uawdijnntqw1x1x1
IP : 216.73.216.168
Hostname : server.fattispazio.it
Kernel : Linux server.fattispazio.it 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
poliximo
/
public_html
/
4690b
/
..
/
.
/
da45a
/
htm.zip
/
/
PK���\��,###modules/mod_search/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_search * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Including fallback code for the placeholder attribute in the search field. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); if ($width) { $moduleclass_sfx .= ' ' . 'mod_search' . $module->id; $css = 'div.mod_search' . $module->id . ' input[type="search"]{ width:auto; }'; JFactory::getDocument()->addStyleDeclaration($css); $width = ' size="' . $width . '"'; } else { $width = ''; } ?> <div class="search<?php echo $moduleclass_sfx ?>"> <form action="<?php echo JRoute::_('index.php');?>" method="post" class="form-inline"> <?php $output = '<label for="mod-search-searchword" class="element-invisible">' . $label . '</label> '; $output .= '<input name="searchword" id="mod-search-searchword" maxlength="' . $maxlength . '" class="inputbox search-query" type="search"' . $width; $output .= ' placeholder="' . $text . '" />'; if ($button) : if ($imagebutton) : $btn_output = ' <input type="image" alt="' . $button_text . '" class="button" src="' . $img . '" onclick="this.form.searchword.focus();"/>'; else : $btn_output = ' <button class="button btn btn-primary" onclick="this.form.searchword.focus();">' . $button_text . '</button>'; endif; switch ($button_pos) : case 'top' : $output = $btn_output . '<br />' . $output; break; case 'bottom' : $output .= '<br />' . $btn_output; break; case 'right' : $output .= $btn_output; break; case 'left' : default : $output = $btn_output . $output; break; endswitch; endif; echo $output; ?> <input type="hidden" name="task" value="search" /> <input type="hidden" name="option" value="com_search" /> <input type="hidden" name="Itemid" value="<?php echo $mitemid; ?>" /> </form> </div> PK���\�zZ*��modules/mod_search/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_search * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_search * * @package Joomla.Site * @subpackage mod_search * @since 1.5 */ class ModSearchHelper { /** * Display the search button as an image. * * @param string $button_text The alt text for the button. * * @return string The HTML for the image. * * @since 1.5 */ public static function getSearchImage($button_text) { $img = JHtml::_('image', 'searchButton.gif', $button_text, null, true, true); return $img; } } PK���\꠸��!modules/mod_search/mod_search.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_search</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_SEARCH_XML_DESCRIPTION</description> <files> <filename module="mod_search">mod_search.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_search.ini</language> <language tag="en-GB">en-GB.mod_search.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_SEARCH" /> <config> <fields name="params"> <fieldset name="basic"> <field name="label" type="label" label="MOD_SEARCH_FIELD_LABEL_TEXT_LABEL" description="MOD_SEARCH_FIELD_LABEL_TEXT_DESC" /> <field name="width" type="text" label="MOD_SEARCH_FIELD_BOXWIDTH_LABEL" description="MOD_SEARCH_FIELD_BOXWIDTH_DESC" /> <field name="text" type="text" label="MOD_SEARCH_FIELD_TEXT_LABEL" description="MOD_SEARCH_FIELD_TEXT_DESC" /> <field name="button" type="radio" default="0" class="btn-group btn-group-yesno" label="MOD_SEARCH_FIELD_BUTTON_LABEL" description="MOD_SEARCH_FIELD_BUTTON_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="button_pos" type="list" default="left" label="MOD_SEARCH_FIELD_BUTTONPOS_LABEL" description="MOD_SEARCH_FIELD_BUTTONPOS_DESC"> <option value="right">MOD_SEARCH_FIELD_VALUE_RIGHT</option> <option value="left">MOD_SEARCH_FIELD_VALUE_LEFT</option> <option value="top">MOD_SEARCH_FIELD_VALUE_TOP</option> <option value="bottom">MOD_SEARCH_FIELD_VALUE_BOTTOM</option> </field> <field name="imagebutton" type="radio" default="0" class="btn-group btn-group-yesno" label="MOD_SEARCH_FIELD_IMAGEBUTTON_LABEL" description="MOD_SEARCH_FIELD_IMAGEBUTTON_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="button_text" type="text" label="MOD_SEARCH_FIELD_BUTTONTEXT_LABEL" description="MOD_SEARCH_FIELD_BUTTONTEXT_DESC" /> <field name="opensearch" type="radio" class="btn-group btn-group-yesno" label="MOD_SEARCH_FIELD_OPENSEARCH_LABEL" description="MOD_SEARCH_FIELD_OPENSEARCH_DESC" default="1"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="opensearch_title" type="text" label="MOD_SEARCH_FIELD_OPENSEARCH_TEXT_LABEL" description="MOD_SEARCH_FIELD_OPENSEARCH_TEXT_DESC" /> <field name="set_itemid" type="menuitem" default="0" label="MOD_SEARCH_FIELD_SETITEMID_LABEL" description="MOD_SEARCH_FIELD_SETITEMID_DESC"> <option value="0">MOD_SEARCH_SELECT_MENU_ITEMID</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="itemid"> <option value="itemid"></option> </field> </fieldset> </fields> </config> </extension> PK���\h�n�00!modules/mod_search/mod_search.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_search * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $lang = JFactory::getLanguage(); $app = JFactory::getApplication(); if ($params->get('opensearch', 1)) { $doc = JFactory::getDocument(); $ostitle = $params->get('opensearch_title', JText::_('MOD_SEARCH_SEARCHBUTTON_TEXT') . ' ' . $app->get('sitename')); $doc->addHeadLink( JUri::getInstance()->toString(array('scheme', 'host', 'port')) . JRoute::_('&option=com_search&format=opensearch'), 'search', 'rel', array( 'title' => htmlspecialchars($ostitle), 'type' => 'application/opensearchdescription+xml' ) ); } $upper_limit = $lang->getUpperLimitSearchWord(); $button = $params->get('button', 0); $imagebutton = $params->get('imagebutton', 0); $button_pos = $params->get('button_pos', 'left'); $button_text = htmlspecialchars($params->get('button_text', JText::_('MOD_SEARCH_SEARCHBUTTON_TEXT'))); $width = (int) $params->get('width'); $maxlength = $upper_limit; $text = htmlspecialchars($params->get('text', JText::_('MOD_SEARCH_SEARCHBOX_TEXT'))); $label = htmlspecialchars($params->get('label', JText::_('MOD_SEARCH_LABEL_TEXT'))); $set_Itemid = (int) $params->get('set_itemid', 0); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); if ($imagebutton) { $img = ModSearchHelper::getSearchImage($button_text); } $mitemid = $set_Itemid > 0 ? $set_Itemid : $app->input->get('Itemid'); require JModuleHelper::getLayoutPath('mod_search', $params->get('layout', 'default')); PK���\�) ���$modules/mod_wrapper/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_wrapper * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::script('com_wrapper/iframe-height.min.js', false, true); ?> <iframe <?php echo $load; ?> id="blockrandom" name="<?php echo $target; ?>" src="<?php echo $url; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" scrolling="<?php echo $scroll; ?>" frameborder="<?php echo $frameborder; ?>" class="wrapper<?php echo $moduleclass_sfx; ?>" > <?php echo JText::_('MOD_WRAPPER_NO_IFRAMES'); ?> </iframe> PK���\����modules/mod_wrapper/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_wrapper * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_wrapper * * @package Joomla.Site * @subpackage mod_wrapper * @since 1.5 */ class ModWrapperHelper { /** * Gets the parameters for the wrapper * * @param mixed &$params The parameters set in the administrator section * * @return mixed ¶ms The modified parameters * * @since 1.5 */ public static function getParams(&$params) { $params->def('url', ''); $params->def('scrolling', 'auto'); $params->def('height', '200'); $params->def('height_auto', '0'); $params->def('width', '100%'); $params->def('add', '1'); $params->def('name', 'wrapper'); $url = $params->get('url'); if ($params->get('add')) { // Adds 'http://' if none is set if (substr($url, 0, 1) == '/') { // Relative url in component. use server http_host. $url = 'http://' . $_SERVER['HTTP_HOST'] . $url; } elseif (!strstr($url, 'http') && !strstr($url, 'https')) { $url = 'http://' . $url; } } // Auto height control if ($params->def('height_auto')) { $load = 'onload="iFrameHeight()"'; } else { $load = ''; } $params->set('load', $load); $params->set('url', $url); return $params; } } PK���\�����#modules/mod_wrapper/mod_wrapper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_wrapper * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $params = ModWrapperHelper::getParams($params); $load = $params->get('load'); $url = htmlspecialchars($params->get('url')); $target = htmlspecialchars($params->get('target')); $width = htmlspecialchars($params->get('width')); $height = htmlspecialchars($params->get('height')); $scroll = htmlspecialchars($params->get('scrolling')); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $frameborder = htmlspecialchars($params->get('frameborder')); require JModuleHelper::getLayoutPath('mod_wrapper', $params->get('layout', 'default')); PK���\��#modules/mod_wrapper/mod_wrapper.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_wrapper</name> <author>Joomla! Project</author> <creationDate>October 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_WRAPPER_XML_DESCRIPTION</description> <files> <filename module="mod_wrapper">mod_wrapper.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_wrapper.ini</language> <language tag="en-GB">en-GB.mod_wrapper.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_WRAPPER" /> <config> <fields name="params"> <fieldset name="basic"> <field name="url" type="text" size="30" label="MOD_WRAPPER_FIELD_URL_LABEL" description="MOD_WRAPPER_FIELD_URL_DESC" required="true" /> <field name="add" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_WRAPPER_FIELD_ADD_LABEL" description="MOD_WRAPPER_FIELD_ADD_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="scrolling" type="list" default="auto" label="MOD_WRAPPER_FIELD_SCROLL_LABEL" description="MOD_WRAPPER_FIELD_SCROLL_DESC"> <option value="auto">MOD_WRAPPER_FIELD_VALUE_AUTO</option> <option value="no">JNO</option> <option value="yes">JYES</option> </field> <field name="width" type="text" size="5" default="100%" label="MOD_WRAPPER_FIELD_WIDTH_LABEL" description="MOD_WRAPPER_FIELD_WIDTH_DESC" /> <field name="height" type="text" size="5" default="200" label="MOD_WRAPPER_FIELD_HEIGHT_LABEL" description="MOD_WRAPPER_FIELD_HEIGHT_DESC" /> <field name="height_auto" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_WRAPPER_FIELD_AUTOHEIGHT_LABEL" description="MOD_WRAPPER_FIELD_AUTOHEIGHT_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="frameborder" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_WRAPPER_FIELD_FRAME_LABEL" description="MOD_WRAPPER_FIELD_FRAME_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="target" type="text" size="30" label="MOD_WRAPPER_FIELD_TARGET_LABEL" description="MOD_WRAPPER_FIELD_TARGET_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static"> <option value="static"></option> </field> </fieldset> </fields> </config> </extension> PK���\�K�K� � 'modules/mod_syndicate/mod_syndicate.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_syndicate</name> <author>Joomla! Project</author> <creationDate>May 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_SYNDICATE_XML_DESCRIPTION</description> <files> <filename module="mod_syndicate">mod_syndicate.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_syndicate.ini</language> <language tag="en-GB">en-GB.mod_syndicate.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_SYNDICATION_FEEDS" /> <config> <fields name="params"> <fieldset name="basic"> <field name="display_text" type="radio" default="1" class="btn-group btn-group-yesno" label="MOD_SYNDICATE_FIELD_DISPLAYTEXT_LABEL" description="MOD_SYNDICATE_FIELD_DISPLAYTEXT_DESC" filter="integer"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="text" type="text" label="MOD_SYNDICATE_FIELD_TEXT_LABEL" description="MOD_SYNDICATE_FIELD_TEXT_DESC" /> <field name="format" type="list" default="rss" label="MOD_SYNDICATE_FIELD_FORMAT_LABEL" description="MOD_SYNDICATE_FIELD_FORMAT_DESC"> <option value="rss">MOD_SYNDICATE_FIELD_VALUE_RSS</option> <option value="atom">MOD_SYNDICATE_FIELD_VALUE_ATOM</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\��ͽ��'modules/mod_syndicate/mod_syndicate.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_syndicate * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $params->def('format', 'rss'); $link = ModSyndicateHelper::getLink($params); if (is_null($link)) { return; } $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $text = htmlspecialchars($params->get('text')); require JModuleHelper::getLayoutPath('mod_syndicate', $params->get('layout', 'default')); PK���\H���&modules/mod_syndicate/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_syndicate * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <a href="<?php echo $link ?>" class="syndicate-module<?php echo $moduleclass_sfx ?>"> <?php echo JHtml::_('image', 'system/livemarks.png', 'feed-image', null, true); ?> <?php if ($params->get('display_text', 1)) : ?> <span> <?php if (str_replace(' ', '', $text) != '') : ?> <?php echo $text; ?> <?php else : ?> <?php echo JText::_('MOD_SYNDICATE_DEFAULT_FEED_ENTRIES'); ?> <?php endif; ?> </span> <?php endif; ?> </a> PK���\0X$mm modules/mod_syndicate/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_syndicate * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_syndicate * * @package Joomla.Site * @subpackage mod_syndicate * @since 1.5 */ class ModSyndicateHelper { /** * Gets the link * * @param \Joomla\Registry\Registry &$params module parameters * * @return array The link as a string * * @since 1.5 */ public static function getLink(&$params) { $document = JFactory::getDocument(); foreach ($document->_links as $link => $value) { $value = JArrayHelper::toString($value); if (strpos($value, 'application/' . $params->get('format') . '+xml')) { return $link; } } } } PK���\�aA��'modules/mod_whosonline/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_whosonline * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php if ($showmode == 0 || $showmode == 2) : ?> <?php $guest = JText::plural('MOD_WHOSONLINE_GUESTS', $count['guest']); ?> <?php $member = JText::plural('MOD_WHOSONLINE_MEMBERS', $count['user']); ?> <p><?php echo JText::sprintf('MOD_WHOSONLINE_WE_HAVE', $guest, $member); ?></p> <?php endif; ?> <?php if (($showmode > 0) && count($names)) : ?> <ul class="whosonline<?php echo $moduleclass_sfx ?>" > <?php if ($params->get('filter_groups')):?> <p><?php echo JText::_('MOD_WHOSONLINE_SAME_GROUP_MESSAGE'); ?></p> <?php endif;?> <?php foreach ($names as $name) : ?> <li> <?php echo $name->username; ?> </li> <?php endforeach; ?> </ul> <?php endif; PK���\7���� � !modules/mod_whosonline/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_whosonline * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_whosonline * * @since 1.5 */ class ModWhosonlineHelper { /** * Show online count * * @return array The number of Users and Guests online. * * @since 1.5 **/ public static function getOnlineCount() { $db = JFactory::getDbo(); // Calculate number of guests and users $result = array(); $user_array = 0; $guest_array = 0; $query = $db->getQuery(true) ->select('guest, client_id') ->from('#__session') ->where('client_id = 0'); $db->setQuery($query); try { $sessions = (array) $db->loadObjectList(); } catch (RuntimeException $e) { // Don't worry be happy $sessions = array(); } if (count($sessions)) { foreach ($sessions as $session) { // If guest increase guest count by 1 if ($session->guest == 1) { $guest_array ++; } // If member increase member count by 1 if ($session->guest == 0) { $user_array ++; } } } $result['user'] = $user_array; $result['guest'] = $guest_array; return $result; } /** * Show online member names * * @param mixed $params The parameters * * @return array (array) $db->loadObjectList() The names of the online users. * * @since 1.5 **/ public static function getOnlineUserNames($params) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName(array('a.username', 'a.userid', 'a.client_id'))) ->from('#__session AS a') ->where($db->quoteName('a.userid') . ' != 0') ->where($db->quoteName('a.client_id') . ' = 0') ->group($db->quoteName(array('a.username', 'a.userid', 'a.client_id'))); $user = JFactory::getUser(); if (!$user->authorise('core.admin') && $params->get('filter_groups', 0) == 1) { $groups = $user->getAuthorisedGroups(); if (empty($groups)) { return array(); } $query->join('LEFT', '#__user_usergroup_map AS m ON m.user_id = a.userid') ->join('LEFT', '#__usergroups AS ug ON ug.id = m.group_id') ->where('ug.id in (' . implode(',', $groups) . ')') ->where('ug.id <> 1'); } $db->setQuery($query); try { return (array) $db->loadObjectList(); } catch (RuntimeException $e) { return array(); } } } PK���\(�" " )modules/mod_whosonline/mod_whosonline.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_whosonline</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_WHOSONLINE_XML_DESCRIPTION</description> <files> <filename module="mod_whosonline">mod_whosonline.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_whosonline.ini</language> <language tag="en-GB">en-GB.mod_whosonline.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_WHO_ONLINE" /> <config> <fields name="params"> <fieldset name="basic"> <field name="showmode" type="list" default="0" label="MOD_WHOSONLINE_SHOWMODE_LABEL" description="MOD_WHOSONLINE_SHOWMODE_DESC"> <option value="0">MOD_WHOSONLINE_FIELD_VALUE_NUMBER</option> <option value="1">MOD_WHOSONLINE_FIELD_VALUE_NAMES</option> <option value="2">MOD_WHOSONLINE_FIELD_VALUE_BOTH</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="filter_groups" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_WHOSONLINE_FIELD_FILTER_GROUPS_LABEL" description="MOD_WHOSONLINE_FIELD_FILTER_GROUPS_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> </fields> </config> </extension> PK���\����)modules/mod_whosonline/mod_whosonline.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_whosonline * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the whosonline functions only once require_once __DIR__ . '/helper.php'; $showmode = $params->get('showmode', 0); if ($showmode == 0 || $showmode == 2) { $count = ModWhosonlineHelper::getOnlineCount(); } if ($showmode > 0) { $names = ModWhosonlineHelper::getOnlineUserNames($params); } $linknames = $params->get('linknames', 0); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_whosonline', $params->get('layout', 'default')); PK���\�>O���/modules/mod_articles_news/mod_articles_news.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_articles_news</name> <author>Joomla! Project</author> <creationDate>July 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_ARTICLES_NEWS_XML_DESCRIPTION</description> <files> <filename module="mod_articles_news">mod_articles_news.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_articles_news.ini</language> <language tag="en-GB">en-GB.mod_articles_news.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_NEWSFLASH" /> <config> <fields name="params"> <fieldset name="basic"> <field name="catid" type="category" extension="com_content" multiple="true" default="" size="10" label="JCATEGORY" description="MOD_ARTICLES_NEWS_FIELD_CATEGORY_DESC" > <option value="">JOPTION_ALL_CATEGORIES</option> </field> <field name="image" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_ARTICLES_NEWS_FIELD_IMAGES_LABEL" description="MOD_ARTICLES_NEWS_FIELD_IMAGES_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="item_title" class="btn-group btn-group-yesno" type="radio" default="0" label="MOD_ARTICLES_NEWS_FIELD_TITLE_LABEL" description="MOD_ARTICLES_NEWS_FIELD_TITLE_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="link_titles" type="list" class="chzn-color" label="MOD_ARTICLES_NEWS_FIELD_LINKTITLE_LABEL" description="MOD_ARTICLES_NEWS_FIELD_LINKTITLE_DESC" > <option value="">JGLOBAL_USE_GLOBAL</option> <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="item_heading" type="list" default="h4" label="MOD_ARTICLES_NEWS_TITLE_HEADING" description="MOD_ARTICLES_NEWS_TITLE_HEADING_DESCRIPTION" > <option value="h1">JH1</option> <option value="h2">JH2</option> <option value="h3">JH3</option> <option value="h4">JH4</option> <option value="h5">JH5</option> </field> <field name="showLastSeparator" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_ARTICLES_NEWS_FIELD_SEPARATOR_LABEL" description="MOD_ARTICLES_NEWS_FIELD_SEPARATOR_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="readmore" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_ARTICLES_NEWS_FIELD_READMORE_LABEL" description="MOD_ARTICLES_NEWS_FIELD_READMORE_DESC" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="count" type="text" default="5" label="MOD_ARTICLES_NEWS_FIELD_ITEMS_LABEL" description="MOD_ARTICLES_NEWS_FIELD_ITEMS_DESC" /> <field name="ordering" type="list" default="a.publish_up" label="MOD_ARTICLES_NEWS_FIELD_ORDERING_LABEL" description="MOD_ARTICLES_NEWS_FIELD_ORDERING_DESC" > <option value="a.publish_up">MOD_ARTICLES_NEWS_FIELD_ORDERING_PUBLISHED_DATE</option> <option value="a.created">MOD_ARTICLES_NEWS_FIELD_ORDERING_CREATED_DATE</option> <option value="a.ordering">MOD_ARTICLES_NEWS_FIELD_ORDERING_ORDERING</option> <option value="a.hits">JGLOBAL_HITS</option> <option value="rand()">MOD_ARTICLES_NEWS_FIELD_ORDERING_RANDOM</option> </field> <field name="direction" type="list" default="1" label="JGLOBAL_ORDER_DIRECTION_LABEL" description="JGLOBAL_ORDER_DIRECTION_DESC" > <option value="0">JGLOBAL_ORDER_ASCENDING</option> <option value="1">JGLOBAL_ORDER_DESCENDING</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC" > <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="itemid" > <option value="itemid"></option> </field> </fieldset> </fields> </config> </extension> PK���\o�)]��-modules/mod_articles_news/tmpl/horizontal.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_news * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <ul class="newsflash-horiz<?php echo $params->get('moduleclass_sfx'); ?>"> <?php for ($i = 0, $n = count($list); $i < $n; $i ++) : ?> <?php $item = $list[$i]; ?> <li> <?php require JModuleHelper::getLayoutPath('mod_articles_news', '_item'); ?> <?php if ($n > 1 && (($i < $n - 1) || $params->get('showLastSeparator'))) : ?> <span class="article-separator"> </span> <?php endif; ?> </li> <?php endfor; ?> </ul> PK���\�\.���+modules/mod_articles_news/tmpl/vertical.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_news * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <ul class="newsflash-vert<?php echo $params->get('moduleclass_sfx'); ?>"> <?php for ($i = 0, $n = count($list); $i < $n; $i ++) : ?> <?php $item = $list[$i]; ?> <li class="newsflash-item"> <?php require JModuleHelper::getLayoutPath('mod_articles_news', '_item'); ?> <?php if ($n > 1 && (($i < $n - 1) || $params->get('showLastSeparator'))) : ?> <span class="article-separator"> </span> <?php endif; ?> </li> <?php endfor; ?> </ul> PK���\��1���*modules/mod_articles_news/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_news * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="newsflash<?php echo $moduleclass_sfx; ?>"> <?php foreach ($list as $item) : ?> <?php require JModuleHelper::getLayoutPath('mod_articles_news', '_item'); ?> <?php endforeach; ?> </div> PK���\�nVV(modules/mod_articles_news/tmpl/_item.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_news * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $item_heading = $params->get('item_heading', 'h4'); ?> <?php if ($params->get('item_title')) : ?> <<?php echo $item_heading; ?> class="newsflash-title<?php echo $params->get('moduleclass_sfx'); ?>"> <?php if ($params->get('link_titles') && $item->link != '') : ?> <a href="<?php echo $item->link; ?>"> <?php echo $item->title; ?> </a> <?php else : ?> <?php echo $item->title; ?> <?php endif; ?> </<?php echo $item_heading; ?>> <?php endif; ?> <?php if (!$params->get('intro_only')) : ?> <?php echo $item->afterDisplayTitle; ?> <?php endif; ?> <?php echo $item->beforeDisplayContent; ?> <?php echo $item->introtext; ?> <?php if (isset($item->link) && $item->readmore != 0 && $params->get('readmore')) : ?> <?php echo '<a class="readmore" href="' . $item->link . '">' . $item->linkText . '</a>'; ?> <?php endif; ?> PK���\�9[���$modules/mod_articles_news/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_news * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE . '/components/com_content/helpers/route.php'; JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); /** * Helper for mod_articles_news * * @package Joomla.Site * @subpackage mod_articles_news * * @since 1.6 */ abstract class ModArticlesNewsHelper { /** * Get a list of the latest articles from the article model * * @param \Joomla\Registry\Registry &$params object holding the models parameters * * @return mixed * * @since 1.6 */ public static function getList(&$params) { $app = JFactory::getApplication(); // Get an instance of the generic articles model $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $appParams = JFactory::getApplication()->getParams(); $model->setState('params', $appParams); // Set the filters based on the module params $model->setState('list.start', 0); $model->setState('list.limit', (int) $params->get('count', 5)); $model->setState('filter.published', 1); $model->setState('list.select', 'a.fulltext, a.id, a.title, a.alias, a.introtext, a.state, a.catid, a.created, a.created_by, a.created_by_alias,' . ' a.modified, a.modified_by, a.publish_up, a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access,' . ' a.hits, a.featured, a.language'); // Access filter $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')); $model->setState('filter.access', $access); // Category filter $model->setState('filter.category_id', $params->get('catid', array())); // Filter by language $model->setState('filter.language', $app->getLanguageFilter()); // Set ordering $ordering = $params->get('ordering', 'a.publish_up'); $model->setState('list.ordering', $ordering); if (trim($ordering) == 'rand()') { $model->setState('list.direction', ''); } else { $direction = $params->get('direction', 1) ? 'DESC' : 'ASC'; $model->setState('list.direction', $direction); } // Retrieve Content $items = $model->getItems(); foreach ($items as &$item) { $item->readmore = strlen(trim($item->fulltext)); $item->slug = $item->id . ':' . $item->alias; $item->catslug = $item->catid . ':' . $item->category_alias; if ($access || in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); $item->linkText = JText::_('MOD_ARTICLES_NEWS_READMORE'); } else { $item->link = new JUri(JRoute::_('index.php?option=com_users&view=login', false)); $item->link->setVar('return', base64_encode(JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language), false))); $item->linkText = JText::_('MOD_ARTICLES_NEWS_READMORE_REGISTER'); } $item->introtext = JHtml::_('content.prepare', $item->introtext, '', 'mod_articles_news.content'); // New if (!$params->get('image')) { $item->introtext = preg_replace('/<img[^>]*>/', '', $item->introtext); } $results = $app->triggerEvent('onContentAfterDisplay', array('com_content.article', &$item, &$params, 1)); $item->afterDisplayTitle = trim(implode("\n", $results)); $results = $app->triggerEvent('onContentBeforeDisplay', array('com_content.article', &$item, &$params, 1)); $item->beforeDisplayContent = trim(implode("\n", $results)); } return $items; } } PK���\��`�KK/modules/mod_articles_news/mod_articles_news.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_news * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $list = ModArticlesNewsHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_articles_news', $params->get('layout', 'horizontal')); PK���\�w>��0modules/mod_articles_categories/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_categories * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <ul class="categories-module<?php echo $moduleclass_sfx; ?>"> <?php require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default') . '_items'); ?> </ul> PK���\�v��6modules/mod_articles_categories/tmpl/default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_categories * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; foreach ($list as $item) : ?> <li <?php if ($_SERVER['REQUEST_URI'] == JRoute::_(ContentHelperRoute::getCategoryRoute($item->id))) echo ' class="active"';?>> <?php $levelup = $item->level - $startLevel - 1; ?> <h<?php echo $params->get('item_heading') + $levelup; ?>> <a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id)); ?>"> <?php echo $item->title;?> <?php if ($params->get('numitems')) : ?> (<?php echo $item->numitems; ?>) <?php endif; ?> </a> </h<?php echo $params->get('item_heading') + $levelup; ?>> <?php if ($params->get('show_description', 0)) : ?> <?php echo JHtml::_('content.prepare', $item->description, $item->getParams(), 'mod_articles_categories.content'); ?> <?php endif; ?> <?php if ($params->get('show_children', 0) && (($params->get('maxlevel', 0) == 0) || ($params->get('maxlevel') >= ($item->level - $startLevel))) && count($item->getChildren())) : ?> <?php echo '<ul>'; ?> <?php $temp = $list; ?> <?php $list = $item->getChildren(); ?> <?php require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default') . '_items'); ?> <?php $list = $temp; ?> <?php echo '</ul>'; ?> <?php endif; ?> </li> <?php endforeach; ?> PK���\�س'';modules/mod_articles_categories/mod_articles_categories.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_categories * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the helper functions only once require_once __DIR__ . '/helper.php'; JLoader::register('JCategoryNode', JPATH_BASE . '/libraries/legacy/categories/categories.php'); $cacheid = md5($module->id); $cacheparams = new stdClass; $cacheparams->cachemode = 'id'; $cacheparams->class = 'ModArticlesCategoriesHelper'; $cacheparams->method = 'getList'; $cacheparams->methodparams = $params; $cacheparams->modeparams = $cacheid; $list = JModuleHelper::moduleCache($module, $params, $cacheparams); if (!empty($list)) { $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $startLevel = reset($list)->getParent()->level; require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default')); } PK���\�-W��*modules/mod_articles_categories/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_categories * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE . '/components/com_content/helpers/route.php'; /** * Helper for mod_articles_categories * * @package Joomla.Site * @subpackage mod_articles_categories * * @since 1.5 */ abstract class ModArticlesCategoriesHelper { /** * Get list of articles * * @param \Joomla\Registry\Registry &$params module parameters * * @return array * * @since 1.5 */ public static function getList(&$params) { $options = array(); $options['countItems'] = $params->get('numitems', 0); $categories = JCategories::getInstance('Content', $options); $category = $categories->get($params->get('parent', 'root')); if ($category != null) { $items = $category->getChildren(); if ($params->get('count', 0) > 0 && count($items) > $params->get('count', 0)) { $items = array_slice($items, 0, $params->get('count', 0)); } return $items; } } } PK���\f]��uu;modules/mod_articles_categories/mod_articles_categories.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_articles_categories</name> <author>Joomla! Project</author> <creationDate>February 2010</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_ARTICLES_CATEGORIES_XML_DESCRIPTION</description> <files> <filename module="mod_articles_categories">mod_articles_categories.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_articles_categories.ini</language> <language tag="en-GB">en-GB.mod_articles_categories.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_CATEGORIES" /> <config> <fields name="params"> <fieldset name="basic"> <field name="parent" type="category" extension="com_content" published="" label="MOD_ARTICLES_CATEGORIES_FIELD_PARENT_LABEL" description="MOD_ARTICLES_CATEGORIES_FIELD_PARENT_DESC"/> <field name="show_description" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_ARTICLES_CATEGORIES_FIELD_SHOW_DESCRIPTION_LABEL" description="MOD_ARTICLES_CATEGORIES_FIELD_SHOW_DESCRIPTION_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="numitems" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_ARTICLES_CATEGORIES_FIELD_NUMITEMS_LABEL" description="MOD_ARTICLES_CATEGORIES_FIELD_NUMITEMS_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="show_children" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_ARTICLES_CATEGORIES_FIELD_SHOW_CHILDREN_LABEL" description="MOD_ARTICLES_CATEGORIES_FIELD_SHOW_CHILDREN_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="count" type="list" label="MOD_ARTICLES_CATEGORIES_FIELD_COUNT_LABEL" description="MOD_ARTICLES_CATEGORIES_FIELD_COUNT_DESC" default="0" > <option value="0">JALL</option> <option value="1">J1</option> <option value="2">J2</option> <option value="3">J3</option> <option value="4">J4</option> <option value="5">J5</option> <option value="6">J6</option> <option value="7">J7</option> <option value="8">J8</option> <option value="9">J9</option> <option value="10">J10</option> </field> <field name="maxlevel" type="list" label="MOD_ARTICLES_CATEGORIES_FIELD_MAXLEVEL_LABEL" description="MOD_ARTICLES_CATEGORIES_FIELD_MAXLEVEL_DESC" default="0" > <option value="0">JALL</option> <option value="1">J1</option> <option value="2">J2</option> <option value="3">J3</option> <option value="4">J4</option> <option value="5">J5</option> <option value="6">J6</option> <option value="7">J7</option> <option value="8">J8</option> <option value="9">J9</option> <option value="10">J10</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="item_heading" type="list" default="4" label="MOD_ARTICLES_CATEGORIES_TITLE_HEADING_LABEL" description="MOD_ARTICLES_CATEGORIES_TITLE_HEADING_DESC" > <option value="1">JH1</option> <option value="2">JH2</option> <option value="3">JH3</option> <option value="4">JH4</option> <option value="5">JH5</option> </field> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="owncache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC" > <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\F�t�NN3modules/mod_articles_latest/mod_articles_latest.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_latest * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $list = ModArticlesLatestHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_articles_latest', $params->get('layout', 'default')); PK���\���MM,modules/mod_articles_latest/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_latest * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <ul class="latestnews<?php echo $moduleclass_sfx; ?>"> <?php foreach ($list as $item) : ?> <li itemscope itemtype="http://schema.org/Article"> <a href="<?php echo $item->link; ?>" itemprop="url"> <span itemprop="name"> <?php echo $item->title; ?> </span> </a> </li> <?php endforeach; ?> </ul> PK���\[�?� � &modules/mod_articles_latest/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_latest * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE . '/components/com_content/helpers/route.php'; JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); /** * Helper for mod_articles_latest * * @package Joomla.Site * @subpackage mod_articles_latest * @since 1.6 */ abstract class ModArticlesLatestHelper { /** * Retrieve a list of article * * @param \Joomla\Registry\Registry &$params module parameters * * @return mixed * * @since 1.6 */ public static function getList(&$params) { // Get the dbo $db = JFactory::getDbo(); // Get an instance of the generic articles model $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = JFactory::getApplication(); $appParams = $app->getParams(); $model->setState('params', $appParams); // Set the filters based on the module params $model->setState('list.start', 0); $model->setState('list.limit', (int) $params->get('count', 5)); $model->setState('filter.published', 1); // Access filter $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')); $model->setState('filter.access', $access); // Category filter $model->setState('filter.category_id', $params->get('catid', array())); // User filter $userId = JFactory::getUser()->get('id'); switch ($params->get('user_id')) { case 'by_me' : $model->setState('filter.author_id', (int) $userId); break; case 'not_me' : $model->setState('filter.author_id', $userId); $model->setState('filter.author_id.include', false); break; case '0' : break; default: $model->setState('filter.author_id', (int) $params->get('user_id')); break; } // Filter by language $model->setState('filter.language', $app->getLanguageFilter()); // Featured switch switch ($params->get('show_featured')) { case '1' : $model->setState('filter.featured', 'only'); break; case '0' : $model->setState('filter.featured', 'hide'); break; default : $model->setState('filter.featured', 'show'); break; } // Set ordering $order_map = array( 'm_dsc' => 'a.modified DESC, a.created', 'mc_dsc' => 'CASE WHEN (a.modified = ' . $db->quote($db->getNullDate()) . ') THEN a.created ELSE a.modified END', 'c_dsc' => 'a.created', 'p_dsc' => 'a.publish_up', 'random' => 'RAND()', ); $ordering = JArrayHelper::getValue($order_map, $params->get('ordering'), 'a.publish_up'); $dir = 'DESC'; $model->setState('list.ordering', $ordering); $model->setState('list.direction', $dir); $items = $model->getItems(); foreach ($items as &$item) { $item->slug = $item->id . ':' . $item->alias; $item->catslug = $item->catid . ':' . $item->category_alias; if ($access || in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); } else { $item->link = JRoute::_('index.php?option=com_users&view=login'); } } return $items; } } PK���\s��b��3modules/mod_articles_latest/mod_articles_latest.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_articles_latest</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_LATEST_NEWS_XML_DESCRIPTION</description> <files> <filename module="mod_articles_latest">mod_articles_latest.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_articles_latest.ini</language> <language tag="en-GB">en-GB.mod_articles_latest.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_LATEST_NEWS" /> <config> <fields name="params"> <fieldset name="basic"> <field name="catid" type="category" extension="com_content" multiple="true" size="10" default="" label="JCATEGORY" description="MOD_LATEST_NEWS_FIELD_CATEGORY_DESC" > <option value="">JOPTION_ALL_CATEGORIES</option> </field> <field name="count" type="text" default="5" label="MOD_LATEST_NEWS_FIELD_COUNT_LABEL" description="MOD_LATEST_NEWS_FIELD_COUNT_DESC" /> <field name="show_featured" type="list" default="" label="MOD_LATEST_NEWS_FIELD_FEATURED_LABEL" description="MOD_LATEST_NEWS_FIELD_FEATURED_DESC" > <option value="">JSHOW</option> <option value="0">JHIDE</option> <option value="1">MOD_LATEST_NEWS_VALUE_ONLY_SHOW_FEATURED</option> </field> <field name="ordering" type="list" default="published" label="MOD_LATEST_NEWS_FIELD_ORDERING_LABEL" description="MOD_LATEST_NEWS_FIELD_ORDERING_DESC" > <option value="c_dsc">MOD_LATEST_NEWS_VALUE_RECENT_ADDED</option> <option value="m_dsc">MOD_LATEST_NEWS_VALUE_RECENT_MODIFIED</option> <option value="p_dsc">MOD_LATEST_NEWS_VALUE_RECENT_PUBLISHED</option> <option value="mc_dsc">MOD_LATEST_NEWS_VALUE_RECENT_TOUCHED</option> <option value="random">MOD_LATEST_NEWS_VALUE_RECENT_RAND</option> </field> <field name="user_id" type="list" default="0" label="MOD_LATEST_NEWS_FIELD_USER_LABEL" description="MOD_LATEST_NEWS_FIELD_USER_DESC" > <option value="0">MOD_LATEST_NEWS_VALUE_ANYONE</option> <option value="by_me">MOD_LATEST_NEWS_VALUE_ADDED_BY_ME</option> <option value="not_me">MOD_LATEST_NEWS_VALUE_NOTADDED_BY_ME</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC" > <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static" > <option value="static"></option> </field> </fieldset> </fields> </config> </extension> PK���\�W����modules/mod_menu/mod_menu.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $list = ModMenuHelper::getList($params); $base = ModMenuHelper::getBase($params); $active = ModMenuHelper::getActive($params); $active_id = $active->id; $path = $base->tree; $showAll = $params->get('showAllChildren'); $class_sfx = htmlspecialchars($params->get('class_sfx')); if (count($list)) { require JModuleHelper::getLayoutPath('mod_menu', $params->get('layout', 'default')); } PK���\�%,�modules/mod_menu/mod_menu.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_menu</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_MENU_XML_DESCRIPTION</description> <files> <filename module="mod_menu">mod_menu.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_menu.ini</language> <language tag="en-GB">en-GB.mod_menu.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_MENU" /> <config> <fields name="params"> <fieldset name="basic"> <field name="menutype" type="menu" label="MOD_MENU_FIELD_MENUTYPE_LABEL" description="MOD_MENU_FIELD_MENUTYPE_DESC" /> <field name="base" type="menuitem" label="MOD_MENU_FIELD_ACTIVE_LABEL" description="MOD_MENU_FIELD_ACTIVE_DESC" > <option value="">JCURRENT</option> </field> <field name="startLevel" type="list" default="1" label="MOD_MENU_FIELD_STARTLEVEL_LABEL" description="MOD_MENU_FIELD_STARTLEVEL_DESC" > <option value="1">J1</option> <option value="2">J2</option> <option value="3">J3</option> <option value="4">J4</option> <option value="5">J5</option> <option value="6">J6</option> <option value="7">J7</option> <option value="8">J8</option> <option value="9">J9</option> <option value="10">J10</option> </field> <field name="endLevel" type="list" default="0" label="MOD_MENU_FIELD_ENDLEVEL_LABEL" description="MOD_MENU_FIELD_ENDLEVEL_DESC" > <option value="0">JALL</option> <option value="1">J1</option> <option value="2">J2</option> <option value="3">J3</option> <option value="4">J4</option> <option value="5">J5</option> <option value="6">J6</option> <option value="7">J7</option> <option value="8">J8</option> <option value="9">J9</option> <option value="10">J10</option> </field> <field name="showAllChildren" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_MENU_FIELD_ALLCHILDREN_LABEL" description="MOD_MENU_FIELD_ALLCHILDREN_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> <fieldset name="advanced"> <field name="tag_id" type="text" label="MOD_MENU_FIELD_TAG_ID_LABEL" description="MOD_MENU_FIELD_TAG_ID_DESC" /> <field name="class_sfx" type="text" label="MOD_MENU_FIELD_CLASS_LABEL" description="MOD_MENU_FIELD_CLASS_DESC" /> <field name="window_open" type="text" label="MOD_MENU_FIELD_TARGET_LABEL" description="MOD_MENU_FIELD_TARGET_DESC" /> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="itemid"> <option value="itemid"></option> </field> </fieldset> </fields> </config> </extension> PK���\���--+modules/mod_menu/tmpl/default_separator.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Note. It is important to remove spaces between elements. $title = $item->anchor_title ? ' title="' . $item->anchor_title . '" ' : ''; if ($item->menu_image) { $item->params->get('menu_text', 1) ? $linktype = '<img src="' . $item->menu_image . '" alt="' . $item->title . '" /><span class="image-title">' . $item->title . '</span> ' : $linktype = '<img src="' . $item->menu_image . '" alt="' . $item->title . '" />'; } else { $linktype = $item->title; } ?> <span class="separator"<?php echo $title; ?>> <?php echo $linktype; ?> </span> PK���\�7�A)modules/mod_menu/tmpl/default_heading.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $title = $item->anchor_title ? 'title="' . $item->anchor_title . '" ' : ''; if ($item->menu_image) { $item->params->get('menu_text', 1) ? $linktype = '<img src="' . $item->menu_image . '" alt="' . $item->title . '" /><span class="image-title">' . $item->title . '</span> ' : $linktype = '<img src="' . $item->menu_image . '" alt="' . $item->title . '" />'; } else { $linktype = $item->title; } ?> <span class="nav-header <?php echo $item->anchor_css; ?>" <?php echo $title; ?>><?php echo $linktype; ?></span> PK���\��,*��!modules/mod_menu/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Note. It is important to remove spaces between elements. ?> <?php // The menu class is deprecated. Use nav instead. ?> <ul class="nav menu<?php echo $class_sfx;?>"<?php $tag = ''; if ($params->get('tag_id') != null) { $tag = $params->get('tag_id') . ''; echo ' id="' . $tag . '"'; } ?>> <?php foreach ($list as $i => &$item) { $class = 'item-' . $item->id; if (($item->id == $active_id) OR ($item->type == 'alias' AND $item->params->get('aliasoptions') == $active_id)) { $class .= ' current'; } if (in_array($item->id, $path)) { $class .= ' active'; } elseif ($item->type == 'alias') { $aliasToId = $item->params->get('aliasoptions'); if (count($path) > 0 && $aliasToId == $path[count($path) - 1]) { $class .= ' active'; } elseif (in_array($aliasToId, $path)) { $class .= ' alias-parent-active'; } } if ($item->type == 'separator') { $class .= ' divider'; } if ($item->deeper) { $class .= ' deeper'; } if ($item->parent) { $class .= ' parent'; } if (!empty($class)) { $class = ' class="' . trim($class) . '"'; } echo '<li' . $class . '>'; // Render the menu item. switch ($item->type) : case 'separator': case 'url': case 'component': case 'heading': require JModuleHelper::getLayoutPath('mod_menu', 'default_' . $item->type); break; default: require JModuleHelper::getLayoutPath('mod_menu', 'default_url'); break; endswitch; // The next item is deeper. if ($item->deeper) { echo '<ul class="nav-child unstyled small">'; } elseif ($item->shallower) { // The next item is shallower. echo '</li>'; echo str_repeat('</ul></li>', $item->level_diff); } else { // The next item is on the same level. echo '</li>'; } } ?></ul> PK���\����+modules/mod_menu/tmpl/default_component.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Note. It is important to remove spaces between elements. $class = $item->anchor_css ? 'class="' . $item->anchor_css . '" ' : ''; $title = $item->anchor_title ? 'title="' . $item->anchor_title . '" ' : ''; if ($item->menu_image) { $item->params->get('menu_text', 1) ? $linktype = '<img src="' . $item->menu_image . '" alt="' . $item->title . '" /><span class="image-title">' . $item->title . '</span> ' : $linktype = '<img src="' . $item->menu_image . '" alt="' . $item->title . '" />'; } else { $linktype = $item->title; } switch ($item->browserNav) { default: case 0: ?><a <?php echo $class; ?>href="<?php echo $item->flink; ?>" <?php echo $title; ?>><?php echo $linktype; ?></a><?php break; case 1: // _blank ?><a <?php echo $class; ?>href="<?php echo $item->flink; ?>" target="_blank" <?php echo $title; ?>><?php echo $linktype; ?></a><?php break; case 2: // Use JavaScript "window.open" ?><a <?php echo $class; ?>href="<?php echo $item->flink; ?>" onclick="window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');return false;" <?php echo $title; ?>><?php echo $linktype; ?></a> <?php break; } PK���\���99%modules/mod_menu/tmpl/default_url.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Note. It is important to remove spaces between elements. $class = $item->anchor_css ? 'class="' . $item->anchor_css . '" ' : ''; $title = $item->anchor_title ? 'title="' . $item->anchor_title . '" ' : ''; if ($item->menu_image) { $item->params->get('menu_text', 1) ? $linktype = '<img src="' . $item->menu_image . '" alt="' . $item->title . '" /><span class="image-title">' . $item->title . '</span> ' : $linktype = '<img src="' . $item->menu_image . '" alt="' . $item->title . '" />'; } else { $linktype = $item->title; } $flink = $item->flink; $flink = JFilterOutput::ampReplace(htmlspecialchars($flink)); switch ($item->browserNav) : default: case 0: ?><a <?php echo $class; ?>href="<?php echo $flink; ?>" <?php echo $title; ?>><?php echo $linktype; ?></a><?php break; case 1: // _blank ?><a <?php echo $class; ?>href="<?php echo $flink; ?>" target="_blank" <?php echo $title; ?>><?php echo $linktype; ?></a><?php break; case 2: // Use JavaScript "window.open" $options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open'); ?><a <?php echo $class; ?>href="<?php echo $flink; ?>" onclick="window.open(this.href,'targetWindow','<?php echo $options;?>');return false;" <?php echo $title; ?>><?php echo $linktype; ?></a><?php break; endswitch; PK���\���y99modules/mod_menu/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_menu * * @package Joomla.Site * @subpackage mod_menu * @since 1.5 */ class ModMenuHelper { /** * Get a list of the menu items. * * @param \Joomla\Registry\Registry &$params The module options. * * @return array * * @since 1.5 */ public static function getList(&$params) { $app = JFactory::getApplication(); $menu = $app->getMenu(); // Get active menu item $base = self::getBase($params); $user = JFactory::getUser(); $levels = $user->getAuthorisedViewLevels(); asort($levels); $key = 'menu_items' . $params . implode(',', $levels) . '.' . $base->id; $cache = JFactory::getCache('mod_menu', ''); if (!($items = $cache->get($key))) { $path = $base->tree; $start = (int) $params->get('startLevel'); $end = (int) $params->get('endLevel'); $showAll = $params->get('showAllChildren'); $items = $menu->getItems('menutype', $params->get('menutype')); $lastitem = 0; if ($items) { foreach ($items as $i => $item) { if (($start && $start > $item->level) || ($end && $item->level > $end) || (!$showAll && $item->level > 1 && !in_array($item->parent_id, $path)) || ($start > 1 && !in_array($item->tree[$start - 2], $path))) { unset($items[$i]); continue; } $item->deeper = false; $item->shallower = false; $item->level_diff = 0; if (isset($items[$lastitem])) { $items[$lastitem]->deeper = ($item->level > $items[$lastitem]->level); $items[$lastitem]->shallower = ($item->level < $items[$lastitem]->level); $items[$lastitem]->level_diff = ($items[$lastitem]->level - $item->level); } $item->parent = (boolean) $menu->getItems('parent_id', (int) $item->id, true); $lastitem = $i; $item->active = false; $item->flink = $item->link; // Reverted back for CMS version 2.5.6 switch ($item->type) { case 'separator': case 'heading': // No further action needed. continue; case 'url': if ((strpos($item->link, 'index.php?') === 0) && (strpos($item->link, 'Itemid=') === false)) { // If this is an internal Joomla link, ensure the Itemid is set. $item->flink = $item->link . '&Itemid=' . $item->id; } break; case 'alias': $item->flink = 'index.php?Itemid=' . $item->params->get('aliasoptions'); break; default: $item->flink = 'index.php?Itemid=' . $item->id; break; } if (strcasecmp(substr($item->flink, 0, 4), 'http') && (strpos($item->flink, 'index.php?') !== false)) { $item->flink = JRoute::_($item->flink, true, $item->params->get('secure')); } else { $item->flink = JRoute::_($item->flink); } // We prevent the double encoding because for some reason the $item is shared for menu modules and we get double encoding // when the cause of that is found the argument should be removed $item->title = htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8', false); $item->anchor_css = htmlspecialchars($item->params->get('menu-anchor_css', ''), ENT_COMPAT, 'UTF-8', false); $item->anchor_title = htmlspecialchars($item->params->get('menu-anchor_title', ''), ENT_COMPAT, 'UTF-8', false); $item->menu_image = $item->params->get('menu_image', '') ? htmlspecialchars($item->params->get('menu_image', ''), ENT_COMPAT, 'UTF-8', false) : ''; } if (isset($items[$lastitem])) { $items[$lastitem]->deeper = (($start?$start:1) > $items[$lastitem]->level); $items[$lastitem]->shallower = (($start?$start:1) < $items[$lastitem]->level); $items[$lastitem]->level_diff = ($items[$lastitem]->level - ($start?$start:1)); } } $cache->store($items, $key); } return $items; } /** * Get base menu item. * * @param \Joomla\Registry\Registry &$params The module options. * * @return object * * @since 3.0.2 */ public static function getBase(&$params) { // Get base menu item from parameters if ($params->get('base')) { $base = JFactory::getApplication()->getMenu()->getItem($params->get('base')); } else { $base = false; } // Use active menu item if no base found if (!$base) { $base = self::getActive($params); } return $base; } /** * Get active menu item. * * @param \Joomla\Registry\Registry &$params The module options. * * @return object * * @since 3.0.2 */ public static function getActive(&$params) { $menu = JFactory::getApplication()->getMenu(); $lang = JFactory::getLanguage(); // Look for the home menu if (JLanguageMultilang::isEnabled()) { $home = $menu->getDefault($lang->getTag()); } else { $home = $menu->getDefault(); } return $menu->getActive() ? $menu->getActive() : $home; } } PK���\�]���!modules/mod_finder/mod_finder.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_finder * * @copyright Copyright (C) 2005 - 2015 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('FinderHelperRoute', JPATH_SITE . '/components/com_finder/helpers/route.php'); JLoader::register('FinderHelperLanguage', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/language.php'); // Include the helper. require_once __DIR__ . '/helper.php'; if (!defined('FINDER_PATH_INDEXER')) { define('FINDER_PATH_INDEXER', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer'); } JLoader::register('FinderIndexerQuery', FINDER_PATH_INDEXER . '/query.php'); // Check for OpenSearch if ($params->get('opensearch', 1)) { /* This code intentionally commented $doc = JFactory::getDocument(); $app = JFactory::getApplication(); $ostitle = $params->get('opensearch_title', JText::_('MOD_FINDER_SEARCHBUTTON_TEXT') . ' ' . $app->get('sitename')); $doc->addHeadLink( JUri::getInstance()->toString(array('scheme', 'host', 'port')) . JRoute::_('&option=com_finder&format=opensearch'), 'search', 'rel', array('title' => $ostitle, 'type' => 'application/opensearchdescription+xml') ); */ } // Initialize module parameters. $params->def('field_size', 20); // Get the route. $route = FinderHelperRoute::getSearchRoute($params->get('searchfilter', null)); // Load component language file. FinderHelperLanguage::loadComponentLanguage(); // Load plug-in language files. FinderHelperLanguage::loadPluginLanguage(); // Get Smart Search query object. $query = modFinderHelper::getQuery($params); require JModuleHelper::getLayoutPath('mod_finder', $params->get('layout', 'default')); PK���\C� ��#modules/mod_finder/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_finder * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_SITE . '/components/com_finder/helpers/html'); JHtml::_('jquery.framework'); JHtml::_('bootstrap.tooltip'); // Load the smart search component language file. $lang = JFactory::getLanguage(); $lang->load('com_finder', JPATH_SITE); $suffix = $params->get('moduleclass_sfx'); $output = '<input type="text" name="q" id="mod-finder-searchword" class="search-query input-medium" size="' . $params->get('field_size', 20) . '" value="' . htmlspecialchars(JFactory::getApplication()->input->get('q', '', 'string')) . '" />'; if ($params->get('show_label', 1)) { $label = '<label for="mod-finder-searchword" class="finder' . $suffix . '">' . $params->get('alt_label', JText::_('JSEARCH_FILTER_SUBMIT')) . '</label>'; switch ($params->get('label_pos', 'left')) { case 'top' : $output = $label . '<br />' . $output; break; case 'bottom' : $output .= '<br />' . $label; break; case 'right' : $output .= $label; break; case 'left' : default : $output = $label . $output; break; } } if ($params->get('show_button')) { $button = '<button class="btn btn-primary hasTooltip ' . $suffix . ' finder' . $suffix . '" type="submit" title="' . JText::_('MOD_FINDER_SEARCH_BUTTON') . '"><span class="icon-search icon-white"></span></button>'; switch ($params->get('button_pos', 'left')) { case 'top' : $output = $button . '<br />' . $output; break; case 'bottom' : $output .= '<br />' . $button; break; case 'right' : $output .= $button; break; case 'left' : default : $output = $button . $output; break; } } JHtml::stylesheet('com_finder/finder.css', false, true, false); $script = " jQuery(document).ready(function() { var value, searchword = jQuery('#mod-finder-searchword'); // Set the input value if not already set. if (!searchword.val()) { searchword.val('" . JText::_('MOD_FINDER_SEARCH_VALUE', true) . "'); } // Get the current value. value = searchword.val(); // If the current value equals the default value, clear it. searchword.on('focus', function() { var el = jQuery(this); if (el.val() === '" . JText::_('MOD_FINDER_SEARCH_VALUE', true) . "') { el.val(''); } }); // If the current value is empty, set the previous value. searchword.on('blur', function() { var el = jQuery(this); if (!el.val()) { el.val(value); } }); jQuery('#mod-finder-searchform').on('submit', function(e){ e.stopPropagation(); var advanced = jQuery('#mod-finder-advanced'); // Disable select boxes with no value selected. if ( advanced.length) { advanced.find('select').each(function(index, el) { var el = jQuery(el); if(!el.val()){ el.attr('disabled', 'disabled'); } }); } });"; /* * This segment of code sets up the autocompleter. */ if ($params->get('show_autosuggest', 1)) { JHtml::_('script', 'media/jui/js/jquery.autocomplete.min.js', false, false, false, false, true); $script .= " var suggest = jQuery('#mod-finder-searchword').autocomplete({ serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component', false) . "', paramName: 'q', minChars: 1, maxHeight: 400, width: 300, zIndex: 9999, deferRequestBy: 500 });"; } $script .= "});"; JFactory::getDocument()->addScriptDeclaration($script); ?> <form id="mod-finder-searchform" action="<?php echo JRoute::_($route); ?>" method="get" class="form-search"> <div class="finder<?php echo $suffix; ?>"> <?php // Show the form fields. echo $output; ?> <?php $show_advanced = $params->get('show_advanced'); ?> <?php if ($show_advanced == 2) : ?> <br /> <a href="<?php echo JRoute::_($route); ?>"><?php echo JText::_('COM_FINDER_ADVANCED_SEARCH'); ?></a> <?php elseif ($show_advanced == 1) : ?> <div id="mod-finder-advanced"> <?php echo JHtml::_('filter.select', $query, $params); ?> </div> <?php endif; ?> <?php echo modFinderHelper::getGetFields($route, (int) $params->get('set_itemid')); ?> </div> </form> PK���\:Z�Fd d modules/mod_finder/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_finder * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Finder module helper. * * @package Joomla.Site * @subpackage mod_finder * @since 2.5 */ class ModFinderHelper { /** * Method to get hidden input fields for a get form so that control variables * are not lost upon form submission. * * @param string $route The route to the page. [optional] * @param integer $paramItem The menu item ID. (@since 3.1) [optional] * * @return string A string of hidden input form fields * * @since 2.5 */ public static function getGetFields($route = null, $paramItem = 0) { // Determine if there is an item id before routing. $needId = !JUri::getInstance($route)->getVar('Itemid'); $fields = array(); $uri = JUri::getInstance(JRoute::_($route)); $uri->delVar('q'); // Create hidden input elements for each part of the URI. foreach ($uri->getQuery(true) as $n => $v) { $fields[] = '<input type="hidden" name="' . $n . '" value="' . $v . '" />'; } // Add a field for Itemid if we need one. if ($needId) { $id = JFactory::getApplication()->input->get('Itemid', '0', 'int'); $fields[] = '<input type="hidden" name="Itemid" value="' . $id . '" />'; } return implode('', $fields); } /** * Get Smart Search query object. * * @param \Joomla\Registry\Registry $params Module parameters. * * @return FinderIndexerQuery object * * @since 2.5 */ public static function getQuery($params) { $app = JFactory::getApplication(); $input = $app->input; $request = $input->request; $filter = JFilterInput::getInstance(); // Get the static taxonomy filters. $options = array(); $options['filter'] = ($request->get('f', 0, 'int') != 0) ? $request->get('f', '', 'int') : $params->get('searchfilter'); $options['filter'] = $filter->clean($options['filter'], 'int'); // Get the dynamic taxonomy filters. $options['filters'] = $request->get('t', '', 'array'); $options['filters'] = $filter->clean($options['filters'], 'array'); JArrayHelper::toInteger($options['filters']); // Instantiate a query object. $query = new FinderIndexerQuery($options); return $query; } } PK���\?�@@!modules/mod_finder/mod_finder.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_finder</name> <author>Joomla! Project</author> <creationDate>August 2011</creationDate> <copyright>(C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_FINDER_XML_DESCRIPTION</description> <files> <filename module="mod_finder">mod_finder.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">language/en-GB/en-GB.mod_finder.ini</language> <language tag="en-GB">language/en-GB/en-GB.mod_finder.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_SMART_SEARCH" /> <config> <fields name="params" addfieldpath="/administrator/components/com_finder/models/fields"> <fieldset name="basic"> <field name="searchfilter" type="searchfilter" default="" label="MOD_FINDER_FIELDSET_BASIC_SEARCHFILTER_LABEL" description="MOD_FINDER_FIELDSET_BASIC_SEARCHFILTER_DESCRIPTION" /> <field name="show_autosuggest" type="radio" default="1" class="btn-group btn-group-yesno" label="MOD_FINDER_FIELDSET_BASIC_AUTOSUGGEST_LABEL" description="MOD_FINDER_FIELDSET_BASIC_AUTOSUGGEST_DESCRIPTION"> <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="show_advanced" type="list" default="0" label="MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_LABEL" description="MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_DESCRIPTION"> <option value="2">MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_OPTION_LINK</option> <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="field_size" type="text" default="25" filter="integer" label="MOD_FINDER_FIELDSET_ADVANCED_FIELD_SIZE_LABEL" description="MOD_FINDER_FIELDSET_ADVANCED_FIELD_SIZE_DESCRIPTION" /> <field name="show_label" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_FINDER_FIELDSET_ADVANCED_SHOW_LABEL_LABEL" description="MOD_FINDER_FIELDSET_ADVANCED_SHOW_LABEL_DESCRIPTION"> <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="label_pos" type="list" default="left" label="MOD_FINDER_FIELDSET_ADVANCED_LABEL_POS_LABEL" description="MOD_FINDER_FIELDSET_ADVANCED_LABEL_POS_DESCRIPTION"> <option value="right">JGLOBAL_RIGHT</option> <option value="left">JGLOBAL_LEFT</option> <option value="top">MOD_FINDER_CONFIG_OPTION_TOP</option> <option value="bottom">MOD_FINDER_CONFIG_OPTION_BOTTOM</option> </field> <field name="alt_label" type="text" label="MOD_FINDER_FIELDSET_ADVANCED_ALT_LABEL" description="MOD_FINDER_FIELDSET_ADVANCED_ALT_DESCRIPTION" /> <field name="show_button" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_FINDER_FIELDSET_ADVANCED_SHOW_BUTTON_LABEL" description="MOD_FINDER_FIELDSET_ADVANCED_SHOW_BUTTON_DESCRIPTION"> <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="button_pos" type="list" default="left" label="MOD_FINDER_FIELDSET_ADVANCED_BUTTON_POS_LABEL" description="MOD_FINDER_FIELDSET_ADVANCED_BUTTON_POS_DESCRIPTION"> <option value="right">JGLOBAL_RIGHT</option> <option value="left">JGLOBAL_LEFT</option> <option value="top">MOD_FINDER_CONFIG_OPTION_TOP</option> <option value="bottom">MOD_FINDER_CONFIG_OPTION_BOTTOM</option> </field> <field name="opensearch" type="radio" class="btn-group btn-group-yesno" label="MOD_FINDER_FIELD_OPENSEARCH_LABEL" description="MOD_FINDER_FIELD_OPENSEARCH_DESCRIPTION" default="1"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="opensearch_title" type="text" label="MOD_FINDER_FIELD_OPENSEARCH_TEXT_LABEL" description="MOD_FINDER_FIELD_OPENSEARCH_TEXT_DESCRIPTION" /> <field name="set_itemid" type="menuitem" default="0" label="MOD_FINDER_FIELDSET_ADVANCED_SETITEMID_LABEL" description="MOD_FINDER_FIELDSET_ADVANCED_SETITEMID_DESCRIPTION"> <option value="0">MOD_FINDER_SELECT_MENU_ITEMID</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" default="" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> </fieldset> </fields> </config> </extension> PK���\�V�modules/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\讎�]]#modules/mod_banners/mod_banners.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_banners</name> <author>Joomla! Project</author> <creationDate>July 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_BANNERS_XML_DESCRIPTION</description> <files> <filename module="mod_banners">mod_banners.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_banners.ini</language> <language tag="en-GB">en-GB.mod_banners.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_BANNERS" /> <config> <fields name="params"> <fieldset name="basic" addfieldpath="/administrator/components/com_banners/models/fields"> <field name="target" type="list" default="1" label="MOD_BANNERS_FIELD_TARGET_LABEL" description="MOD_BANNERS_FIELD_TARGET_DESC"> <option value="0">JBROWSERTARGET_PARENT</option> <option value="1">JBROWSERTARGET_NEW</option> <option value="2">JBROWSERTARGET_POPUP</option> </field> <field name="count" type="text" default="5" class="validate-numeric" filter="integer" label="MOD_BANNERS_FIELD_COUNT_LABEL" description="MOD_BANNERS_FIELD_COUNT_DESC" /> <field name="cid" type="bannerclient" label="MOD_BANNERS_FIELD_BANNERCLIENT_LABEL" description="MOD_BANNERS_FIELD_BANNERCLIENT_DESC" /> <field name="catid" type="category" extension="com_banners" label="JCATEGORY" multiple="true" size="5" default="" description="MOD_BANNERS_FIELD_CATEGORY_DESC" > <option value="">JOPTION_ALL_CATEGORIES</option> </field> <field name="tag_search" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_BANNERS_FIELD_TAG_LABEL" description="MOD_BANNERS_FIELD_TAG_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="ordering" type="list" default="0" label="MOD_BANNERS_FIELD_RANDOMISE_LABEL" description="MOD_BANNERS_FIELD_RANDOMISE_DESC"> <option value="0">MOD_BANNERS_VALUE_STICKYORDERING</option> <option value="random">MOD_BANNERS_VALUE_STICKYRANDOMISE</option> </field> <field name="header_text" type="textarea" filter="safehtml" rows="3" cols="40" label="MOD_BANNERS_FIELD_HEADER_LABEL" description="MOD_BANNERS_FIELD_HEADER_DESC" /> <field name="footer_text" type="textarea" filter="safehtml" rows="3" cols="40" label="MOD_BANNERS_FIELD_FOOTER_LABEL" description="MOD_BANNERS_FIELD_FOOTER_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\!��enn$modules/mod_banners/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_banners * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_ROOT . '/components/com_banners/helpers/banner.php'; $baseurl = JUri::base(); ?> <div class="bannergroup<?php echo $moduleclass_sfx ?>"> <?php if ($headerText) : ?> <?php echo $headerText; ?> <?php endif; ?> <?php foreach ($list as $item) : ?> <div class="banneritem"> <?php $link = JRoute::_('index.php?option=com_banners&task=click&id=' . $item->id);?> <?php if ($item->type == 1) :?> <?php // Text based banners ?> <?php echo str_replace(array('{CLICKURL}', '{NAME}'), array($link, $item->name), $item->custombannercode);?> <?php else:?> <?php $imageurl = $item->params->get('imageurl');?> <?php $width = $item->params->get('width');?> <?php $height = $item->params->get('height');?> <?php if (BannerHelper::isImage($imageurl)) :?> <?php // Image based banner ?> <?php $alt = $item->params->get('alt');?> <?php $alt = $alt ? $alt : $item->name; ?> <?php $alt = $alt ? $alt : JText::_('MOD_BANNERS_BANNER'); ?> <?php if ($item->clickurl) :?> <?php // Wrap the banner in a link?> <?php $target = $params->get('target', 1);?> <?php if ($target == 1) :?> <?php // Open in a new window?> <a href="<?php echo $link; ?>" target="_blank" title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8');?>"> <img src="<?php echo $baseurl . $imageurl;?>" alt="<?php echo $alt;?>" <?php if (!empty($width)) echo 'width ="' . $width . '"';?> <?php if (!empty($height)) echo 'height ="' . $height . '"';?> /> </a> <?php elseif ($target == 2):?> <?php // Open in a popup window?> <a href="<?php echo $link;?>" onclick="window.open(this.href, '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false" title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8');?>"> <img src="<?php echo $baseurl . $imageurl;?>" alt="<?php echo $alt;?>" <?php if (!empty($width)) echo 'width ="' . $width . '"';?> <?php if (!empty($height)) echo 'height ="' . $height . '"';?> /> </a> <?php else :?> <?php // Open in parent window?> <a href="<?php echo $link;?>" title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8');?>"> <img src="<?php echo $baseurl . $imageurl;?>" alt="<?php echo $alt;?>" <?php if (!empty($width)) echo 'width ="' . $width . '"';?> <?php if (!empty($height)) echo 'height ="' . $height . '"';?> /> </a> <?php endif;?> <?php else :?> <?php // Just display the image if no link specified?> <img src="<?php echo $baseurl . $imageurl;?>" alt="<?php echo $alt;?>" <?php if (!empty($width)) echo 'width ="' . $width . '"';?> <?php if (!empty($height)) echo 'height ="' . $height . '"';?> /> <?php endif;?> <?php elseif (BannerHelper::isFlash($imageurl)) :?> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" <?php if (!empty($width)) echo 'width ="' . $width . '"';?> <?php if (!empty($height)) echo 'height ="' . $height . '"';?> > <param name="movie" value="<?php echo $imageurl;?>" /> <embed src="<?php echo $imageurl;?>" loop="false" pluginspage="http://www.macromedia.com/go/get/flashplayer" type="application/x-shockwave-flash" <?php if (!empty($width)) echo 'width ="' . $width . '"';?> <?php if (!empty($height)) echo 'height ="' . $height . '"';?> /> </object> <?php endif;?> <?php endif;?> <div class="clr"></div> </div> <?php endforeach; ?> <?php if ($footerText) : ?> <div class="bannerfooter"> <?php echo $footerText; ?> </div> <?php endif; ?> </div> PK���\K�i��modules/mod_banners/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_banners * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_banners * * @package Joomla.Site * @subpackage mod_banners * @since 1.5 */ class ModBannersHelper { /** * Retrieve list of banners * * @param \Joomla\Registry\Registry &$params module parameters * * @return mixed */ public static function &getList(&$params) { JModelLegacy::addIncludePath(JPATH_ROOT . '/components/com_banners/models', 'BannersModel'); $document = JFactory::getDocument(); $app = JFactory::getApplication(); $keywords = explode(',', $document->getMetaData('keywords')); $model = JModelLegacy::getInstance('Banners', 'BannersModel', array('ignore_request' => true)); $model->setState('filter.client_id', (int) $params->get('cid')); $model->setState('filter.category_id', $params->get('catid', array())); $model->setState('list.limit', (int) $params->get('count', 1)); $model->setState('list.start', 0); $model->setState('filter.ordering', $params->get('ordering')); $model->setState('filter.tag_search', $params->get('tag_search')); $model->setState('filter.keywords', $keywords); $model->setState('filter.language', $app->getLanguageFilter()); $banners = $model->getItems(); $model->impress(); return $banners; } } PK���\��/#modules/mod_banners/mod_banners.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_banners * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $headerText = trim($params->get('header_text')); $footerText = trim($params->get('footer_text')); require_once JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'; BannersHelper::updateReset(); $list = &ModBannersHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_banners', $params->get('layout', 'default')); PK���\�k���&modules/mod_languages/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_languages * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('stylesheet', 'mod_languages/template.css', array(), true); ?> <div class="mod-languages<?php echo $moduleclass_sfx ?>"> <?php if ($headerText) : ?> <div class="pretext"><p><?php echo $headerText; ?></p></div> <?php endif; ?> <?php if ($params->get('dropdown', 1)) : ?> <form name="lang" method="post" action="<?php echo htmlspecialchars(JUri::current()); ?>"> <select class="inputbox" onchange="document.location.replace(this.value);" > <?php foreach ($list as $language) : ?> <option dir=<?php echo JLanguage::getInstance($language->lang_code)->isRtl() ? '"rtl"' : '"ltr"'?> value="<?php echo $language->link;?>" <?php echo $language->active ? 'selected="selected"' : ''?>> <?php echo $language->title_native;?></option> <?php endforeach; ?> </select> </form> <?php else : ?> <ul class="<?php echo $params->get('inline', 1) ? 'lang-inline' : 'lang-block';?>"> <?php foreach ($list as $language) : ?> <?php if ($params->get('show_active', 0) || !$language->active):?> <li class="<?php echo $language->active ? 'lang-active' : '';?>" dir="<?php echo JLanguage::getInstance($language->lang_code)->isRtl() ? 'rtl' : 'ltr' ?>"> <a href="<?php echo $language->link;?>"> <?php if ($params->get('image', 1)):?> <?php echo JHtml::_('image', 'mod_languages/' . $language->image . '.gif', $language->title_native, array('title' => $language->title_native), true);?> <?php else : ?> <?php echo $params->get('full_name', 1) ? $language->title_native : strtoupper($language->sef);?> <?php endif; ?> </a> </li> <?php endif;?> <?php endforeach;?> </ul> <?php endif; ?> <?php if ($footerText) : ?> <div class="posttext"><p><?php echo $footerText; ?></p></div> <?php endif; ?> </div> PK���\${��>> modules/mod_languages/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_languages * * @copyright Copyright (C) 2005 - 2015 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('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); JLoader::register('MultilangstatusHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/multilangstatus.php'); /** * Helper for mod_languages * * @package Joomla.Site * @subpackage mod_languages * * @since 1.6.0 */ abstract class ModLanguagesHelper { /** * Gets a list of available languages * * @param \Joomla\Registry\Registry &$params module params * * @return array */ public static function getList(&$params) { $user = JFactory::getUser(); $lang = JFactory::getLanguage(); $languages = JLanguageHelper::getLanguages(); $app = JFactory::getApplication(); $menu = $app->getMenu(); // Get menu home items $homes = array(); $homes['*'] = $menu->getDefault('*'); foreach ($languages as $item) { $default = $menu->getDefault($item->lang_code); if ($default && $default->language == $item->lang_code) { $homes[$item->lang_code] = $default; } } // Load associations $assoc = JLanguageAssociations::isEnabled(); if ($assoc) { $active = $menu->getActive(); if ($active) { $associations = MenusHelper::getAssociations($active->id); } // Load component associations $class = str_replace('com_', '', $app->input->get('option')) . 'HelperAssociation'; JLoader::register($class, JPATH_COMPONENT_SITE . '/helpers/association.php'); if (class_exists($class) && is_callable(array($class, 'getAssociations'))) { $cassociations = call_user_func(array($class, 'getAssociations')); } } $levels = $user->getAuthorisedViewLevels(); // Filter allowed languages foreach ($languages as $i => &$language) { // Do not display language without frontend UI if (!array_key_exists($language->lang_code, MultilangstatusHelper::getSitelangs())) { unset($languages[$i]); } // Do not display language without specific home menu elseif (!isset($homes[$language->lang_code])) { unset($languages[$i]); } // Do not display language without authorized access level elseif (isset($language->access) && $language->access && !in_array($language->access, $levels)) { unset($languages[$i]); } else { $language->active = ($language->lang_code == $lang->getTag()); if (JLanguageMultilang::isEnabled()) { if (isset($cassociations[$language->lang_code])) { $language->link = JRoute::_($cassociations[$language->lang_code] . '&lang=' . $language->sef); } elseif (isset($associations[$language->lang_code]) && $menu->getItem($associations[$language->lang_code])) { $itemid = $associations[$language->lang_code]; $language->link = JRoute::_('index.php?lang=' . $language->sef . '&Itemid=' . $itemid); } else { if ($language->active) { $language->link = JUri::getInstance()->toString(array('scheme', 'host', 'port', 'path', 'query')); } else { $itemid = isset($homes[$language->lang_code]) ? $homes[$language->lang_code]->id : $homes['*']->id; $language->link = JRoute::_('index.php?lang=' . $language->sef . '&Itemid=' . $itemid); } } } else { $language->link = JRoute::_('&Itemid=' . $homes['*']->id); } } } return $languages; } } PK���\x�17��'modules/mod_languages/mod_languages.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_languages * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $headerText = JString::trim($params->get('header_text')); $footerText = JString::trim($params->get('footer_text')); $list = ModLanguagesHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_languages', $params->get('layout', 'default')); PK���\�Â1��'modules/mod_languages/mod_languages.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_languages</name> <author>Joomla! Project</author> <creationDate>February 2010</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_LANGUAGES_XML_DESCRIPTION</description> <files> <filename module="mod_languages">mod_languages.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_languages.ini</language> <language tag="en-GB">en-GB.mod_languages.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_LANGUAGE_SWITCHER" /> <config> <fieldset> <field name="language" type="list" description="JFIELD_MODULE_LANGUAGE_DESC" label="JFIELD_LANGUAGE_LABEL"> <option value="*">JALL</option> </field> </fieldset> <fields name="params"> <fieldset name="basic"> <field name="header_text" type="textarea" filter="safehtml" rows="3" cols="40" label="MOD_LANGUAGES_FIELD_HEADER_LABEL" description="MOD_LANGUAGES_FIELD_HEADER_DESC" /> <field name="footer_text" type="textarea" filter="safehtml" rows="3" cols="40" label="MOD_LANGUAGES_FIELD_FOOTER_LABEL" description="MOD_LANGUAGES_FIELD_FOOTER_DESC" /> <field name="dropdown" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_LANGUAGES_FIELD_DROPDOWN_LABEL" description="MOD_LANGUAGES_FIELD_DROPDOWN_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="spacer1" type="spacer" class="text" label="MOD_LANGUAGES_SPACERDROP_LABEL" /> <field name="image" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_LANGUAGES_FIELD_USEIMAGE_LABEL" description="MOD_LANGUAGES_FIELD_USEIMAGE_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="inline" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_LANGUAGES_FIELD_INLINE_LABEL" description="MOD_LANGUAGES_FIELD_INLINE_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="show_active" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_LANGUAGES_FIELD_ACTIVE_LABEL" description="MOD_LANGUAGES_FIELD_ACTIVE_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="spacer2" type="spacer" class="text" label="MOD_LANGUAGES_SPACERNAME_LABEL" /> <field name="full_name" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_LANGUAGES_FIELD_FULL_NAME_LABEL" description="MOD_LANGUAGES_FIELD_FULL_NAME_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="MOD_LANGUAGES_FIELD_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="MOD_LANGUAGES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="itemid"> <option value="itemid"></option> </field> </fieldset> </fields> </config> </extension> PK���\8�}�> > 7modules/mod_articles_category/mod_articles_category.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_category * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the helper functions only once require_once __DIR__ . '/helper.php'; $input = JFactory::getApplication()->input; // Prep for Normal or Dynamic Modes $mode = $params->get('mode', 'normal'); $idbase = null; switch ($mode) { case 'dynamic' : $option = $input->get('option'); $view = $input->get('view'); if ($option === 'com_content') { switch ($view) { case 'category' : $idbase = $input->getInt('id'); break; case 'categories' : $idbase = $input->getInt('id'); break; case 'article' : if ($params->get('show_on_article_page', 1)) { $idbase = $input->getInt('catid'); } break; } } break; case 'normal' : default: $idbase = $params->get('catid'); break; } $cacheid = md5(serialize(array ($idbase, $module->module))); $cacheparams = new stdClass; $cacheparams->cachemode = 'id'; $cacheparams->class = 'ModArticlesCategoryHelper'; $cacheparams->method = 'getList'; $cacheparams->methodparams = $params; $cacheparams->modeparams = $cacheid; $list = JModuleHelper::moduleCache($module, $params, $cacheparams); if (!empty($list)) { $grouped = false; $article_grouping = $params->get('article_grouping', 'none'); $article_grouping_direction = $params->get('article_grouping_direction', 'ksort'); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $item_heading = $params->get('item_heading'); if ($article_grouping !== 'none') { $grouped = true; switch ($article_grouping) { case 'year' : case 'month_year' : $list = ModArticlesCategoryHelper::groupByDate($list, $article_grouping, $article_grouping_direction, $params->get('month_year_format', 'F Y')); break; case 'author' : case 'category_title' : $list = ModArticlesCategoryHelper::groupBy($list, $article_grouping, $article_grouping_direction); break; default: break; } } require JModuleHelper::getLayoutPath('mod_articles_category', $params->get('layout', 'default')); } PK���\ժ|[�;�;7modules/mod_articles_category/mod_articles_category.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_articles_category</name> <author>Joomla! Project</author> <creationDate>February 2010</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_ARTICLES_CATEGORY_XML_DESCRIPTION</description> <files> <filename module="mod_articles_category">mod_articles_category.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_articles_category.ini</language> <language tag="en-GB">en-GB.mod_articles_category.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_CATEGORY" /> <config> <fields name="params"> <fieldset name="basic"> <field name="mode" type="list" default="normal" label="MOD_ARTICLES_CATEGORY_FIELD_MODE_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_MODE_DESC" > <option value="normal">MOD_ARTICLES_CATEGORY_OPTION_NORMAL_VALUE</option> <option value="dynamic">MOD_ARTICLES_CATEGORY_OPTION_DYNAMIC_VALUE</option> </field> </fieldset> <fieldset name="dynamic" label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_DYNAMIC_LABEL" > <field name="show_on_article_page" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_ARTICLES_CATEGORY_FIELD_SHOWONARTICLEPAGE_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_SHOWONARTICLEPAGE_DESC" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> </fieldset> <fieldset name="filtering" label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_FILTERING_LABEL" > <field name="count" type="text" default="0" label="MOD_ARTICLES_CATEGORY_FIELD_COUNT_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_COUNT_DESC" /> <field name="show_front" type="list" default="show" label="MOD_ARTICLES_CATEGORY_FIELD_SHOWFEATURED_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_SHOWFEATURED_DESC" > <option value="show">JSHOW</option> <option value="hide">JHIDE</option> <option value="only">MOD_ARTICLES_CATEGORY_OPTION_ONLYFEATURED_VALUE</option> </field> <field name="filteringspacer1" type="spacer" hr="true" /> <field name="category_filtering_type" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_ARTICLES_CATEGORY_FIELD_CATFILTERINGTYPE_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_CATFILTERINGTYPE_DESC" > <option value="1">MOD_ARTICLES_CATEGORY_OPTION_INCLUSIVE_VALUE</option> <option value="0">MOD_ARTICLES_CATEGORY_OPTION_EXCLUSIVE_VALUE</option> </field> <field name="catid" type="category" extension="com_content" multiple="true" size="5" label="JCATEGORY" description="MOD_ARTICLES_CATEGORY_FIELD_CATEGORY_DESC" > <option value="">JOPTION_ALL_CATEGORIES</option> </field> <field name="show_child_category_articles" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_ARTICLES_CATEGORY_FIELD_SHOWCHILDCATEGORYARTICLES_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_SHOWCHILDCATEGORYARTICLES_DESC" > <option value="1">MOD_ARTICLES_CATEGORY_OPTION_INCLUDE_VALUE</option> <option value="0">MOD_ARTICLES_CATEGORY_OPTION_EXCLUDE_VALUE</option> </field> <field name="levels" type="text" default="1" label="MOD_ARTICLES_CATEGORY_FIELD_CATDEPTH_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_CATDEPTH_DESC" /> <field name="filteringspacer2" type="spacer" hr="true" /> <field name="author_filtering_type" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_ARTICLES_CATEGORY_FIELD_AUTHORFILTERING_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_AUTHORFILTERING_DESC" > <option value="1">MOD_ARTICLES_CATEGORY_OPTION_INCLUSIVE_VALUE</option> <option value="0">MOD_ARTICLES_CATEGORY_OPTION_EXCLUSIVE_VALUE</option> </field> <field name="created_by" type="sql" multiple="true" size="5" label="MOD_ARTICLES_CATEGORY_FIELD_AUTHOR_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_AUTHOR_DESC" query="select id, name, username from #__users where id IN (select distinct(created_by) from #__content) order by name ASC" key_field="id" value_field="name" > <option value="">JOPTION_SELECT_AUTHORS</option> </field> <field name="filteringspacer3" type="spacer" hr="true" /> <field name="author_alias_filtering_type" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIASFILTERING_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIASFILTERING_DESC" > <option value="1">MOD_ARTICLES_CATEGORY_OPTION_INCLUSIVE_VALUE</option> <option value="0">MOD_ARTICLES_CATEGORY_OPTION_EXCLUSIVE_VALUE</option> </field> <field name="created_by_alias" type="sql" multiple="true" size="5" label="MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIAS_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIAS_DESC" query="select distinct(created_by_alias) from #__content where created_by_alias != '' order by created_by_alias ASC" key_field="created_by_alias" value_field="created_by_alias" > <option value="">JOPTION_SELECT_AUTHOR_ALIASES</option> </field> <field name="filteringspacer4" type="spacer" hr="true" /> <field name="excluded_articles" type="textarea" cols="10" rows="3" label="MOD_ARTICLES_CATEGORY_FIELD_EXCLUDEDARTICLES_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_EXCLUDEDARTICLES_DESC" /> <field name="filteringspacer5" type="spacer" hr="true" /> <field name="date_filtering" type="list" default="off" label="MOD_ARTICLES_CATEGORY_FIELD_DATEFILTERING_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_DATEFILTERING_DESC" > <option value="off">MOD_ARTICLES_CATEGORY_OPTION_OFF_VALUE</option> <option value="range">MOD_ARTICLES_CATEGORY_OPTION_DATERANGE_VALUE</option> <option value="relative">MOD_ARTICLES_CATEGORY_OPTION_RELATIVEDAY_VALUE</option> </field> <field name="date_field" type="list" default="a.created" label="MOD_ARTICLES_CATEGORY_FIELD_DATERANGEFIELD_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_DATERANGEFIELD_DESC" > <option value="a.created">MOD_ARTICLES_CATEGORY_OPTION_CREATED_VALUE</option> <option value="a.modified">MOD_ARTICLES_CATEGORY_OPTION_MODIFIED_VALUE</option> <option value="a.publish_up">MOD_ARTICLES_CATEGORY_OPTION_STARTPUBLISHING_VALUE</option> </field> <field name="start_date_range" type="calendar" format="%Y-%m-%d %H:%M:%S" label="MOD_ARTICLES_CATEGORY_FIELD_STARTDATE_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_STARTDATE_DESC" size="22" filter="user_utc" /> <field name="end_date_range" type="calendar" format="%Y-%m-%d %H:%M:%S" label="MOD_ARTICLES_CATEGORY_FIELD_ENDDATE_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_ENDDATE_DESC" size="22" filter="user_utc" /> <field name="relative_date" type="text" default="30" label="MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_DESC" /> </fieldset> <fieldset name="ordering" label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_ORDERING_LABEL" > <field name="article_ordering" type="list" default="a.title" label="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERING_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERING_DESC" > <option value="a.ordering">MOD_ARTICLES_CATEGORY_OPTION_ORDERING_VALUE</option> <option value="fp.ordering">MOD_ARTICLES_CATEGORY_OPTION_ORDERINGFEATURED_VALUE</option> <option value="a.hits">MOD_ARTICLES_CATEGORY_OPTION_HITS_VALUE</option> <option value="a.title">JGLOBAL_TITLE</option> <option value="a.id">MOD_ARTICLES_CATEGORY_OPTION_ID_VALUE</option> <option value="a.alias">JFIELD_ALIAS_LABEL</option> <option value="a.created">MOD_ARTICLES_CATEGORY_OPTION_CREATED_VALUE</option> <option value="modified">MOD_ARTICLES_CATEGORY_OPTION_MODIFIED_VALUE</option> <option value="publish_up">MOD_ARTICLES_CATEGORY_OPTION_STARTPUBLISHING_VALUE</option> <option value="a.publish_down">MOD_ARTICLES_CATEGORY_OPTION_FINISHPUBLISHING_VALUE</option> </field> <field name="article_ordering_direction" type="list" default="ASC" label="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERINGDIR_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERINGDIR_DESC" > <option value="DESC">MOD_ARTICLES_CATEGORY_OPTION_DESCENDING_VALUE</option> <option value="ASC">MOD_ARTICLES_CATEGORY_OPTION_ASCENDING_VALUE</option> </field> </fieldset> <fieldset name="grouping" label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_GROUPING_LABEL" > <field name="article_grouping" type="list" default="none" label="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPING_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPING_DESC" > <option value="none">JNONE</option> <option value="year">MOD_ARTICLES_CATEGORY_OPTION_YEAR_VALUE</option> <option value="month_year">MOD_ARTICLES_CATEGORY_OPTION_MONTHYEAR_VALUE</option> <option value="author">JAUTHOR</option> <option value="category_title">JCATEGORY</option> </field> <field name="article_grouping_direction" type="list" default="ksort" label="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPINGDIR_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPINGDIR_DESC" > <option value="krsort">MOD_ARTICLES_CATEGORY_OPTION_DESCENDING_VALUE</option> <option value="ksort">MOD_ARTICLES_CATEGORY_OPTION_ASCENDING_VALUE</option> </field> <field name="month_year_format" type="text" default="F Y" label="MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_DESC" /> </fieldset> <fieldset name="display" label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_DISPLAY_LABEL" > <field name="link_titles" type="radio" default="1" class="btn-group btn-group-yesno" label="MOD_ARTICLES_CATEGORY_FIELD_LINKTITLES_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_LINKTITLES_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="show_date" type="radio" default="0" class="btn-group btn-group-yesno" label="JDATE" description="MOD_ARTICLES_CATEGORY_FIELD_SHOWDATE_DESC" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="show_date_field" type="list" default="created" label="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELD_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELD_DESC" > <option value="created">MOD_ARTICLES_CATEGORY_OPTION_CREATED_VALUE</option> <option value="modified">MOD_ARTICLES_CATEGORY_OPTION_MODIFIED_VALUE</option> <option value="publish_up">MOD_ARTICLES_CATEGORY_OPTION_STARTPUBLISHING_VALUE</option> </field> <field name="show_date_format" type="text" default="Y-m-d H:i:s" label="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_DESC" /> <field name="show_category" type="radio" default="0" class="btn-group btn-group-yesno" label="JCATEGORY" description="MOD_ARTICLES_CATEGORY_FIELD_SHOWCATEGORY_DESC" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="show_hits" type="radio" default="0" class="btn-group btn-group-yesno" label="MOD_ARTICLES_CATEGORY_FIELD_SHOWHITS_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_SHOWHITS_DESC" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="show_author" type="radio" default="0" class="btn-group btn-group-yesno" label="JAUTHOR" description="MOD_ARTICLES_CATEGORY_FIELD_SHOWAUTHOR_DESC" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="show_introtext" type="radio" default="0" class="btn-group btn-group-yesno" label="MOD_ARTICLES_CATEGORY_FIELD_SHOWINTROTEXT_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_SHOWINTROTEXT_DESC" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="introtext_limit" type="text" default="100" label="MOD_ARTICLES_CATEGORY_FIELD_INTROTEXTLIMIT_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_INTROTEXTLIMIT_DESC" /> <field name="show_readmore" label="JGLOBAL_SHOW_READMORE_LABEL" description="JGLOBAL_SHOW_READMORE_DESC" type="radio" default="0" class="btn-group btn-group-yesno" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="show_readmore_title" label="JGLOBAL_SHOW_READMORE_TITLE_LABEL" description="JGLOBAL_SHOW_READMORE_TITLE_DESC" type="radio" default="1" class="btn-group btn-group-yesno" > <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="readmore_limit" type="text" default="15" label="JGLOBAL_SHOW_READMORE_LIMIT_LABEL" description="JGLOBAL_SHOW_READMORE_LIMIT_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="owncache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC" > <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\ט<�xx.modules/mod_articles_category/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_category * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <ul class="category-module<?php echo $moduleclass_sfx; ?>"> <?php if ($grouped) : ?> <?php foreach ($list as $group_name => $group) : ?> <li> <div class="mod-articles-category-group"><?php echo $group_name;?></div> <ul> <?php foreach ($group as $item) : ?> <li> <?php if ($params->get('link_titles') == 1) : ?> <a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>"> <?php echo $item->title; ?> </a> <?php else : ?> <?php echo $item->title; ?> <?php endif; ?> <?php if ($item->displayHits) : ?> <span class="mod-articles-category-hits"> (<?php echo $item->displayHits; ?>) </span> <?php endif; ?> <?php if ($params->get('show_author')) : ?> <span class="mod-articles-category-writtenby"> <?php echo $item->displayAuthorName; ?> </span> <?php endif;?> <?php if ($item->displayCategoryTitle) : ?> <span class="mod-articles-category-category"> (<?php echo $item->displayCategoryTitle; ?>) </span> <?php endif; ?> <?php if ($item->displayDate) : ?> <span class="mod-articles-category-date"><?php echo $item->displayDate; ?></span> <?php endif; ?> <?php if ($params->get('show_introtext')) : ?> <p class="mod-articles-category-introtext"> <?php echo $item->displayIntrotext; ?> </p> <?php endif; ?> <?php if ($params->get('show_readmore')) : ?> <p class="mod-articles-category-readmore"> <a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>"> <?php if ($item->params->get('access-view') == false) : ?> <?php echo JText::_('MOD_ARTICLES_CATEGORY_REGISTER_TO_READ_MORE'); ?> <?php elseif ($readmore = $item->alternative_readmore) : ?> <?php echo $readmore; ?> <?php echo JHtml::_('string.truncate', $item->title, $params->get('readmore_limit')); ?> <?php if ($params->get('show_readmore_title', 0) != 0) : ?> <?php echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit')); ?> <?php endif; ?> <?php elseif ($params->get('show_readmore_title', 0) == 0) : ?> <?php echo JText::sprintf('MOD_ARTICLES_CATEGORY_READ_MORE_TITLE'); ?> <?php else : ?> <?php echo JText::_('MOD_ARTICLES_CATEGORY_READ_MORE'); ?> <?php echo JHtml::_('string.truncate', ($item->title), $params->get('readmore_limit')); ?> <?php endif; ?> </a> </p> <?php endif; ?> </li> <?php endforeach; ?> </ul> </li> <?php endforeach; ?> <?php else : ?> <?php foreach ($list as $item) : ?> <li> <?php if ($params->get('link_titles') == 1) : ?> <a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>"> <?php echo $item->title; ?> </a> <?php else : ?> <?php echo $item->title; ?> <?php endif; ?> <?php if ($item->displayHits) : ?> <span class="mod-articles-category-hits"> (<?php echo $item->displayHits; ?>) </span> <?php endif; ?> <?php if ($params->get('show_author')) : ?> <span class="mod-articles-category-writtenby"> <?php echo $item->displayAuthorName; ?> </span> <?php endif;?> <?php if ($item->displayCategoryTitle) : ?> <span class="mod-articles-category-category"> (<?php echo $item->displayCategoryTitle; ?>) </span> <?php endif; ?> <?php if ($item->displayDate) : ?> <span class="mod-articles-category-date"> <?php echo $item->displayDate; ?> </span> <?php endif; ?> <?php if ($params->get('show_introtext')) : ?> <p class="mod-articles-category-introtext"> <?php echo $item->displayIntrotext; ?> </p> <?php endif; ?> <?php if ($params->get('show_readmore')) : ?> <p class="mod-articles-category-readmore"> <a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>"> <?php if ($item->params->get('access-view') == false) : ?> <?php echo JText::_('MOD_ARTICLES_CATEGORY_REGISTER_TO_READ_MORE'); ?> <?php elseif ($readmore = $item->alternative_readmore) : ?> <?php echo $readmore; ?> <?php echo JHtml::_('string.truncate', $item->title, $params->get('readmore_limit')); ?> <?php elseif ($params->get('show_readmore_title', 0) == 0) : ?> <?php echo JText::sprintf('MOD_ARTICLES_CATEGORY_READ_MORE_TITLE'); ?> <?php else : ?> <?php echo JText::_('MOD_ARTICLES_CATEGORY_READ_MORE'); ?> <?php echo JHtml::_('string.truncate', $item->title, $params->get('readmore_limit')); ?> <?php endif; ?> </a> </p> <?php endif; ?> </li> <?php endforeach; ?> <?php endif; ?> </ul> PK���\�H�v55(modules/mod_articles_category/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_category * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $com_path = JPATH_SITE . '/components/com_content/'; require_once $com_path . 'helpers/route.php'; JModelLegacy::addIncludePath($com_path . '/models', 'ContentModel'); /** * Helper for mod_articles_category * * @package Joomla.Site * @subpackage mod_articles_category * * @since 1.6 */ abstract class ModArticlesCategoryHelper { /** * Get a list of articles from a specific category * * @param \Joomla\Registry\Registry &$params object holding the models parameters * * @return mixed * * @since 1.6 */ public static function getList(&$params) { // Get an instance of the generic articles model $articles = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = JFactory::getApplication(); $appParams = $app->getParams(); $articles->setState('params', $appParams); // Set the filters based on the module params $articles->setState('list.start', 0); $articles->setState('list.limit', (int) $params->get('count', 0)); $articles->setState('filter.published', 1); // Access filter $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')); $articles->setState('filter.access', $access); // Prep for Normal or Dynamic Modes $mode = $params->get('mode', 'normal'); switch ($mode) { case 'dynamic' : $option = $app->input->get('option'); $view = $app->input->get('view'); if ($option === 'com_content') { switch ($view) { case 'category' : $catids = array($app->input->getInt('id')); break; case 'categories' : $catids = array($app->input->getInt('id')); break; case 'article' : if ($params->get('show_on_article_page', 1)) { $article_id = $app->input->getInt('id'); $catid = $app->input->getInt('catid'); if (!$catid) { // Get an instance of the generic article model $article = JModelLegacy::getInstance('Article', 'ContentModel', array('ignore_request' => true)); $article->setState('params', $appParams); $article->setState('filter.published', 1); $article->setState('article.id', (int) $article_id); $item = $article->getItem(); $catids = array($item->catid); } else { $catids = array($catid); } } else { // Return right away if show_on_article_page option is off return; } break; case 'featured' : default: // Return right away if not on the category or article views return; } } else { // Return right away if not on a com_content page return; } break; case 'normal' : default: $catids = $params->get('catid'); $articles->setState('filter.category_id.include', (bool) $params->get('category_filtering_type', 1)); break; } // Category filter if ($catids) { if ($params->get('show_child_category_articles', 0) && (int) $params->get('levels', 0) > 0) { // Get an instance of the generic categories model $categories = JModelLegacy::getInstance('Categories', 'ContentModel', array('ignore_request' => true)); $categories->setState('params', $appParams); $levels = $params->get('levels', 1) ? $params->get('levels', 1) : 9999; $categories->setState('filter.get_children', $levels); $categories->setState('filter.published', 1); $categories->setState('filter.access', $access); $additional_catids = array(); foreach ($catids as $catid) { $categories->setState('filter.parentId', $catid); $recursive = true; $items = $categories->getItems($recursive); if ($items) { foreach ($items as $category) { $condition = (($category->level - $categories->getParent()->level) <= $levels); if ($condition) { $additional_catids[] = $category->id; } } } } $catids = array_unique(array_merge($catids, $additional_catids)); } $articles->setState('filter.category_id', $catids); } // Ordering $articles->setState('list.ordering', $params->get('article_ordering', 'a.ordering')); $articles->setState('list.direction', $params->get('article_ordering_direction', 'ASC')); // New Parameters $articles->setState('filter.featured', $params->get('show_front', 'show')); $articles->setState('filter.author_id', $params->get('created_by', "")); $articles->setState('filter.author_id.include', $params->get('author_filtering_type', 1)); $articles->setState('filter.author_alias', $params->get('created_by_alias', "")); $articles->setState('filter.author_alias.include', $params->get('author_alias_filtering_type', 1)); $excluded_articles = $params->get('excluded_articles', ''); if ($excluded_articles) { $excluded_articles = explode("\r\n", $excluded_articles); $articles->setState('filter.article_id', $excluded_articles); // Exclude $articles->setState('filter.article_id.include', false); } $date_filtering = $params->get('date_filtering', 'off'); if ($date_filtering !== 'off') { $articles->setState('filter.date_filtering', $date_filtering); $articles->setState('filter.date_field', $params->get('date_field', 'a.created')); $articles->setState('filter.start_date_range', $params->get('start_date_range', '1000-01-01 00:00:00')); $articles->setState('filter.end_date_range', $params->get('end_date_range', '9999-12-31 23:59:59')); $articles->setState('filter.relative_date', $params->get('relative_date', 30)); } // Filter by language $articles->setState('filter.language', $app->getLanguageFilter()); $items = $articles->getItems(); // Display options $show_date = $params->get('show_date', 0); $show_date_field = $params->get('show_date_field', 'created'); $show_date_format = $params->get('show_date_format', 'Y-m-d H:i:s'); $show_category = $params->get('show_category', 0); $show_hits = $params->get('show_hits', 0); $show_author = $params->get('show_author', 0); $show_introtext = $params->get('show_introtext', 0); $introtext_limit = $params->get('introtext_limit', 100); // Find current Article ID if on an article page $option = $app->input->get('option'); $view = $app->input->get('view'); if ($option === 'com_content' && $view === 'article') { $active_article_id = $app->input->getInt('id'); } else { $active_article_id = 0; } // Prepare data for display using display options foreach ($items as &$item) { $item->slug = $item->id . ':' . $item->alias; $item->catslug = $item->catid . ':' . $item->category_alias; if ($access || in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); } else { $app = JFactory::getApplication(); $menu = $app->getMenu(); $menuitems = $menu->getItems('link', 'index.php?option=com_users&view=login'); if (isset($menuitems[0])) { $Itemid = $menuitems[0]->id; } elseif ($app->input->getInt('Itemid') > 0) { // Use Itemid from requesting page only if there is no existing menu $Itemid = $app->input->getInt('Itemid'); } $item->link = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $Itemid); } // Used for styling the active article $item->active = $item->id == $active_article_id ? 'active' : ''; $item->displayDate = ''; if ($show_date) { $item->displayDate = JHtml::_('date', $item->$show_date_field, $show_date_format); } if ($item->catid) { $item->displayCategoryLink = JRoute::_(ContentHelperRoute::getCategoryRoute($item->catid)); $item->displayCategoryTitle = $show_category ? '<a href="' . $item->displayCategoryLink . '">' . $item->category_title . '</a>' : ''; } else { $item->displayCategoryTitle = $show_category ? $item->category_title : ''; } $item->displayHits = $show_hits ? $item->hits : ''; $item->displayAuthorName = $show_author ? $item->author : ''; if ($show_introtext) { $item->introtext = JHtml::_('content.prepare', $item->introtext, '', 'mod_articles_category.content'); $item->introtext = self::_cleanIntrotext($item->introtext); } $item->displayIntrotext = $show_introtext ? self::truncate($item->introtext, $introtext_limit) : ''; $item->displayReadmore = $item->alternative_readmore; } return $items; } /** * Strips unnecessary tags from the introtext * * @param string $introtext introtext to sanitize * * @return mixed|string * * @since 1.6 */ public static function _cleanIntrotext($introtext) { $introtext = str_replace('<p>', ' ', $introtext); $introtext = str_replace('</p>', ' ', $introtext); $introtext = strip_tags($introtext, '<a><em><strong>'); $introtext = trim($introtext); return $introtext; } /** * Method to truncate introtext * * The goal is to get the proper length plain text string with as much of * the html intact as possible with all tags properly closed. * * @param string $html The content of the introtext to be truncated * @param integer $maxLength The maximum number of charactes to render * * @return string The truncated string * * @since 1.6 */ public static function truncate($html, $maxLength = 0) { $baseLength = strlen($html); // First get the plain text string. This is the rendered text we want to end up with. $ptString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = false); for ($maxLength; $maxLength < $baseLength;) { // Now get the string if we allow html. $htmlString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = true); // Now get the plain text from the html string. $htmlStringToPtString = JHtml::_('string.truncate', $htmlString, $maxLength, $noSplit = true, $allowHtml = false); // If the new plain text string matches the original plain text string we are done. if ($ptString == $htmlStringToPtString) { return $htmlString; } // Get the number of html tag characters in the first $maxlength characters $diffLength = strlen($ptString) - strlen($htmlStringToPtString); // Set new $maxlength that adjusts for the html tags $maxLength += $diffLength; if ($baseLength <= $maxLength || $diffLength <= 0) { return $htmlString; } } return $html; } /** * Groups items by field * * @param array $list list of items * @param string $fieldName name of field that is used for grouping * @param string $article_grouping_direction ordering direction * @param null $fieldNameToKeep field name to keep * * @return array * * @since 1.6 */ public static function groupBy($list, $fieldName, $article_grouping_direction, $fieldNameToKeep = null) { $grouped = array(); if (!is_array($list)) { if ($list == '') { return $grouped; } $list = array($list); } foreach ($list as $key => $item) { if (!isset($grouped[$item->$fieldName])) { $grouped[$item->$fieldName] = array(); } if (is_null($fieldNameToKeep)) { $grouped[$item->$fieldName][$key] = $item; } else { $grouped[$item->$fieldName][$key] = $item->$fieldNameToKeep; } unset($list[$key]); } $article_grouping_direction($grouped); return $grouped; } /** * Groups items by date * * @param array $list list of items * @param string $type type of grouping * @param string $article_grouping_direction ordering direction * @param string $month_year_format date format to use * * @return array * * @since 1.6 */ public static function groupByDate($list, $type = 'year', $article_grouping_direction, $month_year_format = 'F Y') { $grouped = array(); if (!is_array($list)) { if ($list == '') { return $grouped; } $list = array($list); } foreach ($list as $key => $item) { switch ($type) { case 'month_year' : $month_year = JString::substr($item->created, 0, 7); if (!isset($grouped[$month_year])) { $grouped[$month_year] = array(); } $grouped[$month_year][$key] = $item; break; case 'year' : default: $year = JString::substr($item->created, 0, 4); if (!isset($grouped[$year])) { $grouped[$year] = array(); } $grouped[$year][$key] = $item; break; } unset($list[$key]); } $article_grouping_direction($grouped); if ($type === 'month_year') { foreach ($grouped as $group => $items) { $date = new JDate($group); $formatted_group = $date->format($month_year_format); $grouped[$formatted_group] = $items; unset($grouped[$group]); } } return $grouped; } } PK���\t����)modules/mod_users_latest/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_users_latest * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php if (!empty($names)) : ?> <ul class="latestusers<?php echo $moduleclass_sfx ?>" > <?php foreach ($names as $name) : ?> <li> <?php echo $name->username; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> PK���\2�H\EE#modules/mod_users_latest/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_users_latest * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_users_latest * * @package Joomla.Site * @subpackage mod_users_latest * * @since 1.6 */ class ModUsersLatestHelper { /** * Get users sorted by activation date * * @param \Joomla\Registry\Registry $params module parameters * * @return array The array of users * * @since 1.6 */ public static function getUsers($params) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName(array('a.id', 'a.name', 'a.username', 'a.registerDate'))) ->order($db->quoteName('a.registerDate') . ' DESC') ->from('#__users AS a'); $user = JFactory::getUser(); if (!$user->authorise('core.admin') && $params->get('filter_groups', 0) == 1) { $groups = $user->getAuthorisedGroups(); if (empty($groups)) { return array(); } $query->join('LEFT', '#__user_usergroup_map AS m ON m.user_id = a.id') ->join('LEFT', '#__usergroups AS ug ON ug.id = m.group_id') ->where('ug.id in (' . implode(',', $groups) . ')') ->where('ug.id <> 1'); } $db->setQuery($query, 0, $params->get('shownumber')); try { return (array) $db->loadObjectList(); } catch (RuntimeException $e) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return array(); } } } PK���\�KHʑ�-modules/mod_users_latest/mod_users_latest.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_users_latest * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the latest functions only once require_once __DIR__ . '/helper.php'; $shownumber = $params->get('shownumber', 5); $names = ModUsersLatestHelper::getUsers($params); $linknames = $params->get('linknames', 0); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_users_latest', $params->get('layout', 'default')); PK���\~S��� � -modules/mod_users_latest/mod_users_latest.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_users_latest</name> <author>Joomla! Project</author> <creationDate>December 2009</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_USERS_LATEST_XML_DESCRIPTION</description> <files> <filename module="mod_users_latest">mod_users_latest.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_users_latest.ini</language> <language tag="en-GB">en-GB.mod_users_latest.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_LATEST_USERS" /> <config> <fields name="params"> <fieldset name="basic"> <field name="shownumber" type="text" default="5" label="MOD_USERS_LATEST_FIELD_NUMBER_LABEL" description="MOD_USERS_LATEST_FIELD_NUMBER_DESC"> </field> <field name="filter_groups" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_USERS_LATEST_FIELD_FILTER_GROUPS_LABEL" description="MOD_USERS_LATEST_FIELD_FILTER_GROUPS_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static"> <option value="static"></option> </field> </fieldset> </fields> </config> </extension> PK���\�V�?jj!modules/mod_footer/mod_footer.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_footer</name> <author>Joomla! Project</author> <creationDate>July 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_FOOTER_XML_DESCRIPTION</description> <files> <filename module="mod_footer">mod_footer.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_footer.ini</language> <language tag="en-GB">en-GB.mod_footer.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_FOOTER" /> <config> <fields name="params"> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static"> <option value="static"></option> </field> </fieldset> </fields> </config> </extension> PK���\?� ���#modules/mod_footer/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_footer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="footer1<?php echo $moduleclass_sfx ?>"><?php echo $lineone; ?></div> <div class="footer2<?php echo $moduleclass_sfx ?>"><?php echo JText::_('MOD_FOOTER_LINE2'); ?></div> PK���\<�n��!modules/mod_footer/mod_footer.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_footer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $date = JFactory::getDate(); $cur_year = JHtml::_('date', $date, 'Y'); $csite_name = $app->get('sitename'); if (is_int(JString::strpos(JText :: _('MOD_FOOTER_LINE1'), '%date%'))) { $line1 = str_replace('%date%', $cur_year, JText :: _('MOD_FOOTER_LINE1')); } else { $line1 = JText :: _('MOD_FOOTER_LINE1'); } if (is_int(JString::strpos($line1, '%sitename%'))) { $lineone = str_replace('%sitename%', $csite_name, $line1); } else { $lineone = $line1; } $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_footer', $params->get('layout', 'default')); PK���\�*�+WW)modules/mod_random_image/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_random_image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="random-image<?php echo $moduleclass_sfx ?>"> <?php if ($link) : ?> <a href="<?php echo $link; ?>"> <?php endif; ?> <?php echo JHtml::_('image', $image->folder . '/' . $image->name, $image->name, array('width' => $image->width, 'height' => $image->height)); ?> <?php if ($link) : ?> </a> <?php endif; ?> </div> PK���\���ee#modules/mod_random_image/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_random_image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_random_image * * @package Joomla.Site * @subpackage mod_random_image * @since 1.5 */ class ModRandomImageHelper { /** * Retrieves a random image * * @param \Joomla\Registry\Registry &$params module parameters object * @param array $images list of images * * @return mixed */ public static function getRandomImage(&$params, $images) { $width = $params->get('width'); $height = $params->get('height'); $i = count($images); $random = mt_rand(0, $i - 1); $image = $images[$random]; $size = getimagesize(JPATH_BASE . '/' . $image->folder . '/' . $image->name); if ($width == '') { $width = 100; } if ($size[0] < $width) { $width = $size[0]; } $coeff = $size[0] / $size[1]; if ($height == '') { $height = (int) ($width / $coeff); } else { $newheight = min($height, (int) ($width / $coeff)); if ($newheight < $height) { $height = $newheight; } else { $width = $height * $coeff; } } $image->width = $width; $image->height = $height; $image->folder = str_replace('\\', '/', $image->folder); return $image; } /** * Retrieves images from a specific folder * * @param \Joomla\Registry\Registry &$params module params * @param string $folder folder to get the images from * * @return array */ public static function getImages(&$params, $folder) { $type = $params->get('type', 'jpg'); $files = array(); $images = array(); $dir = JPATH_BASE . '/' . $folder; // Check if directory exists if (is_dir($dir)) { if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && $file != 'CVS' && $file != 'index.html') { $files[] = $file; } } } closedir($handle); $i = 0; foreach ($files as $img) { if (!is_dir($dir . '/' . $img)) { if (preg_match('/' . $type . '/', $img)) { $images[$i] = new stdClass; $images[$i]->name = $img; $images[$i]->folder = $folder; $i++; } } } } return $images; } /** * Get sanitized folder * * @param \Joomla\Registry\Registry &$params module params objects * * @return mixed */ public static function getFolder(&$params) { $folder = $params->get('folder'); $LiveSite = JUri::base(); // If folder includes livesite info, remove if (JString::strpos($folder, $LiveSite) === 0) { $folder = str_replace($LiveSite, '', $folder); } // If folder includes absolute path, remove if (JString::strpos($folder, JPATH_SITE) === 0) { $folder = str_replace(JPATH_BASE, '', $folder); } $folder = str_replace('\\', DIRECTORY_SEPARATOR, $folder); $folder = str_replace('/', DIRECTORY_SEPARATOR, $folder); return $folder; } } PK���\�.!cz z -modules/mod_random_image/mod_random_image.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_random_image</name> <author>Joomla! Project</author> <creationDate>July 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_RANDOM_IMAGE_XML_DESCRIPTION</description> <files> <filename module="mod_random_image">mod_random_image.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_random_image.ini</language> <language tag="en-GB">en-GB.mod_random_image.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_RANDOM_IMAGE" /> <config> <fields name="params"> <fieldset name="basic"> <field name="type" type="text" default="jpg" label="MOD_RANDOM_IMAGE_FIELD_TYPE_LABEL" description="MOD_RANDOM_IMAGE_FIELD_TYPE_DESC" /> <field name="folder" type="text" label="MOD_RANDOM_IMAGE_FIELD_FOLDER_LABEL" description="MOD_RANDOM_IMAGE_FIELD_FOLDER_DESC" /> <field name="link" type="text" label="MOD_RANDOM_IMAGE_FIELD_LINK_LABEL" description="MOD_RANDOM_IMAGE_FIELD_LINK_DESC" /> <field name="width" type="text" label="MOD_RANDOM_IMAGE_FIELD_WIDTH_LABEL" description="MOD_RANDOM_IMAGE_FIELD_WIDTH_DESC" /> <field name="height" type="text" label="MOD_RANDOM_IMAGE_FIELD_HEIGHT_LABEL" description="MOD_RANDOM_IMAGE_FIELD_HEIGHT_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\��2..-modules/mod_random_image/mod_random_image.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_random_image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $link = $params->get('link'); $folder = ModRandomImageHelper::getFolder($params); $images = ModRandomImageHelper::getImages($params, $folder); if (!count($images)) { echo JText::_('MOD_RANDOM_IMAGE_NO_IMAGES'); return; } $image = ModRandomImageHelper::getRandomImage($params, $images); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_random_image', $params->get('layout', 'default')); PK���\���a��"modules/mod_stats/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_stats * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <dl class="stats-module<?php echo $moduleclass_sfx ?>"> <?php foreach ($list as $item) : ?> <dt><?php echo $item->title;?></dt> <dd><?php echo $item->data;?></dd> <?php endforeach; ?> </dl> PK���\p��~� � modules/mod_stats/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_stats * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_stats * * @package Joomla.Site * @subpackage mod_stats * @since 1.5 */ class ModStatsHelper { /** * Get list of stats * * @param \Joomla\Registry\Registry &$params module parameters * * @return array */ public static function &getList(&$params) { $app = JFactory::getApplication(); $db = JFactory::getDbo(); $rows = array(); $query = $db->getQuery(true); $serverinfo = $params->get('serverinfo'); $siteinfo = $params->get('siteinfo'); $counter = $params->get('counter'); $increase = $params->get('increase'); $i = 0; if ($serverinfo) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_OS'); $rows[$i]->data = substr(php_uname(), 0, 7); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_PHP'); $rows[$i]->data = phpversion(); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_($db->name); $rows[$i]->data = $db->getVersion(); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_TIME'); $rows[$i]->data = JHtml::_('date', 'now', 'H:i'); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_CACHING'); $rows[$i]->data = $app->get('caching') ? JText::_('JENABLED') : JText::_('JDISABLED'); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_GZIP'); $rows[$i]->data = $app->get('gzip') ? JText::_('JENABLED') : JText::_('JDISABLED'); $i++; } if ($siteinfo) { $query->select('COUNT(id) AS count_users') ->from('#__users'); $db->setQuery($query); try { $users = $db->loadResult(); } catch (RuntimeException $e) { $users = false; } $query->clear() ->select('COUNT(id) AS count_items') ->from('#__content') ->where('state = 1'); $db->setQuery($query); try { $items = $db->loadResult(); } catch (RuntimeException $e) { $items = false; } if ($users) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_USERS'); $rows[$i]->data = $users; $i++; } if ($items) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_ARTICLES'); $rows[$i]->data = $items; $i++; } if (JComponentHelper::isInstalled('com_weblinks')) { $query->clear() ->select('COUNT(id) AS count_links') ->from('#__weblinks') ->where('state = 1'); $db->setQuery($query); try { $links = $db->loadResult(); } catch (RuntimeException $e) { $links = false; } if ($links) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_WEBLINKS'); $rows[$i]->icon = 'out-2'; $rows[$i]->data = $links; $i++; } } } if ($counter) { $query->clear() ->select('SUM(hits) AS count_hits') ->from('#__content') ->where('state = 1'); $db->setQuery($query); try { $hits = $db->loadResult(); } catch (RuntimeException $e) { $hits = false; } if ($hits) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_ARTICLES_VIEW_HITS'); $rows[$i]->data = $hits + $increase; } } return $rows; } } PK���\Tj"2��modules/mod_stats/mod_stats.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_stats * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $serverinfo = $params->get('serverinfo'); $siteinfo = $params->get('siteinfo'); $list = ModStatsHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_stats', $params->get('layout', 'default')); PK���\��^���modules/mod_stats/mod_stats.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_stats</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_STATS_XML_DESCRIPTION</description> <files> <filename module="mod_stats">mod_stats.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_stats.ini</language> <language tag="en-GB">en-GB.mod_stats.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_STATISTICS" /> <config> <fields name="params"> <fieldset name="basic"> <field name="serverinfo" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_STATS_FIELD_SERVERINFO_LABEL" description="MOD_STATS_FIELD_SERVERINFO_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="siteinfo" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_STATS_FIELD_SITEINFO_LABEL" description="MOD_STATS_FIELD_SITEINFO_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="counter" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_STATS_FIELD_COUNTER_LABEL" description="MOD_STATS_FIELD_COUNTER_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="increase" type="text" default="0" label="MOD_STATS_FIELD_INCREASECOUNTER_LABEL" description="MOD_STATS_FIELD_INCREASECOUNTER_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static"> <option value="static"></option> </field> </fieldset> </fields> </config> </extension> PK���\��nnmodules/mod_login/mod_login.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_login</name> <author>Joomla! Project</author> <creationDate>July 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_LOGIN_XML_DESCRIPTION</description> <files> <filename module="mod_login">mod_login.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_login.ini</language> <language tag="en-GB">en-GB.mod_login.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_LOGIN" /> <config> <fields name="params"> <fieldset name="basic"> <field name="pretext" type="textarea" filter="safehtml" cols="30" rows="5" label="MOD_LOGIN_FIELD_PRE_TEXT_LABEL" description="MOD_LOGIN_FIELD_PRE_TEXT_DESC" /> <field name="posttext" type="textarea" filter="safehtml" cols="30" rows="5" label="MOD_LOGIN_FIELD_POST_TEXT_LABEL" description="MOD_LOGIN_FIELD_POST_TEXT_DESC" /> <field name="login" type="menuitem" disable="separator,alias,heading,url" label="MOD_LOGIN_FIELD_LOGIN_REDIRECTURL_LABEL" description="MOD_LOGIN_FIELD_LOGIN_REDIRECTURL_DESC" > <option value="">JDEFAULT</option> </field> <field name="logout" type="menuitem" disable="separator,alias,heading,url" label="MOD_LOGIN_FIELD_LOGOUT_REDIRECTURL_LABEL" description="MOD_LOGIN_FIELD_LOGOUT_REDIRECTURL_DESC" > <option value="">JDEFAULT</option> </field> <field name="greeting" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_LOGIN_FIELD_GREETING_LABEL" description="MOD_LOGIN_FIELD_GREETING_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="name" type="list" default="0" label="MOD_LOGIN_FIELD_NAME_LABEL" description="MOD_LOGIN_FIELD_NAME_DESC"> <option value="0">MOD_LOGIN_VALUE_NAME</option> <option value="1">MOD_LOGIN_VALUE_USERNAME</option> </field> <field name="usesecure" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_LOGIN_FIELD_USESECURE_LABEL" description="MOD_LOGIN_FIELD_USESECURE_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="usetext" type="list" default="0" label="MOD_LOGIN_FIELD_USETEXT_LABEL" description="MOD_LOGIN_FIELD_USETEXT_DESC"> <option value="0">MOD_LOGIN_VALUE_ICONS</option> <option value="1">MOD_LOGIN_VALUE_TEXT</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\T�u��)modules/mod_login/tmpl/default_logout.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_login * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.keepalive'); ?> <form action="<?php echo JRoute::_(htmlspecialchars(JUri::getInstance()->toString()), true, $params->get('usesecure')); ?>" method="post" id="login-form" class="form-vertical"> <?php if ($params->get('greeting')) : ?> <div class="login-greeting"> <?php if ($params->get('name') == 0) : { echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('name'))); } else : { echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('username'))); } endif; ?> </div> <?php endif; ?> <div class="logout-button"> <input type="submit" name="Submit" class="btn btn-primary" value="<?php echo JText::_('JLOGOUT'); ?>" /> <input type="hidden" name="option" value="com_users" /> <input type="hidden" name="task" value="user.logout" /> <input type="hidden" name="return" value="<?php echo $return; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> PK���\�BN���"modules/mod_login/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_login * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE . '/components/com_users/helpers/route.php'; JHtml::_('behavior.keepalive'); JHtml::_('bootstrap.tooltip'); ?> <form action="<?php echo JRoute::_(htmlspecialchars(JUri::getInstance()->toString()), true, $params->get('usesecure')); ?>" method="post" id="login-form" class="form-inline"> <?php if ($params->get('pretext')) : ?> <div class="pretext"> <p><?php echo $params->get('pretext'); ?></p> </div> <?php endif; ?> <div class="userdata"> <div id="form-login-username" class="control-group"> <div class="controls"> <?php if (!$params->get('usetext')) : ?> <div class="input-prepend"> <span class="add-on"> <span class="icon-user hasTooltip" title="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?>"></span> <label for="modlgn-username" class="element-invisible"><?php echo JText::_('MOD_LOGIN_VALUE_USERNAME'); ?></label> </span> <input id="modlgn-username" type="text" name="username" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?>" /> </div> <?php else: ?> <label for="modlgn-username"><?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?></label> <input id="modlgn-username" type="text" name="username" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?>" /> <?php endif; ?> </div> </div> <div id="form-login-password" class="control-group"> <div class="controls"> <?php if (!$params->get('usetext')) : ?> <div class="input-prepend"> <span class="add-on"> <span class="icon-lock hasTooltip" title="<?php echo JText::_('JGLOBAL_PASSWORD') ?>"> </span> <label for="modlgn-passwd" class="element-invisible"><?php echo JText::_('JGLOBAL_PASSWORD'); ?> </label> </span> <input id="modlgn-passwd" type="password" name="password" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD') ?>" /> </div> <?php else: ?> <label for="modlgn-passwd"><?php echo JText::_('JGLOBAL_PASSWORD') ?></label> <input id="modlgn-passwd" type="password" name="password" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD') ?>" /> <?php endif; ?> </div> </div> <?php if (count($twofactormethods) > 1): ?> <div id="form-login-secretkey" class="control-group"> <div class="controls"> <?php if (!$params->get('usetext')) : ?> <div class="input-prepend input-append"> <span class="add-on"> <span class="icon-star hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY'); ?>"> </span> <label for="modlgn-secretkey" class="element-invisible"><?php echo JText::_('JGLOBAL_SECRETKEY'); ?> </label> </span> <input id="modlgn-secretkey" autocomplete="off" type="text" name="secretkey" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_SECRETKEY') ?>" /> <span class="btn width-auto hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY_HELP'); ?>"> <span class="icon-help"></span> </span> </div> <?php else: ?> <label for="modlgn-secretkey"><?php echo JText::_('JGLOBAL_SECRETKEY') ?></label> <input id="modlgn-secretkey" autocomplete="off" type="text" name="secretkey" class="input-small" tabindex="0" size="18" placeholder="<?php echo JText::_('JGLOBAL_SECRETKEY') ?>" /> <span class="btn width-auto hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY_HELP'); ?>"> <span class="icon-help"></span> </span> <?php endif; ?> </div> </div> <?php endif; ?> <?php if (JPluginHelper::isEnabled('system', 'remember')) : ?> <div id="form-login-remember" class="control-group checkbox"> <label for="modlgn-remember" class="control-label"><?php echo JText::_('MOD_LOGIN_REMEMBER_ME') ?></label> <input id="modlgn-remember" type="checkbox" name="remember" class="inputbox" value="yes"/> </div> <?php endif; ?> <div id="form-login-submit" class="control-group"> <div class="controls"> <button type="submit" tabindex="0" name="Submit" class="btn btn-primary"><?php echo JText::_('JLOGIN') ?></button> </div> </div> <?php $usersConfig = JComponentHelper::getParams('com_users'); ?> <ul class="unstyled"> <?php if ($usersConfig->get('allowUserRegistration')) : ?> <li> <a href="<?php echo JRoute::_('index.php?option=com_users&view=registration&Itemid=' . UsersHelperRoute::getRegistrationRoute()); ?>"> <?php echo JText::_('MOD_LOGIN_REGISTER'); ?> <span class="icon-arrow-right"></span></a> </li> <?php endif; ?> <li> <a href="<?php echo JRoute::_('index.php?option=com_users&view=remind&Itemid=' . UsersHelperRoute::getRemindRoute()); ?>"> <?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a> </li> <li> <a href="<?php echo JRoute::_('index.php?option=com_users&view=reset&Itemid=' . UsersHelperRoute::getResetRoute()); ?>"> <?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a> </li> </ul> <input type="hidden" name="option" value="com_users" /> <input type="hidden" name="task" value="user.login" /> <input type="hidden" name="return" value="<?php echo $return; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> <?php if ($params->get('posttext')) : ?> <div class="posttext"> <p><?php echo $params->get('posttext'); ?></p> </div> <?php endif; ?> </form> PK���\&X@��modules/mod_login/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_login * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_login * * @package Joomla.Site * @subpackage mod_login * * @since 1.5 */ class ModLoginHelper { /** * Retrieve the url where the user should be returned after logging in * * @param \Joomla\Registry\Registry $params module parameters * @param string $type return type * * @return string */ public static function getReturnUrl($params, $type) { $app = JFactory::getApplication(); $item = $app->getMenu()->getItem($params->get($type)); if ($item) { $url = 'index.php?Itemid=' . $item->id; } else { // Stay on the same page $url = JUri::getInstance()->toString(); } return base64_encode($url); } /** * Returns the current users type * * @return string */ public static function getType() { $user = JFactory::getUser(); return (!$user->get('guest')) ? 'logout' : 'login'; } /** * Get list of available two factor methods * * @return array */ public static function getTwoFactorMethods() { require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; return UsersHelper::getTwoFactorMethods(); } } PK���\"7��modules/mod_login/mod_login.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_login * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the login functions only once require_once __DIR__ . '/helper.php'; $params->def('greeting', 1); $type = ModLoginHelper::getType(); $return = ModLoginHelper::getReturnUrl($params, $type); $twofactormethods = ModLoginHelper::getTwoFactorMethods(); $user = JFactory::getUser(); $layout = $params->get('layout', 'default'); // Logged users must load the logout sublayout if (!$user->guest) { $layout .= '_logout'; } require JModuleHelper::getLayoutPath('mod_login', $layout); PK���\hV���(modules/mod_breadcrumbs/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_breadcrumbs * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); ?> <ul itemscope itemtype="http://schema.org/BreadcrumbList" class="breadcrumb<?php echo $moduleclass_sfx; ?>"> <?php if ($params->get('showHere', 1)) : ?> <li class="active"> <?php echo JText::_('MOD_BREADCRUMBS_HERE'); ?>  </li> <?php else : ?> <li class="active"> <span class="divider icon-location"></span> </li> <?php endif; ?> <?php // Get rid of duplicated entries on trail including home page when using multilanguage for ($i = 0; $i < $count; $i++) { if ($i == 1 && !empty($list[$i]->link) && !empty($list[$i - 1]->link) && $list[$i]->link == $list[$i - 1]->link) { unset($list[$i]); } } // Find last and penultimate items in breadcrumbs list end($list); $last_item_key = key($list); prev($list); $penult_item_key = key($list); // Make a link if not the last item in the breadcrumbs $show_last = $params->get('showLast', 1); // Generate the trail foreach ($list as $key => $item) : if ($key != $last_item_key) : // Render all but last item - along with separator ?> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <?php if (!empty($item->link)) : ?> <a itemprop="item" href="<?php echo $item->link; ?>" class="pathway"> <span itemprop="name"> <?php echo $item->name; ?> </span> </a> <?php else : ?> <span itemprop="name"> <?php $item->name; ?> </span> <?php endif; ?> <?php if (($key != $penult_item_key) || $show_last) : ?> <span class="divider"> <?php echo $separator; ?> </span> <?php endif; ?> <meta itemprop="position" content="<?php echo $key + 1; ?>"> </li> <?php elseif ($show_last) : // Render last item if reqd. ?> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="active"> <span itemprop="name"> <?php echo $item->name; ?> </span> <meta itemprop="position" content="<?php echo $key + 1; ?>"> </li> <?php endif; endforeach; ?> </ul> PK���\�K7J� � "modules/mod_breadcrumbs/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_breadcrumbs * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_breadcrumbs * * @package Joomla.Site * @subpackage mod_breadcrumbs * @since 1.5 */ class ModBreadCrumbsHelper { /** * Retrieve breadcrumb items * * @param \Joomla\Registry\Registry &$params module parameters * * @return array */ public static function getList(&$params) { // Get the PathWay object from the application $app = JFactory::getApplication(); $pathway = $app->getPathway(); $items = $pathway->getPathWay(); $lang = JFactory::getLanguage(); $menu = $app->getMenu(); // Look for the home menu if (JLanguageMultilang::isEnabled()) { $home = $menu->getDefault($lang->getTag()); } else { $home = $menu->getDefault(); } $count = count($items); // Don't use $items here as it references JPathway properties directly $crumbs = array(); for ($i = 0; $i < $count; $i ++) { $crumbs[$i] = new stdClass; $crumbs[$i]->name = stripslashes(htmlspecialchars($items[$i]->name, ENT_COMPAT, 'UTF-8')); $crumbs[$i]->link = JRoute::_($items[$i]->link); } if ($params->get('showHome', 1)) { $item = new stdClass; $item->name = htmlspecialchars($params->get('homeText', JText::_('MOD_BREADCRUMBS_HOME'))); $item->link = JRoute::_('index.php?Itemid=' . $home->id); array_unshift($crumbs, $item); } return $crumbs; } /** * Set the breadcrumbs separator for the breadcrumbs display. * * @param string $custom Custom xhtml complient string to separate the * items of the breadcrumbs * * @return string Separator string * * @since 1.5 */ public static function setSeparator($custom = null) { $lang = JFactory::getLanguage(); // If a custom separator has not been provided we try to load a template // specific one first, and if that is not present we load the default separator if ($custom == null) { if ($lang->isRtl()) { $_separator = JHtml::_('image', 'system/arrow_rtl.png', null, null, true); } else { $_separator = JHtml::_('image', 'system/arrow.png', null, null, true); } } else { $_separator = htmlspecialchars($custom); } return $_separator; } } PK���\LC�֘�+modules/mod_breadcrumbs/mod_breadcrumbs.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_breadcrumbs</name> <author>Joomla! Project</author> <creationDate>July 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_BREADCRUMBS_XML_DESCRIPTION</description> <files> <filename module="mod_breadcrumbs">mod_breadcrumbs.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_breadcrumbs.ini</language> <language tag="en-GB">en-GB.mod_breadcrumbs.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_BREADCRUMBS" /> <config> <fields name="params"> <fieldset name="basic"> <field name="showHere" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_BREADCRUMBS_FIELD_SHOWHERE_LABEL" description="MOD_BREADCRUMBS_FIELD_SHOWHERE_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="showHome" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_BREADCRUMBS_FIELD_SHOWHOME_LABEL" description="MOD_BREADCRUMBS_FIELD_SHOWHOME_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="homeText" type="text" label="MOD_BREADCRUMBS_FIELD_HOMETEXT_LABEL" description="MOD_BREADCRUMBS_FIELD_HOMETEXT_DESC" /> <field name="showLast" type="radio" default="1" class="btn-group btn-group-yesno" label="MOD_BREADCRUMBS_FIELD_SHOWLAST_LABEL" description="MOD_BREADCRUMBS_FIELD_SHOWLAST_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="separator" type="text" label="MOD_BREADCRUMBS_FIELD_SEPARATOR_LABEL" description="MOD_BREADCRUMBS_FIELD_SEPARATOR_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="itemid"> <option value="itemid"></option> </field> </fieldset> </fields> </config> </extension> PK���\��T��+modules/mod_breadcrumbs/mod_breadcrumbs.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_breadcrumbs * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; // Get the breadcrumbs $list = ModBreadCrumbsHelper::getList($params); $count = count($list); // Set the default separator $separator = ModBreadCrumbsHelper::setSeparator($params->get('separator')); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_breadcrumbs', $params->get('layout', 'default')); PK���\ћ���modules/mod_feed/mod_feed.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $rssurl = $params->get('rssurl', ''); $rssrtl = $params->get('rssrtl', 0); // Check if feed URL has been set if (empty ($rssurl)) { echo '<div>'; echo JText::_('MOD_FEED_ERR_NO_URL'); echo '</div>'; return; } $feed = ModFeedHelper::getFeed($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_feed', $params->get('layout', 'default')); PK���\C����!modules/mod_feed/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php if (!empty($feed) && is_string($feed)) { echo $feed; } else { $lang = JFactory::getLanguage(); $myrtl = $params->get('rssrtl'); $direction = " "; if ($lang->isRtl() && $myrtl == 0) { $direction = " redirect-rtl"; } // Feed description elseif ($lang->isRtl() && $myrtl == 1) { $direction = " redirect-ltr"; } elseif ($lang->isRtl() && $myrtl == 2) { $direction = " redirect-rtl"; } elseif ($myrtl == 0) { $direction = " redirect-ltr"; } elseif ($myrtl == 1) { $direction = " redirect-ltr"; } elseif ($myrtl == 2) { $direction = " redirect-rtl"; } if ($feed != false) { // Image handling $iUrl = isset($feed->image) ? $feed->image : null; $iTitle = isset($feed->imagetitle) ? $feed->imagetitle : null; ?> <div style="direction: <?php echo $rssrtl ? 'rtl' :'ltr'; ?>; text-align: <?php echo $rssrtl ? 'right' :'left'; ?> ! important" class="feed<?php echo $moduleclass_sfx; ?>"> <?php // Feed description if (!is_null($feed->title) && $params->get('rsstitle', 1)) { ?> <h2 class="<?php echo $direction; ?>"> <a href="<?php echo htmlspecialchars($rssurl); ?>" target="_blank"> <?php echo $feed->title; ?></a> </h2> <?php } // Feed description if ($params->get('rssdesc', 1)) { ?> <?php echo $feed->description; ?> <?php } // Feed image if ($params->get('rssimage', 1) && $iUrl) : ?> <img src="<?php echo $iUrl; ?>" alt="<?php echo @$iTitle; ?>"/> <?php endif; ?> <!-- Show items --> <?php if (!empty($feed)) { ?> <ul class="newsfeed<?php echo $params->get('moduleclass_sfx'); ?>"> <?php for ($i = 0; $i < $params->get('rssitems', 5); $i++) { if (!$feed->offsetExists($i)) { break; } ?> <?php $uri = (!empty($feed[$i]->uri) || !is_null($feed[$i]->uri)) ? $feed[$i]->uri : $feed[$i]->guid; $uri = substr($uri, 0, 4) != 'http' ? $params->get('rsslink') : $uri; $text = !empty($feed[$i]->content) || !is_null($feed[$i]->content) ? $feed[$i]->content : $feed[$i]->description; ?> <li> <?php if (!empty($uri)) : ?> <span class="feed-link"> <a href="<?php echo htmlspecialchars($uri); ?>" target="_blank"> <?php echo $feed[$i]->title; ?></a></span> <?php else : ?> <span class="feed-link"><?php echo $feed[$i]->title; ?></span> <?php endif; ?> <?php if ($params->get('rssitemdesc') && !empty($text)) : ?> <div class="feed-item-description"> <?php // Strip the images. $text = JFilterOutput::stripImages($text); $text = JHtml::_('string.truncate', $text, $params->get('word_count')); echo str_replace(''', "'", $text); ?> </div> <?php endif; ?> </li> <?php } ?> </ul> <?php } ?> </div> <?php } } PK���\�w��modules/mod_feed/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_feed * * @package Joomla.Site * @subpackage mod_feed * @since 1.5 */ class ModFeedHelper { /** * Retrieve feed information * * @param \Joomla\Registry\Registry $params module parameters * * @return JFeedReader|string */ public static function getFeed($params) { // Module params $rssurl = $params->get('rssurl', ''); // Get RSS parsed object try { $feed = new JFeedFactory; $rssDoc = $feed->getFeed($rssurl); } catch (InvalidArgumentException $e) { return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } catch (RunTimeException $e) { return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } catch (LogicException $e) { return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } if (empty($rssDoc)) { return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } if ($rssDoc) { return $rssDoc; } } } PK���\ͦ� modules/mod_feed/mod_feed.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_feed</name> <author>Joomla! Project</author> <creationDate>July 2005</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_FEED_XML_DESCRIPTION</description> <files> <filename module="mod_feed">mod_feed.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_feed.ini</language> <language tag="en-GB">en-GB.mod_feed.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_FEED_DISPLAY" /> <config> <fields name="params"> <fieldset name="basic"> <field name="rssurl" type="url" size="50" filter="url" required="true" validate="url" label="MOD_FEED_FIELD_RSSURL_LABEL" description="MOD_FEED_FIELD_RSSURL_DESC" /> <field name="rssrtl" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_FEED_FIELD_RTL_LABEL" description="MOD_FEED_FIELD_RTL_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="rsstitle" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_FEED_FIELD_RSSTITLE_LABEL" description="MOD_FEED_FIELD_RSSTITLE_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="rssdesc" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_FEED_FIELD_DESCRIPTION_LABEL" description="MOD_FEED_FIELD_DESCRIPTION_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="rssimage" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_FEED_FIELD_IMAGE_LABEL" description="MOD_FEED_FIELD_IMAGE_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="rssitems" type="text" default="3" label="MOD_FEED_FIELD_ITEMS_LABEL" description="MOD_FEED_FIELD_ITEMS_DESC" /> <field name="rssitemdesc" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_FEED_FIELD_ITEMDESCRIPTION_LABEL" description="MOD_FEED_FIELD_ITEMDESCRIPTION_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="word_count" type="text" size="6" default="0" label="MOD_FEED_FIELD_WORDCOUNT_LABEL" description="MOD_FEED_FIELD_WORDCOUNT_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\�%>�dd5modules/mod_articles_archive/mod_articles_archive.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $params->def('count', 10); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $list = ModArchiveHelper::getList($params); require JModuleHelper::getLayoutPath('mod_articles_archive', $params->get('layout', 'default')); PK���\= ���5modules/mod_articles_archive/mod_articles_archive.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_articles_archive</name> <author>Joomla! Project</author> <creationDate>July 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_ARTICLES_ARCHIVE_XML_DESCRIPTION</description> <files> <filename module="mod_articles_archive">mod_articles_archive.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_articles_archive.ini</language> <language tag="en-GB">en-GB.mod_articles_archive.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_ARCHIVE" /> <config> <fields name="params"> <fieldset name="basic"> <field name="count" type="text" default="10" label="MOD_ARTICLES_ARCHIVE_FIELD_COUNT_LABEL" description="MOD_ARTICLES_ARCHIVE_FIELD_COUNT_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC" > <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static"> <option value="static"></option> </field> </fieldset> </fields> </config> </extension> PK���\y��-modules/mod_articles_archive/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php if (!empty($list)) : ?> <ul class="archive-module<?php echo $moduleclass_sfx; ?>"> <?php foreach ($list as $item) : ?> <li> <a href="<?php echo $item->link; ?>"> <?php echo $item->text; ?> </a> </li> <?php endforeach; ?> </ul> <?php endif; ?> PK���\J��� � 'modules/mod_articles_archive/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_articles_archive * * @package Joomla.Site * @subpackage mod_articles_archive * @since 1.5 */ class ModArchiveHelper { /** * Retrieve list of archived articles * * @param \Joomla\Registry\Registry &$params module parameters * * @return array * * @since 1.5 */ public static function getList(&$params) { // Get database $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select($query->month($db->quoteName('created')) . ' AS created_month') ->select('MIN(' . $db->quoteName('created') . ') AS created') ->select($query->year($db->quoteName('created')) . ' AS created_year') ->from('#__content') ->where('state = 2') ->group($query->year($db->quoteName('created')) . ', ' . $query->month($db->quoteName('created'))) ->order($query->year($db->quoteName('created')) . ' DESC, ' . $query->month($db->quoteName('created')) . ' DESC'); // Filter by language if (JFactory::getApplication()->getLanguageFilter()) { $query->where('language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, (int) $params->get('count')); try { $rows = (array) $db->loadObjectList(); } catch (RuntimeException $e) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return; } $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getItems('link', 'index.php?option=com_content&view=archive', true); $itemid = (isset($item) && !empty($item->id)) ? '&Itemid=' . $item->id : ''; $i = 0; $lists = array(); foreach ($rows as $row) { $date = JFactory::getDate($row->created); $created_month = $date->format('n'); $created_year = $date->format('Y'); $created_year_cal = JHtml::_('date', $row->created, 'Y'); $month_name_cal = JHtml::_('date', $row->created, 'F'); $lists[$i] = new stdClass; $lists[$i]->link = JRoute::_('index.php?option=com_content&view=archive&year=' . $created_year . '&month=' . $created_month . $itemid); $lists[$i]->text = JText::sprintf('MOD_ARTICLES_ARCHIVE_DATE', $month_name_cal, $created_year_cal); $i++; } return $lists; } } PK���\']��#modules/mod_custom/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_custom * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="custom<?php echo $moduleclass_sfx ?>" <?php if ($params->get('backgroundimage')) : ?> style="background-image:url(<?php echo $params->get('backgroundimage');?>)"<?php endif;?> > <?php echo $module->content;?> </div> PK���\(�y� � !modules/mod_custom/mod_custom.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_custom</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_CUSTOM_XML_DESCRIPTION</description> <customContent /> <files> <filename module="mod_custom">mod_custom.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_custom.ini</language> <language tag="en-GB">en-GB.mod_custom.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_CUSTOM_HTML" /> <config> <fields name="params"> <fieldset name="options" label="COM_MODULES_BASIC_FIELDSET_LABEL"> <field name="prepare_content" type="radio" class="btn-group btn-group-yesno" label="MOD_CUSTOM_FIELD_PREPARE_CONTENT_LABEL" description="MOD_CUSTOM_FIELD_PREPARE_CONTENT_DESC" default="0"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="backgroundimage" type="media" label="MOD_CUSTOM_FIELD_BACKGROUNDIMAGE_LABEL" description="MOD_BACKGROUNDIMAGE_FIELD_LOGO_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static"> <option value="static"></option> </field> </fieldset> </fields> </config> </extension> PK���\I �v]]!modules/mod_custom/mod_custom.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_custom * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; if ($params->def('prepare_content', 1)) { JPluginHelper::importPlugin('content'); $module->content = JHtml::_('content.prepare', $module->content, '', 'mod_custom.content'); } $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_custom', $params->get('layout', 'default')); PK���\���n��5modules/mod_articles_popular/mod_articles_popular.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_articles_popular</name> <author>Joomla! Project</author> <creationDate>July 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_POPULAR_XML_DESCRIPTION</description> <files> <filename module="mod_articles_popular">mod_articles_popular.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_articles_popular.ini</language> <language tag="en-GB">en-GB.mod_articles_popular.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_MOST_READ" /> <config> <fields name="params"> <fieldset name="basic"> <field name="catid" type="category" extension="com_content" multiple="true" size="10" default="" label="JCATEGORY" description="MOD_POPULAR_FIELD_CATEGORY_DESC" > <option value="">JOPTION_ALL_CATEGORIES</option> </field> <field name="count" type="text" default="5" label="MOD_POPULAR_FIELD_COUNT_LABEL" description="MOD_POPULAR_FIELD_COUNT_DESC" /> <field name="show_front" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_POPULAR_FIELD_FEATURED_LABEL" description="MOD_POPULAR_FIELD_FEATURED_DESC"> <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> <field name="basicspacer1" type="spacer" hr="true" /> <field name="date_filtering" type="list" default="off" label="MOD_POPULAR_FIELD_DATEFILTERING_LABEL" description="MOD_POPULAR_FIELD_DATEFILTERING_DESC" > <option value="off">MOD_POPULAR_OPTION_OFF_VALUE </option> <option value="range">MOD_POPULAR_OPTION_DATERANGE_VALUE </option> <option value="relative">MOD_POPULAR_OPTION_RELATIVEDAY_VALUE </option> </field> <field name="date_field" type="list" default="a.created" label="MOD_POPULAR_FIELD_DATEFIELD_LABEL" description="MOD_POPULAR_FIELD_DATEFIELD_DESC" > <option value="a.created">MOD_POPULAR_OPTION_CREATED_VALUE </option> <option value="a.modified">MOD_POPULAR_OPTION_MODIFIED_VALUE </option> <option value="a.publish_up">MOD_POPULAR_OPTION_STARTPUBLISHING_VALUE </option> </field> <field name="start_date_range" type="calendar" format="%Y-%m-%d %H:%M:%S" label="MOD_POPULAR_FIELD_STARTDATE_LABEL" description="MOD_POPULAR_FIELD_STARTDATE_DESC" size="22" filter="user_utc" /> <field name="end_date_range" type="calendar" format="%Y-%m-%d %H:%M:%S" label="MOD_POPULAR_FIELD_ENDDATE_LABEL" description="MOD_POPULAR_FIELD_ENDDATE_DESC" size="22" filter="user_utc" /> <field name="relative_date" type="text" default="30" label="MOD_POPULAR_FIELD_RELATIVEDATE_LABEL" description="MOD_POPULAR_FIELD_RELATIVEDATE_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static"> <option value="static"></option> </field> </fieldset> </fields> </config> </extension> PK���\UH��-modules/mod_articles_popular/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <ul class="mostread<?php echo $moduleclass_sfx; ?>"> <?php foreach ($list as $item) : ?> <li> <a href="<?php echo $item->link; ?>"> <?php echo $item->title; ?></a> </li> <?php endforeach; ?> </ul> PK���\%c����'modules/mod_articles_popular/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE . '/components/com_content/helpers/route.php'; JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel'); /** * Helper for mod_articles_popular * * @package Joomla.Site * @subpackage mod_articles_popular * * @since 1.6.0 */ abstract class ModArticlesPopularHelper { /** * Get a list of popular articles from the articles model * * @param \Joomla\Registry\Registry &$params object holding the models parameters * * @return mixed */ public static function getList(&$params) { // Get an instance of the generic articles model $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = JFactory::getApplication(); $appParams = $app->getParams(); $model->setState('params', $appParams); // Set the filters based on the module params $model->setState('list.start', 0); $model->setState('list.limit', (int) $params->get('count', 5)); $model->setState('filter.published', 1); $model->setState('filter.featured', $params->get('show_front', 1) == 1 ? 'show' : 'hide'); // Access filter $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')); $model->setState('filter.access', $access); // Category filter $model->setState('filter.category_id', $params->get('catid', array())); // Date filter $date_filtering = $params->get('date_filtering', 'off'); if ($date_filtering !== 'off') { $model->setState('filter.date_filtering', $date_filtering); $model->setState('filter.date_field', $params->get('date_field', 'a.created')); $model->setState('filter.start_date_range', $params->get('start_date_range', '1000-01-01 00:00:00')); $model->setState('filter.end_date_range', $params->get('end_date_range', '9999-12-31 23:59:59')); $model->setState('filter.relative_date', $params->get('relative_date', 30)); } // Filter by language $model->setState('filter.language', $app->getLanguageFilter()); // Ordering $model->setState('list.ordering', 'a.hits'); $model->setState('list.direction', 'DESC'); $items = $model->getItems(); foreach ($items as &$item) { $item->slug = $item->id . ':' . $item->alias; $item->catslug = $item->catid . ':' . $item->category_alias; if ($access || in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); } else { $item->link = JRoute::_('index.php?option=com_users&view=login'); } } return $items; } } PK���\Xw�kFF5modules/mod_articles_popular/mod_articles_popular.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_articles_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $list = ModArticlesPopularHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_articles_popular', $params->get('layout', 'default')); PK���\.�o��-modules/mod_tags_similar/mod_tags_similar.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_tags_similar</name> <author>Joomla! Project</author> <creationDate>January 2013</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.1.0</version> <description>MOD_TAGS_SIMILAR_XML_DESCRIPTION</description> <files> <filename module="mod_tags_similar">mod_tags_similar.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_tags_similar.ini</language> <language tag="en-GB">en-GB.mod_tags_similar.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_TAGS_SIMILAR" /> <config> <fields name="params"> <fieldset name="basic"> <field name="maximum" type="integer" default="5" first="1" last="20" step="1" label="MOD_TAGS_SIMILAR_MAX_LABEL" description="MOD_TAGS_SIMILAR_MAX_DESC"> </field> <field name="matchtype" type="list" default="any" label="MOD_TAGS_SIMILAR_FIELD_MATCHTYPE_LABEL" description="MOD_TAGS_SIMILAR_FIELD_MATCHTYPE_DESC"> <option value="all">MOD_TAGS_SIMILAR_FIELD_ALL</option> <option value="any">MOD_TAGS_SIMILAR_FIELD_ONE</option> <option value="half">MOD_TAGS_SIMILAR_FIELD_HALF</option> </field> <field name="ordering" type="list" default="count" label="MOD_TAGS_SIMILAR_FIELD_ORDERING_LABEL" description="MOD_TAGS_SIMILAR_FIELD_ORDERING_DESC"> <option value="count">MOD_TAGS_SIMILAR_FIELD_ORDERING_COUNT</option> <option value="random">MOD_TAGS_SIMILAR_FIELD_ORDERING_RANDOM</option> <option value="countrandom">MOD_TAGS_SIMILAR_FIELD_ORDERING_COUNT_AND_RANDOM</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="owncache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\������)modules/mod_tags_similar/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php JLoader::register('TagsHelperRoute', JPATH_BASE . '/components/com_tags/helpers/route.php'); ?> <div class="tagssimilar<?php echo $moduleclass_sfx; ?>"> <?php if ($list) : ?> <ul> <?php foreach ($list as $i => $item) : ?> <li> <?php $item->route = new JHelperRoute; ?> <a href="<?php echo JRoute::_(TagsHelperRoute::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>"> <?php if (!empty($item->core_title)) : echo htmlspecialchars($item->core_title); endif; ?> </a> </li> <?php endforeach; ?> </ul> <?php else : ?> <span><?php echo JText::_('MOD_TAGS_SIMILAR_NO_MATCHING_TAGS'); ?></span> <?php endif; ?> </div> PK���\������#modules/mod_tags_similar/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\Registry\Registry; /** * Helper for mod_tags_popular * * @package Joomla.Site * @subpackage mod_tags_popular * @since 3.1 */ abstract class ModTagssimilarHelper { /** * Get a list of tags * * @param Registry &$params Module parameters * * @return mixed Results array / null */ public static function getList(&$params) { $app = JFactory::getApplication(); $option = $app->input->get('option'); $view = $app->input->get('view'); // For now assume com_tags and com_users do not have tags. // This module does not apply to list views in general at this point. if ($option == 'com_tags' || $view == 'category' || $option == 'com_users') { return; } $db = JFactory::getDbo(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $matchtype = $params->get('matchtype', 'all'); $maximum = $params->get('maximum', 5); $ordering = $params->get('ordering', 'count'); $tagsHelper = new JHelperTags; $prefix = $option . '.' . $view; $id = $app->input->getInt('id'); $now = JFactory::getDate()->toSql(); $nullDate = $db->getNullDate(); $tagsToMatch = $tagsHelper->getTagIds($id, $prefix); if (!$tagsToMatch || is_null($tagsToMatch)) { return; } $tagCount = substr_count($tagsToMatch, ',') + 1; $query = $db->getQuery(true) ->select( array( $db->quoteName('m.core_content_id'), $db->quoteName('m.content_item_id'), $db->quoteName('m.type_alias'), 'COUNT( ' . $db->quoteName('tag_id') . ') AS ' . $db->quoteName('count'), $db->quoteName('ct.router'), $db->quoteName('cc.core_title'), $db->quoteName('cc.core_alias'), $db->quoteName('cc.core_catid'), $db->quoteName('cc.core_language'), $db->quoteName('cc.core_params') ) ); $query->from($db->quoteName('#__contentitem_tag_map', 'm')); $query->join('INNER', $db->quoteName('#__tags', 't') . ' ON m.tag_id = t.id') ->join('INNER', $db->quoteName('#__ucm_content', 'cc') . ' ON m.core_content_id = cc.core_content_id') ->join('INNER', $db->quoteName('#__content_types', 'ct') . ' ON m.type_alias = ct.type_alias'); $query->where($db->quoteName('m.tag_id') . ' IN (' . $tagsToMatch . ')'); $query->where('t.access IN (' . $groups . ')'); $query->where('(cc.core_access IN (' . $groups . ') OR cc.core_access = 0)'); // Don't show current item $query->where('(' . $db->quoteName('m.content_item_id') . ' <> ' . $id . ' OR ' . $db->quoteName('m.type_alias') . ' <> ' . $db->quote($prefix) . ')'); // Only return published tags $query->where($db->quoteName('cc.core_state') . ' = 1 ') ->where('(' . $db->quoteName('cc.core_publish_up') . '=' . $db->quote($nullDate) . ' OR ' . $db->quoteName('cc.core_publish_up') . '<=' . $db->quote($now) . ')') ->where('(' . $db->quoteName('cc.core_publish_down') . '=' . $db->quote($nullDate) . ' OR ' . $db->quoteName('cc.core_publish_down') . '>=' . $db->quote($now) . ')'); // Optionally filter on language $language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all'); if ($language != 'all') { if ($language == 'current_language') { $language = JHelperContent::getCurrentLanguage(); } $query->where($db->quoteName('cc.core_language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')'); } $query->group( $db->quoteName( array('m.core_content_id', 'm.content_item_id', 'm.type_alias', 'ct.router', 'cc.core_title', 'cc.core_alias', 'cc.core_catid', 'cc.core_language', 'cc.core_params') ) ); if ($matchtype == 'all' && $tagCount > 0) { $query->having('COUNT( ' . $db->quoteName('tag_id') . ') = ' . $tagCount); } elseif ($matchtype == 'half' && $tagCount > 0) { $tagCountHalf = ceil($tagCount / 2); $query->having('COUNT( ' . $db->quoteName('tag_id') . ') >= ' . $tagCountHalf); } if ($ordering == 'count' || $ordering == 'countrandom') { $query->order($db->quoteName('count') . ' DESC'); } if ($ordering == 'random' || $ordering == 'countrandom') { $query->order('RAND()'); } $db->setQuery($query, 0, $maximum); try { $results = $db->loadObjectList(); } catch (RuntimeException $e) { $results = array(); JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } foreach ($results as $result) { $explodedAlias = explode('.', $result->type_alias); $result->link = 'index.php?option=' . $explodedAlias[0] . '&view=' . $explodedAlias[1] . '&id=' . $result->content_item_id . '-' . $result->core_alias; $result->core_params = new Registry($result->core_params); } return $results; } } PK���\U��/oo-modules/mod_tags_similar/mod_tags_similar.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_similar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $cacheparams = new stdClass; $cacheparams->cachemode = 'safeuri'; $cacheparams->class = 'ModTagssimilarHelper'; $cacheparams->method = 'getList'; $cacheparams->methodparams = $params; $cacheparams->modeparams = array('id' => 'array', 'Itemid' => 'int'); $list = JModuleHelper::moduleCache($module, $params, $cacheparams); if (!count($list)) { return; } $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_tags_similar', $params->get('layout', 'default')); PK���\��DB99-modules/mod_tags_popular/mod_tags_popular.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_tags_popular</name> <author>Joomla! Project</author> <creationDate>January 2013</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.1.0</version> <description>MOD_TAGS_POPULAR_XML_DESCRIPTION</description> <files> <filename module="mod_tags_popular">mod_tags_popular.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_tags_popular.ini</language> <language tag="en-GB">en-GB.mod_tags_popular.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_TAGS_POPULAR" /> <config> <fields name="params"> <fieldset name="basic"> <field name="maximum" type="integer" default="5" first="1" last="20" step="1" label="MOD_TAGS_POPULAR_MAX_LABEL" description="MOD_TAGS_POPULAR_MAX_DESC"> </field> <field name="timeframe" type="list" default="alltime" label="MOD_TAGS_POPULAR_FIELD_TIMEFRAME_LABEL" description="MOD_TAGS_POPULAR_FIELD_TIMEFRAME_DESC"> <option value="alltime">MOD_TAGS_POPULAR_FIELD_ALL_TIME</option> <option value="hour">MOD_TAGS_POPULAR_FIELD_LAST_HOUR</option> <option value="day">MOD_TAGS_POPULAR_FIELD_LAST_DAY</option> <option value="week">MOD_TAGS_POPULAR_FIELD_LAST_WEEK</option> <option value="month">MOD_TAGS_POPULAR_FIELD_LAST_MONTH</option> <option value="year">MOD_TAGS_POPULAR_FIELD_LAST_YEAR</option> </field> <field name="order_value" type="list" default="count" label="MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_LABEL" description="MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_DESC"> <option value="title">MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_TITLE</option> <option value="count">MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_COUNT</option> <option value="rand()">MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_RANDOM</option> </field> <field name="order_direction" type="list" default="1" label="JGLOBAL_ORDER_DIRECTION_LABEL" description="JGLOBAL_ORDER_DIRECTION_DESC"> <option value="0">JGLOBAL_ORDER_ASCENDING</option> <option value="1">JGLOBAL_ORDER_DESCENDING</option> </field> <field name="display_count" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_TAGS_POPULAR_FIELD_DISPLAY_COUNT_LABEL" description="MOD_TAGS_POPULAR_FIELD_DISPLAY_COUNT_DESC" filter="integer"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="no_results_text" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_TAGS_POPULAR_FIELD_NO_RESULTS_LABEL" description="MOD_TAGS_POPULAR_FIELD_NO_RESULTS_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> <fieldset name="cloud" label="MOD_TAGS_POPULAR_FIELDSET_CLOUD_LABEL"> <field name="minsize" type="text" default="1" label="MOD_TAGS_POPULAR_FIELD_MINSIZE_LABEL" description="MOD_TAGS_POPULAR_FIELD_MINSIZE_DESC" filter="float" /> <field name="maxsize" type="text" default="2" label="MOD_TAGS_POPULAR_FIELD_MAXSIZE_LABEL" description="MOD_TAGS_POPULAR_FIELD_MAXSIZE_DESC" filter="float" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" default="_:default" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="owncache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\k`mm'modules/mod_tags_popular/tmpl/cloud.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $minsize = $params->get('minsize', 1); $maxsize = $params->get('maxsize', 2); JLoader::register('TagsHelperRoute', JPATH_BASE . '/components/com_tags/helpers/route.php'); ?> <div class="tagspopular<?php echo $moduleclass_sfx; ?> tagscloud<?php echo $moduleclass_sfx; ?>"> <?php if (!count($list)) : ?> <div class="alert alert-no-items"><?php echo JText::_('MOD_TAGS_POPULAR_NO_ITEMS_FOUND'); ?></div> <?php else : // Find maximum and minimum count $mincount = null; $maxcount = null; foreach ($list as $item) { if ($mincount === null or $mincount > $item->count) { $mincount = $item->count; } if ($maxcount === null or $maxcount < $item->count) { $maxcount = $item->count; } } $countdiff = $maxcount - $mincount; foreach ($list as $item) : if ($countdiff == 0) : $fontsize = $minsize; else : $fontsize = $minsize + (($maxsize - $minsize) / ($countdiff)) * ($item->count - $mincount); endif; ?> <span class="tag"> <a class="tag-name" style="font-size: <?php echo $fontsize . 'em'; ?>" href="<?php echo JRoute::_(TagsHelperRoute::getTagRoute($item->tag_id . ':' . $item->alias)); ?>"> <?php echo htmlspecialchars($item->title); ?></a> <?php if ($display_count) : ?> <span class="tag-count badge badge-info"><?php echo $item->count; ?></span> <?php endif; ?> </span> <?php endforeach; ?> <?php endif; ?> </div> PK���\�/y��)modules/mod_tags_popular/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php JLoader::register('TagsHelperRoute', JPATH_BASE . '/components/com_tags/helpers/route.php'); ?> <div class="tagspopular<?php echo $moduleclass_sfx; ?>"> <?php if (!count($list)) : ?> <div class="alert alert-no-items"><?php echo JText::_('MOD_TAGS_POPULAR_NO_ITEMS_FOUND'); ?></div> <?php else : ?> <ul> <?php foreach ($list as $item) : ?> <li><?php $route = new TagsHelperRoute; ?> <a href="<?php echo JRoute::_(TagsHelperRoute::getTagRoute($item->tag_id . '-' . $item->alias)); ?>"> <?php echo htmlspecialchars($item->title); ?></a> <?php if ($display_count) : ?> <span class="tag-count badge badge-info"><?php echo $item->count; ?></span> <?php endif; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> </div> PK���\�bI�[ [ #modules/mod_tags_popular/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_tags_popular * * @package Joomla.Site * @subpackage mod_tags_popular * @since 3.1 */ abstract class ModTagsPopularHelper { /** * Get list of popular tags * * @param \Joomla\Registry\Registry &$params module parameters * * @return mixed */ public static function getList(&$params) { $db = JFactory::getDbo(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $timeframe = $params->get('timeframe', 'alltime'); $maximum = $params->get('maximum', 5); $order_value = $params->get('order_value', 'title'); $nowDate = JFactory::getDate()->toSql(); $nullDate = $db->quote($db->getNullDate()); if ($order_value == 'rand()') { $order_direction = ''; } else { $order_value = $db->quoteName($order_value); $order_direction = $params->get('order_direction', 1) ? 'DESC' : 'ASC'; } $query = $db->getQuery(true) ->select( array( 'MAX(' . $db->quoteName('tag_id') . ') AS tag_id', ' COUNT(*) AS count', 'MAX(t.title) AS title', 'MAX(' . $db->quoteName('t.access') . ') AS access', 'MAX(' . $db->quoteName('t.alias') . ') AS alias' ) ) ->group($db->quoteName(array('tag_id', 'title', 'access', 'alias'))) ->from($db->quoteName('#__contentitem_tag_map', 'm')) ->where($db->quoteName('t.access') . ' IN (' . $groups . ')'); // Only return published tags $query->where($db->quoteName('t.published') . ' = 1 '); // Optionally filter on language $language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all'); if ($language != 'all') { if ($language == 'current_language') { $language = JHelperContent::getCurrentLanguage(); } $query->where($db->quoteName('t.language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')'); } if ($timeframe != 'alltime') { $query->where($db->quoteName('tag_date') . ' > ' . $query->dateAdd($nowDate, '-1', strtoupper($timeframe))); } $query->join('INNER', $db->quoteName('#__tags', 't') . ' ON ' . $db->quoteName('tag_id') . ' = t.id') ->join('INNER', $db->quoteName('#__ucm_content', 'c') . ' ON ' . $db->quoteName('m.core_content_id') . ' = ' . $db->quoteName('c.core_content_id')) ->order($order_value . ' ' . $order_direction); $query->where($db->quoteName('m.type_alias') . ' = ' . $db->quoteName('c.core_type_alias')); // Only return tags connected to published articles $query->where($db->quoteName('c.core_state') . ' = 1') ->where('(' . $db->quoteName('c.core_publish_up') . ' = ' . $nullDate . ' OR ' . $db->quoteName('c.core_publish_up') . ' <= ' . $db->quote($nowDate) . ')') ->where('(' . $db->quoteName('c.core_publish_down') . ' = ' . $nullDate . ' OR ' . $db->quoteName('c.core_publish_down') . ' >= ' . $db->quote($nowDate) . ')'); $db->setQuery($query, 0, $maximum); try { $results = $db->loadObjectList(); } catch (RuntimeException $e) { $results = array(); JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); } return $results; } } PK���\��%���-modules/mod_tags_popular/mod_tags_popular.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_tags_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $cacheparams = new stdClass; $cacheparams->cachemode = 'safeuri'; $cacheparams->class = 'ModTagsPopularHelper'; $cacheparams->method = 'getList'; $cacheparams->methodparams = $params; $cacheparams->modeparams = array('id' => 'array', 'Itemid' => 'int'); $list = JModuleHelper::moduleCache($module, $params, $cacheparams); if (!count($list) && !$params->get('no_results_text')) { return; } $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $display_count = $params->get('display_count', 0); require JModuleHelper::getLayoutPath('mod_tags_popular', $params->get('layout', 'default')); PK���\_vA��/modules/mod_related_items/mod_related_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_related_items * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $cacheparams = new stdClass; $cacheparams->cachemode = 'safeuri'; $cacheparams->class = 'ModRelatedItemsHelper'; $cacheparams->method = 'getList'; $cacheparams->methodparams = $params; $cacheparams->modeparams = array('id' => 'int', 'Itemid' => 'int'); $list = JModuleHelper::moduleCache($module, $params, $cacheparams); if (!count($list)) { return; } $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $showDate = $params->get('showDate', 0); require JModuleHelper::getLayoutPath('mod_related_items', $params->get('layout', 'default')); PK���\�=lHH*modules/mod_related_items/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_related_items * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <ul class="relateditems<?php echo $moduleclass_sfx; ?>"> <?php foreach ($list as $item) : ?> <li> <a href="<?php echo $item->route; ?>"> <?php if ($showDate) echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')) . " - "; ?> <?php echo $item->title; ?></a> </li> <?php endforeach; ?> </ul> PK���\B��q77$modules/mod_related_items/helper.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_related_items * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE . '/components/com_content/helpers/route.php'; /** * Helper for mod_related_items * * @package Joomla.Site * @subpackage mod_related_items * @since 1.5 */ abstract class ModRelatedItemsHelper { /** * Get a list of related articles * * @param \Joomla\Registry\Registry &$params module parameters * * @return array */ public static function getList(&$params) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $date = JFactory::getDate(); $maximum = (int) $params->get('maximum', 5); $option = $app->input->get('option'); $view = $app->input->get('view'); $temp = $app->input->getString('id'); $temp = explode(':', $temp); $id = $temp[0]; $nullDate = $db->getNullDate(); $now = $date->toSql(); $related = array(); $query = $db->getQuery(true); if ($option == 'com_content' && $view == 'article' && $id) { // Select the meta keywords from the item $query->select('metakey') ->from('#__content') ->where('id = ' . (int) $id); $db->setQuery($query); try { $metakey = trim($db->loadResult()); } catch (RuntimeException $e) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return; } // Explode the meta keys on a comma $keys = explode(',', $metakey); $likes = array(); // Assemble any non-blank word(s) foreach ($keys as $key) { $key = trim($key); if ($key) { $likes[] = $db->escape($key); } } if (count($likes)) { // Select other items based on the metakey field 'like' the keys found $query->clear() ->select('a.id') ->select('a.title') ->select('DATE(a.created) as created') ->select('a.catid') ->select('a.language') ->select('cc.access AS cat_access') ->select('cc.published AS cat_state'); // Sqlsrv changes $case_when = ' CASE WHEN '; $case_when .= $query->charLength('a.alias', '!=', '0'); $case_when .= ' THEN '; $a_id = $query->castAsChar('a.id'); $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $a_id . ' END as slug'; $query->select($case_when); $case_when = ' CASE WHEN '; $case_when .= $query->charLength('cc.alias', '!=', '0'); $case_when .= ' THEN '; $c_id = $query->castAsChar('cc.id'); $case_when .= $query->concatenate(array($c_id, 'cc.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $c_id . ' END as catslug'; $query->select($case_when) ->from('#__content AS a') ->join('LEFT', '#__content_frontpage AS f ON f.content_id = a.id') ->join('LEFT', '#__categories AS cc ON cc.id = a.catid') ->where('a.id != ' . (int) $id) ->where('a.state = 1') ->where('a.access IN (' . $groups . ')'); $wheres = array(); foreach ($likes as $keyword) { $wheres[] = 'a.metakey LIKE ' . $db->quote('%' . $keyword . '%'); } $query->where('(' . implode(' OR ', $wheres) . ')') ->where('(a.publish_up = ' . $db->quote($nullDate) . ' OR a.publish_up <= ' . $db->quote($now) . ')') ->where('(a.publish_down = ' . $db->quote($nullDate) . ' OR a.publish_down >= ' . $db->quote($now) . ')'); // Filter by language if (JLanguageMultilang::isEnabled()) { $query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } $db->setQuery($query, 0, $maximum); try { $temp = $db->loadObjectList(); } catch (RuntimeException $e) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return; } if (count($temp)) { foreach ($temp as $row) { if ($row->cat_state == 1) { $row->route = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language)); $related[] = $row; } } } unset ($temp); } } return $related; } } PK���\�M�# # /modules/mod_related_items/mod_related_items.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="site" method="upgrade"> <name>mod_related_items</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_RELATED_XML_DESCRIPTION</description> <files> <filename module="mod_related_items">mod_related_items.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_related_items.ini</language> <language tag="en-GB">en-GB.mod_related_items.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_RELATED" /> <config> <fields name="params"> <fieldset name="basic"> <field name="showDate" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_RELATED_FIELD_SHOWDATE_LABEL" description="MOD_RELATED_FIELD_SHOWDATE_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="maximum" type="text" default="5" label="MOD_RELATED_FIELD_MAX_LABEL" description="MOD_RELATED_FIELD_MAX_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="owncache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\�V�cache/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\��FN�F�FLICENSE.txtnu�[��� GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. PK���\�:bmlltemplates/system/error.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Template.system * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; if (!isset($this->error)) { $this->error = JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); $this->debug = false; } // Get language and direction $doc = JFactory::getDocument(); $app = JFactory::getApplication(); $this->language = $doc->language; $this->direction = $doc->direction; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $this->error->getCode(); ?> - <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></title> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/error.css" type="text/css" /> <?php if ($this->direction == 'rtl') : ?> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/error_rtl.css" type="text/css" /> <?php endif; ?> <?php if ($app->get('debug_lang', '0') == '1' || $app->get('debug', '0') == '1') : ?> <link rel="stylesheet" href="<?php echo $this->baseurl ?>/media/cms/css/debug.css" type="text/css" /> <?php endif; ?> </head> <body> <div class="error"> <div id="outline"> <div id="errorboxoutline"> <div id="errorboxheader"><?php echo $this->error->getCode(); ?> - <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></div> <div id="errorboxbody"> <p><strong><?php echo JText::_('JERROR_LAYOUT_NOT_ABLE_TO_VISIT'); ?></strong></p> <ol> <li><?php echo JText::_('JERROR_LAYOUT_AN_OUT_OF_DATE_BOOKMARK_FAVOURITE'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_SEARCH_ENGINE_OUT_OF_DATE_LISTING'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_MIS_TYPED_ADDRESS'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_YOU_HAVE_NO_ACCESS_TO_THIS_PAGE'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_REQUESTED_RESOURCE_WAS_NOT_FOUND'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_ERROR_HAS_OCCURRED_WHILE_PROCESSING_YOUR_REQUEST'); ?></li> </ol> <p><strong><?php echo JText::_('JERROR_LAYOUT_PLEASE_TRY_ONE_OF_THE_FOLLOWING_PAGES'); ?></strong></p> <ul> <li><a href="<?php echo $this->baseurl; ?>/index.php" title="<?php echo JText::_('JERROR_LAYOUT_GO_TO_THE_HOME_PAGE'); ?>"><?php echo JText::_('JERROR_LAYOUT_HOME_PAGE'); ?></a></li> </ul> <p><?php echo JText::_('JERROR_LAYOUT_PLEASE_CONTACT_THE_SYSTEM_ADMINISTRATOR'); ?></p> <div id="techinfo"> <p><?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></p> <p> <?php if ($this->debug) : ?> <?php echo $this->renderBacktrace(); ?> <?php endif; ?> </p> </div> </div> </div> </div> </div> </body> </html> PK���\��4))!templates/system/html/modules.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Template.system * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /* * none (output raw module content) */ function modChrome_none($module, &$params, &$attribs) { echo $module->content; } /* * html5 (chosen html5 tag and font header tags) */ function modChrome_html5($module, &$params, &$attribs) { $moduleTag = $params->get('module_tag', 'div'); $headerTag = htmlspecialchars($params->get('header_tag', 'h3')); $bootstrapSize = (int) $params->get('bootstrap_size', 0); $moduleClass = $bootstrapSize != 0 ? ' span' . $bootstrapSize : ''; // Temporarily store header class in variable $headerClass = $params->get('header_class'); $headerClass = !empty($headerClass) ? ' class="' . htmlspecialchars($headerClass) . '"' : ''; if (!empty ($module->content)) : ?> <<?php echo $moduleTag; ?> class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx')) . $moduleClass; ?>"> <?php if ((bool) $module->showtitle) :?> <<?php echo $headerTag . $headerClass . '>' . $module->title; ?></<?php echo $headerTag; ?>> <?php endif; ?> <?php echo $module->content; ?> </<?php echo $moduleTag; ?>> <?php endif; } /* * Module chrome that wraps the module in a table */ function modChrome_table($module, &$params, &$attribs) { ?> <table cellpadding="0" cellspacing="0" class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx')); ?>"> <?php if ((bool) $module->showtitle) : ?> <tr> <th> <?php echo $module->title; ?> </th> </tr> <?php endif; ?> <tr> <td> <?php echo $module->content; ?> </td> </tr> </table> <?php } /* * Module chrome that wraps the tabled module output in a <td> tag of another table */ function modChrome_horz($module, &$params, &$attribs) { ?> <table cellspacing="1" cellpadding="0" width="100%"> <tr> <td> <?php modChrome_table($module, $params, $attribs); ?> </td> </tr> </table> <?php } /* * xhtml (divs and font header tags) * With the new advanced parameter it does the same as the html5 chrome */ function modChrome_xhtml($module, &$params, &$attribs) { $moduleTag = $params->get('module_tag', 'div'); $headerTag = htmlspecialchars($params->get('header_tag', 'h3')); $bootstrapSize = (int) $params->get('bootstrap_size', 0); $moduleClass = $bootstrapSize != 0 ? ' span' . $bootstrapSize : ''; // Temporarily store header class in variable $headerClass = $params->get('header_class'); $headerClass = ($headerClass) ? ' class="' . htmlspecialchars($headerClass) . '"' : ''; if (!empty ($module->content)) : ?> <<?php echo $moduleTag; ?> class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx')) . $moduleClass; ?>"> <?php if ((bool) $module->showtitle) : ?> <<?php echo $headerTag . $headerClass . '>' . $module->title; ?></<?php echo $headerTag; ?>> <?php endif; ?> <?php echo $module->content; ?> </<?php echo $moduleTag; ?>> <?php endif; } /* * Module chrome that allows for rounded corners by wrapping in nested div tags */ function modChrome_rounded($module, &$params, &$attribs) { ?> <div class="module<?php echo htmlspecialchars($params->get('moduleclass_sfx')); ?>"> <div> <div> <div> <?php if ((bool) $module->showtitle) : ?> <h3><?php echo $module->title; ?></h3> <?php endif; ?> <?php echo $module->content; ?> </div> </div> </div> </div> <?php } /* * Module chrome that add preview information to the module */ function modChrome_outline($module, &$params, &$attribs) { static $css = false; if (!$css) { $css = true; $doc = JFactory::getDocument(); $doc->addStyleDeclaration(".mod-preview-info { padding: 2px 4px 2px 4px; border: 1px solid black; position: absolute; background-color: white; color: red;}"); $doc->addStyleDeclaration(".mod-preview-wrapper { background-color:#eee; border: 1px dotted black; color:#700;}"); } ?> <div class="mod-preview"> <div class="mod-preview-info"><?php echo 'Position: ' . $module->position . ' [ Style: ' . $module->style . ']'; ?></div> <div class="mod-preview-wrapper"> <?php echo $module->content; ?> </div> </div> <?php } PK���\�i����templates/system/css/system.cssnu�[���/** * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ /* Import project-level system CSS */ @import url(../../../media/system/css/system.css); /* Unpublished */ .system-unpublished, tr.system-unpublished { background: #e8edf1; border-top: 4px solid #c4d3df; border-bottom: 4px solid #c4d3df; } span.highlight { background-color:#FFFFCC; font-weight:bold; padding:1px 4px; } .img-fulltext-float-right { float: right; margin-left: 10px; margin-bottom: 10px; } .img-fulltext-float-left { float: left; margin-right: 10px; margin-bottom: 10px; } .img-fulltext-float-none { } .img-intro-float-right { float: right; margin-left: 5px; margin-bottom: 5px; } .img-intro-float-left { float: left; margin-right: 5px; margin-bottom: 5px; } .img-intro-float-none { }PK���\ᮙ:��templates/system/css/editor.cssnu�[���/** * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ body { background: #fff; font-family: Tahoma,Helvetica,Arial,sans-serif; line-height: 1.3em; font-size: 76%; color: #333; } h1 { font-family:Helvetica ,Arial,sans-serif; font-size: 16px; font-weight: bold; color: #666; } h2 { font-family: Arial, Helvetica,sans-serif; font-size: 14px; font-weight: normal; color: #333; } h3 { font-weight: bold; font-family: Helvetica,Arial,sans-serif; font-size: 13px; color: #135cae; } h4 { font-weight: bold; font-family: Arial, Helvetica, sans-serif; color: #333; } a:link, a:visited { color: #1B57B1; text-decoration: none; font-weight: normal; } a:hover { color: #00c; text-decoration: underline; font-weight: normal; } div.caption { padding: 0 10px 0 10px; } div.caption img { border: 1px solid #CCC; } div.caption p { font-size: .90em; color: #666; text-align: center; } /* STYLES FOR JOOMLA! EDITOR */ hr#system-readmore { border: red dashed 1px; color: red; } hr.system-pagebreak { border: gray dashed 1px; color: gray; }PK���\��l�HH"templates/system/css/error_rtl.cssnu�[���/** * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ /* Start Common Styles */ body { text-align: right; } .TD{ text-align: left; } #errorboxbody { text-align: right; } #techinfo { text-align: right; } PK���\A�?`` templates/system/css/toolbar.cssnu�[���/** * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ div.toolbar-list { margin-right: 10px; float: right; text-align: right; } div.toolbar-list a { color : #808080; text-decoration : none; display: block; float: left; border: 1px solid #DDD; width: 40px; padding: 2px 5px 2px 5px; } div.toolbar-list a:hover { color : #C64934; cursor: pointer; border: 1px solid #c24733; background-color: #f1e8e6; padding: 3px 5px 1px 5px; } div.toolbar-list a:active { color : #FF9900; }PK���\�l���templates/system/css/error.cssnu�[���/** * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ /* Start Common Styles */ * { font-family: helvetica, arial, sans-serif; font-size: 11px; color: #5F6565; } html { height: 100%; margin-bottom: 1px; } body { margin: 0px; padding: 0px; height: 100%; margin-bottom: 1px; background: #FFFFFF; font-family: helvetica, arial, sans-serif; font-weight: normal; padding-top: 0px; margin-top: 0px; } .error { margin-left: auto; margin-right: auto; } table, td, th, div, pre, blockquote, ul, ol, dl, address,.componentheading,.contentheading,.contentpagetitle,.sectiontableheader,.newsfeedheading { font-family: helvetica, arial, sans-serif; font-weight: normal; } #outline { width: 900px; margin: 0 auto; padding: 0px; padding-top: 60px; padding-bottom: 60px; background: #FFFFFF; } #errorboxoutline { width: 900px; margin: 0px; padding: 0px; border: 1px solid #000000; } #errorboxheader { width: 900px; margin: 0px; padding: 0px; background: #E44249; color: #FFFFFF; font-weight: bold; font-size: 12px; line-height: 22px; text-align: center; border-bottom: 1px solid #000000; } #errorboxbody { margin: 0px; padding: 10px; text-align: left; } #techinfo { margin: 10px; padding: 10px; text-align: left; border: 1px solid #CCCCCC; color: #CCCCCC; } #techinfo p { color: #CCCCCC; }PK���\��~�� templates/system/css/offline.cssnu�[���/** * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ body { margin: 0; padding: 0; font-family: Arial, Helvetica, Sans Serif; font-size: 78%; color: #333333; text-align: center; } img { border: 0 none; margin-left: auto; margin-right: auto; } /* -- id styles ------------------------------------- */ #frame { margin: 20px auto; width: 400px; padding: 20px; } #frame img { max-width: 100%; height: auto; } #frame form { text-align: left; } /* -- class styles ---------------------------------- */ .outline { border: 1px solid #cccccc; background: #ffffff; padding: 2px; } /* -- form styles ----------------------------------- */ form { margin: auto; } form p { margin: 0; padding: 0; } form fieldset { border: 0 none; margin: 0em; padding: 0.2em;} label { display: block; float: left; } input { padding: 1px; } input.button { width: auto; height: 1.8em; cursor: pointer; } label { margin: 5px 0px 2px 0px; width: 10em;} form p { padding: 0.2em 0 0.2em 0; } form br { display: none; } input { border: 1px solid #0E67A1; } input.button { background-color: white; } input.button:hover { border-color: #FC902E; } fieldset.input p {clear: left;} #frmlogin { margin: 0 10px 0 10px; } #frmlogin fieldset.button { text-align: right; } /* -- message styles ----------------------------------- */ #system-message { margin: 0 auto; padding: 20px 0 0; width: 445px; } .alert { background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #CCCCCC; padding: 8px 25px 8px 14px; text-align: left; } .alert h4 { color: red; margin: 5px 0; } .alert p { padding: 0px; margin: 0px; } .alert .close { float: right; font-size: 24px; line-height: 18px; position: relative; right: -20px; top: -2px; cursor: pointer; } .login { margin-top: 5px; } PK���\�os�$$$templates/system/css/offline_rtl.cssnu�[���/** * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ /** * Joomla! 1.5 Offline RTL css file * * @package Joomla * @since 1.5 * @version 1.0 */ #frame form{ text-align: right; } label { float:right; } fieldset.input p {clear: right;} /* -- message styles ----------------------------------- */ .alert { padding: 8px 8px 25px 14px; text-align: right; } .alert .close { float: left; left: -20px; right: 0px; }PK���\H��d� � templates/system/css/general.cssnu�[���/** * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ /* Form validation */ .invalid { border-color: #ff0000; } label.invalid { color: #ff0000; } /* Buttons */ #editor-xtd-buttons { padding: 5px; } .button2-left, .button2-right, .button2-left div, .button2-right div { float: left; } .button2-left a, .button2-right a, .button2-left span, .button2-right span { display: block; height: 22px; float: left; line-height: 22px; font-size: 11px; color: #666; cursor: pointer; } .button2-left span, .button2-right span { cursor: default; color: #999; } .button2-left .page a, .button2-right .page a, .button2-left .page span, .button2-right .page span { padding: 0 6px; } .page span { color: #000; font-weight: bold; } .button2-left a:hover, .button2-right a:hover { text-decoration: none; color: #0B55C4; } .button2-left a, .button2-left span { padding: 0 24px 0 6px; } .button2-right a, .button2-right span { padding: 0 6px 0 24px; } .button2-left { background: url(../images/j_button2_left.png) no-repeat; float: left; margin-left: 5px; } .button2-right { background: url(../images/j_button2_right.png) 100% 0 no-repeat; float: left; margin-left: 5px; } .button2-left .image { background: url(../images/j_button2_image.png) 100% 0 no-repeat; } .button2-left .readmore, .button2-left .article { background: url(../images/j_button2_readmore.png) 100% 0 no-repeat; } .button2-left .pagebreak { background: url(../images/j_button2_pagebreak.png) 100% 0 no-repeat; } .button2-left .blank { background: url(../images/j_button2_blank.png) 100% 0 no-repeat; } /* Tooltips */ div.tooltip { float: left; background: #ffc; border: 1px solid #D4D5AA; padding: 5px; max-width: 200px; z-index:13000; } div.tooltip h4 { padding: 0; margin: 0; font-size: 95%; font-weight: bold; margin-top: -15px; padding-top: 15px; padding-bottom: 5px; background: url(../images/selector-arrow.png) no-repeat; } div.tooltip p { font-size: 90%; margin: 0; } /* Caption fixes */ /* Caption fixes */ .img_caption .left { float: left; margin-right: 1em; } .img_caption .right { float: right; margin-left: 1em; } .img_caption .left p { clear: left; text-align: center; } .img_caption .right p { clear: right; text-align: center; } .img_caption { text-align: center!important; } .img_caption.none { margin-left:auto; margin-right:auto; } /* Calendar */ a img.calendar { width: 16px; height: 16px; margin-left: 3px; background: url(../images/calendar.png) no-repeat; cursor: pointer; vertical-align: middle; } PK���\�9v;55templates/system/index.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Template.system * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; include __DIR__ . '/component.php'; PK���\�T�t<<templates/system/component.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Template.system * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head> <jdoc:include type="head" /> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/general.css" type="text/css" /> </head> <body class="contentpane"> <jdoc:include type="message" /> <jdoc:include type="component" /> </body> </html> PK���\���;9 9 templates/system/offline.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Template.system * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); // Add JavaScript Frameworks JHtml::_('bootstrap.framework'); require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; $twofactormethods = UsersHelper::getTwoFactorMethods(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head> <jdoc:include type="head" /> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/offline.css" type="text/css" /> <?php if ($this->direction == 'rtl') : ?> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/offline_rtl.css" type="text/css" /> <?php endif; ?> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/general.css" type="text/css" /> </head> <body> <jdoc:include type="message" /> <div id="frame" class="outline"> <?php if ($app->get('offline_image') && file_exists($app->get('offline_image'))) : ?> <img src="<?php echo $app->get('offline_image'); ?>" alt="<?php echo htmlspecialchars($app->get('sitename')); ?>" /> <?php endif; ?> <h1> <?php echo htmlspecialchars($app->get('sitename')); ?> </h1> <?php if ($app->get('display_offline_message', 1) == 1 && str_replace(' ', '', $app->get('offline_message')) != '') : ?> <p> <?php echo $app->get('offline_message'); ?> </p> <?php elseif ($app->get('display_offline_message', 1) == 2 && str_replace(' ', '', JText::_('JOFFLINE_MESSAGE')) != '') : ?> <p> <?php echo JText::_('JOFFLINE_MESSAGE'); ?> </p> <?php endif; ?> <form action="<?php echo JRoute::_('index.php', true); ?>" method="post" id="form-login"> <fieldset class="input"> <p id="form-login-username"> <label for="username"><?php echo JText::_('JGLOBAL_USERNAME'); ?></label> <input name="username" id="username" type="text" class="inputbox" alt="<?php echo JText::_('JGLOBAL_USERNAME'); ?>" size="18" /> </p> <p id="form-login-password"> <label for="passwd"><?php echo JText::_('JGLOBAL_PASSWORD'); ?></label> <input type="password" name="password" class="inputbox" size="18" alt="<?php echo JText::_('JGLOBAL_PASSWORD'); ?>" id="passwd" /> </p> <?php if (count($twofactormethods) > 1) : ?> <p id="form-login-secretkey"> <label for="secretkey"><?php echo JText::_('JGLOBAL_SECRETKEY'); ?></label> <input type="text" name="secretkey" class="inputbox" size="18" alt="<?php echo JText::_('JGLOBAL_SECRETKEY'); ?>" id="secretkey" /> </p> <?php endif; ?> <p id="submit-buton"> <label> </label> <input type="submit" name="Submit" class="button login" value="<?php echo JText::_('JLOGIN'); ?>" /> </p> <input type="hidden" name="option" value="com_users" /> <input type="hidden" name="task" value="user.login" /> <input type="hidden" name="return" value="<?php echo base64_encode(JUri::base()); ?>" /> <?php echo JHtml::_('form.token'); ?> </fieldset> </form> </div> </body> </html> PK���\�nx��+templates/system/images/j_button2_right.pngnu�[����PNG IHDR�F1k�IDATh���1 �@���m��6AH�!E�ER�=�̻´E m�df|ű��u;3v����3:�z7:�0giF��%�h�nt1�o�)����,�#��Ect�`�F�i��i�K�E(c}�Fg%o�qd8�����0Jyr��IEND�B`�PK���\��KE**/templates/system/images/j_button2_pagebreak.pngnu�[����PNG IHDR�j� PLTE�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ξ�ͽ�ɻ�ʸ�ƹ���������T�w�IDATx^m�5rD1��I�i�������?��*W�_��6����4�W����=�L6/qi����h�2h�#��,;�|G��cӸ^�O ��Ҫ�ΕF/����[��1?�c�����9��AQݭ�CP��V7�fϿs���c8A��{��~c��% ����B-�h��x�FmÕ&�XrI�Ɋq%�l]\�!�@��n�IEND�B`�PK���\�Z{��+templates/system/images/j_button2_blank.pngnu�[����PNG IHDR��3�rIDATm���0������$8%F�P!S�y���+!N��ǶN>�i��wi�'���ٸm���Xbv��C�!��;D�g�H�����;\K�ꁡ�NVb�: \i�����tf)�}IEND�B`�PK���\ ��jj$templates/system/images/calendar.pngnu�[����PNG IHDR�a1IDATx^�SMkQ=3�~�j"$LUQE�w�N�ʍ"�AA�t���(�*��(�~�!���Bզ��&�3���KH7����p��Ý73c;�(��F�qY2 $B�Tg���UR0$Q��#î1_�0�3����������}�;y`�H���vpl���~ތ7I�u04�H�b�2Q�6�GHt$A����NB���6��`���x�[u���Ya����~���̒�r��#��8�@JX��b �ebj����r ��;x7C`"�n�hxl�+A4�ʵ_6O%JzR�g�:���(?N?��髮�~���{'`<&�"U�r�>/nÇ0M�/yX���Da� A��%���Ο B�Ё�0�Nqvh�3QDNG��o!�뇷��1��,��(��y0OW�@�XY��?؋���ΗS���3����x�� o>i~���b9��p�k��;�?<�;0�;P��A6�8@n}�ݽȬ�����=���2T"�H<�i��-ɫn�*)�5R�_�n��U�����aJ��IEND�B`�PK���\�� %%+templates/system/images/j_button2_image.pngnu�[����PNG IHDR�j� �PLTE���������������������������������������������ڿ����������������������˪������ǚ�ټ����ն��������s�|r�{~��h��(�3�����������������������������ڻ��������������߾ۣ�ۡ�����������������������ѷ�������������ر��������ۨ����Ҫӥ����Р������Ϥ������҉��ͼ����ͺ�ɗ���亸�Ǹ�Ŵ�ƹ���̑��ŝ�Ŝ����ŵ�ô����݈ȑ��Ī����뢸�}�r��ʘ����ۮ�����w����������Ў�Ł�Ȗ����ب�����z�×��[�Y]�a}��{�����r��p��K�Uk�����c��^��^��X�����[��S��)�-IDATx^e�S�A�Ѫjcl{ֶm۶m�ɛ=��1}��{���$0�:�1J���r�����(Y�f�!�F#����l1�r��㪧 ��)yq��_�3��"H�����/��&$@EQ�[��� �l�P� ���V�N�nw��a0�Ҁ ���R�?��6���wb@�,�m��o��Z�v�)�x�wF"�ǹڦᢍ��r���l��X�u4�T��9��(�i���B�`p���,�d2�J�RY�,{���<�LQ fT��yQ�V9�)�Jm�ڇ*UD���*�ƪ�?m����U�x��ZIEND�B`�PK���\�yO0qq.templates/system/images/j_button2_readmore.pngnu�[����PNG IHDR�j� APLTE�����������������������������������������������������������������������������������������������������������������������������������������������������������a�����������������ݟ������ָ��Ϣ�@��������������ԫ��ى��c��?�ԑ��ӫԌ��\��ѸȾ�����ͽ�ϼ�͚�b�ʝ�Ή�Ĭ��ɺ�ȹ�ƛ�c�����ŵ����������]��kI���IDATx^m�Ӛ1��dhkm۶m[��>��*�_�m��O��ݿ�V&PDޒ�+ � L����6�����E��h6��D�q×�FR_��=/%�x`���� &��;�p@<��R�\"�N�x�ן�H�{��j{����K(�LtĎvs���8;κ�� �j,���v�2?#� �kм���G��b�]��T3h�V��x�rE�ǡEV.m@�$�藊������R8EGF�n�IEND�B`�PK���\Kr��*templates/system/images/j_button2_left.pngnu�[����PNG IHDR�Պ0�yIDAT�A�@��lGIt�d_Y�D�Н��{�4�@��_��i�z�|Zh�����\7�j���6@�G`g�l�� �H9\���]`���T�2x�T�&�`���D���` kŖIEND�B`�PK���\6g���*templates/system/images/selector-arrow.pngnu�[����PNG IHDR X0$�0PLTE������������������ޱ�����������������)��tRNS@��fDIDATx�M�A� ���q���V�����e̬K դ�i����%�:x�;KL:�Z�ΆD:"�4�xo�U�IEND�B`�PK���\�V�templates/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\_�$*templates/protostar/less/template_rtl.lessnu�[���// Specific RTL. rtl class is added to body tag // Fix for sub menu alignment .rtl .navigation .nav-child { left: auto; right:0; } .rtl .navigation .nav > li > .nav-child:before { left: auto; right:12px; } .rtl .navigation .nav > li > .nav-child:after { left: auto; right:13px; }PK���\.��T��%templates/protostar/less/icomoon.lessnu�[���@font-face { font-family: 'IcoMoon'; src: url('../../../media/jui/fonts/IcoMoon.eot'); src: url('../../../media/jui/fonts/IcoMoon.eot?#iefix') format('embedded-opentype'), url('../../../media/jui/fonts/IcoMoon.woff') format('woff'), url('../../../media/jui/fonts/IcoMoon.ttf') format('truetype'), url('../../../media/jui/fonts/IcoMoon.svg#IcoMoon') format('svg'); font-weight: normal; font-style: normal; } @import "../../../media/jui/less/icomoon.less"; PK���\�;��2�2&templates/protostar/less/template.lessnu�[���// CSS Reset @import "../../../media/jui/less/reset.less"; // Core variables and mixins @import "variables.less"; // Custom for this template @import "template_rtl.less"; // Specific for rtl @import "../../../media/jui/less/mixins.less"; // Grid system and page structure @import "../../../media/jui/less/scaffolding.less"; @import "../../../media/jui/less/grid.less"; @import "../../../media/jui/less/layouts.less"; // Base CSS @import "../../../media/jui/less/type.less"; @import "../../../media/jui/less/code.less"; @import "../../../media/jui/less/forms.less"; @import "../../../media/jui/less/tables.less"; // Components: common // @import "../../../media/jui/less/sprites.less"; @import "../../../media/jui/less/dropdowns.less"; @import "../../../media/jui/less/wells.less"; @import "../../../media/jui/less/component-animations.less"; @import "../../../media/jui/less/close.less"; // Components: Buttons & Alerts @import "../../../media/jui/less/buttons.less"; @import "../../../media/jui/less/button-groups.less"; @import "../../../media/jui/less/alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less // Components: Nav @import "../../../media/jui/less/navs.less"; @import "../../../media/jui/less/navbar.less"; @import "../../../media/jui/less/breadcrumbs.less"; @import "../../../media/jui/less/pagination.less"; @import "../../../media/jui/less/pager.less"; // Components: Popovers @import "../../../media/jui/less/modals.less"; @import "../../../media/jui/less/tooltip.less"; @import "../../../media/jui/less/popovers.less"; // Components: Misc @import "../../../media/jui/less/thumbnails.less"; @import "../../../media/jui/less/labels-badges.less"; @import "../../../media/jui/less/progress-bars.less"; @import "../../../media/jui/less/accordion.less"; @import "../../../media/jui/less/carousel.less"; @import "../../../media/jui/less/hero-unit.less"; // Utility classes @import "../../../media/jui/less/utilities.less"; // RESPONSIVE CLASSES // ------------------ @import "../../../media/jui/less/responsive-utilities.less"; // MEDIA QUERIES // ------------------ // Phones to portrait tablets and narrow desktops @import "../../../media/jui/less/responsive-767px-max.less"; // Tablets to regular desktops @import "../../../media/jui/less/responsive-768px-979px.less"; // Large desktops @import "../../../media/jui/less/responsive-1200px-min.less"; // RESPONSIVE NAVBAR // ------------------ // From 979px and below, show a button to toggle navbar contents @import "../../../media/jui/less/responsive-navbar.less"; // Extended for JUI @import "../../../media/jui/less/bootstrap-extended.less"; // Has to be last to override when necessary // div.modal (instead of .modal) @import "../../../media/jui/less/modals.joomla.less"; @import "../../../media/jui/less/responsive-767px-max.joomla.less"; // Icon Font @import "icomoon.less"; /* Site Body Styles */ body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body.site{ border-top:3px solid #0088cc; padding: 20px; background-color: #f4f6f7; } body.site.fluid{ background-color: #ffffff; } .thumbnail { margin-bottom:9px; } .accordion-group { background:#fff; } /* Site Title (if no logo) */ .site-title { font-size: 40px; line-height: 48px; font-weight: bold; } .brand { color: darken(@linkColor, 20%); .transition(color .5s linear); } .brand:hover { color: @linkColor; text-decoration: none; } /* Header */ .header{ margin-bottom: 10px; } .header .finder { margin-top: 14px; } .header .finder .btn{ margin-top: 0px; } /* Nav */ .navigation{ padding: 5px 0; border-top: 1px solid rgba(0, 0, 0, 0.075); border-bottom: 1px solid rgba(0, 0, 0, 0.075); margin-bottom: 10px; } .navigation .nav-pills{ margin-bottom: 0; } /* Hero Banner Unit */ .hero-unit{ background-color: #08C; } .hero-unit > *{ color: white; text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5); } /* Container */ .container{ max-width: 960px; } .body .container{ background-color: #fff; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; padding: 20px; border: 1px solid rgba(0, 0, 0, 0.15); -moz-box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.05); -webkit-box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.05); box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.05); } /* Wells */ .well .page-header{ margin: 0px 0px 5px 0px; } /* Headings */ h1, h2, h3, h4, h5, h6 { margin: (@baseLineHeight / 1.5) 0; } h1 { font-size: 26px; line-height: 28px; } h2 { font-size: 22px; line-height: 24px; } h3 { font-size: 18px; line-height: 20px; } h4 { font-size: 14px; line-height: 16px; } h5 { font-size: 13px; line-height: 15px; } h6 { font-size: 12px; line-height: 14px; } /* Module */ .module-header { padding-bottom: 17px; margin: 20px 0 18px 0; border-bottom: 1px solid #eeeeee; } /* Single Item */ .item-title { margin-bottom:9px; } .item-content { margin:18px 0; } .item-subtitle { margin-bottom:9px; } .pull-right.item-image { margin:0 0 18px 20px; } .pull-left.item-image { margin:0 20px 18px 0; } .header .nav > li:last-child > .dropdown-menu, .item-actions .dropdown-menu, .item-comment .dropdown-menu { left:initial; right:0; } .article-index { margin:0 0 10px 10px; } /* List */ .list-item-title { margin-bottom:9px; } .list-item-content { margin:18px 0; } .list-item-subtitle { margin-bottom:9px; } /* More Items */ .items-more, .content-links { padding: 15px 0; } /* Breadcrumbs */ .breadcrumb { margin: 10px 0; } /* Caption fixes */ .img_caption .left { float: left; margin-right: 1em; } .img_caption .right { float: right; margin-left: 1em; } .img_caption .left p { clear: left; text-align: center; } .img_caption .right p { clear: right; text-align: center; } .img_caption { text-align: center!important; } .img_caption.none { margin-left:auto; margin-right:auto; } /* New captions */ figure { display: table; } figure.pull-center, img.pull-center { margin-left: auto; margin-right: auto; } figcaption { display: table-caption; caption-side: bottom; } /* Aside Subnavs */ #aside .nav .nav-child { border-left: 2px solid @tableBorder; padding-left: 5px; } /* Navigation Submenus */ // The dropdown menu (ul) // ---------------------- .navigation { .nav-child { position: absolute; top: 95%; left: 0; z-index: @zindexDropdown; display: none; // none by default, but block on "open" of the menu float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; // override default ul list-style: none; background-color: @dropdownBackground; border: 1px solid #ccc; // Fallback for IE7-8 border: 1px solid @dropdownBorder; *border-right-width: 2px; *border-bottom-width: 2px; .border-radius(6px); .box-shadow(0 5px 10px rgba(0,0,0,.2)); -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; // Aligns the dropdown menu to right &.pull-right { right: 0; left: auto; } // Dividers (basically an hr) within the dropdown .divider { .nav-divider(@dropdownDividerTop, @dropdownDividerBottom); } // Links within the dropdown menu a { display: block; padding: 3px 20px; clear: both; font-size: @baseFontSize; font-weight: normal; line-height: @baseLineHeight; color: @dropdownLinkColor; white-space: nowrap; } } .nav li { position: relative; } .nav > li:hover > .nav-child, .nav > li > a:focus + .nav-child, .nav li li:hover > .nav-child, .nav li li > a:focus + .nav-child { display: block; } .nav > li > .nav-child { &:before { position: absolute; top: -7px; left: 9px; display: inline-block; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-left: 7px solid transparent; border-bottom-color: rgba(0, 0, 0, 0.2); content: ''; } &:after { position: absolute; top: -6px; left: 10px; display: inline-block; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; border-left: 6px solid transparent; content: ''; } } .nav li li .nav-child { top: -8px; left: 100%; &:before { position: absolute; top: 9px; left: -7px; display: inline-block; border-top: 7px solid transparent; border-right: 7px solid rgba(0, 0, 0, 0.2); border-bottom: 7px solid transparent; content: ''; } &:after { position: absolute; top: 10px; left: -6px; display: inline-block; border-top: 6px solid transparent; border-right: 6px solid #ffffff; border-bottom: 6px solid transparent; content: ''; } } } // Hover state // ----------- .navigation .nav-child li > a:hover, .navigation .nav-child li > a:focus, .navigation .nav-child:hover > a { text-decoration: none; color: @dropdownLinkColorHover; background-color: @dropdownLinkBackgroundHover; #gradient > .vertical(@dropdownLinkBackgroundHover, darken(@dropdownLinkBackgroundHover, 5%)); } @media (max-width: 480px) { .item-info > span { display:block; } .blog-item .pull-right.item-image { margin:0 0 18px 0; } .blog-item .pull-left.item-image { margin:0 0 18px 0; float:none; } } @media (max-width: 768px) { body { padding-top: 0; } .header { background:transparent; } .header .brand { float:none; display:block; text-align:center; } .header .nav.pull-right, .header-search { float:none; display:block; } .header-search form { margin: 0; } .header-search .search-query { width: 90%; } .header .nav-pills > li > a { border: 1px solid @tableBorder; border-bottom:0; margin:0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; margin-right: 0; } .header .nav-pills > li:first-child > a { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .header .nav-pills > li:last-child > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; border-bottom:1px solid @tableBorder; } .modal.fade { top:-100%; } .nav-tabs { border-bottom: 0; } .nav-tabs > li { float: none; } .nav-tabs > li > a { border: 1px solid @tableBorder; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; margin-right: 0; } .nav-tabs > li:first-child > a { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .nav-tabs > li:last-child > a, .nav-tabs > .active:last-child > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; border-bottom:1px solid @tableBorder; } .nav-tabs > li > a:hover { border-color: @tableBorder; z-index: 2; } .nav-tabs.nav-dark > li > a { border: 1px solid @grayDark; } .nav-tabs > li:last-child > a, .nav-tabs > .active:last-child > a { border-bottom:1px solid @grayDark; } .nav-tabs.nav-dark > li > a:hover { border-color: @grayDark; } .nav-pills > li { float: none; } .nav-pills > li > a { margin-right: 0; } .nav-pills > li > a { margin-bottom: 3px; } .nav-pills > li:last-child > a { margin-bottom: 1px; } .form-search > .pull-left, .form-search > .pull-right { float:none; display:block; margin-bottom:9px; } } @media (max-width: 980px) { .navbar-fixed-top { margin-bottom:0!important; } .item-comment .item-image{ display:none; } .well { padding: 10px; } } @media (max-width: 979px) { .nav-collapse.in.collapse { overflow: visible; height: 0; z-index: 100; } } @media (min-width: 768px) and (max-width: 979px) { #login-form .input-small { width: 62px; } } // Page break dl.tabs { float: left; margin-bottom: -1px; } dl.tabs dt.tabs { float: left; margin-left: 3px; padding: 4px 10px; background-color: #F0F0F0; border-top: 1px solid #CCC; border-left: 1px solid #CCC; border-right: 1px solid #CCC; } dl.tabs dt:hover { background-color: #F9F9F9; } dl.tabs dt.open { background-color: #FFF; border-bottom: 1px solid #FFF; } dl.tabs dt.tabs h3 { margin: 0; font-size: 1.1em; font-weight: normal; } dl.tabs dt.tabs h3 a { color: #0088CC; } dl.tabs dt.tabs h3 a:hover { color: #005580; text-decoration: none; } dl.tabs dt.open h3 a { color: #000; text-decoration: none; } div.current dd.tabs { margin: 0; padding: 10px; clear: both; border: 1px solid #CCC; background-color: #FFF; } /* Help site refresh button*/ #helpsite-refresh { vertical-align: top; } /*Print pop-up*/ #pop-print { float: right; margin: 10px; } /*Code white space*/ code { white-space: pre-wrap; } /*Search filter*/ #filter-search { vertical-align: top; } /*Fix for editor buttons having a stupid height*/ .editor { overflow: hidden; position: relative; } /* Com_search highlighting */ .search span.highlight { background-color:#FFFFCC; font-weight:bold; padding:1px 4px; } /* Prevent scrolling on the parent window of a modal */ body.modal-open { overflow: hidden; -ms-overflow-style: none; } /* Align fields for the profile display */ #users-profile-custom label { display: inline; }PK���\H���]#]#'templates/protostar/less/variables.lessnu�[���// // Variables // -------------------------------------------------- // Global values // -------------------------------------------------- // Grays // ------------------------- @black: #000; @grayDarker: #222; @grayDark: #333; @gray: #555; @grayLight: #999; @grayLighter: #eee; @white: #fff; // Accent colors // ------------------------- @blue: #049cdb; @blueDark: #0064cd; @green: #46a546; @red: #9d261d; @yellow: #ffc40d; @orange: #f89406; @pink: #c3325f; @purple: #7a43b6; // Scaffolding // ------------------------- @bodyBackground: @white; @textColor: @grayDark; // Links // ------------------------- @linkColor: #08c; @linkColorHover: darken(@linkColor, 15%); // Typography // ------------------------- @sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif; @serifFontFamily: Georgia, "Times New Roman", Times, serif; @monoFontFamily: Monaco, Menlo, Consolas, "Courier New", monospace; // > Joomla JUI @baseFontSize: 13px; // < Joomla JUI @baseFontFamily: @sansFontFamily; // > Joomla JUI @baseLineHeight: 18px; // < Joomla JUI @altFontFamily: @serifFontFamily; @headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily @headingsFontWeight: bold; // instead of browser default, bold @headingsColor: inherit; // empty to use BS default, @textColor // Component sizing // ------------------------- // Based on 14px font-size and 20px line-height @fontSizeLarge: @baseFontSize * 1.25; // ~18px // > Joomla JUI @fontSizeSmall: ceil(@baseFontSize * 0.90); // ~12px // < Joomla JUI @fontSizeMini: @baseFontSize * 0.75; // ~11px @paddingLarge: 11px 19px; // 44px @paddingSmall: 2px 10px; // 26px @paddingMini: 0 6px; // 22px @baseBorderRadius: 4px; @borderRadiusLarge: 6px; @borderRadiusSmall: 3px; // Tables // ------------------------- @tableBackground: transparent; // overall background-color @tableBackgroundAccent: #f9f9f9; // for striping @tableBackgroundHover: #f5f5f5; // for hover @tableBorder: #ddd; // table and cell border // Buttons // ------------------------- @btnBackground: @white; @btnBackgroundHighlight: darken(@white, 10%); @btnBorder: #bbb; @btnPrimaryBackground: @linkColor; @btnPrimaryBackgroundHighlight: spin(@btnPrimaryBackground, 20%); @btnInfoBackground: #5bc0de; @btnInfoBackgroundHighlight: #2f96b4; @btnSuccessBackground: #62c462; @btnSuccessBackgroundHighlight: #51a351; @btnWarningBackground: lighten(@orange, 15%); @btnWarningBackgroundHighlight: @orange; @btnDangerBackground: #ee5f5b; @btnDangerBackgroundHighlight: #bd362f; @btnInverseBackground: #444; @btnInverseBackgroundHighlight: @grayDarker; // Forms // ------------------------- @inputBackground: @white; @inputBorder: #ccc; @inputBorderRadius: 3px; @inputDisabledBackground: @grayLighter; @formActionsBackground: #f5f5f5; @inputHeight: @baseLineHeight + 10px; // base line-height + 8px vertical padding + 2px top/bottom border // Dropdowns // ------------------------- @dropdownBackground: @white; @dropdownBorder: rgba(0,0,0,.2); @dropdownDividerTop: #e5e5e5; @dropdownDividerBottom: @white; @dropdownLinkColor: @grayDark; @dropdownLinkColorHover: @white; @dropdownLinkColorActive: @dropdownLinkColor; @dropdownLinkBackgroundHover: @dropdownLinkBackgroundActive; @dropdownLinkBackgroundActive: @linkColor; // COMPONENT VARIABLES // -------------------------------------------------- // Z-index master list // ------------------------- // Used for a bird's eye view of components dependent on the z-axis // Try to avoid customizing these :) @zindexDropdown: 1000; @zindexPopover: 1010; @zindexTooltip: 1030; @zindexFixedNavbar: 1030; @zindexModalBackdrop: 1040; @zindexModal: 1050; // Sprite icons path // ------------------------- @iconSpritePath: "../img/glyphicons-halflings.png"; @iconWhiteSpritePath: "../img/glyphicons-halflings-white.png"; // Input placeholder text color // ------------------------- @placeholderText: @grayLight; // Hr border color // ------------------------- @hrBorder: @grayLighter; // Horizontal forms & lists // ------------------------- @horizontalComponentOffset: 180px; // Wells // ------------------------- @wellBackground: #f5f5f5; // Navbar // ------------------------- @navbarCollapseWidth: 979px; @navbarCollapseDesktopWidth: @navbarCollapseWidth + 1; @navbarHeight: 40px; @navbarBackgroundHighlight: #ffffff; @navbarBackground: darken(@navbarBackgroundHighlight, 5%); @navbarBorder: darken(@navbarBackground, 12%); @navbarText: @gray; @navbarLinkColor: @gray; @navbarLinkColorHover: @grayDark; @navbarLinkColorActive: @gray; @navbarLinkBackgroundHover: transparent; @navbarLinkBackgroundActive: darken(@navbarBackground, 5%); @navbarBrandColor: @navbarLinkColor; // Inverted navbar @navbarInverseBackground: #111111; @navbarInverseBackgroundHighlight: #222222; @navbarInverseBorder: #252525; @navbarInverseText: @grayLight; @navbarInverseLinkColor: @grayLight; @navbarInverseLinkColorHover: @white; @navbarInverseLinkColorActive: @navbarInverseLinkColorHover; @navbarInverseLinkBackgroundHover: transparent; @navbarInverseLinkBackgroundActive: @navbarInverseBackground; @navbarInverseSearchBackground: lighten(@navbarInverseBackground, 25%); @navbarInverseSearchBackgroundFocus: @white; @navbarInverseSearchBorder: @navbarInverseBackground; @navbarInverseSearchPlaceholderColor: #ccc; @navbarInverseBrandColor: @navbarInverseLinkColor; // Pagination // ------------------------- @paginationBackground: #fff; @paginationBorder: #ddd; @paginationActiveBackground: #f5f5f5; // Hero unit // ------------------------- @heroUnitBackground: @grayLighter; @heroUnitHeadingColor: inherit; @heroUnitLeadColor: inherit; // Form states and alerts // ------------------------- @warningText: #c09853; @warningBackground: #fcf8e3; @warningBorder: darken(spin(@warningBackground, -10), 3%); @errorText: #b94a48; @errorBackground: #f2dede; @errorBorder: darken(spin(@errorBackground, -10), 3%); @successText: #468847; @successBackground: #dff0d8; @successBorder: darken(spin(@successBackground, -10), 5%); @infoText: #3a87ad; @infoBackground: #d9edf7; @infoBorder: darken(spin(@infoBackground, -10), 7%); // Tooltips and popovers // ------------------------- @tooltipColor: #fff; @tooltipBackground: #000; @tooltipArrowWidth: 5px; @tooltipArrowColor: @tooltipBackground; @popoverBackground: #fff; @popoverArrowWidth: 10px; @popoverArrowColor: #fff; @popoverTitleBackground: darken(@popoverBackground, 3%); // Special enhancement for popovers @popoverArrowOuterWidth: @popoverArrowWidth + 1; @popoverArrowOuterColor: rgba(0,0,0,.25); // GRID // -------------------------------------------------- // Default 940px grid // ------------------------- @gridColumns: 12; @gridColumnWidth: 60px; @gridGutterWidth: 20px; @gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1)); // > Joomla JUI // 1200px min @gridColumnWidth1200: 60px; @gridGutterWidth1200: 20px; @gridRowWidth1200: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1)); // 768px-979px @gridColumnWidth768: 42px; @gridGutterWidth768: 20px; @gridRowWidth768: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1)); // Fluid grid // ------------------------- @fluidGridColumnWidth: 6.382978723%; @fluidGridGutterWidth: 2.127659574%; // 1200px min @fluidGridColumnWidth1200: 6.382978723%; @fluidGridGutterWidth1200: 2.127659574%; // 768px-979px @fluidGridColumnWidth768: 6.382978723%; @fluidGridGutterWidth768: 2.127659574%; // < Joomla JUI PK���\d�.�;;templates/protostar/error.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.protostar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $user = JFactory::getUser(); $this->language = $doc->language; $this->direction = $doc->direction; // Getting params from template $params = $app->getTemplate(true)->params; // Detecting Active Variables $option = $app->input->getCmd('option', ''); $view = $app->input->getCmd('view', ''); $layout = $app->input->getCmd('layout', ''); $task = $app->input->getCmd('task', ''); $itemid = $app->input->getCmd('Itemid', ''); $sitename = $app->get('sitename'); if($task == "edit" || $layout == "form" ) { $fullWidth = 1; } else { $fullWidth = 0; } // Add JavaScript Frameworks JHtml::_('bootstrap.framework'); // Logo file or site title param if ($params->get('logoFile')) { $logo = '<img src="' . JUri::root() . $params->get('logoFile') . '" alt="' . $sitename . '" />'; } elseif ($params->get('sitetitle')) { $logo = '<span class="site-title" title="' . $sitename . '">' . htmlspecialchars($params->get('sitetitle')) . '</span>'; } else { $logo = '<span class="site-title" title="' . $sitename . '">' . $sitename . '</span>'; } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $this->title; ?> <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <?php // Use of Google Font ?> <?php if ($params->get('googleFont')) : ?> <link href='//fonts.googleapis.com/css?family=<?php echo $params->get('googleFontName'); ?>' rel='stylesheet' type='text/css' /> <style type="text/css"> h1,h2,h3,h4,h5,h6,.site-title{ font-family: '<?php echo str_replace('+', ' ', $params->get('googleFontName')); ?>', sans-serif; } </style> <?php endif; ?> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/template.css" type="text/css" /> <?php if ($app->get('debug_lang', '0') == '1' || $app->get('debug', '0') == '1') : ?> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/media/cms/css/debug.css" type="text/css" /> <?php endif; ?> <?php // If Right-to-Left ?> <?php if ($this->direction == 'rtl') : ?> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/media/jui/css/bootstrap-rtl.css" type="text/css" /> <?php endif; ?> <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" /> <?php // Template color ?> <?php if ($params->get('templateColor')) : ?> <style type="text/css"> body.site { border-top: 3px solid <?php echo $params->get('templateColor'); ?>; background-color: <?php echo $params->get('templateBackgroundColor'); ?> } a { color: <?php echo $params->get('templateColor'); ?>; } .navbar-inner, .nav-list > .active > a, .nav-list > .active > a:hover, .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover, .nav-pills > .active > a, .nav-pills > .active > a:hover { background: <?php echo $params->get('templateColor'); ?>; } .navbar-inner { -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2); -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2); box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2); } </style> <?php endif; ?> <!--[if lt IE 9]> <script src="<?php echo $this->baseurl; ?>/media/jui/js/html5.js"></script> <![endif]--> </head> <body class="site <?php echo $option . ' view-' . $view . ($layout ? ' layout-' . $layout : ' no-layout') . ($task ? ' task-' . $task : ' no-task') . ($itemid ? ' itemid-' . $itemid : '') . ($params->get('fluidContainer') ? ' fluid' : ''); ?>"> <!-- Body --> <div class="body"> <div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>"> <!-- Header --> <header class="header" role="banner"> <div class="header-inner clearfix"> <a class="brand pull-left" href="<?php echo $this->baseurl; ?>/"> <?php echo $logo; ?> </a> <div class="header-search pull-right"> <?php // Display position-0 modules ?> <?php echo $doc->getBuffer('modules', 'position-0', array('style' => 'none')); ?> </div> </div> </header> <div class="navigation"> <?php // Display position-1 modules ?> <?php echo $doc->getBuffer('modules', 'position-1', array('style' => 'none')); ?> </div> <!-- Banner --> <div class="banner"> <?php echo $doc->getBuffer('modules', 'banner', array('style' => 'xhtml')); ?> </div> <div class="row-fluid"> <div id="content" class="span12"> <!-- Begin Content --> <h1 class="page-header"><?php echo JText::_('JERROR_LAYOUT_PAGE_NOT_FOUND'); ?></h1> <div class="well"> <div class="row-fluid"> <div class="span6"> <p><strong><?php echo JText::_('JERROR_LAYOUT_ERROR_HAS_OCCURRED_WHILE_PROCESSING_YOUR_REQUEST'); ?></strong></p> <p><?php echo JText::_('JERROR_LAYOUT_NOT_ABLE_TO_VISIT'); ?></p> <ul> <li><?php echo JText::_('JERROR_LAYOUT_AN_OUT_OF_DATE_BOOKMARK_FAVOURITE'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_MIS_TYPED_ADDRESS'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_SEARCH_ENGINE_OUT_OF_DATE_LISTING'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_YOU_HAVE_NO_ACCESS_TO_THIS_PAGE'); ?></li> </ul> </div> <div class="span6"> <?php if (JModuleHelper::getModule('search')) : ?> <p><strong><?php echo JText::_('JERROR_LAYOUT_SEARCH'); ?></strong></p> <p><?php echo JText::_('JERROR_LAYOUT_SEARCH_PAGE'); ?></p> <?php echo $doc->getBuffer('module', 'search'); ?> <?php endif; ?> <p><?php echo JText::_('JERROR_LAYOUT_GO_TO_THE_HOME_PAGE'); ?></p> <p><a href="<?php echo $this->baseurl; ?>/index.php" class="btn"><span class="icon-home"></span> <?php echo JText::_('JERROR_LAYOUT_HOME_PAGE'); ?></a></p> </div> </div> <hr /> <p><?php echo JText::_('JERROR_LAYOUT_PLEASE_CONTACT_THE_SYSTEM_ADMINISTRATOR'); ?></p> <blockquote> <span class="label label-inverse"><?php echo $this->error->getCode(); ?></span> <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8');?> </blockquote> <?php if ($this->debug) : ?> <?php echo $this->renderBacktrace(); ?> <?php endif; ?> </div> <!-- End Content --> </div> </div> </div> </div> <!-- Footer --> <div class="footer"> <div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>"> <hr /> <?php echo $doc->getBuffer('modules', 'footer', array('style' => 'none')); ?> <p class="pull-right"> <a href="#top" id="back-top"> <?php echo JText::_('TPL_PROTOSTAR_BACKTOTOP'); ?> </a> </p> <p> © <?php echo date('Y'); ?> <?php echo $sitename; ?> </p> </div> </div> <?php echo $doc->getBuffer('modules', 'debug', array('style' => 'none')); ?> </body> </html> PK���\ƞ�x~~:templates/protostar/html/layouts/joomla/system/message.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Template.protostar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $msgList = $displayData['msgList']; $alert = array('error' => 'alert-error', 'warning' => '', 'notice' => 'alert-info', 'message' => 'alert-success'); ?> <div id="system-message-container"> <?php if (is_array($msgList) && !empty($msgList)) : ?> <div id="system-message"> <?php foreach ($msgList as $type => $msgs) : ?> <div class="alert <?php echo $alert[$type]; ?>"> <?php // This requires JS so we should add it trough JS. Progressive enhancement and stuff. ?> <a class="close" data-dismiss="alert">×</a> <?php if (!empty($msgs)) : ?> <h4 class="alert-heading"><?php echo JText::_($type); ?></h4> <div> <?php foreach ($msgs as $msg) : ?> <p class="alert-message"><?php echo $msg; ?></p> <?php endforeach; ?> </div> <?php endif; ?> </div> <?php endforeach; ?> </div> <?php endif; ?> </div> PK���\? s���$templates/protostar/html/modules.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.protostar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * This is a file to add template specific chrome to module rendering. To use it you would * set the style attribute for the given module(s) include in your template to use the style * for each given modChrome function. * * eg. To render a module mod_test in the submenu style, you would use the following include: * <jdoc:include type="module" name="test" style="submenu" /> * * This gives template designers ultimate control over how modules are rendered. * * NOTICE: All chrome wrapping methods should be named: modChrome_{STYLE} and take the same * two arguments. */ /* * Module chrome for rendering the module in a submenu */ function modChrome_no($module, &$params, &$attribs) { if ($module->content) { echo $module->content; } } function modChrome_well($module, &$params, &$attribs) { $moduleTag = $params->get('module_tag', 'div'); $bootstrapSize = (int) $params->get('bootstrap_size', 0); $moduleClass = $bootstrapSize != 0 ? ' span' . $bootstrapSize : ''; $headerTag = htmlspecialchars($params->get('header_tag', 'h3')); $headerClass = htmlspecialchars($params->get('header_class', 'page-header')); if ($module->content) { echo '<' . $moduleTag . ' class="well ' . htmlspecialchars($params->get('moduleclass_sfx')) . $moduleClass . '">'; if ($module->showtitle) { echo '<' . $headerTag . ' class="' . $headerClass . '">' . $module->title . '</' . $headerTag . '>'; } echo $module->content; echo '</' . $moduleTag . '>'; } } PK���\;��Q��'templates/protostar/html/pagination.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.protostar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * This is a file to add template specific chrome to pagination rendering. * * pagination_list_footer * Input variable $list is an array with offsets: * $list[limit] : int * $list[limitstart] : int * $list[total] : int * $list[limitfield] : string * $list[pagescounter] : string * $list[pageslinks] : string * * pagination_list_render * Input variable $list is an array with offsets: * $list[all] * [data] : string * [active] : boolean * $list[start] * [data] : string * [active] : boolean * $list[previous] * [data] : string * [active] : boolean * $list[next] * [data] : string * [active] : boolean * $list[end] * [data] : string * [active] : boolean * $list[pages] * [{PAGE}][data] : string * [{PAGE}][active] : boolean * * pagination_item_active * Input variable $item is an object with fields: * $item->base : integer * $item->link : string * $item->text : string * * pagination_item_inactive * Input variable $item is an object with fields: * $item->base : integer * $item->link : string * $item->text : string * * This gives template designers ultimate control over how pagination is rendered. * * NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both */ /** * Renders the pagination footer * * @param array $list Array containing pagination footer * * @return string HTML markup for the full pagination footer * * @since 3.0 */ function pagination_list_footer($list) { $html = "<div class=\"pagination\">\n"; $html .= $list['pageslinks']; $html .= "\n<input type=\"hidden\" name=\"" . $list['prefix'] . "limitstart\" value=\"" . $list['limitstart'] . "\" />"; $html .= "\n</div>"; return $html; } /** * Renders the pagination list * * @param array $list Array containing pagination information * * @return string HTML markup for the full pagination object * * @since 3.0 */ function pagination_list_render($list) { // Calculate to display range of pages $currentPage = 1; $range = 1; $step = 5; foreach ($list['pages'] as $k => $page) { if (!$page['active']) { $currentPage = $k; } } if ($currentPage >= $step) { if ($currentPage % $step == 0) { $range = ceil($currentPage / $step) + 1; } else { $range = ceil($currentPage / $step); } } $html = '<ul class="pagination-list">'; $html .= $list['start']['data']; $html .= $list['previous']['data']; foreach ($list['pages'] as $k => $page) { if (in_array($k, range($range * $step - ($step + 1), $range * $step))) { if (($k % $step == 0 || $k == $range * $step - ($step + 1)) && $k != $currentPage && $k != $range * $step - $step) { $page['data'] = preg_replace('#(<a.*?>).*?(</a>)#', '$1...$2', $page['data']); } } $html .= $page['data']; } $html .= $list['next']['data']; $html .= $list['end']['data']; $html .= '</ul>'; return $html; } /** * Renders an active item in the pagination block * * @param JPaginationObject $item The current pagination object * * @return string HTML markup for active item * * @since 3.0 */ function pagination_item_active(&$item) { $class = ''; // Check for "Start" item if ($item->text == JText::_('JLIB_HTML_START')) { $display = '<span class="icon-first"></span>'; } // Check for "Prev" item if ($item->text == JText::_('JPREV')) { $display = '<span class="icon-previous"></span>'; } // Check for "Next" item if ($item->text == JText::_('JNEXT')) { $display = '<span class="icon-next"></span>'; } // Check for "End" item if ($item->text == JText::_('JLIB_HTML_END')) { $display = '<span class="icon-last"></span>'; } // If the display object isn't set already, just render the item with its text if (!isset($display)) { $display = $item->text; $class = ' class="hidden-phone"'; } return '<li' . $class . '><a title="' . $item->text . '" href="' . $item->link . '" class="pagenav">' . $display . '</a></li>'; } /** * Renders an inactive item in the pagination block * * @param JPaginationObject $item The current pagination object * * @return string HTML markup for inactive item * * @since 3.0 */ function pagination_item_inactive(&$item) { // Check for "Start" item if ($item->text == JText::_('JLIB_HTML_START')) { return '<li class="disabled"><a><span class="icon-first"></span></a></li>'; } // Check for "Prev" item if ($item->text == JText::_('JPREV')) { return '<li class="disabled"><a><span class="icon-previous"></span></a></li>'; } // Check for "Next" item if ($item->text == JText::_('JNEXT')) { return '<li class="disabled"><a><span class="icon-next"></span></a></li>'; } // Check for "End" item if ($item->text == JText::_('JLIB_HTML_END')) { return '<li class="disabled"><a><span class="icon-last"></span></a></li>'; } // Check if the item is the active page if (isset($item->active) && ($item->active)) { return '<li class="active hidden-phone"><a>' . $item->text . '</a></li>'; } // Doesn't match any other condition, render a normal item return '<li class="disabled hidden-phone"><a>' . $item->text . '</a></li>'; } PK���\8yA�JnJn$templates/protostar/css/template.cssnu�[���article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } audio:not([controls]) { display: none; } html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } a:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } a:hover, a:active { outline: 0; } sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { max-width: 100%; width: auto \9; height: auto; vertical-align: middle; border: 0; -ms-interpolation-mode: bicubic; } #map_canvas img, .google-maps img, .gm-style img { max-width: none; } button, input, select, textarea { margin: 0; font-size: 100%; vertical-align: middle; } button, input { *overflow: visible; line-height: normal; } button::-moz-focus-inner, input::-moz-focus-inner { padding: 0; border: 0; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } label, select, button, input[type="button"], input[type="reset"], input[type="submit"], input[type="radio"], input[type="checkbox"] { cursor: pointer; } input[type="search"] { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-appearance: textfield; } input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; } textarea { overflow: auto; vertical-align: top; } @media print { * { text-shadow: none !important; color: #000 !important; background: transparent !important; box-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } @page { margin: 0.5cm; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } } .rtl .navigation .nav-child { left: auto; right: 0; } .rtl .navigation .nav > li > .nav-child:before { left: auto; right: 12px; } .rtl .navigation .nav > li > .nav-child:after { left: auto; right: 13px; } .clearfix { *zoom: 1; } .clearfix:before, .clearfix:after { display: table; content: ""; line-height: 0; } .clearfix:after { clear: both; } .hide-text { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .input-block-level { display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } body { margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; color: #333; background-color: #fff; } a { color: #08c; text-decoration: none; } a:hover, a:focus { color: #005580; text-decoration: underline; } .img-rounded { -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .img-polaroid { padding: 4px; background-color: #fff; border: 1px solid #ccc; border: 1px solid rgba(0,0,0,0.2); -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.1); -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.1); box-shadow: 0 1px 3px rgba(0,0,0,0.1); } .img-circle { -webkit-border-radius: 500px; -moz-border-radius: 500px; border-radius: 500px; } .row { margin-left: -20px; *zoom: 1; } .row:before, .row:after { display: table; content: ""; line-height: 0; } .row:after { clear: both; } [class*="span"] { float: left; min-height: 1px; margin-left: 20px; } .container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 940px; } .span12 { width: 940px; } .span11 { width: 860px; } .span10 { width: 780px; } .span9 { width: 700px; } .span8 { width: 620px; } .span7 { width: 540px; } .span6 { width: 460px; } .span5 { width: 380px; } .span4 { width: 300px; } .span3 { width: 220px; } .span2 { width: 140px; } .span1 { width: 60px; } .offset12 { margin-left: 980px; } .offset11 { margin-left: 900px; } .offset10 { margin-left: 820px; } .offset9 { margin-left: 740px; } .offset8 { margin-left: 660px; } .offset7 { margin-left: 580px; } .offset6 { margin-left: 500px; } .offset5 { margin-left: 420px; } .offset4 { margin-left: 340px; } .offset3 { margin-left: 260px; } .offset2 { margin-left: 180px; } .offset1 { margin-left: 100px; } .row-fluid { width: 100%; *zoom: 1; } .row-fluid:before, .row-fluid:after { display: table; content: ""; line-height: 0; } .row-fluid:after { clear: both; } .row-fluid [class*="span"] { display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.127659574%; *margin-left: 2.0744680846383%; } .row-fluid [class*="span"]:first-child { margin-left: 0; } .row-fluid .controls-row [class*="span"] + [class*="span"] { margin-left: 2.127659574%; } .row-fluid .span12 { width: 99.99999999%; *width: 99.946808500638%; } .row-fluid .span11 { width: 91.489361693%; *width: 91.436170203638%; } .row-fluid .span10 { width: 82.978723396%; *width: 82.925531906638%; } .row-fluid .span9 { width: 74.468085099%; *width: 74.414893609638%; } .row-fluid .span8 { width: 65.957446802%; *width: 65.904255312638%; } .row-fluid .span7 { width: 57.446808505%; *width: 57.393617015638%; } .row-fluid .span6 { width: 48.936170208%; *width: 48.882978718638%; } .row-fluid .span5 { width: 40.425531911%; *width: 40.372340421638%; } .row-fluid .span4 { width: 31.914893614%; *width: 31.861702124638%; } .row-fluid .span3 { width: 23.404255317%; *width: 23.351063827638%; } .row-fluid .span2 { width: 14.89361702%; *width: 14.840425530638%; } .row-fluid .span1 { width: 6.382978723%; *width: 6.3297872336383%; } .row-fluid .offset12 { margin-left: 104.255319138%; *margin-left: 104.14893615928%; } .row-fluid .offset12:first-child { margin-left: 102.127659564%; *margin-left: 102.02127658528%; } .row-fluid .offset11 { margin-left: 95.744680841%; *margin-left: 95.638297862277%; } .row-fluid .offset11:first-child { margin-left: 93.617021267%; *margin-left: 93.510638288277%; } .row-fluid .offset10 { margin-left: 87.234042544%; *margin-left: 87.127659565277%; } .row-fluid .offset10:first-child { margin-left: 85.10638297%; *margin-left: 84.999999991277%; } .row-fluid .offset9 { margin-left: 78.723404247%; *margin-left: 78.617021268277%; } .row-fluid .offset9:first-child { margin-left: 76.595744673%; *margin-left: 76.489361694277%; } .row-fluid .offset8 { margin-left: 70.21276595%; *margin-left: 70.106382971277%; } .row-fluid .offset8:first-child { margin-left: 68.085106376%; *margin-left: 67.978723397277%; } .row-fluid .offset7 { margin-left: 61.702127653%; *margin-left: 61.595744674277%; } .row-fluid .offset7:first-child { margin-left: 59.574468079%; *margin-left: 59.468085100277%; } .row-fluid .offset6 { margin-left: 53.191489356%; *margin-left: 53.085106377277%; } .row-fluid .offset6:first-child { margin-left: 51.063829782%; *margin-left: 50.957446803277%; } .row-fluid .offset5 { margin-left: 44.680851059%; *margin-left: 44.574468080277%; } .row-fluid .offset5:first-child { margin-left: 42.553191485%; *margin-left: 42.446808506277%; } .row-fluid .offset4 { margin-left: 36.170212762%; *margin-left: 36.063829783277%; } .row-fluid .offset4:first-child { margin-left: 34.042553188%; *margin-left: 33.936170209277%; } .row-fluid .offset3 { margin-left: 27.659574465%; *margin-left: 27.553191486277%; } .row-fluid .offset3:first-child { margin-left: 25.531914891%; *margin-left: 25.425531912277%; } .row-fluid .offset2 { margin-left: 19.148936168%; *margin-left: 19.042553189277%; } .row-fluid .offset2:first-child { margin-left: 17.021276594%; *margin-left: 16.914893615277%; } .row-fluid .offset1 { margin-left: 10.638297871%; *margin-left: 10.531914892277%; } .row-fluid .offset1:first-child { margin-left: 8.510638297%; *margin-left: 8.4042553182766%; } [class*="span"].hide, .row-fluid [class*="span"].hide { display: none; } [class*="span"].pull-right, .row-fluid [class*="span"].pull-right { float: right; } .container { margin-right: auto; margin-left: auto; *zoom: 1; } .container:before, .container:after { display: table; content: ""; line-height: 0; } .container:after { clear: both; } .container-fluid { padding-right: 20px; padding-left: 20px; *zoom: 1; } .container-fluid:before, .container-fluid:after { display: table; content: ""; line-height: 0; } .container-fluid:after { clear: both; } p { margin: 0 0 9px; } .lead { margin-bottom: 18px; font-size: 19.5px; font-weight: 200; line-height: 27px; } small { font-size: 85%; } strong { font-weight: bold; } em { font-style: italic; } cite { font-style: normal; } .muted { color: #999; } a.muted:hover, a.muted:focus { color: #808080; } .text-warning { color: #c09853; } a.text-warning:hover, a.text-warning:focus { color: #a47e3c; } .text-error { color: #b94a48; } a.text-error:hover, a.text-error:focus { color: #953b39; } .text-info { color: #3a87ad; } a.text-info:hover, a.text-info:focus { color: #2d6987; } .text-success { color: #468847; } a.text-success:hover, a.text-success:focus { color: #356635; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } h1, h2, h3, h4, h5, h6 { margin: 9px 0; font-family: inherit; font-weight: bold; line-height: 18px; color: inherit; text-rendering: optimizelegibility; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-weight: normal; line-height: 1; color: #999; } h1, h2, h3 { line-height: 36px; } h1 { font-size: 35.75px; } h2 { font-size: 29.25px; } h3 { font-size: 22.75px; } h4 { font-size: 16.25px; } h5 { font-size: 13px; } h6 { font-size: 11.05px; } h1 small { font-size: 22.75px; } h2 small { font-size: 16.25px; } h3 small { font-size: 13px; } h4 small { font-size: 13px; } .page-header { padding-bottom: 8px; margin: 18px 0 27px; border-bottom: 1px solid #eee; } ul, ol { padding: 0; margin: 0 0 9px 25px; } ul ul, ul ol, ol ol, ol ul { margin-bottom: 0; } li { line-height: 18px; } ul.unstyled, ol.unstyled { margin-left: 0; list-style: none; } ul.inline, ol.inline { margin-left: 0; list-style: none; } ul.inline > li, ol.inline > li { display: inline-block; *display: inline; *zoom: 1; padding-left: 5px; padding-right: 5px; } dl { margin-bottom: 18px; } dt, dd { line-height: 18px; } dt { font-weight: bold; } dd { margin-left: 9px; } .dl-horizontal { *zoom: 1; } .dl-horizontal:before, .dl-horizontal:after { display: table; content: ""; line-height: 0; } .dl-horizontal:after { clear: both; } .dl-horizontal dt { float: left; width: 160px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } hr { margin: 18px 0; border: 0; border-top: 1px solid #eee; border-bottom: 1px solid #fff; } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #999; } abbr.initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 0 0 0 15px; margin: 0 0 18px; border-left: 5px solid #eee; } blockquote p { margin-bottom: 0; font-size: 16.25px; font-weight: 300; line-height: 1.25; } blockquote small { display: block; line-height: 18px; color: #999; } blockquote small:before { content: '\2014 \00A0'; } blockquote.pull-right { float: right; padding-right: 15px; padding-left: 0; border-right: 5px solid #eee; border-left: 0; } blockquote.pull-right p, blockquote.pull-right small { text-align: right; } blockquote.pull-right small:before { content: ''; } blockquote.pull-right small:after { content: '\00A0 \2014'; } q:before, q:after, blockquote:before, blockquote:after { content: ""; } address { display: block; margin-bottom: 18px; font-style: normal; line-height: 18px; } code, pre { padding: 0 3px 2px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 11px; color: #333; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } code { padding: 2px 4px; color: #d14; background-color: #f7f7f9; border: 1px solid #e1e1e8; white-space: nowrap; } pre { display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; word-break: break-all; word-wrap: break-word; white-space: pre; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0,0,0,0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } pre.prettyprint { margin-bottom: 18px; } pre code { padding: 0; color: inherit; white-space: pre; white-space: pre-wrap; background-color: transparent; border: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } form { margin: 0 0 18px; } fieldset { padding: 0; margin: 0; border: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 18px; font-size: 19.5px; line-height: 36px; color: #333; border: 0; border-bottom: 1px solid #e5e5e5; } legend small { font-size: 13.5px; color: #999; } label, input, button, select, textarea { font-size: 13px; font-weight: normal; line-height: 18px; } input, button, select, textarea { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } label { display: block; margin-bottom: 5px; } select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { display: inline-block; height: 18px; padding: 4px 6px; margin-bottom: 9px; font-size: 13px; line-height: 18px; color: #555; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; vertical-align: middle; } input, textarea, .uneditable-input { width: 206px; } textarea { height: auto; } textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { background-color: #fff; border: 1px solid #ccc; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -webkit-transition: border linear .2s, box-shadow linear .2s; -moz-transition: border linear .2s, box-shadow linear .2s; -o-transition: border linear .2s, box-shadow linear .2s; transition: border linear .2s, box-shadow linear .2s; } textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="color"]:focus, .uneditable-input:focus { border-color: rgba(82,168,236,0.8); outline: 0; outline: thin dotted \9; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; *margin-top: 0; margin-top: 1px \9; line-height: normal; } input[type="file"], input[type="image"], input[type="submit"], input[type="reset"], input[type="button"], input[type="radio"], input[type="checkbox"] { width: auto; } select, input[type="file"] { height: 28px; *margin-top: 4px; line-height: 28px; } select { width: 220px; border: 1px solid #ccc; background-color: #fff; } select[multiple], select[size] { height: auto; } select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .uneditable-input, .uneditable-textarea { color: #999; background-color: #fcfcfc; border-color: #ccc; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.025); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.025); box-shadow: inset 0 1px 2px rgba(0,0,0,0.025); cursor: not-allowed; } .uneditable-input { overflow: hidden; white-space: nowrap; } .uneditable-textarea { width: auto; height: auto; } input:-moz-placeholder, textarea:-moz-placeholder { color: #999; } input:-ms-input-placeholder, textarea:-ms-input-placeholder { color: #999; } input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #999; } .radio, .checkbox { min-height: 18px; padding-left: 20px; } .radio input[type="radio"], .checkbox input[type="checkbox"] { float: left; margin-left: -20px; } .controls > .radio:first-child, .controls > .checkbox:first-child { padding-top: 5px; } .radio.inline, .checkbox.inline { display: inline-block; padding-top: 5px; margin-bottom: 0; vertical-align: middle; } .radio.inline + .radio.inline, .checkbox.inline + .checkbox.inline { margin-left: 10px; } .input-mini { width: 60px; } .input-small { width: 90px; } .input-medium { width: 150px; } .input-large { width: 210px; } .input-xlarge { width: 270px; } .input-xxlarge { width: 530px; } input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"] { float: none; margin-left: 0; } .input-append input[class*="span"], .input-append .uneditable-input[class*="span"], .input-prepend input[class*="span"], .input-prepend .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"], .row-fluid .input-prepend [class*="span"], .row-fluid .input-append [class*="span"] { display: inline-block; } input, textarea, .uneditable-input { margin-left: 0; } .controls-row [class*="span"] + [class*="span"] { margin-left: 20px; } input.span12, textarea.span12, .uneditable-input.span12 { width: 926px; } input.span11, textarea.span11, .uneditable-input.span11 { width: 846px; } input.span10, textarea.span10, .uneditable-input.span10 { width: 766px; } input.span9, textarea.span9, .uneditable-input.span9 { width: 686px; } input.span8, textarea.span8, .uneditable-input.span8 { width: 606px; } input.span7, textarea.span7, .uneditable-input.span7 { width: 526px; } input.span6, textarea.span6, .uneditable-input.span6 { width: 446px; } input.span5, textarea.span5, .uneditable-input.span5 { width: 366px; } input.span4, textarea.span4, .uneditable-input.span4 { width: 286px; } input.span3, textarea.span3, .uneditable-input.span3 { width: 206px; } input.span2, textarea.span2, .uneditable-input.span2 { width: 126px; } input.span1, textarea.span1, .uneditable-input.span1 { width: 46px; } .controls-row { *zoom: 1; } .controls-row:before, .controls-row:after { display: table; content: ""; line-height: 0; } .controls-row:after { clear: both; } .controls-row [class*="span"], .row-fluid .controls-row [class*="span"] { float: left; } .controls-row .checkbox[class*="span"], .controls-row .radio[class*="span"] { padding-top: 5px; } input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] { cursor: not-allowed; background-color: #eee; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"][readonly], input[type="checkbox"][readonly] { background-color: transparent; } .control-group.warning .control-label, .control-group.warning .help-block, .control-group.warning .help-inline { color: #c09853; } .control-group.warning .checkbox, .control-group.warning .radio, .control-group.warning input, .control-group.warning select, .control-group.warning textarea { color: #c09853; } .control-group.warning input, .control-group.warning select, .control-group.warning textarea { border-color: #c09853; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); } .control-group.warning input:focus, .control-group.warning select:focus, .control-group.warning textarea:focus { border-color: #a47e3c; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #dbc59e; -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #dbc59e; box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #dbc59e; } .control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on { color: #c09853; background-color: #fcf8e3; border-color: #c09853; } .control-group.error .control-label, .control-group.error .help-block, .control-group.error .help-inline { color: #b94a48; } .control-group.error .checkbox, .control-group.error .radio, .control-group.error input, .control-group.error select, .control-group.error textarea { color: #b94a48; } .control-group.error input, .control-group.error select, .control-group.error textarea { border-color: #b94a48; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); } .control-group.error input:focus, .control-group.error select:focus, .control-group.error textarea:focus { border-color: #953b39; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #d59392; -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #d59392; box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #d59392; } .control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on { color: #b94a48; background-color: #f2dede; border-color: #b94a48; } .control-group.success .control-label, .control-group.success .help-block, .control-group.success .help-inline { color: #468847; } .control-group.success .checkbox, .control-group.success .radio, .control-group.success input, .control-group.success select, .control-group.success textarea { color: #468847; } .control-group.success input, .control-group.success select, .control-group.success textarea { border-color: #468847; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); } .control-group.success input:focus, .control-group.success select:focus, .control-group.success textarea:focus { border-color: #356635; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7aba7b; -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7aba7b; box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7aba7b; } .control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on { color: #468847; background-color: #dff0d8; border-color: #468847; } .control-group.info .control-label, .control-group.info .help-block, .control-group.info .help-inline { color: #3a87ad; } .control-group.info .checkbox, .control-group.info .radio, .control-group.info input, .control-group.info select, .control-group.info textarea { color: #3a87ad; } .control-group.info input, .control-group.info select, .control-group.info textarea { border-color: #3a87ad; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); } .control-group.info input:focus, .control-group.info select:focus, .control-group.info textarea:focus { border-color: #2d6987; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7ab5d3; -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7ab5d3; box-shadow: inset 0 1px 1px rgba(0,0,0,0.075), 0 0 6px #7ab5d3; } .control-group.info .input-prepend .add-on, .control-group.info .input-append .add-on { color: #3a87ad; background-color: #d9edf7; border-color: #3a87ad; } input:focus:invalid, textarea:focus:invalid, select:focus:invalid { color: #b94a48; border-color: #ee5f5b; } input:focus:invalid:focus, textarea:focus:invalid:focus, select:focus:invalid:focus { border-color: #e9322d; -webkit-box-shadow: 0 0 6px #f8b9b7; -moz-box-shadow: 0 0 6px #f8b9b7; box-shadow: 0 0 6px #f8b9b7; } .form-actions { padding: 17px 20px 18px; margin-top: 18px; margin-bottom: 18px; background-color: #f5f5f5; border-top: 1px solid #e5e5e5; *zoom: 1; } .form-actions:before, .form-actions:after { display: table; content: ""; line-height: 0; } .form-actions:after { clear: both; } .help-block, .help-inline { color: #595959; } .help-block { display: block; margin-bottom: 9px; } .help-inline { display: inline-block; *display: inline; *zoom: 1; vertical-align: middle; padding-left: 5px; } .input-append, .input-prepend { display: inline-block; margin-bottom: 9px; vertical-align: middle; font-size: 0; white-space: nowrap; } .input-append input, .input-append select, .input-append .uneditable-input, .input-append .dropdown-menu, .input-append .popover, .input-prepend input, .input-prepend select, .input-prepend .uneditable-input, .input-prepend .dropdown-menu, .input-prepend .popover { font-size: 13px; } .input-append input, .input-append select, .input-append .uneditable-input, .input-prepend input, .input-prepend select, .input-prepend .uneditable-input { position: relative; margin-bottom: 0; *margin-left: 0; vertical-align: top; -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-append input:focus, .input-append select:focus, .input-append .uneditable-input:focus, .input-prepend input:focus, .input-prepend select:focus, .input-prepend .uneditable-input:focus { z-index: 2; } .input-append .add-on, .input-prepend .add-on { display: inline-block; width: auto; height: 18px; min-width: 16px; padding: 4px 5px; font-size: 13px; font-weight: normal; line-height: 18px; text-align: center; text-shadow: 0 1px 0 #fff; background-color: #eee; border: 1px solid #ccc; } .input-append .add-on, .input-append .btn, .input-append .btn-group > .dropdown-toggle, .input-prepend .add-on, .input-prepend .btn, .input-prepend .btn-group > .dropdown-toggle { vertical-align: top; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .input-append .active, .input-prepend .active { background-color: #a9dba9; border-color: #46a546; } .input-prepend .add-on, .input-prepend .btn { margin-right: -1px; } .input-prepend .add-on:first-child, .input-prepend .btn:first-child { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .input-append input, .input-append select, .input-append .uneditable-input { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .input-append input + .btn-group .btn:last-child, .input-append select + .btn-group .btn:last-child, .input-append .uneditable-input + .btn-group .btn:last-child { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-append .add-on, .input-append .btn, .input-append .btn-group { margin-left: -1px; } .input-append .add-on:last-child, .input-append .btn:last-child, .input-append .btn-group:last-child > .dropdown-toggle { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-prepend.input-append input, .input-prepend.input-append select, .input-prepend.input-append .uneditable-input { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .input-prepend.input-append input + .btn-group .btn, .input-prepend.input-append select + .btn-group .btn, .input-prepend.input-append .uneditable-input + .btn-group .btn { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-prepend.input-append .add-on:first-child, .input-prepend.input-append .btn:first-child { margin-right: -1px; -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .input-prepend.input-append .add-on:last-child, .input-prepend.input-append .btn:last-child { margin-left: -1px; -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-prepend.input-append .btn-group:first-child { margin-left: 0; } input.search-query { padding-right: 14px; padding-right: 4px \9; padding-left: 14px; padding-left: 4px \9; margin-bottom: 0; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; } .form-search .input-append .search-query, .form-search .input-prepend .search-query { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .form-search .input-append .search-query { -webkit-border-radius: 14px 0 0 14px; -moz-border-radius: 14px 0 0 14px; border-radius: 14px 0 0 14px; } .form-search .input-append .btn { -webkit-border-radius: 0 14px 14px 0; -moz-border-radius: 0 14px 14px 0; border-radius: 0 14px 14px 0; } .form-search .input-prepend .search-query { -webkit-border-radius: 0 14px 14px 0; -moz-border-radius: 0 14px 14px 0; border-radius: 0 14px 14px 0; } .form-search .input-prepend .btn { -webkit-border-radius: 14px 0 0 14px; -moz-border-radius: 14px 0 0 14px; border-radius: 14px 0 0 14px; } .form-search input, .form-search textarea, .form-search select, .form-search .help-inline, .form-search .uneditable-input, .form-search .input-prepend, .form-search .input-append, .form-inline input, .form-inline textarea, .form-inline select, .form-inline .help-inline, .form-inline .uneditable-input, .form-inline .input-prepend, .form-inline .input-append, .form-horizontal input, .form-horizontal textarea, .form-horizontal select, .form-horizontal .help-inline, .form-horizontal .uneditable-input, .form-horizontal .input-prepend, .form-horizontal .input-append { display: inline-block; *display: inline; *zoom: 1; margin-bottom: 0; vertical-align: middle; } .form-search .hide, .form-inline .hide, .form-horizontal .hide { display: none; } .form-search label, .form-inline label, .form-search .btn-group, .form-inline .btn-group { display: inline-block; } .form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend { margin-bottom: 0; } .form-search .radio, .form-search .checkbox, .form-inline .radio, .form-inline .checkbox { padding-left: 0; margin-bottom: 0; vertical-align: middle; } .form-search .radio input[type="radio"], .form-search .checkbox input[type="checkbox"], .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { float: left; margin-right: 3px; margin-left: 0; } .control-group { margin-bottom: 9px; } legend + .control-group { margin-top: 18px; -webkit-margin-top-collapse: separate; } .form-horizontal .control-group { margin-bottom: 18px; *zoom: 1; } .form-horizontal .control-group:before, .form-horizontal .control-group:after { display: table; content: ""; line-height: 0; } .form-horizontal .control-group:after { clear: both; } .form-horizontal .control-label { float: left; width: 160px; padding-top: 5px; text-align: right; } .form-horizontal .controls { *display: inline-block; *padding-left: 20px; margin-left: 180px; *margin-left: 0; } .form-horizontal .controls:first-child { *padding-left: 180px; } .form-horizontal .help-block { margin-bottom: 0; } .form-horizontal input + .help-block, .form-horizontal select + .help-block, .form-horizontal textarea + .help-block, .form-horizontal .uneditable-input + .help-block, .form-horizontal .input-prepend + .help-block, .form-horizontal .input-append + .help-block { margin-top: 9px; } .form-horizontal .form-actions { padding-left: 180px; } .control-label .hasTooltip { display: inline-block; } table { max-width: 100%; background-color: transparent; border-collapse: collapse; border-spacing: 0; } .table { width: 100%; margin-bottom: 18px; } .table th, .table td { padding: 8px; line-height: 18px; text-align: left; vertical-align: top; border-top: 1px solid #ddd; } .table th { font-weight: bold; } .table thead th { vertical-align: bottom; } .table caption + thead tr:first-child th, .table caption + thead tr:first-child td, .table colgroup + thead tr:first-child th, .table colgroup + thead tr:first-child td, .table thead:first-child tr:first-child th, .table thead:first-child tr:first-child td { border-top: 0; } .table tbody + tbody { border-top: 2px solid #ddd; } .table .table { background-color: #fff; } .table-condensed th, .table-condensed td { padding: 4px 5px; } .table-bordered { border: 1px solid #ddd; border-collapse: separate; *border-collapse: collapse; border-left: 0; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .table-bordered th, .table-bordered td { border-left: 1px solid #ddd; } .table-bordered caption + thead tr:first-child th, .table-bordered caption + tbody tr:first-child th, .table-bordered caption + tbody tr:first-child td, .table-bordered colgroup + thead tr:first-child th, .table-bordered colgroup + tbody tr:first-child th, .table-bordered colgroup + tbody tr:first-child td, .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td { border-top: 0; } .table-bordered thead:first-child tr:first-child > th:first-child, .table-bordered tbody:first-child tr:first-child > td:first-child, .table-bordered tbody:first-child tr:first-child > th:first-child { -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; } .table-bordered thead:first-child tr:first-child > th:last-child, .table-bordered tbody:first-child tr:first-child > td:last-child, .table-bordered tbody:first-child tr:first-child > th:last-child { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; } .table-bordered thead:last-child tr:last-child > th:first-child, .table-bordered tbody:last-child tr:last-child > td:first-child, .table-bordered tbody:last-child tr:last-child > th:first-child, .table-bordered tfoot:last-child tr:last-child > td:first-child, .table-bordered tfoot:last-child tr:last-child > th:first-child { -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .table-bordered thead:last-child tr:last-child > th:last-child, .table-bordered tbody:last-child tr:last-child > td:last-child, .table-bordered tbody:last-child tr:last-child > th:last-child, .table-bordered tfoot:last-child tr:last-child > td:last-child, .table-bordered tfoot:last-child tr:last-child > th:last-child { -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } .table-bordered tfoot + tbody:last-child tr:last-child td:first-child { -webkit-border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; border-bottom-left-radius: 0; } .table-bordered tfoot + tbody:last-child tr:last-child td:last-child { -webkit-border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; border-bottom-right-radius: 0; } .table-bordered caption + thead tr:first-child th:first-child, .table-bordered caption + tbody tr:first-child td:first-child, .table-bordered colgroup + thead tr:first-child th:first-child, .table-bordered colgroup + tbody tr:first-child td:first-child { -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; } .table-bordered caption + thead tr:first-child th:last-child, .table-bordered caption + tbody tr:first-child td:last-child, .table-bordered colgroup + thead tr:first-child th:last-child, .table-bordered colgroup + tbody tr:first-child td:last-child { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; } .table-striped tbody > tr:nth-child(odd) > td, .table-striped tbody > tr:nth-child(odd) > th { background-color: #f9f9f9; } .table-hover tbody tr:hover > td, .table-hover tbody tr:hover > th { background-color: #f5f5f5; } table td[class*="span"], table th[class*="span"], .row-fluid table td[class*="span"], .row-fluid table th[class*="span"] { display: table-cell; float: none; margin-left: 0; } .table td.span1, .table th.span1 { float: none; width: 44px; margin-left: 0; } .table td.span2, .table th.span2 { float: none; width: 124px; margin-left: 0; } .table td.span3, .table th.span3 { float: none; width: 204px; margin-left: 0; } .table td.span4, .table th.span4 { float: none; width: 284px; margin-left: 0; } .table td.span5, .table th.span5 { float: none; width: 364px; margin-left: 0; } .table td.span6, .table th.span6 { float: none; width: 444px; margin-left: 0; } .table td.span7, .table th.span7 { float: none; width: 524px; margin-left: 0; } .table td.span8, .table th.span8 { float: none; width: 604px; margin-left: 0; } .table td.span9, .table th.span9 { float: none; width: 684px; margin-left: 0; } .table td.span10, .table th.span10 { float: none; width: 764px; margin-left: 0; } .table td.span11, .table th.span11 { float: none; width: 844px; margin-left: 0; } .table td.span12, .table th.span12 { float: none; width: 924px; margin-left: 0; } .table tbody tr.success > td { background-color: #dff0d8; } .table tbody tr.error > td { background-color: #f2dede; } .table tbody tr.warning > td { background-color: #fcf8e3; } .table tbody tr.info > td { background-color: #d9edf7; } .table-hover tbody tr.success:hover > td { background-color: #d0e9c6; } .table-hover tbody tr.error:hover > td { background-color: #ebcccc; } .table-hover tbody tr.warning:hover > td { background-color: #faf2cc; } .table-hover tbody tr.info:hover > td { background-color: #c4e3f3; } .dropup, .dropdown { position: relative; } .dropdown-toggle { *margin-bottom: -3px; } .dropdown-toggle:active, .open .dropdown-toggle { outline: 0; } .caret { display: inline-block; width: 0; height: 0; vertical-align: top; border-top: 4px solid #000; border-right: 4px solid transparent; border-left: 4px solid transparent; content: ""; } .dropdown .caret { margin-top: 8px; margin-left: 2px; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; background-color: #fff; border: 1px solid #ccc; border: 1px solid rgba(0,0,0,0.2); *border-right-width: 2px; *border-bottom-width: 2px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.2); -moz-box-shadow: 0 5px 10px rgba(0,0,0,0.2); box-shadow: 0 5px 10px rgba(0,0,0,0.2); -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { *width: 100%; height: 1px; margin: 8px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #fff; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 18px; color: #333; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus, .dropdown-submenu:hover > a, .dropdown-submenu:focus > a { text-decoration: none; color: #fff; background-color: #0081c2; background-image: -moz-linear-gradient(top,#08c,#0077b3); background-image: -webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3)); background-image: -webkit-linear-gradient(top,#08c,#0077b3); background-image: -o-linear-gradient(top,#08c,#0077b3); background-image: linear-gradient(to bottom,#08c,#0077b3); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0076b2', GradientType=0); } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #333; text-decoration: none; outline: 0; background-color: #0081c2; background-image: -moz-linear-gradient(top,#08c,#0077b3); background-image: -webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3)); background-image: -webkit-linear-gradient(top,#08c,#0077b3); background-image: -o-linear-gradient(top,#08c,#0077b3); background-image: linear-gradient(to bottom,#08c,#0077b3); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0076b2', GradientType=0); } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #999; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); cursor: default; } .open { *z-index: 1000; } .open > .dropdown-menu { display: block; } .dropdown-backdrop { position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px solid #000; content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 1px; } .dropdown-submenu { position: relative; } .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-top: -6px; margin-left: -1px; -webkit-border-radius: 6px 6px 6px 6px; -moz-border-radius: 6px 6px 6px 6px; border-radius: 6px 6px 6px 6px; } .dropdown-submenu:hover > .dropdown-menu { display: block; } .dropup .dropdown-submenu > .dropdown-menu { top: auto; bottom: 0; margin-top: 0; margin-bottom: -2px; -webkit-border-radius: 5px 5px 5px 0; -moz-border-radius: 5px 5px 5px 0; border-radius: 5px 5px 5px 0; } .dropdown-submenu > a:after { display: block; content: " "; float: right; width: 0; height: 0; border-color: transparent; border-style: solid; border-width: 5px 0 5px 5px; border-left-color: #cccccc; margin-top: 5px; margin-right: -10px; } .dropdown-submenu:hover > a:after { border-left-color: #fff; } .dropdown-submenu.pull-left { float: none; } .dropdown-submenu.pull-left > .dropdown-menu { left: -100%; margin-left: 10px; -webkit-border-radius: 6px 0 6px 6px; -moz-border-radius: 6px 0 6px 6px; border-radius: 6px 0 6px 6px; } .dropdown .dropdown-menu .nav-header { padding-left: 20px; padding-right: 20px; } .typeahead { z-index: 1051; margin-top: 2px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.05); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.05); box-shadow: inset 0 1px 1px rgba(0,0,0,0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0,0,0,0.15); } .well-large { padding: 24px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .well-small { padding: 9px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .fade { opacity: 0; -webkit-transition: opacity .15s linear; -moz-transition: opacity .15s linear; -o-transition: opacity .15s linear; transition: opacity .15s linear; } .fade.in { opacity: 1; } .collapse { position: relative; height: 0; overflow: hidden; -webkit-transition: height .35s ease; -moz-transition: height .35s ease; -o-transition: height .35s ease; transition: height .35s ease; } .collapse.in { height: auto; } .close { float: right; font-size: 20px; font-weight: bold; line-height: 18px; color: #000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20); } .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; opacity: 0.4; filter: alpha(opacity=40); } button.close { padding: 3; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; } .btn { display: inline-block; *display: inline; *zoom: 1; padding: 4px 12px; margin-bottom: 0; font-size: 13px; line-height: 18px; text-align: center; vertical-align: middle; cursor: pointer; color: #333; text-shadow: 0 1px 1px rgba(255,255,255,0.75); background-color: #f5f5f5; background-image: -moz-linear-gradient(top,#fff,#e6e6e6); background-image: -webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6)); background-image: -webkit-linear-gradient(top,#fff,#e6e6e6); background-image: -o-linear-gradient(top,#fff,#e6e6e6); background-image: linear-gradient(to bottom,#fff,#e6e6e6); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe5e5e5', GradientType=0); border-color: #e6e6e6 #e6e6e6 #bfbfbf; *background-color: #e6e6e6; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); border: 1px solid #bbb; *border: 0; border-bottom-color: #a2a2a2; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; *margin-left: .3em; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); } .btn:hover, .btn:focus, .btn:active, .btn.active, .btn.disabled, .btn[disabled] { color: #333; background-color: #e6e6e6; *background-color: #d9d9d9; } .btn:active, .btn.active { background-color: #cccccc \9; } .btn:first-child { *margin-left: 0; } .btn:hover, .btn:focus { color: #333; text-decoration: none; background-position: 0 -15px; -webkit-transition: background-position .1s linear; -moz-transition: background-position .1s linear; -o-transition: background-position .1s linear; transition: background-position .1s linear; } .btn:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn.active, .btn:active { background-image: none; outline: 0; -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); } .btn.disabled, .btn[disabled] { cursor: default; background-image: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn-large { padding: 11px 19px; font-size: 16.25px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .btn-large [class^="icon-"], .btn-large [class*=" icon-"] { margin-top: 4px; } .btn-small { padding: 2px 10px; font-size: 12px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .btn-small [class^="icon-"], .btn-small [class*=" icon-"] { margin-top: 0; } .btn-mini [class^="icon-"], .btn-mini [class*=" icon-"] { margin-top: -1px; } .btn-mini { padding: 0 6px; font-size: 9.75px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .btn-block { display: block; width: 100%; padding-left: 0; padding-right: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .btn-block + .btn-block { margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { width: 100%; } .btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-inverse.active { color: rgba(255,255,255,0.75); } .btn-primary { color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #006dcc; background-image: -moz-linear-gradient(top,#08c,#0044cc); background-image: -webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0044cc)); background-image: -webkit-linear-gradient(top,#08c,#0044cc); background-image: -o-linear-gradient(top,#08c,#0044cc); background-image: linear-gradient(to bottom,#08c,#0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0043cc', GradientType=0); border-color: #0044cc #0044cc #002a80; *background-color: #0044cc; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { color: #fff; background-color: #0044cc; *background-color: #003bb3; } .btn-primary:active, .btn-primary.active { background-color: #003399 \9; } .btn-warning { color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #faa732; background-image: -moz-linear-gradient(top,#fbb450,#f89406); background-image: -webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406)); background-image: -webkit-linear-gradient(top,#fbb450,#f89406); background-image: -o-linear-gradient(top,#fbb450,#f89406); background-image: linear-gradient(to bottom,#fbb450,#f89406); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffab44f', endColorstr='#fff89406', GradientType=0); border-color: #f89406 #f89406 #ad6704; *background-color: #f89406; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] { color: #fff; background-color: #f89406; *background-color: #df8505; } .btn-warning:active, .btn-warning.active { background-color: #c67605 \9; } .btn-danger { color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #da4f49; background-image: -moz-linear-gradient(top,#ee5f5b,#bd362f); background-image: -webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f)); background-image: -webkit-linear-gradient(top,#ee5f5b,#bd362f); background-image: -o-linear-gradient(top,#ee5f5b,#bd362f); background-image: linear-gradient(to bottom,#ee5f5b,#bd362f); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); border-color: #bd362f #bd362f #802420; *background-color: #bd362f; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] { color: #fff; background-color: #bd362f; *background-color: #a9302a; } .btn-danger:active, .btn-danger.active { background-color: #942a25 \9; } .btn-success { color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #5bb75b; background-image: -moz-linear-gradient(top,#62c462,#51a351); background-image: -webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351)); background-image: -webkit-linear-gradient(top,#62c462,#51a351); background-image: -o-linear-gradient(top,#62c462,#51a351); background-image: linear-gradient(to bottom,#62c462,#51a351); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); border-color: #51a351 #51a351 #387038; *background-color: #51a351; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] { color: #fff; background-color: #51a351; *background-color: #499249; } .btn-success:active, .btn-success.active { background-color: #408140 \9; } .btn-info { color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #49afcd; background-image: -moz-linear-gradient(top,#5bc0de,#2f96b4); background-image: -webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4)); background-image: -webkit-linear-gradient(top,#5bc0de,#2f96b4); background-image: -o-linear-gradient(top,#5bc0de,#2f96b4); background-image: linear-gradient(to bottom,#5bc0de,#2f96b4); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0); border-color: #2f96b4 #2f96b4 #1f6377; *background-color: #2f96b4; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] { color: #fff; background-color: #2f96b4; *background-color: #2a85a0; } .btn-info:active, .btn-info.active { background-color: #24748c \9; } .btn-inverse { color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #363636; background-image: -moz-linear-gradient(top,#444,#222); background-image: -webkit-gradient(linear,0 0,0 100%,from(#444),to(#222)); background-image: -webkit-linear-gradient(top,#444,#222); background-image: -o-linear-gradient(top,#444,#222); background-image: linear-gradient(to bottom,#444,#222); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); border-color: #222 #222 #000000; *background-color: #222; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-inverse:hover, .btn-inverse:focus, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] { color: #fff; background-color: #222; *background-color: #151515; } .btn-inverse:active, .btn-inverse.active { background-color: #090909 \9; } button.btn, input[type="submit"].btn { *padding-top: 3px; *padding-bottom: 3px; } button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner { padding: 0; border: 0; } button.btn.btn-large, input[type="submit"].btn.btn-large { *padding-top: 7px; *padding-bottom: 7px; } button.btn.btn-small, input[type="submit"].btn.btn-small { *padding-top: 3px; *padding-bottom: 3px; } button.btn.btn-mini, input[type="submit"].btn.btn-mini { *padding-top: 1px; *padding-bottom: 1px; } .btn-link, .btn-link:active, .btn-link[disabled] { background-color: transparent; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn-link { border-color: transparent; cursor: pointer; color: #08c; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-link:hover, .btn-link:focus { color: #005580; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, .btn-link[disabled]:focus { color: #333; text-decoration: none; } .btn-group { position: relative; display: inline-block; *display: inline; *zoom: 1; font-size: 0; vertical-align: middle; white-space: nowrap; *margin-left: .3em; } .btn-group:first-child { *margin-left: 0; } .btn-group + .btn-group { margin-left: 5px; } .btn-toolbar { font-size: 0; margin-top: 9px; margin-bottom: 9px; } .btn-toolbar > .btn + .btn, .btn-toolbar > .btn-group + .btn, .btn-toolbar > .btn + .btn-group { margin-left: 5px; } .btn-group > .btn { position: relative; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-group > .btn + .btn { margin-left: -1px; } .btn-group > .btn, .btn-group > .dropdown-menu, .btn-group > .popover { font-size: 13px; } .btn-group > .btn-mini { font-size: 9.75px; } .btn-group > .btn-small { font-size: 12px; } .btn-group > .btn-large { font-size: 16.25px; } .btn-group > .btn:first-child { margin-left: 0; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .btn-group > .btn:last-child, .btn-group > .dropdown-toggle { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } .btn-group > .btn.large:first-child { margin-left: 0; -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; } .btn-group > .btn.large:last-child, .btn-group > .large.dropdown-toggle { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; } .btn-group > .btn:hover, .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active { z-index: 2; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; -webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); *padding-top: 5px; *padding-bottom: 5px; } .btn-group > .btn-mini + .dropdown-toggle { padding-left: 5px; padding-right: 5px; *padding-top: 2px; *padding-bottom: 2px; } .btn-group > .btn-small + .dropdown-toggle { *padding-top: 5px; *padding-bottom: 4px; } .btn-group > .btn-large + .dropdown-toggle { padding-left: 12px; padding-right: 12px; *padding-top: 7px; *padding-bottom: 7px; } .btn-group.open .dropdown-toggle { background-image: none; -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); } .btn-group.open .btn.dropdown-toggle { background-color: #e6e6e6; } .btn-group.open .btn-primary.dropdown-toggle { background-color: #0044cc; } .btn-group.open .btn-warning.dropdown-toggle { background-color: #f89406; } .btn-group.open .btn-danger.dropdown-toggle { background-color: #bd362f; } .btn-group.open .btn-success.dropdown-toggle { background-color: #51a351; } .btn-group.open .btn-info.dropdown-toggle { background-color: #2f96b4; } .btn-group.open .btn-inverse.dropdown-toggle { background-color: #222; } .btn .caret { margin-top: 8px; margin-left: 0; } .btn-large .caret { margin-top: 6px; } .btn-large .caret { border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; } .btn-mini .caret, .btn-small .caret { margin-top: 8px; } .dropup .btn-large .caret { border-bottom-width: 5px; } .btn-primary .caret, .btn-warning .caret, .btn-danger .caret, .btn-info .caret, .btn-success .caret, .btn-inverse .caret { border-top-color: #fff; border-bottom-color: #fff; } .btn-group-vertical { display: inline-block; *display: inline; *zoom: 1; } .btn-group-vertical > .btn { display: block; float: none; max-width: 100%; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-group-vertical > .btn + .btn { margin-left: 0; margin-top: -1px; } .btn-group-vertical > .btn:first-child { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .btn-group-vertical > .btn:last-child { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .btn-group-vertical > .btn-large:first-child { -webkit-border-radius: 6px 6px 0 0; -moz-border-radius: 6px 6px 0 0; border-radius: 6px 6px 0 0; } .btn-group-vertical > .btn-large:last-child { -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; } .alert { padding: 8px 35px 8px 14px; margin-bottom: 18px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); background-color: #fcf8e3; border: 1px solid #fbeed5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .alert, .alert h4 { color: #c09853; } .alert h4 { margin: 0; } .alert .close { position: relative; top: -2px; right: -21px; line-height: 18px; } .alert-success { background-color: #dff0d8; border-color: #d6e9c6; color: #468847; } .alert-success h4 { color: #468847; } .alert-danger, .alert-error { background-color: #f2dede; border-color: #eed3d7; color: #b94a48; } .alert-danger h4, .alert-error h4 { color: #b94a48; } .alert-info { background-color: #d9edf7; border-color: #bce8f1; color: #3a87ad; } .alert-info h4 { color: #3a87ad; } .alert-block { padding-top: 14px; padding-bottom: 14px; } .alert-block > p, .alert-block > ul { margin-bottom: 0; } .alert-block p + p { margin-top: 5px; } .nav { margin-left: 0; margin-bottom: 18px; list-style: none; } .nav > li > a { display: block; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eee; } .nav > li > a > img { max-width: none; } .nav > .pull-right { float: right; } .nav-header { display: block; padding: 3px 15px; font-size: 11px; font-weight: bold; line-height: 18px; color: #999; text-shadow: 0 1px 0 rgba(255,255,255,0.5); text-transform: uppercase; } .nav li + .nav-header { margin-top: 9px; } .nav-list { padding-left: 15px; padding-right: 15px; margin-bottom: 0; } .nav-list > li > a, .nav-list .nav-header { margin-left: -15px; margin-right: -15px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); } .nav-list > li > a { padding: 3px 15px; } .nav-list > .active > a, .nav-list > .active > a:hover, .nav-list > .active > a:focus { color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.2); background-color: #08c; } .nav-list [class^="icon-"], .nav-list [class*=" icon-"] { margin-right: 2px; } .nav-list .divider { *width: 100%; height: 1px; margin: 8px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #fff; } .nav-tabs, .nav-pills { *zoom: 1; } .nav-tabs:before, .nav-tabs:after, .nav-pills:before, .nav-pills:after { display: table; content: ""; line-height: 0; } .nav-tabs:after, .nav-pills:after { clear: both; } .nav-tabs > li, .nav-pills > li { float: left; } .nav-tabs > li > a, .nav-pills > li > a { padding-right: 12px; padding-left: 12px; margin-right: 2px; line-height: 14px; } .nav-tabs { border-bottom: 1px solid #ddd; } .nav-tabs > li { margin-bottom: -1px; } .nav-tabs > li > a { padding-top: 8px; padding-bottom: 8px; line-height: 18px; border: 1px solid transparent; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover, .nav-tabs > li > a:focus { border-color: #eee #eee #ddd; } .nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus { color: #555; background-color: #fff; border: 1px solid #ddd; border-bottom-color: transparent; cursor: default; } .nav-pills > li > a { padding-top: 8px; padding-bottom: 8px; margin-top: 2px; margin-bottom: 2px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .nav-pills > .active > a, .nav-pills > .active > a:hover, .nav-pills > .active > a:focus { color: #fff; background-color: #08c; } .nav-stacked > li { float: none; } .nav-stacked > li > a { margin-right: 0; } .nav-tabs.nav-stacked { border-bottom: 0; } .nav-tabs.nav-stacked > li > a { border: 1px solid #ddd; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .nav-tabs.nav-stacked > li:first-child > a { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; } .nav-tabs.nav-stacked > li:last-child > a { -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .nav-tabs.nav-stacked > li > a:hover, .nav-tabs.nav-stacked > li > a:focus { border-color: #ddd; z-index: 2; } .nav-pills.nav-stacked > li > a { margin-bottom: 3px; } .nav-pills.nav-stacked > li:last-child > a { margin-bottom: 1px; } .nav-tabs .dropdown-menu { -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; } .nav-pills .dropdown-menu { -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .nav .dropdown-toggle .caret { border-top-color: #08c; border-bottom-color: #08c; margin-top: 6px; } .nav .dropdown-toggle:hover .caret, .nav .dropdown-toggle:focus .caret { border-top-color: #005580; border-bottom-color: #005580; } .nav-tabs .dropdown-toggle .caret { margin-top: 8px; } .nav .active .dropdown-toggle .caret { border-top-color: #fff; border-bottom-color: #fff; } .nav-tabs .active .dropdown-toggle .caret { border-top-color: #555; border-bottom-color: #555; } .nav > .dropdown.active > a:hover, .nav > .dropdown.active > a:focus { cursor: pointer; } .nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > li.dropdown.open.active > a:hover, .nav > li.dropdown.open.active > a:focus { color: #fff; background-color: #999; border-color: #999; } .nav li.dropdown.open .caret, .nav li.dropdown.open.active .caret, .nav li.dropdown.open a:hover .caret, .nav li.dropdown.open a:focus .caret { border-top-color: #fff; border-bottom-color: #fff; opacity: 1; filter: alpha(opacity=100); } .tabs-stacked .open > a:hover, .tabs-stacked .open > a:focus { border-color: #999; } .tabbable { *zoom: 1; } .tabbable:before, .tabbable:after { display: table; content: ""; line-height: 0; } .tabbable:after { clear: both; } .tab-content { overflow: auto; } .tabs-below > .nav-tabs, .tabs-right > .nav-tabs, .tabs-left > .nav-tabs { border-bottom: 0; } .tab-content > .tab-pane, .pill-content > .pill-pane { display: none; } .tab-content > .active, .pill-content > .active { display: block; } .tabs-below > .nav-tabs { border-top: 1px solid #ddd; } .tabs-below > .nav-tabs > li { margin-top: -1px; margin-bottom: 0; } .tabs-below > .nav-tabs > li > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .tabs-below > .nav-tabs > li > a:hover, .tabs-below > .nav-tabs > li > a:focus { border-bottom-color: transparent; border-top-color: #ddd; } .tabs-below > .nav-tabs > .active > a, .tabs-below > .nav-tabs > .active > a:hover, .tabs-below > .nav-tabs > .active > a:focus { border-color: transparent #ddd #ddd #ddd; } .tabs-left > .nav-tabs > li, .tabs-right > .nav-tabs > li { float: none; } .tabs-left > .nav-tabs > li > a, .tabs-right > .nav-tabs > li > a { min-width: 74px; margin-right: 0; margin-bottom: 3px; } .tabs-left > .nav-tabs { float: left; margin-right: 19px; border-right: 1px solid #ddd; } .tabs-left > .nav-tabs > li > a { margin-right: -1px; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; } .tabs-left > .nav-tabs > li > a:hover, .tabs-left > .nav-tabs > li > a:focus { border-color: #eee #ddd #eee #eee; } .tabs-left > .nav-tabs .active > a, .tabs-left > .nav-tabs .active > a:hover, .tabs-left > .nav-tabs .active > a:focus { border-color: #ddd transparent #ddd #ddd; *border-right-color: #fff; } .tabs-right > .nav-tabs { float: right; margin-left: 19px; border-left: 1px solid #ddd; } .tabs-right > .nav-tabs > li > a { margin-left: -1px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .tabs-right > .nav-tabs > li > a:hover, .tabs-right > .nav-tabs > li > a:focus { border-color: #eee #eee #eee #ddd; } .tabs-right > .nav-tabs .active > a, .tabs-right > .nav-tabs .active > a:hover, .tabs-right > .nav-tabs .active > a:focus { border-color: #ddd #ddd #ddd transparent; *border-left-color: #fff; } .nav > .disabled > a { color: #999; } .nav > .disabled > a:hover, .nav > .disabled > a:focus { text-decoration: none; background-color: transparent; cursor: default; } .navbar { overflow: visible; margin-bottom: 18px; *position: relative; *z-index: 2; } .navbar-inner { min-height: 40px; padding-left: 20px; padding-right: 20px; background-color: #fafafa; background-image: -moz-linear-gradient(top,#ffffff,#f2f2f2); background-image: -webkit-gradient(linear,0 0,0 100%,from(#ffffff),to(#f2f2f2)); background-image: -webkit-linear-gradient(top,#ffffff,#f2f2f2); background-image: -o-linear-gradient(top,#ffffff,#f2f2f2); background-image: linear-gradient(to bottom,#ffffff,#f2f2f2); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); border: 1px solid #d4d4d4; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 4px rgba(0,0,0,0.065); -moz-box-shadow: 0 1px 4px rgba(0,0,0,0.065); box-shadow: 0 1px 4px rgba(0,0,0,0.065); *zoom: 1; } .navbar-inner:before, .navbar-inner:after { display: table; content: ""; line-height: 0; } .navbar-inner:after { clear: both; } .navbar .container { width: auto; } .nav-collapse.collapse { height: auto; overflow: visible; } .navbar .brand { float: left; display: block; padding: 11px 20px 11px; margin-left: -20px; font-size: 20px; font-weight: 200; color: #555; text-shadow: 0 1px 0 #ffffff; } .navbar .brand:hover, .navbar .brand:focus { text-decoration: none; } .navbar-text { margin-bottom: 0; line-height: 40px; color: #555; } .navbar-link { color: #555; } .navbar-link:hover, .navbar-link:focus { color: #333; } .navbar .divider-vertical { height: 40px; margin: 0 9px; border-left: 1px solid #f2f2f2; border-right: 1px solid #ffffff; } .navbar .btn, .navbar .btn-group { margin-top: 5px; } .navbar .btn-group .btn, .navbar .input-prepend .btn, .navbar .input-append .btn, .navbar .input-prepend .btn-group, .navbar .input-append .btn-group { margin-top: 0; } .navbar-form { margin-bottom: 0; *zoom: 1; } .navbar-form:before, .navbar-form:after { display: table; content: ""; line-height: 0; } .navbar-form:after { clear: both; } .navbar-form input, .navbar-form select, .navbar-form .radio, .navbar-form .checkbox { margin-top: 5px; } .navbar-form input, .navbar-form select, .navbar-form .btn { display: inline-block; margin-bottom: 0; } .navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] { margin-top: 3px; } .navbar-form .input-append, .navbar-form .input-prepend { margin-top: 5px; white-space: nowrap; } .navbar-form .input-append input, .navbar-form .input-prepend input { margin-top: 0; } .navbar-search { position: relative; float: left; margin-top: 5px; margin-bottom: 0; } .navbar-search .search-query { margin-bottom: 0; padding: 4px 14px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; font-weight: normal; line-height: 1; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; } .navbar-static-top { position: static; margin-bottom: 0; } .navbar-static-top .navbar-inner { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; margin-bottom: 0; } .navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner { border-width: 0 0 1px; } .navbar-fixed-bottom .navbar-inner { border-width: 1px 0 0; } .navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner { padding-left: 0; padding-right: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 940px; } .navbar-fixed-top { top: 0; } .navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner { -webkit-box-shadow: 0 1px 10px rgba(0,0,0,.1); -moz-box-shadow: 0 1px 10px rgba(0,0,0,.1); box-shadow: 0 1px 10px rgba(0,0,0,.1); } .navbar-fixed-bottom { bottom: 0; } .navbar-fixed-bottom .navbar-inner { -webkit-box-shadow: 0 -1px 10px rgba(0,0,0,.1); -moz-box-shadow: 0 -1px 10px rgba(0,0,0,.1); box-shadow: 0 -1px 10px rgba(0,0,0,.1); } .navbar .nav { position: relative; left: 0; display: block; float: left; margin: 0 10px 0 0; } .navbar .nav.pull-right { float: right; margin-right: 0; } .navbar .nav > li { float: left; } .navbar .nav > li > a { float: none; padding: 11px 15px 11px; color: #555; text-decoration: none; text-shadow: 0 1px 0 #ffffff; } .navbar .nav .dropdown-toggle .caret { margin-top: 8px; } .navbar .nav > li > a:focus, .navbar .nav > li > a:hover { background-color: transparent; color: #333; text-decoration: none; } .navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus { color: #555; text-decoration: none; background-color: #e6e6e6; -webkit-box-shadow: inset 0 3px 8px rgba(0,0,0,0.125); -moz-box-shadow: inset 0 3px 8px rgba(0,0,0,0.125); box-shadow: inset 0 3px 8px rgba(0,0,0,0.125); } .navbar .btn-navbar { display: none; float: right; padding: 7px 10px; margin-left: 5px; margin-right: 5px; color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #ededed; background-image: -moz-linear-gradient(top,#f2f2f2,#e6e6e6); background-image: -webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e6e6e6)); background-image: -webkit-linear-gradient(top,#f2f2f2,#e6e6e6); background-image: -o-linear-gradient(top,#f2f2f2,#e6e6e6); background-image: linear-gradient(to bottom,#f2f2f2,#e6e6e6); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); border-color: #e6e6e6 #e6e6e6 #bfbfbf; *background-color: #e6e6e6; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); } .navbar .btn-navbar:hover, .navbar .btn-navbar:focus, .navbar .btn-navbar:active, .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled] { color: #fff; background-color: #e6e6e6; *background-color: #d9d9d9; } .navbar .btn-navbar:active, .navbar .btn-navbar.active { background-color: #cccccc \9; } .navbar .btn-navbar .icon-bar { display: block; width: 18px; height: 2px; background-color: #f5f5f5; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; -webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.25); -moz-box-shadow: 0 1px 0 rgba(0,0,0,0.25); box-shadow: 0 1px 0 rgba(0,0,0,0.25); } .btn-navbar .icon-bar + .icon-bar { margin-top: 3px; } .navbar .nav > li > .dropdown-menu:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0,0,0,0.2); position: absolute; top: -7px; left: 9px; } .navbar .nav > li > .dropdown-menu:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #fff; position: absolute; top: -6px; left: 10px; } .navbar-fixed-bottom .nav > li > .dropdown-menu:before { border-top: 7px solid #ccc; border-top-color: rgba(0,0,0,0.2); border-bottom: 0; bottom: -7px; top: auto; } .navbar-fixed-bottom .nav > li > .dropdown-menu:after { border-top: 6px solid #fff; border-bottom: 0; bottom: -6px; top: auto; } .navbar .nav li.dropdown > a:hover .caret, .navbar .nav li.dropdown > a:focus .caret { border-top-color: #333; border-bottom-color: #333; } .navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.active > .dropdown-toggle, .navbar .nav li.dropdown.open.active > .dropdown-toggle { background-color: #e6e6e6; color: #555; } .navbar .nav li.dropdown > .dropdown-toggle .caret { border-top-color: #555; border-bottom-color: #555; } .navbar .nav li.dropdown.open > .dropdown-toggle .caret, .navbar .nav li.dropdown.active > .dropdown-toggle .caret, .navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { border-top-color: #555; border-bottom-color: #555; } .navbar .pull-right > li > .dropdown-menu, .navbar .nav > li > .dropdown-menu.pull-right { left: auto; right: 0; } .navbar .pull-right > li > .dropdown-menu:before, .navbar .nav > li > .dropdown-menu.pull-right:before { left: auto; right: 12px; } .navbar .pull-right > li > .dropdown-menu:after, .navbar .nav > li > .dropdown-menu.pull-right:after { left: auto; right: 13px; } .navbar .pull-right > li > .dropdown-menu .dropdown-menu, .navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { left: auto; right: 100%; margin-left: 0; margin-right: -1px; -webkit-border-radius: 6px 0 6px 6px; -moz-border-radius: 6px 0 6px 6px; border-radius: 6px 0 6px 6px; } .navbar-inverse .navbar-inner { background-color: #1b1b1b; background-image: -moz-linear-gradient(top,#222222,#111111); background-image: -webkit-gradient(linear,0 0,0 100%,from(#222222),to(#111111)); background-image: -webkit-linear-gradient(top,#222222,#111111); background-image: -o-linear-gradient(top,#222222,#111111); background-image: linear-gradient(to bottom,#222222,#111111); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); border-color: #252525; } .navbar-inverse .brand, .navbar-inverse .nav > li > a { color: #999; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); } .navbar-inverse .brand:hover, .navbar-inverse .brand:focus, .navbar-inverse .nav > li > a:hover, .navbar-inverse .nav > li > a:focus { color: #fff; } .navbar-inverse .brand { color: #999; } .navbar-inverse .navbar-text { color: #999; } .navbar-inverse .nav > li > a:focus, .navbar-inverse .nav > li > a:hover { background-color: transparent; color: #fff; } .navbar-inverse .nav .active > a, .navbar-inverse .nav .active > a:hover, .navbar-inverse .nav .active > a:focus { color: #fff; background-color: #111111; } .navbar-inverse .navbar-link { color: #999; } .navbar-inverse .navbar-link:hover, .navbar-inverse .navbar-link:focus { color: #fff; } .navbar-inverse .divider-vertical { border-left-color: #111111; border-right-color: #222222; } .navbar-inverse .nav li.dropdown.open > .dropdown-toggle, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { background-color: #111111; color: #fff; } .navbar-inverse .nav li.dropdown > a:hover .caret, .navbar-inverse .nav li.dropdown > a:focus .caret { border-top-color: #fff; border-bottom-color: #fff; } .navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { border-top-color: #999; border-bottom-color: #999; } .navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { border-top-color: #fff; border-bottom-color: #fff; } .navbar-inverse .navbar-search .search-query { color: #fff; background-color: #515151; border-color: #111111; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15); box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15); -webkit-transition: none; -moz-transition: none; -o-transition: none; transition: none; } .navbar-inverse .navbar-search .search-query:-moz-placeholder { color: #ccc; } .navbar-inverse .navbar-search .search-query:-ms-input-placeholder { color: #ccc; } .navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { color: #ccc; } .navbar-inverse .navbar-search .search-query:focus, .navbar-inverse .navbar-search .search-query.focused { padding: 5px 15px; color: #333; text-shadow: 0 1px 0 #fff; background-color: #fff; border: 0; -webkit-box-shadow: 0 0 3px rgba(0,0,0,0.15); -moz-box-shadow: 0 0 3px rgba(0,0,0,0.15); box-shadow: 0 0 3px rgba(0,0,0,0.15); outline: 0; } .navbar-inverse .btn-navbar { color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #0e0e0e; background-image: -moz-linear-gradient(top,#151515,#040404); background-image: -webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404)); background-image: -webkit-linear-gradient(top,#151515,#040404); background-image: -o-linear-gradient(top,#151515,#040404); background-image: linear-gradient(to bottom,#151515,#040404); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); border-color: #040404 #040404 #000000; *background-color: #040404; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .navbar-inverse .btn-navbar:hover, .navbar-inverse .btn-navbar:focus, .navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active, .navbar-inverse .btn-navbar.disabled, .navbar-inverse .btn-navbar[disabled] { color: #fff; background-color: #040404; *background-color: #000000; } .navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active { background-color: #000000 \9; } .breadcrumb { padding: 8px 15px; margin: 0 0 18px; list-style: none; background-color: #f5f5f5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .breadcrumb > li { display: inline-block; *display: inline; *zoom: 1; text-shadow: 0 1px 0 #fff; } .breadcrumb > li > .divider { padding: 0 5px; color: #ccc; } .breadcrumb > .active { color: #999; } .pagination { margin: 18px 0; } .pagination ul { display: inline-block; *display: inline; *zoom: 1; margin-left: 0; margin-bottom: 0; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.05); -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.05); box-shadow: 0 1px 2px rgba(0,0,0,0.05); } .pagination ul > li { display: inline; } .pagination ul > li > a, .pagination ul > li > span { float: left; padding: 4px 12px; line-height: 18px; text-decoration: none; background-color: #fff; border: 1px solid #ddd; border-left-width: 0; } .pagination ul > li > a:hover, .pagination ul > li > a:focus, .pagination ul > .active > a, .pagination ul > .active > span { background-color: #f5f5f5; } .pagination ul > .active > a, .pagination ul > .active > span { color: #999; cursor: default; } .pagination ul > .disabled > span, .pagination ul > .disabled > a, .pagination ul > .disabled > a:hover, .pagination ul > .disabled > a:focus { color: #999; background-color: transparent; cursor: default; } .pagination ul > li:first-child > a, .pagination ul > li:first-child > span { border-left-width: 1px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .pagination ul > li:last-child > a, .pagination ul > li:last-child > span { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } .pagination-centered { text-align: center; } .pagination-right { text-align: right; } .pagination-large ul > li > a, .pagination-large ul > li > span { padding: 11px 19px; font-size: 16.25px; } .pagination-large ul > li:first-child > a, .pagination-large ul > li:first-child > span { -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; } .pagination-large ul > li:last-child > a, .pagination-large ul > li:last-child > span { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; } .pagination-mini ul > li:first-child > a, .pagination-mini ul > li:first-child > span, .pagination-small ul > li:first-child > a, .pagination-small ul > li:first-child > span { -webkit-border-top-left-radius: 3px; -moz-border-radius-topleft: 3px; border-top-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; border-bottom-left-radius: 3px; } .pagination-mini ul > li:last-child > a, .pagination-mini ul > li:last-child > span, .pagination-small ul > li:last-child > a, .pagination-small ul > li:last-child > span { -webkit-border-top-right-radius: 3px; -moz-border-radius-topright: 3px; border-top-right-radius: 3px; -webkit-border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; border-bottom-right-radius: 3px; } .pagination-small ul > li > a, .pagination-small ul > li > span { padding: 2px 10px; font-size: 12px; } .pagination-mini ul > li > a, .pagination-mini ul > li > span { padding: 0 6px; font-size: 9.75px; } .pager { margin: 18px 0; list-style: none; text-align: center; *zoom: 1; } .pager:before, .pager:after { display: table; content: ""; line-height: 0; } .pager:after { clear: both; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #ddd; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #f5f5f5; } .pager .next > a, .pager .next > span { float: right; } .pager .previous > a, .pager .previous > span { float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #999; background-color: #fff; cursor: default; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000; } .modal-backdrop.fade { opacity: 0; } .modal-backdrop, .modal-backdrop.fade.in { opacity: 0.8; filter: alpha(opacity=80); } .modal-header { padding: 9px 15px; border-bottom: 1px solid #eee; } .modal-header .close { margin-top: 2px; } .modal-header h3 { margin: 0; line-height: 30px; } .modal-body { width: 98%; position: relative; max-height: 400px; padding: 1%; } .modal-body iframe { width: 100%; max-height: none; border: 0 !important; } .modal-form { margin-bottom: 0; } .modal-footer { padding: 14px 15px 15px; margin-bottom: 0; text-align: right; background-color: #f5f5f5; border-top: 1px solid #ddd; -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; -webkit-box-shadow: inset 0 1px 0 #fff; -moz-box-shadow: inset 0 1px 0 #fff; box-shadow: inset 0 1px 0 #fff; *zoom: 1; } .modal-footer:before, .modal-footer:after { display: table; content: ""; line-height: 0; } .modal-footer:after { clear: both; } .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .modal-footer .btn-block + .btn-block { margin-left: 0; } .tooltip { position: absolute; z-index: 1030; display: block; visibility: visible; font-size: 11px; line-height: 1.4; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.8; filter: alpha(opacity=80); } .tooltip.top { margin-top: -3px; padding: 5px 0; } .tooltip.right { margin-left: 3px; padding: 0 5px; } .tooltip.bottom { margin-top: 3px; padding: 5px 0; } .tooltip.left { margin-left: -3px; padding: 0 5px; } .tooltip-inner { max-width: 200px; padding: 8px; color: #fff; text-align: center; text-decoration: none; background-color: #000; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .popover { position: absolute; top: 0; left: 0; z-index: 1010; display: none; max-width: 276px; padding: 1px; text-align: left; background-color: #fff; -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0,0,0,0.2); -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.2); -moz-box-shadow: 0 5px 10px rgba(0,0,0,0.2); box-shadow: 0 5px 10px rgba(0,0,0,0.2); white-space: normal; } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { margin: 0; padding: 8px 14px; font-size: 14px; font-weight: normal; line-height: 18px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; -webkit-border-radius: 5px 5px 0 0; -moz-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; } .popover-title:empty { display: none; } .popover-content { padding: 9px 14px; } .popover .arrow, .popover .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover .arrow { border-width: 11px; } .popover .arrow:after { border-width: 10px; content: ""; } .popover.top .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: #999; border-top-color: rgba(0,0,0,0.25); bottom: -11px; } .popover.top .arrow:after { bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #fff; } .popover.right .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: #999; border-right-color: rgba(0,0,0,0.25); } .popover.right .arrow:after { left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #fff; } .popover.bottom .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999; border-bottom-color: rgba(0,0,0,0.25); top: -11px; } .popover.bottom .arrow:after { top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #fff; } .popover.left .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999; border-left-color: rgba(0,0,0,0.25); } .popover.left .arrow:after { right: 1px; border-right-width: 0; border-left-color: #fff; bottom: -10px; } .thumbnails { margin-left: -20px; list-style: none; *zoom: 1; } .thumbnails:before, .thumbnails:after { display: table; content: ""; line-height: 0; } .thumbnails:after { clear: both; } .row-fluid .thumbnails { margin-left: 0; } .thumbnails > li { float: left; margin-bottom: 18px; margin-left: 20px; } .thumbnail { display: block; padding: 4px; line-height: 18px; border: 1px solid #ddd; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.055); -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.055); box-shadow: 0 1px 3px rgba(0,0,0,0.055); -webkit-transition: all .2s ease-in-out; -moz-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; transition: all .2s ease-in-out; } a.thumbnail:hover, a.thumbnail:focus { border-color: #08c; -webkit-box-shadow: 0 1px 4px rgba(0,105,214,0.25); -moz-box-shadow: 0 1px 4px rgba(0,105,214,0.25); box-shadow: 0 1px 4px rgba(0,105,214,0.25); } .thumbnail > img { display: block; max-width: 100%; margin-left: auto; margin-right: auto; } .thumbnail .caption { padding: 9px; color: #555; } .label, .badge { display: inline-block; padding: 2px 4px; font-size: 10.998px; font-weight: bold; line-height: 14px; color: #fff; vertical-align: baseline; white-space: nowrap; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #999; } .label { -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .badge { padding-left: 9px; padding-right: 9px; -webkit-border-radius: 9px; -moz-border-radius: 9px; border-radius: 9px; } .label:empty, .badge:empty { display: none; } a.label:hover, a.label:focus, a.badge:hover, a.badge:focus { color: #fff; text-decoration: none; cursor: pointer; } .label-important, .badge-important { background-color: #b94a48; } .label-important[href], .badge-important[href] { background-color: #953b39; } .label-warning, .badge-warning { background-color: #f89406; } .label-warning[href], .badge-warning[href] { background-color: #c67605; } .label-success, .badge-success { background-color: #468847; } .label-success[href], .badge-success[href] { background-color: #356635; } .label-info, .badge-info { background-color: #3a87ad; } .label-info[href], .badge-info[href] { background-color: #2d6987; } .label-inverse, .badge-inverse { background-color: #333; } .label-inverse[href], .badge-inverse[href] { background-color: #1a1a1a; } .btn .label, .btn .badge { position: relative; top: -1px; } .btn-mini .label, .btn-mini .badge { top: 0; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-moz-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-ms-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-o-keyframes progress-bar-stripes { from { background-position: 0 0; } to { background-position: 40px 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { overflow: hidden; height: 18px; margin-bottom: 18px; background-color: #f7f7f7; background-image: -moz-linear-gradient(top,#f5f5f5,#f9f9f9); background-image: -webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9)); background-image: -webkit-linear-gradient(top,#f5f5f5,#f9f9f9); background-image: -o-linear-gradient(top,#f5f5f5,#f9f9f9); background-image: linear-gradient(to bottom,#f5f5f5,#f9f9f9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .progress .bar { width: 0%; height: 100%; color: #fff; float: left; font-size: 12px; text-align: center; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); background-color: #0e90d2; background-image: -moz-linear-gradient(top,#149bdf,#0480be); background-image: -webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be)); background-image: -webkit-linear-gradient(top,#149bdf,#0480be); background-image: -o-linear-gradient(top,#149bdf,#0480be); background-image: linear-gradient(to bottom,#149bdf,#0480be); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); -moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: width .6s ease; -moz-transition: width .6s ease; -o-transition: width .6s ease; transition: width .6s ease; } .progress .bar + .bar { -webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15); -moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15); box-shadow: inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15); } .progress-striped .bar { background-color: #149bdf; background-image: -webkit-gradient(linear,0 100%,100% 0,color-stop(.25,rgba(255,255,255,0.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,0.15)),color-stop(.75,rgba(255,255,255,0.15)),color-stop(.75,transparent),to(transparent)); background-image: -webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); -webkit-background-size: 40px 40px; -moz-background-size: 40px 40px; -o-background-size: 40px 40px; background-size: 40px 40px; } .progress.active .bar { -webkit-animation: progress-bar-stripes 2s linear infinite; -moz-animation: progress-bar-stripes 2s linear infinite; -ms-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-danger .bar, .progress .bar-danger { background-color: #dd514c; background-image: -moz-linear-gradient(top,#ee5f5b,#c43c35); background-image: -webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35)); background-image: -webkit-linear-gradient(top,#ee5f5b,#c43c35); background-image: -o-linear-gradient(top,#ee5f5b,#c43c35); background-image: linear-gradient(to bottom,#ee5f5b,#c43c35); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); } .progress-danger.progress-striped .bar, .progress-striped .bar-danger { background-color: #ee5f5b; background-image: -webkit-gradient(linear,0 100%,100% 0,color-stop(.25,rgba(255,255,255,0.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,0.15)),color-stop(.75,rgba(255,255,255,0.15)),color-stop(.75,transparent),to(transparent)); background-image: -webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); } .progress-success .bar, .progress .bar-success { background-color: #5eb95e; background-image: -moz-linear-gradient(top,#62c462,#57a957); background-image: -webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957)); background-image: -webkit-linear-gradient(top,#62c462,#57a957); background-image: -o-linear-gradient(top,#62c462,#57a957); background-image: linear-gradient(to bottom,#62c462,#57a957); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); } .progress-success.progress-striped .bar, .progress-striped .bar-success { background-color: #62c462; background-image: -webkit-gradient(linear,0 100%,100% 0,color-stop(.25,rgba(255,255,255,0.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,0.15)),color-stop(.75,rgba(255,255,255,0.15)),color-stop(.75,transparent),to(transparent)); background-image: -webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); } .progress-info .bar, .progress .bar-info { background-color: #4bb1cf; background-image: -moz-linear-gradient(top,#5bc0de,#339bb9); background-image: -webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9)); background-image: -webkit-linear-gradient(top,#5bc0de,#339bb9); background-image: -o-linear-gradient(top,#5bc0de,#339bb9); background-image: linear-gradient(to bottom,#5bc0de,#339bb9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); } .progress-info.progress-striped .bar, .progress-striped .bar-info { background-color: #5bc0de; background-image: -webkit-gradient(linear,0 100%,100% 0,color-stop(.25,rgba(255,255,255,0.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,0.15)),color-stop(.75,rgba(255,255,255,0.15)),color-stop(.75,transparent),to(transparent)); background-image: -webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); } .progress-warning .bar, .progress .bar-warning { background-color: #faa732; background-image: -moz-linear-gradient(top,#fbb450,#f89406); background-image: -webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406)); background-image: -webkit-linear-gradient(top,#fbb450,#f89406); background-image: -o-linear-gradient(top,#fbb450,#f89406); background-image: linear-gradient(to bottom,#fbb450,#f89406); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffab44f', endColorstr='#fff89406', GradientType=0); } .progress-warning.progress-striped .bar, .progress-striped .bar-warning { background-color: #fbb450; background-image: -webkit-gradient(linear,0 100%,100% 0,color-stop(.25,rgba(255,255,255,0.15)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,0.15)),color-stop(.75,rgba(255,255,255,0.15)),color-stop(.75,transparent),to(transparent)); background-image: -webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: -o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); background-image: linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent); } .accordion { margin-bottom: 18px; } .accordion-group { margin-bottom: 2px; border: 1px solid #e5e5e5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .accordion-heading { border-bottom: 0; } .accordion-heading .accordion-toggle { display: block; padding: 8px 15px; } .accordion-toggle { cursor: pointer; } .accordion-inner { padding: 9px 15px; border-top: 1px solid #e5e5e5; } .carousel { position: relative; margin-bottom: 18px; line-height: 1; } .carousel-inner { overflow: hidden; width: 100%; position: relative; } .carousel-inner > .item { display: none; position: relative; -webkit-transition: .6s ease-in-out left; -moz-transition: .6s ease-in-out left; -o-transition: .6s ease-in-out left; transition: .6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; line-height: 1; } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { display: block; } .carousel-inner > .active { left: 0; } .carousel-inner > .next, .carousel-inner > .prev { position: absolute; top: 0; width: 100%; } .carousel-inner > .next { left: 100%; } .carousel-inner > .prev { left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { left: 0; } .carousel-inner > .active.left { left: -100%; } .carousel-inner > .active.right { left: 100%; } .carousel-control { position: absolute; top: 40%; left: 15px; width: 40px; height: 40px; margin-top: -20px; font-size: 60px; font-weight: 100; line-height: 30px; color: #fff; text-align: center; background: #222; border: 3px solid #fff; -webkit-border-radius: 23px; -moz-border-radius: 23px; border-radius: 23px; opacity: 0.5; filter: alpha(opacity=50); } .carousel-control.right { left: auto; right: 15px; } .carousel-control:hover, .carousel-control:focus { color: #fff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-indicators { position: absolute; top: 15px; right: 15px; z-index: 5; margin: 0; list-style: none; } .carousel-indicators li { display: block; float: left; width: 10px; height: 10px; margin-left: 5px; text-indent: -999px; background-color: #ccc; background-color: rgba(255,255,255,0.25); border-radius: 5px; } .carousel-indicators .active { background-color: #fff; } .carousel-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 15px; background: #333; background: rgba(0,0,0,0.75); } .carousel-caption h4, .carousel-caption p { color: #fff; line-height: 18px; } .carousel-caption h4 { margin: 0 0 5px; } .carousel-caption p { margin-bottom: 0; } .hero-unit { padding: 60px; margin-bottom: 30px; font-size: 18px; font-weight: 200; line-height: 27px; color: inherit; background-color: #eee; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .hero-unit h1 { margin-bottom: 0; font-size: 60px; line-height: 1; color: inherit; letter-spacing: -1px; } .hero-unit li { line-height: 27px; } .pull-right { float: right; } .pull-left { float: left; } .hide { display: none; } .show { display: block; } .invisible { visibility: hidden; } .affix { position: fixed; } .hidden { display: none; visibility: hidden; } .visible-phone { display: none !important; } .visible-tablet { display: none !important; } .hidden-desktop { display: none !important; } .visible-desktop { display: inherit !important; } @media (min-width: 768px) and (max-width: 979px) { .hidden-desktop { display: inherit !important; } .visible-desktop { display: none !important; } .visible-tablet { display: inherit !important; } .hidden-tablet { display: none !important; } } @media (max-width: 767px) { .hidden-desktop { display: inherit !important; } .visible-desktop { display: none !important; } .visible-phone { display: inherit !important; } .hidden-phone { display: none !important; } } .visible-print { display: none !important; } @media print { .visible-print { display: inherit !important; } .hidden-print { display: none !important; } } @media (max-width: 767px) { body { padding-left: 20px; padding-right: 20px; } .navbar-fixed-top, .navbar-fixed-bottom, .navbar-static-top { margin-left: -20px; margin-right: -20px; } .container-fluid { padding: 0; } .dl-horizontal dt { float: none; clear: none; width: auto; text-align: left; } .dl-horizontal dd { margin-left: 0; } .container { width: auto; } .row-fluid { width: 100%; } .row, .thumbnails { margin-left: 0; } .thumbnails > li { float: none; margin-left: 0; } [class*="span"], .uneditable-input[class*="span"], .row-fluid [class*="span"] { float: none; display: block; width: 100%; margin-left: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .span12, .row-fluid .span12 { width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .row-fluid [class*="offset"]:first-child { margin-left: 0; } .input-large, .input-xlarge, .input-xxlarge, input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input { display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .input-prepend input, .input-append input, .input-prepend input[class*="span"], .input-append input[class*="span"] { display: inline-block; width: auto; } .controls-row [class*="span"] + [class*="span"] { margin-left: 0; } } @media (max-width: 480px) { .nav-collapse { -webkit-transform: translate3d(0,0,0); } .page-header h1 small { display: block; line-height: 18px; } input[type="checkbox"], input[type="radio"] { border: 1px solid #ccc; } .form-horizontal .control-label { float: none; width: auto; padding-top: 0; text-align: left; } .form-horizontal .controls { margin-left: 0; } .form-horizontal .control-list { padding-top: 0; } .form-horizontal .form-actions { padding-left: 10px; padding-right: 10px; } .media .pull-left, .media .pull-right { float: none; display: block; margin-bottom: 10px; } .media-object { margin-right: 0; margin-left: 0; } .modal-header .close { padding: 10px; margin: -10px; } .carousel-caption { position: static; } } @media (min-width: 768px) and (max-width: 979px) { .row { margin-left: -20px; *zoom: 1; } .row:before, .row:after { display: table; content: ""; line-height: 0; } .row:after { clear: both; } [class*="span"] { float: left; min-height: 1px; margin-left: 20px; } .container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 724px; } .span12 { width: 724px; } .span11 { width: 662px; } .span10 { width: 600px; } .span9 { width: 538px; } .span8 { width: 476px; } .span7 { width: 414px; } .span6 { width: 352px; } .span5 { width: 290px; } .span4 { width: 228px; } .span3 { width: 166px; } .span2 { width: 104px; } .span1 { width: 42px; } .offset12 { margin-left: 764px; } .offset11 { margin-left: 702px; } .offset10 { margin-left: 640px; } .offset9 { margin-left: 578px; } .offset8 { margin-left: 516px; } .offset7 { margin-left: 454px; } .offset6 { margin-left: 392px; } .offset5 { margin-left: 330px; } .offset4 { margin-left: 268px; } .offset3 { margin-left: 206px; } .offset2 { margin-left: 144px; } .offset1 { margin-left: 82px; } .row-fluid { width: 100%; *zoom: 1; } .row-fluid:before, .row-fluid:after { display: table; content: ""; line-height: 0; } .row-fluid:after { clear: both; } .row-fluid [class*="span"] { display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.127659574%; *margin-left: 2.0744680846383%; } .row-fluid [class*="span"]:first-child { margin-left: 0; } .row-fluid .controls-row [class*="span"] + [class*="span"] { margin-left: 2.127659574%; } .row-fluid .span12 { width: 99.99999999%; *width: 99.946808500638%; } .row-fluid .span11 { width: 91.489361693%; *width: 91.436170203638%; } .row-fluid .span10 { width: 82.978723396%; *width: 82.925531906638%; } .row-fluid .span9 { width: 74.468085099%; *width: 74.414893609638%; } .row-fluid .span8 { width: 65.957446802%; *width: 65.904255312638%; } .row-fluid .span7 { width: 57.446808505%; *width: 57.393617015638%; } .row-fluid .span6 { width: 48.936170208%; *width: 48.882978718638%; } .row-fluid .span5 { width: 40.425531911%; *width: 40.372340421638%; } .row-fluid .span4 { width: 31.914893614%; *width: 31.861702124638%; } .row-fluid .span3 { width: 23.404255317%; *width: 23.351063827638%; } .row-fluid .span2 { width: 14.89361702%; *width: 14.840425530638%; } .row-fluid .span1 { width: 6.382978723%; *width: 6.3297872336383%; } .row-fluid .offset12 { margin-left: 104.255319138%; *margin-left: 104.14893615928%; } .row-fluid .offset12:first-child { margin-left: 102.127659564%; *margin-left: 102.02127658528%; } .row-fluid .offset11 { margin-left: 95.744680841%; *margin-left: 95.638297862277%; } .row-fluid .offset11:first-child { margin-left: 93.617021267%; *margin-left: 93.510638288277%; } .row-fluid .offset10 { margin-left: 87.234042544%; *margin-left: 87.127659565277%; } .row-fluid .offset10:first-child { margin-left: 85.10638297%; *margin-left: 84.999999991277%; } .row-fluid .offset9 { margin-left: 78.723404247%; *margin-left: 78.617021268277%; } .row-fluid .offset9:first-child { margin-left: 76.595744673%; *margin-left: 76.489361694277%; } .row-fluid .offset8 { margin-left: 70.21276595%; *margin-left: 70.106382971277%; } .row-fluid .offset8:first-child { margin-left: 68.085106376%; *margin-left: 67.978723397277%; } .row-fluid .offset7 { margin-left: 61.702127653%; *margin-left: 61.595744674277%; } .row-fluid .offset7:first-child { margin-left: 59.574468079%; *margin-left: 59.468085100277%; } .row-fluid .offset6 { margin-left: 53.191489356%; *margin-left: 53.085106377277%; } .row-fluid .offset6:first-child { margin-left: 51.063829782%; *margin-left: 50.957446803277%; } .row-fluid .offset5 { margin-left: 44.680851059%; *margin-left: 44.574468080277%; } .row-fluid .offset5:first-child { margin-left: 42.553191485%; *margin-left: 42.446808506277%; } .row-fluid .offset4 { margin-left: 36.170212762%; *margin-left: 36.063829783277%; } .row-fluid .offset4:first-child { margin-left: 34.042553188%; *margin-left: 33.936170209277%; } .row-fluid .offset3 { margin-left: 27.659574465%; *margin-left: 27.553191486277%; } .row-fluid .offset3:first-child { margin-left: 25.531914891%; *margin-left: 25.425531912277%; } .row-fluid .offset2 { margin-left: 19.148936168%; *margin-left: 19.042553189277%; } .row-fluid .offset2:first-child { margin-left: 17.021276594%; *margin-left: 16.914893615277%; } .row-fluid .offset1 { margin-left: 10.638297871%; *margin-left: 10.531914892277%; } .row-fluid .offset1:first-child { margin-left: 8.510638297%; *margin-left: 8.4042553182766%; } input, textarea, .uneditable-input { margin-left: 0; } .controls-row [class*="span"] + [class*="span"] { margin-left: 20px; } input.span12, textarea.span12, .uneditable-input.span12 { width: 710px; } input.span11, textarea.span11, .uneditable-input.span11 { width: 648px; } input.span10, textarea.span10, .uneditable-input.span10 { width: 586px; } input.span9, textarea.span9, .uneditable-input.span9 { width: 524px; } input.span8, textarea.span8, .uneditable-input.span8 { width: 462px; } input.span7, textarea.span7, .uneditable-input.span7 { width: 400px; } input.span6, textarea.span6, .uneditable-input.span6 { width: 338px; } input.span5, textarea.span5, .uneditable-input.span5 { width: 276px; } input.span4, textarea.span4, .uneditable-input.span4 { width: 214px; } input.span3, textarea.span3, .uneditable-input.span3 { width: 152px; } input.span2, textarea.span2, .uneditable-input.span2 { width: 90px; } input.span1, textarea.span1, .uneditable-input.span1 { width: 28px; } } @media (min-width: 1200px) { .row { margin-left: -20px; *zoom: 1; } .row:before, .row:after { display: table; content: ""; line-height: 0; } .row:after { clear: both; } [class*="span"] { float: left; min-height: 1px; margin-left: 20px; } .container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 940px; } .span12 { width: 940px; } .span11 { width: 860px; } .span10 { width: 780px; } .span9 { width: 700px; } .span8 { width: 620px; } .span7 { width: 540px; } .span6 { width: 460px; } .span5 { width: 380px; } .span4 { width: 300px; } .span3 { width: 220px; } .span2 { width: 140px; } .span1 { width: 60px; } .offset12 { margin-left: 980px; } .offset11 { margin-left: 900px; } .offset10 { margin-left: 820px; } .offset9 { margin-left: 740px; } .offset8 { margin-left: 660px; } .offset7 { margin-left: 580px; } .offset6 { margin-left: 500px; } .offset5 { margin-left: 420px; } .offset4 { margin-left: 340px; } .offset3 { margin-left: 260px; } .offset2 { margin-left: 180px; } .offset1 { margin-left: 100px; } .row-fluid { width: 100%; *zoom: 1; } .row-fluid:before, .row-fluid:after { display: table; content: ""; line-height: 0; } .row-fluid:after { clear: both; } .row-fluid [class*="span"] { display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.127659574%; *margin-left: 2.0744680846383%; } .row-fluid [class*="span"]:first-child { margin-left: 0; } .row-fluid .controls-row [class*="span"] + [class*="span"] { margin-left: 2.127659574%; } .row-fluid .span12 { width: 99.99999999%; *width: 99.946808500638%; } .row-fluid .span11 { width: 91.489361693%; *width: 91.436170203638%; } .row-fluid .span10 { width: 82.978723396%; *width: 82.925531906638%; } .row-fluid .span9 { width: 74.468085099%; *width: 74.414893609638%; } .row-fluid .span8 { width: 65.957446802%; *width: 65.904255312638%; } .row-fluid .span7 { width: 57.446808505%; *width: 57.393617015638%; } .row-fluid .span6 { width: 48.936170208%; *width: 48.882978718638%; } .row-fluid .span5 { width: 40.425531911%; *width: 40.372340421638%; } .row-fluid .span4 { width: 31.914893614%; *width: 31.861702124638%; } .row-fluid .span3 { width: 23.404255317%; *width: 23.351063827638%; } .row-fluid .span2 { width: 14.89361702%; *width: 14.840425530638%; } .row-fluid .span1 { width: 6.382978723%; *width: 6.3297872336383%; } .row-fluid .offset12 { margin-left: 104.255319138%; *margin-left: 104.14893615928%; } .row-fluid .offset12:first-child { margin-left: 102.127659564%; *margin-left: 102.02127658528%; } .row-fluid .offset11 { margin-left: 95.744680841%; *margin-left: 95.638297862277%; } .row-fluid .offset11:first-child { margin-left: 93.617021267%; *margin-left: 93.510638288277%; } .row-fluid .offset10 { margin-left: 87.234042544%; *margin-left: 87.127659565277%; } .row-fluid .offset10:first-child { margin-left: 85.10638297%; *margin-left: 84.999999991277%; } .row-fluid .offset9 { margin-left: 78.723404247%; *margin-left: 78.617021268277%; } .row-fluid .offset9:first-child { margin-left: 76.595744673%; *margin-left: 76.489361694277%; } .row-fluid .offset8 { margin-left: 70.21276595%; *margin-left: 70.106382971277%; } .row-fluid .offset8:first-child { margin-left: 68.085106376%; *margin-left: 67.978723397277%; } .row-fluid .offset7 { margin-left: 61.702127653%; *margin-left: 61.595744674277%; } .row-fluid .offset7:first-child { margin-left: 59.574468079%; *margin-left: 59.468085100277%; } .row-fluid .offset6 { margin-left: 53.191489356%; *margin-left: 53.085106377277%; } .row-fluid .offset6:first-child { margin-left: 51.063829782%; *margin-left: 50.957446803277%; } .row-fluid .offset5 { margin-left: 44.680851059%; *margin-left: 44.574468080277%; } .row-fluid .offset5:first-child { margin-left: 42.553191485%; *margin-left: 42.446808506277%; } .row-fluid .offset4 { margin-left: 36.170212762%; *margin-left: 36.063829783277%; } .row-fluid .offset4:first-child { margin-left: 34.042553188%; *margin-left: 33.936170209277%; } .row-fluid .offset3 { margin-left: 27.659574465%; *margin-left: 27.553191486277%; } .row-fluid .offset3:first-child { margin-left: 25.531914891%; *margin-left: 25.425531912277%; } .row-fluid .offset2 { margin-left: 19.148936168%; *margin-left: 19.042553189277%; } .row-fluid .offset2:first-child { margin-left: 17.021276594%; *margin-left: 16.914893615277%; } .row-fluid .offset1 { margin-left: 10.638297871%; *margin-left: 10.531914892277%; } .row-fluid .offset1:first-child { margin-left: 8.510638297%; *margin-left: 8.4042553182766%; } input, textarea, .uneditable-input { margin-left: 0; } .controls-row [class*="span"] + [class*="span"] { margin-left: 20px; } input.span12, textarea.span12, .uneditable-input.span12 { width: 926px; } input.span11, textarea.span11, .uneditable-input.span11 { width: 846px; } input.span10, textarea.span10, .uneditable-input.span10 { width: 766px; } input.span9, textarea.span9, .uneditable-input.span9 { width: 686px; } input.span8, textarea.span8, .uneditable-input.span8 { width: 606px; } input.span7, textarea.span7, .uneditable-input.span7 { width: 526px; } input.span6, textarea.span6, .uneditable-input.span6 { width: 446px; } input.span5, textarea.span5, .uneditable-input.span5 { width: 366px; } input.span4, textarea.span4, .uneditable-input.span4 { width: 286px; } input.span3, textarea.span3, .uneditable-input.span3 { width: 206px; } input.span2, textarea.span2, .uneditable-input.span2 { width: 126px; } input.span1, textarea.span1, .uneditable-input.span1 { width: 46px; } .thumbnails { margin-left: -20px; } .thumbnails > li { margin-left: 20px; } .row-fluid .thumbnails { margin-left: 0; } } @media (max-width: 979px) { body { padding-top: 0; } .navbar-fixed-top, .navbar-fixed-bottom { position: static; } .navbar-fixed-top { margin-bottom: 18px; } .navbar-fixed-bottom { margin-top: 18px; } .navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner { padding: 5px; } .navbar .container { width: auto; padding: 0; } .navbar .brand { padding-left: 10px; padding-right: 10px; margin: 0 0 0 -5px; } .nav-collapse { clear: both; } .nav-collapse .nav { float: none; margin: 0 0 9px; } .nav-collapse .nav > li { float: none; } .nav-collapse .nav > li > a { margin-bottom: 2px; } .nav-collapse .nav > .divider-vertical { display: none; } .nav-collapse .nav .nav-header { color: #555; text-shadow: none; } .nav-collapse .nav > li > a, .nav-collapse .dropdown-menu a { padding: 9px 15px; font-weight: bold; color: #555; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .nav-collapse .btn { padding: 4px 10px 4px; font-weight: normal; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .nav-collapse .dropdown-menu li + li a { margin-bottom: 2px; } .nav-collapse .nav > li > a:hover, .nav-collapse .nav > li > a:focus, .nav-collapse .dropdown-menu a:hover, .nav-collapse .dropdown-menu a:focus { background-color: #f2f2f2; } .navbar-inverse .nav-collapse .nav > li > a, .navbar-inverse .nav-collapse .dropdown-menu a { color: #999; } .navbar-inverse .nav-collapse .nav > li > a:hover, .navbar-inverse .nav-collapse .nav > li > a:focus, .navbar-inverse .nav-collapse .dropdown-menu a:hover, .navbar-inverse .nav-collapse .dropdown-menu a:focus { background-color: #111111; } .nav-collapse.in .btn-group { margin-top: 5px; padding: 0; } .nav-collapse .dropdown-menu { position: static; top: auto; left: auto; float: none; display: none; max-width: none; margin: 0 15px; padding: 0; background-color: transparent; border: none; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .nav-collapse .open > .dropdown-menu { display: block; } .nav-collapse .dropdown-menu:before, .nav-collapse .dropdown-menu:after { display: none; } .nav-collapse .dropdown-menu .divider { display: none; } .nav-collapse .nav > li > .dropdown-menu:before, .nav-collapse .nav > li > .dropdown-menu:after { display: none; } .nav-collapse .navbar-form, .nav-collapse .navbar-search { float: none; padding: 9px 15px; margin: 9px 0; border-top: 1px solid #f2f2f2; border-bottom: 1px solid #f2f2f2; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1); } .navbar-inverse .nav-collapse .navbar-form, .navbar-inverse .nav-collapse .navbar-search { border-top-color: #111111; border-bottom-color: #111111; } .navbar .nav-collapse .nav.pull-right { float: none; margin-left: 0; } .nav-collapse, .nav-collapse.collapse { overflow: hidden; height: 0; } .navbar .btn-navbar { display: block; } .navbar-static .navbar-inner { padding-left: 10px; padding-right: 10px; } } @media (min-width: 980px) { .nav-collapse.collapse { height: auto !important; overflow: visible !important; } } .small { font-size: 11px; } iframe, svg { max-width: 100%; } .nowrap { white-space: nowrap; } .center, .table td.center, .table th.center { text-align: center; } a.disabled, a.disabled:hover { color: #999999; background-color: transparent; cursor: default; text-decoration: none; } .hero-unit { text-align: center; } .hero-unit .lead { margin-bottom: 18px; font-size: 20px; font-weight: 200; line-height: 27px; } .btn .caret { margin-bottom: 7px; } .btn.btn-micro .caret { margin: 5px 0; } .blog-row-rule, .blog-item-rule { border: 0; } body.modal { padding-top: 0; } .row-even, .row-odd { padding: 5px; width: 99%; border-bottom: 1px solid #ddd; } .row-odd { background-color: transparent; } .row-even { background-color: #f9f9f9; } .blog-row-rule, .blog-item-rule { border: 0; } .row-fluid .row-reveal { visibility: hidden; } .row-fluid:hover .row-reveal { visibility: visible; } .btn-wide { width: 80%; } .nav-list > li.offset > a { padding-left: 30px; font-size: 12px; } .blog-row-rule, .blog-item-rule { border: 0; } .row-fluid .offset1 { margin-left: 8.382978723%; } .row-fluid .offset2 { margin-left: 16.89361702%; } .row-fluid .offset3 { margin-left: 25.404255317%; } .row-fluid .offset4 { margin-left: 33.914893614%; } .row-fluid .offset5 { margin-left: 42.425531911%; } .row-fluid .offset6 { margin-left: 50.93617020799999%; } .row-fluid .offset7 { margin-left: 59.446808505%; } .row-fluid .offset8 { margin-left: 67.95744680199999%; } .row-fluid .offset9 { margin-left: 76.468085099%; } .row-fluid .offset10 { margin-left: 84.97872339599999%; } .row-fluid .offset11 { margin-left: 91.489361693%; } .navbar .nav > li > a.btn { padding: 4px 10px; line-height: 18px; } .nav-tabs.nav-dark { border-bottom: 1px solid #333; text-shadow: 1px 1px 1px #000; } .nav-tabs.nav-dark > li > a { color: #F8F8F8; } .nav-tabs.nav-dark > li > a:hover { border-color: #333 #333 #111; background-color: #777777; } .nav-tabs.nav-dark > .active > a, .nav-tabs.nav-dark > .active > a:hover { color: #ffffff; background-color: #555555; border: 1px solid #222; border-bottom-color: transparent; } .thumbnail.pull-left { margin: 0 10px 10px 0; } .thumbnail.pull-right { margin: 0 0 10px 10px; } .width-10 { width: 10px; } .width-20 { width: 20px; } .width-30 { width: 30px; } .width-40 { width: 40px; } .width-50 { width: 50px; } .width-60 { width: 60px; } .width-70 { width: 70px; } .width-80 { width: 80px; } .width-90 { width: 90px; } .width-100 { width: 100px; } .height-10 { height: 10px; } .height-20 { height: 20px; } .height-30 { height: 30px; } .height-40 { height: 40px; } .height-50 { height: 50px; } .height-60 { height: 60px; } .height-70 { height: 70px; } .height-80 { height: 80px; } .height-90 { height: 90px; } .height-100 { height: 100px; } hr.hr-condensed { margin: 10px 0; } .list-striped, .row-striped { list-style: none; line-height: 18px; text-align: left; vertical-align: middle; border-top: 1px solid #ddd; margin-left: 0; } .list-striped li, .list-striped dd, .row-striped .row, .row-striped .row-fluid { border-bottom: 1px solid #ddd; padding: 8px; } .list-striped li:nth-child(odd), .list-striped dd:nth-child(odd), .row-striped .row:nth-child(odd), .row-striped .row-fluid:nth-child(odd) { background-color: #f9f9f9; } .list-striped li:hover, .list-striped dd:hover, .row-striped .row:hover, .row-striped .row-fluid:hover { background-color: #f5f5f5; } .row-striped .row-fluid { width: 97%; } .row-striped .row-fluid [class*="span"] { min-height: 10px; } .row-striped .row-fluid [class*="span"] { margin-left: 8px; } .row-striped .row-fluid [class*="span"]:first-child { margin-left: 0; } .list-condensed li { padding: 4px 5px; } .row-condensed .row, .row-condensed .row-fluid { padding: 4px 5px; } .list-bordered, .row-bordered { list-style: none; line-height: 18px; text-align: left; vertical-align: middle; margin-left: 0; border: 1px solid #ddd; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .radio.btn-group input[type=radio] { display: none; } .radio.btn-group > label:first-of-type { margin-left: 0; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-topleft: 4px; } fieldset.radio.btn-group { padding-left: 0; } .iframe-bordered { border: 1px solid #ddd; } .tab-content { overflow: visible; } .tabs-left .tab-content { overflow: auto; } .nav-tabs > li > span { display: block; margin-right: 2px; padding-right: 12px; padding-left: 12px; padding-top: 8px; padding-bottom: 8px; line-height: 18px; border: 1px solid transparent; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .btn-micro { padding: 1px 4px; font-size: 10px; line-height: 8px; } .btn-group > .btn-micro { font-size: 10px; } .tip-wrap { max-width: 200px; padding: 3px 8px; color: #fff; text-align: center; text-decoration: none; background-color: #000; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; z-index: 100; } .page-header { margin: 2px 0px 10px 0px; padding-bottom: 5px; } .input-prepend .chzn-container-single .chzn-single, .input-append .chzn-container-single .chzn-single { border-color: #ccc; height: 26px; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } .input-prepend .chzn-container-single .chzn-drop, .input-append .chzn-container-single .chzn-drop { border-color: #ccc; } .input-prepend > .add-on, .input-append > .add-on { vertical-align: top; } .input-prepend .chzn-container-single .chzn-single { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-prepend .chzn-container-single .chzn-single-with-drop { -webkit-border-radius: 0 3px 0 0; -moz-border-radius: 0 3px 0 0; border-radius: 0 3px 0 0; } .input-append .chzn-container-single .chzn-single { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .input-append .chzn-container-single .chzn-single-with-drop { -webkit-border-radius: 3px 0 0 0; -moz-border-radius: 3px 0 0 0; border-radius: 3px 0 0 0; } .input-prepend.input-append .chzn-container-single .chzn-single, .input-prepend.input-append .chzn-container-single .chzn-single-with-drop { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .element-invisible { position: absolute; padding: 0; margin: 0; border: 0; height: 1px; width: 1px; overflow: hidden; } .form-vertical .control-label { float: none; width: auto; padding-right: 0; padding-top: 0; text-align: left; } .form-vertical .controls { margin-left: 0; } .width-auto { width: auto; } .btn-group .chzn-results { white-space: normal; } .accordion-body.in:hover { overflow: visible; } .invalid { color: #9d261d; font-weight: bold; } input.invalid { border: 1px solid #9d261d; } select.chzn-done.invalid + .chzn-container.chzn-container-single > a.chzn-single, select.chzn-done.invalid + .chzn-container.chzn-container-multi > ul.chzn-choices { border-color: #9d261d; color: #9d261d; } .tooltip { max-width: 400px; } .tooltip-inner { max-width: none; text-align: left; text-shadow: none; } th .tooltip-inner { font-weight: normal; } .tooltip.hasimage { opacity: 1; } .tip-text { text-align: left; } .btn-group > .btn + .dropdown-backdrop + .btn { margin-left: -1px; } .btn-group > .btn + .dropdown-backdrop + .dropdown-toggle { padding-left: 8px; padding-right: 8px; -webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); *padding-top: 5px; *padding-bottom: 5px; } .btn-group > .btn-mini + .dropdown-backdrop + .dropdown-toggle { padding-left: 5px; padding-right: 5px; *padding-top: 2px; *padding-bottom: 2px; } .btn-group > .btn-small + .dropdown-backdrop + .dropdown-toggle { *padding-top: 5px; *padding-bottom: 4px; } .btn-group > .btn-large + .dropdown-backdrop + .dropdown-toggle { padding-left: 12px; padding-right: 12px; *padding-top: 7px; *padding-bottom: 7px; } .dropdown-menu { text-align: left; } div.modal { position: fixed; top: 5%; left: 50%; z-index: 1050; width: 80%; margin-left: -40%; background-color: #fff; border: 1px solid #999; border: 1px solid rgba(0,0,0,0.3); *border: 1px solid #999; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 3px 7px rgba(0,0,0,0.3); -moz-box-shadow: 0 3px 7px rgba(0,0,0,0.3); box-shadow: 0 3px 7px rgba(0,0,0,0.3); -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; outline: none; } div.modal.fade { -webkit-transition: opacity .3s linear, top .3s ease-out; -moz-transition: opacity .3s linear, top .3s ease-out; -o-transition: opacity .3s linear, top .3s ease-out; transition: opacity .3s linear, top .3s ease-out; top: -25%; } div.modal.fade.in { top: 5%; } .modal-batch { overflow-y: visible; } @media (max-width: 767px) { div.modal { position: fixed; top: 20px; left: 20px; right: 20px; width: auto; margin: 0; } div.modal.fade { top: -100px; } div.modal.fade.in { top: 20px; } } @media (max-width: 480px) { div.modal { top: 10px; left: 10px; right: 10px; } } @font-face { font-family: 'IcoMoon'; src: url('../../../media/jui/fonts/IcoMoon.eot'); src: url('../../../media/jui/fonts/IcoMoon.eot?#iefix') format('embedded-opentype'), url('../../../media/jui/fonts/IcoMoon.woff') format('woff'), url('../../../media/jui/fonts/IcoMoon.ttf') format('truetype'), url('../../../media/jui/fonts/IcoMoon.svg#IcoMoon') format('svg'); font-weight: normal; font-style: normal; } [data-icon]:before { font-family: 'IcoMoon'; content: attr(data-icon); speak: none; } [class^="icon-"], [class*=" icon-"] { display: inline-block; width: 14px; height: 14px; margin-right: .25em; line-height: 14px; } [class^="icon-"]:before, [class*=" icon-"]:before { font-family: 'IcoMoon'; font-style: normal; speak: none; } [class^="icon-"].disabled, [class*=" icon-"].disabled { font-weight: normal; } .icon-joomla:before { content: "\e200"; } .icon-chevron-up:before, .icon-uparrow:before, .icon-arrow-up:before { content: "\e005"; } .icon-chevron-right:before, .icon-rightarrow:before, .icon-arrow-right:before { content: "\e006"; } .icon-chevron-down:before, .icon-downarrow:before, .icon-arrow-down:before { content: "\e007"; } .icon-chevron-left:before, .icon-leftarrow:before, .icon-arrow-left:before { content: "\e008"; } .icon-arrow-first:before { content: "\e003"; } .icon-arrow-last:before { content: "\e004"; } .icon-arrow-up-2:before { content: "\e009"; } .icon-arrow-right-2:before { content: "\e00a"; } .icon-arrow-down-2:before { content: "\e00b"; } .icon-arrow-left-2:before { content: "\e00c"; } .icon-arrow-up-3:before { content: "\e00f"; } .icon-arrow-right-3:before { content: "\e010"; } .icon-arrow-down-3:before { content: "\e011"; } .icon-arrow-left-3:before { content: "\e012"; } .icon-menu-2:before { content: "\e00e"; } .icon-arrow-up-4:before { content: "\e201"; } .icon-arrow-right-4:before { content: "\e202"; } .icon-arrow-down-4:before { content: "\e203"; } .icon-arrow-left-4:before { content: "\e204"; } .icon-share:before, .icon-redo:before { content: "\27"; } .icon-undo:before { content: "\28"; } .icon-forward-2:before { content: "\e205"; } .icon-backward-2:before, .icon-reply:before { content: "\e206"; } .icon-unblock:before, .icon-refresh:before, .icon-redo-2:before { content: "\6c"; } .icon-undo-2:before { content: "\e207"; } .icon-move:before { content: "\7a"; } .icon-expand:before { content: "\66"; } .icon-contract:before { content: "\67"; } .icon-expand-2:before { content: "\68"; } .icon-contract-2:before { content: "\69"; } .icon-play:before { content: "\e208"; } .icon-pause:before { content: "\e209"; } .icon-stop:before { content: "\e210"; } .icon-previous:before, .icon-backward:before { content: "\7c"; } .icon-next:before, .icon-forward:before { content: "\7b"; } .icon-first:before { content: "\7d"; } .icon-last:before { content: "\e000"; } .icon-play-circle:before { content: "\e00d"; } .icon-pause-circle:before { content: "\e211"; } .icon-stop-circle:before { content: "\e212"; } .icon-backward-circle:before { content: "\e213"; } .icon-forward-circle:before { content: "\e214"; } .icon-loop:before { content: "\e001"; } .icon-shuffle:before { content: "\e002"; } .icon-search:before { content: "\53"; } .icon-zoom-in:before { content: "\64"; } .icon-zoom-out:before { content: "\65"; } .icon-apply:before, .icon-edit:before, .icon-pencil:before { content: "\2b"; } .icon-pencil-2:before { content: "\2c"; } .icon-brush:before { content: "\3b"; } .icon-save-new:before, .icon-plus-2:before { content: "\5d"; } .icon-minus-sign:before, .icon-minus-2:before { content: "\5e"; } .icon-delete:before, .icon-remove:before, .icon-cancel-2:before { content: "\49"; } .icon-publish:before, .icon-save:before, .icon-ok:before, .icon-checkmark:before { content: "\47"; } .icon-new:before, .icon-plus:before { content: "\2a"; } .icon-plus-circle:before { content: "\e215"; } .icon-minus:before, .icon-not-ok:before { content: "\4b"; } .icon-ban-circle:before, .icon-minus-circle:before { content: "\e216"; } .icon-unpublish:before, .icon-cancel:before { content: "\4a"; } .icon-cancel-circle:before { content: "\e217"; } .icon-checkmark-2:before { content: "\e218"; } .icon-checkmark-circle:before { content: "\e219"; } .icon-info:before { content: "\e220"; } .icon-info-2:before, .icon-info-circle:before { content: "\e221"; } .icon-question:before, .icon-question-sign:before, .icon-help:before { content: "\45"; } .icon-question-2:before, .icon-question-circle:before { content: "\e222"; } .icon-notification:before { content: "\e223"; } .icon-notification-2:before, .icon-notification-circle:before { content: "\e224"; } .icon-pending:before, .icon-warning:before { content: "\48"; } .icon-warning-2:before, .icon-warning-circle:before { content: "\e225"; } .icon-checkbox-unchecked:before { content: "\3d"; } .icon-checkin:before, .icon-checkbox:before, .icon-checkbox-checked:before { content: "\3e"; } .icon-checkbox-partial:before { content: "\3f"; } .icon-square:before { content: "\e226"; } .icon-radio-unchecked:before { content: "\e227"; } .icon-radio-checked:before, .icon-generic:before { content: "\e228"; } .icon-circle:before { content: "\e229"; } .icon-signup:before { content: "\e230"; } .icon-grid:before, .icon-grid-view:before { content: "\58"; } .icon-grid-2:before, .icon-grid-view-2:before { content: "\59"; } .icon-menu:before { content: "\5a"; } .icon-list:before, .icon-list-view:before { content: "\31"; } .icon-list-2:before { content: "\e231"; } .icon-menu-3:before { content: "\e232"; } .icon-folder-open:before, .icon-folder:before { content: "\2d"; } .icon-folder-close:before, .icon-folder-2:before { content: "\2e"; } .icon-folder-plus:before { content: "\e234"; } .icon-folder-minus:before { content: "\e235"; } .icon-folder-3:before { content: "\e236"; } .icon-folder-plus-2:before { content: "\e237"; } .icon-folder-remove:before { content: "\e238"; } .icon-file:before { content: "\e016"; } .icon-file-2:before { content: "\e239"; } .icon-file-add:before, .icon-file-plus:before { content: "\29"; } .icon-file-minus:before { content: "\e017"; } .icon-file-check:before { content: "\e240"; } .icon-file-remove:before { content: "\e241"; } .icon-save-copy:before, .icon-copy:before { content: "\e018"; } .icon-stack:before { content: "\e242"; } .icon-tree:before { content: "\e243"; } .icon-tree-2:before { content: "\e244"; } .icon-paragraph-left:before { content: "\e246"; } .icon-paragraph-center:before { content: "\e247"; } .icon-paragraph-right:before { content: "\e248"; } .icon-paragraph-justify:before { content: "\e249"; } .icon-screen:before { content: "\e01c"; } .icon-tablet:before { content: "\e01d"; } .icon-mobile:before { content: "\e01e"; } .icon-box-add:before { content: "\51"; } .icon-box-remove:before { content: "\52"; } .icon-download:before { content: "\e021"; } .icon-upload:before { content: "\e022"; } .icon-home:before { content: "\21"; } .icon-home-2:before { content: "\e250"; } .icon-out-2:before, .icon-new-tab:before { content: "\e024"; } .icon-out-3:before, .icon-new-tab-2:before { content: "\e251"; } .icon-link:before { content: "\e252"; } .icon-picture:before, .icon-image:before { content: "\2f"; } .icon-pictures:before, .icon-images:before { content: "\30"; } .icon-palette:before, .icon-color-palette:before { content: "\e014"; } .icon-camera:before { content: "\55"; } .icon-camera-2:before, .icon-video:before { content: "\e015"; } .icon-play-2:before, .icon-video-2:before, .icon-youtube:before { content: "\56"; } .icon-music:before { content: "\57"; } .icon-user:before { content: "\22"; } .icon-users:before { content: "\e01f"; } .icon-vcard:before { content: "\6d"; } .icon-address:before { content: "\70"; } .icon-share-alt:before, .icon-out:before { content: "\26"; } .icon-enter:before { content: "\e257"; } .icon-exit:before { content: "\e258"; } .icon-comment:before, .icon-comments:before { content: "\24"; } .icon-comments-2:before { content: "\25"; } .icon-quote:before, .icon-quotes-left:before { content: "\60"; } .icon-quote-2:before, .icon-quotes-right:before { content: "\61"; } .icon-quote-3:before, .icon-bubble-quote:before { content: "\e259"; } .icon-phone:before { content: "\e260"; } .icon-phone-2:before { content: "\e261"; } .icon-envelope:before, .icon-mail:before { content: "\4d"; } .icon-envelope-opened:before, .icon-mail-2:before { content: "\4e"; } .icon-unarchive:before, .icon-drawer:before { content: "\4f"; } .icon-archive:before, .icon-drawer-2:before { content: "\50"; } .icon-briefcase:before { content: "\e020"; } .icon-tag:before { content: "\e262"; } .icon-tag-2:before { content: "\e263"; } .icon-tags:before { content: "\e264"; } .icon-tags-2:before { content: "\e265"; } .icon-options:before, .icon-cog:before { content: "\38"; } .icon-cogs:before { content: "\37"; } .icon-screwdriver:before, .icon-tools:before { content: "\36"; } .icon-wrench:before { content: "\3a"; } .icon-equalizer:before { content: "\39"; } .icon-dashboard:before { content: "\78"; } .icon-switch:before { content: "\e266"; } .icon-filter:before { content: "\54"; } .icon-purge:before, .icon-trash:before { content: "\4c"; } .icon-checkedout:before, .icon-lock:before, .icon-locked:before { content: "\23"; } .icon-unlock:before { content: "\e267"; } .icon-key:before { content: "\5f"; } .icon-support:before { content: "\46"; } .icon-database:before { content: "\62"; } .icon-scissors:before { content: "\e268"; } .icon-health:before { content: "\6a"; } .icon-wand:before { content: "\6b"; } .icon-eye-open:before, .icon-eye:before { content: "\3c"; } .icon-eye-close:before, .icon-eye-blocked:before, .icon-eye-2:before { content: "\e269"; } .icon-clock:before { content: "\6e"; } .icon-compass:before { content: "\6f"; } .icon-broadcast:before, .icon-connection:before, .icon-wifi:before { content: "\e01b"; } .icon-book:before { content: "\e271"; } .icon-lightning:before, .icon-flash:before { content: "\79"; } .icon-print:before, .icon-printer:before { content: "\e013"; } .icon-feed:before { content: "\71"; } .icon-calendar:before { content: "\43"; } .icon-calendar-2:before { content: "\44"; } .icon-calendar-3:before { content: "\e273"; } .icon-pie:before { content: "\77"; } .icon-bars:before { content: "\76"; } .icon-chart:before { content: "\75"; } .icon-power-cord:before { content: "\32"; } .icon-cube:before { content: "\33"; } .icon-puzzle:before { content: "\34"; } .icon-attachment:before, .icon-paperclip:before, .icon-flag-2:before { content: "\72"; } .icon-lamp:before { content: "\74"; } .icon-pin:before, .icon-pushpin:before { content: "\73"; } .icon-location:before { content: "\63"; } .icon-shield:before { content: "\e274"; } .icon-flag:before { content: "\35"; } .icon-flag-3:before { content: "\e275"; } .icon-bookmark:before { content: "\e023"; } .icon-bookmark-2:before { content: "\e276"; } .icon-heart:before { content: "\e277"; } .icon-heart-2:before { content: "\e278"; } .icon-thumbs-up:before { content: "\5b"; } .icon-thumbs-down:before { content: "\5c"; } .icon-unfeatured:before, .icon-asterisk:before, .icon-star-empty:before { content: "\40"; } .icon-star-2:before { content: "\41"; } .icon-featured:before, .icon-default:before, .icon-star:before { content: "\42"; } .icon-smiley:before, .icon-smiley-happy:before { content: "\e279"; } .icon-smiley-2:before, .icon-smiley-happy-2:before { content: "\e280"; } .icon-smiley-sad:before { content: "\e281"; } .icon-smiley-sad-2:before { content: "\e282"; } .icon-smiley-neutral:before { content: "\e283"; } .icon-smiley-neutral-2:before { content: "\e284"; } .icon-cart:before { content: "\e019"; } .icon-basket:before { content: "\e01a"; } .icon-credit:before { content: "\e286"; } .icon-credit-2:before { content: "\e287"; } .icon-expired:before { content: "\4b"; } body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body.site { border-top: 3px solid #0088cc; padding: 20px; background-color: #f4f6f7; } body.site.fluid { background-color: #ffffff; } .thumbnail { margin-bottom: 9px; } .accordion-group { background: #fff; } .site-title { font-size: 40px; line-height: 48px; font-weight: bold; } .brand { color: #004466; -webkit-transition: color .5s linear; -moz-transition: color .5s linear; -o-transition: color .5s linear; transition: color .5s linear; } .brand:hover { color: #08c; text-decoration: none; } .header { margin-bottom: 10px; } .header .finder { margin-top: 14px; } .header .finder .btn { margin-top: 0px; } .navigation { padding: 5px 0; border-top: 1px solid rgba(0,0,0,0.075); border-bottom: 1px solid rgba(0,0,0,0.075); margin-bottom: 10px; } .navigation .nav-pills { margin-bottom: 0; } .hero-unit { background-color: #08C; } .hero-unit > * { color: white; text-shadow: 1px 1px 1px rgba(0,0,0,0.5); } .container { max-width: 960px; } .body .container { background-color: #fff; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; padding: 20px; border: 1px solid rgba(0,0,0,0.15); -moz-box-shadow: 0px 0px 6px rgba(0,0,0,0.05); -webkit-box-shadow: 0px 0px 6px rgba(0,0,0,0.05); box-shadow: 0px 0px 6px rgba(0,0,0,0.05); } .well .page-header { margin: 0px 0px 5px 0px; } h1, h2, h3, h4, h5, h6 { margin: 12px 0; } h1 { font-size: 26px; line-height: 28px; } h2 { font-size: 22px; line-height: 24px; } h3 { font-size: 18px; line-height: 20px; } h4 { font-size: 14px; line-height: 16px; } h5 { font-size: 13px; line-height: 15px; } h6 { font-size: 12px; line-height: 14px; } .module-header { padding-bottom: 17px; margin: 20px 0 18px 0; border-bottom: 1px solid #eeeeee; } .item-title { margin-bottom: 9px; } .item-content { margin: 18px 0; } .item-subtitle { margin-bottom: 9px; } .pull-right.item-image { margin: 0 0 18px 20px; } .pull-left.item-image { margin: 0 20px 18px 0; } .header .nav > li:last-child > .dropdown-menu, .item-actions .dropdown-menu, .item-comment .dropdown-menu { left: initial; right: 0; } .article-index { margin: 0 0 10px 10px; } .list-item-title { margin-bottom: 9px; } .list-item-content { margin: 18px 0; } .list-item-subtitle { margin-bottom: 9px; } .items-more, .content-links { padding: 15px 0; } .breadcrumb { margin: 10px 0; } .img_caption .left { float: left; margin-right: 1em; } .img_caption .right { float: right; margin-left: 1em; } .img_caption .left p { clear: left; text-align: center; } .img_caption .right p { clear: right; text-align: center; } .img_caption { text-align: center !important; } .img_caption.none { margin-left: auto; margin-right: auto; } figure { display: table; } figure.pull-center, img.pull-center { margin-left: auto; margin-right: auto; } figcaption { display: table-caption; caption-side: bottom; } #aside .nav .nav-child { border-left: 2px solid #ddd; padding-left: 5px; } .navigation .nav-child { position: absolute; top: 95%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; background-color: #fff; border: 1px solid #ccc; border: 1px solid rgba(0,0,0,0.2); *border-right-width: 2px; *border-bottom-width: 2px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.2); -moz-box-shadow: 0 5px 10px rgba(0,0,0,0.2); box-shadow: 0 5px 10px rgba(0,0,0,0.2); -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; } .navigation .nav-child.pull-right { right: 0; left: auto; } .navigation .nav-child .divider { *width: 100%; height: 1px; margin: 8px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #fff; } .navigation .nav-child a { display: block; padding: 3px 20px; clear: both; font-size: 13px; font-weight: normal; line-height: 18px; color: #333; white-space: nowrap; } .navigation .nav li { position: relative; } .navigation .nav > li:hover > .nav-child, .navigation .nav > li > a:focus + .nav-child, .navigation .nav li li:hover > .nav-child, .navigation .nav li li > a:focus + .nav-child { display: block; } .navigation .nav > li > .nav-child:before { position: absolute; top: -7px; left: 9px; display: inline-block; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-left: 7px solid transparent; border-bottom-color: rgba(0,0,0,0.2); content: ''; } .navigation .nav > li > .nav-child:after { position: absolute; top: -6px; left: 10px; display: inline-block; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; border-left: 6px solid transparent; content: ''; } .navigation .nav li li .nav-child { top: -8px; left: 100%; } .navigation .nav li li .nav-child:before { position: absolute; top: 9px; left: -7px; display: inline-block; border-top: 7px solid transparent; border-right: 7px solid rgba(0,0,0,0.2); border-bottom: 7px solid transparent; content: ''; } .navigation .nav li li .nav-child:after { position: absolute; top: 10px; left: -6px; display: inline-block; border-top: 6px solid transparent; border-right: 6px solid #ffffff; border-bottom: 6px solid transparent; content: ''; } .navigation .nav-child li > a:hover, .navigation .nav-child li > a:focus, .navigation .nav-child:hover > a { text-decoration: none; color: #fff; background-color: #08c; background-color: #0081c2; background-image: -moz-linear-gradient(top,#08c,#0077b3); background-image: -webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3)); background-image: -webkit-linear-gradient(top,#08c,#0077b3); background-image: -o-linear-gradient(top,#08c,#0077b3); background-image: linear-gradient(to bottom,#08c,#0077b3); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0076b2', GradientType=0); } @media (max-width: 480px) { .item-info > span { display: block; } .blog-item .pull-right.item-image { margin: 0 0 18px 0; } .blog-item .pull-left.item-image { margin: 0 0 18px 0; float: none; } } @media (max-width: 768px) { body { padding-top: 0; } .header { background: transparent; } .header .brand { float: none; display: block; text-align: center; } .header .nav.pull-right, .header-search { float: none; display: block; } .header-search form { margin: 0; } .header-search .search-query { width: 90%; } .header .nav-pills > li > a { border: 1px solid #ddd; border-bottom: 0; margin: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; margin-right: 0; } .header .nav-pills > li:first-child > a { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .header .nav-pills > li:last-child > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; border-bottom: 1px solid #ddd; } .modal.fade { top: -100%; } .nav-tabs { border-bottom: 0; } .nav-tabs > li { float: none; } .nav-tabs > li > a { border: 1px solid #ddd; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; margin-right: 0; } .nav-tabs > li:first-child > a { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .nav-tabs > li:last-child > a, .nav-tabs > .active:last-child > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; border-bottom: 1px solid #ddd; } .nav-tabs > li > a:hover { border-color: #ddd; z-index: 2; } .nav-tabs.nav-dark > li > a { border: 1px solid #333; } .nav-tabs > li:last-child > a, .nav-tabs > .active:last-child > a { border-bottom: 1px solid #333; } .nav-tabs.nav-dark > li > a:hover { border-color: #333; } .nav-pills > li { float: none; } .nav-pills > li > a { margin-right: 0; } .nav-pills > li > a { margin-bottom: 3px; } .nav-pills > li:last-child > a { margin-bottom: 1px; } .form-search > .pull-left, .form-search > .pull-right { float: none; display: block; margin-bottom: 9px; } } @media (max-width: 980px) { .navbar-fixed-top { margin-bottom: 0 !important; } .item-comment .item-image { display: none; } .well { padding: 10px; } } @media (max-width: 979px) { .nav-collapse.in.collapse { overflow: visible; height: 0; z-index: 100; } } @media (min-width: 768px) and (max-width: 979px) { #login-form .input-small { width: 62px; } } dl.tabs { float: left; margin-bottom: -1px; } dl.tabs dt.tabs { float: left; margin-left: 3px; padding: 4px 10px; background-color: #F0F0F0; border-top: 1px solid #CCC; border-left: 1px solid #CCC; border-right: 1px solid #CCC; } dl.tabs dt:hover { background-color: #F9F9F9; } dl.tabs dt.open { background-color: #FFF; border-bottom: 1px solid #FFF; } dl.tabs dt.tabs h3 { margin: 0; font-size: 1.1em; font-weight: normal; } dl.tabs dt.tabs h3 a { color: #0088CC; } dl.tabs dt.tabs h3 a:hover { color: #005580; text-decoration: none; } dl.tabs dt.open h3 a { color: #000; text-decoration: none; } div.current dd.tabs { margin: 0; padding: 10px; clear: both; border: 1px solid #CCC; background-color: #FFF; } #helpsite-refresh { vertical-align: top; } #pop-print { float: right; margin: 10px; } code { white-space: pre-wrap; } #filter-search { vertical-align: top; } .editor { overflow: hidden; position: relative; } .search span.highlight { background-color: #FFFFCC; font-weight: bold; padding: 1px 4px; } body.modal-open { overflow: hidden; -ms-overflow-style: none; } #users-profile-custom label { display: inline; } PK���\)fjM����(templates/protostar/template_preview.pngnu�[����PNG IHDR��)����IDATx^̝��-9R���{�1f ܍���\^�G��M0�1q�y�����?1G��̬�;���T������/e���?�M�����m6jͫ��h������f7 $����4j��=v��_��C_�Ɵ�K�tP����a���n|�C��t�Hz�A^�Xm�����W�Q"�]^�^Z����o���<��&�7u�~I�ԥ���nVs�Nuiu-^��A�2^��B��u�:��|d�D���&=~c�����jᗴ�("������ i��sǞ��1�El �t!0O�v��!.ǒ�|��~����ߑn��z��|���?��[9Sފz�XsB����6�Q]�=�d#Q>�>UƼ�'��}:��N��z��όd��տ�˷~���!�K�.4q���l��O�-7��Ͷ_���$5���1�@�&�ͺ������hF!7��F)�t$��܊�y�s���k_�6;��Ks����������V����f� ��t�����-b��t*q�� �t<�$g�;�Jv��R����$��p�[����a�o�J,��e^��@�j�W1n���p� �1 �%�) �`ӓ��t&�gtwq���4��-�΄Ćux ]�9Z�V�X��>�Kf5�ta�YAa�%Ad<��osm�s��ْ���r5G�+�Q,6���;���腃(��_��S����� G�<Qa��7�}j��ن��=���_�ɛ� �\L���dz�z��T.v�͙:hs$�s�ЅJ��C�4���.D���s��}Ȏ�����f�_G7Ў�4j#O6��.���;Ӿ1��~<����go3�E �w���F;CZ��ڸ)�B�T���Xq_6�O<�\��<�^~�0+�Sh��E��I���%Z���)�,�7�G�8�� �Kv�e�lD���yrQk#UMc��UH��?<,��#��,��}���,^e�k��!`�}�:C����WN������ 䒇e\���*�{�w��*�hl��iv]Ub���!5 _�/F,�|��7�*�,~ܞ���=��N���!�����%z���� �&M��7{̝y� ��x���~_�N������AE�\��ʙ�e������ ������F�Ĵ�lEP@�h��A�Lĸ"Fri%��X�u0�v��zDKx�Iu�:(�f�����t�7��%y���pr�0j�� �M� �i�������k�1��bTT C3�S��~u{Q�83iǦ��(cm<��quԀ�Y�i�o���Qo�������ڎI/I9@q���Dz���N��A1�U�F�k}�rS�C�6� q8f�ڥ�;�Ȁ7��������$��x^4�|v�|�x��S�^R�qw��d��?5p!_G��/@�;=+�=���C����bR�ok��Cբ�R� ˛_IP�v�|E�\�y���L�nP�7��h�V��H8��}c�+�iiʌ!ۆę>���a-W��HBh�=�w!��E��iB�����ZWv7>��li#�e�a�K�:���������U����hm^2Ws��`����j��6�L�R�8 lz�O���ck�7����ɃG`��e�n���պ��Q�S(���S�z��^7�Y&-��q��E#�xB��x��^���� ��ܚ8Tb��s�Ko�ηg�*Hњ��Ɍ�\���UE�j�x�v� A�C�"!���$�i�Y����`f���s�% ې탄J��(/ҍb�19�0o8�hz��\�vX�Z˹)7Az�!�Ji�Hy%���UPr�,�zZ9Yz^�H������iI@�)�eɓ,͚Q;�V]�%��j ;(�x?%�>�{ɛ�D�\B��KWL$��.P�o���|&z�e]�;�ƺR�u�Թ�r���թV/�"I�0#� � !� �K}�=!z�"�F�}��7W���'O ��yP���7����g7�;j�O��o�p�}�Ὡ�/+Ϊ�n��b������q�QՏ����t����z�y�#�{�M���.�`�S1��\�d1*?�^�6�����[�x+E9{�#� �S7C2�o��E�F+�}b�Z cմ6�����7�n�q# �������к����{����wp�Z�$!-�bGi%-b#� ����4�X���3K�*LV��� �P��tz� �Fi|} ���a/;H'��^NwMd�59!���L�3��g ū�W���$���aJ&�j��Yg���m4-�DV�f�&�&ġ������U4���Y �!1=J�=�b�X.�����"�,��l�'m�'�W��Z&?��o�~w��5���y��m��2�{���J/�A9��V,v�5����ԡq'۶��.x�0+��?k�B��/�ju�Ԯ��U�r�/�r����}�n�^�O�D�8��|LD��Z L6odĥ�� �A8�K?��^�m���>5�R���wY�M�Q5+V�:�f�� �T��oj*W�d^�T(�$�[��8R(,�� M��X,݉��9H�`E57���=��z��#��ʗ��6�d����VYc�{��J���V� ���Yr&n����D�-�]Dz��`U�s�n���~n��ϻؾD{\����A�����q��g6BQ����s9t1�AEm�����"єwwe��e��*MJ�8��f��r�궴�҆'�έ�H�v NU���eM%-�:�k��ѭdq��T�� $=���V�� �����_Z��(�˲ms�`}�$�zr�cG�Ap]=K�h��¦��\�̬[ �m����m��ܿ@�:I�Ŋ`�g��6�n�C%\��AXi����j�����B��Ǥ`P�/S�[�3��:FRQk��T��T�-O�}4�R�t',��f�F9��Q�.ng��L�m҈��{��Fx���J_J�x��L�٥��&�$�9���ә]Ay(�1C5�Sי��p�f_k=�Z!$�Ko]��� ���[@����D���f��sEC�t6�.�WQ��f�8�ִ�$S����k���"�CC�VZh�E��(���d`��y��1M�m��ӌ^��,RL�aޓ��m�ͪAR�_�n�x�x�� b�$K%CVE���&5y#Ų�4� R �l�Ѽ�܇��}R^͆i�$��>�G0S��T��+'���)�^���Hˊכ|I�4I7I�a�g^��ۤ�6�L4�qLU.�t�8��V�n��y�V�.���廠�5�9�)$��jE����68VI��Q}�?�s�b�}�X���e[�ֻ��}�j�h,�YR��Nu�#S������酛�l�i���Zx��sNQ�: H�Fnn�|�_�љ*�P&���! �ͦ[E���Z�U��K9�K���eNJq�Ȉ�,� ��|�kp�k�z;n����&J��yӅ?���I5��D�����q-���B�� �Z��dY�!N0��|�cLfTDf��*=��M}�rb?�3/��4��)%��5�x'<�~և �d���ge+(��5?�v7�-2�T�s�1��I�jZ�8�F����n@zY?N�6����� �Zv�xS"����}�N�h�P}N!Pխa���nSږ�,�~i�*��̮U�?�D��GX�]�/>G�Ӌu2)�u�b� ߟ܂JڀX��_h�l�J�`��t�rY�/UX�aRMbы�s���*/�$tQ�y� ��n�S�P;��b'�RY�L�JsJ,��m&��|j�%'��(���T�e�=�饓Y�W�Z��^$�h����'�w1�Z�gj��" rn��O�@e� m�vݸ�A�JR2�uX����ed�t���k�_��G ���Ğ�y����8���k�[ �a����P-�"�"��O�a�3L��|�Fa/�1V��� r��p ���4��J0��n>B˔ك��=�C�ӊ�e��0e�&���{u?�.�8���D�U�vμ�Õ�c��ά���[M��hL���^�=_�4f�P�z�T�T�ƣB\��� ժ�Z��.��"�j�.V5Ә��[�\��#�eH���LVe�� Q�C���D�W�j�{���P�PirQN� � C0�6V�� �Q��hV�է*�'���{��*� MI�k?*記"#,�o�ۑ�H��9�_PȬS'�7̶�=��"�&�@9ko���W���Z�2W�P<�yˌ���0z�_M�FU���Ժj�^���٨����E���mƸ졏�- ���.�K��qI�0 ��+�N�%���a�Ί�-�fM���Vm����v�p(��9�H��ظ#5%��T �\9�O�)8��q�*��A�g@��[����7ǬP��W$�7���J�*t��A��VW��2"�y_���8DjRo>�P��s�}�t!�r�[=�� ���TS�v�WTF�`�D��l�8u*�Whm��� �.�j1��e �Ҥ�Y��6)�}�n{p�/�w���Ѫ��_}�=8 �NSn�Uʾ Ko��r�H'%��ȹ�m]���5��G����u�܍�ü�2)��/@¯����w�.�)�����ҥd���: x���5 ��䂤r���0�4���6ȫ�����K�v����K��6��\� �趍=5�V�n F+�A&ג����O�XJ�� ?�U�".v��� �4TH���T����T��k�l���� T�v�]�̻�_�*-iFe�Y��>� ���D)��H���ذ�l�ӟ�o'd�s�����0���?���\��]�`(�71%-�6tF�qӶ_�VRxkB ������.�����c��,�ʿ�UP�3sW�`��"2�ly�N����'Y;3AOj������J�"՜sGoЉ�~<�Xݙ|l)�E�^�n��xeG���!a��R?�b���]����� �Hu<���ɪ�a��I[Y�N�:/U�(YH�_��zt(u��]���:��}�'����)~�����1�Z�f�J��>����������n�dž%ۂ���-��u����U>,U-^���� ��,�l�Pʃ���f= �sI�_��b()hR��Qo��ֹ�_���+<UeeZo}�%�U_A?cX�Q{�U�?��X$�(�s9�+�<?mL���XX���%ᔹ�:�)H���̸�a�^���Kiz8���W��0��_�,؈�ގB�=w�$�UʥK$K�n� �uF���+t�W�������� MT9�T/������&��������e�lq�ϝ.���/�ʄ���#!ӟ�R����w?��?��?��~��n����nj�?�t}�O$����|Ӛ�~���S�~����۾���矒�N�h��՞@ſ�=�=9g��$�16��P��z��f�_�zu���m`��N�0�W�=4�^}����U�[o~}�K�թw�}� ��Z���t4����h|��c��oW+GU�眙���v��loJmi��Fh�z��D&���1>MLLx�E���>�* $� )�!������Ҵ��K{?gwv��̙������E����ܳg~��sf�k:�z�$I���f��t�{�ʚ��6����i��r]�8��`�~�o�Qu��#W�r�ˣ�z���}皖issS�W���_/�q�y��۾z�l����(�y�?���"���q�܁Ci�!������?��ɍt���?u��^�@{�\�ho�X��K��� �Ի4 ��c��ڌ�Ѱ��=<n7 ϳOt�y Ikmڔ�ƅ1���ɅG����<<�ny��" ."����q���V[��L��-"S����b�Zi]�i��i�g�XF1ɘ�4P���r8�(�xWK����M��({nO��������M��LMcRӠjԅ(-`: ս-;S���u�mk\+++�N����8v�����qK�X8Z��*�I��Lv"���4m���oq^cuCeY��E���z�ǚ/<��?x�S�=���~X*���~�ҳ�~��ҵ�_x�!�Ow�٫�����˓���O�����o&�w��7H�WW�PMtc�ڳ��b���6�'�G��M�X�� �5�q����_�<{�(��5��(x|6ó��S�A�ʰ�aG��r:ʞ~������kϿ� �}�gΝ����k�<[Y�OMg�^��cz*ZZ\���)u�s�sV�`�.�Iy�b����cL��"�i�W�����hJG����d�7 F] K��Pk�Z8I aL�.E2){���=��iE������,C,Ϊ����+[~���߈�������z��-S�Q �t0��`0�a�ln��?wOů�m�6O�v������r��h�j0�����~���Dy���7$�l��wo��ug����5��G�P�������J)j$8C�zQ-���T�"�Z3K.����)x��H�D�=ޫ�� A�����1l{G���{�m9A�� ��ʟ�����7��᧟zbaq���cq���^ D 9��[�t������?p���^»-*, oR�F��s�O5gԚ��a�E���Iuo;�E��E�ã~�c�YG�=��#�3{X��K�3(���]__���N�dqq1�������\]�݇- )�Bu� ��BVT���D����a8�U#P�˶m��k�M� ���ξn,����:���E�l&��q������ԁn�$�f�U#jtw��=3;#Z�� �;�^/�S�5���rYia����e\�5� <�b�(���{���"0>�- �g�g𘌕.5K�g�ˤV4��;�=;S\�.:��~a�����;��F�o=x��?5;;u��gμ~���|���xkǞ��[�յ�H�`�a�N���A�6M��i��=*\|��,��Rʘ�ׇhtQ�aoRӠT�0]���\�d���v�.\XXX0���_��'��9o�r�Ϳ�� "���E�(GP���^RlY���Q,W��o�-�%��i��\�6��R�/��3s�������i_����d�;f��ly)K�y�̮��kW���}ݥ���]ڑ^�9�{>�odj�'D�)��S' 5��G� �5^��م�9�=�6��A]��7)<>eA�q�Y0�"J�D��8>{@BG�?�Þo�Y���=r�Ț�vd-q�O���ǎ6=���ٝ:U���#����?����6���7���`r�S�I�C������>L`�#��;���M}\���f�a��#&Ͳm�D��]' 'Ɍ8��kyyyff���^�|9˲jRچ�X�*�9QR8u|��n��:��#*��H��*\[�ށ�]����̣f3LS���⩠�$I}����b Bv�6����)�J�+*O�aG�A�B�Z��_���Y��u2���ǡOQυ�X��F] 85F�eR� �<��{8){L��k���ݍ1�-'\9y��]��S��7��ͳ��� M���Fq�~�5��s��0��A�R�a���C���r�W�z1/���i�i�̓�DŽ7Q2�^�٫fn4�����Cc��n�4��3�-����OҌ����j0�D���ի/^4�N�3777���G��{q5��Nk�(5!���)���i��"���h����@�ŧ�U(�)���8����@�e��#�RI�ah��Wa�h�*뛣�v��P����s%�,� �k���m��R/�PK��AG�)�8��94�:5{m7��ڑ[�*픶,,E�-���:]�t�/��&�E��~Pk]=���,N�e�T�e��u'�g�o��W�[#3u���jx���Ψ/\R���)^-��ѹ��/ �vŞ,N�=Yv�a�^�c�e y�K�:�/ x9��Y��p->��° �<F�,f\�3 ]��c�)��0�Ȩ�IY����C�8F���=�.�y�g:yN�.���.<���'%��Mݲ4~�{.<1�{p�`��Kj!�p�i�����>%��g���ap���2XA��4@�_��۞��'ħˆ���i(�M#���(�������4��0'���C?[��� Ei�U* $� b��PY���H�s�*-[�E�R�@(s����l�|�[j$��s�L��4�B�{�_�:6���ƒB)R`[ع�PZur����ʪ�I9�5?� �R�JE���C^Z!��n�:�=YFY Y���*�6x����«�R�`x$;eۆ₽axR�aH��aC���k��`n��uN0�P�����T�"��8�^`#+�����~�a�JY��U@�[�'�y�Ӂw+��'-N�� �بp���uR� � 9D#���o���`�_!�r<��pE���8 ��xC��v����h�b7�g���9X� �6�Rk�%Xއp=��r;�D�����`����9��Ƙ0� U����zL�*�Jt;�(�ӰQ�^n�\U���(ٍ�j�k��� \\v�<�q{�'�ރ�L���>�!�Ke�|V7�u���P� d������̩*w���_eT:o�N"�qz�V �b�#y9癞� �Q�3%�a��]Ɔ�V3BS8� \���=X8a�+\��8{TͶ�+mM A{xT���^j<<�=2�a��`����N��YŪ��i��8A헰�mӠ�䓛��Ђ+2�F�# ��p'�ó������e�!\��2���tJd�p��\㷾����&��wRWT�V���vv�Lw���;�ܦa0��NJӴB�/8 �����*���>lB��u���W�EN;��4p�oQ�Z��J�����?m߿{Vr��m���Μ��ǟwz�U9���;�q��_�|f^�����[��G�uk@rʽ5���r�yHs��j���ꕍF�� ����x��Ө3~�Am �Z�C�y�bS}x�,` B!�k_Z}�� �-�h_*���ba�����uF)%h�Q�z�6 ����&�[J�B]3�Ekư�Q%���5*7�lH��a��Y���ȧ�GO[��B!V\�3]��6uA���6��k�����O�v�����B���"f]9y��p�D錖 ���c�������2!�B�E�αWo q��x��[ٗr[���N!�$!���Hjp�G]-RS�P��T&\}� ���%A��$�+�F;�ks�3ʂ�7����?����0�ġ.�SU�1�tq���� ���F�c�3���]1qB��^5͙�.����I�W��(�||k�/�!P�-�?5O�hi�jr�̧�}��m��U�(B���~ݶ|0lH:J��N�PiT�>Q��a�pOJ �2�M3���l�@!M�|���V�7�1�D�4a1��Vw�mT�[9�HCT�T�K ���%�#�V�iL��7��`���dhBy�L��r�����v���Z��Yo���j�+�lo�1����%!��S �vss���|'o�_/���;�Y뱉o⇘�c 3VAC^�ꫣ���+��0˖��B���wHQ�m�[ݓ7'r�Q@@�b�p�t*fE��y�9˝zgB�gV`FP%�9����wgvrw�_۽=ս5a����lMuuuu�8O���UUU��lmmm8���*%�8lڴ)77�{��tZ����M��&h�˄k��l6qqq߾}333�U�@Y64ݥ�dLL a��Y�ꅌ<�vgv.Z�PQZ�7=#�M�6u�����z�Ht6mcmS���%��8��kR�m,X��e˖;v���R����C�(���Ɍ�n��ɿ���!C�t�ܙRN�Cbrd3�%G��#����5d)ڧO�p8�w���&r��o]����={�<x`?5�ܱ= QcvFFF�.]�<ii-. +���ɰ�2ZhVA3i:Q�Bd´��`��V�N$Y�b�ƍ)#fgg�m�v��T��c�V�YQ�-���Nп��A�(�������-wo N~���F����b��kV��ةӠ��۵kרP+�����q'4��.H&o�|�z1�$չ,X�`�b��˗�\�R�$*�v��1==����ڹs�]����j���P�IU&ǘJ��!��,�}ٲ���(rr d��P'.V`���Yg��1&���/��r8ƴ�������c��X�~�/cL�fVV�.]�w�F⣎:J��PQ����ҭ۱�����L��.N�6�� Jʾ&+v7��Ӏ�o� �1%י3g��={v�֍���ׯ�5k��E�v���A,��:k��E��sE}�:E�,�[�lӊתl���5�Ŋ������lٌ�գ �e�1 K-E��%�V��--������2t̘3�;�8��/..}��_|1b�ȣ�I& �Lm]�5��ΘQ�(�23�s&���'�S3���ꝥ�{;d�,H� �=��w��v����`�ʂ�1��P���+���?������+V|��G����C��9y�nA��1FF�*�6hH��31�PpMs���y��G������8���p���wi�f��\a���op���|�K ����h�N�U53fL�[��}�{��O��۶m[�pAyy٩��Z��afD�OH]k�`M� �Vbr��:�Wۚ�"}�_�|�֦;�/r���5�����P���`�e©�!,��,X��%K,XЫW/��K���|��)S�D%�}���Y� jc5�#Da\�q� F<\�b��W&�K2�9��q�Y��-�y/�9�1���4�&�&�$4��R��3�1�2��06uB���AUaOZ$m��?�ݷ��{�T�>ҫW����ο��a�X� �� ��N&�sh���ߟ�f"�B�+OR��-}j;�(Ȟe�'Q4�ܹ�,xKY� :�`��ž�z�͛G}�������&O�4'�����9���\U3��l�"K߂In��I~��(�A�f�����P����t��>#IH�+�f�i��]B�G�J�6�=;� -��to��7�x���`ԨQ�>��_}%IƘ�wb���]�c28����Ec���(�Z���ۿ�t� X$����智�����,�SD 3ҭٯ��"����c��͉lnڍre���QPbX(>X� �C�jre���������㧟~7�����={ �/hC�ɲ�Ju��|�''�� �%`�d,}b �J;�X���S3��<�����1����a P��������A��`}g����~�����Y���K/���㏻\��Ç�C����Th�y�|0� rO28��p�7�$�ț��S�@�"����e��,_��禮����[��/��S7r��{���#K�W~�ٵ9�LNr$I�%�|��Ϗ��^�hI9:İ`� {��;w.�<���������#z���p8%I& 1ʂf0����e�{gh��*M���v��.�X?A�|�u���+07�iN0������y�3a��v&�Ƴ,%�^�*̤gd�\iT�}���(:���d�9������ei)�(Q�k��Q�Zgb8������k`��[�vAZR��!�SP��"�m.[�۞�G��@潊\��ɫ#Z,�͔ %�E�G�u���¢M�w�6�c�|t�c�J+F;��v��cՆm���U��s��A�w�E!';c�]��䡦Â&*%��7�Θ1#??�w�ދ/~��]��]�B�1��R(p��x�evY ����dBշeC��� �^��!���0l�?+������č<VT�����r��������8pժUm۵��|-a@+�B�L���ꋮ�&��u�0�����f����7��QRX�밿 �x�/\�t�>��v����c�^~o8�,|KI�G���>��B�Qďb �r�v�pҝ���ݬ�/?g�*t$�&_p�Cť�Y����k-Z���t(����}��23݃��'���& !�h��~��rp�~�h��?��N���$t�.�/!f.�&0�7�������K �@���,o���2Y�r7�4�\sc�U�tʍЕɒ$i'�WL��;�N���|��)]U,Y�(��``�T��c������ ��3�l�T1a��pW|�3���`!ӕ��9�Q���͓�6w(8��eW}��H�vO?c���$W:�� "|�c��,�+U�?AnB�a��z�p9(+�n��#T���L0F͂�fCٙ6ц���E+7dg���5,h�;t�1N2(���P�u�ݏ?��E��҂XXX(�bmB��/B�e�l&�OG7.��Ϙ�^H�hLb5Z�d��+��2�#,؈U�5J�Lvd`k�ڜ��̧"�$)���ե �r���ȋ/�4b��Ҡ��%KN>���Ʊ�is���b��5*%���̷�Z`��9�7��M�?[� ���9$)�\O��y�zD�y�^Y!孙&�H���.w�*�F�t��O������ñ�nh��vh�����8qj.,X�]�ݞ�}�t�R�K�9̞5�F�v����p��ˉ����9'�q�?O!`�79���R����RLK�p]�'<��Zx��h�?sVQ<Ր�>ϼA�lX�<�|i�^o�ĉ�n7�l�}�6�VS_#dP]���:�ֈ�b����L� ��,��* sGXM~`^)a�6\�}�0Dl�=�IҼ�d_Y�M�wS���g�Z�QF EF�t�a����a��ş|<yÎ"�UAQEe$��WVV��㓤L+��\��;�@gl��d͎���f�������C�{x�f�9�f�Us~.�&�I,��gO�虵��{|d5a�`����̙ԢO�0��.!�8��PE.@FHA`���Yk�$`���$��fM@��!�:e�� ��Էo��ƙ0w"r� 9 6L��Q��� +@�57�/G��֙� B����k7�x��iw?���{���g�|���}>m��(�*���y���}�ڿO��o~���E+Ñ�!I���jƜ����=��7����O�/,ڏtг��ޔ���{��w��y�?BI�~k�S�����k�����K�>���[!&}�ڇ_�Cjn��ےA���_����|��E�p�t���B��~�e��h^���Y��]��\؈ f�5gw�'!>��l�)��Y��G�&H�f��etj&����$!ᵛWœ7o�&�U�I�͟J� ����^����7q:��/�����{��]�HD��6�$a� �)�;����?�Nݤo�^����:��>�{8�f�W��_p��p���yZ8�*��n(�������ڛ�{�jK�� �i�O�ekϼ���ϻ�g_��lmiYUiE�����������(���DŽ��6�ʻ��:�����5���w�ؿ9���}�#RA����x�s#λ�>7g�P(����d��7���Oi8���{���仒�* <s����1���B���t�M;��;{yΒ��K**���S��{��nzp�oK^~w��|{�z,83� ��m�֝�3\�9yٲ�_|>u���/����ٰi���1�1�',nw�,�ɒ �@� Ɍ}� �d�i�ZY���6A�e1�2�����$��Ȍ��̩�A�E#�7�$b}>�S/$ҿ���X�paa�NZf* �[3Ihf{N��/��E��� �\.h�{�����i.Z),x�7�z��9�Irԍ�_���}��6�; ��E�N|ɦ(����sr����Os��N�l��[������s_x���<�[��HǮ����i���>>��?x��.8�vn�Ytɸ�7m�v����a�{ ��TP1w���}��q�?>�����&�fe�ع��QCf|�BϮ����}��S?x���j|�{�j����� [o{�nz`�篞~�p�j��1�껞R=x��W�z�^L�/)�����O���e�?�t�s�2�!����!�qT��>�� g=jPeU徝��{놭�4��j��-[���0����O����%!� �H ����4���Pٴ�-�� e����|�<vƸ\P���[��u[�^9���]�e#�4�S��r��ު�]{�.�koQM�bv1h �?v͆D� u0�U0'��f��L�o6,�t�UG��iC�"�a�֏��? _�T���|k��{U%r�������i���v��Hs�7n+��������r�}���u��Iy9Y�|�ʸ���|~�mo���G/>2bp_�}5�؞�8aΗ��������_�m6*�v���מ��k����^{ј=[ '�?�����W�>ݿ��dfF��C;��Kʩ4��G_����nVٗ�M^�MW���^�Ҿ���C�U�`!�m�LY�z�)�����+�Q'��սK����ddfddff�]���,������R����DWײ� �� '�1DϿą'��2�\�)�9��cS�' uڠn8�H�A4�71�%�ׁ�6hv3I�rrrh��z4�%��k^Q��4(Π[��������VT8[�4g���~�cvM�'�[�/�7ӽ��t�[�2��~j����O��9$(���6?L��鍚�鷳$�ܽs{n/�Ç��{��~��p$�h�����W]�@����9K?���k.y��n�q���4��=������ܱ�����Щ���)+,z���8q8J���:>��[.��t(a��Γ�<��ҽ.'C�k�1 ��z�v�mÆ��״��I���H���$���b��WoϾ|�V��QxcƦ$�Hv0l���9���i��l4/0t�x�gc=3߫$�˦�Uڀ�-[�ҧ�����kkk�e��'��T& ,���� @oc�&ݲ J���ܰjO�+��h�7�BP��ߢ'~�Z(*]�Ƃ��w��l�G_�\y�P] n�RVR��PS�1F�`hӶBg~�>�PR�8�/%��廋KP8<z�P�4�����m�Zgm� ˲$ɈCT��^��=#�E):P�lb�b����r��Â��9�H�D���UA;���ub9čD2Q6�s,�im�K�lfa�<���X�L|x>H�kb<O�� ���m�L��%�D�0� ����*E�d����6{uu�u�x<6Q�L�@�`��1s/���6�{xs���(b�:c���>�-��i��/��g�V��r�q���5 !�P᯾��?�ۗ��9�����ǟʺ�|��Affx�ry�~�h�A$�T�K�=�`��DIA��H�\N��nCJʫPRP���Z�]p�t"�˓�]N;�_�պ]���J�D���: �Â�T(f�:(�|>j�4���Rm($��\v$��+�5X��X�1Ug�8��9S3.^f7s:�K���d ��Ӊ�5m���uű���Қr.�Vb+*�Z%�b ()-u��t����J d��6P/l*b�;O�=�*���?�iK ;JkA�ܫC��#ێ�u���I%xیU��rgf��������흟�o�a�2�_*�ݤ���t��>�O1H�����()>��'�կ簁�\�_M��zN�Ġ�P�Wo9�_�m"Q ����أ"Q��Y()��z���(hB��^]�y�ѣ��ÂA�q����$��WT�l��(I�|���f䊤F:&[�r"[!�i�����FY�b�]hd�����r-G�\�˹�:6�i$e�c��#)�^t��~)��.������lvEQB���>3��R��B��M���뛴�F��ԗ�(�ӓ�q�V�j�Z�Kwh�{���W�i/z��c>��p��22�>ؓ����ҷ�K|>�(@E��A)�;O���V&hW�K���~��ďxQsW��3�}��7��3��1'��Ͻ�U�k6]x�C�v�E������7At:5�ʊ�Z~��c�\xᙿ|=s�C/T{} �nι����l��۰{��;N��ԭ�ި-�6m������*E�F��1��5XJ�5�Z�Ӌ��(�17Y�6��{��I�� ����M��M�-�����L����M��^}/1�SS$x�!�lՀA+��1�/�D�|K�S*c�!P����q?��"%���'������-,-,�~�^�C���@M`�g˞8wPT"�e��a+e_ �ѡ�7�'~�tѥ�5�zD�"�<�B�=w9�f���.~��z��9|p߾=:�v*���d�+oަm��ަy#�΄�����{��)��^<���y9���JZ�`���Rx�%g���MBO�{#!䙗���X�t��Q�ڵ5�-;�Pv�3sA��]>|�ѓ�BI�j�i�%YF�����MWK7M�]7��_���<�����?�^|�g�4r0uײ���j�H�i��Z�~�ྡH4�hw<�"�?v�_:#͍Z,�7��WP��c�Ʌ:>��z݀�yAx�(a�:%���&� !�l:��ɽ�����]�T���ӄY���)?�>�ˡ�g�6�*�,%�?0�>}5�3R���Q��Q`4Z���`z�� %+�k�Q$�Ę_Iɾ�l-9���aB2�vB��e��|�̍Ee�ܜ���~b�"�Z$��qk߸�3���+�2�y�(=�4�J来ߛB�PD�c\���y��7��� ��ީ�o_����?����w�Ԇ(@4*�����|鱻.=�d�����Nz�������gk�)M ���y���|�y�Yj!.T���E!�$�tv�ΰ��K�I��h;��l���#Ѫ�Mz���y{�M���{S����%�)������gN=n�iW�-��K���ٛCǠCX1yq����\�:й[�L�T���8�_I0� 3��s��Wp4�� �� ��6mcI>���~��U���yMe�J����I,lX���fr8��t���_�.}��� �J�`�"��S���2��Tt�E���@���5�PfN�gwu��W��+��"��c7��)�ޗ_u{����y�(����R��*��֑ ���MjA�������C�up&��!�{������[|����V�j�3��uj�c@:�N��O_� ]!l��]|��z�I�������vq��7� �y�H��xk�j����:�C�<�^���/���ן^�4�*;+�:,XЙ��0��e5�IE�l����SSE��b�G�d�����k d���9�6� 0�����H�k�u�9Ɩa��4o���8$*�Ḑ��(���y�7N��O��q6�?[`��*F}<Q�b�P�Jd��C��2��H� �ڤ|uI���e��eS���䠄 ">�W�kW��1��l�ޔ��YA�\.�0�vK{��`�6��7ݨ���[� �ۃu�*kHcy�D&�H�$9�n(2���n�7�X::whK��G �,XЊBx�tC�sB >��$b�x`�f������`�"Kc��t�<3�щ��?].��B�a�B#�2�Y����ќ^mXuf�T��Ġ��4��-<a I5���6oD��p'̩A���,� RVE�6(��ܩ�$�+��ڂ�v��n��I�R27���C��)� �l����"�rf�6��v�>�_=���|��KBs�J{��ܼ��e�Ͼ�9����CBN68���� N�b�2���J��XF@��@I���`���J�XD,��D���Ig�����C��QMU�$E5���b0U֧%��t ����i�TЌ�����F^�8 x�k&�K�D��(���7ḍq=Ĵ�D��O��|�{D�%���b�.�ܧ�~�"�P�[�|�8f{���-�0����9���lb4��r�x鰮��gf�/<_k;O9)4w�\T$�c��@����`�g�e0��2JF��e�� 0�-O� �,���N��(��:r�!��#���V��EV��V��/!2��� A;`�������E4(t �B��j���A��c=������M�xhE2�K���%�aL�nYA'`E��Ld]����ma]sOh�p j�����}�x�vwuV�}�QJ��K�u��S_����2пC�S� �ٗ�ؾ]��Ϫ_x1�i�خm���\g���X�`t$ ve�I�bq�1�J.`�ƾ|-`$KQцvJX���q���.IQf���2,C�H���N��fDQ�|��N��P$�|/SVk=�P��H����KKC!?%��(��T�Ȓ4��Aq�m@�(��k����-��A�'�j�~a@�k���`�]oM�Fo�ZO�� �������y�;�-*)67Az��;���I4 6��`���V�n�41'�7M*��1���0��]8�3�=S Qw~G��/�"1��W� �r9=n����l�-���h�W��PC1>��LwK2�'E"Q:��Q��B ��N7��I���|�ty�x��&�2�NHg�ALng���5�L��cZq�\�Z"MJ���n��8ʀ�cߦ�a_,��4O����s�g��8�iC2�'�~I*�R���d�W�mR�`���B8�TЄ(�͎1��QI�=J�Ֆ` ZP X����u>�"Z�_4�HO�X$��ҝF�� W���ɸZ��'S���$`N-ͅ6%��c�75�@����`�cZev!^�a�Y��Ͼ,X�8� v������t$��F���v_0G�B��X0�Zm�P��4�#De��(���c.�6S���.��1�iU=5��*E!�B!�Ɛ ��6Q��Ѩ���]QY�F�x�� � ��@��� ��WJ��a���qE�^-�>�J�����-��6(�ڲŤIKt�֜��b��x��*���LX�`A�A�Uq|>_vv6���[F�P�9DSԌ�h����&��āQD%%�Nl�a�A���)��%q�y�_�+�}��8�NQE��:�����Ñ�Ҳ*Y%�[a�<�@���e�'V�J2����1��) x�d����"��5&�x�A c#�( �� ���DŽu��dE�1"��� Z �#�����@�e�����X� �� F��zͼ���ʃ�3 �JT-+$ kr*A�J��~�Pd箽kńL�[�d=f.�0�� ʊ��p�\Ba 76��Bc��*�wL�d.�f�Z���N� ͆�QB$@���`�S6��V:#���c,rŔ����P�C�Q����U_��r�#,X���]�v�@�R2��ǐ$��>-�9%k��¬�RD�r$�kb������H�Y1uJ�D�ct���&�dmQ����*W��-��� �)��cD�����t*ׇ�-��e�ͺ�f!QDdC!G X�@��T'Q����1綨��_�E7^����O�,X��ohU�=�����q���z!6�>�ϒR�S����T�lF�b�g�gfK��C�ͼ�����V(�@_�����|����~J��I�mƼB�!������{��#A�� �/���qS�:Q�;1߇�b��M�E[����RI&�QS��Q'�ʺuH>��,� sQ`�R�,����[m0@�XX� ?�����G��ļj���l�a|u"�C��]&��\ϧ��-�U�l��{��6���N�X�;�4����6; Y�% fC��A�&��"��}���У�701��`J� ������_n��"H���|}�C���E,X�8 i��c*hƑ��M�E��������tdy�1n|fD�=�� dcY�?�*b��Y�� Q�e� �6��x�r��$+����I�F���6�1��nh�����|Hߩ �Y>,@;.��Lݥ��+{r�sA�`�m0��E;PrX�}���}3�q��5�?��-X�jkL�#�HZZZ�:��D��)b=�(�2����ɨ@���&��'7�dJm�X�� �L&J死l������i���0��m�4pXV��fV�×�����A8�e�t��W�Pߔ@!z,w3�s������I����H�� �~<rL�"��;��Xo Aa5>.,#�4�zHĀ�0X�`I���MY9&f�v����zD���16e�30�[C��w�S����\�/cL�f��v��/<k�`mdzC[�d�=�ô��Oa>�p�zG����g�鱓�m�?���"��`,��7{5� L��N���@�}0�����uOC��YC�ET�m$)((QJ�{UH�[%�/���^[����*�[K�"d�����q��v��j"���n_����@�Ge5Ѱ���'.<PRPR�-��]e�6�N^���E��=U�HDAM�2�+��~���Q�?X ����Q�cg�?$#��{�Hdž}ސ~�#a�<)�h�"�|�/��|遍e���E����Ofk����SV�{%t�`Ub�ò,� �5A�Y��q0LmfLe�&4�l��m^-�;�0�>����1�&ɚݱo�4X��R$EQd�R���k �]��)̦��M���� ��c�p�U�6�)Q��)��ЍO'�Q�`AQ�=�q}3�tq����:/�N'w�L�G��#c���v�!�u�L�$W.��Z���Q��o7TV"OL�Uamq���BR�`K٭3�i�ٻ?�Z]Xꟶ�&�W�tCem���F�_m��x�>���ic���7Wm�W�ջ��n�JŪ��U��x�.v���UE�Y��PD���jVa�/۫�U�+����-�XY��zyYhoI�̝���撽���&Gg���)����^i��Ue!"I?l��T���d�y{;��l-�YRZ��|ܴ�ސ<{Ke�NV;�k�Y��Z�"S֕NZ]��<�����E���Vn��TEe�0uC���P����"?l��]~g���~/�7����%;k���[[r���`�e�����}��7zU�wC��;���UE*}�"odEa��"0,�u���e[��Hie�ӵ��Qaeq�fod�>Z�bƶJ!�UYZ���%� ��h��-�v�л={k��Z����rm�(ڊ 6f��m�#� ��x��B��� y�Ϸ<���imtK2��d�w��[�e�F0���>ݴ�M�5��ï�-���S7$�m|OL��l�R�-�F����M8��֧����A��!�� ���ʷ�=���ήˇ�����tJ{�v�uɘtj�7O��Ա�s|> 'g�����UR�,qeY�&��5//9��o���6��n6��no@���l��V|o}e������pٱ��R��*���}Vq`��7V�o,�}��b랚ɛjPR�ꖝ�H;#�W:,�]��ʺ5|��f����E�Y�J_Xz��6��ڒ��PS�u��������� ��@���Ɗp��_���e�.�Ĭ�/ו-*�EɁ��zem8���v����~)φ>^^����ggרּ:���g�����e%I 0kGٯ��SV�,�W����"_�5%���*]V�v�ɫ�V��_XR��ona�Kˊ��Hy ������Ң�f�4�i"�G�U������_V�������Xy��5?�+]��7m]ݍ�D��-9H��{�'�(}q��6S�[�#^��Q��vռ��+��7VEl(��]�n�|yN���~��rEQ��1�gS��ģ�7�W�v>�0�� IN�$���t�_��K��.�{��K���K�hlEQt�o m#�?���sm������b�o�'t�f�W����6��4 㥳64��-��Ձ��_R�ɳl{�Z2 ������Wv�uuu�E�6!y�G*]�o�q\[�[K�+^�fèL�>�Jpf/ϋ���t˩� ��yNqoE�M�{Lό���#��G�V����yҝ�t�*��(H;�����"��d^�=��"�<E��g���g.��q�;�B'��>�k�9��ۊȏ�>�Y6R��U�+�g��(�]:�on��d�����S��i�O��9��s���z���JT*�+��ٵ��m�=�\��{�Ѭw�S��*j7UD��qo�S9w_�/}��Er0B��;�����ٶ�LQ�-Ǵ� +[��s<���}r�N�еm��t�Z%B��>biH>�_����������6�qt;O�CI ���7�S�����S�j��+;)A8�o�+k��5�� ��s��gU:��.��,�RB6I�Z:�K����`n���]r<=�����ɰx��R��;F,�a|b��wG�fu/��ߔI�/m�i�aR� ,��S�rL��Z1�ԝ�X�Mef��2!̓�l=eTɖC�W���k���(�E�{t��K�>k �m�Q.a����U�1����PD9s��6���pt�voEP���z�������g�`���v_D~fY��f;1��ƪ�K��y毨(��N閛as�PD�*DZ�+��#����H����}ڧUV�z�L���Ң�ޏ�����i�m�l}E�<W/�~�-��_������������m�C�cE;J��m�>Y_is��?�˾�P�����N;����ו�oEɉ3O��W6�*cz��R�gʖ�4���S�t�vFC�f����9Ѕ���Jz�.vʹ}���s��өn���?�k��}�v�ҩ4�3��|l��:���V�E�2<7�}R���ۖ�Γ��-+��AIqп[f�m�l��xzy�=�~�ӳ�Sz���֭�s_m��W���v��r�d��YZR�x�?G�g �x)����=s��-v˰G����ٝ��n({sY�I�3O��H��= �i]���]2������$���Kڻ���O�J6���>���n�6;�H~I��>5V%`&�A�M�y�USR+�DIE����g"$\)�Xy"P7�u���"lb^&fg��yp�X��Y�nyM1���-6�~�lA�,�س;�y0q\��'(����3��S�p�81~:kc���>g&��!E!�/4��g��:�� R� B�oώ�~��y�������-==q�`uٍ��D�T�90�(H1h`lI �dݍcdӿFA�a�� �pIY����"��(S��mrm�Z �W���N1�2s[ũ��l�Q�W�qMEV��ҡy"j>,D"�h4JywժU������1b� W\qAB~A;Y����Y >� E������W�XgVJX 0�`69�V��d�_�c z���,�I?)��AR���YLD�GN��Î7^�L_M�SO=}�EΞ=�w�>�Mxmۮ���0��74�4aS�@��%�����}����-H�ÌI�kDT�m��0�+J�VR3�=��<.�,���O�Z'��E�a���C�F�L���ݨ�`I���۷o�E����*�A�B6�zS� }o%)�*�E��]��/�I=�|�2T10 �~�¸TY``N�&�~�U�c�IjO)��w�&�Or�ܤ����:��}�. �k��*hE� ۥ0K���%���{�=⏶$8��Y=,X��l�.�K+�@(Ԓ3$�b�项,��P;��2 t�2���9�9q� +f/��Y/A�D O�;Oŏ�G��mƆ�,�a��$Q�j֝�5�ՀM��B![dc����i2B�xă������[Y�I�ri0�9�W� ���,c���ckj�LL`2 s2'$�<��S���c\"/���x��h)����h���$� w__����afe61��&�+��Ӯ,9�I���pa}ǰFN]�9�� (�pH�m��ntCG&,X���h�T�i�h&���*EH���J^X&@��� ��Μ�x����* �����ۼE��m:-#b�b��g'1�er60A_�%�ޛ�̸�ˎ�l�A�ڄ��;�\��q,O�`�"��$1�Y�R� ��j)�O ,X^�cQ��**���������X�y2OK�<u���;7:���2�L��M+��2�]\Ne}��d� GHѨ$ˈ��U��Fr'NZ|���4��Pb�Rh��!a($���#� ��FJ2�E�İ�yG�Qd���#6�A�e��� ��%�E���ڭ{$1�*ge�H��}�۫�>�)�A#l&}r�Y}F0�0sf���Bk�_� �P(�ڲR�@z��,K���.�(��������$x��K�;@���&�^���r�&��*�6��3�[������k'����`�"`��V�_�$C"S)�h4RЦø�ow�u͊�nqaW% %�]o�j|"2��j] ��g�Օ+���gG}�����ڃ�N���k�k�����V��߰q��E.�Ӥ��р�a���� �n�lT¢��m���G��A2���l��Y�(�6� cSl��>xkj���_;{�O���ѣss�D�=�P�zN*C���ҕ+r��;w�:3����vڶ����AAl694����r�n�,���� )���͟�������O?xА!������`�������>��Nz��7B����!Æ��ޛ��v:��?�����U�f���w�QX�sʷ?��� Z��v��˯sv}csa��J�"��Ɵw�홒�)�S�X�\/��$e��-����|!^X�`��AG��`�vO��rI�(�9�JNn�k��iǝ4z��{���x�n�\Ц��谢��FS^^�c���N<ioў���!C�ede�0ٴ+xǷg���\�,W��?_�_�ՁW��>�0+s!�b��_���eK��{v?��3��y��cF�]����OY0o�g�yꩧ.\�xWa��f[�p���GSn.ܹ��>��_{�%�f۶yӪ�+6mX��B�Ȋ�X�k�\���T����v,�-^��c��-5�N��G���U_��)���.�c"��ǩ���%���,X��s*ISfI��?P�g����C�Nު�9���}��/�֣׆5����O?|��O��|7lX�b�(��+++:�kw�������6���]g���\Y�8=����� ��-� K2��A�<��[�{��M��}=���Ǥ�]��g�9�������7�TVV"E��.��_�$I�G~( =�ȣ_M�ꨡC��lr�N��uAA�Ä��hw���+UALDFkI��-^���S��Vd�� �A@e � �߭��gCbM"�#��k=��^XG,,X�`Qimm�VW5�o���R#�\iۜ��A�`��t����;�Π�_Vr ��MEe����ߥg����O��{��(/���O>Y&����s��Uq)����(Ƚ�ig���Lϴ�����V�P�@�x���+:�>��g�;�ͷ��ݝ^�v��e��a/>���zԱ����j�Y������7�|��gf���˽{�����\tQqqq09|�&+��93�ɘ?7*�������<�P$bB.�)Y{��2¢J�2�y\,�0/hsaEhP���NhW�:aY�`����p8P�<~U�R8c� B% ���z�OӧѮ�\x�������'-͓�A����TUu�ؑ�[A^���=bp0��>_,�bI(<nd��3�O�T��eAjUYv:�'�tb���WU~̨QS>�|�5���g�uͷo�z�=�R��^������(/��O?�C�5�~(<l�)��]�GCac��OU$�}n��#��@�Y?��mG��.E"R4�I�S5�=*��U��amZ�,��8� ���F�`E3�={K�d�, �n�c��D��P�jܘ��E�h�ߗۮ����F�#ڴ��=^��e*�vι�5�cO:%�t�� cG��={�\2θiw����9&߅��J��(De�Z)���w��WT��cTxWd���柏>V�5lD�G���6"( �xk�~��j��Kr�=�R�ig���p�I'WTV�8C��R?�s������!o0�T�l���Vp| @�'mP�� �@��:��q$����c��,�RmX�J��Z�;����,h�ua�t�^��4��)b�,X��X����;�Q���b�F���*��^��:���c\U]~u5��1����WaP�T�S9D�Ё�ƥ�e�5b��eD[^l�2���V���*�R_%T�|j�:�"$��x��(ԥXBx��?s��ƈnD1�1b�W�� ��4 �ʋ|T�b:2),L^��х�ott���H��Y{��y�qi���v�K{z�!����C˗�f.�ɪ�t��"��T�Ղ詮��M� �[��3�Q&D�X��4'����=�Scq�+�Â?,�����(�+�m��#|^�܁yu| �'�.�&czf��ك�����LgaY`�O�d`����N��]3�땁�]b�#B6���*�E��=����r��A% �V��Z�]K_�5����(�m������D3~�J4FuML��Y���Ǩ�NQb����仡��,�.)�����ry|�7<5C9�ݍ�˥,'L�u������_wo�Rr=By�����tp�_���w@4{r��%�!�/���u�{lȁ��t`��e6��R�����ٲ,���ͫQ�!Y���^��f���������)�zO�-���)�B.���+ɘ��k�pY����t�'X�?��CRS@SW�֢i�-����y�r{[2Oh��w�t��� ���aǞt�q}^�W�Ғ��n0��zwǚ����!Y!t�Y���_W�����D��.jmX�`�� �\�P(��������Z�I��4���h$����Q�h�kHQ������Ld�+ǔ�%�,� �xlGW.8zf�jj#ea�xtGwF�cd;��]�`T��=?�M�=����~\��l��0t�����^�ٶjA��"�d��O�����˲�$=B��VUH�v�1E�!�����U��k�AW��$�9�F؆�`�q�����Yz���6��f������3]=2l(*}�ͻ��7s�� ˙f�2Iw��hX!��`��e�-� f�^W|pL������e:�-�.��l����;]N�McUPat���Cmڴq����'�-�8���� f�11 m���|l#DB��<B��ɟ-8D@ �I�ґm'm���� ��C~�#�se��G����W�����h�!_@r�d:F��((�$����k�pP� �'tKO��jk�K�۰`��q��z�Σ�6(5,X��;�w*�=�8IFv���E�M�*�`��u#N9Kt'g���H�o�/ F�de�%z�,S$`DɒY�1�b��6���Ԗ�����u��q`!���N�W�l"Fȕ�{����⪾�n�?(׆����G��^y��+z�!$|rY�I��A�2��7���������&B������]������~���^?0��~u��z��&Âc\�~��mE��������/������OL(���AM��_g8�C�,���>�A�/3<{�kS�"� ��z���h*lݯ ŷ Ŵ+,�,��&"��ة����\���"#�>�|J�,��-��-_c;���yz�l�qTnj�:jM��s�'j.,X���xr��i�O��g8.�jҫoF Bz�ފ��g��G:==]WO��OD���)A�ႄMĩ�(�,@H��"j��,��S��f+�ڍu��йM��}]n�y}�@�3,X� �����;�أ��%J��M�N��I�-���/�.������tb� +\� ��I���hG�Ȑ�ҝ����Qֿ�M�}:���9-4���BEL�%d�������rX:�a���$��S���������f���{Bo��g���1'��K�I#�Z:h.�Se�Tԥh���!?u�L��;�L�F�3�;�6X1�A/,MD3�� t h$���ʟ�k���px�ٗs�eZ��;�m+���3�\�nݺ 9rǺ���8�|KH2� �P�'�OX J�q�݂ $� a��j;���nP$�q*� �f~&zfo����$i# ��H `nsjhu���" r)Po�=��,9)�҆����^�@n��k�/-�̤��G�S�)$/?��@-��P���D`���7�$��/pc �E��쵢�'I���ED$��?}A$,XU�����@A�I������&*���=HH�iE�� X����Sj����U�D!rQ`�`�55M��z�H@�F��������^WL�&`6!�e�Ⱥ :5,�ݿ|�F�n�o7���m�z04��R���#�Ο|�$�<�rN~?s�S�ǯ6)�CMB�;@;�}'����M�2�p�l/ĝ��k6�t���t4��!�1�Z�L�,ՁN����y�f�J�P`��L�j����*�����`��%Wg_���p�G� J�{�g�G�_�"��o���f�<�q�#��a��PlB\�Mp�16�16��5@�E]r�>e�{B8Q �zp�9 %�?8�Q*�7������+�s6��a�4�p��-0u� �&�f�۩NG� !��Q�S�Ϡ7S35?ߓă �L�:i�y�}��(�<k�T#���?p��+�c���a��pX �q?����'Ck�6�1�6�6� u��MU�D5�6ΥS,�f��ک`�a�!��22����|& 8 �����f��� r}'@2!\wKA���$X��&0�K���G� Xa��M�lB���� ��p����h�G�$�"���J�I�$"�|o�T�PH<��8"��y����$y�^=�$��"S;��,��.c�l�/�&���t�:A�]0�8�nSE~b�+�q(cz�E���u#��)O�J�6L��a�Γ�0�`&ɤtȯ��F�I�:E�{|�<�fG� n��McĞ`��( �66��XVa�UZqS��N���FL}� К�o2e_HKKcr�V�����B.��5)�X=�#���J��T��@�$�H0۱���rh�&bv¢�2K��1;)���6�=�,4��DP<��p��\�M.'*�����3f)��lL*$�x��V�|���F��۞� '�?��+Փ||ɿ�~�R�7@�?�U�[F+D����r�DQ���`�A��D�梍�Mc���� �3�Jи2E�|bz�FZ%���&^�=�����y��j"xn����۟-�c�mҭ�V��q7����O<%��Ó�����ϟ��ww��1@��1�CR4;͑��3�&w�A8�3� �r��F���i��a$�w]��X"�A9�{TJ7�N��)O�B)��l��֟�ܞ�:}��o���SN�ի���]�K�@Z��B��?��ŀ�0$3�j6�ܥ����d�S���8��N�f�<��2X���Hw�l�� �-�Z^npr��2Q���ѣ�l�r��F"��7G5�cv�H�%-9�������=��E�w����~�$k�m��^����m�0�4Ǖ1]F7���ƾ�.��T5旈|�F�q� ��6Mgn[���3����\ǵY��/�1�_��Dô4��DGJ��li�ȯ��3?���c.)� ���9����<;6X{k�q*�*�Ƃ�j��Mv_l� [��[#Is�ml�v�w:�aQ�aXݚQ�o�NC~%IZ�x�i��F{"��F���H,�Ř[8��wٰ�tpiT�\:��d���2�~"�ط�Ha<�&�,Xcb`�Op�D}�Tw��/���hv�69m ��������O����B7;�5���,��V�!G�}�Q0�� %)��kٴ��1�F���֭[���駟.\���t �a�J.#e31{��6p�m�Nѓ��e�'_�y��5/,�=-*���`5Y7����x�����Ґ�n"�a�LDd�E�%�^�B����o���(�"����U�db-W!X�'����$Pj�_`���bY�9��sP�H'mN$M<C*�n�)�j�Q�^��e�Fz� |��͖E�|��phw/�`-5?QH�G�$���Vb��6��X�_�B��A�O~�WU�2�aT��>ѿ�D��q�����u�ʏ��ٹ}���_�&/���$IRf~F�?��x�)�+��OƍK:x��2ځ�Cľ�q(&?�At�;�@U[�a�&�#���%P�/%]���5JN��*:��_��Q%��Q@X!�D�F�ME?�C��Q�%��+�z�#���6��j�����0ê���}��¢������ϻ�@(�m�>��&¾�-`]���F2� Q�"'��'��ay�DD~4k2cs�,s�@)aY|IL���%�]���2Z2w���:k4��kJ��Y�2�H� M�*f=- �m��5�Ji0�`��`n�ԝ >�XE#�������2���[Ny�q\�nB�hy3��'�B���` �:Ն��-����ڐ�i��p � �S{_aÎU��s�v��E^W��TSL��BFD��v0j<3%����{_��ы�:Nز��w�����wn��������,Kʈ�}����n�ܡmk<&v/����������q.m��X�S�� ��?^�������BN,h�����$ oҀ��v��c��)�yy?���L���z��0$�P0ʈFF���� s_m.0 ��ػ}��/.|�%���o����h�=ɹ�p^wD!>L]��"���;c��J���vt��n�3<�(4#�/��P$2|p��=:;�&N�R�&m�=��&G`t�c������q��p�j�&ʌy*����M��B5��T4~1)���p(�Y�0C���+>_U+z�YM�.��n�˲��#ш���0�B��Y�|�*�)N;�ι��&����6�vO��5�eM|A���"ם<䵄�4���W�}���ALY���Bt�7�"BL)�����,2m�"`��A�x�Tl$e��.��?e��<���&?�w�Ji�md I��'�Z��'Jl�~��l��Gpr�*����6�B8�2��3뚋;5'�30�K:�Эy�e�L�Wd�M�ܡc�Q���6Y��H3vN��aڽ*�J����Aމ�E����{K<0OA����W�ۺr���崝��ܿ�1C�ee�!��\�r�]{Ñ��n�խ��!}{t��2g��쌴]��^�j��}QI�ѹ�)�iW��T,X�n�m5�ڂ���yT?���ek���`i%����ܷ�q��]�_�:PZq��a�IjB`�d���Ʊ�ʻ��*TNT�nfu/6���@���%i͛�霭�7�'�z4I�:�PW3���ܓ�7���:pv��2SX�%��Q�f�;�����e'�j�u�/`����!n���s�"��S`,�Y��V�1�u��"8�~;�����C��)}�o K���IK��^}��w�l��P��y*j:��6��}�g������爂PQ�{���m6�K��R�C*�o-�0����KKsunW��v�B���ke�w�C���!�{ʲ���ݽ�@nv��nл �ì�>��?o���#>�wԧkNv��U�=�Ӂ}�O|��]; 3ޟ2c��Pw�.۶�˦: z�Wޛ�q��vӥ�[�z��r�cth_�S0hm���bu����2gQ�3vނ�����O��� �M)Ē�������"����A�VV���|�$�S��P8�JRT��Y��xxX��.r�Ե�ۉgf�{��e^��]�<m���m��������-W��l�����M M|���x������36�� �X4-�g_�hъ�S�|������ই33�_~��1'��R2R�Ϝ����w����?�����]��?p�U��^@ͱ� ;��Y�����H���ϟ�j�6y���e��{&\y��K�}�R��0��=��s/x�����R�7f�-�_���i�=��(`*|Z�@�d��H�����5���+I��:AD1c ��W�၀��\-$� ��cG�� ;<�泩�*�M�<xKv����'�T��-�*��� UUU�h��t�cL���EQD�^6b�D��K!�κ��5�~斜?�Npۍ�����1g����o<[��7��NdM�M@M���Z�y�/x����=Ȍ��<y� �zv���_���{o�l��/��˙��˪&�!#�sٹ��0b�)��}�#/���K�h��G��ː�(^�ٿ��<��ٯ<q�ƾ���愿�t�]T��Dm�˹|��^�|�u���?.�}�gS��;��CF��O���eE��7�*� �mZ�A ";X�ؼq�Rc�����؈�b���e��zI���X�3���9=14;Y4�:��v&�t��Iw���IDEc��q�@t�O9q?�D Pف�i0_����,v�1Т�X�,S��:Oz �#���w��)���tWFV�������.�����;_6f�}�����r���c��K�\�����;f���@8�yC�=weO������{��{n�%��JU���_N���w���]��w�p��O��j�v��^'�r�Hw�egx\.dF^NVfz��e�ٴC�������k.@ p���?���/8�� �lN�)�D�� �D�uw���+h���2Q�,>X��$�ԕ� �8X���HQ_���us�� �8<�$n�/ ��ou� ��d��`�̔h���������{�A@*( �\�;�(Vy�uk���/�URQ5c��5�W�����ub��mo��}����Y_��WrMMת�^�QZZp���y��4e ���v:����r����Ə1���D�Q��E�`�����M�i7�e�!�Rǻ1[z ��^U˝}zv�F� �#�@�Қ��\N��YO��D�>�W�����A@R�db�v%���RQ9Xf�<�a�v�9��{Zi���͏`>�x��t��P`Kq�WJ���U�V 0`�ر��eeezz:.++-+ufe9)y6�`i9�-�"A���#�Ƒ/"ʼ]��u�sӳgm��r���<n`V��n ����Px�r�g�T�˕�v�PЩ]�K�|�d�Ɯ��S�h�`5�o7Q�.YCeb�?��ꐻth�J-����UUT�ܰ�G�����Z��zykv����g��ӏ�X�P,)�UWۺ.]�B�H&��Q�MCb6��7a!�,�(�� �-O�}�pX�qe��'Vl����1�l�-��m}n��xn�5�>�!(�|W38��G���ಲ��s�|� 6�^���_~��_�GB��Ǔ�*�ֽIQ�!?��}�K]�O��u֦*�����=rb?E22�������7`�~T��ս��OM�Ю���@f��W�p�s�U�:�f����'�;u`�n�_{!��5d�_}8��{�_9�_�`(�Z�P(r�)������'��ܞ�)!3j|��ޘL����;��r9e}�����5p|��Ƅ�ƘXU�c� D6�|V��ڄ����A�p��F�efE������d�1�T���gFT4��=� ���Da3� j�U4[�cS5��X���%y����ٲ�����\�e�4�O]���B@�%M+�C������ZR����f���+V��j�k�^}��j������e��Dz!��K#߮no%�`���r�����Cgm�ᴑ�+��>�#뾖rϐ���1UA!��s���/� f����7i~ǣ�uԧGF������~��t�?o�"w�z���yy�_�v�I#�=��( J+[��_E��'G7����cw@�Mx�:R�;z�у�P�.�;W��Fmɫ6n���˟h�����#���.^Z����G��$�u)���̴��~�^8��{�}��'M�S�D���jΒU?�[�����t�����Lض����>���F/�J��K�*�27icȻ�ª���ҧ�+kӍUC�e�P��r$䂶��������_�ˬ���"�&��}L�'9�p�4�gJc�H���� }K�@�H۶mh��B��U���"��r�o-Ep�ڱfo噯��#Q���1�<���%s*��I�a�8�PtӦ�[n!^��k4�+嵭����TQU�pڻth��&\p� H��7e���fѰڷ>�V���N��M~�mcϿ�s:�͋�{���߮<�����i/��F)S���Ё=���m��E�2jh��sx���Uc�LH���;����3���91'�����|=�������oN�!)��t�۵ɻ����ߞ�ê��@! $I :d )v��,���H$��Q��r��`�M�� g��sn��\2Rdt$�Bj/h� :��Kw�!&�� v~@k�Ҷ�8���ǻ���@E����g�}���i��=z��K��MZ��0�(-u�"�>g;�㶉� �.:���!ύ���)e3~���Im-��[��Ed9���+��7]q�>-��[����_{��Q�ʊ�E�e��eY�h�j|T�ò3��qDC�Q<�{>����~�SZ��w' � \s�t�LOSpD%�J���x��kbqP߾�L0�wrq�L�X� (������ 0.m���;������.FXV�c�(L�ND��|�>���hl����2,ğ����Xp[���(����s*E�(����|��f|�Zt$K�Ç$z����ѣ)�jm��K + � I�( �9�I��I� F���2Avwm�����3o>���ۡ�w�������ef*%%rMM����BH��(6�=�$ƝmrP�@y�n����&���0c���7.�ů�iKmC��Xk����¤�n�h�f�dLԑLAM��$��U�k]h���%�yRؼ���,�8�B�!+Ɛ��át������r�´��0�����IA��<�f?���~�Q&����O),,���� :wP����%����c����C A�FZ����2��@���O>I ������D̓Ҩ!8�m��* B!��-#P��٨���$�q��X�l+G�R3�#>��x�3�n|����[�}8�δ@-��w)�6�i����}����n�qL2!&��㡳��׆>Y�����ѽ�}�`�M@�n7mxƏ�KKk�L!�}�u�=�Z���9�q'� ��U��4Ϡ$&Sh��[�����s�nI C�c^KN��nd����@kA�e�k��\Р��xܔ�)O��u��[�4������O�I���OÙ�=�VD�ؽ;j}X�0�h���n�&���<����I\dmc}<�}�\�ܞ['��*G,r���g@L�c���,�;��♜SS��2�$t�B�yCfrG0)�Q�Z�l�4V�%L�3M���'$�zYk�T-$,����c���w&��R"V;�NH�VØ)�Yà�V�����2P:9En8�B���RE�FC\��4��ݺ�փMT�dn�A�6������'�q�X�7�^I�S���&�E1�'G:[�LY�ϟZ=w�!:�/�p�Jm�?��<2�?C��AZR҆���T� e6%bv\N`�%Lo뼋uY�$6=�4Q��JFH�e�#��-�e��aƚ-�s����H��S�L��Ph���WmQoK���F����� 6��� c�6B��+�1w-����\��h�����u��� ˜�-���)��nڊ���Z`2�D���q8�qmuwh�6���-nɭ�����v����G� 6lܨe�0����8�i�/FS "P�QH�t��jK�Q�K�����0�P�:%��(E���@GSq��$��0��j|�k�"�x�,�Ck�.�X]l�e��!��� �@v����k��Lb�����<[�^u��ƫa��bFb�L��$nxe��:� ���̅PQꢌ4r�mQ�t�Bm»V��y'`O���Y�lY��P�ӣB�Ϣ��@�?�s?Q7`���J����z��e �n�XL�=v5k�>1� bi^�x$ϞAqx ��S.K�� �p2����U�S}bIf_xP�=�h��<&b p�i#Z�%�'+�OI�_�~Z��@�a�s�(;�ѡ�i�:�����=�*u-!!���D�dl���{����uL[_Z^AB��I�|�i}r�\+U�`(�c��|� �̅���A'@�uS���\/������o3�nVdJ�1ZML����h[V�l�"�B���cHQ�X���a��*FG���p�P(�e�� ��s�����m��n���=]�7� ��-..��e���Q���c���]��V�� Aj���;�� �:�>��N�6UtMXQXߏ�*��F51���F��`�3��6�h�(4���r�0��f��\rR�Lh�l�� �y�3[�I��{8I��l�}ߪ���t'�PB,D9L4�6�Ø`�1�}6��D�$�d�d�!$�ʠO'��m���U���M_�F������yF5�Uս̢g�7��s��$*D���9�(a:�AX��x'� 3C4�"*B�N!��Y��"1(er�wb� ��$4���6�¿�.Sp�}��Q/��Yf�Ń f��h�&���8�85ϵ[¹��S>�����z#O����AOq1#�C,e�z�V>��� �C� �������7L.�������ɍz�^f!#p�� �ty�P��¬2����nWa�y���r2�c����ܙ�>n��-IX�ϟV��7C�_o����ϱ�B�I�P�R��W��"B`�c�!DB@��:Yk�Q^9PJ�;��샵6�#f�6eY�%��G�D8= Y$��-��������ݫ�`�oAD�ʩxB6��o�p�4^PV���t�8�n�z� 7(�\�r���I�?nc$q����!���7�]\.̒�b�Z[cR��Tn���G����� P�|�t��PHH�Q.z�1v]t��V���&g�Bԅ"�'X��ZF��ǀ P�}���Y(��k�r|��xJ9��^�k��""�*�@䨖2~�Z��8������u�a�^�(��3!��qdY,��FDX��γ�R��� Y��n�ʵ�� W�i���y�xzz�I�$��1Cc�j���G���h���XP+x�b8�ޤWq�V[H�/�Sy�Ǧ�Q�y�çoZ��!�;��'#������k߾��;�l����]�`A�h�Yᾒ^"t�N��t��\��y�,���!�a��Z��K�m��ׁ �:>�.R�H*�Z{D�����"u�fv�U����L b�"��(c��������� �R�""t�Td�Nb�`���>��}D�C�ֺu�Xk�nM��Fm�) ��Fr�r2/��"ھ}�S��5kָ�1��뎒��s2_*���� �;�8���A��)h�=���W|�>��?��#N]W���4�C��_��E$���)�����̛��s���[�Ng��>@2��9�-�M�̊�W �▅w�-��X�!�H�YZ��_ie!��;�+0c*@ݣ*��H�}_��4%3����*�c��ɻ+ӟڜ�#lfNf�1��A@%�q�(�l���&����[1K�Y$�k`�œ����.q,)�fR������̀���ZΞ��K<�S�͵˚����Cٙu�ΝGuԣ��J�r�%�$AL'�xb�E��[oM�'�����;�cbb�뮄���g$*�09�����W/7��I���K'�.���qBQ�S��� �S��s��� s��؉]7�w��i��8X��5�H���o�)�b�����Tʘ�$���i�Q��d΅�&� 2:I��$���1�Z�"Z��j�̌)|�3�Q�j9ٕ�����v��ӽ��d�b�~"�syF�"�7���Ӿ�"`�X%��>��6�1 �nٲ��k�Mn��y��W_�h�+V$����κ��+_��'�8a�s�=w���ɥ;��+�x����k�|�7Wo�gF*`e?[��dr%�aD\��.W�t�����R#�����+�w��53q;����Bh��%ڥ��hKf�¬ �� �(Dg�ўgS b�N��X� 9�-�˪�d����0L���]Rʵ�e�u����=�T*���q��J��8&T�$D�+�� �X�č3����|f��GxPʞ�=5#&�&�8�ð��'�=ꐀ*��^�P���L�}W�^��iS�q7lؐ0nҽx�ʕ�8���˵�����w�}7y���=�#��ꃎ��|�<����k��3x�+���em(��[M�=Y�ȌA��( ;|* DЅ���T�b���R�?�0@&z���d����w}!/y�@! 0�TcB��� Wۭ}О����=�'"@L���(E֚z��[�"f�� �ms�� ��8�cm٘v�T�7�� `�����.)w������A����^v�Ǯ��,t����Ol����L�"���q������'?��Irp�u��''�7�B'\I�'=)���ׯO�qI������D:у���ӐV�_8y���6İl�'R�J,�bm1�%������iA �Y��c�.y���� �'�g�"�<gjQ�tɔl��]��] V�/qqmL���x��F���$�nؕ�$"E�H�#�kb́D^,�JqIԜe��G�Ih1b�ڑEf.~�R51G���m�}_@m�ݘ�����>�(j[��m+��G>3c�"\���G �0��R�@4�B�c�1"Q��ثa�Ҿ͞{y�E���7g�]��p����n�&E��� %�6�Й�D�ے��3�x���A9B�1+X��r>-3��<�H<�Ox��x} H���C�\>���e$l >Hf�~u{�W��!��W�Ӑ2r�:�b��-�C��uK�r��"9pW�B�����J�ҥ/E��n6�b�+���tT!(�%��Ҋ���!_cD"�@+6L��� �v+f���2�(*�� �X6qš4S�2��L�A���s�86J���$6�f���:U�A�Ӻ��G �EfR��;�?�ew�.��E߬�"�ȟ� Ć�V���{�`\غ��w���e �X���8�4��h\�X(B�R0b1x��vD��ay�B$D�2t��ܝ�q�H�iПρ���m^�rC.-��{�ԥ����;�Y@8=j�O�\.�(T��Z�N��ʥ����ɝ�\]Q�0����V�&۲�R�*,����#Ħ�lF� )��kOk�Z�6ffB�6�04l<�e7�v���J�Oᢩӫ��8�ZH� A@��7�"v-|��T��e��{��ry``���c���"Psm P��]�P�w� �F#<�b���"�}J�+�z ��6��3O=~i�*N����] U� |��JS�9�d��2!]�+9906/"��0=K�eDn����t�]��SIQ��8�RXa�t���ɱ��/"@P�����h��]rώ�Sv�c�x�����o��� �ޫ_v��l߶���s�u��������10��/Q؎�f��)�ZM�Z+R��|��6�kW�dm۾+���PJ%l�������eC��=<���0 :A��\���P�-ˤz�/����E�^��K�]�!�W֪Oݨ?r�.]�7�S�n�{�j�{�</�& ���s��EDx�EQ8�^���M�}�}��̛�=�Q��)DY��L�brv�,�YLǴ_LK�;��b��+�+/�e�ˋ$A\dS �p�[i�.�> ����ұ 3�E@A'|;ٽ���j�q�/x���8~��^w��7�����/zzJ��/~̣�������?��u�~A�땟����D;662zF��R���2pt�c�k���;#��0��7���.O��q��p-Cg��<Ok�Ь�1�t?�*�h���Vlc$M�,�Kp�e���Ջ^x��J�V�B�}n��b�L�dze�bI ���d�na{��l<%�n���i�G�|_��#�<���/MIx3<tAJ�����r �$aa �r�,)�����A�0�E�y K�SEb��.����r0@�o6�r.�������u�6lVZ�}�R0s�%f0��s�]0T+{�G�+�bbtL8�UK������*��R��j##���jU%�h4�H�>�o��w���@["��c[��ʥR���ĉ��X��ZkW�ȤR8� <OU˥Z��k�L���+c�#����:����<۞���P��<:�1�P ��=�u\��D�sYI�e$��@t����I��y�EZ$�Η���u-e2@��2Ҫ��CT(�!@Q�<����S=Õ�0&�T+~ �s�0<T |�jbT� �_#�)���i4~��ڽkW��Aetb|�=3s�=wG ���;w�� ���;�0� FO��s�s���]{�?�{ϤV���ڐ�T��¦�$&�XQ����86H��b�: X��-��z�M�?��U#xw�������,�0���a��>�� ]��g�$]�!]p�r)�L:�`-��U:=J�sznF����H7�����d\�^� j ���@3u���KC��������|"�NT�,y�HkR�K!�K�)���n�D�����JeH�Z9��mw+�_5�ZP�'�oos�c#�?���_�Ɨ.���Ri��/=��g��[������k֯G��[_���~|͍[�������h��}�K�lOͽ�u/<��D�/��+��_Y�H��+�:ܹcR��{<�s�s�F��]� 9ow���%%�-��d (����Y�.�xc��0��t�o���� �kWz3S{�1<�1(.T�)��LE����R�tT�nC�XQ0+��6��z> t�DD��1�Jb���pa�w\t钬g�R"�����Ť��m^�߷�.�,j�da�;'���=Dr�&�N/IXJ���f�Ν���}o|l�;o� k�������ݳ� ���g*/�U�J��'����}��~R��9�x��=��gW���=�)W]w���}���^�UK����^���� n<ꌇO�F���JC��� �.�MժU��Qo�H�Z@ �}1�6 YmP�~;����yֻb�M���]�T� �����|��D 즠B��!p϶�;�z�&�{f�|���~�!���h}) , ���HN��[�iٜ�Vg^D ����[��I�B�J��sw��F}�c�bl���̹��ܳ�� D�/eLD���bc#n۶�F���K���{.�!b~�k���`r�5�ৗ���/��w��##�#Oz�9�ο�ћ7��e/=���}�{>�}�+��{�G��ս��+4�3�s^�u�Sox㟯[�����|���3��D���=��Me餮�Iв(B�脘�z�pCle����n]!8�� �����*y(���*X�6'Y���Z�b�`gO�K�n�9Vgt�'�-�����"���<@��#.W9'/]w�D�%��G�P���.�_;�T�.�Sd���1b��=��*cc%O�}�(2�*�����}U�=���7����W�FR~�^�r⦅��g���'&<<<�_�0Wo�/���u��Q�ш�(�_�j�2����e��fl@yA��*��+��Q� Ĭ`9A��>�1$��$@���=*IPl��$��b� ��ZpCd�<T�G}���uU�F6h�}��T6��\���7n �q�F�1s#HaA�2 Q� �Fwhݝ�b\8G���lM�5�|e".�)%E��W�8��_�z�Ȁ�`�ѕJ��t����/�!���m��l��Hmժ��k�($�ё�Zm�>��:(%��(�����?y���8�z҉'�v��P �+V��"�d!6��B�1"��g'g~u�'{��^�ڿ{�{�����呱�0vy��ih��%#�@�r�lbGa�2� �X�dK����}����P\Y|�>�p������J P��r9� ��� ���ӌ1i��ᗿ|k�;�����na7�����t�:����&w��`�$�Ja��L�2�N5��]��n�oX@AD�t���Zi_ޠV��a�Jq�왜�;�b|d�qعkF�&�]�zltl���\�AʉXr�E&�|҉����~�2�2[aq� 1��/�8n�@)R|�?����?�w_��X����Cc�GV�i��r��(8�x�(��`W6���r���ęC@�Vd!y�(� C�n�J��4��G|��j�v�t��D̷�����'v'�37r�^����Kܽ��=�/�z����kp�蚩�{ϳ��8�u=��*���(2{wM��y���m�4 ��=1�M��a�vG9���/�����g���U/q�{���l-��#k-�1��I�[&��^u͍/z�k>��w���~���6��߽��4���?5=����Y�'D��Q;���B��Q��vt?�.�+����ӕ�!��4�a��P�.B�B�B�,T�[Vϋ���űofw�y��B�~����<�t��9�����<��-�,v@:�B�wn�#C�Np?0�B�L����Y� ���&��j��g��c6s�Î���u_���'��z�LM�4rܹc� ����� ���駟�pl �����"2pH��l��%/| �ԛ��w��?���G\���|��M�k6Z �1)B�0��o�g���Ğ�|?�T� �a�(ԕټ�Ȁ�Uu7*,^���@6f�C��/=!2 ������Y5\$�0�*r7�i��|�}�n)"��n����+�@r~W�g�O>�f�"�H�K.���Ktf?p�ET���"��/B��ޤ�#bP*i� �}�:� �F��gf����lޔ�+7�mO���������^@�U����RF��<���M�r�O!��Z)ٲ��bcm}n�M���;⬳����˧?���N>��_�iy,"�wE����8���X�{�Q�?d�\J�2[BLo��X}3����K� T)z���,n铀�(�]i7)J���T���^6a��CA$�W��*"v�*�S��+�������c�3/9:�''/��* �-"�xTJ������r¬�w��y�z1�8V�G��ʮ=3D�#�8�-��͖_�f�ZG�0ܶkgG ,�L�����Ȅ�ǟu���m��l�U�c������4&����nEͭ۶$|�3?11 ��=�5�(Hɗ�c'�J� ����.k�;M ���X.W�(n��]ڷ/�:ܮ�HV�p�j�ZE, �}��#��-b�XgA\E,���i:G��:+��Q��@�9S3:�Ϳ��vnfv��1�yvp�V�e���(Ly�K���Z�T��鑺m!�l�\o�N�잚a�W���%R�R�j�K��;��G<���ד�9� 5�k�����������_�����x�e��j�R����'?����ȏ~�S&V }�1�Z�T2�0��6��6&d'�T��(�L��d �`����,6h�T�\�C��O?�B7��_�l�Q$�C0}�j)�� ��21�,�����������m�f��7��S��RJ��M�9� l�^� ����QAX���#Dt}2���1�m��l&�D�yGQ(H���}�˕��o�����͗��?�� ��r��kV����>���v��'?����a\��g��}�G?���8���n��q�ޙ�O:жÖ�_�>�__�x������'>���?���ˮ���eCQd��|� ��|��� B�R�|ߏ�(3���<��Jus���l�$)�VL�u¼K̐�`��r�l���Vp��$�"?��k��MB.��h-�.>�E�y�o:N_�e�I�Cr��C�E��#%P��'R��3�3J�H�J)g�m6�f]A��{v}�?�H:Z1�jbժP�/��=5T��XmӱG߹u�����Ș��}����}���O]��+K���Ȇ=ӭ~��V�c�`��B���S_���pm���?��ʋ.��4y����8#$�<�)���qg&h��S��,�V�i�I���2�g��K/߱�%��&#��f#Ƽ��b���D���5D*�r�ߴp�:Pw�ώa9�w���Hv��F� �RbM��,%����JL���3�H����KJى; �S@ �l��#�j�266������t�%�kD�R�rm$��nK41�bEm=�����Dã+�kR���|�A� �@��Ƭ%�m B�m}o�2�S��o�R ��&$�V(��2<�l%f�l�4��YmdHs���gfa���=��iC�M��� m�1S�FH 7�_T5 ;݀�szh�����mS�b�� ��=��gn/��^(1���~���i9��:sg9H�ns*�;���.����}1>jnDf��֏8�4"�@�U= "-T>K �@B�+�H�ڐ�M�i�1�}2�ȼc�V� "�a��<W��r��j�mi��Ru42�I�@��"כ��rcr. "�ϱmGV��bY��b�,a��&3#U*@E�-�Um��(I:�PK�]��x�K@H�M����1[�uR�:N)���Z�Vf�����6�T�`����0"�o1f ,���]ͷ��n`M�(p�ջ�_Q��ǯ?pb�/��]�t���3g�t��k!�L3g� ҕ8, �ɼ�aA�T�`'�(������/</(s7b�rp���ٸO��@���Q- ��fS�� ��U[9:�����QU�a(��%�����/����f���Mx�x� J��#����%,��1A��"��b���Q=��$���V*16j7#Bi0����A[�ʴ�(��PD�" 3!��h%BZ��bј�e�H��v�l!��Fa"J�+����a0kP�5 H[k��<=OkO�Y+lm�RIk�K���j��""`Q(�dER�AJѣG�X8�C�ne�([�_�z0�3����f:�Re�������eKH�2Aİ#�ݸ�ucE3��Bz�,& ��2w]R���L���"P��"���)��}�R !����4���)/]��$ՠ]���S��?�2S���;ul)\��@��nr\ERkm��&~w3��(��?���+��=�'�@2��/DZ!��v+B�"&� �5lYr�1�a�Y��"QE�R�\]IW�Sd��B��(JxZkϋ��Yȳ�RP.�*H�" ]�;TʫT\�7 DLZ$y�n�M;���Y�lJ���A��<��U�0��V�]�4�DB�� 7O��R�| ���';*Vf��`w���z)���� ������jϔI탊�Ԍ�m�?�o��ӻ�V[ǖګO�'>�t�W/�em[�� ��J�-٩V{O�P�����G����)�sCՆ��&_s�ĵ�6���:ҳ� ����b(�F���Q����@f5=����r�����3R϶�{Eq�<��v�c R�@i�E��P$g�"kQ� /Mk��x�_�V���� �ym �fU���8 х�Cnz�Dp"�e�"�m����c�D@8!��"H`P�����-�\n��ؙL�6KO�B9�|V�z����H��P ]�sp��0�:@dVu�+�&Vnh�Ͷ���,��u3��Q�)G�p�߯���Wǎ����sO�y����Z�G���D�:�����+�]�E���&b�������]�.��=�Y�Rkܲ�:��;t��z�M���A�1�ة:Ii����d$b�Y�@���h�x)�3�~�c�:�U`d��h"������*x��a�����!kR̳�K�K��B��9ytW3����^��5߹cz�n&jޭ�[�@����#��[&�pҚʍ{��,#k���<�a�G�b#`���+Hw���_��|��^���^��[`��!=�G�˝V��ue��g捋٢� �ׅ.:�S[�����( ���J�(ْ�F�:;v�llx$^u�9ͱ���;��qk��n�x�������W�tI"�Y�d!��l��h-i"GM��U��[��kU����Ŋ��bF��y��1&Ӿy�u�W�l>_�Ia�$�OO"��ȸh-�鎒?�T*A)cW2 ;Dl�h�f;"]èR��@�WD$��f3Ŵݞ������u)x�Rﻣ�D����K�UJ%�>\ؒ����%y�����ͣ%��M�����1�me�a㥈eð��an� c�ͣ����ȕ�,�2aP��>`t�&�̝�,7F`�Y��˚��.�\w���XV��Nd̯Fy�|(�fq���)"�������ե��sW���!�:�Ҫ��z��6=k��][�F`hh.6mKcs���"����z[+�j����~�-# )���z�9�z����.��Ϯ�#�3H:6�d��^Q�����"c�"�ն��A�֧���]�v��t��z]U`��:*�J�^�[k@��$4듯x���������ҋ^��O}�+�����R�o���w,Y�yn�Bs�'Yμ��-�g6Jt�6�p��E�N��s�J��g��|��W|����5���'[�N^Q�|�˖�4��҃�]t�dؔ!]8�s�wm��Dy^g#�N%,7!��v��B_-�f�Grԡ�כ���WH�d��А7r�eU��>ᄠ��[�$� ��D)S�4yW�Uu�9kL�䑉-v��7l[?<j���ӱZa�n*�����7\]_bd���$ג�y�ac�R�j�<�M/z����/��#�]�}�!k8�+}��9�!�`/B�t�mɾɫ�������Fk��Ǟy�I�~�k_�L�<*s�dO��*��2�Ұք��Û�Z7V�#���n��G^v�5nI�$]�u���A���e�B�Ŷ���N��qxO�<rm����5�����a�p�W�[���G���hGv�b�ޡ�@�����.�BL>l93A累�(R$( �'���TT��9Q�S��ѫ���.���w)�L ���5�}��ٸq�*�efG��_��h�S������G������[��?���7�)�U��i'��Y�I�{/��wOi"��1R�b85�r�afaҊbk#C�����1�{J���H���[ �!0Qd�IHi�� �eE�@Z�10*f&�6J�B �AS�l-($fa�������z~�RF�{z*��\�U��R�c�X��F$�J��Z�7d d�����P�h�+߹��m��[o*�Jo���.��/������^��w����IC�ण宏�o�:� 0|�ɽ-sԈ���]��1�z̟�ao#�n�a8kM�=��%��z��u9AD���#?H�D��<]�[�YU�뽉{+��H���KS����hVd�٧�7<⏇���:�~���|�#��ێ_��� ���Z����>��9ۆ?���;d�+7��ONk*n*�MF����jP����q>�d�)�i�X�J �RD�� 2���(dd%B�VHi$d"`Dda �b�"�Q�X�J��@ @(��& ���84lA��,�RZ!9��lM;�l�R+W*�Hl���D�h����p��V�Xk�%�0P*tôcG���a�@!�.W��i�^v]�s0/��{p{R�!�a �%��ą��m���F�wM�w�i�������0 \r�,(����,�#�4����D�vT�.͑-Н�g�X��jɱqF���CU|g����O�$@#Ā�-�ډ�ꭵjDk�O���?��S��Ζ���{��/�-랭������o�nB�z��mD�6�f�Ji!�a6�M��� 4Q������Zm�6R.�4J�Y�7'gg��/��#�HFF�mϴu�i|t�22�qε�3ӳD^�R#]fV(�p��nNM��;4R�*��02��s���R��� C��õ��Ȑ��z�i���� (�X`�$�V�Q��W�Amxȯ�h�xzf�ԧ��l�J��*�� �y3T��Z��Y��T��yI"�K`B)NHg�T:�»�0��T�n-��:;Gv�z���D$�ÌtE����v�N�R�@�7��Yr�|=\\=��1�h%�#����{�X]�=�Nz֑g�ݛO��Z�~����mz֖F�m͘�b�x��*96���]��7O��p&�c���nP��-�ZM�;>��ɓ�Ո��3�8��|����f�$ٽw�/����芫n����Ш�!�vknr�UO{���Gm�tT���R�Fx��7������?��i{���c���w���_��9�{暵kQ������_|濾x�M7?�1���W��#�<�T P��n���]t�~zI��I)Ĩ� 6qݶ��x���['?��ёa$@;59{�ϯ������;��Ol�g���nk�;rX\63�_���W�W�(���Z|)ʁ�ey�摥h_q�n��"�(S�^uWQ:����O1ϰ�3��`>�<;]��:�1at �����H�HR-�Ū~����?�X]����U\�x�|��S��|���^�z��IgS��c�3��z��oX{O{�[����G�ZCgܷ���r8�j[�ٗo�4^��'=���jl���Y�l��|��� Nvɼ��v��}nnv��?�_�����cj��/=����M�������N:�Y�x��_�~��{�gݩ<j7�^���ͯ._|�U_��y;�m��(i��~�ڳs�{�7����w��Ǯ��ʚ���N;q�S��[��O���oMN���g����y���y��/{��$'�k�ݺ徒�Y5q�g��_����<�o��#�ͺ�5,���~�goy�s���ɹ��.��mwn���b�##��7nz�3�����}�I'� �yW�CD���MC�-�ɘ�h.��|+wa��J�"2_-��~ȿ�%Ǿ�{�f�����SV,S�U1�;����ܱH�d,uZ'ͣj-�u�s�i�ypGw�;�/n-$��⠩�*�� ���x�w�mٳ'`n���ޤ�w^6w�E���cF7D��~�5��plJ��y�y��5y��y�h�c'q��F��z��QeU$�DR��G�Ȗ���寞�G������̎]{-��Z�fY�V��ȟ��u����^�b�O��wS�ۯyՋ���_��w��;��W7�aIkd@Ak��>��s�����?��^߬O�"o����~Gy%P �����g��s���[^��_v����m�'XW �&n}����_��W������w��D bCӞ~��������O|�K�3MQ��}+�9{����5/}�K_ Ͱ�`r}�b�_�������C�0�(���q;��f��z���VU>�����`�ϑ�@�GQv85�(�����4̯יN�)G�)KN�g������5��J.ZB�Y�$�B0~ Í��οd℡�;��Ժ�~ԑ�ް]o?r]��2��SΚ�9�W�5�o6p����kG�9Wx;��^U.�"�zd�>x�87��}G`a�V�9�yf¾_��w����cO��n�5���}*kan�������W���Oy�#.�亷��;w�~�k_�s�];B�j@m6��4bտ��E,�߽��^��w���Օ���_��؊MʯFb����W\}�7�y���e_����5�f�q���JP7�v~�K�x��s��}�ƑGؘ�z�o����~�?�ˇ���z�e��-�����o�+�B/}� AL����� FqUq��u�5,�A��ύ�^�A�:�x�1�17���Y P�ݬ.2nј����0�t0r����r���\=mڋ�+�=I{�5��1��������u��'G�����0uƟy7~���sGm���̋[�7��W�mFC;�4o������s��"�7�@�8?��Eb! ������{�aRgJ��� +õp�E �*��74^e���/H���Ojε���>�}ۧ�}܌EC�@T 5�~m�?���[����3�8b��8�ZͰT��+#�1R�2l�VK�:Z�H���T�M�� k���af+��O?.��bDdde�"R�X,3(�J�re䓟��=�YIE,,�`[(D����'�g�,����P��Zk}��Z/�"͖ s�R!��b��~|͊�K̠F��]�@8S�ء^�����,��d�h3gmQq\�=I��%�W��c�a��i�! �<��@Q+2�Zc��c���ʧ\}AXn]���=a43���[O[^�^���RӋ*{~��g�s*z��;�h�G�X�z��Z�k$������M)�h��5�6,��T�ǫ��3s�D��s��B)S���"���XQ�3�p�46���\��E�5��A�&@"�+�n�6������OJ+��a�%aP�`*Ad��*�b��G�D<$_HY]�`f�����$��Ekc�������ڶ�{f�q��f�h]>!*D E��=��Ak&�k@��8FĢk�o�W��9����E��x$�q^/��s�0�9,��~��X`�U�ø�q0��.�3碦Qϓ�H�ǂ���R��_Z�D�ɸ��@�d�t �!a�}ߚ�uˈ�U��Զ�zj�V��?�����̹�����e�l~�P�j�uW8�{��PV Ϟ���̙RI������j�'�*Yi2Lj�I`�@�8�������[�4��c�_{�+VnҦʖ)a`"K:�����I�w�����ӎb;��*���c�4HJH �¹�ի'6�a�}[��ܡ<���"�̚� ib�Z6Q1�R:G�S�B��da�}{`����k*�lP�X��6����� B��'�A3rE�I ��5��d�Y��+��%��'���5��yq�H����|��@�ƹ8)�O��g#�p�e�\�Q�_2�s�mC�q�e+&����o��彅%`d_���J|`5������}��M٬��ׯ;�}�۫�ù�or� w�V���Ƹ�5^��Ưnh�ڙf3����Uo�k!4��{�v���ӄ���Q�N߷vM��>�0�t��z���-o~�7ݳ���kC+,�� ����w�t�oy�k-�wο�[��[�y��_��g|��3:�9�NĞ�3�S�����c5��>��<+���A�B�d-$/B�i;������H� �X-]�����/z�K^�_y�-��\��z,AI;l���U���?\Y�o� '��~�K_�۰CCc"�g,3)���<�����M����3Q#�'�(τv$PP@3fM�+���� ����Y��(��,�,Q�Щ��#�Ab���%[&��̟Wp2â1 �:k����e���tq�r���1_��k�ϥ*c�cYYZ���}�G���;:�Ƅ��t�7V���{˫)l>an��zJ�NͧL7}�={'hVy�Q�g7��%�~�m��v��w��N��������x��#V�o�������W���~��?�_?���={�ĦmlUb�fu�/���kC��� ��mx�߾���ǿ��ߟq��_���ܲ����5���ѡǜ}���Ug<���^pɧ>�յk&���a�= RȒ�ٌ�RZ��Ҍ�1�zs:�l� KP�릻��=z�_��g?�/���������rI�Dm�I�8���|��G��D�6#e����8�ˮ����)��x"�����e]Y&�9�`��i���թܝK9TiH���eE�}�M�aO����}s<�˚�~�������|��o�p��-)��m�ed��`J �m�x���HɖcDr�df���*)醝u2�h����Cp���������>]��_�!�i!L�7t��f��i����67|�#���������'���+/�����X�~��+�<\�2$����GZZ����{�]볔�3����՛���{��4��y��X�}�7?��+�֔*}�+�}����e����{��gfn/@�R�l:���rٵ������K~5:q4c�ƛ���5oz���/x�K_��o�.���kV�ߵs�{����Q��c�r�ZJg��0N�K���RZ�"���F��,��e����FV��|�~�+_�q3��ٺ��l��j�t��rp�/�yˇ������۸4Tz�?��#��c���~�@( �)dѡ��\�^5���W|y�Y3�<�,��}:�{��9�GWW�S��ՄG��5+/?q|u���Ǔ����;�c�}m�.��^�t��o��(�'m>gC X��D�/��� �e%QN�γ���y5�r9H�����Ђ���p� �� ���*�A6n���\�d��RX��z�#��!F�73l�c~����/lQZ��I��b7�Utt��ܺ���`d�[?���]�b|�u���t��萵��߹�+����_c0��R,�*��\~�u�ޘ�8�_�����n���+������Ъ��B�������}���_:��N=���k��;�L^��������ə����-���}y��]J@0A(�:��K.�"��;wk�)Rd-�0��?��VS�����ˮ��I��c��y�_�w��N:��c��816�yj�֝�}�'�]{�O~����#���b�G�0����9g��ß]h�m!�AӃ�U�X �i�8g}�����K�W�X[9q����g��=-{�t�p�S�ZW�� {=�����#�4����iG?똑��ѽ� �D R{��9Z��HCtd��=��\���{����A��0�D:��\��D���9�Z���ɦts�MF2��}J�)3��q����xۆw��pFmlk]89���a�1���E����d�Z*Wf��ɻ��۶�[W�ؖ�h�J)��6YB�DbD�b�W_u�/yk;4�8m5Y])W�`��A�b�)��9(W�oh���o�����Z�A�ҞE�T�q�������1?�j�c�A�Da�d+}�����JAYk���e6&����??#8<:�����+q-8�T�� qtܫD7�ʛ��b<�XJ4�������&j�>�}������Y8]��]�RX�Z�V��h�+Ud�l�=ew#��>��5����r�����@�+w4J�2���;j$HU�9{}�߮��3Vݴ����������(݈�Q��fc, �\/�B�]�Ɲw� U�i��t�;������0@����)%怽M��O)�*M�O��dYX�3�)7IV���� EQ�� �[ u��Rj��k*���ԞF\��9Q�w�%�r�oV6�q���Q���{��z^ ���bZ ����Ti��n��0*�RX+ְ��#O�� �X�%���r%(9�Yk �h! -\"%��Yi�� @�����Ҋ�i+��Ā8�b��� �DV�0����GV���XIvE�6K�&&J44��e�VYS*��)e�QK�N����%B6fHy 03׀�"��O��@@+�;K�#�@t�p'芹�х��_�[����j-)���M9E���ݔ��?�W_�Fe�cO?�_��]w��9��jj���&�0����g�E�+N���Ι�f����:��+�eo;�㋷և����s7����Ƒ`]�;qE)�r��ik*Wmo�VF���Fai(�͒��+��"��=w��5��_�$���E�U�m��@m/[�-D�}P̭�;GW���[�<3Lv���s��j4��e�a-���K��<n�@]��l���'�r;bma���`�T.)��1b�M���F1i_EͶ*�K�d��Yf��a�)q��� �.jY�S%��09�[$$a6���Ec��y`�u�"0im� Zg�8�)=GHD����qdʥ�R�l)6Q����*-���z@Z{,ƀ��r ��� �Yw��p7$��>5���_�y��Y?��n��^����y��v�g���3�ԣ'��ٹ�^~(�g3�}�Ǭ��S��6��y,���o|���xI��y�(���|����0��X��b ��v��l'" "�s,ï���!�Am�b3�<=�-u�H�h���v/��k�&��㤽ѽ|��K*���|���jy�G"m�����?��l��GwPp , ��7qhٺ�DT���1�ص.��Qc�V��I D�4�Hx��H�� I�EPk-Xk�Y�p�x�$w�5c��k��"62J)At$m�]�ɦ�-!�c�fvnV@|�7�Xk�T2OD�,H)��@��F�[kA��oG��_|�+�;k���n�olb���_���\}�/Ο�����/x��]�:��@Ň /H�N)�w�t��.�hZ)z��X�1u��WИ�qt-+X�C��&�D�̰T�X�8и�֩�<�$�Y�j���!a@B�����7�R�bB5��Ǝכ���`ר�e��"VĚ�Y�֎M��TSz��JiDP�@��X��1&����:CG����4wr�q1�ag��Q�ٝ�-p�2��̎>E���Y� �T�ٴ�j�K�R�\��^��m��o�(�O� e,�����;����hc+:휧Ѻ���/۾��{�{��w���K7�M�5�i@�X�);�( �|�4��jΩ�6�Y�g)�t�N`�|���_�#��gˢ/�د�}��+�Y�eA� P��jN��\F��HP�MZ���"��Q�^�?��S8Q�YbG|_;d�s;��(�B���J)���Z ��jE�?Rљ���v�_'0�8* ��Z���m�09\D�Rn/sjI���@����=a��w����)ۑqF�D��j��q���tU�+~�]3}�H�Y:x!w|A((� /(>�0�'�.�!�'elM���uϽs�߽��+����?��6^��o]{o�;����o=��'�����y��f6�!��)a�Aj����!,3z-֎D ���q^�-�>%���f�è�E�{�t��1��,Pc��;r���D��L(L�(���~�.ť��RY)�W:�m�E�iǾ��Ef�<_�}�J)" SX6���T�1�=w���}?��D�&km�Rq���j%��zU����v279��n#b�1N�L2s���B�T�[�\M�_�����GRY�ޏ���{ �{��T/y�+C�R:��7���j���uGn�X$�MYh�����~���ߛ̱�.�&DCWC_�B�aDz�D"��C� 8.���¨R����ܟVX����Ꞓ�0`l���Z�<�R�j���pȫZ5���(�B�+�� RA2�D�H�HN�cR�-Q���qz��pN�����j�V����h2[I8҉�ؘf�Y�ՔR���9�;"�Rh��C�wN�y�����=���s��n�i�Zֺ>�G�u��G�ҩ�W>A�M��W�f2a�� �� ;���k��U�*�X2�.V���j�?�d7Eɭq�r��0@?Mh����O��Kq��/Z0m�1��]8t�A}�.�Lj"�����AY�X�H�P3@�Z�YSI�R�`���n�[&5�D`�`RL�S9gm�u$������r����L��"����Ik���j�g����Eի�r�e�"Y��t�<D�Ѱ�s!�l�)�����W��HD�C��+�M�l�ȁ� �$�o���ؽ@��¹L���y�㉸�[��C�}��e)������H^Bk7��{y�LY�4uvsneND���{�lLQ����6��A&b� �Rh�cdt7�/�X@�A(f b���6YEq)�P�JՊUHDoq �gJ!3h����j���V��IRf��n��ܽD��);�R^�������RBȑ�zc6CEjdt�7���4"�E F�4�1k>�6ӵ"233��`g�v��6��(�͋h�+�JQr�J�O��`��Ͼ'ND\v�6.�@����R �Zk{ͻ�1O��!���ۥ��}��+E�K�+��y���|�ˎe{{q��YY��Ú}8@�(� )|,��Jn��1�$,�1Hd��)Qq�TręОR�R�8 ���^�Z;�[��,���v>�M�477'���1F3����Ofxd�:\iG��l=�/�p��f�)r�"SK�$ND٭[A��wG�2���.�,�A¨�"�wJH�\�@��R`�����?��� ��+ �%����-�8[�/zU�9��~�ԡ�8T�@���\+"��o1�Rr�iVk���&���w8Xe�TI�1њ��z���Yʐ��B��(J���bFTb9D"�� �`��J^�K3�7'�N��Hf�L;E��#rp��F�H*EB�9��0L�� �>0Gql�!�1'��zDă��4�\"+��i��7��.̜�H�+�AE1vXrw�]��@v��nA_�5�ȲE��,4s� ���9z�f�=O�=���O��t��J@H}����,�'s��N8ω�8��� �&W&#"���$�d>Y�|�)��1��5�5^d@`�D�V�e�� Qb@"d&�0]r>Ӊ�����8���M���UZKg{r���8�ML���0�kuy�9��|�G�-�)aq����yp�HDPEH�� �2ỷOW<J�u�[�x���� X`Yx��v-��bW�^D*0���.�i�ZWs(� f)L�1�+�b1/���AĞ3��"b����6^���]"��)2jq%)��}"r�xׅ '��V[�<���l6��VYp���Q3w ;��0*i4gl�����U��U��՚ J�U�����w w3�x�K�X[ g�V)R�5DJܶ#�o��soV�V>0}:,c�����H}��A5��]���,��ݚxg�y�-�_�i����k:��=sUO?�꛷MO���6Ԟ�i��$} ?�s�(��$��e�����^<��ٲqVg�=�$��n �û3x�ο�d���Xk��|߯�j���D�=���d�\uy>�5ݩ{��d�;km���3�D,�{���>��#_��s~�I�c��ڭ�w����N�[C�RVm�c6�"c��#z��ڥQ9m�R߶5Vi�fZ� t���+��b\7ӷ�������\�?�5���(����~7�t�L�%�+)���W�����+v����;{ݻ/�qݮ֪�6�紕�u���Zk�^N��* �^��|Q���2/�I:�H ���נ:�R�2�����.����^Ո�� �WV*.^���BPlY)d�8�=�3��Z|�O�s�2�I���ٶ�j%2wdd����G�]�碵֩Ja;=��IO8�������)�>��<뷟�Go|��\S%@��( ���]�h�u�k��|�NI��Fl�QD%��x�����-�\�=gߔ��cd>��(�����;r���W�gϿvW�e3��d��� � _�#<rȏ-�3���!�/�֘�lţ�e����eǀ�{FA#�����Ei� Pv)݂�sW�ᅣ��R�ߺ\�x�G f���_�i�>V�)u�q[��,�LH��baF�ְ5�h�y�,�"�������<=��!�,𪷤���Ŵ7�}��ߐ�oE�TG�5�Bx��O���=�m��8E�J�XY���٭�&�,t˕�DDR`�E&n�Z�PDxY�w��5KDE[w�D����ex/<--�h/z4�'�HFvWK��ʵw���yծ�[vM�Ώ�A�U�O�8��;g���x�ڽs�F��G����K�O����xD��go��Ac���wȷ���"�*o�k�:q�^-*�{0O�n'�0���E� 0@OF/Sb��>���DJ�F�J�RENg�L�Y�����W�7��l��y��z�c먣�d�BJH]����SN>iӆ�6��2�=�+�2*Q�|��#�"�`٤�n��1H����'���������Pa:������J�d��� �4N��e��|&���rNJ�&���\�Ƨ�,�A�W�%u�걤10tp�2, `/ \P�9��B?��F��u:=�sM�Etn[>����9"���@rwX���`"B�.a�QJiRH) ����dW�����IRd�}ӽ�i�{��-�7�S3'�x�'>�������֮_�떭� �NԘ��y�;���(�ӧ���z��VP�E{ݓtqp�>�mc�V̿}ꊑ;�6�7=f�����mp��U�,q� �GԒ,7���GA�,� �.��9��F�y��(�5䑯��ޤ��X��[W6�0�E :�ɛ��5"���v�N^�O(�ʨ+�����͏���]=��� ���, �W��rŭ\�,��e�Zk��CDy�s��� Y�eA�c8���;�s�Lì:��o���_\y�# ��J�"�H�"�H2{(��+3���@�V�?H[�/2ڗV�����+m̍�����u��]�(�e0\>I Ҵ�ㆍ�a;�m���yd�5�>M��?T�! �!Ӟ�Y�on}.6�H�ypЎ��z�0 �'�a ��{]��Ddok�w�-bW���B��\��_/�����GQ�����ؕ�_�R��R*�(����rP���(D�Uj�k�""m�����L�����i-�(n5[�$��7W�վ��W9r�f���(fhG��eP0G�"�= �=u�[I�cgR�� s'��X�=nM��_��t�Y��L}�W��&�-*�%�rʊ�:.@��ړ+�X.�]�+Д5�4��{��;��0��\���0WX���)�@ڮ�X��xc�' �l�>cF"�GZ�zU����r��@0ǾRP,�-"��ET��v���5X4'���$=4�k�/��9�w�H���b1�� d߾�++�߁��e�[f1���rz�U*�}?H.!8��̐ދ��?AV�2О�O�TH�����1��F Фز�#V����L�g�������zc�Kn:�Ž������߲��c܇Rm�� .�b�+�����W����1��<�1�T� �m�|� P��kl�ؤ�:�e8,��:̆�" ��Y�d���睲�t�uX�~J��/�"zy��.�yL YKl�Ǒk�1�����u���00���)�W3��͋�P(1��=�39s���l�%5y�4v�B�ү%������=��tJ��Hu֔0oyηGTJw�����h��b��148%J}3k{i�۫��a�df.�W��oX+K�,� <(�9Y� d�p�űީ!H�{p��\�X����L>�0`��o�8�4R���.�,��B��B�?�dG.�.�ӒD�� F)���h�E�aDt��0t��^�n��t�(�jm���8��_���]B�j`E�X��T�J���V�p��B�^F!����B��1�Y)��uEH&���vi���d9�&�����m���㷮ݻf���e�+�^x搲T�ǐ��@�o�NqA�"M�E��"b5`�)�q�p�@��9�(b��j� �2�A$���(H҅égfIce">�BHNk� �Ia� [OD�}sݳ ��02����ccD�v{��N9��t�nG����X8F�8F�@�R�c�[t qg��<m�E�8��̈́|#E��o?8�&�_����ej��L��_6��D+�~Q, =�� 1H��9z��<f�Y�~6NW2�딺;_s�&��w����Q��-ŀ��<-x !!+HeXZ :B��J����"G��]J������1&��5\�=V�\������:ŀQ�f[�ݓ{�điX]7b����መ����ŗ���h"a�>�>��z�Bx�rf9�%��D �q����r!��@ѰaYJ���#\�kz����c��X)י��#��9�����Ф���C8���S��,�+���~�v��>.<�y!�5~�5R,�+BH���e�"Q���ӎY����H'nA1+� B�,��</ �j7���p��6���"��VCw߳}��)�WH�5�@� �3��)�O��zNUw��j4YT|��c���bj���5'�e�?�3f�j�p<��5ݷ�tw�JW8���tծK<.�Ǩ���se#"9G߁�"�N��w���9w��6�%�o�2����C��ָ�=-��*�jm̓Lg"��l�|�+�4�#`��}�Wv/�'�����M�s�Ӌ� Q���k��P.�k��b��5)���L�B��8�L�rY+ڦ1�U�G� iU����b��r� X�<�swwYR�`lL���4Eq�ٞ�� ���N��'�m��6O]��~��Ȑ��R�a7ˉ� �+N� mB��=�ȵ��N�jBB�(�)��>o�Ȗ�ho�|��#��g=� �~�ԉ�'9d�գ��2}���KO��SIm�d�wn�9n���#�"{����U1�}�Ѥ��iŞ�@�KR�y��^�[;�0��������l�����D@$&b�+�\(V̶�hf1Yy��+��T����[4��۪56�WB�k�S{���S���w~PZ���H�b2���e!;ʷ�S�ϴZ�V֚f�Y�7P�<�Z� ж�l<[o9QZ7_�b���۠_���o�6���}D��O��E[���:!�˷Փ�;��o��:eEy��7L��?~�naI�7l��o:s��n���-�O9j����Qk�'�,}���%��k�Tۄ� �֒������5�?\��Ep��!�d��\����x�k�ҫ8C�e�.�,0i�mH����4[N`}�q��[�d�Q$J���aD�Ka�uR�(��:� z��,,����"R�ş�n|���Ǘ^�e۶��RhY�H� �1&�HǮPWzG+"�A"v���P�'�� R�u!�����rr/��)z��u�^�uz!u+��e��#u�)���{`*aYc�b����7�2�Z�w���V���?^�=Q��Tm�P@���6���E�&u�rh#����k���n�z�q��2��͓�vOcˈG0�D5�n�D@?�ȡ�Ur@�( �|�]��I���*]9��@(ku�S�|�&3���Flv��钫`�w$/��ֻ�,"� D�Xc�c��iL�/b�[�*�y$�XD���R�L-��t�$%aa�W""�ԥS�a箩�}�; �ѱ�b��("�t�\%�4�����72.? D��(��F��j#*�\���3+�H�����ؘP�7 �ɘ�O�\�u&�ь�X]/넌O_]��WUf#��ֹ�M�����գcFK߸uj]�[���7�� {Eo|��ɖ)yt�d��NY�?w�<'�ܰ���cF&J�v����`����q�>i6!���+��mz[^@DPW��=�˨*G�V��e6�,[ �!�"c�K �T*��(�Qച��P�7��"�"���0p�G�q�l�2�k�KN� 3 R��];�̈��(Ք@���o�{E*=��̙�(� �ԣDk�⸌,���Q���e�aEY@ s�}��#���0����:8ye9y�C��������p�=�<�e��} �R��j�~�yX�6�aZ<PI�F��q����ے��L�څ[���P�0)RZk�����Z� �1�)�%c'��]r=���i��VafN�`Fn3GQ�r���Y�MblL�6�M�LZ���j�@c+���0/r����/�a(���m�v����+�J9����[��%����S�-(�.½1v^r��J1%���9����^=7.��4�>����{w�G"g<f��J;�"�� ��C�J����:�D�"U�Z�֔=���y>R;4� ��J�6J ���Z�ƶ�a؎-* ��7ς���|�y(�0ء_"S��K줔�2����M�,�CDb���&�ywsSM5%���G'<"̾���ɪd" ��؎���Ŝ�D7�@������|�B鬠�j�\��u �p\��^Te)z.�E! �Xc-��(��zˮ{R�V��;��D�Jw��sZ{�29˷�� �$c�|�2�r�::�����}S��� �t���ޗ��Q\iƋ�����-!HH��N���c�6�1f��1�6���Y���xf{l|���0�e! ����nu�Ϻ�2�FVfVTVT*KU�j��?E*��Ȭ�������r1D@D�5Mz��5�������s��9��x]������0 �r+B=|��4�v���Όy?������4����#�yFD7F(!��b��j0���,ן��Xu-^�������/��>�y�04�j���(JvpA)@ ^&��R4Mw��Iʙ&7|(��J�M"ՠG �F�1��f(w^�swty5�}=ّ=�H8�Ԛ�BTnG��m���(�U<2z0D��Cn������n�oZ�D�(EN�T� b��F�(\�p#��2S���I��lǦ��� "U (PcE�vD�KZ"��q������9�U ��ό8��G�K�~T[t�H�9����%∅�,Pl�b�I!��w�&�h�dk�o�p>�XXD�A�0��U�'�h���|'��GB.�#M�s�,�*�P�ð]dUҬ^_�%d@�Rd�&@QU-J��[ ��{Y�I�+E���$ �)�J̪(@QQ��Ӊd҈eM�u�x��Y&?�Z���F�C(�d��}����R�&/(AO�Q��r�q� �sEP�J� �R T���Dl.����R�Y��r�$J��N� �����.M~�u�D�'�䂮+��.�EE��K��-��;ґ<���.0�ғd2�F��ew]���M�\fMU������肫��g 5��Ji�,پ��u�2������X1o�7 ��-���ɩ�qJsP��8��FI �Tiք� _��eGWM�(�$�t8<CW�������P@�%�XAF�]�m`����N`kQ �> 2�r�Ӵr��3UJ�D����+UQ3��Sf~��oV ��>�}���x��/�[��"�ڼe�5����|��^����Q��b��X� B)`f� �̹�� �� u�S�Ta��fU��3����Kd����2� 6_6���~A�U7À�R�Jne��� �A��K�H)�6%��4���oڔ�UBL�����%N8~ځ�}�<���b��QdPE��r��a}+C��u:�Q;fG�F�j4�J�2��,��G��Eg�b�-ht��\�FVo4V��AW�9Ӱ� %� �_�.�3X(�81�!ch�rX'D��Pꌨ��Ξ-C�N�W�C�`Z W���"{���;��>��(�cћ+�����pB�J|6*�?�� �r���!�s�|���`!�Bi��� �O�[-h��*H!�X���+@�#�y�3d�~}�!����)��U:.�?���g!�%�bމ!�OJG9�ԛ�N�^�ӕ���&$T��0/(=#mTu �3h�u�dD��}D�"!�:�2��)�||.�-����c��!��e4_�J(˒fX�Ʉȼ�ؔje:W� "�"�Xˆ���t���K��=��#�?g�ӌ�H�C�D ���嬨���PR?�te5�fsy��6L��5<~��'Nξ{�̔�����ž}�'7����W�h �k;�L� xCO��-}+���<���̀�$�B�d19џg��x�+�"� l��s�n��*%�-�ES7��l��ڟS�~I�W�xq���S�����;i;V*Q���q"����)K�JDiw8��/����`j���l�F�r{�JQ6ξB�<@����*.��xr$$���d٦�n�{CQ�����J�"'��1a������de�e�N>k�".��� �sڵ>3w�� }������V�<����������>��gKo~נ٢+�OM.ۗ��� �����6��K�ft�rawu Omꛔ����]53�9���|n�^0-5�M?JjEgf�@aNG,_dOn�/��znK�$m��ؿz���㎝J���t�>"#Dq�j�Z��P*|���#]ч�c�H�Ґ���{rO(B�����@BR'2�K�SmR(�g�fty�1,u��( �B!��Ƶ����0p'P��D���.`8E�O���(�q��Fuz�C����uR��SP:Ͱ:PT��QȖ6D����O~��G���[��O{Ϟ�3E��G2���F�;���1���W��r�=c��S���VCQ����姍�� %c��K�-L���Я�j���-�%�S�ez���o���5'&�C���6��6��5 Z��S:b��t�{6�ä�(A��p��r�0�6��I��Dx UI� D���!�|�NT��H��b2&��}q�{��Ȧ(9�hC/1��8��q�nôL�erE�P���S��Ӗ��%�M�挋?��[�p�i�#I���j�|�c��z��i)��m۔�L��=��1$�MIr����Qj(t��x{\�Y���CWl���Ii�3+p�Ĥ��XOw�s3����"o}��|?;oܺy�H�+ }"�R�N�QV$T!�����˨^T3smY� R�)I�R����/�7"�t��r��v o��]3��5!TG�1�C �0B�ˏ��[�1�S��6�-�7hM�w�7� s���^<�!�<�6���-��þ�v\�'gON��<)�W� ����暹���xgu��1�D�i���A��bVNH�i��:U�c_��{�����H �r��-���?���dJn2�)������0��Y���Ihg�>��ە��ڮ���@/�,$����#���;3�*:��*.�ҧ��F�7��.���i�Ss�9`�Z�ut�z���j" Z\���l���c��P��o8x�Zn�x�C�ƈY~���$��A!"6&����n%�F%�e- ��U����YD$�kA�xj&���U}V%�vYZ� L�Z�w�qD[��[��J8*��p�}?�f"0$(���B����XUC7�~ � �~�P\D�H(%8JjT!Ȋb t�p�Pj+GG[��1��ßQ�i���F�}�J��H"��&D�J*��Ty��;�'T�RDF�ħ�ڷ�=TTd��sە��^�H��@� �3$a��ZQ��t?G���m<����=,�D!#'�"H�^�����D��AL���YH��G�Dd�ay�K�"�샸<��C���A�~�iY��6b�w*]9p�3X^��-��@�����(�+7ٲI��j2�W�3���Cs�� %4v?���R��G�s#���Gd�!z�5�G(�TXQ�m\K������U{2Z�X��F�<�f1��Q�9��H�5��G��(Xã���L���sS�/f�v����i��gB�i��R[ +�D� cD.�Į.���>D�A�{��U&eu�@?a̞ �#�x,ْ@�08,"� ��kc���(t�%&RG"��Z�VxJX�S���|P�: �J;h"�?�:^um����Vŋ�7�6\���5#���'?ВL���(� W-��ª��/]��cu҃��T>6���(���/p�����53|BS���>��N�ә�%ԟ�&�>����K���t68 �.���%�GU.fD�@0�I];�볲hI�j�9,��By+��l`�#V�a3q����`���4�6{�D��x|�9S�1������<���_{i� ` c��<Z��2��l�}�q�g S���7n�x`X3���l�wjI�;%I��P��;��$+�Ol���o�^W�Lk4�#C8 �J��偭� �rp�,�_ B^P��V��H�zAQ�d,C��܁jT��])��dYj߮_<���+�l�x]�?��m����z��O.x���yƬ��:���� վM�V�d:QZ!�r ޛ�5�f��V�<����r9UUI�`@�]2Q4�H���}9�/g� ����H��*�W�\r|���ξSR��W��]�I������~^��}gL���+X�����I��R�K�ޗ�Ь6���}SS�Eǥx3��J/����Ol=�x$"�@��% �d3Ay�W����%�H����s��/-�V��D��rÁ�X�$����mN{�n���ŋ�Y�j]��lݸ�#y����e]sO���i���L�0��TA78< ���"HX�`Á���t�A�P�J`!�]�?X�-�ʴ�����^(�VBX5D�˃|�P�C�4�� �""�2َ0\���S�&$X�4�T��!��4-�H��I�T@���b*] s�Wf�my��y�d�:�w�]�v���I���u^>��s�i����Z���q-��veM�{%�q�qq�b�Ҷ���)�[p�\gf?r�دV����vf�\yCCީ�7J��[���1VM�7u�Ut��sU��~���8�kq�/�K,�"N �S _(0��XL����E�,�J�d��5����5�㧟���U;1c��6d&��(��e&��(=��MEiDt�� �L��K��4��Y��BI��s��fx0��@\L� O�'�B��ȗ� H*�aX�Aԃ{�Q��S��p��X����(r�YT y�� ������"�mEQ(���n����B�b�z�9�#���{2���b o�;���]�$����7X��#��- ��.0��Ү�����]0%�n)i��v\�óҚB�<���֗��+�ݟ[՝��Ҧ�� ��q�7vm�+k�o�� ������NZ�#�0��s"Е-�A� ɵv E��R�BḩS�fq� ��]���pH���84���ܻ����اv/\@�{��8����θ��&���G^����%0�B,�j�.ZA�Ӏ �\�^""�Ь26T{6����o��"�h��H��ם:�8j��/���>M�HP&�5CU�=e�0 y���f�a������WJ�y��g6� �)9�Q$vA��䔶��p���xG�kNi��?3o�����[ �!��vg�}|+�POL�.�\ޙ��� �;�i�nq�g� �DZ���D�����?�N>�a���g�@��Y�<��s�#�{��iΛ����[w�?{��ή��vMU�m�2OQ������7��-8sn��m_��3�s��o�@��-�F � I�2�p@+4���Sx����@�߱,�D>�\^5�1������R����v���P(%��k��j�|��%�ĸi\53��Z�S)�U�%���1YR���u�u��ճ������3'&To� ���}霉۵�|�T�!_��M}d���=w�m.� p��`{���j�g걘�]��Vh���V��Ů� w�' �'�K��t��״��y@.��2y�]w��M7~���c�5�ןnK+ ui���&S����4�^ ��|���/��⛾��=���np�ۻ��H�s�����`d:�� �-`1$��oL��к�,�\�U�d� ��t]sچ�PJ�"Qub��|��2KBv�%Z�Pk��ε���,�f Ţ���1.r�h���z���0�Y��?o1ðOy�k�Zin_oߌ�}觷��7�����X��䤨��٬ΡiI>�S�y"�1*u���JƨR�,m����� �p�W�J�?����Z�91 D�LބF��ª��(3�x1��| ��V�JѷX�.J��Ll��H j \d �7>��Y��{w���~�����/r�mHF���Wdջ��*�{�����7mڤ�Z>�+�C��ɋ�;��7g#6}CH�-r.FVU���o�歪�An0�_ӄ� k���aM?Yݼ�<�m�s�ښ��K�e�>|���?�>QTξ��O�О^�zC\�/�}����c1��iS�B�`f���|A��4�3�8{{��tk�瞳v�ƞ�^�*��?08q���AN��{ζm��[�\��{��81@&�K%c�ȓ��Yg�۱sw��n��isfw���ޟJ&���p�l` 7I�z��П���{?�U�(}B)P=[�Q+�%4QPa ���ߝ��w�'>{��]�H$�c>=�T����`�����;�W��ߣkZP@���!�T}�a���r�Kl�̱�>eD�|ꜙ�lB 7���Ü}i���̹��W �|�(<���F2ԟyߍ-��2W~�e���շ/?��e��e�Y�O�hM��l��I���:a�֝3�N:��w�9��ˋ�V(-��Ӧ�0�� ���|� �s���;�t ��~��\ݍ7⚏}�7/|�M ���|�g|�}��۰��k����k�6�Z�M��.��O\w���;�y������e�ҥ�bT!9��*"x~ƀ<`�D|�g �߳,LgU�W�P�5�x���}�0B�8"<���߾�{6m��W.���P]�)���C���0i��A(��#��+�b��j��� ��B�C��@!g y�@��>~���E�>ZE�u��"2]�]�|�k�w ���fk*����s�� }��W���?��L��w���#��9p@�Tf/�CC��w�왋���o�0�i�D��ys��:�ۮ��j>��3�]|�y7^�}���wV�:���̾��+^X��-���ox� `Ā~*c�l��Ej.BE�J��L�łJ�W��V�����ҐJG�D\�ֲo|�ߞ}�eMS����}�1Y�Q7/��X�Ї�|�j�!!K ɛ&`$�&R�0�%D��F>� �^X,���P �����X��X:�ع�k��]g�:�R��R�-��%�qm���M�24 R� UPo���-��~tõ�������{�����u��+���<�{���?����8'�Lp�tѲv��������6mݞN����T�T8*&(���Fpch�c'�7�k4PwH�ZbM摴B�F�4X� ��j����SϾ��!���D������'?�e&�K�[��ZcH���eʤ �����Ac,f�X�A��f �|C�l�x8���e=t<Cƈ��0� шa<����j:&Ҩ�LU�����6B�oy CO�&�Z�qݖ��>;�+h�����S&N�<�h�ek6:� �\��]���?��_N�8�]��o�}�.��E~��Sw����}�w<��S��]q�8��G)moo{�Յ'�8�%��q�P��[���x�i�r3��_���/~~��e���dKjT-��o��̚F�Ȩ�;��B T!�K' O*A�j�#�ZZ@E��0$�U-��H^�/t)�Yn-�!�����U�]���+W�v�����+%��d�uu�b�,��d۳2 @��t&�Ԫ�2iB�d,�k�!����[�j݇���B�����8&[c��E��u�h�~�k��o<�u���w(;�$�ݽ9u��Ϡ�)�dr����fwo�%�d�l.�+^z�m��=��yΰ��i�֮_�be6�_�n�i�����͛ji��o~�{�'�{^����{���O=���'e>��n1600x�o�������g�����<���)���˻{{�_O ��j�xD�/=D���(ز�B�@�C�R���lC����&AEҐ#!�Xr.�?OU���HQJ@�� s¦��� ��3B���Sp]�7o���8Kh���4k��N�\����@ D�~�#����4~ G�P�b:r�q}�+�{/�!i��u�1e�*b$8���0v��xK��_�T;� E�l�y�N���=���G�v�%%��5Eq��*�M� ��ap^Y��*~]���k�]]?���-�����_}�^L��^�8�H��|��������DKj�]o.^�Wlii�^�aْeDU�D�9q; ~Bh�9��89r x(?����}�7��EqJ���B����<����B��|��;�G��k�(�a�+���7!,2C2�g5�8�n�ա�0�&ғ�1Ґa,�;��@��j1eY���B `誣�k�F$ 2Cל�w}W���4������e��R�?�Z�c2�pW��дd¥%5Oxc� �s�5�K$%c�Oic�(�+���@` �����r�9s��+�؟u��]K�pD@�ѢE5�(9%B�Ϡ`����a�?m@��,b�y2�~m��4�by8�� 7� �3=D&�ͧ4A� s��i�<�·?I�����,�F�̝W��hb��(q3�8<�s5@��,�����r@�� g�"� ����`&i����� @��X���S꺫3f��A}��r�w���)����)�| Y�F�$�E��0��7���*���S�ڗF�a=&2b�՝+`����_H�0r����ª_g<(C3y�@eG(Ӥ�yA�O�(1}#`@<ȿ*.���B��E������$���D. ���b�q=���!d���6�>��˾�=���V�;�SX��ו����S���� P5ETN�Ү�"b����Z�YP���ɠcDe�C[��5�d��|&�`v�T@!+W.Ȑ�7��B�D^�+��gf\d���հ*j�ؗ`u��E�WMl���o;���=�Xp-`/F�f.�3���G^�%t��ڲF��F@��ֳ�R�7Xf ��lU4)�بV*z�~5��e�4Q(���b��30�" �$��p��PQQ��E�2�BZV��x +�D�^p 0`��� �zval�<-�K��dV��|GP9��t>�%��0CY@|_Da���7�Jc��� 58�@D���t�~�v �zrbщ�Jd(>!5�4�[��o��^��@�@�$�����8�%5a��w �c�ʍ_B���S�D�)�.�_����*�����CyMе����� M^�@_�(�MGG�?��5{D��cd�H|� `&��8%U���@0Ca��E�N�s�u��US��9���F��˷"���c������A���G��3��i#�DgU��T�F`�Z)'#��Nl��%��,Xz0�NZ����Y�D� �)�ȇph���3L��#=5fe�ϟ?��c�m7Q� h���:_���~e���Y��i���"z�1�I}ݼ#�粋��݈!���#�}s��e3Z��wEg��;�ro;(+�(,ۓy���VC!� "d*^(A� �e���P��zg鲄�$��UWc$B�" A�l�>p�C�v�d��?[|eS_o�XS��-��Ś r$��� ;e���z �rJ���[z�-r����A� �f"�"�ھ=k2��U����f,Ԛ�f��\�PK�����-^��X�,� Z�B_y�C}��V6�#�������]CD�p,X>��P��%��2,��у�ϛV�Zٻ���V|~9��^H*k"I�@tZޭyxu���~Co�����g�~�.�ڿh��K:X��[�^�=t�������[�Pj/��7���������}��V]! ��#�[��ºyװ2�E<����+s'b��"(� ����ٻ���s-ݫ}ABB�� x���i����8M�&�K��6��״=I�6I�ĉ��v��/xű�n�`����lf5 @ ЎmW�˛��ns�s�ϫ�H:����g�{�����K��������ᱹ� '���c��e�#��~��2�ymMeu-�� ��)�NI�1����+-;ˌS�ڮ#�ɀs���>��L<;(� 7��L���)gC�,$�_J����\s�c��=���aĜ�AW����^AE��jt~a���+��W��06�ne���j=(l>t����TQ��>}s�����-u��R�a��tl�h|n�N��FI5eƵ�̪��4�l��5�g�t�VWH�����7�07Mm�٬ryk���Eewg��>�knk��R�� �nR�ʪ�5�E7�y{��f�Hb�h����L(�+)nU�����X_ZV�"��`6a����B�nϺQ<_��~F���^_Ģ������A~��9M�I�ZfB~]����ɨ����PJM�����=b1�ؖѳ)Mު�}qg���� �]9}�/�#9��\�?&7#/�wY�6�J�C��3�'a&��~3kϩ�~�|�� M�*y�r��|�1W �-؝�!�I��� ��O�|m�`w���_�8)/?w���.d�7��>t��cgΝI�p1';�x�����̴���Ac[My�R�QJ/��LMO�/���)�9�-�5_~��������}_|�@,+�С��2��l�� 0&H��壿��HD'��S�8;;�̠�^/�'�4?+-���4���3�.gee�(��7���'��ܕl+JPpGQ~������Ww45�|��@Rz^M��$��^����u���O�Vv*�KI��=G���dr�^��V�lŠ����iyu ����K*�#�v��;mccc���k���_x�.?��畖OL:8��ы��q����ʹӉɧG��+���U��c�G�ut�]:y�|�4�'˻^���v�h�����/,*j�DP�A�y�bQ�W�/;v$>5-G*m;u�HZnAyQ�/kJk�����k�����w!5���&�G�]1�p&��*9t0�F�ݒ�R�Js�f�b�j����RRN����%�������#I'MVG��� �n�e�4�u�VRb|aIqg�49�ȕ������7:\PKSm�լ���c ���8ɱ8j6��+Mz��̳g����~��̙�����+�Jk���T�O�mi˾r>!1�Gk������5.��ՖVU]<�|�K��:��f~��Pgݍ�ځ�{e�WϟN�s�����T���F����;�ڛ��*�S�� n��{��|-;-�rq598@�.i���g/�A�Ey�_'T��=�|�����{-W/�O<~V��M��\z��FA^K�Ԕ�ζ��8w2��7長��~����AR������SgS�G����$��M`�Pj��L7wE�l M�~�^+5���ˍ���yc��|��D1Ƅ!'N�<N|fK��Cz4ֿ>�w����Wygu�i0�=���>Y/G$<�>��j'y'94�M�8Yr~�y�f#�tg��{�41�w�6LЌ��\H'��K3R����s�'�ag���e�x�?��IMK��.ި"%��o����ֳvI$bs�j�Ȏ� �qj1���h�����n\m�u����և�7�F��v��ɔ&;�jW�tqaYtr�`�+?|qۆ�����+�nȯ���\և�~ԉ�ߴm}�Aq9����n�AHf��ai��iF�����Cl�Q�ê������80:�O-((����{����b;�vl���Ԓ�f��t��6R��2��28���fE?W�� ���#8���Ã����Ƭ�jK 1:�����W��|�뒴L�vYdp�RŢ� � N��t5�����V���4&��u5�]0K;ܣ2�3RSF^���lP~��{P�eizQ��9����5�[�2T�va��B�vT�4qy���:P��J�Sg.�l1H�m��κ�ͯ�!��il���7d��W[�{2L%:{���a6���4(r��מ'� ��*�����c�X"����������W�T]�8�w�b�?��5&�+��s9��L���鶪+�jkh4�)jT� h ��w9 &b�Y ���6E��zBk_� v�O�6�tR�l�p�T�vQ &1��uH�n5I1���`����g��,xP�z�5��mzU��キ^̾t\� v��O ���Yt���j�p�N����;�/mۂ�aK�<�*���ꁙ�-�0ؓE��ьc�U5(���g�<b���靟�'��s������]]߮��,��4f�E۟[\����/���T���'(d>^f���٢�yy�B<��҇��^3�oF�̇ �a�ؓ٨�N�����9�0�˟K�M� ���:�/umN�w�\�(��'z�'� ��C�T��� �st�p��Кm7t�A���@L��'�I]���P�8u:�tjЪ�����6kV�Z��q�|ItLXn��f�684JLE�m2ĂPp�N�%pvinj���K,6���A�(J!�Jy7A�/^�~)���\�|9���y&�f��F1��Ȳ��ű1 2,.�̉D3#|M����'�V�la��P,�{�4CJ�z�`��|j��?hѺ�֬5KF�x21�H���nsZMvrn���'���м�l���~�I����O��A̒X�# <8\�������5�ʰ�,���VaK��٧�r�춠��6f#��܉��2�/Y)�_%�_��_dK8��oԪ`_���K��y\.�4<4ЧB����x����!�B|lD�ك��M:����h208� �X�㴏(�{\ Lgs�\&��F�"V�� 6aH$4 n�1�0 SPS��rӆ5=��Ϭ'�(����$�׳�J�Ђ� �8�8�xF,�� �IMMiՎJD" ND-_��Zq1�&�c��R �P;f��A���!�7�7�)���Q�98v9r�:z�<ʊ �]��̒x���X�2�#`���9BM:uʈ�}�l�I1�Xp���s��36���G�)�0i1��B��&X�(���W,��٫"bp�#@� ��κn�:�\���_�y/�⨵�m[������̦���go�3'\&,_���""Y\1l�;F4:_$��L&~�EF�8)5*��A8mJi�u�n3:�b �/�]aw���|c��`�ڞ���b����#p�?~i;h�WHdD`~����Ε��&|F�Eb�aX9��?]3>y���N '�HOֈ�O,t����B-��Em`:P�lEx�p�^)������3�¾�{�pkW�� ��Eʉ���o �3�k�Ot߇��:�;'r��pf��n��7k��Zbv�,�72@P`��o ��#��^�?~��&� ���=2 G�#�p���U�%U�����$�%�Co��2l�Ns�!�STJ%���-�����B���y��30ܓC�o�L���FEE�M&&˦��7,:}�����-ha��no�Tz���y�h�T⓿� b4n��w�/�l>�h��;�#��w\���o�N���ʛ������G8�0�@��@ON�}�����}4Zdh8��0��Z��C2�,Y� ��7 P̢� /�� =��~��?��B4:�����z��E��Em�˖�aV��O�(&s"0� �0%&ʉ,�R) �[>�՝�1���/��� ��!����"d��#�c��.bI�"ã��A���m+�F�_��Gq ��d�(�8|��M�� ]���8u��;l' ��7^����lq���Bp�|����(���"%��<6���~�j��� ]@"ߦ� #�tPg yC�o�d%J��ͤ�BI�W@��{j����&���D��M4P�2_$����P)�r��zs�֮����1}�#�G�-sQH%�w,Ԙ�>&Ly�������\��|��bo�b0� �đ�0ShR4�\�(�Kb2.ӌ��Wy�wv��28�Ghz?��ÂA���u{>^A�!�Ơ�ր�*6W���M?y��b扱ں �a��b�R� q������lB�'O������tZF������X�s{,��q/v�~��Q�F�h��J��uO�������J�і�X�`?�A�nl�M*�V��P~ ��Va��b��p�*_^��/���Im7z��"�(�[j��j� ~'���4$�AP�&D>���륁<t��M�%��G�%<р��n�3�B���s�� gq�:mxk"�ۦ�['v[a%�D2�$H��8�p��1���[Q�^�ʌ�x��v8�������,�b?�+1O�vhH��X5��n@Τ}g�L:���eL2�!����cr�8�@��c�@Q��t:&BZZZ\\�/����lf29�� ��а��6:��a�D���c"��aE��_���0!�ό|X���AB���d��l�?���Ɯ^|��6�E�XN�x�x�ѳ��.��P��6��r�m���{�ȁZ����;Õ�1Of�'�E��{ʧ��|�j�ԋ"E���K�v�踅��Ϗ�Y�ޑ��f���~ ����$88�/��-$T�@�)L�t�O���/D}`��:=sL�����_��婘���Y��p� ��'�#�W�̯���[~��P�Q�� ��a��/ؐ�㴖�#�x�q��DV�-��L��W�O�Ju� wW�a��C+�q����b����/?�ߪ>{�x,�S�J�����" ˔X�J�ɿ��0 {@O�1��j|���("800 'A2 |" $���db��o�5�:��C'x&��q���.��cP��j�}-C�bأ+?�R,�#�F��!B2�`�]B�6u�v���#ΰAO<�e�)�!4A�h4ғ'��>ý;{�[��^�#���f�tA8���u���6j��w�_�`=�`yrsB��W�H 8@%�x)|N2ol���a�T`dc���No ��_\(@�����J��i�}k�|�$�4=w�عA���{�]��<�yN��}��Y9�Meæ7ْ�m"�+`9@�(�������$@�/�c[ x�mS2�CK�BQÝ�/w��o�yr��NU�m�eH$��͝�~������9�!�e�QDd���E�HB�ƌg8D�Kc|��E�h[���r����c�9��������g%�rȡ띰BP���F��U�1wF �,�D��L��:lyn( �>(�ӧ�X+��n�L���r�� .p���2��n:Κ��dv����1�s����*Ne���ۈ��"*@��ϠX[��VK[bqw��;Q�>��8�`�`D���ɛ�;�<�y�H�B(�.�{����9����Ki %�W�Oa,}�F���h,Y��1^�P�@fS0�"^������g4P�;��D�`@�{ь��YŒ��S?.i�4r.��K�:��F�+�W�����[����B|��ڵ˻��k��RlS�}����-+���^��eDZ!)U�˺��0sk���.ɥ �9b@����53�� �s��|�H���L�x�����8�5+<�n���;�=�)ML�no��vPQMPN��mA�&]r�Ŏ���� ��A���m��MB�� �ti�wa3IP�L�c�i��!u�!o�)8-� ���|5�JAk1��L�@�\r(��AF���ɏ���MvFyfX��uyw'Gn2�n�|-� ]A��b���:�TH[q3P� �> ��ww�����SU��+��a�Go�lav�$%�#������|�t缺%� �� ��֭��g��R�ك��!]\\`*�W����K��c��|P���.˂�ܸq㥗���dj�����)A��&��B���e|J�H iX<��2��C�� �x�D(�d�����VH�����B G����Rl�5%� � s�ބ��Up���V�0k�:����1��0QN3;�:E�R��=��������b��l ɟ��j�D��Bȁ��A0B�H~L���mB��@���!P�dagRȬ��EPS��s�W�⚙FJ7?]�j��uA�����#�>��b�Yf�2�hGB��mZ[u��;<�RBc�E%�dP~��$�%�i�;9@߰��V@�;��~_���0螺����8�6DW-��c?���r�0㿝�h���>� IJ�T�{��'��?��R�S&��}����Jkǭ"�#�����#f[��E�HJ H���L�T�Ǵ���2�r=�Q#7I(�������Ô�����qh�{af�{�lNk�é��Ц�H�Od*&l�ל&:HA@I�22�x�N-з��W�U@�#3 ���hW~;Ή�8��D�6�͜G80/�t�*�,^$11i�r���O���!Z�Hv���b�ݙiG2u.�h�;��S �AZʇ�P��}m�7-՞���T� �Ȭ�(�m�Ŧ�P$�p����do8�2I&tUU)w��,j�E{����5�p�" �[�B~�3fK�QN-[����a0&ї- ��;Փ�4zX`�W. i�D�Gd�@p���yr��O(�=�l�������Q��M�c���{���thM�|b� Y���Jns �|?e�ȦF�Ēbp0H��c��(�.:���,vsk���W�v�U_I�()*&�71��q�����I��p��QU���|ڀ�@��C`�`UG��k<W��6��(�h"�!8����B&,L�&�� �:�,�����B~$4�MRtc8N�����c��1�rJ�����kB͑�r�B�I3���70<��l;�rE%D�K;��VŁE&����F���!� ����ĸ�� ˆ�E��QzX37��e�˚8�~2f&fZ�;@�hj��&���5���eNĻ���1�$��H\�L�\ ����<J{J)�A�P� Ш U� єrЁ Ip6��`L96�<Z�(�0rkW�IN�C;�<���`i�`X,F�U.PР�N焀A�;�D��bG�� ��:�E? ��y���$a%L� _�H��|��h�I$�1�L"�7K&�y{��D)����ߒ�L�&H�ȭ8ӽ�(R�MI�ֵ�^����R�?(��Z=`F���鮵il�"����!2~�?��-�5�l2Å�Pkm�A�$I(����C��CB�K��5@T��4��hZh���8��g�o�� �=C�@N;�^���a�22��l_w�N[�`�k���� �'��؉`��R*[cL���.��0l��L�s]`�f�Ux!I�� xx'��Ut� '*��"S�ĭi��#F�Y�����Nz��IM�F.�D_fT�6t�p�=�z�6!�(EW��[>�R#��;�*��K�D�z�-� P&c�<��}ޤ����E� P�x�����;,���ڑ-e����L�1�_�p���9�D���}����Z��` f��j��S$$D|� i����_{�c���E>r���ER���I.�B�O�f~�Z{�iY��>�����fq ��)�a�H���x9��d��c����^A ysJ�$ �2A=JP�#G���8�p�]B"��˨��9�u�qֶ懛{�p����꽯���� �q�C"�|�L��q�8� �z�a9\p��+p�C�k��&2�X� $�G@��wHR%�� ���Ƣ1İ� |�mU���]k)�13����q.�H��f��ؖ�8q��P�KkB��/�6B���;t�����g��)b�`�5� ╠%�4&;���;��\�|L���ͺ̢d��W�4��6�lr���(��r:U�<�,��ƛo���w?���_\�!��F����x��\�%����ݫ� ��.e9ܹ}��ß��g��;��^���s���ګ7�}����s/<����ݺ��믝��'�|�^��G(4�s�w� �Z�BB��tZn<���ҽBzД)(�:L$�X�b]�~�8�Ϫ〩�֜���,�<� )5�4 �@Q*��;8E��'�&�3�G�V1�?y���ty��bw�)�1��k��۳f��B����r�mBeh�(�)�h���|�ɪ(X[��Q��Z�5�����C�1���%XT\/����@�fWp�'�H���FA� y3�ֹ�Is�0�|��~�DF��i �2�<��g�$Qʓ�Lp(�bN��J��d6�6�zyp̕�"���B��*!$�R�+ C����Q��`9�i�W$��*�9JdO;�603�+lM�m/%i��fZ�Qsf�o~~P}x�$t�A`!$Ww��/�r���W����>w�o����_}���}�áొ���<y��7u����53���Y��w_Y��rx�����j:~������~��/���'?��{��Q�+�#�x��?����W��;_y���\����3O?���ů|��>�,�H}w�����b7�^o߾��{����_�^��./�;��իkV��"hҚ婥�osCg�Wu ~M�W�/���~(��=Y��@V� �ps�D�P��FA��1I���7�Ȣ�Og o�MH�x�� �g�ƢqJ KQM����r�#��s?4�lr �HFA��X;ä $,��/�A¯�!:ΌX��� l �?�C�ns��J9���� 8U� '�7�| Ǒ��)V�5��ȁ��?k|b|��L����+XζA����L��$� ɰ�c>K/ $)�H�>9�Zi��3 Q�� ��Գ�ˢ��rd�8�Qn�i낗Ly�q-єB����L���r�����<~��|+mK��w.�g�͐g �`�Yu}��߸V��'����o縞@=v ���=���?z����M�\\\���͋����s�����گ���W���?��.�]�ħ>����?�������O��/��?��3Ͻ�o���?����^���?���wo?��O����~�w�>��#��~�Wn����,��s���ws����7_}�_��Y0�ӫ���[���f{H�<�QY����%.`�3�)P�� ��O]UeN��/BB�Bp���(���P8�>9��d�S����EXi�n:�2���E�rt[�v��`�)F#���r®�&gb����".m�D��[ݤ�,�2 ��0a�X`%� P@ ��G�I�P�ND�W�̂'����n�FO@��������h��_i��u�=�q��$��Ѡ)��s �Q�b�o�jT��S�Q��� + Ҧ`m\�����(5կ;`)7k��?�~ Ξd1Ziq9��J�/;,EĹ���w^� �d�Rv� �)]�AN�l���:�,T�C�k��f���o�z�O�������&���*�Z�r:�$��v��{��w�{o9\���u��{w~�~���_�o��_~����hwX �;kY.�|��[��C����O��?�ٿ���ݺ�./~����K���W�\������?��}����(q��S=�ֻWW�֟����rq�߃���;?q�������]OF��w耵��h��$�N��������z`�4�Q�`�3Q�n!��"+��c��\ ���t��H��*A�� �ٿ¶��4l�>tɝt�IN�5�DM+�Qs�~�8'!��o��Lߘt�d0&��%�"�$p�b �R�i@��-z�a� �4�1<�� �X� U`�Wb�����gl���73e��+"G���&� I� y&�t9�dP#d��o�����)��9 �&p��G��*7,0�u����NDHbH�8)�{������B"�`���M !�h�@��܆�Kg+��gw��ם���k�Jq�X1��U�V�9���T�vx���O_����Ϟ{�� ܫ<>�����i�$_|�'�������9`�ֵ~��x�������o|���/��_��>��W�s/ 8,���C��{�g�b�b�i��Ȅ{�X���Bԫ��������O�i���'����s�~��n\�z)����.f;�k����( }' ��J5��FL&�.\d�-��5��E�q0�� � N#�wI�����S9"�ǩ�(����}�p��s����o�;V����<M�S�DM�����)����K���.0�Dd�5u�3�ìI�U@�B�\`&- ?P��J�ԙ�]�'����OD%�߿9���pkØR*�9o�Η�ʏ�R�=�t�W9�A�$K�I^G�����ې��R#�Kѭ�������Ϣ��.��q�e�6�\���N�L�\��hSը+h`f% ���Qcg��2vk��(}�Qpg��k�B�5����1 ܍�̸�?�*8�)�z��{u,u�إw��s/}�3?v�٧��!��ݣ�?6�����I#oݾ��;w�VI��f�L�U]����^}�f1>�����?��_��o<��GH�k}xD��Hx��W���W���=oVn�{/Cu�~� w?�ֻw��R �k���7_��֟t�b,F$�N�{�r��=N}�{��^���%`�D8��6�\5��wר`�-'���d��JP��nh�9A�N�&@[7��*Վ�Hq&I4 ��,���i[�U�ˌ���1���2qT���Ęw{�ݿPF�GZ�4�V�i�9�W��D�跷����ξ\��Ȗ{�R��Q+�+�#�B+�Uu�-@�W�C>�Z��w"�z�45bf:Ȇ)gt��8缧�2�5N���\ ��V�J5G߳�]-5��%��}[7Ri&̨�j``m���n��L��tPA#sK���/� �E�7U�D��;��k{{�Y3��lQ���_T�m�B�/i��=V^�e�%�E�Kt�;���?�������ا>���Ⱌ�����`�!�YW���wn�vw�Y~�6%�;����/��������?���?���(���#�������x|�w���{�=U��g>�����ڷ^YLk��G o�u�����G�ܽKY.K1�hT/��7�٤4�4�}�f���b6[� 5E��srQ �'\�Y�!(3 �\͊G䴃e��!3�V�������:#LRܾ���m�y� ��N~؏�:e��dJ|��k�a� �a�A�|ha����� ����xh�,̦` ss�"��h����Th i�Ԟ���r�]�Z�`i�,;�O�UXYOX p����X[�<6_� �_��J�`�q�JHXH�X"�Z�BJ��h� 3q�ȏ��Գ�_��b2�4иG�@��Ȓ4�C���6� %9 Z�;�+Ks��82ѓ&E�� ��Խ��(ذ��m�<�F`0>a_-�˥��4��v|l�{��B���D�����ܪ�����aHf���;��HX�˭�W��+_�¿�����?���̸ֺ�����{��;�����������N�ˋ���?uZ�r�Z�~��O~���tyyx4��̬|�����~��p�'��O|�/����_���/�~���~螅��Wws⡋_������{������7_�8,�Ƶ������i�Vwi��m!�TH�.ORJh�@�G��e��-���L�+l��b�J�ޤ���V� )��>��^�)��R��#��z�or쉥�����<��6z"&�[i2P��ۇ=7u��}����Ps�Ƽ'��ƹZ�y[����u������5�p KH� /ӕ�����9��E,`�u�-�X��`�f��Ⱦ ��(Gȅ+�Q�A&;RU��Bi m���I��FV�_#�9%\�G� Zh���TV`0�2Φt�lF����T~�����Y����+�+�6�ʜ���"�m��_R�Q�P)E��!���0��H^A�j��&� ���/3�ۏ�`�����y�Ոr�²@�i��i��>E�QGJy[ �#�1?"(�>��ݙ�[H^����+o}����?��{w�||�pu<}�;o�w늤%��~���i���|�� r�s�ʻ��^��Hv�/��W_�F)t�o\�|罫_�_}�ݥ�Ӻ~���O+�G �ڷ^��?�g�����ݛ7���~��wo]�{6k��f0�tt5xQ����D�����c4M�y�1�$���'8*T��kS)a��ɟ̀�-F@�h���\��b S����$�c8������GS�$k&�&�1��<'BJ�S���X��i������K<�K5p���(M��4[-8l�[H��]����E��"�\�"�.�� �P�d�*�|���� TAX3�Z;�䀡jQ9���8#~*l q�C� �8�f� :zO �Y G�)�к�C��W@1���X`����A��X�&K�]0jʎ�2|{��.��Nc��Ha�G35�GI:24�s�AG���4��뒫ޥ���&(�/��\P�=�>H�3y*O-Πɶ ��9��S:�٫V#L��R$��K_�w��Ux�B�ݣ#%e;�|�շ��0����?Hs���|�����������{|���C��W���{��� :��-f�,��}橐�C�=;��i5�Y����^ ���f�6�ޱ��`J�Z�]��1r���28�pF=�'&Κ��e��M�Թ�:�t�*�^�4|�x�T�{h�����}ِ�9�m^��,[���=��`�_ n�-")G9�̀���.��v�U���Q�Ҽx�p�:a*�,����w��H�Q�C�űY�V�����/� 8�B����x� cl �AUj��� �O~�b&�+T)�$&}�b�!~En}J��sYJS�"J0S��i�0��v6�љx} O �(�6N���n�$��mb~BQ� n�KIFV+���tz���A��[�<���R ��Bcl뢰���Pj�=���"ϣIs�1���aZg�9�;9� ���Dwͤ9\�� �8����.�{ZJٱ�y�/��R1w��!���U��xZ����%c1��`�y�@��,ԂvU7$!c�֦��� �w��Q�z@�,#E,��9c�J.{���c�Fr�ϯ�%����7%��ăƧ$5�;�n�f��:[�I��9�;&������f�ieB{��Y hC���� N�P@�xh|*���l�I$@�Q�g�4� 6ղ��F-D�8�)�tA�Pi�u�Z�$�B8�:�R.���� � DJ U�Z,ʀ�� G1R��u8�z��Rv72�2ɚu���8��frO��bPG�MIV� I��@�d ��L ��C��`����u�ɳB>|BIԙ��yICY '�$��j�� �r�.���M� z� �k�~�L_ ����6���K༠pw�r�`�q�C��- ��F�N�-%�.Pr��AQSw�m�Za�X�1t.�ў�Ph��h�L�c6$4���]5�����8!�q2�/@�"fH�l���x���@�a�� (�F�b3�<�:��� 2{����{8�3Ӧ4��^l|�wy���5�)3�B�i�c0S�n�R�B���d��8`9&`�4Y颎�H�00"x���#���&�<&Tp6�����r9@�jh�H�����h!�[Z��۾)�Y���#_c�W��Bz��}�>1�k�� y����+P|���6I^�;�F,&J�/#���T�ʲ$/6s�2�D ��� /�B��_&�)ц�I�F��}E�":�4;�a��9��8�<گr�s�����"�v��C= Ɗ�,<�A��1����(�#��j7ah�z�"�ߒ�Aq��E�d` �f3�tO\'��_C�AB�T#�0�D4��а���{��J>�c��I��w*1 rM�f+L�8��A���h^M�|A��Z|Dy�@ *�Ab�E�-�� �#�ϩ��$I�F�R���{���J�H�R��)Q\^WT�,)Llji[p1����X@���+u��X\f��~��`,� $�"��D�A�V�U�n� ����ڼN��\.�P�t��!�ݒ��onC)|��b^3��W� Ȋ�܋\�� #�,fӫ��VBLuR[_��*�8Se[����:�xc����^��� ���9�revE���P�~ �E���#�k���[�<���N�����Gn7��lK�r�F���\AN��?��J��7��Z�ʜ.O�+�p��Y�}�D��|%�&�48gT� � 7n�K�'��YB�����y���'>�� #u]�ql{DM;ׁA�N�����(�Ւ�6���Ԝ'x�B��c_���⎳E� 9n͌�ڤ���-�k��bg��ODt���`Eg9IYP�4�A��1[ͧ�@������,������H9��^u7쐭�H���4��%T�#:|mLpq�J9H��(be�#!Jk����J�P<X�A����F��S��GF�(��ȭpE�Ұv$�2Y� *d36�q�#g�^ ;D������ۑu�v��\cܡ�4�r����@B�L58{a�cV�%��y���C�6�w�i�p�=����˘!��,=�[�5I1���e�s�_��Ͼ��OԺN ����X� DN��0n�C��N�����+�A�V5��=�F��{�?g�������EЙ��H����� ���I��(� =�(���~�P���k��N�l�fBG�l�e}��U�KsV�d@ǩ�%j����T%At;N�I!�~���� S�%�k���'E�$8��Dj�C�� X��x p^��a��K��*�C�%��������0P��iu,0��a���D���r��U�"'�Cb�*��ҏ`&P�#,���U&��]�������t@T��ڏ*;�S�ZPJ�� ɢtaRҸL���:;,!qmPދ �h�EȔE�{<I�d�$eo��@ r٬����t��@R"�@tZd�ec�.u�(��G˜�W=���/+C�N)�$p2�PPW�*��/�; ����>�+�U>(�����=?��W�h�p��D+����wE�vkVg0� �bȭȗ45n �v�1�Ә�d�~8�� 1:w�T��&��f���aF����_8��Fq�hP��p*;�b`Zd�Y";a�\��m�V�������&,�+osG��#EF �� �X��UQ�����n�$�&�pzˬ �(9�-ۏW��뿇3��+q���ť�P'�`�4�I(F�9$�C<H*%�h4��ɡ�`�%�ʦ�w>��5�B��7A~X0�X�JS�����t�ݷ����P<��H�6�r� t=,0Ko�ְ&k�|�@@�b<y.���$|Zn�`N�N�BS�KR3�~�CF �}� Ϡ�����-��1$�@HI���� �cEߔ��N��aT��x]����4p�F#?!�Ѡ���}�^��i�D:�i"�i���5��q0��ӆ���s�$�.Q��I2�2 %��QN+Q�G@bF�Ԕ~<p&�n&���¹��&��i��q�NM�IF-z������L#y��TS�vĘ�)ÌL/�gJo�>"����Ԝ�LVC��n�W�F-v�*�a&X{�͢z3���`�,�fDOą�J�����!��"��NX3�*Q`���-���`��p��=(�)c�m��b[�$S�?��q�����x��1�c����D�>Q:�Q��$[?�N�4ي�.2> �-��o�x�ﭞ|�O=���ƈ 6E�$p��JBs\��i[:�!�q3a�|�}E�;��l��6�Dv�$��S��6E��B1� d����H'�a���."����� }�Lj���m�8�4A��3��we�S��O@�K�e'����4&��{�8xĒ'B���!����ܒ-\� .~VtSu�A����1RP�V �N'(:=>N�����ѷW�L~I�OK��MfnEuz��vs��,�E��cő�� 4�d��W�N�ԐG6p/e�F�E���k�@��@L����/2�.�� �� �E w�B,c6�e�ׅ�@�jX�Yi���U�H`=C���-Wom6\\C!VW1:`K��"ȃ�*���&>���0�'F�7� I H��7�"*��8�K[�A�+�h* ���p��Y�1���̃Vu>�̘��t��⇋bq�lk�k�[i�]�ՎZ���Z�]�G�/liaښ�F �eaG&�G��J0�b��i��*c� TV�H<�+�J�S��KcIJ�DK�6�3}c�;'1�S�9�=��t:�0'ĭ4q��ȆLjb����Z�A��$kKn�X")�z��?�^�r�E�9h�H,)�U�9�%Z`�f��yлh^0N\`�S|���]�Qgl�Yh�T�2�}�$��� ����)����ĝ;2�y'�L�dS�[P�g�be#z0c���d��%�T��)�^��9���Tf(g6-��F�a�O)�9S��a!8����X��b1xm�M�( xC�& &�r%���� lm�%�:��P�b��:(��XIQ^ ��*vV�SN������@S�����f4�JR2�`LXP3�2���1��ZbK��^Ik�OT:]sA~�I`H�� V�}��\�цЌ���Vq�")l S�. R�dD��9��)��p���5�����PT�YߧދB�AI�;�$v�a!�J��힚�451�����¼SY-7���6�LRP�H��S�z��2�x'�^&i����8���d�4�����F��,�q����8��snԛ�hbs{�&{���95'���Kkv&����8�;l;��`y��P��w�dMr�cZ���Ƚ��h��tH.S�#k� K��e@�E+Q$3�+D�-�T,4��!8]8H�az�?����C���� _�ExK�EpkLp!��*:���;wp��Y�gp��pA��:��С���I��U�Vڗ@e�ÚI��<��UIH5�bPM�bl�R�:A��Z0��W�c���٦oMq�JC_^[���;����P{*�D��Ŷ�L˚S 2�G��]ꅏ�!��BӜ&��r�����0f �4��j���hX� �f�1��߿_��� =���Qu����җ�4�(�$@a����yg}�������i�pt�ײ�^��E��/g�S��M7���D�V1Rȡۡ8@x���b�Y�<�Y^<C��������:Q��r�̑����7�d��6���6(�E��`b0��Z��X��rMv2��H�bF�+IzY�K�Ip6�R�pX ��S� 9��9@�� +E�,�X �S�{ �S-�sq�}�@��I�Z���C�E����t�9ŤQ�b��Z����c/O�o�6nw�6�$<�,)|d��֨TR�����%�+�6~�-m�*Gi��=L<�P��4��w�Tfj�9��D�y�_�B�2Ļpf�-f�y\�%�M��F+6�*H�,c�ѤOc�@�8UZ�C��q<ș|���0�f;�|R��O�λ~��� 8S��y��%%=V��~�r�ʙ����f�-��!(�U�H�䖾�o]�ۂ%�����X�c=�Y^̫z����� ��nJ��h�S����7W�H!�3/>��a������)&%���ci;� ���I�����r)Q�f����h�8K���A�pA������� 3`%��@����_n�^ \���L�#Q k�T�&���tsN�@���� ��-L�*�6��r��GS��;@Բ��!D�wĜ�� �X�()�?�?y%,�E+�,�GuHZ+�������>oN=��;$�z�jT@>��<�+����%�l����Z� %*q\�\�W�#`i����q�o����r?�^ņ0�P�Φޭpf>��s U����g�/�(��K�g��0�k)���+���e�)�ã��j�;�(51A��Dy|����q����ɅCpsA��(3��h�(�A�<Rm͔�&�I������휒���P��ҕNw�ػ> qu�s�\b?�S����&M��hdx��h̝�`h�3���$�,�'�Z���*�,4�&f��f1/��~j@�B8�#��X�agx`���q�K1�:���,���i(��F�^ rq�o�.`�m�ioM�2q�@�� ������䀰I�^[�2E�͚O�[� ��^m,u|��d��q���Y�!�vD��ʆ�����(�{^"4���!��U'�p��֟E�,���|��fKOp���82dA�rʑE1�K[�,��R[g���I�����.�E�(%i�h3R6q��o]� @�8�Sɨ�<[�m�[1�FO?���d�5���G�N!g�K���总���7_&hA �2�[o�4g��h�<�!����i@��ɯe��#���ynA)��TQ���_��#�_����y�9�ۍ)DT �C&fˣ4�1��c�gԨ����H��c�� `@�轌 pV��d&�ff��f8Vd�}d���F4x��RԚ5E��pGc�W�3np��n!0w�+ Й��+D�����y�㬋�\�Y��Z #$�rMc�4y���F�fR��)�5Y��r���J��,������<$[��(�Ha)kS��a�*�1�=�$.�`��լ�]�-�rt�eg�$U@S��榶���_z%w��^6Uf��i���=�z�_š87X�]�h��ӆpҺ�hw�\���GrbM��Q���s��Uz|��\� J���Ѡ>�t�hOJ��&k`�G̹@f�3�@\�s��]�^q�F�~�D0wr��Z����� �b~ĢN!7�l;9��S�1z���,�T�$�r�U��n�<cUR�:a�ٴJ�E�_����$9,0j0�0ky���{ƈ��8�Ь�%�_��5ؒ�*\k��s�}��ҫ�~ؒ,ɲe�@6�f�� 4�π�q7A��!�����g~0�DGLL3t�=�C���n��*˒�GI*I��[��s��̽�����ܙg繷J���x���>�ع3Of~{=��U=h�H{�� ƿ�D`Ї���x�i��]��J�??I���:�v!����5����O%"�T��*�9���h�/�2˧`���I��o�Of-��S�:� (�P�h���CX~�����P>� �v��;�`»d�'������@81XX���]�u Vq�@f�e@Bȑ�O`�i ����C� 9^����B.`��h��x8��&�9y0ґ���)L��,����˛�Fg��6��G�wT����� (��߽N���B�$�n�f�;%�(�Bz���(V�%�`}�u�J�u#hCM�۳u8��~f�hi[���<���n]�:��t��no�BQ��!d�5k�D軱&e & ��*5b������[>�����W����N"WE����c*��ډ4�a%=$�1I������~���v�@�փ��֢��}=] P=:F$->�(6�=w��41���U��."*0c�rS��Z[W��[����\֧HGV�(��=��"&N08��S}4cБ�D��@8רU�d[�[���Y1�Y�Qxd%�EuyvV(Ү� ��!�EC�n[�1��.�<����B>q|�$��il�,��+�t���@@}����R@���M�e�d�>�N�s4�7�������Hf�|5�EQD{�N�D�&��@t�E�tB��1�!����-@�A��������58�Y�_�%G���G �g��?F7M3$ C�uV�EI�r�ͅo���u���!��Tt�� ��)�wɺ�N�d34=<pV�L�ac�ۓy{`du�Q����'�iP���m0A�M%Щ���p��l�DO�r��w���H;�GW�+H��5�</�ːO�?6��k��B���_�����@�M|�b�o�)�55���J$���mp�Ks6�ȅ����3�iƵ³o��E���R ��V�[O�{#!ࣙ���$�����r���۲��|`_���6,��R��f�3~U=��$�H�xG����WPF[�$I�TD�(E�@$�s� �08I�Ka��,��`Y�>��R���q�u�(������������s$"�M:�߿�ik�u 8�� c��XU���3�c�/�����M×3+�Q��0�+�Ql����j��&˷�[��P����J^{���g?����"���Wm���#��{B@Bo>5R3;7�3ϸ���H�|�x �|����2b_S�@��e��/�E���b�(ʘ^��SEx�'#�1�͢(� ��Ƴ�����k;�_��n.QhB�5'W�Xę�p�_�(v���Ba�`{�}���z�T�"�i�L��aeZe�4�����^uWh�e ��.C�s�xZ�cg���0�;��P�b���^�ď��q��s���F:/Y^��`�C�=�{����bN�uU�X_3˗ ����%F��\:=i<��uI�Ԝ�����pr��K��z��l��x����z�M7��o�����1���������[O� �lm; ���9��>�vr�n��i�E�eٕ�x�(u�,��Y��f�>�TvСu�0�Ї>t�ȑ/|����IwDP��`�� nJ�&����[�� E���nUT-FD���M�1Ҹ� ���4=]Ql���`+J�Si�0;�R�.H�}��V���P4 �@lq#��r�|,2�WC�(p�"d�tq����̆r��D�je�$A?���U��HL�(�`��5/~8�~��0���� QB`��@��d�<�%���� �z�N��!�`��B��o�7����a& ��c� �f=2I�D� @(2Z(���Xϔ'ؙ��+B9�����G9�C9w�i��CUal��;�^��5j������3�f�|�%�Ŏ:�D���y^[���hf�'< ������w�L�R��twr�*�i��x�!���Ǣ=�9<pȩ�1ǾPC �$�B�T��UY����@�Q�1�i�|�/���N_��"-E��7�x��Ç��#)`y�����(���1VJ����W~�DJ��x��n�o�ey�33\�0s���������̡�AFc�m��7:��oٵk� 7�p���?�Q�o=p`۴������<�֎Iy�"����/H���X�s� ��cE%�JF�� G՟�V �Q��Q�:�����nX��*�35jC� y�F���;S�0O��朌��f2�2�?��%�"��$�d��{�B晁հhs��ܼT�o���:4����-�:�A`��K@�E����z;�N �W8S���B�~P=�ǐ}��u�� RaA�c��� �DC�P�Xq�����H���d l��څ�%�6`4$��p��)�E��F&�,˅����վ1`: F� �7����ąm$捏 ��˸�n���d��Yxz�,O��pQV/O�*^&�����x�u�vÃ�FjI� 2�X����/�ö�i�~3<��ځ� ��7R�e��:-{�G>�S?JD������l��ڌ2��ɪ/��(H��8�xGF�8&&V�$�(���<�,y=+������+!x����ͩ�'��(S&�8 #��������x��O��y[�k�" ��"'D;%����bJ�����*�ݽs�M ZN�:t"f�4c&�:� �nb�QB��4�Ac74�N5Q�Ǧ�q�������pm �H@Y�!��S�� �&z��(=��B�|`��)��rp�Q<�K�]�0g�|e��I���JD ��#7�K�[axvvz0�����>Z�̺�t�7(�jj�C�C�B6�8�u[���N�Aqق�\u�l�KT� &ӻ�����ȅ3@�DUܱ�$f,��sh�Y�O�6-�c��H���@r��Khf.\�q�3����,�~��۫�25��sڦ���� t�o��G����e��<�}%��k����0�2m����� ]��.�<�2cL�/h1��D�UdrJl�i{�fl����$�c�n��;�z� �EQBx �eo�Ӎ�1��LLy]������މH���,�(!#����`�h�|%,�zJL�ɷ�u�³�67�bz�%P�؉���m �� �GY�$��9��kQ�51^1H��ȇ42�����|��鵼��=p�$��8!9�2�,xxƖต%�݃S����ǥ &�M�z"�"b֧K/C�!>�ԓ!��Z�fa�C��� ����y� H()q��ȱ���x@��~X��?B��5�kJ=����>��t��|M����!>:����TK�/�g��@�����`q��2�D�+^�*���E ����D�<��I#�p��o�o���Zt9��vie9}���է�ɬ�\:�s%U�@��Z�4vc�ؤ�������M6���i\[MO�G���=2�x*���-�K��3�_� 2��jy�w{�~I�Pq���`�����cZ�v��|oqí�L�@���]^�x�,�kx�ec�v{D�M���Od��E���N6W�K(j�yJ�F���`����JhL١d�U���\�����ui�ޘ��x��V^ b�[Fϼ(�&����/�/(:�� �(w,6S�&�iFx�ƸJ���(V7�ͼ�frAQ���<�x4�x� �2Q�I���JC�z�VDU���*u¹����� �����z���6L���þ�R���w�F���/`5.H�Kdu�h0#�_L�����Ԝ��_��3)�g#��k��0"�?Mg�ɇ��ic\��v.<AԆ�����WK$�id���y7�V���>�(�8�t'�������������B�0��4_?�8[.Å�y�h!@a�/�_{��0X-qU(� ��]JAD�p!����K^���{�'{�%�����hj��]ٝ�m����=�- �s���n�����U;�<"R�29|LJifz��(�ę�s����P��G�)=�>�����/�N�ȵ��+78��kq���z��8+c��ˀ�D#$��6�[�R &��kLn����Υ��/<�EV������{������혱�s{�l[m����x�f�c�.���گ����x^z�Cx����:�^�ꡈ����c0���6�*���r�jk��$I����ŅO�i�����U��+.�"�`�v� �h�m�B�bV>�p,Q��V`@�L�ޛ|b�<��. G�D���#��{(��*1��dC�����{C!��1�@ۏ�,<���7�ut��k��}��>�C���KƢ��M�+�?ų������-/�/]��*�Lς8�@1�LG`D��-�b�+xPzs�{?^�|��S0��"�DCv���鎽�ʍ��_�9�t[�e���3p�_�?�%3J'���I��$���!`�\ ����V0�`�6}h���e��oͰ�$p6#��P��ZDY�Q��h�?��6d�J }�yDLdDu,8�wϝ��݃�������Y_�ry��@I�͈;8P\�2�n��2�L��`(���swf���'��OK�S��3��ʹ(�--�0���!��i�g*������t&Pz� �=}rx���H+�T���CI}湯�I�y�Me��co�� !�������8bKU�Z�w��n��6�X��5=������t:�,��m`W[��>���_��=��靕�vn���s-��%��&i������(����N�*s�ZͶy��z�$1�Z@l���$��h�����q$��a�nC�w�A���4ɧb>��j�O�n�#��������c�YH�C8�&TK���t��"�R�%lB� ��ه�`3��عp�)�G�ڦFf����;�>��}��>#:�� �M�vYI���;��Q��:����Ge��'�Їh���9�{H�1V�{��ˠ3�S��H��M���ɧg�)�N�#���Oǽ��Z<���O1(g���X"k �C�g�h���ʮO�Z3�=�\��AV����}�|�]�I�ų�p<���Yoe={�Ý��y�;my��E'|�X������iHK���� �Փ��l�ԫ��ߖ��n9xu%�D]$XX�`ϞG�����rDj�H#�I;�.n�����2|LJzg_�� ��K �A�z6��Z�jk�f � �~���i�c�co)n��|p��y�rĘ�����ѣ�����M��-N?������"ʪ7����j�$Ƙ��ME��|���?===???�A �w�u�W��3gδ9�s�n��)뚊�W�5�.����V�\`TrJ��������'_�`�f_$:d�H���rad��#��a�&O�*��]��I�� %�V�2��4���n}81�x�B��H��9Qҵ�� H�C�K��,8�<_�t�y�hw���˰�f G�BFH���! Ͽ`��7�3�{����@�����K00�&'�� {�����C�}��a3>�:�JE����2ݛ^�ы���!t258"�)$���5һ1!C $�"�KU}HD�ad%���* ����wϽ��bF�F"�LByA�w��~�Xna�Z���7o�y�;2�/�(�9�Έ�Am*�n6$5M�=���#33�8`�g�6į,�!�yv�� ��"��|v!��!�d �D��W^��n�u�^�ZP9�&�b�iTc�)����H�Anae�{�an���[ �9,o���,���*����N"D�&e�N��g����7 �;�sff�/��/766b��~�ϟ?ۮ�De�9b��;�낳�;� ���K��1{�n�Qh}�֣�Ip���*�j0���L���!�+B�2��Ѷ7b��B�md�_�Թ3�$�t%�W�d�؎�����TD\�D �M5�Qb�U���H�ʍzTR�q�6��o+�j���A�Q IFeo�J� ���<Ǣ��7��0��!�$`A��15�Ȁ�7�� VZ=��Sq���6��r���C�M�&L~z>cB.ۘ.�]7�S��A� ��I������e�ӊ�ĩw����`g�,�W��|�-���`Ro�W���3*8�OV��ޝ>�M���ـ�w��9�%L)A�LR����",/��# ����-U]�k�n��~ ���IFj4 ϱ2�Hh�,��htn!��uS�@'pF���s��k�6L�ȑ�F�j�ٸ����}4�5��� ���o�n'=w�v�1*�q9�0���e�|�ëED��H1�lé���R�U���'N����n�Tsc+tQi�3G����MҖb�">R������7�]ƹ��Y����|��qh���&�Xp�6����N�fR���rr!��ؚ~^���x�w��IUו�s(!B3�� ;u9л�辀�ǘ,���>�ҷ�I1��3H��9��(NNM�!�4|�'�A����A1F�I7NR"v���LՕ$I�)����Xyp �~ d&��Vg�PTq����O} �����I,SY��`9��qI���R$���(�"�`�Y�P�� � ��e��c&[JD�rF�x�$ P�%Q��3�j�}�&&Vt��v�p��V�3')���5@��t(�U+�|�/0��2Ph3�����.��ګ�����<؋���kYD2����Wj���E:}�ͤwvW���,��{�X�ڶPA��*�1�h��D��%ꮖ W�n��������e���kF���*"����;�}�wH���L�r~bO��R#=jMg����uq%��Ǒ#�Lɴs�_S��UmM�ĂPe��u��x�a��H 6A�o@q�lH�%�lP<f6��ǰ\��~%�xw�٪���`����a% Cd� l���r�%i�?��(z��$���:U Rh�B�y�;|����.���Y�[�"``�8b��;'�Ǐ�Hݘ����� ��v`r�.]�� ��>����� �&A$�XH3A � �P˃y-3�\^�����!cX���,t�!�i�*<.ҾC�� L��G�x��S`�O�9�(�Q}�30�^F(ؑ@�*!�`��(�Q��l�jK�"kҨ���S5յo �f:��!;#�_��0�+�uט��[�h��_rM�)&AW���m�N6( ���c`��6'T�UXl`���}��ի�V��{�+ͽ�T9��(1�������J$Е4w��:�,J�ܯx���0Xυ==Psx5<����U^!].`��viz����I��#�3� L6�AȀ���%���*��(�RB�|���;7;���p��p��� ����#8��S_�l�QI��_�drv�O()���ds@�'�ПPdv�Y_�J�vU�e� �"*0��*���t�EOf��:'�'fc-��}铟W��qZ1A`���ti�A�w���\����$1WP[Q��/�v����VE�ɧ?��ǔ̵K�ݸ� 3�e���|�c>o6&��ļ,�����9�"��Ƌ�F���Mr' ���7�Ƙ����J��}�J��%*��$���CJ�p�C��`{���L@!����y�E��Bm_�`�C��v4;�]x[.q��p%�b�F��W�g�B�T[��e�=�IH큤�o��$#��u�ԑx�2Mϲ��ZQ���XWa#�W�櫚�إQ�1 $�d0�Q2i��[F-|0,- V�,)�'<�P��.�@T�U������t2Fg*�"� @w�)��9J�j�yn��<J�%�#3�����*$�G��ӻ@P!�٢����o5�_A�����B�7=��ރ�M<:�~�c��褧���1���h8�讄��(Mr�UE��l;v=�q�LV�Ϋ��KlW�a�(4ֈ��Fwݮ��������C�73�֓*��8�������Y��������L�!;*�m���I��*��!���O̱���O$$�h3�9���;Α���8xҟ� Z�&�W �0pȸN��K��!l�!1 ŧ��K%aJ�o�v�%�ʀ���z:��Gn8c��ص{4�8 �6n$ "@q��h��X'�B���^q�$�Y k������YTALHT@�� �0 ��l�8��A$a+�K��b �@5�z�����L����6��w}?~i�υ�xw���u8u�O����`�:pا�'@�Y�G�@g�B�t\�zω�K��ٟ(u`hF\�le��]�UI ��R�h+�Ĉ�〚�H��hz�.��eE��b<��x�}w��P��᫈��w3 4�� ��w� R��h({��y�(��ݮ������eS��a�v�x�6)P"�O3��J���܆Ӗ(�2��+"E�'G=I]�����2ưkc�y���TͦX= DU����F���HT`v� ��%��$V���z��0���!S�tʤ�qL�&��ثIR418�.m�@�����`�>�?>�Ԁ@L�J��@fd���q�0'�{E,GnrZsekE�j�"�����b��4q�&�v���鳛?�����o�m�}ri����p��=;�7���v+��8b=�YC�y��( ����#��@)�BĎ~���\:�n�&�2���>�`�y�k���P���q;y��wTG�N���+=�1�J�V5Y�ZKN��$: � e~p���I�aeh+��&5ދL�����M�Jp`]�(� �>�u�cw��o����l�Pv h�a[����(q�\��_8V�[���G����{� �W��[��� ����Z���S v��m,^*�TU*@� �mD������1,��y�}b!�$������?OD ����Ȋ�0�B&W��܀�i��\ �!�jvk'+�� h$�P&d�~���-7n�o;ǿ�e����?۔�C��wzU���# X��6¹H� @���e}A��1� ��ȥ3�����[��7�k��f���������D�t�F���� ���[C���XF�gH�v],K�G�@�;�(Q�v��4����/�#9}��K/�4�{���?\�(�xL�� pW�M*bwV'�\\�:�z��j�0�Z����5���o��K��b<}���bs�kQ05V�[�M�S����^����!�CF��Ѣf:Ћ�@�ވ(�;�T�*/�!ɘ$�QF�� Bb� (l��xpf͵�,�4�m��I�� �^-�YXi�����$<�6DŽnȎ�������Ќ�H�/�tGwѹ����bk 9�`c�O @Օ�@E�E��>ǻv���|���'�k�L��x�̟b��M���V��f�"���b��1��,��Xt��F���>�oy ��-fc#��4u�� 6ૠ�M5u�O�Y�Fp���h���$�\�Cԙ���f�X��2+�Y�gӑ�7(PqԬD����-�܀����ɳ�>{��~��{��@��}K���>����,`��� �M)"�͟�� �XA�s� �l'��(�j/1)a�����_ �[U�f:�{ꄀ��ڡk�7�Px%�p4L�d���Ѱa���&�n�UQ|l:��*�կ�����p7r��w�'�]�zB˖��1�4��� @�ͪ� �M �,"`�q�υ������.*y�E�/lLJ��35��+ �8B��&�9�IЈ wvnc��Z7 ���X�G��r��?'@�T���#t#(�v9����@R�&a� ����K�vz&{��Çߑ�6�>�n\�A7�_��9N{t�-A�!��F&�"�n'A��e�Q�4r����,�i��������B.|%K >�젭�2��x�h�cn�(�6?"$�0�i���5��)/,3��pWL�����vl�^�#nF�"`��AD%�mYp������<ϡ&_�җ�|�ɲ�8AĊ����vXV�ڷo_I�;77��+���\�ߗ��y��n[�g�TFQ�Q߬�(���DWi��,��d�!k���h�[����؍DjL(ĺ]8d�����e_�7�Fu��u�@%��'�N�@ք���b4�tM��~!P�/�V�1ҙA�ZqY��P��N#0����� �=�0��r"�!�0`���b%�[��ZX:����bI&��NN`�G�^B��h(�1�2��SQY�"{��xq�/�3=�i��w�e@�?�u��>!��6y����^sELدb�xl_vQ��romY�Sv����?k��ŗ�G�%���i9�8��(!آ��pY�i1�'#�TUޤ2e[Y_�lЪ�fw=l���/)�2#L�¹V �Z�7 ��}{[�x��8-Ʒјm.�7�B����x�7�6��ݻw�.�K�.\�8�8�w�L��dõ+%�<hU˚�_{�R�=t��{��aY�����l+�8�&�JI�K�-q�l$IR�Ϟ=۬�%�&��D�,��̬��� ��N�c7A��j���Fq� �ynX��U�9�f��x����P7v�A� +mb�P��RόnV�V�$DJ�I���+�&��h��h���D��xp�?F�TP�{�/J��a�L�d�<�z5v���`���/`����T����6�C���\�9 "��� ���w-�- �3���@���vg9�� ����kw��Q5��>o�,� �;If&�Nbf!݆� (�6S�p} �� ��]��X��u���� �H��4/�I���v�s�3��}s)+����o�a�W�&/=e.�!h�Ǟ�\w�u�����/η�]�|�(Y w?:Ր�ź�;|t:8�+�?���*OIl�H�F�����W�ˍD�v��8'ǟ�����T�n� �O�ZV/��Xǀfy}X�>K�9z�h�(m6�T��H�炱%�y���&! �+5{b�7m�ɁJ�-���*�"���\�Z�Q���INj1�Y���fW�D><�V7�t��@�+���Ӽg0N���=I�oZ��%�BW�o�`�k��؎��I�n�@Ѥ�"��I|b��Vtע��R:BF����DYwaJ��(�bE��2����³#lq}ѹ���9����jRB�F-�‹��q��� �-g�Dj�_��饯2q�Qq�tmqZ�`&��� ��5-XvʧC_�ِ�7��\n0�@���Y'X�R\skr��WS��X��ݪD��07��+�ED),�mu��#7%�u�Ey�TT`� ���G�`����_�>��ݛ��}��C�/�%�W�i�\{3Xu{�T�p�SY�����-�f�����8�>���h��~b4)��2�9�N��d����t!J�jk��������H50bﴊ�`qe}mm�����c�i1v��ڦ�*���p�/у�U�Z�_Ej_�p�G~ڟ��������Z� ���z��K��mm��K��4<��3�������\{�=`aie��:��7>��fz�H�H"��F�IV��u`2i��&�Қ;̳R QM3�G�9��z��x�a�c^gi\�� L]�J�6 ��'G�^W|�o@A��>XAV�ƀ����}�5HpZ#��dk 9 �Z�,,�\ПbQ�j*$ p�_����Y�)&�9��P���U|�3�/~�=�&m9�3���*Y�o�ʜ��[�4E �C���}m�`m(� 3��*6�r(<����1��/��L��l��-Fr��!��k�]�m�W���������%C0��|��z��p}�~��Waj.�� W��˹p�Է��oyky�-E>��O�f0߄?��v��Έ'ě�9b?��=-��8d��\�8��HI`��f*3�I� !@+,K�ť�����0"����3l�Bf�D��jn;�����>��;��F�����O?��;��"*>f���Y�X}��$I]���*�f����-�d�?��& j F�W^���xL�M���� ID��a�RlH�dݱ�G��y��+*�os^Ғ�ߚ�/�#��*��xؕ�݇gy `�ց��*e]���RP�ֳ��[�y�5�m X1�-���nQ��Io<yd��0X�DP���#.������7G�Z��0�;Y<�]5�e� �G��~"Q2p��D��},Um��z�*tှN͕�LA�1Xl��B�`-_s-<k�2���i�{����h(�*�r��Ó6qfJ���%��y�2vg!MЧ�Ԡ�-@a6kKӛ�û��y��Zk�3#�T!�?k�L� �aL��8�G���S9��ڽ)@B��4�pP�A�`؏ ���P�'�}��b����h�Ӯ�a�CL�����P�lx�R�+uESq1,A���+�A�:n�(R7I��c"o�-K�,���)���`qW,D�$I W/^<~�8|WȻ�.c�����Kk`���qeu��dЌ�$I"~�}cĪ� �ǝ���)Yt��w[��6u5K^���X�z|�I�n��HM㘪�?�����w�: {b_��Bi<��-�~+s���w-r\8�����C���i5EpŞ�HΙW��C��;+9`�!�qڏa��]��`A��8e��}��#���N�����߾g�L��K[hݪ�ron�@���&Xȝ^�Y�EtA� ���r���(V��?�/�M2��(�e�&��x��E��� �XH"��t�[U {�F3X.��P�<��/>�ݞ��~!R� ��$���&��' i�ul�A&i�n�n0���iA ��K����!κc�B�x��a9��zhpc�j�L�5���씅XKX�������j�w-��#���.t���k�%ؔ����~��/1�Z���H�H[���FP�Ǿ1u���#�JP��^�R�֖0��ч�R2t��҂]�s�y�O�٥<����=KKK'_;�:D�@����Z�l�dp�O��F���Ɔm$�Tpٹ(K�[� �1�-`��7��Ŧ�^�I�^mą�� P��bc���h[Ix���w����M㓉�;K->Kۡ�e�b�M/�=tc�|�m�'�iAcA�n��B=Q���)ބ��,Ux���AwD��H�� �G����Y�QҠI������^מ\�����^+�l�{ �8(��k_�k�[����Ғ$�����˅CA�6��<����ic��t�f���7���6�q�¤W9���L�����g�J1�/|�n{��4���g�Hu��6�Ax V��� sb�6\��y\8���Yj`�L��W`�>!R-�X$d ]��{"6���B�I��KI�ar?�WCQb0��|'���,�%/�]:{��]w�я~�`�*��kr�ش�������,d�L��(�l�%���x��2 �ffq���W�o�U�\*�e��w G���;v쩧�z�ųؙ!��"H��A��s@F)9��V���Ec�8`�Ωn�t!���hJ��!3 ��E �"v���X�7�l3J����pပ��\�ޛy�*[�x�Y��,F�g��ѨH���w�$Í�83�Mnӧ�s��N�ٰ��6�g��g�%�^hzv�"CfHRwhB[!z�Q��@ l7ЙN�{4y�� ]��u���@w�\r�������c�3�,+�z3���VG��`��e+��h�bN D�t�f��J/=�~��v��b-���n�Ѷ��fdzWy�GJT=��ؔ�/�u�Bb�/,6�on�$��n��,�R���볧O���ה�U������\��$0y��̟B�ve�׃"w��,�Gؙ$��Ḣp���7�g+�l���t{0�nk�15iO�%!����)��MD�����"&D��;�G�7���kH�8�I"�o3�0�o<��u�=�����|�'�xZ���� cT�oX�}+�^e�0�-�4���z�:"�;w�3������o}kI�?t�!�c<Hi��QZEQ��?���w�1���D����W�}j��ʭ�ɶ�{�|�_[Yc"(�0c8��FBYDj����`??�0��*�*�p�9<$�@u�ʄ&����{�%YI�ZLtIYq<���S��V=����c.����iI�}fwQ#��a�n��qWj�({�mf� R����`�P߆�B-��R�qs���HP�<��$8 �r��00�%91� ���/�A��9Ճ�\�A�|�8�w��7s֪�G~�3 �����c"��� Z�R�EA3�¬7�S_�w���@�_��C�F'(lV��m��~��Z�f���\{�k�"(�_�3/�-&�Kq����Ӂ���ۅYο+� ��6��d�<t=t�( �X��Y8��g�E��J+ȴV*�#�������x%�h����`؇�u8|Nό� M�K�_8����8�X�h,Ť��+�����@t��?���ܜ#��i0���ѥ�9D�kcׂ4zlmhTSj|EQ͋�N�+O��}����~��S���&��.m$�O�O9�W�H'<K�� �a�cjk�g_����H�;���;�,Sqz�^��zv�$˲���2t���.1���c�X�/�=���8CZn �A�����`%����G"O�$�� $�`'s��*J�I\�ٛ��`�DT7�&�"�B �n�Z��.�:i ��F}��W�VJ�G��L)�<�t�Z�zs5�&z<#n�q��¹-M7M!ICQ�� �]+tO;�mo�yA@5m�`@t$@�לP��a�_�����X�W ���Z����p�G�e?�s���@���N�Wa0���sv�Ý}7��0����?(WŖg��~��UV4d(t辠Y., �_t��� CX.�h^Pl�Z�/^z����E�B��7�%}�v�^� �|fw��� �ٖ����Hg} ���}����yh���[k�fJ�ny��H���ȇ�=����6G�bb��I�ij�=�Vi�Ϸ����%������C�2�˫߆�9H�z�J>�-�l���_NDpn��Zcڃ��h{�!�(�PȑCi�5�Gȃ��� ��1IH���&}���Gy�����O��5Z�b'�D�_� �%�aբ�_�C�4AwR6� 9e~�F_Zk}K��l�w��iП����g���ϟ�d�uI"�)�i�#v�h<d�=O\���F�`�l�W%a�e}�*�˺2�Qנ?�D3�8XI�G�+,(�R} �^�p�65ҫ��dG����#��qj4��C�k�m�����V��=|�vϝ@]%�C�&oQ�!QJg1���H}KD����q�@�U�@�%����=��]�]��?R�,1����$�a�8��_nLJüexff���->q[���`�D� [Q[4�⎇Ӌ/X���F����I��v���o 6k��7�f����%hH-�am���+{�)Z<��7D���{z����\�� /n��&�ý��&�I�5�h"����gWn��lsk�1��y�W�rvr�vc课��F���$c��M%���u`j��@r+�nB��.h���%m�t(�Pg毟x��;� &��j�=y�$�)O ۹l�talV1����Z����"r�A[�N�7���U���g���&͐���qw�*%=4�h�(ƈAb�A ���h=W6O�TŸ��{ZԆ) [��a�}#&�h��H �Q�3d�6+H �*�%>V�I3)�(�-3ؙ�I>��Y���.���Qh��4>��"٬E"�XMfiEu>l���@�p���%в�6�)���N��0���짎�_L�נW�(E`x�p�%\��{���ý>s��?X}���В�v�u�.�N�`A�"'����^Jps^�=�D�AX�H�� ����G�����e]�p�����*�����F���s�ӧ��!�Q.}7ߝ,]�&�* �wL֖�ܗ>�wW�:�r�fv)��IS�2�z�]��kғ��~��pT���ӂq��\yऱW̭",M;ld��9O�5z+�~��v�>��<X��o�֧>�)�@��#�QS�;ָ�5P�yt0 ����5;��/J��d����/�RIU�1�?��7_[1�{�%@jxm&l�D���� ҐQ>S4^%=P�Y�� �m*��L�6����<���<KA�)�݂�ir�SZG/@2� �@��UVXEB��u.q�� ��mB�.m�}�梖�eI��w�h��d6.�H`M,"�`O��0��V�>C��˞)u96�Ȕ�w���]L��s.�j�Y��#s� ��ɿ������a��TD�̬Z/5���~1����e��F�R��Jf�Yѥ! ��>���x�Ԗ��ג�=��� z&G햸�yy��#ɋO�/3@��*���������VT]r��|:+�������"�,��7`q��]o�9����(���⭊,x�F>�V.]�,S��=��]zM��˗6��ý�V��+��;��ޖ\�9nn@wj���֗a�a%����#6J̆9G�Q�WZ����"����lA`:Ϝ]����zɛ{�����o����ʯ��ۺ;8D �l灓�"�Ҙ���d�(Y(j��ߓ2����/\��'��g_~�L�s��DK��e1�$�F�U�ը�'F�I*����,�HH��7p"(�;y�Wl�W�0�Du�w��F�³� � ��j�QO��5f��ܱ�t,��Y�ި���N�z��HP��o3^u��,�4$��wfw=�;s�6�j Yh0�%w.�L�"#*�x��B���e t,0R��n"@u($KP�����Ο̗�h�V{`˥l�i��>v]�Lk5��aCF�V sH�d�������T/{��~�Oh�Qca�f 0����FJ�K�G�AP,�ͦ^{~xݱ� �v�����ow�Q�7�����Bz� U��AF�LW�;�������e�sm��c��ew�3���ΜPoM_6A;�]8��Ї�'�h.���|Oq�=��!ԏ����;������o;��4���d�ԩg%I�o{�����R\w;�̙�:^!@ H-1A��탱���+�qAߦz����r��s����}%M�|���;��k��k"P�o(�ƺb�;@����mȡ�N�~��=)���4��O�����f�)L@?��Շ�Dc/akLCl�H�ji�ړ�F�����,q�rp�LF����"c4nR3���x�[����J����㑴����٭�u^�V���*i�^s,��A3�O��&�"��Q�y� K���S���z:�~����n1�Q�5�:0V8� �#^�%`$� ��A�b�_��W�om&_~,9������n��:�u��]f�K�!w�)�bv �� ������c��?n^}�QEq)��^��4��νF�����U�H[E!tϿj�S��/Y��~!9� n��d��c�ܜ���7�νL��2���6�Ș��7D0���粹�������sf�:�'�N#��7����Toy�r}�BI ���H�-SNn>�ť���ߢ���ej.����;���ԩocQ�pis��pv��\x-=�4�.LR�큣�uw`o�;��qyV��L�<���3_��x��ȱ��{̰�����2��0�Y���_�)U^��N�8}V�F{j|�%��)���/>�8/aI���������Q�/I`|R�7c����a]xA�\:���{RZ/�9�O��O��V��>���A�hФ���ȐuT�Flr0�$L��J��/��4��8]���&eim+�L��G�f����E}��"�a�ب���*�:X���C�n8Pd�npZ4����&|�.�t��NJ����E+�����5I��{?�=�{�9X��:�R>��I(�c$�1�\���#v�A$��&&J��,�Lz=H�L &�n ݔLƈAH�� 8�� 0Pב�'�K�,=��"y^=�D'�����i�i��LqG'@g�� ��r�Po-���2gX���0�<�����]�.���T���q000L���8d�V��b�� �����f�A|EFϝ'�WU��ٞvn/�-/8�B,��h���+�<�;Y_�\:E���f�V ����N>�E �L���ݶ7m.��|hV.5a�W��dz�^��\�W�<CAip����0��NH��D!6�f�����"�W�|R�K�f 餗/&+� q�S��p��ZIR\Y4+Pd�蕴[B)$�鯔���;�Q��?<rs ����j�2=I��\J�R6�������!L�|���7��I�S�ՠ�4\�Mi�&b�Hbsϲ�p!���K��{~��.�w�,��?���˒R�,ߓ~�ٹLz.������?�;�ѡ���I)�$E2��] D���1�)�7a�m�gjw�z�����K� �l�(�!" ��'"AU]kd&�J� ��iԹ��WZ'C)�� ���7o�� ��vjN:����6sl���h���OA�����h�&P"hՊ�J���m@�IL"&���V#��ţ��vGH�6�z;:H@� R����$@I� &(�bpAL��������`%�e`�|�kq�R�g4t�O��l��B��;�<�C�8`y��W=xX�GSF�dPX�6x a�B��ա;�%D��fK�B�f�A��Ƞ�(�5T�_F��[�gq�w'*zSav�J䠏EF���9EF ���F�O)"p���ձ"�pg��]�L�Y[�l�����oO� b��pwFL ����1R6��m½Yۛ���͌Ő���^Q��D6��ʫCfcƯ�^5�};��W�_8���b�9[���������̑��?������"��<���?�3?Sz ��x�����闞Y�Sd:�$h:H�OξfВ>�T�阠0��@�c+u`Dh����2FD�=UVSC�Dy$�r��C�!5���U�z�u�q�1F�.�w��φPX»%y��'�]� ����T���w�&����B�%H�h�q���&�"( �p��uܩ���t3�`�tRb֚ZC��XB�ס!��&��!)�S�J��<���_�O�$�*:뷵@�%`a��3����r���W�-H���Q��QeF6x�'�8��ARl�Ƃ��F$�RR�������-�ۈD�l.��X���B��� ����� �(9����ˣ���V$`��kۨٚ����0�`Z�8T�e4X/��.��W��yF\.�P[�t�fi-�����0��XQi��խ�ZH��������O]����oY��7�7?��O~�_|��G�{�9e��ǒ�I�$��~����}�C%�1�ԩS'N�����8��� 9mG b��l�"��Y�E��R���b��#Z�f�P={7LE��,)�������X�ւ�[�~���nC��ъ�N�BD�����}s2�6,���//��P���c' y,w����z����=���[YE#C�'�CA�� �Ҧ�����_�C��[E �Be(�ZW�э���Vh��#�:�-8 �s�%(0`����P@� ��0����,�00;&�Gn3@"c8WlHuB���c��E-myT�[ �:%�����$��B �jN;Ū��P�mݜ�����C� w4j��]R�����f�Tor�I� �Qo��ܜ�/����+���h��8QT8B�MF��zP�$ʰ��0�bď�m��,�+��~�66æ�����X�c�zw4:3�͝\)�տ�ϼ��;�z�m���:~���g�gϞ=[�ԗ��e�Vi�~3����JG�7�X�7��e���<�%{����/-�D2�)0X×z�ndٶ���N\gC�m��q�W�Y�~*=�X$5���(�AD�y�o�J��)������@~m��z��n&���υ����7��[�b�IG�G>�z]i�'I�PUҧ��J���q���f���ͭX�1`�� '�0h�/9PC�qƂ -FB0.ꤰl�L�4e`X�E� L:�T5���7���zL�7����X� �:$v �u�Œe��`k�� ��v�ʑu�fQ-E֭O>O�+W���D���觕�*�?7 ���-�^U��-�5�k�Wcr�h�MQ�{��O2��T�q�4�>��$ʳG�q��g� �x�&�⇜��Lmn2vD �1 �_4ѡb�3�2���T\��/���scN ��X�o�.*���+O������Co���[�����W����"��Wcz"�x�l]�;^ձt���1q���hl���gW8ɲlss������W_;u�ٓ�O��_��R���G_2��͒�� �sNy��$,�!(��"�S���&��b����z3`{�kq8���� H��!/C����0C�4<LqU��E B�Ҟ��u�mE�,�&f[�Q�zr�UնɧGWS~ mm0��ؒU�,D�F)�fv��Z���R�ܙ�Sw8!r��!�YE��N�قR�!q����w�N������C� DK�e`�'�}��CJ�����fo~��A ��A��ڰP@0�\�(t��ȃ��x`B$q�G�f��7*�ܕ+WWGF�C�(AsտP)�bsQi^�hoB��J1�|���r��D"fӰ�� �4~Q�&�`[�c��+��X� c��^���2q���&�!FՊ-�@�Tn��O��q�?�{��#{o��С�{���;33�:n�)�S�����A��9V<Ν%��G���줿9��������œg/�^�ȩG�4u ���������[v5i��֊�o�α��9oS����0bbK ۧ{����Z �ʻ��[�����K�QN����G�i�|}��9����1�����)?���[Ӭn�2��dG������ANB��9f���:��m��~�5}�(s������qM�Zt�UWN�}er}D�$c��{ �F�b$n�;�@b�H`ED�PZ� �D\���؋ߔ����'�������}"�H��E*݉[� I ��V�x���n��]�`mB�y�����~�Sw"A [z��r�I�l�����H�bGA�4 �Hf�q�:H �ou�b�pH��Գ�2�Ryk�-ɷxH2��geb��b�5�2;�~j��6�Lk�3d. �7���0���)�&�~��4m�FJο��xW���� �D�C$�&���������������o����� � �~mR�|sn����g:��>�G��C<��yh.�>��w�����������-d,�B,r!��J��y��_���8Ts`J�Q��m`��qq��Nh��tx��/��v��ܮ������* Z$�U��������і} �f� �d�ۦ�J`��.(��hp ;7��J� nƵ�IQ�F^+D�6.`/\���&���%i��k�[��Bn�{A�R��H|"��eD`o@��"���.y�{��{c�>�D��}���H�YP�_���2�I�"��t��HF-�������d�V��%�"�&��Wph�� J��mG�B3$�� ����㟱o;1��� *���=K��o���I��ل a����m��}�A���?�ir���&���F(���4[�[A��dތPn�-%\/|����_o�~�:����6R��`C��G �5N#��a��=�+� K�P�X`���N��A:��'_��{H[�L�J���Ņ��K��`0�!o�A�`,�3�;ߠ߸��t�����<|^���@���� ���/���aRk��% K� e���Mi�Z"P�Q*d�h���b�ۄxJJ�(��LtKY T��Wr]���h�^\�ޟ5��ֱ̄H �7��Tn�?y��B?�".�M��&�E\�� @��� �b~ L�"�qG� By�]%R�PE��w"�V9W.�ۼ�;�MݸL�$6r�WT�=��.�imBE5��gSx2[�~��in���-#�g��ONz�'hַⴗ��d��Je�B�#��zkR��HI����8cⅨ:���t��3䜏�@kl��LC���������8����Q\fܞ�nj�ҤL7��M��³`H$� �$/D"7�6���v� ZO�;F�e���|��r\$)�*� �l� ���U�3]A"��!�Fy�i,�N��܀��7͎��e2Y�h�2N�1G� ��\�?�D,2�-�!�4�s�i�F��\�W�_�\�;� ��0U8�Vh@��+9���(�S4�CB�:Zn�u����4B�3{�YM�,����ɢ��,`,� �r�q�@0FvPo5�<| ˖uCC� ��z�Un�H1�}d�b�w�Fn1nl�(%6�H-������N��-�Hkc� ����B�"��)aW�g��!�<��)d�ީ}KlŁ�BfJ�� �چ��8�s�<[e5K��jd>��J�����u��)��2�9�b����[�!#�&��]Y����$g�d�i�/����£� ,�ϳ�$f�"'�0exx��u�oMJNL�l-�2�-TݹY��dY}hJ�n��"(�����"��V%�\d���`8|��P�S=9Q�M��/��~}�_U�Tf��;��,�Q;�Q�"�A�#N�` @�q�����e ^�>�WQ��g"�c��7�|�㩧����{����Lp��g&�~Y�͇ʶ�)zYIsD��}V�M�Z���[K�U'5>57�W�H{?��*�_H��\5G��[J�dPJ��@\@-����L�T$(p1 �0a �$� b�ZP �]/�pH�8f��*��2��D�yd�2�U��- �̶(�s罉}T�y��)�L�ȨC�@�S�K�3OFQl��&x�Z�Z�&��i<s$RE0��z�hf� -7R'�a<��R �!�4DA(BP��5(534�ڱW�TI��_&��rL֙�^jz���˗�~�cn<�+7�nj)�I=�$�T�+���]ƫLd���0����q/6ʫ�k*�_,�L���%��l�`=�v�KA x63�%���� �� �B`�\ ��^��&�ᔟ�j�)՚�����A�A�1�}�����v����e���4���͓R�]�����?,�t� ��=��j���X6��B�G6$u��zF@Tn!�Z��ï�w�9B�,`M\�)U.��[`�� A0��}WF�%�Xx�^�H���kA��̈́r1 �g>�}�o�\a+�;$1q���^Vy�>�np6QѬ�����,��r{0ȔuiH4�ܑT,���}�:!ߤ���e���zYv����EX�[��N� �d�$ ���XrI ;��V�+�%1�rJrXP�t1��<�>�-�N �36k����Y�_ߘo�7��>"BcI �~��_�(�Z �J$����� ����k;�h�^eYTl"#��E��x��H&C���"��3�Mq��ò����n+�M7���D�Ct?nQ[��r��{��+��ALh�)��L�^�)BaAw��Z��_Ϙ�N�궔����#bPCm�|�*��IBIfػ�0Y ��e��Q� Ee0������/%:W9�+N�L,�R���~�AIAHQŃ����"�>��V\�+������Z ֒��%rI��7�[��:cgdr�bb�:K���!��C��̍T�,�f�d�o(�e�dJN�A��~�>\|��EI¹p� /���gٞ(����s�$"��s+�� �k$b�zmq�,ղ�k�sM�`���&���t� ��T�y�+�ptVg�72s�<�Г!w��,���)�N.�[i1��L �A!5 Q�b���1�Q�rJ���� �m�@�fv�+��|0��"yU�V��'���Lav��)�@Xğ�����7p5�k'���v��Z�l�h3/Q���q�2��k�"� ���`��ES�<���ul�������p$��\)�-�y�Ls��+�vXE7��u������ �!���2[q-�-�� �؞ Īt=o�\Ă�܈Pg�����)p�#+�-,�&��dJ�F*ߛJ���H�|coHH �$�T ;��{SB&t#3����y۫�:0,Ȃ$�usSS��3�Bᒚ�G�glT`5�� $�&(n�]:���Ȕ���!���Drf��tf��ʻY��������{�&Β����HAJ}�O�DZ�^AF��ݎע�Q��se$D�Һu��fB >�i�-{�#��E�ȁ�\:D�>���N��2���0!�r������Ɏ��x1�� Kh�|�����<�$B��{^Q��@ �>�UGy��:��;�M#��3t3�X'��p.z���{H�s{\#L�gF�a��[B �F�̆��gs�0o�W&~gC�2#b{���ح��"�8$+�H�%'�[Ĕ�ǿ$�,�B�[K�b����m��])!ep.0��(X��-��$����B\q�f��u6 �.��7�"%$6�+���H!��ѷ.j�v潹��� l��-(��w�*�m� ��@�H�@���Fnh3e+,�2˭� �(�I���/'$ ��3���[�1�1͑�lB�<�A�JA��!��t=(��$R��6�N�އ�0�Y<@V����$R:>7�]��ԢM$�N��(2�<��)63��뀃�n�^l�X�PO��F̞��jve��H�L y!��G415��Q�%�հ�0 K�&nO�߰��Z횹n�滃ʙ�xP"qa} .)���Q�3���O�7�x1 }� H D[5fʲ���G�ް&g��B�*U>�� ۦ���d@2b�.��FBԴ.!����j�^a����,�]g�İ) ��]]�n�����T���!���������c��&e��o�f�F ����b�E�o����Ӳ$�q�DKń,�g;e�p��Fn���A �!(����!�����E�4�7!!�L�o�7� %�ʄ���G\ D�yMa-d*�:�&�o�N,a!z��a���,cB0f�x�[��wd�` � �H�=�G؞�&My���T0B��<C%�&�=A�Z�� ʔTl�jV�0�Z\>I�2g]A!-Tצ�^�+�tinj�(�/���{��zL��t�Vb8;ʮ�������祵Z�i��MR7��Co!7����gS�`��I�zC���pM�9%�3�0�s�y\f�_�?��������sɜi�������,���e�uHEv��������t+���0FS ���|�Ɣn�����C�تA�of}��:�KW�t��5�=v�ce��ZXw�!���Cd�e2p��I���,�!�H3� Q�S�R�����KP�g��Q���.��a���#k^�GNJ�J"-�3(��X����n�/bs�! ���_�X/m�~'��v ��L����{c(7�V&s��I���@@a)Q�"�քR+�d�l�<�Vn�����,�(���9�O1˓5�:l�/n���,�Cd�Y��X�:q:�Md�e��m=<I��c0{��ڕ<���дU��ipE�w2������˸vi����t��) ��!@���� I�}���-��4�����&>����L�꾏ε�`4y�9H~ڳ=�f�zVh��s��/ ) ��P-�SӾ9��}��6�E ƷөМ�����mo��$��ޡ�#��}ϱ�G1U%(��-��N�3h����>P]X�7y=��O���I� l���9�Q��v�u��)����� �RUs��ME�n��CvQ����8�><Чp���������q��V��@q!���M�)�[���$3/�S[cC��n�D�R{b 6��.Y�+�H�`� c���$��l�:����W�]��Ty����g���AR|ptx�Ȱ�_Yd0�C9�LK-i.��x��`���( �[F�C'�$F2?��P��};AMS��dOMII�c�˯|88Q�@�þ6�,E�$��EH�i�(;�i֖�� ���œ�Fޤ\����r谆Y������q ��2{b���f�2�{=����7�}x*7�Pʝ��ry���P<2���tѳT��ί��FO^��>�'���������.�����`�^��tƪ l|�#F�H�eO�@��J&H�Fs�`7gŹi �Y��q(��,�� "�<wh2���z��̭�7��[p��40e�A��/��$HR"�J����) nJ�ĵ�P%����>��of2���{k��7�}�zsCodE��D�Hd"����L`ko(yd�H* �D�e�e9E,~�%>�%��L��q!��ӳh���i;�#A�L�lӍ��8;��7�5)矑nS�7�7�VnH*���=Bt5<!���Y/ܜ�����r' ��u���H�͢b8/4�n��.�5�� ����e�IGB`0.�RM���`Ŵ�GzTh(���vЏ\�;��� �^+:=����`����axS<A��W�O��d��S��N�'4��y�Ph� O������ Y�����3D��������M�����r)�(�f�~�x*���[�ӷa�`�y�1�G��S�Ī4B^�Dӌ!pt�2�l C AFT�JcT�P�A��m�A F� p��v�}B�jO��'I�Dܪ$�R�����N�ea~��(��*�}��d ��a)�J�o�|wn�� �bLu'tS�y�����N��T�1�b�yׁ#�N� &D0ɔ� �,�+�GT[r~!�����!��f��ZP��#(ӂg�i]���]x�,hӡ��Q�[ @ R��}Q� �D���k{3[�bp?���jBQo�)X�t��%ʻW�zm:S��r����Nj��Gz�fwi?~�v��U�a���V�ӓ�2�� ���w:I��r���*ֶ`=G����CD!�ٽQ�^2�P�$�����K�j�F�U�i`�!�W]O[6�s��_<4�:����GD�*dƱ��ઑ���n��lg���-�����LA� f>'X h��@�fk�>t�r2z<lΛ��@�����vbPvB��O`�O�%�)Sϐrx����p�`̊��1�=�%S�e��X u��,Hm|I,��`��7��O��S�W�Z��+���EMHdjo*Q>��n(����nn��T�@��A2ӡ<�w������yF^�H������"wd5"=��bF��q|�oi�d�X�Q-���R똉�muM�w�_J�����c�����?�䭮�$=�r`� :�=mE�[7�c��V7;��@�A�� F�$�D$�`Zd�P��[A/M��WP�n���%ʼn��~.�]���5G �RXT�lݟ=���:��6h�lf���<I�eQ���EGReQ��т�VY��\g�l ���zGya��w)��p��u�H}6�LI�z�^������a��D1�q�Ր����-�{*�렻�#`�|��6t,��s��i�E^��ݛ��C_]k���F����(��|�x�7پbT�KB���UJG�m�$鄡�džR �*s<Q�P"��o~�2L��P�[�� !+��M�xy�1���J�]��7� 9�+* .N{�Dn��S��X{�n9Ɩ��"S���Q���̈<�AV�d���B�ꦚl�:c9L#d�/��f��=�ϲy�#u���*-0��;��Иݨ��<�:cE�+���!�DI�rn���d����j&����PJʈ�\���1ʃ�Z�qvj�6��t�:������f+�e��֖x .Q@X&\�(���8r���S��%�Ky(������� 3���w`����cD��xt�"�~��%��cT��֧+�!-���X�-�)�\P�Uh��/$V�D��XΚ�ׅ&�F�����D�q{�����Ҧ�)�<Rb�z����j�0V<(\�S�xe�Y�U���f��,�a8+����КvAd/��?(��;�D��`���p���*����$T{��iAl�Ŷfq�y��ڐ�7b!�ͨQ�D"ep!+�NnBy%I!��BT��c Iq#lR���<7������d�&rO�(գ���i���1���29"�r�h8S:Z�L4r;?APngF�������"I��q���Bv~�l6��`9K��-���ohHȏNhX����@������/�r�)��� [�Z�'37��H��G�L.y � �Kޔoh� �t��E��"����)'���}aW�� _P��Âx �G����r�]��(o{.��|���oR���P�빀z�aHf����6����7��Y�d.�$� LR��7�����B�.i*�پu�-���U�5�_Ŧ���Q���:-)�2���R�:���溸��}ZCrhJܕ�Pi)hHd�L���MldB^c[B{�b�U�[�uW�D�J)I�+�=T��'(b��������/�A��j�ʻߤI����P���8�V�5��)2Syw��g/M����Enr $Y�h�����_t��,@��M�UG@1��EPF�"fH�]h�C1�*FS��0-.d�<}x���o�v�F��ku��_�"�x�5�$V,^ d�ęZ;3�z�,��}!�<ߐ���=G������ ȸp���w t�/��>�/��*�6�4�b�_1�D���h�$J|���1��^ �1^�}L��A��6)�O���ǿ��+~�`�[]U�%�ݹ�$Յ�LB�(���>���z�d�E�\��-��n��Fz��U��3+2{�e�պ,"D"��)C@JE�����T�,L���D)4���c��o�M$ʙ��r^5�(iG"��~>XgS� k�$�r�B�H"�<y9�,�W*�3h�����p��e���؍���V�)�:��ɽ��l�d���_lǠ��~�0���3�� ����(���JI�d��{�1� ���{��Y[`=b�� }��t�Iu����C�pdJ%�A�̤˔Cr6��f�m>����y��n�Y2�%q�=϶����Nv�N��A���wfo��z�E�O��I��;�����?b}��u��mk-M�'�s�v��ݪ�n�߯ʨ�71�A�Ipί�;�C$�M*��3@i���������8�2P�?�4��:�b��I�44��p`qIt�����֯&N��rBӴ�Zi�2!�.X��E,1�?�sA��o���&b ���%�ʤn�l�Lme*��Iv�9@�L�N��i6f��V�]̝��9�^���M��R���[�YvT;�*EJ�R��{u/s�����弥!��I��E�#AY�HՐ.��gg��Db��h�+��� :.q��ϸ*�Y��=46B#�D���˦צ�I ���oLb�F�l��Ũu� �<���>�6Trh(5ħf0T]7�O�l�ٗ�m�9A�����}��;�@2�2ݠ�����tD��w�]~�3���!�&dQ&+��Ch #������R��һKjbJ� ,�a�3���M�3 �x.���M�(��~�>M��m���-��U�hQ|[f����s��o����!X� �u�D��.cB��Y��m�:/P�$l�6���ֈ��{�@�_G���_䒙���R^!���M�;��b`�(�*J��<�~RY��{�ԑ���F=��$l���Ռu4<h�k;1�6��>�ӕIH�}�?f��4�F$V���4!�2�! �lN�B�s�ֶ��ݕ�!�o�.֪Ԉ�6�3���p��OЭ�������g@�ɰZ���H@�9 �c��1h��DhFϝ�Y�t�+�kא�3�A3�e?��3u:݈��!��SrzVp��̑��c1.�o({���ש�t�}`�HV���p��i^���{X�8`� �q� ��!5�<����mh�Ŝ��/�:]���0DL2��e�H?��G7���S��ln'��%0��g�A�OyZ�T"b��L�ϫ?�k7�K�06i�jb8�ϞƦ��J��G�-�as���k�]�� d��d�t*����+�2)�d��>ՒL�A�3�.�F���g� ����<@ m�T���?�ձ4OR�9�zQF�J�[�G����rP�І�����Xu�k8]�ؕG`;�V 8��M���Q�t���qByO0G�qv��/��bߧ��>h�=,�Zղ<���h�|��`�o=Ш]��?�~��Lw����3�/�ē��� s�����;�KU�I�G����� �R��f�s�/�%D�uB�䮄�F6�M�$< ��=z˯��:M�ʊ��dd�N�?8�)���ܛ�!U�yז���=Q���z-�Ay��f���{�B�a��6ݔ���{�a+���T ��w��6+ ���:v�D�|ᓅN 5p|�gEO��)(&�'���ț˱�C�'N���@6l�q5��0�#IsiMcdT�Z��LI�i�I���u3&���fO��)�a�~�b�` ��JS��dX�j�:(B38��-7���KT:ݎ�[�K��1g����%�P����!����<�n<�e8[��&�J����O�j]�\9� �:$cyL¡F/�Ipa�.¿zw�_(��XPR�P�ju���眱fp�IEND�B`�PK���\��b��templates/protostar/index.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.protostar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $user = JFactory::getUser(); $this->language = $doc->language; $this->direction = $doc->direction; // Getting params from template $params = $app->getTemplate(true)->params; // Detecting Active Variables $option = $app->input->getCmd('option', ''); $view = $app->input->getCmd('view', ''); $layout = $app->input->getCmd('layout', ''); $task = $app->input->getCmd('task', ''); $itemid = $app->input->getCmd('Itemid', ''); $sitename = $app->get('sitename'); if($task == "edit" || $layout == "form" ) { $fullWidth = 1; } else { $fullWidth = 0; } // Add JavaScript Frameworks JHtml::_('bootstrap.framework'); $doc->addScript($this->baseurl . '/templates/' . $this->template . '/js/template.js'); // Add Stylesheets $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template.css'); // Load optional RTL Bootstrap CSS JHtml::_('bootstrap.loadCss', false, $this->direction); // Adjusting content width if ($this->countModules('position-7') && $this->countModules('position-8')) { $span = "span6"; } elseif ($this->countModules('position-7') && !$this->countModules('position-8')) { $span = "span9"; } elseif (!$this->countModules('position-7') && $this->countModules('position-8')) { $span = "span9"; } else { $span = "span12"; } // Logo file or site title param if ($this->params->get('logoFile')) { $logo = '<img src="' . JUri::root() . $this->params->get('logoFile') . '" alt="' . $sitename . '" />'; } elseif ($this->params->get('sitetitle')) { $logo = '<span class="site-title" title="' . $sitename . '">' . htmlspecialchars($this->params->get('sitetitle')) . '</span>'; } else { $logo = '<span class="site-title" title="' . $sitename . '">' . $sitename . '</span>'; } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <jdoc:include type="head" /> <?php // Use of Google Font ?> <?php if ($this->params->get('googleFont')) : ?> <link href='//fonts.googleapis.com/css?family=<?php echo $this->params->get('googleFontName'); ?>' rel='stylesheet' type='text/css' /> <style type="text/css"> h1,h2,h3,h4,h5,h6,.site-title{ font-family: '<?php echo str_replace('+', ' ', $this->params->get('googleFontName')); ?>', sans-serif; } </style> <?php endif; ?> <?php // Template color ?> <?php if ($this->params->get('templateColor')) : ?> <style type="text/css"> body.site { border-top: 3px solid <?php echo $this->params->get('templateColor'); ?>; background-color: <?php echo $this->params->get('templateBackgroundColor'); ?> } a { color: <?php echo $this->params->get('templateColor'); ?>; } .navbar-inner, .nav-list > .active > a, .nav-list > .active > a:hover, .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover, .nav-pills > .active > a, .nav-pills > .active > a:hover, .btn-primary { background: <?php echo $this->params->get('templateColor'); ?>; } .navbar-inner { -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2); -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2); box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2); } </style> <?php endif; ?> <!--[if lt IE 9]> <script src="<?php echo JUri::root(true); ?>/media/jui/js/html5.js"></script> <![endif]--> </head> <body class="site <?php echo $option . ' view-' . $view . ($layout ? ' layout-' . $layout : ' no-layout') . ($task ? ' task-' . $task : ' no-task') . ($itemid ? ' itemid-' . $itemid : '') . ($params->get('fluidContainer') ? ' fluid' : ''); echo ($this->direction == 'rtl' ? ' rtl' : ''); ?>"> <!-- Body --> <div class="body"> <div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>"> <!-- Header --> <header class="header" role="banner"> <div class="header-inner clearfix"> <a class="brand pull-left" href="<?php echo $this->baseurl; ?>/"> <?php echo $logo; ?> <?php if ($this->params->get('sitedescription')) : ?> <?php echo '<div class="site-description">' . htmlspecialchars($this->params->get('sitedescription')) . '</div>'; ?> <?php endif; ?> </a> <div class="header-search pull-right"> <jdoc:include type="modules" name="position-0" style="none" /> </div> </div> </header> <?php if ($this->countModules('position-1')) : ?> <nav class="navigation" role="navigation"> <div class="navbar pull-left"> <a class="btn btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> </div> <div class="nav-collapse"> <jdoc:include type="modules" name="position-1" style="none" /> </div> </nav> <?php endif; ?> <jdoc:include type="modules" name="banner" style="xhtml" /> <div class="row-fluid"> <?php if ($this->countModules('position-8')) : ?> <!-- Begin Sidebar --> <div id="sidebar" class="span3"> <div class="sidebar-nav"> <jdoc:include type="modules" name="position-8" style="xhtml" /> </div> </div> <!-- End Sidebar --> <?php endif; ?> <main id="content" role="main" class="<?php echo $span; ?>"> <!-- Begin Content --> <jdoc:include type="modules" name="position-3" style="xhtml" /> <jdoc:include type="message" /> <jdoc:include type="component" /> <jdoc:include type="modules" name="position-2" style="none" /> <!-- End Content --> </main> <?php if ($this->countModules('position-7')) : ?> <div id="aside" class="span3"> <!-- Begin Right Sidebar --> <jdoc:include type="modules" name="position-7" style="well" /> <!-- End Right Sidebar --> </div> <?php endif; ?> </div> </div> </div> <!-- Footer --> <footer class="footer" role="contentinfo"> <div class="container<?php echo ($params->get('fluidContainer') ? '-fluid' : ''); ?>"> <hr /> <jdoc:include type="modules" name="footer" style="none" /> <p class="pull-right"> <a href="#top" id="back-top"> <?php echo JText::_('TPL_PROTOSTAR_BACKTOTOP'); ?> </a> </p> <p> © <?php echo date('Y'); ?> <?php echo $sitename; ?> </p> </div> </footer> <jdoc:include type="modules" name="debug" style="none" /> </body> </html> PK���\" ����templates/protostar/favicon.iconu�[����PNG IHDR�asRGB��� pHYs��$iTXtXML:com.adobe.xmp<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/"> <tiff:ResolutionUnit>2</tiff:ResolutionUnit> <tiff:Compression>5</tiff:Compression> <tiff:XResolution>72</tiff:XResolution> <tiff:Orientation>1</tiff:Orientation> <tiff:YResolution>72</tiff:YResolution> <exif:PixelXDimension>16</exif:PixelXDimension> <exif:ColorSpace>1</exif:ColorSpace> <exif:PixelYDimension>16</exif:PixelYDimension> <dc:subject> <rdf:Seq/> </dc:subject> <xmp:ModifyDate>2015:03:15 13:03:46</xmp:ModifyDate> <xmp:CreatorTool>Pixelmator 3.3.1</xmp:CreatorTool> </rdf:Description> </rdf:RDF> </x:xmpmeta> >Iv]XIDAT8}�]h\E�ϙ�{wﺻI]m�XClK4�RE�w-E��(->�f|)y�~(Z�"ȢA�R�h�Z�B46M��-$ӆ6&-k41����c�xn��S��\����s��g;^��t}�Pc{���յ�� �uQ��{VJ�5"I"�:�����X���7���O))����:L;�j8�lQ�P ��%!��럒|2��qye��4��m�m<3�@�!��$�+c粒���J�ۤ-S�R��Hk�A8$��k��� )��[�O�/�ov,�6�˔�}�O0|� ��n�����N�ҀF�{Ӂ�{ǽLK�)��{�|�G�� ʭ�"W���?��X-����Y�W�~Rn�2�˰o.� x�*S߇�Kê: �4`DF�oԝ.(Y�&pKq��ѵX�n���9�bbn��|��cc�N��ݛZĴ�&��ܖۑ�t�B���Trj]ޱ*�Sxqd�w?�� p�|���n�)3^E8Y��⑷g"rU`Wn�A�O�5���?�H�lpY[��Q8��+��]��r�q�oޱe��t����j Z�G�O\}�����r���7�wَ�C����V6t�b70j�#Ū�!��_WH+��R����F&/������Ϗ��j.9W���xZA!�/�W> `[�X;���GP���w6�V���R�{4w�e��WD�0�Α�h�������Lȣ��%J�Л��z����=i ZϰŠ��Q����^"���O:58՛�k��~h���l`M��ǽS�qV1DZ���m���hb��w�yu�K����o��;�������DS(IEND�B`�PK���\%���>templates/protostar/language/en-GB/en-GB.tpl_protostar.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 TPL_PROTOSTAR_POSITION_BANNER="Banner" TPL_PROTOSTAR_POSITION_DEBUG="Debug" TPL_PROTOSTAR_POSITION_POSITION-0="Search" TPL_PROTOSTAR_POSITION_POSITION-10="Unused" TPL_PROTOSTAR_POSITION_POSITION-11="Unused" TPL_PROTOSTAR_POSITION_POSITION-12="Unused" TPL_PROTOSTAR_POSITION_POSITION-13="Unused" TPL_PROTOSTAR_POSITION_POSITION-14="Unused" TPL_PROTOSTAR_POSITION_POSITION-15="Unused" TPL_PROTOSTAR_POSITION_POSITION-1="Navigation" TPL_PROTOSTAR_POSITION_POSITION-2="Breadcrumbs" TPL_PROTOSTAR_POSITION_POSITION-3="Top center" TPL_PROTOSTAR_POSITION_POSITION-4="Unused" TPL_PROTOSTAR_POSITION_POSITION-5="Unused" TPL_PROTOSTAR_POSITION_POSITION-6="Unused" TPL_PROTOSTAR_POSITION_POSITION-7="Right" TPL_PROTOSTAR_POSITION_POSITION-8="Left" TPL_PROTOSTAR_POSITION_POSITION-9="Unused" TPL_PROTOSTAR_POSITION_FOOTER="Footer" TPL_PROTOSTAR_XML_DESCRIPTION="Continuing the space theme (Solarflare from 1.0 and Milkyway from 1.5), Protostar is the Joomla 3 site template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." PK���\goށ�:templates/protostar/language/en-GB/en-GB.tpl_protostar.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 TPL_PROTOSTAR_XML_DESCRIPTION="Continuing the space theme (Solarflare from 1.0 and Milkyway from 1.5), Protostar is the Joomla 3 site template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." TPL_PROTOSTAR_BACKGROUND_COLOR_DESC="Choose a background colour for static layouts. If left blank the Default (#f4f6f7) is used." TPL_PROTOSTAR_BACKGROUND_COLOR_LABEL="Background Colour" TPL_PROTOSTAR_BACKTOTOP="Back to Top" TPL_PROTOSTAR_COLOR_DESC="Choose an overall colour for the site template. If left blank the Default (#0088cc) is used." TPL_PROTOSTAR_COLOR_LABEL="Template Colour" TPL_PROTOSTAR_FLUID="Fluid" TPL_PROTOSTAR_FLUID_LABEL="Fluid Layout" TPL_PROTOSTAR_FLUID_DESC="Use Bootstrap's fluid or static container (both are responsive)." TPL_PROTOSTAR_FONT_LABEL="Google Font for Headings" TPL_PROTOSTAR_FONT_DESC="Load a Google font for the headings (H1, H2, H3, etc)." TPL_PROTOSTAR_FONT_NAME_LABEL="Google Font Name" TPL_PROTOSTAR_FONT_NAME_DESC="Example: Open+Sans or Source+Sans+Pro." TPL_PROTOSTAR_LOGO_LABEL="Logo" TPL_PROTOSTAR_LOGO_DESC="Select or upload a custom logo for the site template." TPL_PROTOSTAR_STATIC="Static" PK���\a�?"?"6templates/protostar/img/glyphicons-halflings-white.pngnu�[����PNG IHDR���ӳ{�PLTE���������������mmm�����������������������������������������������������ⰰ���������������������������������������ᒒ�������������ttt��������������������bbb�������������������������������������������������������eeeggg������������������������������xxx�����������������������������������������������������������Ƽ�������������������������������������������������������������������������������������������������������������������������������������������������������몪����������������֢���������UUU������������������������������������������������������������������鿿���������������rO��tRNS���#�_ /�����oS��?��C� kD���OS_������6��>4!~a�@1�_'o�n�ҋ���M���3�BQj��p&%!l��"Xqr;�� A[�<`�am}4�3/0I��PCM!6(*gK&YQ�GDP,�`�{VP�-�x�)h�7�e1]��W��$��1�b�zSܕcO��]����U;Zi<N#�) 86pV��:h�#�0Z�Q�JN��EDT��~��^#IDATx^읇#Ǚ��b' 4A$Ah� )�p�3�<M�F9Y9X��,�r�i��ھ��|�s��t9�s��X� k��jv�@�l_��I��*~h��>�'y�"�������؆�K64�Y�*.v�@���c.};��tN%�DI���� !Z�Џ5L�H�2�6 ��ɯ��"��-b�E,,)�ʏ� B���>m����n��6pm�R�O wm@���V�#?�'C�ȑZ#��q���b��|$�:�)��/E�%��nR�q�C�hn��%�i�̓�����}l�m ?i�d�d�"�,���`�H�"r.z�����~��(b�Q�U&��)�5��X#�����EM���R<�*p[�[%.�O�̣��k7�lIo�������J�F��lV!̡ăuH�`��������&�,�z��Rk$���|$�l���Xb�����jߪ�dU��?Σ$H���W��$U�'���H�E3*խ����U\}��(� �zhVk}g�u�Rk$��%�|�T�|��ck�獳"��D���_W+����.Q���)�@���ƽ�H����b�s��l��T���D��R�2Xm�#a ��3lY��z�j����㒚#!� 4�J��8�(��c�v���t]�a��T��� ��D ΅��Q?^-��_^$:\���V �$��N|�=(v�Z'q�6�Z�׆��B5V���!y���3��K��㱿b�v4��x����R]al��!�I�o�P�@�t��Vy����L�٪ml�ڿI�Ub|[*��lke'*�Wd���d���D�ӝ}\W��_Wߝ����r�N�?���vޫ�۲X%��0u��oui*��JV��Ʀ�b%�}���i5I�YlN�E-w�ς�f_W3m�I������-�m����Q)�S��k��TC7��m�<"��܌�b�T|��'��$�Ҙ�����R&>��O p��������6����t���S��N\�ׯL��m�\�����r@�3�u�T b7��t.5.q���3�r0�=�8T����i�J�\��6uF ��R�32^���'Ū����x��I� ��F�8O{%8��kJ��MS�ȴd�BEd����W��CY�O:/O�N/�I��_=��xFE��! �=��i:o�~��� y�?��'��'��[͓[͓[͓[͓[ͭ��.�U>�$�P�Ʀ�c%�]��\c��:�| �,e�S�Z,�o��Xr����X�!�R����@�Z�v� �0��>?�*� �<��|����N6�0��;{�a�d��2��v+D��^t���[q!�۞V}�f��ۨϏ���Y��eॗ��)Vy�l|"f�U��q��@�Ǽ�4Y-��Y��-!�6a���B:o%�J��I���UQ|�U�K�O�`��=\����:�0���x��Pa��u�@��!�K��P�d�xhw1>�$j��v��Zd���x��S�UA�&[UR�d��7�ø��z�k��/���r�U^������w:I.�VǮ��c>q�.!�zS�r&���2�)Wg� ��R -�i�Q 8���Pa\О�U%�iݡ��U�_=��p� �Lu��(�N�?���0?�Æ:]�ά���t�B%�U|�����NsorN��f�� �,�P !�v" Y�6�hL�_�@@�b�s�c���qg�v4|��|0lϟ���$S��9����bʱ��j#���~�����?o��}����}7sAPm:IV�=n��� !��{��{��h��Eࢪ�8�s�u��oL���T�$�;V���s��cq�D�3����༂3.D�B����B4�&�V'��T� `��D�6����Ϸ�q�y�j�8V����*���X%���@s�\�jrN�$�|�=5�Ά '�mU��i��K��i�%C��I�:ssaƅ`*`��=�l��)>�uMeuS����I�_�O��L��_�}�o&���jz���p��{�����lu�:O���)�s�%Q@��$�<]f� ��xO%��PCbhr2�������PK���p�f5�Në3^o�����]�e�J��i�B��464��^t���uٲ�U:G4'���22Y�p���u�G'/Py�4?���.��SB�P_>����I 1t3Γ�B�ɭ�ɭ�ɭ�ɭ�V��V��V��V��Vs���]�!�67(��g�����y��@��4>Q�� ��V�F�}^Xׇ�ڼ���j���e�26 L���%��Y�G�h���l�C�}�)��< �!�E����E�P�ZWZ���V+�@�R 5{@ou�ɐ�4���&����H���6�e�y V��݀�Vť����cqZ�ޒ�r��J��yB��y���Fz��FN�$��Hb����*+�jՏq�э� ګ�kݿU�X��l�e�����1����d�0d^�-�B%���}����{Y���%r�*�j5Ak5�u��"�,�:~�Ҹ�Y��~ h����SA�~��6���fu�lՇf��{ȵQtATH�Z�k���ƭ/_���S��n� �u']b�]|m`�B��ā���J,O$�du]�Zs� �FL�:�����a�����Ǚ���T4�o�~by?wp�j滥�A����(�x�]�����f��~an֧/����^�d�ڲ�c���Շ,!��1��i&�xi_VK@ip�̓9���Vi%a;��L?�0J�*���Ū5���U����'���x^�6�V[�^ �{�eU���|�:0�=0���d۫o���*J�q%�[��Y�N��.sQ�L�ud�[2��9�I��:W�n�������m�Xl�ڃ�6�!l�Nl��V�էKU���jV�\J%�Uߊ��B��LcKf�b��>a�=�b�~�R]aG%[����js@�<i�[Х*^.d;UI�R+�OD�2e�ܶ� ��Q��N3�4"1������g�0��u�\��I}���wFV�4y/D��j��j��jn5On5On5On5On5��h�,ҷUr��]��]L^����%J��D��iɭ��G�ԝ ߴ�/�%='q�å)����:��Q�<�X�.��'�[�@�P����v�/ɼ����>/9�MطݘU�>yɲX�@}� ���F��t�g^��vO\��Ӹwv�p���z3��K5i�!$P>�ā����'��Vƛ���L�2r��@�UM��K�Z�����6���tw�맟¦b�m�1�h|�|�]}~�0��MjA����(J����JP68�C&yr��e}�j�_c�J�?�I0��k��>�W��� �����|�B�ޝ�."TEXd� ��8��!cw�*E(�J)���!�[W"�j_���ТeX_��XB;���o��O0~?�:P�C�(.��[�����!Wq�%��*le�Y)E�<^�K�Z�T�60�.�#���A\���5;Rm�tkd�/8�)5~����^0� #�Ckg���e��y)����Ͷ��Ժ��6ĥ�<�(?��&��u�A��V���m0^h�.�t�xR*��a�'�:,�H�|�ō���l5z�;8+e�#b'#|�}2�w(|Kc�J� �l6 �����w��^�Տ�o��i��3H� �R ��̔9�,Y�gP�ְ:N�[5S���R��!���[)��]���i}`���m���N�4Х���v�`|;f�(��F�lt���L�8��÷Z#�AO%�Y)N�U�5Y��e��d�J�E�3dZذ���<�x����ɝ��e �@�Pڧ���F�TR ��2S�·�Φ/u�Z�~�C�3���X�z���U���x�\2�s���e �D��D.���fBO&en�'i��R%��?Fy�VsS~$u��m��w()��r��o�0*D���i!3�:On[B�!sʇB�p>ݣHT�1��;�8M�jnʏ��Ӥ��qp�1h�^�<��<��<���j��j��j��j��jn����q�(qp�Ok���}��I?TY8H��mh�yK�̝u5�����I�t�e�nQBޗ`�R��`��E�P� �ڦ����x�����>�>����yt�{?|��'j)�����}YU���U���{�@V�/�J1�F+���7䀉[OW�O[� ����y���UY������!?B��D%�D��Wj�>-Ai6x�z)���U R�����7d���@�g����\�so�)�a�4�zf�[�W+���>�����P��>� |��qL��G8�v���ȣ��l�j���2Z��t��+��V��A�6g<�/��Q �H��SrΣ����d}�Y�q��g]�sY]�;]F�C�@5�Y��Ֆ�5�C�3�8o�)k�1'��d6�>T*�ʆ��Uz(�m)��CD `��He/�.�:�zN��9pgo &N�C�׃�އ�>�W�հ_��Hj��)�Xe6F��7p�m�-�`'�c���.����AZ=���^�e8��F�;<���J1{��+8'�ɪ'�և\A�*���[���R$U�Y)V� �AyɃ�w)�Ec#<�T����\vW<�U1�IؘCDo��Yo��]�wm�aw��:B� :'�Z+�v�}�|�0��q���1�P��*��u��T��7 �F3��9���A}$���f�+�o���[��I�5��ʰ�x(&����i��ʼY���:c�Pp*��b��¸J���j�V7l�jtsNk��v����[�fy3��g]�����u����鲱���g�J��E�0)Vił��ù���\vW<�Ug�t�e�~B�[����A�����H�J��'�.��n��& 1Ԕ�� ��o%gͱ_��N� ���5�.W��3y/D��d�yr���<��<��<��<��<���j�ܪ{�����waw�:6�dJ�;&��3�p tl���as������W_U���T�_'9{?�a���Ԭ���l/0���dHgqll�c��8�R�y�����m=ˢ�_�ͺ�[Է71�x"�"��S�IfV��r�x3�3y�)h� ���h�ՠ��0���?�r��5�x�����_�-���j����� ���чoO:��$���XBXJ��ѣ�1����#ֈu7�`�zu2�{�\;��uܗ�9@�0��V$2X���S����&���Ba�[�O�~��j�N2ߠȪ/����jz_���nA��������~���u��h@GL�O�eɵ��?T���f<V�����e��@���*�-}�e��@� �0Zt�/~������Xm0�*���*��H'\������u��S�E��m�Lֻ��6����;+{l��5۽����?u*����_� Ni-:�I@,;�]����W�Y�` *���߀n�SO�~�n���W�P�.��c����Z�T�u���Po^ǃ7���w��B�RB�W�_m�dj��������B��6�:��*��H����]�����d�Q>�{R�������t�n(��z�!S�7o ����Ie���w�3]��bܗ���8�5|�i��Ϡ��R��JkʱZ�RO+�8�U&�:]�Z�ieR����<I��~�|�d���,�j��릟�{��;�7�U��X�B���`����[�u5~�=z�q굵Ű�e��b�c5���o���{;���ߩ�@;���n*T�ĵ2�$ܨ��0�'�Y-? �j�[�Z��j����ӭ�v���i�-�*rD{�mL-,L�=��y��m��x���c:���We����vұ�oÏń� ��"dF���8[�T}ӵF�-�I��V�lV[P�����)DVC�8ݪ}|kZ������{����Y�|��xrr��xa��G_���>�(��J�M�ޗ7����Z@��5�a^�\G�z��s���ρU��*�rM�e�zT�^�:ɬ��ͦX=>�$ bi>�U&X�Qoybb�G�k��8� � �Ҙ�n).Ս����o� ��^M�m�d�Z���i�$s��o�o��*{�4���eLb�Lٳ"�"mx:�`:m�k�[�geT���ެ)���'0*T��B�{!��I��'��'��'��'��[͓[͓[͓[͓[]�Z���jQ�.e�'/��y�vQ�71�(Z&���X��?(_��Z�����){t�ڀm�Z�W�Ϗ�)��-C���� jq�n�,̋�"�Iv���UL�!h������s�k��AcrN��佚ф���VE4�0�y�X��~�4zʸV㳰%��,��)f��qt�p�u�~� �����*���^��0:���ܲ�3�3���J��O�(�����ZB?K�^ �v]�un��l��W����i0�p6��[착�C_5X�#�[��wX3�b��廫�R�{���NK�A����e S���e�|���w��x���s��o>�P\儔ԕ6�;nV�m�f�I$��V͓J-�J%��0��Uw�YЎ�S����n�u��m�藮��xz��˗V�ƫ�I�vn�W��_�qL�Z����"_�X�z����8�]Ap�����?��C�����5�4��3�zw(�{7e�*Ȳ`۰�!A�Q�:�KUn����z�]�1y�V���Ga��C��m0�PY ٚUx6TT&�hV�9V� ���Ӭ�zÑ� 1[�X�z�Z�����9�e�r�q�J���ND�/���g��X��*9o���N6�D��` �{�I�%�M�z9�T�Q�����7f�\"j��_3���~xB�'���ܷ��Y��]*KЌ�%"���5�"��qxq~���ƕ=����j���S�>j�V�&~]2�xz�F����1X��_y�D��<#N����RB��}K���/���i��y����� !V^��˿e�J���}/Fk��A�7��� ��S���+.�(ec���J:�z��W�Z���몖w���Q������~a����̈́�p�6,e5�,�+����,���������t�v�%O^O��O}�ן -O��7>e��kC�6�wa�_��C� ��|���9���*�����W��A�)�U�Jg�8<�Z���x^?���2�u��Y���*^?��ڇKC�Z�[�����0.���C��@m�����$-��/~�|�Y��[e�w�eQ���&c��O�4s|��c��J�ws�X�8/��6�/ڼ;�'F�LN^�8]��ead�Z1'������^������L��sBd�%�+M��`��SK��8פ����*��)gl�#�3"��gъ�S�����qtcxx��|H>���=��:�����m�j�����U���v�q�y��s�ܒ�Lgl�C6+[F�SWg���9���wV3�1�A ��N��D�<����$5e�(s������;�a� �F$��]���IEND�B`�PK���\���1�10templates/protostar/img/glyphicons-halflings.pngnu�[����PNG IHDR����1iIDATx��}]l\Ǖ& �\���F�%��[d��R-�Iڴ~�4CoV�V6�T"3�`K�ǰˎ��@�ȁ����x��9%��C"[Z�Yg���ĆL�5OC��y���unu����[u��-ћ:dw�߭[��|U��v}UWg͚�Ug��-2p�E�����,1�16�)hp�l�]��c���@�j��%s�-dz��:�uד������?�~���:���GnI��R�04��@�1�paHsY��ka=D ��!ݐ���Ѥl�t��`�l��?�Es,D*�D7�1� 1���sK2�o諹�A����>T�J��P��ʨ(���@plV�F�S�硝ߟ�q;ȼ���0@\eù��ׂ��������HT�W'')�G_N�Q6�����8��/ո�Y��ڮtsD "�.w�W��m�R$]?��_�+�+�=�j�!�y�;�_Tn!h�ޫ����W*�r��i���5�2Q�"���N��c���*���$�歺Te���Z�A�S��Y���DoZz��ۍt��;�[GTY��٩�셴*�]�t`���^�yz���Rn;U��h;Uz,Y�y�Rz�@���Y������x��;n�y��!��O�����7�� �q����ԇ��h�(���>��,�1�76�D�^I8�E��������o��.P�Հ�O�d�˝�����Ϲ��VD�2���h)\�B�r��*� 8g��R���U#�I��k�������ͩ�}h1Ui�*���M.}��KZu"Q���o��Mq��[���D��G�š�o|���'ܱ��̛�R�5��b�]��uf�pɪk���i8Y�4����@������뀟���A�<^��#��b�靥!����~�թ�0�0t`�/���G)7�W��X�%�:����!T�K7���ݧ��徜�y� Ac_.��I��6��v��4�o}�%ԩ+�).�Fw��H�b�b�z�6�Uk6_����Eu�j��zpQ@�S��pVE$h���Y=>���F��k�nP����?�5�=']Q�)��zߡ�U���ϫ�X�%BK�8�ш*�7�@��4r� +�K�E�?/=��j�ƴ7��E��w����K�9���w\Ui�X+ɉSЪ��qI�����rj�D���<DX{V�QY"��Wx'���|'��S�z���/��v��hx�N�U���T���p�Ǫ�Sn0��D�z_9fU��\���������>�%R��$���(z���4��þ��Ǥ7���R�Xi��| 'ͳ,+�3rM��F�0C_�D���)����u`�U�M��E<��>_�Z=� ��2?�2��X�6\��o�MK��}�U5�j�?����;��/x�<�}��TS�b��p؍��uiW��l�]�Z�(a<��8��Pd"��Z .<ATLi*^������J#�����@��q�6��4x��f��� �7��cU���zZb�[OW����e`!��P��lg�[L�Ss��0m8�X�7U�ꆥ��9�g��;Οܣ��@/`��a�kv/�ԭ4��jdKw��%�������W��?�=y3��^���Z�ܬ��?W5-}��V��qT����y�A��/�AL���$�1Ґ�`d8;��`������E8�o��?B���|&: =��(�P��}�Ud�G��ʬ��|uv�)y�v�{��<Cㅡ��O���N��W-�V��=WEʍ�ӈ���^��t��խ����1�������;���^�}�SU\婽G崙P_��~|Q��3�|{�ZW�A���j%����@́��P��×��Ip�V���ߘ�P�j�h�����HB��G��{���fj�i(.�t��2N��:k�n��X�f͚5k֬Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬Y[}V���5k�n4Q3�!FY���$;�P��,�A`M�?�|m��6�1ó1V*c5V��,�3�\m�9}�G1MZ�R�E�$�õ�Fx���c��֡�K�&+~ ��P�3,��EId������j�\o.�� ���gg�u�7)EB��3͏)>���U)����eE��j��_q��/me k�����.�dž8!�O����� (����*�AW�N;y�m����� r�N��o�(�����q�pEH!����^g5�GL������՞�.UM�c��e�u�?�]~p5���K�r*νε�^O����$j���R'ujd�e٨&�1�Ȝم�8�k"#��������xZ��"u�=�+\:�TU�s��W�bR�G���,$����DgT� A�v=(H��??@�~���+��B�U���I~�S�)]��ó&=�s.��^Z.�J�TaoL�;;�������0�nsc�9z���u@�j#�o[����w}��[\"�G� ��RuAG>?U�˾Qg��2hG�W��vP�~d�h���`���Ϗ���#�l0� ��:<�X�J����eY���<M"�դ~���T��T����B�m�/J���K�^G?���5��2:�T=6!�����:Ec�ǣ�I�/)cO��r�W�ݧj�����e����Gё��Q�<�U�=��j�S��}����O5ŗe^�4a�??"G�<k��;n��5i�ہ������Ё�o���c@xX��s����>��z�T�IA����G*�ۣ% *(;s`�ځ�� |]�#Ė�1%⿹�P�7X,�N���&T�e U��]Y���d����h��Ye )y��(�$��q����e~�+L%��ʏ�C=�y��E�*<�3�������k��ë�e]~pr�L�v90<M��@�j����P娪R�u`���o3m�����(��(�z����L�zψ��{F��?�+�=U�����)��Y�ծ�Y����.�+�Hu !.���@l��Ώ�y�j����yJ���_ .#/��W��]�C����i2��ֹ5�U+�*k�>}�̮� �)'����0����Bأb��z㉭�L���Ď�,��*`��v���r���T5�Y�S��b~�R����c�� 65Z� �e~�q"3��F]~���;U��M�w3�+#/}.�֬O�|y>xH�d/C+�ѫB=$a 4���^�̘�A��y�h�(xN�k�����l�;��r_m�<��e[Q\:!S}��鬲1��A�9�x��1E��!��}��ݍtx�7��T_�ү��К�� �����kݫ���'2�:�yJ�W��<��7�]E�O�T�ޗ���{<ճ��hkd�*C�UFU3���_�4�=~�}��FP���F��\��_�uU9�m~0G���_��*�P}y%U��q#F��x�楇�N����\U��)��b]v?7��&:�=�2ͱ����K�s������꾚�ͩZi~pBj8�Ǐ�C����t�ە_+ο��w�w[0���Q�~u����3̍�h�x_1�َ|_I��C�{oRuV} �aѦ�P�TtM�c�7�����j;A�6��{Ltn t��e�iu��d�]����!r�ns3?�J�^tSg͚5k֬Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬Y�Vd�/eg��,CРmBA����m��L}�f%�j� �6CN}2FVw���H�,[I�Z[u��� ���Ȗ�ug�^L.��$U��t���"' t�H3�~�S�&�ێ���B�,a -S��q^�t��D]����1T���ҕ4,�*nh���i�B[y��g֨�,Ϳ�ғ��,]��'k�Ւ@�4�*J��D�6+b�996^#�ΕfXsaȁ�?Q+��'h5:�,��.Cr�#*����[Z�����,h�����KӦ,�.�+E9`J=]���59���)3P.���Z�تK��'�h�p��dE�3�&Z�W#gR@وA�Ŭ��T��~WN�SqG�+����� �t 1"����iS��5�� -�&T-��|{V�n(��*��L��&km��DCAO��;��������Our��u�s��[]C�*K��r`�9*U�Tu"n�%g�К(in�c�q�� ��y�5�*EUBU��U��ݔ��<�+��^E�;�*���*�֖�����E��甀������i� ���������&��E_�X亐��qhA!\m�j�aa��Non,��Z���H>cR>B{[U�ȱ� Qq��kr�1#k>����j���L�~`���u��� ���d�ɭ��x�� N��G�)�����|��jX��^�����_"�2���I�E��LD����-���E�=�HԸ+��z1�/G�-�+2���z��jOU�V���.|����d&! (�/�&zR@����!��H'�v��S��Ge�g��� ��p����{�MEx ��.#���G�7��,��x�߮>����>4��,���gUFՁ�3�(=^eT��y�3���>'4��X�!��ۇRI�'H�M!R���vTe�n�5I!��|��&j�`�Q���{-�;����g��+]�n�?e��'�����D����N~���Bl�Nm뫾B��m'�����N����'M+��d�5� �J�d<0X;�����<���j �Kg��"��3�}\]R�?����.��H�Q�Z�W�<UG�U7'7��\h��vBI3q�&��>]x�1�w��\�%�_L+���H'��9�k-n�o��S ���T� �� �3����8Bܣ�i��� ��D��٤��A!@0� ��(J�a,����d�q��mI�ً���Rp�:�6N:���̊sZ�h˼��x�IO)'=�GL�U?@]]3�����U�*P՝y��$+���j�T�[D�@�6�E�T���J���V�Z�ۢ��S6V�^ȣ)e��NjI��)�8W���V�C�O%�ƕ��R%`����g��/֬Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬�cM,�*�1g�5Q[/�/�+q�l��esY0}�]f��, �˹���U�،����Д��Y���7��_J)W�7l�n��v��!Jv���\���,E¤�=:>� �o����f�b��W�����;̚�D����ڲXV�X�Yfx~����#�B�x�$�v�+�M��+uz���V�/:y���с��G�>� g'2��:�Y1� 1�Y.ڝ��D[/j3z8�j&�^�i}~)�X�ʚFn�zz`!H�S�rS�q��:`�)����˝��,ӥ�!ue"�.�?�X�Yf�$���1�0H�ݬT�Euz�pY��V�Œ8�Y�W�QR���On���(�W$�'�!UB�r���F{���R�:.���Z����l�+��h��O��� ����z���M��|Z�$�8Љn٤M�"�N�p�iuA��U^�"B�A�:B��K;�����5�ĝ�����"���e�����^����g�HV�W��y&��R�뿴�V�B4��{I�GU��i}��*R��n��CnXR�x��C���[�xTXm�q�<��ϸ��KT�|��\��_T�H�W�z7����L��S�,�o6U��:$j���J����'���Tc�L�^b~ � C�)�x� �&��rbY���R����$`_-F�����̿��z.ƱbC���4��L�X���n�؝W�w �ݚ��U��'�pyX�Y~Ǣ]ū�8��}OV[� ��Q��*nF�˓�#s�*�jFԺ����v�0s��P���W{se�(��G籯.�|J� ���!�f��^H��LC�����˥�[jI)�����m�f) I�j��&���N��K�� �Ԟ�����u)�b��g_d�s�wC���WK�ה�uu�E�����ɻ��HDü��� ����I�P5�X<���Ia�4���Т�^^����%QUjF�5�o�oME�ө�a)g��d�/���{��|���!8*��S��-��^}�'����$��W<�1!*nP4>��D����w`ù�*���*����-���C����E��ڪ/��|�D�6'��$j��H���3�a"��*ũ<,�,��H����ׇ˸Et^Q{��o:���JU�tW���`�&Zz�����:Q�~��U>����q[�`9�o�TRe[��a�φ.H�z'p�����K���_�:�C�� +�0ȏU3�����)�ǥX�Y�x)�:uz)2n����MZwRO�U�X3EDs��!*�Q>�1���c����|����ٌA�E��R�Om��E��}99�?�Dɶm��Y�'n�xR�6��� ��+�����x��Рu5<���J����)�c+Q��j��~YGx��V�x���y@��ꉇ��<���lon���$N��h8��n \�;L����Cb�-�w�>kn�OV�_!�֪��RΒ(�1�����5��{��i�.ݕ5��>����[��R7yXSr��nu�A[+�F�W��C��CQ��䥵#z��5<]������:��9�^�����,P��ux�z�1�)^�|���z�ja�zh��f�ڍhv�k��f͚5k֬Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬Y�f͚�*��N�_�=�,;�:�_s �%LJ�� �U��J,�fV+M�:�I�����YBF�^�N�7g��Z�o���MB�]j^���<k���s��]�%BK`37���[�[C�-Պ���V����wm�w �f�N_�3�u�k�����1�_�;���R��i���[�Yc�1���ku����q<5�7�G��0�Oq/}��Z�JT����5$ږ 2h��+.+���:����:����q���q�-=})���U���|e/=���Ek;ճ��p�/r�S��q^�x��i��D��#u�݅�x��F�? ��-ō�N 6)���BrSWg�l?�W�zx*�����y > m�xf�yT�Ԟ\�-0}�ryS����.����C�����;\��k��g��?���=�":���a�Y�Z{J�RT�K̚���hq���;�� Z���E93�w���H���/KH���f�C ��J ڰ��Z�5J_l���0[C'd܉�}$��K�8��� �vT���K�u�����e�ø�|O�����ǧ|aQ۩!}���"�����:|D>ݼ�5Ł�yz]biqpDG��ϠR�Q��=���yܳft�{^��:�Y�Vh;E���+�E��7�k�t�]~��wS�f;�w����H�$�k�Br���Y�y�|U?Fe%%J��D����J |���"S��V��e�j�?; ͐�z�z��*As�)�ΰij�("�9�Q�^ H����ݛS��l'��x^H����ڨƷ]��v���!�6}M`�f\���+�3�p�!�,.tP�*g��ODOg43-��Wp�1�Yd��j�^�o_�����z~����C�Lb��Z<�AT�3������Fܑ�s{VT}R�z�c��{V|�R��sQ܅�?�'��!O�R��a�OΎ��c�r��� ��8c1>�1��%��X�Y�Jf�kOUze�WB��� D�m�ӻ�u�uz=��P�S��?��pv+EHߕ��D������2���C��<N&!nӷ{����*h�{���#�7�����uA.ҡǷM~��Ј)��~��X�ІB 3�B���<�{O�%��Qg�:��it{!���V2K\\6D�B#}C� Y7`���-�fQ��zx����a�"���.Ɖ��n))������u�19Ӟ�2� &e��u��0n���#���#�1'<n��û�Y��X���JzjT2��5R�}|4�r���BD��#����V2K\�i�}��?��)��\��}���)��tz+���Z�_;�pv�x�^q��=f�m#���Nt��'��HW�jT��!~��"�;�>D�O&��߀`a����k7���S.�:�}T�0�<K��S�R���(?��{������ʜ����Wգ�rw^�Y��%�=U��h^[����tz���r�AƮ�כ��zȨ�PE�¶�Y�R����n�Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬Y�f�Z�5����Y+����,;�P�c�}?��?lp�A~�Y�,#�l�|��=ǀ*��s}�(�N᠀��� ���b�<�G�O_J�N��a}]w-���&�XH.��Ͱ�0$�o��2���.��7�5 ����] �R��4���Wh_Jg�1�]ڒ��ئ���HUéH_6 l�|��Ee�����Q�ӗѺ�@��g.�K�r�$*�N�������gq�# �J�����2�z��uv��=U7^s`�n_֤-��0tR�����ý?/E<G�xr5b �eR� �I��=K�EA��ZK�M?զ�P[��Q�6�R�H+㶢i�T����T�T(2qfx��y����*uq`���B����k�g�z�)�Sk/��Wch)�W�90��(�������E]ݝ�Q7(w�a7D� �i?���>>���l B/RK�FՕb��UU�%���z����a{��?�J5 �r\ٿ�{���3�]Xy�c/��p ���{���x�-�+.��'���\�O�e�.��_t�w=���.-E�rSǡ��H�RvL�T,��l�u\9n}#�i)�-��x\�� /�.��W�UWj��/��8C�uF��Ԯ�2Y鏒[�����<D��Z�9 �M"2��ʚRz���mRj�")��{�FA��xu��?eZ�L!���Y�� j�\2�d���)`M����^���x�2�ڧwN�d����c�e����Oq�`�o��� �u����ӟ@=tㅡ��Df�����Q��zQ�F���\��o������_�IT�DV�#�[��R2"B��S��?����ןXy���L�_����$�*UE�T��'���z,�^��_<���OJ��8�;�f���n �w��iol`A�|I���q`�?A�pv����Q�Yh��O��/ ��/:��$�5/'�6_�w�����1�� !�&�w�FG\�����}���vot���lfT��*7-��5Y j�ԞP^6q����;�`C���Sk��9�_�~��u�K�~=]���V�)Zz(�jG_��gCK�B�H�`|�mo��-drkиj8�=�;��vS~'�='�B8�A<��8��2�x9��~���o�[=4�������w�wǕ�� ���?�� �'j�{mn�3����GTޯ��Ѥ~�+��j�9�*G�7A��i����d�9��JU1&/�x��L�:�uu�AHQ�^y���>i���;i�-aa�X�)���I,tA�9~ �X2�X���+ > �o����,��G�x�P����Ѓ��n�|���BK�9.�ݓ�y�Ӈzs��j��I�̩nDԦ�.u\Y�W��d ��M0鶞�5�M����*GVQW:8���a�� >G�ˍ�]5���_�?��AC5ƪX��υ������X��Ɗ&}�@��rdtp�ظ�QW���]�.�s^v��;����8v��v�?�PH���3�@��6|�퀯������n=ǥ!�ȼ��9�s�j���j����zW��#>V4���B��`�r,o�\�IGVU��0n��Ӯ��/��yS��Pw��>�|�i`��4�.�U[/�_:����[�\�^��6$6�l�|U���F�|�Cߌ����R�~���)��x>]q�v�������n� ���s#������U*�c �S�^UR���c�(H ������_� WZ4""A�t��ϓ?'�c�ݲ+�� �i�&Uۏ����Y�RU���Q��w���[�D��{8�[p6�@ӹ�f�$$��f�5���f�;�8��Umr��2�yh���5����:W4��4��6�U�g�F���J���HD�@y;��͛�T�x�<��g�a�uU��t]�B����S%3')4 �+��un ��ZAjh�!š<��Q����Pe��J��z�ё���/��ԗ��W �G¾CϛH�Z�B�V�5k֬Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬Y�f͚5k֬��k�*���r��r�P��Uy��*Mn�M��dL���'^���B�K�D�.V�+Y+/�G��E���*����2�=i�sg�2:\UO6��*��u�YZ�+��~��� O�݈���0����%���^l�� ��ȵ��)0��l�4�d�Z4s��h����"�<�F|�'C�0���O��3=�7p�4_�V�n��\��'N�-NO���x������� �ɾ[u�8�o�����ԾX���4�]��� =כ�a�C��f/�����0��S�]��� �˷��l'5��'o�G�ҩ�uu�p�r3�S��:���s���)M[��`N$�v�DZ�(�0�?Q"h�5\�L�������gc���c����"q�E���*��G�u�R�&> 8nf�r�ǩ�$@�N�.�_�i�a`!��,���a�.�ƋP���ǥ"�'�u��ojӟ[�t� ��J�³��_@�'�/�9B(�RWw����u���r��\S�)R�Y,l.�����R�}�c����\i�{A:|_�����'O<��q��6#��KT�\H���W��@r�m`��)��Y�&m*����K#����I�M�W-�lZ�V��6=W��/Iw�_R�u�?���5cT(mu�u/�x8��[-���$t��x>�Y��=� \ff �t��1�{<\�$�y{7?[=���!ԩ��{9�ݑ���w�ޭ� Ɩ=�3��MhR��%G� �Ʒ��܁i�xg���{���@ŋЧ�3��s���wI�B��vJ����/x���S�r��{29}��S�*$�&�b|w�q7Vɯ�e�� ��A*�&}�f:���,jQ�Ta�*���կS�^2 �U�.��@�U���������٩Ż��"��̮�g�б�| F-��8[U>�_�� I�.�n�t��������VCD=>:�rD-����e~`�+7�x�$�"q�VC��qt�R��S�;�w���):�-/�-$gN<T��*���>����L�]B��Q�{�\���M�Od`A��_V}��7�Q��N�`0@��[�!�3���������?8�-�Hm�Wl�����^+�{m-V�9��:�B8�9�*��1TMm ���{�S=[�.��\�շ݁�ۛS�/m����xW�D"D�tx4�>D����/����rϟ }�4��ο����$�;�cU�W�MOB�,�?>���@����0X�ro��j��n(�aJUvxE@����V�;�S��9[�ؿ�_����[N,����h����Iq�'q���:;ʖ�ۯ�}�8q�T��{��m�XF5R����a����Fr�ע��{�� 6Z�+u�G��I�����W��:|w~��C 5~�M�ە��G~'j�zD�4�g:�cU�W���^��)N��?�Ԯ���z��i2�a�t�d�X=��9�>4>��*��ɮ��RL���*(�L��ҿ��A�r�}ñ݉e���)��O=6�����[���5��3��T����ܤg��`�փ�v�������;UڞγlN�1�<| ��yg��T���y�%:���í.~�D�>90��;�U?��d�*�`w`��#�J٥����}E\q����_��=�k�8�MTT}�k�8�!z������EzD�+�Z���l���c����o��x*E�18֗CY����=pB���`�o=���(H�a�����;^��T�����bx�L��+�n�γ��7�<MGZ��]�ݔA�)y)�3������4���p�`wxQ:����i�ז�B�B�Q�D&���$�?9���~>��ZU�Ѿ[�����t� �U�����M}��M&2ӹho�M�'��,�u�f��i8��U�s�H�\@{ �����T�F��7L��6Ʋ��u�sU�XU����X�n�P�՚t}��Ҥ�;��|���p�Ԉ>`X��~��_(�E�g1�u�Y���%L�"��r'aL"{�B��$����f�/��{ļt�1���*�N���}���Ϫ����>W��U��˕�N�/�u]i�nn��TQ�h�jfnowS�W��䯩�϶^�f����yƈ��K��~ �T���WV�Q�-��J����bw`�k��/�E�|=�W�IEND�B`�PK���\�m!y!templates/protostar/component.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.protostar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $this->language = $doc->language; $this->direction = $doc->direction; // Add JavaScript Frameworks JHtml::_('bootstrap.framework'); // Add Stylesheets $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template.css'); // Load optional rtl Bootstrap css and Bootstrap bugfixes JHtmlBootstrap::loadCss($includeMaincss = false, $this->direction); ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <jdoc:include type="head" /> <!--[if lt IE 9]> <script src="<?php echo JUri::root(true); ?>/media/jui/js/html5.js"></script> <![endif]--> </head> <body class="contentpane modal"> <jdoc:include type="message" /> <jdoc:include type="component" /> </body> </html> PK���\�.�<<"templates/protostar/js/template.jsnu�[���/** * @package Joomla.Site * @subpackage Templates.protostar * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @since 3.2 */ (function($) { $(document).ready(function() { $('*[rel=tooltip]').tooltip() // Turn radios into btn-group $('.radio.btn-group label').addClass('btn'); $(".btn-group label:not(.active)").click(function() { var label = $(this); var input = $('#' + label.attr('for')); if (!input.prop('checked')) { label.closest('.btn-group').find("label").removeClass('active btn-success btn-danger btn-primary'); if (input.val() == '') { label.addClass('active btn-primary'); } else if (input.val() == 0) { label.addClass('active btn-danger'); } else { label.addClass('active btn-success'); } input.prop('checked', true); } }); $(".btn-group input[checked=checked]").each(function() { if ($(this).val() == '') { $("label[for=" + $(this).attr('id') + "]").addClass('active btn-primary'); } else if ($(this).val() == 0) { $("label[for=" + $(this).attr('id') + "]").addClass('active btn-danger'); } else { $("label[for=" + $(this).attr('id') + "]").addClass('active btn-success'); } }); }) })(jQuery);PK���\r�;�tt!templates/protostar/js/classes.jsnu�[���// Add classes window.onload=function() { var input = document.getElementsByTagName("input"); for (var i = 0; i < input.length; i++) { if (input[i].className == 'button') { input[i].className = 'btn btn-primary'; } } var button = document.getElementsByTagName("button"); for (var i = 0; i < input.length; i++) { if (button[i].className == 'button') { button[i].className = 'btn btn-primary'; } } var p = document.getElementsByTagName("p"); for (var i = 0; i < p.length; i++) { if (p[i].className == 'readmore') { p[i].className = 'btn'; } } var table = document.getElementsByTagName("table"); for (var i = 0; i < table.length; i++) { if (table[i].className == 'category') { table[i].className = 'table table-striped'; } } var ul = document.getElementsByTagName("ul"); for (var i = 0; i < ul.length; i++) { if (ul[i].className == 'actions') { ul[i].className = 'nav nav-pills'; } } var ul = document.getElementsByTagName("ul"); for (var i = 0; i < ul.length; i++) { if (ul[i].className == 'pagenav') { ul[i].className = 'pagination'; } } }PK���\D�;���%templates/protostar/js/application.jsnu�[���$('.dropdown-toggle').dropdown() $('.collapse').collapse('show') $('#myModal').modal('hide') $('.typeahead').typeahead() $('.tabs').button() $('.tip').tooltip() $(".alert-message").alert()PK���\j�O O *templates/protostar/template_thumbnail.pngnu�[����PNG IHDR���Gl�PLTE �?e L�`�������$R?CZ"���q��#)bC{j{���δ��`��d����EWt-R@�Ü���3��Y�*$*&JH����Y�F� +l��N 3s�p���LZjf�8!3RLQS+6+1ClN���� Z� /rBs��������c$4B�`n���$9Kk0���Ӂ/9\1R#B B��:c8Ic�f3x���uy������P���킍�=�)/K:k(7Ty�Q+d���1RY�������jt�¾�Al���(�e�fff�� !H��R�*A_J|�33���7|���J����I����!: R�|�n����"+K!0Z�z����ŧ�2 W�||�r�+A��h���h� 5Z79N!/4s��3Gm&d��J�����Gt#;_���;�B� 6\ғ��<ӽ�֢����J��� ��y�� M� !: H��̙B��k�Y�Wax���2b�>5��눆�S�)9[H{/L�be {�lު��!4(R�������-k*�ΑDs�Ұ������S����ry�s��/@Z�����"07e�[��(:��B��������q�"}����3Jf��� :t������ g������[�BQk�EJ2Cbu�3{2"6Q(K��� (D m������C�M��ۣy�<j�w,\+H Q�'������������t��������(B)J"J"B(R1X([�� IDATx^Ĕ�$1��/����8Z� ��[̀I��+�0��������L�L\jG���)�SabC���������a�Ϟmk&�u�&��Q I�|>u�Zi�a�@��w�����+�:�(��A��4�}Z$;�f���NY%�x�j��;d3�fO��0:]�����L�[PZY2M����L&y�aK��l��.�Bϸ.5�_6�L3`��u|�tJ���Yl\�3�\��_k-��j+��*���Zm���"H $m#�VG9� J�T����R�F�ox�q|�T�d��!$�*�U�[�N�=``�D�F� b�ay:X�{(&��u ���=�oJ��\e"3*��ء���4�w��ϸo�)�A?Yf�ِ���RO����e� �'�4B@�#�8�&rK�'�O��pٌ��͒����1��GH|�tu��py� ��O9ȾA���߅�3fL�qARr6u��g������~�h_�� FT~�,s�v���"1:h������Y��BA��XU�52�; �@m��6 �q?��M��e4�2�8! �u?HE���K鰃�w3����NT�`�P��'yA�"(�S��IÊ�^Ӳ���]���69}�}�5���g+��s��ϡ4a��.��.�����0L3�0���g���l:�Ϫ���}N�lW����çK��`84<�P�;��[ S@ɞ8�gn�ÃC*��{`4�S@sz%�Y��P =6�Gѣ��{���������Wt=J7�XQ����bCoČ x��4���p��'���~\�;y��9Ɨ4@� ?�b�Hr��`ma!WՆk�j���k7��ld��i���)����� �F��Lj4 8�H�ҕ@H��`�1I��z�'zc��{���P12P4*U~h*P5�+FH]I��s%`|��L�ә��ir:��)�pNۍCy�"�y����q���:O]ɲ1B'�8��18��B4�~d�$�HB��\'2H!"�"��]�� �yJ�H��sz�{aKtz��|>\�E"�2a�{�%* -E�O�"��%)���n(�X��Z�W��3�e���Xfy��U�����3���+�3�>�v8��9�(v�tN�l�ʑ�\�!�,���P<"n��sL�/��i�p�µp�V��5�� ��D� ��U��9�r��a���@�[�e�D��%��9��G�x�E<�/L�q�VzPb���9�l���8��w?�����Vi�c3Nb\��-��2~��؍�9��@)���36Ƕ��jǡm\w��Y`��S*(��C='�Y/�[���V 31-��q�(�:�F8U �qB�#� �_�,�KPX /H,hh`���V��{O��'�����'��{����.$�yP�t��?�=��jM�\a�%��-)�g���_�L�Z�)�m�!�E�)�j����������'�)��df����7���+#O��7 3H,p����o�9��/������l���N:�Eq8�"X��h1��&uҫ��㏬?X�aY���iι����=8/�z��J���v�&BbH�@��bilͶ ea����0�l4�r��^��� ���)�jJ�����54�����i< ��l˗��gBz$�����f�$�a`0�gF�@]���Q*�#awN�>�fyy���������0M<��i8"1Q���a��f���`�}NZT�'g ��f�D�3Y=���J|]Nz������HqT�"D���i�r|�V��`�;v�N�yZ�i��.t��4M�q��>]ojy�3Z;���BO���y�B]���4p� �7��^c �0��� H@m�6�,����K�S��F�ؿ���GK���?��<�����bixC-˲�в�kpz�p� r���DƠ״8��>G�D�#� bT�XVHi3L$����0����+=�������t����c`��䇫s�B�i�X��U<Y�1�ݐ3�#�Gg��ћytV��>����F'�f�@����կ7 ��T���m��7�n �v����}���)}�8��8�VP �krD���|n�\�2R^ ��Z�i`� ���=��W��B��B��m�u��ab����;#w��2p�m�np6����R}���%���Ɇ,�a����U���o!�����M��vS�#O:ȉF�:��SZ'�m��S�<���m�]�$O(�)5A��������[{7�<�9�k�ϴ���N�D3p]� �� �0��UWxpp��S�h��sDuP#9�_����o����ir � N�Z���v*����T<�gV��������w�̩�_>y�c�ڕ��q��qb���s�fj��W�ې#��G�U�����v�����1�IV3��J&�+TWS�d.��$3��jf�x�����'g+�D���?��g��^1���R'���HU竫/�.-�q�m|p����&�t�������O� �B&�L�P�̋TΨ�\��VS���^�2 X��A��v��9�KO�����ųDj� VR��.��&$G�D.Ek`�r�k�~��j�E���<%�>G�n���Ȧ�]>���l��[a�ICt��y�3{��/���=/?)��,��8��x^L���J�a[�ٴ-��u]&({ضcG��6��:�kﮍ^�8xil���y�xV�rZ�#N�*�w� -+�l���H�!��ՐH�ENu�.�04 �xyk-�A (v2�C2�v����mY��� ����F��?l�i��46�MO��{>����m6��[�ۅ�Rr�s(�{GЮz��2�9=9����pwcc�Q�����@up�)O�<.���d��P(�g&rf+��"248^�#��=Qcy�*�txRq+��}��E��v"7E6�}��(5'�'�ay�&�bU9��q`��C ��؝��V�q:�r�O.L�> �v�x=�(x�a�HMs�;�t<�zw]>Y3 ��A@!L�E��`C��?�����(���\;Wv�@�٬��%A�3��=:4br6|�@�5���MF��Ȼg�(d5�K�e��r�v�ԏo,<�V����ݍ��1 C=J|��� =R�X�K9�� 0M^6��9���|��>o:�f�)9:ͦ�gg�xHXIu@�lI >*@�Ã�Ϛ�o4��o�Q�i/�(z8��^�绋��ݾک� ��18��&�/֩<��L�(��l�D8�1�ul>cp��T�p ȁ�L��L1x��?����b�����D��au+��7Zv&��pN��b�H��ǚ��}���O��� Ca<t������:3t��^�K�C4KT8L8��-�<d�t��P/Y�h��9C� K?9&�5ؗ4��O/DO��I��dk��ݿ�� �S�~��<�9^>����w�L��,��2�0�2{�>��@�F��)��_@�������E�!B�<a̽CN7���|M����䝤y�5�����i�>p~|�_�O���X�H�$�� �"g��'�����4wѣ�l;��=ʲ�lʚ�!�ywH\T�p�aY*WT�F�^2���WW�������{W=��s ��0G�.��~���ɗz��آ1���� �z�*`��]˵w��f�羾Ņ��/�3����8��R[&�ZGUƹ�O<2�dd�3K+i���V��$ 7��p��(�x!�θYe��-��S� {E�ᅝ��m��a����8�nc:���h�yN�.�I��i �Ԛ,��'�UE��ZJW[�W���r�IҖ����%MO�h��o���A�iz�w�8Rw��5�y�$ٲ�9F�K4��bcx��%�@$�O� >�Z�Z��pD}I.��qvayM��I��6f���KUTg!�����I�5 E�v�O���<�z���E:"#b��j�ws�">���Yiu�"G�����F�7�˒�?�J��� !_AoC)�IК|� � �b�Y�XEZh����$�.q�Z!��o��!Z�y5���V������4��]w��,4 ��b��l�K��8"�g��H���a0 �ﰁ�v:@`�|�t�0r�=�����*R�>�9��},���Ų�)b~���!�i����~�(�9��8�Vq���b����DfA�Y��Z,���Qɴo��N���m[���!��1Nb�8z�G�}J���w�� eJ �q�R����(8�ah:�,aU+"�;"� C�b|�B���VW?��L�q�I��\ z��J��T�i��]#�����A�c'B3zǹ��\�n��:��% aDC�@��Q�0���G ��L��g�r�Y5����q�p��d s��Z�ډ�j����}X��6DU@tg�<�}N�<� �-"`���Q�>y�y��FX�*���.��JZ��S/zS4oU�j2�V�"D<��;��V����출y�H]�Zv!���e�Ӫfiu�5�Ͳ�tRR�4��K�@� �H=���䁠l�Iz��k�FB��2Ԩ�����P39�$\8��y�i76��4�4��i��R~�k�盭4Ⱥ�-�A;� ��9��@��r���@����wYw�K�qTRr�����a�j��5�fX47 �r� =m�ߛ�ux8�Y�8�=��1O�t���I����ru[��R�c���V�i�n��rxa�x������xl����>�ĉцr�ӹ*������6�t_"�:t�Q7'��$�v��q@�c߆����R�x�}쩭�!�p��:���\Roi�Yei�DU<�u��3H7(G4^�#x�����ކW�H� �p�N��hfh����z�ca���E�m�JM�x�.�41&5�<>�&Ur��HE�W����+�z2Y��gT��h���3�!N��v��u�_<�v�!��[O8���O�0;vm[��^�At���q�Û��s��E��0���y�d<t�d蔡:he08t���]��A�?��s�QU���7T� ����mZq"���뺺Ҕe���ܴONNz� ��Y6�ϳ�K��n�e)��r�]�" qʟ6y��R��源�Q�c/�/��@�ѷ�WbQ�ҥ��gL{N�5�� G����9���m��E�$���vɞv�o�:1�b�|�J���YG;�`$�q��Xc��M�I ��ɨ�#�9k�w�Ge���"ig��_�~"Pv��$��\�����Z���Xa�<�5-/c�#>���*�\(��i�9U�h�x|gg���qy2��^t��_�L����^��I�I:]��۟N�{xJ��}���1���f WEE��:0@Ȅ� >������V9��L�㺊�Q;��xw�o!ˏ�?3�ڦC�Ow���Ow�$�s�s|��4��O�'\>]5o���r��h�k\��#x��ߙb#���#;m��v;�Y���b6C7�.q.aA=w4oi�Y.��~� yH�C�0��J��x�}S��Cű�\� O�'{u��0^/p�&�R"�]h9��!�55 {.�E���s�4h� y�Y��Ղ8����� �(�� N�㐎W�v�����48�1�A9�I�fC�|�;g��������ha��b�Z��,���(ν])��#ɕ�ˡ�g<�y��\;���4�r���S��B�=���S���OQ*��D����9�+� �Ԝ��gMő�_�7M� 0��+$�Ws<���.�¼� W'w��?<Ǒp9,:lG�����9h�R8�C�`������Z�Z��/�9��DhI88�`9��^��U2go�N(��*��@#�8l M������"�sش���B��I���E�]pƻ8�i�H{z�Y���\8[��k��X��.��jxQ{����L̥�E �R �а՜�yv�45�)Æ��،��v�t�����2��&zt�ۘ<�z5X�^�����i N�E8�h�=�m أ]ČQϾ$N� q��yM�3�-�~�����Q5�!M��Y�'�����G�#E>��� ����DTkb��g_��Ig��`���^b�f:B�0��oo��q�% S��A|1=���P��Z�<l�����`�f����3ȘSA0��C��~���0��3L���$�C��� �̗�Bc ���6���{P�Hdɝjؤ�8�G8�<�N <�$�Ͳl���4ϸ��`0�LRѴh����#3�vm]I!���A^����#^�Dk�v�e�;GE2r��{2��m�7���7f��;�����94��1qp��1����\��h�Fd?G��|�E�#���D�v0Gy�8 �~�_]vl�6D���A�ʔ(p��C�p�G�����5(:� ��ӄ���X ���qW 3; )QR�ٲ�J�q��}X?�t�n�>����\��7�C�swx���8'�Sa��xt ���1@�=/C�YL����*^��(�;�a�{t(=B���'5�yB�,�kĹ��NӤW�`�������q���3s�8>,O�|#H!�L��)GuGH"W jz �Q�,�K��*����YqJ�,<�Y�t�<߽�Wi�]�8E�����&�w���Rc��ǸI�EL*�2�#AҬ9�A�����s��"�Ajm�j�@��)8��� �:*�*ɒ[u�f�f�ق��sBy�A}�A�f�S��5�$@*�H3�k�HGyR�3L��dN����z��<�B�:60�|t� �21\�)Ҙ�_=8W}eY6���8����|��FB&��A���@(P���ܨ�� �ʙ|Qjq�h��韒$��<!b!QJ`,�oޙ�u�������v��ܐ�4�0�-DU� U��Ѣq��I�L�t'ꓳ� y�<>:?*�M��g�:�_}vu�S�,f�Uj��xي��:9�R,8�*�$Rn�x�g�#N8�!�x��5��nY���1�Ǣ��,m�|����� ���Ԝ�9@�Fx�)���t(�� �\r�%K�֍ڃ���1�� �H��0� ��E! �7cc��TY:ۚ������Q9���}�"I��IEND�B`�PK���\p���5�5#templates/protostar/images/logo.pngnu�[����PNG IHDR,<�܇ZsRGB��� pHYs��%iTXtXML:com.adobe.xmp<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/"> <tiff:ResolutionUnit>2</tiff:ResolutionUnit> <tiff:Compression>5</tiff:Compression> <tiff:XResolution>72</tiff:XResolution> <tiff:Orientation>1</tiff:Orientation> <tiff:YResolution>72</tiff:YResolution> <exif:PixelXDimension>300</exif:PixelXDimension> <exif:ColorSpace>1</exif:ColorSpace> <exif:PixelYDimension>60</exif:PixelYDimension> <dc:subject> <rdf:Seq/> </dc:subject> <xmp:ModifyDate>2015:03:15 14:03:35</xmp:ModifyDate> <xmp:CreatorTool>Pixelmator 3.3.1</xmp:CreatorTool> </rdf:Description> </rdf:RDF> </x:xmpmeta> B%��1gIDATx�]|TUֿ��� DQ@� "*H��d�.�Ɗ}�)j,���ka� �-kEiI �"~�b�R�$@�̼r��y�f��II�u�/��n9��{���s�=��0aڒ1�G�ZF_�dn���8[��W��}��$��n�燨,.�pC��Y�:����\�w�2�S?��+8Ɓ��<8nj�����tƤ+p?I��"c\��2�^��u���������^�I�q�ba�+�Ǜ�E�@�i�/`�:{����~/c��8�@�q���X�>XU��%I�p�2��) `�dUb�bU��|�s���v/�v���Q�����7HoSU������58�2��֯�/����.�>(@6���y�14�E��3���HϨ�<�T�(���C&��|Sqa��Y� =k�`�ܷ(2�O�X'��>X=�)�nXL�` ����c[��Xy1�8м�&�ɲŬ��D]Q�Ny&$/LI2����:�[����AB�7b��(ET?�(����L��ŏ=�q Ɓ��R��%=�>י$=E�5 I��-"Ö�j��xg�fY�Ū&�3e�V�z9��dT�x�g1�8pps@��gI��,��5!��� ������* ��O�ޙ��]ф��E�N��ӰBIk��,�/[�c���a���gbؔ@��,1�i�K�nyS����8��>=gL6g�@$�-��t(�5T˖ѰJ�3�� ��R�ڰE<#*$�"�g�ә)N��4�q�@cKoȔ�e��l4%mRа`�ӭ<�O�F��4)�X�bh5��Wa=m����aؤ5�0XX�L�4a>�kk��"+����Re�?`����>�j�*%Y-X5�u�i�ZU8���{S2��]��׆�Ǟ�8���`�! xR���6 &B�Iw����1c��o����0��H� �� �H�d =�U9?���`EerB<ƼY�C'��@��0�b��r2u�I��$��iT�x-�D���s�P~��V��:ۨ���[;P:b�c�q`�9Kv�ət# $��n��II��z�vU^qf�'�k�=�aM���dG��/�b��`��?m�ܛ���ɓ墢"�I��x�n����M[Ip2��W9�'L���ݻWr�\v�NM��CT�:y�dmk��2Յ�<�zvvv��ݐ!C�t�_�~q^p-D(�N�+�X��䱺���X��*�\<;��Mc�4��>[#@?F��_4��5ʋVƎŧb�`*�x�wq�'��EK{���a�]KK��@����C?Y��ƾ:�81`�mG��;d�:u��_��{�L��}�j��ꕜ�6�?� ��ǥ�#�ӊ�l.\�@ϕ���F�n��B蚺�X���ϰ�&��T��Vɠ�5)�K�#s�*~NVIk���z�K���UU{�#�s��b��q��fG&��dE>�*n�0�f��8=���v+�hOT5��!�2���3�B�6�HJ=�t�%I�:dr����.�4�����'�:��\�l c����n�d�6Y �ͥ����h'ԽV4���/O+1_Q!�&i�@?��т�Lh���^9tn4p����'�}Y�%��E9Y $k��˦0b��A{@ �k��c�2@�h�~j�C�sL2�O�^�֝��L����{��w���+Ls���BeG��ʪ{�5f��mE'ـEy?���}fHgA��zP1䴐�P ^��b.�L!�;��/@�)�g�Kf^�Z3l�������\��ب-`� Y��;Z���K��N�E�n!jLȘ�[ WJ���]��rc����8���έ�Ч[�6���$�Xu�lq���.�} �>?d���%�#�W�(zB�)� �+Q�r�&�7����1f��e�S>��<�̜;�B��iHC`��V�o�m�2]�h�g�yz_O��8O��j�8��_HU5���U�\?�OyFd�^�<b�b�q�w�e�9��kIϞ~�7?�\�ws�o��Y�-Q�y�W�hT+a�Xm�'���/��sN�>!*�W>4rYXQ�G-.��A>��b���{�t����|�~���EY!`Ey�/����e�\���[�݅��dI�E���c`U�E�1��L�X�^w��l�/�9�~������ۑx^�܌����g���b-T��(�s������f�C�uBC v�b����}����7B�a���)�Of� ��1�-�4�u��,v�@�/�5_�������%�E��S�Ĕ����%',`A"j��u"k�p���j� ��ꈓ ��J'7�`�=~:��e�9E����ѽn�W �7��F]��DT��bVx��_�^�1���֭�!� ���+��b����ϸ,�HBL�o�����%c�S���aW �%{e�j�_O�y>�+R�c��g���!sy�5���5TQ|v��P�6?��J����|;v�@��0237��]Ъ�_�9��v��_d�t;��6��m͚5%a��]{1�*��W� ����7�ϯ��ئH���$�ރ����Y1� �P>�h��4�t�PDž��Hez�9���7��`��vc��݈q ƁC��|ߺ����K�C$ZI�S��YL���ȧ���:U5��e.O�nh�{9�����r�ś*6��j=�~#m�n��\�Ի!�J�oc�%�1ח���7�.i�H�L@ � |a���z���ҽ���g���;�H�_�,���'�-��БtO0��s�PqL߽{�+ވ�ip;4UU�;u�27d����Ve �Y�Gq�TVV�y�{�,Wʅ����' [���2�|p��X�a��S-UWW[DGyy��n�:��~l�q���X%�bă���@�v�(Ì� e�ܿ�������<>����R�R[��Ǣ���X6l��>��B�o0��G���\1f���!,�Z!�a��:X�\�!��e��c#s�� :+��m�_�}L��}+��ّ����������n19�Q��gi*�K$%>@y��\1v�<tR 6�HE1�VO�v�⾼Lh���W-L�:e��[w�/���MPd~���V˒v,��R�MLL�(JOh��(y<��Q^VՎY�1�.݃qEx�~?�E�����&'�o1n�\ٞ���W�i4��$���U}<ܧy`f �{�l��5�J,]��~�wO�y�������8�ͥH�j�� =�����L��L�i��e;?jHMMU�~v"V��H*�SQV}<�Ƒ�źp?yQw��Vb(ޝ���5L�B��1yG-� i��駩�pn!��0�$:{��*���{x[�G[aj����~�>")�K��[dY+��2��[�]\�����x��p!w"�K�9�GKss�Z�?,`a)fd�U�O��i���;���>�m�������g�����������n9!ڰJ�h����*���b�.�*��z�.673n��۫��z�n��t��X�y*z<��eI¢.� ��0U���1�� �x�^LoL���$��n����떖({@[[���A.>��q2��9o�^��+� y�$����B?����BK��� ��U�$��Py�~%A�����Ծ����r:��|buG�.�atM?K��aR�<n���m���*�6|,R��פ�f�Cש��=�ҝQ �����;�5&go����F� #�c�s��,���S� ������%>�u��)����pe�u��O[�� ??�<�j"���G����s{vcXp�в[���M� �!������m�vH�R�4ixA<�GW�G|b:@�p�����on@��,�/+6�J� k{5�2 _1�~�Ư��W��6��,�Is��j�����f�nU�S,�5%��e��<<h۶��0�/���àڿ���s��#�G#s�7��|��x�����_&�y>7��&O������>q+���$Y���m����^��P�� o��~�3��moV��g�EU��[?⨜��,Ϡ��Pn�&Z���l�H��I0�;�&&'�>���sN{E{�� ��h�#@� � z�@���1PCzVӱ�Q��II���W��E�{��7G����4�o'��iߞ]w�/v�j��P���0�p���g$'��Min^^�"M3M]W��gP��ij����D�٣�o��3�l�y4r�+M��������W����ɨ������ל�.^�5=8"��BL(�����r�����"#��Qa�3��^���-�Z�t�b_T)ʛv���h:�iq�;���v�Fc!54$�y>p�{1���@W��\����Om�?��D���!��n�8!��-�b������YHxyN&���cm�V4y�@R!����S����(��~��=�*E2N p�6����@q/����'���6��2.><��.j�~��B^a��l� ��`�&V��X(b��u�?�ѱH�i�t�@�_$�7�s˚uȃ�$w�NJqj:k ����ޅ�A�[0���Y�7��dp�;��B�� ���o�1� C���j͚�xw�H���z�ez��@�6�:�h�YL��і��`�%bG��;��!�D*:!xz�x½Q��y�'O�٪!"`�T�K~Y9KVXr$)��6IZ�2��QI��Z���\���)�^k#�Z�rj�1���>X�3�����})"h�C4$L�o0^ޔ�\�!4����&��`*�P�s|z��{���UM@݅N0 ��?FL�x�Ʉ��-B�_�� 04D/D���H4�q�;�⏲���LX��.HN5&//���Ӄp!��WJ¼-�K��B�y����Ec^$��g� bP�� ����r�JҏAU�0:� mdI�w+O�7�ŋ�5� Ώ�ڝֲh��B��M.�E�W�HL��Bt�KP����T��_�^`:y_���hw��齎���U�`���6�R\i�|�ݳ&o�q�*�_1bĹ+W�, N��s����z�3L`��7���Y�rp?��|ߘ|��;JN����&��t�i+m08]��HԿKc�j�8 ���������Io�h^E��}�Tf>}f����S�^���K]fm��6+�)�ʽ�CJ���5�����w�%�s�e=���J�N|����%8�n@7r�':�iԩ��9'77���������Lr:>��<��b���(��(��e_���e�Ö�(/���֫Gw�|� �[r!�|>v�"K�m���Lzk��UQ�&3��S�i���)�As~��w��qNjX�q��9�_<�6��e>xiK>��+��W7��x�ɣ1G����!X܍|�>B���sk9LknY�z����ı������ �@�R~~��N��đ'�����tl�c48+oUN��������P>�$! 5���0�9LY��KT0�E�7*it�_b g8|p�N2�L˼.??�Y�s$g|nW�E���4�4���Ͼq��D�z(G�g}% �JӲ���{�`�]?5��|c~[�1Ve�d�8XQ~i����[�a��}���Q��&�|W��oBo��4ݽ1�����;�^/�Q���诗���w(XWh5GV1�p6�ZU8J�%�3�=]���p�5\�퉫L�)wuve��&������B��5e5�%X}��tg7R}^�䊦��0�=�}h���M���7�ůh*X��AQĝ������>�i�N �6�?�*�=a���\�w��(X%9���B:����m��=lMi3El���G-_n���M��%|�&�^e�|ܑ_?�������EN�����s2��R=j�x 9|��:g�z��f�_�|��_���c�S��f�1"-�4 �}���؊ս�yyY��P0��H���~��3��$�@C$%��Q�%'�=�ף��r��K�RL �x����:8�<�%P�O�<���� M9Q���}�.�ֆ 6�4�"����&�,�����``�9���Uٛ"'��|��2�n�I<��4B�GO���x��˃���+���6ԗ�Csh�Unn��Q�����ycFA�}�1w���~��ʽ}瘆����9��#Y��A̝��f+?�D�5�� ~����hh|Na�#yH��[������g(�������Z�a��}0�h$�Z�2/�^s�C�Z �4|�lm�I�"q!M����_���5j5�s!���i��K���F�� �L[�0��ا�W��l�1�x��EjĽ�坷��4M�@�be�[�_6"y�(��݊s�)������$G'S;���s��e`�ȉ��k�]s1@���ݼ�7�[��u�?�&�B��z���vvٞA3�|��Q����?-'}d4R&?��6��4�u��j7㯧�Q\�����YԱ0��"�i���e���H8(��$��B�Mv��;㋱���s���0�/�8��$�2���4c��]�o����y���ϧD]EnznjY1�[����N��H?�(����\Ji�g����dR��S�}�l���T�7Tk����(gP4�N�v�p��ע��+�/��Z��{ϟ"2P֏��7Ln�ň X�Y�ӄM�6�L�Ę-�\q���!�-K��!�})�e���B:c�hZ��Ξ���Yu�i�^��O����?�\b��MҢ!����n���q�P����4H��(�4���:6@��8�t�-�$S�= 2��Sy>a��N��X�$�F4�('�32��#&�m�-��5��GD�S�m;R���a��$;y�عsg_����]D?�$���Y�ă���i������-��,M�o�Bo�iڰ����cwl�2����l��U����R[?�Z|u�����0�Y�C����T�> �,���t�5�ʉ����>U�ި:-d*3�����)�t.�P:�gţ`�X��B�(3�Ѩe�樧ŭ��*'/��*�D�p[��6 <G�Ux����&Sr@E-mT��尃`K�r0��j� ���ۚZ���Wa�lm� =�_�Y�~��q>�a��@K�D��nWYv���M�6"'B�#�$��"��K�r��`�?>?\������'㾔�Q��Ĕ�n�����*!?�`t%ۗH��n�����.��`�~�N�9�e��+���n���*@�֬ �����ͩdξ�9V���f(m0l��r۪��@�2�E��K���ߠ���c�ҥG,�KJ_ �L~hq^�7^��x�,aZd�`E@�@OU$�+߸��*�(��R;OÅ��]3��fL��vI���WD�Ma�큐}���6N��=��EF�V��3h$i�BY�s����*�w4�B:^��<z'����'�?$��Va+8��wd��a��)�f;Q4uc�W]���a06���ໆabn����VU�~��x�tYQ&���6h<%a�>E�Xz�ɏI�y�Y�DR���t���P:���A$��&�,�M�U���A-�<lj'z�B�FWL� y�^K� �%��&�Ζ,��۴�����a$����y�0��:h+���[�*�Q?�G >�(R�{Z�/}$5g-ԅ�+�"��sY������q4tV�f:��#��O̳⇹��S���0w_�Y ������#$]�Z��sEb����c]D�@�'����@�< #w��~V���Š{����J���¥��Z�(�q�Ds����])��R n���ǵ�h��;o���0lz]��0��X;������<~(u��3�3��6yH]zaI�7}�dES4 t�BS�)��נ=��ef�qw>��J��&_8kx��el��A�x�J�ҵ#ʫ�I��6;��&�J���Z�> �]�����Z�����o��B�a�7�9jX?�����aÆ���}�R+a���B����J=�s�Y5��@����h�%%%��+�� j�r� gȶ�6�~���Gz�dK�4����(l:��A����x}(mɗܒ���%��`lXX����[��+k� ��(Z1!f��.|e�a�_᭴(ڪ!�����2��M���>��,��t�%i�}�j����� ؊258~K��v9�W�'��P��.���B�v�r�2��î���8�U�݅ˀH�<h棦����6<�6���_����:d����/�W�k+@�<�Yڕ�D���/y�uV�� � 1 �3���A��� P/$`v�/�kr? 靂%����(&#au+�1�Yc�`e0S����7m��4|�u"� ��+�^����s�M�C� �MY���ن��C-$ J��k4:�����G�۩�b�SEQ�Z�A�L��4F�����8r[n�X�s�� ڈ0J���ڐ�6�� �C�ay^Qx���m�F?�^����]c���`�q�4zD�/��4��#�h�E�l=ќ۔���!�0��2d�?�}� �f��l����q�M$�q����m���hdC�p�!�����Ղ�"�c��:���W=�=D��C���}S�7c�OW��/�g5Bg���-���n�4�+Y�d���P�k�).�ۘ��_����W�ԃ��`՟�S]�u�u��ʦ�(p^r7���x8&��l��Qמ|�����R1�KL5�3I��k!Ċ��`rp��W/*Ì�6��D���,9gVRҸf���˔��ԛ���${�"��� ]��.]����x^�BxWs�Os� �� 6�oJMM�7�� �� v��\oH\��\V�C@M.a%,C�a�j�-��N��kA�'I���;���{�� ���6����4�� ����p�*g��肅��-aѨrl��1W�ED��@� �������5��a�)J���$~�_SRb���:�3���0�C ���o���`T�@=^�,��g����x��xeۆ�8B�ßi��wq���y^�<F-�E�"�ib�p��W��nbNv�&�U���i��Є���[�5")�*����lϧh�4���i���J4����!��n-�R��+�!іj'�v�'��=��i������W��2��jH��R!~���O�~~��k�����_�8�E�^u.��1��� ���I�����?:��s:C��*)�Õ+��7�2�Ԍ,w���/f�u�t��&�Kc&��'?��B���ק�6W=��Zb��Q8F�#Ll��Љ |t����'�t���Ge�{��ѿ�en��ml��}������n��CŘ^�"�q��͗��_[�|'���2/�4>^�%'�*�7#�MP��P�����AC�2��/�����R3ͪ���� �&\䆵;6���K�Wa!�>�u���T.',�]�$����3]/�6..·/��v�^b��n�p�Vc�8��� !�2�;��a��팎h���^���MuK�E�ޭ��z7)i��C�����4N��Ϯp-�,���jU����1������h>�Nj�O1�|:�cq�X��<���ḅ����E?�44:�!��*HI��\��ȓ���>���ގi�������gFl+��)��>�9�t��|�j�V$�[�4rlE���:��#>H��0E�aΊ&M.�٥)�i��d�֔�TXg=���h�s����$Y��L�>���u���F�ug=��; ��Nď�6��+SV+%���\x4���'0I�W�G]����.g��B���d|ൽ�*��"������{����s�k�&͡!N+�.N@x��F-��(�8&��aUg6�h��J��P�k�@@qk���=�Ms�;#�|�>��#�8y�F��|�=� r1/j���UC��_��Gi�W�\-���.������`#3 @ �~dN�*p�� v{����S~�ʏ�Oݠ~'��s�ϑ5u�z��`�~������K���s���� ����%�;�d��^]=��� �"��� `>a9�[�� i��4�4�0 m�����r~"^5�,M�Q��ows�;���}����U���gT�X����\`����B��~m�q�} �����*ޭ=�7k�l�W'��:�8�l��lָG�6wi��W5�@�PC]�!�˒2~���mJ+�B�_�@ Ӓd��~�Ņ�%.��G/��N��'>-<]�j�<���h9�{��5A0�ć�L���q=.>l��B�I#�m�V���������'B.���"����"�[���X� I��S2��D���(; ~���� �����a� ��*�>��X�1�F �!�Y��|x �c��@��*�꺑I��OE����1N�q��<��@<�\��&����%P6�(�+my�b���ܺuM�-���^^���dL��Ļ���0�v�[��v{@h�6@}u��>���v���>��B�� �`��⽼������|�L(U�A�P_n���S��L�xG�]�;%Yb��'��;W㓒X���[:}�{�A��@'d��R0�r�Y��d��D�6R������ܲ�F]R:-���d�:��:�I�V+��'�oրP��a�D���S|��x��hlb4"��w%42PW��8�)\oF�,�����]�鲡)#\ ��+�/Ɲ�#a���j��A_��_�h}�(�}��]�o�R�iI���;����&El 8֩|)��d�z�\7&��q���7�@3��ō�-�����^�����#0h�An�j�iA�JpF5\�34�M8�DZ� }5y�u ��e�B�鳟��Ow**��ܡ}�S�9+�\;�a�DS�?��/��5xX]n<i�{��;u����,��&�אh�TԼ�Qn69�%'�Y^�`K ��) xwY����C�P�A��HBs�Z�����\ ��Y'�zI��IG��Tj����0�q�M ����5�PgjO��}�A9>x���k]~V��|����!�>N�c�����Еt��-O��R2��X}0o�"���0u�ؙ��k��ZG��=�������Dp���I�X�؆�����ʱW5�#��ȑcN�W�z�}�UbC>>RT�㫟��@�h���T�p�h�����p�H�^�VI-K X��p���ڕ+5�Po�ja[|��K�l*���i+v~P�b��� �?��?k>��ų ��)�)OH���֟��"��ǂ�����Uv��$ł-����U��,��S~��란3��7n�����X>|�k���� >�����g���$S��YV8�щbc�q��y��`(k�._rm��0�Z�U�p{lZ�E��H��W6�+���@��"h �oKN�`2[ � J�lK�.x�ք��<��-� Y��b.��;9d����A�\M0͒�v-�},�bh`=�o;�rd� ��.|�Ye�B? �p?V����s>�u����o�ס�f�>�a���K�2���܀R���?W�����$`aR�aɁdK�@��H� ��]%ZGHj�V��ǝXa��"i��>�ap�^��U��Y���Z��^c!qM�����`�m#_�P�2^Z�b��j�@*izK:/�5"-ui�]�8���t~Q���C�&І�28\u�g��E��v�T|G�����O7X���n��dI���% a�Ȁ���;�*m�qŔT��-��tY���rt�]2�Z�X�,dH�?Z��h�=b�q��bi��L7�Bϔ�|�� 뭰��՜����>z4�AfZ�i/Z��hBz�gYSe<�h֨���m��b��"�8�A����N�ے{���O���g��M�-��*���c��/��RV��a�C�3��Cm?��[�R�-ƁZ������ ^��qZA���@�f���⺞���M�\1�&<��g�ߔ�4��=-��"R�C�f���s)�"ŋݏq ƁC�!�}��G��z/6 ��� ���Z Ba�ga���h��֨zɄ>�4�yȚ�:��J�*��\ly����L��5芕�@�-ǁ��b�<�y��89;j��vj�S�%7>�5��s��� U�}� ٘ �ע��z�x&'��+��AR�1�8ā�W����IEND�B`�PK���\,�Aɧ�.templates/protostar/images/system/sort_asc.pngnu�[����PNG IHDR�[A�PLTE���333222333222333���:tRNS��ߚ���;IDATx^c��d�*) �[�����9a@�JZ2sZ s��Y2�1��)�� ���lIEND�B`�PK���\G%7�1templates/protostar/images/system/rating_star.pngnu�[����PNG IHDRa���WPLTE�M�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�N�tRNS '*8LMNO[\gim��������u3��VIDATx^M�G� �������9�3�²A���bp]�e)��.�k�ӼX�94��i�� B��Nj�z�|{gN�N������i� ��IEND�B`�PK���\��)�7templates/protostar/images/system/rating_star_blank.pngnu�[����PNG IHDRa���WPLTEDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD+�u�tRNS\��8[ON� '��MLm���*��ig�H�TTIDATx^E� �0�Q�9����c�5�P��H���ZG��·ރw� ���E�p3a��BX^�[m�n+c���'�Y���/��^0%IEND�B`�PK���\b�K��/templates/protostar/images/system/sort_desc.pngnu�[����PNG IHDR�[A�PLTE���333222333222333���:tRNS��ߚ���?IDATx^c�`��l���f�`�̠��̜������䦥(0�@��0�F���D ״��IEND�B`�PK���\c��� � 'templates/protostar/templateDetails.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE install PUBLIC "-//Joomla! 2.5//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/2.5/template-install.dtd"> <extension version="3.1" type="template" client="site"> <name>protostar</name> <version>1.0</version> <creationDate>4/30/2012</creationDate> <author>Kyle Ledbetter</author> <authorEmail>admin@joomla.org</authorEmail> <copyright>Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.</copyright> <description>TPL_PROTOSTAR_XML_DESCRIPTION</description> <files> <filename>component.php</filename> <filename>error.php</filename> <filename>favicon.ico</filename> <filename>index.php</filename> <filename>templateDetails.xml</filename> <filename>template_preview.png</filename> <filename>template_thumbnail.png</filename> <folder>css</folder> <folder>html</folder> <folder>images</folder> <folder>img</folder> <folder>js</folder> <folder>language</folder> <folder>less</folder> </files> <positions> <position>banner</position> <position>debug</position> <position>position-0</position> <position>position-1</position> <position>position-2</position> <position>position-3</position> <position>position-4</position> <position>position-5</position> <position>position-6</position> <position>position-7</position> <position>position-8</position> <position>position-9</position> <position>position-10</position> <position>position-11</position> <position>position-12</position> <position>position-13</position> <position>position-14</position> <position>footer</position> </positions> <languages folder="language"> <language tag="en-GB">en-GB/en-GB.tpl_protostar.ini</language> <language tag="en-GB">en-GB/en-GB.tpl_protostar.sys.ini</language> </languages> <config> <fields name="params"> <fieldset name="advanced"> <field name="templateColor" class="" type="color" default="#08C" label="TPL_PROTOSTAR_COLOR_LABEL" description="TPL_PROTOSTAR_COLOR_DESC" /> <field name="templateBackgroundColor" class="" type="color" default="#F4F6F7" label="TPL_PROTOSTAR_BACKGROUND_COLOR_LABEL" description="TPL_PROTOSTAR_BACKGROUND_COLOR_DESC" /> <field name="logoFile" class="" type="media" default="" label="TPL_PROTOSTAR_LOGO_LABEL" description="TPL_PROTOSTAR_LOGO_DESC" /> <field name="sitetitle" type="text" default="" label="JGLOBAL_TITLE" description="JFIELD_ALT_PAGE_TITLE_LABEL" filter="string" /> <field name="sitedescription" type="text" default="" label="JGLOBAL_DESCRIPTION" description="JGLOBAL_SUBHEADING_DESC" filter="string" /> <field name="googleFont" type="radio" class="btn-group btn-group-yesno" default="1" label="TPL_PROTOSTAR_FONT_LABEL" description="TPL_PROTOSTAR_FONT_DESC" > <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="googleFontName" class="" type="text" default="Open+Sans" label="TPL_PROTOSTAR_FONT_NAME_LABEL" description="TPL_PROTOSTAR_FONT_NAME_DESC" /> <field name="fluidContainer" type="radio" class="btn-group btn-group-yesno" default="0" label="TPL_PROTOSTAR_FLUID_LABEL" description="TPL_PROTOSTAR_FLUID_DESC" > <option value="1">TPL_PROTOSTAR_FLUID</option> <option value="0">TPL_PROTOSTAR_STATIC</option> </field> </fieldset> </fields> </config> </extension> PK���\1L�D��templates/beez3/error.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $showRightColumn = 0; $showleft = 0; $showbottom = 0; // Get params $app = JFactory::getApplication(); $params = $app->getTemplate(true)->params; $logo = $params->get('logo'); $color = $params->get('templatecolor'); $navposition = $params->get('navposition'); // Get language and direction $doc = JFactory::getDocument(); $this->language = $doc->language; $this->direction = $doc->direction; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $this->error->getCode(); ?> - <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></title> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/system.css" type="text/css" /> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/error.css" type="text/css" /> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/position.css" type="text/css" media="screen,projection" /> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/layout.css" type="text/css" media="screen,projection" /> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/print.css" type="text/css" media="Print" /> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/<?php echo htmlspecialchars($color); ?>.css" type="text/css" /> <?php $files = JHtml::_('stylesheet', 'templates/' . $this->template . '/css/general.css', null, false, true); ?> <?php if ($files) : ?> <?php if (!is_array($files)) : ?> <?php $files = array($files); ?> <?php endif; ?> <?php foreach ($files as $file) : ?> <link rel="stylesheet" href="<?php echo $file; ?>" type="text/css" /> <?php endforeach; ?> <?php endif; ?> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/<?php echo htmlspecialchars($color); ?>.css" type="text/css" /> <?php if ($this->direction == 'rtl') : ?> <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/template_rtl.css" type="text/css" /> <?php if (file_exists(JPATH_SITE . '/templates/' . $this->template . '/css/' . $color . '_rtl.css')) : ?> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/<?php echo $color ?>_rtl.css" type="text/css" /> <?php endif; ?> <?php endif; ?> <?php if ($app->get('debug_lang', '0') == '1' || $app->get('debug', '0') == '1') : ?> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/media/cms/css/debug.css" type="text/css" /> <?php endif; ?> <!--[if lte IE 6]> <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/ieonly.css" rel="stylesheet" type="text/css" /> <![endif]--> <!--[if IE 7]> <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/ie7only.css" rel="stylesheet" type="text/css" /> <![endif]--> <!--[if lt IE 9]> <script src="<?php echo JUri::root(true); ?>/media/jui/js/html5.js"></script> <![endif]--> <style type="text/css"> <!-- #errorboxbody {margin:30px} #errorboxbody h2 {font-weight:normal; font-size:1.5em} #searchbox {background:#eee; padding:10px; margin-top:20px; border:solid 1px #ddd } --> </style> </head> <body> <div id="all"> <div id="back"> <div id="header"> <div class="logoheader"> <h1 id="logo"> <?php if ($logo) : ?> <img src="<?php echo $this->baseurl; ?>/<?php echo htmlspecialchars($logo); ?>" alt="<?php echo htmlspecialchars($params->get('sitetitle')); ?>" /> <?php else : ?> <?php echo htmlspecialchars($params->get('sitetitle')); ?> <?php endif; ?> <span class="header1"> <?php echo htmlspecialchars($params->get('sitedescription')); ?> </span> </h1> </div><!-- end logoheader --> <ul class="skiplinks"> <li> <a href="#wrapper2" class="u2"> <?php echo JText::_('TPL_BEEZ3_SKIP_TO_ERROR_CONTENT'); ?> </a> </li> <li> <a href="#nav" class="u2"> <?php echo JText::_('TPL_BEEZ3_ERROR_JUMP_TO_NAV'); ?> </a> </li> </ul> <div id="line"> </div><!-- end line --> </div><!-- end header --> <div id="contentarea2" > <div class="left1" id="nav"> <h2 class="unseen"> <?php echo JText::_('TPL_BEEZ3_NAVIGATION'); ?> </h2> <?php $module = JModuleHelper::getModule('menu'); ?> <?php echo JModuleHelper::renderModule($module); ?> </div><!-- end navi --> <div id="wrapper2"> <div id="errorboxbody"> <h2> <?php echo JText::_('JERROR_LAYOUT_PAGE_NOT_FOUND'); ?> </h2> <h3><?php echo JText::_('JERROR_LAYOUT_ERROR_HAS_OCCURRED_WHILE_PROCESSING_YOUR_REQUEST'); ?></h3> <p><?php echo JText::_('JERROR_LAYOUT_NOT_ABLE_TO_VISIT'); ?></p> <ul> <li><?php echo JText::_('JERROR_LAYOUT_AN_OUT_OF_DATE_BOOKMARK_FAVOURITE'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_MIS_TYPED_ADDRESS'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_SEARCH_ENGINE_OUT_OF_DATE_LISTING'); ?></li> <li><?php echo JText::_('JERROR_LAYOUT_YOU_HAVE_NO_ACCESS_TO_THIS_PAGE'); ?></li> </ul> <?php if (JModuleHelper::getModule('search')) : ?> <div id="searchbox"> <h3 class="unseen"> <?php echo JText::_('TPL_BEEZ3_SEARCH'); ?> </h3> <p> <?php echo JText::_('JERROR_LAYOUT_SEARCH'); ?> </p> <?php $module = JModuleHelper::getModule('search'); ?> <?php echo JModuleHelper::renderModule($module); ?> </div><!-- end searchbox --> <?php endif; ?> <div><!-- start gotohomepage --> <p> <a href="<?php echo $this->baseurl; ?>/index.php" title="<?php echo JText::_('JERROR_LAYOUT_GO_TO_THE_HOME_PAGE'); ?>"><?php echo JText::_('JERROR_LAYOUT_HOME_PAGE'); ?></a> </p> </div><!-- end gotohomepage --> <h3> <?php echo JText::_('JERROR_LAYOUT_PLEASE_CONTACT_THE_SYSTEM_ADMINISTRATOR'); ?> </h3> <h2>#<?php echo $this->error->getCode(); ?> <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?> </h2> <br /> </div><!-- end errorboxbody --> </div><!-- end wrapper2 --> </div><!-- end contentarea2 --> <?php if ($this->debug) : echo $this->renderBacktrace(); endif; ?> </div><!--end back --> </div><!--end all --> <div id="footer-outer"> <div id="footer-sub"> <div id="footer"> <p> <?php echo JText::_('TPL_BEEZ3_POWERED_BY'); ?> <a href="http://www.joomla.org/"> Joomla!® </a> </p> </div><!-- end footer --> </div><!-- end footer-sub --> </div><!-- end footer-outer--> </body> </html> PK���\9Ɔ�7templates/beez3/html/com_content/categories/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Template.beez5 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); JHtml::addIncludePath(JPATH_COMPONENT.'/helpers'); JHtml::_('behavior.caption'); ?> <div class="categories-list<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_base_description')) : ?> <?php //If there is a description in the menu parameters use that; ?> <?php if ($this->params->get('categories_description')) : ?> <?php echo JHtml::_('content.prepare', $this->params->get('categories_description'), '', 'com_content.categories'); ?> <?php else: ?> <?php //Otherwise get one from the database if it exists. ?> <?php if ($this->parent->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $this->parent->description, '', 'com_content.categories'); ?> </div> <?php endif; ?> <?php endif; ?> <?php endif; ?> <?php echo $this->loadTemplate('items'); ?> </div> PK���\?mM��=templates/beez3/html/com_content/categories/default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_content * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; $class = ' class="first"'; if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : ?> <ul> <?php foreach ($this->items[$this->parent->id] as $id => $item) : ?> <?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : if (!isset($this->items[$this->parent->id][$id + 1])) { $class = ' class="last"'; } ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <h3 class="item-title"><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id));?>"> <?php echo $this->escape($item->title); ?></a> </h3> <?php if ($this->params->get('show_subcat_desc_cat') == 1) :?> <?php if ($item->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $item->description); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_cat_num_articles_cat') == 1) :?> <dl class="article-count"><dt> <?php echo JText::_('COM_CONTENT_NUM_ITEMS'); ?></dt> <dd><?php echo $item->numitems; ?></dd> </dl> <?php endif; ?> <?php if (count($item->getChildren()) > 0) : $this->items[$item->id] = $item->getChildren(); $this->parent = $item; $this->maxLevelcat--; echo $this->loadTemplate('items'); $this->parent = $item->getParent(); $this->maxLevelcat++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> PK���\�]��[[;templates/beez3/html/com_content/featured/default_links.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <h3><?php echo JText::_('COM_CONTENT_MORE_ARTICLES'); ?></h3> <ol class="links"> <?php foreach ($this->link_items as &$item) : ?> <li> <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>"> <?php echo $item->title; ?></a> </li> <?php endforeach; ?> </ol> PK���\@t�ͭ � 5templates/beez3/html/com_content/featured/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); JHtml::_('behavior.caption'); ?> <section class="blog-featured<?php echo $this->pageclass_sfx;?>"> <?php if ( $this->params->get('show_page_heading') != 0) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php $leadingcount = 0; ?> <?php if (!empty($this->lead_items)) : ?> <div class="items-leading"> <?php foreach ($this->lead_items as &$item) : ?> <article class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"> <?php $this->item = &$item; echo $this->loadTemplate('item'); ?> </article> <?php $leadingcount++; ?> <?php endforeach; ?> </div> <?php endif; ?> <?php $introcount = (count($this->intro_items)); $counter = 0; ?> <?php if (!empty($this->intro_items)) : ?> <?php foreach ($this->intro_items as $key => &$item) : ?> <?php $key = ($key - $leadingcount) + 1; $rowcount = (((int) $key - 1) % (int) $this->columns) + 1; $row = $counter / $this->columns; if ($rowcount == 1) : ?> <div class="items-row cols-<?php echo (int) $this->columns;?> <?php echo 'row-'.$row; ?>"> <?php endif; ?> <article class="item column-<?php echo $rowcount;?><?php echo $item->state == 0 ? ' system-unpublished"' : null; ?>"> <?php $this->item = &$item; echo $this->loadTemplate('item'); ?> </article> <?php $counter++; ?> <?php if (($rowcount == $this->columns) or ($counter == $introcount)) : ?> <span class="row-separator"></span> </div> <?php endif; ?> <?php endforeach; ?> <?php endif; ?> <?php if (!empty($this->link_items)) : ?> <div class="items-more"> <?php echo $this->loadTemplate('links'); ?> </div> <?php endif; ?> <?php if ($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2 && $this->pagination->pagesTotal > 1)) : ?> <div class="pagination"> <?php if ($this->params->def('show_pagination_results', 1)) : ?> <p class="counter"> <?php echo $this->pagination->getPagesCounter(); ?> </p> <?php endif; ?> <?php echo $this->pagination->getPagesLinks(); ?> </div> <?php endif; ?> </section> PK���\ǐ7���:templates/beez3/html/com_content/featured/default_item.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Create a shortcut for params. $canEdit = $this->item->params->get('access-edit'); $params = &$this->item->params; $images = json_decode($this->item->images); $app = JFactory::getApplication(); $templateparams = $app->getTemplate(true)->params; ?> <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate()) || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?> <div class="system-unpublished"> <?php endif; ?> <?php if ($params->get('show_title')) : ?> <h2> <?php if ($params->get('link_titles') && $params->get('access-view')) : ?> <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); ?>"> <?php echo $this->escape($this->item->title); ?></a> <?php else : ?> <?php echo $this->escape($this->item->title); ?> <?php endif; ?> </h2> <?php endif; ?> <?php if ($params->get('show_print_icon') || $params->get('show_email_icon') || $canEdit) : ?> <ul class="actions"> <?php if ($params->get('show_print_icon')) : ?> <li class="print-icon"> <?php echo JHtml::_('icon.print_popup', $this->item, $params, array(), true); ?> </li> <?php endif; ?> <?php if ($params->get('show_email_icon')) : ?> <li class="email-icon"> <?php echo JHtml::_('icon.email', $this->item, $params, array(), true); ?> </li> <?php endif; ?> <?php if ($canEdit) : ?> <li class="edit-icon"> <?php echo JHtml::_('icon.edit', $this->item, $params, array(), true); ?> </li> <?php endif; ?> </ul> <?php endif; ?> <?php if (!$params->get('show_intro')) : ?> <?php echo $this->item->event->afterDisplayTitle; ?> <?php endif; ?> <?php echo $this->item->event->beforeDisplayContent; ?> <?php // to do not that elegant would be nice to group the params ?> <?php if (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_parent_category')) or ($params->get('show_hits'))) : ?> <dl class="article-info"> <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt> <?php endif; ?> <?php if ($params->get('show_parent_category') && $this->item->parent_id != 1) : ?> <dd class="parent-category-name"> <?php $title = $this->escape($this->item->parent_title); $title = ($title) ? $title : JText::_('JGLOBAL_UNCATEGORISED'); $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)) . '">' . $title . '</a>'; ?> <?php if ($params->get('link_parent_category') and $this->item->parent_slug) : ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_category')) : ?> <dd class="category-name"> <?php $title = $this->escape($this->item->category_title); $title = ($title) ? $title : JText::_('JGLOBAL_UNCATEGORISED'); $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';?> <?php if ($params->get('link_category') and $this->item->catslug) : ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_create_date')) : ?> <dd class="create"> <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_modify_date')) : ?> <dd class="modified"> <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_publish_date')) : ?> <dd class="published"> <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_author') && !empty($this->item->author )) : ?> <dd class="createdby"> <?php $author = $this->item->author; ?> <?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?> <?php if (!empty($this->item->contact_link ) && $params->get('link_author') == true) : ?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author)); ?> <?php else :?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_hits')) : ?> <dd class="hits"> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?> </dd> <?php endif; ?> <?php if (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_parent_category')) or ($params->get('show_hits'))) : ?> </dl> <?php endif; ?> <?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?> <?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?> <div class="img-intro-<?php echo htmlspecialchars($imgfloat); ?>"> <img <?php if ($images->image_intro_caption): echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"'; endif; ?> src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/> </div> <?php endif; ?> <?php echo $this->item->introtext; ?> <?php if ($params->get('show_readmore') && $this->item->readmore) : if ($params->get('access-view')) : $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); else : $menu = JFactory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); $link->setVar('return', base64_encode(JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language), false))); endif; ?> <p class="readmore"> <a href="<?php echo $link; ?>"> <?php if (!$params->get('access-view')) : echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); elseif ($readmore = $this->item->alternative_readmore) : echo $readmore; if ($params->get('show_readmore_title', 0) != 0) : echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit')); endif; elseif ($params->get('show_readmore_title', 0) == 0) : echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE'); else : echo JText::_('COM_CONTENT_READ_MORE'); echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit')); endif; ?></a> </p> <?php endif; ?> <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate()) || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?> </div> <?php endif; ?> <div class="item-separator"></div> <?php echo $this->item->event->afterDisplayContent; ?> PK���\X��K�'�'.templates/beez3/html/com_content/form/edit.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; JHtml::_('behavior.keepalive'); JHtml::_('behavior.calendar'); JHtml::_('behavior.formvalidation'); // Create shortcut to parameters. $params = $this->state->get('params'); //$images = json_decode($this->item->images); //$urls = json_decode($this->item->urls); // This checks if the editor config options have ever been saved. If they haven't they will fall back to the original settings. $editoroptions = isset($params->show_publishing_options); if (!$editoroptions): $params->show_urls_images_frontend = '0'; endif; ?> <script type="text/javascript"> Joomla.submitbutton = function(task) { if (task == 'article.cancel' || document.formvalidator.isValid(document.getElementById('adminForm'))) { <?php echo $this->form->getField('articletext')->save(); ?> Joomla.submitform(task); } } </script> <div class="edit item-page<?php echo $this->pageclass_sfx; ?>"> <?php if ($params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($params->get('page_heading')); ?> </h1> <?php endif; ?> <form action="<?php echo JRoute::_('index.php?option=com_content&a_id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate"> <fieldset> <legend><?php echo JText::_('COM_CONTENT_ARTICLE_CONTENT'); ?></legend> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('title'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('title'); ?> </div> </div> <?php if (is_null($this->item->id)):?> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('alias'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('alias'); ?> </div> </div> <?php endif; ?> <div class="btn-group"> <button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('article.save')"> <?php echo JText::_('JSAVE') ?> </button> <button type="button" class="btn" onclick="Joomla.submitbutton('article.cancel')"> <?php echo JText::_('JCANCEL') ?> </button> </div> <?php echo $this->form->getInput('articletext'); ?> </fieldset> <?php if ($params->get('show_urls_images_frontend') ) : ?> <fieldset> <legend><?php echo JText::_('COM_CONTENT_IMAGES_AND_URLS'); ?></legend> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('image_intro', 'images'); ?> <?php echo $this->form->getInput('image_intro', 'images'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('image_intro_alt', 'images'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('image_intro_alt', 'images'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('image_intro_caption', 'images'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('image_intro_caption', 'images'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('float_intro', 'images'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('float_intro', 'images'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('image_fulltext', 'images'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('image_fulltext', 'images'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('image_fulltext_alt', 'images'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('image_fulltext_alt', 'images'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('image_fulltext_caption', 'images'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('image_fulltext_caption', 'images'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('float_fulltext', 'images'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('float_fulltext', 'images'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('urla', 'urls'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('urla', 'urls'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('urlatext', 'urls'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('urlatext', 'urls'); ?> </div> </div> <div class="control-group"> <div class="controls"> <?php echo $this->form->getInput('targeta', 'urls'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('urlb', 'urls'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('urlb', 'urls'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('urlbtext', 'urls'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('urlbtext', 'urls'); ?> </div> </div> <div class="control-group"> <div class="controls"> <?php echo $this->form->getInput('targetb', 'urls'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('urlc', 'urls'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('urlc', 'urls'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('urlctext', 'urls'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('urlctext', 'urls'); ?> </div> </div> <div class="control-group"> <div class="controls"> <?php echo $this->form->getInput('targetc', 'urls'); ?> </div> </div> </fieldset> <?php endif; ?> <fieldset> <legend><?php echo JText::_('COM_CONTENT_PUBLISHING'); ?></legend> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('catid'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('catid'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('tags'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('tags'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('created_by_alias'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('created_by_alias'); ?> </div> </div> <?php if ($this->item->params->get('access-change')) : ?> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('state'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('state'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('featured'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('featured'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('publish_up'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('publish_up'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('publish_down'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('publish_down'); ?> </div> </div> <?php endif; ?> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('access'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('access'); ?> </div> </div> <?php if (is_null($this->item->id)):?> <div class="control-group"> <div class="control-label"> </div> <div class="controls"> <?php echo JText::_('COM_CONTENT_ORDERING'); ?> </div> </div> <?php endif; ?> </fieldset> <fieldset> <legend><?php echo JText::_('JFIELD_LANGUAGE_LABEL'); ?></legend> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('language'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('language'); ?> </div> </div> </fieldset> <fieldset> <legend><?php echo JText::_('COM_CONTENT_METADATA'); ?></legend> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('metadesc'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('metadesc'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('metakey'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('metakey'); ?> </div> </div> <input type="hidden" name="task" value="" /> <input type="hidden" name="return" value="<?php echo $this->return_page;?>" /> <?php if ($this->params->get('enable_category', 0) == 1) : ?> <input type="hidden" name="jform[catid]" value="<?php echo $this->params->get('catid', 1);?>"/> <?php endif;?> <?php echo JHtml::_('form.token'); ?> </fieldset> </form> </div> PK���\��k� ;templates/beez3/html/com_content/category/blog_children.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $templateparams = $app->getTemplate(true)->params; $class = ' class="first"'; ?> <?php if (count($this->children[$this->category->id]) > 0) : ?> <ul> <?php foreach ($this->children[$this->category->id] as $id => $child) : ?> <?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : if (!isset($this->children[$this->category->id][$id + 1])) : $class = ' class="last"'; endif; ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id));?>"> <?php echo $this->escape($child->title); ?></a> </span> <?php if ($this->params->get('show_subcat_desc') == 1) :?> <?php if ($child->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $child->description, '', 'com_content.category'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ( $this->params->get('show_cat_num_articles', 1)) : ?> <dl> <dt> <?php echo JText::_('COM_CONTENT_NUM_ITEMS'); ?> </dt> <dd> <?php echo $child->getNumItems(true); ?> </dd> </dl> <?php endif; ?> <?php if (count($child->getChildren()) > 0): $this->children[$child->id] = $child->getChildren(); $this->category = $child; $this->maxLevel--; if ($this->maxLevel != 0) : echo $this->loadTemplate('children'); endif; $this->category = $child->getParent(); $this->maxLevel++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> PK���\��k��>templates/beez3/html/com_content/category/default_articles.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.framework'); $n = count($this->items); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> <?php if (empty($this->items)) : ?> <?php if ($this->params->get('show_no_articles', 1)) : ?> <p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p> <?php endif; ?> <?php else : ?> <form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm"> <?php if ($this->params->get('filter_field') != 'hide') : ?> <fieldset class="filters"> <legend class="hidelabeltxt"> <?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?> </legend> <div class="filter-search"> <label class="filter-search-lbl" for="filter-search"><?php echo JText::_('COM_CONTENT_'.$this->params->get('filter_field').'_FILTER_LABEL').' '; ?></label> <input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>" /> </div> <?php endif; ?> <?php if ($this->params->get('show_pagination_limit')) : ?> <div class="display-limit"> <?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>  <?php echo $this->pagination->getLimitBox(); ?> </div> <?php endif; ?> <?php if ($this->params->get('filter_field') != 'hide') :?> </fieldset> <?php endif; ?> <div class="clr"></div> <table class="category"> <?php if ($this->params->get('show_headings')) :?> <thead> <tr> <th class="list-title" id="tableOrdering"> <?php echo JHtml::_('grid.sort', 'COM_CONTENT_HEADING_TITLE', 'a.title', $listDirn, $listOrder); ?> </th> <?php if ($date = $this->params->get('list_show_date')) : ?> <th class="list-date" id="tableOrdering2"> <?php if ($date == "created") : ?> <?php echo JHtml::_('grid.sort', 'COM_CONTENT_'.$date.'_DATE', 'a.created', $listDirn, $listOrder); ?> <?php elseif ($date == "modified") : ?> <?php echo JHtml::_('grid.sort', 'COM_CONTENT_'.$date.'_DATE', 'a.modified', $listDirn, $listOrder); ?> <?php elseif ($date == "published") : ?> <?php echo JHtml::_('grid.sort', 'COM_CONTENT_'.$date.'_DATE', 'a.publish_up', $listDirn, $listOrder); ?> <?php endif; ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_author', 1)) : ?> <th class="list-author" id="tableOrdering3"> <?php echo JHtml::_('grid.sort', 'JAUTHOR', 'author', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_hits', 1)) : ?> <th class="list-hits" id="tableOrdering4"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?> </th> <?php endif; ?> </tr> </thead> <?php endif; ?> <tbody> <?php foreach ($this->items as $i => &$article) : ?> <tr class="cat-list-row<?php echo $i % 2; ?>"> <?php if (in_array($article->access, $this->user->getAuthorisedViewLevels())) : ?> <td class="list-title"> <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language)); ?>"> <?php echo $this->escape($article->title); ?></a> </td> <?php if ($this->params->get('list_show_date')) : ?> <td class="list-date"> <?php echo JHtml::_( 'date', $article->displayDate, $this->escape( $this->params->get('date_format', JText::_('DATE_FORMAT_LC3')) ) ); ?> </td> <?php endif; ?> <?php if ($this->params->get('list_show_author', 1)) : ?> <td class="list-author"> <?php if (!empty($article->author) || !empty($article->created_by_alias)) : ?> <?php $author = $article->author ?> <?php $author = ($article->created_by_alias ? $article->created_by_alias : $author);?> <?php if (!empty($article->contact_link ) && $this->params->get('link_author') == true):?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $article->contact_link, $author)); ?> <?php else :?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?> <?php endif; ?> <?php endif; ?> </td> <?php endif; ?> <?php if ($this->params->get('list_show_hits', 1)) : ?> <td class="list-hits"> <?php echo $article->hits; ?> </td> <?php endif; ?> <?php else : ?> <td> <?php echo $this->escape($article->title) . ' : '; $menu = JFactory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); $link->setVar('return', base64_encode(JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language), false))); ?> <a href="<?php echo $link; ?>" class="register"> <?php echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); ?></a> </td> <?php endif; ?> </tr> <?php endforeach; ?> </tbody> </table> <?php endif; ?> <?php // Code to add a link to submit an article. ?> <?php if ($this->category->getParams()->get('access-create')) : ?> <?php echo JHtml::_('icon.create', $this->category, $this->category->params, array(), true); ?> <?php endif; ?> <?php // Add pagination links ?> <?php if (!empty($this->items)) : ?> <?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?> <div class="pagination"> <?php if ($this->params->def('show_pagination_results', 1)) : ?> <p class="counter"> <?php echo $this->pagination->getPagesCounter(); ?> </p> <?php endif; ?> <?php echo $this->pagination->getPagesLinks(); ?> </div> <?php endif; ?> <div> <input type="hidden" name="task" value="" /> <input type="hidden" name="filter_order" value="" /> <input type="hidden" name="filter_order_Dir" value="" /> <input type="hidden" name="limitstart" value="" /> </div> </form> <?php endif; ?> PK���\Dd�h2templates/beez3/html/com_content/category/blog.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $templateparams = $app->getTemplate(true)->params; JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); JHtml::_('behavior.caption'); $cparams = JComponentHelper::getParams('com_media'); // If the page class is defined, add to class as suffix. // It will be a separate class if the user starts it with a space ?> <section class="blog<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading') != 0) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_category_title')) : ?> <h2 class="subheading-category"> <?php echo JHtml::_('content.prepare', $this->category->title, '', 'com_content.category.title'); ?> </h2> <?php endif; ?> <?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?> <div class="category-desc"> <?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?> <img src="<?php echo $this->category->getParams()->get('image'); ?>"/> <?php endif; ?> <?php if ($this->params->get('show_description') && $this->category->description) : ?> <?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?> <?php if (empty($this->lead_items) && empty($this->link_items) && empty($this->intro_items)) : ?> <?php if ($this->params->get('show_no_articles', 1)) : ?> <p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p> <?php endif; ?> <?php endif; ?> <?php $leadingcount = 0; ?> <?php if (!empty($this->lead_items)) : ?> <div class="items-leading"> <?php foreach ($this->lead_items as &$item) : ?> <article class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? 'system-unpublished' : null; ?>"> <?php $this->item = &$item; echo $this->loadTemplate('item'); ?> </article> <?php $leadingcount++; ?> <?php endforeach; ?> </div> <?php endif; ?> <?php $introcount = (count($this->intro_items)); $counter = 0; ?> <?php if (!empty($this->intro_items)) : ?> <?php foreach ($this->intro_items as $key => &$item) : ?> <?php $rowcount = ((int) $key % (int) $this->columns) + 1; ?> <?php if ($rowcount == 1) : ?> <?php $row = $counter / $this->columns; ?> <div class="items-row cols-<?php echo (int) $this->columns;?> <?php echo 'row-'.$row; ?>"> <?php endif; ?> <article class="item column-<?php echo $rowcount;?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"> <?php $this->item = &$item; echo $this->loadTemplate('item'); ?> </article> <?php $counter++; ?> <?php if (($rowcount == $this->columns) or ($counter == $introcount)) : ?> <span class="row-separator"></span> </div> <?php endif; ?> <?php endforeach; ?> <?php endif; ?> <?php if (!empty($this->link_items)) : ?> <?php echo $this->loadTemplate('links'); ?> <?php endif; ?> <?php if (is_array($this->children[$this->category->id]) && count($this->children[$this->category->id]) > 0 && $this->params->get('maxLevel') != 0) : ?> <div class="cat-children"> <?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?> <h3> <?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?> </h3> <?php endif; ?> <?php echo $this->loadTemplate('children'); ?> </div> <?php endif; ?> <?php if (($this->params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?> <div class="pagination"> <?php if ($this->params->def('show_pagination_results', 1)) : ?> <p class="counter"> <?php echo $this->pagination->getPagesCounter(); ?> </p> <?php endif; ?> <?php echo $this->pagination->getPagesLinks(); ?> </div> <?php endif; ?> </section> PK���\�����5templates/beez3/html/com_content/category/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $templateparams = $app->getTemplate(true)->params; JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); JHtml::_('behavior.caption'); $pageClass = $this->params->get('pageclass_sfx'); ?> <section class="category-list<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading')) : ?> <?php if ($this->params->get('show_page_heading') and ($this->params->get('show_category_title') or $this->params->get('page_subheading'))) : ?> <hgroup> <?php endif; ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_category_title') or $this->params->get('page_subheading')) : ?> <h2> <?php echo $this->escape($this->params->get('page_subheading')); ?> <?php if ($this->params->get('show_category_title')) { echo '<span class="subheading-category">'.JHtml::_('content.prepare', $this->category->title, '', 'com_content.category.title').'</span>'; } ?> </h2> <?php if ($this->params->get('show_page_heading') and ($this->params->get('show_category_title', 1) or $this->params->get('page_subheading'))) : ?> </hgroup> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?> <div class="category-desc"> <?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?> <img src="<?php echo $this->category->getParams()->get('image'); ?>"/> <?php endif; ?> <?php if ($this->params->get('show_description') && $this->category->description) : ?> <?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?> <?php if (is_array($this->children[$this->category->id]) && count($this->children[$this->category->id]) > 0 && $this->params->get('maxLevel') != 0) : ?> <div class="cat-children"> <?php if ($this->params->get('show_category_title') or $this->params->get('page_subheading')) { echo '<h3>'; } elseif ($this->params->get('show_category_heading_title_text', 1) == 1) { echo '<h2>'; } ?> <?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?> <?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?> <?php endif; ?> <?php if ($this->params->get('show_category_title') or $this->params->get('page_subheading')) { echo '</h3>'; } elseif ($this->params->get('show_category_heading_title_text', 1) == 1) { echo '</h2>'; } ?> </div> <?php endif; ?> <?php echo $this->loadTemplate('children'); ?> <div class="cat-items"> <?php echo $this->loadTemplate('articles'); ?> </div> </section> PK���\����8templates/beez3/html/com_content/category/blog_links.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $params =& $this->item->params; $app = JFactory::getApplication(); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); ?> <div class="items-more"> <h3><?php echo JText::_('COM_CONTENT_MORE_ARTICLES'); ?></h3> <ol> <?php foreach ($this->link_items as &$item) : ?> <li> <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>"> <?php echo $item->title; ?></a> </li> <?php endforeach; ?> </ol> </div> PK���\l�C>templates/beez3/html/com_content/category/default_children.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $templateparams = $app->getTemplate(true)->params; $class = ' class="first"'; ?> <?php if (count($this->children[$this->category->id]) > 0) :?> <ul> <?php foreach ($this->children[$this->category->id] as $id => $child) : ?> <?php if ($this->params->get('show_empty_categories') || $child->getNumItems(true) || count($child->getChildren())) : if (!isset($this->children[$this->category->id][$id + 1])) : $class = ' class="last"'; endif; ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <h3 class="item-title"><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id));?>"> <?php echo $this->escape($child->title); ?></a> </h3> <?php if ($this->params->get('show_subcat_desc') == 1) :?> <?php if ($child->description and $this->params->get('show_description') != 0 ) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $child->description, '', 'com_content.category'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_cat_num_articles', 1)) : ?> <?php if ($child->getNumItems() == true) : ?> <dl> <dt> <?php echo JText::_('COM_CONTENT_NUM_ITEMS'); ?> </dt> <dd> <?php echo $child->getNumItems(true); ?> </dd> </dl> <?php endif; ?> <?php endif; ?> <?php if (count($child->getChildren()) > 0 ) : $this->children[$child->id] = $child->getChildren(); $this->category = $child; $this->maxLevel--; if ($this->maxLevel != 0) : echo $this->loadTemplate('children'); endif; $this->category = $child->getParent(); $this->maxLevel++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> PK���\�9yo��7templates/beez3/html/com_content/category/blog_item.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $params =& $this->item->params; $images = json_decode($this->item->images); $app = JFactory::getApplication(); $canEdit = $this->item->params->get('access-edit'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); ?> <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate()) || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?> <div class="system-unpublished"> <?php endif; ?> <?php if ($params->get('show_title')) : ?> <h2> <?php if ($params->get('link_titles') && $params->get('access-view')) : ?> <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); ?>"> <?php echo $this->escape($this->item->title); ?></a> <?php else : ?> <?php echo $this->escape($this->item->title); ?> <?php endif; ?> </h2> <?php endif; ?> <?php if ($params->get('show_print_icon') || $params->get('show_email_icon') || $canEdit) : ?> <ul class="actions"> <?php if ($params->get('show_print_icon')) : ?> <li class="print-icon"> <?php echo JHtml::_('icon.print_popup', $this->item, $params, array(), true); ?> </li> <?php endif; ?> <?php if ($params->get('show_email_icon')) : ?> <li class="email-icon"> <?php echo JHtml::_('icon.email', $this->item, $params, array(), true); ?> </li> <?php endif; ?> <?php if ($canEdit) : ?> <li class="edit-icon"> <?php echo JHtml::_('icon.edit', $this->item, $params, array(), true); ?> </li> <?php endif; ?> </ul> <?php endif; ?> <?php if (!$params->get('show_intro')) : ?> <?php echo $this->item->event->afterDisplayTitle; ?> <?php endif; ?> <?php echo $this->item->event->beforeDisplayContent; ?> <?php // to do not that elegant would be nice to group the params ?> <?php if (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_parent_category')) or ($params->get('show_hits'))) : ?> <dl class="article-info"> <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt> <?php endif; ?> <?php if ($params->get('show_parent_category') && $this->item->parent_id != 1) : ?> <dd class="parent-category-name"> <?php $title = $this->escape($this->item->parent_title); $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_id)) . '">' . $title . '</a>'; ?> <?php if ($params->get('link_parent_category')) : ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_category')) : ?> <dd class="category-name"> <?php $title = $this->escape($this->item->category_title); $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catid)) . '">' . $title . '</a>'; ?> <?php if ($params->get('link_category')) : ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_create_date')) : ?> <dd class="create"> <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_modify_date')) : ?> <dd class="modified"> <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_publish_date')) : ?> <dd class="published"> <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_author') && !empty($this->item->author )) : ?> <dd class="createdby"> <?php $author = $this->item->author; ?> <?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?> <?php if (!empty($this->item->contact_link ) && $params->get('link_author') == true) : ?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author)); ?> <?php else :?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_hits')) : ?> <dd class="hits"> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?> </dd> <?php endif; ?> <?php if (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_parent_category')) or ($params->get('show_hits'))) :?> </dl> <?php endif; ?> <?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?> <?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?> <div class="img-intro-<?php echo htmlspecialchars($imgfloat); ?>"> <img <?php if ($images->image_intro_caption): echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"'; endif; ?> src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/> </div> <?php endif; ?> <?php echo $this->item->introtext; ?> <?php if ($params->get('show_readmore') && $this->item->readmore) : if ($params->get('access-view')) : $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); else : $menu = JFactory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); $link->setVar('return', base64_encode(JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language), false))); endif; ?> <p class="readmore"> <a href="<?php echo $link; ?>"> <?php if (!$params->get('access-view')) : echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); elseif ($readmore = $this->item->alternative_readmore) : echo $readmore; if ($params->get('show_readmore_title', 0) != 0) : echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit')); endif; elseif ($params->get('show_readmore_title', 0) == 0) : echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE'); else : echo JText::_('COM_CONTENT_READ_MORE'); echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit')); endif; ?></a> </p> <?php endif; ?> <?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate()) || ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?> </div> <?php endif; ?> <div class="item-separator"></div> <?php echo $this->item->event->afterDisplayContent; ?> PK���\�"���4templates/beez3/html/com_content/archive/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Template.beez5 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $templateparams = $app->getTemplate(true)->params; if (!$templateparams->get('html5', 0)) { require JPATH_BASE.'/components/com_content/views/archive/tmpl/default.php'; //evtl. ersetzen durch JPATH_COMPONENT.'/views/...' } else { JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); JHtml::_('behavior.caption'); ?><div class="archive<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <form id="adminForm" action="<?php echo JRoute::_('index.php')?>" method="post"> <fieldset class="filters"> <legend class="hidelabeltxt"><?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?></legend> <div class="filter-search"> <?php if ($this->params->get('filter_field') != 'hide') : ?> <label class="filter-search-lbl" for="filter-search"><?php echo JText::_('COM_CONTENT_'.$this->params->get('filter_field').'_FILTER_LABEL').' '; ?></label> <input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->filter); ?>" class="inputbox" onchange="document.getElementById('adminForm').submit();" /> <?php endif; ?> <?php echo $this->form->monthField; ?> <?php echo $this->form->yearField; ?> <?php echo $this->form->limitField; ?> <button type="submit" class="button"><?php echo JText::_('JGLOBAL_FILTER_BUTTON'); ?></button> </div> <input type="hidden" name="view" value="archive" /> <input type="hidden" name="option" value="com_content" /> <input type="hidden" name="limitstart" value="0" /> </fieldset> <?php echo $this->loadTemplate('items'); ?> </form> </div> <?php } ?> PK���\��H��:templates/beez3/html/com_content/archive/default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Template.beez5 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $templateparams = $app->getTemplate(true)->params; if (!$templateparams->get('html5', 0)) { require JPATH_BASE.'/components/com_content/views/archive/tmpl/default_items.php'; //evtl. ersetzen durch JPATH_COMPONENT.'/views/...' } else { JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); $params = &$this->params; ?> <ul id="archive-items"> <?php foreach ($this->items as $i => $item) : ?> <li class="row<?php echo $i % 2; ?>"> <h2> <?php if ($params->get('link_titles')) : ?> <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>"> <?php echo $this->escape($item->title); ?></a> <?php else: ?> <?php echo $this->escape($item->title); ?> <?php endif; ?> </h2> <?php if (($params->get('show_author')) or ($params->get('show_parent_category')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_hits'))) : ?> <dl class="article-info"> <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt> <?php endif; ?> <?php if ($params->get('show_parent_category')) : ?> <dd class="parent-category-name"> <?php $title = $this->escape($item->parent_title); $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($item->parent_slug)).'">'.$title.'</a>';?> <?php if ($params->get('link_parent_category') && $item->parent_slug) : ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_category')) : ?> <dd class="category-name"> <?php $title = $this->escape($item->category_title); $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->catslug)) . '">' . $title . '</a>'; ?> <?php if ($params->get('link_category') && $item->catslug) : ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_create_date')) : ?> <dd class="create"> <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_modify_date')) : ?> <dd class="modified"> <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_publish_date')) : ?> <dd class="published"> <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_author') && !empty($item->author )) : ?> <dd class="createdby"> <?php $author = $item->author; ?> <?php $author = ($item->created_by_alias ? $item->created_by_alias : $author);?> <?php if (!empty($item->contact_link ) && $params->get('link_author') == true):?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $item->contact_link, $author)); ?> <?php else :?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_hits')) : ?> <dd class="hits"> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $item->hits); ?> </dd> <?php endif; ?> <?php if (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_hits'))) :?> </dl> <?php endif; ?> <?php if ($params->get('show_intro')) :?> <div class="intro"> <?php echo JHtml::_('string.truncate', $item->introtext, $params->get('introtext_limit')); ?> </div> <?php endif; ?> </li> <?php endforeach; ?> </ul> <div id="pagination"> <span><?php echo $this->pagination->getPagesLinks(); ?></span> <span><?php echo $this->pagination->getPagesCounter(); ?></span> </div> <?php } ?> PK���\2&�& & :templates/beez3/html/com_content/article/default_links.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Create shortcut $urls = json_decode($this->item->urls); // Create shortcuts to some parameters. $params = $this->item->params; if ($urls && (!empty($urls->urla) || !empty($urls->urlb) || !empty($urls->urlc))) : ?> <div class="content-links"> <ul class="nav nav-tabs nav-stacked"> <?php $urlarray = array( array($urls->urla, $urls->urlatext, $urls->targeta, 'a'), array($urls->urlb, $urls->urlbtext, $urls->targetb, 'b'), array($urls->urlc, $urls->urlctext, $urls->targetc, 'c') ); foreach ($urlarray as $url) : $link = $url[0]; $label = $url[1]; $target = $url[2]; $id = $url[3]; if ( ! $link) : continue; endif; // If no label is present, take the link $label = ($label) ? $label : $link; // If no target is present, use the default $target = $target ? $target : $params->get('target'.$id); ?> <li class="content-links-<?php echo $id; ?>"> <?php // Compute the correct link switch ($target) { case 1: // open in a new window echo '<a href="'. htmlspecialchars($link) .'" target="_blank" rel="nofollow">'. htmlspecialchars($label) .'</a>'; break; case 2: // open in a popup window $attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600'; echo "<a href=\"" . htmlspecialchars($link) . "\" onclick=\"window.open(this.href, 'targetWindow', '".$attribs."'); return false;\">". htmlspecialchars($label).'</a>'; break; case 3: // open in a modal window JHtml::_('behavior.modal', 'a.modal'); echo '<a class="modal" href="'.htmlspecialchars($link).'" rel="{handler: \'iframe\', size: {x:600, y:600}}">'. htmlspecialchars($label) . ' </a>'; break; default: // open in parent window echo '<a href="'. htmlspecialchars($link) . '" rel="nofollow">'. htmlspecialchars($label) . ' </a>'; break; } ?> </li> <?php endforeach; ?> </ul> </div> <?php endif; ?> PK���\������4templates/beez3/html/com_content/article/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $templateparams = $app->getTemplate(true)->params; $images = json_decode($this->item->images); $urls = json_decode($this->item->urls); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); JHtml::_('behavior.caption'); // Create shortcut to parameters. $params = $this->item->params; ?> <article class="item-page<?php echo $this->pageclass_sfx?>"> <?php if ($this->params->get('show_page_heading')) : ?> <?php if ($this->params->get('show_page_heading') and $params->get('show_title')) :?> <hgroup> <?php endif; ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && $this->item->paginationrelative) { echo $this->item->pagination; } if ($params->get('show_title')) : ?> <h2> <?php echo $this->escape($this->item->title); ?> </h2> <?php endif; ?> <?php if ($this->params->get('show_page_heading') and $params->get('show_title')) :?> </hgroup> <?php endif; ?> <?php if ($params->get('access-edit') || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?> <ul class="actions"> <?php if (!$this->print) : ?> <?php if ($params->get('show_print_icon')) : ?> <li class="print-icon"> <?php echo JHtml::_('icon.print_popup', $this->item, $params, array(), true); ?> </li> <?php endif; ?> <?php if ($params->get('show_email_icon')) : ?> <li class="email-icon"> <?php echo JHtml::_('icon.email', $this->item, $params, array(), true); ?> </li> <?php endif; ?> <?php if ($this->user->authorise('core.edit', 'com_content.article.'.$this->item->id)) : ?> <li class="edit-icon"> <?php echo JHtml::_('icon.edit', $this->item, $params, array(), true); ?> </li> <?php endif; ?> <?php else : ?> <li> <?php echo JHtml::_('icon.print_screen', $this->item, $params, array(), true); ?> </li> <?php endif; ?> </ul> <?php endif; ?> <?php if (!$params->get('show_intro')) : echo $this->item->event->afterDisplayTitle; endif; ?> <?php echo $this->item->event->beforeDisplayContent; ?> <?php $useDefList = (($params->get('show_author')) or ($params->get('show_category')) or ($params->get('show_parent_category')) or ($params->get('show_create_date')) or ($params->get('show_modify_date')) or ($params->get('show_publish_date')) or ($params->get('show_hits'))); ?> <?php if ($useDefList) : ?> <dl class="article-info"> <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt> <?php endif; ?> <?php if ($params->get('show_parent_category') && $this->item->parent_slug != '1:root') : ?> <dd class="parent-category-name"> <?php $title = $this->escape($this->item->parent_title); $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)).'">'.$title.'</a>';?> <?php if ($params->get('link_parent_category') and $this->item->parent_slug) : ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_category')) : ?> <dd class="category-name"> <?php $title = $this->escape($this->item->category_title); $url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';?> <?php if ($params->get('link_category') and $this->item->catslug) : ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_create_date')) : ?> <dd class="create"> <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_modify_date')) : ?> <dd class="modified"> <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_publish_date')) : ?> <dd class="published"> <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC2'))); ?> </dd> <?php endif; ?> <?php if ($params->get('show_author') && !empty($this->item->author )) : ?> <dd class="createdby"> <?php $author = $this->item->author; ?> <?php $author = ($this->item->created_by_alias ? $this->item->created_by_alias : $author);?> <?php if (!empty($this->item->contact_link ) && $params->get('link_author') == true) : ?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author)); ?> <?php else :?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?> <?php endif; ?> </dd> <?php endif; ?> <?php if ($params->get('show_hits')) : ?> <dd class="hits"> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?> </dd> <?php endif; ?> <?php if ($useDefList) : ?> </dl> <?php endif; ?> <?php if (isset ($this->item->toc)) : ?> <?php echo $this->item->toc; ?> <?php endif; ?> <?php if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position == '0')) OR ($params->get('urls_position') == '0' AND empty($urls->urls_position))) OR (empty($urls->urls_position) AND (!$params->get('urls_position')))) : ?> <?php echo $this->loadTemplate('links'); ?> <?php endif; ?> <?php if (isset($images->image_fulltext) and !empty($images->image_fulltext)) : ?> <?php $imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext; ?> <div class="img-fulltext-<?php echo htmlspecialchars($imgfloat); ?>"> <img <?php if ($images->image_fulltext_caption): echo 'class="caption"'.' title="' .htmlspecialchars($images->image_fulltext_caption) .'"'; endif; ?> src="<?php echo htmlspecialchars($images->image_fulltext); ?>" alt="<?php echo htmlspecialchars($images->image_fulltext_alt); ?>"/> </div> <?php endif; ?> <?php if (!empty($this->item->pagination) AND $this->item->pagination AND !$this->item->paginationposition AND !$this->item->paginationrelative): echo $this->item->pagination; endif; ?> <?php echo $this->item->text; ?> <?php // TAGS ?> <?php if ($params->get('show_tags', 1) && !empty($this->item->tags)) : ?> <?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?> <?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?> <?php endif; ?> <?php if (!empty($this->item->pagination) AND $this->item->pagination AND $this->item->paginationposition AND!$this->item->paginationrelative): echo $this->item->pagination;?> <?php endif; ?> <?php if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position == '1')) OR ( $params->get('urls_position') == '1'))) : ?> <?php echo $this->loadTemplate('links'); ?> <?php endif; ?> <?php if (!empty($this->item->pagination) AND $this->item->pagination AND $this->item->paginationposition AND $this->item->paginationrelative): echo $this->item->pagination;?> <?php endif; ?> <?php echo $this->item->event->afterDisplayContent; ?> </article> PK���\En(�558templates/beez3/html/com_weblinks/categories/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_weblinks * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers'); JHtml::_('behavior.caption'); ?> <div class="categories-list<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_base_description')) : ?> <?php //If there is a description in the menu parameters use that; ?> <?php if ($this->params->get('categories_description')) : ?> <div class="category-desc base-desc"> <?php echo JHtml::_('content.prepare', $this->params->get('categories_description'), '', 'com_weblinks.categories'); ?> </div> <?php else: ?> <?php //Otherwise get one from the database if it exists. ?> <?php if ($this->parent->description) : ?> <div class="category-desc base-desc"> <?php echo JHtml::_('content.prepare', $this->parent->description, '', 'com_weblinks.categories'); ?> </div> <?php endif; ?> <?php endif; ?> <?php endif; ?> <?php echo $this->loadTemplate('items'); ?> </div> PK���\��]��>templates/beez3/html/com_weblinks/categories/default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_weblinks * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $class = ' class="first"'; if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : ?> <ul> <?php foreach ($this->items[$this->parent->id] as $id => $item) : ?> <?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : if (!isset($this->items[$this->parent->id][$id + 1])) { $class = ' class="last"'; } ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(WeblinksHelperRoute::getCategoryRoute($item->id));?>"> <?php echo $this->escape($item->title); ?></a> </span> <?php if ($this->params->get('show_subcat_desc_cat') == 1) :?> <?php if ($item->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $item->description, '', 'com_weblinks.categories'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_cat_num_links_cat') == 1) :?> <dl class="weblink-count"><dt> <?php echo JText::_('COM_WEBLINKS_NUM'); ?></dt> <dd><?php echo $item->numitems; ?></dd> </dl> <?php endif; ?> <?php if (count($item->getChildren()) > 0) : $this->items[$item->id] = $item->getChildren(); $this->parent = $item; $this->maxLevelcat--; echo $this->loadTemplate('items'); $this->parent = $item->getParent(); $this->maxLevelcat++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> PK���\��VV66/templates/beez3/html/com_weblinks/form/edit.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_weblinks * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.keepalive'); JHtml::_('behavior.formvalidation'); // Create shortcut to parameters. $params = $this->state->get('params'); ?> <script type="text/javascript"> Joomla.submitbutton = function(task) { if (task == 'weblink.cancel' || document.formvalidator.isValid(document.getElementById('adminForm'))) { <?php echo $this->form->getField('description')->save(); ?> Joomla.submitform(task); } } </script> <div class="edit<?php echo $this->pageclass_sfx; ?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <form action="<?php echo JRoute::_('index.php?option=com_weblinks&view=form&w_id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical"> <div class="btn-toolbar"> <div class="btn-group"> <button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('weblink.save')"> <span class="icon-ok"></span> <?php echo JText::_('JSAVE') ?> </button> </div> <div class="btn-group"> <button type="button" class="btn" onclick="Joomla.submitbutton('weblink.cancel')"> <span class="icon-cancel"></span> <?php echo JText::_('JCANCEL') ?> </button> </div> </div> <hr class="hr-condensed" /> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('title'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('title'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('alias'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('alias'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('catid'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('catid'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('tags'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('tags'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('url'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('url'); ?> </div> </div> <?php if ($this->user->authorise('core.edit.state', 'com_weblinks.weblink')) : ?> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('state'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('state'); ?> </div> </div> <?php endif; ?> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('language'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('language'); ?> </div> </div> <div class="control-group"> <div class="control-label"> <?php echo $this->form->getLabel('description'); ?> </div> <div class="controls"> <?php echo $this->form->getInput('description'); ?> </div> </div> <input type="hidden" name="return" value="<?php echo $this->return_page;?>" /> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </form> </div> PK���\�S�too6templates/beez3/html/com_weblinks/category/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_weblinks * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers'); JHtml::_('behavior.caption'); ?> <div class="weblink-category<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_category_title', 1)) : ?> <h2> <?php echo JHtml::_('content.prepare', $this->category->title, '', 'com_weblinks.category.title'); ?> </h2> <?php endif; ?> <?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?> <div class="category-desc"> <?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?> <img src="<?php echo $this->category->getParams()->get('image'); ?>"/> <?php endif; ?> <?php if ($this->params->get('show_description') && $this->category->description) : ?> <?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_weblinks.category'); ?> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?> <?php echo $this->loadTemplate('items'); ?> <?php if (!empty($this->children[$this->category->id])&& $this->maxLevel != 0) : ?> <div class="cat-children"> <h3><?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?></h3> <?php echo $this->loadTemplate('children'); ?> </div> <?php endif; ?> </div> PK���\Y�1��?templates/beez3/html/com_weblinks/category/default_children.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_weblinks * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $class = ' class="first"'; if (count($this->children[$this->category->id]) > 0 && $this->maxLevel != 0) : ?> <ul> <?php foreach ($this->children[$this->category->id] as $id => $child) : ?> <?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : if (!isset($this->children[$this->category->id][$id + 1])) { $class = ' class="last"'; } ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(WeblinksHelperRoute::getCategoryRoute($child->id));?>"> <?php echo $this->escape($child->title); ?></a> </span> <?php if ($this->params->get('show_subcat_desc') == 1) :?> <?php if ($child->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $child->description, '', 'com_weblinks.category'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_cat_num_links') == 1) :?> <dl class="weblink-count"><dt> <?php echo JText::_('COM_WEBLINKS_NUM'); ?></dt> <dd><?php echo $child->numitems; ?></dd> </dl> <?php endif; ?> <?php if (count($child->getChildren()) > 0 ) : $this->children[$child->id] = $child->getChildren(); $this->category = $child; $this->maxLevel--; echo $this->loadTemplate('children'); $this->category = $child->getParent(); $this->maxLevel++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; PK���\&L�__<templates/beez3/html/com_weblinks/category/default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_weblinks * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Code to support edit links for weblinks // Create a shortcut for params. $params = &$this->item->params; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.framework'); // Get the user object. $user = JFactory::getUser(); // Check if user is allowed to add/edit based on weblinks permissinos. $canEdit = $user->authorise('core.edit', 'com_weblinks'); $canCreate = $user->authorise('core.create', 'com_weblinks'); $canEditState = $user->authorise('core.edit.state', 'com_weblinks'); $n = count($this->items); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> <?php if (empty($this->items)) : ?> <p> <?php echo JText::_('COM_WEBLINKS_NO_WEBLINKS'); ?></p> <?php else : ?> <form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm"> <?php if ($this->params->get('show_pagination_limit')) : ?> <fieldset class="filters"> <legend class="hidelabeltxt"><?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?></legend> <div class="display-limit"> <?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>  <?php echo $this->pagination->getLimitBox(); ?> </div> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> </fieldset> <?php endif; ?> <table class="category"> <?php if ($this->params->get('show_headings') == 1) : ?> <thead><tr> <th class="title"> <?php echo JHtml::_('grid.sort', 'COM_WEBLINKS_GRID_TITLE', 'title', $listDirn, $listOrder); ?> </th> <?php if ($this->params->get('show_link_hits')) : ?> <th class="hits"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'hits', $listDirn, $listOrder); ?> </th> <?php endif; ?> </tr> </thead> <?php endif; ?> <tbody> <?php foreach ($this->items as $i => $item) : ?> <?php if ($this->items[$i]->state == 0) : ?> <tr class="system-unpublished cat-list-row<?php echo $i % 2; ?>"> <?php else: ?> <tr class="cat-list-row<?php echo $i % 2; ?>" > <?php endif; ?> <td class="title"> <p> <?php if ($this->params->get('icons') == 0) : ?> <?php echo JText::_('COM_WEBLINKS_LINK'); ?> <?php elseif ($this->params->get('icons') == 1) : ?> <?php if (!$this->params->get('link_icons')) : ?> <?php echo JHtml::_('image', 'system/'.$this->params->get('link_icons', 'weblink.png'), JText::_('COM_WEBLINKS_LINK'), null, true); ?> <?php else: ?> <?php echo '<img src="'.$this->params->get('link_icons').'" alt="'.JText::_('COM_WEBLINKS_LINK').'" />'; ?> <?php endif; ?> <?php endif; ?> <?php // Compute the correct link $menuclass = 'category' . $this->pageclass_sfx; $link = $item->link; $width = $item->params->get('width'); $height = $item->params->get('height'); if ($width == null || $height == null) { $width = 600; $height = 500; } switch ($item->params->get('target', $this->params->get('target'))) { case 1: // open in a new window echo '<a href="'. $link .'" target="_blank" class="'. $menuclass .'" rel="nofollow">'. $this->escape($item->title) .'</a>'; break; case 2: // open in a popup window $attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='.$this->escape($width).',height='.$this->escape($height).''; echo "<a href=\"$link\" onclick=\"window.open(this.href, 'targetWindow', '".$attribs."'); return false;\">". $this->escape($item->title).'</a>'; break; case 3: // open in a modal window JHtml::_('behavior.modal', 'a.modal'); echo '<a class="modal" href="'.$link.'" rel="{handler: \'iframe\', size: {x:'.$this->escape($width).', y:'.$this->escape($height).'}}">'. $this->escape($item->title). ' </a>'; break; default: // open in parent window echo '<a href="'. $link . '" class="'. $menuclass .'" rel="nofollow">'. $this->escape($item->title) . ' </a>'; break; } ?> <?php // Code to add the edit link for the weblink. ?> <?php if ($canEdit) : ?> <ul class="actions"> <li class="edit-icon"> <?php echo JHtml::_('icon.edit', $item, $params); ?> </li> </ul> <?php endif; ?> </p> <?php $tagsData = $item->tags->getItemTags('com_weblinks.weblink', $item->id); ?> <?php if ($this->params->get('show_tags', 1)) : ?> <?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?> <?php echo $this->item->tagLayout->render($tagsData); ?> <?php endif; ?> <?php if (($this->params->get('show_link_description')) and ($item->description != '')) : ?> <?php $images = json_decode($item->images); ?> <?php if (isset($images->image_first) and !empty($images->image_first)) : ?> <?php $imgfloat = (empty($images->float_first)) ? $this->params->get('float_first') : $images->float_first; ?> <div class="img-intro-<?php echo htmlspecialchars($imgfloat); ?>"> <img <?php if ($images->image_first_caption): echo 'class="caption"'.' title="' .htmlspecialchars($images->image_first_caption) .'"'; endif; ?> src="<?php echo htmlspecialchars($images->image_first); ?>" alt="<?php echo htmlspecialchars($images->image_first_alt); ?>"/> </div> <?php endif; ?> <?php if (isset($images->image_second) and !empty($images->image_second)) : ?> <?php $imgfloat = (empty($images->float_second)) ? $this->params->get('float_second') : $images->float_second; ?> <div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> <img <?php if ($images->image_second_caption): echo 'class="caption"'.' title="' .htmlspecialchars($images->image_second_caption) .'"'; endif; ?> src="<?php echo htmlspecialchars($images->image_second); ?>" alt="<?php echo htmlspecialchars($images->image_second_alt); ?>"/> </div> <?php endif; ?> <?php echo $item->description; ?> <?php endif; ?> </td> <?php if ($this->params->get('show_link_hits')) : ?> <td class="hits"> <?php echo $item->hits; ?> </td> <?php endif; ?> </tr> <?php endforeach; ?> </tbody> </table> <?php // Code to add a link to submit a weblink. ?> <?php /* if ($canCreate) : // TODO This is not working due to some problem in the router, I think. Ref issue #23685 ?> <?php echo JHtml::_('icon.create', $item, $item->params); ?> <?php endif; */ ?> <?php if ($this->params->get('show_pagination')) : ?> <div class="pagination"> <?php if ($this->params->def('show_pagination_results', 1)) : ?> <p class="counter"> <?php echo $this->pagination->getPagesCounter(); ?> </p> <?php endif; ?> <?php echo $this->pagination->getPagesLinks(); ?> </div> <?php endif; ?> </form> <?php endif; ?> PK���\����__6templates/beez3/html/layouts/joomla/system/message.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $msgList = $displayData['msgList']; ?> <div id="system-message-container"> <?php if (is_array($msgList) && $msgList) : ?> <dl id="system-message"> <?php foreach ($msgList as $type => $msgs) : ?> <?php if ($msgs) : ?> <dt class="<?php echo strtolower($type); ?>"><?php echo JText::_($type); ?></dt> <dd class="<?php echo strtolower($type); ?> message"> <ul> <?php foreach ($msgs as $msg) : ?> <li><?php echo $msg; ?></li> <?php endforeach; ?> </ul> </dd> <?php endif; ?> <?php endforeach; ?> </dl> <?php endif; ?> </div> PK���\��*templates/beez3/html/mod_login/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; JHtml::_('behavior.keepalive'); ?> <?php if ($type == 'logout') : ?> <form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" id="login-form"> <?php if ($params->get('greeting')) : ?> <div class="login-greeting"> <?php if ($params->get('name') == 0) : ?> <?php echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('name'))); ?> <?php else : ?> <?php echo JText::sprintf('MOD_LOGIN_HINAME', htmlspecialchars($user->get('username'))); ?> <?php endif; ?> </div> <?php endif; ?> <div class="logout-button"> <input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGOUT'); ?>" /> <input type="hidden" name="option" value="com_users" /> <input type="hidden" name="task" value="user.logout" /> <input type="hidden" name="return" value="<?php echo $return; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> <?php else : ?> <form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" id="login-form" > <?php if ($params->get('pretext')) : ?> <div class="pretext"> <p><?php echo $params->get('pretext'); ?></p> </div> <?php endif; ?> <fieldset class="userdata"> <p id="form-login-username"> <label for="modlgn-username"><?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?></label> <input id="modlgn-username" type="text" name="username" class="inputbox" size="18" /> </p> <p id="form-login-password"> <label for="modlgn-passwd"><?php echo JText::_('JGLOBAL_PASSWORD') ?></label> <input id="modlgn-passwd" type="password" name="password" class="inputbox" size="18" /> </p> <?php if (count($twofactormethods) > 1) : ?> <div id="form-login-secretkey" class="control-group"> <div class="controls"> <?php if (!$params->get('usetext')) : ?> <div class="input-prepend input-append"> <label for="modlgn-secretkey"><?php echo JText::_('JGLOBAL_SECRETKEY'); ?></label> <input id="modlgn-secretkey" autocomplete="off" type="text" name="secretkey" class="input-small" tabindex="0" size="18" /> </div> <?php else: ?> <label for="modlgn-secretkey"><?php echo JText::_('JGLOBAL_SECRETKEY') ?></label> <input id="modlgn-secretkey" autocomplete="off" type="text" name="secretkey" class="input-small" tabindex="0" size="18" /> <?php endif; ?> </div> </div> <?php endif; ?> <?php if (JPluginHelper::isEnabled('system', 'remember')) : ?> <p id="form-login-remember"> <label for="modlgn-remember"><?php echo JText::_('MOD_LOGIN_REMEMBER_ME') ?></label> <input id="modlgn-remember" type="checkbox" name="remember" class="inputbox" value="yes"/> </p> <?php endif; ?> <input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGIN') ?>" /> <input type="hidden" name="option" value="com_users" /> <input type="hidden" name="task" value="user.login" /> <input type="hidden" name="return" value="<?php echo $return; ?>" /> <?php echo JHtml::_('form.token'); ?> <ul> <li> <a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>"> <?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a> </li> <li> <a href="<?php echo JRoute::_('index.php?option=com_users&view=remind'); ?>"> <?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a> </li> <?php $usersConfig = JComponentHelper::getParams('com_users'); ?> <?php if ($usersConfig->get('allowUserRegistration')) : ?> <li> <a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>"> <?php echo JText::_('MOD_LOGIN_REGISTER'); ?></a> </li> <?php endif; ?> </ul> <?php if ($params->get('posttext')) : ?> <div class="posttext"> <p><?php echo $params->get('posttext'); ?></p> </div> <?php endif; ?> </fieldset> </form> <?php endif; ?> PK���\�Dea��0templates/beez3/html/mod_breadcrumbs/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class = "breadcrumbs<?php echo $moduleclass_sfx; ?>"> <?php if ($params->get('showHere', 1)) { echo '<span class="showHere">' .JText::_('MOD_BREADCRUMBS_HERE').'</span>'; } // Get rid of duplicated entries on trail including home page when using multilanguage for ($i = 0; $i < $count; $i++) { if ($i == 1 && !empty($list[$i]->link) && !empty($list[$i - 1]->link) && $list[$i]->link == $list[$i - 1]->link) { unset($list[$i]); } } // Find last and penultimate items in breadcrumbs list end($list); $last_item_key = key($list); prev($list); $penult_item_key = key($list); // Generate the trail foreach ($list as $key => $item) : // Make a link if not the last item in the breadcrumbs $show_last = $params->get('showLast', 1); if ($key != $last_item_key) { // Render all but last item - along with separator if (!empty($item->link)) { echo '<a href="' . $item->link . '" class="pathway">' . $item->name . '</a>'; } else { echo '<span>' . $item->name . '</span>'; } if (($key != $penult_item_key) || $show_last) { echo ' '.$separator.' '; } } elseif ($show_last) { // Render last item if reqd. echo '<span>' . $item->name . '</span>'; } endforeach; ?> </div> PK���\>Y��447templates/beez3/html/com_contact/categories/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers'); JHtml::_('behavior.caption'); ?> <div class="categories-list<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_base_description')) : ?> <?php //If there is a description in the menu parameters use that; ?> <?php if ($this->params->get('categories_description')) : ?> <div class="category-desc base-desc"> <?php echo JHtml::_('content.prepare', $this->params->get('categories_description'), '', 'com_contact.categories'); ?> </div> <?php else: ?> <?php //Otherwise get one from the database if it exists. ?> <?php if ($this->parent->description) : ?> <div class="category-desc base-desc"> <?php echo JHtml::_('content.prepare', $this->parent->description, '', 'com_contact.categories'); ?> </div> <?php endif; ?> <?php endif; ?> <?php endif; ?> <?php echo $this->loadTemplate('items'); ?> </div> PK���\l��A��=templates/beez3/html/com_contact/categories/default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $class = ' class="first"'; if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : ?> <ul> <?php foreach ($this->items[$this->parent->id] as $id => $item) : ?> <?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : if (!isset($this->items[$this->parent->id][$id + 1])) { $class = ' class="last"'; } ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(ContactHelperRoute::getCategoryRoute($item->id));?>"> <?php echo $this->escape($item->title); ?></a> </span> <?php if ($this->params->get('show_subcat_desc_cat') == 1) :?> <?php if ($item->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $item->description, '', 'com_contact.categories'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_cat_items_cat') == 1) :?> <dl><dt> <?php echo JText::_('COM_CONTACT_COUNT'); ?></dt> <dd><?php echo $item->numitems; ?></dd> </dl> <?php endif; ?> <?php if (count($item->getChildren()) > 0) : $this->items[$item->id] = $item->getChildren(); $this->parent = $item; $this->maxLevelcat--; echo $this->loadTemplate('items'); $this->parent = $item->getParent(); $this->maxLevelcat++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> PK���\��88:templates/beez3/html/com_contact/contact/default_links.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; if ($this->params->get('presentation_style') == 'sliders'):?> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="accordionContact" href="#display-links"> <?php echo JText::_('COM_CONTACT_LINKS');?> </a> </div> <div id="display-links" class="accordion-body collapse"> <div class="accordion-inner"> <?php endif; ?> <?php if ($this->params->get('presentation_style') == 'plain'):?> <?php echo '<h3>'. JText::_('JGLOBAL_ARTICLES').'</h3>'; ?> <?php endif; ?> <div class="contact-links"> <ul class="nav nav-list"> <?php foreach (range('a', 'e') as $char) :// letters 'a' to 'e' $link = $this->contact->params->get('link'.$char); $label = $this->contact->params->get('link'.$char.'_name'); if (!$link) : continue; endif; // Add 'http://' if not present $link = (0 === strpos($link, 'http')) ? $link : 'http://'.$link; // If no label is present, take the link $label = ($label) ? $label : $link; ?> <li> <a href="<?php echo $link; ?>"> <?php echo $label; ?> </a> </li> <?php endforeach; ?> </ul> </div> <?php if ($this->params->get('presentation_style') == 'sliders'):?> </div> </div> </div> <?php endif; ?> PK���\6K^Ucc<templates/beez3/html/com_contact/contact/default_profile.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php if (JPluginHelper::isEnabled('user', 'profile')) : $fields = $this->item->profile->getFieldset('profile'); ?> <div class="contact-profile" id="users-profile-custom"> <dl class="dl-horizontal"> <?php foreach ($fields as $profile) : if ($profile->value) : echo '<dt>'.$profile->label.'</dt>'; $profile->text = htmlspecialchars($profile->value, ENT_COMPAT, 'UTF-8'); switch ($profile->id) : case "profile_website" : $v_http = substr($profile->profile_value, 0, 4); if ($v_http == "http") : echo '<dd><a href="'.$profile->text.'">'.$profile->text.'</a></dd>'; else : echo '<dd><a href="http://'.$profile->text.'">'.$profile->text.'</a></dd>'; endif; break; default: echo '<dd>'.$profile->text.'</dd>'; break; endswitch; endif; endforeach; ?> </dl> </div> <?php endif; ?> PK���\1��CC9templates/beez3/html/com_contact/contact/default_form.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.keepalive'); JHtml::_('behavior.formvalidation'); if (isset($this->error)) : ?> <div class="contact-error"> <?php echo $this->error; ?> </div> <?php endif; ?> <div class="contact-form"> <form id="contact-form" action="<?php echo JRoute::_('index.php'); ?>" method="post" class="form-validate form-horizontal"> <fieldset> <legend><?php echo JText::_('COM_CONTACT_FORM_LABEL'); ?></legend> <div class="control-group"> <div class="control-label"><?php echo $this->form->getLabel('contact_name'); ?></div> <div class="controls"><?php echo $this->form->getInput('contact_name'); ?></div> </div> <div class="control-group"> <div class="control-label"><?php echo $this->form->getLabel('contact_email'); ?></div> <div class="controls"><?php echo $this->form->getInput('contact_email'); ?></div> </div> <div class="control-group"> <div class="control-label"><?php echo $this->form->getLabel('contact_subject'); ?></div> <div class="controls"><?php echo $this->form->getInput('contact_subject'); ?></div> </div> <div class="control-group"> <div class="control-label"><?php echo $this->form->getLabel('contact_message'); ?></div> <div class="controls"><?php echo $this->form->getInput('contact_message'); ?></div> </div> <?php if ($this->params->get('show_email_copy')){ ?> <div class="control-group"> <div class="control-label"><?php echo $this->form->getLabel('contact_email_copy'); ?></div> <div class="controls"><?php echo $this->form->getInput('contact_email_copy'); ?></div> </div> <?php } ?> <?php //Dynamically load any additional fields from plugins. ?> <?php foreach ($this->form->getFieldsets() as $fieldset) : ?> <?php if ($fieldset->name != 'contact'):?> <?php $fields = $this->form->getFieldset($fieldset->name);?> <?php foreach ($fields as $field) : ?> <div class="control-group"> <?php if ($field->hidden) : ?> <div class="controls"> <?php echo $field->input;?> </div> <?php else:?> <div class="control-label"> <?php echo $field->label; ?> <?php if (!$field->required && $field->type != "Spacer") : ?> <span class="optional"><?php echo JText::_('COM_CONTACT_OPTIONAL');?></span> <?php endif; ?> </div> <div class="controls"><?php echo $field->input;?></div> <?php endif;?> </div> <?php endforeach;?> <?php endif ?> <?php endforeach;?> <div class="form-actions"><button class="btn btn-primary validate" type="submit"><?php echo JText::_('COM_CONTACT_CONTACT_SEND'); ?></button> <input type="hidden" name="option" value="com_contact" /> <input type="hidden" name="task" value="contact.submit" /> <input type="hidden" name="return" value="<?php echo $this->return_page;?>" /> <input type="hidden" name="id" value="<?php echo $this->contact->slug; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </fieldset> </form> </div> PK���\G�7��=templates/beez3/html/com_contact/contact/default_articles.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE . '/components/com_content/helpers/route.php'; ?> <?php if ($this->params->get('show_articles')) : ?> <div class="contact-articles"> <ol> <?php foreach ($this->item->articles as $article) : ?> <li> <?php echo JHtml::_('link', JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language)), htmlspecialchars($article->title, ENT_COMPAT, 'UTF-8')); ?> </li> <?php endforeach; ?> </ol> </div> <?php endif; ?> PK���\h�^~� � 9templates/beez3/html/com_contact/contact/encyclopedia.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $cparams = JComponentHelper::getParams('com_media'); ?> <div class="contact<?php echo $this->pageclass_sfx?>"> <?php $contactLink = ContactHelperRoute::getCategoryRoute($this->contact->catid);?> <h3> <span class="contact-category"><a href="<?php echo $contactLink; ?>"> <?php echo $this->escape($this->contact->category_title); ?></a> </span> </h3> <?php if ($this->contact->name && $this->params->get('show_name')) : ?> <h2> <span class="contact-name"><?php echo $this->contact->name; ?></span> </h2> <?php endif; ?> <div class="encyclopedia_col1"> <?php if ($this->contact->image ) : ?> <div class="contact-image"> <?php // We are going to use the contact address field for the main image caption. // If we have a caption load the caption behavior. ?> <?php if ($this->contact->address) { JHtml::_('behavior.caption'); }?> <?php echo JHtml::_('image', $this->contact->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('align' => 'middle', 'class' => 'caption', 'title' => $this->contact->address)); ?> </div> <?php endif; ?> </div> <div class="encyclopedia_col2"> <?php // We are going to use some of the standard content fields in non standard ways. ?> <div class="contact-miscinfo"> <div class="contact-misc"> <?php echo $this->contact->misc; ?> </div> </div> <?php //Let's use position for the scientific name. ?> <?php if ($this->contact->con_position && $this->params->get('show_position')) : ?> <p class="contact-position"><?php echo $this->contact->con_position; ?></p> <?php endif; ?> <?php //Let's use state to put the family name. ?> <?php if ($this->contact->state && $this->params->get('show_state')) : ?> <p class="contact-state"><?php echo $this->contact->state; ?></p> <?php endif; ?> <?php // Let's use contry to list the main countries it grows in. '?> <?php if ($this->contact->country && $this->params->get('show_country')) : ?> <p class="contact-country"><?php echo $this->contact->country; ?></p> <?php endif; ?> </div> <div class="clr"> </div> <?php if ($this->params->get('presentation_style') != 'plain'):?> <?php echo JHtml::_($this->params->get('presentation_style').'.start', 'contact-slider'); ?> <?php endif ?> <div class="encyclopedia_links"> <?php echo $this->loadTemplate('links'); ?> </div> <?php if ($this->params->get('presentation_style') != 'plain'):?> <?php echo JHtml::_($this->params->get('presentation_style').'.end'); ?> <?php endif; ?> </div> PK���\�,i��4templates/beez3/html/com_contact/contact/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $cparams = JComponentHelper::getParams('com_media'); ?> <div class="contact<?php echo $this->pageclass_sfx?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->contact->name && $this->params->get('show_name')) : ?> <div class="page-header"> <h2> <span class="contact-name"><?php echo $this->contact->name; ?></span> </h2> </div> <?php endif; ?> <?php if ($this->params->get('show_contact_category') == 'show_no_link') : ?> <h3> <span class="contact-category"><?php echo $this->contact->category_title; ?></span> </h3> <?php endif; ?> <?php if ($this->params->get('show_contact_category') == 'show_with_link') : ?> <?php $contactLink = ContactHelperRoute::getCategoryRoute($this->contact->catid);?> <h3> <span class="contact-category"><a href="<?php echo $contactLink; ?>"> <?php echo $this->escape($this->contact->category_title); ?></a> </span> </h3> <?php endif; ?> <?php if ($this->params->get('show_contact_list') && count($this->contacts) > 1) : ?> <form action="#" method="get" name="selectForm" id="selectForm"> <?php echo JText::_('COM_CONTACT_SELECT_CONTACT'); ?> <?php echo JHtml::_('select.genericlist', $this->contacts, 'id', 'class="inputbox" onchange="document.location.href = this.value"', 'link', 'name', $this->contact->link);?> </form> <?php endif; ?> <?php if ($this->params->get('show_tags', 1) && !empty($this->item->tags)) : ?> <?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?> <?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?> <?php endif; ?> <?php if ($this->params->get('presentation_style') == 'sliders'):?> <div class="accordion" id="accordionContact"> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="accordionContact" href="#basic-details"> <?php echo JText::_('COM_CONTACT_DETAILS');?> </a> </div> <div id="basic-details" class="accordion-body collapse in"> <div class="accordion-inner"> <?php endif; ?> <?php if ($this->params->get('presentation_style') == 'plain'):?> <?php echo '<h3>' . JText::_('COM_CONTACT_DETAILS') . '</h3>'; ?> <?php endif; ?> <?php if ($this->contact->image && $this->params->get('show_image')) : ?> <div class="thumbnail pull-right"> <?php echo JHtml::_('image', $this->contact->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('align' => 'middle')); ?> </div> <?php endif; ?> <?php if ($this->contact->con_position && $this->params->get('show_position')) : ?> <dl class="contact-position dl-horizontal"> <dd> <?php echo $this->contact->con_position; ?> </dd> </dl> <?php endif; ?> <?php echo $this->loadTemplate('address'); ?> <?php if ($this->params->get('allow_vcard')) : ?> <?php echo JText::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS');?> <a href="<?php echo JRoute::_('index.php?option=com_contact&view=contact&id='.$this->contact->id . '&format=vcf'); ?>"> <?php echo JText::_('COM_CONTACT_VCARD');?></a> <?php endif; ?> <?php if ($this->params->get('presentation_style') == 'sliders'):?> </div> </div> </div> </div> <?php endif; ?> <?php if ($this->params->get('show_email_form') && ($this->contact->email_to || $this->contact->user_id)) : ?> <?php if ($this->params->get('presentation_style') == 'sliders'):?> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="accordionContact" href="#display-form"> <?php echo JText::_('COM_CONTACT_EMAIL_FORM');?> </a> </div> <div id="display-form" class="accordion-body collapse"> <div class="accordion-inner"> <?php endif; ?> <?php if ($this->params->get('presentation_style') == 'plain'):?> <?php echo '<h3>'. JText::_('COM_CONTACT_EMAIL_FORM').'</h3>'; ?> <?php endif; ?> <?php echo $this->loadTemplate('form'); ?> <?php if ($this->params->get('presentation_style') == 'sliders'):?> </div> </div> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_links')) : ?> <?php echo $this->loadTemplate('links'); ?> <?php endif; ?> <?php if ($this->params->get('show_articles') && $this->contact->user_id && $this->contact->articles) : ?> <?php if ($this->params->get('presentation_style') == 'sliders'):?> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="accordionContact" href="#display-articles"> <?php echo JText::_('JGLOBAL_ARTICLES');?> </a> </div> <div id="display-articles" class="accordion-body collapse"> <div class="accordion-inner"> <?php endif; ?> <?php if ($this->params->get('presentation_style') == 'plain'):?> <?php echo '<h3>'. JText::_('JGLOBAL_ARTICLES').'</h3>'; ?> <?php endif; ?> <?php echo $this->loadTemplate('articles'); ?> <?php if ($this->params->get('presentation_style') == 'sliders'):?> </div> </div> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_profile') && $this->contact->user_id && JPluginHelper::isEnabled('user', 'profile')) : ?> <?php if ($this->params->get('presentation_style') == 'sliders'):?> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="accordionContact" href="#display-profile"> <?php echo JText::_('COM_CONTACT_PROFILE');?> </a> </div> <div id="display-profile" class="accordion-body collapse"> <div class="accordion-inner"> <?php endif; ?> <?php if ($this->params->get('presentation_style') == 'plain'):?> <?php echo '<h3>'. JText::_('COM_CONTACT_PROFILE').'</h3>'; ?> <?php endif; ?> <?php echo $this->loadTemplate('profile'); ?> <?php if ($this->params->get('presentation_style') == 'sliders'):?> </div> </div> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->contact->misc && $this->params->get('show_misc')) : ?> <?php if ($this->params->get('presentation_style') == 'sliders'):?> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="accordionContact" href="#display-misc"> <?php echo JText::_('COM_CONTACT_OTHER_INFORMATION');?> </a> </div> <div id="display-misc" class="accordion-body collapse"> <div class="accordion-inner"> <?php endif; ?> <?php if ($this->params->get('presentation_style') == 'plain'):?> <?php echo '<h3>'. JText::_('COM_CONTACT_OTHER_INFORMATION').'</h3>'; ?> <?php endif; ?> <div class="contact-miscinfo"> <dl class="dl-horizontal"> <dt> <span class="<?php echo $this->params->get('marker_class'); ?>"> <?php echo $this->params->get('marker_misc'); ?> </span> </dt> <dd> <span class="contact-misc"> <?php echo $this->contact->misc; ?> </span> </dd> </dl> </div> <?php if ($this->params->get('presentation_style') == 'sliders'):?> </div> </div> </div> <?php endif; ?> <?php endif; ?> </div> PK���\^,�Q <templates/beez3/html/com_contact/contact/default_address.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /* marker_class: Class based on the selection of text, none, or icons * jicon-text, jicon-none, jicon-icon */ ?> <dl class="contact-address dl-horizontal"> <?php if (($this->params->get('address_check') > 0) && ($this->contact->address || $this->contact->suburb || $this->contact->state || $this->contact->country || $this->contact->postcode)) : ?> <?php if ($this->params->get('address_check') > 0) : ?> <dt> <span class="<?php echo $this->params->get('marker_class'); ?>" > <?php echo $this->params->get('marker_address'); ?> </span> </dt> <dd> <address> <?php endif; ?> <?php if ($this->contact->address && $this->params->get('show_street_address')) : ?> <span class="contact-street"> <?php echo nl2br($this->contact->address); ?> </span> <?php endif; ?> <?php if ($this->contact->suburb && $this->params->get('show_suburb')) : ?> <span class="contact-suburb"> <?php echo $this->contact->suburb; ?> </span> <?php endif; ?> <?php if ($this->contact->state && $this->params->get('show_state')) : ?> <span class="contact-state"> <?php echo $this->contact->state; ?> </span> <?php endif; ?> <?php if ($this->contact->postcode && $this->params->get('show_postcode')) : ?> <span class="contact-postcode"> <?php echo $this->contact->postcode; ?> </span> <?php endif; ?> <?php if ($this->contact->country && $this->params->get('show_country')) : ?> <span class="contact-country"> <?php echo $this->contact->country; ?> </span> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('address_check') > 0) : ?> </address> </dd> <?php endif; ?> <?php if ($this->contact->email_to && $this->params->get('show_email')) : ?> <dt> <span class="<?php echo $this->params->get('marker_class'); ?>" > <?php echo $this->params->get('marker_email'); ?> </span> </dt> <dd> <span class="contact-emailto"> <?php echo $this->contact->email_to; ?> </span> </dd> <?php endif; ?> <?php if ($this->contact->telephone && $this->params->get('show_telephone')) : ?> <dt> <span class="<?php echo $this->params->get('marker_class'); ?>" > <?php echo $this->params->get('marker_telephone'); ?> </span> </dt> <dd> <span class="contact-telephone"> <?php echo nl2br($this->contact->telephone); ?> </span> </dd> <?php endif; ?> <?php if ($this->contact->fax && $this->params->get('show_fax')) : ?> <dt> <span class="<?php echo $this->params->get('marker_class'); ?>" > <?php echo $this->params->get('marker_fax'); ?> </span> </dt> <dd> <span class="contact-fax"> <?php echo nl2br($this->contact->fax); ?> </span> </dd> <?php endif; ?> <?php if ($this->contact->mobile && $this->params->get('show_mobile')) :?> <dt> <span class="<?php echo $this->params->get('marker_class'); ?>" > <?php echo $this->params->get('marker_mobile'); ?> </span> </dt> <dd> <span class="contact-mobile"> <?php echo nl2br($this->contact->mobile); ?> </span> </dd> <?php endif; ?> <?php if ($this->contact->webpage && $this->params->get('show_webpage')) : ?> <dt> <span class="<?php echo $this->params->get('marker_class'); ?>" > </span> </dt> <dd> <span class="contact-webpage"> <a href="<?php echo $this->contact->webpage; ?>" target="_blank"> <?php echo $this->contact->webpage; ?></a> </span> </dd> <?php endif; ?> </dl> PK���\��5templates/beez3/html/com_contact/category/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="contact-category<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_category_title', 1)) : ?> <h2> <?php echo JHtml::_('content.prepare', $this->category->title, '', 'com_contact.category.title'); ?> </h2> <?php endif; ?> <?php if ($this->params->def('show_description', 1) || $this->params->def('show_description_image', 1)) : ?> <div class="category-desc"> <?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?> <img src="<?php echo $this->category->getParams()->get('image'); ?>"/> <?php endif; ?> <?php if ($this->params->get('show_description') && $this->category->description) : ?> <?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_contact.category'); ?> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?> <?php echo $this->loadTemplate('items'); ?> <?php if (!empty($this->children[$this->category->id])&& $this->maxLevel != 0) : ?> <div class="cat-children"> <h3><?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?></h3> <?php echo $this->loadTemplate('children'); ?> </div> <?php endif; ?> </div> PK���\��� ��>templates/beez3/html/com_contact/category/default_children.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $class = ' class="first"'; if (count($this->children[$this->category->id]) > 0 && $this->maxLevel != 0) : ?> <ul> <?php foreach ($this->children[$this->category->id] as $id => $child) : ?> <?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : if (!isset($this->children[$this->category->id][$id + 1])) { $class = ' class="last"'; } ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(ContactHelperRoute::getCategoryRoute($child->id));?>"> <?php echo $this->escape($child->title); ?></a> </span> <?php if ($this->params->get('show_subcat_desc') == 1) :?> <?php if ($child->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $child->description, '', 'com_contact.category'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_cat_items') == 1) :?> <dl><dt> <?php echo JText::_('COM_CONTACT_CAT_NUM'); ?></dt> <dd><?php echo $child->numitems; ?></dd> </dl> <?php endif; ?> <?php if (count($child->getChildren()) > 0 ) : $this->children[$child->id] = $child->getChildren(); $this->category = $child; $this->maxLevel--; echo $this->loadTemplate('children'); $this->category = $child->getParent(); $this->maxLevel++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; PK���\P��P__;templates/beez3/html/com_contact/category/default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_contact * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.framework'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> <?php if (empty($this->items)) : ?> <p> <?php echo JText::_('COM_CONTACT_NO_CONTACTS'); ?> </p> <?php else : ?> <form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm"> <?php if ($this->params->get('show_pagination_limit')) : ?> <fieldset class="filters"> <legend class="hidelabeltxt"><?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?></legend> <div class="display-limit"> <?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>  <?php echo $this->pagination->getLimitBox(); ?> </div> </fieldset> <?php endif; ?> <table class="category"> <?php if ($this->params->get('show_headings')) : ?> <thead><tr> <th class="item-title"> <?php echo JHtml::_('grid.sort', 'COM_CONTACT_CONTACT_EMAIL_NAME_LABEL', 'a.name', $listDirn, $listOrder); ?> </th> <?php if ($this->params->get('show_position_headings')) : ?> <th class="item-position"> <?php echo JHtml::_('grid.sort', 'COM_CONTACT_POSITION', 'a.con_position', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('show_email_headings')) : ?> <th class="item-email"> <?php echo JText::_('JGLOBAL_EMAIL'); ?> </th> <?php endif; ?> <?php if ($this->params->get('show_telephone_headings')) : ?> <th class="item-phone"> <?php echo JText::_('COM_CONTACT_TELEPHONE'); ?> </th> <?php endif; ?> <?php if ($this->params->get('show_mobile_headings')) : ?> <th class="item-phone"> <?php echo JText::_('COM_CONTACT_MOBILE'); ?> </th> <?php endif; ?> <?php if ($this->params->get('show_fax_headings')) : ?> <th class="item-phone"> <?php echo JText::_('COM_CONTACT_FAX'); ?> </th> <?php endif; ?> <?php if ($this->params->get('show_suburb_headings')) : ?> <th class="item-suburb"> <?php echo JHtml::_('grid.sort', 'COM_CONTACT_SUBURB', 'a.suburb', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('show_state_headings')) : ?> <th class="item-state"> <?php echo JHtml::_('grid.sort', 'COM_CONTACT_STATE', 'a.state', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('show_country_headings')) : ?> <th class="item-state"> <?php echo JHtml::_('grid.sort', 'COM_CONTACT_COUNTRY', 'a.country', $listDirn, $listOrder); ?> </th> <?php endif; ?> </tr> </thead> <?php endif; ?> <tbody> <?php foreach ($this->items as $i => $item) : ?> <?php if ($this->items[$i]->published == 0) : ?> <tr class="system-unpublished cat-list-row<?php echo $i % 2; ?>"> <?php else: ?> <tr class="cat-list-row<?php echo $i % 2; ?>" > <?php endif; ?> <td class="item-title"> <a href="<?php echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); ?>"> <?php echo $item->name; ?></a> </td> <?php if ($this->params->get('show_position_headings')) : ?> <td class="item-position"> <?php echo $item->con_position; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_email_headings')) : ?> <td class="item-email"> <?php echo $item->email_to; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_telephone_headings')) : ?> <td class="item-phone"> <?php echo $item->telephone; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_mobile_headings')) : ?> <td class="item-phone"> <?php echo $item->mobile; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_fax_headings')) : ?> <td class="item-phone"> <?php echo $item->fax; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_suburb_headings')) : ?> <td class="item-suburb"> <?php echo $item->suburb; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_state_headings')) : ?> <td class="item-state"> <?php echo $item->state; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_country_headings')) : ?> <td class="item-state"> <?php echo $item->country; ?> </td> <?php endif; ?> </tr> <?php endforeach; ?> </tbody> </table> <?php if ($this->params->get('show_pagination')) : ?> <div class="pagination"> <?php if ($this->params->def('show_pagination_results', 1)) : ?> <p class="counter"> <?php echo $this->pagination->getPagesCounter(); ?> </p> <?php endif; ?> <?php echo $this->pagination->getPagesLinks(); ?> </div> <?php endif; ?> <div> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> </div> </form> <?php endif; ?> PK���\���� � templates/beez3/html/modules.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * beezDivision chrome. * * @since 3.0 */ function modChrome_beezDivision($module, &$params, &$attribs) { $headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3; if (!empty ($module->content)) { ?> <div class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx')); ?>"> <?php if ($module->showtitle) { ?> <h<?php echo $headerLevel; ?>><?php echo $module->title; ?></h<?php echo $headerLevel; ?>> <?php }; ?> <?php echo $module->content; ?></div> <?php }; } /** * beezHide chrome. * * @since 3.0 */ function modChrome_beezHide($module, &$params, &$attribs) { $headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3; $state = isset($attribs['state']) ? (int) $attribs['state'] :0; if (!empty ($module->content)) { ?> <div class="moduletable_js <?php echo htmlspecialchars($params->get('moduleclass_sfx'));?>"><?php if ($module->showtitle) : ?> <h<?php echo $headerLevel; ?> class="js_heading"> <?php echo $module->title; ?> <a href="#" title="<?php echo JText::_('TPL_BEEZ3_CLICK'); ?>" onclick="auf('module_<?php echo $module->id; ?>'); return false" class="opencloselink" id="link_<?php echo $module->id?>"> <span class="no"><img src="templates/beez3/images/plus.png" alt="<?php if ($state == 1) { echo JText::_('TPL_BEEZ3_ALTOPEN');} else {echo JText::_('TPL_BEEZ3_ALTCLOSE');} ?>" /> </span></a></h<?php echo $headerLevel; ?>> <?php endif; ?> <div class="module_content <?php if ($state == 1){echo "open";} ?>" id="module_<?php echo $module->id; ?>" tabindex="-1"><?php echo $module->content; ?></div> </div> <?php } } /** * beezTabs chrome. * * @since 3.0 */ function modChrome_beezTabs($module, $params, $attribs) { $area = isset($attribs['id']) ? (int) $attribs['id'] :'1'; $area = 'area-'.$area; static $modulecount; static $modules; if ($modulecount < 1) { $modulecount = count(JModuleHelper::getModules($module->position)); $modules = array(); } if ($modulecount == 1) { $temp = new stdClass; $temp->content = $module->content; $temp->title = $module->title; $temp->params = $module->params; $temp->id = $module->id; $modules[] = $temp; // list of moduletitles // list of moduletitles echo '<div id="'. $area.'" class="tabouter"><ul class="tabs">'; foreach ($modules as $rendermodule) { echo '<li class="tab"><a href="#" id="link_'.$rendermodule->id.'" class="linkopen" onclick="tabshow(\'module_'. $rendermodule->id.'\');return false">'.$rendermodule->title.'</a></li>'; } echo '</ul>'; $counter = 0; // modulecontent foreach ($modules as $rendermodule) { $counter ++; echo '<div tabindex="-1" class="tabcontent tabopen" id="module_'.$rendermodule->id.'">'; echo $rendermodule->content; if ($counter != count($modules)) { echo '<a href="#" class="unseen" onclick="nexttab(\'module_'. $rendermodule->id.'\');return false;" id="next_'.$rendermodule->id.'">'.JText::_('TPL_BEEZ3_NEXTTAB').'</a>'; } echo '</div>'; } $modulecount--; echo '</div>'; } else { $temp = new stdClass; $temp->content = $module->content; $temp->params = $module->params; $temp->title = $module->title; $temp->id = $module->id; $modules[] = $temp; $modulecount--; } } PK���\��y�DD9templates/beez3/html/com_newsfeeds/categories/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_newsfeeds * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers'); JHtml::_('behavior.caption'); ?> <div class="categories-list<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_base_description')) : ?> <?php //If there is a description in the menu parameters use that; ?> <?php if ($this->params->get('categories_description')) : ?> <div class="category-desc base-desc"> <?php echo JHtml::_('content.prepare', $this->params->get('categories_description'), '', 'com_newsfeeds.categories'); ?> </div> <?php else: ?> <?php //Otherwise get one from the database if it exists. ?> <?php if ($this->parent->description) : ?> <div class="category-desc base-desc"> <?php echo JHtml::_('content.prepare', $this->parent->description, '', 'com_newsfeeds.categories'); ?> </div> <?php endif; ?> <?php endif; ?> <?php endif; ?> <?php echo $this->loadTemplate('items'); ?> </div> PK���\�e���?templates/beez3/html/com_newsfeeds/categories/default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_newsfeeds * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $class = ' class="first"'; if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : ?> <ul> <?php foreach ($this->items[$this->parent->id] as $id => $item) : ?> <?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : if (!isset($this->items[$this->parent->id][$id + 1])) { $class = ' class="last"'; } ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($item->id));?>"> <?php echo $this->escape($item->title); ?></a> </span> <?php if ($this->params->get('show_subcat_desc_cat') == 1) :?> <?php if ($item->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $item->description, '', 'com_newsfeeds.categories'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_cat_items_cat') == 1) :?> <dl class="newsfeed-count"><dt> <?php echo JText::_('COM_NEWSFEEDS_CAT_NUM'); ?></dt> <dd><?php echo $item->numitems; ?></dd> </dl> <?php endif; ?> <?php if (count($item->getChildren()) > 0) : $this->items[$item->id] = $item->getChildren(); $this->parent = $item; $this->maxLevelcat--; echo $this->loadTemplate('items'); $this->parent = $item->getParent(); $this->maxLevelcat++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> PK���\Q���ss7templates/beez3/html/com_newsfeeds/category/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_newsfeeds * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers'); JHtml::_('behavior.caption'); ?> <div class="newsfeed-category<?php echo $this->pageclass_sfx;?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_category_title', 1)) : ?> <h2> <?php echo JHtml::_('content.prepare', $this->category->title, '', 'com_newsfeeds.category.title'); ?> </h2> <?php endif; ?> <?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?> <div class="category-desc"> <?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?> <img src="<?php echo $this->category->getParams()->get('image'); ?>"/> <?php endif; ?> <?php if ($this->params->get('show_description') && $this->category->description) : ?> <?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_newsfeeds.category'); ?> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?> <?php echo $this->loadTemplate('items'); ?> <?php if (!empty($this->children[$this->category->id])&& $this->maxLevel != 0) : ?> <div class="cat-children"> <h3><?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?></h3> <?php echo $this->loadTemplate('children'); ?> </div> <?php endif; ?> </div> PK���\��F��@templates/beez3/html/com_newsfeeds/category/default_children.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_newsfeeds * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $class = ' class="first"'; if (count($this->children[$this->category->id]) > 0 && $this->maxLevel != 0) : ?> <ul> <?php foreach ($this->children[$this->category->id] as $id => $child) : ?> <?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : if (!isset($this->children[$this->category->id][$id + 1])) { $class = ' class="last"'; } ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($child->id));?>"> <?php echo $this->escape($child->title); ?></a> </span> <?php if ($this->params->get('show_subcat_desc') == 1) :?> <?php if ($child->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $child->description, '', 'com_newsfeeds.category'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->params->get('show_cat_items') == 1) :?> <dl class="newsfeed-count"><dt> <?php echo JText::_('COM_NEWSFEEDS_CAT_NUM'); ?></dt> <dd><?php echo $child->numitems; ?></dd> </dl> <?php endif; ?> <?php if (count($child->getChildren()) > 0) : $this->children[$child->id] = $child->getChildren(); $this->category = $child; $this->maxLevel--; echo $this->loadTemplate('children'); $this->category = $child->getParent(); $this->maxLevel++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; PK���\�0��=templates/beez3/html/com_newsfeeds/category/default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage com_newsfeeds * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.framework'); $n = count($this->items); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> <?php if (empty($this->items)) : ?> <p> <?php echo JText::_('COM_NEWSFEEDS_NO_ARTICLES'); ?> </p> <?php else : ?> <form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm"> <fieldset class="filters"> <legend class="hidelabeltxt"><?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?></legend> <?php if ($this->params->get('show_pagination_limit')) : ?> <div class="display-limit"> <?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>  <?php echo $this->pagination->getLimitBox(); ?> </div> <?php endif; ?> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> </fieldset> <table class="category"> <?php if ($this->params->get('show_headings') == 1) : ?> <thead><tr> <th class="item-title" id="tableOrdering"> <?php echo JHtml::_('grid.sort', 'COM_NEWSFEEDS_FEED_NAME', 'a.name', $listDirn, $listOrder); ?> </th> <?php if ($this->params->get('show_articles')) : ?> <th class="item-num-art" id="tableOrdering2"> <?php echo JHtml::_('grid.sort', 'COM_NEWSFEEDS_NUM_ARTICLES', 'a.numarticles', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('show_link')) : ?> <th class="item-link" id="tableOrdering3"> <?php echo JHtml::_('grid.sort', 'COM_NEWSFEEDS_FEED_LINK', 'a.link', $listDirn, $listOrder); ?> </th> <?php endif; ?> </tr> </thead> <?php endif; ?> <tbody> <?php foreach ($this->items as $i => $item) : ?> <?php if ($this->items[$i]->published == 0) : ?> <tr class="system-unpublished cat-list-row<?php echo $i % 2; ?>"> <?php else: ?> <tr class="cat-list-row<?php echo $i % 2; ?>" > <?php endif; ?> <td class="item-title"> <a href="<?php echo JRoute::_(NewsFeedsHelperRoute::getNewsfeedRoute($item->slug, $item->catid)); ?>"> <?php echo $item->name; ?></a> </td> <?php if ($this->params->get('show_articles')) : ?> <td class="item-num-art"> <?php echo $item->numarticles; ?> </td> <?php endif; ?> <?php if ($this->params->get('show_link')) : ?> <td class="item-link"> <a href="<?php echo $item->link; ?>"><?php echo $item->link; ?></a> </td> <?php endif; ?> </tr> <?php endforeach; ?> </tbody> </table> <?php if ($this->params->get('show_pagination')) : ?> <div class="pagination"> <?php if ($this->params->def('show_pagination_results', 1)) : ?> <p class="counter"> <?php echo $this->pagination->getPagesCounter(); ?> </p> <?php endif; ?> <?php echo $this->pagination->getPagesLinks(); ?> </div> <?php endif; ?> </form> <?php endif; ?> PK���\ S�88 templates/beez3/css/position.cssnu�[���/** * @author ( Angie Radtke ) * @package Joomla * @subpackage Accessible-Template-Beez * @copyright Copyright (C) 2005 - 2009 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant to the * GNU General Public License, and as distributed it includes or is derivative * of works licensed under the GNU General Public License or other free or open * source software licenses. See COPYRIGHT.php for copyright notices and * details. */ html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, hgroup, menu, nav, section, time, mark, audio, video { margin: 0; padding: 0; border: 0; outline: 0; vertical-align: baseline; background: transparent; } article, aside, figure, footer, header, hgroup, nav, section { display: block; } html { background: #ffffff; font-size: 100.01%; -webkit-overflow-scrolling: touch; -webkit-tap-highlight-color: #f3f5f6; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } body { position: relative; width: 100%; line-height: 1.5em; background: #eee } /* ###################### general ###################### */ #all { margin: 0 auto; max-width: 1050px; padding: 0; text-align: left; font-size: 0.8em } #header { display: block !important; position: relative; padding: 8em 0 0 0; overflow: hidden; } #header ul { position: absolute; left: 0; top: 5em; right: 0; display: block; margin: 0 0 1px 0; text-align: right; list-style-type: none; padding: 10px 0 } #back { margin: 0; padding: 0; } #contentarea, #contentarea2 { position: relative; overflow: hidden; padding: 0 20px !important; margin: 0; } #wrapper { width: 53%; float: left; position: relative; } #wrapper2 { width: 72%; float: left; position: relative; padding-bottom: 20px; } #wrapper2 .item-page { max-width: 660px } #main { padding-top: 10px; padding-bottom: 20px; position: relative; } #right { float: left; width: 20%; margin: 10px 0 10px 2%; padding: 0 0 5px 0; position: relative; } .unseen, .hidelabeltxt, #line label { display: inline; height: 0; left: -3000px; position: absolute; top: -2000px; width: 0; } /* ++++++++++++++ nav after content ++++++++++++++ */ .left { padding-top: 0; float: right; margin: 10px 0 10px 0; width: 22%; position: relative; } /* ++++++++++++++ nav before content ++++++++++++++ */ .left1 { padding: 0; float: left; margin: 10px 3% 10px 0; width: 21%; position: relative } .leftbigger { width: 25% } /* ###################### header ###################### */ .skiplinks, .skiplinks li { display: inline; height: 0; line-height: 0; padding: 0 !important; } .skiplinks li a.u2 { display: inline; height: 0; left: -3000px; position: absolute; top: -2000px; width: 0; } .skiplinks li a.u2:active, .skiplinks li a.u2:focus { position: absolute; width: 13em; top: -4em; left: 10px; line-height: 1.5em; padding: 5px; font-weight: bold; height: 3em; } .wrap { border: 0; clear: both; float: none; font-size: 1px; height: 0; line-height: 1px; margin: 0; padding: 0; visibility: hidden; } #logo { margin-top: 0; margin-left: 10px; display: block; padding: 1em 20px 20px 10px; width: 425px; font-weight: normal; line-height: 1em; } #logo img { display: block; } #logo span { padding-left: 2px } #logo span.header1 { display: block; top: 0; line-height: 0.8em; font-size: 0.7em; padding-left: 55px } .logoheader { margin: -2px 10px 0; padding: 0; text-align: left; font-weight: normal; line-height: 1.5em; } .header1 { font-size: 1.5em; margin-left: 10px; } #line { padding: 5px 0 2px 2px; position: absolute; right: 10px; top: 0.5em; max-width: 40em; text-align: right; min-width: 40em } #fontsize, #line .search { display: inline; margin: 0; } /* ++++++++++++++ button for closing right column ++++++++++++++ */ #close { margin-right: 0; text-transform: uppercase; } #close span { position: absolute; right: 20px; z-index: 10000; top: 5px; font-weight: bold; text-align: right; line-height: 1.5em; margin-top:20px; padding: 5px } #close > a { display: block; overflow: hidden } #close > a:hover span { background: #095197 } /* ###################### main ###################### */ /* ++++++++++++++ position ++++++++++++++ */ .blog-featured { padding: 0; } .items-leading { padding: 0 5px 10px 5px; overflow: hidden; margin-bottom: 10px } .row-separator { display: block; clear: both; margin: 0; border: 0; height: 1px } .item-separator { display: none; margin: 0; } .shownocolumns { width: 98% !important; } #top { margin: 0 0 20px 0; overflow: hidden } /* ++++++++++++++ blog ++++++++++++++ */ .cols-1 { display: block; float: none !important; margin: 0 !important; } .cols-2 .column-1 { width: 46%; float: left; } .cols-2 .column-2 { width: 46%; float: right; margin: 0 } .cols-3 .column-1 { float: left; width: 29%; padding: 0 5px; margin-right: 4% } .cols-3 .column-2 { float: left; width: 29%; margin-left: 0; padding: 0 5px } .cols-3 .column-3 { float: right; width: 29%; padding: 0 5px } .items-row { overflow: hidden; margin-bottom: 10px !important; } .column-1, .column-2, .column-3 { padding: 10px 5px } .column-2 { width: 55%; margin-left: 40%; } .column-3 { width: 30% } .blog-more { padding: 10px 5px } /* ++++++++++++++ footer ++++++++++++++ */ #bottom { overflow: hidden } .box { width: 27%; float: left; margin-right: 10px; min-height: 100px } .box1 { width: 35% } .box2 { width: 32% } .box3 { float: right } #footer-inner, #footer { max-width: 1025px; margin: 0 auto; padding: 10px 15px 10px 10px; } img { border: 0 none; max-width: 100%; } /* hide the mobile menu button */ #mobile_select { display: none } PK���\�>��**templates/beez3/css/nature.cssnu�[���/* * @author ( Angie Radtke ) */ /* ########################## general ########################### */ body { font-family: arial, helvetica, sans-serif; background:#fff; color:#444 } h3 { color: #555 } h2 a { text-decoration: none } h2, .moduletable h3 { border-bottom: solid 1px #ddd; } .items-row h2 {border-top: solid 1px #ddd; } a:link, a:visited { color:#0A5E69 } a:hover, a:active, a:focus { background:#0A5E69; color:#FFF; } /* ########################## logo ########################### */ .logoheader { border-top:solid 1px transparent; color:#fff; max-width: 1050px; margin:37px auto; min-height:20px; margin-bottom:0; } .logoheader h1#logo {padding:20px 10px 0px 10px; } .logoheader h1#logo span.header1 {padding:0} /* ########################## header ########################### */ #all {padding-top:13em} #line { position:relative; max-width:1050px; margin:0 auto; text-align:right; right:0; top:0em} #header { background: #004746; /* Old browsers */ background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#185359", endColorstr="#007774"); background: -moz-linear-gradient(top, #004746 0%, #0a5e69 25%, #185359 18%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#004746), color-stop(25%,#0a5e69), color-stop(18%,#185359)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #004746 0%,#0a5e69 25%,#185359 18%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #004746 0%,#0a5e69 25%,#185359 18%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #004746 0%,#0a5e69 25%,#185359 18%); /* IE10+ */ background: linear-gradient(top, #004746 0%,#0a5e69 25%,#185359 18%); /* W3C */ position:absolute; left:0; top:0; width:99.9%; padding:0; } /* green background */ .button:hover, button:hover, p.readmore a:hover, .pagenav a:hover, .pagenav a:active, .pagenav a:focus, #advanced-search-toggle:hover, #advanced-search-toggle:active, #advanced-search-toggle:focus, .profile-edit a:hover, .profile-edit a:active, .profile-edit a:focus, #fontsize a:hover, #fontsize a:active, #fontsize a:focus,#mobile_select h2 a { color: #fff; background: #008885; /* Old browsers */ background-color: hsl(165, 27%, 27%) ; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#008885", endColorstr="#004746"); background-image: -khtml-gradient(linear, left top, left bottom, from(#008885), to(#004746)); background-image: -moz-linear-gradient(top, #008885, #004746); background-image: -ms-linear-gradient(top, #008885, #004746); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #008885), color-stop(100%, #004746)); background-image: -webkit-linear-gradient(top, #008885, #004746); background-image: -o-linear-gradient(top, #008885, #004746); background-image: linear-gradient(#008885, #004746); border-color: #004746 #004746 hsl(165, 27%, 22.5%); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.29); -webkit-font-smoothing: antialiased; } /* ++++++++++++++ header menu ++++++++++++++ */ #header ul.menu { border:0; list-style-type:none; border-radius:0; overflow:hidden; margin:0 auto ; text-align:right; position:absolute; top:0; right:10px; } #header ul.menu li { border:0; } #header ul.menu a { box-shadow:none; border-bottom:0 } #header ul.menu li a:link, #header ul.menu li a:visited { color:#fff; border:0; border-right:solid 1px #237D85; box-shadow: none; background:transparent; padding:10px ; display:inline-block } #header ul.menu li:first-child a {border-radius:0} #header ul.menu li a:hover, #header ul.menu li a:active, #header ul.menu li a:focus { color:#333; background:#bddfb3; padding:10px } #header ul li.active a:link, #header ul li.active a:visited { color:#333; border-right:solid 1px #237D85; background:#bddfb3; padding: 10px ; } #fontsize a , #fontsize h3 {color:#fff} /* grey background */ .button, button , p.readmore a , .pagenav a:link, .pagenav a:visited, #advanced-search-toggle , .profile-edit a:link,.profile-edit a:visited, h3.js_heading { background-color: #F5F5F5; background-image: -moz-linear-gradient(center top, #FFFFFF, #E6E6E6); background-repeat: repeat-x; border:solid 1px #ccc; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); color: #004746; } /* ++++++++++++++++++++++ navigation ++++++++++++++++++++++++++ */ .moduletable_menu { border: solid 1px #ddd; background: #f9f9f9; } #header ul.menu { border-color: #D5D5D5; } ul.menu a:hover, ul.menu a:active, ul.menu a:focus { background-color: #F5F5F5; background-image: -moz-linear-gradient(center top, #FFFFFF, #E6E6E6); background-repeat: repeat-x; background: url(../images/arrow.png) no-repeat right center; color: #004746; } /* ++++++++++++++++ highlightning active menuitem +++++++++++++++++++ */ ul.menu li.active a,ul.menu li.active ul li.active a, ul.menu li.active ul li.active ul li.active a, ul.menu li.active ul li.active ul li.active ul li.active a , ul.menu li.active ul li.active ul li.active ul li.active ul li.active a {font-weight:bold; } ul.menu li.active ul li a, ul.menu li.active ul li.active ul li a, ul.menu li.active ul li.active ul li.active ul li a, ul.menu li.active ul li.active ul li.active ul li.active ul li a {font-weight:normal} ul.menu a { box-shadow:0 1px 0 #fff; border-bottom:solid 1px #ddd; } ul.menu ul a { background: #e5e5e5; margin-bottom:1px } ul.menu ul ul ul a { background: #f5f5f5 url(../images/arrow.png) no-repeat 24px center; } ul.menu ul ul ul ul a { background: #fff; } /* +++++++++++++++++ content +++++++++++++++ */ .article-info { background-color: #fbfbfb; background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5) ); background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); background-image: linear-gradient(top, #ffffff, #f5f5f5); background-repeat: repeat-x; filter: progid : DXImageTransform.Microsoft.gradient ( startColorstr = '#ffffff', endColorstr = '#f5f5f5', GradientType = 0 ); border: 1px solid #ddd; -webkit-box-shadow: inset 0 1px 0 #ffffff; -moz-box-shadow: inset 0 1px 0 #ffffff; box-shadow: inset 0 1px 0 #ffffff; } ul.menu a:link,ul.menu a:visited { color: #444; } #footer-inner, #footer , #footer-outer { background: #f5f5f5; } #footer-sub {background:#555;} #footer {background:#555; max-width:1025px; margin:0 auto; } #footer a {color:#fff} .box1 {border-right:solid 1px #ccc} .box3 {border-left:solid 1px #ccc} #bottom ul li a {background-image:none; padding-left:0} /* +++++++++++++++++++++++ SLIDER ++++++++++++++++++++ */ .panel h3.pane-toggler a { background: url(../images/slider_plus.png) right top no-repeat; color:#333 } .panel h3.pane-toggler-down a { background: url(../images/slider_minus.png) right top no-repeat; border-bottom:solid 1px #ddd; color:#333 } /* +++++++++++++++++ Tabs ++++++++++++++++++++++ */ ul.tabs li, dl.tabs dt h3 a:link, dl.tabs dt h3 a:visited { background:#f5f5f5 url(../images/nature/box.png) repeat-x; } ul.tabs li a:link, ul.tabs li a:visited, dl.tabs dt a { color:#333; border:solid 1px #ddd; border-bottom:0 } ul.tabs li a:hover, ul.tabs li a:active, ul.tabs li a:focus { color:#000 } .tabcontent, div.current { background:#fff; color:#000; border:solid 1px #ddd; } .tabcontent .linkclosed { color:#000; border-bottom:solid 1px #e5e5e5; } ul.tabs li a.linkopen, dl.tabs dt.open h3 a:link, dl.tabs dt.open h3 a:visited { background:#fff; color:#333; border-radius: 5px 5px 0px 0px; } ul.tabs li a.linkclosed:hover, ul.tabs li a.linkclosed:active, ul.tabs li a.linkclosed:focus, ul.tabs li a.linkopen:hover, ul.tabs li a.linkopen:active, ul.tabs li a.linkopen:focus { background:#555; color:#fff } /* +++++++++++++++++ Pagination +++++++++++++++ */ .pagination span, .pagination span a:hover { color: #999999; background-color: #f5f5f5; } /* active item */ span.pagenav { background:#0A5E69; color:#fff } .pagination-start span.pagenav, .pagination-prev span.pagenav, .pagination-end span.pagenav, .pagination-next span.pagenav { background-color:#f5f5f5; color:#444 } /* +++++++++++++ table display Catgegories table, contact etc, ++++++++++++++++++++* */ table {border:solid 1px #ddd} table th { background-color: #0A5E69;; color: #fff; } table th a:link, table th a:visited {color:#fff} tr.odd, tr.cat-list-row1 {background:#f8f8f8} table tr:hover td, table tr:hover th { background-color: #FEFDE2; } /* responsive */ #mobile_select h2 {border:0; margin:-17px 0 0 0; padding:0; background:#004746;text-align:right} #mobile_select h2 a { display:inline-block; font-size:0.8em; border-radius:4px 4px 0 0; padding:6px; font-size:0.75em; margin-right:5px; } @media only screen and (max-width: 480px) { img { max-width: 100%; height: auto; border: 0; -ms-interpolation-mode: bicubic; } #fontsize{display:none} #nav,#wrapper2,#wrapper,.cols-3 .column-1,.cols-3 .column-2,.cols-3 .column-3,#right,.box,#header form { float: none; width: 100% } #header {padding-top:3em; position:relative; margin:0; max-height:auto !important; } #header form {margin:0} #all {padding-top:0} .logoheader {background:#004746 ; min-height:100px;margin:0 } .box { border-left: 0 !important; border-bottom: solid 1px #ddd; } #line { text-align: center; top: 0; right: auto; max-width: 100% ; min-width:100%; margin: 0 0px; background:#0A5E69; position:absolute } #header form input { float: none; margin-bottom:4px } #menuwrapper { margin-top:10px; background:#fff; padding:10px; width:97%} #header ul.menu {position:relative; top:0;left:20px; right:20px; margin:0; width:90%; border-radius:4px; text-align:left; border:0} #header ul.menu li:first-child a {border-radius: 4px 4px 0 0} #header ul.menu li:last-child a {border-radius:0 0 4px 4px } #header ul.menu li a:link, #header ul.menu li a:visited { display: block; padding: 6px 10px; border-right:0; border-bottom: solid 1px #ccc; background:#eee; color:#444 } } @media only screen and (min-width: 600px) { } @media only screen and (min-width: 768px) { } @media only screen and (min-width: 992px) { } @media only screen and (min-width: 1382px) { /* Styles */ } @media only screen and (-webkit-min-device-pixel-ratio: 1.5) , only screen and (min--moz-device-pixel-ratio: 1.5) , only screen and (min-device-pixel-ratio: 1.5) { /* Styles */ } PK���\�0���"templates/beez3/css/nature_rtl.cssnu�[���h1#logo { padding: 0.6em 20px 10px 10px; } #header ul.menu { left: 0; right: auto; } #logo span { padding-right: 2px; } PK���\��>�3 3 templates/beez3/css/ieonly.cssnu�[���/** * @author ( Angie Radtke ) * @package Joomla * @subpackage Accessible-Template-Beez * @copyright Copyright (C) 2005 - 2009 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant to the * GNU General Public License, and as distributed it includes or is derivative * of works licensed under the GNU General Public License or other free or open * source software licenses. See COPYRIGHT.php for copyright notices and * details. */ #all { width: expression(document . body . clientWidth > 1050 ? "1050" : "auto"); } #footer-inner { width: expression(document . body . clientWidth > 1050 ? "1025" : "auto"); } #footer { width: expression(document . body . clientWidth > 1050 ? "1020" : "auto"); } #all { border:solid 1px #fff; zoom:1 } #header { position:relative; zoom:1} #line { width:19.0em; margin-right:20px; } #header ul.skiplinks li a { background:#cc0000; border:0px solid #000 } #contentarea, #contentarea2 { display:inline-block; position:relative; } #main { height:520px; } #back { margin: 0; padding:0 0px; } #right { float:left; width: 20.5%; text-align:left !important } .left { margin:10px 0px 10px 18px; } /* haslayout erzwingen */ .blog { width:100% } .article_row { width:auto; } .row1 .cols2 { width:auto; } .moduletable, .moduletable_js { zoom:1 } #nav ul li, #right ul li, #bottom ul li { height:1% } p.articleinfo { display:inline-block } h1 { } ul.tabs { text-align:left } ul.newsflash-horiz, #footer-outer, ul.tabs { zoom:1 } .tabcontent { overflow:hidden !important; position:relative } #main h1 { zoom:1} .box {width:26%} #bottom {display:inline-block} .panel, div.current {zoom:1} .contact-image { display:inline-block } .item-page { width:100%} #mailto-window .mailto-close a { width:25px; height:25px; } #users-profile-core legend, #users-profile-custom legend, .profile-edit legend, .registration legend { margin-bottom:15px } .login-fields input { width:14em } dd.error {zoom:1} #close a { cursor:pointer } #close a span { line-height:normal } PK���\�&��D�Dtemplates/beez3/css/layout.cssnu�[���/** * @author ( Angie Radtke ) * @package Joomla * @subpackage Accessible-Template-Beez * @copyright Copyright (C) 2005 - 2009 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant to the * GNU General Public License, and as distributed it includes or is derivative * of works licensed under the GNU General Public License or other free or open * source software licenses. See COPYRIGHT.php for copyright notices and * details. /* Typography =================================================== */ body#shadow { font-family: arial,sans-serif } body h1,body h2,body h3,body h4,body h5,body h6 { margin: 0; font-family: inherit; font-weight: normal; color: inherit; text-rendering: optimizelegibility; } body h1 { margin-bottom: 0.75em; font-size: 3.6em; line-height: 1.2; } body h2 { margin-bottom: 0.75em; font-size: 1.5em; line-height: 1.2; padding: 5px 0 } body h3 { margin-bottom: 1em; font-size: 1.4em; line-height: 1.3; padding-bottom: 5px } body h4 { margin-bottom: 1.5em; font-size: 1.2em; line-height: 1.25; } body h5 { font-size: 1.1em; margin-bottom: 1.5em; } body p,body ol,body ul,body dl,body address { margin-bottom: 1.5em; font-size: 1.0em; line-height: 1.5em; } small { font-size: 0.9em; } body ul,body ol { margin: 0 0 1.5em 12px; padding: 0 0 0 12px; } body li ul,body li ol { margin: 0; } ul.categories-module { padding:0; margin:0} blockquote { margin: 0 0 1.5em -24px; padding-left: 24px; border-left: 2px solid #c7ced6; font-style: normal; } q { quotes: none; } cite { font-style: normal; } abbr[title] { border-bottom: 1px dotted #c7ced6; cursor: help; } b,strong { font-weight: bold; } dfn { font-style: italic; } ins { text-decoration: none; } mark { font-style: italic; font-weight: bold; } pre,code,kbd,samp { line-height: 1.5em; } pre { white-space: pre-wrap; } sub,sup { position: relative; line-height: 0; } sup { top: -0.5em; } sub { bottom: -0.25em; } table { width: 100%; max-width: 100%; margin-bottom: 1.5em; border-collapse: collapse; border-spacing: 0; background-color: transparent; font-size: 1em } table th,table td { padding: 8px; vertical-align: top; border-top: 1px solid #ddd; line-height: 1.5em; text-align: left; } table th { font-weight: bold; border: 0 } table thead th { vertical-align: bottom; } table tr:first-child th,table tr:first-child td,table thead:first-child tr:first-child th,table thead:first-child tr:first-child td { border-top: 0; } table tbody+tbody { border-top: 2px solid #8c9bab; } table tbody tr td,table tbody tr th { -webkit-transition: background-color 0.25s 0 linear; -moz-transition: background-color 0.25s 0 linear; -ms-transition: background-color 0.25s 0 linear; -o-transition: background-color 0.25s 0 linear; transition: background-color 0.25s 0 linear; } /* links */ p.readmore a, .mod-articles-category-readmore a { border: 1px solid #CCCCCC; border-radius: 3px; display: inline-block; text-decoration: none; line-height: 1.6em; margin-bottom: 9px; padding: 4px; line-height: 1.6em; } /* +++++++++++++++++ forms general ####################### */ form { margin: 0 0 18px; } fieldset { border: solid 1px #ddd; margin: 10px 0; padding: 20px; border-radius: 5px } fieldset p { margin: 0; padding: 0; } legend { font-weight: bold; background: #fff; padding: 5px 10px } label,input,button,select,textarea { font-weight: normal; } label { color: #333333; margin-bottom: 5px; max-width: 90% } input,textarea,select,#advanced-search-toggle, input.search-query { border: 1px solid #CCCCCC; border-radius: 3px; display: inline-block; margin-bottom: 9px; padding: 4px; } .filter-search-lbl {display:inline} .filter-search, .display-limit {float:left; margin-right:10px} .button,button,.profile-edit a { border-radius: 3px; padding: 4px; line-height: 1.2em; text-decoration: none; } label input,label textarea,label select { display: block; } input[type="image"],input[type="checkbox"],input[type="radio"] { border-radius: 0; cursor: pointer; height: auto; line-height: normal; margin: 3px 0; padding: 0; width: auto; } input[type="button"],input[type="reset"],input[type="submit"] { height: auto; width: auto; } select { height: 28px; line-height: 28px; max-width:99%} select { width: 220px; } select[multiple],select[size] { height: auto; } textarea { height: auto; } .radio,.checkbox { padding-left: 18px; } input[type="radio"],input[type="checkbox"] { display: inline; margin-right : 10px; border:none } input,textarea { -moz-transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset; } input:focus,textarea:focus { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6); outline: 0 none; } input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus,select:focus { box-shadow: none; outline-offset: -2px; } /* +++++++++++++++++++++++ header searchbox +++++++++++++++++++++ */ #header form { overflow: hidden; float: right } #header form .search {display:inline} #header input { font-weight: bold; float: left; } #header .inputbox { margin-right: 5px } /* ++++++++++++++++++++ search component +++++++++++++++++++++++ */ fieldset.word { border: 0; background: #fff; padding: 0 } fieldset.phrases label,fieldset.only label { display: inline; margin: 0 10px } :root *> fieldset.only label:before { background: #a7c7dc; background: -moz-linear-gradient(-45deg, #fefefe, #ddd); background: -webkit-linear-gradient(-45deg, #fefefe, #ddd); background: -o-linear-gradient(-45deg, #fefefe, #ddd); background: -ms-linear-gradient(-45deg, #fefefe, #ddd); background: linear-gradient(-45deg, #fefefe, #ddd); border: 1px solid #aaa; border-radius: 3px; box-shadow: 0 0 1px 1px #CCCCCC; height: 1em; margin: 0 4px 0 0; text-transform: uppercase; width: 1em; content: "."; display: inline-block; margin-left: -40px; padding: 2px; line-height: 1em; text-indent: -50px; } input[type="checkbox"]:checked+label:before { content: "\2714"; text-indent: 0; background: -moz-linear-gradient(-45deg, #fefefe, #0b70cd); background: -webkit-linear-gradient(-45deg, #fefefe, #0b70cd); background: -o-linear-gradient(-45deg, #fefefe, #0b70cd); background: -ms-linear-gradient(-45deg, #fefefe, #0b70cd); background: linear-gradient(-45deg, #fefefe, #0b70cd); border: 1px solid #0B70CD; } :root *> .phrases-box label:before { background: #a7c7dc; background: -moz-linear-gradient(-45deg, #fefefe, #ccc); background: -webkit-linear-gradient(-45deg, #fefefe, #0b70cd); background: -o-linear-gradient(-45deg, #fefefe, #0b70cd); background: -ms-linear-gradient(-45deg, #fefefe, #0b70cd); background: linear-gradient(-45deg, #fefefe, #0b70cd); border: 1px solid #aaa; line-height: 1.3em; margin: 0 4px 0 0; text-transform: uppercase; width: 1.3em; content: "."; display: inline-block; margin-left: -40px; -moz-border-radius: 12px; -webkit-border-radius: 12px; border-radius: 12px; text-indent: -40px; color: #fff; text-shadow: 0px 10px 6px #fff; } /* input[type="radio"]:checked + label:before { content: "\2022"; text-indent: 6px; background: -moz-linear-gradient(-45deg, #fefefe, #0b70cd); background: -webkit-linear-gradient(-45deg, #fefefe, #0b70cd); background: -o-linear-gradient(-45deg, #fefefe, #0b70cd); background: -ms-linear-gradient(-45deg, #fefefe, #0b70cd); background: linear-gradient(-45deg, #fefefe, #0b70cd); color: #000; zoom:1; border: 1px solid #aaa; }*/ .ordering-box { margin: 10px 0; } .search-results dt.result-title { padding: 15px 15px 0px 5px; font-weight: bold; } .search-results dd { padding: 2px 15px 2px 5px } .search-results dd.result-text { padding: 10px 15px 10px 5px; line-height: 1.7em } .search-results dd.result-url { font-size: 90%; padding: 2px 15px 15px 5px; } .search-results dd.result-created { padding: 2px 15px 15px 5px } .search-results dd.result-category { padding: 10px 15px 5px 5px } .advanced-search-tip { background: #FEFDE2; border-radius: 3px; padding: 20px; border: solid 1px #ddd } .advanced-search-tip p { margin: 0 } .advanced-search-tip .term { font-weight: bold; font-style: italic } .panel { border: solid 1px #ddd; margin-top: -1px; } #main .panel h3 { margin: 0px; padding: 0; background: #eee; border: 0; font-size: 1.0em } .panel h3 a { display: block; padding: 6px; text-decoration: none; padding: 6px; } .pane-slider { border: solid 0px; padding: 10px; margin: 0; } /* +++++++++++++++++++ Contact Form +++++++++++++++++++++++++++++++++ */ .panel .contact-form,.panel .contact-miscinfo { padding: 10px } .contact .panel .contact-form form,.contact .panel .contact-address { margin: 20px 0 0 0 } textarea,.contact-form input[type="text"],.contact-form input[type="email"],.contact-form textarea { width: 80%; border: solid 1px; -moz-box-sizing: border-box; border: 1px solid #DDDDDD; color: #333333; overflow: auto; padding: 5px; vertical-align: top; } #jform_contact_email_copy-lbl,#jform_contact_email_copy { float: left; margin-right: 10px; border: 0 } .contact-form .button { clear: left; float: left; margin: 20px 0 } fieldset.filters { background: none; border: none; padding: 0 } .contact-form,.contact-links,.contact-misc,.contact-image,.contact-contactinfo,.contact-address { margin: 20px 0 } /* ++++++++++++++ loginmodule +++++++++++++++++++++++++++ */ #form-login-remember { overflow: hidden; margin-bottom: 10px } #form-login-remember label { display: inline; margin-left: 10px } #modlgn-remember { float: left } #login-form fieldset { background: #f5f5f5 } form ul { list-style-type: none; margin: 0; padding: 0 } /* +++++++++++++++++++++++ pagenav +++++++++++++++++++++++ */ .pagenav { text-align: right } .pagenav ul { display: inline-block; *display: inline; /* IE7 inline-block hack */ list-style-type: none; margin-left: 0; margin-bottom: 0; } .pagenav li { display: inline; margin: 0px; padding: 0 } .pagenav a,span.pagenav { padding: 0 14px; margin: 0; line-height: 1.9em; text-decoration: none; border: 1px solid #ddd; border-left: 0px solid #ddd; display: inline-block; line-height: 1.9em; } .pagenav li:first-child a,.pagination-start span { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; border-left: solid 1px #ddd } .pagenav li:last-child a,.pagination-end span { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .pagination ul { margin: 10px 10px 10px 0; padding: 0 } .pagination li { display: inline; } .pagination a { padding: 0 14px; line-height: 2em; text-decoration: none; border: 1px solid #ddd; border-left: 0px solid #ddd; display: inline-block } .pagination .active a { cursor: default; } .pagination span,.pagination span a:hover { cursor: default; padding: 0 14px; line-height: 2em; } .pagination li:first-child a { border-left-width: 1px; -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .pagination li:last-child a { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } /* +++++++++++++++++ Breadcrumbs +++++++++++++++++++++++++++ */ .breadcrumbs,.article-info { padding: 7px; margin: 0 0 18px; list-style: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .breadcrumbs li { display: inline-block; } /* +++++++++++++++++ articleinfo /actions +++++++++++++++++++++++++++ */ ul.actions { list-style-type: none; text-align: right } ul.actions a {padding:0} ul.actions li { display: inline } .article-info-term { display: none } .article-info { overflow: hidden; font-size: 0.9em } .article-info dd { float: left; padding: 0 5px; border-right: solid 1px #ccc } .article-info dd span { text-transform: none; display: inline-block; padding: 0 5px 0 0px; margin: 0 10px 0 0px; } .article-info dd.create { clear: left } /* ###################### header ###################### */ #fontsize { padding: 0; margin: 0 20px 0 1px; text-align: right; margin-bottom: 0px; float: none; } #fontsize h3 { padding-right: 0; font-weight: normal; display: inline; font-size: 1em; margin: 0 } #fontsize p { margin: 0 0 0 2px; padding: 0; display: inline; font-size: 1em; } #fontsize p a { margin: 0 2px; display: inline; padding: 0px 5px; } /* +++++++++++++++ menus ++++++++++++++++++++++++ */ #header ul.menu { padding: 0; width: auto; text-align: left; display: block; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; margin: 0 10px } #header ul.menu li { display: inline; padding: 0; margin: 0; } #header ul.menu li a:link,#header ul.menu li a:visited,#header ul.menu li:last-child a { font-weight: bold; text-decoration: none; padding: 0px 10px; margin: 0; display: inline-block; margin: 0 0 0; padding: 12px 15px; position: relative; border-right: 1px solid #ddd; box-shadow: 1px 0px 0px #f5f5f5; } #header ul.menu li:first-child a { border-radius: 4px 0 0 0; margin-left: -1px } .moduletable_menu { border: solid 1px #ddd; background: #f9f9f9; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; padding: 20px; margin-bottom: 20px } ul.menu { margin: 0 0 20px 0; padding: 0; } ul.menu,ul.menu ul { list-style-type: none; } ul.menu a { display: block; margin: 0; text-decoration: none; padding: 5px 0px; border-bottom: solid 1px #ddd; } ul.menu li:last-child a { border: 0; box-shadow: none } ul.menu ul { margin: 0; padding: 0 } ul.menu ul a { padding-left: 20px } ul.menu ul ul a { padding-left: 30px } ul.menu ul ul ul a { padding-left: 40px } ul.menu ul ul ul ul a { padding-left: 45px } /* ++++++++++++++ content-module ++++++++++++++ */ .category-module { margin: 0; padding: 0 } .category-module li { padding: 5px 0 5px 0; margin: 0; list-style-type: none } .category-module li h4 { margin-bottom: 0 } .category-module span { display: block; font-size: 0.85em; } .category-module a span { display: inline } /* content */ .categories-list .item-title a { text-decoration: none; margin-bottom: 20px } .category-desc { margin: 20px 0 } .category-desc img { float: left; margin: 0 20px 10px 0 } .categories-list dt,.categories-list dd { display: inline } /* ++++++++++++++++++++++ Footer +++++++++++++++++++++++++ */ #footer-outer {font-size:0.8em} .box { text-align: left } .box ul { list-style-type: none } #bottom .newsfeed-item { padding: 0; margin-bottom: 10px } .box .moduletable_menu,.box .moduletable { margin: 10px } .box3 { padding-left: 10px } .box h3 { font-size: 1.3em } #footer { font-size: 0.8em } /* #################### Sliding modules ################## */ .moduletable_js,.moduletable { margin-bottom: 20px; } .js_heading,.js_heading { position: relative; display: block; padding: 5px 10px; margin: 0px; font-size: 1.40em; border-radius: 3px } h3.js_heading a { display: block; position: absolute; right: 0px; top: 0px; padding: 5px 5px 0 0; text-decoration: none; background: none } .module_content { padding: 10px; border: solid 1px #ddd; border-top: 0; border-radius: 0 0 3px 3px; margin-top: -1px } .no { font-size: 1px; } .slide { height: auto !important; } /* +++++++++++++++++++++++++++++ Module Tabs / Pagebreak Tabs / Contact Tabs ++++++++++++++++ */ ul.tabs { margin: 0; padding: 0; overflow: hidden } dl.tabs dt,dl.tabs dd { margin: 0; padding: 7px 5px; } dl.tabs dt h3 { font-size: 1em; margin: 0; padding: 0 } dl.tabs dt { position: relative; z-index: 1 } ul.tabs li,dl.tabs dt { list-style-type: none; float: left; width: auto; padding: 0; display: block; margin: 0 3px 0 0; font-size: 1em; } ul.tabs li a:link,ul.tabs li a:visited,dl.tabs dt h3 a:link,dl.tabs dt h3 a:visited { text-decoration: none; padding: 7px 5px; margin: 0px; display: block; font-size: 0.9em; font-weight: normal; border-radius: 5px 5px 0px 0px; } ul.tabs li a.linkopen:link,ul.tabs li a.linkopen:visited,dl.tabs dt.open h3 a:link,dl.tabs dt.open h3 a:visited { font-weight: bold; } .tabcontent,div.current { padding: 30px 20px; margin: -1px 0 0 0; border-radius: 0 3px 3px 3px; clear: left; } div.current { position: relative; z-index: 0; top: -1px } .tabcontent:focus { outline: none } .tabopen { display: block; margin-bottom: 20px; overflow: hidden } .tabclosed { display: none } .tabcontent ul { padding: 0 } .tabcontent ul li { list-style-type: none } /* ++++++++++++++ image float style ++++++++++++++ */ .img-fulltext-left { float:left; margin-right: 20px; margin-bottom: 20px; } .img-intro-left { float: left; margin-right: 10px; margin-bottom: 10px; } .img-fulltext-right { float: right; margin-left: 20px; margin-bottom: 20px; } .img-intro-right { float: right; margin-left: 10px; margin-bottom: 10px; } .img-fulltext-none {display:block; margin:10px 0 } /* Correction for user profile date of birth calendar image */ #jform_profile_dob_img { background: url("../images/system/calendar.png") no-repeat scroll 0 0 transparent; cursor: pointer; height: 18px; margin: 0 3px; vertical-align: middle; width: 18px; } PK���\��YY templates/beez3/css/template.cssnu�[���/** * @author Design & Accessible Team ( Angie Radtke ) * @package Joomla * @subpackage Accessible-Template-Beez * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant to the * GNU General Public License, and as distributed it includes or is derivative * of works licensed under the GNU General Public License or other free or open * source software licenses. See COPYRIGHT.php for copyright notices and * details. */ body { background: #fff; color: #000000; font-size: 100.1%; padding: 0px; text-align: center; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body.contentpane { width:auto; margin:10px; text-align: left; } img { border: 0 none; } PK���\8Q��S#S#templates/beez3/css/turq.cssnu�[���body { background: #eeeeee; } h3 { color: #555; } h2 a { text-decoration: none; } h2, .moduletable h3, .items-leading h2 { border-bottom: solid 1px #ddd; } .items-row h2 { border-top: solid 1px #ddd; border-bottom: solid 1px #ddd; } a:link, a:visited { color: #009999; } a:hover, a:active, a:focus { background: #009999; color: #FFF; } .logoheader { background: #009999; color: #FFFFFF; min-height: 200px; } #all { background: #fff; color: #555; } #shadow #all { box-shadow: 0px 20px 10px #555555; } #header ul.menu { background-color: #ddd; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#eee,endColorstr=#ddd); background-image: -khtml-gradient(linear,left top,left bottom,from(#eee),to(#ddd)); background-image: -moz-linear-gradient(top,#eee,#ddd); background-image: -ms-linear-gradient(top,#eee,#ddd); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#eee),color-stop(100%,#ddd)); background-image: -webkit-linear-gradient(top,#eee,#ddd); background-image: -o-linear-gradient(top,#eee,#ddd); background-image: linear-gradient(#eee,#ddd); border-color: #b2b2b2 #b2b2b2 #9f9f9f; text-shadow: 0 1px 1px rgba(255,255,255,0.49); -webkit-font-smoothing: antialiased; box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 1px 2px rgba(0,0,0,0.05); border: solid 1px #ddd; border: 1px solid #e5e5e5; text-transform: uppercase; } #header ul.menu a:link, #header ul.menu a:visited { color: #333; display: inline-block; font-weight: bold; text-decoration: none; padding: 0px 10px; margin: 0; display: inline-block; margin: 0 0 0; padding: 12px 15px; position: relative; border-right: 1px solid #ddd; box-shadow: 1px 0px 0px #f5f5f5; } .button, button, p.readmore a, #header input.button, .pagenav a:link, .pagenav a:visited, #advanced-search-toggle, .profile-edit a:link, .profile-edit a:visited, h3.js_heading, .article-info { background-color: #ddd; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#dddddd); background-image: -khtml-gradient(linear,left top,left bottom,from(#ffffff),to(#dddddd)); background-image: -moz-linear-gradient(top,#ffffff,#dddddd); background-image: -ms-linear-gradient(top,#ffffff,#dddddd); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffffff),color-stop(100%,#dddddd)); background-image: -webkit-linear-gradient(top,#ffffff,#dddddd); background-image: -o-linear-gradient(top,#ffffff,#dddddd); background-image: linear-gradient(#ffffff,#dddddd); border-color: #b2b2b2 #b2b2b2 #9f9f9f; text-shadow: 0 1px 1px rgba(255,255,255,0.49); -webkit-font-smoothing: antialiased; box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 1px 2px rgba(0,0,0,0.05); color: #009999; border: solid 1px #ddd; } .article-info { color: #555; } table { border: solid 1px #ddd; } table th a:link, table th a:visited { color: #fff; } tr.odd, tr.cat-list-row1 { background: #f8f8f8; } table tr:hover td { background: #FEFDE2; } .button:hover, .button:active, .button:focus, button:hover, p.readmore a:hover, #header ul.menu a:hover, #header ul.menu a:active, #header ul.menu a:focus, .pagenav a:hover, .pagenav a:active, .pagenav a:focus, #advanced-search-toggle:hover, #advanced-search-toggle:active, #advanced-search-toggle:focus, .profile-edit a:hover, .profile-edit a:active, .profile-edit a:focus, #fontsize a:hover, #fontsize a:active, #fontsize a:focus, #mobile_select h2 a, table th, .logoheader { background-color: #00B9B9; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00B9B9,endColorstr=#009999); background-image: -khtml-gradient(linear,left top,left bottom,from(#00B9B9),to(#009999)); background-image: -moz-linear-gradient(top,#00B9B9,#009999); background-image: -ms-linear-gradient(top,#00B9B9,#009999); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#00B9B9),color-stop(100%,#009999)); background-image: -webkit-linear-gradient(top,#00B9B9,#009999); background-image: -o-linear-gradient(top,#00B9B9,#009999); background-image: linear-gradient(#00B9B9,#009999); border-color: #009999; color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.33); -webkit-font-smoothing: antialiased; } input:focus, textarea:focus { box-shadow: 0 1px 1px #ddd inset, 0 0 8px #00B9B9; outline: 0 none; } .pagination span, .pagination span a:hover { color: #999999; background-color: #f5f5f5; } span.pagenav { background: #009999; color: #fff; } .pagination-start span.pagenav, .pagination-prev span.pagenav, .pagination-end span.pagenav, .pagination-next span.pagenav { background-color: #f5f5f5; color: #444; } ul.menu a:link, ul.menu a:visited { color: #444; } .moduletable_menu { border: solid 1px #ddd; background: #f9f9f9; } #header ul.menu { border: solid 1px #D5D5D5; box-shadow: 0 1px 0 #FFFFFF inset, 0 1px 5px rgba(0,0,0,0.1); } #header ul.menu a { box-shadow: none; border-bottom: 0; } ul.menu a:hover, ul.menu a:active, ul.menu a:focus { background-color: #F5F5F5; background-image: -moz-linear-gradient(center top,#FFFFFF,#E6E6E6); background-repeat: repeat-x; background: url(../images/arrow.png) no-repeat right center; color: #009999; } ul.menu li.active a, ul.menu li.active ul li.active a, ul.menu li.active ul li.active ul li.active a, ul.menu li.active ul li.active ul li.active ul li.active a, ul.menu li.active ul li.active ul li.active ul li.active ul li.active a { font-weight: bold; } ul.menu li.active ul li a, ul.menu li.active ul li.active ul li a, ul.menu li.active ul li.active ul li.active ul li a, ul.menu li.active ul li.active ul li.active ul li.active ul li a { font-weight: normal; } ul.menu a { box-shadow: 0 1px 0 #fff; border-bottom: solid 1px #ddd; text-shadow: 0 1px 0 #fff; } ul.menu ul a { background: #e5e5e5; margin-bottom: 1px; } ul.menu ul ul ul a { background: #f5f5f5 url(../images/arrow.png) no-repeat 24px center; } ul.menu ul ul ul ul a { background: #fff; } .panel h3.pane-toggler a { background: url(../images/slider_plus.png) right top no-repeat; color: #333; } .panel h3.pane-toggler-down a { background: url(../images/slider_minus.png) right top no-repeat; border-bottom: solid 1px #ddd; color: #333; } ul.tabs li, dl.tabs dt h3 a:link, dl.tabs dt h3 a:visited { background: #f5f5f5 url(../images/nature/box.png) repeat-x; } ul.tabs li a:link, ul.tabs li a:visited, dl.tabs dt a { color: #333; border: solid 1px #ddd; border-bottom: 0; } ul.tabs li a:hover, ul.tabs li a:active, ul.tabs li a:focus { color: #000; } .tabcontent, div.current { background: #fff; color: #000; border: solid 1px #ddd; } .tabcontent .linkclosed { color: #000; border-bottom: solid 1px #e5e5e5; } ul.tabs li a.linkopen, dl.tabs dt.open h3 a:link, dl.tabs dt.open h3 a:visited { background: #fff; color: #333; border-radius: 5px 5px 0px 0px; } ul.tabs li a.linkclosed:hover, ul.tabs li a.linkclosed:active, ul.tabs li a.linkclosed:focus, ul.tabs li a.linkopen:hover, ul.tabs li a.linkopen:active, ul.tabs li a.linkopen:focus { background: #555; color: #fff; } #footer-inner, #footer { background: #f5f5f5; box-shadow: 0px 20px 10px #555; } #footer { background: #555; max-width: 1025px; margin: 0 auto; box-shadow: 0px 0px 10px #555555; color: #fff; } #footer a { color: #fff; background: none; } #bottom a { background: none; } .box1 { border-right: solid 1px #ccc; } .box3 { border-left: solid 1px #ccc; } #bottom ul li a { background-image: none; padding-left: 0; } #mobile_select h2 { border: 0; margin: -17px 0 0 0; padding: 0; background: #009999; text-align: right; } #mobile_select h2 a { display: inline-block; font-size: 0.8em; border-radius: 4px 4px 0 0; padding: 6px; font-size: 0.75em; margin-right: 5px; } @media only screen and (max-width: 480px) { img { max-width: 100%; height: auto; border: 0; -ms-interpolation-mode: bicubic; } #fontsize { display: none; } #nav, #wrapper2, #wrapper, .cols-3 .column-1, .cols-3 .column-2, .cols-3 .column-3, #right, .box, #header form { float: none; width: 100%; } #header { padding-top: 3em; } #header form { margin: 0; } .logoheader { background: #009999; min-height: 100px; margin: 0; } .box { border-left: 0 !important; border-bottom: solid 1px #ddd; } #line { text-align: center; top: 0; right: auto; max-width: 100%; min-width: 100%; margin: 0 0px; background: #00B9B9; } #header form input { float: none; margin-bottom: 4px; } #menuwrapper { margin-top: 10px; } #header ul.menu { position: relative; top: 0; left: 20px; right: 20px; margin: 0; width: 90%; border-radius: 4px; } #header ul.menu li:first-child a { border-radius: 4px 4px 0 0; } #header ul.menu li:last-child a { border-radius: 0 0 4px 4px; } #header ul.menu li a:link, #header ul.menu li a:visited { display: block; padding: 6px 10px; border-bottom: solid 1px #ccc; } } PK���\�O�f-f- templates/beez3/css/personal.cssnu�[���body { background: #eee } h3 { color: #555 } h2 a { text-decoration: none } h2,.moduletable h3, .items-leading h2 { border-bottom: solid 1px #ddd; } .items-row h2 { border-top: solid 1px #ddd; border-bottom: solid 1px #ddd; } a:link,a:visited { color: #095197 } a:hover,a:active,a:focus { background: #095197; color: #FFF; } .logoheader { background: url(../images/personal/personal2.png) no-repeat right bottom #0C1A3E; color: #FFFFFF; min-height: 250px; } #all { background: #FFFFFF; color: #444; } #shadow #all { box-shadow: 0px 20px 10px #555555 } #header ul.menu { background-color:#ddd; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#eeeeee", endColorstr="#dddddd"); background-image: -khtml-gradient(linear, left top, left bottom, from(#eeeeee), to(#dddddd)); background-image: -moz-linear-gradient(top, #eeeeee, #dddddd); background-image: -ms-linear-gradient(top, #eeeeee, #dddddd); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100%, #dddddd)); background-image: -webkit-linear-gradient(top, #eeeeee, #dddddd); background-image: -o-linear-gradient(top, #eeeeee, #dddddd); background-image: linear-gradient(#eeeeee, #dddddd); border-color: #b2b2b2 #b2b2b2 hsl(114, 0%, 62.5%); text-shadow: 0 1px 1px rgba(255, 255, 255, 0.49); -webkit-font-smoothing: antialiased; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); color: #095197; border: solid 1px #ddd; border: 1px solid #e5e5e5; text-transform: uppercase; } #header ul.menu a:link,#header ul.menu a:visited { color: #333; display: inline-block; font-weight: bold; text-decoration: none; padding: 0px 10px; margin: 0; display: inline-block; margin: 0 0 0; padding: 12px 15px; position: relative; border-right: 1px solid #ddd; box-shadow: 1px 0px 0px #f5f5f5; } /* grey background */ .button,button,p.readmore a,#header input.button,.pagenav a:link,.pagenav a:visited,#advanced-search-toggle,.profile-edit a:link,.profile-edit a:visited,h3.js_heading { background-color:#ddd; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff", endColorstr="#dddddd"); background-image: -khtml-gradient(linear, left top, left bottom, from(#ffffff), to(#dddddd)); background-image: -moz-linear-gradient(top, #ffffff, #dddddd); background-image: -ms-linear-gradient(top, #ffffff, #dddddd); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #dddddd)); background-image: -webkit-linear-gradient(top, #ffffff, #dddddd); background-image: -o-linear-gradient(top, #ffffff, #dddddd); background-image: linear-gradient(#ffffff, #dddddd); border-color: #b2b2b2 #b2b2b2 hsl(114, 0%, 62.5%); text-shadow: 0 1px 1px rgba(255, 255, 255, 0.49); -webkit-font-smoothing: antialiased; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); color: #095197; border: solid 1px #ddd } /* +++++++++++++ table display Catgegories table, contact etc, ++++++++++++++++++++* */ table { border: solid 1px #ddd } table th { background-color: #0074cc; color: #fff; background-image: -moz-linear-gradient(top, #095197, #1B6BA5); background-image: -ms-linear-gradient(top, #095197, #1B6BA5); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#095197), to(#1B6BA5) ); background-image: -webkit-linear-gradient(top, #095197, #1B6BA5); background-image: -o-linear-gradient(top, #095197, #1B6BA5); background-image: linear-gradient(top, #095197, #1B6BA5); background-repeat: repeat-x; filter: progid : DXImageTransform.Microsoft.gradient ( startColorstr = '#095197', endColorstr = '#1B6BA5', GradientType = 0 ); border-color: #0055cc #0055cc #003580; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid : dximagetransform.microsoft.gradient ( enabled = false ); } table th a:link,table th a:visited { color: #fff } tr.odd,tr.cat-list-row1 { background: #f8f8f8 } table tr:hover td { background: #FEFDE2; } /* blue background */ .button:hover, .button:active, .button:focus, button:hover, p.readmore a:hover, #header ul.menu a:hover, #header ul.menu a:active, #header ul.menu a:focus, .pagenav a:hover, .pagenav a:active, .pagenav a:focus, #advanced-search-toggle:hover, #advanced-search-toggle:active, #advanced-search-toggle:focus, .profile-edit a:hover, .profile-edit a:active, .profile-edit a:focus, #fontsize a:hover,#fontsize a:active,#fontsize a:focus, #mobile_select h2 a { background-color: #000000; color: #fff; background-color:#095197; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#0087d1", endColorstr="#095197"); background-image: -khtml-gradient(linear, left top, left bottom, from(#0087d1), to(#095197)); background-image: -moz-linear-gradient(top, #0087d1, #095197); background-image: -ms-linear-gradient(top, #0087d1, #095197); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #0087d1), color-stop(100%, #095197)); background-image: -webkit-linear-gradient(top, #0087d1, #095197); background-image: -o-linear-gradient(top, #0087d1, #095197); background-image: linear-gradient(#0087d1, #095197); border-color: #00456b #095197 hsl(201, 100%, 16%); color: #fff ; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.33); -webkit-font-smoothing: antialiased; } /* +++++++++++++++++ Pagination +++++++++++++++ */ .pagination span,.pagination span a:hover { color: #999999; background-color: #f5f5f5; } /* active item */ span.pagenav { background: #095197; color: #fff } .pagination-start span.pagenav,.pagination-prev span.pagenav,.pagination-end span.pagenav,.pagination-next span.pagenav { background-color: #f5f5f5; color: #444 } /* +++++++++++++++++ content +++++++++++++++ */ .article-info { background-color: #fbfbfb; background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5) ); background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); background-image: linear-gradient(top, #ffffff, #f5f5f5); background-repeat: repeat-x; filter: progid : DXImageTransform.Microsoft.gradient ( startColorstr = '#ffffff', endColorstr = '#f5f5f5', GradientType = 0 ); border: 1px solid #ddd; -webkit-box-shadow: inset 0 1px 0 #ffffff; -moz-box-shadow: inset 0 1px 0 #ffffff; box-shadow: inset 0 1px 0 #ffffff; } ul.menu a:link,ul.menu a:visited { color: #444; } /* ++++++++++++++++++++++ menu ++++++++++++++++++++++++++ */ .moduletable_menu { border: solid 1px #ddd; background: #f9f9f9; } #header ul.menu { border: solid 1px #D5D5D5; box-shadow: 0 1px 0 #FFFFFF inset, 0 1px 5px rgba(0, 0, 0, 0.1); } #header ul.menu a { box-shadow: none; border-bottom: 0 } ul.menu a:hover,ul.menu a:active,ul.menu a:focus { background-color: #F5F5F5; background-image: -moz-linear-gradient(center top, #FFFFFF, #E6E6E6); background-repeat: repeat-x; background: url(../images/arrow.png) no-repeat right center; color: #095197 } /* ++++++++++++++++ highlightning active menuitem +++++++++++++++++++ */ ul.menu li.active a,ul.menu li.active ul li.active a,ul.menu li.active ul li.active ul li.active a,ul.menu li.active ul li.active ul li.active ul li.active a,ul.menu li.active ul li.active ul li.active ul li.active ul li.active a { font-weight: bold; } ul.menu li.active ul li a,ul.menu li.active ul li.active ul li a,ul.menu li.active ul li.active ul li.active ul li a,ul.menu li.active ul li.active ul li.active ul li.active ul li a { font-weight: normal } ul.menu a { box-shadow: 0 1px 0 #fff; border-bottom: solid 1px #ddd; text-shadow: 0 1px 0 #fff } ul.menu ul a { background: #e5e5e5; margin-bottom: 1px } ul.menu ul ul ul a { background: #f5f5f5 url(../images/arrow.png) no-repeat 24px center; } ul.menu ul ul ul ul a { background: #fff; } /* +++++++++++++++++++++++ SLIDER ++++++++++++++++++++ */ .panel h3.pane-toggler a { background: url(../images/slider_plus.png) right top no-repeat; color: #333 } .panel h3.pane-toggler-down a { background: url(../images/slider_minus.png) right top no-repeat; border-bottom: solid 1px #ddd; color: #333 } /* +++++++++++++++++ Tabs ++++++++++++++++++++++ */ ul.tabs li,dl.tabs dt h3 a:link,dl.tabs dt h3 a:visited { background: #f5f5f5 url(../images/nature/box.png) repeat-x; } ul.tabs li a:link,ul.tabs li a:visited,dl.tabs dt a { color: #333; border: solid 1px #ddd; border-bottom: 0 } ul.tabs li a:hover,ul.tabs li a:active,ul.tabs li a:focus { color: #000 } .tabcontent,div.current { background: #fff; color: #000; border: solid 1px #ddd; } .tabcontent .linkclosed { color: #000; border-bottom: solid 1px #e5e5e5; } ul.tabs li a.linkopen,dl.tabs dt.open h3 a:link,dl.tabs dt.open h3 a:visited { background: #fff; color: #333; border-radius: 5px 5px 0px 0px; } ul.tabs li a.linkclosed:hover,ul.tabs li a.linkclosed:active,ul.tabs li a.linkclosed:focus,ul.tabs li a.linkopen:hover,ul.tabs li a.linkopen:active,ul.tabs li a.linkopen:focus { background: #555; color: #fff } #footer-inner,#footer { background: #f5f5f5; box-shadow: 0px 20px 10px #555 } #footer { background: #555; max-width: 1025px; margin: 0 auto; box-shadow: 0px 0px 10px #555555; color: #fff } #footer a { color: #fff; background: none } #bottom a { background: none } .box1 { border-right: solid 1px #ccc } .box3 { border-left: solid 1px #ccc } #bottom ul li a { background-image: none; padding-left: 0 } /* responsive */ #mobile_select h2 {border:0; margin:-17px 0 0 0; padding:0; background:#0C1D43;text-align:right} #mobile_select h2 a { display:inline-block; font-size:0.8em; border-radius:4px 4px 0 0; padding:6px; font-size:0.75em; margin-right:5px; } @media only screen and (max-width: 480px) { img { max-width: 100%; height: auto; border: 0; -ms-interpolation-mode: bicubic; } #fontsize{display:none} #nav,#wrapper2,#wrapper,.cols-3 .column-1,.cols-3 .column-2,.cols-3 .column-3,#right,.box,#header form { float: none; width: 100% } #header {padding-top:3em} #header form {margin:0} .logoheader {background:#0C1D43; min-height:100px; margin:0} .box { border-left: 0 !important; border-bottom: solid 1px #ddd; } #line { text-align: center; top: 0; right: auto; max-width: 100% ; min-width:100%; margin: 0 0px; background:#095197; } #header form input { float: none; margin-bottom:4px } #menuwrapper { margin-top:10px; } #header ul.menu {position:relative; top:0;left:20px; right:20px; margin:0; width:90%; border-radius:4px} #header ul.menu li:first-child a {border-radius: 4px 4px 0 0} #header ul.menu li:last-child a {border-radius:0 0 4px 4px } #header ul.menu li a:link, #header ul.menu li a:visited { display: block; padding: 6px 10px; border-bottom: solid 1px #ccc } } @media only screen and (min-width: 600px) { } @media only screen and (min-width: 768px) { } @media only screen and (min-width: 992px) { } @media only screen and (min-width: 1382px) { /* Styles */ } @media only screen and (-webkit-min-device-pixel-ratio: 1.5) , only screen and (min--moz-device-pixel-ratio: 1.5) , only screen and (min-device-pixel-ratio: 1.5) { /* Styles */ } PK���\ �r!r!$templates/beez3/css/template_rtl.cssnu�[���/** * @author Design & Accessible Team ( Angie Radtke ) * @package Joomla * @subpackage Accessible-Template-Beez * @copyright Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant to the * GNU General Public License, and as distributed it includes or is derivative * of works licensed under the GNU General Public License or other free or open * source software licenses. See COPYRIGHT.php for copyright notices and * details. */ #all { text-align: right; } #wrapper { float:right; } #logo span { padding-right:15px;} h1#logo{ font-family: 'Titillium Maps', Arial; padding:0.9em 20px 20px 10px; /*text-transform:uppercase;*/ text-align:right; } #logo { margin-top:0.6em; margin-left:10px; /* position:absolute;*/ display:block; padding:20px 20px 20px 10px; width:425px; padding-top:0.6em; font-weight:normal; line-height:1em; font-size:3em; } .logoheader { text-align:right; } /* ########################## header ########################### */ #header { font-size:1em; position:relative } #header ul.menu { text-align: right; } /* ++++++++++++++ search box+font options ++++++++++++++ */ #line { left: 20px; margin-right: -10px; right: auto; text-align: left; } /* ++++++++++++++ breadcrumbs ++++++++++++++ */ #breadcrumbs { /*display: block;*/ background: none; float: right; text-align: right; width: 100%; } #breadcrumbs * { text-align:right; float: right; } /* for IE7 and less */ *:first-child+html .breadcrumbs, * html .breadcrumbs { width: 100%; } #breadcrumbs { margin:15px 5px 15px 0px; } #breadcrumbs img { padding: 4px 5px 0px 5px; } #breadcrumbs .showHere { margin-left: 4px; } ul.menu li a:link,ul.menu li a:visited { background: url(../images/nature/karo.gif) no-repeat scroll right 14px; padding-right: 10px; } ul.menu li { text-align: right; } ul.menu li.active ul li a:link, ul.menu li.active ul li a:visited { padding-right: 20px; } ul.menu li.active ul li.active a:link, ul.menu li.active ul li.active a:visited { padding-right: 20px; } ul.menu li.active ul li.active ul li a:link, ul.menu li.active ul li.active ul li a:visited { padding-right: 33px; } ul.menu li.active ul li.active ul li.active ul li a:link, ul.menu li.active ul li.active ul li.active ul li a:visited { padding: 3px 47px 3px 2px; background:#fff url(../images/nature/arrow_small_rtl.png) no-repeat scroll right 8px; } ul.menu li.active ul li.active ul li.active ul li.active ul li a:link, ul.menu li.active ul li.active ul li.active ul li.active ul li a:visited { padding-right:30px; } h3 { text-align: right } h3.js_heading a { position: absolute; right: auto; left: 5px } .box { text-align: right } ul.newsfeed { text-align: right } a.readmore:link,a.readmore:visited,.readmore a:link,.readmore a:visited { background: url(../images/nature/arrow1_rtl.gif) repeat-x scroll right top; padding-right: 10px !important } .readmore a:hover, .readmore a:active, .readmore a:focus, a.readmore a:hover, a.readmore a:active, a.readmore a:focus { background: url(../images/nature/arrow2_rtl.gif) no-repeat right 6px #555 !important; } .mailto-close { left: 5px !important; right: auto !important; } * html .mailto-close { left: 0; position: absolute; right: 340px !important } /* personal.css overrides */ .panel h3.pane-toggler a { background:#f5f5f5 url(../images/slider_plus_rtl.png) left top no-repeat; } .panel h3.pane-toggler-down a { background:#f5f5f5 url(../images/slider_minus_rtl.png) left top no-repeat; border-bottom:solid 1px #ddd; } .form-required { background-position: right; } input.button, button.button { background:#FFFFFF url(../images/nature/arrow1_rtl.gif) no-repeat right top; } /* layout.css overrides */ #main ul { padding:0 15px 0 0; margin:10px 0 10px 0px; } #main ol { padding:0 20px 0 0; margin:10px 0 10px 0px; } .contact-email label { width:17em; float:right; } #contact-email-copy { float:right; margin-left:10px; } table.weblinks th, table.category th { text-align: right; } table th, table td { text-align: right; } dl.tabs { float: right; margin: 50px 0 0 0; z-index: 50; clear:both; } dl.tabs dt { float: right; padding: 4px 10px; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 1px solid #ccc; margin-left: 3px; margin-right: 0px; } form fieldset dt { clear:right ; float:right; width:12em; padding:3px 0 } form fieldset dd { float:right; padding:3px 0 } #users-profile-core dt, #users-profile-custom dt { float:right; width:12em; padding:3px 0; } .profile-edit form#member-profile fieldset dt, .registration form#member-registration fieldset dt {padding:5px 0px 5px 5px; width:13em} .login-fields label {float:right} /* ++++++++++++++ pagination ++++++++++++++ */ #main .pagination { float:right; text-align:right; padding:10px 10px 0px 0px; width: 100%; clear:both; } #main .pagination ul { float:right; text-align:right; } #main .pagination li { float:right; text-align:right; } #main .pagination li.pagination-start span, #main .pagination li.pagination-start a { padding:4px 0; } .left1 { float: right; margin: 10px 10px 3% 10px ; } /* ++++++++++++++ login ++++++++++++++ */ #login-form label { margin-right:0px; } #form-login-remember label { float:none; width:auto; display:inline } input.button, button.button, button.validate { padding:3px 7px 5px 7px; } #modlgn-username, #modlgn-passwd { margin-right: 0; } .module_content #form-login-username label, .module_content #form-login-password label { float:right; } .login-fields { margin:10px 0 } .login-fields label { float:right; } .login-description img, .logout-description img { float:right; margin-right:0px } .login-description, .logout-description { padding-right:5px; margin:20px 10px 0 0; } /* ++++++++++++++ columns alignment left to right ++++++++++++++ */ ul.tabs li { float: right; border-left: 1px solid #DDDDDD; border-right: 0px solid #DDDDDD; } ul.pagenav li.pagenav-next { float: left; } ul.pagenav li.pagenav-prev { float: right; } #close span { width: auto; left: 20px; right: auto; } #header ul.menu li a:link, #header ul.menu li a:visited { border-right:solid 0px #237D85; border-left:solid 1px #237D85; } #header ul li.active a:link, #header ul li.active a:visited { border-right:solid 0px #237D85; border-left:solid 1px #237D85; } #fontsize { margin: 0 1px 0 20px; text-align: right; } #fontsize p a:link, #fontsize p a:visited { border-left: 1px solid #CCCCCC; border-right: none; } #header form .inputbox { margin: 2px 2px 2px 13px; } #header form .inputbox:focus { margin: 1px 1px 0 11px; } #header ul.menu li { float: right; } /* ############## Blog/featured columns ######## */ .blog-featured .item, .blog .item { float:right; } .items-row .column-1 { margin-right: 0; margin-left: 4%; } #main ul.actions { text-align: left; } .content_rating { text-align: right; } ul.menu li ul li ul li ul li ul { padding-right: 7px; } #system-message dd.notice ul, #system-message dd.error ul, #system-message dd.message ul { background-position: 100% 0!important; padding: 10px 40px 10px 10px!important; } #system-message dd.message ul { background-image:url(../images/system/notice-info_rtl.png)!important; } #system-message dd.notice ul { background-image:url("../images/system/notice-note_rtl.png")!important; } #system-message dd.error ul { background-image:url(../images/system/notice-alert_rtl.png)!important; } /* ++++++++++++++ image float style ++++++++++++++ */ .img-fulltext-left { float: right; margin-left: 20px; margin-bottom: 20px; } .img-intro-left { float: right; margin-left: 10px; margin-bottom: 10px; } .img-fulltext-right { float:left; margin-right: 20px; margin-bottom: 20px; } .img-intro-right { float: left; margin-right: 10px; margin-bottom: 10px; } /* ++++++ Bootstrap markup ++++++++++++++ */ .pull-left { float: right; } /* ++++++ tooltip +++++++ */ .tooltip.right { margin-left: -3px; } .tooltip.left { margin-left: 3px; } .tooltip-inner { text-align: right; } .tooltip.top .tooltip-arrow { bottom: 0; right: 50%; margin-right: -5px; } .tooltip.right .tooltip-arrow { left: 0; border-width: 5px 0 5px 5px; } .tooltip.left .tooltip-arrow { right: 0; border-width: 5px 5px 5px 0; } .tooltip.bottom .tooltip-arrow { right: 50%; margin-right: -5px; } PK���\"�oI--templates/beez3/css/turq.lessnu�[���@basecolor : rgb(45,53,62); @compcolor : spin(@basecolor, 180); @bordercolor : lighten(@basecolor, 60%); @bodycolor : #eeeeee; @contentbackground:#fff; @textcolor : #555; @linkcolor : #009999; @linkcolorhover : darken(@linkcolor, 10); @linkcolorvisited : darken(@linkcolorhover, 10); @linkcolorfocus : darken(@linkcolorvisited, 10); @backgroundlogoheader: #009999; @headermenugradientfrom:#eee; @headermenugradientto:#ddd; @uxelmentsgradientfrom: #ffffff; @uxelmentsgradientto: #dddddd; @uxelmentshovergradientfrom: #00B9B9; @uxelmentshovergradientto: #009999; body { background: @bodycolor } h3 { color: @textcolor } h2 a { text-decoration: none } h2,.moduletable h3, .items-leading h2 { border-bottom: solid 1px #ddd; } .items-row h2 { border-top: solid 1px #ddd; border-bottom: solid 1px #ddd; } a:link,a:visited { color: @linkcolor } a:hover,a:active,a:focus { background:@linkcolor ; color: #FFF; } .logoheader { background: @backgroundlogoheader; color: #FFFFFF; min-height: 200px; } #all { background: @contentbackground; color: @textcolor ; } #shadow #all { box-shadow: 0px 20px 10px #555555 } #header ul.menu { background-color:#ddd; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=@headermenugradientfrom, endColorstr=@headermenugradientto); background-image: -khtml-gradient(linear, left top, left bottom, from(@headermenugradientfrom), to(@headermenugradientto)); background-image: -moz-linear-gradient(top, @headermenugradientfrom, @headermenugradientto); background-image: -ms-linear-gradient(top, @headermenugradientfrom, @headermenugradientto); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @headermenugradientfrom), color-stop(100%, @headermenugradientto)); background-image: -webkit-linear-gradient(top, @headermenugradientfrom, @headermenugradientto); background-image: -o-linear-gradient(top, @headermenugradientfrom, @headermenugradientto); background-image: linear-gradient(@headermenugradientfrom, @headermenugradientto); border-color: #b2b2b2 #b2b2b2 hsl(114, 0%, 62.5%); text-shadow: 0 1px 1px rgba(255, 255, 255, 0.49); -webkit-font-smoothing: antialiased; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); border: solid 1px #ddd; border: 1px solid #e5e5e5; text-transform: uppercase; } #header ul.menu a:link,#header ul.menu a:visited { color: #333; display: inline-block; font-weight: bold; text-decoration: none; padding: 0px 10px; margin: 0; display: inline-block; margin: 0 0 0; padding: 12px 15px; position: relative; border-right: 1px solid #ddd; box-shadow: 1px 0px 0px #f5f5f5; } /* grey background */ .button,button,p.readmore a,#header input.button,.pagenav a:link,.pagenav a:visited,#advanced-search-toggle,.profile-edit a:link,.profile-edit a:visited,h3.js_heading,.article-info { background-color:#ddd; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=@uxelmentsgradientfrom, endColorstr=@uxelmentsgradientto); background-image: -khtml-gradient(linear, left top, left bottom, from(@uxelmentsgradientfrom), to(@uxelmentsgradientto)); background-image: -moz-linear-gradient(top, @uxelmentsgradientfrom, @uxelmentsgradientto); background-image: -ms-linear-gradient(top, #ffffff, #dddddd); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @uxelmentsgradientfrom), color-stop(100%, @uxelmentsgradientto)); background-image: -webkit-linear-gradient(top, @uxelmentsgradientfrom, @uxelmentsgradientto); background-image: -o-linear-gradient(top, @uxelmentsgradientfrom, @uxelmentsgradientto); background-image: linear-gradient(@uxelmentsgradientfrom, @uxelmentsgradientto); border-color: #b2b2b2 #b2b2b2 hsl(114, 0%, 62.5%); text-shadow: 0 1px 1px rgba(255, 255, 255, 0.49); -webkit-font-smoothing: antialiased; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); color: @linkcolor; border: solid 1px #ddd } .article-info {color:@textcolor} /* +++++++++++++ table display Catgegories table, contact etc, ++++++++++++++++++++* */ table { border: solid 1px #ddd } table th a:link,table th a:visited { color: #fff } tr.odd,tr.cat-list-row1 { background: #f8f8f8 } table tr:hover td { background: #FEFDE2; } /* blue background */ .button:hover, .button:active, .button:focus, button:hover, p.readmore a:hover, #header ul.menu a:hover, #header ul.menu a:active, #header ul.menu a:focus, .pagenav a:hover, .pagenav a:active, .pagenav a:focus, #advanced-search-toggle:hover, #advanced-search-toggle:active, #advanced-search-toggle:focus, .profile-edit a:hover, .profile-edit a:active, .profile-edit a:focus, #fontsize a:hover,#fontsize a:active,#fontsize a:focus, #mobile_select h2 a,table th,.logoheader { background-color:@uxelmentshovergradientfrom; background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=@uxelmentshovergradientfrom, endColorstr=@uxelmentshovergradientto); background-image: -khtml-gradient(linear, left top, left bottom, from(@uxelmentshovergradientfrom), to(@uxelmentshovergradientto)); background-image: -moz-linear-gradient(top,@uxelmentshovergradientfrom, @uxelmentshovergradientto); background-image: -ms-linear-gradient(top, @uxelmentshovergradientfrom, @uxelmentshovergradientto); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @uxelmentshovergradientfrom), color-stop(100%, @uxelmentshovergradientto)); background-image: -webkit-linear-gradient(top, @uxelmentshovergradientfrom, @uxelmentshovergradientto); background-image: -o-linear-gradient(top, @uxelmentshovergradientfrom, @uxelmentshovergradientto); background-image: linear-gradient(@uxelmentshovergradientfrom, @uxelmentshovergradientto); border-color: @uxelmentshovergradientto; color: #fff ; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.33); -webkit-font-smoothing: antialiased; } input:focus,textarea:focus { box-shadow: 0 1px 1px @headermenugradientto inset, 0 0 8px @uxelmentshovergradientfrom; outline: 0 none; } /* +++++++++++++++++ Pagination +++++++++++++++ */ .pagination span,.pagination span a:hover { color: #999999; background-color: #f5f5f5; } /* active item */ span.pagenav { background: @uxelmentshovergradientto; color: #fff; } .pagination-start span.pagenav,.pagination-prev span.pagenav,.pagination-end span.pagenav,.pagination-next span.pagenav { background-color: #f5f5f5; color: #444; } /* +++++++++++++++++ content +++++++++++++++ */ ul.menu a:link,ul.menu a:visited { color: #444; } /* ++++++++++++++++++++++ menu ++++++++++++++++++++++++++ */ .moduletable_menu { border: solid 1px #ddd; background: #f9f9f9; } #header ul.menu { border: solid 1px #D5D5D5; box-shadow: 0 1px 0 #FFFFFF inset, 0 1px 5px rgba(0, 0, 0, 0.1); } #header ul.menu a { box-shadow: none; border-bottom: 0 } ul.menu a:hover,ul.menu a:active,ul.menu a:focus { background-color: #F5F5F5; background-image: -moz-linear-gradient(center top, #FFFFFF, #E6E6E6); background-repeat: repeat-x; background: url(../images/arrow.png) no-repeat right center; color:@linkcolor } /* ++++++++++++++++ highlightning active menuitem +++++++++++++++++++ */ ul.menu li.active a,ul.menu li.active ul li.active a,ul.menu li.active ul li.active ul li.active a,ul.menu li.active ul li.active ul li.active ul li.active a,ul.menu li.active ul li.active ul li.active ul li.active ul li.active a { font-weight: bold; } ul.menu li.active ul li a,ul.menu li.active ul li.active ul li a,ul.menu li.active ul li.active ul li.active ul li a,ul.menu li.active ul li.active ul li.active ul li.active ul li a { font-weight: normal } ul.menu a { box-shadow: 0 1px 0 #fff; border-bottom: solid 1px #ddd; text-shadow: 0 1px 0 #fff } ul.menu ul a { background: #e5e5e5; margin-bottom: 1px } ul.menu ul ul ul a { background: #f5f5f5 url(../images/arrow.png) no-repeat 24px center; } ul.menu ul ul ul ul a { background: #fff; } /* +++++++++++++++++++++++ SLIDER ++++++++++++++++++++ */ .panel h3.pane-toggler a { background: url(../images/slider_plus.png) right top no-repeat; color: #333 } .panel h3.pane-toggler-down a { background: url(../images/slider_minus.png) right top no-repeat; border-bottom: solid 1px #ddd; color: #333 } /* +++++++++++++++++ Tabs ++++++++++++++++++++++ */ ul.tabs li,dl.tabs dt h3 a:link,dl.tabs dt h3 a:visited { background: #f5f5f5 url(../images/nature/box.png) repeat-x; } ul.tabs li a:link,ul.tabs li a:visited,dl.tabs dt a { color: #333; border: solid 1px #ddd; border-bottom: 0 } ul.tabs li a:hover,ul.tabs li a:active,ul.tabs li a:focus { color: #000 } .tabcontent,div.current { background: #fff; color: #000; border: solid 1px #ddd; } .tabcontent .linkclosed { color: #000; border-bottom: solid 1px #e5e5e5; } ul.tabs li a.linkopen,dl.tabs dt.open h3 a:link,dl.tabs dt.open h3 a:visited { background: #fff; color: #333; border-radius: 5px 5px 0px 0px; } ul.tabs li a.linkclosed:hover,ul.tabs li a.linkclosed:active,ul.tabs li a.linkclosed:focus,ul.tabs li a.linkopen:hover,ul.tabs li a.linkopen:active,ul.tabs li a.linkopen:focus { background: #555; color: #fff } #footer-inner,#footer { background: #f5f5f5; box-shadow: 0px 20px 10px #555 } #footer { background: #555; max-width: 1025px; margin: 0 auto; box-shadow: 0px 0px 10px #555555; color: #fff } #footer a { color: #fff; background: none } #bottom a { background: none } .box1 { border-right: solid 1px #ccc } .box3 { border-left: solid 1px #ccc } #bottom ul li a { background-image: none; padding-left: 0 } /* responsive */ #mobile_select h2 {border:0; margin:-17px 0 0 0; padding:0; background:@uxelmentshovergradientto;text-align:right} #mobile_select h2 a { display:inline-block; font-size:0.8em; border-radius:4px 4px 0 0; padding:6px; font-size:0.75em; margin-right:5px; } @media only screen and (max-width: 480px) { img { max-width: 100%; height: auto; border: 0; -ms-interpolation-mode: bicubic; } #fontsize{display:none} #nav,#wrapper2,#wrapper,.cols-3 .column-1,.cols-3 .column-2,.cols-3 .column-3,#right,.box,#header form { float: none; width: 100% } #header {padding-top:3em} #header form {margin:0} .logoheader {background:@uxelmentshovergradientto; min-height:100px; margin:0} .box { border-left: 0 !important; border-bottom: solid 1px #ddd; } #line { text-align: center; top: 0; right: auto; max-width: 100% ; min-width:100%; margin: 0 0px; background:@uxelmentshovergradientfrom; } #header form input { float: none; margin-bottom:4px } #menuwrapper { margin-top:10px; } #header ul.menu {position:relative; top:0;left:20px; right:20px; margin:0; width:90%; border-radius:4px} #header ul.menu li:first-child a {border-radius: 4px 4px 0 0} #header ul.menu li:last-child a {border-radius:0 0 4px 4px } #header ul.menu li a:link, #header ul.menu li a:visited { display: block; padding: 6px 10px; border-bottom: solid 1px #ccc } } @media only screen and (min-width: 600px) { } @media only screen and (min-width: 768px) { } @media only screen and (min-width: 992px) { } @media only screen and (min-width: 1382px) { /* Styles */ } @media only screen and (-webkit-min-device-pixel-ratio: 1.5) , only screen and (min--moz-device-pixel-ratio: 1.5) , only screen and (min-device-pixel-ratio: 1.5) { /* Styles */ } PK���\���q77templates/beez3/css/print.cssnu�[���/** * @author Design & Accessible Team ( Angie Radtke / Robert Deutz ) * @package Joomla * @subpackage Accessible-Template-Beez * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant to the * GNU General Public License, and as distributed it includes or is derivative * of works licensed under the GNU General Public License or other free or open * source software licenses. See COPYRIGHT.php for copyright notices and * details. */ /* not ready */ h1, #main h1 { font-size: 16pt; font-weight: bold; margin: 0.4em 0 0.5em 0; padding:0; } h2, #main h2 { font-size: 14pt; font-weight: bold; margin: 0.2em 0 0.5em 0; padding: 0.3em 0.3em 0.3em 0; } h3 { font-size: 12pt; font-weight: bold; margin: 0.4em 0 0.2em 0; } /* Vermeidung von Seitenumbr�chen direkt nach einer �berschrift */ h1, h2, h3 { page-break-after: avoid; } body { line-height:150%; font-family:Arial, Verdana, Helvetica, sans-serif; } p, ul li, ol li, address, .category-desc, table, label, dt, dd { font-size:10pt } address { font-style:normal } .contact-address address span { display:block } a { font-weight: bold; } .unseen, #line, #header ul, #breadcrumbs, .article-info-term, ul.actions, #close, .display-limit, .moduletable_menu, .moduletable_js, .tabouter, #bottom, .pagination, #footer, #header-image { display: none; } .skiplinks, #suckerfish { display:none !important } #header .logoheader { border:0; } #header { width: auto; } #all #back #header { padding-top:0 } #all { text-align:left; border:solid 0px #000 } #back { border:solid 0px #000; padding:0 } #right { display: block; } #header h1#logo { font-size:20pt; font-weight:normal } #contentarea2, #contentarea { border: solid 0px #000; padding:0 !important } #main .blog-featured h1 { padding:0 !important; } #main #top { overflow:hidden; margin-bottom:25pt; border:0 } #main .categories-listalphabet ul { padding-left:0 } #main .categories-listalphabet ul li { display:inline; padding:5pt; border-right:solid 1pt #ddd } #wrapper { display:block; width:100% !important; } .item { margin-bottom:30pt } .category-desc { margin:15pt 0 } .items-leading { margin-bottom:30pt } #main .items-leading h2, #main .item h2 { font-size: 14pt; font-weight: bold; } h2 a { text-decoration:none } #main h1 { padding:5pt } #main .readmore a { border:0 !important; padding-left:0 !important } .image-left { float:left; margin:0 15pt 5pt 0; } table { margin:20pt 0; border-collapse:collapse; width:90%; } table td, table th { padding:2pt 5pt; border:solid 1pt #ddd } .items-more h3 { padding: 5pt 0; font-size:14pt } .items-more ol li a { font-weight:normal } #nav a.readmore { font-size:10pt } #nav .module_content { margin-bottom:20pt; border:0 !important; padding:0 !important } #nav .moduletable ul.menu { border:0; list-style-type:none; padding:0 } #nav .moduletable ul.menu, #nav .moduletable ul.menu ul, #nav .moduletable ul.menu ul ul { border:0; list-style-type:none } #nav .moduletable ul.menu ul, #nav .moduletable ul.menu ul ul { padding-left:15pt } #nav .moduletable ul.menu li { border:0 } #nav .moduletable ul.menu li a, #nav .moduletable ul.menu li.active ul li a, #nav .moduletable ul.menu li.active ul li.active ul li a { text-decoration:none; border:solid 0px #000 } ul#archive-items { list-style-type:none; padding-left:0 } .moduletable { margin:20pt 0 } dl.article-info { line-height:120%; font-size:9pt } dl.article-info dd { margin-left:0 } h3.js_heading a img { border:0 } h3.js_heading, #bottom h3, .moduletable h3, #nav h3 { font-size:12pt !important; } .category-list { padding:0 !important; } .moduletable_js { margin-bottom:20pt } .tabouter { border:solid 0px ; overflow:hidden; margin:20pt 0 } ul.tabs { padding:0; } ul.tabs li.tab { list-style-type:none; text-transform:uppercase; display:inline; border-right:solid 1pt #ddd; padding:2pt 10pt } ul.tabs li.tab a { text-decoration:none; } .tabcontent { padding:10pt } .contact-email div { overflow:hidden } .contact-email label { border:solid 0px #000; float:left; width:10em } .login div { overflow:hidden } .login label { float:left; width:10em } form fieldset dt { clear:left; float:left; width:12em; } legend { background:#fff; font-size:.85em } .phrases, .only { margin-bottom:15pt } .newsflash a.readmore:link { border: solid 0pt ; font-weight:normal; font-size:0.8em; text-decoration:none } .stats dt { float:left; width:10em } #footer-outer { border:solid 0px; padding:0; background:none } #bottom { text-align:left } #footer-outer #bottom .box .moduletable { border-bottom:solid 1px #ddd; padding:10pt 0 } #footer-outer #bottom .box1, #footer-outer #bottom .box3 { border:0; } #bottom ul { list-style-type:none; padding:0 !important } #bottom ul li { border:solid 0px #c00 } PK���\�E��"�"templates/beez3/css/red.cssnu�[���/* This beautiful CSS-File has been crafted with LESS (lesscss.org) and compiled by simpLESS (wearekiss.com/simpless) */ body { background: #eee } h3 { color: #555 } h2 a { text-decoration: none } h2, .moduletable h3, .items-leading h2 { border-bottom: solid 1px #ddd } .items-row h2 { border-top: solid 1px #ddd; border-bottom: solid 1px #ddd } a:link, a:visited { color: #c00 } a:hover, a:active, a:focus { background: #c00; color: #FFF } .logoheader { background: #900; color: #FFF; min-height: 200px } #all { background: #fff; color: #555 } #shadow #all { box-shadow: 0 20px 10px #555 } #header ul.menu { background-color: #ddd; background-repeat: repeat-x; filter: progid:dximagetransform.microsoft.gradient(startColorstr=#eeeeee, endColorstr=#dddddd); background-image: -khtml-gradient(linear, left top, left bottom, from(#eee), to(#ddd)); background-image: -moz-linear-gradient(top, #eee, #ddd); background-image: -ms-linear-gradient(top, #eee, #ddd); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eee), color-stop(100%, #ddd)); background-image: -webkit-linear-gradient(top, #eee, #ddd); background-image: -o-linear-gradient(top, #eee, #ddd); background-image: linear-gradient(#eee, #ddd); border-color: #b2b2b2 #b2b2b2 #9f9f9f; text-shadow: 0 1px 1px rgba(255, 255, 255, .49); -webkit-font-smoothing: antialiased; box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 1px 2px rgba(0, 0, 0, .05); border: solid 1px #ddd; border: 1px solid #e5e5e5; text-transform: uppercase } #header ul.menu a:link, #header ul.menu a:visited { color: #333; display: inline-block; font-weight: 700; text-decoration: none; padding: 0 10px; margin: 0; display: inline-block; margin: 0 0 0; padding: 12px 15px; position: relative; border-right: 1px solid #ddd; box-shadow: 1px 0 0 #f5f5f5 } .button, button, p.readmore a, #header input.button, .pagenav a:link, .pagenav a:visited, #advanced-search-toggle, .profile-edit a:link, .profile-edit a:visited, h3.js_heading, .article-info { background-color: #ddd; background-repeat: repeat-x; filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffffff, endColorstr=#dddddd); background-image: -khtml-gradient(linear, left top, left bottom, from(#fff), to(#ddd)); background-image: -moz-linear-gradient(top, #fff, #ddd); background-image: -ms-linear-gradient(top, #fff, #ddd); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #ddd)); background-image: -webkit-linear-gradient(top, #fff, #ddd); background-image: -o-linear-gradient(top, #fff, #ddd); background-image: linear-gradient(#fff, #ddd); border-color: #b2b2b2 #b2b2b2 #9f9f9f; text-shadow: 0 1px 1px rgba(255, 255, 255, .49); -webkit-font-smoothing: antialiased; box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 1px 2px rgba(0, 0, 0, .05); color: #c00; border: solid 1px #ddd } .article-info { color: #555 } table { border: solid 1px #ddd } table th a:link, table th a:visited { color: #fff } tr.odd, tr.cat-list-row1 { background: #f8f8f8 } table tr:hover td { background: #FEFDE2 } .button:hover, .button:active, .button:focus, button:hover, p.readmore a:hover, #header ul.menu a:hover, #header ul.menu a:active, #header ul.menu a:focus, .pagenav a:hover, .pagenav a:active, .pagenav a:focus, #advanced-search-toggle:hover, #advanced-search-toggle:active, #advanced-search-toggle:focus, .profile-edit a:hover, .profile-edit a:active, .profile-edit a:focus, #fontsize a:hover, #fontsize a:active, #fontsize a:focus, #mobile_select h2 a, table th, .logoheader { background-color: #c00; background-repeat: repeat-x; filter: progid:dximagetransform.microsoft.gradient(startColorstr=#cc0000, endColorstr=#990000); background-image: -khtml-gradient(linear, left top, left bottom, from(#c00), to(#900)); background-image: -moz-linear-gradient(top, #c00, #900); background-image: -ms-linear-gradient(top, #c00, #900); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #c00), color-stop(100%, #900)); background-image: -webkit-linear-gradient(top, #c00, #900); background-image: -o-linear-gradient(top, #c00, #900); background-image: linear-gradient(#c00, #900); border-color: #900; color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, .33); -webkit-font-smoothing: antialiased } .pagination span, .pagination span a:hover { color: #999; background-color: #f5f5f5 } span.pagenav { background: #095197; color: #fff } .pagination-start span.pagenav, .pagination-prev span.pagenav, .pagination-end span.pagenav, .pagination-next span.pagenav { background-color: #f5f5f5; color: #444 } ul.menu a:link, ul.menu a:visited { color: #444 } .moduletable_menu { border: solid 1px #ddd; background: #f9f9f9 } #header ul.menu { border: solid 1px #D5D5D5; box-shadow: 0 1px 0 #fff inset, 0 1px 5px rgba(0, 0, 0, .1) } #header ul.menu a { box-shadow: none; border-bottom: 0 } ul.menu a:hover, ul.menu a:active, ul.menu a:focus { background-color: #F5F5F5; background-image: -moz-linear-gradient(center top, #fff, #e6e6e6); background-repeat: repeat-x; background: url(../images/arrow.png) no-repeat right center; color: #c00 } ul.menu li.active a, ul.menu li.active ul li.active a, ul.menu li.active ul li.active ul li.active a, ul.menu li.active ul li.active ul li.active ul li.active a, ul.menu li.active ul li.active ul li.active ul li.active ul li.active a { font-weight: 700 } ul.menu li.active ul li a, ul.menu li.active ul li.active ul li a, ul.menu li.active ul li.active ul li.active ul li a, ul.menu li.active ul li.active ul li.active ul li.active ul li a { font-weight: 400 } ul.menu a { box-shadow: 0 1px 0 #fff; border-bottom: solid 1px #ddd; text-shadow: 0 1px 0 #fff } ul.menu ul a { background: #e5e5e5; margin-bottom: 1px } ul.menu ul ul ul a { background: #f5f5f5 url(../images/arrow.png) no-repeat 24px center } ul.menu ul ul ul ul a { background: #fff } .panel h3.pane-toggler a { background: url(../images/slider_plus.png) right top no-repeat; color: #333 } .panel h3.pane-toggler-down a { background: url(../images/slider_minus.png) right top no-repeat; border-bottom: solid 1px #ddd; color: #333 } ul.tabs li, dl.tabs dt h3 a:link, dl.tabs dt h3 a:visited { background: #f5f5f5 url(../images/nature/box.png) repeat-x } ul.tabs li a:link, ul.tabs li a:visited, dl.tabs dt a { color: #333; border: solid 1px #ddd; border-bottom: 0 } ul.tabs li a:hover, ul.tabs li a:active, ul.tabs li a:focus { color: #000 } .tabcontent, div.current { background: #fff; color: #000; border: solid 1px #ddd } .tabcontent .linkclosed { color: #000; border-bottom: solid 1px #e5e5e5 } ul.tabs li a.linkopen, dl.tabs dt.open h3 a:link, dl.tabs dt.open h3 a:visited { background: #fff; color: #333; border-radius: 5px 5px 0 0 } ul.tabs li a.linkclosed:hover, ul.tabs li a.linkclosed:active, ul.tabs li a.linkclosed:focus, ul.tabs li a.linkopen:hover, ul.tabs li a.linkopen:active, ul.tabs li a.linkopen:focus { background: #555; color: #fff } #footer-inner, #footer { background: #f5f5f5; box-shadow: 0 20px 10px #555 } #footer { background: #555; max-width: 1025px; margin: 0 auto; box-shadow: 0 0 10px #555; color: #fff } #footer a { color: #fff; background: 0 } #bottom a { background: 0 } .box1 { border-right: solid 1px #ccc } .box3 { border-left: solid 1px #ccc } #bottom ul li a { background-image: none; padding-left: 0 } #mobile_select h2 { border: 0; margin: -17px 0 0 0; padding: 0; background: #900; text-align: right } #mobile_select h2 a { display: inline-block; font-size: .8em; border-radius: 4px 4px 0 0; padding: 6px; font-size: .75em; margin-right: 5px } @media only screen and (max-width: 480px) { img { max-width: 100%; height: auto; border: 0; -ms-interpolation-mode: bicubic } #fontsize { display: none } #nav, #wrapper2, #wrapper, .cols-3 .column-1, .cols-3 .column-2, .cols-3 .column-3, #right, .box, #header form { float: none; width: 100% } #header { padding-top: 3em } #header form { margin: 0 } .logoheader { background: #900; min-height: 100px; margin: 0 } .box { border-left: 0 !important; border-bottom: solid 1px #ddd } #line { text-align: center; top: 0; right: auto; max-width: 100%; min-width: 100%; margin: 0 0; background: #c00 } #header form input { float: none; margin-bottom: 4px } #menuwrapper { margin-top: 10px } #header ul.menu { position: relative; top: 0; left: 20px; right: 20px; margin: 0; width: 90%; border-radius: 4px } #header ul.menu li:first-child a { border-radius: 4px 4px 0 0 } #header ul.menu li:last-child a { border-radius: 0 0 4px 4px } #header ul.menu li a:link, #header ul.menu li a:visited { display: block; padding: 6px 10px; border-bottom: solid 1px #ccc } } PK���\�����templates/beez3/css/ie7only.cssnu�[���/** * @author ( Angie Radtke ) * @package Joomla * @subpackage Accessible-Template-Beez * @copyright Copyright (C) 2005 - 2009 Open Source Matters. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant to the * GNU General Public License, and as distributed it includes or is derivative * of works licensed under the GNU General Public License or other free or open * source software licenses. See COPYRIGHT.php for copyright notices and * details. */ div.current , fieldset {zoom:1} dl.tabs ,.tabs dt,.tabs dd {display:inline} .contact-links , .js_heading{zoom:1} legend {margin-left:-7px} #users-profile-core legend, #users-profile-custom legend, .profile-edit legend, .registration legend {margin-bottom:15px} .login-fields input {width:14em} #close a { cursor:pointer } #close a span { line-height:normal } PK���\��9arrtemplates/beez3/css/general.cssnu�[���/* not ready */ /* -- form validation */ .invalid { border-color: #B94A48;background:#F2DEDE} label.invalid , label.required span{ color: #B94A48; background:none } /* -- Joomla edit buttons Frontendediting*/ #editor-xtd-buttons { padding: 0px; } .edit tr:hover td {background:#eee} .button2-left, .button2-right, .button2-left div, .button2-right div { float: left; } .button2-left a, .button2-right a, .button2-left span, .button2-right span { display: block; float: left; color: #666; cursor: pointer; } .button2-left span, .button2-right span { cursor: default; color: #999; } .button2-left .page a, .button2-right .page a, .button2-left .page span, .button2-right .page span { padding: 0 6px; } .page span { color: #000; font-weight: bold; } .button2-left, .button2-right { float: left; margin-left: 5px; } .edit .formelm-buttons {text-align:right} .edit .formelm-buttons button {background:#D9EDF7; color:#095197;} .edit .formelm-buttons button:hover {color:#D9EDF7; background:#095197;} .modal-button:link, .modal-button:visited, .button2-left .readmore a:link, .button2-left .readmore a:visited, .button2-left .blank a:link, .button2-left .blank a:visited { background-color: #D9EDF7; color:#095197;border:solid 1px #BCE8F1; border-top:0; border-radius:0 0 3px 3px; text-decoration:none; padding:3px} .button2-left a:hover, .button2-left .blank a:hover, .button2-left .readmore a:hover, .button2-right a:hover { text-decoration: none; color: #fff; background:#095197; } .pull-right { float: right; } .pull-left { float: left; } .btn-toolbar .btn { -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; background-color: #D9EDF7; border-image: none; border-radius: 0 0 3px 3px; color: #095197; padding: 3px; text-decoration: none; } div.toggle-editor { } /* Caption fixes */ .img_caption .left { float: left; margin-right: 1em; } .img_caption .right { float: right; margin-left: 1em; } .img_caption .left p { clear: left; text-align: center; } .img_caption .right p { clear: right; text-align: center; } .img_caption { text-align: center!important; } .img_caption.none { margin-left:auto; margin-right:auto; } /* New captions */ figure { display: table; } figure.pull-center, img.pull-center { margin-left: auto; margin-right: auto; } figcaption { display: table-caption; caption-side: bottom; } /* Calendar */ #jform_publish_down_img { width: 18px; height: 18px; margin-left: 3px; background: url(../images/system/calendar.png) no-repeat; cursor: pointer; vertical-align: middle; } #jform_publish_up_img { width: 18px; height: 18px; margin-left: 3px; background: url(../images/system/calendar.png) no-repeat; cursor: pointer; vertical-align: middle; } /* System Messages */ .error { padding:0px; margin-bottom: 20px; } .error h2 { color:#000 !important; font-size:1.4em !important; text-transform:uppercase; padding:0 0 0 0px !important } #system-message dt { font-weight: bold; } #system-message dd { margin: 0 0 15px 0; font-weight: bold; text-indent: 0px; padding:0 } #system-message dd ul { color: #000; list-style: none; padding: 0px; } #system-message dd ul li { line-height:1.5em } /* System Standard Messages */ #system-message dt.message { position:absolute; top:-2000px; left:-3000px; } #system-message dd.message ul { background: #fff url(../images/system/notice-info.png) no-repeat; padding-left:40px; padding: 10px 10px 10px 40px; border: 2px solid #90B203; border-radius:10px } #system-message dd.message ul li{background:none !important} /* System Error Messages */ #system-message dt.error { position:absolute; top:-2000px; left:-3000px; } #system-message dd.error ul { background:#fff url(../images/system/notice-alert.png) no-repeat ; padding-left:40px; padding: 10px 10px 10px 40px; border: 2px solid #990000; border-radius:10px } /* System Notice Messages */ #system-message dt.notice { position:absolute; top:-2000px; left:-3000px; } #system-message dd.notice ul { background:#fff url(../images/system/notice-note.png) no-repeat ; padding-left:40px; padding: 10px 10px 10px 40px; border: 2px solid #FAA528; border-radius:10px } #system-message dd.notice ul { color: #000;margin:10px 0 } #system-message { margin-bottom: 0px; padding: 0; } #system-message dt { font-weight: bold; } #system-message dd { font-weight: bold; padding: 0; } .tip-wrap { background:#FEFDE2; font-size:0.8em ; padding:5px; border:solid 1px #ddd; border-radius:3px; box-shadow: 0 1px 5px #ccc } .tip-title {font-weight:bold} #all #upload-flash ul li a:hover, #all .item a:hover span { background:#095197; color:#fff; } /* ########################## user profile ########################### */ #users-profile-core, #users-profile-custom { margin:10px 0 15px 0; padding:15px; } #users-profile-core dt, #users-profile-custom dt { float:left; width:12em; padding:3px 0; } #users-profile-core dd, #users-profile-custom dd { padding:3px 0; } #member-profile fieldset, .registration fieldset { margin:10px 0 15px 0; padding:15px; } #users-profile-core legend, #users-profile-custom legend, .profile-edit legend, .registration legend { font-weight:bold } .profile-edit form#member-profile fieldset dd, .registration form#member-registration fieldset dd { float:none; padding:5px 0} .profile-edit form#member-profile fieldset dd input, .profile-edit form#member-profile fieldset dd select, .registration form#member-registration fieldset dd input {width:17em} .profile-edit form#member-profile fieldset dt, .registration form#member-registration fieldset dt {padding:5px 5px 5px 0; width:13em} span.optional {font-size:0.9em} /* ########################## clearing ########################### */ .clr { clear: both; overflow: hidden; height: 0; } /* ########################## tooltip ########################### */ .tooltip { position: absolute; z-index: 103000; display: block; visibility: visible; font-size: 11px; line-height: 1.4; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.8; filter: alpha(opacity=80); } .tooltip.top { margin-top: -3px; padding: 5px 0; } .tooltip.right { margin-left: 3px; padding: 0 5px; } .tooltip.bottom { margin-top: 3px; padding: 5px 0; } .tooltip.left { margin-left: -3px; padding: 0 5px; } .tooltip-inner { max-width: 200px; padding: 8px; color: #fff; text-align: left; text-decoration: none; background-color: #000; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .element-invisible { position: absolute; padding: 0; margin: 0; border: 0; height: 1px; width: 1px; overflow: hidden; } #filter-search { vertical-align: top; } .input-mini { width: 60px; } /* Bootstrap overrides anhiliation * @since 3.2 */ body#shadow { line-height: 1.5em; } body .nav-pills > .active > a, body .nav-pills > .active > a:hover, body .nav-pills > .active > a:focus { background-color: transparent; } body .nav-pills > li > a { border-radius: 0px; line-height: 1.5em; } body a { text-decoration: underline; } body input[type="text"].search-query { line-height: 1.5em; height: auto; border-radius: 4px; } /* Text alignments */ .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } PK���\)�""$templates/beez3/css/personal_rtl.cssnu�[���h1#logo { margin-right: 90px; } PK���\j�� % %)templates/beez3/javascript/respond.src.jsnu�[���/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ window.matchMedia = window.matchMedia || (function(doc, undefined){ var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, // fakeBody required for <FF4 when executed in <head> fakeBody = doc.createElement('body'), div = doc.createElement('div'); div.id = 'mq-test-1'; div.style.cssText = "position:absolute;top:-100em"; fakeBody.style.background = "none"; fakeBody.appendChild(div); return function(q){ div.innerHTML = '­<style media="'+q+'"> #mq-test-1 { width: 42px; }</style>'; docElem.insertBefore(fakeBody, refNode); bool = div.offsetWidth == 42; docElem.removeChild(fakeBody); return { matches: bool, media: q }; }; })(document); /*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ (function( win ){ // Exposed namespace win.respond = {}; // Define update even in native-mq-supporting browsers, to avoid errors respond.update = function(){}; // Expose media query support flag for external use respond.mediaQueriesSupported = win.matchMedia && win.matchMedia( "only all" ).matches; // If media queries are supported, exit here if ( respond.mediaQueriesSupported ){ return; } // Define vars var doc = win.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName( "head" )[0] || docElem, base = doc.getElementsByTagName( "base" )[0], links = head.getElementsByTagName( "link" ), requestQueue = [], // Loop stylesheets, send text content to translate ripCSS = function(){ var sheets = links, sl = sheets.length, i = 0, // Vars for loop: sheet, href, media, isCSS; for( ; i < sl; i++ ){ sheet = sheets[ i ], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet"; //only links plz and prevent re-parsing if ( !!href && isCSS && !parsedSheets[ href ] ){ // selectivizr exposes css through the rawCssText expando if (sheet.styleSheet && sheet.styleSheet.rawCssText) { translate( sheet.styleSheet.rawCssText, href, media ); parsedSheets[ href ] = true; } else { if ( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base) || href.replace( RegExp.$1, "" ).split( "/" )[0] === win.location.host ){ requestQueue.push( { href: href, media: media } ); } } } } makeRequests(); }, // Recurse through request queue, get css text makeRequests = function(){ if ( requestQueue.length ){ var thisRequest = requestQueue.shift(); ajax( thisRequest.href, function( styles ){ translate( styles, thisRequest.href, thisRequest.media ); parsedSheets[ thisRequest.href ] = true; makeRequests(); } ); } }, // Find media blocks in css text, convert to style blocks translate = function( styles, href, media ){ var qs = styles.match( /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi ), ql = qs && qs.length || 0, // Try to get CSS path href = href.substring( 0, href.lastIndexOf( "/" )), repUrls = function( css ){ return css.replace( /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + href + "$2$3" ); }, useMedia = !ql && media, // Vars used in loop i = 0, j, fullq, thisq, eachq, eql; // If path exists, tack on trailing slash if ( href.length ){ href += "/"; } //if no internal queries exist, but media attr does, use that //note: this currently lacks support for situations where a media attr is specified on a link AND //its associated stylesheet has internal CSS media queries. //In those cases, the media attribute will currently be ignored. if ( useMedia ){ ql = 1; } for( ; i < ql; i++ ){ j = 0; // Media attr if ( useMedia ){ fullq = media; rules.push( repUrls( styles ) ); } // Parse for styles else{ fullq = qs[ i ].match( /@media *([^\{]+)\{([\S\s]+?)$/ ) && RegExp.$1; rules.push( RegExp.$2 && repUrls( RegExp.$2 ) ); } eachq = fullq.split( "," ); eql = eachq.length; for( ; j < eql; j++ ){ thisq = eachq[ j ]; mediastyles.push( { media : thisq.split( "(" )[ 0 ].match( /(only\s+)?([a-zA-Z]+)\s?/ ) && RegExp.$2 || "all", rules : rules.length - 1, hasquery : thisq.indexOf("(") > -1, minw : thisq.match( /\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ), maxw : thisq.match( /\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ) } ); } } applyMedia(); }, lastCall, resizeDefer, // returns the value of 1em in pixels getEmValue = function() { var ret, div = doc.createElement('div'), body = doc.body, fakeUsed = false; div.style.cssText = "position:absolute;font-size:1em;width:1em"; if ( !body ){ body = fakeUsed = doc.createElement( "body" ); body.style.background = "none"; } body.appendChild( div ); docElem.insertBefore( body, docElem.firstChild ); ret = div.offsetWidth; if ( fakeUsed ){ docElem.removeChild( body ); } else { body.removeChild( div ); } // Also update eminpx before returning ret = eminpx = parseFloat(ret); return ret; }, // Cached container for 1em value, populated the first time it's needed eminpx, // Enable/disable styles applyMedia = function( fromResize ){ var name = "clientWidth", docElemProp = docElem[ name ], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[ name ] || docElemProp, styleBlocks = {}, lastLink = links[ links.length-1 ], now = (new Date()).getTime(); // Throttle resize calls if ( fromResize && lastCall && now - lastCall < resizeThrottle ){ clearTimeout( resizeDefer ); resizeDefer = setTimeout( applyMedia, resizeThrottle ); return; } else { lastCall = now; } for( var i in mediastyles ){ var thisstyle = mediastyles[ i ], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em"; if ( !!min ){ min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 ); } if ( !!max ){ max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 ); } // If there's no media query at all (the () part), or min or max is not null, and if either is present, they're true if ( !thisstyle.hasquery || ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max ) ){ if ( !styleBlocks[ thisstyle.media ] ){ styleBlocks[ thisstyle.media ] = []; } styleBlocks[ thisstyle.media ].push( rules[ thisstyle.rules ] ); } } // Remove any existing respond style element(s) for( var i in appendedEls ){ if ( appendedEls[ i ] && appendedEls[ i ].parentNode === head ){ head.removeChild( appendedEls[ i ] ); } } // Inject active styles, grouped by media type for( var i in styleBlocks ){ var ss = doc.createElement( "style" ), css = styleBlocks[ i ].join( "\n" ); ss.type = "text/css"; ss.media = i; // Originally, ss was appended to a documentFragment and sheets were appended in bulk. // This caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one! head.insertBefore( ss, lastLink.nextSibling ); if ( ss.styleSheet ){ ss.styleSheet.cssText = css; } else{ ss.appendChild( doc.createTextNode( css ) ); } // Push to appendedEls to track for later removal appendedEls.push( ss ); } }, // Tweaked Ajax functions from Quirksmode ajax = function( url, callback ) { var req = xmlHttp(); if (!req){ return; } req.open( "GET", url, true ); req.onreadystatechange = function () { if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){ return; } callback( req.responseText ); } if ( req.readyState == 4 ){ return; } req.send( null ); }, // Define ajax obj xmlHttp = (function() { var xmlhttpmethod = false; try { xmlhttpmethod = new XMLHttpRequest(); } catch( e ){ xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" ); } return function(){ return xmlhttpmethod; }; })(); // Translate CSS ripCSS(); // Expose update for re-running respond later on respond.update = ripCSS; // Adjust on resize function callMedia(){ applyMedia( true ); } if ( win.addEventListener ){ win.addEventListener( "resize", callMedia, false ); } else if( win.attachEvent ){ win.attachEvent( "onresize", callMedia ); } })(this); PK���\��ΰ�!�!"templates/beez3/javascript/hide.jsnu�[���// Angie Radtke 2009 - 2012 thanks to daniel // /*global window, localStorage, Cookie, altopen, altclose, big, small, rightopen, rightclose, bildauf, bildzu */ function saveIt(name) { var x = document.getElementById(name).style.display; if (!x) { alert('No cookie available'); } else if (localStorage) { localStorage[name] = x; } } function readIt(name) { if (localStorage) { return localStorage[name]; } } function wrapperwidth(width) { jQuery('#wrapper').css('width', width); } // add Wai-Aria landmark-roles jQuery(function($) { $('#nav').attr('role', 'navigation'); $('#mod-search-searchword').closest('form').attr('role', 'search'); $('#main').attr('role', 'main'); $('#right').attr('role', 'contentinfo'); }); jQuery(function($) { // get ankers var $myankers = $('a.opencloselink'); $myankers.each(function() { var $element = $(this); $element.attr('role', 'tab'); var myid = $element.attr('id'); myid = myid.split('_'); myid = 'module_' + myid[1]; $element.attr('aria-controls', myid); }); var $list = $('div.moduletable_js'); $list.each(function() { var $element = $(this); if ($element.find('div.module_content').length) { var $el = $element.find('div.module_content'); $el.attr('role', 'tabpanel'); var myid = $el.attr('id'); myid = myid.split('_'); myid = 'link_' + myid[1]; $el.attr('aria-labelledby', myid); var myclass = $el.attr('class'); var one = myclass.split(' '); // search for active menu-item var $listelement = $el.find('a.active').first(); var unique = $el.attr('id'); var nocookieset = readIt(unique); if (($listelement.length) || ((one[1] == 'open') && (nocookieset == null))) { $el.show(); var $eltern = $el.parent(); var $elternh = $eltern.find('h3').first(); var $elternbild = $eltern.find('img').first(); $elternbild.attr('alt', altopen).attr('src', bildzu); $elternbild.focus(); } else { $el.hide(); $el.attr('aria-expanded', 'false'); } unique = $el.attr('id'); var cookieset = readIt(unique); if (cookieset === 'block') { $el.show(); $el.attr('aria-expanded', 'true'); } } }); }); jQuery(function($) { var $what = $('#right'); // if rightcolumn if ($what.length) { var whatid = $what.attr('id'); var rightcookie = readIt(whatid); if (rightcookie === 'none') { $what.hide(); $('#nav').addClass('leftbigger'); wrapperwidth(big); var $grafik = $('#bild'); $grafik.html(rightopen); $grafik.focus(); } } }); function auf(key) { var $ = jQuery.noConflict(); var $el = $('#' + key); if (!$el.is(':visible')) { $el.show(); $el.attr('aria-expanded', 'true'); if (key !== 'right') { $el.hide().toggle('slide'); $el.parent().attr('class', 'slide'); $eltern = $el.parent().parent(); $elternh = $eltern.find('h3').first(); $elternh.addClass('high'); $elternbild = $eltern.find('img').first(); $el.focus(); $elternbild.attr('alt', altopen).attr('src', bildzu); } if (key === 'right') { $('#right').show(); wrapperwidth(small); $('#nav').removeClass('leftbigger'); $grafik = $('#bild'); $('#bild').html(rightclose); $grafik.focus(); } } else { $el.hide(); $el.attr('aria-expanded', 'false'); $el.removeClass('open'); if (key !== 'right') { $eltern = $el.parent().parent(); $elternh = $eltern.find('h3').first(); $elternh.removeClass('high'); $elternbild = $eltern.find('img').first(); $elternbild.attr('alt', altclose).attr('src', bildauf); $elternbild.focus(); } if (key === 'right') { $('#right').hide(); wrapperwidth(big); $('#nav').addClass('leftbigger'); $grafik = $('#bild'); $grafik.html(rightopen); $grafik.focus(); } } // write cookie saveIt(key); } // ########### Tabfunctions #################### jQuery(function($) { var $alldivs = $('div.tabcontent'); var $outerdivs = $('div.tabouter'); //outerdivs = outerdivs.getProperty('id'); $outerdivs.each(function() { var $alldivs = $(this).find('div.tabcontent'); var count = 0; var countankers = 0; $alldivs.each(function() { var $el = $(this); count++; $el.attr('role', 'tabpanel'); $el.attr('aria-hidden', 'false'); $el.attr('aria-expanded', 'true'); elid = $el.attr('id'); elid = elid.split('_'); elid = 'link_' + elid[1]; $el.attr('aria-labelledby', elid); if (count !== 1) { $el.addClass('tabclosed').removeClass('tabopen'); $el.attr('aria-hidden', 'true'); $el.attr('aria-expanded', 'false'); } }); $allankers = $(this).find('ul.tabs').first().find('a'); $allankers.each(function() { countankers++; var $el = $(this); $el.attr('aria-selected', 'true'); $el.attr('role', 'tab'); linkid = $el.attr('id'); moduleid = linkid.split('_'); moduleid = 'module_' + moduleid[1]; $el.attr('aria-controls', moduleid); if (countankers != 1) { $el.addClass('linkclosed').removeClass('linkopen'); $el.attr('aria-selected', 'false'); } }); }); }); function tabshow(elid) { var $ = jQuery.noConflict(); var $el = $('#' + elid); var $outerdiv = $el.parent(); var $alldivs = $outerdiv.find('div.tabcontent'); var $liste = $outerdiv.find('ul.tabs').first(); $liste.find('a').attr('aria-selected', 'false'); $alldivs.each(function() { var $element = $(this); $element.addClass('tabclosed').removeClass('tabopen'); $element.attr('aria-hidden', 'true'); $element.attr('aria-expanded', 'false'); }); $el.addClass('tabopen').removeClass('tabclosed'); $el.attr('aria-hidden', 'false'); $el.attr('aria-expanded', 'true'); $el.focus(); var getid = elid.split('_'); var activelink = '#link_' + getid[1]; $(activelink).attr('aria-selected', 'true'); $liste.find('a').addClass('linkclosed').removeClass('linkopen'); $(activelink).addClass('linkopen').removeClass('linkclosed'); } function nexttab(el) { var $ = jQuery.noConflict(); var $outerdiv = $('#' + el).parent(); var $liste = $outerdiv.find('ul.tabs').first(); var getid = el.split('_'); var activelink = '#link_' + getid[1]; var aktiverlink = $(activelink).attr('aria-selected'); var $tablinks = $liste.find('a'); for (var i = 0; i < $tablinks.length; i++) { if ($($tablinks[i]).attr('id') === activelink) { if ($($tablinks[i + 1]).length) { $($tablinks[i + 1]).click(); break; } } } } // mobilemenuheader var mobileMenu = function(){ var $ = jQuery.noConflict(), displayed = false, $mobile, $menu, $menuWrapper; var getX = function() { return $(document).width(); }; var createElements = function () { var Openmenu=Joomla.JText._('TPL_BEEZ3_OPENMENU'); var Closemenu=Joomla.JText._('TPL_BEEZ3_CLOSEMENU'); $menu = $("#header").find('ul.menu').first(); $menuWrapper = $('<div>', {id : 'menuwrapper', role: 'menubar'}); // create the menu opener and assign events $mobile = $('<div>', {id: 'mobile_select'}).html('<h2><a href=#" id="menuopener" onclick="return false;"><span>Openmenu</span></a></h2>').show(); $mobile.on('click', function(){ var state = $menuWrapper.css('display'); $menuWrapper.slideToggle(); if (state === 'none') { $('#menuopener').html(Closemenu); $('#menuwrapper').attr('aria-expanded', 'true').attr('aria-hidden','false'); } else { $('#menuopener').html(Openmenu); $('#menuwrapper').attr('aria-expanded', 'false').attr('aria-hidden', 'true'); } }); // add the menu to the dom $menu.wrap($menuWrapper); // add the menuopener to the dom and hide it $('#header').find('#menuwrapper').first().before($mobile.hide()); $menuWrapper = $('#menuwrapper'); $mobile = $('#mobile_select'); }; var display = function () { $menuWrapper.hide(); $mobile.show(); displayed = true; }; var initialize = function () { // create the elements once createElements(); // show the elements if the browser size is smaller if (getX() <= 461 && !displayed) { display(); } // react on resize events $(window).on('resize', function () { if (getX() >= 461) { if (displayed) { $mobile.hide(); $('#menuwrapper').show(); displayed = false; } } if (getX() < 461) { if (!displayed) { display(); } } }); }; initialize(); }; jQuery(function () { new mobileMenu(); }); //For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/ (function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})() PK���\!�JK99&templates/beez3/javascript/template.jsnu�[���/** * @package Joomla.Site * @subpackage Templates.beez3 * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @since 3.2 */ (function($) { $(document).ready(function() { $('*[rel=tooltip]').tooltip() // Turn radios into btn-group $('.radio.btn-group label').addClass('btn'); $(".btn-group label:not(.active)").click(function() { var label = $(this); var input = $('#' + label.attr('for')); if (!input.prop('checked')) { label.closest('.btn-group').find("label").removeClass('active btn-success btn-danger btn-primary'); if (input.val() == '') { label.addClass('active btn-primary'); } else if (input.val() == 0) { label.addClass('active btn-danger'); } else { label.addClass('active btn-success'); } input.prop('checked', true); } }); $(".btn-group input[checked=checked]").each(function() { if ($(this).val() == '') { $("label[for=" + $(this).attr('id') + "]").addClass('active btn-primary'); } else if ($(this).val() == 0) { $("label[for=" + $(this).attr('id') + "]").addClass('active btn-danger'); } else { $("label[for=" + $(this).attr('id') + "]").addClass('active btn-success'); } }); }) })(jQuery); PK���\��t%%%templates/beez3/javascript/respond.jsnu�[���/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ window.matchMedia = window.matchMedia || (function(doc, undefined){ var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, // fakeBody required for <FF4 when executed in <head> fakeBody = doc.createElement('body'), div = doc.createElement('div'); div.id = 'mq-test-1'; div.style.cssText = "position:absolute;top:-100em"; fakeBody.style.background = "none"; fakeBody.appendChild(div); return function(q){ div.innerHTML = '­<style media="'+q+'"> #mq-test-1 { width: 42px; }</style>'; docElem.insertBefore(fakeBody, refNode); bool = div.offsetWidth == 42; docElem.removeChild(fakeBody); return { matches: bool, media: q }; }; })(document); /*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ (function( win ){ //exposed namespace win.respond = {}; //define update even in native-mq-supporting browsers, to avoid errors respond.update = function(){}; //expose media query support flag for external use respond.mediaQueriesSupported = win.matchMedia && win.matchMedia( "only all" ).matches; //if media queries are supported, exit here if ( respond.mediaQueriesSupported ){ return; } //define vars var doc = win.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName( "head" )[0] || docElem, base = doc.getElementsByTagName( "base" )[0], links = head.getElementsByTagName( "link" ), requestQueue = [], // Loop stylesheets, send text content to translate ripCSS = function(){ var sheets = links, sl = sheets.length, i = 0, // Vars for loop: sheet, href, media, isCSS; for( ; i < sl; i++ ){ sheet = sheets[ i ], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet"; // Only links plz and prevent re-parsing if ( !!href && isCSS && !parsedSheets[ href ] ){ // Selectivizr exposes css through the rawCssText expando if (sheet.styleSheet && sheet.styleSheet.rawCssText) { translate( sheet.styleSheet.rawCssText, href, media ); parsedSheets[ href ] = true; } else { if ( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base) || href.replace( RegExp.$1, "" ).split( "/" )[0] === win.location.host ){ requestQueue.push( { href: href, media: media } ); } } } } makeRequests(); }, // Recurse through request queue, get css text makeRequests = function(){ if ( requestQueue.length ){ var thisRequest = requestQueue.shift(); ajax( thisRequest.href, function( styles ){ translate( styles, thisRequest.href, thisRequest.media ); parsedSheets[ thisRequest.href ] = true; makeRequests(); } ); } }, // Find media blocks in css text, convert to style blocks translate = function( styles, href, media ){ var qs = styles.match( /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi ), ql = qs && qs.length || 0, // Try to get CSS path href = href.substring( 0, href.lastIndexOf( "/" )), repUrls = function( css ){ return css.replace( /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + href + "$2$3" ); }, useMedia = !ql && media, // Vars used in loop i = 0, j, fullq, thisq, eachq, eql; // If path exists, tack on trailing slash if ( href.length ){ href += "/"; } /* If no internal queries exist, but media attr does, use that * note: this currently lacks support for situations where a media attr is specified on a link AND * its associated stylesheet has internal CSS media queries. * In those cases, the media attribute will currently be ignored. */ if ( useMedia ){ ql = 1; } for( ; i < ql; i++ ){ j = 0; // Media attr if ( useMedia ){ fullq = media; rules.push( repUrls( styles ) ); } // Parse for styles else{ fullq = qs[ i ].match( /@media *([^\{]+)\{([\S\s]+?)$/ ) && RegExp.$1; rules.push( RegExp.$2 && repUrls( RegExp.$2 ) ); } eachq = fullq.split( "," ); eql = eachq.length; for( ; j < eql; j++ ){ thisq = eachq[ j ]; mediastyles.push( { media : thisq.split( "(" )[ 0 ].match( /(only\s+)?([a-zA-Z]+)\s?/ ) && RegExp.$2 || "all", rules : rules.length - 1, hasquery : thisq.indexOf("(") > -1, minw : thisq.match( /\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ), maxw : thisq.match( /\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ) } ); } } applyMedia(); }, lastCall, resizeDefer, // Returns the value of 1em in pixels getEmValue = function() { var ret, div = doc.createElement('div'), body = doc.body, fakeUsed = false; div.style.cssText = "position:absolute;font-size:1em;width:1em"; if ( !body ){ body = fakeUsed = doc.createElement( "body" ); body.style.background = "none"; } body.appendChild( div ); docElem.insertBefore( body, docElem.firstChild ); ret = div.offsetWidth; if ( fakeUsed ){ docElem.removeChild( body ); } else { body.removeChild( div ); } // Also update eminpx before returning ret = eminpx = parseFloat(ret); return ret; }, // Cached container for 1em value, populated the first time it's needed eminpx, // Enable/disable styles applyMedia = function( fromResize ){ var name = "clientWidth", docElemProp = docElem[ name ], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[ name ] || docElemProp, styleBlocks = {}, lastLink = links[ links.length-1 ], now = (new Date()).getTime(); // Throttle resize calls if ( fromResize && lastCall && now - lastCall < resizeThrottle ){ clearTimeout( resizeDefer ); resizeDefer = setTimeout( applyMedia, resizeThrottle ); return; } else { lastCall = now; } for( var i in mediastyles ){ var thisstyle = mediastyles[ i ], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em"; if ( !!min ){ min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 ); } if ( !!max ){ max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 ); } // If there's no media query at all (the () part), or min or max is not null, and if either is present, they're true if ( !thisstyle.hasquery || ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max ) ){ if ( !styleBlocks[ thisstyle.media ] ){ styleBlocks[ thisstyle.media ] = []; } styleBlocks[ thisstyle.media ].push( rules[ thisstyle.rules ] ); } } // Remove any existing respond style element(s) for( var i in appendedEls ){ if ( appendedEls[ i ] && appendedEls[ i ].parentNode === head ){ head.removeChild( appendedEls[ i ] ); } } // Inject active styles, grouped by media type for( var i in styleBlocks ){ var ss = doc.createElement( "style" ), css = styleBlocks[ i ].join( "\n" ); ss.type = "text/css"; ss.media = i; // Originally, ss was appended to a documentFragment and sheets were appended in bulk. // This caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one! head.insertBefore( ss, lastLink.nextSibling ); if ( ss.styleSheet ){ ss.styleSheet.cssText = css; } else { ss.appendChild( doc.createTextNode( css ) ); } // Push to appendedEls to track for later removal appendedEls.push( ss ); } }, // Tweaked Ajax functions from Quirksmode ajax = function( url, callback ) { var req = xmlHttp(); if (!req){ return; } req.open( "GET", url, true ); req.onreadystatechange = function () { if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){ return; } callback( req.responseText ); } if ( req.readyState == 4 ){ return; } req.send( null ); }, // Define ajax obj xmlHttp = (function() { var xmlhttpmethod = false; try { xmlhttpmethod = new XMLHttpRequest(); } catch( e ){ xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" ); } return function(){ return xmlhttpmethod; }; })(); // Translate CSS ripCSS(); // Expose update for re-running respond later on respond.update = ripCSS; // Adjust on resize function callMedia(){ applyMedia( true ); } if ( win.addEventListener ){ win.addEventListener( "resize", callMedia, false ); } else if( win.attachEvent ){ win.attachEvent( "onresize", callMedia ); } })(this); PK���\�sR�� � -templates/beez3/javascript/md_stylechanger.jsnu�[���/*global window, localStorage, fontSizeTitle, bigger, reset, smaller, biggerTitle, resetTitle, smallerTitle, Cookie */ var prefsLoaded = false; var defaultFontSize = 100; var currentFontSize = defaultFontSize; Object.append(Browser.Features, { localstorage: (function() { return ('localStorage' in window) && window.localStorage !== null; })() }); function setFontSize(fontSize) { document.body.style.fontSize = fontSize + '%'; } function changeFontSize(sizeDifference) { currentFontSize = parseInt(currentFontSize, 10) + parseInt(sizeDifference * 5, 10); if (currentFontSize > 180) { currentFontSize = 180; } else if (currentFontSize < 60) { currentFontSize = 60; } setFontSize(currentFontSize); } function revertStyles() { currentFontSize = defaultFontSize; changeFontSize(0); } function writeFontSize(value) { if (Browser.Features.localstorage) { localStorage.fontSize = value; } else { Cookie.write("fontSize", value, {duration: 180}); } } function readFontSize() { if (Browser.Features.localstorage) { return localStorage.fontSize; } else { return Cookie.read("fontSize"); } } function setUserOptions() { if (!prefsLoaded) { var size = readFontSize(); currentFontSize = size ? size : defaultFontSize; setFontSize(currentFontSize); prefsLoaded = true; } } function addControls() { var container = document.id('fontsize'); var content = '<h3>'+ fontSizeTitle +'</h3><p><a title="'+ biggerTitle +'" href="#" onclick="changeFontSize(2); return false">'+ bigger +'</a><span class="unseen">.</span><a href="#" title="'+resetTitle+'" onclick="revertStyles(); return false">'+ reset +'</a><span class="unseen">.</span><a href="#" title="'+ smallerTitle +'" onclick="changeFontSize(-2); return false">'+ smaller +'</a></p>'; container.set('html', content); } function saveSettings() { writeFontSize(currentFontSize); } window.addEvent('domready', function () { smaller = Joomla.JText._('TPL_BEEZ3_SMALLER'); fontSizeTitle = Joomla.JText._('TPL_BEEZ3_FONTSIZE'); bigger = Joomla.JText._('TPL_BEEZ3_BIGGER'); reset = Joomla.JText._('TPL_BEEZ3_RESET'); biggerTitle = Joomla.JText._('TPL_BEEZ3_INCREASE_SIZE'); smallerTitle = Joomla.JText._('TPL_BEEZ3_DECREASE_SIZE'); resetTitle = Joomla.JText._('TPL_BEEZ3_REVERT_STYLES_TO_DEFAULT'); }); window.addEvent('domready', setUserOptions); window.addEvent('domready', addControls); window.addEvent('unload', saveSettings); PK���\!DFH����$templates/beez3/template_preview.pngnu�[����PNG IHDR��)��ҤIDATx^b����ڃQ0 F�(�`����Ç��L@>�];�a�(�kU���b�p[)�*I[d4s���-�w�[f�F@f��h��i>���'�0�\k}�k�}����y�`8/�qTU���n��0�X���B�)hT��>�:��D��U���~~���#U����[D�곝��ef��;��$?-���Fgbb��M'] FM5D\ X�b�o�@��$(B�{�bu��h�3��%�~��,!��l&�,(p�!Nym۞s�B��A����mFjv��0z�4��gSZ�邬 �6G��{�S���ݒ��gxF���$qs/�جg��E��)�W�����|�0c�!�䳣��e�Z-�vY��T{��;���p�*%��HV,���#ҵa���_�⹕%Y�ń�εƞ�e/�� �ؠ�M�*�bJY��ֆ�����zu�،��R<Z��� ����S�/>عט��(��עB\T��-�Y��,�ɲd1[�\�bncK���~� u���c6�Lh�P������R�-��KK���B/��Rhi�-}�w'�Y\�a~!q��霜����N��D"��%BQ����Ƚ����\�P�E�@��S��Ag(b��=I(ֻCO��l�TΔ?�5��WC�)����Èl>���T�ֹ�EHG��f��Z��7�b``B }z���`I���IӞ���D�� Gl��D��Co{T>�_���Ƥ8��H]�7�x�x� ��CS�$�Lld�6�`W��,�*H�9&}�dh-n�)Xh��[ ��ÿ��u��(V�ۦ�lk�?֎1��<���l��s>�T����Qw�'(����XR_� e�$f�AС˝I�~ڿ1s���מ�v{�g��hT�Ph�ZE�c��~p8.ktTQ�H�L��n�íbJ 6-��UtYи���wn��� \���J�f��A��ΘF)d�$@F�c�Y��^��Fy���*u�����9|�&�9bk9��ffE>��:U6_����B2ÇUkD̆{�j��e����� .�N{�Q�OB)do�Ш,B͌ɂn~y��qV��/�!P��YR�9���BڦƖ�U�ɥ�[_ښP*9���{5q���Iu��_�\�$�3�q���o+'=��N���}0�ڹc3�[F3�s�oHOO���2�m~��qb��4�EH �g�0c�C�=�r��]5T��kiP��x���|!�k2�a)���\�xSR_|Vv/�ӣ'(�[g��g �S�}�29�9r(�##���&�?ۀM&X?8'�j��8��P��*X�&JH�w�tr��f��PK}�L�<���� ���lf���N*I�m�X!��RW?>��Kzpm�{�ɧn�}[��O/�J� +��;4C Sv��Īb���ZD ���dB[ҩ�݁|R-�0D'j����- 5 w�@1� �O~͋��ɽ@��/�2�F�R��u����h_��h��e#�\� ���� �Z�q�#�������`m������'i�ү$��7f��;��7�ͷ�4,�������j��SE�35��<����J�N��J�.��`S�Bt�.���mq�W��l�������-���J�(1��W^9]Nn=p�ޣ0�����){�7`�? ��X,���2���F�(�����2�r ���00����?3#'+ë?���|}����L ��.�e���ٕ+7����b������u$��dfa`�1��WA����߂bRZ���������<��~|Y���o^^�/?��c`���?.i6F&FQ)/IN��������������-."v�fn��(+�����ce�*(�)���f�~b��^�IN�;2��V,�?_�~�o��g:�-I��Qg��}����l�߿1|������N����m}���@�/L��?~�����ן����Y����y��������l���RA���j+n�{iJ>ާ���A���y��"$�1j[[n����g�:��?����-��o���}/�mj�_�C��' �)N��*Ro��dX7333�`�5��$�0���6�xٽ�ţ&f����cL�j�$-�kU�Ŵ�`Q��b[�RK P��)�-E�t�g�)t;�� �hpQ�J[Ư!�hғ��2y�|y/�<O��(��ѠA���h�'?�\bv�\.�ײl�=�?���'�=](����Z�~Ԍ���8ZZF�ބ�˫!�0�7[�ԋ�ܧ�ٕ6�5J� x�/�(sK2"u���8[��)�[;�Y0�~3���Ze��� cxV���Z���]��\��l ����z�F������@�"}�Ƈ�kܮl8�d�uAm �@�|Tt,"���D�$��*㼝J���J�3���)�fw�<�'M�1x�½+�xX�pU�;A��J�����M�������cظ�|�(�^< &��A��d��:���:p��]O��}}����HX�t�c2� ɥ�o^e�sx�Ta#s�d�[J��JEQ���"���hРA������'�^�S�⎨���X5�j�B����.�����j���Bn�eW�2��v9Y��s&��~�ᙻ3�J����]�ʆ��G/YNH���f)��e�O�/$֫�5��S�1��3t��.h���Fq�=,s�R���zb��'����z��)��y5J+]����&�W ��0թ�����`jж��O�3�9��a�����R+)��d�E��P t�v�������ۖ���H�3�����DΨ���=�/��a�e^�@ ��rC����]��_�ƿ����=��*vv^���S� �c��g���[/5�m��I�R��A5�/l�?f�$��u&�%���N�@j~c���z��x|��߳w?�Ma��쿰��%�5R��,"���Y��ً'�|'�/oz+��K�����@jvgg�ix I����dwv�g/�� �Y__Ws���,R�LY�O�Ze��;���Z�|�v�������n�����]=(�4N��32Nk]��ן�[V�t������:�N�H�-���W���J�<�Ļ��r�xB�2��I"�u��q��&�����;l\�D|YT��q\��VJ'5U�:�8��W�W(�UM���۳D�#S:y�e��w�Y���Z�,��T�އk�n�'�oI���t:y���I3�����-5�˧�ߩ��G+o^o���|p[���i� ��p�i��,�S����,�yZ�qz;B���i�FQt���R��-�b�:�8��ͦ��O������@�����00 � ���^M�gsv@D��Ӷ#SE�Z;�x�y����{�K�2EDk���y�� c�^���97�2c�OTUupp0/8D�(�~�c�2E��"}���9wxx��D�+`�u8��l6/>���i�6 c��\���,s|c����BY�"���e�U@������RAQ��wy�L+cQ"w73U��|��3��ݝpU���M8|̈́����9'"v�@Ua�h�{�����$l����w �MZ�,�_��~���8�~��xc��0.�Ӵr��1�[9q+ܟ����������_ˉ��_�K��6t}jm��KDD���nA�wƗ��""��a�ɱ�[��yi9�+�E����o�Y�j:[�#�$�N�%U�ʝ�̣ܪCٺ �{�.>������h$̲�tw��ޚ�����2�2@�필�Y��K�x +���i��q�m�B}���+�.��/��v�m9A�K`���(P�mG,!���:�;;�=��f��]���HH�@��@n�h|o��D�7�'Bc��zn��D���t���(w��B ��_�3���+�m9E�@4�`��(��r���dȂ��9�(с0��LrJ�s�VeQ4�7�9�,���ϊ��T[Dd������ǥ���&"y��5�ӱ��/�-�J�>�_�{�DR�I�u���a�<��*NW��y�?+W$43��@f�&d���!��0��)~��L���,�G�6qȖy��,�Έ`��$�m���B���������;gŵ��ަgg���a6��1.(��EⒸ�$��fAM\�"Jܞ�0"�$��F@�J�a@@@�f�f��^C=����+|~�_Wݺ�U���?ݾ�sn��&,T&'��]-W(w��NwR**s�퉾�r����M�\hz�nN�w��*���c�L�<�^[���H�����_�YP�� PRs��3��a?���rgF�䛐��I����F�~�p�~�Ta��^6y��{�{�mY�Sڭ���};�]����ቹ�R��K���� �c/ff�_�/�$0�����蓉g�lݞ^��[�v���ѷ=���7b��#i74���ӛX5(q�{u��ٳQaaQ�l���켋R�;�s��ZJ���9q���q�q�\�����ç����>x��}���*����Ύĩ���<���mߑt�N*�} �r ��o��U�Zl\Q_b4ɤ����;�Ƨ$�>Yi;��ݛ��ed]�zb��S-��Gs������5�Uw�"��`aaaaA�S�d��45CJà�����ژq�֗1���_���U��z�I���dz��6�;LFsǫz`Ȭ��K{`}G� A�~րA�LP�|>1��fI����F �q�S�;_=k���t������&��7���vu�;u-��-^�'�箻8Ьי:1 ���Mı_"��� $[[��IE�Ϯ�$��>��PXуt�Z��*A��=�M�q��PSq*c�~{l/�{��<�օ�׳Ic7!�څ�K��BӤq�X��˪������\�^7o�ݘ�Ba�ՃbM��%?_9;u�:��M��i fg#Aj�.+����m꼺VL��i����`6�Hb���mo��=���^�X�{Gt��vhۚ�����S_8��Ebj����=��vn)m6�����aaaaa-h �Ʉu�8�[�ssQ<�IG�&�!��̂�]/�k�~y��KKhG�HoC;��e�'b�E�U�m"!�<L���3�_����|�M��tU�Uh?^���\_Tхa�����Jר���~~R��P��G�7vԔV�\�R��|���4 �U|sR�㑑�=B`��q\���mY�� � ����Rb�$-��@��`� -obZtҤ@�6%,&ut���.#�ժ�[�b�ڪ���}�&0��ٓ�s�'唵.X*�Y)��B&��ʾ�Ÿ���o��m�x&�Q��yv��@]�8��b�t�p�����,���b%�̣tOWa*9�P����y����{�'-Z&��W�aA!!#U"�g�ow𱰰����s������/��*��&p+f����#8\��+F�%BG����J$R��8I��H���0r���H �7��� ��w�W���$���Զ��S-$��{R � D��ޢ,��TX0���i��I+�:|Q���d�K��I��9�o�� � z��nF>621~��n���S���0h/'�ˬ�#�7c��b�Z��/�m�\�|����'4E!|'���x���J�$��}oG���F�P! 4��A����2g%�Xj�5e*�ˀ�ۻi�i������}�jlx����x<�1ă`�hAp �і�Ԩ����g��Z����Ɠ��� ���.�5�J,���XXXX�cHo���4i����M��ͽ���c�̌_��fC� �ڭ?y��&�%D8>�Ƀ>��KR�4��aSf������� ��E�ԗ?���-m�7�R�(� ڌ�N�7�ui��&)`��Ps���1!>�%/�a1²aKW��/��D�0��Kd(,�Im�%��Tڗ?]K3 ڛ����Ն_.�?���˗F��mϊ���h�7�`�X����IA��! Y�VO�=g^�I�����d��G��;Âͭ���h��[f�� �ܮ���A�ɄԌ]�A�*�v�ĝ���p'oo[]Z =3`DeM%M�6�J�D��tW���Z㔟xQ�R]WQ��hZȀis�-W�_{+9w���1#�[w]��ݜ�o#�y��^L��u��ũ��U�C���?�z�.4�� $f2�N�f̀���2��aj/AE���k�����c��u�Z}�3ZI��?N��zF� �Ǎp%�ӯ� �8 m�;�2���0�e�G$���O?o�l<t���Q੪.��{�0��5l�c��h�2�PGW�% ���M�L��8��]8�v�q����`b�B!ִ?�r����/ܠ2����FS�˞'*b-���]�`r{Q���ӽm�歘�k5��C&c#�Ǡ֔����~��||=��W�?�i)3��~�� �e++�^�"Ԣ߭�>6+?���9��^��܆іbBĨ�����ԃ.ϲ�|�]�1�.Z��카��ع�{V��zl��ϥ��q���SW���r���)+6� ���9�����1>x�1������߶��������CJJJ�7��z�M"�8��bH!PV��HQ��Za��^f��^f/,k�Dh��$��8�9��y9�Z[����W�1���=/p(ƈ@���e�֢~�+R�0� �R�J���n����n��tG3+�w���8���#Ry�rf���$7�r>�0J�e��MM�&B�ca�e�ZH���|]�+��Լ����� ���~�h���[[E��T��}���h|xD벬j����(���>���߳W7,���pr���^�}�!տ3��Ǚ E�.a��_�z�N���>%n�Q�~��*�hSn3�h�����ga���Qe�/�P���A�i�û���d�eI�<1��ѷɜ�x�{f��ڛƌ�/�+�2��+!Js��7��$/w��}���M��M�WSuUQqK)�����l���6 P���:. �9����*� �BBH��O��_d�u[����xl��Cb������������H!��b�X.��A��F=h���~�k@�v�1��N�!A������y� ���(�m�kx��*���,eE�;BVZ?����R�T��3+(��^ܟ�"w��wb$�r|�JQ���e)�5��j��ht9��X+�n���du�" F�rF��ɗ��Q��6����SZ)�w�P��C��8�O�vIB�֛\|�^�2�I��`G�l<0�MxF�\�|�[��[��l�P����g߁�4y(�=�TB�8�P�A s���`l-FJa�YF5�� a���h������7�d�݆�'A�mJ��u�Ӌ�ؒ�l>��}�)!8��������x�Z=��zDwp��=H������͇3=�(�F6�`�����ػ���2�߷����\��`iAS�ƾ�H1�-i,��R�J�U%����s�FCm Z1�"�TE�}�V���X[`�tn���{��Y�<a @�̞��/�8YY����������א�1�:�d��/��oA\�h�~ |��i�UJ�H��@+J�Ʒr��HPw��� �R�^�{V�f�ќI��86F����,���Z�I�tN�S�G�q�C ��,�̔4"��8����<��w\i+�D�V�������Z��1�j��S��e�53wҺ�Ȉ�(��b�P ��<�F�$f0�Dm� ���Kac��J)f�|��O��۷}3;�����4���Lk-wp����Z�pf� �j�#!bJ�Tʌ�d<��^��Y�fE�\�a岗~��R�J���ֹs�Ԉ.-�DH5�O~�����/�Z����8H7�y�,??�����/���Vv�Y�q��J+`?� �b�=�8�b�~������.��z�%"�Ĝ�Y����YJ�IgY�Id&�nl����3�iLL�1��N�)��k��?Z��c��yӬ; `f"�F�]�n��-i+7H+a�YLD� � D�\?�M����?�����M�9A�M¦�v��f��s7p=JE����^����ү�i�+B �L�2���|z�'�²1�2s�;a ���^9 �����ݳ�X�cN�^t+t�y���G��Ϳ��hV��f��t�:a�@�o�z����T�8�$�n��|^o����c�q"1�� �d ����h�أ���`�Z��m�1\ZT�O �$h����)��ξ�=#�V���1%G��-Z~n��=;�O�e��,�:�pr%�2�����T�[�P�T����m�~�O�5b��`q2%wb4=�Ģ�T���Cղ{��S���q��tB(�e���r�~��h�擔�L�p��~��u��W��%̝��~�������t�$�rpq���tv���v��������K���K��x�ֳV(j+fJ&j��Rrߖ3�J���3�Z9�D8�^�;24�г��E�zI��$��-_>��cc�I+"�����d݃{��x����IV��z�Mg��/^Yi�[��-hKb��p:��#��?P豫n�,O� �`�j�-͋�~�Įo��Xw�dD��/2[�(��u�q�����Ӆn-����xik��F ��Z�0w�4�l�3y.���.:7�נ�<���ڦ��]�ݨ sg�"�Ie���o�~oqu��',�E�:���ʧ�q6 �`!��̀{�X~��Ea�MV�"���p���<��Q�6���� 2}ꍿ�}j���m�t�uu�g�lx�=���2�f?�xG�u��Ri����v[�6l}��5�qk�%�����t`ttx_o:պ{�D��Zsr28l:ٜyp�H��^?ڗ�%��́fG�*Sq�E��ԛK�b�h]�������|�#t5X)���ez� ���@ѥw�@�T��� v��k�&'\� ��� �Хx��S��N����&��oA�����ڰ�� ����:�i.�a�8�l����e�*�v����qa��k�Yգ�6�.B䦋�������J�ХY%i/�Vq�/��|�d��Z����p81y�_<r`ב����7��p�̲5_����[��G(����=wa�]/���J_�mM� ����f����b�&���ʔ����o�d a�������TԬ��0��Ls��ۡ��v3���.&���D-��O �.�}~m"ڽp�T�حiV�f�i�$B�)�[k[=�FU��z���/C��e�>����6�?{Ϝ�r��$FB)ҫ��K�E!R.b���R�"苀4���� RH�HB�9gN�sf�{H� �.x�~�ߚY{��N><k�i��!L�N%�;�T�9�tp��ֻ*�JC@�$�t�h/����]��UUu;5z#a�� W�F>�33˙y���v�E����7s� K:g8�m���fw���3'�ΐ�_-�O( x�"E�2�v#A�ڤ�3?�dl��|!��g� �q,�P( P�.�K�E��J7�7��ޯ�2�(m�6�̑J</S�ʾ��^H[?��}�5I�^���}J������G<?x�k�<F�ڣv�ΙuKDB���+;�r�\!��Ǐ*�?�G��*�]�,�? ��� n���r����٩�<�S$����DS����ܢv�+#G�ʄ��̙Dgf��)�n�~��eG��6��s�:��{�T���]n�$� �B�(��h�Ug���_����tJ��.���ҫ��5#�;�F��t���^y�_��~F��x�|��ly�����7&l_'>%����7m��gٹ&S���2@�Bf��Q�YS���P?R������ӵ��(=9�u�kϚ1�]����MX�=ɂ�]j��� �q5�_@Ғ��W4�r����Ao}�!�Z5Ay�H�`�u��ڔW�mY�1�`�sG�x���҇Y($��<D�)$ �B�xpR^�U[�3�J�_ɔeY�QB:}9^�5O}>�/ g�X�G����xܔ�La �����:���Ow��;�uQ��)c�&$ಉ|���b���.�Q�Ig����jR�zU��n��k�haBFn|���WM��"~���ACk7]�M���o�����b��C�z 7���������`w,F u�����ye�V~���C���P�Q�SĀ S��^[tR����dw���ɳ~��Y�"�We0�6��N��m�z�����=&��R� v���t�DA�` �B�``D��Ȓ�yU�����~B�C���$�=�u�z�6'��/R<�b�,�r��rաԂw�ƅ� �#"8���tM����]<i� ���ނ�D�M�6�����1|l��ݫ7|�u�[.��Ң��5��(��BZ������+�n�s�W�߭f����1��4f���OW��� �V�N����=���vM�V�ץ���rh7��?O ��O�_��c�z�\���ʰn���+1���Z�w��8}=�K��~��5��U��K-�O�.�:�B�֯�.����q�$ ng�^�P(JS�IG�t��C�"B�d�{�Et0�U����'�p<#�LVy�V�{��W�t�_���i#.�|��3yy�Js�^�S�Lf���k8\L��:�=����f�V\�G�m�{���i���Y����S��N���{萧�B��³#���DЖ����=y�˙y��~Y<�է--`,�� Uy=2C'���Y�N�e��yQ����UZ�7������m��쒤7>�v��r����Oƽd��֬_��o�;m��E���ȸ����yx���O�u(����$?@9"���D�Mp1I"��a( ���z�Fp�,�J>b�X�1�T*�gõ3u'�gs�2Z�j�t��M���lxm@��I�ho��[��a��?�5l۩���F)+������ �p52��, ��:�e��^��5�Es?=~ͫ�X�d6�&Sl��O_V���.�7F����/<����� 3��6�T�j4�a�ƈ�_�`�eM[��c������� @eS�P��]d֙�t�oW�J#��5�����R�k�&�ʡ���3߯h�n̫�fM[�L��\nHly�n�h�Z�PJ!�n��x�w�* ��1@mU�\�e�*_:k0[$<�Fy珪�G��v���}4����D���/�2P���2u짋�/�}x}��O�=6t@��H=����Q����|�r�wиk�P���@��׀)�# ��T((���U� ���w�C(�2c0D�?��7_�DMB�D=�5�L������h]�FҘ�����3Q���Y�ʦ���9��{��57����4 �%�ǹ���J�QFƀ?.�3�QP �� (%O �ߝz �5��c q�Q�VmxL\��-;�5�x�J)��t���t$�PE�P(c����,����>G������ T߱C��#�1]��� �$N���r��Z�}W>����B�ͽ�m^~�bt��W��))��m������r�~�c� 8�Z �_����j.Ak0�������� 8�DG��732���s��F�BgF���h1ÏPk�A����j������|�4V���_�8�qA��Q�r�}���Q۰�إ?�9�gE�U�6���,�5��S5�Z*�H)|���p�|���O+ ���(��K�� ����ղ�~;�`��'M�5-@��?s��Ro��p��L�{��j��EZ�8��~+V4/��?��O���cV�.�Zu�����:}�jx#y��K1r�$e�6ڼ���4Y�y�� �����)���))�(x����(%����N8{�x���(�_v���ޙ+ ��Re�(i/;m"\�~�G�-Nj�E)�XaNڮ�*�l�"�r���R�~�����J���#P( �x]��_��� wUo���6 ;��2��ª�O�~yBV��y_�ڶ�x�=�,8�÷� '6�]�c8DZ�k�S�]$����N��}?��irҰ�����S)�jխ2f�QN�[�Th�,��1�4&����/�x��� �j5Z0��$B@m�~��!�2�N���P&�,eI�Ӈ���67mD��J�O� ��1 Z�Yo���a =��aV� �t�O($Ѡ�k�"J�|���NJ�� )�"�s<��Z���';m����r�zf��mϼzQ���i��28 1�* `���{Ի� �BA��T�P��n�zs���uz��7��>d��<1�9�g~5d��1!O���'&��쮶�&�9w�����Z�$���O<8zb���}������=��{�Ǽ�S'�����I뷮9vay���Lz"I��" z�g^A�~ߦJ����{�e2���K`ɝ˚��3�O˭���80�d2�6����jz.�Рz�c?g�B@(�f;P�e�D�̛�a����olQ5iR3L��w3���į~ڸQ=� ��oA��L�3! ��OH�Q.qII��M z��ʠ�_�H=ѵ��{��BeGA)�y�n�41�T&�hC�%��#S( ���X��7���Δd�/R�R=��2y�+&��B� P4���k��>�f{�\��ɃWL�l��}�'���KSA��8����|�˵+2ۿ�5⏧�]���o�M[�î�?���7n���D�%JY���Z�7*���o�������I��`��wK;pqO��;�J@�O�,������28k�A��m�C�S'�%OG�4zx��[f ټ!�L�,��0�iȈ���:z�,���GR_J�Ӣ�Ȯ�>��kҫ��g��N_L���|�ґsyĬf���%Es.�9#��f8#��@��$@Yig&#�R!&��_��=����fe�$���v�t{2��6���ʜZm��ߴj^N��gr�#���P( �Z��e��ۘ�H_��.ƤA ��{�:�V�V[��x��?�dm�#��/�}<ex犑�������0���NC��孛�=�,Ox\��HhTG�d�{)7秦9�'��|���Ok�m�[�zܤ�:���f���4��?$FI�J7y�7a��fFn�h�$�i��)\�u�3��"(7/=-:��l�9���}yjw�n�qap��.\��41罿xt��⇳1s�ƕ�l�u��_�۔�� i��GL�Ϋ�z�y �u�6�ܒt*��6�\���w�Я=r��ӄ�ڈ��g�av7n�c��4$;���z��/R( #Dc�rZ�/b�� ��Y�z�$:�T���}�?�+b�~�' +~�]�N��7v�ߎ���]�`��[��-�ղ$ч�h��kK�6�nn䶾�1:v\=m���^�ۏ���3�cAdBP!p:8�U2�Z��m�\0�������*��;���74@;i·���� m�c�N�Y� y��3ס�L9b����Þ �xn��?��H��Tq�4�7#�e1�b>���p���=��k�nRK�$|��Ǐ]�n�QOu���.�j��=�D!Eʮ�o������ް�!E�]-Z o�۸kl˞�5~�W�z9v�.��^����y�&4�b6���S�F�,�K�N?�� �~�FE��( ��0�B��<Ú����~{A.�2~*�%�A�kD��:~Mƙ���-�ӳm�1/���Y<�h�Fu�.z9$aMLE @��: |�GG��'�o�o]�6��'�<lp�{��OoUa����'�z��$��C9��a�£������9��p�@���H�!a7�?c�3�{$��X2���:n�g��4gc�b1�Aἴ��'}�Ѹ*j��v�C�̔�)��r_F��dF��(q��)=��y��ǙP�I�:MP³}��wV�x���b�2LV+m��Ci����Qj�Ր$�?�:�A�P-� ���T�5��Er�/I�]�!�u��Z7C W�G|�S���jG6kT7њq�]����/��m�sg�Mp=� �BQc�!L�*�/�_9i����^G!�2|Z��|t��m��9���}�OڧY��W���r���#+�������Vǜ�,��{��O������6�_�V�����#��شc��%Q�3�!(��$x&���|���d��}����>ۜ�&�y��i[�B�ns%����ԅ{����&���hk��m]�=ߡs��=�W���6m��O������ȌL�ufqn��[���ѱK��`�ճ��ڰc��CMaZ&Ɍp���O6V�.��(AN�a����=����|��.�"��h2._8|B�,7ǩ �z{��'�qp]�9 �it�c�q'�tԳ]� F����n�r$9�\x'� ��}�����`�������U!p]=ည�)�M �BA�� [�y鼪�M�'��K�,�e��!���_t�qy��o��'�Г���i���4�^�l�g����"���P��;�=.�q!,R�~E;t�u���LyӸ��Ȟ�un3������^}����18 I�f�W/-�W��0 ��>��ӧ�x� ���:�6V���"�9�=Ӱ�SO�k)v��mR@u�0�]�t$�x���)�����7��:�2�=_�He7���V�NMٝ�P�;d�^����Ȗ|���,p�F�ɠ����^A�DNj�p��{�^� 4�b�ܮO(�|nw��� ��S�BͲG�9�+�5<�� �N���C\�L�� �B!��1�N��i�!a�`�����\P�� ���~�4���_<q��V j7�n��~˝�e�'�����AˆTh��͗�)��W2�9 #5dxו��v�4祸F���$1�~^7���yfa;6E�^���v��g��$eB����ܹ�`0DEE=j��$s�m�Ѝ��&m�QEq��) �2��k�c��ʍ%�<pH���gPZ���|Kq��w�QQ]����w���A��� ��b�kcl�[�1j��b�k�?�`E��������=��O������$˲?�k1��__��fo��!����K3��?�����-�Z�2�e�c5z�:X��g���}��}:ؾ��6��up�Z ���f3Cy� ��͚6|iBRRC_ﵛ�]J^�c��u �d���+[��D"F�����DTjA��z$Ҿ���k���W����}�BQj2��m�|5��z�������d�B�MfQuxr�s"��WE?|y���[IP��÷��lӬ-24��W��y�|$���#>IIy�ů��Z��-�z�5�78�q������ncML����@,�%2X�H�s�{n��y}��B" �=�p��Ln��SZ�meA���)�W�%Щe��FD�K�z�|8�٣��l�5)�f��j֠=����o���F_|-W@��`gC�^��w�G��#�).$��ۣK-�����,|N^[�e�3��8Ly�|�QR��a���B!�Ʉ����jco�Կ@Y���L@�e}�?�u�O��K�۲'�� .�ۧ�:;5�w����ԽV4�u{Z���@�.�v�Ņr�<y�M3o�ؼ�o��Yh�|�f��/U�s�_�kysF�c�tF*����r��H!�"bg���.���u,V)�7�W���B�ёO<��� t�=�˖�7����l[���_t�n�f�:�`6�ؖW�0P�l&5�x\2�ׁ�OM[�7|��� �-����f.����R^6�a^s6AhK�����B!�!r+��@�.�?�o�.* ��E�3�&9a[���w��#�Ŝ>2!l�蹻����zxh}�찙w�Wx{�z�ʩ^K8��,��� ���y���F��,`gl��i�M��>)8�;T/����5��a��K+gz�F���W!��R�=���w�w�vx�Y[STP��z�����C�9㪽�S��>�~�O][w��8�}�5.˦-�>z�_�b��&�u}�\G��D�SRm���<�v�l �{R�7�c"�G/��1j��f��+]]�V��3��B!�`�҂6*�L[|ߩ����eZ �p��n�N60j\�m̨_۳a��v�V���8�~��=�UU<V�n��/�T�u����5a���6-��R��|�e3��>�0v�p1rw�h�kuj40ou����[��o!� �P�D�e�n]�1!� �*�����U77kgV�o�)��l��b���@Ɏ!���:��ֻ��RWW�ڞ f/�Y�.0U+����5.dl�c[���5�N��ԓ[��6���̜���VXJj��B����8��1VA#�B�#J!�F���c�fI-x��2�5j�Z5z-c��#�?�Y¦�vc{��۵���S.�����ؠvТW;����l@S�]]B�R�$fFXpZv|�3��N6�#�t�;da �g���Z���֝x���L�8�B��"��Q�x�}�ZgDZ���`昀�Y]�5�8{�ɒI)z6�}kk��z��ݱ'�]8�߰��[ �8��K��ejף�u�UJ���9�b���7=T���q�W&����y���3'䌐��g�a}`B3X �5�8�ai���Rj��)a���P�n�����_���_�[���o;�-����>�,�����Թ�V2/k�OO>�G�n��[�KM�s�WFV�."��ݻ�Wv��Qo����+&ff,���s�� �$n�!�#�������k[*Q��j0�AO|pI����P��?�ӎ��ܼ߮v������;����ϥ��u,��5�Hݦ /�_vzG��d�UA���V.n���dd*=]�����x&e�BQ�J,EZ��USam�TRRDx��6��m���8�S���/��1e��}�o�>��a�m��Zn��Gg�h��LJ+�{�LD&�6��������9{��йmW��>�������-[u���KB��!�"B�Q��;"�,,�5�(J_5�"b���n�>o��~���o��s���'��-b��榾C3�R�>5�I�F�c85�e<�R�����1����~a�C���<k���K>�",�B���V��Z�X㙕*����w:�fm^���w3����tq76�0�����Q[�Z���c�5�� �X�3���K��^�M8>-h����Bb�e 5���Ѿ3h��;aQ@%>L!���Q���q 7eA���YY\�$K��:u@(�;�]�o�&�����+g^>�cĉ��ƞ_��d��$u�ȩ��S��;�QO�����ܳ���g�r��m�6mZ����B!J�ԁ>y�u?.8ݪ�AG����J�<�ڦ_�v�U�/��I�-\1jȊ�5�J�������c�4��� 5�6]T7�/��XV��P�\��*|�U�!�0�V �"����փ�@n�S ��&�m��7�A�h����㲞�:7,t[ĺ�A�o�︕�ݔPk~Zj*�%|E�r&0�Fйv��j;�i��7`�TA#�BVȈ���~��ӂ�zJ�XJ ��g21NN��T�.o������g$��t�v#���kw �5ܮ��,�oϟR�+�K�'��EX!�`X�Hd'�x�=v��HDEbJ)TЪ��+i���b?qH�X$�k��J�l�ī�{z��<�>n���I�穸r��[ %|B!�P'�q]+k}��%�E`��:�0��M�.1M��q����67�98����_�Vm��0g�_�>�Fpb Û[�8B�BاR� �{�z[��oѱ����Y���]�W�������C�Nw��d=M_?�c��ua�`ٚ�gz5L����#�b֧!�0���2��#V;#��\�Y�R ���?�xo⭔{��O�U��N]�帡ӶGlڴ=6dIh��]������H��7��B3X(��նQ�kg�&*�`B*,`H���'o����{��:����c�7�̘�������3z�ӧ)�.�e���-hB0a�� �B��93�yΛV�&�sv7+� !���I`����G=�~�dW�З�{Gw�=�U���n��s�~upެU���=��l}dB!�0�HȓG.�W��ݳP��hE�� ��c�����i��������4�W��=G���x��I/ ���S|��!�B��A+q��Ov�^�S�[RJH���Da ����M��r�JjH��^;�#/@������~�9��hy�+���P��qU�F!�+�"G�K^{7� �QJ���8T���!/���#�֓�<١��כ!1�+,��Ovp�D�lo� x��À1�B�=�IEB[љؚ1;�R���j��V�����JS3��F��h5Kw�U�w��$��� A�O�{ѷ���|��Ba�"������9}�^&��� f3qp���ً̧&�3<����ׂ�kz�j&D@��w�%�H��:?X��C#B�e�a�c�B�Ljj�w����v�n%E��� ���>k�3 ���#��S��I5��YH�������>�A�S����wr��X��BѲ/"�+XGo�sUbc[Y<e2G�kueөƓ��le��]�Bf=��c��K�{���U�$�k%o&��� ���oB!�XnG49��՟~���P\@��AO�li�E:}���,� ��c�a��2�y� ~��,&�B~?�m�kāBQɪ���UۼJ?i�o����"R��Fy���4�&�)^4aIZz���:�R�^���=UЄ�A�S+5�Kc0����Zg"�!x���\��`��G�3�U�4j��չ�!f�Q�қ�ʌB�aXV��d��G��ҕ���N����$V�5{诫w�\�mH�s���q�R�*7�,���Z�l�V���%I�DUP��l+�$3�����{�N�z����Rvt�*&e�J�1o��K�E��<5aX�F�g9�R�[h��O�y`�{8ۀQ�)���ޠ�XW7{)�<�9�a�I�~Z�3�!�C!��U��kl[�iЂL��f�R��&=�<��Ƕ֠*&��m��oR�iv�s�غ��kKW�o{6�W?+�y��/J�[�^]��Cߵ�%S���9~�&�J �&N��Ld����,���)UZ� ~-jP���0�}^�5S�S��ҫјa��j�8�A�Y.ݺ�B�0��y�&M�`��!��Tg��7�^'��9�S �Ao�B�/{�յ���O�3�1C[Ԩ�=�W�D���ޣQ�D��b�jA4�ذkPc�J�D� 00�Ϝs����^_������u��f^f��g�����'(�f��n~<�A#�G�С���6,�nH���#�!��w0{�!jजԱ�N�w����� �W�9�y�G�/�:�a��|�r�\�k1���?��Q�I��<` �B�8��ح>e�}K"��a�cBH�^�������v���f���t��Fn���TN�v��Ύ��.����h�H+�����@%�������N�F!�%⼎:��e+�/���?�fC��M��L+i:!ݎ�X��>JkE��b�w����@%��v11Y{%5�&�k����B�u[jM�c�v� H �Z��>{F��p[S<$�ڼmz����� $� ��]9���� Ao3��?�B�D�[j���@��D�4���G1V�(�m���f`(A+�8o��C����"�8lzۛ�4��r p� �52���J��Ľ�j#��?�Q #���k��?{�mS�J���j��@1����4�i�ٕ,�{�!��C�>6������!���o!�ő۾Qp!�� Q�7���oÒA�&eM[�OW��Б�j�$���7���Q�}�>Q��ݻ��.���HB۹Nq�#����?��8I�J����Y�O� ����"��!��'{������K�ņ�LX9���BƍJQ�.��~o߮tg�z��nۦmx��s�w��h��6��6q��s9F� &�Z6�W#����R��DH�{�q��:����Z���|��q���${9�m�}�v��K�3�-�t\ߖ�%O�/���5|Nw����S�j�������oX��܃z2*f�O����rcŦu�/W�Z=��W���4{���V��1pg)�MվÇ���A0�[��U��ă��r�����h��e?�r˱Z�v�� j�٪_�(O�����8��?v��.8Ǿ|r뫍�Lv�O��:5�� �vN��z���9�um�O�5�;ɛ�7&�������c_�;>�ї̽=r����f�Ϝ?zl��<����3y�P��خ�mg��$��/IJ|�n�b��;���&Ή�Xq��Ycg�b%"��`�88�sk���/��cy�!<z'/����*h��7o�7<r���J��\Y�����!�(�������|�F!�����=�x9�t�W��� ��k�x��w]�Ǎ�Y({�F��E�C� w�"'��[^�6�١��ѽN��S�g7SV�Ј�^C����=7K�n^�͙}}:b`��f�Y;;s��+��K�:|��¢���=�Ͻ����#Gp�̴5�[$��5>�̵|E���SF�:P楄��@d�VB��Y��Q�TD �U=��p�vzȊ%�淿s��X��~}f\c���O���k���#F�*q��r�:�� ��Ƚ��,Kٲ���L6f��.R��k���rh����>��|,����AFHL��r�6��I�Zխ�����ۅ��vm�aGV��i��.�9fl��;�I� �GG���zW����o�;�gz��>��O��P���i� �Q}{|��f���cf��CŹ}'4�Ɯ\;���C#�Nڰ�T�p�+���Me���'�۾<VQԺ� E9�γ=���}~�y�t^�B@k��wv;at�V6�>m��_�Ԛ\,�Y���0�o��dd<��G�ޓ�r;��Z������E�m`�.�Y�3[|@a< �1���NHJ�r^<������}/��{���3ʍ�y�oV.��s��k�z(���� n���S{FK� @�Ҵ���U�����Ѣ�]������l��3f��<>�{58E����8}��K�^��w88�(�������I}E���F�B����R6��?]��hn��f�˩[��"mVy����o�=Z*!p���P>k��@o2��6AT� �:�۾z�W'@�A� ���6t�g.����O��dx_���^�^����b���g�$f�$Z�˦�9���a����m�Ę� )ݛ����l^ش��2��z��O��� �q��]´�v�7=�����l瞟�<��rxl�ೝ6[���ޣ�@��c�w;QP�q��A��˅�I"�t�_�F5�G��y���⤫�"]�z����A�VL-طnͼ��y��|'v�LL�ꗜq~��I���T\Q�_��6�k;� ��wR��Z���5 ��w��Yn���_��>�K��VZ6~ya��S�N�ݭ���ßB@@@�~J�@V����VbiN�.n��?�oY�E2��*�Vv���,`���jW�n1o��P����ٻ� �e�o�F4� a��$��Ń��)9����\F� �� �O� ��1��f�F}4b���d�I��I�a�!{;��0�X'�xx'�!)8}�A��QG0.����pv��!$�=�ʫ�� ��K�wJ!��T�}�p�A��==�N��Trh��UE��$�WV�tI��@������!l��k^�A��e7�=���]�y5O*3���gUvDx�cR�\Lb!�1>��u���C������U�H����-��ƺ]B�B%� � �(���B �抬���}nn(/~��e4��ޠ��3�?9<˞{�B���C@�ݔ��wP5�1��ee9F����O�}Q�}�j��j�EǨ�� &��ɳ�u )��>q��y��|�Ah�-wc��?*1,� �5��z}=!�Q��g�9�{��E���E-R�$���rF�)O��'��'�v q�� @5nv�����L��` пH��z��ك�me:K����F��|�*�pR�0�'4�BL���- �<)��YݵK���)��{��|�a�H$I�<�X��⢦O���r �,�EX��!X�����7>.Xh�����}z�gTLP�F����U)���q@���"�Z_�k�����*�lA�pO�����E�[�����\@#bl��7K�o7-h�s�+//ߞ�r��6uO����Q#>��b�h9t���%��TH4Eb��h�e�����;��ic��-�l��SPQ"��0��` ��b9�i�gMfۻ���<�Tcwy,�<x�@�ټR�s�ً�51���8fت5�I��P,xy�p�q8I�<[���>�yvT�Y⎫�P����O�U-[| �Y��^���n������͇��M[�����tM�1 'H��h�hJd7��ʣ��8��59���:��� B�f#H �!�`��l�ϳq9 �?a�XM���Rw�_��)x�� ��E�7�XMd���zI���յ�<.Ҫ���)_��B���i��e��Q��x�o|{�AU�rٿ�T�!$Zs$i-���0�OL�LJA�F��1�x!�ZZ}����'���O�iei�Vr�H��__��Y�{y^o)���q�6]�.|Sݸ��z�%X!�L"�1��+��N��ĄdZ�b@���ݼ�&�t�g�"X�(}�郷��nLH�qlM~��ڲZ::D������yٺ��[�{ij�0�>��[D�Y�Ô����0$v�r�W�/������_��rB���f�(:�[=�,�!���"�F�`�[�%�&�[�������D����Tr�.�E��^��ۯ��ȣ�Tj�}�č��F�>�.c0o��Tpr]R|>D2ZMh����� ۿ(-��P`355>ܶ�d|����[U!k�S��%'�8��ܢ[�MNAd(�yf���F�4o������b@D����E�S����~��Z_H�У�7��Â@J����(�h����ԡy�䪎�$>s�d4��`��!|iIt�&X�&W���п%�`ީ�b�d[6��7>�A<�8��_^ ����A�i����-eWv�<_%�&uكƭZ>%NEA�wWv_(aBBwn9h)�e"4xC��K�YFLB�Z8���3�6�W��xS�=<4U><�U�J���K��鄭߭�n���{8�~H�� Le�ym�o�K%钫':Nr��ߔ�Gf��q��<�S1�c88sv�p2��V�(�?F��U�:o��A͔4w�~z��ǥNy��i��US�4C��N�Z%Zc����/B&�Ͻ~yAb4�{�?-TnB���}��������G L�4i�C�� Vz�s��-�*��θ-Ҏ2!�p�-cR��; ��N�JQH���E����Ņ�#�-՞��Z�I�!djr:Sm`4A���ČB;��̉Q��^1r[���"Ȑƚ#����v�d���x\xt��Y�Ş= �?�q�����d-��6xQ�e���W��T� �V��S����]�0-NK��;�/?g�ÿ۞a-�f�T`y�o��� '�:�?��1�E���$ !D Z���ȴ�֙�J"�e��f0���i��̵�a�W��5�.��p��O*�+Eಘ���й���.B�U�h�mV{��$R�Z�x����R�p���AAJ�q��σ4���~�$DFr<��e1;���'��B�q�+�$�,NڟCv��KÔ��3��A�J)�|����F8�U�����8��\c0�(b��C���[=o|S��n���Z([��c�eQAఘu�7� ���n��TJ�\�|.C��*��b���I���\�G�(�x@oG� �RJ�k��!r��h5��� y�ps@�`��� SmJ��wڌ5V\$���z��@�0���G��pi���_-A<h;.�(Qbv���?�B���n���V���ֺ�da*�s�L W(��b��m�* �y UJ�j!紛�-(8H!Ce xI&"��8�صc�(�8 ���^Θ���h8,���bP�bT�Lek��A�S[�"�!(X�Y���9�4w��.�]� 1���̟7�^�¿&��+�Sd�� d�i������Wk�>����2�i�ة+gޕ���d���8�v��+���v^�u��Qt�w��<���mk9�;���W�m�]i���7Wo���^jB�]hA {��肜��L�t �W��J�|p�����j��% ���4��]~yi��h�t�}p����p��д���D�b��~��H����,�+����'�� �3WLy���RP܍Y�[CB $��_k�y4p 4���b�o$H��OU*���E�F���ú�d!9�Ϫ%$(O ��B�$ @��f���g�ha���'�;'���>#�@�OX{�GB$@CP���#��\�Ys����(H�O�br�"w|c�|V���;��>Պ�9Rb��CO� أ���<C�$�@Fy+@�� ��CƠ�� Y}o����dž� ���j��U�ϭ�ݽ8��3z�"�ʒ�Ƃ5n�b�����I\�Ah*�*X�� �*GUU<���6�� |9�8&���1�JGI��^���Q�$���I�9]O(�I@қ! �@��A�dJW��9���>$<戓=WpN1 ���/ ��~�bICx��-��(aU��U���_������߾�կ��������"�_ �U��.����X_v���\��"X$�P�Q��u-p�8�L��jF�be$=��qe��?�x�<`:�C�ĉ��?�h|�dZ�A�LS��!�5)�"��jI�҄���DX�Zo��#��5�֢.�'��1�u���ޘ�;�È�$��! 1P4�I���@EW����[R*M���V��p��SP�ܤ�B�:]V�q�e @��~"��{�<�d?������}Zr��}�}���Ž��f�Pz�t3X��9O�yp��(�nH�j&�,��_#�������U?����>����W^�r���*��@��RPY�ZI����+ ��0>�L 4� �ܓ�ҐТ��Iʕd(�`^��R@�C`���r��kN.k1�V�$֑��ʤ�Ykf�(�@����R��pl= ��! N}L���1w}��R��J'��M �B(�̓EB�D�DٙO&z����� ѥ!wX a�)�VE��K����X k�e���! �G �C��� �4I ZL�tб/��v;/rU����}�������-0ɾ���6�F<o��=ms~N��{����7Ͽ��������g�V~�[��&�W^�a s� Յ�e!֢�*��P�PPQp�:(�ȣ��P�US��4j1H���*�DP� b0]!$���]s��4���jPIQ�Tu-�h�H�X��u,(ص�V��<=�\+�)�� 0;�=���"D� �L$�2j�H pj�Lz�irEC�vB��(@R l�$ 4:�N�ld�,�ҁI�!d#�T�O� ���#HDI�H`tLD�s��|�S��@.�ɓ�Hk� �� �D�%���H�$�?�%Q��a�h H@-c%Q���+�W��*ƃu]��E�*�p?ϤA�t�gw�٭��IZ����o����ӏ����Ͽ��?����'��/�b����+��r�J�h����:k\�oЋ�0߃(�*C��C�C�(�ŵ� ��k@�4 ���p�����HB�jX�@��*m���8�h�"�u�:��Z�����oLl YG`��X��ْZ��^O��ƩP�Eӕ$�9��b�eڤF1�h%H��(��T�1 �`�����������Dz����y�ա����R��@3!6��B�D�bVQ<�F���h(��[CN��bʫ�a�P,͆��|�UB� U��E x��NU��#�F�*��'E�&i'��"�Ͱ�,��aƩ3E��r��T���0�3�>������?��G��>����S�O���y��j2�#&!Z��U����E�k\�:���E��֛� ��W���`=���T����3����`�#u���$yK^���#V�UTŕ�o�.�h�RUʭ@����>#�u��uPe7O�ر�k��c�־/ɾ�~W����!.�@Y�' B�8��Ik�3O��;ǑP��d|�n�Gr&�!��ao�Z�f�A��Z�e�����[�G: 4:�erW@(�dC��$K�@�@�I�,�6�q3e���cL%I�� �E�R�$�Z�H,A�Z$jYҝ�K��R��L���O)�nj��Ю�Y�%�oT)�V�G��]#oIu�� ��ޅ�':H����JHr�"L��N�c�ɻ��*z�J!<���;_�������~�ß��n>�L}��� ���� CF!��ޗ�Z�eg�٬}��V�j�$u�_���A4J*D��4��! *&��� �"J��%*ؠ&`GB%�1v��1�J�{��{�9��}�{�S���֥Dj�}����k���וy�|�Q�jXe�Sn�&���lPk�U�JĶ��QLLYj������ەG�%Զʜ������nQ)<IcE�S,�G��V*�KAq��w�J�0s(�Kܴ�Ս,����� c�JGzN�>��Է�y�r��̥��]�[�<I��9<�n�Ș�>� 3��Z|�1�7b3xe(�~C�ߪ��ȉ��t���F� sԵ�j�V�M�^`έ�Vp6���|����r�Cs�b�+ �yZ�7����oc�Vj߷9@��jsR���"�� �*��>vC�[��F-(0�*4u獵��*�-ʋåڕ�_�h!�6-�LK)���P&�,���`�³N�o�I,$Cj��R����g�e�Ϸ������55W�Ѳ����&��k�;�J9I�k��:aX�:ݶ���Zp���'����� ��E�r�`ڭ��73����杨i���$�Z)7�&�8�V�&Y���3B�[�m��C���oz�?�~�o��wO�����G���*ɿ53y�����1�k[�) .��-��J)ۻt5�Ւ^hel�sI���1^��Bf1 �V�Fx%VasX�,{��>��K�[�f���zO�2��&e����&뒁U�&��9�kP�TQ�S��[G;�ݐk�^�ֱ�͡':n�X��,��S/�;pds�^�C`�XGa�2��1�Dwcs��˅fAg�tw.���2��<(*�O��6��2q��&θ�w�qA�����3o�s��N�uw^oh+�6���}����8�8`���k�0�����w��q��H�I�I��Q�->8<>� )}��;e�M�<y��r��;�o�4 �924���� �bÄ��AB�p*o�]�>��)r�h�N��.)��~]tG�S��K+3b*�e�ˑ��fs��T�b1S �� %��$��s���1c{ ωs>;ɲ�!_��:�x��)�&���r��*ȧ�%�*���+)Ak�2)d\TL5s�% q�-F�JHF��6d�W��� �7���"~Y�䶼�i�yz�n��n?�c_wz���֟�O~\ʯ ���҇��7.%�̤�;� ��&�{yy&�/~��]�mhnj��b��Z��*D<���eL+��!����Xv D��2M�8V F�buF 8]l���[ӆ%%w`j$pN���q3���ڷ��ڜӈp���UcJ59(F�`���,��4,~}/6��pJv�� (�5A�Y#p��-��(2P �h�y�h�B�s��Linl �S�r��u!Bh&#MM'+!ku4{7��Y��B�P�|9(�={m�u��Bb�mm2{հ��yk6g�Y�9��M��l9����j�`Xx�@d9���)Xn��\���ib��e֊�O�j�y�`��Ky���P�7�5�ΎL$����Y>?�����)�� �^|v�m��n�8�2Kj�y~����h������J�l�I� ��#�L�g;9ƃ �P��BE�(9҇L� =�2[��jF˖�xf~�%͞l�1e�!5�/���Z]OB��M�F�p����Ն���4�ۊ��mI�0`����l�� �*�����/-;�1{a��k���{��ܰ��ڊ���d'�]�W����I7��^#����}>�?��_��~�7}��~���/�_��7�����7 �"�9��2=H�J���yd�&��U]�:u��!s�{�?�*��;�,�R�T�,৶����՚3b��iT)'EJ�㈒aޜ�8W��� ��b�)Ihמ`I�E��.T&�i���� ���fW�q j���&w[���9-i��>�G�K�����V;�z5�j�.��Z ���i���`��)UƇ�ltȑ��X��Ť�m�籙��KUY�����;['�7����`!��hφ&��9jkxJ��1CS��ⱦl���KP/�^a�GC黟�z��U���ZYBKF�wT�w�}�O�xe�O4h�u����ؒv�.R�6�A1~뭚���]14�wR�fu?�x���q�;;g� h,`��-h 6��'O��Ӧ�bC�c5��brQ��DA�p`H1�7���2���d�0)9��N�o�� �&Pf�մ+����r\P�6���%�p��C���i�(�gJM��lk�X�J�Чܞ���5H�t�^2�f$ :n*i@�J�=�(�M�,�{=Iz\M�Ú��Zl$Tm9�_���_����]��?��|{��/�_��o��{χߟ&%^|�Jq2��hM��� ����m�$+\c�_��"Bd�@YM�e�<�Lh��mT�t�[[4����G*͉��i-��DAf��2Y���\b)���A\��9�/�<�u!ƞV�e8*6V��N6���S��Mވ�iF$�1|N�sL��u�M�f�2Ֆ�(5��nI;X�p�@����{�H"9��𭠡�pXr�"�[^��Sy�L� ��Ϧ����=�EH�r�L��� !���D��x?]r{����V���{�,���霧�-�:jC�k �~�[����<ʼ܉��a�]�ʨ�2<���j�f�_d�|9���%�m=H�\���eA�-���4'����Qh)V{u��<� 6kk����J�┳j�)i�l�P�ތ@���"�Yt�<.���.M6��õ"�VA�Rx[p�j��ܾo�RL-�sH�C����hþ�6FB��,6]۸7wq�nu���������q7�+�q$����� _vsRx�R��[�hDq��!�6Q`v�H��*)N�R�o]��q�|H�<Ϳ�KV�KBJ�㜈�����S�"����jC�Q�w5*�1"�Ԯq�9P��O9��������/��;������?�W��B�$B19��E�ssQ�y��Լk�VK^��)�W�����+�m6�O�V�r��m��s��@�n�E{���]���N� !�;������u�7�����?(Ev��nZ���) c��\K�^""gά�9�U@�D�q�K]��ր1*��7b�OY�8�XV���M�X�%R�(��MIJ �hi;F�q�U�d^�'��ÁD��jb��G�1�P�q�� c浗q��&,�� Zu����m5+Okq��lJ� T������h.�u��ڋZ���`:Yar�����{g>M�H1����ub��`��u �@�*(.� ;vCn �$<G�t�M�^3jQ�C=��HQ��Ѻ��=��κY� ۔�RP㐵��H� U���ZEfQc"=cE�/�;�f���hIrh�*n�Og�쵐� 8����Ũ6�Uk`.�v;��k��f)��ee�bĊBz����nskl�&:��Zk��ek���r�3�ȿjȍ�O''��E/JRe9b�ـ�^�؟'9b:Ѣe����c��iU.ǜc�~��Kk�����.�T�����-Cr�"��谫$�q�o5������sA�T2�&������p�|�RBp]9$=���:H�ȴ�x�?>��'�����#_�E��7�/<�9�|��|��s/��Ʊ���/Bv��Y��/)���W��^L��7疼T���ݒ)E�q��|�{6{��O/4�eZ:p�Œ}#�2����;���Bʷ �����bq��ڵpsZ���*A�p+�����Y�[G۩�1��9��덓�k������1�Ӧ�����cN.�~9�c�I�o�R����<�?��E3-�+;9�1p��$,4�Z��*��E�Z�zS�ʊl��#M�{�P�l��"��#���G?& �7�FEbۢ�'�2N��Q�p� ������uH��ڶq�b�i�l&�����G��~�j�jٍ�&^4��؎��^��$갰��� ��V�S�t)N_f�3��8������<��@S�����ݓҐ �E�3�d�z+�La��֍��ڰ��}��w��Vg3�As>{-�4|W�O@Mj����[c ��:�;g�i� bK��SJ����^`���K��P�����Kco�h�� Ј�`�-=��Y����ԃ�'D�t ���Ԓ��NҎv;_���{���T|�E�ۜ>���=(���8�y9��,���Ps��{1���jk9/L�<���~�mS�wvos]���$���*�/,8[�H.�M2�dE3�ࢇ�z' ���&�r�,��a�ݝ?L���}���x����_�/������ڟܶ�ss�����p��|r�֟z�@K9(����핪�����������Sʦ�X��㧩/T5��Z����^�[��-�6~D�pm"'�76�K�j H+������p�H,ZG��^Ҧri$Ԇ��Ա��8Y A�&ͥ���cn�h1�s0?��+f;�S�َL ?B�ڜ�4�(�,!�k�&tTi��A�'Wd��������p�!S��,�[5�g˻�WjA��1�;���^�KhUͼ�9�;C@7�%x�S��?Z;�W�0j��24 ���QbRS��)�K����A��꼮H z�ᛝ�L�G/WA7*k���U��؎L6`a(�F&^ s.�8*z�!�us�@��F)�l�`�49���U#��~RwA˧�T�)[6�Xz��Z��K9������㢦@�P���|l�վ{��~KZ9�2��n���W�"��ָ�5�sQ�{�ȤBg4�}5p�$��tr�C+PۘOmҋ�N��MU}��1p������9�-9焔b��3W-H�N�@&��j8�IG��i ��&m?�hn�{��ؕ`?�` �^=ܵ���rl�~�t̂*��Z��u(�6�#��V*����L��xjy��ٹ�Y�N��)�q�:��������7��_���|�^���x2�*��ɭ�+E�M/��� {)���)>�B������E �;�t ���j� �B�T��W~ �"2�b �7�i\� ��W���J1�Y˵G��ce!��� v����[��+�:ND/H0/d!�_�2Ht��:�҂���V�Mڲ���ϫH���R��ޞ!��ĞԺU�?��'�q���ͽ TJ���X��̧�x�i�g0}A���\�E��q�� k; Y=��hh��bP��BPit���8�L1�k�M� �9��G�5���V\2��WJ���eV����H���w�G�B�f��ge���Fn�ǥL�G�0VBT�!G9�m� ER� �T;Tӏs�h�y����w���!ѹ�K�&m\h!g}�}�I�i��=�(�v*�Si;�>Vp��&��� V؎{��m�`[*UZ/?��Q���{C�%KBy�i���K�&����emo����揮�8I䒔5�Dk�y��69�PZ��Ԇ����l����dnyfҘ@Мm�|��Ji��%�_�:C��F��IP��X�1��#�!��l�UP�^A:�) ������`(Gn�Tw��+ M�~�?J#Q\u-�� N��\�kp����W~�~��R^@�c����W^~��E��ϱ��%/�T����'B,n����m��&��;�Qx|g(+Sҡ�-hL��e�K9��-�Md��8���m�]�JÊ#oy.��8�=�$Է��8b'�����6��nLS4�����M&-��k'W�1�Av��Q,�� ��4��cڑ���\��U�k�e=0|k��j7/@��G|�q��i�H3:�����x`�r��ɇ��>�AA���6�m�y�IY� ���ax�zU��W-��e��U8Ɗs֙R��ʹ܀oV �yT2�6G!v�ԽIH9=��ms�|�FysF�,eBp���2��LJ��z蕁�:��E2!���`���sy�����n�[�Oȧ�ɭ�*�/��}:���d���|����%�{��v۟x�%�(R1�9�߃r��}�����B����<���Ӳ��wOFz�6��ϗ{x4��0���<�{e�t����=fb��y!�qqD�7>h����*�ŭ�V)�K�iӌ�������9m�`���\�\�%o��E���a���%�\a4�/��c�#z^�|p��%p^f��`�B�y�XtJ3��U�9c�z�-^F�N�61�ʰ��,�ʣ`�.|O��)������$jW��]6����n��I�rbr��/���_����߆�_���w-�ŷrE`��'fXv��9[�)�g�}�8���X�y$^��ͣ/h��q�%�@�T�:��%�뿵*~�q.Q�ꅠ[�C�M-u����4����ʞ�t1��2��"H�Օ�xˇ��Ѹ�à�s�1B�����O�j�sM��rT�}Q0��#u���` e�djI�j��/��z$��ڣk͢��([�w �3��{��Fr�N���T�Jn�hT�U$wMQ� ��C�̆d�,�Ť&�#-&oT��,ek�ۉuo}�}�4q"�ZF�W�j���[4tj��8�$tQE�hͧby��&�b7�r �.��V{+5�Y�l�wTPk&�ǥ��f��$��l�{�w�z�w��� ����6/���y����'�}��x�� oTo����n0�8���]�q�(��d����mL-�EV��:jj0��FI��/ 1��y;x�<7�>Ƭ>�&l�2�m.d�Z�a�y�"ڜ�h��.P� �u����Э�A�!�:n�Z��x�(@�+(^��Eӱ!��_�X��$�C>s���̦F���#��Ø�7�K�B��6�`�r�Y�����{c-ڤ��*�!E,W-B�"^w�iݓs�C��_}�~�~�o���8�MTy�VB[{�<��N9��=��-^u��T�E���'����������pc֮��y�'���[\���U���C`�\f���&=� .�f�rPX�X�����Pc�8�4/3�N�pW����ڛb/6�<��c�q��ͥ��D+r�y����.�Tr�zk��3c�����p<���E��A�0�G�v��]�q�ZAr��9HP��Ђ�ؠ;�_wP<-�:�]��\����M����F�k �!z��<H���}o���6��H�H �Lꁠ�� �U�i�9FH�����3����.����#q(��@ZJ\�bC�M}G�R�J�!�P�R�X_��0�^�d&�d�|��� �~<8]�&�Lq�{��Kێ<7}Pc��r8�����R�9�%F���f�o�zw����5v��L�r��_��>9��^�Ǹ�4U3����w����`lC9\�}�/o�a�_��3��[M���n�{���=_�ND�ƥ9Ȕcvl�p�cP(P��:�LP�3s��lD�<`C%%�1G7a$���F=]q�k�a��L\�se^0US�)Z���2+# �fW�*�K�A�jxN˂Lk�Y��d�� �-�a�&B���^���C�"�N-��#g� �+�Nq�}��$֨zߦ�H�@��KMk�Ɨ9X_U���L���uܟ�{?�>&������W� �U��O�B�E�Y��~�+tisO��-Ӥ�?o�a=�m��**������$:X���0/Hl�P�(1��!N<J����-Nki�c���m]��*�Vg�d���Ze��3�g.�a ����M=+�/&EP+�]m�>@�[�+���N�=�%��FX,�=�j.Wޮtxq�8�|Ʒմ*�6��Y�I��.�B����l�EŨd8�P�N}�]��� ��N=����c8E���Z�:"���n.4j%�FZ�������>2� ;�~�Ȫ��~Rn�]��{�h�r;3�:F f� ¢�>X���o� �$]����O��9����N�TE��u�a��,�c��O'�O�;*B�w�o�M �wО�|�1F�,��7T��N���!�>���2���.G�:��0�u8�^��N���ھKj�J�T>�A� q1��<���@a^=D����sw k^��GF�Hkm$*�k����f�L�4S�Jc��K;K،�i��d��2�(�P6 wH�F�]T���h1��srw �<�rl�Q�0��d��lf(KbH�����hCR�q���v�<��4�J'�c��s�HhZ���+,2��|ⵏ|ŗ���$.~~4��>�A[q�re]O}6�������K8���z�ڭͳH���-J�����M�d�[ �V�k��I\{)�R�Y��/wCR��6q��%�+��~|��òk4��C2`1�2�ç�5�ø� LƗWz���m�N�ty�� %�o���T��_�����+i�&"��ӹ��kt�s���V`�gGPAe����nZ %�@L��ԧ�g��X�s �X��7Q_L?8�q�IP�R��ay��] o��`K�V�� =�D��mf��xNy�qٶ�6f�MM�ƪ�ȶ�`��XrH\!� ��YʼnI�_�G�l]EP?��^�0�������۴x�1q�T��6�q�©b?�՞�0�c�{u��)��G�zcMOH4���%���e��A� x���5�ab�܋�%H� ��AIOa��3�B��'��XB��%�T��EV�� l]�{Y*Y���ձ��Ul�U���3��b��@*# �軖$��K&4�t�$c'��@� �*�4̣�l��a�\�Ei�l�����0��ܑD�Y���3I�L_�,G�)��&��K���/���?����?}�/��{�s�T>"Ӳ�З��O���3�nK��M�g��9�j����^$[9���%�B�/��gf: �g�╅�����/$G��=ޟ�J��k�m�/�;�[���GI0�3S�{��G���F��.�9ߵY�+�ce߈�c}%� �F�s��HTZQ��i�scy������(mz��w{��'��҅I��(�X-� � ���5�0hq����S��9v�(�Z��.�ŲjYD�P�:U3H�Űw��� |q�G�ZK�x�h7(� Z�n�E�2c,W3H��p`� ��W�D�FF�q�^��:*9�ѫ�����:p�R��:0\���S��Z?�V^��PzHW��5J�Aq��;#j��yC/˯��3 �Y`Oc`�*�Ƭ���3��$�0�V��&�-��!���Q����X��BRZ���\o��|*S����=N6WC��4��Œ�sƏ ��-,@˗���jB�4���Q�fa��O���nKNeFO�آT%������ͬ�Ug�$"Fb^I�큌.�$#V���� ��"���\��eE+�Q}4�_���O��տ��~���?�����/}�}z�t�� z�T4n��\�l�#�b.�,Iq�ڈ-� �&����z��gf����8�a�JgZ�S`K�/��RY�E��F�a.�A)P��^�7�1� �Z���ZȂ/z�M�r1���0�F8�n!k�&r�w�^F(��ٺ��V��&�t��L���xz���s�4����[���s��]��}��Ϸy��gD�5l�d��"+�~�vCf&�U�/���:��HxM��RES�c���2g��q6H��r����P���2. x"�)��F��$�QH/kA �y��N{3�4FX��xBE:ȋ!�S@�X�<�eD��J�l����Q�*�xP��͘��7伟j�A%�(��L��]��K9�r�O ��O�C�K��2�՛�¥�amVj�7:M�u�hq�sF���쎗�-㊈�-�-8�\?�7W���+t焥(��i�zA���\b���k2�5�Ih��SH ��/A��N�e�RЭ�+��&�b�Y3adr#ı�d���U-.8���3"�EL����ui�p�����}S�k�P�� �bTm/�_s�o��l !�G�iD�Y�IO6]Ypsm�}�ި�U�O���G��S"�o��?�ӿ�;����<��qZ�n��Q��p �)j����Rlp8rN�mml�X���VZȾ�g];{�64բ!dc[�7���t�K�Ǡ�Q�2���t<x%f3kkZRh�!'Z�j���B��aIFO 3�� �Qx��Nj����Ѽ��*��cbop|��sЬq���q6f��K�'�v��E;�ui��?�]�R �F�au��7��:�x\�|:a�v慯k*� �Nٱ���7A�BD�+`K��=��N��q��̘��?.!���nH��ﯲ�M���,�N�@�˱�mW�m7פ�Yd*Uk��/DN|�Si�JN,A�'��[�x�� Zg�*��v�!1`�<u��� ���z3�[kE���Ѭ����q��@ ���E�kl[�H������,�)�M�b�&#hA~�~�t�퍼iJn�7hraД����I��2��$�"��e~�4b�+���bN[*�Q���`�ݗ2�u�g33لZ�!J�N~T����5����#�p%O�]��3���Dg�$7!���V��Q���\��`�7��g��;�4r@yXqƛ�a�d cjn8�yU�]�jdҩ����u�7��^������o���/�q�ڸH��J�S2]�?=�)�(e?0��,�����x���߸�xC�-���:�*]S��9��"�;���lC�z��&$;� MP���t��wk1�����#{�Z7�so�yԌ$��iƎ�ؠ��D�5���t�(̸N�����h}f�WWڽշ`'J=�OD�E��Iѽ�'_�uڦޘ�4X4���Y��O�+��rS��k3�|\+�@�b]/�NA:���r��p�e�=��z���O�[�nS�1Ș�2��[o�*���#�Z�F�<����D�un_�MD�q��"�]�V7�2M�]f[*�P��U��6��f=�O�Д#X�yD7Ʉ���v,H"�;�w6�C�{���%��Ÿ�b�jo���jCɚ���.%7�>��jj�M�4ժ��d��lj[�h լeь��!L��IR��j�nb(w�����aK��+�Z2�w��O�l�9TW>|���p�LTE�E�`��L�ԷX�����b�'=4�e.ƚ�`'�=A�e>٤�5e�d���-��>��O~�W|���?��/���}�}�|��Ը�a~$2���(����7 2f醋M���df��5�|��Fnx���-��9U���T���0#Z]�<�.y�����b�Fxq��Xe����O����dq�dD%���)HbS�1�����ʰ5TL�K��(NM��LJ�v���tZN��`�je6�zDk@�B���\�~c�\�,G��\j�D��~x$�]��͟1U��#���p 9�`��U��g�X�i���unEu��B�:)��{����{uFtL�o����6�s��eNIP5�GF�b��Uq��ɝ�K(��5�2�*�)�am�Zwurc`������!Xz��8�،�=YZ�WZ䗈��;�������$��4�G$�F��E���� q��ؖ�iL������� Y�{�p��P\��Ґ�7�w#ԕ�ށ*�4S���;2�g��er���>�Ѓh�t��$!$���9�U��n������M�W�>=�� �;<�;kFV�@�`�VZ�֖���P$H ���"��b�?�U��;�O/��w���n�)xH_5>$)}���0\6k��4U�j�f�Ur!�'~���/�ѿ��_����[��?��b��'C�y��4�&J���Ow���M?jh7�Y�\I�g�<��G�'��|��Q�6��u8�xǸ0�+����Q��g6�Fb^@�ۘ��L����fy�`"�l��a-�n��<J���6� �q���IbO�5���R�� e��[��~��aj�?m�gA[�)M@-֙�z����%�պ�T�!���4�tO�yC�{��H?�ZZ ʼ�x>�V��6˺j�})� ���>y~{"��*�p��,���0��́��w�� ��řACa^�i�o�m&QfF\ԦA���(p��$ɵ�n��۱f-���fm�3�`��8R�f<�@k6����/�� ��0,�ۚ�)���'_^IhZ�-m��������������BMY��ߏ�`Ů,)N�@T)�RE�sZSVqֹ��s q�$���]���q�Od�t�#�d��qY5r��&$����J��L;���}�&M_�,��R��-q*#�7l��j��P��Ũ����nX�l�S⭳����_���*�ZG��5'ړ�jk%�3�aI,R�b,��K�_���?��9�� ���W_���Sw�ç���V,��Nw���`m�{`DR�hЈ�l�D�BF�]�JɅB������\����MHuJ���5_��Dp��K�TfS�T4T�c�q�B$�����!��J���Pխ� H'0'Q��3���1̶�c�8������Ơ�]4���LE��mR��K���N|rk۱i-[Ljd�˴{;�$iO�\���Fc�iĪnIg������mx�q���������% �nR�!�j��EҤq��x�6�Y�*��zC)�TAܶ�ί�xuӎO2êr�������;Y��b�6�g�{�C)��E"��G5r��7|�U{C��q���e�z9�L� Dq�G� ��`�'j�S]-lȆK��K�A�P��Cy�`23���(���Y3] ��q��. k��#\�U«���({��\A���q!S�Lȧdr�X�#Yj}Y����1�� !�U�`��f) W�� `�èQ��4���Bz�.�v4��T�:.gC"�G�_�zUf�>�)���?A>x��N�sa筫��Ze�G�z�@I����{��\X:Aa��7���ڋ�<����Oq��J�Q�mAj����=�({��u���>����÷��|��xD�}o{��t�オ�|B�S�;!Y�u�(魓�]Y�� t��w�)�J���PX#�v��}�ژ�7@�/3n*#n�8P;h���n�~#��9�A;�a�rКc�k�a�8��l�|�=�=�(d�co���i�1��h(9���[��&�K`�.��b����n m���iJ+�ϊ���,�L]��" �L���o�R->=�́O,�3�Wc�4��L�gU�1����0�<�'K��ĥ`(4�K�|k˽J~#�(�iz@���7@7s�ĕ�}�DI�]$�3'6���T�#�����a�>��R~5�=˲-�A�%�c����\|v�-�����T���^bw,Q��Q�RqTL_5�#A�(Z���^�7Y�Uݪ�*�r�LUu��qWH���+�wA/�-� z>�Q*��D�B���ifVJ�ף����ߊ�kUԑ֣��hc�Z�ល�rV~�W�%f�霭|n�'��]S�=�0jx:�|Ş]������Uk�J�z�?�u�^������z�U��;�����#�&�)n���\��oaâ K6�uf^�JU^�j{p��c(���"��6~v �����[1�JF?�G�p�D�g4�/�9͏n��耏���z�(�>����$�,2��*6�x �v�0���_��d�V����6i����4��x:�g%&�mnnu�$��n* G�u��ʁ֒�X��kL�l�uv�f�*F��Z�P>$E���ǫ��@W���\�/P12�|�"�Y��ae穗M�u�z��{�V���mߺ <�l+��C�N;|�z�g�KFWT�`9R��d�YZ˚w&G�52�A�]��&W��C��CxE���g�BE�<��D� n%��dH�Lܗ�J"�L��G,�e�;��Q�l��V�D ѣ�B>�}xo�Z�Rxo4l: ��I��V������3�� ��ǣ#<��W収����no�W���t<nQ�k�M҃ǜ���l\��>���Mf��4��rk�ڋW��tp���]mM4���(t]�H��Nd�L��c���C��ޜ*�C�&�<��c0�v��M���m���j���)Ԁ��gv��w�6�P��|qTy0c|��st.���S��ʃX`�t��H~����cD��m�F}����T���u T��q�m�'�z{�Ya��¿���|{k��$O�6���Lr��q�ߺ���c�&��,!J=�@� PP'���t�I |F-P�B)�a�݅�~�+xjp��-�sP�I� ̀W���V�"7�o�S�z �ÂMJ�̖:6�o��v(\Mw�4$��t��^fe�ܒ�<��A�d���(�1.�t#�b,�]��Ԉ�ܺ,�qJ&N���蛫��G��Ʈǩ��ݗ�ǒ�G��6��wcD�R�磉�����k�mɁ&���Nl7bꆠ\�0���m=ZR˃�Hx�T�S�XB�[��u�w�� ��w&ٷC�g��yp3�6+{�<�r9p��ޜ��� i;?ht��K%��E� ��*���C�N��v��x�!�"]t�`�N�`�g�Kw�U����!� ��"W{!g�i�����t�y�v�I��vώ���8]OZ_z�Ѡ�~��H�4��gޑ�?��`�yj-(W��c�uH�q�x��z�i��k�r�G9��h>�5��x�VF.q��5� �v�M�Z/C1�'��SXe~(���K9�Fޘ��a3c�b�l�7v��;a��n ��1H!ᗖxA<�y�;��X��"��t�@s> 87�;����ݿ �ID�-���&ʊ��I6��Uf�x�oկ[�_�n8~Y*��% ��(+�Z�'Ȑ+;�ai[���f�������;[@8��A���ɬ�P�y�RQ^���MH�i_`�<-��6(��N`�~�®3�<����o}���o�G�����D��dKL]y~ee��p�=����+���%Ƙ�ʼn��nQ�Hbd#"�fGP�4b=��6y����� Ln�iN�l��.�C�gyM�ݩ ��5�~d��:M��R@�bx˃Śr�I�UϽ��"�Ϗ�G� ��.���;e���C��k(�M�I� U9 ����H@��M�!�Dq g̷���3/�4Nڝ��V_t.W=S��uI|�-B�Rde#��,�O� �k���:MI�T�+fy}��ɴ�r��6$������M�17ͮf+W�~��~l*��c�t��j%��\��^h��C��<&�?;�H���'�|.�~�0��ɇQՅ`�OJ��q�<)3�,��!<��%|�ǂ:"�f��cD�d�`��$Ѵ�d ֛|G�^��1-Q���M�F*�&o>�n@�P�#�G�;!�Z2Jn�n��+e������H���h$�1Qы�<����Ώ;�=�����*����Ӟ�%��4���W��Q/4���M��U�1:�<X��/B��6<Nh ��&�f�s�s</�"����S�W�.����SW{��[T�I�½/++���n��D��'�1�y:�:9��,�U�N�ׄt,�f4��@,=����1��U��#UI�`:$��[܍�G�"�*5-�H�ق��|J���Q���=9�aGnu*��w����,�B+��Е�s*H�p�~AN��Q�5*AA��'�(��Q�Š��e8 u��ù�����E������X�2�E��mH�C�`�O�?_�0A�}.��`�7��8=��R�]��?*d�mA1_�VQ�!9eO�5k��b3�s�'��<6����sd2��e; �YY�kx��D�c{�-lյ*���TaT�MT&S���YJ���Np�>ƚt�s\���"��**/��i$��̑��v"}H��}��5�� r��U�~� T���J�0B�D�r������i�dMU��8ᛚ�Ď�������WX��������m�iP�H���ݠ�1e: 1�Fu��ƫ���~�wtE�k���ϗ�։�`y_��Ą�T�797�+���OD%L�XmG��<6j3u-���tMժḋ�>nXI�XM��$+���l<��/ج����tOU� a��3��,�y�}"W����@��s�B������muL �V]_ ½��_Wwt@�_����X�����m#��q�.WL�9� g!k&.!=D�&w�vr(�����Ț+�hY���q�0�`eN�ʐJXc�3p�'l������,�:=���A��ǒY(%nd?�� ���d�qh�2$�,�//�Ρ1�+�H�N�l;��>�/G�iAkv��]�a�j\.�F�m�&���]���ܛn<z]\!��U긝�|j��E���f��������Xj_�\�����E���������9f�Q�j71���o�ؤug2nW�n1� ��ܸ�8ʄ[��]�x�ҟ*��3e(S�6�7���4>�(���lg��'�V����hW�� ABJ 2Z`�^��e��=J����{�o-S��{��*�?��+�^���2������2;R�ϰ���>x�K+��c��z��KWu���g��c��V���g1c6�s�4;��R�t-�yw7Wu�>9�d����i?��}�,5�zt��|.�Jp����[��bgIs��$S�0���)c�9���a{|��".�̤ ��+!� ��Xk}Q�/EFhT2d&\�r�[�q�Y���ݍZM����r;#�w��I+BQ�h4a�/�wǯM���}�%��e!��۳^m=L����֪_D������W����@�^�ƝZ&�1��FsbKso*f����'�?�}}�so!I��ײ��v��C��}ѓ��]p[�Д$u��e�ND�6)�Q�E'E��\p�w���4��F$ ��QXc �F�����| 7uO���_٧�f������?��3���X'W7��8��^���1��3�=�Yf�9Eds�- D����m ���g��f�c���R@Oz>�˜Aﺬ��Fo��?K^H|.�C�p`p{��t��G�oiaײf�y]n�R��WW��)����r�B�h��Y���V����,�]���L5�b� ����D�n�iA��k���,��$N����<N��7�#���Wc��h�%�p��m��s���O���"��%��bص0�V�����U��MߓU�z:�z�W�[� ��c���(��̔�w�f�u����ai\�$��Sa�0r���EvJ6s�N��z7��p;I�v�K^"�8DH�i�E�@�͈ϊ\KȿF�����O�l���@�.(t��@�\I�)zZO��lڲ�}g?KgN�B��L봍q^�\DE�!5�q�3^�w/�z� ���k^��i�'W/����lծJ;��*�. &��� WuC������V�|�'k�gC�� A:�ɴ��R�0�0�F�������;�[��b*"A.S��К��Alʿ�͂�s8�ڶ\=F3w���x�{�������\�/�&�)&+T{?Y�V)z�U��b�.ڦ�d��0zzAD[���.�fhèӜ"�G�=6���?P��+$O靳u^@2��'�<����>�]Y�c��g�)����O��#��ʦ�J���ʅ��AQ����j�0�,�����崐�ӄ����fI��b�J��@U1z_�7�E�,��J6l�*��t zRi���n�6�V}�6�JR�Z��2/8�a�C�r���/�!m����%/Y�q"r���3��y��f��N��4G�ʂ�P��?k�� k@�zZ����Tdз������7c�V�X��H^%{6TY�'/�<I�Vb�јU�Ο�Y >�SOw����Po�w�8g4[�:QR�:uPq���v��ǽ �nl�x?��l(�OZ�bO�</n=,{hG��\�V~x�x��=e7eQtm�C��R�b�Z��A]���T�Z����;��Śg!��4���G������� �gǸ�؈9��_sÃ�RY��qA��G��Rc��у����8`�Q܉݊8��(lG�i���F��h4�u��(0����b%���˯�����2�g�:BFΛC �&�Y!���f�Lw���9 D�6!��YN(j�A��х�[�D�_C� �Ϥ&w3��j�(�Q�f�L�=�9v&6U��{�o�@Iⶉf�X����fOZ�ƖBo^�%_��]�! s�����V�p���&*�1��S[yB�u^�%�R��ة}� [�h�'��1��ē�"�Q���զ�#�N�|� e+֦h���2��LL�4�."��L6�Ǻ�,/�f�!"8ؒ;���e���1����Y1,bC�����}���7��R�p�}#U�ݵX�c�+1�~�1_�Y���m�d�����nˊ�~iŘ�ɕe��wW.��|�y�/;���f��y_�B%v�q:Q��b��1�?�ㅷ�K3y��ʆ�TR��X,�Ii:Yiʀu�0 Юc�B���ф�zZ����|?�[x����眇vxaH�8��Nw�� t0yS{��Z(����bC>�Xv,�aR x'����]��ln�(YΏ�z0��̯ʱ+W��ELyQ.�R>a~�b��h^YY��Y�o0>&�m���iD������y����PR<n�P���ʴ��+�� �|��:��c��[�g��l�Ab%Va���G,��y�У�r�䇰��8uO�SA���rÙ)�VҤf��;�& ��Rr:vi�A��_[��[�]��*2yd����(��R��g���f�j�����E��@4��̤�|2�����ϖWK`D���sOU��'��x�hO���ZDL|��Ͷ��ί��+����M�!������@���>�"SƘ��]-(�z��P<���#�6 ��b�Y�WЙ����h$��1Vd(���UU�������ռt���az;a��j2��_*l`@ ���@g�}��'�]��C�;ѿh?ħ&��ɽ����m"�at�XQn��=c��r����������]���+�����s6���۠���?:]2���:���d�\�� _~5E �D�(�p�ox��l�n�춳�v�|j-1=d?�4�3�������ʣ��p��B�@$ED3�������Dk>Wk�O�$e����_�����`2��e�-,u?�-�� �rk�ay2�řO/�Ɖh!�k��;[s���X���{���Gg�>�����|���f����3�u����y���h��7vc�EZ����Ж���������u�%���J�S5A�7�~O�6b�Ţ'͙nWOd*�㛩y�ޖB7�?W?1�v�,[������2��1S��ͥ���ζ6���tҠ.�lu��������N������YK���Ï[G<.��@�;�⩗C��zo-�C�7�q�0�q�����P�,("��h<�(�6���hċ-��Xt(8xU�%P�"�3��Z�~��h�aP�@ok�.�̭�QY�������h�9���XM���> Y*�� 6���E�s��L�y���3K�&c�is �}&���'=6w\`�H��w�t"'/���&�nK$ce�|��\cԮ���N��@�����s8������a���)I��(��_ػ��&�0�O��HP -g� ����"u�1�M��#���e��X���L�MouY�3s0�*��9�h@�A���E�ǯ����߷�`�]y����x�O���˄d��L�9�El�z�����+�KL#����S���熿?�E���4�H���f�K*��KR&ɥ���V�� �:#a��RIdtlRrB��l4�|�L" �'%$+x��$I �f����4m���blh�qϠ�$�H����a2YfH�No����!�q��I!R�$Ba�Wd�B���l�Z��3�{��i����ʋ��˖��/���j��&R�� ���h�+[��7_�|d�������/"T��M}wUpmy����и�av�m�gO6hzY�~�U�ik�������:ALlHtrʦ5�'Nd�&{2�C���!� ��7e,ӔWNX�K�?@!�O�5�B���B?c@!�0�B!��Ba#�B!���t���=v�|a�,Gζ����EL��1�X��ڇ���iQis�њ��#V]u�-�����:� ���{�uِ��4_�pP�Ś�'֡��=���k�/j�����μ�u� Zn�]�%�B�uێ3o��Dy�wi ��䯝wNps��Y��|d�k��o�?�0e%�G[�>Ɍ�N�sdA��q��g�Q�\��������~ꢁ�t�nô��n�/��̔��U�����]�'֥)2�݇���b�F!��{��]��{�8��QZ4h���W���T[��d�Z�]6N��¦�4&�͖�^uXs��Hm��F/�QQ��m"\��{K�9�����+=|�P�{͊���ʏO}z�8_��wJU�p1�#�Bsz���y�����lh���O�^�;x/���w�<�� ,�è3�Nw�V ��r8���Ҥ���~&����hwߗg��_�j 6�32Tn�Q�-/�^&!�;ď���<����-d��2�����0د�;�������9�)����,�j���/Č3U5Z�P�6m�c��(��8��0�+�e�]T�}�I\m=��5��!�B!fκ�����Ms���V��Y�t7x�xO������*�X��d��J�GY�()�Y4�J%��Ƚ�}�����D3<�K�ÅL gȑ)E;G�uZ�pK�4��?'l4e�1Rޫ��͖� �O��\�p�0�t�^�_rs��`��Q0 F��[wj��wz�����X��\��S͋�5o���?|���x�#ξ��y�Q�C���.8��=v�Jۢ���N6�<����{�����߯�v߸���۬uN��q�փy���GW.ެ�y�~م?�?z *�Q0 F�(�`�2{w��@CQ�[ea�� ��Z�`�_���@�@�``�~c��:�$� ]��w��������{�u�tw�9������;��=��C��s5�n�}���[uo�@E/�VMc�6*�h|*Dl�{!�G�EM"�(�y��@h����[U�ns���_��9_�}���/�0��5��c��o���X�9�����}��ag���Oa(F5W���c'N���}v�<�l�I)VdFd� V��fW��(�T'��<�;�}�lʲʎ���"�2z�cu���7l�Q�c8 �P�Vʹ�3I!��Z-��9-����7�6��p�����E;O�J�:WԄ���+���w-AO�=2Y٠y�|��A�t�S��?vgV�Ǿ��f3������G6w�y>=�����kn:w�h}��n�w~��G=N$�綏,�hV��g�C����< r�"κ�QeSum��eXUe��E_]�����n��ć��sn|F�8]���ʹ�(v�6��Q]��9V�����R��߯�(�O�$x���a������4�௱����Mo{���u�sp��^��H�#y����q�.��2���m �6 $��ءO;(� ��W#���cn����w��}�_m,0�?A{����$�����dc�����> @:��1�%p�!`L�7r��_��-u�\���;�i����s?祐���=�.��[�;E�m���V�G��a����p8w�c�_��F�i`%0�. 0��}1����q��w�&ԊU�&����(� (#_�50�oZ���s���x�4�C}�7M�����Ғ���ɓ��A�*^Y=�����@Tn��/�Ek � '��v���gMq�H��l��na���B��v%�`*�B�mr4�`:�oL�g�{?��I�L�9��<;�+cjE��))��}�em\�G�Ʋ���$A�o��NCUն���5�$!6$9�/}�w��6GN\k\3�7�՚��㨧1]Yb=sõ7������x������̳������b�O���"ƙŔ}��z�;��q]7��w����F����K�}L�-�=e�� #C1��ڈ 7�Ȯ�Xx�{�8<r�6�� N�2l��Qu��K=�wL�%L��n.9�ˬ"��bx� -"��----Yc hw{g{�J ���db۷�y�B �(l�D! �PL�rm5/����b��z<Y�*���J �b�Ґ����+[/,f�Q���b�!����,�%�{���+�_�O ��6�������"t`S�����BcO*�Q��>�)� ��sWUA�R������"�|��W���'�����ܰڜlf�3���>PS�X&��A@b$��j�e)D � x�ؓըΒ�s�T(3����GSu�X��V'�~|�q�=�9 g��ظ`M?$֗�4j������Q����%�~6Od�1I� 绐,x\�Y4jb��h`��Q3�K;I5�ZkD1��W�`gKk�`NM�lF�����mZ��e�SVU3� �4e�s����ܧA�dQb���U�P��UhE�� +8f }�}�va9N�glҕ�����\�w��3��'<_�/o�;�J�:E�@b������zQ�50$Pa$���:fV��ɬ�9Q�jQH4D�2Y��T���˒�W��Uo�][O�3o\��v��A̹�)�/�jԴ�������ar iiiii)�t�{��[�B �Z��hu2�]q��3�`��0���a���0��a�<ِ]�Ϙm��w�]���+�� ��ڙ�8D)@��-excO�՚�L4�=%�=it&Z����j���&Q%"k�)�H&X��l��a��[]�,��Ii�a/6�Swx�@rM�Wv�ݚhH�4v�Az�DہD�R� 2��#G ���#m�*�u&gÚ4��2�H�Pll�~����p�d누t��_Z�-0P��Z��8��6�xygޚ��Y�asxiiii� 6#�C��rN�tn\�[/]~��2�Z&��:Z�����-�W���mI�+�h� ��6� !���Yc�]O�C���ӧ�?������nG�[m�q����]��,�>#B��Q���f,��^��u\�0NY�Ţ;�LV��V��l։b�1Ψ3���Yv��؝���:���XkT�@ r"����e�GMm���vA����DA��]];kR@NMS5���9UNd��ܾ�����ʺ��3�����۔��)�����[A��(>xiiiiITX� �RS7 �0?���kR86��K�LŸag!��`C�(�!4�벬��q?��0\{��5�6<�8�* �&Dɕ����ց9��E�<��h'k��Ք�#��'A<+I!�*��#G�M]�/��D]+L�8�;����W�ʣ�F�.�t���.ژ��_�����"��B��Ms�̵k� ��� 2!�a) �6tK H/)dѬjlk�����A��,Of��m[��x��W�'�W�Z�-��uFHۡW��O^ZZZZJ1�3rT���x\W�di�s�TDF�ٺD As֬�� 0:�8��<�hKw��S�v�O?q��1�CT���5nR������+�{{"�ZCW��F��1&���ZA��d��-dE(�"fQ���K��b��U^t}�&�6&V7�r$�B�� O�]`?%+h��m��ک�\9:���/ ��1�����QT4eI�$���.�6��aB]8��M�G���<���+tm m�|���w�7�����J�KvU6+�� ���n�*[g���������A �hV��G7��� bKHY�#��AŐ-<ΐ������pַq}u�1�>^��������DQVU0֫�B��Q������h���[M��ˢ� d��M�C��'(�4%1s��ö*(��6 �1��Q!YJg+[�X���uK���n �VA~>��b?E2�ͫ������zR%Szl_x���xG�/�[Z�&���{c��#RV@��Y�f\���VC���?h AuŸ�U]̧- g�eF��I%K��ˉ�C�q(��Z���0�/----�������t�h}}��.D�����4#����vv��(�g�@��� �?v�]�f���t��vD3�3�s>\�~�)��jI��i� ����� ��!3QQ8km�����Pʒ�q2j�#�;����i"D�T[4c)�$�&��)�Xe�2��I=��Cp����x�ZSt�`o=��ԣs�B�b�[G+�0�q�G����[���Φ��>mfݛ��ZkuE��!?�2 1�0S�����Es�ɑ�k_��*B�#�VC�-�`)��u�b�3X��.A/I��\:?�d�ry�=w�+� ����'�+>%����Hj�'O�Q7���l>W��FQahΒ��uC���X��2��+A�Ȱ��n6ox���QĄ��胀�뺶7� �U��,B`gL���5&e�1�Ţ����9GI���$�� �MJ������=[x�"��v6��ʤ�Mц3��܌��,<qc]�r��@ʗ�0�}�cʩ�e[�-ohV�U�g&k�u���)�C�C��co����|�!��z�I�lYL�\x/!Z� Z*��j�)�m���B�����S�$>�b�%�l�F�����y ii���[����o��w?�'>��+�{�z�����+�SbiiI�������m!�(���)����,�#�f*y�!�y���@�!K��c˵�C?tm���s.��XBV�)e�A� bgaLB�eVa� ��M_�^��u�)��� u�� ;Ĩ�$�DS���A��.Jg-E� ��y�BL�Ǜ������cGfm���m���l��1Y�[�9���֥�;���}��WME�|mdDC;{�|��Ss���8[՛u�b�%ǝ�yTi�FP�+�}�<vǎ7�R�C����kHKd�m4cG����)��؊�_ɸc��#|J,--`��ŋ�غ�l� f2�`Am}� �,�4s��0�b� Vf@Sop��Q����iV"eg��9Kg,��NY�TU�1D���� ��.uLlH8�uW��QN!EFƬ����J���q�.��� �p���1����o6Ν<V�oL%�,yH(�=�;5r��n6s�ם:~��ICX�E� k��f��w��S .z�daJ���K�s��3'��u�jm�z�:ݎ�@!E�L�����20-���}�y�q��k�B���3��'�g����zӽ�J?����?���~��`���}�O��G~����y�3�O���{����s_�o���عt�?�'�i�ৎ}�/��[ 0�Siii��,�hÕ�C6��j��$EV@��P��J`"[�E���Z�^��0f�]���gF!AR�����\t���0����UU��ƚ������EP<�9��e��5lMI��ʪꆾ�z��8bÔFU�R�h�>��������7n����#p����$�~���uqgL��N���+֮ 0ZI{�S�ё�����}�Mc��aE���` PcL�q���MQ��潤ba � E��9��8�:-���=h7 ����9��b���PU�bIU�?��W��_�O�?�U��>1.տ��PU<<��Z�~��W|��o���x��#�W����������;������'n��?��_�ݼ��>g���<����{�?c�~����d��5��Љg?�g��Ӿ�&��{p�0>�����(�!L���i�=1�������ό�Ҳ#���Х�⢪�� �8 I�!���0��d���Y�Us�����"�@�)g!B�E��aS�Ր�,���f ��-si�`�����S� CO%t�Nct S�r)���-bJ�\�G���<��5OZ;AC��.�X0_�ڿ�MM�nn�������X�mYѩ�Y��R�we���vWljv�i�6I,}��b�9^U�������X�,��(���x3/L7����!o�ЖV��5K��>��o�������5��oo�{?[k�7E����G�h�������;���Z�ϲ��������;���@d���}��w��ÐjU�{>p���s��/xܯ��߹�u�_~���=_�]_p�w����o���Ko�c�rg����o����'>��'O�<�/���/���=z�ܗ`,����>�z�]���w�LȀ!|j---�@U��gI�{�&J`$� ����c�T��2v�Ec�I@�TAVԖK6eaU�;[��6sb�+�Ą>@DE D��@]�Yu� �uB8����P�̄rT�aQ �зmL9+�jcs#As^�KDH�6�m�S���!H�u���䑣gV�6�4C2�'g�,��T'�kls��r���}߶m�KD�{�L�ɺiݚ��e���e��Dq遾�s��H5��S?Ǝ��F�\[�cu3��Q�A) DH��*��jaY�����'�����o��ɗ�������k^��糮30�qHb]aW]�d.��0dW����M����?��F�R""\e��~�7_�����o<62����0L�-�\_�k��y�ۿ�iO?�_��_����̧>ʒ����w�}p1�GoPΰ!�|��x��F�gW���>���W=����n�ye}c�.к�����t�,�DQ�>�×��mo��}㋞��/;��W�o����6�SciiI��8_�E��w�8_$�a�l�9X�����QQ�m6�t��˥'HRRXBS�ͼ�4�l ��,�|���Y�R:����d����]LX�l�M�0y�m��b9�(�, ��]��Mc��9�:�IQ�En�vm� �R����fܦY?���W\S��p�νK>���%��Ǐ��]���"���4l)V�n�,7��@�==��yC�xH㲰���ԅc��HBd-��C�|�8CT!�r�@ �Y[8�+���!��t�C;�|�N���y�km�#�>�א �Ϳ�ӟ���V`@m}����{��勾���j����-���?���W��o��?�뮹sn����{���?x�{����]w�y��xȮmn6����W~������M��9_������_��?�|Q���]�|�k�����������{�u39r�Hm�����zѷ���~��;�h���1U<<\��o���{�����{><�8������c�|��~^�3���˯���F��w�q��{��u�=�7]��<�!��b��Y֙a8�o���?��g���[?~ၡ�r�U����2��XZZ�)G DLD����lQyrVE�La�a2��HI5j�C8�!au2���Y$+�'_�D)����7���A+{��h��(�#fA�9��� mJXC��<�8&5F`�L�0����"Dʑ5� e�`1_L��vm4)�}&C\��2:�ϝ���k��ʕ/V�W����=[�g!o�Oޜ~č�Ξ��R���`6�[�uص�-kH,��y�VU�f��ACL��5��1l�����~�V2����2H��N�o/fۇ�>��N�9u���#'־��/���Oo��V.�;�Q3�֩|����y�o��o~�O��k�����n��Moz7���������^f����W?�+X]]��o����7e��{��}�R������?|[$W{k�����r��{���wv��������R������=y���{��>�?`��?�|��}���w���C����O������76����#�s���5�ӽ��W�.�0^��'~ۭ���������s�����������%������ѯl��O�����g��냛�{����ꓞ�O_=�mژ�!͇�g]L@Jqk�������<�G���w���x��_�H�_|��t_�)������ꦘ]����4��[�<�\�8}�ȩ3�O��Gc%��n��Eb^̺������$XQ3���>�m�'P�:�Ne�1�V�UoMJ&"�*d��I�i��,��YST�N�`�CLd�"91I�cF�.���1P���M�,/b�!�Η�IU]s��M�O��*�0���Q������+�� �ү����n�������� A�(HT�U�ia"���r?���� �0I�U,owa��1DQ�:��RL��Ʊ�Sl���h����s���T���նw�읟�H�u�M�;;���V�?wr�#��q�sV�'w �ᶷ���]��T�y�o]��~����_=� �����]w=u���5/��/y�ŝ��5�|�mϸ��3'��p����<�Yß���c_��7��@b�,��G���iq��/�k/���-�p>���y�7x�K�����/;��q��/�߳ѽ��_���8������y��o-8�N���o��q��ޏ�s{�v�7���/��wߟ'+�}��������=�Q��7����М8�G?�u��+�&Ͻ����#�����_���;�k/9~��~�k�����_�g_�r�'���&4G��7|���KKKe]?��VVW��:ā�B�mS������jz0���٨��B�,F�A����o�ݝ���A낃�^4ě�R����WTH9$K���Us��!��Hl ٪ ����P�C��� Rg��V��]����6Ŕ�Z��(CWS}j2.���1hg1�Ե����{�u�m��Pqlc�����]����6��P�$[��fN�x;c����:au�bʈR7��ݔ6��sjI{���.A��DÂ�>ɇtzG㮥��F�����j��0�W~�m�[w�s>�����ݻ!�O�0[���|������������o^�'<����Ǭ��[/\�o��#�t�����ko�N����,K�������D �����aVh�c��=W=����gy��>�i���O�g�;w�N>����ʦq����3iq�����>��s>����wwfs�����^������x�_^[x�SG�su3z��ԱU\_>��V'�\���g=��m�n�}��O�Seii��WƓfs�ijQՕ͍r}�ҕ��s -J[L6��#K]�eY���0��!M훦���ا��`DU���!�f9$k1�fIĕ%��n�)�(L0"`��YrV C Q�BL�/,u]߬�5kťż��D���l��W+_�o]ٙp��5�Sc5�ƻ�9��Lf���|���g�+�Re�5M+s�, 2vc��I�Z��m6�u]AP����U`�2�t��Ilb�[9{Y�N�.�����%T�龝+�7=�iO�9��㷽��aucb�'sX�,��[�[�?�����ӯy��|�����5������o��}���ƛw���� ��?���߹{��3�b�ޭ�}�}ϥ�-�!�������o����?�@1��=W�s����Ϳ��v��s���������{���T)C�CrB���� 0��w������������'��~����_�9OD�Y�iaiii��{we+�`���uSe1Y�?qb�эkO<������OzTu��OO�9��b��.@ �z'�𨲓�t�q�:(�Q@ ��2s��O�w�dkc�L�!1�e�5�J9kNI�hS�/� �ڪ(��z6F��,���v�-�\� +++���m���u�]���w�~۽����:�5W���;�2WBE�MH��`d�a!��b�9)�B ��8��������dc���m%Cby5ac�5�P�nL���'��ʂ��`�Z��� w���>;�7������[?u:��oH�9����O|�w>�� �������ӏ��/7u���;^u��E���'N?�YO|�K���cG�{�g�w��\{�u'_����_�dv�y$G��%?�ל��/~�i@W�}�9�y_|�-��|�#7���{�����~7����[���~�}�~�f=?pO���{�w�xi[@l�����ݭ�E��]�t����GV������xv���n��;`�,�t����C���;�;�gNM�w�/���u#o��#HO�6`�qg��)�]�ÊѲ��ꨪ+�*�ؔU� �+;CF�) ��,��!�Q4 ��}J��y2[�02H��e2�F�*)�D%����aH�u�4u�.II��YS����|��M����[�9&g���ŝ+}�{����6�k�c�:� q�-F�'c ��m��ԒPS�f%vCJ��ڏ��6�.�<�x^[[����C�6���ٕN�!p�����Yw�p�~s�U�BD�SN* ��:{˵�O������a��i�5�O��������9�O��c��ƍ�m/�����~�?��w���7��%_�Գ9�g|Ջ'�μ�O�� ��%�|L��_��菟�s�y�7�l�9?�~�?�o\+I���'_�^q�z�N��/��U�R?�^�ï����5����eS�[^�������<��_�e7����|�69�#��'_�ܰ�s�g}��w�N��_����_�ϾS����2G����m�/C��ѳi"�OKKKKD�H���`��N]��h�5�)���1ua���8]t�ʸzmr:��}K����춇�����ik�����Qe��ݙ*@�RFRE�`��7ڠ0���0��@ k8��hŴZUޘY� �,���yc�ykD������]�lSV{��[��bs}}ۋ;[}t%[oI�A�L��:il��*U��zHE�����Jr�W~cE��'�!�����AJӌS��2k�� Qe�+`�d���ǣ����e�B(���*�M���ٝy{�W`q�����v���'q�SB}�9��4���S��џ�G㿻�QO� �,�����?rIT����o�U7��P:��G���b��u_�M/�C�0$ ��7~շ~"a *�=�k��N���@��v�9�9��[>����Y�=��!�>��E� ��y��?��@��ɧ����%U0P���vE�<�8��=*_�����p�b�V���HCfϏ���rT_<���.��l����LV�l�9v�,��F�V��P�CL9Ð���A �BTELjK�x�1F*�qQԾ��s���ɱ�G/]�8���ǎ?r�X7��s���~?��7������P�j��W�S��DdSS�(Q����k���X� Ѥ�,�:{�0)#�@�ΠE������"��!���)1�!�Ǭ��� ����X�$J)L�Y��#�I���Kw���`o_�9yzsc���t:����""H�D(��W��������j�O$$�Ot�D0����H�Ę�'��� W�ˣ$�O�}�������OKKK9�iF��f�`R���ec�J6ʆ�fPx���v��㧏�m�/zcC�;.^s��kk��p>�YT3���S3�O]��N�R��q�]߇��X__!���P&"&U"!�� J�� @1%��!�Q6�0Ľ���l���|�-��ol����sם��a��K�.ϳ�!9��a�.-f�VWER�]�Ĉ'U% HT����ڸ�κ��}o�H�pQ"�Lt����q�։�3�;�5lLh��`R �dg��e��j@�� Ta�XL�";ߝ�9q�ı�C����J����������������SX��y2^=��D9e%�L�Y��n�5�=���S(Fե;��;k�c��;�E��,Ƅ���X9l�����:`���R$�4�s��a�jg���:V���X�D ��r�� 6������ϯtm���}��o9��q��{>��/B���Τ,���$�u�8�Np�֕�QS��eb�w�㙵cօ�a�љ��?��K�H�;8��:��}�F����@�� ]N�ɸ��Ĕ���At���J3�y�ua�$�mv9���Tb����5'���3�C�Xl��1^D��5x������ҒZ@�/Μ=C��.^$'@8�TD����V���J��4�~���>x���A�����6tm:��F���5&'䘝��d�<_,��!k����`�>q�U5C ��e�s�� ��m��Ϟ~�͏���^���1f 3�1��e&V#,�`��I��v�͆a�(Fu��걓'&Z�}�)B�:k9ʙr|�ꚹ��Y��dyRw `q䋂cLL�ł$�EҴV����)Եw��^&7��k �8dE��)��ft�̙ �Sk8�0,Z�p��������� &G�[w��kVǕKP�3�BX�Td�X����ڷb�LF(�P�XKt�(��k� M� DLQ��s�E� �g�ڔ��>f�e2�ɚ��T��lf �P��2�qL�����>�����=�����Z7jj02ж��`�@�,��V�S��A�/inq��ޅ�ͣ�<K2v����`�A ����w}��H���?��{���-n7�Z�:�&Ό��y�(&����f�C]��=�sYl��.�ƪ �(�l�{S〨ܑ &{+�#����,�C��ä/----�( �����g�6��}��*H�x� jÚe"1�E���,��+{ӝ�w;�)a�s���Eۏ�n�M�Ij ����;�1�d��p��!� ���$���𮃨%V�B4'[:W�!ɩ�Gϝ:~�G?z��{\�=�}�Y��@�%AT@r��T�XȞ����y��f�v��wn�g� �T!��_�E��.��-Z��x�jgq���M�f��7f%a��;�8)����"]�x�gR�r��g ��( hS+9�@&1G�lL�>L���������� l/o���v!{ݢUQC/ ($Q�}S���]lT����R�9%3tk��j2�w�J���¹�������,3;k�!��A�!Y���h<],BHMU�s����1�����cG����K;e�$1�z�:C� "���" ef@9I�@Y���3)���w��|���lV _M��eZ��$LsIAxB�䍉C*�s��8J)��#�xɂ��Dy�As����f.�4f���-�jv36-�%Xj$�U�63॥��%_�c#s���a��|������@ xGן<9�<�%��YT%�b�sG���.�LBi�}�Dr���3G6�n8q���c}]'o�� ��gr�1��g�����A��b"r� � ��;�q2�S��� 1�20�)QFNٳ��Afq������x��?��Oy�M����IJ ��X��h�^֒��Y�(�����M���ư�l�[�*�`2y���_����U�]V����D�-�I�Re�g�� ���MU��u&�p:������}K�DU]�ڻxe �U=,B����k�m����U����p0&�����"�F� ����� K�9$�?�� -VG��\��k����ۮUR�,j�)��B�� �jN��R�QP9�Y$*&�h�&��\[��})� �4�,��ȪArP0�C����0�#r 0�[���a>߽p���=� ��8;�T��������{KT��Ƭx�4�vݠI�ڢ�i)G��!��1�;����x��2�5�S�!��� �d!U�ޚYSeaVԠ��Xa�������Ғ���\=��j��[��bc��|���moyן|p'� �Co� e���0pi\mK�C���Y�Bi<�)\H��{D�҆!if�L�Z�I���֬�ʆ��!����.�IY7��Ӝ$�б�(MC<�qe� _�6�4!k���B�l,�DŽ�����$U~�������~{o��WW� R5�yu��!2Yv^�� �up�)�L,RQ =IU:��9;l������h'.�%bcK6� " �1C��Q�ߔ�,�`�1Ǽ?ŮJ��������b�Q�E2�ze�ȢK��գ+��������7�������A� �������8_$@3H0�r��Y����;�g��d� o,�HaDa�r�d!&�* D�А��`��Ek�kמ��Q��p��b�7)J$̻8d���S�0�٢.�ә!����WY�nu�������E#<� �qe\�eS����*4���B��D@2MQ*�N����)� g}H!K �X�Xy6�2UF£�Y/�E�����{a(lX��U5��Z;��xe�+A��������>���3��'�|��+0p�rtz8�,2��T�F�H���Le_u�� 0�#G�� `���. 4&JG��Rb�eQUHE��B9kf��,����IQW9Dke\���8b� �Y�%��F@7Z[]�8�uE ���G��9��U�1�[8�@ky�C?`9B\JN�Zx�l�za�B_Z��cʦ6D�!Q�D�!��`�\ ��`�rTܪkS���ПB.K��c2���ڮ��ʝ5R� ��x��<| ����Ғ�~muݓ��ݛ�O�W�.-ڨY [��ł��T�Y%��hʺ��":!@�6d��b��b�2c�I"C�@��֚�31��Dr!#e5�`�,b�艓Ǐ�m"���m;��S����ל �'GE��껒�9���KF��d3�?Q���J�Rn�� P�d8�1%�:O�uT5Mi����R)&{��h�@L;_(�D�$Y%%��Ԥؤ~��S���}�Uu�d��CG�����;7�&�F�Z8�<�o��X W~����^�{����B�_��w��U]w��{�s��U����$ D5���.���c�8�'��M<��[��5.\��m� �c�tL� �� ���U��Խ��.a-e��5)�ٟ�tκg���]����1�>t�qF04M7X��ʱ�4�9h��0Lۿ��ݧ�!���-;����V9Tq��Q䮃{u��W��s�ǀ��`C͉S M�t F=���C�#���9x�|[� �S�tF��<�p����p[ݱo�5}x��!�RSU�"�t�WM�p��ӧ/��T���p}���ǎ�����8���57訪(�n�v?�_2�t�DE�/W����go���?��P��`l�i�ohil�kk���4t.� C�! �;,��fE�v�$�q��(�!�@l��Lw`p!�#�\Dt ��b5Q��1.���]��f����Yl&�U$�0E��ku�� ��1�Ǐ��HCㆡ�:A$��2���n�N0&$� `�TU퍄z�X��$q�a̩n�"�VKaj�W2[9�"b�(jP]� ��V�� � �Gy��py8U9D)W1� Ȅ+܈"cD���!ng�$O0%��j�=�^C �L�ǡ��b��)@��q$r�S�����|��;J���۟1��jw����k�f���q�N� ��*�Q�t��|r�1���� � ����Uɛ9a\�����}�'���w�b��Ў�>���O�T��e�N�@/WTԶ���t|�P]��:��\=���LJ�Uu�0���+Ʈ�����<~^�1�ٵ�83��eW~�q�� �g�P��jjՉ㵝�ƥ�ȃ��d�sG�_��j��0��|���X�J�w����9��k5r�F���L�W�s�{��`F�#UU��tU�ů�xt�[��3~�= t��7�[��k�,,�N1W�?\_/0��R��My��/2��LZ]q�r[hDe�k'�.*�M>��[�]�#/�ΑV8�(����@o�6�]/ӥ�[7l;ðVu�t�l�*������R{s[kl��P*�.�Z0XDd1�6�=R,��e�����q4ft�M��(JS�T��;9x�Es�2#��1��@3��s�hv,��(�%�$`��s�,�=f+��A���7�G�M�}]�S�*�&�PD5�&�8����G��cfCVeA10'~�{$k���`2��i�i*�\������:e�A�$H""f��%�H�;)Q)�A@E��l5K�[ǂ�z����:Alx�&.��A�c��E)�E#���M(��E|H��3Yd��E2�i�Đ@R�����5�&QҀH9�ߢ�;�3G���GO-?�?~�/7�B�~���O?���`�����^zyݓ� ��֓/���Ko����bË/������7_x��g�n>r�����ǯv����.W�9z�6� oT���̶��³k^9Py��BűSU��-�u��n|�'��r�IU�>x�����3�l�ה��{�Һu�lh�s��R0�~��<�����{��?���t���'�x��Ձ��'���w~��>���d�壟�[�f��p4����/<���w�nٶe{U@o����N������y4����ky�FG�;�� I R�f�GO>������j�<�ēk^�ح�ޚ]/>�۵�����7����c���l�ڳw�k�^zqͫ�B�E�.�����]�Ү��Hw��ʓZku��A��諿y~��#1��e��H0�����MMu����Zt����|晧����k�Z��o�_������/~�ZS�������/���_|��G�����xᅷ�z���ں�˓G[���}�������e!)#w�h�]���\����j�V��ݧv��Ko��B\�����o�[�����z�˽_~��3�~��+jĺ?|㥵/�����"ы��������]��{@��i�v��^�ٷ����X������~��ߝj�5�7Gwm\��� F��J�u�8t����ź&RfzF��wf�����EOf�顖Ϳy/<���{<ti�';��_�u>�;h�Ñu����Oi eۅ����ڗ/��B=5�_yy�ڡ��[��>s��ʙCG�0Z��|�_�۴����XY]]q�˃�;�p�7��;��o}�u�^�S}�����]g�0L�T}j�� �����a����^f���k�<�������A4�c��E"��)Ii�P@z�vL��6�pPeQ:��D�&!�� `M5t�M��H�Sv���I@t��,�$I���)^�-�ec���h�l�HH���d��������+��p�i����1N�X�3��J8��8���Ft� ��ͬ[M1i�2�)Q�#`@u= #Dcמ�D�Ju�������n�R4���A� �M6��*�$��������0�)#�(�s�q�tĐ�&A�)0�H,fA��d�%�97�T�U���UU�`4GT}�~�;�(I��0L�fdyw~�;q�O�0���UMu~R��{��^<{�|��V�/��a�{���ʥ�%�I�3��ז����˖.��t�6 lo�� &�qg̜��P��^n˹yɢ�sRPO}s�3��G�ꉟu�u��tm��>>:�~����S����&�F[���u��^-��u�4�i��6m�K^���_�{ۙ�^�r�a@�0��������-� bфi��i�p������|ScwGS��}'g�\Աoӧ_�C�c'ݴ��o�\�|2&Z]5'����7��tW<zt�����%�};��6ww�l%?��Ԛcg�����ЩF�IPIΟ�x�b��ܱj?�5|����v˼�I2�R��)�2s��)�����[� �Ͷm�)� ��lB�Ҷ]��㦆��=�O�u�Ï�9������m~��G�j��cW�` j�c��`�9)w��[�i��U��5���W?����<��e~�o?&O����~���OLe��<�����q ���ٷ ��_U_=q�rx�&�������90�tڼs�ĝ�r�ف��3m�^}�c'/[4c�������ɚ�e��=�G�]�j���*�{y����-��|���%,�'�n�2qL��K����p���y�����������܉z۩ώ\Y��?�,��d�Â�]\�tѬ�����"G��s�|����������ʅ��ιca��^좒}�m�=�,k�-����9�fN�c������Ys�r����u��Xx���腸���������'B�@Owo_kӡ��p��`��,��xaY����E�,���lk� N_���\~�B���z<��$��}�S�v���� �h0���d3��p,�dOp��1U�������#�����"�cF Ĺ�JNp�*�*���\F� G��YTS��b3���ɪ��H�[�&S5j�fl`j�K$����L9�Ʉʹa������;��f��N@@: �9��2�@$f�0D`!\G@L�nf��l�D,V���`��Ā��F��TC\���/�z���s"���4`"EӢ*�faa;���A�KbL#���ļ�L���� ��r`Q0 �(@nf�a�4M!:C:�F#J���oQ��Ž �2�t��Ԟ��������r߀�=}�XONR�����+��$z��'��4��U2&�,+88�y���au�l��b�%"�x��(p�AW_KG�%��.o��jrZ�~���S�JL�p�vZ2�4+1��Ө{����y����nw��$�Fκ���s����Y��'f�K"�@�{�v��*`�tBR�N�����d5�a�"}.4̱`� {��-|rI^oCs��3s���ĩ ��zj뻬v�5�#�+CGxR��|)!+����I�]n��i�Ǐς�~ŔTR:�muN���6*Ձ5�!�c�k���{�ĕ,���s�.?9�M���YEΤtQ�����;�hRA�G�<^/����R�ˌy�ǯ ���抝͝�iy)e�N-�c'�K�y� �r�r2�\U)A*�v���l7C������3#;�`���tV��5��=�9$De��Ӝ�N$�����;T��,o��Gߣ��� qD2ۭ��N���tw4���b�/j(��_��J.~������_���ys&�+�>�g�-��/�,�$��p�\0}���+��ڒ�:6?�dL.���� �L�h2[�&1��� ��<c��T���r��|HN��ć��-vܹǚ�"O9~F˚��iljo�wg���t��(���:n�:�q�=sX�7gz��r:�&ћ�Jbww��+���d� &��j"��M�{=N�ƌ]y����Ǐ5w�� �] v�aB�= ��䂉%Ywr����Zb���S�D��Q�8�[2�N�$(�sƀ3��x$�"2���Sj�ށHL�+�"Z�Hu��e��l�0���F��U aʘ�9rT���MĀ�XT G����T���1 �H�l����l�7��L�9�V; ��:Ƙ �!�I2��$��l1�3N(����9!F��P����Ɵ��ۜNC7����麮�@8���b�BQ�����iC��Al6��2 ����1�Fv���v@��ps�@��e��IB)0��jBLVQ|�#fb�RU1T�#�� �HBߦ�;�S����֬���O=��)�*-$�o���a���B|��XGgߤ���ۿ�{��%�a�"N��~���v��0���C&^}tgK��(uo�t���T�c1�Z>��Q�{L�]�b\�=�wK��R�3����Wd��gG��j���1����p�l�3�c��`�@o��@ K<��p��O�M��g�4�ڷc�Κ�n$�#�aو� �םݾ�dפ�Ń�)%c�5��٤�rƎNO����H�� ���wv�M,��4j?�ڋ�l�x@�O�G���>�r���Z4'G�d�����ɳ)�� P���/��hL�yk���o9^0k u�C ĵ_8~)j+��;Sѣ�B!�b����OI�:�xTbz�;q;\X��̎�l~��7�h�gM,�����v�<u��b��͟�ߣ���9[�(@���B,<�D�Q���nx�S#k| v� p�����W����`T���_~���6� ����H��X�t��*}��7�� �*+7E�p�����U5\��HP�8�3��4�k�^8�x�d������ڽ��T:g���kꪨ�<jr�~��Xs k�m�i�&ę\RcŮs���B�᷶lY���q�����O6n]��@�Ź�m>�v�tD3����r���\\V� ����O���p��b���'�+��m���<W;κ �jT����%�?�8*33��7]��7��՝]�w��Ӕ�g��TW�-���m�p�M�\���]�!nPKJ�W;�Ѧ�;Nu���R�)�^U^�# M���g��g������C2@�����f�'{G�d��%���l�V�@,����q��F9 �j��*�0䈊 n"`���%������Ҋ� �-��$I�T�w��0n�@10Q�r��1��Æ��-�0�����e� DdAg`�j��ڬfAuC783tX)��J��G*pL�I���,9B�k@qU�r. ̸�P�ۉD���`q&b,&+�f��)c��3V��4ͤ��-�H�F��D�f@"ȓ�`�X�#"��a�f��XE��@ ��DaBDL�#�0E�U �0�� �ׁ��4��F���;���M�p}�o�c�vǴ�Ko�� ��Z:o¤�敥���t��1Y�+�N$f��)�s��-����]�J�=��Q6c�⛳��p���_ڼ;n)-�0uj��<J�����ϻeJ:U]c�Λ������m+�g���+f��K��j��|u����|��kK0¤%�NJ��K^1��r��wEA������[^]�B0L���֛�lRzɼ�SoZ��&[jZ�{�X�Ʈ��o�N,�w�Z�u�tԚ4�c��Y���b�r���c?͍��_�����Uޕ�1�u55N�}���+�Y�uX'/[55'�`��iY`�Zy�R;@�쥳gϜ5w��9�=rה������b'�e�+Mb5����AY�3�L��xA�7b��z�hme��0:�.�LD0g�ߏ����9s�'�������q˖�:��l�3F�~��{�<q鲙`�m����-�?g���KǗ����$ν��%%���o�}�`�»�d�Ijٌ9���}��-,�{Wd���5y�#9��e��mԪ{n��ŕ��2�9���_�9�<�SΝV2��3s2���w�#�ַ�S�',}��.��\����9� �jʫJ��2/��`w&��Y�Ol�3�m�@P���GK����/���{������ݺ< ��/�>y��ʊ��ϙY�?�{�|�$�Rg�����[���䞫�-}�g3�$�&���b�X[�����pd�{�֊Ӳ#)�b^����Ri�5��{��+�#�u���?���qE��L?u��i�̰���Y��Nk��t�q^�����X>��9�V-��2�8M�=�c���~4u��eK��!�FϽ}匌@T\qϭ^���o*̛xӭ%���pfV�!VtU�c2 CTט��2A��L|J4��� �,�����b3�QMR�d6a��%��1өl��&(�h#�1�`ě�*D�@0F(��2T(�J"b `b�c�U���D�dY�M��f�V��s�SJ�s�x.�A�@w���b�����m&�I�� b6�kOyr�(&�>?�Y��)�#4�c���s"P�U�rS�H�$�a�e� H0,�H�e�ưd����醁!� X%qE�uf�D$�| -=M-"DA�`FY(��*�̬QIIn �j3t����ޝ�U]�_{:��q�Y�Vwk@ b26366�x<yy�q��9��c�����H !B�4�C�����}o�����P\��"qJ)�X�O�ֹk�r�_gW���8��'��۷O�>�S�\朧R))%�c�m#��F�b3�b%�4�#�m'� #�8�۶�U���4��۶�F�^���'����t`o��;�|A�S���U�.ؐ���_:�����_�3v�]��,x�U��]vӕG�%�"�QHL�|6G ]WWRAW����Wn�k��1��h3��)��b���2����9�B�D0FB$C�T�<@``�,m�RgS,dcs{.P�R��y�R�� �ض��B #���)���>֫V<��fS�5��+Lh(�����8�C�T�F!d�6���R� �N���GI0���:'\�L�^��)m#"8���A�`EB�0�ƾ AC���u��TEy������in.��\,���<*�L��h�,�AI��r_���p�&f��ѝGZ�L�$K<�<9e����_DC��B7�r�'kLE���ck�Q��1@l��v�Z�|�Σ�ٌ c��@��[0X'��>��PI!��e?�����ּ6�c۶OT3l����o�@��%�1.g��*���i���=i0�^�ݧ<}O;�X������)W}�S���2:����RE�B8���Dg|WbhӜ�D�o���JCyH|# �Rc UYV�k���5��p�0�W��ZBI!�Z[�P�R�b�@���E��A���JF�M�B�#�al1'�&��c)����#`d0���f��PPKDX�Z�Z6��%�+ cc��+e�kH!J��Ć�dBj��"S(z� �)�0AI �b�H��i�DJSB����q���A���,�-%-UùjB!0�*�%ϦTi,e��4����6��/c@�f����?�����.l[�}�>���b6�Fwo;�v�����c���}(�N�A�,�!8I��Ӌ�]��bD�u��|嫟P�]֘3C�#�P#йc�MnO��a�8�f�vq��>9�s�鴶�s� �N;��s���a�u�L�? �|����N%�M*~�R)�2*nY%^�z"�Z�|'z8[Q\3�y�{�B$��E�"0`l����m�RB�e(��e��)H ~�l�R�A}}��젯�O�AE��'T��5F�L��9o��<�Ɣ*�d8�Qa�u�/j`�(�i�-Lf�w0Fes�1U!�Y�xm�� ,<JES �X�Ra�X8���ɗ].$��9LK�� ���X9�0#n3l��̠WuB`�a,0RHL�E�'x"��"SDF U?ȨAڀS��S�=�<�|��J+��`N� ʨ������/|�k��o���\��=>���w�����_���U�=���>�Wb&��r�k��?�zk�e���[�h���_O�g!��J���������o�:c�}��?xl�.Bȁ�V<���7�YTصu�����v�zBH��~=�#'l�v{�?�¢-��R��:��N+�*{��b������~ ��P1��:�'N�43' ;Ԑp$X$o�P����bB5�*�B)F�C������������l���_-7ԥ�ǴpDr ���<��Oe2Ƹ� J0eRj��ƀ� p��(�P�+d �041Z��BM,��T\���0c&�!�kRq.9�!��}�]Ʋ��^��jPP �$@�8�ԉ"c[8��0&�1���j��L)p��&Tj#�"�!`\[E��S�m�pn-�k8Q,h�d�;�k���P�\ I`$�Oqc���q��W�B����μ�Ѳ{��N�v���l�]3�9D�K��5�Я�?��-s�z�m}]/?�t����R���O�ꆋ�~�������&r��s.<�Q��&R=���]C���'��ڇ���I��J�����K��O%���/��=���g ����6�i9�?~���Ꮲ�[*U�.2�\*�xz������2�՝���nJŲ�S,p��J��*��1�l��o�&{�;=���0����X��a��0.�0d$�H���p�\J8�fQc Ji���4aF �@!a���hT�13��`��!0HRs���P�`[h&p�0@�`#e5�wh[�X;�*�"��pَf��!(CQ� '�1�k(m����*����u��6X!$l�p$� R�4����Di9�t5h�f�p9WվԢ =�σQJ�"#�)�Pf!��"y�2�5�TT "��Fk�@5�-��s1�1E������ф�� ��\TB�����jʯ��������B�'��(�C,Á��+^CbU�@P���?��m���8,�(�y,W�ӯ��Y��~ƅ�\�Ҕb� �4O���~��)c�lܴu0�o���7�"�@KOǯ��W�}�=������K����ã&O?s���p�o�2���r�y3g_v~�����X �3;^���Ww�~Ӝ�d�����}�Ux�,J��ٳ�C�No~�%!����o��g�b)0�C���!�Z.����dw>�'��P���;3���l\����evh��t�S�[?:o���r����v�Gt���J�T��I9 !`�B!����v}�nLƢ6 �Ճ;���%jY� xY�����E�Z� �,BPUK��l���STi7ZH�5��x`*�;<���56D%�6\V}�c 6�Q\�E����#��H��sX��e���Uak����1r����-U��K)x��\�TZsI�A�P�B� i�k@�"��(�hF4E��@��0` �J[�)�H�B���\I�ÉP��F�h�2B���!R[�$'`�P!m�6Hb�DB��$DH�cƠA) �|���<��hf�o_�9�O��p��ȱ�P���̞0!��ّ+�jy =�0�{~@��P��bD��%d�U@3+������_�涫o���"���Og2�@��y��LE"���F!b������c�6�kj�9�3'��������?W=�9T����A�9>-����tC����d��dzХ��F�'8z��m[9���3����S�Ty���z;������ž=���ݴ Ǐn\�xśG���/��pR����K�V��7��rgޑ��>�ݵ/n�kF�`��_�U#�I�+h���ïm؟�7�=���0�{���l� �L�e/-�| o�-�Ƈ�?��w[�G�;*���[���iiӔ�^�wۆՋ��t+�5K_�?���C+�/^�gE��0(]����t�ٟ�5@q�^ςǟ��S�wz{�U��']墜�X�b�7;�-��%�^X��;��nZ�h�K��*� ���{?}b�En��oIC��u��[��� ��;�~��u�{�-����/,}�#d�0��j�5�W�q��ػ��������>�p��mk�V�U+��oza��~�\��w�s_W@�~q���ocǍmk`����W,\����}w�1@i��H<d�B�15���D����*�Z]U��@�b�H�5@� %�0BS�&LCq(��bL��H��R �0��#(c��\�t�&�m����(��DJj--����W^2�]("ʰ���s��H%L+�Ҷ"Q�HfQ�xn-�`#��(��+��6�JkD)c�0�c1��!A��m��GR�#�J�c����-��\�����PQ�t}#�#�r�E��[C,la����Fva6��4"*�=ߑ�֠�T��� Ƨ~��B'��u�]��O<�������97Ξs����^���Ĭ����_��}^��˯�)��i�D"�d��GI�ԫ��g��5���:��=cά&~�����d:�֛���_�ό��j˸ֈ�RIG2� �_4M���Z���)�C��97N��}?ۚE������7,o{�{O��w�^��ʍk�Hcsl�S/�ؼf�������Hҙ���>��s�Յ�Wm~}��������M{��]�d+@y�o��{��Q��Y�t0����}q{�� K�mشiӮD]��y�n�7�����Es��8:j\s����ÿxls�4�'�20B�X��k<���o����,Ia�I$U9���yϿ�e�s�sG ���e+�v�����<>�̚7��}��{��=���ޞɗ<����ӣۚld�$����*��{��[��G6�.{���^;ҿ�������||az��_��� ._4���Gnjn ����FƬ��~lo?���'c ��S�z"[����o6-]K��_{�g��K��=~��_Y2w����<����>����>b�����/�Qc��cJ�,Z±���'7��B������܇�ص�������ǟ؝I�[��|oO�Qa�{����O����{w.}z��Ύ [�U��Ï>���˞_�aז'��B�Ǟ~�����F��m�^J���m�?��U������_w�{���.���0k@���T�JEBM�5��p$fV��s��eT0��@ʲ O0B���A1�h�XZi����h���� �1Ķh��#A��Ta���?8� ]:c���vi�'�:�$"����GJ�Ra� �S\�Pa���3���E�R��2�����Ƥ�28�#DSP����`Bc�v�HDb�T�V���Ψ�Z�ȣȣPu=�!E�[�=Q B��� kC0&��P�s].�D�,c�4��D�&S�"�5h�#�%X]uq���NjZ�"�9a���0#^�>��ꍷ�v��~sj����7�p�5�������w|pZӔK�u��Ə�m�M�~�J���qa�;2�/��s�&�0�����˯��q�-�~�S��8�+���_0��˾z�g�̾���%�g}�k��}����]|퇯���[n�S�$g�r�g��#_��?|��V!�Y:o�t�s�^�z�Yd�KkϹ�s&4��j�s�w��`�A�0���1��3/>���֎�c��ΛV:|p�G���{�BǶȄ�jC4�H�]Lj�=o|t��u�c����#nh�%W�=q��Ffhp(:ꬻ��3���.���Kf��6�q�&]��͚�#X���g�w�����7���_��;_���?V��#hX u���6_���_�j?��gzٷs߁�j4Q=��t��6��o~��/mܼk/���ֱο��K.��a�qΙ��ۣ[�j�Զ�&�x�����D��~��ߚ�:�n�`��?}���P��۷�dj��c�kG�F;s���H��sf^u͇B��Ÿ/� ;�y4�v4��D<��\d�}�����UO?��4��|�/��[�^x�C�*V欫��>��+V�0�N�xǁ��H���9�HK��j�}�w_;���ƍ�e���_��*\��̓���rۭWO�i�y۽�����} m_81Ő!~��d� A.���w~�3��i�x����I�^0�ƶ)�bN��pㇿ�ſ��2�M��4 X1��(r�J�\p���a��"d[آ��H9,N��%�Q�b�A<.J��\����c�Y#�!Р,\[W�E&'�h���M�<��[��ab�2�Ɯ��NP���x0`����Fh�A�e�i),����6 �� �ޠ�\f���@��b!��fQFR�e(aa�Y�9�_s)�r���80*S. �oil,�B�c�a�N��6�`���c�e��R0FDG��qS2�@T+����40jQ�`�Jm����n�JUT�@�@H`��ԏ�D8���O�4nTB Υ�N�T�`�9ر��Z$E$��cBe(e��b��K_��q� ���Q\H��6i��v$�Y���!�c�R�(lٔ�6rꛚ���Κ҂.$3�=� #�s�l=;�{���3��˿����s'nz�=����@_��e����Ϭn?���mƬY��/�g�8�) ����"�h�XV$����|���u5㯵/�F����K;�k��PF+dE4@> Ffz�K��H)�r.�7P�� nY��K��6���X�o�d�?�zF�jA��u�GK[ �$m�B�&_4u�۸�pC��K/9'e�R�5�\9N�%���Ӆ���:~���i�³/��#��cT��-����+C��^`0Wt�hຘ� ��<�+'�F`D.�70TF�%��U�p�)T\��qd�ѺQ$(V�C9��/z~��a�R�\�����X�!R�4}���U#v/~�73I�� g5�ټ��1/d��JB��$ªP�����k#j�3�70ǒ�R�"_�H�RPT@�R&������K��uy��� ��(C�7[D��4(1r�zz��ف���PnXY�k�T\���R�� �.��1h,���`.i)(�4���FHc!`�dFFk!�2 ��g1�bfQ�T4X#ж����v�;��چ+�N�Y�2.�h�m��u8ݻk߾\�D�-��� |]�z�GZب�T�Hiט�o��3 ��J! `�\���36K55h�1��cF˞��JF�&H( _)/�T�DQkYt]��HKeQZ��hL%����{\�hM Q@'��1v(��rَ]U�1�B^J� C(9��^�P��]e̱X����q,�SM�w�m5Zq�`���� �s�=R% ѫ?��(���Ԫwux�&#�'h����7�gΩko���c�kG��Ѽ6�#;�VrL����|����Ą���C�����s�����V�)���su���/v�xkc��ڶ ��ǦΜ�q(�P[o�����S��1�x,�hx䯷{��/���z45��]��+v�s�4��3����Í�n�{��E�-s,aP�.5��k�_���%�n��'?�ڞ�s���knN/X�u�_N�w�w�/j��q�t8E��H�xY�v��_�9�߷q��%�O����s0�hK���GC�'"����O��#�6m��2q��̿�zS�u�4 'M8�aŲ�{�|��sw���0�<�+&������/�AWc�n|M,JK]���O"4q�W�uw/��O~n�7���]�w�X����yY��S�/����j���Ʊ6�5 5f�.�}tk�CH<�@�A�)�����L���+a��D<��hJ00$���U+�l5�N!��p�a�N�_k�ܶ~�3[zΫ�K�?��6�Дtp@"��"�h��7�v��[��.����(�bc�"L�� !�g9NSC����PYD�a��r&�H�Ƶ��e�B�������D�'�! �a� %�d�@ �h�j��(�kFU���)�Xt攳:r��Q�p�U�,�X1�k�;�NCޥFYc��V$D2�o��3($�E� ����C��p$N�[r� ��hmUA%�1L#@T��cKR`xDF$ �bGEi472�= �*�*7�L%-V���L/6578�t=��A�a�D��� �5�^�ݠ.E����&�ED鈍cј6�R����F�1B�l�i��(��QJ���2 ���M���T���f�;�o��zxr��ϱ+�}V���=E6���g^�����@NЂKfYJ�� ���mm�@��j�5��\�q���.�e���K�0��J�l��ceZ;�6n 8فc�& 9/Y��,Z�c����]Cz����~��벿���1��$9G�Ed%3��46P8Iv<o=�>��`�2J"ʰRaư�w���;/��cS��׆��DZ�#{:'O�x��5���<��p���I�� ��=����ox���n���������G�dK}�P}GӦ��1gd5EI5�(t�j;�!���tg�$�6�� ƔR)8P�"�=��͍Q�;�����i� f7�"�=z H������ cS\hˢnn�sjê�ȱX˸�P FiD�Ra�d%W�u5���o[{���2ƲƯ`�q�0����=�{o<_��Z�V��ۜj]*�2=}�Pa� 4�_ꔁ1�!y��01 LAA� �1 ����B��0�>�lI�ѰE�Hؤ����rV #?F�B&����o!��P�qڡ��l�B�����S.u�\�Z�Q+�u� B�d�+$�ª���mEÙR� �E-�C���G�qb�q��u55"��A���1cjluM8��ve����! Ј- �G%�c�B��Ǐ��q��-�2���� X��,H&K�T�8H@� ����h�utsOi�o(�0���XĦخ���Z����zhԸq�h������y̥�}���l�r�w�ճy��� �Ҥ!]��J� Mh�B�* � P�D T�TU�JRZJ�6NH�'v'v��xoc�x�y�y<�y����G6PiZ��XV��ѕt��9�s���y�s�5 `���_�}�ѻ~��ş��g�2����c����6�?獵���cՏ��{\q�[��������<��/?w����e����l?��}?�>�Ti�ㆯZ�ER����8C8w.�F?j�m]. v�td��ۗ��P����H8����X�l �a��)��'�/Y����0%e`Q���r�s�О]M�'�-8�r� /�;w�̹L�� �_X�X�^����g��SE����V�g�ɬ�6�kJ��iSk9,T��SF��L�S�u��1���n��O��'O��yۄ��Е���i����dY�:�� ���8]OC�J�.�j�/�r���gϜ]�6�CZ�gN��V�RUg/�y@#J(N�����Ս�s��د�M�������y�Ie��j�m�p�����J+\#D���1��`f�~�����������=Z��B��}�0����q��ҭ��[�g63�ڰ�Dy��&L��f^�ey�4�ھp���M7�=�6.�"�(�v=J�!e3m�O1���R�E���R�HH�@�KDD�2A8V� �A99�隱�+{�h=�,�{�{e���5���I~1*�"7�f[稫D7�|)������\x#���N�V�.jC6���B:��]ss�7�R�� �H �N� q�h�f>R���v_ҁB�S�A�D2���c����ߵv��Sg�w�����\��,�Rd���S�2gS��cR�nct= �Q�`�)U��#�Y �rR��8�۶��_x0�R*�Bk������g��Ϗ����i�\_�[�,�`�A�K�Vc�3%.\�4ص\���6�t2�M^v}�'!T�Y˂�bks�"` 1� ��b" i�@�� Ȁ~�:e?�r�Ȧ�h�;�A_�t�Ѝ��N6��^���N����:�$�|�1�Ș�rkw�I�DwWw �"�e����&4. ����a�RIs�6�$r����dH]](2c��HbL��i+!0�DK�>�m�Z�(KaE�d��T���j��ڦ#цH@4t��Ŝ�1$ ��"�Ӊ\���b��|_�d2N ��$��D��ۦ&�8�c�eY��eҙxşq�~fffFg�N�ēO�n��"�(����&��h:��G���{!#�8GY(����Ɣ����0�w�c�(Q��Q Ҹ��F����Y�( Q �vAj��lCI�G;��jw慳�Z��e�uH�yG RZX ���ht�#��5(�к<���jݞ][�v����02)ϓ͡ޮ�U���uPBjSx'�Cr��+9�(�,t2�J��0��Th17�s�{�6�7A(F�<ޮ`D�(|k92'VJ%���,%)��Đ�B;���q��'�*�S7���s!� 0_�p��K�3���&* )X�sy'u��6Ĉ� ��z{���Ź]E��L�6I�"T·�u�y��tJZ����9��" (A�.2��i���b�����&c�1�L�is8��Fw2n� �V/�������F[Oc�iU5m�K-�DJJ�k��������"V�L�����7'�UZC��.��6d��Bj}P /}I1x��Dd���`���Q�44=��^'T���6H��JJ�@�@BPi�\�O�N��Q �̒̉9�tI�%ߖBP�d��ʹ:��U��_��%I��5��%Kfffff�y��n2M��h4�Đ$L�T"τ��S�W����a�gdR,�N�b�JfF�K-mڪY@a@�99��}�i_��M��JA�It�����ƖO�� %��p4�ظ������.��,�ʚv;%#S��1���&*%��;���(;�R 1ɦ}�`~Q��F���* B)��:��5E2"�u)Ɛ��s��2-�p���Sn ����ʶ \�VDR�����ʼ@�)sJl23i���]���AK�I�(˲�L6��M�u�.�^�-��V�U��ļ�k~�JI�K�TJ ��*��IH)%W�*���Z �w����&�@ӆ�������`h������2k��'�ͪ���(���´�>%Ʈ~w^定 �� ��vJF�2 -��}��-����[�����i-b�Ą���m����/����u������W�.)-�1Y��C����HPJf" A�i`T��� aǕ�i��5������/�e[�hʻw-��ۓ ��Q����I.8�ÝD��Q �g��s����r�8i|� �ևq�I)$X���$��M}���2���U�k�@pQI$����|� �Jy�'�Q���Ѫc2͜+�Hj!���p��ct��+o��� "�w67��?�99�"�*^E����G�w������ @H(C|HL)3����:�$�z"�H�&�8�l�2�Q�W��u�:`R���.�nm%��pu����Çv��S��IU�E�R�^�� ��v�|�)E$BR��C��-{��x��q�u��B���g�|�O�O�f:��k/�>�FU�u�-�!���7������� ��W��Q,�2B�ĵW!fR��9&�QR��\Ң��&��]�.�V�|�z�ܜ���I���U]qH0�}�2�DRI0@��{��� �88״��~^�Bt$z@�_�MXZ��}�����,���a|�m�+b�p��e��{���Y���� �����{n�����=%��֒ʌo-t�������C?u�J�+���G~}���|���3333R�^.�ɓ � JRw�HÝj�n��������5<�MA&JJ@!aKA�Ț�6�i�������H��s��O��f�������q��R�m���h251E�B1�Ȋ�������w�n�mn{�]RJC��/�m� Ɉ���ⴞN��iL�3����y���i�ދ��S���T��j�p��,�J���Q`��uvc&(" E�`AJKo9��\j����S��Q��l,D�k5 Δ �H�u�1���0%N�%D��|��X����@v4�DQ��LD��67��^�jg{k�<{��>��w�-��L�s'���#;�ʲlx��{�qluc�<�JO�[�[lJ���:�6β������t��t{�܉����й����mdrgc�L���=w��emB���A "·����b�L��%�R�B�Kʄ��;qgXL�M��v�|�X��\o��&z�+��!!]�m�PtB��A��t�I�I��R��.]\�����?t����)��N~��Sk�8���J��.�HF(A���ض�E����[�"3 ��.z�o��<�$A�L.F҆r=����zp��\��[�OG�����X/�F&�։�u�$��h:��:� �e٠�t�QQHaH� E+xm2�X�u�X�\۬mmyJ@��D�(D���o�a!.rJ��䐜���yk�y��3x�]��ȅN�0���3`��<#�Dg�]��g�~��_}�=��駿��;���7��~�G��w�:�����Ν�?|�/����Hk����3W��_���z���~�w��>y��}�+���߾��姿���|����_���S��o=3yqaD7�?��Ϭn����_�Ɖ��o�� �ffffRJ>�D2&F4����N���֛�E�g}*t"j�� �O(�I1M�F�e{W�}����G!wFY^9xhna� A���d|�ĉ�ֶ'.���)��X��l�-�B)��O���6%"��!%<P��`n0�!��|�1%N����s.q�l]�ڻ�;�Nwv�|^�9�X *Q+��kC,EbN ��,�"z��2y�l��y �R��+����k��V� ��$�"���n����J���bJ�Y0H ����R���"�2JK��I���8�����0J%�N�(U����w��1sU�o~����k���_���|�?��e9OZ�#b�w.>z���s��_����7?�O��7��������lm�����g?����?�~���㏟`Bꬼ�{�ux�Ϭou:K������̌�Rj��eö��� ��Iy>v�ݨ���vF���7i�4�g���n��o:�0e�q4����1�ۦ��d���ܤ���z���O�5͂�^���]h!�*aF�w�HRqҲ�jJj���[C�n��`��>Q+�D�v��@���?���I���d������ �.�3�6ۣ#�Yڵ2N�i���FI#Kh �2b�P7��rZZl�N8�uq�a$@ ]'D�dciRYJiO^.@K d��˔B������c)<y j$��<�O)q ^CJ�Nmتۚ��1�$]�J�A)�k��+���^r~�B�{7����Z{��;�(��ѻ��i4�Y BB ��������n2d� W0�@D0��d��i2�^$`��ĺ�O=~�W��aT��R���7�_V)%|������R%���#3#���r�n&���v`�Dކ���Vc�d�-��#����vb����}�K��k�0J�7�w�AA��*�)ϊiS?����u�}�,s��F��(#��2�L�ܐJ �&�$������{�T?3o:x��3@"/�9�V/ ��=�sC1�)X�QBP"D�� [;���H��7�i����LS�Q�L2�)&�P&Ѥ���ˋ,�:RJ��R�2�&�]�.�A @C��&�1rJ�N���D�)�!&�"��HBh���8>%���HTYJ�S��jB �k� +��?����o��_]\�����������gx>_X^�a����#o~�������ϝ��:�hnw��G?�K�\�u����������(��Ͻ/}�3���P���?������&�!& $� �=�Tv�e�#��Qgj��9|'����I1���ED��0Q�ޅ�@fDUM��Ü���6)F�S_d'mkm��;�d��8j`�������|.g! ��'AJ��'���#{Wl[�ӦIC@� �B5�},:�� ��29�b�-��xr���|fL]O �I��.��N�0�&�(��!�b�S�����7�R�v�s�<{��g��b� 8��(EI 1�Tbg�L�&���O�?��Zͤ)FALB���0u�R��FQS7�Bd��R���M�l�J1��$H)J1%B��5�ĵ�_ cR������ma���1x�����=z���W��c?��7�;�����C�+#�/�*s���p�ܾ��|��n.z�E�nz�/�������w��w~f��c{�����ͽ�7���]��|��"j����Ɏw��-,9������<r�y�?��Ӝ[�4���afffF0b��CpH,�I��������"3��Fk6<��&CK�f;ΔR��n��N�씥�| �w�h-�t)&�-�*�$X7�˘�3#��c�"�cl Me�RJ)ƨ��%A1�&�R&N� 0���p{��+&!0b��e�q�C�Hq����;|����:FU[[� �'mtatp>�b��%����=�� Ke�D�1� �B"�!�L'�u��������g�yqy���7�����Z�T5>$8@T�)3]5�f?��6d�����t��#s���}3$kI�]o����fq��<��\~���V����7���}Hi���`mT����_���!���xk����|ZZ.����"�%��o��0z7�W���o���gfffH 5�z߸6�-d��#�$Q�sJ#I���Ni��/�:e�ڍ�n���2�9�4���mZ���;UUz;ވ�`�ַs #(�Chj���#,�e�J\0���ey����y��`hb�B�Lk�A�AREp"H-�"@(œ&�J�2��g���n}���7?��ck;�#����-�X a}�s��U1!$@ �47�- �!�dQv�MR睲�L�6� ��ưL�����N G$-i�o�2�֒���E���J���IXD�,�����EW�!�®7�O��O��}������A�� �E�2"�+���^�w/������W�l�z��g����x��ǟ=� ix쁣�u��������/>4�'=���'7&_8���8{����n�����;^ᚨ����g���=~ W�>��gw,�������=�k�:~�ы��?��~q��e�.��[o�6��<v�⥓O?u~�p��ɧO�:���On4x�MW_x���.�<�'��� N��o�K;���g�x�|�����|���K!z<�H܁��Zu �đ�Qr��9a&;í�--�rn��/���uЦ<��n���xzty��IE'�Ο�F)��ز�nT~��@��{}�p�]���H e�� 9�RI��1�Y.0Kf(Z�Pf�L(Ifb&�D�FCP�ABD�(D�ˈ�u���g,��|�uG�ge�L �[K/���f]7J@&���NaL�[z�B �RI"1�jN\�SIPH �F�/[ �B()`�Z�HK���<F�QMm�4y����sF �x%� �q��[n< �w�kk�̃_�����j�����}�ѫT��� �zZ�O灻���S=r�]όqu�\��;��O=��o}�/=�WO�3���]��������x�ux�֣_�̝�բ��O���sS�?�+���Ƕ�G�y��}+�ڻ>��SV]e|���v���'>Y^�3���mȫ��ʾ}�s��G.���±�?s�s{��]�x����û��гO<p�W��J��?t��y�����U�����Ń� �����o�x�G|zM/��FH����{"ӎ3��d#1�,#�H� k�f{g��3դsj])yT���5�ڒD���E<�v��� ��$���� = !��R�U�(�#�*B"P ���ւ9#BJ�u�9�$��1"�b��t�1�&+��1ɔ������ �Ѫc�ָ����:E`�:w�ҙ3+�v�p�Q�QI�SA �w� E&:�&dD��nll ! A0���d"� _Uu]���ֺ��kC�����Z y��@Ii��EZ�N6����PR�@1Z[�(�$�u`��+Sb��f����{@�q���_Uu�<ȁ3�s� �D�`Y�dKNr�x�w��^[�e�ʑ �(1S�(�H�� @�$2&O� �ӐߣϽg��W���������y���}�`8��Xc�{����W]6�#�����P��j6/{k�����g��Q�Z֯���4�n����~���>�{���464QĮ��_=9��A��J5/y��}���r��îV��z�T�\��d���UR���D��[��=��:�M,�ԆW~���- ������P��_y��WW�3�����ԯ�gu�u��X�Λ/�����R��/?���`^>��Ώ�~�����y ]��+�^~��/���^�kk��n7Z��9�h%�_��o�]w���]��˯?���F@�tx���XWw�IE�J"A�zzӇ�^���_]ڙ�}�U��K�}��ӿy���g.��_�r�u���l��"��O����-���~��+���?qb����_{���|��U�ۿumc��sl��- �H�߷/R>���߽��1 �-_��S����G�̟���U�Q����so,kc���7_x�=�g�y��/l:�e 7����b`�ٱ�R<}z��_��S��X��-�pb��#� �0���x��O>�dg�k�-y��%k��X���~��u1���dc�Ͽ�t�㺇��h�p��`m���dwG�*,)./�{Nm���/���:hP�ڕ�T�������{ᩗ>�LA������/����i���-K���o~��� ���Y��O>��@�n��%o�{�E�����o��ѐ�3�{c�uF�/͋t_0�`�~���~��k�-)�h=rt߲W��y���~�KO=��٠�Ѽo˶#�+�/�����]g)�����+K�'(�߽����#[��v6��ԯ_xku���;7�iυ�������[�n�r��g���+�L��{���WkW��e�#�|�) *��&DUMU$�q��H ��@YK�i@�s��ɸ�(��ɚ>�����W�'ẖ榖v.@�@"T(�!#�S @!�"���Ly b�CHł#��q��KT�\<9���X�"ီj�7Y�#� a�p�%`��R�DNE�����-�=f�����vb�LO2�LI��� �s��%��V��F6c^Ij�"L�0ad-@(#��\���Lin�\ϸ���1m� ��Z�i+E-� GpB�F���m!�(����$<�?+��r��Qt����w�D��]�̌�<�|𡻶�[U\��m{#};����v{�澻wo}�B�0�t~����9{x)���[� �َw<�f��y>��k$}�UwT��\=f��H�+:tXaIa��N�߱�fʜY5����q�Ju��/b�?��Q֯r��#�?d�m�k�/(�����}��&K�l��[�O��~��zg̾�zê���$Ӵ���:NNw��Ҵ�@�C/t�u�q��te���'T#U4��a��m�����ع=��c��N4$��#}g�h>�nCDN�H��� �&�e{�9;h|~�����eXЋHn�x�z�7g�KWGP@p3�(�'�ڸo��i3���w'[$���K��n+����x2�9��/<zl�3����l{kžo}w֚��'L��O�O����ݾ��;�E&ꗛ���V:<��ʖ}�j����z��W�,X3e�ir�$�]�vm�]_��n�y�ap�P��rb�͓�.��B�T�g\���?d�y�D����'��e�UҔ�'�\�;wZájK:��L2P<l�۷V�çZ���/Z�A�bR��o�����w@"����"��`�5�+�5ǭ;QW00���%�|y�N뱕�j��@�����:_:��z북�=��p�P�xM��b���vL�sf������������Hh;�rͮ��n;7[�n�3�[�,^�6��I�6o���P���%����n�vZ�b�ԇT]ad/o[�|\�䙳&��x�Y:���;�/�������0 �[��ҝ=xpӖ���"���ԇ �w�}��] U%�\O�s@�u[w�:�����r�d��R���oT�~�Ұ{��܌�ܴ��'�h���`�0f�Zå��? �W�\�u��$�0��渎��(�� 'k8za�b�lS�%5�k�b�"ʬ�Y����g~�����(��% T�*,�R�P��צ2q�0]�i��`٥��[TPY�i��ٶiZr ��� �X�,I�Keĸ��"!dL�l�TŖ g.gp�΄�e��v�3b3��Z=D�5E�چ���Y� ,�,Q\��AY3���r�8gA��+2!�p�oYW6�qm��$� I�W�0g�e��*6m�՝�|D���2�`W���)D�5���r&}�*h��a�iB��37~�ϧ�y���v5Qԧ8ԥDgK�r��G���?z���.`�p�zw۹��#F��1Nuw��0;z�i}g����ViΩ�k=Q1$���d�W��._����1:%�7*�?y���*�ޒ/���OYYٵ��dO����nq��_�!�̻��g�����A}�cIƴ����/v���+����|�>�F�}��xpEiho�1�>N+nj�gZ`o���Kui{��gO��w��vz1}U�'�Ǥp���>���_��Ͼ}z��W�)�r����{'o\�_�Bz�83X5��Ƀ���c��y0! 0���g#���|��*��aޢV{�@�WT���˒�������W���q6�Q1q�����r�b�����^O�q��ac�Ǝ�ѴW*�(� h��q�m;6m��ú7�9gB�+��o���ݠ�k�/\-��Deb�4 ��P��9�M�_�ht��t4�d�ra$��O�ePYA�����f,<T��<avI�ą��FO�Xs��9UX����B�C ��'�|Q�FM����p�٫��aZ�_Q�G6�p��q�K�w�Q��������k���g����Ny�h<�e���0~�-c���\h��3~ȇ/�=�&0��O��ړ)�+�x�Mx���w��P:d���#���2i��lM�>E)+P���bƂ!������n�N_�-Su���C����՚斳��'�/+$�����JᠱcG��/5\.8e�-�� W]_��X����w��Q����}�����$pQaaX G"�4w��O\R���}�с��>I�LSkCFs�(/����>Q��h�O��������wfmWC$)\f:B�U���r�m#MM��,k¶-,�y�b�D*Ci*�\n�R�r ��DAHX��d��@ȡLpB�Ę !�I�I��R!��̈́pP��;L\�2�*KHB=�L��@ �����p4��Em��$��s`�� ��j�! ˓}�t*e�E�+� #=��6�<��0��`���(XR�4EƄ1��r���8�۶E0�(��m�(�fY��W�\Ȁ�\���@��A�,�|>�����e^�v���'}�U�t]�~b������_*�o��l�}�-t�-#P��]�+��(�;3�u�����K̞[p��=a����)0P2��d;*gv�~cW���ծ�lq �T:�jmO��'�:m�+��)ept���T~���6f]O�N��۟NǺ��O�?`PE��aR�1�8�n�k}�~��-�L�bw^�߸Z��h��|ε��|@yOw���r r��w=���/����N�ٓ5ܔa�භwjC�Y�k��K�]�z�EO��m{i�S:}jQ����l�l�T��1}W��W�Ɲ-?{��Կ}b�Ƀ{}�Uy�鲒hS�ǰ�t��=�����=l�K�aUR2iB/8趵��Vݖ=�!w�lK�˫���7�'ud�hO��mK�gV���<��<2�>��L2fƒR�ݹ�K���kfR�?ԛhB�F��ˇ�������O�V�e�a�����+X^ֿ��++��ؾ�==w̜㘆 ��� �ѷl���~}��ӱl ����ۆyz�����@���͇O�I�����W��u���3�.O$�qx�s˺�|sN�V�LeK2��(Xf�*E�pE)]�v�؆}��ӵ��o'��<����&�� Z����i#����Ys�y�>�6=�5�P6��z��%LL���"�Z�Z�~�%��?�]��=m�G��b+�N�2胏V���I�����TF��-�g����b�g���Si <���m�̛��Z�yw��k3�[��u�\>��xq�>;R����m��6v�(z��ѣ��/e�4������ÐC�{ưg^y����Y�W�m��)�t��Y�ٽsw��ڵ��X�dm���m��)G/Z9|��U�����9�К�i"�#g�O����0Ut��C@"�� &4!��,g˒�u"����i�J��3��1��B�d�R�*AH'�)�+���8�� �'s�ڌbI�) 2��9����` ���23�i�[l � ]�i6� $d2!{���ǐ�f�ဏK�-�@X0Y ̦�é���0 ��?&KX�]���%wʸ Æ>w�b�eS�4��큌B�1#�2s��B&�`B]WEHl�٬K)�uuME �� l#�R���� X�@�g�/����2�A4�ѐ��zX��X�9N�5�K)b�.� �?4�|�����c�gі��яϜP}�..ݼ��o��+ӎUkWo��c����M�d����7A�!9��]]������{o��&`�7e֔���mck7_v��O(���>2�� ��9>X���6f�H���CU���[��+�,)~�˟�w~x�jո���Hx�̦mGwԇ���/hk�D*�N-�|s��X����C4�w\=v�Tٔ�&TU���BI���ၳG��n�E����� '��K����+Ԗů.��=��LIs�r��H���GJ�JZ��G�^�`sW����c&M�p���ᙂ1���~k��Y7��_�p���!��z���z����a�����}�&:b��1#��tWC�5vĘ�4fReg�w���o��Z,��Af�eҫ�O����F�7o�L�ʴ���G*�q��>��2��{HD �8)w����c&N�j��h��__5�au�Z��sf�ǎg��)#v������SB��S�F!�20��W��0�;ڮ�0�����ƔkW/n:��r���p���m:�\|�]��S��o@�?���wG�7zQ��;����p�w�Ӭ���𗎹u�;�`�"�x��)��-{�f�j�$�š�d)�1�p��AUG/&�z� 9P٤G�m<z�h�ĹCG��/������>��'F��iS����Ǒ|�#�L�(/V�-��b���(D��A�Q�i_��}�C��9z@Mwv���g�u>��7����)��ύ����t��ÆψޑZ�z���3�����U�'4|$�P�����/�ܕ_��9ӋS���U5���M���Ѐ��i���������\p�i�'�h�X] kf�؟*���1ˡ�`@�1�Y�e"�j��V� ���h���Y �H�,@����p�$(��4U��e����g �cBB`D$� ������`�M�&y�L$�(ܵAB�B�2��e"��e�P��x,��}.c6e#/�!p�`P��QX �pg<�ݓ�y�v�ٺ��G���|����PXSV,U8x�c �%���urϘ�@H ����(W4�̙+0]A���(��IH���e�1�g3v쀪+*��d��gZ�O�z��~/�Bǎ7n����i�q��(�����$��qUUs����~������5>}إ���������Ȝ8r&X5i`�������ߙ�z��O<0��g�v�ⳬ�8q�4T}��s%���Z�bs��o��E�A_=~�� �Zv���[3פ4A}�l�n�BEf����W�:m�F\�|rȇ1@KW~�) G.�醌��-,ՓL� � lGtUB�ۮ���p�D��i"(�$݈%� �'(k�f�L���2$��q�� �2�8Ģ���a��EC�i#C]N�,y)گ��Dp)�$]��͚Y���ۇvv���_�p��'QQ��#=��m�i���|dh8��� j�T�1C�\0�TN�aP�P �u�j['�$&�BYP!ݔ� &�@0r\B蒤�)ʲ�',��h�ɐ� �/����P;�ʀ��pD}�����|�g�?��a6�9���>�p_]�����4�˾^�Dw�)���e�T;�t���U}��������}_x��?.bLE�A(TT��A*�T��� *&��W$P$��/Pl����d�6�y:�&�TY�t��kY����*c�1zJN]�I�F�w!IU,@������r�}���R&l�L����&;H�,��� �k��g�I��T&���(�,(WB��\t��I Qtɒ0�0D�\���(/-�I8Kv��ۖ�+���"���ʬ\�b؛�u(�C�Q�D�eB��?�0fBP.����S���c.c��Y��,R|*��#m\�'�� {g��d��ǧ_�aY�F圍dB�[�����+���(74���N�HH��{A�n���W�Rݟ! ;�_� ��I�a�"��0p��?4K��t*F=�����s�d�/�R����P��8`(�e�t�1%D`�s�y�&)�� �T�ΐ�.mj�����#DS"ab�4��dE�T&Iqlj04�Hۖ�&��� �+�"0Lp���+��s��0ɚ���JJJ��@UVU�e�IR �e��0����_�*@H2V�!|��t���t�@��� ��4]Ÿ�j�e���*3��^�J��>��2�\'����ԡ<� �WPНIel<Q4FİL�9�f���.���I� �{{ *�����F@SK�!]P�8� �$K��iX|� �||��g������O��%+/\��� ��x�I��&�?0ϒg.[�ِe��x�0���-a�D���囹�'�.[�͖�\����^~�ѐs����~�/O=���=���w7t�97E"!�V&��;��.��D������!�U�������5UKeҌ3˱�B��a��麺"ɘ0�%Ri�q$�H��3�'�B2]�~ݟ�R&� D&c6se�B�k�m�:�70v8���c OV��@8���g�;���� r\A�K)0����zm ��a$˒"�D��Ȯ嘦)K(��@@V��pʸ��xyT��i\'�+�붷�� Q�� �A��$L�e�1� V��H%{b�ˀ{�Kiӈ�R.8���,c`lF ס�`�9�K �Ne3����/� pm�(�eYWU��⧚�9c �y�_}���S�����Uw����)+��ș�����W.ٱֺ�f�1��s盨��W&��s�Qd@3���+q"�����g�^�0���B�@R����s�]/S�������}��*;�ޕ0d��4��6!��1C���M=�PrwZJ�_��'�t�7^_��� ��6�&,�g)��X�d"m����� ���\��s��M�:�26��#zc���c5��DgW҄`V6O�ؘ;F<��ߊ���?�?i27���zx�t����?��?���H!DS"���e��q$����DYf�0.$��_���Y�Z�L"\#J��!a(ґOV��W��[ �Tڶm��rʹ`l�R&�Y�1���b�����t�!p�l����\������u��k3Ox����z�ɀ���.�4E�UȺ/범a����d9�Pd��l�*p���-\�9{�c��HX�TJ)�e.cF�{K��ۻ�.wKI����M��+@`B$$i Ĺ �ALWȝ ��,@،MI27�NEU_�O�Ǡ �3��5�� ���@0??��� ??�+�����o<��6#;��õK�[���5E�|V��bd\[�λ��Y�`�$K�^�`��Eᄏ���V�����,]���Y>�w�d����LOü��_���g�n#eC+��4�haiIq4/�0��$�_8��g?~�̥��=��{�o.lI;��?>p�j۹�/Y�x��mo���o��x�h��<_Wז�c���Sk�,�t �w����u'W����Ga�6]h�Ů]�Y`7x��Z�=M�Ǒ9��������Y�f��]�iߊg�_��m@���#�P�~�KS�>�`ޒV�_�^�}���k� v��&z�n������Xǵ�g����Y�|�)\���O��lj�Бq�Ɇ7_[��X��.����������d�������*sP r,����r����3M����qD�8A�kaY�6릎�@t�d�T6C �9XA�.r�(�~�2a����c6�1Ri�ꪍ��K�pL� ��b�@�\�8�]s%�9!Yx�j���u$��Q�Sd��,K��xO�0)`�d���NǴ�-�W��2��4M�e��]#��jj�}*|��8.ǂ"!$��*&*���v�IX 2V�>]�2������a�:h��m.�+r��M[و(�ՠ��1&#�KDS���l��7'��NÝ�xtX��ĉC;����Ɩ��[�DHƠ(�ׄ��������'��W�pp뺭�/�'�yr������;[u�w�`��3_��O�'�ϧ}ȑ��ͼeʀX��T�*������.,|�����K��<�˵��{��o��ߞ~rv�sӾ�$��-�V-�U:{�x`��u�:3��jXiIeդ9���?L8c��ӽ{��֬7����=q���Ћ�u`���-�F�f��B퉣 �x2�,��[�ɣ5��;\�z���� 7B�v�О�<6�}��yC}���+g�7��1S=ɴ b�=�I㼤jd}��~�Ú��D����7T��fw�ٚ�'so�f<e�t2e:���gOV�h���d���:3c�5�:�ғpo��f�a�:^��hC�ӝ��=���97�ۿ�|���K�叿eD�`��~ss\`)���9s%9Ĺ��kϷ�"L��f��0��m?�c��� ��G����`]so4W����{��������N�p#W�:x� l^���7d����Nz{Y]4r�����RP�L�<���w~���:���;��xs����>�Dnŷӱ}�����v*���պl=�{�1r�}��]�^��l�;Y[� `�9���Z{�l>�}m̂��6vd��<�{6�RpN�y��i���S5Gϵ�ǹ��uWs�Ќ��\w��S��R���]%��TW��� TI�ᦒi��r�s-�tl��9�_:u���!��x,�+OKg�v{K+5�'N9u9���Q���;��4U���j���P������O6vO�>�Ύ5��]�mϴ�ٵ��5 ,��PWs�� x4��>p�����l& �R�ƌ���<�vM�|���X.��2�M����P(I��l��ӓ��% �p�/�c��s�9#ثk� F�IC~�.�<����� B����|%���f��%�A !�����q%�v���P�$y3��r !I�\ᦌL�29�����+�2Ba�OEHEH�8.�j��*zqa�_�)�ޣ�c�M]�������`�'c�wB�%P�+0P�(��au'i�pr�1�}�,�3� ��@Џ�4 P����q�%_P�0e��>=�6����l�@�������i´h�� ��)� �����bP�'jeR����(��l���� �T:PT\ �Y1xx�z �8� J��_��z�b��H�����e����w|��/=����{�ˢ�t�Oy�cH��燐a�T�Z���+�P,��%:�y�+K3qN�OY�쥥o-��9�������������rZ�E��u����S]��G uu�o��dw���w��}r�� �N}��_[�ZS��C �vn�t�<ھ�N]j;�ykSW���n=ݡb�����w�8s���Lxg�������S���s ���}�k˷�ۇ����;���z����~�L��0�;q�vǚ�>�i:�wъ��G�<y��O�f�C+^�6�h:�l��C�N5�E��{���:���7_hhڰbek6s��Vm=Rw�I�w��֥�O4��^w�>!�cɼ-����|���Y�ݞx��k �\3O�$�tj�Uo�{:��p`�ʵ�.^P�x�Uk�t�ΓK>���~�wu_i_w�}���~~���M+��k�my��5��-��`���sY�?�R��M�Mk�툹�Kc���/ݵ����3���)`�;p�0/ּ����l9��vj�{���ն�?�t��VU���t��k6��{Ǜۏl���y�bm'���Zw�/��E�/���85��55���_u8����E�5G>x{�5����|�y�u�}n١���_��𗔗�u��,_}�j���^Y�E��m��^��i�{�gcӺӭY�ȶ��G�ޖ�.��O�ܻb��;�_�T���d㾵��_�:����кeo,�ˡ���7�՞�rxӆ����c-\�gϊ���6�ٻ��]��6-Y������B����}�W�?�w���dw��ͻO�>�g��n���/Z�Н�^�뗷^m=S���yA�N�^����k�6.^v����7�ݺb����@�>s������z��O�bٮ��V���+U�\9��Ύ�m��?uzņ��d뇋W��w�����_yj��ޞ��J���+�o<�t���C�O�27��)%�Af��!�ո\��` Hda3�u���C�_ Kr4�˄�P�B�=���(�(�q�@���Z�L$I 8BcW"+�ɁDT9LT#�+w4�+CQ�U;����4�U B���L�L��!JfX8��Ǵm� �����$�E��P����pm(*�I�N��D嶠 ��6���̴����V�i��!a���$�@_a�"�h��2,�d�U�2�Je.�d�aО0ۻ�2M&��p$"y!�R�т��0�� V5�vzkY�����'`�HJ��X��Ǵ��꾒ԇ�?�(��*(R1�H1�j���S/,���8fH���w^{���7��ɡL������3d���jʰ5����t2e�����j�ʪ���.ñ!�L�s��t� �����e0�t�;����km/���G5]�� �]��6kL ER"U�o�1�_zzŞ�%}��6�(�$�����z��~���Zۡ=�������թ�g�T^��K�z���$�Us��w����{R���`=�8�{���~���?]2��ݺ�/��o���<�� �UT�b�vy��7���^ܳ��<` ݶbm���##&�I���9?�?�?-G�(z�ة7�q���L�7���D_�tK<��T�����A�O���{Ѱk��R���Pqaǻ��?��;w�܊���~�' �-�S6v`۩#�7l������{_�Id��,�I������z�n�]�|�g?zd$i��ǣw�q�g�9v��w�QY$:h�w���w 5?��D���??6�䞽�4,�{�MJ��%y�UF��gz��2M�� �������'�N�ߺ���'�������f���W ��#�kg���}Ƶ3� G��U��Z50z��s�2��'��ʒ�m ���aiC����/�7����so����.'�~�[Ç '??o���b���#J����_��Ͼ��n[��G���5���q��������, ������dj� �9y��B��v%�Cp&(�],y��в|<�w�̖�ß�$�V{�X�*��~��W���pՊ}ne_��ض�G{�:���~�;�W.���� ���?$��zv�?��'ߛua��l@�����qw=8gľ-g��?����:�qͱ���eź��)�U��W�#�@���mE� ~�o���@��(���Ğ�'���Ə�W�yʵns�C��/μz�� |�����g�ժ���/��>P[s66ht����;x�M7��_^�:����28���7l�o3��#�~�C*J�OG бP �dR�g���P��候"sU6B�ɪ��MS鰪ǹ�%�D����H�9���)���1��k� K�)��yy:C�iF,��MWt>�lv�A� s�Y�t�,��c[ND�E9*�z����$���%� � �T�"��IF��f�����)D°�'�r-;(c�skP$I�U�譶ېH6�v!�"�Aԑe�=�����$c@�?V�I-W� L��X!\S�*�� �L���pi2�Q|��c#��9���h7PKW8�\�����0�T��7�4�G](����!Qu�s�2zΔ�j�k#F@����x�{߸g@���_�sbA崯>6�y_��#Cʆ=�G����M�ȟtǣS���ۿ��;��mw�4��3���n�hO�����)�5P�B0J�>_�ƣUAA�K)u]:���?|�`��対^�'S���-� x:�v#3�?�턒~�B��~�Ή�Z�17M3v�_�g"u\��#��po�R�B8T ���[vԘ"�Je}~<'ԯ< 'jP%�-�\[f8��udU!8wT�̄�'�=w�<x���=8��9�n}���`^��&�{R!p��x���� "�W�t�:nR���m� Kܴ��c=`k}K� Cՠ������e!������r7c2���T�1qPN�w�\0KEM�����2��9#��e=��4ӕ�6c�̓c'��ܰ���'�Y@$�3��'I�H�:3�����b ˹���1�(5$5ir2��u�����k��8sb��\?'2���K�>hK�AMa� �9�$Ӂ�ѷ�3C�7�^��ф^xjI�S�x"�ߋ[6�l�f���hK���ޟk���-M�Q&ٕ�8���d����v�ߕ/��|�ё���˖��BY��L[�@�\S�Ͻ�w�? .�R��<`J�J��ɬ�H���T��:Thx @��g�so��X�z[}xx*��.$�WnF Y����4�w�1���/���I�za�9~nX����.��BL3���vʅH4�H��Q��-Xu�7�Ȥeg����g��m�5u�~�H����aUBC�15���H�N�\���A� iBYilC����7�w}�H��m{OP'�N��ˏ����ɸ��W�=����U����!�tE�.s��_��`��1#Cs,˲]��8�u�7���N&i�)Y�c�R�� F�'I��2*�2`T���g�s�Q�R��u q� Q����fTYB���芬"�g�&R��ܷB�2¥X`����I�c�����"Ib������H20�r쩤�a�\�2͐�IҶ�qs�L���ದ � �\sL0F`��X �<i�1�8H\����`ٴ�I$�N�`��>���zY�%��6�S6c��I��â@m� s��惰mw�-���T |Sod�7�ds�3l��fp۶��!�g\߮<���y��N�A��:b�]�L�O(��������\�r�笨�"�P8���o<͵kW���(@��ǿ�����zdZ�Rz�]�xG�~�ţ'�]��S�q_كw�ݻx=c���@�Ν����m�;�U1b����<3�#{��/=6*�����N4�)����S�}�Z;XѨ�ʼn�ۼ��D�]�����zV.�:�˳�g����������A��ٓ�l[�EK�N�V�(p�\228����ǖ����b���7$S�(5S�p3��:�����kJ��mʚ�$��w��uᲤ����gb�[�σ���_i�\��X[��/B/�Cf�쯟.��ۯm_k�7.�Rz�J��6�CgL�Z��g ����Y�o>y�ď�C�������EK��A����v�� űb��;o�[��M�dRbw\ٳ�/(( ��M7 ^�������W��H��/�E��[�d��c��`��M�E%J֯\zd�ӷ�*]��g1�s���L��P�ѱc�.-?/?�%�p���' Gqۛ��� :��_��z��Ղ2x�mw�lxg�sO���/�r��N�@��.0ʸ�( q��MMf� A]K���=eXV�X͞�j~$�*x���[�{j*w�!ͫ�{��6o��KΙ�S�ݒ20J#e3���$�z��_I0��4���矩{�Ï�.l~��?U`B�_N&P|���5O=�����s���~���Dd�@�cG�^8zR� �� ���H٠��AB��y�i���;�L�x�]s�מ~����:�W��1J)Ipǡ�Y"�&�=·�+����h8�2��W�6\J]��T�Z�:��ףyy�wad���J8�u] Hd���!̥#$c�v��aTF.5�����Ub�4$,� �'KA�g��w} @0�SK�& �лPGR$�ɞ�Zp̱u ���!#H\�� ^�(9c���Y�1�tpg�c�z&�8T013�N���|6�� �mY�DT��+"#� n�V�R��r�u�vl�O,�0`�Ba�L� �8.u��)*FȦX�"+�S!q�}C�gr!8U"�A� #�H!�4�2ٯI&I�Ԕ-�e! ��$B8��/5��H��;�t:�]���k�'���G�|�h�F7��Ͳ뺐]YV�J��n�K�m�-�.@JKKi�mB�gg�c:�N�������$=w��9'��L��`��B��+�J��,n���˵��C��(���ф˝P�d�b�\S���K)�/��um1˱Bb(m�l{�GB�R؏�V"���mw�P��,L/n����nw��l&#�j��Dx�2z����i�E>C�0a) *K�{K����`rbV@�F�N����ZE�i^�<�Y\:dJU)�2| X�+ e<�_�ܗ��(�W����F�Gu�����v:��x;8�]ڼȫ�N���E�(�xrv? �2YX|"#W�nc�;K)��n�7J�BY���1��S1ę�䛕*�W������&��H�\w����j����-D�g�l��\���X�S�x�Wi� ͢�T<�� ��ji;��d��J�\�� �����2%��e�b4]_p��7P����q���`i N� l Bp��|^�����./�Sl'M#��2�������,�>�y���n��9H�Q`�l�\-���������x'��w�yrcnv5��_�Y������VE���5�oYB����c��*�9��&q4#� o���\q�X(<�L��<=H!�����p�_�d���j��c9�X������O�z��0{랹�h ��u�g�*-�<����`m�ݦ��jswk�ͦ�w��z���JS��u��S�0tu��NӅc��|iW��Rݸ���ln�A�Y�䥦A-aǀ�R��嗇��N\�4j ���A�v5�����ۨ�ye�f�2�M��j\����a������ ��E���H Z���ۍj;.>�7j5=<1�N�P�!�UG�,�1�Ta�F��`'��Z�i���o1���g��/Ԡ���E��Q�̪�͂�,�HS������Qk���N>l���4N��A��t`Ѐ `���jr��L`C����t�T�c�C��n2��5�Ro�E�70�I�֓8���C�����Lt��z�N��s���i��=���wZ0h1L���3����ÏM��G"�����������=���;�B#""0� A��(Y�)ٖ��]��ǻ[[�S�[[e�g�v�kym�J#+P�(Rf� @0��D"r�htx���g�`�\c�$/MKb����{�λ������|zzA3s���ADc��n��o~�HMEȭx���z[�q3�z��۴�����ɉ���)�����w~���(��TF�ag��$e��p�����^�ҡ��' ��s$�P'�a��:�8���-JsPO{s�Ⱥze�4eb_Ǖ��z��.Pu�#5Æ�<�2��ZX��Ӹ4���}�n9�m-\*E�u|�ڴ�t$fa�<�a�,�)=��C~%���'뵔Й�m=3���|Xp֒$����*� �W*�+#���f�� b��?�:Ǧ��j)C g��,�s���Sl�b1�pI#M�BV�*���Fb��I���J���\.��u�oAZCH�Zm�T1�} <)$��i��A��8N��D��X:��љ�w��&���Z��g�&Om/>e�(˲� �1�������{�u�%>Fc�g}�w�|�rŶܯ�|q�*�\�x:��H��O�$�E&�YK͢S.��8�Z�~.I�hd�J��j"�y^�4��ښ�\��H�(�8N�$X���,�pc VJ�^��<��Y�b�KS��vN;8�ڕ�<�l���Y�JM���� ���H�h x�3���R�3��y�z�0���LRO��a"�0��p6�[m�����r�b�W����F�c��6M�V2��I���eKR1;c�H),�I��G�Ҷ;W���R6*���@K"rL��! !�?�1D�e�cr���CJ)��!(��v�$ĩ�FbXi�`����$�fw�z� ���F���t�4k�3g�7�z�Z̅aH)���Z�TDB�APsZ0ClR�+E����!Y�F�1�LR� ��13�!2�rA>�������Y,���-E�ն�����VJ�� ��sQ{k����$ �ȗ�� =_�HA$��|%198�)H��L�C +,�`�Ny~#˜sJ\kn!�<f�N;6����M��d(��=��ד4KTh��ZJ*�lhЀ�ȷl=�9v���!�8n6�ٌq�EM�?��3f����̒V�2#�cc� � F%V8xJ�j�$ɤ���e/�d�D��cOJIOe&�l�����2�\>#��FC ��9a�hm- U�q��C'UX*��HM' �(P��R#.�����T���v�BI�r'Q[ʩ�F����BkW��(zNۑ�:�X(�sQ}d(�BGF�4 �@ɚ��$�u��g\FL�h�B[�zĎ��U�<�D�`k2��ҲpBXbA1�Y��Y�- JM:0x%̇�'���8[O��3R�X�s.��c~��NB��W����� �'�*�c\���[�������;prd�9?x�خ�I��y}��q���#���-~��{��_����,1f�k�y���B� �=�v�L -~`Ǚ�˲L3A�K�6@$���4�R�2i%?*�ɴ1i=+�KAT�Y�9G���=�4$��Y|�\,��U�!�s֖����q��Wtj2D~�r�hA"�U���jZ/� I:��a-�`��X��j+�h[v ͎Y �Y�X��-%'���RO㬡(J�' �AdY[ˎ� H[�j̲`(�IgDp���@�lt���K�H�s���`�yN �����}Q�g5/K���@����D�� �x�s?A�)xb_{���L����O`�J���x�;��U�Y�?39��?���'p���G�O���m��n[��#o�x��t������xn ���y�Y̻���E��Ǐ/�SO=qp��cT������j�O�1\���q].�'��V���>Upu]�A�u���s���c�E)�Y�1��,;#����:Ȓ8���Y9+B�end��<�wR�Mإ�!��mI�$y`@;'��HG[ǒ�3�#�*@wt�^&T��~\&�R�Q�3�l�qJ@@�j�#Z#VR�)���BT�VG%V�'+��"u�2448Е ���Y蟮_aV�mJ0V+a��p�[����G��I#O$��X���*!�1�IX_��5�)k�s�'�^B��DE�8e� �:X���H0�2V�R��r2��{��2]�n�w���ٸ��o}�99e����c�7�Y7NM�{Ү�y!aT��7�T'^�}��l��g��p_��3o���f��̝K&Fz�ŭ{O ���&�x��~�o����O������˾���h�=/~c_p�n�}���:�'����[N��Ջ'����'O��3�IE����7g�|���6���9n��x^�~�[��hη����/-\�OY������w{V>�zN��`�Hv���s�Җ�;w'�nZ���������]��Re�2�'��|�/f'f���fv�����o�/��'���φ3��o�o��w�jے%�#?�ɏܷl���|� gb��{�-�=K�Mo�Ϋi�s:1r��MW�{�8��aӡ��������g����m7N����e7Mo�z���έY{�Ηw��%�Od8t��'-��÷{�]�Nb�����o?��_*��TN|���|�:q��VNphdž���-���<��ÿ��9�>����%>�p���� Tl]�C�T(����vƲp̂�D��0E�uI����KC���t���Y�n��R*��4˴�(��0;$4ПĢ����G*՜RC�C����Ϛ��3�� ����TצjG�x�B ��(�CbE����� Ǚ��Y�%D�]�+O��=�ല d�8i4��tG�JSn�dR� "�셲�#$a�;X�0b�0Rk�:�1R�p I���0XA�@�q� {�I�'hoo����<�l!���� �E��I�Q�J��?��S`L�]���v���ȉ�?���]�״����w���s�J��;��{�d�v���7�X}��<_� �٤Y�f�S������m>����㚷^x��[�}�=s�C��yz0E˭kV������w�/��_�q�[<�s�c߹P�7]��מ�0��|�w�K�,��`���>wൗ_>�s۾��=��+�͜�ߴm�{o���g^7���՟��:uFwM'w���ݭ;��y�f���{���mO��>ݲ|f2\m띺`Ѽ�Q��)��͛ݞ��s�&N_����㛟�>~�x����(=t⭭�O���{{����#�������^�����'7m�� Ͻ2(�i��[��z,s�v��h/o9ݲfy�+O<�}�m�fۆ7� k��ݳ{���>�����wl�v���7��}h�������/ڞ%=����b捫�Ϛ��W�z��iY�j���hj�8���s���;��K��?��Ƨ�j Be�̑c���z $[!�Z�ˎADRI1@�X@D��j��Ԓ$�/�'�'�a.GBx��ds5�HJ N�P� j�k#����s�8s|9�N���L�AA���i�3�Zgl�}�����dYZ��4�Jr�A�3IHO���e�V��p�dum<I����Z�p�h�#ˌc8�3Q! ˹|>ʩ0r�L�nu-��e 8g��K�������,,�;�M���>���'�KR��TК+����0P��:e9�Dւ����df��#I�Sbd3@0��6�B�03�?�3I�ē�f��&,���<zW��=�߲���纵��^�K�ܾ��53�Ǐ6����b�������ʁCW� w߰lݯ}vnw{kkW:|��k� k�ݹ������*.��ݲ��Us��,�s��;�v��3Ƈl��R�C<\y�ȑ��V��z��f���DE^P(����f��.��ݱb�W�=�y�=SN�v(Y4�cĴ�=���L��{o��)�:��ܕ�W����)ȗ��0W(���b[�L0g����ng���2n����9�Q^k[ϴ�3J9�v�Y�-s�N�O�p�䱚��h������}nq�g7�O�a��Y��:v��к�eڽ������j�����:�Ү-��/������7�{z����� D���(�m��_x�Ҍ���m��;nX�Y���3S_g=S��[��S�b�M��|\%�|���m����Ɨ�T*�M�n�8w^���5k�!�r� >-ƌkk��ӓ#�[ H ��8�5�z0B`f0@�9/������e��*`�*yB*�RD~���@�ei��i��� B�*J�u�=��5uk��f�:��*��R�Y���I@I�����dN�S�|��B|�|i������1Kp�����d䇦�J�i8IRc�eG��"˜62%Dk��˅�>8R��:��DDJ2�$,;�i!�瘈|?� �2G$%)��F{���� \�JQX #Ǩ�Yf8� �����Ra9�c�q�J)��Ͽ��_��_��W��S/mx�l�zJ��#���aK�g�ձ����_c�n�\=���|�GO�N��2�������<�F(⏯'ƙ][6o?�Vm�ˤ��?��_Uʋ&�MV��olݷ��9=���{���J3���6�=��������3������WU' ������zepp(MF>�Va ��諏�G[߲���׆�����<��f/�:�w´)�͘�}�\rd��"9�{�ɑM�sgW.m:�]���;��.Z}C�qr�9�s,�8!H�qC��ĕ��>�����u\e-�<عq��G�x��Y�;g^'=���Cs|���5�&֗���U�dY�4��K������5�k��i�L�E�3;�����eM��ځ��Mz�+�mK�7�'8}|�uҕo|�ɋW��f���;���g���w6���9�2sA��{�>t����i�}�ފ��-�n���rv���q N%YR�`��`MS�rr��� �&[�TR����}dM$�c�����]f�۷?�=i�n�j�C���H)P�WIP�T�}D" J��� �`���Ap�Fc�ѐJ�С5��jq�fZL� H*9J(��� �4%(PJaV�X�" 3�,�|�f�Z�EňI1[mJ�OIʐ�:��N�Kd�Ym-�� ���1�$Ik�%(�A�J(���H�=��:uL��Q���pƉ�J"cY�L���`�2 s�*�HJ((14R�x�[v�jI7�pe�V�R� �q���<�*YJ�I��+���Q��7/�>������)o}u��T �|O*�}�obf4I)�gnذ]K)}_*5�H�.SR�.��7�f�R��29����;�Z�'�t��=�܆aH)��̦�k�����g��o���|_zW�kn��ZB]R�y�y�GA]]դF�d{߬�3{6?��'�:�7���f̌_`=˦kg;�N��?rǁ�<���~��57.w�_�>\�톥hRK���ʭO~��jOw�]��f��_��j�u�Ξ=���{�ʅ���x��6��;~���y�Y{����Gg�r�q���M�1s��N8��s_�K����T�� M�<~�9���=��⪨o�ݟ[3��4�o]�����f�s���ӧNn�z�Μ>}�u+�t�8qM�Cq�w���A�p��r����������p锎t�*��^=��=�n�y��͛�ٷ����{�|�������oYo��%���kb�[x�ڶ��˺�}���Fu�,��G��ۭ�:u��Y�<��p����x�˖ܺ��<����oX;�,Фz���tN��n���`ڪ;���������Λ�3g��k��iSf.Z2�8<�є[�t��ً���<�0cTi��˦�mG�����/�|��o���۳�P�_qc��ڙZ�*�ZU;�����o4.�V��)b"�B�$�#36˜oѓ�wDy����Ff��r��T Bh�ں�]�2�W��R�!�|?�EQ�B"|勶u�fy�H��Ğ��C`�-[.�(T 2pa>RTj���b�&�_9�u` �e&B2�c*Ib�ͭH�q]]Q*���9!��Q�2�$��Z�Y�F��B/�`�JJ�)_����Z��`2�a�S��<���ƀ��lh`�'#�$l38/�S���% �&��0��|�#�̌�����p'���=���yW���ť0�?�{�vft���?qp��}dѸBf���{�ѭ����o~�{w_\�����6�����rτ%k���G_��7�\�eiΔIW�m1��L_����o=������J6�[Z�o>����M�����'�����M�@��S�)S����Σ�U}i�����x�D"��eV�ܰ�����s��������=�+;��B��Ν6o�z�z�eÙRO�9��㬱��\��ty�s�)�śZ.W�_����/n9�{�[�ѿ��(�ѿ����������J��}�/���?��2|R���~��3s��+p ������i͗�`��|"ƌ9�k��>p���Jn���%�\� ��$��=fm, �29N�r{4��g(���?N�����)�H�p`�:"��r5N��I���j��23���.ÂA� ��p�uw�<$kk�z���H�� h�&(�g��Z(�C���<9082X7"3�a�D��#"���ˀ�z�����6�� �z:08b�<eyo\� �,�+�J��\���|XEur�/ �i�vE��S�����,E���C{����[�.W�/�GR�F�"A��f�eFAx��O$�c �OI����yJ�^=nH�Z'M ��'N�(>>Y��6:���T��r� ������ʹܼe���ք�Y�g]���{���;��?�晷_ݸi���^�����g������C���w<�\n|��ڇ�q��-'�o ������뎿�aO��km� �Z�uN�8��y�M;���&����ߵ�����ԁ}gn|����}���{w�o���ؙ����C�6�o~��N�9z�̈����g.=�u���U�l}���.7殺qŲ%��+��ٺme!��X�.�J|��~�e�+��7>x�R|��~�=�{W����]�}�]�d�3Fr��z��W,X�^�ި�I�y�c8b����uv,� A�84��mvWw�R� �7�0�S*�I��FR3)�^���x�n�H A$��Yf�� FR�3c4�B�͇��9?Pm���LB� (_X� �8N�Z�e:��k:����"5�yJ9fgC�� U@����|pR������Ce�`f���l�^��T��K�6�Z�Y�>$%y��%�I�fY�l��! D����',���1ڎ�8Gp섃��u�Ƶ���m.\p� " �Bt:�s�UsOﬡ��_9q��=�e��1Iwl�⬹�]%�s��E;nʢ�3��������S�w�}p�BGϔ���֏�Y��:iޤqo��L8"��t��g�\1��֖r(�J�哗1�WQv����.�̟�;ubO�������guwaRO4m�n�r�R��e�&u�L�;�o�q�[w_����V�uk9�8���|���w�"�|NeQ��/vM�;���/��tN]�v���(Ny��L������=u>Ym�V~y�!�t���5f�"Q�j��F�Z�N�!"O8�H�r�Ap�XI���.��i�J�ȋ�0���F�V�8�Ϟ=G��k)����ˆ@`r,,R���=�s%����,Dk���Z��9_�X��Z�Ԝ ڑ՜S0�&�F��Mk$��Bj8&m���v�t�W�A�Z�J�/=Y�qΧ����yJk8�>`� �i qVF�����9I`F J)Xc�)%3k�Z�*�Y�r�n�O��<&�8}/�A�5�%@Ħ(Dh��`�%`-;�����P�0�W�L���V���fO���9�g��Ep����O��� {ӎ���\ؽ�g�<0���O��?�싛��^75�?=8R�K3dCC�q=&2�6���/^>�r�h"�qS:l�5�2o�g���o��?�//�8��ƾ�o���S��F�i��S����Uu\�6tV�|i�ش�¥�Eu�R=�(ҹg~��+�[�Ԫ�8����H�W�����_����7���ط���g`�ſ�1cƌq̥b��\n�S�Y����(�C�L�$$H���:c��*�/�_֍�r$b]P�Y7��X���.�bk�L[��1��Uk�$�J�����������E�LT#-��G��$���hǥr)� %�|�1L E^{���g���1K)�@�TP���0�<�T�P �g @�rN2��X�*��@��$&iPB�B8�2 ����� _��Zm�'�dHb@;g��R����5l�E��Bz�$)��7[xF]�\gg'}44A}��8��u��Z��;�Q���-���r��='�� ��������~|*���Փr|���w���CKfu�>����ߝ��5�zW���܊u�KX���RE���i��O�>Q}�˿3��\H%���fF��?_���]���=���k/?��#����UoZ'���\u�rŹ�W���z�p����ض,�5��L��'_�-[{��y��8S�{���7��g[��]���r�1kz��2i�T�3 ¿�1cƌq���#0���ZNSk|��|$�j�+&bҀ�����g�`��Yv�R={6QY.�K93�'[��y�Bp�U*U_y>�9��I�����T#Ξ��+�aӰ� �HS�В�NT�G�p����Rm�Tg�u֣�Ff3�v�.r"礵�'$YXi�K@XC�@��lm ��T�`/l� �9)Bj�.�&��G~Fl�2��8g\��$�Y"&h��T<)�e�5�W@k�FƱdˎ$i�� �>�R��6��k� g (Ǭ�RTי���?�3� ����|�,#��e�%��5Ky�'0��� �=4eY�>�t�y��Z��,��G�����NSG��|%�dufX���eZ�\�� =d���e�YJ~��Ր�a�4�=�����f���>�w�8�ך<f̘1��o���W��(`����5�7�P��C � �Ha���N��4�A3��q�������RО�7�Fh���Ȁ����L` �:T�y�%� �hu�?z#�6s�q3���.����f�P@\i&?��Gf! �p�y�� �I��Ț�7�i��"7S5�@�ѭkèc@?�7W�?�{�̡7�/|�| �������$��GA{��_m�2��P�$�33�� �����?�~?��ß7]��1BW?��笽cjQf�+�3f̘�2|��M�X� �A��Ж-@����� `@�ff��B�-�̴���#�L�/�֞T� ����z"�����s(���$9_I���s.�l����$A�k�6�b�u�2�0��I �����Lz�#�t� 0AH��* |�aa3۰.��b`�CA�XP�ЎH %E`�$�m,Ss5���` q�} �N:0�� �p� ��0v$��/�$�a�$L�eB쎓R[[gG��'��~ډ�<"��w��~���9���ׅ���d���&����;���(J������8,�� c��P`q�7y��a�yY��ݦа�.\1ޥ4n�4�\s�_�)�w���a�@�`���3K�W;���v!v���� /�x ���'��I���T�?1�:�Ď��l�+��`c�f!�Bb$��}�R{�k��vOW>��Q���:�s��s�O�<��m�hQ]��78�P�|A��ecN2���+�T+W����[��,l��*�D8�����>�bA��� =�,�J:��i��i��Y�l�Dn)Wv��T���_x�����q)d;?��k�?�[f�S�;�w+���x*��l��p���+z�_I��|k����bɕ���j�mx60��28��G�� m}u�����>~��?t�C]C2�Y}�+T�p*���uFU[��'jk�K��̏,!ht*��};��5�0���]��i�Ή�����`R���[p�B@Àwa��C��aosm�k�\ޅ7/j:�6~��&�_���dh|�T�/P�j��Ɲ���t ~�v멭�"�wwO�ۀ�G�Ӂ�9��C!�Jbj��?%�v�,;���g�п�V�{��ց��xW�p� ~p`���Y������}T^r���hp����}��YY���?���Xŵ?�{�jp���٭on=l���ԋꪊ�M�l-�{+���d���7�ܫ�fz����?�}$�ؚn�]�Di�F|Eo�-�2aMՃon?��m����ŷ�*u��#����h��ymz�?�u����e=&����,z�������jz��`P+��}�nU�ڴ=���.o�)�v���v�N�#�(�����+���ƫa�B6���[� ���E�kOoި�lK/��~��;��mLv���O�GwM띝C��8�VE�bHdR��~�ՃFM $Xzj�]��@����u?y�=,h��7�j�3)1�F#ZՓwo���C�:2@�b���a���6a��fz*�����*�%x��|�V���ֹc =���c0�R���͛Z�T�D��k_<Zq�fg��G�n<��ƵYw���L,=d���pc?��tߍ/���;<Q��]pȪ���QUm�jcM.{�䇯oW-��7������J�~y�[��p�;�A#"�O`_mzt������5Q�W��U�2���Uu���=â-B770 ���.��V熚�}~^�L��厮���wFDf�����o<^����k�oHm���6%�����w&Vv�۪���ݿ�2����{z�۩�쮮�����-GH�H������R��l6 0����}3!aov��q���WJʩ��{�͛AR*��ꏡ�pF��4U��F�������y��2��u[��<#�Wnke���;(UE�ڥ~u��w?4� ��=�`,�F~9p`����.�����8R*vc�{jyz�C g3��7�#wye��w��Ă[Ɲ��313ūh���v��3����$NvF& �k�|M�A��iz#���Q�����14/#��&"#Ù��kb^96�8c�rmc�`�},����p˚�K��]�s3�I��d�E�,�0;Ų����7�,��Լꢰ�������W/p.�7�<�\>�̀��;6XQ�q���G��o(���Z��Dz$��}T��|7��*^^�ilr�f���[z�%���K�t"����1�ݚ'�Hn>ju�wb���E�����A��ɴ����cұv�6��l�m�֯t6 �e V�jG��|�Vo����y���8֡d���Ɓ�u�.�15U���]�i v����t���6���X�^D�M.*�� R�Զ��t�H�nY}�J�=����"^V����3~����v�ξ�����æ����iS^��qՌB�Y�p �4Z�z��L�kG�YZQS��\w���dU�������=?���A>��?c/d�<fh�� 86�������=o_:r숬���������bs� �Z��89,��l�ks�m�Mx�[]q/|^9��sVx��D2��P��6>� n�o��ύO*�9�շn�TE��F�f�ͽ��S���,V�`SÊ7���4w�TK͍ "�!����L[ӄ�pF6"�T� ��y��Cu��yQ�� 8/����A� �X�gqs7)�o��ꐅ���� 2��;�+;�� �Ҿ�q�T,^��M�S�yՂ�ud՛K硧��*�⣷ۺG�ܬD �_ �n��9����F[�7T�r��PQa�4���&\<Q|��tta|�ji�������<�{��Q�P����!F��%���N �g.�_z� G�ii<�1���1ֹ�ʎ����#����X�u��X�ӏBC`n����D<������ ?��^t��$�A50%W��l���D#Ӓ��Tp��[�H��訠7l�>���K!�g�� , �e�qx�ǚ7��ز�O^���S+�A��ˏ�;JG�"�eS�](?�~)ۯ�C��9l ]�=� �Q�(`[��]�է�h�P�*��x��gG�r ������'��>8�w��`��b{L��v����`�%�rN���1g��6�z7b��$�d���`� � J�;�aY��R@?1'Z]XS��P"X[�\R,����p�ي�/:y����v��u�,�?-/�������%�_Ԙ��(DL,�w��Q��}P|t!.nW*�!�����<���x�?:Sz$��k66����v25��䗖=��L�m*.6��.`V���ܒc%��0�B�c��1d|P~�⯏r��AOR���u��XFZB�D4�� 8\6��b�����U|���1�.��x��Ь�P�X Id�]���|��:;���'�?���D���8��[~�Dq�p��H��--*.�Hw�,�ϩ�j�( e����c�N$����� 'e�.)�Ǒ<6wɔ���l�w[I�p�詂x��RC�����Dl4��^:�H���5�#Wϟ�M�f�E1x�4"�`4�%q`�<f�����is�`O�k�c�tr<-.59������0�1��q�do��-���_���d,`�ڜ�yϼ��Ʋ(�4�@�Z<99����D X 6��aܳ8�A�Q>;cqE��i�:\NO���2�V�'2;ލ%����.{�6���r��V�n����~Vg���Y�6�������m^�awÐz��4�0(��L�*�yq�V���0÷�a�x���� �ف;�s�v�#P+fB��B2��G�DË�y�D����o�3Y]�ۊhJtP;.Q�L�@(���5���εkc��M���$��s�;c�3�,��ȰB2�p4�_��o�F��ju; �����IŽ"��n�L�|n�#��P��A�q��͇��,��`��5,?/Ż���-�A�U�������Z�����q�TAl ������|.�����PL�~���J��z��Cb��B#%$�Ynzv�e]7@�O䫺Zz��}v+���ql�*��i p�]n�~W�w"�b<��BOO�eg��i�r^(�{�Q��+�Et|�K��R)�4N|"!�Sv*R1 Z�Yԙ�ߚV���hSA��0C��>_���a��t/56�E�1�p�btH!jAD�^\XZ^Tml a�r�~}C�JbQ`:����w:��M�&`�X�n���r��F�7���✫��+��)����D�O��I���0?ޭ�w�D�#I�F�w?��g�#5�s�b���l��*�:����s�s���I���#Ǹ�z���:&�f� �Eq��� f�g!���IG��G�?|�R�O54���E�*%���xzo`QK��^�r�4��k u�ܩ�$z (<��u(��j��ۧ��Qњ���3��"�a3���d���+6��O��&�8�h0���䧄߇��s��L�s�I }6��I�ŧry$�$����� :�+������3X�W��iɱ�y�u��]���C<6÷!2�s�f�������,.�NK`�S�y�r�=òu~a���� �K��N����tj���o'��S��� ���ds�}�q�\9!�����/�*a&%2h����.��<}L+(�qN�9n��U��'�K�|��zYɇ�����t.4t`~^"��rX+>.1���M6d���1Ói9!+�z�pRG�5�QoBNQ3 ��Q��]��`��� �z6�g�+/���l���֣��c%x�D�DOf�s���ˎ�@� q��ĭ�V��'���+9�Cz��o�D��Q���� ��K����*7�Ŀ\>22ҷ���D&�I��pI�D2=���\�i`L@�E�*��_��&�c�a�n�=�nS��?8�y|� �ȅR>>,���_�\W�,8����B�`�{{(9��]^���&|�(Ff@6+� ��叓��g�˅�����;�����'�ё��e��5�J� ?���M%�r����\�L~5���ݿ�A 9,$~x�x��N��fd��ҭ����`��پ�օ#�]�ͥ\�F�4c�qB�R�2����Ex�º#���t?�Ԓ3�:Y��5^'q��i��A�?��%�����y��yAr;��_��OLY��G;�cg��XԮԲT��4a�EHиլ�A�&����=�yW���e[�ح�V(�v����2C����N�t/$�k� �>�9���a�=����6��ځ��'�v�J�p��(�8S,G��6�|o��Ϳr�g{�CY�t�}�* ��u��A%��#4�LA�$����e ���ˬ,<t��o�p',�֏2�ʏ(.�qO���Y��r�K�!F @�����$:�r�/�JPt�ZQ�E�_g�`�v�7�{�>�\���h���C�����;�C��W{s]K7��A{WoA�<����G���?0<G�$�)K^W�Վ� �_/"$�����E�2�8��ʫ�t�[�P��&���3���]KM�e�R�X�7�t���+Pz�TI�bv����*c��Fc����m�)�9�:t��1�Ev���Z�of'�r����c���9�,xǜ����ᙋAQ��j�i����n��y���>�V/�,�� ��p��֞�iX@�`�-ڦ�MRcM�Ȭ_�cI�W�>�}+��i>3f�-n.زx�v=��kU�pՍ���"�7��}Q�@,��6�-�z*D*�g[]��!�4V\(o����UV�p�����]|3l�ع� �)���ڶ�;�G�h��{5�lV&�v�9�V)���(���@"�?_�K�!�*�XEم�[����tu�ӧ�ӗ�G�/w����XqNv��d��m��d��ݬ(�N}c�<�l�h�>YH�g�x��)�;��ݍ����&���C�������{<}�bO�F�&K$)B���!��G���g&Sf��]�������P�p�*S�V�Ϲ�b�=?4�DTYr��IEND�B`�PK���\_�3��templates/beez3/jsstrings.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ JText::script('TPL_BEEZ3_ALTOPEN'); JText::script('TPL_BEEZ3_ALTCLOSE'); JText::script('TPL_BEEZ3_TEXTRIGHTOPEN'); JText::script('TPL_BEEZ3_TEXTRIGHTCLOSE'); JText::script('TPL_BEEZ3_FONTSIZE'); JText::script('TPL_BEEZ3_BIGGER'); JText::script('TPL_BEEZ3_RESET'); JText::script('TPL_BEEZ3_SMALLER'); JText::script('TPL_BEEZ3_INCREASE_SIZE'); JText::script('TPL_BEEZ3_REVERT_STYLES_TO_DEFAULT'); JText::script('TPL_BEEZ3_DECREASE_SIZE'); JText::script('TPL_BEEZ3_OPENMENU'); JText::script('TPL_BEEZ3_CLOSEMENU'); ?> <script type="text/javascript"> var big = '<?php echo (int) $this->params->get('wrapperLarge'); ?>%'; var small = '<?php echo (int) $this->params->get('wrapperSmall'); ?>%'; var bildauf = '<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/plus.png'; var bildzu = '<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/minus.png'; var rightopen = '<?php echo JText::_('TPL_BEEZ3_TEXTRIGHTOPEN', true); ?>'; var rightclose = '<?php echo JText::_('TPL_BEEZ3_TEXTRIGHTCLOSE', true); ?>'; var altopen = '<?php echo JText::_('TPL_BEEZ3_ALTOPEN', true); ?>'; var altclose = '<?php echo JText::_('TPL_BEEZ3_ALTCLOSE', true); ?>'; </script> PK���\{.Zl#l#templates/beez3/index.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // No direct access. defined('_JEXEC') or die; JLoader::import('joomla.filesystem.file'); // Check modules $showRightColumn = ($this->countModules('position-3') or $this->countModules('position-6') or $this->countModules('position-8')); $showbottom = ($this->countModules('position-9') or $this->countModules('position-10') or $this->countModules('position-11')); $showleft = ($this->countModules('position-4') or $this->countModules('position-7') or $this->countModules('position-5')); if ($showRightColumn == 0 and $showleft == 0) { $showno = 0; } JHtml::_('behavior.framework', true); // Get params $color = $this->params->get('templatecolor'); $logo = $this->params->get('logo'); $navposition = $this->params->get('navposition'); $headerImage = $this->params->get('headerImage'); $doc = JFactory::getDocument(); $app = JFactory::getApplication(); $templateparams = $app->getTemplate(true)->params; $config = JFactory::getConfig(); $bootstrap = explode(',', $templateparams->get('bootstrap')); $jinput = JFactory::getApplication()->input; $option = $jinput->get('option', '', 'cmd'); if (in_array($option, $bootstrap)) { // Load optional rtl Bootstrap css and Bootstrap bugfixes JHtml::_('bootstrap.loadCss', true, $this->direction); } $doc->addStyleSheet($this->baseurl . '/templates/system/css/system.css'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/position.css', $type = 'text/css', $media = 'screen,projection'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/layout.css', $type = 'text/css', $media = 'screen,projection'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/print.css', $type = 'text/css', $media = 'print'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/general.css', $type = 'text/css', $media = 'screen,projection'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/' . htmlspecialchars($color) . '.css', $type = 'text/css', $media = 'screen,projection'); if ($this->direction == 'rtl') { $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template_rtl.css'); if (file_exists(JPATH_SITE . '/templates/' . $this->template . '/css/' . $color . '_rtl.css')) { $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/' . htmlspecialchars($color) . '_rtl.css'); } } JHtml::_('bootstrap.framework'); $doc->addScript($this->baseurl . '/templates/' . $this->template . '/javascript/md_stylechanger.js', 'text/javascript'); $doc->addScript($this->baseurl . '/templates/' . $this->template . '/javascript/hide.js', 'text/javascript'); $doc->addScript($this->baseurl . '/templates/' . $this->template . '/javascript/respond.src.js', 'text/javascript'); $doc->addScript($this->baseurl . '/templates/' . $this->template . '/javascript/template.js', 'text/javascript'); ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" > <head> <?php require __DIR__ . '/jsstrings.php';?> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=yes"/> <meta name="HandheldFriendly" content="true" /> <meta name="apple-mobile-web-app-capable" content="YES" /> <jdoc:include type="head" /> <!--[if IE 7]> <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/ie7only.css" rel="stylesheet" type="text/css" /> <![endif]--> </head> <body id="shadow"> <?php if ($color == 'image'):?> <style type="text/css"> .logoheader { background:url('<?php echo $this->baseurl . '/' . htmlspecialchars($headerImage); ?>') no-repeat right; } body { background: <?php echo $templateparams->get('backgroundcolor'); ?>; } </style> <?php endif; ?> <div id="all"> <div id="back"> <header id="header"> <div class="logoheader"> <h1 id="logo"> <?php if ($logo) : ?> <img src="<?php echo $this->baseurl; ?>/<?php echo htmlspecialchars($logo); ?>" alt="<?php echo htmlspecialchars($templateparams->get('sitetitle')); ?>" /> <?php endif;?> <?php if (!$logo AND $templateparams->get('sitetitle')) : ?> <?php echo htmlspecialchars($templateparams->get('sitetitle')); ?> <?php elseif (!$logo AND $config->get('sitename')) : ?> <?php echo htmlspecialchars($config->get('sitename')); ?> <?php endif; ?> <span class="header1"> <?php echo htmlspecialchars($templateparams->get('sitedescription')); ?> </span></h1> </div><!-- end logoheader --> <ul class="skiplinks"> <li><a href="#main" class="u2"><?php echo JText::_('TPL_BEEZ3_SKIP_TO_CONTENT'); ?></a></li> <li><a href="#nav" class="u2"><?php echo JText::_('TPL_BEEZ3_JUMP_TO_NAV'); ?></a></li> <?php if ($showRightColumn) : ?> <li><a href="#right" class="u2"><?php echo JText::_('TPL_BEEZ3_JUMP_TO_INFO'); ?></a></li> <?php endif; ?> </ul> <h2 class="unseen"><?php echo JText::_('TPL_BEEZ3_NAV_VIEW_SEARCH'); ?></h2> <h3 class="unseen"><?php echo JText::_('TPL_BEEZ3_NAVIGATION'); ?></h3> <jdoc:include type="modules" name="position-1" /> <div id="line"> <div id="fontsize"></div> <h3 class="unseen"><?php echo JText::_('TPL_BEEZ3_SEARCH'); ?></h3> <jdoc:include type="modules" name="position-0" /> </div> <!-- end line --> </header><!-- end header --> <div id="<?php echo $showRightColumn ? 'contentarea2' : 'contentarea'; ?>"> <div id="breadcrumbs"> <jdoc:include type="modules" name="position-2" /> </div> <?php if ($navposition == 'left' and $showleft) : ?> <nav class="left1 <?php if ($showRightColumn == null) { echo 'leftbigger';} ?>" id="nav"> <jdoc:include type="modules" name="position-7" style="beezDivision" headerLevel="3" /> <jdoc:include type="modules" name="position-4" style="beezHide" headerLevel="3" state="0 " /> <jdoc:include type="modules" name="position-5" style="beezTabs" headerLevel="2" id="3" /> </nav><!-- end navi --> <?php endif; ?> <div id="<?php echo $showRightColumn ? 'wrapper' : 'wrapper2'; ?>" <?php if (isset($showno)){echo 'class="shownocolumns"';}?>> <div id="main"> <?php if ($this->countModules('position-12')) : ?> <div id="top"> <jdoc:include type="modules" name="position-12" /> </div> <?php endif; ?> <jdoc:include type="message" /> <jdoc:include type="component" /> </div><!-- end main --> </div><!-- end wrapper --> <?php if ($showRightColumn) : ?> <div id="close"> <a href="#" onclick="auf('right')"> <span id="bild"> <?php echo JText::_('TPL_BEEZ3_TEXTRIGHTCLOSE'); ?> </span> </a> </div> <aside id="right"> <h2 class="unseen"><?php echo JText::_('TPL_BEEZ3_ADDITIONAL_INFORMATION'); ?></h2> <jdoc:include type="modules" name="position-6" style="beezDivision" headerLevel="3" /> <jdoc:include type="modules" name="position-8" style="beezDivision" headerLevel="3" /> <jdoc:include type="modules" name="position-3" style="beezDivision" headerLevel="3" /> </aside><!-- end right --> <?php endif; ?> <?php if ($navposition == 'center' and $showleft) : ?> <nav class="left <?php if ($showRightColumn == null) { echo 'leftbigger'; } ?>" id="nav" > <jdoc:include type="modules" name="position-7" style="beezDivision" headerLevel="3" /> <jdoc:include type="modules" name="position-4" style="beezHide" headerLevel="3" state="0 " /> <jdoc:include type="modules" name="position-5" style="beezTabs" headerLevel="2" id="3" /> </nav><!-- end navi --> <?php endif; ?> <div class="wrap"></div> </div> <!-- end contentarea --> </div><!-- back --> </div><!-- all --> <div id="footer-outer"> <?php if ($showbottom) : ?> <div id="footer-inner" > <div id="bottom"> <div class="box box1"> <jdoc:include type="modules" name="position-9" style="beezDivision" headerlevel="3" /></div> <div class="box box2"> <jdoc:include type="modules" name="position-10" style="beezDivision" headerlevel="3" /></div> <div class="box box3"> <jdoc:include type="modules" name="position-11" style="beezDivision" headerlevel="3" /></div> </div> </div> <?php endif; ?> <div id="footer-sub"> <footer id="footer"> <jdoc:include type="modules" name="position-14" /> </footer><!-- end footer --> </div> </div> <jdoc:include type="modules" name="debug" /> </body> </html> PK���\" ����templates/beez3/favicon.iconu�[����PNG IHDR�asRGB��� pHYs��$iTXtXML:com.adobe.xmp<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/"> <tiff:ResolutionUnit>2</tiff:ResolutionUnit> <tiff:Compression>5</tiff:Compression> <tiff:XResolution>72</tiff:XResolution> <tiff:Orientation>1</tiff:Orientation> <tiff:YResolution>72</tiff:YResolution> <exif:PixelXDimension>16</exif:PixelXDimension> <exif:ColorSpace>1</exif:ColorSpace> <exif:PixelYDimension>16</exif:PixelYDimension> <dc:subject> <rdf:Seq/> </dc:subject> <xmp:ModifyDate>2015:03:15 13:03:46</xmp:ModifyDate> <xmp:CreatorTool>Pixelmator 3.3.1</xmp:CreatorTool> </rdf:Description> </rdf:RDF> </x:xmpmeta> >Iv]XIDAT8}�]h\E�ϙ�{wﺻI]m�XClK4�RE�w-E��(->�f|)y�~(Z�"ȢA�R�h�Z�B46M��-$ӆ6&-k41����c�xn��S��\����s��g;^��t}�Pc{���յ�� �uQ��{VJ�5"I"�:�����X���7���O))����:L;�j8�lQ�P ��%!��럒|2��qye��4��m�m<3�@�!��$�+c粒���J�ۤ-S�R��Hk�A8$��k��� )��[�O�/�ov,�6�˔�}�O0|� ��n�����N�ҀF�{Ӂ�{ǽLK�)��{�|�G�� ʭ�"W���?��X-����Y�W�~Rn�2�˰o.� x�*S߇�Kê: �4`DF�oԝ.(Y�&pKq��ѵX�n���9�bbn��|��cc�N��ݛZĴ�&��ܖۑ�t�B���Trj]ޱ*�Sxqd�w?�� p�|���n�)3^E8Y��⑷g"rU`Wn�A�O�5���?�H�lpY[��Q8��+��]��r�q�oޱe��t����j Z�G�O\}�����r���7�wَ�C����V6t�b70j�#Ū�!��_WH+��R����F&/������Ϗ��j.9W���xZA!�/�W> `[�X;���GP���w6�V���R�{4w�e��WD�0�Α�h�������Lȣ��%J�Л��z����=i ZϰŠ��Q����^"���O:58՛�k��~h���l`M��ǽS�qV1DZ���m���hb��w�yu�K����o��;�������DS(IEND�B`�PK���\+o�L 6templates/beez3/language/en-GB/en-GB.tpl_beez3.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 TPL_BEEZ3_POSITION_DEBUG="Debug" TPL_BEEZ3_POSITION_POSITION-0="Search" TPL_BEEZ3_POSITION_POSITION-10="Footer middle" TPL_BEEZ3_POSITION_POSITION-11="Footer bottom" TPL_BEEZ3_POSITION_POSITION-12="Middle top" TPL_BEEZ3_POSITION_POSITION-13="Unused" TPL_BEEZ3_POSITION_POSITION-14="Footer last" TPL_BEEZ3_POSITION_POSITION-15="Header" TPL_BEEZ3_POSITION_POSITION-1="Top" TPL_BEEZ3_POSITION_POSITION-2="Breadcrumbs" TPL_BEEZ3_POSITION_POSITION-3="Right bottom" TPL_BEEZ3_POSITION_POSITION-4="Left middle" TPL_BEEZ3_POSITION_POSITION-5="Left bottom" TPL_BEEZ3_POSITION_POSITION-6="Right top" TPL_BEEZ3_POSITION_POSITION-7="Left top" TPL_BEEZ3_POSITION_POSITION-8="Right middle" TPL_BEEZ3_POSITION_POSITION-9="Footer top" TPL_BEEZ3_XML_DESCRIPTION="Accessible template for Joomla! Beez, the HTML 4 version." PK���\X��,��2templates/beez3/language/en-GB/en-GB.tpl_beez3.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 TPL_BEEZ3_ADDITIONAL_INFORMATION="Additional information" TPL_BEEZ3_ALTCLOSE="is closed" TPL_BEEZ3_ALTOPEN="is open" TPL_BEEZ3_BIGGER="Bigger" TPL_BEEZ3_CLICK="select" TPL_BEEZ3_CLOSEMENU="Close Menu" TPL_BEEZ3_DECREASE_SIZE="Decrease size" TPL_BEEZ3_ERROR_JUMP_TO_NAV="Jump to navigation" TPL_BEEZ3_FIELD_BOOTSTRAP_DESC="Create a comma separated list of any components for which Bootstrap is needed, for example com_name, com_anothername." TPL_BEEZ3_FIELD_BOOTSTRAP_LABEL="Components Requiring<br /> Bootstrap" TPL_BEEZ3_FIELD_DESCRIPTION_DESC="Please add your site description here." TPL_BEEZ3_FIELD_DESCRIPTION_LABEL="Site Description" TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_DESC="Choose a colour for the Background when Custom is selected as the Template Colour. If left blank the Default (#eeeeee) is used." TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_LABEL="Background Colour" TPL_BEEZ3_FIELD_HEADER_IMAGE_DESC="Use the selected header image when Custom is selected as the Template Colour" TPL_BEEZ3_FIELD_HEADER_IMAGE_LABEL="Header Image" TPL_BEEZ3_FIELD_LOGO_DESC="Please choose an image. If you do not want to display a logo, select Clear and leave the field blank." TPL_BEEZ3_FIELD_LOGO_LABEL="Logo" TPL_BEEZ3_FIELD_NAVPOSITION_DESC="Navigation before or after content." TPL_BEEZ3_FIELD_NAVPOSITION_LABEL="Position of Navigation" TPL_BEEZ3_FIELD_SITETITLE_DESC="Please add your site title here, it's only displayed if you don't use a logo." TPL_BEEZ3_FIELD_SITETITLE_LABEL="Site Title" TPL_BEEZ3_FIELD_TEMPLATECOLOR_DESC="Colour of the template." TPL_BEEZ3_FIELD_TEMPLATECOLOR_LABEL="Template colour" TPL_BEEZ3_FIELD_WRAPPERLARGE_DESC="Wrapper width with closed additional columns in percent." TPL_BEEZ3_FIELD_WRAPPERLARGE_LABEL="Wrapper Large (%)" TPL_BEEZ3_FIELD_WRAPPERSMALL_DESC="Wrapper width with opened additional columns in percent." TPL_BEEZ3_FIELD_WRAPPERSMALL_LABEL="Wrapper Small (%)" TPL_BEEZ3_FONTSIZE="Font size" TPL_BEEZ3_INCREASE_SIZE="Increase size" TPL_BEEZ3_JUMP_TO_INFO="Jump to additional information" TPL_BEEZ3_JUMP_TO_NAV="Jump to main navigation and login" TPL_BEEZ3_NAVIGATION="Navigation" TPL_BEEZ3_NAV_VIEW_SEARCH="Nav view search" TPL_BEEZ3_NEXTTAB="Next Tab" TPL_BEEZ3_OPENMENU="Open Menu" TPL_BEEZ3_OPTION_AFTER_CONTENT="after content" TPL_BEEZ3_OPTION_BEFORE_CONTENT="before content" TPL_BEEZ3_OPTION_IMAGE="Custom" TPL_BEEZ3_OPTION_NATURE="Nature" TPL_BEEZ3_OPTION_PERSONAL="Personal" TPL_BEEZ3_OPTION_RED="Red" TPL_BEEZ3_OPTION_TURQ="Turquoise" TPL_BEEZ3_POWERED_BY="Powered by" TPL_BEEZ3_RESET="Reset" TPL_BEEZ3_REVERT_STYLES_TO_DEFAULT="Revert styles to default" TPL_BEEZ3_SEARCH="Search" TPL_BEEZ3_SKIP_TO_CONTENT="Skip to content" TPL_BEEZ3_SKIP_TO_ERROR_CONTENT="Jump to error message and search" TPL_BEEZ3_SMALLER="Smaller" TPL_BEEZ3_SYSTEM_MESSAGE="Error" TPL_BEEZ3_TEXTRIGHTCLOSE="Close info" TPL_BEEZ3_TEXTRIGHTOPEN="Open info" TPL_BEEZ3_XML_DESCRIPTION="Accessible template for Joomla! Beez, the HTML 4 version." TPL_BEEZ3_YOUR_SITE_DESCRIPTION="Your site description" PK���\�Iqo� � templates/beez3/component.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Templates.beez3 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $doc = JFactory::getDocument(); $color = $this->params->get('templatecolor'); $doc->addStyleSheet($this->baseurl . '/templates/system/css/system.css'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template.css', $type = 'text/css', $media = 'screen,projection'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/position.css', $type = 'text/css', $media = 'screen,projection'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/layout.css', $type = 'text/css', $media = 'screen,projection'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/print.css', $type = 'text/css', $media = 'print'); $files = JHtml::_('stylesheet', 'templates/' . $this->template . '/css/general.css', null, false, true); if ($files) { if (!is_array($files)) { $files = array($files); } foreach ($files as $file) { $doc->addStyleSheet($file); } } $doc->addStyleSheet('templates/' . $this->template . '/css/' . htmlspecialchars($color) . '.css'); if ($this->direction == 'rtl') { $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template_rtl.css'); if (file_exists(JPATH_SITE . '/templates/' . $this->template . '/css/' . $color . '_rtl.css')) { $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/' . htmlspecialchars($color) . '_rtl.css'); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head> <jdoc:include type="head" /> <!--[if lte IE 6]> <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/ieonly.css" rel="stylesheet" type="text/css" /> <![endif]--> <!--[if lt IE 9]> <script src="<?php echo JUri::root(true); ?>/media/jui/js/html5.js"></script> <![endif]--> </head> <body class="contentpane"> <div id="all"> <div id="main"> <jdoc:include type="message" /> <jdoc:include type="component" /> </div> </div> </body> </html> PK���\\��V�V&templates/beez3/template_thumbnail.pngnu�[����PNG IHDR��� VYIDATx^��]O�P���)ssphD h� �"�^{i�� ]��Q� $�<&$P"�`<�u�k��sz�[H ^!�9���I���ߤM�\�%���xo��F!����<_�=5�4M��'#�jXU8�p�R ����|��% �9[�m�EA��,CU5R�b��u8Ugc/��.W�K�쪳����9D���*֖�:صp�lY+�R��ٶ�3�c��� �J"䒓�4�R�x�UUcg�R�VP6��O��|\^�ZȦ���W���S�C#������^�{=�Z�N�nF�6^��)� �a�~WfVv?D�'ֳ�FW#���|jLÊ�/����Z�T�����br`1�r|#g��8a��r��iOo�͋�������Oz�'��?�<�w?��� �,�0�7x���O������N]am�2+� rkkX�k�,Tm�DN�&�u;�)�1=���������$HB2S.!�UoH%U��vb�����%ֶ�9C�ض�+`"<�`��;�<|�X��b��3��^�)e2/߸}kgqi쎦P�9�`��溻�eY�ER�c![��5�9��rQ� ���s ����%UǕe���C��V�r��#,wA`�1CZ� ��˲$Q�.�y����۰lA%����u]E/0&�vuu���(��X��/|���1�&ð��=�.�Dj�Լ{���a�Qg�����(�EE��_��!�0Q��Z�;㶐�APAH���f��;����t "|-"�ja���*�s���|3\/�_[ԃ=+�m���M����Mj��ٚM��첨��/�C� ����Zc��r� ��~�G �(v�&BbF�� ������襤����UjS�*��B~!I)Jᜡ�RD��G�J��1����%y�,ZS�tPD9��2�X[�x�E��������4n��<�G?ޔ���!�Co�[�~"N��nO�n���1 ;7v���GӶ�Y$b�U~Cf&���o�|>����}?�Q��k��7mg����`�4v���N^�/��&����7� ���e���������_�_5��ccդ5jm,� 5�@��I�.ta�]�e�ffw��`CA/�/Ԅ�0���;7�LrF!<��߾I�>��w�է�kKW��_y9i��z���aي�S[�!�ۊ=No���{t�A��h�b&�8�;�.�%bIC|��f �ү?� �c*ئ���d�û��z�0J�gѹ��[7o���"}a9��w�D��7��/=y��/�߿U)��dL0�*7�;�}�A��~��͜�=�qt�<���֟��[eϵ��IM�vm����/], {���/0֞�8��S�ϝ�ð�V�^����X��oWk ��?2Eu{�L��9J����_�?vA�O��a�G{)�%�f����� `��i|� �0clY����J%'��%�e��U�D���#h�.��i�ȭ���\���j�,��+��1�%���Pe,˲$IjQ�"�#�����3p�u�u܂\���.13�_$U�8(�Uʉ����z [��K��#�$&@�h�f�ܣ���=���癙d�NH" "����-��*mE �"^{�U�+�E�jA��⫊��,߫իJ�V+�(�(3!�5�Lf��d�3�w3 Zs)��r-q9��[{��g�Μ?��۳�w�,˙=����3�/��z�0�R:�)fPȜ�#�iU�B��0�~A5]��`9#�k���(��T*��2�j�nA�iF�XӔ�e��z��w�(���6�����"T7ƘeY��dY��7�Bp�ep�)..fO0B�#���(.�AGn�5�;��: ��C ��K-���� `���`��d�ax0�L�b��u�ܱ�D4ƛ�cKcL��"qt8N �a��p��[F�,H�©g�ǜ�����,V�Wsܵ���2J��;WRik�m��k��Lմ{6<j����`���$`aK�Ƈ##F����l� ����Q��c��w7_�~�-�*�{��?2�`�:����}��1�iw'ϰt� M��r��%ձ@�mD����>{QyF���dt�~dd!:���#��M+Ǭ~�>7_�rs,%0, t�ꊍ�뗞�� S�@p_� C�,��A�e�������� 8&K}�\�)�M��Qb! S�,�%%��Xv�|t���./�z*���J`0t����J]�'VOJ2��.���%���J�41>~k�=W�ry�Б������͎��x�� ��J)�?�:��0V5K"t�1��M��ɔ�0rAYND�1��,��kB.��3c_}�YZa`f����C����U�\ՠ�q��"D�(1t�ٔ��d3����u8�Ҵ� ��uA���d��4=Qs`Y������8?�yq����c��4�㧋���A��7F�����J-��_r�yg��%������@�X$�0��$"qH���B4��Տ?�P�.[ ��r�mw�^4q�jN��b8!�B0ٕ�&>����O�8G�4��d��կϓH� 7�m���=ֲ5�q=[@i&������!��o����]f���@��U��U�/_��N�*F\v���-[,J�ow˥�1Y�v�����{�O�L��B�a�'xF%��+g�|븖F��J'E�Q�5b`����|A�ˡQXq�����0#�xcA��z�>g��W��xZ�u�o�zt��Ͼ��I5�W,���8���w��prͼE>��j�}��z���Vwc������%������������S���'1��(�Ĝ�,��@�#b@?,OXd��u�s<A�.��w� �+��K.���ܲ�Y @��@Q�ƈ�!�`��,���-Z�Y�|�K/=�4�[8�/�{��y��X�k�s~rսO�<�_/�{�o�N=�UVr�l {�zv[y<�k��9��]=� �1':Yѩ�\�x�6�P7l�2�����u�7�4v,u�Y�F,s��v�b���&��ȱ�[طj�X��"5��7�H�����o{��R2�=�a�'�ScƏ���O8�I�l�:�*˝��m��co<͘qD�gO�v�� ;w�DS ��PO���11��@J��\���x�r���B���`��c|��HJ �'�RsyS�ި������]U����eS ee��R�B:�r0�����2�d�N�l{��w��i�eg�g 7�����5=�*�0Ք�Q��s��V���RZTR�h2#�C�t�E�$�@C�ښ���|:`�HX�t���͂��L��u��5�� �#���+�ڮ,-�KFD��e�E�}�L��j��璸� |��AS�'���C7�����oH c`0��,[z��UK�'#�7�����.�a㲫f�:Wnx���t���,�(�k^�� ��П^��e���+������(B8��?��e�u��?w�'��}����*+���$ײP@ؐJ�O}:_Yz�_'В����e;�V�X\�m���[�4�=����>>ov��q�;�T�2��4i���g��w���X�,fH%A0� \1����[�\<��W�E� �v҈X i�VY�� D`�Q���-�Y���l���� �Y0�rZT�Ƣ�>^�_}��VC�F0��b�%�?; �zﴞ���.�,iې�3�A���r��\� �M����8l�a��3,\@dɂ��JF�z�?�4�vU�a���7$.���`M�5��th���4��OS����e�&a�0�p|���,YBM%n���y�3�ó����$T&C=#W���T�"�4PD�MI(!�$�l��d\�,ea��F��dɂ��|9�;6�6eݖ'� z�o"s����a�q�c��=�oN����`pM��(Q(A��J� ��ȒAFm%ɸ�����{fwe����i�u�s��G�m�j�D�+L�lNxDFG�p��2�pd�n$�+R�֊�nH�{����[�ʆ�x1���ܓW٦�{������"� I�H-�K�,5�${���Vm�T�N����+]�IZ��z�*�s�3YH$8rd g��ɒ�A�Q�]�oZ��cSK��}���m-�ǝZ��ue\x��«� ���S�i��,Y2�Q�Go��p��|Ug��]Ca?k�NGF����ܛ�Τ�C7�!�(�/Y� �ո ��g�;]��� ��G�K��j��)%�����ݪ �f�a���7K<�С}��"˚���e�|:t�UMN)�Ix��aT7(�`�u��A�OeEC>�.�\f�q�h:�1Q�~�BDI!��������Kb�� �S���z�m�@�oN�)9��pdY�>w[��LP�a�&��b�:ˬ��p�+<�%��*�0���&���gV�:}�C~�H��p��OE0 ,� 0�,��9l�D�3������`@�AA�a `�1���y P�x�c�E��>W �dO� ۃf�\oL�^���C�q�l��CN���C���i|�s�Q�����HLՓ:�����剶sǾ_\~���y�|�%�d��8% ��z<)s�x�Bs�L���5������$ 3��)v�z�Q577��"WQ��Ojg�l2ID)/�9��`�J�m�N��f��j%�NȺ��8�e9��p0*3lV3��"���{G]��*�I6�Fmy������Ͽ��oVVR��`v$��H�,@��U �?_�pQ�'�6n�痞��&/�4wE���H��N��W��ƌI�z��{R�ԅ�g�C�5��Key������i?�zJ����Ђ��n̝����� 45��Һ}�^��Sψa!���Y{x��vL��O�ٌ���Ƕ���E3N/�z��6E�T���̩�;���t��iՅ��$���2�9ũ��r��s7>�^���Nb�ù�!Q���ކ&�����]���������1��*����U��:���)[�>TSU�m������?���<��"��>��+h����vZr��]{|�&<f_z��IU�y�J���=�x���Y��<��9����Xl�7�S�<c��J_��m�������-�ڻ{�pK �E3����kDB*aX�������c:d�4��8G�)z�n�{�BǗ��9#b�-c�\)��.W>���W���������$�E�F����q�$��f9�gP\����'mS$.#���I"O)c�"��TJ�D8�Z��?���Wˎ"�U��7o��� �BV��[E1��N�H�] �Ap� �.E@ܸ�FD@ B3�0_$�̻�tWy�*��¨��kέ�ӧ�uׯ>���M��jE�*�O�(�z��8?�{��FI�e9����a�þ����+/��Ok��Y����uٗ�e�Z��߸؉��(�zR�x@�:� Dq�4J0�'�� �S� N�PZ~�<�BR��,9�]�n[ ��{��p��p�i�DQj���#����������ō~�̈́�a��O��Ɲ��yݽ�1���F^JU5wqTnV[�a�����������aX����(�H]���Q2}���������>j}PUPY����F�ϝQ\U�X@G�H~t��`��H�H$�E|�� [\�SN�qJ�Ei�-8�(O*庄f�S�wOl)�+n�Xh��"�����5�"�J�X�QI7+!a����l�0��&��_<��߽��_�~�T���) �n_z����ϋ�Պ%��|���s��ʼn��ZK�x��:U�/��Hl)z�+f�&�0�K`a!����Ak���h��h�^o <3�HD����US7Wd�Ǵ�7�K8��x��B�Sa�(��~�.�W ���E���P�.�J%�@���B7p�����2+��R��<�̟����N��i�~��X����� )�f�H/'atR��D��ox�̓6}�}�Uj�֢�Sk�6mK��!��1�f g5�=���g�y��TmZ]+�r��|0BH�-_��f��J����q3I�$C��;��F4�6`ӌ�n�K�cڟea��*�š�C0f�\�P�3x�Q,�%+�wHAس ȂYŅ�+!Q��S�ן|���_\����yM�jR� ?�7�4����!�7��X�g�>y���;h�4�'�N��>/��Ŝ�U@�,B�겓ݙ���ث��@6�>� F���m���ͅ �d{��@">�� �|��]�QF�CZK[Jk�5�� �����d,�� ��ы���|F����� �zgh�x�0W>���&»:\ ̴ F�m13?}��d ;�'�$}M�Jj�=-LawSL�0yg����;��w��Q�V��ߓ�,���;W�M��s�*����2^�̳�9q3!�����: ��d<N7���5*z��e�h�Iڴ!^ă��u���v1��z��p��e���ع���.+�J�-��btQ�-�7��WVfu��5�5ܒå�+�}��̖EK�#�#��m�ݹ��S_��n1Ct<;�E���OD�5=��Z��u��M�3şTL�(�]c��d]}=��{�,��)8��ta6�BM�GB%�n�Ɓ,$t�H� ��|ry��?>��g�_Am-�G�I)�T��`a���3 /J���p���8�[�E���F��%�ժ��[�j��"����c4�;n6�~�c=xn�6�w����� ��1E'����%Q�g�I�[E�-����өK��e�d!�aidU��(����ܴڵ��\*���Wr��;/�A�z(���ە#_���P�v`�jG��~؏1�-=cg�̃ױ�0��ؖ��qfQm�P�h�W�� ���Zd����j�BE��.���V{4�&�7�x�����4^6/���'By�,�P� Ј�k�Z�V��.̵� �V���_ϋ�T-� d���c���@G��?�{=}�!4�Ff�.�s�Zg��{=]�<j��l��ҪQq�f$X���ZS "܀�����hf�C�Z�Bί�n'� ��a����H2���/�p��C���}��#��b���"Zu���Κ=W��M���BD.! S���t^(5�g"��"�yV�8��ڠ�_��*�P�#O-��xd�}]G�g�f�c�+�ELf�M|�d��Z��!�#V)���\��:���q�� e}� h�q�C�Ap&p)��Lq��7'9�8�l��$s�oO0I�$\SV�Ւ���pU-�ӄ�b! ��,��ԉ���<��u9o�rܿ�]��n�����?�(�lBē�R�GU*��"��bf�*�~٧��c�Zr�ji�1Ƞp"���R}������~�m���ko|����niEk���Y ��{��!���dǶ7ȶ��H����������o�b�����Y�Io_Lj�V2$� �U�M�5�y�?�ykb��Tc���(gf�2C��m�K��<~b��S���ܔ�.[ܧ��XRu�%L��<Ors�Qݛh�B�� p-Dy�dr2w"� ��"urm�����jF-�b$i8(nN����m]�ل�y��w���oj*��@��j@�|��3�%���YD�!�e3�NF$ �"CJ \]f�K�l*�(;����UȚ`��� �'� hkषԜ�ʑ�����[��>DD���L牅��b9�`Β�B O�R�b�;ӜLt�ָ��ƈ�A�f�ܾBlmϖ3'&� i�Ҧ�ƙ�R�pa�b�_Ѝ+�.`r��*E��e) �|�뷿��7���<Cf�o�:�l?Cl3�Ο�|�6q�AE����`nM��&YTl�9[�B���� �W����I�a�`�E�n^�W��V�f���]�t�,�a,O�!@�@s�N�-Y#ҩܳ��f����j�.c6���Nn��rҪA�6��{O>~���]H�_)���p_����_��[�� J���N}b=D?m��s���os�j���Я���7� �-�m&�*n9/W�����ry�Y��?�][��(,v��nK�(�6JU��M�U)�#%q\�WKjC�-`���}��ck~����OJ#�l��IKЙ����Ԕ�iAǴm���> ��녳<G�x7��O�I����:�nS)����L�3��S�E����R��k[0�J_u��e��}��U�{g��D���-�J!*# D<�&Fo^L4Q��'<����hTECFL����"�-���]��v������)�A��&���o{�2�IN�T`51�")!ҷ����6��QGI7筕A���U�bĸ��\B$ׯԃЀ ��f�S:Y�@JRc�l1g�p����S1�S-��`tĈ�U�-��vӍLkI�Y��d�����j���U6���?��6���Dbv��b/X�UL�k�� �w�z�V`!�k�%��1U����l�����y0<B:����Բ%�y8�"��������j���L�7�.k�F��+�����`�H� �(�sY�o����j� p�i�R��l�I&��f��\FԖ$���̻�0�K��]S�E��в��j�������+���݄�J�h,�c !I1��eM�D�BЯ���i(f5���4?�r���gw8������9�rk��{�N�㞏�ݾ�nhLGhinz��X�ӎ�}#���^��1y��w�Ѕ����h�z��Ra�?u��Zm����:�^�$&��Q���6�K����ג��xc����%�8��:3�i�,ˤ�0�>� ����!S�'<n_�_�����+%�S��~�7��-��t`5�� ����^�����|@ѿ{�>DFw�w�_�r��Ϭ�R6s�6��|�� H��쩱����Ά+wq�k�+��,���%*W�� ���1X��`l��l]M3�X���g���g�a�Lc$���~���ڷ����Y��p��EQ)ɲ�ʆi�p�A���b�A� ��N�Y��(�e+NE2e�"�}Hΐ�����wuw�U��~�4g(�"g(R�,%��C��w�}}�w�Ncm����% ��y&(�Pa�q����d6���F�1#�n&J@���(R-@R%,ӏ��SV�0���#�t�1H���.%���,�ZNNsB�t��i�j�RRJ À�7��ȿ��O���'�q��i�4�f B �(@���6�E�~��W���w�ss� ��{'o�����uv�ί9�r@��C ���>�l�T����Fi�v`��K�t�>~�3J���~kD_�Dj0�2���qމ�zݾ�l�#���o��5�)��'� ��#a4ӎ���˟�'�&G����F'|�Y���<��Km/���+�2@�{�V�� ��F� ������9T)���/3(�Cf�uF��CHp� h���-�3I.��5�!Ӥ��(B^�h�\e �~ l��uN&m��4&#�hjY��"��D��ӕ��I���8Eu�5���'J ¯o�R�@T��*�1��O^�{��vӏ�2������&t���vn����Ikn�$�R���z��A�� ێ�$�L�v�n�qh�s����i[9����(v@ 䒔�YŹ�H�2��{ŮsL ��%PT�Y#�Ѥ���tu�psb&0!�v�8�Ca[&��,a�煆��{c{���.��;W���L��F��T���©�m��܇��&�Oa��@�W�a�LB趛E�4K��"�%L�"f�[4) 7 �uh�)�v_�z�Εwt�:;<,��!FvE�;�����e����4�gґb)��Mg��o.�{��'V��?��Olml<��S���������nX�W/���O�/�_�t���_<��G���W;��s�>�سgwkm]��=paqo��,|vi�����e��Im -7�کŦ���p�G3-��'����Q��6�`K$I�P]�4̐j��X�$�4���˼e���Gh�7M����R�י��B )��j���N҉���K�+�#�p#����w���F#ҥ����oy��yy�:ju7��5J�7VO�p�����y���&62�l�~��E��=�B�Ň�.�gV:w�/ﴏ��P�P�s��O�10XH����>�ǽ�鱡�-�ѱ�AE�r^w{A�a�:쨁Ki���F)�� �0�E��I9:6rhpd��;۫��M���v�u��)�O�$�x#����/���r�1-�Q�1��{��2�����ӷ�����v�ֻ���h}�~�e��B �#6>\�L{� ��_�e#_�&m��2r���uߑ"��e�R@h4iс���v���i���kowwm�;.��@�i���~٘��YB��m�E �P�q�4 _Ȓf�딎MH�����n�L���5ÍV�OV�[��)&6)��6Nq'�r�~T@�����n,5�X&W�J�{߇�-�O�����L@���a�q!�Khɯ������N�b\l�no��i4e� *�v\HˏsJ��"A�R�D6�@3f�bnrdtckӫ6Ű����4�!����e���(ڗ0DZf��ܡt���� �<�7�BH.� B��x�*�׀�����G'��M�0AE��� R�jԔdHPD��Ŕ�Bnh܋���qea���r ~*`S,���0,�v����H�9 �H�"`x<�]�v��:�0lC����y�ѣ�]3����;nk� P&S#X��)d�H>'�41�VJR����hv:g����v�'�FM�6� �� ��0R�ݎ��ef�L�츢��)7��ڏ��D�Wk�.�,\�P�M�n�❝�(����?����-�`�j�H䓧�v�!B&1�D�`�F���ؠ4����D��Xqt��Ӫ k�"Z��ږ�A��K���Ӿ��S��d�j<a%B���t�GzN�Ht�I��26��+��K�R�mlU����˗/�U��Օ��g�Y�~���KK��^|�ٗvj�����k��s���Z�[�=��8?7�ԉ`�ʹ�xnggg���Յ�N��t�[�5�ť�skKsW�7w�7֮>����g�C��j����<���������k_�9���[k��\8u����r}��q���������-\����]kԂ^��ٖ���w������Ʈ�����3�^ܫw��3s������K�<��GW�N8�뛾�,ϜYZY�=�ң�=�_�[�t���|���;���Nswcmu~��s;/<xfq}�q����V��_Kѭ����%$w��J&�!�P��@�$l#M��@�)@��Rb$��T���O'��8�[ׇ9&1OĢ��0![�hڊ`�1�w1��F�f�D�oˀ~ ��D�t�i�#�ޤQ�"�j�^�"9� !1F���3��\}��gg.Μ~���s��������Zu��ՙ�3����.�b�҆s�}�k1���?Tޚ�����?P�܅���+�W/\]��ի��Յ���~qi�BT/hW/^������S��:��g�>�K-����ŹS/�,�,6*��XY�r��)��=&������_�6�[K��_�|en�����PAsg���K�/���?�;[������Ϭ�4 C�x��'�:�r�͵���u�7���n$g�7��W��+�3������^��i5�+K��ϟ9���K�[@;�����o�T�-h�q�2�G3��𝀧%MJ]#���TM!,e��Hj��T�� fc�H���%�%� �1�B�P��!���J� �N� Dd,���\�Z!-��^�;�p�8�z��(�8���+k[J)��f���U�(Z]^XY�v]WJ�8_)幽f�q���&�C���F�u}���W��7����z~�l;��;N��J��J�$g��J�J�0�Y�<��ց!Ys��(8h����X̸P�h�;1�JĮ�)%�^W %g�+�~����n�nK���-��sy`_��:��t� ��Xk�j�:BJ��N�<�e�9���Q�j���5Bzn/f��nωc�q��u6�v:�|��u8��J)�9����į��_�mS�ף�R��o�5���o!�;�|����s���]������V*}ct��G*�5��|���d�?��=���i}٢_A�_��_)��վ�#�ů�u�]���-�hz������S���?~ܲ,���4&��=}�\�w�4I�8h�k�-�W���f��<���d,-^�c���#����df����ف1�u�#7(��W��DQ�֜%?���ѷK^�)z��NXo �{�n*���C)�������S_����S�\[�+��H�������Ъ⺄�NO\��˻~��w?��6<Ӗ<J !�����Qo�Z�sn��{<�IX����ZID'b8�F�|��C o�{������7��ь���VS6꾡4+a膯���I%���� |�R�� %�V��L��M@�l�^�|EY� 2����$o._��d�L=prlwן_�J�v\ہ��'���G�~�#�y�Pd���Ƕ�ζD�TJ�n��Q~�sO}k���RI2��F�-9^"ݹ�M�H��v�W+��u�� WZ~9��_\C�Ѵܯ7�Cw���=�կTX掓��V}�^�zy�dnV<d�ڳ'n�3�/��}S����^�g��'���}\$]E@D�#�aݕB�Ȯ��k������Z�Ns$�*Gڜ��y3�C��>�;V@]@�x�l��B��0*v7aH7H$�J���D��^�Q�\4�n"5!��=vT��rt��I���m?�cJ�X�q-��X(PR���ﺰ����RZo7v��#����\��}�Fc��)�A�&���all4@խ�� %X��<t�ɈK�R��Z�LH��u��>:6�M[Q(��C#����s�d3ib� p_!�����V���d�@�"a& �!�\I)��?��f�v�;r[J�{�}��Af�a�3S��(�=]�1!��`�X�&I����s���I���L�"����xx�aw� vn+��'L���QU�Gj/a���V��n%4}��� �I� m=��B���l��v[�ST������E^-���2Z9g����߮�^�y�:�^*�L���[ [E�'H&a^��4r�����8��P�i�5O��t�,~�>��#P,`��R~�rQ��מNp����㩿�wg��'^![@v�過���Z�I�Չ��e)G1��� +�W�Q��vc�F��g2��;�E/�������+�m�Ѻ�LeZQX�E�}9� �A�-/��G,��Ng<��7S���]/���Ucc�$\� J�R�(�qy]����d҆�D^�:;}�;SM�ڍǐJg� B�uC�t�&�.@�·�Q���P���� Q�(��ZQ�v��C9`����P*���� È�d�8EP]K��p?�����V���~���k ���S �W�8�2\�H�e�1B��y}�dT�tc�!Bb?h�!�L�MS��)E�L�)�D�b?�V���I�� CJ����b���$��9��G} �6-%���x��\�Z�^��i����dj/Ԛn{Բrq<_�f���}�4��8t;N����a�8�a?V�j0b ��J�4[��ТXb<����^oy}3t��@��Z%���������z�����$�>CJ�c�`$U_+ܝ*����HO�C)�O�K/�W�l�NR�5���YI�V�XӦr٦����n�<�Sߐ9�8�Φn�z-�h,Ez�Atp�2(�c[�t��MҼ��\�в{��������[�'h�P����t]/� -�L�������q����y��u]�*�A9��9^&�8�}��M��.�nM+��A0�0gj���@2��8��DR��z�Yo�y�+��t�cOӴ�o�!��R6�P�Ţ� �B�c`@�U`��o,5%Ҍ��o{c������������Ɲ� �b@��y5�x[�d�V=�)J��(�\hDH���D<�؉D���Ǧ��YS'kK�Q,�K�D���z�,����Z�o`XӔPi�I�� �չ���G �tAx� R�Bvuq������8�����a�^5�ݡ����Z]^�<Ŗ������R]�,SI�G1��� ���38qX�xs��4n!��Q�j�&A @�a �����y'��b�x.�F!�XZZ&Vf��"T3M3C��ih�^G7�ՙ���������R� #`K�#�o� ��F{����i�Ȝ���w=�BV�[�� i� �04Jc�E,E�������c\�t������j���l���F�%VR�.� e�;~�;Co�%E�GJ�W��()}߿{�I4�úKJI��6=�n�'�OK���ml�U�ɣř����{�嗿9����O|��w����+41:Z�ׯ�FJ�����y�3|�~;����ro����/��Y6��"��o�F�eZ����!zT������Ā�.���~��~���\\�L�����R*tΞz��c�S�Oͬ.* ͵U^���=����dJcC����<��R�h��~y{�D����;W���������O<san|$ט��qc�r��?6<\��?�j��]4عm��f���>=�g�ا�����+�[���ɴ��Fv�C��3���0)�BI�}��ɦ[����Mꆃ偸Lu:fж�H���@�Ĥ��SM�F+k'2�l��QX�5br֑J'HB I1v\OD(MP���NsZR@��%l�uCp΅�0Ʀi(�)E�O��P�z&#��Ji� ��ͷ�^�+�9\�'�Z"�"C�c�+�B�����)��Y��OޝH$�[�w1�M*G��I"�:F�}���J}e3�B��&�GrF�-���K&?�:Q�K&��{�o;YΧ�&���zGYfF?6u�R/�S'>X���e���C}y���T}���b�@ S�>���c��u�#}�\2�I��{��nO$���:�-��<\�i�t{N�[t��J'��::\T��6��}}}����M�d<e�&L��D�I���7�ӷ��?�"�.Mw{^�<>m���L-צ $D,�ԊD_K�8U����8�L���RPB2&E�)M��`P�.�R�j垾�Wv�T�x<�$R�4�Ŕ��b�*K�Hb���н�@7�W�^sv���Oޞ���l�� ���S��0��P�l�80@�痗��s�8�f:nw:�a��v��S�#�#�W������+�������Y���%�Ș�a "Hj�0��3X�K[�aZ3CU�u,�Z#�Ž�1�ݝ��D��� Ş�GS���*�i�x�X۔�� �ӛ�o���z������ĥ_z�S�f6��H�_�e�#�f;�K5n�pqD\Z�@�S��Z#R6�^����G��8��{��z�Z,���=���l�tG��M6�-e��p���{aHdhڹ���ze��y���ݷ�[�Ւ��4T��k��H��F��)&F�=��JF���I=i�* "F�UED�0 =���a��s/Q3=59R�vM��o���D��r_&�����HX �m�F��̄�I6��r����XI�^.ߧ[��mI\�=� ��:###A{����V�ԟMX��z]||jw�Z6<EL��8f����e��T��vDmZ�(��=JRĬ��E �$p�(�1��0�%vx|�$YD�)�>)��)��`���ZN� ���Aj�< Q���U31A�R��<"�,hn��<4^��-l�t��@!�Y�W������Ș�F/ ��<�ٟ�u\��j��}�I ;o'���6�ϝz��������n�?q�ןX�m��z���g<q���,?��{�ӹܣO��)���_]�LN��{�� �?]._�MM�9s+���Ne��G��~g�P�t{FC�_�ң}ǎ�{͊#��kicl*�,ÇF�\�r߽�nlm���vC�w��_��I}bj��U�덵��(�cZm�n��(l����O���V[wV��`��#'�b��ŗ0�"+�f��j�o���Q{��;=tlH���������ۍ&Mf��f��#�Mf=F�����ax����!W�'j�tYP��1�-b_(M�MƲ�X��$�4/�i�ǘ����m0ߏG *d-R �d�uCd[� ��X !UO�熥'0�Q7f7M" Ð��K�!�w�R))ķkʪ(fo��a��$�8�� <0���Ǯ�^�����g�5�#��8��g��W�-e���g�^�TB�(b,f�+)ص�8�\���a�u9�s?�KΜ�at��`Q��k��Y��t��뺂3��J)�b�s��0�(�m�^��ܸ^�\p!8��0f��ya_��+�Z��q�q��ۿ�z�L�Z�S1�A(���q���o��/�&��Q�~1��C�g~�l�a:�X>�d&�%��I녾��~.��|�~9c=[��f|��#��d&��y���L�S����2�_����y�������g&�|�}�=���QC_Jk_�f��e~�/�vg�R�wU"t=���;=�����F�'��������/�a�B��0ø���3t�XA�^w5eü#�������Y=��T��$0���%�ˈ�\u[� ���9�{A�D��.�HzґD ő�r��NbQ�� g�]�����űf���do@r��p�H�]�3F��Ы��B %�:�za�����Ӌ�N5+�h��Ѯ;'����e�ff����[y�l�y�SϾT���੧N����g/�dʕ+燦�1A��1-�����'/�y^� �ҋq~�Ј��W�rQ��lq�U[k:Q�9-WO=xωS�=b')E$��J[:��q�ST�)��ơ�%J:JVut�ʤZ��6�*�f��se�j��`�4����B)Y�5)Vq{�=.)I%t���Vl'�Mip��'s�\u�ls/q�$*��do{}�҅z��y����xk�N��x�j66VV��+������ln�4��z�Q�7�0��Vv�-�i�Nkwoms���(�0Fo�����3�������0��z��S��j5?c ��j�㺦�U�#&I��M�~�Y��k���2%��Z��@$�i۶G�K��j�� ��7Z�vm{o{M����j���vw�8�7��[��Z��mu" �d:Y(dMS��;A�(択ϻ�A�M/�4B)jpG"�D�в�|�H�C �Ǘ�{)�(���E� <��8��88Qܬ5c���tMo&��b=�T�e�N�vR ���G.A ͼ���zecak}ain�M�����K/^X�v'mo�&�cS���F�{a�÷ݕ9tdsyCȈ��ۛM�|hr4�|a��-���z���Y\(����ovt�5�Y�t�:�BB�{D�I�[Z� �����;�^߶"�[&�U���O�|�/;�4@��#cU���ph�t�R����()ՓG���804�+X�\$NPx�C�'��q� �hR8�J���S)�6_+� �����fDT� ��n?��fv��ǧ2���nC`��9��T:i��#DŽ�����x�o��:t,���s�튝+J)�ݐ-�J'�^s�<|wЁ����y�P?¤�%�JM[8���"��tpl4��w��r�iE�v�0��;�!�'���R$t*�����\*��R�I��1�a�$��E���+�K����A_����ɐ�B!wӰ@)E����J��#\o.%V�M)�RHL��/ţ���!�6o����u�i�HH@BHc�&� v!N=�N�8��lv�˶����G�i;�;;��O;��vڦ�'��K���l�0$�� ���ґ���s�N�#�� ��C �;c�>/�|���<�q[�����b���^�B�5�A@�-w ȬqW�s\(�C�Ex��!r�H@(�, �^7Xn��.❗ׅ����9N�[��_��F�/נ�� �my9��wC���N����El�A�>:��+.y�y&�z�a��@&�Aײۡ$JC�]��\<&J^ޓi���r��U���%`qNţ4h�pЏ��8D��n�@��XP-��g����96�u����C>�"t�Y:��,C�!3�n�F�ˆ�@&�|��4�l4@��p'4C'9�)��Sׯ�!w���I�")ަ�e��티��GC�$��7X�`���f��8�8�#�4�%��i���X ��@�ʥycԃ�!�P�<�0�V��W&���ц��!��pRyh��!�ia����t��vLZV�M�����m3N�5S��7t�v��+����H<�C�~��?�t����E�����'�E�Hǵ�F�E=�}���a�p����fо�~Wg4�������Oǖ4#}7o�O��Z燧��c㣃=��G�z:���w�Q?^�Ow���u�������k�j4#��}���Z��0s���i�{d���[�ĶC�=�����;x����������h ���k��N%������e����%RQ��������;�CfQO0����C�߽�!�^�E3����{U"co�T�<���|��VW*�L��#��6��HE����H\$���:�~�`�4��6��**�D"���� � &��um�CU2�7*�UJ�YUݚZ���^ls�c�jUՑ�o�ln���4��h�����^U�)W�H��de�����$��(.-���l2q�\EXR���X�I��N�_lmN5V���K�� �|�W��T�]��'�?�Z�*� FRZz�A�<��)�Ȅљ���@�4�>݈V����C��H6�;R�*?��>�"��Yy<�9Z�S�O�**�����*ޞ�O.L����a�^#�/hL���f�/��X���/�p���s����q�Ob:����Q�e\pt �.��m��=!Q��%25q�v��xL^���;� �2��a�m'T����&�l9���[�����9O�T�Y�b#k��_{�L���$�'���a��������H��g�*Z�\����`�Işij���፨����ʷ[���^z�$���ji��*ĥ�@�`�S�ق�gV0�ɘo�= V�j\�t<���%�S8&X��$Xa���Yȱ��~���c����Ya-L��l�k��D�b��5.��5e�γ �(W����ט�0����:@p'� �;���� ��j�?Jv��60�47o�o@�5���Ωdtl�au]#���K�U�,��)o'�� �)�:n��q���}�����p��V��8V�O�n�_��}��n��6�1���A���f���U ��:�s����6�#�%��^��*��B)a8�oUI������dngtqH&����l���o��B�����kp:���Vw ��z��/"���6��P���N�?��*:vP��ү墏�2tbM^,�g�Gb���{���cGAc#$WW]��JY�"D�2$���p�QdNJ@#z�|�7@�i��Z���}��2�ۮ�a=�@g�[�f;n�c֊���e۾��qֈQ����s &���w�z5�`τ����&�����6p7��`�t�o��$�_�\�a]��A��S�j^9����2���u�Ivi�}���ߣuΘ��w�:�h��θc��ノI�}��A��Z��:��g���ҫo��GMG� B��MϽ��+�^~�_���?_:�e���i �{��Z�~s]��KsK����59<A��N��*��y��.>�F���ϯh����}V���MX=�E��以��dbX�͍i݊KZZܫ����7���D�B�|�2�hI"%�(��)ʄ�v���<UW��M�{S���vLX~�gZ!��������?�����%%�_ߜ�Z��`c-�H�0��%|8 e�R�(Φ��uR��� w����V��r�(�����bݲ��{��Dc�H��/�U#u+�ĂS���k�H�����V<�j;|�A!+�f�V����t�TTEgεVgR� Yi�����j;�����Ǟ;T���ZTsf\.->VSVs@�R�r��Cʅk6"�l���*��3u/�'"�~��H&m��|�_��.��Z#�.�_,9��b8����Yt �2�����B�7����: _��0Hr�d�!ٱyf'�E��]�[�q�ap����O@����&_;���vO&;�� 1YgkU��R�����8�X*�����|�Q�c�a|�*���.J3�� 8H�oq5�:�O���e�牨��!hxMOMj�340�G�.�=t�?㮒!�l��"PM-,�P���L�3!�Au��:B�'H���vy��I��e5�X����^̃���[Yү�06B>W���V�@���G����иߋ��0��d��E�v�Ñ�pB���E�����v`��H�i�ʌ��f8BQ7���q���a�����8��$�t�ǀI�B�d� ,�h,�x(���ON�L��KD�1�u��H<����{Ө�w�w��[�/tܙ�Q�^�����v/w��-��_��.ϒ�c4̵_����-_n���<6Í��~��ʥ�jce�rz�� ����c� 37?3����?6�<oQ���f�nu ܾS$.�*��6���;��ML>��Ս�Y�fd�����<e�Y�?�52��$69�{o�������}w�����{�K`���d���A{���[�J�浓���4s����ţ���ޕ��0D�I& ��� �]���uf;�m�7�����08}��c[s�_`��Z^\�R��M6��l�Y��d���xL�7�pc�Tw�� ba��n�0� ���0'��!���GA�`��$�J%|�E�=Ik�P�e�v�x���ٲ)2H���U�QX<���yX��H �pY��;иN'���`"N��f� "�R8�D.���͏���=$��*����N��p�� �c�Zc��j���TL;���d��D,��w�����H|m�_�V���lʫe�DE��6���v ������`Bx�[�ɜ��F�Έ+���o�D�a�t�BU_���R(�bM�i>�#'���@w��XeM-G��X�AC��`-$��R�`]��戭E16�P��E�e�j��`J(�J�8�nk=g�xZ�",���)B��SjIe��ZTd�J)H&$y�b1? EδĬ�b��W)6v�ۖN�UU�f�R�5�\,�!� i HЁ.J��k�4�)"�C�؊��v�y��'����^��Z��9�$�LW��A�^��g���I+`��IEND�B`�PK���\2Gs%% templates/beez3/images/trans.gifnu�[���GIF89ap!�,@D;PK���\*�ݷ�$templates/beez3/images/footer_bg.gifnu�[���GIF89a������fffeeedddcccbbbaaa```___^^^]]]\\\[[[ZZZYYYXXXWWWVVVUUUTTTSSSRRRQQQPPPOOONNNMMMLLLKKKJJJIIIHHHGGGFFFEEEDDDCCCBBBAAA@@@���!�(,���@�pH,�Ȥr�l:�ШtJ�Z�جvk x��xL.���z�n���|N���~������������������������������������������������������������������������������������������������������������������������������� H����*\Ȱ�Ç#J�H��ŋ3j�ȱ�Ǐ C�I��ɓ(S�\ɲ�˗0cʜI��͛8s��ɳ���@� J��ѣH�*�&��ӧP�J�J��իX�j�ʵ�ׯ`ÊK��ٳhӪ]+u�۷p�ʝK��ݻx��}+v�߿�L���È+^̸��ǐ#�%@���˘3k�̹��ϠC�M���ӨS�^ͺ��װc��\���۸s��ͻ�����N-����ȓ+_μ���УK�N�����}�ν����ËO�����ӫ_Ͼ�����˟O������?�����(�h�_�6��F(�Vh�f��v��" �$�h�(���,���0�(�4�h�8��<���@����Di�H&��L6�� ��TVi�Xf��\v��`�)�d�i� ���l���p�)�t�i�x��|��矀*蠄j�n.�袌6�裐F*餔Vji��f�馜v�駠�*ꨤ�jꩨ��ꪬ�����*무�j뭸�뮼���+��k��&���6Kk�F+��Vk��f���"���+��k�覫�������+��k������,�l�'���7���G,��>`��g���w��� ���"�l��(����,����0�,��4�l��8���<����@-��Dm��H'���L7���PG-��TWm��Xg t\w��`�-��d�m��eW���l���p�-��t�m��x��|���.��n��'���7��G.��Wn��g���w��O �褗n�騧��ꬷ�:��.���n�������/���O���'����7���G/���Wo���g����w��/����|觯������/���O���������H��L�h�:���'H� Z�̠7�z� �GH���(L� W(���0��gH���8�a U����@��H�"�HL����&:�Pl"�H�*Z�X̢���.z�`��H�2��hL����6��p�#3@�:��x̣���>��z�# I�B�L�"��F:�$'I�JZ��Ȥ&7��Nz��(GI�R��L�*W��V��,gI�Z��܀.w��^���0�I�b���L�2���f:�Ќ�4�I�jZ��̦6���lr���8�I�r���L�:���v���<�I�z��̧>���~�� �@JЂ�M�BZP2���D'JъZ�ͨF7�юz� �H?ꁒ��(M�JW�Җ��0��LgJӚ��8ͩNw�Ӟ��@ �P�����HM�R��Ԧ:��P��R���Z��XͪV��ծz��` �X�Jֲ���hM�YA�ֶ���p��\�J��xͫ^������ �`K�����M�b���:�����d'K��Z�����bٚ��z��� �hGK�Қ���M�jW��ֺ���m�fK�����ͭnw������ �p�K�����M�r����:��Ѝ.nG@��Z���ͮv����z��֕�l�K���Mԯz�������|�K����%�~��������L���N����;�����'L� [���o 6��{�� ��GL������W�����0���gL���8α�w���x�&���L�"��HN�����&;��P����L�*[��Xβ����.{��F>���L�2���hN�����6��Cv���L�:��xγ����>��π�s;PK���\7����templates/beez3/images/plus.pngnu�[����PNG IHDR��yPLTE��������������ս�����333���O@:�>IDAT[c` K�h4`�3:2��@FVFyyy5H"P&;B�r`` ��U�6����}IEND�B`�PK���\�2k���+templates/beez3/images/system/arrow_rtl.pngnu�[����PNG IHDR ڛg`SIDATx�u�!1Dѽ$��%8J}u�R4��iV�J�O&� >e���1"����h��hΉ���h���F�����(�{_�\��n�HX�IEND�B`�PK���\�����2templates/beez3/images/system/notice-alert_rtl.pngnu�[����PNG IHDR�9"�FPLTE�����������TT����������������rq�pn�TS��SR}SR�88xCCwDD{<<�22�00�$$���������������ٴ����������������������������������������������������oo�|{�zy�zy�pp�wt�vt�ur�ur�����nl�om�ki�kh�VU�VU����TS���SS���}TS~SR�RQRRRQ���}RQ|SS}RRQQ|RRuPO�77uOO�88xMMvNMwMMvMMyLLvLL���vFFyDD}CC�����zBBxBB~??xAA�=={>>���~77�44�22�2244�22��с11��Ѐ11�--�,,�..�**�&&�$$�%%��ψ##�""�����͓���ʎ����Ώ���ΐ���������Ϊ��������������� �叏��ꎎ�������ҏ�Տ�����������������oo�}{�6��9IDATx^��S�$[F�ؙYj۶Ƕm۶m۶m��65=�Y]���g���>������l�s�9a����k�m�Ye����1���cZi��l����]k�� �V+;� ���¦i�͊�� ��˩mp��FwwL��$i����Q}�v ̶��I�J#0$�Ʋ_JI��ߖ�^����W������a���� �Io}���_��NEuIQ���/(*�~�����>`�>˲B���B^^���8P�s���>`�)�����+M��Y���D7Jw}@�5xJ���*��s�t�$�>X��W�F�H�V韞ݹ���/W�Ir�t�įVJE�^m�w�t�,����t���B�zM�ie�44x����d�@�I���õJ��&��F��� ��m���x�3�<���V�ljֵo�ѥ̴�fE:i�_�����ٙ�Di��K��q-��7�:C��2�C��4�OC�|1�{C��3H�!@�!~b�xƤ�9�IEND�B`�PK���\|�##-templates/beez3/images/system/notice-note.pngnu�[����PNG IHDR�9"�sPLTE�����0���/�(�$�{!�x�u��.�������������������������������ٵ�ß�Þ~�����3��,��+��)��)����&�*�$����}"�|"����B��짃d��b�u��ꦁc�|I�{J�{J�q�z`�tS�g�sY�sZ�` q6 V/��������tTɣ�Ǣ�������Ý|Ü|ÜzÛy����z ��2ʥ�����-������1������0����:݆H�+�;ކ;�����܆<�������+�~&�~(у@҃?������Ձ:���́B�6ʁB���ɁCǀC����|4������Q��ڼ��}H��b�|Jټ��y?�t#غ�ں�ٸ��xA�zL�~b�xC�yI�wC�o�|c�|_�yM�wH�mٸ��z`�za�z`�z`�z_�y^�wP�uF�uH�wP�j�x^�uS�w_���ȣ��sP嫃�tT�sU�rN�j�sS�f⧀ʨ��sZ�r[�rZ�qQ�pN�d�qXɦ��^�Z�W�V}_H�T|CzAs: r8ǥ�_/ V.Ǧ�P) O' N&�������2�4����g�:�tS�{^�n�5��t�vQ��2�tR�IkIDATx^����]���۶m�۶m۶m۶�cIS�]���ﳈ��G>id�&@�id�&@�hd�&@�id�&@�:�虗��#�N9 ��u�qekvvvɏ��� jr�������Dc��!AJ lz��D�5�iI�ѧ�gh�J@Z��6�f��ӝ��F\ѡ���������QZ*NO.'yqG��)����B�c����"��[J�a���W����ۓ�'�V/��vk��l.����G3�UT?\*�C~���0J�����e�LǞ�]ix�ȴ�7�Y����tٱ���:/���Z�/��[��ֈE��y��a�+�RH�K��数�qM�S[�JhG�$�e��#��������NK�0��u�d�UͰ����"��o��Y Iw���Ф�5LD�4�U\��t��$�*+��`�<���5���*�ieڹ극���eW�)F% �mL�.�3��7��~S�R@��{{��xΔ��+�G+$��Ց����˃�2F 5�E g42M 352A �4�U �5�����>�=�IEND�B`�PK���\��KE**5templates/beez3/images/system/j_button2_pagebreak.pngnu�[����PNG IHDR�j� PLTE�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ξ�ͽ�ɻ�ʸ�ƹ���������T�w�IDATx^m�5rD1��I�i�������?��*W�_��6����4�W����=�L6/qi����h�2h�#��,;�|G��cӸ^�O ��Ҫ�ΕF/����[��1?�c�����9��AQݭ�CP��V7�fϿs���c8A��{��~c��% ����B-�h��x�FmÕ&�XrI�Ɋq%�l]\�!�@��n�IEND�B`�PK���\�Z{��1templates/beez3/images/system/j_button2_blank.pngnu�[����PNG IHDR��3�rIDATm���0������$8%F�P!S�y���+!N��ǶN>�i��wi�'���ٸm���Xbv��C�!��;D�g�H�����;\K�ꁡ�NVb�: \i�����tf)�}IEND�B`�PK���\R�}���.templates/beez3/images/system/notice-alert.pngnu�[����PNG IHDR�9"�FPLTE��������������������������������������������������������������rq�pn�TS�TT�SR}SR�88xCCwDD{<<�22�00�$$�����������������������������������oo�|{�zy�zy�pp�wt�vt�ur�ur�����nl�om�ki�kh�VU�VU����TS���SS���}TS~SR�RQRRRQ���}RQ|SS}RRQQ|RRuPO�77uOO�88xMMvNMwMMvMMyLLvLL���vFFyDD}CC�����zBBxBB~??xAA�=={>>���~77�44�22�2244�22��с11��Ѐ11�--�,,�..�**�&&�$$�%%��ψ##�""�����͓���ʎ����Ώ���ΐ���������Ϊ��������������� �叏��ꎎ�������ҏ�Տ�����������������oo�}{Ar[>IDATx^��c�dA�/�m۶m�m۶m۶msgS�s��k��Ļ��+�\0�%C��5�qC��3�C�l5�JC��K���5:5N; �} ]�zgQQ� K��j$�W�ԍ�_���ٮo����h��i��4�p:�Z�&F�$�gƁ{v���no��>Ί� H�א͎���5��֒?8R# ^����UUeUn{S�RWVDh$��e�����R��UZ^Y�����=\ a��;�e���bWY����f����P˄#��~r�r�urR�>@B,c7�~��g� u:#D ��q�M����� ���nZ�����~�1G��$В���_���Z����%��Z_�ԍ������vu����H�Ϝ����T�ٝ:i�I�^���/��f[vB�N@�z�g�]T=�^͟_�����/�+8q�خ�e��5R�/9-333-�Z; ��� 3 2� #�� � �� w Rb���?9���|��)IEND�B`�PK���\l8d5��'templates/beez3/images/system/arrow.pngnu�[����PNG IHDR (�zS*PLTE�����������������߿�����������uuujjj```UUU�~�z"IDAT[c`0`�NٻL�I�w@������;�IEND�B`�PK���\��bW-templates/beez3/images/system/notice-info.pngnu�[����PNG IHDR�9"��PLTE�����w~Ys}Hjm]�����������������z�ݍ���"x~Zv}Xrx[koZI[2>��B��B��l��������~���������t�E�����������ԝ�t��s�����l��i��ܒ�i��ѐ�c������}�/|�2{�5|�3{�5������������������rxZqzLqwZqwYpyN���kn[jm`jm^���im^en@hjaXb0������筸������������ᜦsx�;x�E��r��qw}Z��ltEt~J�⎯���sx]�� �����ntTmsVmsUnsXz�7y�8y�9jm_�깒�h�����"�� s~G��t~Fr{Krx]�����rw\��2������ƌ�����lqWmrVkpYko[��g���������im_il^jl_ik_��ꂙ#��&���}�0���IDATx^���z-XE� ��k۶mm۶�u���$�������`�'���,���3/g ��@��@��ױ���wSGkrb�akO�/ٺuǽ���-s��� U?�}ג��j�����TEDKe^/�a*%�����W��60S�7�O @�[���B����gfN�Ww�& ���0chx�����˞�ľ��o �"���=vq_:bw�+K�j��ҷ���5�m����8�����sQ��)�� �k�/. ���t�ƚ o- � �[j�Y��۷� VԽ��`u��"!�Tw��'��3��� }��B����L��J}�)�� �(��F�>���Į9W�~�.��/���J @��'�~~ۍ#�����������,�L@�� ��� �x� ��� ��� ��� ��� ��#�w&��L�{��G3�f �d �g �e ^�@��@��@<� ��O�[ ��R�S1IEND�B`�PK���\ ��jj*templates/beez3/images/system/calendar.pngnu�[����PNG IHDR�a1IDATx^�SMkQ=3�~�j"$LUQE�w�N�ʍ"�AA�t���(�*��(�~�!���Bզ��&�3���KH7����p��Ý73c;�(��F�qY2 $B�Tg���UR0$Q��#î1_�0�3����������}�;y`�H���vpl���~ތ7I�u04�H�b�2Q�6�GHt$A����NB���6��`���x�[u���Ya����~���̒�r��#��8�@JX��b �ebj����r ��;x7C`"�n�hxl�+A4�ʵ_6O%JzR�g�:���(?N?��髮�~���{'`<&�"U�r�>/nÇ0M�/yX���Da� A��%���Ο B�Ё�0�Nqvh�3QDNG��o!�뇷��1��,��(��y0OW�@�XY��?؋���ΗS���3����x�� o>i~���b9��p�k��;�?<�;0�;P��A6�8@n}�ݽȬ�����=���2T"�H<�i��-ɫn�*)�5R�_�n��U�����aJ��IEND�B`�PK���\�� %%1templates/beez3/images/system/j_button2_image.pngnu�[����PNG IHDR�j� �PLTE���������������������������������������������ڿ����������������������˪������ǚ�ټ����ն��������s�|r�{~��h��(�3�����������������������������ڻ��������������߾ۣ�ۡ�����������������������ѷ�������������ر��������ۨ����Ҫӥ����Р������Ϥ������҉��ͼ����ͺ�ɗ���亸�Ǹ�Ŵ�ƹ���̑��ŝ�Ŝ����ŵ�ô����݈ȑ��Ī����뢸�}�r��ʘ����ۮ�����w����������Ў�Ł�Ȗ����ب�����z�×��[�Y]�a}��{�����r��p��K�Uk�����c��^��^��X�����[��S��)�-IDATx^e�S�A�Ѫjcl{ֶm۶m�ɛ=��1}��{���$0�:�1J���r�����(Y�f�!�F#����l1�r��㪧 ��)yq��_�3��"H�����/��&$@EQ�[��� �l�P� ���V�N�nw��a0�Ҁ ���R�?��6���wb@�,�m��o��Z�v�)�x�wF"�ǹڦᢍ��r���l��X�u4�T��9��(�i���B�`p���,�d2�J�RY�,{���<�LQ fT��yQ�V9�)�Jm�ڇ*UD���*�ƪ�?m����U�x��ZIEND�B`�PK���\�yO0qq4templates/beez3/images/system/j_button2_readmore.pngnu�[����PNG IHDR�j� APLTE�����������������������������������������������������������������������������������������������������������������������������������������������������������a�����������������ݟ������ָ��Ϣ�@��������������ԫ��ى��c��?�ԑ��ӫԌ��\��ѸȾ�����ͽ�ϼ�͚�b�ʝ�Ή�Ĭ��ɺ�ȹ�ƛ�c�����ŵ����������]��kI���IDATx^m�Ӛ1��dhkm۶m[��>��*�_�m��O��ݿ�V&PDޒ�+ � L����6�����E��h6��D�q×�FR_��=/%�x`���� &��;�p@<��R�\"�N�x�ן�H�{��j{����K(�LtĎvs���8;κ�� �j,���v�2?#� �kм���G��b�]��T3h�V��x�rE�ǡEV.m@�$�藊������R8EGF�n�IEND�B`�PK���\W�9--1templates/beez3/images/system/notice-note_rtl.pngnu�[����PNG IHDR�9"�sPLTE�����0���/�(�$�{!�x�u��.�������������������������������ٵ�ß�Þ~�����3��,��+��)��)����&�*�$����}"�|"����B��짃d��b�u��ꦁc�|I�{J�{J�q�z`�tS�g�sY�sZ�` q6 V/��������tTɣ�Ǣ�������Ý|Ü|ÜzÛy����z ��2ʥ�����-������1������0����:݆H�+�;ކ;�����܆<�������+�~&�~(у@҃?������Ձ:���́B�6ʁB���ɁCǀC����|4������Q��ڼ��}H��b�|Jټ��y?�t#غ�ں�ٸ��xA�zL�~b�xC�yI�wC�o�|c�|_�yM�wH�mٸ��z`�za�z`�z`�z_�y^�wP�uF�uH�wP�j�x^�uS�w_���ȣ��sP嫃�tT�sU�rN�j�sS�f⧀ʨ��sZ�r[�rZ�qQ�pN�d�qXɦ��^�Z�W�V}_H�T|CzAs: r8ǥ�_/ V.Ǧ�P) O' N&�������2�4����g�:�tS�{^�n�5��t�vQ��2�tR�IuIDATx���eW�A��;�k�R�H���������������e9�]�̜�^��{fF>�!d,B��!d0B��!dB��!d B:�v"z������3�N��.E�sRSS�^��\��VB���qq����Ϟ �Q��$�GV�$���x�ph0IS�ɡ�h�����ݮ��N�4��=����On��"��@�&���QJ�&|}+"s*�{\��4}lȷ��qN�;YP|�2�=��^+JC�G�����_D�>(.���|����#s�R�)�We"W�Ǔ�f���#sj����L�\���q��>�#s^���ߋ���a9�l��t}De��WBד��G�W�QV����u�R������e�X#����������q<��n�+�1�(Ф-h�e~tՉ�ZD΄������\�I)UZZ��ል��L� tb��Y�ث�Z��L��b�|�_�7�>[�"-@3� �7͟2'���Zsi�Y������T��!�B��!�4B��!d&B&�!�7B��!d<B��$����G��H�}�>���IEND�B`�PK���\Kr��0templates/beez3/images/system/j_button2_left.pngnu�[����PNG IHDR�Պ0�yIDAT�A�@��lGIt�d_Y�D�Н��{�4�@��_��i�z�|Zh�����\7�j���6@�G`g�l�� �H9\���]`���T�2x�T�&�`���D���` kŖIEND�B`�PK���\6g���0templates/beez3/images/system/selector-arrow.pngnu�[����PNG IHDR X0$�0PLTE������������������ޱ�����������������)��tRNS@��fDIDATx�M�A� ���q���V�����e̬K դ�i����%�:x�;KL:�Z�ΆD:"�4�xo�U�IEND�B`�PK���\]�c�1templates/beez3/images/system/notice-info_rtl.pngnu�[����PNG IHDR�9"��PLTE�����w~Ys}Hjm]�����������������z�ݍ���"x~Zv}Xrx[koZI[2>��B��B��l��������~���������t�E�����������ԝ�t��s�����l��i��ܒ�i��ѐ�c������}�/|�2{�5|�3{�5������������������rxZqzLqwZqwYpyN���kn[jm`jm^���im^en@hjaXb0������筸������������ᜦsx�;x�E��r��qw}Z��ltEt~J�⎯���sx]�� �����ntTmsVmsUnsXz�7y�8y�9jm_�깒�h�����"�� s~G��t~Fr{Krx]�����rw\��2������ƌ�����lqWmrVkpYko[��g���������im_il^jl_ik_��ꂙ#��&���}�0���IDATx����v�QE�u�@�%֦Z\J�š+wwwwww}`�t�I���ރ�ݜ1��_GO� �������N�8�M�F�9 ݙL���ꪉ`̬ěCzz:�Ϭ��Lyߟ��|>��尢 `�Ǖ�!�:I������`I���^5��{O����!_'C^����7���R�0�k*�?nii�ז���[ׄ���B��(j1��.�?����Q�x�#6�f�zcQ�X�#��f�������5�u)E�;�V���(j�Q��z��6�GQS��頻��u��4ٿ�y�`�<���4,�Ɠ����r!/ϖ���%��δ�H[��Y9i��:���P����1�h635�X������w�s:[��tkg�U�� �'t��NpB�� m'� ��OpB� }'t��1pB�� �'4��$pB�� �'���qpB����@���)g��يTsIEND�B`�PK���\���ĝ�%templates/beez3/images/content_bg.gifnu�[���GIF87au�������������������������������������������,u"� (A� �0��c�x��|��pH,�H\;PK���\�G���*templates/beez3/images/blog_more_hover.gifnu�[���GIF87a������躺�������kkk\]]��ݰ��A@@yxx��ޣ�������������ޱ�����]|�,c�Js���Ƀ�� Q����,k�&�dIZU6d�ejׄQ�MWy �ANd���O2qi*���@P�0Q�� �H�� ]�����ߦ��Q�O�����>b N0<iAC#1357�')+-/�$!;PK���\Q�kV}}templates/beez3/images/req.pngnu�[����PNG IHDR�7uQrPLTE������:=?�����ʷ�������͠�������������眛���������ݣ����������������ӕ�������⢡������kln��������״������������_�IDATx^��W�0P�\ҝ��W�8�0��F#keq�VI� �Ъ�CbY�<�ܔ2~�h�-PE�VK�Zh�c�W�S�aTD�ո�?Djx-gI���~K$�I�2u�>F9��Br�$�N�n�ݙhL�t��SgD���$� x��ty�Q�}*�>���~n�c�5��8kl�Κ��ʿ���_�� �0�11�&IEND�B`�PK���\�;B���'templates/beez3/images/nature/pfeil.gifnu�[���GIF89a"�fff�����ŵ���������������������������������!�,"K��I��8�ͻFA �B��XAq&#��2�p݃�ԋ��"(,�"�R`8W��3P)"�JcpE@'��š({��z��;PK���\P�!ee,templates/beez3/images/nature/arrow2_rtl.gifnu�[���GIF87a� ���_^^�����ϵ��������������UUUrpq,0�I����!�> & ! D���jj,_;PK���\�C�6rr(templates/beez3/images/nature/level4.pngnu�[����PNG IHDR(�F�9IDATH��� 0����L�80�V0(��{�3��}�uL��� @�\&�>��GT�� IEND�B`�PK���\z6u+��-templates/beez3/images/nature/arrow_small.pngnu�[����PNG IHDR6|J�*PLTE�����������������߿�����������uuujjj```UUU�~�z!IDAT[c0`�N ѻD�Iw����z��q?y�IEND�B`�PK���\�M�fdd(templates/beez3/images/nature/arrow2.gifnu�[���GIF87a� ���_^^�����ϵ��������������UUUrpq,0�I�����:���Xqf���p;PK���\��1��,templates/beez3/images/nature/arrow1_rtl.gifnu�[���GIF87a�8�Ljeg����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������¿����������������~y{a[^���,�8��L����������������������������������������������������������������������������������Ԟ���������������������������������� Hۻ� �K��Ç�"J����Ä�jܸ�� %H�C@�$���\ɲ�K�(+&�� f��6s><���ϟ?��聊+m�\zR��vL�J�J��U�O�J]�@�kK��ٳhӪ]˶�۷p��ʝ���ݻt���˷/�$K��e@���È+^̸��ǐ#K�L���˘3k�̹�d"K�v@���ӨS�^ͺ��װc˞M���۸s��ͻ��!K�~@����ȓ+_μ���УK��<�u�سk�ν����CR�����ӫ_Ͼ�{��ˏ�^�� ��������'�h`z���6��H��Vh��dx�Z��� f��!�h�(�8�Z��0�(#4�h#2��b�.���@�x�9i�;R�"��I6餓GF �#.yb{d��\v饖!�)�d���h� l��&�b�)�t�i�x��|�駟hz 蠄j衈&����6�蟐�I夔Vj饘�h¦�v�i ��*j���j*�"��ꪬ�J«��*k���j뭸�z�#�����*창�:��&�l�̖ ��F[���Vk�^���v�·�+��k�莋º�p»����k.������,���)'���7���G,��#���W���w��� �,��$�\�(����,����0���1�l��8���<����@-��D��H'���34���PG-��TWm��Xg���\w��`�-��d_-��h����l���p�-��t�m��x�=w|��߀.��j�`��5$~��7n8�C��#�x�6d�y�k^��7N�褓���w��嬷����.;�/�z��~x�4��x�.����6�'���7�����x�Wo=�9d=�����/����`��ʧ���<0���[��篿������>��8@�Uz����G>�x��'�:�Y�̠7�z� �GH���(L� W����0��gH���8̡w����@��H�"�HL����&:�P���H�*Z�X̢���.z�`��H�2��hL����6��p���H�:��x̣���>��� I�B�L�"��F:�$'I�JZ�̤&7��Nz����(GI�R��L�*�;PK���\ٕi�WW-templates/beez3/images/nature/headingback.pngnu�[����PNG IHDR(���IDAT�c��,�4���i a�1��P]�*��IEND�B`�PK���\dW���-templates/beez3/images/nature/arrow2_grey.pngnu�[����PNG IHDR �GIDAT�c ��@��l���?O#F������K� ��gR>7-��C�"�B\�+�' ��A����.�IEND�B`�PK���\z1sIFF0templates/beez3/images/nature/readmore_arrow.pngnu�[����PNG IHDRexxPLTE�����脃���������������������ʇ�������������������������������������������ɏ����ё����������������������������������f���IDATx^m�G� a���Y����U���PS3,��έb����l7]O't�8�N��Ek�2'��b�^A��%W�p߾�<)r&Ean%+�w$nq1��'��A|�<�����x�9x���O}�����5Ͽ I4�H�IEND�B`�PK���\/�1�.templates/beez3/images/nature/searchbutton.pngnu�[����PNG IHDR��/X��PLTE����������������������������������������������������������������ſ�ľ�ý�¼�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~��}��|��{��z��y��x��w��v��u��s��t��r��q��p��on~m~}l||j}|k{{izzhzygyxfxwdxwewvcvubutats`sr^sr_rq]qp\qo[pnZomYnmYmlWlkVljVkiTihSjhSigR� W@IDATH�cif�,��T��M��h�����}$�>�?�lF� q<À�lM6�eݨ�#;�7�vYj��5IEND�B`�PK���\H7 --&templates/beez3/images/nature/karo.gifnu�[���GIF89a������!��,���X;PK���\�-���&templates/beez3/images/nature/box1.pngnu�[����PNG IHDR&���PLTE����������������������%�nC)IDAT�cae�X�q��)��.��S��W3�a$CUe��EY�@�IEND�B`�PK���\�]�A��.templates/beez3/images/nature/nav_level1_a.gifnu�[���GIF89a,��������!��,,q��������ڋ����H�扦�ʶ���L����� �Ģ�L*�̦� �J�Ԫ���j�ܮ�����N���;��������o' 8HXhx������88T;PK���\�a-���1templates/beez3/images/nature/arrow_small_rtl.pngnu�[����PNG IHDR(z�YIDATx��ӡ1D�k2>O�����Do}��ggP���,"P�w�CfBD���tw03���f�9g�zU�`}���D�X�sZ=�d?�+{�IEND�B`�PK���\}U]��-templates/beez3/images/nature/nav_level_1.gifnu�[���GIF89a(�������������������������������������������������!��,(���I����ͻ�`�9di�h��M�p,�/c�x��<����pH,Ȥr�l:�Ш��Z�جv{Ex��xLg��a�n���x�@���~�����������������������������������������������;PK���\�]]+templates/beez3/images/nature/blog_more.gifnu�[���GIF87a�2����faa���lff���������RNNd_^���JGFunnicbNJJGEE���;99��� =?=�����PPP���(''�����ٓ�����643���\WW,�2@�'�di�h��l�p,ϭ!K!t��p82����axĨtJ�Z�جv��z��xL.���z-,K��8 �~���������������EG LNP��Tnpvx��S68:��������������������������� �� ˨ آ��������������������� H����*\Ȱ�;PK���\ġd���(templates/beez3/images/nature/arrow1.gifnu�[���GIF89a�8��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������¿����������������~y{jega[^!��,�8������������������������������������������������������������������������������������ԠHJ*������������������������������H���}��3���Ç",Я��q2j�ȱ�nj�,Q��ɓ''�����˗0cʜI�ʛ,c�T�s߁�@�J��Q��*]���wEo&���X�"��݂�@�$�J��ٳhӪ]˶�۷p���}۠�ݹx���˷�߿}>��È+^̸��ǐ#K�L���˘3k�̹��ϗ�0⠴�ӨS�^ͺ��װc˞M���۸s��ͻ�o�E�@x@����ȓ+_μ���УK�N����"h�ν����KO�����ӫ_Ͼ�����˟/�}����Wo��� �I���U`�y&�`�����F(�Th�f��v��j(�$�h������b ��vh��8樣�,V��@ �8�(��H&9a��)I�P:)�TVi�X����\v��`�)f��i�h���lvগpr��t�i�x��x��'�*蠁��硈&�(�6�裐F*餔6j¥�f�香��駟r*ꨤ�J*�����%��꫰��ꬡ�j���~:®���뮘�:ª��j챬f벰����F�쭜K��)d���v���+��k�莋º좐��{¼�����.����/,�l�'���7���G,��W�p�cl��wL� �,��$�l��(����,����0�,��4�l��#��3�<���@-��Dm��H'���L7���PG-��TWm��X=��L���`�-��d�m��h����l���1���t�m��x��7��߀.��n��}נ��#^8 �C���`� �cNyߙw�砇�9�/���Gnx�K���7�>x�������� |�o<�:$����7���G�C����_<�����;/����w��§��Է�~�~�����矿�ҿ_=��_�G�J�~�K��:���'H� Z�̠7�z� �GH���(L� W����0��gH���8̡w����@��H�"�HL����&:�P���H�*Z�X̢���.z�`��H�2��hL����6��p���H�:��x̣���>��� I�B�L�"��F:�$'I�JZ�̤&7��N:1;PK���\�# �^^&templates/beez3/images/nature/tabs.gifnu�[���GIF87ad�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������,d�Hp`��*\Ȱ!�9@D�J�T�LA� �TP�A��$ �%S�D�1�7,X@5�d��[P��YĂ�"= �i�HL��-���1 4�*f�� ���@I�[�.ڡ�Ν�M;@IZ+l�e+CBG$9"�0w��=rą.K��e�=�/)�@���ʘG �L�3�!�:_hqa4�ҦI�raȡ�Ć�G6�BlC(s{7�P����8/EnDIn��(Q���`d;3�`���`���7���|�&+4ď��� ~�Я���4$HB����F�i|B����v��b� `J� ��aX,�@�������0N��*�8A�*����c�=��c�`�Pr�F٤��D�!�D ��Vj1��[F��&/� �%5�Pf 5���/��u��B �'LL��u�Kd ��*hK0���z�:H��A�� :��i�APzj��Fq�Pnt�IU�:j](��&`b�����a,Ъ�� �@�8�,�t��C����F[m�?$�C �-��p�m�x��>����D�Ј�&��{ уYx�Y�N��Hx@�.L@;��[ d�1�t����1#�̀�?��'����7Ӭs��LC4� @�L�|�sL#� � 5�)0�F0$X����)8�)� v�� ٧�Ͷ�p�-��t�=v�x��|�C�߀.��wn�܅���y��ގǽ�ޑ�R��g���rOη��x褗n�駀��ꬷ�z۪o;PK���\���{{%templates/beez3/images/nature/box.pngnu�[����PNG IHDR&���PLTE������������������!���!IDAT�cab�Xp��)�H�iLd��@'�����B (EdIEND�B`�PK���\�7ڢ�)templates/beez3/images/nature/grey_bg.pngnu�[����PNG IHDRrT�g�0PLTE������������������������������������������������®��-IDAT8�c��>01 4�{$@-��2�l �-��9P�9���(�0)��p<�IEND�B`�PK���\�)�pOO+templates/beez3/images/nature/arrow_nav.gifnu�[���GIF89a �>>>��籱�wwvIII���fff���!��, ��.ũ�Ubnn��@Z�;PK���\dW���&templates/beez3/images/arrow2_grey.pngnu�[����PNG IHDR �GIDAT�c ��@��l���?O#F������K� ��gR>7-��C�"�B\�+�' ��A����.�IEND�B`�PK���\Ґ��pp$templates/beez3/images/footer_bg.pngnu�[����PNG IHDR���)��7IDATx��Ա �@@�<��<��T(��5�s�됟r~�(�A� �n�Y&˅�, +��t!6�ɲY.dG/Lְ^D7]���Ӌ��Y@zza�\��RT���Y@L��r!;za���"��Bl��^D7]������BL��bD7]��b�l����5��Mb����"��Bl��^�,b��#��Bl�e�\Ȏ^��i ��"@� � @D� �"@� D� @D� �"@�D� @"@� �"@D������<8�)��[IEND�B`�PK���\dW��� templates/beez3/images/arrow.pngnu�[����PNG IHDR �GIDAT�c ��@��l���?O#F������K� ��gR>7-��C�"�B\�+�' ��A����.�IEND�B`�PK���\q?����templates/beez3/images/news.gifnu�[���GIF89a�����������������!��,�ZH��=0�9��8�� �di�h��l�p,�tm�x��|��pH,�Ȥr�l:�ШtJ�Z�جv��z��xL.���z�n���|N���xR;PK���\3q����+templates/beez3/images/arrow_white_grey.pngnu�[����PNG IHDR J�ΛSIDAT[c8#t���g`8����3��B���3���Px�"L�3\�י(����3�g@l ����7��G���Ȏt5b]`��eIEND�B`�PK���\Q*곛� templates/beez3/images/minus.pngnu�[����PNG IHDR��yPLTE��������������ս�����333���O@:�;IDAT[c` K�h4`�3:2� X���X� �D�1�t�K(�Wm6��\e�IEND�B`�PK���\}ZT�o o 'templates/beez3/images/slider_minus.pngnu�[����PNG IHDR�Fh�N�oPLTE��������������������������������������������������������������������������������333���i� �IDATx���v9��%0!w�@`6��Wr�gg� M��eY�Z'�r���A�zg���3�+�<�tm�k�;S�ߖoSͺĠ��Ur��t�]]Ȁ,(�kA.D�6��{�݆%c�˅ހ4(�d��G�kU��S;z�}�\PP�;�]x�"R��ąDsl���^E����M4.�Ԅ(�f{[���*��դ���yc6D ˍ",N�)ۄ:���t8x��|�L���Ѵ�q^�Ʈ�hP����m��E�o�� T��J����>�{I�!�;�/���b��0�G��p��!=��Ju��J��b�Tܱ8B3�l�1bL A"��1/AS K�&:�)�.}rk9�&><�M��(@f��晲�� 8�=�?=~��z� ��_���3�ApF�]q�A�3�!�?ڠ?dЃ��O��|ϕ��c��]ч�kE��Z�"J ؔ.d�<�|Ѽu'�F�WΚ�L�C-ة^4���NYJU;�U�R$T��Nb{�IBy���ܪ\��N�R��� �^�H0hՅ+��u"��>%����6cU1qFh��IKÓ&��s��T���ł�擝�&�I�"(�N����,�����%��:�6u��z�o�C=N?�E������.7�)Z��"�QDa��]�4n0qS^�-��R,�° ��b{��6�tdRm���X���� ���� �u�A3%^+��S�5w}A�{�R�:�\��:�%q��e�˅ހ4( ^ɇ�7h�^v*��;��P�䂂bƟ�lx�"R���*Z��>֢zP���<��_�yu�]�.c�\.��C��n���]����ѥ�e�x��]\�ǭ�zlW�͙>d�p�L��i�o�B���~��b���pW���ph��t�[��j�82aҤ�-C�Ŕd�V���X]R��ȡ�)zdHpؐ]2��~���<�F}!�-,7d/�>9�Z� UD(��I���4�1�|����>�8hG-h���<�0���q����5�3`�L���]�������a�h��7S�`�RÂ�d� V��j:{�(-n��L�pM�7kT^�N���2�p0A��X�D�J�[�W\&�B;KJ���?=cL0'n��P,o�EVt� ���� PEg�ы�_�>�S�Ap"<~� �?Nn=N�o�������o��A�Nj�/�O/o�Ԥ�TG�����n�"�#�D7�v���m���a��$���Y102ݢ/r�{/��N�W��զ1k=��3%�.�P���\�r��m�*CS�I�Fa��i@ˀ��2�:E��ë.I��4z-��^��خ\Pj��<P+ɫ>]qn5VX$�)� jY�I��Y�|r;~ ���ȠA=�z���no�ڸ��xt����xǂB뗰�exc����K\HhiK���D�@)�&1���X��'BQ�92��j>���D��agR ZHXn@�=���V�n�o�E+��{j��ERiIs�.s|<T����K*�J�j>,��G�����~��<a�S���b����������� 8=2�A�A��8������8����yn�V��ȏ���2:�[6�^��� �y D��Q���)�е*DA���ʻn���.|[ԉ�e�ɡ ��q�B���!"�\Y��r�A:F\���/�I���Ȇ:Z��KRks�u�X��4 �^��R�*�'�����-9��/���Yl�� N�zdЃ 8���^�~u�)rE��Śj�t�&��t9�����Y@4��) ��̵��o�a�5H>���Q�nfO �P�4�&ɦ/��zCdw�/&E��\�9o���H(1��!msҧ1ڋ�2�5#Rh��b.��1���ķ�q�&���o��&�,Y��n9�m�a�V�����9��#�� �c��xj/�]mc�g,uKoMI\����:OSMb%��F� ��P'�eS�(�z�2Hɫ��l�F�a�@��M�P��kB{?�&y�/5�נ��H���U�S!$�o�!�\J@dRiRg�����UԈEJ ��8�{[��� ���z�z�4����!�����>��aJ��x|���ȠA=�z���A�� ȠA�A��Y�%��#�� 2�A<o^�|���u맏���v� ���r�Z�"%��jvK��)њ�� ��p�W��Ra�S/�` (5Y K��j{��: ��PZܐ�� 2¿$�uN�䱽�*��7��M�9�(��/�[�x�YR����wv�4�V��<kC��� b?zI�UQt�X-��h}nN�\�i�S�� N�zdЃ ȠA�,p���A�z� 2�Ad�k��i@��b��b��ci=x2�������gp�j'��y�IEND�B`�PK���\}U]��&templates/beez3/images/nav_level_1.gifnu�[���GIF89a(�������������������������������������������������!��,(���I����ͻ�`�9di�h��M�p,�/c�x��<����pH,Ȥr�l:�Ш��Z�جv{Ex��xLg��a�n���x�@���~�����������������������������������������������;PK���\ И���$templates/beez3/images/blog_more.gifnu�[���GIF87a���ꡡ����������A@@������yxx���\]]��ݰ��kkk��������������������豱�������,@k &�d�]�Y���%ZW�&�]I]�E2�PL��x�V��,d� �@T! G�D6Y*���2� �:AS�@T�AN5��P*"u+-/|~"o�rfhjl$!;PK���\Q�݀�$templates/beez3/images/header-bg.gifnu�[���GIF87au� ������������������������,u50%� 8���`(��a�h��V뾰;�tm���|��pH,)Ȥr�d �Ш;PK���\V��d templates/beez3/images/close.pngnu�[����PNG IHDR�W�?�PLTE����������������������������������������������������������������������������������������������������GGH������+++������������������������������������������������������������������嗗�ffg������������������Ȧ����ʌ����伽���������ɸ��������ggh��������������������˪�����uuvrrr������{{{����������������;;;�����������===EEF��������ͼ�������뢣����SSS��پ��������������������ˏY(�tRNS@��f"IDATx^u�S�Q��3�m{m۶m��;gn������%��TY�d?�R^_��d��R�D�<�i�Sz�8�#"���&�̌\�W�?����I��������������Y&:�>,KT�:�g�����q}�����q]E�.�=;�a��F��խ�4�m��I] �K�bi�a&���vc�?f| �~��8�16�����u����U�[��U�f�ΡW�U4�<������w��x���J�d�%)�Q1� Y� ���lb_@�n@�Jd���'E1u*=�%�@ H�.�IEND�B`�PK���\,����-templates/beez3/images/personal/tabs_back.pngnu�[����PNG IHDR�؇o�PLTE__aOOOYYZWWXNNN[[\WVWONNVUVQPQ^^`__`]]^^]_]]_ZZ[SRSUTUTTUXXY\\]PPPQQQSRRUUVSSS^^_\\^RQRSSTONOTST[\]_^`YXZRQQQPPXXX[[]TTTUUU[Z\[Z[VVVZYZRRRRSSXWYOPP]\]Z[\ZY[PPQ_^_YXYZZ\UTTVVWQQRXWXVWXNNM\[\POOPOP]^_QRRNNO]\^RRSXXZ\]_YZ[TUUNOO^_aSQR\[]`_b``a`_a``bMMLMMMMLLMLMLLLNMMLMMMNNMNM�$���IDATx^D�� 1�2�!}���O�0�[:���ˈ��e8X�ج��(}��o$��}c?��n0��n�W�.Қ�y���9�=��\k�w���F��#��<"bGL+�+¯C�ZKIC�Rjؕ�a� �Zܪn��9q�*���Cf���>�_�JNu���U;撐Iwf^|�$/�UV�˰�a�6"��萗�88������'m`C� ����@�N�:�^2 > ��vU}]�_6�`��h�E��AA� ��]�Xz�N�@O}� 0����]m�Ȟ���OI�$u�A��`YA���`ޭO�Ryp-�8��3��b]l�!�[Us��N��_��`���<e��'d�"U����4=a��̜c|��]L��1��4��S<��mFoY����ptC�@Q�h�w�Z�F�ӣG~ޮ�Y�����_&����LvS3cc!���Ͻ��{ҽ��~�����ӛս;��tb�4�Nz�ퟘ4O���;��4�i�{:��_���U>K��4�d٧���7���ϻ��D8��夬D� ����O_Lwwo�Vzo�餜��ݜ�i��ޟ����7��E]�k��Z؟�bo}�-ՃX�R��Jn�A��n���->��,��=��5���Fw�W�w�I�·cu��ۻ�%Ht���Wye���Q�籵��;��:���U���n�w��O�fD�c�7D���N��<��zK(�~�jg؞��Vc�۳R[����&2X��V[�ڛ���md��=�ΐ�Z�����Z��J�ѫߍ��M�+���zz�{�XG0:��.�r����]�&���{v����{ĢN7��l-����\:u�፻ػ.�ﻍ-ͨ1+�Kz+m�>)AG,�ފL&�����D���?�Y�@�`��NBa��w{�������-~^x�`V& &�Sɣ�Ŭ*H�AQSM�Tۜ�`��!�����iVؾ��+�Ae�d&��*s+��`��R�n�60F��?��%���J�'O+�"��D�9��PK=".pq��j��Dj[#���x҈��[ĉ7�٨0�f۲7>r�S�����j� �����:�K�� rL���Re�>aȿX�e�A��B�\\���r��M-l��|���:J&X��rs�P�}qq+M�k�[I�jg6�U��R��-Q&��S�~�ڳ�F��w)�"�6A��IY�b��5ΗZ�O�!Q�$s��F�|`�$!(IX�n#�����!���^�:�(w���=�j;����G,;�zj�n5fj0d1:P����%���S'�����Ev\��6�}�j�M�d�H.˛�4�tT��Ӻ����qRp �j�L�ǘ@%�ո�lw�#��Y�5%,�PC�t+�/�.�;�O�C9Ȣ^Kov7��0H�+;��zI���ӀOڷOD�d�������n|�J�4|�����I���� �� ԉ��~��� ^y$O�&��+�8�O�K95.��/�:�Ϲ��_�%T� -L�(�q�^D�v���I#ħ�c�|�nqiM�i�K��{�����m>����l��;.J��&�ȃf�����ZYM� ��Q<^!"����n"e�6�!9V'95��=wR-�^��D�@ℝW^�]��vc��G���B Y�;MJ�$������k��>�ʑ�ð_ݴ��-�#4��܀�a�]�����UM�����gm6�C� ��D@�NJ��ej�T �RMS�`_N|5����2S�Cƕk�J�c*��P-O"&{��ĝ`�ю |P��|>�)��3������%yw���RK�/���/�0���[9��z�@K'�gwŐ�����;Ш�Ͼ�ai��Jo��1�ڱD�.9����0&ꔅ�L25On��= �[��z ���B���̚M$�=�"eW���JZ �bQ���cJ�7�� �Tn�?v+>�P�ΌSQIm�Z�y�S�b"��A�&Q�ڊm[�M�0��q�h#���g�m�����lE�D�i��2�$1Ս5��J2kL�$��jB�3�=.J�Q�@ebr0Ej�m3�lK�����X,ց�gk+= �,�X����I�t�1�먓R*]��O*�)�b?kq�t{^�X�%���d�'����.Z�FVw��⪅J�%.f&�53��y�R���HK�G�Hf��i�zt�ʙ?�D���N�1�%�<;�>b%gӼ�M�i�V����d@t�JU[P�]~"�j�K�1̕kt��͒o\?�ÿ��Y�3�t�P`S���A+����N�,w����/�p�! �VO�E6���u�-g��[�9=_6�)�@�b�=X%P�6�ס��߾;�)�u���/Æ֙�2�Hǡ�}G�F���ɉB"pm8#�_������J9��Sʔ�"L��Ѓ�����0� ޤR���gq:\�B�l�b˥`��_EĞ� \�*�!*'��b�(�P6��Ѥ1��e�veA�i��K�(� *�ݘ`� �����U�h���E_���O����} ��>�DF#��f��m�Հ����Z� ;�L�g�Z�;�,�b;�,��f��ɳ��i J��f?S:s�7��3X�7M,�rR��Qn��o�+m�o�`k!��É����ol^_�H٪�A|�o��e��va])�8��c��l;�V.�3���]P�;mu5u��衬�X��Ak��kY�m�?�[fK8�q j���Y:���u���i~��'U`�� �k�p���c��%���l+͆�vl!��SN� 5y����l��`���a�\�M�� ���m@k�ݕM�@���m�t�8M6nI_>��=[���H5B,�s Ty]��5�� Z�r��P�����-_ �f8&�E֊f�L;�Q�`�^���q\Gv��d����S��%���=�a���V���H�C�$�=����q�N)i�N�2q�[/Pw�G�~G$����i-�?jGR�W�I��R�%��`A0�2����m���1��<� eA-0R;�I(��5��� ѣ�#%GJ�;-$�xݵ�`>�� !�W�� �\-(|0"�����q��`L��Z\d�SV����[�@��Ϣo�<�O ��!G��ҰL��t��Z�Y\���e�AY��P�{E��q7�h�2Dۙe D��/F��Hf��D��8H�x��۠���\�/&� :$[�{�Ԛ��/F)��lv�tU��:uo���Y �ȶ���.:�%0hE���j+��R]G��o�<�H�R��m���%�7�)7����WN���W�_D�G�$�P��b�4b�W���K�gˢ�N���'�8��)��5����}{,��])=|ee�^�0>��P�v�D�a �$����["c=q���i��]$��U?�e��WZb����:J!�$�G#8���֧C,��\L�?��Sާ�����I����S�!�� �|E� ���C�&x=�j~*A Ek$�P�(?�,3���e�^�#��K[d� Z�,����/��A��^M��=��J�V���9�m�O�B\�SιN�Cd�ne?��1�/�h����#˃��6��K�.�5��(]���J�����!NK7�C k(��a�h�8�mIK��N�ի�]�x<��Gf��� }�e�җ���X�����|,�,��L'��'�ު�RL�� &�wL۽� ����U�d�&�;�m��� 3(X�/�]��sg�ZJW�Bx�o�L���l�J�Hv ��=uF����|�y]�SDs#.s��~b|���^T�NSa�c����tYr3��D�iZ�VB��b ��҇�5�j ơ�Mb7���&N4³P*X�o�(���&���G��>E�=���s�Yl�鿡� ��!}U��5L��V/{��>Z*+���K�u^if(�7aӉX�Z)�T��)�3�^I�@�����$��I��m��y,�e5��Z�K%PV' �Ȧ�dr����MD�X�\��D �J���Xb�ż��վ�p9 ���'ݰ�$Om|< �\�n �y~=��0!�L��^7��w�k�F������D�����M�?��"��:bD�Dj7 u�A@���&5��z�k�8��I��:�'f��_v�1uP���p6LנqѢvd�6_�c؎Il��~�>X�?V�$|Ak��j�I��ud�0���ڮ��A��&���o���0�xS��P�N� ^�6�Ug���ٰ�R%T��X�x������3�ॽ�$��Q��@X�P$)I�hD��iNZ�[X}m��|3�n�bqO�P�a���J�J� c����(��{��C�IEND�B`�PK���\�ö�� � *templates/beez3/images/personal/button.pngnu�[����PNG IHDR~@�3g�PLTE��������������Խ��������¾���������������и�������������������������������������θ����и����������ľ����Կ���������������ƺ�����¾���������ú�������������������������������������·��������������¼���������ſ����������ź�����������ľ����������������������¾�������Ϳ����ƺ����������������Ŀ�������̼�����Ŀ��������������»���������������������������������ֺ�������������������������Һ�������ֻ�������μ����ν����˸�����������������������ѹ�������������ϼ��������������ƽ����������������������������˾����ο��������������������ø�������Թ����������շ����ļ�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������b��� RIDATx^�ͅ��0�c��uwuY��B��.���IӴ%�.��Zp�q���k�5I��j?$�Fh��[G=��Zah-eҀj�P0��Jfah���}����f+L&� �i@�t��L���]Pi�;�E��9�� �a{�>��~��C�3�k��!i����N��_�ʧ[9����t�S�TXEr7-��-hی���m5����<MI�� ���H�\>3=i��o��_�����Oi!�$�1�X�����sZ�Cs�����F�Q�C��t#�ݫ�����t�V+\H�H9���U��^�W��sNNb���X�|�i�Yv:���_t��u�SfF]ئ=�m{i�4�9����\�3f�aHe�j���+�[2B�r���xl���H���F�(�VX +T䨒Z]P i��A���a��B u�ZG@��c%YN�*"�a�}��d3�4���yo�xo��|>����dNk<bc�s�0�&'��1P�\.�k�_��A� �^��X�6�͊�;àCC7T�Jch�� � ���3���. �:Yi �*�1ԇX�f�@@�b���>*��yͲ�W����� O[E���|��Ev�w��x���ҵ+�>�D[����s�M�\��~�h4���V��}��^%Y��,ɦYIB/%���&��k��4QR�����iJ�L�PJ��g���b�'y���Q�,��L�,�D�Kax�q��y"�X/'//'G�!,Dڑ�1&b�DQD;, &�Cf�<��)bI&���a�B�'S�ġ�1~�g�K�G��O��w�x�6"�q=�,~�٬���>J��� ptAI1�鳳����)�v�X{��m�l) 2:��cQ������,������̥~,R��ە�P����V,��W���R�-�Z�:7�ݺ�+�;��%P�!B�8�W���yq��������w�}�J�J�`�:hm܈�>ha�$����%`rZ ���ւ^���ތt������e�)� |�?Z��i$E���7c�73��y�eY��UeY���H�q�]_{ ^dy�yި%0z�nYUx��ťVћ�ZY4����C���`�B<�uݱ�o.}���h�L�;Un� �tr'.p��}.��FePU�.�w��ֺEQ��wwx�=P�}��_ ��ϯ0xĨZ[�~ץ���eY�6�M�i�[� G^mH�ol~`���>��Pl��������2,�VɐS��1{�;��C#(�SE�d>�df���Dع���KO�m�V�mϘ���fcQ�'2�(^Gk���D��H�1�g1�1v�1f�m�ن8�;��ik��x�aw"�[6ÅL[`/�o�Nk�rl|������ x�(0d/h��`�o� �q$&ٙ@@&��Z��U��mW8�p����`5�:D�aNc�i�ZA0���|8��H㫔�#��)ԇ"e͉�GjN3�9��wt�a�0x 2�l�s��}[# � Aru�����,��H!�d��|�x���+}.>5Ś!})}ߐ(��+6��H��g�9��[�D���>��7��g��B��%��R�W �''UJU�w X��.��)^�G*T5�JD��$92��N���PImЏ���*�����~��<��A�vĨ+%�,K�D�N����#�ױ�4�2�IS) �]�E����v�n���U�ʷ[�IQ�� 2�3{~��i�,��3��7�ZO�l$[f|]���|Q0��ۦ�Wu8�f��9OP�-̪�[���ݙ��@a Q�Ap�Zf�C��݁�w���/��\�c�&M�/�OL��4�l��������߲�����:e�(ɛyk�+��־����7f2GB_��d���&��/D3�2����Eq�늏1jr%-7l�:��1���,%a�cGӺ����"�IJ�͖a���m�I{�U��������S;�mL瑖q���XR�� �ְ�>�1!#v��5).����Lƴmbڣa�b�q��(ѐ�C��Xi��Ьҧ�$*@}Nb53�����r ix7�Ӝ�sA+5��T織q�0Db�v]'��~/��J`�_^^�/X���}�����j�`���?�2���pB2E��{/����r{/��h�B!E�yDX��.s���-�KΙ��p�@eT���{��Qd|S}�wq���<��Y���9�D����~g�0g2@�/.�K�/�l�! <ā��� �Je'O��i��d��βF%�����:� y����¯!��"e�F9��M�z��o��?�r��臸t�-�,eEH7k��j���J�%@�� !E�<8q�*PK����56��)4�6���qV�j�E7t>1��薴u���v��q7�������E��ֵ�N���kȪY��v�j�[AQ�ZCE�v�K�yd�Ъ��F�PS�K��d�B8�B��ǖ h��y����*z]���bX 9���H�B�tp�����+��|I���8?4���Q�닕Z�5v�ҏ���y���"�Pv0qpٍ�E��E:���� 8w�9��EĆUu��G]TF�!��������IEND�B`�PK���\-]+kk/templates/beez3/images/personal/arrow2_grey.jpgnu�[������JFIFdd��C��C�� �� �� ������?��e�_���h&o�w��v��2�ɔ���28��a��d�$�ޤ�]�_�d)��V!����m�VX��PK���\dW���/templates/beez3/images/personal/arrow2_grey.pngnu�[����PNG IHDR �GIDAT�c ��@��l���?O#F������K� ��gR>7-��C�"�B\�+�' ��A����.�IEND�B`�PK���\z1sIFF2templates/beez3/images/personal/readmore_arrow.pngnu�[����PNG IHDRexxPLTE�����脃���������������������ʇ�������������������������������������������ɏ����ё����������������������������������f���IDATx^m�G� a���Y����U���PS3,��έb����l7]O't�8�N��Ek�2'��b�^A��%W�p߾�<)r&Ean%+�w$nq1��'��A|�<�����x�9x���O}�����5Ͽ I4�H�IEND�B`�PK���\��TXX/templates/beez3/images/personal/navi_active.pngnu�[����PNG IHDR�&��F/PLTE^^^i�2IIDATc�`K���bIEND�B`�PK���\�ޯ��L�L-templates/beez3/images/personal/personal2.pngnu�[����PNG IHDR$ [�R�PLTE4H&U�V�P����L}��k����)d�X�L�c�OZumv����e�;u�R�2l�h�M�,i�J�AqP� ^�?nN� F:Fd��Eu��O�Z�Q����]��� Z�����T�CtHzU�I|C{���\�b�3_Q� V�/ZM�W�������Gxj���G�AY'N�/X��+U9o�*T8f &O6q�N�K~$LO�$R��� "I��� Z�*p�'P��+`�<k#K2^2\N�'LIQ�R�J|K~%N6d�:k�)Me�+6bV�L~>s�.UK�����P�%M *Q %H��o�f��� [�@c-X��,R1g�4`6d&G!H5a2[|&>M�Ev1\��:h I���T� #E!H.Y|J}L� 'Kg�h�g�;i���e�$\�p�Hxa�H~"l�"r�b�V�Q�T�Z�<j$i�]�%a�?x�?n`�+r�!f�T�$p�R�m�Y�i���P�Q�1t�Aq)L���D}���Cq>p]�N����*8XJ�H��贸�^�5b��?v� %L�� +O����P���@dS4^ &M &NM� (R< 5�� @A 3@k� _{*).��Wq������8 -CX>C~�p��� 1��x�*;!%7.Le ��Dt�h���< B��E��~��Q�IMIDATx^�܇�+7Fa���e���r��lCr��W�%��oL�V�.] e-����Y�#`���y�RhOb�D���Kb�|%�32Ύ�n���o����I�#`�2NU٥pQ�J� �J��LrK��f �J�.����� ��C�J���u���:t� �i�v�C$*� )��hm�`��jNR���ź�#��+a��X�w$��j]�C}�Q��#0���~H�=�r�G���s�!>sP��u��%nI*1�W%� �Q�a�'�C���."0�2 "1|ף�k�����ԥ��m=Z��H�%�>s���<����}HrK�Oɧ�jM�{�%����m�qkJjM�z�J�¦���H�uaR��+�w$�E�t;���u����O�Co(n^��>���ԗ��U�u;���Cm�_߾*�y$8�����3ݽ�e NF?�Ms��1�I�� �.z�Zs���|���!���4���KpyG����<&�_�(�� ����MKp�����_��s��#P �.�sߵ����ԟs�{T�y$�e��<4 "1�Ozq�G���ͣ���s ���� �4��i�gb�����1}<BX�T�&�-q��,!�H���.�#��EyY�"P�[�H��:�v �J\�)7/!� �J�~R�#����%��#P�j ���(;�@%�j>'hģoO�2���OU����V��ػ��đõ��� ��y�:�� �}���b�9@���h�70(�x��\ E�P�h�Q+��.}�*R���T���q��<[�5X�Sy��-|Z$ �d%�'-� cY�FG�G�<k��fEq�#�Jȹ�LK%֪Dg��v�ê�m"�J��^����q�H�EQ>���QU7;PɳD��yU��*1.��IG$b��J��s@%?�g�P5����H@U��g-� �͎���d��Y��G�(��,�`���{ "���:tn/\��,a@$P �t4���\VH�G�0I�QT5; �E:L��y�#��K���J�"�"#"�QՓ��B����i�P���/jT��H@U���s{�GUDg�zE�s{k5�0!�^.��9t��FD�*�A�K�@������G�YB��L��8� ��Y�T�H �_�TB��Q�k� �o�\���aY�y�K~�H�z�H�ÄL�<2 8Klf�`I�<oz$��b��8k9�lx$ ��YbIu���Dg �갓�h~$p�( ���Y "���E�B5�dsY "�J���Qա&Ds�yF�(�\H�,�&�A(� �D�/��:,��҄H`.���FU� ���;�����Y�L::�����\�oG �ȹ��@%��h��܄H�s�C�Y�Yȹ���MU h9�s3"���\��K� L/W�9�4#��ʽ�W��U������{��[v�+Y #"����u�?Z�{��n�2!8K������d��ʈH`.�J��%�sN6��0!�K��ܳ�u�����G�&D7U9�]��{�z�vW�K��"#"���ػ���.�.�� �B��Ԟ*��H@4-�t�ޑ}n��u�z�[�����u٩5�4!�Klٛ�f��9\'l> ^�b�眷��No�2!�^.�z�V���S��L-�X�쌻�����Y��U�]�sK�K�]�D>l������.\��P7 T�U�kz�|�K���];e�k������v�%w�}E�F����]!,��^�qn�zW^i�9Y����cl��eEU��*!GU�g��a��|yX��2�>��Գ��N��Ҷ�e������G�8T"�\vI>l�.��&Jl~� �P�l�#K��{.;���_V�<6Ī��&{;������v�o���o�m���5 |��"�G�o;�-�y?�h^$ >�T��A����nq�!H�^XXdw�J|P{A�?�m�]X��J����6�Dq�b�N�OA��t[�����)�C�6gT�:�b� �,#�H`�¡:�8��7E��o���ȗ˒��K��z��kƲT�y�4䟝��[���r����eB��hT�:oI��͢E?b�a��c:��{�fs�p�`C!�L/�S�&�*M(*��łdn��uX���Л�`�T���VJ����w/�3� V�!$ʺ��2��a+n0�@���/���~fzW������n�Bh�j��?�k}dnc��&$l0*��S���3���/ ۴p)��!���o.��!��Y|+�*5�`&�'!��J�M+?��qoNR�c�����x�C!4>�S���2�^�H �s ��ǖl>1�{�μK�5�dG7_W)AwB���v�YGd}��EF A���W�B�$��9�h��$�܍�����@S��%&W���DPN�A�X�g�]yT�g����ئ߈K�� �0%F�*��}�d�V%.)�'�:"2��R<߲��� /� $�Zb^1��½7 -m !Q��닎K�jj)Hd�1���gMJ��!�8>]̧b���L./Ké��Ҝ��uHdD��`�2�c����㏝ ���y��Y�E�U��A��w���OR�Ɩ*ʙ�/���+%v;$B�\��O��Ĕ7��l�o��Y��q�?�brv�!��ĵ�[tp��M3�tApd�X��S� �ű�}ќ��b]�9�i���x��6��%Hk��E4���$|ߛ���*���b���!�j��D�.�G%!Q��� klf���OBM�� o�v?$B?��O�����M/ �D����I���)@F��p�绽 ���]Lfa����E��䚅��$-����S���C<��.�N�}R~Դ��<�I�f)�ơ���؇�@������L�^� -5�Y@t�* ��/�@0��6$xݒ簅�@�Cy�}p2�m)4�!�ע*����r�Bu-1���S �rݔ*B6/^�-|[���W�TZ�����!tzZ�S ��d`��hܪ_&�µ�PHy(�JAܨ$Q��aJ<�^�ƽ��`Inٺp�z&A��'��yn��.�3$B�.%t�aq½�k�8n��y��0��Nh��� ��s�L�� �0%&Wq���k�-�X��R� �d� ���z���7ͭ6��@�?u)ѭު��:��B&!QU������h�Rwk�C!L��4nӥ��euN�Y�j�����$*f�ss��!�z�:��j�"��>�&M���B�WEFGVQ?���uH �����8Ω�*]��ݏ[Nr In�xA���V�A�e�Y#7��O���'��+=ݵ{��`�0�6� 嘜���vCp�4�l3� ֍�āC�ƧlTb�&����6��%� �ְ����[t�#��7�]%���^��J�?\MCϭ�mގ6�h�UӞF!��%V~G�T��2���>��'$7��:��L֛�+#�.a%�5�o�+�U�7k���?{�8g6�����ȑ�c�ԩ��ֲב@+�ʍ���y^q -g�2t��)��>O��]� �ڽD{T%C��L��u�2�W��@DJ>"o�!tp�����@)�b�t�w��\�=62�9�:�Bh[N� �P;K4ͧR�bYȔ\�s�TJb���e^1��˾Oa%�5�2��j ZX ��3��NB3��`�˾G!tp�V��Ln�Up����r�bЉT)C�u!��^�O����ĐJO`aׅ�� +!�8�����BX ���I���Œ�*a�3rg�Ԋ��4�z �P��ў^�&0��i� O,�Nl��*�ij�@"������%�y"���p�YM�/#�B��lg��G8Vt�w�����g�BX����nM`Z�JՕ����5���#�V��_�Q� e&g��Bk�)�jؑ@�8���m��U1��3�B�K��/E��C������f�Lõ4�@L�*��h$B�竛��@JbH��=����:p��O�#��<q�|6Mxl���h���`#�V��Yr�Ȥ*��Jh�<�~Б@+��?)���P�\X���t��@�9jg����(aLN�/�_�5i���g�j$B�v��n磀I�_¡��Q!���B��;�����T�B/�_��~�[.@kp�h$B��J�?�ѓ��N�Q���g6�H��F!�D��T���|d�*�bR�$gC�Bh���\ݤY���� ꪂALR��J$½�O'�"�֭#�] &���lȑ@g��^bU�e����2S\�� 9�n�X��fO�k1���zj'�F�T9�H ��}{�,'�,0� ��֓S�urEj>�H ��]�4Um���g��� y��+�l'�?�ܱj�P��;e��Ξ�P���m_�c3k -X��"����E�^����R�`����@�QHQPB,��=��9��"ohf �Y���W�<��_���4��C����Z�f�蕚����Q�}Z:#P [��z�\wU��E1W��>G`��;9d��O���w���o[���K��g1�i'Ϩ�^`�q`�R^�6g�ՙx �J�v�?��VK=�M+�#��x��ˉ�'\uz���R�c�w����]���g�G$*���#-��=}"��hZ�UZkݮD�����9�H0�[�!�� ������T�'�2H���L�˽;;N}���f��!]*�fG$��D���a��J�"d&�S="� �A����k��8��P�D�J,�tu��/~0��"��H\�8�N�D���]G$��w6�m�{~�\aـ�I�2T\ 7T�X� VAwSa��8��z�n�FwSD)������F�!��� ��xd�cy���Ȍ�`26d`J`��l��K�������9o�Ǔ;��?���~</�'��9G��s�SN������������$q�)Y��#�S��%�zy���V��b��Zh����߷���S���8���k'I��g�)=&�- @�����8)��-�<�����������$��ωS[�F ��;9�c�0�'��Љƈ�g���Ϟ�H1&93ǯ«�|�S� �����O���$�S>�F�ey�=i����I�Y �#��Y3DzL$�ˍ\�����z�O�&�pb�����RlS��`5�=��1�7��'(ڝ�(�9�Ш�r��M#��['m d���O\�9����''�<`#ˡ���Ou�d,$[\�8���{�8vѪ�8�S�l ��7{=%=�2��f6��F�Ɛ3��u<���S^I�h Z��_��7j�8� ")t&ۑT*;9��Jy���H٘8�:�S�����|{�ј�9�m�ԉ��!\�P���;-���yqv,�J,�,�7U�qK���/@L �)z��Y�+�̢e��)Y](��^�e��-�ڿ��l���@�!M�KC���!W$�rd`�ă^vb�P]da���TFw;E�)n\����x�R�����!6� ���ۿ��8%q*���]�To&Aov���ֺ {Fّ��qډAI��lj�(�B���\��� hvU�zG�y�E0����<!��)c,����55��_IoHeܸ���|����uZ���l|��w����%��O�S� �B�����)s�/��fapPᵰ�K��x(!t��y���U�x hJ�c^�*�yEGs Q�rX���!^tQŊ���X�ё�ͭo���p��f�M{�Z����OX�<f��ࠆvJ Ѕ��.�,�=A���pu�|GH�?`��nH�T��9p"�N�rnA�^�Bo���E�!�� 7�{�����/>G3�a'��V�[8pn��ݺu�O�I *F�pd>Te� e�����$N���W�&Qv!(����θ�%��.D�@uJ�b����l߃�f36�ŪU��h�������@����x<X��W�^*�����W=�����E�(��^uE�b��<5�����p� � w�e���s�:�s��2��ݡ����(P_���$�ʁ7N5!a��͏��'"�S�~�i�^���b�c�X����������h�8�E�`�*��� 0"��p�:����lHj��d~�+�(F%��"ʅ@�dB�il��\�v�J�y��� �V®R*�E�ʢ�ֱ J�E/k(u�s^r� ��#��r��2�e��&Yp�:_a�3�5Q_�z���/��7$�t۹o(b�,?PNhO�e X���}�% v���S�W���� 3��3ءak�5��1��!��s (���O��B�P.�$�gr��=Ԃf��z�ބt�χ-��p Vp�r�Lfz2�g2�麫�,�ܵh��l&�ΆVWC�V=%͉��uڕJ����ʺTFg�ь���F̮h������7�{�r��0�x���b���4�@!c� L�aKT*c}�a�����O?�-I\���}��1�h�����+��2�p� ce�` EnX%�X $�����xN0mQO� F�pD��<�.Avh6�Aj� t{L}qެ�kQ'��8҄0����*̠���Ye�"�M�=�\��9ME���]]-�pRƶn�h��`�6R2E�* cudc{q���yٞ�y%c��.�+x�b��������i}�+D�+��b�� ,}�%�7-ԩJvK`���$�����>2����8��� e�<63V#�Pk����>�B#`ޘ$* P�U�ނ����Y N`�>������<1-��!-@y���{볳�zL� E-\V�A�r�Z<j�m��.� �iyl�L&�)���ֲ̎ ==���f)U��hA�RR����I/�v��]��N��t��R������K��� ��4y ^S�(7�;���1g��b���V�&+�*�pbD�a��1K|�����c>� g��24�1��-9H9�)����P['5P٨4ġb�C�_�+��h�*1��MӾ?��e�Z�W�YO�9�$��$��Q+PHSh ��O&�k5�dኹr�ŏ�WN��hE �<����tV���,�%J��$ �(���l95 y6�+� �1��nm��M���:�QZ/�s%��ݦ˔���g{��1D�k��*I �1�R!b�fܟ��(2� �`����W��!OP�A�_��ΰ,u~(f!�~CB�YJB���p�g�r��x��)lѡW|xВPe�`�γhV*NDY��#�g��c�'��>�t&a����ѥ,���dԧi &�J�ht4X�QO�0-��\�h��J�b�; ����{���X-���A�R���t*�/�Ä�����Xfk6�>fhG��x�F �F6�͍�ul�f3�l?��gC�6p�rhC�^aA�Q"]��x��[]C��2��v�R'w�L9�X��B���B�~]��K�'�$�-�u�3���Ԇ�g?�x;XsCf@��"�Nh#�E쩅WCH��e-�#͑x��"b���|�)�����"Z@<Z�m`p�j����C�F���5W����L��@��M�p���t�O�����V����LV( )�T � �')��e�~��J�q}`���Ȱ"�>&����Jb}�1!*4f ��vbhB ��ClA|��L���y�:� xAJ�)a|�����4-b���BݏeG�lg⫖02���Ϝ%�`���{m5эk�}�Y���e�B����뼺�n�o��zx����K5O�PA���)E\��F��GQ_����L�k!��@ZHR��� B��c�Y�Ղ�+:UX.P����5�\��2R ����eK��V�ZlQVÀo�W��������t'�T���Y@� �R!;��A b&Bf@���K��^��E x]��Ph��s�n )Ρ|���H�|N(C�k�O�|aSNB��舚#I6�7�Qs>@cu��'�~��oH����Ϟi{{G��9r��w�ymO���g <�UI�����6�Q̩�n/E͗�y��h��G)�@����d�A�x�5�<IV�={�%�Ф��p�B�z>�8ق�A��k��~�����M�s01(=]����Ox7K.W��\��*��o7�!_n4�Y�X�l�R�,�=�V��L�!b�@��)�r'00����@[�(��K��Ա�Z1�0��I���rk{cED4l �o�f������7���>����s�so��ז'O�>�{�ҥÑ��_�����ûT���ݽww�DZ�8��*KKV�}��;v����Oo�v H�+�o��Y� �G�Bw^�>��Xi� ���E�OOZ܀�2��@[��Y"��h��%ڲ��;P��s7(C��GBF�؋D("�B���M M&��/L)�:�L"[p-hI6�e�bȍ��+�<��_sŪf�U,E���-��1M~�zm�,��M3D���z����4�$���U,Q�K��gC�u� a,�l[�k�p-�kkP8�Dw+���a�i�e�ͱ��ED �/���&ԁ±;2��b�� �����9S �_<��^������'O�=8^�:x��ȅ�Ϯ�]����zn��Ї3&�Tc8�s�ġྍC,������<��Q��f�d�#r�ݙ�v�E��Hd%|F�_�W��<}(�Z ,x�M��,[�k� Q���Ɯ�?�H��0�b�ո�\V=��,H���x� q1����gɚ҂-[����7�w�$�i�b�5� \�̐ϣ#��'®�j�� OOG�M`57�ț�����D�, ���^llI���Ft}f��t�����U�)� ���1���&Dh@���Z��Ro������Tل=H �� ���7g�0��´*A�=�K���ޙ�֖�7���1��%1����5[����@|���nOϽ�<�K\"F^3����y�'��pm���!f�L~�ۏ��8��2;�٧G��{fd��<È"�3��(3;q����4X�b�PB�t5�30��K#`�F~�eb5!�]�����I���D�//_��0���y!�Gh$���C ����DS)��Fj4�P�<.�A&30|���A��2N:�X�XmLO Y�d���UR���λ��?r!ܘ���:Bz�ޝ��:H�2IƿUH�Wi�s�]j�=&���F���P�;|���0!��`~�i�$�y܄<6䵌[��Hფ��Q��jw��Z�=2��`��`�6uȄ��,���������`���#�G^_O�,�(�DS�F�8�d���{���"W5���������s�'�Cv�����(v���{�J�RJ0+����Ŕ���emF�d���K���i��H]'�0�$��>�H���eE�r�'��<����>g���`C,�B�u&4�a|�A�-�@6w8��yA�K��X��� ����"9�"��5�T.�/��>-�O�B\ p5�њ%,L�)1�������Ų��}��N�;_((br�ip7��% vC��f���&��B�~-��u�6S|��gs�@���)�Nb^P��G@���T��=[��@�y?��YG[��5���&�pȄq�d���ۿ�$��Od�������s=@ ��Vv�ٲCt�E�ϡ�Eȁ�����,�4Cs���7)\�p�#Q�g��i�ƙ�i��$�n�d7�"���� �d.=�qNV`�,l�0�DG��c��'О��0�B�����.b�j��C�����V$� >�(�=v �F`�!w�2�0�����@ѡ��?[Hpe� �2._����J ��H#�Kjh=�j@[��TrM#4�a±тߒ�f%�E��D�B�u�w��İ�e�.��腀�$xh+�����T�p�-a��p� X,a� ��]���%�O{�3�w���q�wK|��*�þ��� �;O�P�a*�?u/)9�0z����4"O==�N�IBg{�iF�a�� |����ljeH3�Sc��<�B���~��.��g@�M��I�E��b5wMLD � ��LL4Q���F#���r�8���?�a�V3� [~�V�p�,�<����t�f�����Ŭ��+�� �K��}T�ְ��i�ta�bqн���o`ZR�e��c|>��Cf��C�]��ǜ�`뎾�#� cW�ek��O�fS���k�1ز����� X��Ӷ�$��|O�oc��D'U;:���h�D��v��4au ;P!:@�<�#����dr� �"N�pd-8ƋX��@�`�%�f (qL1F�����.߈�8/4!�N����(�p��r �]�I$�x�-fz��Ry���9]����9W�Zd��7[����w�B��j������du�������c��*OG��f�mz��NKۘ���eӑt6�β$�ip�m`�����sO'3�`i�t-�ռ��#�(�a�=��E~�@ �3�/.���"_<9̞���ޚ3���r�сO-ؚ��)�&��e�,�A�{_ؼ�e�C�a�1,D\���\=�����Ё"hNs�Υ�s�M6.;� ɤN�,*�A�^�c� *T��(��8�8NH?�ruT��H�W.��_"����4�9�*6b�`nBe�>����*� ��W<kp�� 8�� ��@�����Å����J�|ABc\Ǡ rCK�%��A�:� ����`��$��i�c��֞ΙA�[�FfX��(0�Wr�B�'��g�^�O�O�m2� ' �,�r�A����d½�찃R7���,Ӳ��eK�H�&�X�3�|Ď���d�"�sb�6\��vP�B�t�s!�mK�`oK�!��.�`~�TY� 7�H`0�7��r�x<�/���zт�F.�I�-���X&��vء�|��8;]�%�D��f��?!��7x*�P^���Q)�p} }-�>�!KK%.V�3UN�Co� _G9tԈ\��e��f�X���嗗_���i���T6�L��O���+.^;����X��:9�{���v���>]�$����189(��]�h]A�q7��<��)�y�� �k��9��%�q���hgb��$|[����1�N%q��k$��Mɜ�BM�rC5D��N��'�G.���yr����C�z`K����*�@`f��&���/t�������TX�X��C�C��n��r�Jey :�ː�[V���M���]i>�-iģ�9֝:B &��k�죮, �<�-@<@{�Do��U�Ù�3��n/��7{_��'���DUt�,�}@��܀}9�&(���ʲw6�h� 5��ƛ�!�8�qb2A�Ũ�.f�: Ft6I\�$/�$�:{�����# �ޛ�b�:dpb`M2P�����h:�t�j=��/)��� 6V��X��ف��j�2�N��3ak��@�bʰÂ�J��.�D�`�i�'�&n{?� �[O� ��)���F�������釄d�P!��HS ��$�4[Ӽ�>.�v� :$�Kx);Xp�Y66��`Ž�V���_:C9¼�P�g|�Au�4��"�H��qS��凷Jl���go�B��X��˵�.|"]@V�p@ �0�4&)AW-�D_i��P��a�BŒ�r@ 6�����<F(��p�AR@C�C�u��$���V�� ��Qа/D,v�ۡ�F�`���v;d���$�t�::˦�2���.��Z� zڥ�v0����i��$Qz ��F�P,H!P�I����:��2�0\�W,wG9��ڱ�@s�����sl���AU�&�b9Rz����j�v!�2B�\I���6�7�c�xcB�}|���f�Y�����z�������t�x-]=���E<rK��+JFX"�kz& 5<�Co�Jq�19HحV� �t��*h4�����H�Ktֈ��98J$ ;dY�%�����n67`:�� ii� %+�謩�������f���IH���4���AO\j�A�gx��@;Z�ܟ��Ib�$P\�������� �pI`}R�_��Cq �$.+�~��1d� �#�b�L�6]���g�f,>{8��^�ӷQã�S�X���{�r���s��b��; �0ौ�F��z83���=.�RZ�b#7xr��z��A�Q�n��8`ŲI�a����D�F��V0�D�+;8[� g$ٲRv#�� ����-`�!�Š�䅔�|��#��'��PFS�qW@.�i �!�w�C��a ,9P���}���)��B�-���OU�����Y _ak�᪨�U��s���"�E}S ���&c1� X}?:�F��Sq��$�`;�vA�@��aO�G�n���x�Er�y0��c�d�r��"-U�"x4��'n�� �#_�R��i�Bz&�O��h���,�.�p�34��%뒑}� �6Md'Pi=��O�ҙlJ���"6F/ ����p ��-` "`�0� �*k�)"���g�C�'� �B0�Il��~l4ً l\�릍�1L=�c�x$:��rFh!���ϼ��o`�<�x�&D� e��s?d��u�x� ��.j�G�YI�:�E�t�d{=)�E�a����T08DO��&���Xu�遙�ʞ���rIF�Y���v��b��C��ņP!���HPt�C�F��.��.�l_B?$��x���?�Szp@k�<L�L�Ю����=�� �lv��ۡ`�&R'K/{p@j��k�3 %�B@���L�m�l�E���=�'�#�p/�½����ŀ2�Jx��@%�K/͵,N��jHn5�訆��`��I���1AS�H2]�<?P�Peg�BD�Y��S�f� jL%� g�FՋ�E�$!蘤DB�f�>�J���B&�����2C.���8�{.�-\�ؒ�����6���$��d'D!$,vP��i�1]НC �$˖ ��^����-b�s��`\dt�O3�� �1"\�(�p��@��T1���)�h�sE�]J�Zk���;iv@�0�D%Z���lQƛ瞮P�����mJ�-����F�Sv/����/� ��|o�#B#�3�Nc���Q�xa�g�&�e�E��C��D�a���x0�����M��2��_�R $�"�<!Bb��?pA#ު�e�;�;�<�k�tD3T\�ds��M�DY]O+�(=�Ǵy�w l�Ss��L �j��>�+�W:���8�{IH�2)�ȶ�gn_C@*S�u�!��>� �1��̌ݤ�Q.<"J�x?�%3�(G6Ց=Bls��I�&V�Y�x�.P,�M5*>�]Dtx�x��KZ G����3�%�@lj*>�tcm`��b��.��fp�i�T�_av�"e4 c���/��\��i ��ۉ_��E�X�����y�A01A�B�-=�tf"u_|=�N٬���z9w*�pV �8j�t�������U'ClI%[��3>߫���'��PŐ��m$�d����YGS'F6y��@�f_�&3F ����r�S��þ��HR����1D��% �:�p9,�l��)FM��ā@�@��K�yCq5�dR��$Y�狐L�z��`�갲S�V]X�����`K����J�ϑ@"A��~�m����B֔1�.zHM:G�ȟt��X�9:(;8+D��f��� P�_b���Tq�� �B�g����y����*�v� ��X��CmSC�C�}ChT`hCf�[��/�ɢ==_�=@<G��Nz8�av <\�'����bSԦ��g�A�0�`@ԕ�ӔX�H��5�h=|���0�4"�\.��ֆ<[�|&8���� ��ٌ�p��u�ȇn��4d����㟕'Ѵ��N�>��AٴC'��/�mZy��c�C�d�3��IC�2]�M$4#��bfIe R�2�]h���ԉ#�o��裍 ��hc�k���4�a������~�������� �.�P����H�u����͙�:cu�(�t�!$@�5�sB8@���7�e�{4�#�.e�0J�F�`��@5��"�@R����l#8�� B������9��HI&���GT�lVO���!>8�$ f=��y�4�5��SN �'��!x�1�ϛ퐚�fT''I(zo.��.T�\�Q �ĕaUv6�eC�0�`l"P�Bm[����B��B�ހkN��ܼ{�|���^�9��-s<?��կYI�xDљ@��\�%^�0���0���������_:��VS�0�i�����h�ĺJ��(�� #LM��u8�Q?Fzj8�&$*:t ���I@��߮_B�>��g�����D�?�,� =��~j��z�;vA�.J�.i%���3#U�f ���e��6cu��އ�\LLG1ܢ j��{Bj�[Z���� "'�w�9�q�mWM1�1,���v(�2ێ��������p <�b����� #��P�+��f<���5tr�.rÄ�%��r���(���*�?\ف �6��K��,B�)��L#��]���I!"=��o�5�TY�ʨ)�1$x������p�� x�6�4Ő�*u�ụ��`�.Q��0Y_��lB��*rN���ݸ�9j��� j�*�t5�S\V�aNJ�F'FU�!]�m��t�Jh�bt �%LRA��� tv4R��!t�ڂoF"x� %��0�`rH1~Ad�jf�0�2����H��g"m��Σ6�v^}�]�e��>N]��T���T7=��CV�zx'I(陛B��$�T��WWTOl�D�9C�F�밓�-�Z�R{�w��,��ܰ#1]< �"��s@v��k�P#�.������`���Q4S�!���qZR��1N$�9��� �����yx�A �:�$xԐ�!�l&i��|�I쀛���5"ºJ��:2F'��)���9غH����`��Х��ޒ3��@�����Qڲ�2ƍ�[��q�ܠ M0�ŀ%��o�yב�g�X;�*��J��� ˇ`�m��r+� nq�\^�����kܾ����fHJ�li;�7 ��R��ȍ>̐ �˱�'z!O��w�-�$��0�ᄵA�d�N��T���NWs=Þ��ܹ��y#T2�z� z�)��OA�g��x\ ���4/�ِϱ�c������r���>��8��9�E<��l����?�>��e<b�� & �������۷�Y����+�Y{������U���%�t�ӈ!�@_<S�S�p��� ��BLZL`���j�Ѡ��=�G������c��|��ސ5|��� �3 oD� ����F�_���% �>�_�|9��n���y�P�١��&�^�ڱ��z;���Y��0$��k�Y ����pn��D ;�p�D���țbN�؈j�@t��Xج��:��"j���ͤ�:�Ѧ�<|c���D^��9~��S`�]��=/�曃�����/�9%lcp�]���n��8�26C�`Z�T=�K��_��b��(��'r �'�K~�J0��C�}@ ,+�����`�F�p�` ��yXl.�/���%q�\b؞�p�嘊���kG?�Q�)=b�q�3Q.���A�l:�b�D���6�A隌 � @9�(ͅ�a�� ��:�O�h�D@��32Jb&��p[\���3#�I���@��@�������2���2N���l͈,��Je�EO��r�1�����pS���Z�ӌ!u.�G#t�z?(Ib��=d��E���Ў��͓X��z�{x �A�=����]c��ǯv�E��Rc�LL[ӷ�\�)v���$ĠO~M6�Z�htM1F?�>bl�t�:�$f��?�؞��۞���0t�a�Py�]De,��i�o�R�� l'lo2f�ɦ��l�y��Z���L!��Ak|��Gۣ�����ˈ�j �:�rƅ$1cyZ !���:?v�u#u�_�4�ÿ��<��N)��~�qK��t=m[)�ߤ��w�!N��� TCկu#F=�~���x�$����#j�j�כ�Xǘ!��3�q�����d�pG�1]Y���8��F�����@$�A��q�$�l�/`��4Zn3D�b�):Z�z���\�!��u<�A�ߌ3��Y���$f�������#h3����4]=�i������;%�q��"(U��̀5x�j(&a�D^���S؞�����P�Z��RQZ�~� Q����Lm�z:�!�=��I���H��a{g釟��[��8��pKg�+�8�F�5P4�-�G���pM����� �Aވc������P��ۇ��,�T����{iA������t�sRR�4��- 8�L���s������2����,�����X/P��Ǎ6�H��T��vic'K�N��;�=�@!�����㫔�"L ���t\���Hb����$h �i�0��kz¿�x.�ލ�%�`��z��R�$k���O�yB}G�(%e5"��6��_{${�D�aCI)x�%+_G���a�L���羿��M(�'66�*`�A9�r t�W��l��*EG�R�e,��H�,&��R5d<Wm,YN�jDRQ��cH��X�Ù�� ��bTY*�����{��)�����@�D�2}0����S�Z"Rg�D:�m�T8���Q�S�DNUf�Z]���qŊ!���I������)�����i��9|��uC���(��rI"�-S����"+�� �A�b"��#�);L�A���H��@J��n�Xb��W,��a �.���D��<��d P��_��K�/OP��Rڞ����(nAL���G:͘ǐ��+C���r�,H?p�V_�V"�{隌�"��`���.Vq��.���1��(.�t��[tn%h)x/����H�M��f�r�x��%�1ڛć�y˪ �E�QI�\N+�K���ŏ�&��2B�E�������X��J�HR"7L9U�`�Xz�@���LY��vP��AxU�VQ�2�ł����1O��$��b�H� �ϋi��$�RM)$������� �^�"�*)�^*�o�2M���NR؞L��>ұU�����Kb�E��,�ICW-��j�x)-�"E^ �8�.N�KV2V �îS�T*铪�ʤ$����f:�̒���$V�#ʲ?W2;��0�N��/MB���#�J��c'��TZ/-y@�� �萕��d�c+�>��g��$f[�. �b��d�GN���}؟��("�rw3��,�RTh�`2^(]����H�r �|��XR��̐��b_>�b��=�YYX�gF������)�� ���.�:����" ��&��o;�T��0%�y7�`�U��j����R�^ /Q3J��0 �P`����A�v&�g�z���C��J3��=�-��j�m]��Spܺ/�H�,L� n��敱P/���S'~<�=�%������t��p�/kK�IV nma��\Bk��}�܆,+�LHU�=G5f�䃢HJ�v���/�U٪�ɫ�Č{lV�3����U$#�<�#��zp��@� �Fs6ƺтns�1��J���j}"ԫf!^13��\�cxqM^=�x�@n��(�8�˟~J~n�E D�a�6^��K�`�hޏǟ0��oH3�0N�?���0��ɞ�����K�?��,A�o@z[��v�.�y?�v��d&��b���Ef��QB HYD�)~���~�O��w��Ѳ(����2����:*ǿ#�M�������(��fys{E�|T��Z��dfffF��ǏW3333?.���xefff揫��ջw�2333�Hv333s'�C�ÞN{1yIEND�B`�PK���\�V��8templates/beez3/images/personal/readmore_arrow_hover.pngnu�[����PNG IHDRexQPLTE�����ꎎ�YYYkkk������www�������������������yxx����������������A@@\]]DDDH�kIDATx^e�W�0P�=�v��.d�"��Q��ݜ�R�ai����,�ϲ����y��9E�x!&3uX��z's�n� ��N������������c�zr�B�`IEND�B`�PK���\��� ? ? 'templates/beez3/images/personal/bg2.pngnu�[����PNG IHDRXUR6�PLTE���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ü@� IIDATx��ks[� Ea[�l�"�6%Տ6m�ҽ��G�ú�"�C}�t�:#�s�� �R<���@��o�gn+���P�)�=���u����;�f����K_��&�h 9K�Nk<�Yͤ�A�������Zo��{�N9����&�A]�:B�ʄ$w�*�'G{����L�զ�W��NCܧ��*J� !Jդ�^�A�"�Qr��kb)�Ő`��`Ao�0���^�PhXJ���b�$�k��O�*� �+��(�/� �me����'�g�� ��Ж t�W%����p��$2; ���.EV�1�h��E��`����=��fXt�8*)k�?)��7�&�W� �¤!�̉�LJ�N�L�R�좔�nO9� h9�ajڂXnH1wl�����kke=���_��]η��������_I`�4���[ �=3,!��5�s; P���8o�\Y�eI�UA�A3J��e����R>�����w��� ���)x��ʥ���@�X�=���T/G��)���m\b����c�Ծ��+A]���Q(� �JW�v���j ɯ����ʧ��W<~*q�G�DK1��!3�QbY�$I�(J״�>�`�m�� �]���/��7�����[J8OB),4zc�!��^er�V�2h��>9"C(����Ud��ZBRa��)j�#���O�Ⱥ�ڢI�� ����<P A)�J;0�J0<J<���\B�y�N��5�k3P;=Wv����~9w���I��]mw[�a��__��\��Ɉu��E�Jg^d�n����EBB�.��<J8��)��A��"E��I�W֥��AǑ� �"���q�@�"�t氞 �c``fI��%,چ������� A��/�A���c%E�i� k�����9��w�9RԑNA��n��ؑŎ�z����|�ܣ��2�Ѹ��f�L�}�ڪ�-��L�@���D��Ŕ ��HJ{�!j.��ZA�����^� �a������e�1sK��1- 7K��g�gg�(�Kѳ�����L�q,�-q���r>�X��8�N���k;ӥ�T���)f�4H�e�H�쇀ӄ �b�z�Ć���Y��B��J�H�zN�����x9=�"���jyl�����'��9ZꞜLcyx�T�R�x5=�U�_pz��?^�Mc�GSO�+V���tu�Z�ˇ��⚴:<Y�b�A����7�z,�a�m)���~���K�ґN[�����$�R� ���p���u�$�B��HO|L��8�vb�x��#�>�� �N�X��Ǐju*�.aiI� �YJ1>�J�^^uڡ��P"�0:��B;)�Q��U "b)1�me��ի-jLx.O#ל�j7�E"OYͅn�.no�Zda Z�*\����^�Jk|+}\\)!�\o7^s��T"p�!�c%�Ȩ�ѡ1�2�N��6ڟ�����r��̶����C����Zy� 1�Ad$�/M(���=�E��Xe�ၫZ$�v<�TN��枘.�]9�ʖ�Y�fp�t����`q� �7J�i�@�.����vKĊ��ch�AQ@`%��a�ʫ�(l��҇�~�;esw�[7�&�w?������V�S�|_3�)�PM�5��ra͔Y#�><a_C%Cxذ;��?Ŝ��A�a�� R�0��(vw���t�iS�Y�A�"M�R�0�j �qӀm��H��6l{�k8���6��x@#xJ�M$*��8Up1���ag"�EO'���Jm�_H�����0�-f�ә���|.'㰘�29 e�'����l6��I����0^���LL|1c'mg���b2Z|Zr�P<�t���� m����gId�v�r��H��T�d�ʍ�,��/%ie�ܰ�� ,��Q_$jm�K�-Vv��c��@I�JX� (�9�f��@<�9F�3ӂzq�ob܌7������77�SCd�T�W� �dTx ɼ-��wJD;0�(2��YB��Vbپ��D����6,Z��h����3P��E���!���DBO����&H��^�n�L̩ �e)�Ϭ.NJ�^zhGA��Hؓ�P,c��3e�'^ � �r��'H��s��J]j�:�OA ��L �,���$}e�1sD=����<�7��Z �@�6jv�Z�ke�D�^�'p��fv_ ���Mk��IYAٝ�����f]�^�L/���W��"(���u\��7Eސ7,!W��<V���P֚�����N��J��Dz��IVj`�(�7�Rg�?�^Т~�IEND�B`�PK���\o$�99(templates/beez3/images/personal/ecke.gifnu�[���GIF89a�&� ���������������������������������������������������������������������������������������������!� ,�&����A,�Ȥr�l:��(�@�Z�جv��z��B.���z�n����C���~����~������������������������������������������������������������������������������������������������������������������ H����*\Ȱ�Ç#J�H1!��3j�ȱ�Ǐ C�I2���(S�\ɲ�˗0cʜI3f��8s��ɳ���@� J4���H�*]ʴ�ӧP�J�J5ꆫX�j�ʵ�ׯ`ÊK��ٳhӪ]�۷p�ʝK��ݻx��ׂ߿�L���È+^�x��ǐ#K�L���˘3kތ���ϠC�M���ӨS�^����װc˞M���۸s�ލ����N����ȓ+_μ���УK?ޡ���سk�ν����ËO������{?�������˟O������ۧ�����(�h�&h`6��F(�Vh�fh!v�V� �(�$�h�(���,���0���4�h�8��<���@����Di�H&��L6��P6 TVi�Xf��\v��`v;PK���\�ˍ�'templates/beez3/images/personal/dot.pngnu�[����PNG IHDR6!��!PLTE��������(������:���G��4��m�-'IDATc�PE�P� gsU�� �� @"hE�*D����&�IEND�B`�PK���\e���##*templates/beez3/images/personal/footer.jpgnu�[������JFIFHH��C��C����� ��ab���������?��ݮV�p�k��\^_d�/�W������o��}��`�@���V�� �|[o�A\pp��W^od�7�W������G`�;���.���[�� ݮV�p�k�@���.��)t4K�� U�@*� y}� ������ �|[o�+m� }m����������8 ��+��� ���^od�7�W����PK���\�� +templates/beez3/images/personal/grey_bg.pngnu�[����PNG IHDR�7uQPLTE���������������� %IDATx���G0�0g�?� 0�^�� aC������~�@�IEND�B`�PK���\�?|Us s &templates/beez3/images/slider_plus.pngnu�[����PNG IHDR�Fh�N�oPLTE��������������������������������������������������������������������333���������������7�f �IDATx���v7��s����,�1�ݪ�$� <T���꽧����o�G=2�A����3�X�(�ҵ}���L[Z�mL4��fJ�V��[�5wu!����u���ڈ^�v���.zҠ��%L W�Uɋ .�NO�� �rAA1��Pw�a�He��ͱ1�C{! �R,�7Ѹ�S����m-�S��§�V��S�y�-$,7��8=�@Hl�pH�bF���2��3U�'G�2�y�2�A�[�^��I�)�'P�*-xj6�Th�%U���|\�8�7��;À-L>l�K��2��fD+��+y �%KPq��,�T�qLƈ1���2ƼM�,�B�8`�@�����I��Pt����6IJ��!|��g�� ��D���p/���ur3�Ap*<>~�ʠ���m�C=Έ�z�0��go�� ���ӧ/��s�ƫ���<~W�ZQ)��F���6���,O6_4o݉�Q╳�`�Pv� �x�S�B��jզ ����^t�P^b��2�*(������d���6Zu�r�b�o}�O��F/���XUL�co���I���?3�l�j����d�� b����6�4�'�>k{| ��D��NycP�̠����/z=N?�E��}}{{]^��sj�&�hF���w��x�����b�,��+bA� ,�7!j�MG&�f�h�U�|o ��))z�+��Y�4S��9%]s�Ը7*E`�#ȅ Y�cPw�Y�\� H��|hy���e����| ��@.((f��ˆ�-"�(��"�E��#`-�����#@џ�E�W���2�����84�覚��e@L�zo]Z]��W��ŕ�j��veޜ�C& W��ܑ�v/Q.�쇘.6((�>aw�J��&IMG��5I���#�&MN�2D]LI�l���%�Z�J��G�� �%s���ZH�3n�2��rC�2���ǫ�Pu�G��ʛ��I���_��f�g���g��9N�� Rb��&�cl� ��K�\\]��?8��f���@PjXp�L7�j��RmBg��� y�i��i�f��K��RR�&(4K��S��bK�j�˄QhgI�֢c��g� ��-P�卺ȊN�~�8����� z����a�� N�������͠����}�����dЃ���������:5��<�Q"��3��[���-�M�,���i[m�h�6:I�/pV�L��ˆ;?������la�)E�ZO"�L �:Ԡ38W�\q|�����%AҢQةk�2�m�̼NQ���K��)�^K`���1�+�Z�6��J�A��F�[� bJ��Z��@R-���_� 8=2�A�A� ������Ç�ލ���б�b_w� �_��������/q!��-�&�}�@��<�0c�z�E�g��`���I�T�jV�:��I�h!`�����Q[Q�������RI�%�����P��.�`�+I��|�H�����Z?�AZ.�jD�Ma����;���b^�~|���ȠA=�3�������8����yn�V��ȏ���2:�[6�^��� �y D��(�I�Y�Z� T�Z�]7e�Yt�-�D�2J��ІKQ��@!P]�Z�,A�9� #.I����$^oodC-E�%���D�:u,�HW��A)y����SV�]㗏��c��,6��.��#�� ��˗�^^�~��D��zi���)ݱ�)%]ν�s;y���fJ5�,s-���ۀyXl ҁOn��FT�+�����$T@E$ ĤI@��$��P�]{��CQb4�r�[��*JL>qHۜ��i����͈(��>c�/�(�-xܡI���������� =K�0��[�xkX$��lA�?~���ȠA=�3�Xx?�ڋz_����@��[S�hib����T�XIj��v�z9�Itٔ4 �^��R�*�'��y��A�.�u�:Ԅ���ޏ�I�4��KM�5(�?� 9(|�TI�ۄzH/��T��Y��@lbs�5"G�R¤D(�����Ŗ誫��k��0Me��tHj)�O+e��)� 852�A�A� �����{�G=2�AdЃ x8~ ���ȠA=�z�Ǜ����77�>��E6t�g� �j1��(~��-�ΦDk�. 6���a_��Km�]O����d�L,��� &�@���BiqC�f6����9�[����<��LPh$�6����K��Ln��QhgI���ӫ�I�mk�[�2� Y:O7(���%qTEљbA�ף�E�9��r�� �NE�߂ 8=2�A�A� �����G�G=2�AdЃ ȠA�A��}:�a�����.���P���':�������-�I�-n/w�IEND�B`�PK���\��'@��!templates/beez3/images/all_bg.gifnu�[���GIF89a�����������������!�,T��d�I��P�y;��y`8�Q(�]��Xj�ҍ[� ���E�hD&57b9�*�V�yuV��%�;�R�Y� V���v(;PK���\��8:G G +templates/beez3/images/slider_minus_rtl.pngnu�[����PNG IHDR�Fh�N�oPLTE�������������������������������������������������������333�����������������������1�� �IDATx�� r�H93:-ɷ-��=���%f�?�Jd�������� 8<rу =�#`��g��>7�y;�����eF�My�a�֑���ߘ�����@S� �f�!��b�k�����0�H"�U!��3�A�P���=��-2n��D�l��Ib�c��d��?��z�t��bo�d��C�WS��(�Ɵ�U���Q������~��Y�pVr����%v�Hj7vk^��g���UI�47� Yz��s��3��arOƌh햑 hN3�����I�¹o{È'�=ܐ��-�|����Ûbc���L(����`@,�{� f��v��'�NNT��4�c�4`G�75xj}&}�M��i���;)�zE�����qF��/p2����x���Η�� .�__����5�^��k�_� 8�E~ ���9=rу xØ����w}Q��+,n�����đ]��/�e������ϧ,|g��0T���P�t� e�u�E�LK}��k`��h���À��خ�<�X�P����4�h���,A#��`� q�J ��q�?�yT0���u_ۧ�������x킢�Z���NBύX�a3�_'=������X.�}��_�\� 8�E?��q1�[��n�/�S)۴�OO%�w~ -�D��� Ǣ��ڵB� �ݻ,ۆ�-�j�6c��l�=�] POW�29�R�U2�աӫ)��K=4A<�E�Kb�L������~��Y�pVr����%v�Hj7vk^�ć�p�!���.��I9PG_xX�| $#`۰u�P�\K�ȤX(;4}�O��E?�N�w�E���M�����K�e��7]��z�&�6��Vt-2�&�o2�$[:#\�'r���i�tN%cU��pR�1+����܉j*�HxP�9B�u����|]�@܄N�I�贤D?$��m:�1q6�yH�:�'�.K�U˦]�O��j�ڡ���@��ْ��E�i�{�^t�+�(ʳ=u�t�o]�H���)����@�s�#bha��[i�I�-a�h������@`�@� �\��wՆizu��Bl��l�A��>!EZ�h�e��� �H��qdN�٧�jPU�I�[j��~�6i7� ĵ�[J䉱�4ͶeZ�/_����S����r~^q>_^NA�ApxL?|�8��<楤K���,��WX�T�e�H��Pٰ��f�$2��4i�$'�n���6n+�. J���+���d��?O�_gHY9ы�!��}á��#Ͷ���j R#;j����Y��FZ�Y��vN�(�:L����?{��%�A���n,n,�Q�4ZG�HSӯA��A��A.zo��Ϸ�_=�2�v�So˟Ǯ�A��v��A@i�-� o��|Jm����ԭ,�]"u�;)�z�L�MF,%9�6)o�$�1 pvB�ϡ �m߀]����<_�dC�df�W��Ė���Grʣx��F#�0�H"���D�U �a_�@�a���ہh�]0I��';�Apx�A.zG�tw�p7㡿->���˾4�ʨW���bL�*�V7,�;�����z�*9�f��f�*iwUV���L����{�윎�a��;�+[ُ2ڈͺu�D@CY��5����ؙ爖vM�@T�Ho0�:-���$���@J�˫+�k���d���4>r!���:xN�Lt�����E�\� ��ӧ��?��W0K�m=�,R��-k����f�-�ԗg�r�Җ.� ( D]-Pc/!66r4*�C�N@~ˍ:v�(�3tTPaC���ce�z�3�O ,��Ѫ�0�!zݝ���Fјna[�8^���K� �����Y5<6[�+5� �Z�ЋV���<+� y ��MApx�A.zG��s��,�y�eyJ_�~��3��/ 敠����ȵ#��%C "%S�u������FI�h7#0V�� �:�R�Io�AC5��lז,K���:|��8 �M��}!�V��nK��_��� p��LK�cB���Z���2|�9y�١�;Wis<�Ro��n1���6ٹ��kI��0����E�\� rу xC�~����E�\� rу x�~ ����E�\� rу x�~|��<�����K��wY0����P �jKnr� �H�5�_ P�C�Df: �O��1 ������Q�!O:�%K�#Sg㌁��8ⱨ����1E}�x�r�ʝ��i4pƥ5|�{c<���'O�T8��vD&��:h5��`$Ko��v K�Q���*톣]����c�� �\� �E� =�7��� �\� �E� =�\� r�o ��� &8 0��Nc'��IEND�B`�PK���\H:.�jj'templates/beez3/images/table_footer.gifnu�[���GIF89ad�������������!��,d;��������ڋ����H�扦�ʶ���L������Ģ�x(��fs�J��;PK���\�+\K K *templates/beez3/images/slider_plus_rtl.pngnu�[����PNG IHDR�Fh�N�oPLTE����������������������������������������������������������333������������������������������� �IDATx����HD�j;��]�z3{�3.H��� �Q����������ȠA=�3`��g��{���|��f�[�C��4��_����uYz�2�PW30D��^�1�Dx���g£GƜ��D0�@*Ha��ơi(�� Ԡ�H�Id5�3zcv!�Ǜ�o~*�Su����l�x6W�N���o-�L6~�F4��;_�^'�Q�/9��k�I'��Ķ�I�n�MK|�M�m����L}�0gg�̭c��������\�u6�t}� ��#�7���� !�x�P�R����ѫ7φ��ba$�k��`:� ȥA�Xs������Uo��9ь��I�+¼�W'PS���ݧ��8�#!��7�E�{���hx2��t�x��L/�/7כ//A��_������ N8��o[\_� 8��x ����'��zdЃ x��������0gn� �Z�Ũ��(r*Dm�7��a��J�>�������U��SF[�^D����������y��Փ��#a�5ؓ�,E�5L�Z� ��1&6�~`��V (Q�!j)ZBS�xk7��O]dž�ӂ� ��j�5H?$m'T�ް�vM?�k����u���2�wA���=�g�k=�݂�w���b�h���}~ M� ����Ǣ�:5C��xU.�f�Q1�,&�5Z��� 86,{Ի&@<U͔��(�R�l�6�Zu �Z��i.�_]�3�ew�(N֣�_r�g��N���m�:�ݘ����a��$�ʨ�� �!�A�/G]�0��P�Ų� K��Tz'�B:�B��A�\z��r����e��^.���z`.^x���>t4����:~��J�� ��!�6O�q�2���THm�XZ@3�S�H�>�Ծ�RV2r��Xu*�i�Ad�H�l$�����o����uh��Ա�Z����2�L���C�l2��TK��*�FUɾ\ �N�mN8ᗊL���őㅓiM��t敜ʳ�u��η�pL���i��a+a��f.�4�6�Y�e&8����oc����`q��Yx�;��!K�z~q��1��S�qtH���~m����u:��Z{��h�z���ƃ� +��N�e�����%g:�88��L�akW@��<J#o�3�)�%Ӫ�|s ��4pп�\?��^o�\� 8ՠApzL��~�4��<o票"�#�w�C�e�V/�A<�7bBkV���A�Gz��k�ɓ�U7��U�(� aV�]fzҎ���b���=$�9Q�I��'X�Mu�(�u5�U� 9�~g!Mz0����ϖsvPG� #ȴ�2��|���6/ ��GtmQc� ����H��~���ȠA=�z��Ǐ��o~j_p{����[t�a�ٚ���.L�oq�y�e%`k��[�]7��v�ĭ��8��ʗ�����yDR�=j��s3��v��T���kp��Y������Pyo˾e�Aq�d�DV�C��Q ybg�F!���Dv�UA ��MúZ�t�i7�֘����8:ov� ���ȠA=�3`zzz~���{���zn�r.�3���jvT�iYY��송��3E��m�^�J�R�B���,���4=��`jw�-�r*Ƈ���{�>�x���~�٧ Y��gH8���C�9K0��y�p)W�*�hR��N���ߺ%c�@lv��n�m��*�k��T�L�46s�����<�F]vhz ���ȠA=�S`���͛�o���|�[O1�U�ƛ~KZ�x�^�3���(_���à_"�R�lB���������q��69bґA�]�g����tX�q'�.)�ހ�YQa4Ĕa����R��ZQ�jɈl������ ��}v,���]�^�%�+1�5s,P�E����k9T��`�p��N�ApzdЃ ��0����G/�6��,O���o�J<j��`^1*>�pJ]'l]�H�h���.D�5�0)���2y�����hR��!�qv(�,�����u�Q��� �S��,X�patR8��C0]����n�=��IxM�� ��|��yR�B+����_�a��ブ�T� U�a����A�z� ^�߃ 8=2�A�A� �����k�G=2�AdЃ x����<�&����Y�,�J�Zb�6(�u�7>g`�%�j�/�&x�3`�V&l�Mn1P���p�B���M�h-�gᴁ �iq6�k�CR�vF�!��� !(ul���@��q� �x0Г����]ɰ�a��m��%�g���AT�:%���^��v�֮��`�1��g�G=2�AdЃ x�����ȠA=�z� 2�������'�X^�[k�4IEND�B`�PK���\IJ���#templates/beez3/templateDetails.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE install PUBLIC "-//Joomla! 2.5//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.6/template-install.dtd"> <extension version="3.1" type="template" client="site"> <name>beez3</name> <creationDate>25 November 2009</creationDate> <author>Angie Radtke</author> <authorEmail>a.radtke@derauftritt.de</authorEmail> <authorUrl>http://www.der-auftritt.de</authorUrl> <copyright>Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <version>3.1.0</version> <description>TPL_BEEZ3_XML_DESCRIPTION</description> <files> <folder>css</folder> <folder>html</folder> <folder>images</folder> <folder>javascript</folder> <folder>language</folder> <filename>index.php</filename> <filename>templateDetails.xml</filename> <filename>template_preview.png</filename> <filename>template_thumbnail.png</filename> <filename>jsstrings.php</filename> <filename>favicon.ico</filename> <filename>component.php</filename> <filename>error.php</filename> </files> <positions> <position>debug</position> <position>position-0</position> <position>position-1</position> <position>position-2</position> <position>position-3</position> <position>position-4</position> <position>position-5</position> <position>position-6</position> <position>position-7</position> <position>position-8</position> <position>position-9</position> <position>position-10</position> <position>position-11</position> <position>position-12</position> <position>position-13</position> <position>position-14</position> </positions> <!-- For core templates, we also install/uninstall the language files in the core language folders. --> <languages folder="language"> <language tag="en-GB">en-GB/en-GB.tpl_beez3.ini</language> <language tag="en-GB">en-GB/en-GB.tpl_beez3.sys.ini</language> </languages> <config> <fields name="params"> <fieldset name="advanced"> <field name="wrapperSmall" class="validate-numeric" type="text" default="53" label="TPL_BEEZ3_FIELD_WRAPPERSMALL_LABEL" description="TPL_BEEZ3_FIELD_WRAPPERSMALL_DESC" filter="integer" /> <field name="wrapperLarge" class="validate-numeric" type="text" default="72" label="TPL_BEEZ3_FIELD_WRAPPERLARGE_LABEL" description="TPL_BEEZ3_FIELD_WRAPPERLARGE_DESC" filter="integer" /> <field name="logo" type="media" label="TPL_BEEZ3_FIELD_LOGO_LABEL" description="TPL_BEEZ3_FIELD_LOGO_DESC" /> <field name="sitetitle" type="text" default="" label="TPL_BEEZ3_FIELD_SITETITLE_LABEL" description="TPL_BEEZ3_FIELD_SITETITLE_DESC" filter="string" /> <field name="sitedescription" type="text" default="" label="TPL_BEEZ3_FIELD_DESCRIPTION_LABEL" description="TPL_BEEZ3_FIELD_DESCRIPTION_DESC" filter="string" /> <field name="navposition" type="list" default="center" label="TPL_BEEZ3_FIELD_NAVPOSITION_LABEL" description="TPL_BEEZ3_FIELD_NAVPOSITION_DESC" filter="word" > <option value="center">TPL_BEEZ3_OPTION_AFTER_CONTENT</option> <option value="left">TPL_BEEZ3_OPTION_BEFORE_CONTENT</option> </field> <field name="bootstrap" type="textarea" label="TPL_BEEZ3_FIELD_BOOTSTRAP_LABEL" description="TPL_BEEZ3_FIELD_BOOTSTRAP_DESC" rows="4" columns="30" /> <field name="templatecolor" type="list" default="nature" label="TPL_BEEZ3_FIELD_TEMPLATECOLOR_LABEL" description="TPL_BEEZ3_FIELD_TEMPLATECOLOR_DESC" filter="word" > <option value="nature">TPL_BEEZ3_OPTION_NATURE</option> <option value="personal">TPL_BEEZ3_OPTION_PERSONAL</option> <option value="red">TPL_BEEZ3_OPTION_RED</option> <option value="turq">TPL_BEEZ3_OPTION_TURQ</option> <option value="image">TPL_BEEZ3_OPTION_IMAGE</option> </field> <field name="headerImage" type="media" label="TPL_BEEZ3_FIELD_HEADER_IMAGE_LABEL" description="TPL_BEEZ3_FIELD_HEADER_IMAGE_DESC" /> <field name="backgroundcolor" type="color" default="#eee" label="TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_LABEL" description="TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_DESC" /> </fieldset> </fields> </config> </extension> PK���\�V�logs/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\x�uu README.txtnu�[���1- What is this? * This is a Joomla! installation/upgrade package to version 3.x * Joomla! Official site: http://www.joomla.org * Joomla! 3.4 version history - https://docs.joomla.org/Joomla_3.4_version_history * Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/master 2- What is Joomla? * Joomla is a Content Management System (CMS) which enables you to build Web sites and powerful online applications. * It's a free and OpenSource software, distributed under the GNU General Public License version 2 or later * This is a simple and powerful web server application and it requires a server with PHP and either MySQL, PostgreSQL, or SQL Server to run it. More details here: http://www.joomla.org/about-joomla.html 3- Is Joomla for you? * Joomla is the right solution for any content web project: https://docs.joomla.org/Joomla_Is_it_for_me%3F * See Features - http://www.joomla.org/core-features.html * Try out our online demo: https://demo.joomla.org/ 4- How to find a Joomla! translation? * Repository of accredited language packs: http://community.joomla.org/translations.html * You can also add languages directly to your website via your Joomla! administration panel. 5- Learn Joomla! * Read Getting Started with Joomla to find out the basics: https://docs.joomla.org/Getting_Started_with_Joomla! * Before installing, read the beginners guide: https://docs.joomla.org/Beginners 6- What are the limits of Joomla? * Joomla sites can be extended in functionalities with Extensions that you can create (or download) to suite your needs. * There are lots of ready made extensions that you can download and install. * See the Joomla! Extensions Directory (JED): http://extensions.joomla.org 7- Is it easy to change the layout display? * The layout is controlled by templates that you can edit. * There are lots of ready made templates that you can download. 8- Ready to install Joomla? * See minimum requirements here: http://www.joomla.org/technical-requirements.html * How do you install Joomla! ? - https://docs.joomla.org/Installing_Joomla! * Start your Joomla experience building your site with a local test server. When ready it can be moved to an on-line hosting account of your choice. See the tutorial: https://docs.joomla.org/Tutorial:Joomla_Local_install 9- Updates are free! * Always use the latest version: http://www.joomla.org/download.html 10- Where can you get support and help? * The Joomla! Documentation: https://docs.joomla.org/Main_Page * FAQ Frequently Asked Questions: https://docs.joomla.org/Category:FAQ * Find the information you need: https://docs.joomla.org/Start_here * Find help and other users: http://www.joomla.org/about-joomla/create-and-share.html * Post questions at our forums: http://forum.joomla.org * Joomla Resources Directory (JRD): http://resources.joomla.org/ 11- Do you already have a Joomla site that's not built with Joomla 3.x ? * What's new in Joomla 3.x: http://www.joomla.org/3 * What are the main differences from 2.5 to 3? Table of contents: https://docs.joomla.org/Differences_from_Joomla_2.5_to_Joomla_3.0 * How to migrate from 2.5.x to 3.x? Tutorial: https://docs.joomla.org/Joomla_2.5_to_3.x_Step_by_Step_Migration * How to migrate from 1.5.x to 3.x? Tutorial: https://docs.joomla.org/Joomla_1.5_to_3.x_Step_by_Step_Migration * Convert an existing Web site to Joomla: https://docs.joomla.org/How_to_Convert_an_existing_Web_site_to_a_Joomla!_Web_site 12- Do you want to improve Joomla? * How do you request a feature? https://docs.joomla.org/How_do_you_request_a_feature%3F * How do you report a bug? https://docs.joomla.org/Filing_bugs_and_issues * Get Involved: Joomla! is a community developed software. Join the community at http://volunteers.joomla.org/ * Are you a Developer? https://docs.joomla.org/Developers * Are you a Web designer? https://docs.joomla.org/Web_designers Copyright: * Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. * Special Thanks: https://docs.joomla.org/Joomla!_Credits_and_Thanks * Distributed under the GNU General Public License version 2 or later * See Licenses details at https://docs.joomla.org/Joomla_Licenses PK���\Z�}��web.config.txtnu�[���<?xml version="1.0" encoding="UTF-8"?> <configuration> <location path="."> <system.webServer> <directoryBrowse enabled="false" /> <rewrite> <rules> <rule name="Joomla! Rule 1" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{QUERY_STRING}" pattern="base64_encode[^(]*\([^)]*\)" ignoreCase="false" /> <add input="{QUERY_STRING}" pattern="(>|%3C)([^s]*s)+cript.*(<|%3E)" /> <add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" /> <add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" /> </conditions> <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" /> </rule> <rule name="Joomla! Rule 2"> <match url="(.*)" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^/index.php" ignoreCase="true" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite> </system.webServer> </location> </configuration> PK���\�V�layouts/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\N��W��:layouts/libraries/cms/html/bootstrap/starttabsetscript.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $selector = empty($displayData['selector']) ? '' : $displayData['selector']; echo "(function($){ $('#$selector a').click(function (e) { e.preventDefault(); $(this).tab('show'); }); })(jQuery);"; PK���\ޘ�885layouts/libraries/cms/html/bootstrap/addtabscript.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $selector = empty($displayData['selector']) ? '' : $displayData['selector']; $id = empty($displayData['id']) ? '' : $displayData['id']; $active = empty($displayData['active']) ? '' : $displayData['active']; $title = empty($displayData['title']) ? '' : $displayData['title']; echo "(function($){ $(document).ready(function() { // Handler for .ready() called. var tab = $('<li class=\"" . $active . "\"><a href=\"#" . $id . "\" data-toggle=\"tab\">" . $title . "</a></li>'); $('#" . $selector . "Tabs').append(tab); }); })(jQuery);"; PK���\��v��/layouts/libraries/cms/html/bootstrap/addtab.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $id = empty($displayData['id']) ? '' : $displayData['id']; $active = empty($displayData['active']) ? '' : $displayData['active']; ?> <div id="<?php echo $id; ?>" class="tab-pane<?php echo $active; ?>"> PK���\�e��/layouts/libraries/cms/html/bootstrap/endtab.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> </div>PK���\�e��2layouts/libraries/cms/html/bootstrap/endtabset.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> </div>PK���\X15���4layouts/libraries/cms/html/bootstrap/starttabset.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $selector = empty($displayData['selector']) ? '' : $displayData['selector']; ?> <ul class="nav nav-tabs" id="<?php echo $selector; ?>Tabs"></ul> <div class="tab-content" id="<?php echo $selector; ?>Content">PK���\�;���!layouts/joomla/system/message.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $msgList = $displayData['msgList']; ?> <div id="system-message-container"> <?php if (is_array($msgList) && !empty($msgList)) : ?> <div id="system-message"> <?php foreach ($msgList as $type => $msgs) : ?> <div class="alert alert-<?php echo $type; ?>"> <?php // This requires JS so we should add it trough JS. Progressive enhancement and stuff. ?> <a class="close" data-dismiss="alert">×</a> <?php if (!empty($msgs)) : ?> <h4 class="alert-heading"><?php echo JText::_($type); ?></h4> <div> <?php foreach ($msgs as $msg) : ?> <p class="alert-message"><?php echo $msg; ?></p> <?php endforeach; ?> </div> <?php endif; ?> </div> <?php endforeach; ?> </div> <?php endif; ?> </div> PK���\�����3layouts/joomla/content/categories_default_items.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $class = ' class="first"'; JHtml::_('bootstrap.tooltip'); $item = $displayData->item; $items = $displayData->get('items'); $params = $displayData->params; $extension = $displayData->get('extension'); $className = substr($extension, 4); // This will work for the core components but not necessarily for other components // that may have different pluralisation rules. if (substr($className, -1) == 's') { $className = rtrim($className, 's'); } PK���\_�=�*layouts/joomla/content/options_default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.framework'); ?> <fieldset class="<?php echo !empty($displayData->formclass) ? $displayData->formclass : 'form-horizontal'; ?>"> <legend><?php echo $displayData->name ?></legend> <?php if (!empty($displayData->description)): ?> <p><?php echo $displayData->description; ?></p> <?php endif; ?> <?php $fieldsnames = explode(',', $displayData->fieldsname); foreach($fieldsnames as $fieldname) { foreach ($displayData->form->getFieldset($fieldname) as $field) { $classnames = 'control-group'; $rel = ''; $showon = $displayData->form->getFieldAttribute($field->fieldname, 'showon'); if (!empty($showon)) { JHtml::_('jquery.framework'); JHtml::_('script', 'jui/cms.js', false, true); $id = $displayData->form->getFormControl(); $showon = explode(':', $showon, 2); $classnames .= ' showon_' . implode(' showon_', explode(',', $showon[1])); $rel = ' rel="showon_' . $id . '['. $showon[0] . ']"'; } ?> <div class="<?php echo $classnames; ?>"<?php echo $rel; ?>> <?php if (!isset($displayData->showlabel) || $displayData->showlabel): ?> <div class="control-label"><?php echo $field->label; ?></div> <?php endif; ?> <div class="controls"><?php echo $field->input; ?></div> </div> <?php } } ?> </fieldset> PK���\�厩� � +layouts/joomla/content/category_default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; // Note that this layout opens a div with the page class suffix. If you do not use the category children // layout you need to close this div either by overriding this file or in your main layout. $params = $displayData->params; $extension = $displayData->get('category')->extension; $canEdit = $params->get('access-edit'); $className = substr($extension, 4); // This will work for the core components but not necessarily for other components // that may have different pluralisation rules. if (substr($className, -1) == 's') { $className = rtrim($className, 's'); } $tagsData = $displayData->get('category')->tags->itemTags; ?> <div> <div class="<?php echo $className .'-category' . $displayData->pageclass_sfx;?>"> <?php if ($params->get('show_page_heading')) : ?> <h1> <?php echo $displayData->escape($params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if($params->get('show_category_title', 1)) : ?> <h2> <?php echo JHtml::_('content.prepare', $displayData->get('category')->title, '', $extension . '.category.title'); ?> </h2> <?php endif; ?> <?php if ($params->get('show_cat_tags', 1)) : ?> <?php echo JLayoutHelper::render('joomla.content.tags', $tagsData); ?> <?php endif; ?> <?php if ($params->get('show_description', 1) || $params->def('show_description_image', 1)) : ?> <div class="category-desc"> <?php if ($params->get('show_description_image') && $displayData->get('category')->getParams()->get('image')) : ?> <img src="<?php echo $displayData->get('category')->getParams()->get('image'); ?>" alt="<?php echo htmlspecialchars($displayData->get('category')->getParams()->get('image_alt')); ?>"/> <?php endif; ?> <?php if ($params->get('show_description') && $displayData->get('category')->description) : ?> <?php echo JHtml::_('content.prepare', $displayData->get('category')->description, '', $extension . '.category'); ?> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?> <?php echo $displayData->loadTemplate($displayData->subtemplatename); ?> <?php if ($displayData->get('children') && $displayData->maxLevel != 0) : ?> <div class="cat-children"> <?php if ($params->get('show_category_heading_title_text', 1) == 1) : ?> <h3> <?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?> </h3> <?php endif; ?> <?php echo $displayData->loadTemplate('children'); ?> </div> <?php endif; ?> </div> </div> PK���\���/��8layouts/joomla/content/blog_style_default_item_title.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Create a shortcut for params. $params = $displayData->params; $canEdit = $displayData->params->get('access-edit'); JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); ?> <?php if ($params->get('show_title') || $displayData->state == 0 || ($params->get('show_author') && !empty($displayData->author ))) : ?> <div class="page-header"> <?php if ($params->get('show_title')) : ?> <h2 itemprop="name"> <?php if ($params->get('link_titles') && $params->get('access-view')) : ?> <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($displayData->slug, $displayData->catid, $displayData->language)); ?>" itemprop="url"> <?php echo $this->escape($displayData->title); ?></a> <?php else : ?> <?php echo $this->escape($displayData->title); ?> <?php endif; ?> </h2> <?php endif; ?> <?php if ($displayData->state == 0) : ?> <span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span> <?php endif; ?> <?php if (strtotime($displayData->publish_up) > strtotime(JFactory::getDate())) : ?> <span class="label label-warning"><?php echo JText::_('JNOTPUBLISHEDYET'); ?></span> <?php endif; ?> <?php if ((strtotime($displayData->publish_down) < strtotime(JFactory::getDate())) && $displayData->publish_down != JFactory::getDbo()->getNullDate()) : ?> <span class="label label-warning"><?php echo JText::_('JEXPIRED'); ?></span> <?php endif; ?> </div> <?php endif; ?> PK���\����&layouts/joomla/content/intro_image.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $params = $displayData->params; ?> <?php $images = json_decode($displayData->images); ?> <?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?> <?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?> <div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> <?php if ($params->get('link_titles') && $params->get('access-view')) : ?> <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($displayData->slug, $displayData->catid, $displayData->language)); ?>"><img <?php if ($images->image_intro_caption): echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_intro_caption) . '"'; endif; ?> src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>" itemprop="thumbnailUrl"/></a> <?php else : ?><img <?php if ($images->image_intro_caption): echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_intro_caption) . '"'; endif; ?> src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>" itemprop="thumbnailUrl"/> <?php endif; ?> </div> <?php endif; ?> PK���\�g��,layouts/joomla/content/info_block/author.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; ?> <dd class="createdby" itemprop="author" itemscope itemtype="http://schema.org/Person"> <?php $author = ($displayData['item']->created_by_alias ? $displayData['item']->created_by_alias : $displayData['item']->author); ?> <?php $author = '<span itemprop="name">' . $author . '</span>'; ?> <?php if (!empty($displayData['item']->contact_link ) && $displayData['params']->get('link_author') == true) : ?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $displayData['item']->contact_link, $author, array('itemprop' => 'url'))); ?> <?php else :?> <?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?> <?php endif; ?> </dd> PK���\{��SS.layouts/joomla/content/info_block/category.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; ?> <dd class="category-name"> <?php $title = $this->escape($displayData['item']->category_title); ?> <?php if ($displayData['params']->get('link_category') && $displayData['item']->catslug) : ?> <?php $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($displayData['item']->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?> <?php endif; ?> </dd>PK���\ ��\*layouts/joomla/content/info_block/hits.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; ?> <dd class="hits"> <span class="icon-eye-open"></span> <meta itemprop="interactionCount" content="UserPageVisits:<?php echo $displayData['item']->hits; ?>" /> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $displayData['item']->hits); ?> </dd>PK���\��@ +layouts/joomla/content/info_block/block.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; $blockPosition = $displayData['params']->get('info_block_position', 0); ?> <dl class="article-info muted"> <?php if ($displayData['position'] == 'above' && ($blockPosition == 0 || $blockPosition == 2) || $displayData['position'] == 'below' && ($blockPosition == 1) ) : ?> <dt class="article-info-term"> <?php if ($displayData['params']->get('info_block_show_title', 1)) : ?> <?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?> <?php endif; ?> </dt> <?php if ($displayData['params']->get('show_author') && !empty($displayData['item']->author )) : ?> <?php echo JLayoutHelper::render('joomla.content.info_block.author', $displayData); ?> <?php endif; ?> <?php if ($displayData['params']->get('show_parent_category') && !empty($displayData['item']->parent_slug)) : ?> <?php echo JLayoutHelper::render('joomla.content.info_block.parent_category', $displayData); ?> <?php endif; ?> <?php if ($displayData['params']->get('show_category')) : ?> <?php echo JLayoutHelper::render('joomla.content.info_block.category', $displayData); ?> <?php endif; ?> <?php if ($displayData['params']->get('show_publish_date')) : ?> <?php echo JLayoutHelper::render('joomla.content.info_block.publish_date', $displayData); ?> <?php endif; ?> <?php endif; ?> <?php if ($displayData['position'] == 'above' && ($blockPosition == 0) || $displayData['position'] == 'below' && ($blockPosition == 1 || $blockPosition == 2) ) : ?> <?php if ($displayData['params']->get('show_create_date')) : ?> <?php echo JLayoutHelper::render('joomla.content.info_block.create_date', $displayData); ?> <?php endif; ?> <?php if ($displayData['params']->get('show_modify_date')) : ?> <?php echo JLayoutHelper::render('joomla.content.info_block.modify_date', $displayData); ?> <?php endif; ?> <?php if ($displayData['params']->get('show_hits')) : ?> <?php echo JLayoutHelper::render('joomla.content.info_block.hits', $displayData); ?> <?php endif; ?> <?php endif; ?> </dl> PK���\_j=oo2layouts/joomla/content/info_block/publish_date.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; ?> <dd class="published"> <span class="icon-calendar"></span> <time datetime="<?php echo JHtml::_('date', $displayData['item']->publish_up, 'c'); ?>" itemprop="datePublished"> <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $displayData['item']->publish_up, JText::_('DATE_FORMAT_LC3'))); ?> </time> </dd>PK���\>�'�gg1layouts/joomla/content/info_block/create_date.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; ?> <dd class="create"> <span class="icon-calendar"></span> <time datetime="<?php echo JHtml::_('date', $displayData['item']->created, 'c'); ?>" itemprop="dateCreated"> <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $displayData['item']->created, JText::_('DATE_FORMAT_LC3'))); ?> </time> </dd>PK���\r ��kk5layouts/joomla/content/info_block/parent_category.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; ?> <dd class="parent-category-name"> <?php $title = $this->escape($displayData['item']->parent_title); ?> <?php if ($displayData['params']->get('link_parent_category') && !empty($displayData['item']->parent_slug)) : ?> <?php $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($displayData['item']->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?> <?php else : ?> <?php echo JText::sprintf('COM_CONTENT_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?> <?php endif; ?> </dd>PK���\�>9�ee1layouts/joomla/content/info_block/modify_date.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; ?> <dd class="modified"> <span class="icon-calendar"></span> <time datetime="<?php echo JHtml::_('date', $displayData['item']->modified, 'c'); ?>" itemprop="dateModified"> <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $displayData['item']->modified, JText::_('DATE_FORMAT_LC3'))); ?> </time> </dd>PK���\�{?u��'layouts/joomla/content/associations.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; $items = $displayData; if (!empty($items)) : ?> <ul class="item-associations"> <?php foreach ($items as $id => $item) : ?> <li> <?php echo $item->link; ?> </li> <?php endforeach; ?> </ul> <?php endif; PK���\X���003layouts/joomla/content/blog_style_default_links.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <ol class="nav nav-tabs nav-stacked"> <?php foreach ($displayData->get('link_items') as $item) : ?> <li> <a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>"> <?php echo $item->title; ?></a> </li> <?php endforeach; ?> </ol> PK���\���jj layouts/joomla/content/icons.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; JHtml::_('bootstrap.framework'); $canEdit = $displayData['params']->get('access-edit'); ?> <div class="icons"> <?php if (empty($displayData['print'])) : ?> <?php if ($canEdit || $displayData['params']->get('show_print_icon') || $displayData['params']->get('show_email_icon')) : ?> <div class="btn-group pull-right"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <span class="icon-cog"></span><span class="caret"></span> </a> <?php // Note the actions class is deprecated. Use dropdown-menu instead. ?> <ul class="dropdown-menu"> <?php if ($displayData['params']->get('show_print_icon')) : ?> <li class="print-icon"> <?php echo JHtml::_('icon.print_popup', $displayData['item'], $displayData['params']); ?> </li> <?php endif; ?> <?php if ($displayData['params']->get('show_email_icon')) : ?> <li class="email-icon"> <?php echo JHtml::_('icon.email', $displayData['item'], $displayData['params']); ?> </li> <?php endif; ?> <?php if ($canEdit) : ?> <li class="edit-icon"> <?php echo JHtml::_('icon.edit', $displayData['item'], $displayData['params']); ?> </li> <?php endif; ?> </ul> </div> <?php endif; ?> <?php else : ?> <div class="pull-right"> <?php echo JHtml::_('icon.print_screen', $displayData['item'], $displayData['params']); ?> </div> <?php endif; ?> </div> PK���\O���^^layouts/joomla/content/tags.phpnu�[���<?php /** * @package Joomla.Cms * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; use Joomla\Registry\Registry; JLoader::register('TagsHelperRoute', JPATH_BASE . '/components/com_tags/helpers/route.php'); ?> <?php if (!empty($displayData)) : ?> <ul class="tags inline"> <?php foreach ($displayData as $i => $tag) : ?> <?php if (in_array($tag->access, JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')))) : ?> <?php $tagParams = new Registry($tag->params); ?> <?php $link_class = $tagParams->get('tag_link_class', 'label label-info'); ?> <li class="tag-<?php echo $tag->tag_id; ?> tag-list<?php echo $i ?>" itemprop="keywords"> <a href="<?php echo JRoute::_(TagsHelperRoute::getTagRoute($tag->tag_id . '-' . $tag->alias)) ?>" class="<?php echo $link_class; ?>"> <?php echo $this->escape($tag->title); ?> </a> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> PK���\b����-layouts/joomla/content/categories_default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php if ($displayData->params->get('show_page_heading')) : ?> <h1> <?php echo $displayData->escape($displayData->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($displayData->params->get('show_base_description')) : ?> <?php //If there is a description in the menu parameters use that; ?> <?php if($displayData->params->get('categories_description')) : ?> <div class="category-desc base-desc"> <?php echo JHtml::_('content.prepare', $displayData->params->get('categories_description'), '', $displayData->get('extension') . '.categories'); ?> </div> <?php else : ?> <?php //Otherwise get one from the database if it exists. ?> <?php if ($displayData->parent->description) : ?> <div class="category-desc base-desc"> <?php echo JHtml::_('content.prepare', $displayData->parent->description, '', $displayData->parent->extension . '.categories'); ?> </div> <?php endif; ?> <?php endif; ?> <?php endif; ?> PK���\% , #layouts/joomla/content/readmore.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ $params = $displayData['params']; $item = $displayData['item']; ?> <p class="readmore"> <a class="btn" href="<?php echo $displayData['link']; ?>" itemprop="url"> <span class="icon-chevron-right"></span> <?php if (!$params->get('access-view')) : echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); elseif ($readmore = $item->alternative_readmore) : echo $readmore; if ($params->get('show_readmore_title', 0) != 0) : echo JHtml::_('string.truncate', ($item->title), $params->get('readmore_limit')); endif; elseif ($params->get('show_readmore_title', 0) == 0) : echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE'); else : echo JText::_('COM_CONTENT_READ_MORE'); echo JHtml::_('string.truncate', ($item->title), $params->get('readmore_limit')); endif; ?> </a> </p> PK���\��-"layouts/joomla/pagination/link.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; $item = $displayData['data']; $display = $item->text; switch ((string) $item->text) { // Check for "Start" item case JText::_('JLIB_HTML_START') : $icon = "icon-backward"; break; // Check for "Prev" item case $item->text == JText::_('JPREV') : $item->text = JText::_('JPREVIOUS'); $icon = "icon-step-backward"; break; // Check for "Next" item case JText::_('JNEXT') : $icon = "icon-step-forward"; break; // Check for "End" item case JText::_('JLIB_HTML_END') : $icon = "icon-forward"; break; default: $icon = null; break; } if ($icon !== null) { $display = '<span class="' . $icon . '"></span>'; } if ($displayData['active']) { if ($item->base > 0) { $limit = 'limitstart.value=' . $item->base; } else { $limit = 'limitstart.value=0'; } $cssClasses = array(); $title = ''; if (!is_numeric($item->text)) { JHtml::_('bootstrap.tooltip'); $cssClasses[] = 'hasTooltip'; $title = ' title="' . $item->text . '" '; } $onClick = 'document.adminForm.' . $item->prefix . 'limitstart.value=' . ($item->base > 0 ? $item->base : '0') . '; Joomla.submitform();return false;'; } else { $class = (property_exists($item, 'active') && $item->active) ? 'active' : 'disabled'; } ?> <?php if ($displayData['active']) : ?> <li> <a class="<?php echo implode(' ', $cssClasses); ?>" <?php echo $title; ?> href="#" onclick="<?php echo $onClick; ?>"> <?php echo $display; ?> </a> </li> <?php else : ?> <li class="<?php echo $class; ?>"> <span><?php echo $display; ?></span> </li> <?php endif; PK���\��@$ $ #layouts/joomla/pagination/links.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; use Joomla\Registry\Registry; $list = $displayData['list']; $pages = $list['pages']; $options = new Registry($displayData['options']); $showLimitBox = $options->get('showLimitBox', true); $showPagesLinks = $options->get('showPagesLinks', true); $showLimitStart = $options->get('showLimitStart', true); // Calculate to display range of pages $currentPage = 1; $range = 1; $step = 5; if (!empty($pages['pages'])) { foreach ($pages['pages'] as $k => $page) { if (!$page['active']) { $currentPage = $k; } } } if ($currentPage >= $step) { if ($currentPage % $step == 0) { $range = ceil($currentPage / $step) + 1; } else { $range = ceil($currentPage / $step); } } ?> <div class="pagination pagination-toolbar clearfix" style="text-align: center;"> <?php if ($showLimitBox) : ?> <div class="limit pull-right"> <?php echo JText::_('JGLOBAL_DISPLAY_NUM') . $list['limitfield']; ?> </div> <?php endif; ?> <?php if ($showPagesLinks && (!empty($pages))) : ?> <ul class="pagination-list"> <?php echo JLayoutHelper::render('joomla.pagination.link', $pages['start']); echo JLayoutHelper::render('joomla.pagination.link', $pages['previous']); ?> <?php foreach ($pages['pages'] as $k => $page) : ?> <?php $output = JLayoutHelper::render('joomla.pagination.link', $page); ?> <?php if (in_array($k, range($range * $step - ($step + 1), $range * $step))) : ?> <?php if (($k % $step == 0 || $k == $range * $step - ($step + 1)) && $k != $currentPage && $k != $range * $step - $step) :?> <?php $output = preg_replace('#(<a.*?>).*?(</a>)#', '$1...$2', $output); ?> <?php endif; ?> <?php endif; ?> <?php echo $output; ?> <?php endforeach; ?> <?php echo JLayoutHelper::render('joomla.pagination.link', $pages['next']); echo JLayoutHelper::render('joomla.pagination.link', $pages['end']); ?> </ul> <?php endif; ?> <?php if ($showLimitStart) : ?> <input type="hidden" name="<?php echo $list['prefix']; ?>limitstart" value="<?php echo $list['limitstart']; ?>" /> <?php endif; ?> </div> PK���\P�ۺ��"layouts/joomla/quickicons/icon.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $id = empty($displayData['id']) ? '' : (' id="' . $displayData['id'] . '"'); $target = empty($displayData['target']) ? '' : (' target="' . $displayData['target'] . '"'); $onclick = empty($displayData['onclick']) ? '' : (' onclick="' . $displayData['onclick'] . '"'); $title = empty($displayData['title']) ? '' : (' title="' . $this->escape($displayData['title']) . '"'); $text = empty($displayData['text']) ? '' : ('<span>' . $displayData['text'] . '</span>') ?> <div class="row-fluid"<?php echo $id; ?>> <div class="span12"> <a href="<?php echo $displayData['link']; ?>"<?php echo $target . $onclick . $title; ?>> <span class="icon-<?php echo $displayData['image']; ?>"></span> <?php echo $text; ?> </a> </div> </div> PK���\�S �G G #layouts/joomla/sidebars/submenu.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; JHtmlBehavior::core(); JFactory::getDocument()->addScriptDeclaration(' jQuery(document).ready(function($) { if (window.toggleSidebar) { toggleSidebar(true); } else { $("#j-toggle-sidebar-header").css("display", "none"); $("#j-toggle-button-wrapper").css("display", "none"); } }); '); ?> <div id="j-toggle-sidebar-wrapper"> <div id="j-toggle-button-wrapper" class="j-toggle-button-wrapper"> <?php echo JLayoutHelper::render('joomla.sidebars.toggle'); ?> </div> <div id="sidebar" class="sidebar"> <div class="sidebar-nav"> <?php if ($displayData->displayMenu) : ?> <ul id="submenu" class="nav nav-list"> <?php foreach ($displayData->list as $item) : if (isset ($item[2]) && $item[2] == 1) : ?> <li class="active"> <?php else : ?> <li> <?php endif; if ($displayData->hide) : ?> <a class="nolink"><?php echo $item[0]; ?></a> <?php else : if (strlen($item[1])) : ?> <a href="<?php echo JFilterOutput::ampReplace($item[1]); ?>"><?php echo $item[0]; ?></a> <?php else : ?> <?php echo $item[0]; ?> <?php endif; endif; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> <?php if ($displayData->displayMenu && $displayData->displayFilters) : ?> <hr /> <?php endif; ?> <?php if ($displayData->displayFilters) : ?> <div class="filter-select hidden-phone"> <h4 class="page-header"><?php echo JText::_('JSEARCH_FILTER_LABEL');?></h4> <?php foreach ($displayData->filters as $filter) : ?> <label for="<?php echo $filter['name']; ?>" class="element-invisible"><?php echo $filter['label']; ?></label> <select name="<?php echo $filter['name']; ?>" id="<?php echo $filter['name']; ?>" class="span12 small" onchange="this.form.submit()"> <?php if (!$filter['noDefault']) : ?> <option value=""><?php echo $filter['label']; ?></option> <?php endif; ?> <?php echo $filter['options']; ?> </select> <hr class="hr-condensed" /> <?php endforeach; ?> </div> <?php endif; ?> </div> </div> <div id="j-toggle-sidebar"></div> </div> PK���\�G���"layouts/joomla/sidebars/toggle.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; // Set the tooltips JText::script('JTOGGLE_HIDE_SIDEBAR'); JText::script('JTOGGLE_SHOW_SIDEBAR'); ?> <div id="j-toggle-sidebar-button" class="j-toggle-sidebar-button hidden-phone hasTooltip" title="<?php echo JHtml::tooltipText('JTOGGLE_HIDE_SIDEBAR'); ?>" type="button" onclick="toggleSidebar(false); return false;" > <span id="j-toggle-sidebar-icon" class="icon-arrow-left-2"></span> </div> PK���\Eذ��)layouts/joomla/tinymce/buttons/button.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLog::add('The layout joomla.tinymce.buttons.button is deprecated, use joomla.editors.buttons.button instead.', JLog::WARNING, 'deprecated'); echo JLayoutHelper::render('joomla.editors.buttons.button', $displayData); ?> PK���\��ZIII#layouts/joomla/tinymce/textarea.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $data = $displayData; ?> <textarea name="<?php echo $data->name; ?>" id="<?php echo $data->id; ?>" cols="<?php echo $data->cols; ?>" rows="<?php echo $data->rows; ?>" style="width: <?php echo $data->width; ?>; height: <?php echo $data->height; ?>;" class="mce_editable" > <?php echo $data->content; ?> </textarea>PK���\���J��'layouts/joomla/tinymce/togglebutton.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $name = $displayData; ?> <div class="toggle-editor btn-toolbar pull-right clearfix"> <div class="btn-group"> <a class="btn" href="#" onclick="tinyMCE.execCommand('mceToggleEditor', false, '<?php echo $name; ?>');return false;" title="<?php echo JText::_('PLG_TINY_BUTTON_TOGGLE_EDITOR'); ?>" > <span class="icon-eye"></span> <?php echo JText::_('PLG_TINY_BUTTON_TOGGLE_EDITOR'); ?> </a> </div> </div>PK���\f��*��"layouts/joomla/tinymce/buttons.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLog::add('The layout joomla.tinymce.buttons is deprecated, use joomla.editors.buttons instead.', JLog::WARNING, 'deprecated'); echo JLayoutHelper::render('joomla.editors.buttons', $displayData); ?> PK���\�ԗ�&&#layouts/joomla/links/groupsopen.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="j-links-groups">PK���\zs�$layouts/joomla/links/groupsclose.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> </div> PK���\`So00'layouts/joomla/links/groupseparator.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="j-links-separator"></div> PK���\�#�C��"layouts/joomla/links/groupopen.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <h2 class="nav-header"><?php echo JFilterOutput::ampReplace(JText::_($displayData)); ?></h2> <ul class="j-links-group nav nav-list"> PK���\����layouts/joomla/links/link.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $id = empty($displayData['id']) ? '' : (' id="' . $displayData['id'] . '"'); $target = empty($displayData['target']) ? '' : (' target="' . $displayData['target'] . '"'); $onclick = empty($displayData['onclick']) ? '' : (' onclick="' . $displayData['onclick'] . '"'); $title = empty($displayData['title']) ? '' : (' title="' . $this->escape($displayData['title']) . '"'); $text = empty($displayData['text']) ? '' : ('<span class="j-links-link">' . $displayData['text'] . '</span>') ?> <li<?php echo $id; ?>> <a href="<?php echo JFilterOutput::ampReplace($displayData['link']); ?>"<?php echo $target . $onclick . $title; ?>> <span class="icon-<?php echo $displayData['image']; ?>"></span> <?php echo $text; ?> </a> </li> PK���\c.�[#layouts/joomla/links/groupclose.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> </ul> PK���\7�dr��*layouts/joomla/searchtools/default/bar.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; use Joomla\Registry\Registry; $data = $displayData; // Receive overridable options $data['options'] = !empty($data['options']) ? $data['options'] : array(); if (is_array($data['options'])) { $data['options'] = new Registry($data['options']); } // Options $filterButton = $data['options']->get('filterButton', true); $searchButton = $data['options']->get('searchButton', true); $filters = $data['view']->filterForm->getGroup('filter'); ?> <?php if (!empty($filters['filter_search'])) : ?> <?php if ($searchButton) : ?> <label for="filter_search" class="element-invisible"> <?php echo JText::_('JSEARCH_FILTER'); ?> </label> <div class="btn-wrapper input-append"> <?php echo $filters['filter_search']->input; ?> <?php if ($filters['filter_search']->description) : ?> <?php JHtmlBootstrap::tooltip('#filter_search', array('title' => JText::_($filters['filter_search']->description))); ?> <?php endif; ?> <button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"> <span class="icon-search"></span> </button> </div> <?php if ($filterButton) : ?> <div class="btn-wrapper hidden-phone"> <button type="button" class="btn hasTooltip js-stools-btn-filter" title="<?php echo JHtml::tooltipText('JSEARCH_TOOLS_DESC'); ?>"> <?php echo JText::_('JSEARCH_TOOLS');?> <span class="caret"></span> </button> </div> <?php endif; ?> <div class="btn-wrapper"> <button type="button" class="btn hasTooltip js-stools-btn-clear" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>"> <?php echo JText::_('JSEARCH_FILTER_CLEAR');?> </button> </div> <?php endif; ?> <?php endif; PK���\=����.layouts/joomla/searchtools/default/filters.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; $data = $displayData; // Load the form filters $filters = $data['view']->filterForm->getGroup('filter'); ?> <?php if ($filters) : ?> <?php foreach ($filters as $fieldName => $field) : ?> <?php if ($fieldName != 'filter_search') : ?> <div class="js-stools-field-filter"> <?php echo $field->input; ?> </div> <?php endif; ?> <?php endforeach; ?> <?php endif; ?> PK���\ ��soo+layouts/joomla/searchtools/default/list.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') 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; ?> PK���\�b�jj&layouts/joomla/searchtools/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; $data = $displayData; // Receive overridable options $data['options'] = !empty($data['options']) ? $data['options'] : array(); // Set some basic options $customOptions = array( 'filtersHidden' => isset($data['options']['filtersHidden']) ? $data['options']['filtersHidden'] : empty($data['view']->activeFilters), 'defaultLimit' => isset($data['options']['defaultLimit']) ? $data['options']['defaultLimit'] : JFactory::getApplication()->get('list_limit', 20), 'searchFieldSelector' => '#filter_search', 'orderFieldSelector' => '#list_fullordering' ); $data['options'] = array_merge($customOptions, $data['options']); $formSelector = !empty($data['options']['formSelector']) ? $data['options']['formSelector'] : '#adminForm'; // Load search tools JHtml::_('searchtools.form', $formSelector, $data['options']); ?> <div class="js-stools clearfix"> <div class="clearfix"> <div class="js-stools-container-bar"> <?php echo JLayoutHelper::render('joomla.searchtools.default.bar', $data); ?> </div> <div class="js-stools-container-list hidden-phone hidden-tablet"> <?php echo JLayoutHelper::render('joomla.searchtools.default.list', $data); ?> </div> </div> <!-- Filters div --> <div class="js-stools-container-filters hidden-phone clearfix"> <?php echo JLayoutHelper::render('joomla.searchtools.default.filters', $data); ?> </div> </div> PK���\�$,�(layouts/joomla/searchtools/grid/sort.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; $data = $displayData; $metatitle = JHtml::tooltipText(JText::_($data->tip ? $data->tip : $data->title), JText::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN'), 0); JHtml::_('bootstrap.tooltip'); ?> <a href="#" onclick="return false;" class="js-stools-column-order hasTooltip" data-order="<?php echo $data->order; ?>" data-direction="<?php echo strtoupper($data->direction); ?>" data-name="<?php echo JText::_($data->title); ?>" title="<?php echo $metatitle; ?>"> <?php if (!empty($data->icon)) : ?> <span class="<?php echo $data->icon; ?>"></span> <?php endif; ?> <?php if (!empty($data->title)) : ?> <?php echo JText::_($data->title); ?> <?php endif; ?> <?php if ($data->order == $data->selected) : ?> <span class="<?php echo $data->orderIcon; ?>"></span> <?php endif; ?> </a> PK���\��x$layouts/joomla/toolbar/separator.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; PK���\@�f��!layouts/joomla/toolbar/slider.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.core'); $doTask = $displayData['doTask']; $class = $displayData['class']; $text = $displayData['text']; $name = $displayData['name']; $onClose = $displayData['onClose']; ?> <button onclick="<?php echo $doTask; ?>" class="btn btn-small" data-toggle="collapse" data-target="#collapse-<?php echo $name; ?>"<?php echo $onClose; ?>> <span class="icon-cog"></span> <?php echo $text; ?> </button> PK���\�8���#layouts/joomla/toolbar/versions.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.framework'); ?> <a rel="{handler: 'iframe', size: {x: <?php echo $displayData['height']; ?>, y: <?php echo $displayData['width']; ?>}}" href="index.php?option=com_contenthistory&view=history&layout=modal&tmpl=component&item_id=<?php echo (int) $displayData['itemId']; ?>&type_id=<?php echo $displayData['typeId']; ?>&type_alias=<?php echo $displayData['typeAlias']; ?>&<?php echo JSession::getFormToken(); ?>=1" title="<?php echo $displayData['title']; ?>" class="btn btn-small modal_jform_contenthistory"> <span class="icon-archive"></span> <?php echo $displayData['title']; ?> </a> PK���\FҪL�� layouts/joomla/toolbar/batch.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.core'); $title = $displayData['title']; $message = JText::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'); $message = addslashes($message); ?> <button data-toggle="modal" onclick="if (document.adminForm.boxchecked.value==0){alert('<?php echo $message; ?>'); }else{jQuery( '#collapseModal' ).modal('show'); return true;}" class="btn btn-small"> <span class="icon-checkbox-partial" title="<?php echo $title; ?>"></span> <?php echo $title; ?> </button> PK���\zs�)layouts/joomla/toolbar/containerclose.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> </div> PK���\؛�"layouts/joomla/toolbar/confirm.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.core'); $doTask = $displayData['doTask']; $class = $displayData['class']; $text = $displayData['text']; ?> <button onclick="<?php echo $doTask; ?>" class="btn btn-small"> <span class="<?php echo $class; ?>"></span> <?php echo $text; ?> </button> PK���\���UU#layouts/joomla/toolbar/standard.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.core'); $doTask = $displayData['doTask']; $class = $displayData['class']; $text = $displayData['text']; $btnClass = $displayData['btnClass']; ?> <button onclick="<?php echo $doTask; ?>" class="<?php echo $btnClass; ?>"> <span class="<?php echo trim($class); ?>"></span> <?php echo $text; ?> </button> PK���\�P�Uyy layouts/joomla/toolbar/popup.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.core'); $doTask = $displayData['doTask']; $class = $displayData['class']; $text = $displayData['text']; $name = $displayData['name']; ?> <button value="<?php echo $doTask; ?>" class="btn btn-small modal" data-toggle="modal" data-target="#modal-<?php echo $name; ?>"> <span class="<?php echo $class; ?>"></span> <?php echo $text; ?> </button> PK���\��c��layouts/joomla/toolbar/help.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.core'); $doTask = $displayData['doTask']; $text = $displayData['text']; ?> <button onclick="<?php echo $doTask; ?>" rel="help" class="btn btn-small"> <span class="icon-question-sign"></span> <?php echo $text; ?> </button> PK���\�0KK(layouts/joomla/toolbar/containeropen.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="btn-toolbar" id="<?php echo $displayData['id']; ?>"> PK���\��Kkttlayouts/joomla/toolbar/base.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="btn-wrapper" <?php echo $displayData['id']; ?>> <?php echo $displayData['action']; ?> </div> PK���\p�`�� layouts/joomla/toolbar/title.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $icon = empty($displayData['icon']) ? 'generic' : preg_replace('#\.[^ .]*$#', '', $displayData['icon']); ?> <h1 class="page-title"> <span class="icon-<?php echo $icon; ?>"></span> <?php echo $displayData['title']; ?> </h1> PK���\�%�< layouts/joomla/toolbar/link.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $doTask = $displayData['doTask']; $class = $displayData['class']; $text = $displayData['text']; ?> <button onclick="location.href='<?php echo $doTask; ?>';" class="btn btn-small"> <span class="<?php echo $class; ?>"></span> <?php echo $text; ?> </button> PK���\�1d33$layouts/joomla/toolbar/iconclass.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> icon-<?php echo $displayData['icon']; ?> PK���\�s���#layouts/joomla/form/renderlabel.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Layout variables * --------------------- * $text : (string) The label text * $description : (string) An optional description to use in a tooltip * $for : (string) The id of the input this label is for * $required : (boolean) True if a required field * $classes : (array) A list of classes * $position : (string) The tooltip position. Bottom for alias */ $text = $displayData['text']; $desc = $displayData['description']; $for = $displayData['for']; $req = $displayData['required']; $classes = array_filter((array) $displayData['classes']); $position = $displayData['position']; $id = $for . '-lbl'; $title = ''; // If a description is specified, use it to build a tooltip. if (!empty($desc)) { JHtml::_('bootstrap.tooltip'); $classes[] = 'hasTooltip'; $title = ' title="' . JHtml::tooltipText(trim($text, ':'), $desc, 0) . '"'; } // If required, there's a class for that. if ($req) { $classes[] = 'required'; } ?> <label id="<?php echo $id; ?>" for="<?php echo $for; ?>" class="<?php echo implode(' ', $classes); ?>"<?php echo $title; ?><?php echo $position; ?>> <?php echo $text; ?><?php if ($req) : ?><span class="star"> *</span><?php endif; ?> </label>PK���\��]��#layouts/joomla/form/renderfield.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Layout variables * --------------------- * $options : (array) Optional parameters * $label : (string) The html code for the label (not required if $options['hiddenLabel'] is true) * $input : (string) The input field html code */ if (!empty($displayData['options']['showonEnabled'])) { JHtml::_('jquery.framework'); JHtml::_('script', 'jui/cms.js', false, true); } $class = empty($displayData['options']['class']) ? "" : " " . $displayData['options']['class']; $rel = empty($displayData['options']['rel']) ? "" : " " . $displayData['options']['rel']; ?> <div class="control-group<?php echo $class; ?>"<?php echo $rel; ?>> <?php if (empty($displayData['options']['hiddenLabel'])) : ?> <div class="control-label"><?php echo $displayData['label']; ?></div> <?php endif; ?> <div class="controls"><?php echo $displayData['input']; ?></div> </div> PK���\%��<``layouts/joomla/edit/details.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * @deprecated 3.2 */ defined('_JEXEC') or die; $app = JFactory::getApplication(); // JLayout for standard handling of the details sidebar in administrator edit screens. $title = $displayData->getForm()->getValue('title'); $published = $displayData->getForm()->getField('published'); $saveHistory = $displayData->get('state')->get('params')->get('save_history', 0); ?> <div class="span2"> <h4><?php echo JText::_('JDETAILS'); ?></h4> <hr /> <fieldset class="form-vertical"> <?php if (empty($title)) : ?> <div class="control-group"> <div class="controls"> <?php echo $displayData->getForm()->getValue('name'); ?> </div> </div> <?php else : ?> <div class="control-group"> <div class="controls"> <?php echo $displayData->getForm()->getValue('title'); ?> </div> </div> <?php endif; ?> <?php if ($published) : ?> <?php echo $displayData->getForm()->renderField('published'); ?> <?php else : ?> <?php echo $displayData->getForm()->renderField('state'); ?> <?php endif; ?> <?php echo $displayData->getForm()->renderField('access'); ?> <?php echo $displayData->getForm()->renderField('featured'); ?> <?php if (JLanguageMultilang::isEnabled()) : ?> <?php echo $displayData->getForm()->renderField('language'); ?> <?php else : ?> <input type="hidden" id="jform_language" name="jform[language]" value="<?php echo $displayData->getForm()->getValue('language'); ?>" /> <?php endif; ?> <?php echo $displayData->getForm()->renderField('tags'); ?> <?php if ($saveHistory) : ?> <?php echo $displayData->getForm()->renderField('version_note'); ?> <?php endif; ?> </fieldset> </div> PK���\��ҕ��&layouts/joomla/edit/publishingdata.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( 'publish_up', 'publish_down', array('created', 'created_time'), array('created_by', 'created_user_id'), 'created_by_alias', array('modified', 'modified_time'), array('modified_by', 'modified_user_id'), 'version', 'hits', 'id' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); foreach ($fields as $field) { $field = is_array($field) ? $field : array($field); foreach ($field as $f) { if ($form->getField($f)) { if (in_array($f, $hiddenFields)) { $form->setFieldAttribute($f, 'type', 'hidden'); } echo $form->renderField($f); break; } } } PK���\���a� � ,layouts/joomla/edit/frontediting_modules.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // JLayout for standard handling of the edit modules: $moduleHtml =& $displayData['moduleHtml']; $mod = $displayData['module']; $position = $displayData['position']; $menusEditing = $displayData['menusediting']; $parameters = JComponentHelper::getParams('com_modules'); $redirectUri = '&return=' . urlencode(base64_encode(JUri::getInstance()->toString())); $target = '_blank'; if (preg_match('/<(?:div|span|nav|ul|ol|h\d) [^>]*class="[^"]* jmoddiv"/', $moduleHtml)) { // Module has already module edit button: return; } // Add css class jmoddiv and data attributes for module-editing URL and for the tooltip: $editUrl = JUri::base() . 'administrator/index.php?option=com_modules&view=module&layout=edit&id=' . (int) $mod->id; if ($parameters->get('redirect_edit', 'site') == 'site') { $editUrl = JUri::base() . 'index.php?option=com_config&controller=config.display.modules&id=' . (int) $mod->id . $redirectUri; $target = '_self'; } // Add class, editing URL and tooltip, and if module of type menu, also the tooltip for editing the menu item: $count = 0; $moduleHtml = preg_replace( // Replace first tag of module with a class '/^(\s*<(?:div|span|nav|ul|ol|h\d) [^>]*class="[^"]*)"/', // By itself, adding class jmoddiv and data attributes for the url and tooltip: '\\1 jmoddiv" data-jmodediturl="' . $editUrl . '" data-target="' . $target . '" data-jmodtip="' . JHtml::tooltipText( JText::_('JLIB_HTML_EDIT_MODULE'), htmlspecialchars($mod->title) . '<br />' . sprintf(JText::_('JLIB_HTML_EDIT_MODULE_IN_POSITION'), htmlspecialchars($position)), 0 ) . '"' // And if menu editing is enabled and allowed and it's a menu module, add data attributes for menu editing: . ($menusEditing && $mod->module == 'mod_menu' ? '" data-jmenuedittip="' . JHtml::tooltipText('JLIB_HTML_EDIT_MENU_ITEM', 'JLIB_HTML_EDIT_MENU_ITEM_ID') . '"' : '' ), $moduleHtml, 1, $count ); if ($count) { // Load once booststrap tooltip and add stylesheet and javascript to head: JHtml::_('bootstrap.tooltip'); JHtml::_('bootstrap.popover'); JHtml::_('stylesheet', 'system/frontediting.css', array(), true); JHtml::_('script', 'system/frontediting.js', false, true); } PK���\���#layouts/joomla/edit/title_alias.phpnu�[���<?php /** * @package Joomla.Cms * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; $form = $displayData->getForm(); $title = $form->getField('title') ? 'title' : ($form->getField('name') ? 'name' : ''); ?> <div class="form-inline form-inline-header"> <?php echo $title ? $form->renderField($title) : ''; echo $form->renderField('alias'); ?> </div> PK���\�&*�"layouts/joomla/edit/item_title.phpnu�[���<?php /** * @package Joomla.Cms * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * @deprecated 3.2 */ defined('JPATH_BASE') or die; $title = $displayData->getForm()->getValue('title'); $name = $displayData->getForm()->getValue('name'); ?> <?php if ($title) : ?> <h4><?php echo $title; ?></h4> <?php endif; ?> <?php if ($name) : ?> <h4><?php echo $name; ?></h4> <?php endif; PK���\g,��$layouts/joomla/edit/associations.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // JLayout for standard handling of associations fields in the administrator items edit screens. echo $displayData->getForm()->renderFieldset('item_associations'); PK���\j��ww layouts/joomla/edit/fieldset.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $form = $displayData->getForm(); $name = $displayData->get('fieldset'); $fieldSet = $form->getFieldset($name); if (empty($fieldSet)) { return; } $ignoreFields = $displayData->get('ignore_fields') ? : array(); $extraFields = $displayData->get('extra_fields') ? : array(); if ($displayData->get('show_options', 1)) { if (isset($extraFields[$name])) { foreach ($extraFields[$name] as $f) { if (in_array($f, $ignoreFields)) { continue; } if ($form->getField($f)) { $fieldSet[] = $form->getField($f); } } } $html = array(); foreach ($fieldSet as $field) { $html[] = $field->renderField(); } echo implode('', $html); } else { $html = array(); $html[] = '<div style="display:none;">'; foreach ($fieldSet as $field) { $html[] = $field->input; } $html[] = '</div>'; echo implode('', $html); } PK���\2�#� � layouts/joomla/edit/params.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $form = $displayData->getForm(); $fieldSets = $form->getFieldsets(); if (empty($fieldSets)) { return; } $ignoreFieldsets = $displayData->get('ignore_fieldsets') ?: array(); $ignoreFields = $displayData->get('ignore_fields') ?: array(); $extraFields = $displayData->get('extra_fields') ?: array(); if (!empty($displayData->hiddenFieldsets)) { // These are required to preserve data on save when fields are not displayed. $hiddenFieldsets = $displayData->hiddenFieldsets ?: array(); } if (!empty($displayData->configFieldsets)) { // These are required to configure showing and hiding fields in the editor. $configFieldsets = $displayData->configFieldsets ?: array(); } if ($displayData->get('show_options', 1)) { foreach ($fieldSets as $name => $fieldSet) { // Ensure any fieldsets we don't want to show are skipped (including repeating formfield fieldsets) if (in_array($name, $ignoreFieldsets) || (!empty($configFieldsets) && in_array($name, $configFieldsets)) || !empty($hiddenFieldsets) && in_array($name, $hiddenFieldsets) || (isset($fieldSet->repeat) && $fieldSet->repeat == true) ) { continue; } if (!empty($fieldSet->label)) { $label = JText::_($fieldSet->label, true); } else { $label = strtoupper('JGLOBAL_FIELDSET_' . $name); if (JText::_($label, true) == $label) { $label = strtoupper($app->input->get('option') . '_' . $name . '_FIELDSET_LABEL'); } $label = JText::_($label, true); } echo JHtml::_('bootstrap.addTab', 'myTab', 'attrib-' . $name, $label); if (isset($fieldSet->description) && trim($fieldSet->description)) { echo '<p class="alert alert-info">' . $this->escape(JText::_($fieldSet->description)) . '</p>'; } $displayData->fieldset = $name; echo JLayoutHelper::render('joomla.edit.fieldset', $displayData); echo JHtml::_('bootstrap.endTab'); } } else { $html = array(); $html[] = '<div style="display:none;">'; foreach ($fieldSets as $name => $fieldSet) { if (in_array($name, $ignoreFieldsets)) { continue; } if (in_array($name, $hiddenFieldsets)) { foreach ($form->getFieldset($name) as $field) { echo $field->input; } } } $html[] = '</div>'; echo implode('', $html); } PK���\B:}�"" layouts/joomla/edit/metadata.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $form = $displayData->getForm(); // JLayout for standard handling of metadata fields in the administrator content edit screens. $fieldSets = $form->getFieldsets('metadata'); ?> <?php foreach ($fieldSets as $name => $fieldSet) : ?> <?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?> <p class="alert alert-info"><?php echo $this->escape(JText::_($fieldSet->description)); ?></p> <?php endif; ?> <?php // Include the real fields in this panel. if ($name == 'jmetadata') { echo $form->renderField('metadesc'); echo $form->renderField('metakey'); echo $form->renderField('xreference'); } foreach ($form->getFieldset($name) as $field) { if ($field->name != 'jform[metadata][tags][]') { echo $field->renderField(); } } ?> <?php endforeach; ?> PK���\��b��layouts/joomla/edit/global.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $form = $displayData->getForm(); $input = $app->input; $component = $input->getCmd('option', 'com_content'); if ($component == 'com_categories') { $extension = $input->getCmd('extension', 'com_content'); $parts = explode('.', $extension); $component = $parts[0]; } $saveHistory = JComponentHelper::getParams($component)->get('save_history', 0); $fields = $displayData->get('fields') ?: array( array('parent', 'parent_id'), array('published', 'state', 'enabled'), array('category', 'catid'), 'featured', 'sticky', 'access', 'language', 'tags', 'note', 'version_note', ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); if (!$saveHistory) { $hiddenFields[] = 'version_note'; } $html = array(); $html[] = '<fieldset class="form-vertical">'; foreach ($fields as $field) { $field = is_array($field) ? $field : array($field); foreach ($field as $f) { if ($form->getField($f)) { if (in_array($f, $hiddenFields)) { $form->setFieldAttribute($f, 'type', 'hidden'); } $html[] = $form->renderField($f); break; } } } $html[] = '</fieldset>'; echo implode('', $html); PK���\����gg)layouts/joomla/editors/buttons/button.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $button = $displayData; ?> <?php if ($button->get('name')) : ?> <?php $class = ($button->get('class')) ? $button->get('class') : null; $class .= ($button->get('modal')) ? ' modal-button' : null; $href = ($button->get('link')) ? ' href="' . JUri::base() . $button->get('link') . '"' : null; $onclick = ($button->get('onclick')) ? ' onclick="' . $button->get('onclick') . '"' : ''; $title = ($button->get('title')) ? $button->get('title') : $button->get('text'); // Load modal popup behavior if ($button->get('modal')) { JHtml::_('behavior.modal', 'a.modal-button'); } ?> <a class="<?php echo $class; ?>" title="<?php echo $title; ?>" <?php echo $href, $onclick; ?> rel="<?php echo $button->get('options'); ?>"> <span class="icon-<?php echo $button->get('name'); ?>"></span> <?php echo $button->get('text'); ?> </a> <?php endif; PK���\�im&&"layouts/joomla/editors/buttons.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $buttons = $displayData; ?> <div id="editor-xtd-buttons" class="btn-toolbar pull-left"> <?php if ($buttons) : ?> <?php foreach ($buttons as $button) : ?> <?php echo JLayoutHelper::render('joomla.editors.buttons.button', $button); ?> <?php endforeach; ?> <?php endif; ?> </div>PK���\�N���layouts/joomla/modal/footer.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; extract($displayData); /** * Layout variables * ------------------ * @param string $selector Unique DOM identifier for the modal. CSS id without # * @param array $params Modal parameters. Default supported parameters: * - title string The modal title * - backdrop mixed A boolean select if a modal-backdrop element should be included (default = true) * The string 'static' includes a backdrop which doesn't close the modal on click. * - keyboard boolean Closes the modal when escape key is pressed (default = true) * - closeButton boolean Display modal close button (default = true) * - animation boolean Fade in from the top of the page (default = true) * - footer string Optional markup for the modal footer * - url string URL of a resource to be inserted as an <iframe> inside the modal body * - height string height of the <iframe> containing the remote resource * - width string width of the <iframe> containing the remote resource * @param string $body Markup for the modal body. Appended after the <iframe> if the url option is set * */ ?> <div class="modal-footer"> <?php echo $params['footer']; ?> </div> PK���\F��}}layouts/joomla/modal/main.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; extract($displayData); /** * Layout variables * ------------------ * @param string $selector Unique DOM identifier for the modal. CSS id without # * @param array $params Modal parameters. Default supported parameters: * - title string The modal title * - backdrop mixed A boolean select if a modal-backdrop element should be included (default = true) * The string 'static' includes a backdrop which doesn't close the modal on click. * - keyboard boolean Closes the modal when escape key is pressed (default = true) * - closeButton boolean Display modal close button (default = true) * - animation boolean Fade in from the top of the page (default = true) * - footer string Optional markup for the modal footer * - url string URL of a resource to be inserted as an <iframe> inside the modal body * - height string height of the <iframe> containing the remote resource * - width string width of the <iframe> containing the remote resource * @param string $body Markup for the modal body. Appended after the <iframe> if the url option is set * */ $modalClasses = array('modal', 'hide'); if (!isset($params['animation']) || $params['animation']) { array_push($modalClasses, 'fade'); } $modalAttributes = array( 'tabindex' => '-1', 'class' => implode(' ', $modalClasses) ); if (isset($params['backdrop'])) { $modalAttributes['data-backdrop'] = (is_bool($params['backdrop']) ? ($params['backdrop'] ? 'true' : 'false') : $params['backdrop']); } if (isset($params['keyboard'])) { $modalAttributes['data-keyboard'] = (is_bool($params['keyboard']) ? ($params['keyboard'] ? 'true' : 'false') : 'true'); } /** * These lines below are for disabling scrolling of parent window. * $('body').addClass('modal-open'); * $('body').removeClass('modal-open') * * Specific hack for Bootstrap 2.3.x */ $script[] = "jQuery(document).ready(function($) {"; $script[] = " $('#" . $selector . "').on('show', function() {"; $script[] = " $('body').addClass('modal-open');"; if (isset($params['url'])) { $iframeHtml = JLayoutHelper::render('joomla.modal.iframe', $displayData); // Script for destroying and reloading the iframe $script[] = " var modalBody = $(this).find('.modal-body');"; $script[] = " modalBody.find('iframe').remove();"; $script[] = " modalBody.prepend('" . trim($iframeHtml) . "');"; } $script[] = " }).on('hide', function () {"; $script[] = " $('body').removeClass('modal-open');"; $script[] = " });"; $script[] = "});"; JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); ?> <div id="<?php echo $selector; ?>" <?php echo JArrayHelper::toString($modalAttributes); ?>> <?php // Header if (!isset($params['closeButton']) || isset($params['title']) || $params['closeButton']) { echo JLayoutHelper::render('joomla.modal.header', $displayData); } // Body echo JLayoutHelper::render('joomla.modal.body', $displayData); // Footer if (isset($params['footer'])) { echo JLayoutHelper::render('joomla.modal.footer', $displayData); } ?> </div> PK���\M{�y��layouts/joomla/modal/body.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; extract($displayData); /** * Layout variables * ------------------ * @param string $selector Unique DOM identifier for the modal. CSS id without # * @param array $params Modal parameters. Default supported parameters: * - title string The modal title * - backdrop mixed A boolean select if a modal-backdrop element should be included (default = true) * The string 'static' includes a backdrop which doesn't close the modal on click. * - keyboard boolean Closes the modal when escape key is pressed (default = true) * - closeButton boolean Display modal close button (default = true) * - animation boolean Fade in from the top of the page (default = true) * - footer string Optional markup for the modal footer * - url string URL of a resource to be inserted as an <iframe> inside the modal body * - height string height of the <iframe> containing the remote resource * - width string width of the <iframe> containing the remote resource * @param string $body Markup for the modal body. Appended after the <iframe> if the url option is set * */ ?> <div class="modal-body"> <?php echo $body; ?> </div> PK���\V�A���layouts/joomla/modal/header.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; extract($displayData); /** * Layout variables * ------------------ * @param string $selector Unique DOM identifier for the modal. CSS id without # * @param array $params Modal parameters. Default supported parameters: * - title string The modal title * - backdrop mixed A boolean select if a modal-backdrop element should be included (default = true) * The string 'static' includes a backdrop which doesn't close the modal on click. * - keyboard boolean Closes the modal when escape key is pressed (default = true) * - closeButton boolean Display modal close button (default = true) * - animation boolean Fade in from the top of the page (default = true) * - footer string Optional markup for the modal footer * - url string URL of a resource to be inserted as an <iframe> inside the modal body * - height string height of the <iframe> containing the remote resource * - width string width of the <iframe> containing the remote resource * @param string $body Markup for the modal body. Appended after the <iframe> if the url option is set * */ ?> <div class="modal-header"> <?php if (!isset($params['closeButton']) || $params['closeButton']) : ?> <button type="button" class="close" data-dismiss="modal">×</button> <?php endif; ?> <?php if (isset($params['title'])) : ?> <h3><?php echo $params['title']; ?></h3> <?php endif; ?> </div> PK���\�,c�JJlayouts/joomla/modal/iframe.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; extract($displayData); /** * Layout variables * ------------------ * @param string $selector Unique DOM identifier for the modal. CSS id without # * @param array $params Modal parameters. Default supported parameters: * - title string The modal title * - backdrop mixed A boolean select if a modal-backdrop element should be included (default = true) * The string 'static' includes a backdrop which doesn't close the modal on click. * - keyboard boolean Closes the modal when escape key is pressed (default = true) * - closeButton boolean Display modal close button (default = true) * - animation boolean Fade in from the top of the page (default = true) * - footer string Optional markup for the modal footer * - url string URL of a resource to be inserted as an <iframe> inside the modal body * - height string height of the <iframe> containing the remote resource * - width string width of the <iframe> containing the remote resource * @param string $body Markup for the modal body. Appended after the <iframe> if the url option is set * */ $iframeAttributes = array( 'class' => 'iframe', 'src' => $params['url'] ); if (isset($params['title'])) { $iframeAttributes['name'] = $params['title']; } if (isset($params['height'])) { $iframeAttributes['height'] = $params['height']; } if (isset($params['width'])) { $iframeAttributes['width'] = $params['width']; } ?> <iframe <?php echo JArrayHelper::toString($iframeAttributes); ?>></iframe> PK���\��l��+layouts/plugins/user/profile/fields/dob.phpnu�[���<?php /** * @package Joomla.Site * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * $text string infotext to be displayed */ extract($displayData); // Closing the opening .control-group and .control-label div so we can add our info text on own line ?> </div></div> <div class="controls"><?php echo $text; ?></div> <?php // Creating new .control-group and .control-label for the actual field ?> <div class="control-group"><div class="control-label"> PK���\��6wwlibraries/fof/encrypt/aes.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage encrypt * @copyright Copyright (C) 2010 - 2015 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; /** * A simple implementation of AES-128, AES-192 and AES-256 encryption using the * high performance mcrypt library. * * @package FrameworkOnFramework * @since 1.0 */ class FOFEncryptAes { /** @var string The AES cipher to use (this is an mcrypt identifier, not the bit strength) */ private $_cipherType = 0; /** @var string Cipher mode. Can be CBC or ECB. We recommend using CBC */ private $_cipherMode = 0; /** @var string The cipher key (password) */ private $_keyString = ''; /** * Initialise the AES encryption object * * @param string $key The encryption key (password). It can be a raw key (32 bytes) or a passphrase. * @param int $strength Bit strength (128, 192 or 256) * @param string $mode Ecnryption mode. Can be ebc or cbc. We recommend using cbc. */ public function __construct($key, $strength = 256, $mode = 'cbc') { $this->_keyString = $key; switch ($strength) { case 256: default: $this->_cipherType = MCRYPT_RIJNDAEL_256; break; case 192: $this->_cipherType = MCRYPT_RIJNDAEL_192; break; case 128: $this->_cipherType = MCRYPT_RIJNDAEL_128; break; } switch (strtoupper($mode)) { case 'ECB': $this->_cipherMode = MCRYPT_MODE_ECB; break; case 'CBC': $this->_cipherMode = MCRYPT_MODE_CBC; break; } } /** * Encrypts a string using AES * * @param string $stringToEncrypt The plaintext to encrypt * @param bool $base64encoded Should I Base64-encode the result? * * @return string The cryptotext. Please note that the first 16 bytes of * the raw string is the IV (initialisation vector) which * is necessary for decoding the string. */ public function encryptString($stringToEncrypt, $base64encoded = true) { if (strlen($this->_keyString) != 32) { $key = hash('sha256', $this->_keyString, true); } else { $key = $this->_keyString; } // Set up the IV (Initialization Vector) $iv_size = mcrypt_get_iv_size($this->_cipherType, $this->_cipherMode); $iv = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM); if (empty($iv)) { $iv = mcrypt_create_iv($iv_size, MCRYPT_DEV_RANDOM); } if (empty($iv)) { $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); } // Encrypt the data $cipherText = mcrypt_encrypt($this->_cipherType, $key, $stringToEncrypt, $this->_cipherMode, $iv); // Prepend the IV to the ciphertext $cipherText = $iv . $cipherText; // Optionally pass the result through Base64 encoding if ($base64encoded) { $cipherText = base64_encode($cipherText); } // Return the result return $cipherText; } /** * Decrypts a ciphertext into a plaintext string using AES * * @param string $stringToDecrypt The ciphertext to decrypt. The first 16 bytes of the raw string must contain the IV (initialisation vector). * @param bool $base64encoded Should I Base64-decode the data before decryption? * * @return string The plain text string */ public function decryptString($stringToDecrypt, $base64encoded = true) { if (strlen($this->_keyString) != 32) { $key = hash('sha256', $this->_keyString, true); } else { $key = $this->_keyString; } if ($base64encoded) { $stringToDecrypt = base64_decode($stringToDecrypt); } // Calculate the IV size $iv_size = mcrypt_get_iv_size($this->_cipherType, $this->_cipherMode); // Extract IV $iv = substr($stringToDecrypt, 0, $iv_size); $stringToDecrypt = substr($stringToDecrypt, $iv_size); // Decrypt the data $plainText = mcrypt_decrypt($this->_cipherType, $key, $stringToDecrypt, $this->_cipherMode, $iv); return $plainText; } /** * Is AES encryption supported by this PHP installation? * * @return boolean */ public static function isSupported() { if (!function_exists('mcrypt_get_key_size')) { return false; } if (!function_exists('mcrypt_get_iv_size')) { return false; } if (!function_exists('mcrypt_create_iv')) { return false; } if (!function_exists('mcrypt_encrypt')) { return false; } if (!function_exists('mcrypt_decrypt')) { return false; } if (!function_exists('mcrypt_list_algorithms')) { return false; } if (!function_exists('hash')) { return false; } if (!function_exists('hash_algos')) { return false; } if (!function_exists('base64_encode')) { return false; } if (!function_exists('base64_decode')) { return false; } $algorightms = mcrypt_list_algorithms(); if (!in_array('rijndael-128', $algorightms)) { return false; } if (!in_array('rijndael-192', $algorightms)) { return false; } if (!in_array('rijndael-256', $algorightms)) { return false; } $algorightms = hash_algos(); if (!in_array('sha256', $algorightms)) { return false; } return true; } } PK���\[$�5GG libraries/fof/encrypt/base32.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage encrypt * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * FOFEncryptBase32 * * @package FrameworkOnFramework * @since 1.0 */ class FOFEncryptBase32 { /** * CSRFC3548 * * The character set as defined by RFC3548 * @link http://www.ietf.org/rfc/rfc3548.txt */ const CSRFC3548 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'; /** * str2bin * * Converts any ascii string to a binary string * * @param string $str The string you want to convert * * @return string String of 0's and 1's */ private function str2bin($str) { $chrs = unpack('C*', $str); return vsprintf(str_repeat('%08b', count($chrs)), $chrs); } /** * bin2str * * Converts a binary string to an ascii string * * @param string $str The string of 0's and 1's you want to convert * * @return string The ascii output * * @throws Exception */ private function bin2str($str) { if (strlen($str) % 8 > 0) { throw new Exception('Length must be divisible by 8'); } if (!preg_match('/^[01]+$/', $str)) { throw new Exception('Only 0\'s and 1\'s are permitted'); } preg_match_all('/.{8}/', $str, $chrs); $chrs = array_map('bindec', $chrs[0]); // I'm just being slack here array_unshift($chrs, 'C*'); return call_user_func_array('pack', $chrs); } /** * fromBin * * Converts a correct binary string to base32 * * @param string $str The string of 0's and 1's you want to convert * * @return string String encoded as base32 * * @throws exception */ private function fromBin($str) { if (strlen($str) % 8 > 0) { throw new Exception('Length must be divisible by 8'); } if (!preg_match('/^[01]+$/', $str)) { throw new Exception('Only 0\'s and 1\'s are permitted'); } // Base32 works on the first 5 bits of a byte, so we insert blanks to pad it out $str = preg_replace('/(.{5})/', '000$1', $str); // We need a string divisible by 5 $length = strlen($str); $rbits = $length & 7; if ($rbits > 0) { // Excessive bits need to be padded $ebits = substr($str, $length - $rbits); $str = substr($str, 0, $length - $rbits); $str .= "000$ebits" . str_repeat('0', 5 - strlen($ebits)); } preg_match_all('/.{8}/', $str, $chrs); $chrs = array_map(array($this, '_mapcharset'), $chrs[0]); return join('', $chrs); } /** * toBin * * Accepts a base32 string and returns an ascii binary string * * @param string $str The base32 string to convert * * @return string Ascii binary string * * @throws Exception */ private function toBin($str) { if (!preg_match('/^[' . self::CSRFC3548 . ']+$/', $str)) { throw new Exception('Must match character set'); } // Convert the base32 string back to a binary string $str = join('', array_map(array($this, '_mapbin'), str_split($str))); // Remove the extra 0's we added $str = preg_replace('/000(.{5})/', '$1', $str); // Unpad if nessicary $length = strlen($str); $rbits = $length & 7; if ($rbits > 0) { $str = substr($str, 0, $length - $rbits); } return $str; } /** * fromString * * Convert any string to a base32 string * This should be binary safe... * * @param string $str The string to convert * * @return string The converted base32 string */ public function encode($str) { return $this->fromBin($this->str2bin($str)); } /** * toString * * Convert any base32 string to a normal sctring * This should be binary safe... * * @param string $str The base32 string to convert * * @return string The normal string */ public function decode($str) { $str = strtoupper($str); return $this->bin2str($this->tobin($str)); } /** * _mapcharset * * Used with array_map to map the bits from a binary string * directly into a base32 character set * * @param string $str The string of 0's and 1's you want to convert * * @return string Resulting base32 character * * @access private */ private function _mapcharset($str) { // Huh! $x = self::CSRFC3548; return $x[bindec($str)]; } /** * _mapbin * * Used with array_map to map the characters from a base32 * character set directly into a binary string * * @param string $chr The caracter to map * * @return string String of 0's and 1's * * @access private */ private function _mapbin($chr) { return sprintf('%08b', strpos(self::CSRFC3548, $chr)); } } PK���\k�-CClibraries/fof/encrypt/totp.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage encrypt * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * This class provides an RFC6238-compliant Time-based One Time Passwords, * compatible with Google Authenticator (with PassCodeLength = 6 and TimePeriod = 30). * * @package FrameworkOnFramework * @since 1.0 */ class FOFEncryptTotp { private $_passCodeLength = 6; private $_pinModulo; private $_secretLength = 10; private $_timeStep = 30; private $_base32 = null; /** * Initialises an RFC6238-compatible TOTP generator. Please note that this * class does not implement the constraint in the last paragraph of §5.2 * of RFC6238. It's up to you to ensure that the same user/device does not * retry validation within the same Time Step. * * @param int $timeStep The Time Step (in seconds). Use 30 to be compatible with Google Authenticator. * @param int $passCodeLength The generated passcode length. Default: 6 digits. * @param int $secretLength The length of the secret key. Default: 10 bytes (80 bits). * @param Object $base32 The base32 en/decrypter */ public function __construct($timeStep = 30, $passCodeLength = 6, $secretLength = 10, $base32=null) { $this->_timeStep = $timeStep; $this->_passCodeLength = $passCodeLength; $this->_secretLength = $secretLength; $this->_pinModulo = pow(10, $this->_passCodeLength); if (is_null($base32)) { $this->_base32 = new FOFEncryptBase32; } else { $this->_base32 = $base32; } } /** * Get the time period based on the $time timestamp and the Time Step * defined. If $time is skipped or set to null the current timestamp will * be used. * * @param int|null $time Timestamp * * @return int The time period since the UNIX Epoch */ public function getPeriod($time = null) { if (is_null($time)) { $time = time(); } $period = floor($time / $this->_timeStep); return $period; } /** * Check is the given passcode $code is a valid TOTP generated using secret * key $secret * * @param string $secret The Base32-encoded secret key * @param string $code The passcode to check * * @return boolean True if the code is valid */ public function checkCode($secret, $code) { $time = $this->getPeriod(); for ($i = -1; $i <= 1; $i++) { if ($this->getCode($secret, ($time + $i) * $this->_timeStep) == $code) { return true; } } return false; } /** * Gets the TOTP passcode for a given secret key $secret and a given UNIX * timestamp $time * * @param string $secret The Base32-encoded secret key * @param int $time UNIX timestamp * * @return string */ public function getCode($secret, $time = null) { $period = $this->getPeriod($time); $secret = $this->_base32->decode($secret); $time = pack("N", $period); $time = str_pad($time, 8, chr(0), STR_PAD_LEFT); $hash = hash_hmac('sha1', $time, $secret, true); $offset = ord(substr($hash, -1)); $offset = $offset & 0xF; $truncatedHash = $this->hashToInt($hash, $offset) & 0x7FFFFFFF; $pinValue = str_pad($truncatedHash % $this->_pinModulo, $this->_passCodeLength, "0", STR_PAD_LEFT); return $pinValue; } /** * Extracts a part of a hash as an integer * * @param string $bytes The hash * @param string $start The char to start from (0 = first char) * * @return string */ protected function hashToInt($bytes, $start) { $input = substr($bytes, $start, strlen($bytes) - $start); $val2 = unpack("N", substr($input, 0, 4)); return $val2[1]; } /** * Returns a QR code URL for easy setup of TOTP apps like Google Authenticator * * @param string $user User * @param string $hostname Hostname * @param string $secret Secret string * * @return string */ public function getUrl($user, $hostname, $secret) { $url = sprintf("otpauth://totp/%s@%s?secret=%s", $user, $hostname, $secret); $encoder = "https://chart.googleapis.com/chart?chs=200x200&chld=Q|2&cht=qr&chl="; $encoderURL = $encoder . urlencode($url); return $encoderURL; } /** * Generates a (semi-)random Secret Key for TOTP generation * * @return string */ public function generateSecret() { $secret = ""; for ($i = 1; $i <= $this->_secretLength; $i++) { $c = rand(0, 255); $secret .= pack("c", $c); } $base32 = new FOFEncryptBase32; return $this->_base32->encode($secret); } } PK���\�n�;= = $libraries/fof/download/interface.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage dispatcher * @copyright Copyright (C) 2010 - 2015 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; interface FOFDownloadInterface { /** * Does this download adapter support downloading files in chunks? * * @return boolean True if chunk download is supported */ public function supportsChunkDownload(); /** * Does this download adapter support reading the size of a remote file? * * @return boolean True if remote file size determination is supported */ public function supportsFileSize(); /** * Is this download class supported in the current server environment? * * @return boolean True if this server environment supports this download class */ public function isSupported(); /** * Get the priority of this adapter. If multiple download adapters are * supported on a site, the one with the highest priority will be * used. * * @return boolean */ public function getPriority(); /** * Returns the name of this download adapter in use * * @return string */ public function getName(); /** * Download a part (or the whole) of a remote URL and return the downloaded * data. You are supposed to check the size of the returned data. If it's * smaller than what you expected you've reached end of file. If it's empty * you have tried reading past EOF. If it's larger than what you expected * the server doesn't support chunk downloads. * * If this class' supportsChunkDownload returns false you should assume * that the $from and $to parameters will be ignored. * * @param string $url The remote file's URL * @param integer $from Byte range to start downloading from. Use null for start of file. * @param integer $to Byte range to stop downloading. Use null to download the entire file ($from is ignored) * @param array $params Additional params that will be added before performing the download * * @return string The raw file data retrieved from the remote URL. * * @throws Exception A generic exception is thrown on error */ public function downloadAndReturn($url, $from = null, $to = null, array $params = array()); /** * Get the size of a remote file in bytes * * @param string $url The remote file's URL * * @return integer The file size, or -1 if the remote server doesn't support this feature */ public function getFileSize($url); }PK���\��PX/X/#libraries/fof/download/download.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage dispatcher * @copyright Copyright (C) 2010 - 2015 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; class FOFDownload { /** * Parameters passed from the GUI when importing from URL * * @var array */ private $params = array(); /** * The download adapter which will be used by this class * * @var FOFDownloadInterface */ private $adapter = null; /** * Additional params that will be passed to the adapter while performing the download * * @var array */ private $adapterOptions = array(); /** * Creates a new download object and assigns it the most fitting download adapter */ public function __construct() { // Find the best fitting adapter $allAdapters = self::getFiles(__DIR__ . '/adapter', array(), array('abstract.php')); $priority = 0; foreach ($allAdapters as $adapterInfo) { if (!class_exists($adapterInfo['classname'], true)) { continue; } /** @var FOFDownloadAdapterAbstract $adapter */ $adapter = new $adapterInfo['classname']; if ( !$adapter->isSupported()) { continue; } if ($adapter->priority > $priority) { $this->adapter = $adapter; $priority = $adapter->priority; } } // Load the language strings FOFPlatform::getInstance()->loadTranslations('lib_fof'); } /** * Forces the use of a specific adapter * * @param string $className The name of the class or the name of the adapter, e.g. 'FOFDownloadAdapterCurl' or * 'curl' */ public function setAdapter($className) { $adapter = null; if (class_exists($className, true)) { $adapter = new $className; } elseif (class_exists('FOFDownloadAdapter' . ucfirst($className))) { $className = 'FOFDownloadAdapter' . ucfirst($className); $adapter = new $className; } if (is_object($adapter) && ($adapter instanceof FOFDownloadInterface)) { $this->adapter = $adapter; } } /** * Returns the name of the current adapter * * @return string */ public function getAdapterName() { if(is_object($this->adapter)) { $class = get_class($this->adapter); return strtolower(str_ireplace('FOFDownloadAdapter', '', $class)); } return ''; } /** * Sets the additional options for the adapter * * @param array $options */ public function setAdapterOptions(array $options) { $this->adapterOptions = $options; } /** * Returns the additional options for the adapter * * @return array */ public function getAdapterOptions() { return $this->adapterOptions; } /** * Used to decode the $params array * * @param string $key The parameter key you want to retrieve the value for * @param mixed $default The default value, if none is specified * * @return mixed The value for this parameter key */ private function getParam($key, $default = null) { if (array_key_exists($key, $this->params)) { return $this->params[$key]; } else { return $default; } } /** * Download data from a URL and return it * * @param string $url The URL to download from * * @return bool|string The downloaded data or false on failure */ public function getFromURL($url) { try { return $this->adapter->downloadAndReturn($url, null, null, $this->adapterOptions); } catch (Exception $e) { return false; } } /** * Performs the staggered download of file. The downloaded file will be stored in Joomla!'s temp-path using the * basename of the URL as a filename * * The $params array can have any of the following keys * url The file being downloaded * frag Rolling counter of the file fragment being downloaded * totalSize The total size of the file being downloaded, in bytes * doneSize How many bytes we have already downloaded * maxExecTime Maximum execution time downloading file fragments, in seconds * length How many bytes to download at once * * The array returned is in the following format: * * status True if there are no errors, false if there are errors * error A string with the error message if there are errors * frag The next file fragment to download * totalSize The total size of the downloaded file in bytes, if the server supports HEAD requests * doneSize How many bytes have already been downloaded * percent % of the file already downloaded (if totalSize could be determined) * localfile The name of the local file, without the path * * @param array $params A parameters array, as sent by the user interface * * @return array A return status array */ public function importFromURL($params) { $this->params = $params; // Fetch data $url = $this->getParam('url'); $localFilename = $this->getParam('localFilename'); $frag = $this->getParam('frag', -1); $totalSize = $this->getParam('totalSize', -1); $doneSize = $this->getParam('doneSize', -1); $maxExecTime = $this->getParam('maxExecTime', 5); $runTimeBias = $this->getParam('runTimeBias', 75); $length = $this->getParam('length', 1048576); if (empty($localFilename)) { $localFilename = basename($url); if (strpos($localFilename, '?') !== false) { $paramsPos = strpos($localFilename, '?'); $localFilename = substr($localFilename, 0, $paramsPos - 1); } } $tmpDir = JFactory::getConfig()->get('tmp_path', JPATH_ROOT . '/tmp'); $tmpDir = rtrim($tmpDir, '/\\'); // Init retArray $retArray = array( "status" => true, "error" => '', "frag" => $frag, "totalSize" => $totalSize, "doneSize" => $doneSize, "percent" => 0, "localfile" => $localFilename ); try { $timer = new FOFUtilsTimer($maxExecTime, $runTimeBias); $start = $timer->getRunningTime(); // Mark the start of this download $break = false; // Don't break the step // Figure out where on Earth to put that file $local_file = $tmpDir . '/' . $localFilename; while (($timer->getTimeLeft() > 0) && !$break) { // Do we have to initialize the file? if ($frag == -1) { // Currently downloaded size $doneSize = 0; if (@file_exists($local_file)) { @unlink($local_file); } // Delete and touch the output file $fp = @fopen($local_file, 'wb'); if ($fp !== false) { @fclose($fp); } // Init $frag = 0; //debugMsg("-- First frag, getting the file size"); $retArray['totalSize'] = $this->adapter->getFileSize($url); $totalSize = $retArray['totalSize']; } // Calculate from and length $from = $frag * $length; $to = $length + $from - 1; // Try to download the first frag $required_time = 1.0; try { $result = $this->adapter->downloadAndReturn($url, $from, $to, $this->adapterOptions); if ($result === false) { throw new Exception(JText::sprintf('LIB_FOF_DOWNLOAD_ERR_COULDNOTDOWNLOADFROMURL', $url), 500); } } catch (Exception $e) { $result = false; $error = $e->getMessage(); } if ($result === false) { // Failed download if ($frag == 0) { // Failure to download first frag = failure to download. Period. $retArray['status'] = false; $retArray['error'] = $error; //debugMsg("-- Download FAILED"); return $retArray; } else { // Since this is a staggered download, consider this normal and finish $frag = -1; //debugMsg("-- Import complete"); $totalSize = $doneSize; $break = true; } } // Add the currently downloaded frag to the total size of downloaded files if ($result) { $filesize = strlen($result); //debugMsg("-- Successful download of $filesize bytes"); $doneSize += $filesize; // Append the file $fp = @fopen($local_file, 'ab'); if ($fp === false) { //debugMsg("-- Can't open local file $local_file for writing"); // Can't open the file for writing $retArray['status'] = false; $retArray['error'] = JText::sprintf('LIB_FOF_DOWNLOAD_ERR_COULDNOTWRITELOCALFILE', $local_file); return $retArray; } fwrite($fp, $result); fclose($fp); //debugMsg("-- Appended data to local file $local_file"); $frag++; //debugMsg("-- Proceeding to next fragment, frag $frag"); if (($filesize < $length) || ($filesize > $length)) { // A partial download or a download larger than the frag size means we are done $frag = -1; //debugMsg("-- Import complete (partial download of last frag)"); $totalSize = $doneSize; $break = true; } } // Advance the frag pointer and mark the end $end = $timer->getRunningTime(); // Do we predict that we have enough time? $required_time = max(1.1 * ($end - $start), $required_time); if ($required_time > (10 - $end + $start)) { $break = true; } $start = $end; } if ($frag == -1) { $percent = 100; } elseif ($doneSize <= 0) { $percent = 0; } else { if ($totalSize > 0) { $percent = 100 * ($doneSize / $totalSize); } else { $percent = 0; } } // Update $retArray $retArray = array( "status" => true, "error" => '', "frag" => $frag, "totalSize" => $totalSize, "doneSize" => $doneSize, "percent" => $percent, ); } catch (Exception $e) { //debugMsg("EXCEPTION RAISED:"); //debugMsg($e->getMessage()); $retArray['status'] = false; $retArray['error'] = $e->getMessage(); } return $retArray; } /** * This method will crawl a starting directory and get all the valid files * that will be analyzed by __construct. Then it organizes them into an * associative array. * * @param string $path Folder where we should start looking * @param array $ignoreFolders Folder ignore list * @param array $ignoreFiles File ignore list * * @return array Associative array, where the `fullpath` key contains the path to the file, * and the `classname` key contains the name of the class */ protected static function getFiles($path, array $ignoreFolders = array(), array $ignoreFiles = array()) { $return = array(); $files = self::scanDirectory($path, $ignoreFolders, $ignoreFiles); // Ok, I got the files, now I have to organize them foreach ($files as $file) { $clean = str_replace($path, '', $file); $clean = trim(str_replace('\\', '/', $clean), '/'); $parts = explode('/', $clean); $return[] = array( 'fullpath' => $file, 'classname' => 'FOFDownloadAdapter' . ucfirst(basename($parts[0], '.php')) ); } return $return; } /** * Recursive function that will scan every directory unless it's in the * ignore list. Files that aren't in the ignore list are returned. * * @param string $path Folder where we should start looking * @param array $ignoreFolders Folder ignore list * @param array $ignoreFiles File ignore list * * @return array List of all the files */ protected static function scanDirectory($path, array $ignoreFolders = array(), array $ignoreFiles = array()) { $return = array(); $handle = @opendir($path); if ( !$handle) { return $return; } while (($file = readdir($handle)) !== false) { if ($file == '.' || $file == '..') { continue; } $fullpath = $path . '/' . $file; if ((is_dir($fullpath) && in_array($file, $ignoreFolders)) || (is_file($fullpath) && in_array($file, $ignoreFiles))) { continue; } if (is_dir($fullpath)) { $return = array_merge(self::scanDirectory($fullpath, $ignoreFolders, $ignoreFiles), $return); } else { $return[] = $path . '/' . $file; } } return $return; } }PK���\��=�+libraries/fof/download/adapter/abstract.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage dispatcher * @copyright Copyright (C) 2010 - 2015 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; /** * Abstract base class for download adapters */ abstract class FOFDownloadAdapterAbstract implements FOFDownloadInterface { public $priority = 100; public $name = ''; public $isSupported = false; public $supportsChunkDownload = false; public $supportsFileSize = false; /** * Does this download adapter support downloading files in chunks? * * @return boolean True if chunk download is supported */ public function supportsChunkDownload() { return $this->supportsChunkDownload; } /** * Does this download adapter support reading the size of a remote file? * * @return boolean True if remote file size determination is supported */ public function supportsFileSize() { return $this->supportsFileSize; } /** * Is this download class supported in the current server environment? * * @return boolean True if this server environment supports this download class */ public function isSupported() { return $this->isSupported; } /** * Get the priority of this adapter. If multiple download adapters are * supported on a site, the one with the highest priority will be * used. * * @return boolean */ public function getPriority() { return $this->priority; } /** * Returns the name of this download adapter in use * * @return string */ public function getName() { return $this->name; } /** * Download a part (or the whole) of a remote URL and return the downloaded * data. You are supposed to check the size of the returned data. If it's * smaller than what you expected you've reached end of file. If it's empty * you have tried reading past EOF. If it's larger than what you expected * the server doesn't support chunk downloads. * * If this class' supportsChunkDownload returns false you should assume * that the $from and $to parameters will be ignored. * * @param string $url The remote file's URL * @param integer $from Byte range to start downloading from. Use null for start of file. * @param integer $to Byte range to stop downloading. Use null to download the entire file ($from is ignored) * @param array $params Additional params that will be added before performing the download * * @return string The raw file data retrieved from the remote URL. * * @throws Exception A generic exception is thrown on error */ public function downloadAndReturn($url, $from = null, $to = null, array $params = array()) { return ''; } /** * Get the size of a remote file in bytes * * @param string $url The remote file's URL * * @return integer The file size, or -1 if the remote server doesn't support this feature */ public function getFileSize($url) { return -1; } }PK���\�,����'libraries/fof/download/adapter/curl.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage dispatcher * @copyright Copyright (C) 2010 - 2015 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; /** * A download adapter using the cURL PHP module */ class FOFDownloadAdapterCurl extends FOFDownloadAdapterAbstract implements FOFDownloadInterface { protected $headers = array(); public function __construct() { $this->priority = 110; $this->supportsFileSize = true; $this->supportsChunkDownload = true; $this->name = 'curl'; $this->isSupported = function_exists('curl_init') && function_exists('curl_exec') && function_exists('curl_close'); } /** * Download a part (or the whole) of a remote URL and return the downloaded * data. You are supposed to check the size of the returned data. If it's * smaller than what you expected you've reached end of file. If it's empty * you have tried reading past EOF. If it's larger than what you expected * the server doesn't support chunk downloads. * * If this class' supportsChunkDownload returns false you should assume * that the $from and $to parameters will be ignored. * * @param string $url The remote file's URL * @param integer $from Byte range to start downloading from. Use null for start of file. * @param integer $to Byte range to stop downloading. Use null to download the entire file ($from is ignored) * @param array $params Additional params that will be added before performing the download * * @return string The raw file data retrieved from the remote URL. * * @throws Exception A generic exception is thrown on error */ public function downloadAndReturn($url, $from = null, $to = null, array $params = array()) { $ch = curl_init(); if (empty($from)) { $from = 0; } if (empty($to)) { $to = 0; } if ($to < $from) { $temp = $to; $to = $from; $from = $temp; unset($temp); } // Default cURL options $options = array( CURLOPT_AUTOREFERER => 1, CURLOPT_SSL_VERIFYPEER => 1, CURLOPT_SSL_VERIFYHOST => 2, CURLOPT_SSLVERSION => 0, CURLOPT_AUTOREFERER => 1, CURLOPT_URL => $url, CURLOPT_BINARYTRANSFER => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_FOLLOWLOCATION => 1, CURLOPT_CAINFO => JPATH_LIBRARIES . 'joomla/http/transport/cacert.pem', CURLOPT_HEADERFUNCTION => array($this, 'reponseHeaderCallback') ); if (!(empty($from) && empty($to))) { $options[CURLOPT_RANGE] = "$from-$to"; } // Add any additional options: Since they are numeric, we must use the array operator. If the jey exists in both // arrays, only the first one will be used while the second one will be ignored $options = $params + $options; @curl_setopt_array($ch, $options); $this->headers = array(); $result = curl_exec($ch); $errno = curl_errno($ch); $errmsg = curl_error($ch); $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($result === false) { $error = JText::sprintf('LIB_FOF_DOWNLOAD_ERR_CURL_ERROR', $errno, $errmsg); } elseif (($http_status >= 300) && ($http_status <= 399) && isset($this->headers['Location']) && !empty($this->headers['Location'])) { return $this->downloadAndReturn($this->headers['Location'], $from, $to, $params); } elseif ($http_status > 399) { $result = false; $errno = $http_status; $error = JText::sprintf('LIB_FOF_DOWNLOAD_ERR_HTTPERROR', $http_status); } curl_close($ch); if ($result === false) { throw new Exception($error, $errno); } else { return $result; } } /** * Get the size of a remote file in bytes * * @param string $url The remote file's URL * * @return integer The file size, or -1 if the remote server doesn't support this feature */ public function getFileSize($url) { $result = -1; $ch = curl_init(); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSLVERSION, 0); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_NOBODY, true ); curl_setopt($ch, CURLOPT_HEADER, true ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true ); @curl_setopt($ch, CURLOPT_CAINFO, JPATH_LIBRARIES . 'joomla/http/transport/cacert.pem'); $data = curl_exec($ch); curl_close($ch); if ($data) { $content_length = "unknown"; $status = "unknown"; $redirection = null; if (preg_match( "/^HTTP\/1\.[01] (\d\d\d)/", $data, $matches)) { $status = (int)$matches[1]; } if (preg_match( "/Content-Length: (\d+)/", $data, $matches)) { $content_length = (int)$matches[1]; } if (preg_match( "/Location: (.*)/", $data, $matches)) { $redirection = (int)$matches[1]; } if ($status == 200) { $result = $content_length; } if (($status > 300) && ($status <= 308)) { if (!empty($redirection)) { return $this->getFileSize($redirection); } return -1; } } return $result; } /** * Handles the HTTP headers returned by cURL * * @param resource $ch cURL resource handle (unused) * @param string $data Each header line, as returned by the server * * @return int The length of the $data string */ protected function reponseHeaderCallback(&$ch, &$data) { $strlen = strlen($data); if (($strlen) <= 2) { return $strlen; } if (substr($data, 0, 4) == 'HTTP') { return $strlen; } list($header, $value) = explode(': ', trim($data), 2); $this->headers[$header] = $value; return $strlen; } }PK���\�m�V��(libraries/fof/download/adapter/fopen.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage dispatcher * @copyright Copyright (C) 2010 - 2015 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; /** * A download adapter using URL fopen() wrappers */ class FOFDownloadAdapterFopen extends FOFDownloadAdapterAbstract implements FOFDownloadInterface { public function __construct() { $this->priority = 100; $this->supportsFileSize = false; $this->supportsChunkDownload = true; $this->name = 'fopen'; // If we are not allowed to use ini_get, we assume that URL fopen is // disabled. if (!function_exists('ini_get')) { $this->isSupported = false; } else { $this->isSupported = ini_get('allow_url_fopen'); } } /** * Download a part (or the whole) of a remote URL and return the downloaded * data. You are supposed to check the size of the returned data. If it's * smaller than what you expected you've reached end of file. If it's empty * you have tried reading past EOF. If it's larger than what you expected * the server doesn't support chunk downloads. * * If this class' supportsChunkDownload returns false you should assume * that the $from and $to parameters will be ignored. * * @param string $url The remote file's URL * @param integer $from Byte range to start downloading from. Use null for start of file. * @param integer $to Byte range to stop downloading. Use null to download the entire file ($from is ignored) * @param array $params Additional params that will be added before performing the download * * @return string The raw file data retrieved from the remote URL. * * @throws Exception A generic exception is thrown on error */ public function downloadAndReturn($url, $from = null, $to = null, array $params = array()) { if (empty($from)) { $from = 0; } if (empty($to)) { $to = 0; } if ($to < $from) { $temp = $to; $to = $from; $from = $temp; unset($temp); } if (!(empty($from) && empty($to))) { $options = array( 'http' => array( 'method' => 'GET', 'header' => "Range: bytes=$from-$to\r\n" ), 'ssl' => array( 'verify_peer' => true, 'cafile' => JPATH_LIBRARIES . 'joomla/http/transport/cacert.pem', 'verify_depth' => 5, ) ); $options = array_merge($options, $params); $context = stream_context_create($options); $result = @file_get_contents($url, false, $context, $from - $to + 1); } else { $options = array( 'http' => array( 'method' => 'GET', ), 'ssl' => array( 'verify_peer' => true, 'cafile' => JPATH_LIBRARIES . 'joomla/http/transport/cacert.pem', 'verify_depth' => 5, ) ); $options = array_merge($options, $params); $context = stream_context_create($options); $result = @file_get_contents($url, false, $context); } if ($result === false) { $error = JText::sprintf('LIB_FOF_DOWNLOAD_ERR_HTTPERROR'); throw new Exception($error, 1); } else { return $result; } } }PK���\܄W�mmlibraries/fof/input/input.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage input * @copyright Copyright (C) 2010 - 2015 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 input handling class. Extends upon the JInput class. * * @package FrameworkOnFramework * @since 2.0 */ class FOFInput extends JInput { /** * Public constructor. Overriden to allow specifying the global input array * to use as a string and instantiate from an objetc holding variables. * * @param array|string|object|null $source Source data; set null to use $_REQUEST * @param array $options Filter options */ public function __construct($source = null, array $options = array()) { $hash = null; if (is_string($source)) { $hash = strtoupper($source); switch ($hash) { case 'GET': $source = $_GET; break; case 'POST': $source = $_POST; break; case 'FILES': $source = $_FILES; break; case 'COOKIE': $source = $_COOKIE; break; case 'ENV': $source = $_ENV; break; case 'SERVER': $source = $_SERVER; break; default: $source = $_REQUEST; $hash = 'REQUEST'; break; } } elseif (is_object($source)) { try { $source = (array) $source; } catch (Exception $exc) { $source = null; } } elseif (is_array($source)) { // Nothing, it's already an array } else { // Any other case $source = $_REQUEST; $hash = 'REQUEST'; } // Magic quotes GPC handling (something JInput simply can't handle at all) if (($hash == 'REQUEST') && get_magic_quotes_gpc() && class_exists('JRequest', true)) { $source = JRequest::get('REQUEST', 2); } parent::__construct($source, $options); } /** * Gets a value from the input data. Overriden to allow specifying a filter * mask. * * @param string $name Name of the value to get. * @param mixed $default Default value to return if variable does not exist. * @param string $filter Filter to apply to the value. * @param int $mask The filter mask * * @return mixed The filtered input value. */ public function get($name, $default = null, $filter = 'cmd', $mask = 0) { if (isset($this->data[$name])) { return $this->_cleanVar($this->data[$name], $mask, $filter); } return $default; } /** * Returns a copy of the raw data stored in the class * * @return array */ public function getData() { return $this->data; } /** * Old static methods are now deprecated. This magic method makes sure there * is a continuity in our approach. The downside is that it's only compatible * with PHP 5.3.0. Sorry! * * @param string $name Name of the method we're calling * @param array $arguments The arguments passed to the method * * @return mixed */ public static function __callStatic($name, $arguments) { FOFPlatform::getInstance()->logDeprecated('FOFInput: static getXXX() methods are deprecated. Use the input object\'s methods instead.'); if (substr($name, 0, 3) == 'get') { // Initialise arguments $key = array_shift($arguments); $default = array_shift($arguments); $input = array_shift($arguments); $type = 'none'; $mask = 0; $type = strtolower(substr($name, 3)); if ($type == 'var') { $type = array_shift($arguments); $mask = array_shift($arguments); } if (is_null($type)) { $type = 'none'; } if (is_null($mask)) { $mask = 0; } if (!($input instanceof FOFInput) && !($input instanceof JInput)) { $input = new FOFInput($input); } return $input->get($key, $default, $type, $mask); } return false; } /** * Magic method to get filtered input data. * * @param mixed $name Name of the value to get. * @param string $arguments Default value to return if variable does not exist. * * @return boolean The filtered boolean input value. */ public function __call($name, $arguments) { if (substr($name, 0, 3) == 'get') { $filter = substr($name, 3); $default = null; $mask = 0; if (isset($arguments[1])) { $default = $arguments[1]; } if (isset($arguments[2])) { $mask = $arguments[2]; } return $this->get($arguments[0], $default, $filter, $mask); } } /** * Sets an input variable. WARNING: IT SHOULD NO LONGER BE USED! * * @param string $name The name of the variable to set * @param mixed $value The value to set it to * @param array &$input The input array or FOFInput object * @param boolean $overwrite Should I overwrite existing values (default: true) * * @return string Previous value * * @deprecated */ public static function setVar($name, $value = null, &$input = array(), $overwrite = true) { FOFPlatform::getInstance()->logDeprecated('FOFInput::setVar() is deprecated. Use set() instead.'); if (empty($input)) { return JRequest::setVar($name, $value, 'default', $overwrite); } elseif (is_string($input)) { return JRequest::setVar($name, $value, $input, $overwrite); } else { if (!$overwrite && array_key_exists($name, $input)) { return $input[$name]; } $previous = array_key_exists($name, $input) ? $input[$name] : null; if (is_array($input)) { $input[$name] = $value; } elseif ($input instanceof FOFInput) { $input->set($name, $value); } return $previous; } } /** * Custom filter implementation. Works better with arrays and allows the use * of a filter mask. * * @param mixed $var The variable (value) to clean * @param integer $mask The clean mask * @param string $type The variable type * * @return mixed */ protected function _cleanVar($var, $mask = 0, $type = null) { if (is_array($var)) { $temp = array(); foreach ($var as $k => $v) { $temp[$k] = self::_cleanVar($v, $mask); } return $temp; } // If the no trim flag is not set, trim the variable if (!($mask & 1) && is_string($var)) { $var = trim($var); } // Now we handle input filtering if ($mask & 2) { // If the allow raw flag is set, do not modify the variable $var = $var; } elseif ($mask & 4) { // If the allow HTML flag is set, apply a safe HTML filter to the variable $safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1); $var = $safeHtmlFilter->clean($var, $type); } else { $var = $this->filter->clean($var, $type); } return $var; } } PK���\G�O_I6I6%libraries/fof/inflector/inflector.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage inflector * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * The FOFInflector is an adaptation of the Akelos PHP Inflector which is a PHP * port from a Ruby on Rails project. */ /** * FOFInflector to pluralize and singularize English nouns. * * @package FrameworkOnFramework * @since 1.0 */ class FOFInflector { /** * Rules for pluralizing and singularizing of nouns. * * @var array */ protected static $_rules = array ( 'pluralization' => array( '/move$/i' => 'moves', '/sex$/i' => 'sexes', '/child$/i' => 'children', '/children$/i' => 'children', '/man$/i' => 'men', '/men$/i' => 'men', '/foot$/i' => 'feet', '/feet$/i' => 'feet', '/person$/i' => 'people', '/people$/i' => 'people', '/taxon$/i' => 'taxa', '/taxa$/i' => 'taxa', '/(quiz)$/i' => '$1zes', '/^(ox)$/i' => '$1en', '/oxen$/i' => 'oxen', '/(m|l)ouse$/i' => '$1ice', '/(m|l)ice$/i' => '$1ice', '/(matr|vert|ind|suff)ix|ex$/i' => '$1ices', '/(x|ch|ss|sh)$/i' => '$1es', '/([^aeiouy]|qu)y$/i' => '$1ies', '/(?:([^f])fe|([lr])f)$/i' => '$1$2ves', '/sis$/i' => 'ses', '/([ti]|addend)um$/i' => '$1a', '/([ti]|addend)a$/i' => '$1a', '/(alumn|formul)a$/i' => '$1ae', '/(alumn|formul)ae$/i' => '$1ae', '/(buffal|tomat|her)o$/i' => '$1oes', '/(bu)s$/i' => '$1ses', '/(alias|status)$/i' => '$1es', '/(octop|vir)us$/i' => '$1i', '/(octop|vir)i$/i' => '$1i', '/(gen)us$/i' => '$1era', '/(gen)era$/i' => '$1era', '/(ax|test)is$/i' => '$1es', '/s$/i' => 's', '/$/' => 's', ), 'singularization' => array( '/cookies$/i' => 'cookie', '/moves$/i' => 'move', '/sexes$/i' => 'sex', '/children$/i' => 'child', '/men$/i' => 'man', '/feet$/i' => 'foot', '/people$/i' => 'person', '/taxa$/i' => 'taxon', '/databases$/i' => 'database', '/menus$/i' => 'menu', '/(quiz)zes$/i' => '\1', '/(matr|suff)ices$/i' => '\1ix', '/(vert|ind|cod)ices$/i' => '\1ex', '/^(ox)en/i' => '\1', '/(alias|status)es$/i' => '\1', '/(tomato|hero|buffalo)es$/i' => '\1', '/([octop|vir])i$/i' => '\1us', '/(gen)era$/i' => '\1us', '/(cris|^ax|test)es$/i' => '\1is', '/is$/i' => 'is', '/us$/i' => 'us', '/ias$/i' => 'ias', '/(shoe)s$/i' => '\1', '/(o)es$/i' => '\1e', '/(bus)es$/i' => '\1', '/([m|l])ice$/i' => '\1ouse', '/(x|ch|ss|sh)es$/i' => '\1', '/(m)ovies$/i' => '\1ovie', '/(s)eries$/i' => '\1eries', '/(v)ies$/i' => '\1ie', '/([^aeiouy]|qu)ies$/i' => '\1y', '/([lr])ves$/i' => '\1f', '/(tive)s$/i' => '\1', '/(hive)s$/i' => '\1', '/([^f])ves$/i' => '\1fe', '/(^analy)ses$/i' => '\1sis', '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', '/([ti]|addend)a$/i' => '\1um', '/(alumn|formul)ae$/i' => '$1a', '/(n)ews$/i' => '\1ews', '/(.*)ss$/i' => '\1ss', '/(.*)s$/i' => '\1', ), 'countable' => array( 'aircraft', 'cannon', 'deer', 'equipment', 'fish', 'information', 'money', 'moose', 'rice', 'series', 'sheep', 'species', 'swine', ) ); /** * Cache of pluralized and singularized nouns. * * @var array */ protected static $_cache = array( 'singularized' => array(), 'pluralized' => array() ); /** * Constructor * * Prevent creating instances of this class by making the constructor private */ private function __construct() { } public static function deleteCache() { static::$_cache['pluralized'] = array(); static::$_cache['singularized'] = array(); } /** * Add a word to the cache, useful to make exceptions or to add words in other languages. * * @param string $singular word. * @param string $plural word. * * @return void */ public static function addWord($singular, $plural) { static::$_cache['pluralized'][$singular] = $plural; static::$_cache['singularized'][$plural] = $singular; } /** * Singular English word to plural. * * @param string $word word to pluralize. * * @return string Plural noun. */ public static function pluralize($word) { // Get the cached noun of it exists if (isset(static::$_cache['pluralized'][$word])) { return static::$_cache['pluralized'][$word]; } // Create the plural noun if (in_array($word, self::$_rules['countable'])) { static::$_cache['pluralized'][$word] = $word; return $word; } foreach (self::$_rules['pluralization'] as $regexp => $replacement) { $matches = null; $plural = preg_replace($regexp, $replacement, $word, -1, $matches); if ($matches > 0) { static::$_cache['pluralized'][$word] = $plural; return $plural; } } static::$_cache['pluralized'][$word] = $word; return static::$_cache['pluralized'][$word]; } /** * Plural English word to singular. * * @param string $word Word to singularize. * * @return string Singular noun. */ public static function singularize($word) { // Get the cached noun of it exists if (isset(static::$_cache['singularized'][$word])) { return static::$_cache['singularized'][$word]; } // Create the singular noun if (in_array($word, self::$_rules['countable'])) { static::$_cache['singularized'][$word] = $word; return $word; } foreach (self::$_rules['singularization'] as $regexp => $replacement) { $matches = null; $singular = preg_replace($regexp, $replacement, $word, -1, $matches); if ($matches > 0) { static::$_cache['singularized'][$word] = $singular; return $singular; } } static::$_cache['singularized'][$word] = $word; return static::$_cache['singularized'][$word]; } /** * Returns given word as CamelCased. * * Converts a word like "foo_bar" or "foo bar" to "FooBar". It * will remove non alphanumeric characters from the word, so * "who's online" will be converted to "WhoSOnline" * * @param string $word Word to convert to camel case. * * @return string UpperCamelCasedWord */ public static function camelize($word) { $word = preg_replace('/[^a-zA-Z0-9\s]/', ' ', $word); $word = str_replace(' ', '', ucwords(strtolower(str_replace('_', ' ', $word)))); return $word; } /** * Converts a word "into_it_s_underscored_version" * * Convert any "CamelCased" or "ordinary Word" into an "underscored_word". * * @param string $word Word to underscore * * @return string Underscored word */ public static function underscore($word) { $word = preg_replace('/(\s)+/', '_', $word); $word = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $word)); return $word; } /** * Convert any "CamelCased" word into an array of strings * * Returns an array of strings each of which is a substring of string formed * by splitting it at the camelcased letters. * * @param string $word Word to explode * * @return array Array of strings */ public static function explode($word) { $result = explode('_', self::underscore($word)); return $result; } /** * Convert an array of strings into a "CamelCased" word. * * @param array $words Array to implode * * @return string UpperCamelCasedWord */ public static function implode($words) { $result = self::camelize(implode('_', $words)); return $result; } /** * Returns a human-readable string from $word. * * Returns a human-readable string from $word, by replacing * underscores with a space, and by upper-casing the initial * character by default. * * @param string $word String to "humanize" * * @return string Human-readable word */ public static function humanize($word) { $result = ucwords(strtolower(str_replace("_", " ", $word))); return $result; } /** * Converts a class name to its table name according to Koowa * naming conventions. * * Converts "Person" to "people" * * @param string $className Class name for getting related table_name. * * @return string plural_table_name * * @see classify */ public static function tableize($className) { $result = self::underscore($className); if (!self::isPlural($className)) { $result = self::pluralize($result); } return $result; } /** * Converts a table name to its class name according to Koowa naming conventions. * * @param string $tableName Table name for getting related ClassName. * * @return string SingularClassName * * @example Converts "people" to "Person" * @see tableize */ public static function classify($tableName) { $result = self::camelize(self::singularize($tableName)); return $result; } /** * Returns camelBacked version of a string. Same as camelize but first char is lowercased. * * @param string $string String to be camelBacked. * * @return string * * @see camelize */ public static function variablize($string) { $string = self::camelize(self::underscore($string)); $result = strtolower(substr($string, 0, 1)); $variable = preg_replace('/\\w/', $result, $string, 1); return $variable; } /** * Check to see if an English word is singular * * @param string $string The word to check * * @return boolean */ public static function isSingular($string) { // Check cache assuming the string is plural. $singular = isset(static::$_cache['singularized'][$string]) ? static::$_cache['singularized'][$string] : null; $plural = $singular && isset(static::$_cache['pluralized'][$singular]) ? static::$_cache['pluralized'][$singular] : null; if ($singular && $plural) { return $plural != $string; } // If string is not in the cache, try to pluralize and singularize it. return self::singularize(self::pluralize($string)) == $string; } /** * Check to see if an Enlish word is plural. * * @param string $string String to be checked. * * @return boolean */ public static function isPlural($string) { // Check cache assuming the string is singular. $plural = isset(static::$_cache['pluralized'][$string]) ? static::$_cache['pluralized'][$string] : null; $singular = $plural && isset(static::$_cache['singularized'][$plural]) ? static::$_cache['singularized'][$plural] : null; if ($plural && $singular) { return $singular != $string; } // If string is not in the cache, try to singularize and pluralize it. return self::pluralize(self::singularize($string)) == $string; } /** * Gets a part of a CamelCased word by index. * * Use a negative index to start at the last part of the word (-1 is the * last part) * * @param string $string Word * @param integer $index Index of the part * @param string $default Default value * * @return string */ public static function getPart($string, $index, $default = null) { $parts = self::explode($string); if ($index < 0) { $index = count($parts) + $index; } return isset($parts[$index]) ? $parts[$index] : $default; } } PK���\����!libraries/fof/config/provider.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage config * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ defined('FOF_INCLUDED') or die(); /** * Reads and parses the fof.xml file in the back-end of a FOF-powered component, * provisioning the data to the rest of the FOF framework * * @package FrameworkOnFramework * @since 2.1 */ class FOFConfigProvider { /** * Cache of FOF components' configuration variables * * @var array */ public static $configurations = array(); /** * Parses the configuration of the specified component * * @param string $component The name of the component, e.g. com_foobar * @param boolean $force Force reload even if it's already parsed? * * @return void */ public function parseComponent($component, $force = false) { if (!$force && isset(self::$configurations[$component])) { return; } if (FOFPlatform::getInstance()->isCli()) { $order = array('cli', 'backend'); } elseif (FOFPlatform::getInstance()->isBackend()) { $order = array('backend'); } else { $order = array('frontend'); } $order[] = 'common'; $order = array_reverse($order); self::$configurations[$component] = array(); foreach ($order as $area) { $config = $this->parseComponentArea($component, $area); self::$configurations[$component] = array_merge_recursive(self::$configurations[$component], $config); } } /** * Returns the value of a variable. Variables use a dot notation, e.g. * view.config.whatever where the first part is the domain, the rest of the * parts specify the path to the variable. * * @param string $variable The variable name * @param mixed $default The default value, or null if not specified * * @return mixed The value of the variable */ public function get($variable, $default = null) { static $domains = null; if (is_null($domains)) { $domains = $this->getDomains(); } list($component, $domain, $var) = explode('.', $variable, 3); if (!isset(self::$configurations[$component])) { $this->parseComponent($component); } if (!in_array($domain, $domains)) { return $default; } $class = 'FOFConfigDomain' . ucfirst($domain); $o = new $class; return $o->get(self::$configurations[$component], $var, $default); } /** * Parses the configuration options of a specific component area * * @param string $component Which component's cionfiguration to parse * @param string $area Which area to parse (frontend, backend, cli) * * @return array A hash array with the configuration data */ protected function parseComponentArea($component, $area) { // Initialise the return array $ret = array(); // Get the folders of the component $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($component); $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); // Check that the path exists $path = $componentPaths['admin']; $path = $filesystem->pathCheck($path); if (!$filesystem->folderExists($path)) { return $ret; } // Read the filename if it exists $filename = $path . '/fof.xml'; if (!$filesystem->fileExists($filename)) { return $ret; } $data = file_get_contents($filename); // Load the XML data in a SimpleXMLElement object $xml = simplexml_load_string($data); if (!($xml instanceof SimpleXMLElement)) { return $ret; } // Get this area's data $areaData = $xml->xpath('//' . $area); if (empty($areaData)) { return $ret; } $xml = array_shift($areaData); // Parse individual configuration domains $domains = $this->getDomains(); foreach ($domains as $dom) { $class = 'FOFConfigDomain' . ucfirst($dom); if (class_exists($class, true)) { $o = new $class; $o->parseDomain($xml, $ret); } } // Finally, return the result return $ret; } /** * Gets a list of the available configuration domain adapters * * @return array A list of the available domains */ protected function getDomains() { static $domains = array(); if (empty($domains)) { $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); $files = $filesystem->folderFiles(__DIR__ . '/domain', '.php'); if (!empty($files)) { foreach ($files as $file) { $domain = basename($file, '.php'); if ($domain == 'interface') { continue; } $domain = preg_replace('/[^A-Za-z0-9]/', '', $domain); $domains[] = $domain; } $domains = array_unique($domains); } } return $domains; } } PK���\�K?y� � %libraries/fof/config/domain/views.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage config * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ defined('FOF_INCLUDED') or die(); /** * Configuration parser for the view-specific settings * * @package FrameworkOnFramework * @since 2.1 */ class FOFConfigDomainViews implements FOFConfigDomainInterface { /** * Parse the XML data, adding them to the $ret array * * @param SimpleXMLElement $xml The XML data of the component's configuration area * @param array &$ret The parsed data, in the form of a hash array * * @return void */ public function parseDomain(SimpleXMLElement $xml, array &$ret) { // Initialise $ret['views'] = array(); // Parse view configuration $viewData = $xml->xpath('view'); // Sanity check if (empty($viewData)) { return; } foreach ($viewData as $aView) { $key = (string) $aView['name']; // Parse ACL options $ret['views'][$key]['acl'] = array(); $aclData = $aView->xpath('acl/task'); if (!empty($aclData)) { foreach ($aclData as $acl) { $k = (string) $acl['name']; $ret['views'][$key]['acl'][$k] = (string) $acl; } } // Parse taskmap $ret['views'][$key]['taskmap'] = array(); $taskmapData = $aView->xpath('taskmap/task'); if (!empty($taskmapData)) { foreach ($taskmapData as $map) { $k = (string) $map['name']; $ret['views'][$key]['taskmap'][$k] = (string) $map; } } // Parse controller configuration $ret['views'][$key]['config'] = array(); $optionData = $aView->xpath('config/option'); if (!empty($optionData)) { foreach ($optionData as $option) { $k = (string) $option['name']; $ret['views'][$key]['config'][$k] = (string) $option; } } // Parse the toolbar $ret['views'][$key]['toolbar'] = array(); $toolBars = $aView->xpath('toolbar'); if (!empty($toolBars)) { foreach ($toolBars as $toolBar) { $taskName = isset($toolBar['task']) ? (string) $toolBar['task'] : '*'; // If a toolbar title is specified, create a title element. if (isset($toolBar['title'])) { $ret['views'][$key]['toolbar'][$taskName]['title'] = array( 'value' => (string) $toolBar['title'] ); } // Parse the toolbar buttons data $toolbarData = $toolBar->xpath('button'); if (!empty($toolbarData)) { foreach ($toolbarData as $button) { $k = (string) $button['type']; $ret['views'][$key]['toolbar'][$taskName][$k] = current($button->attributes()); $ret['views'][$key]['toolbar'][$taskName][$k]['value'] = (string) $button; } } } } } } /** * Return a configuration variable * * @param string &$configuration Configuration variables (hashed array) * @param string $var The variable we want to fetch * @param mixed $default Default value * * @return mixed The variable's value */ public function get(&$configuration, $var, $default) { $parts = explode('.', $var); $view = $parts[0]; $method = 'get' . ucfirst($parts[1]); if (!method_exists($this, $method)) { return $default; } array_shift($parts); array_shift($parts); $ret = $this->$method($view, $configuration, $parts, $default); return $ret; } /** * Internal function to return the task map for a view * * @param string $view The view for which we will be fetching a task map * @param array &$configuration The configuration parameters hash array * @param array $params Extra options (not used) * @param array $default ßDefault task map; empty array if not provided * * @return array The task map as a hash array in the format task => method */ protected function getTaskmap($view, &$configuration, $params, $default = array()) { $taskmap = array(); if (isset($configuration['views']['*']) && isset($configuration['views']['*']['taskmap'])) { $taskmap = $configuration['views']['*']['taskmap']; } if (isset($configuration['views'][$view]) && isset($configuration['views'][$view]['taskmap'])) { $taskmap = array_merge($taskmap, $configuration['views'][$view]['taskmap']); } if (empty($taskmap)) { return $default; } return $taskmap; } /** * Internal method to return the ACL mapping (privilege required to access * a specific task) for the given view's tasks * * @param string $view The view for which we will be fetching a task map * @param array &$configuration The configuration parameters hash array * @param array $params Extra options; key 0 defines the task we want to fetch * @param string $default Default ACL option; empty (no ACL check) if not defined * * @return string The privilege required to access this view */ protected function getAcl($view, &$configuration, $params, $default = '') { $aclmap = array(); if (isset($configuration['views']['*']) && isset($configuration['views']['*']['acl'])) { $aclmap = $configuration['views']['*']['acl']; } if (isset($configuration['views'][$view]) && isset($configuration['views'][$view]['acl'])) { $aclmap = array_merge($aclmap, $configuration['views'][$view]['acl']); } $acl = $default; if (isset($aclmap['*'])) { $acl = $aclmap['*']; } if (isset($aclmap[$params[0]])) { $acl = $aclmap[$params[0]]; } return $acl; } /** * Internal method to return the a configuration option for the view. These * are equivalent to $config array options passed to the Controller * * @param string $view The view for which we will be fetching a task map * @param array &$configuration The configuration parameters hash array * @param array $params Extra options; key 0 defines the option variable we want to fetch * @param mixed $default Default option; null if not defined * * @return string The setting for the requested option */ protected function getConfig($view, &$configuration, $params, $default = null) { $ret = $default; if (isset($configuration['views']['*']) && isset($configuration['views']['*']['config']) && isset($configuration['views']['*']['config'][$params[0]])) { $ret = $configuration['views']['*']['config'][$params[0]]; } if (isset($configuration['views'][$view]) && isset($configuration['views'][$view]['config']) && isset($configuration['views'][$view]['config'][$params[0]])) { $ret = $configuration['views'][$view]['config'][$params[0]]; } return $ret; } /** * Internal method to return the toolbar infos. * * @param string $view The view for which we will be fetching buttons * @param array &$configuration The configuration parameters hash array * @param array $params Extra options * @param string $default Default option * * @return string The toolbar data for this view */ protected function getToolbar($view, &$configuration, $params, $default = '') { $toolbar = array(); if (isset($configuration['views']['*']) && isset($configuration['views']['*']['toolbar']) && isset($configuration['views']['*']['toolbar']['*'])) { $toolbar = $configuration['views']['*']['toolbar']['*']; } if (isset($configuration['views']['*']) && isset($configuration['views']['*']['toolbar']) && isset($configuration['views']['*']['toolbar'][$params[0]])) { $toolbar = array_merge($toolbar, $configuration['views']['*']['toolbar'][$params[0]]); } if (isset($configuration['views'][$view]) && isset($configuration['views'][$view]['toolbar']) && isset($configuration['views'][$view]['toolbar']['*'])) { $toolbar = array_merge($toolbar, $configuration['views'][$view]['toolbar']['*']); } if (isset($configuration['views'][$view]) && isset($configuration['views'][$view]['toolbar']) && isset($configuration['views'][$view]['toolbar'][$params[0]])) { $toolbar = array_merge($toolbar, $configuration['views'][$view]['toolbar'][$params[0]]); } if (empty($toolbar)) { return $default; } return $toolbar; } } PK���\\�?$��)libraries/fof/config/domain/interface.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage config * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ defined('FOF_INCLUDED') or die(); /** * The Interface of an FOFConfigDomain class. The methods are used to parse and * privision sensible information to consumers. FOFConfigProvider acts as an * adapter to the FOFConfigDomain classes. * * @package FrameworkOnFramework * @since 2.1 */ interface FOFConfigDomainInterface { /** * Parse the XML data, adding them to the $ret array * * @param SimpleXMLElement $xml The XML data of the component's configuration area * @param array &$ret The parsed data, in the form of a hash array * * @return void */ public function parseDomain(SimpleXMLElement $xml, array &$ret); /** * Return a configuration variable * * @param string &$configuration Configuration variables (hashed array) * @param string $var The variable we want to fetch * @param mixed $default Default value * * @return mixed The variable's value */ public function get(&$configuration, $var, $default); } PK���\�� ��&libraries/fof/config/domain/tables.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage config * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ defined('FOF_INCLUDED') or die(); /** * Configuration parser for the tables-specific settings * * @package FrameworkOnFramework * @since 2.1 */ class FOFConfigDomainTables implements FOFConfigDomainInterface { /** * Parse the XML data, adding them to the $ret array * * @param SimpleXMLElement $xml The XML data of the component's configuration area * @param array &$ret The parsed data, in the form of a hash array * * @return void */ public function parseDomain(SimpleXMLElement $xml, array &$ret) { // Initialise $ret['tables'] = array(); // Parse table configuration $tableData = $xml->xpath('table'); // Sanity check if (empty($tableData)) { return; } foreach ($tableData as $aTable) { $key = (string) $aTable['name']; $ret['tables'][$key]['behaviors'] = (string) $aTable->behaviors; $ret['tables'][$key]['tablealias'] = $aTable->xpath('tablealias'); $ret['tables'][$key]['fields'] = array(); $ret['tables'][$key]['relations'] = array(); $fieldData = $aTable->xpath('field'); if (!empty($fieldData)) { foreach ($fieldData as $field) { $k = (string) $field['name']; $ret['tables'][$key]['fields'][$k] = (string) $field; } } $relationsData = $aTable->xpath('relation'); if (!empty($relationsData)) { foreach ($relationsData as $relationData) { $type = (string)$relationData['type']; $itemName = (string)$relationData['name']; if (empty($type) || empty($itemName)) { continue; } $tableClass = (string)$relationData['tableClass']; $localKey = (string)$relationData['localKey']; $remoteKey = (string)$relationData['remoteKey']; $ourPivotKey = (string)$relationData['ourPivotKey']; $theirPivotKey = (string)$relationData['theirPivotKey']; $pivotTable = (string)$relationData['pivotTable']; $default = (string)$relationData['default']; $default = !in_array($default, array('no', 'false', 0)); $relation = array( 'type' => $type, 'itemName' => $itemName, 'tableClass' => empty($tableClass) ? null : $tableClass, 'localKey' => empty($localKey) ? null : $localKey, 'remoteKey' => empty($remoteKey) ? null : $remoteKey, 'default' => $default, ); if (!empty($ourPivotKey) || !empty($theirPivotKey) || !empty($pivotTable)) { $relation['ourPivotKey'] = empty($ourPivotKey) ? null : $ourPivotKey; $relation['theirPivotKey'] = empty($theirPivotKey) ? null : $theirPivotKey; $relation['pivotTable'] = empty($pivotTable) ? null : $pivotTable; } $ret['tables'][$key]['relations'][] = $relation; } } } } /** * Return a configuration variable * * @param string &$configuration Configuration variables (hashed array) * @param string $var The variable we want to fetch * @param mixed $default Default value * * @return mixed The variable's value */ public function get(&$configuration, $var, $default) { $parts = explode('.', $var); $view = $parts[0]; $method = 'get' . ucfirst($parts[1]); if (!method_exists($this, $method)) { return $default; } array_shift($parts); array_shift($parts); $ret = $this->$method($view, $configuration, $parts, $default); return $ret; } /** * Internal method to return the magic field mapping * * @param string $table The table for which we will be fetching a field map * @param array &$configuration The configuration parameters hash array * @param array $params Extra options; key 0 defines the table we want to fetch * @param string $default Default magic field mapping; empty if not defined * * @return array Field map */ protected function getField($table, &$configuration, $params, $default = '') { $fieldmap = array(); if (isset($configuration['tables']['*']) && isset($configuration['tables']['*']['fields'])) { $fieldmap = $configuration['tables']['*']['fields']; } if (isset($configuration['tables'][$table]) && isset($configuration['tables'][$table]['fields'])) { $fieldmap = array_merge($fieldmap, $configuration['tables'][$table]['fields']); } $map = $default; if (empty($params[0])) { $map = $fieldmap; } elseif (isset($fieldmap[$params[0]])) { $map = $fieldmap[$params[0]]; } return $map; } /** * Internal method to get table alias * * @param string $table The table for which we will be fetching table alias * @param array &$configuration The configuration parameters hash array * @param array $params Extra options; key 0 defines the table we want to fetch * @param string $default Default table alias * * @return string Table alias */ protected function getTablealias($table, &$configuration, $params, $default = '') { $tablealias = $default; if (isset($configuration['tables']['*']) && isset($configuration['tables']['*']['tablealias']) && isset($configuration['tables']['*']['tablealias'][0])) { $tablealias = (string) $configuration['tables']['*']['tablealias'][0]; } if (isset($configuration['tables'][$table]) && isset($configuration['tables'][$table]['tablealias']) && isset($configuration['tables'][$table]['tablealias'][0])) { $tablealias = (string) $configuration['tables'][$table]['tablealias'][0]; } return $tablealias; } /** * Internal method to get table behaviours * * @param string $table The table for which we will be fetching table alias * @param array &$configuration The configuration parameters hash array * @param array $params Extra options; key 0 defines the table we want to fetch * @param string $default Default table alias * * @return string Table behaviours */ protected function getBehaviors($table, &$configuration, $params, $default = '') { $behaviors = $default; if (isset($configuration['tables']['*']) && isset($configuration['tables']['*']['behaviors'])) { $behaviors = (string) $configuration['tables']['*']['behaviors']; } if (isset($configuration['tables'][$table]) && isset($configuration['tables'][$table]['behaviors'])) { $behaviors = (string) $configuration['tables'][$table]['behaviors']; } return $behaviors; } /** * Internal method to get table relations * * @param string $table The table for which we will be fetching table alias * @param array &$configuration The configuration parameters hash array * @param array $params Extra options; key 0 defines the table we want to fetch * @param string $default Default table alias * * @return array Table relations */ protected function getRelations($table, &$configuration, $params, $default = '') { $relations = $default; if (isset($configuration['tables']['*']) && isset($configuration['tables']['*']['relations'])) { $relations = $configuration['tables']['*']['relations']; } if (isset($configuration['tables'][$table]) && isset($configuration['tables'][$table]['relations'])) { $relations = $configuration['tables'][$table]['relations']; } return $relations; } } PK���\�S�z��*libraries/fof/config/domain/dispatcher.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage config * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ defined('FOF_INCLUDED') or die(); /** * Configuration parser for the dispatcher-specific settings * * @package FrameworkOnFramework * @since 2.1 */ class FOFConfigDomainDispatcher implements FOFConfigDomainInterface { /** * Parse the XML data, adding them to the $ret array * * @param SimpleXMLElement $xml The XML data of the component's configuration area * @param array &$ret The parsed data, in the form of a hash array * * @return void */ public function parseDomain(SimpleXMLElement $xml, array &$ret) { // Initialise $ret['dispatcher'] = array(); // Parse the dispatcher configuration $dispatcherData = $xml->dispatcher; // Sanity check if (empty($dispatcherData)) { return; } $options = $xml->xpath('dispatcher/option'); if (!empty($options)) { foreach ($options as $option) { $key = (string) $option['name']; $ret['dispatcher'][$key] = (string) $option; } } } /** * Return a configuration variable * * @param string &$configuration Configuration variables (hashed array) * @param string $var The variable we want to fetch * @param mixed $default Default value * * @return mixed The variable's value */ public function get(&$configuration, $var, $default) { if (isset($configuration['dispatcher'][$var])) { return $configuration['dispatcher'][$var]; } else { return $default; } } } PK���\�`s ��libraries/fof/less/less.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage less * @copyright Copyright (C) 2010 - 2015 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; /** * This class is taken near verbatim (changes marked with **FOF** comment markers) from: * * lessphp v0.3.9 * http://leafo.net/lessphp * * LESS css compiler, adapted from http://lesscss.org * * Copyright 2012, Leaf Corcoran <leafot@gmail.com> * Licensed under MIT or GPLv3, see LICENSE * * THIS IS THIRD PARTY CODE. Code comments are mostly useless placeholders to * stop phpcs from complaining... * * @package FrameworkOnFramework * @since 2.0 */ class FOFLess { public static $VERSION = "v0.3.9"; protected static $TRUE = array("keyword", "true"); protected static $FALSE = array("keyword", "false"); protected $libFunctions = array(); protected $registeredVars = array(); protected $preserveComments = false; /** * Prefix of abstract properties * * @var string */ public $vPrefix = '@'; /** * Prefix of abstract blocks * * @var string */ public $mPrefix = '$'; public $parentSelector = '&'; public $importDisabled = false; public $importDir = ''; protected $numberPrecision = null; /** * Set to the parser that generated the current line when compiling * so we know how to create error messages * * @var FOFLessParser */ protected $sourceParser = null; protected $sourceLoc = null; public static $defaultValue = array("keyword", ""); /** * Uniquely identify imports * * @var integer */ protected static $nextImportId = 0; /** * Attempts to find the path of an import url, returns null for css files * * @param string $url The URL of the import * * @return string|null */ protected function findImport($url) { foreach ((array) $this->importDir as $dir) { $full = $dir . (substr($dir, -1) != '/' ? '/' : '') . $url; if ($this->fileExists($file = $full . '.less') || $this->fileExists($file = $full)) { return $file; } } return null; } /** * Does file $name exists? It's a simple proxy to JFile for now * * @param string $name The file we check for existence * * @return boolean */ protected function fileExists($name) { /** FOF - BEGIN CHANGE * */ return FOFPlatform::getInstance()->getIntegrationObject('filesystem')->fileExists($name); /** FOF - END CHANGE * */ } /** * Compresslist * * @param array $items Items * @param string $delim Delimiter * * @return array */ public static function compressList($items, $delim) { if (!isset($items[1]) && isset($items[0])) { return $items[0]; } else { return array('list', $delim, $items); } } /** * Quote for regular expression * * @param string $what What to quote * * @return string Quoted string */ public static function preg_quote($what) { return preg_quote($what, '/'); } /** * Try import * * @param string $importPath Import path * @param stdObject $parentBlock Parent block * @param string $out Out * * @return boolean */ protected function tryImport($importPath, $parentBlock, $out) { if ($importPath[0] == "function" && $importPath[1] == "url") { $importPath = $this->flattenList($importPath[2]); } $str = $this->coerceString($importPath); if ($str === null) { return false; } $url = $this->compileValue($this->lib_e($str)); // Don't import if it ends in css if (substr_compare($url, '.css', -4, 4) === 0) { return false; } $realPath = $this->findImport($url); if ($realPath === null) { return false; } if ($this->importDisabled) { return array(false, "/* import disabled */"); } $this->addParsedFile($realPath); $parser = $this->makeParser($realPath); $root = $parser->parse(file_get_contents($realPath)); // Set the parents of all the block props foreach ($root->props as $prop) { if ($prop[0] == "block") { $prop[1]->parent = $parentBlock; } } /** * Copy mixins into scope, set their parents, bring blocks from import * into current block * TODO: need to mark the source parser these came from this file */ foreach ($root->children as $childName => $child) { if (isset($parentBlock->children[$childName])) { $parentBlock->children[$childName] = array_merge( $parentBlock->children[$childName], $child ); } else { $parentBlock->children[$childName] = $child; } } $pi = pathinfo($realPath); $dir = $pi["dirname"]; list($top, $bottom) = $this->sortProps($root->props, true); $this->compileImportedProps($top, $parentBlock, $out, $parser, $dir); return array(true, $bottom, $parser, $dir); } /** * Compile Imported Props * * @param array $props Props * @param stdClass $block Block * @param string $out Out * @param FOFLessParser $sourceParser Source parser * @param string $importDir Import dir * * @return void */ protected function compileImportedProps($props, $block, $out, $sourceParser, $importDir) { $oldSourceParser = $this->sourceParser; $oldImport = $this->importDir; // TODO: this is because the importDir api is stupid $this->importDir = (array) $this->importDir; array_unshift($this->importDir, $importDir); foreach ($props as $prop) { $this->compileProp($prop, $block, $out); } $this->importDir = $oldImport; $this->sourceParser = $oldSourceParser; } /** * Recursively compiles a block. * * A block is analogous to a CSS block in most cases. A single LESS document * is encapsulated in a block when parsed, but it does not have parent tags * so all of it's children appear on the root level when compiled. * * Blocks are made up of props and children. * * Props are property instructions, array tuples which describe an action * to be taken, eg. write a property, set a variable, mixin a block. * * The children of a block are just all the blocks that are defined within. * This is used to look up mixins when performing a mixin. * * Compiling the block involves pushing a fresh environment on the stack, * and iterating through the props, compiling each one. * * @param stdClass $block Block * * @see FOFLess::compileProp() * * @return void */ protected function compileBlock($block) { switch ($block->type) { case "root": $this->compileRoot($block); break; case null: $this->compileCSSBlock($block); break; case "media": $this->compileMedia($block); break; case "directive": $name = "@" . $block->name; if (!empty($block->value)) { $name .= " " . $this->compileValue($this->reduce($block->value)); } $this->compileNestedBlock($block, array($name)); break; default: $this->throwError("unknown block type: $block->type\n"); } } /** * Compile CSS block * * @param stdClass $block Block to compile * * @return void */ protected function compileCSSBlock($block) { $env = $this->pushEnv(); $selectors = $this->compileSelectors($block->tags); $env->selectors = $this->multiplySelectors($selectors); $out = $this->makeOutputBlock(null, $env->selectors); $this->scope->children[] = $out; $this->compileProps($block, $out); // Mixins carry scope with them! $block->scope = $env; $this->popEnv(); } /** * Compile media * * @param stdClass $media Media * * @return void */ protected function compileMedia($media) { $env = $this->pushEnv($media); $parentScope = $this->mediaParent($this->scope); $query = $this->compileMediaQuery($this->multiplyMedia($env)); $this->scope = $this->makeOutputBlock($media->type, array($query)); $parentScope->children[] = $this->scope; $this->compileProps($media, $this->scope); if (count($this->scope->lines) > 0) { $orphanSelelectors = $this->findClosestSelectors(); if (!is_null($orphanSelelectors)) { $orphan = $this->makeOutputBlock(null, $orphanSelelectors); $orphan->lines = $this->scope->lines; array_unshift($this->scope->children, $orphan); $this->scope->lines = array(); } } $this->scope = $this->scope->parent; $this->popEnv(); } /** * Media parent * * @param stdClass $scope Scope * * @return stdClass */ protected function mediaParent($scope) { while (!empty($scope->parent)) { if (!empty($scope->type) && $scope->type != "media") { break; } $scope = $scope->parent; } return $scope; } /** * Compile nested block * * @param stdClass $block Block * @param array $selectors Selectors * * @return void */ protected function compileNestedBlock($block, $selectors) { $this->pushEnv($block); $this->scope = $this->makeOutputBlock($block->type, $selectors); $this->scope->parent->children[] = $this->scope; $this->compileProps($block, $this->scope); $this->scope = $this->scope->parent; $this->popEnv(); } /** * Compile root * * @param stdClass $root Root * * @return void */ protected function compileRoot($root) { $this->pushEnv(); $this->scope = $this->makeOutputBlock($root->type); $this->compileProps($root, $this->scope); $this->popEnv(); } /** * Compile props * * @param type $block Something * @param type $out Something * * @return void */ protected function compileProps($block, $out) { foreach ($this->sortProps($block->props) as $prop) { $this->compileProp($prop, $block, $out); } } /** * Sort props * * @param type $props X * @param type $split X * * @return type */ protected function sortProps($props, $split = false) { $vars = array(); $imports = array(); $other = array(); foreach ($props as $prop) { switch ($prop[0]) { case "assign": if (isset($prop[1][0]) && $prop[1][0] == $this->vPrefix) { $vars[] = $prop; } else { $other[] = $prop; } break; case "import": $id = self::$nextImportId++; $prop[] = $id; $imports[] = $prop; $other[] = array("import_mixin", $id); break; default: $other[] = $prop; } } if ($split) { return array(array_merge($vars, $imports), $other); } else { return array_merge($vars, $imports, $other); } } /** * Compile media query * * @param type $queries Queries * * @return string */ protected function compileMediaQuery($queries) { $compiledQueries = array(); foreach ($queries as $query) { $parts = array(); foreach ($query as $q) { switch ($q[0]) { case "mediaType": $parts[] = implode(" ", array_slice($q, 1)); break; case "mediaExp": if (isset($q[2])) { $parts[] = "($q[1]: " . $this->compileValue($this->reduce($q[2])) . ")"; } else { $parts[] = "($q[1])"; } break; case "variable": $parts[] = $this->compileValue($this->reduce($q)); break; } } if (count($parts) > 0) { $compiledQueries[] = implode(" and ", $parts); } } $out = "@media"; if (!empty($parts)) { $out .= " " . implode($this->formatter->selectorSeparator, $compiledQueries); } return $out; } /** * Multiply media * * @param type $env X * @param type $childQueries X * * @return type */ protected function multiplyMedia($env, $childQueries = null) { if (is_null($env) || !empty($env->block->type) && $env->block->type != "media") { return $childQueries; } // Plain old block, skip if (empty($env->block->type)) { return $this->multiplyMedia($env->parent, $childQueries); } $out = array(); $queries = $env->block->queries; if (is_null($childQueries)) { $out = $queries; } else { foreach ($queries as $parent) { foreach ($childQueries as $child) { $out[] = array_merge($parent, $child); } } } return $this->multiplyMedia($env->parent, $out); } /** * Expand parent selectors * * @param type &$tag Tag * @param type $replace Replace * * @return type */ protected function expandParentSelectors(&$tag, $replace) { $parts = explode("$&$", $tag); $count = 0; foreach ($parts as &$part) { $part = str_replace($this->parentSelector, $replace, $part, $c); $count += $c; } $tag = implode($this->parentSelector, $parts); return $count; } /** * Find closest selectors * * @return array */ protected function findClosestSelectors() { $env = $this->env; $selectors = null; while ($env !== null) { if (isset($env->selectors)) { $selectors = $env->selectors; break; } $env = $env->parent; } return $selectors; } /** * Multiply $selectors against the nearest selectors in env * * @param array $selectors The selectors * * @return array */ protected function multiplySelectors($selectors) { // Find parent selectors $parentSelectors = $this->findClosestSelectors(); if (is_null($parentSelectors)) { // Kill parent reference in top level selector foreach ($selectors as &$s) { $this->expandParentSelectors($s, ""); } return $selectors; } $out = array(); foreach ($parentSelectors as $parent) { foreach ($selectors as $child) { $count = $this->expandParentSelectors($child, $parent); // Don't prepend the parent tag if & was used if ($count > 0) { $out[] = trim($child); } else { $out[] = trim($parent . ' ' . $child); } } } return $out; } /** * Reduces selector expressions * * @param array $selectors The selector expressions * * @return array */ protected function compileSelectors($selectors) { $out = array(); foreach ($selectors as $s) { if (is_array($s)) { list(, $value) = $s; $out[] = trim($this->compileValue($this->reduce($value))); } else { $out[] = $s; } } return $out; } /** * Equality check * * @param mixed $left Left operand * @param mixed $right Right operand * * @return boolean True if equal */ protected function eq($left, $right) { return $left == $right; } /** * Pattern match * * @param type $block X * @param type $callingArgs X * * @return boolean */ protected function patternMatch($block, $callingArgs) { /** * Match the guards if it has them * any one of the groups must have all its guards pass for a match */ if (!empty($block->guards)) { $groupPassed = false; foreach ($block->guards as $guardGroup) { foreach ($guardGroup as $guard) { $this->pushEnv(); $this->zipSetArgs($block->args, $callingArgs); $negate = false; if ($guard[0] == "negate") { $guard = $guard[1]; $negate = true; } $passed = $this->reduce($guard) == self::$TRUE; if ($negate) { $passed = !$passed; } $this->popEnv(); if ($passed) { $groupPassed = true; } else { $groupPassed = false; break; } } if ($groupPassed) { break; } } if (!$groupPassed) { return false; } } $numCalling = count($callingArgs); if (empty($block->args)) { return $block->isVararg || $numCalling == 0; } // No args $i = -1; // Try to match by arity or by argument literal foreach ($block->args as $i => $arg) { switch ($arg[0]) { case "lit": if (empty($callingArgs[$i]) || !$this->eq($arg[1], $callingArgs[$i])) { return false; } break; case "arg": // No arg and no default value if (!isset($callingArgs[$i]) && !isset($arg[2])) { return false; } break; case "rest": // Rest can be empty $i--; break 2; } } if ($block->isVararg) { // Not having enough is handled above return true; } else { $numMatched = $i + 1; // Greater than becuase default values always match return $numMatched >= $numCalling; } } /** * Pattern match all * * @param type $blocks X * @param type $callingArgs X * * @return type */ protected function patternMatchAll($blocks, $callingArgs) { $matches = null; foreach ($blocks as $block) { if ($this->patternMatch($block, $callingArgs)) { $matches[] = $block; } } return $matches; } /** * Attempt to find blocks matched by path and args * * @param array $searchIn Block to search in * @param string $path The path to search for * @param array $args Arguments * @param array $seen Your guess is as good as mine; that's third party code * * @return null */ protected function findBlocks($searchIn, $path, $args, $seen = array()) { if ($searchIn == null) { return null; } if (isset($seen[$searchIn->id])) { return null; } $seen[$searchIn->id] = true; $name = $path[0]; if (isset($searchIn->children[$name])) { $blocks = $searchIn->children[$name]; if (count($path) == 1) { $matches = $this->patternMatchAll($blocks, $args); if (!empty($matches)) { // This will return all blocks that match in the closest // scope that has any matching block, like lessjs return $matches; } } else { $matches = array(); foreach ($blocks as $subBlock) { $subMatches = $this->findBlocks($subBlock, array_slice($path, 1), $args, $seen); if (!is_null($subMatches)) { foreach ($subMatches as $sm) { $matches[] = $sm; } } } return count($matches) > 0 ? $matches : null; } } if ($searchIn->parent === $searchIn) { return null; } return $this->findBlocks($searchIn->parent, $path, $args, $seen); } /** * Sets all argument names in $args to either the default value * or the one passed in through $values * * @param array $args Arguments * @param array $values Values * * @return void */ protected function zipSetArgs($args, $values) { $i = 0; $assignedValues = array(); foreach ($args as $a) { if ($a[0] == "arg") { if ($i < count($values) && !is_null($values[$i])) { $value = $values[$i]; } elseif (isset($a[2])) { $value = $a[2]; } else { $value = null; } $value = $this->reduce($value); $this->set($a[1], $value); $assignedValues[] = $value; } $i++; } // Check for a rest $last = end($args); if ($last[0] == "rest") { $rest = array_slice($values, count($args) - 1); $this->set($last[1], $this->reduce(array("list", " ", $rest))); } $this->env->arguments = $assignedValues; } /** * Compile a prop and update $lines or $blocks appropriately * * @param array $prop Prop * @param stdClass $block Block * @param string $out Out * * @return void */ protected function compileProp($prop, $block, $out) { // Set error position context $this->sourceLoc = isset($prop[-1]) ? $prop[-1] : -1; switch ($prop[0]) { case 'assign': list(, $name, $value) = $prop; if ($name[0] == $this->vPrefix) { $this->set($name, $value); } else { $out->lines[] = $this->formatter->property($name, $this->compileValue($this->reduce($value))); } break; case 'block': list(, $child) = $prop; $this->compileBlock($child); break; case 'mixin': list(, $path, $args, $suffix) = $prop; $args = array_map(array($this, "reduce"), (array) $args); $mixins = $this->findBlocks($block, $path, $args); if ($mixins === null) { // Throw error here?? break; } foreach ($mixins as $mixin) { $haveScope = false; if (isset($mixin->parent->scope)) { $haveScope = true; $mixinParentEnv = $this->pushEnv(); $mixinParentEnv->storeParent = $mixin->parent->scope; } $haveArgs = false; if (isset($mixin->args)) { $haveArgs = true; $this->pushEnv(); $this->zipSetArgs($mixin->args, $args); } $oldParent = $mixin->parent; if ($mixin != $block) { $mixin->parent = $block; } foreach ($this->sortProps($mixin->props) as $subProp) { if ($suffix !== null && $subProp[0] == "assign" && is_string($subProp[1]) && $subProp[1]{0} != $this->vPrefix) { $subProp[2] = array( 'list', ' ', array($subProp[2], array('keyword', $suffix)) ); } $this->compileProp($subProp, $mixin, $out); } $mixin->parent = $oldParent; if ($haveArgs) { $this->popEnv(); } if ($haveScope) { $this->popEnv(); } } break; case 'raw': $out->lines[] = $prop[1]; break; case "directive": list(, $name, $value) = $prop; $out->lines[] = "@$name " . $this->compileValue($this->reduce($value)) . ';'; break; case "comment": $out->lines[] = $prop[1]; break; case "import"; list(, $importPath, $importId) = $prop; $importPath = $this->reduce($importPath); if (!isset($this->env->imports)) { $this->env->imports = array(); } $result = $this->tryImport($importPath, $block, $out); $this->env->imports[$importId] = $result === false ? array(false, "@import " . $this->compileValue($importPath) . ";") : $result; break; case "import_mixin": list(, $importId) = $prop; $import = $this->env->imports[$importId]; if ($import[0] === false) { $out->lines[] = $import[1]; } else { list(, $bottom, $parser, $importDir) = $import; $this->compileImportedProps($bottom, $block, $out, $parser, $importDir); } break; default: $this->throwError("unknown op: {$prop[0]}\n"); } } /** * Compiles a primitive value into a CSS property value. * * Values in lessphp are typed by being wrapped in arrays, their format is * typically: * * array(type, contents [, additional_contents]*) * * The input is expected to be reduced. This function will not work on * things like expressions and variables. * * @param array $value Value * * @return void */ protected function compileValue($value) { switch ($value[0]) { case 'list': // [1] - delimiter // [2] - array of values return implode($value[1], array_map(array($this, 'compileValue'), $value[2])); case 'raw_color': if (!empty($this->formatter->compressColors)) { return $this->compileValue($this->coerceColor($value)); } return $value[1]; case 'keyword': // [1] - the keyword return $value[1]; case 'number': // Format: [1] - the number -- [2] - the unit list(, $num, $unit) = $value; if ($this->numberPrecision !== null) { $num = round($num, $this->numberPrecision); } return $num . $unit; case 'string': // [1] - contents of string (includes quotes) list(, $delim, $content) = $value; foreach ($content as &$part) { if (is_array($part)) { $part = $this->compileValue($part); } } return $delim . implode($content) . $delim; case 'color': /** * Format: * * [1] - red component (either number or a %) * [2] - green component * [3] - blue component * [4] - optional alpha component */ list(, $r, $g, $b) = $value; $r = round($r); $g = round($g); $b = round($b); if (count($value) == 5 && $value[4] != 1) { // Return an rgba value return 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $value[4] . ')'; } $h = sprintf("#%02x%02x%02x", $r, $g, $b); if (!empty($this->formatter->compressColors)) { // Converting hex color to short notation (e.g. #003399 to #039) if ($h[1] === $h[2] && $h[3] === $h[4] && $h[5] === $h[6]) { $h = '#' . $h[1] . $h[3] . $h[5]; } } return $h; case 'function': list(, $name, $args) = $value; return $name . '(' . $this->compileValue($args) . ')'; default: // Assumed to be unit $this->throwError("unknown value type: $value[0]"); } } /** * Lib is number * * @param type $value X * * @return boolean */ protected function lib_isnumber($value) { return $this->toBool($value[0] == "number"); } /** * Lib is string * * @param type $value X * * @return boolean */ protected function lib_isstring($value) { return $this->toBool($value[0] == "string"); } /** * Lib is color * * @param type $value X * * @return boolean */ protected function lib_iscolor($value) { return $this->toBool($this->coerceColor($value)); } /** * Lib is keyword * * @param type $value X * * @return boolean */ protected function lib_iskeyword($value) { return $this->toBool($value[0] == "keyword"); } /** * Lib is pixel * * @param type $value X * * @return boolean */ protected function lib_ispixel($value) { return $this->toBool($value[0] == "number" && $value[2] == "px"); } /** * Lib is percentage * * @param type $value X * * @return boolean */ protected function lib_ispercentage($value) { return $this->toBool($value[0] == "number" && $value[2] == "%"); } /** * Lib is em * * @param type $value X * * @return boolean */ protected function lib_isem($value) { return $this->toBool($value[0] == "number" && $value[2] == "em"); } /** * Lib is rem * * @param type $value X * * @return boolean */ protected function lib_isrem($value) { return $this->toBool($value[0] == "number" && $value[2] == "rem"); } /** * LIb rgba hex * * @param type $color X * * @return boolean */ protected function lib_rgbahex($color) { $color = $this->coerceColor($color); if (is_null($color)) { $this->throwError("color expected for rgbahex"); } return sprintf("#%02x%02x%02x%02x", isset($color[4]) ? $color[4] * 255 : 255, $color[1], $color[2], $color[3]); } /** * Lib argb * * @param type $color X * * @return type */ protected function lib_argb($color) { return $this->lib_rgbahex($color); } /** * Utility func to unquote a string * * @param string $arg Arg * * @return string */ protected function lib_e($arg) { switch ($arg[0]) { case "list": $items = $arg[2]; if (isset($items[0])) { return $this->lib_e($items[0]); } return self::$defaultValue; case "string": $arg[1] = ""; return $arg; case "keyword": return $arg; default: return array("keyword", $this->compileValue($arg)); } } /** * Lib sprintf * * @param type $args X * * @return type */ protected function lib__sprintf($args) { if ($args[0] != "list") { return $args; } $values = $args[2]; $string = array_shift($values); $template = $this->compileValue($this->lib_e($string)); $i = 0; if (preg_match_all('/%[dsa]/', $template, $m)) { foreach ($m[0] as $match) { $val = isset($values[$i]) ? $this->reduce($values[$i]) : array('keyword', ''); // Lessjs compat, renders fully expanded color, not raw color if ($color = $this->coerceColor($val)) { $val = $color; } $i++; $rep = $this->compileValue($this->lib_e($val)); $template = preg_replace('/' . self::preg_quote($match) . '/', $rep, $template, 1); } } $d = $string[0] == "string" ? $string[1] : '"'; return array("string", $d, array($template)); } /** * Lib floor * * @param type $arg X * * @return array */ protected function lib_floor($arg) { $value = $this->assertNumber($arg); return array("number", floor($value), $arg[2]); } /** * Lib ceil * * @param type $arg X * * @return array */ protected function lib_ceil($arg) { $value = $this->assertNumber($arg); return array("number", ceil($value), $arg[2]); } /** * Lib round * * @param type $arg X * * @return array */ protected function lib_round($arg) { $value = $this->assertNumber($arg); return array("number", round($value), $arg[2]); } /** * Lib unit * * @param type $arg X * * @return array */ protected function lib_unit($arg) { if ($arg[0] == "list") { list($number, $newUnit) = $arg[2]; return array("number", $this->assertNumber($number), $this->compileValue($this->lib_e($newUnit))); } else { return array("number", $this->assertNumber($arg), ""); } } /** * Helper function to get arguments for color manipulation functions. * takes a list that contains a color like thing and a percentage * * @param array $args Args * * @return array */ protected function colorArgs($args) { if ($args[0] != 'list' || count($args[2]) < 2) { return array(array('color', 0, 0, 0), 0); } list($color, $delta) = $args[2]; $color = $this->assertColor($color); $delta = floatval($delta[1]); return array($color, $delta); } /** * Lib darken * * @param type $args X * * @return type */ protected function lib_darken($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[3] = $this->clamp($hsl[3] - $delta, 100); return $this->toRGB($hsl); } /** * Lib lighten * * @param type $args X * * @return type */ protected function lib_lighten($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[3] = $this->clamp($hsl[3] + $delta, 100); return $this->toRGB($hsl); } /** * Lib saturate * * @param type $args X * * @return type */ protected function lib_saturate($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[2] = $this->clamp($hsl[2] + $delta, 100); return $this->toRGB($hsl); } /** * Lib desaturate * * @param type $args X * * @return type */ protected function lib_desaturate($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[2] = $this->clamp($hsl[2] - $delta, 100); return $this->toRGB($hsl); } /** * Lib spin * * @param type $args X * * @return type */ protected function lib_spin($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[1] = $hsl[1] + $delta % 360; if ($hsl[1] < 0) { $hsl[1] += 360; } return $this->toRGB($hsl); } /** * Lib fadeout * * @param type $args X * * @return type */ protected function lib_fadeout($args) { list($color, $delta) = $this->colorArgs($args); $color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) - $delta / 100); return $color; } /** * Lib fadein * * @param type $args X * * @return type */ protected function lib_fadein($args) { list($color, $delta) = $this->colorArgs($args); $color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) + $delta / 100); return $color; } /** * Lib hue * * @param type $color X * * @return type */ protected function lib_hue($color) { $hsl = $this->toHSL($this->assertColor($color)); return round($hsl[1]); } /** * Lib saturation * * @param type $color X * * @return type */ protected function lib_saturation($color) { $hsl = $this->toHSL($this->assertColor($color)); return round($hsl[2]); } /** * Lib lightness * * @param type $color X * * @return type */ protected function lib_lightness($color) { $hsl = $this->toHSL($this->assertColor($color)); return round($hsl[3]); } /** * Get the alpha of a color * Defaults to 1 for non-colors or colors without an alpha * * @param string $value Value * * @return string */ protected function lib_alpha($value) { if (!is_null($color = $this->coerceColor($value))) { return isset($color[4]) ? $color[4] : 1; } } /** * Set the alpha of the color * * @param array $args Args * * @return string */ protected function lib_fade($args) { list($color, $alpha) = $this->colorArgs($args); $color[4] = $this->clamp($alpha / 100.0); return $color; } /** * Third party code; your guess is as good as mine * * @param array $arg Arg * * @return string */ protected function lib_percentage($arg) { $num = $this->assertNumber($arg); return array("number", $num * 100, "%"); } /** * mixes two colors by weight * mix(@color1, @color2, @weight); * http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method * * @param array $args Args * * @return string */ protected function lib_mix($args) { if ($args[0] != "list" || count($args[2]) < 3) { $this->throwError("mix expects (color1, color2, weight)"); } list($first, $second, $weight) = $args[2]; $first = $this->assertColor($first); $second = $this->assertColor($second); $first_a = $this->lib_alpha($first); $second_a = $this->lib_alpha($second); $weight = $weight[1] / 100.0; $w = $weight * 2 - 1; $a = $first_a - $second_a; $w1 = (($w * $a == -1 ? $w : ($w + $a) / (1 + $w * $a)) + 1) / 2.0; $w2 = 1.0 - $w1; $new = array('color', $w1 * $first[1] + $w2 * $second[1], $w1 * $first[2] + $w2 * $second[2], $w1 * $first[3] + $w2 * $second[3], ); if ($first_a != 1.0 || $second_a != 1.0) { $new[] = $first_a * $weight + $second_a * ($weight - 1); } return $this->fixColor($new); } /** * Third party code; your guess is as good as mine * * @param array $arg Arg * * @return string */ protected function lib_contrast($args) { if ($args[0] != 'list' || count($args[2]) < 3) { return array(array('color', 0, 0, 0), 0); } list($inputColor, $darkColor, $lightColor) = $args[2]; $inputColor = $this->assertColor($inputColor); $darkColor = $this->assertColor($darkColor); $lightColor = $this->assertColor($lightColor); $hsl = $this->toHSL($inputColor); if ($hsl[3] > 50) { return $darkColor; } return $lightColor; } /** * Assert color * * @param type $value X * @param type $error X * * @return type */ protected function assertColor($value, $error = "expected color value") { $color = $this->coerceColor($value); if (is_null($color)) { $this->throwError($error); } return $color; } /** * Assert number * * @param type $value X * @param type $error X * * @return type */ protected function assertNumber($value, $error = "expecting number") { if ($value[0] == "number") { return $value[1]; } $this->throwError($error); } /** * To HSL * * @param type $color X * * @return type */ protected function toHSL($color) { if ($color[0] == 'hsl') { return $color; } $r = $color[1] / 255; $g = $color[2] / 255; $b = $color[3] / 255; $min = min($r, $g, $b); $max = max($r, $g, $b); $L = ($min + $max) / 2; if ($min == $max) { $S = $H = 0; } else { if ($L < 0.5) { $S = ($max - $min) / ($max + $min); } else { $S = ($max - $min) / (2.0 - $max - $min); } if ($r == $max) { $H = ($g - $b) / ($max - $min); } elseif ($g == $max) { $H = 2.0 + ($b - $r) / ($max - $min); } elseif ($b == $max) { $H = 4.0 + ($r - $g) / ($max - $min); } } $out = array('hsl', ($H < 0 ? $H + 6 : $H) * 60, $S * 100, $L * 100, ); if (count($color) > 4) { // Copy alpha $out[] = $color[4]; } return $out; } /** * To RGB helper * * @param type $comp X * @param type $temp1 X * @param type $temp2 X * * @return type */ protected function toRGB_helper($comp, $temp1, $temp2) { if ($comp < 0) { $comp += 1.0; } elseif ($comp > 1) { $comp -= 1.0; } if (6 * $comp < 1) { return $temp1 + ($temp2 - $temp1) * 6 * $comp; } if (2 * $comp < 1) { return $temp2; } if (3 * $comp < 2) { return $temp1 + ($temp2 - $temp1) * ((2 / 3) - $comp) * 6; } return $temp1; } /** * Converts a hsl array into a color value in rgb. * Expects H to be in range of 0 to 360, S and L in 0 to 100 * * @param type $color X * * @return type */ protected function toRGB($color) { if ($color == 'color') { return $color; } $H = $color[1] / 360; $S = $color[2] / 100; $L = $color[3] / 100; if ($S == 0) { $r = $g = $b = $L; } else { $temp2 = $L < 0.5 ? $L * (1.0 + $S) : $L + $S - $L * $S; $temp1 = 2.0 * $L - $temp2; $r = $this->toRGB_helper($H + 1 / 3, $temp1, $temp2); $g = $this->toRGB_helper($H, $temp1, $temp2); $b = $this->toRGB_helper($H - 1 / 3, $temp1, $temp2); } // $out = array('color', round($r*255), round($g*255), round($b*255)); $out = array('color', $r * 255, $g * 255, $b * 255); if (count($color) > 4) { // Copy alpha $out[] = $color[4]; } return $out; } /** * Clamp * * @param type $v X * @param type $max X * @param type $min X * * @return type */ protected function clamp($v, $max = 1, $min = 0) { return min($max, max($min, $v)); } /** * Convert the rgb, rgba, hsl color literals of function type * as returned by the parser into values of color type. * * @param type $func X * * @return type */ protected function funcToColor($func) { $fname = $func[1]; if ($func[2][0] != 'list') { // Need a list of arguments return false; } $rawComponents = $func[2][2]; if ($fname == 'hsl' || $fname == 'hsla') { $hsl = array('hsl'); $i = 0; foreach ($rawComponents as $c) { $val = $this->reduce($c); $val = isset($val[1]) ? floatval($val[1]) : 0; if ($i == 0) { $clamp = 360; } elseif ($i < 3) { $clamp = 100; } else { $clamp = 1; } $hsl[] = $this->clamp($val, $clamp); $i++; } while (count($hsl) < 4) { $hsl[] = 0; } return $this->toRGB($hsl); } elseif ($fname == 'rgb' || $fname == 'rgba') { $components = array(); $i = 1; foreach ($rawComponents as $c) { $c = $this->reduce($c); if ($i < 4) { if ($c[0] == "number" && $c[2] == "%") { $components[] = 255 * ($c[1] / 100); } else { $components[] = floatval($c[1]); } } elseif ($i == 4) { if ($c[0] == "number" && $c[2] == "%") { $components[] = 1.0 * ($c[1] / 100); } else { $components[] = floatval($c[1]); } } else { break; } $i++; } while (count($components) < 3) { $components[] = 0; } array_unshift($components, 'color'); return $this->fixColor($components); } return false; } /** * Reduce * * @param type $value X * @param type $forExpression X * * @return type */ protected function reduce($value, $forExpression = false) { switch ($value[0]) { case "interpolate": $reduced = $this->reduce($value[1]); $var = $this->compileValue($reduced); $res = $this->reduce(array("variable", $this->vPrefix . $var)); if (empty($value[2])) { $res = $this->lib_e($res); } return $res; case "variable": $key = $value[1]; if (is_array($key)) { $key = $this->reduce($key); $key = $this->vPrefix . $this->compileValue($this->lib_e($key)); } $seen = & $this->env->seenNames; if (!empty($seen[$key])) { $this->throwError("infinite loop detected: $key"); } $seen[$key] = true; $out = $this->reduce($this->get($key, self::$defaultValue)); $seen[$key] = false; return $out; case "list": foreach ($value[2] as &$item) { $item = $this->reduce($item, $forExpression); } return $value; case "expression": return $this->evaluate($value); case "string": foreach ($value[2] as &$part) { if (is_array($part)) { $strip = $part[0] == "variable"; $part = $this->reduce($part); if ($strip) { $part = $this->lib_e($part); } } } return $value; case "escape": list(, $inner) = $value; return $this->lib_e($this->reduce($inner)); case "function": $color = $this->funcToColor($value); if ($color) { return $color; } list(, $name, $args) = $value; if ($name == "%") { $name = "_sprintf"; } $f = isset($this->libFunctions[$name]) ? $this->libFunctions[$name] : array($this, 'lib_' . $name); if (is_callable($f)) { if ($args[0] == 'list') { $args = self::compressList($args[2], $args[1]); } $ret = call_user_func($f, $this->reduce($args, true), $this); if (is_null($ret)) { return array("string", "", array( $name, "(", $args, ")" )); } // Convert to a typed value if the result is a php primitive if (is_numeric($ret)) { $ret = array('number', $ret, ""); } elseif (!is_array($ret)) { $ret = array('keyword', $ret); } return $ret; } // Plain function, reduce args $value[2] = $this->reduce($value[2]); return $value; case "unary": list(, $op, $exp) = $value; $exp = $this->reduce($exp); if ($exp[0] == "number") { switch ($op) { case "+": return $exp; case "-": $exp[1] *= -1; return $exp; } } return array("string", "", array($op, $exp)); } if ($forExpression) { switch ($value[0]) { case "keyword": if ($color = $this->coerceColor($value)) { return $color; } break; case "raw_color": return $this->coerceColor($value); } } return $value; } /** * Coerce a value for use in color operation * * @param type $value X * * @return null */ protected function coerceColor($value) { switch ($value[0]) { case 'color': return $value; case 'raw_color': $c = array("color", 0, 0, 0); $colorStr = substr($value[1], 1); $num = hexdec($colorStr); $width = strlen($colorStr) == 3 ? 16 : 256; for ($i = 3; $i > 0; $i--) { // It's 3 2 1 $t = $num % $width; $num /= $width; $c[$i] = $t * (256 / $width) + $t * floor(16 / $width); } return $c; case 'keyword': $name = $value[1]; if (isset(self::$cssColors[$name])) { $rgba = explode(',', self::$cssColors[$name]); if (isset($rgba[3])) { return array('color', $rgba[0], $rgba[1], $rgba[2], $rgba[3]); } return array('color', $rgba[0], $rgba[1], $rgba[2]); } return null; } } /** * Make something string like into a string * * @param type $value X * * @return null */ protected function coerceString($value) { switch ($value[0]) { case "string": return $value; case "keyword": return array("string", "", array($value[1])); } return null; } /** * Turn list of length 1 into value type * * @param type $value X * * @return type */ protected function flattenList($value) { if ($value[0] == "list" && count($value[2]) == 1) { return $this->flattenList($value[2][0]); } return $value; } /** * To bool * * @param type $a X * * @return type */ protected function toBool($a) { if ($a) { return self::$TRUE; } else { return self::$FALSE; } } /** * Evaluate an expression * * @param type $exp X * * @return type */ protected function evaluate($exp) { list(, $op, $left, $right, $whiteBefore, $whiteAfter) = $exp; $left = $this->reduce($left, true); $right = $this->reduce($right, true); if ($leftColor = $this->coerceColor($left)) { $left = $leftColor; } if ($rightColor = $this->coerceColor($right)) { $right = $rightColor; } $ltype = $left[0]; $rtype = $right[0]; // Operators that work on all types if ($op == "and") { return $this->toBool($left == self::$TRUE && $right == self::$TRUE); } if ($op == "=") { return $this->toBool($this->eq($left, $right)); } if ($op == "+" && !is_null($str = $this->stringConcatenate($left, $right))) { return $str; } // Type based operators $fname = "op_${ltype}_${rtype}"; if (is_callable(array($this, $fname))) { $out = $this->$fname($op, $left, $right); if (!is_null($out)) { return $out; } } // Make the expression look it did before being parsed $paddedOp = $op; if ($whiteBefore) { $paddedOp = " " . $paddedOp; } if ($whiteAfter) { $paddedOp .= " "; } return array("string", "", array($left, $paddedOp, $right)); } /** * String concatenate * * @param type $left X * @param string $right X * * @return string */ protected function stringConcatenate($left, $right) { if ($strLeft = $this->coerceString($left)) { if ($right[0] == "string") { $right[1] = ""; } $strLeft[2][] = $right; return $strLeft; } if ($strRight = $this->coerceString($right)) { array_unshift($strRight[2], $left); return $strRight; } } /** * Make sure a color's components don't go out of bounds * * @param type $c X * * @return int */ protected function fixColor($c) { foreach (range(1, 3) as $i) { if ($c[$i] < 0) { $c[$i] = 0; } if ($c[$i] > 255) { $c[$i] = 255; } } return $c; } /** * Op number color * * @param type $op X * @param type $lft X * @param type $rgt X * * @return type */ protected function op_number_color($op, $lft, $rgt) { if ($op == '+' || $op == '*') { return $this->op_color_number($op, $rgt, $lft); } } /** * Op color number * * @param type $op X * @param type $lft X * @param int $rgt X * * @return type */ protected function op_color_number($op, $lft, $rgt) { if ($rgt[0] == '%') { $rgt[1] /= 100; } return $this->op_color_color($op, $lft, array_fill(1, count($lft) - 1, $rgt[1])); } /** * Op color color * * @param type $op X * @param type $left X * @param type $right X * * @return type */ protected function op_color_color($op, $left, $right) { $out = array('color'); $max = count($left) > count($right) ? count($left) : count($right); foreach (range(1, $max - 1) as $i) { $lval = isset($left[$i]) ? $left[$i] : 0; $rval = isset($right[$i]) ? $right[$i] : 0; switch ($op) { case '+': $out[] = $lval + $rval; break; case '-': $out[] = $lval - $rval; break; case '*': $out[] = $lval * $rval; break; case '%': $out[] = $lval % $rval; break; case '/': if ($rval == 0) { $this->throwError("evaluate error: can't divide by zero"); } $out[] = $lval / $rval; break; default: $this->throwError('evaluate error: color op number failed on op ' . $op); } } return $this->fixColor($out); } /** * Lib red * * @param type $color X * * @return type */ public function lib_red($color) { $color = $this->coerceColor($color); if (is_null($color)) { $this->throwError('color expected for red()'); } return $color[1]; } /** * Lib green * * @param type $color X * * @return type */ public function lib_green($color) { $color = $this->coerceColor($color); if (is_null($color)) { $this->throwError('color expected for green()'); } return $color[2]; } /** * Lib blue * * @param type $color X * * @return type */ public function lib_blue($color) { $color = $this->coerceColor($color); if (is_null($color)) { $this->throwError('color expected for blue()'); } return $color[3]; } /** * Operator on two numbers * * @param type $op X * @param type $left X * @param type $right X * * @return type */ protected function op_number_number($op, $left, $right) { $unit = empty($left[2]) ? $right[2] : $left[2]; $value = 0; switch ($op) { case '+': $value = $left[1] + $right[1]; break; case '*': $value = $left[1] * $right[1]; break; case '-': $value = $left[1] - $right[1]; break; case '%': $value = $left[1] % $right[1]; break; case '/': if ($right[1] == 0) { $this->throwError('parse error: divide by zero'); } $value = $left[1] / $right[1]; break; case '<': return $this->toBool($left[1] < $right[1]); case '>': return $this->toBool($left[1] > $right[1]); case '>=': return $this->toBool($left[1] >= $right[1]); case '=<': return $this->toBool($left[1] <= $right[1]); default: $this->throwError('parse error: unknown number operator: ' . $op); } return array("number", $value, $unit); } /** * Make output block * * @param type $type X * @param type $selectors X * * @return stdclass */ protected function makeOutputBlock($type, $selectors = null) { $b = new stdclass; $b->lines = array(); $b->children = array(); $b->selectors = $selectors; $b->type = $type; $b->parent = $this->scope; return $b; } /** * The state of execution * * @param type $block X * * @return stdclass */ protected function pushEnv($block = null) { $e = new stdclass; $e->parent = $this->env; $e->store = array(); $e->block = $block; $this->env = $e; return $e; } /** * Pop something off the stack * * @return type */ protected function popEnv() { $old = $this->env; $this->env = $this->env->parent; return $old; } /** * Set something in the current env * * @param type $name X * @param type $value X * * @return void */ protected function set($name, $value) { $this->env->store[$name] = $value; } /** * Get the highest occurrence entry for a name * * @param type $name X * @param type $default X * * @return type */ protected function get($name, $default = null) { $current = $this->env; $isArguments = $name == $this->vPrefix . 'arguments'; while ($current) { if ($isArguments && isset($current->arguments)) { return array('list', ' ', $current->arguments); } if (isset($current->store[$name])) { return $current->store[$name]; } else { $current = isset($current->storeParent) ? $current->storeParent : $current->parent; } } return $default; } /** * Inject array of unparsed strings into environment as variables * * @param type $args X * * @return void * * @throws Exception */ protected function injectVariables($args) { $this->pushEnv(); /** FOF -- BEGIN CHANGE * */ $parser = new FOFLessParser($this, __METHOD__); /** FOF -- END CHANGE * */ foreach ($args as $name => $strValue) { if ($name{0} != '@') { $name = '@' . $name; } $parser->count = 0; $parser->buffer = (string) $strValue; if (!$parser->propertyValue($value)) { throw new Exception("failed to parse passed in variable $name: $strValue"); } $this->set($name, $value); } } /** * Initialize any static state, can initialize parser for a file * * @param type $fname X */ public function __construct($fname = null) { if ($fname !== null) { // Used for deprecated parse method $this->_parseFile = $fname; } } /** * Compile * * @param type $string X * @param type $name X * * @return type */ public function compile($string, $name = null) { $locale = setlocale(LC_NUMERIC, 0); setlocale(LC_NUMERIC, "C"); $this->parser = $this->makeParser($name); $root = $this->parser->parse($string); $this->env = null; $this->scope = null; $this->formatter = $this->newFormatter(); if (!empty($this->registeredVars)) { $this->injectVariables($this->registeredVars); } // Used for error messages $this->sourceParser = $this->parser; $this->compileBlock($root); ob_start(); $this->formatter->block($this->scope); $out = ob_get_clean(); setlocale(LC_NUMERIC, $locale); return $out; } /** * Compile file * * @param type $fname X * @param type $outFname X * * @return type * * @throws Exception */ public function compileFile($fname, $outFname = null) { if (!is_readable($fname)) { throw new Exception('load error: failed to find ' . $fname); } $pi = pathinfo($fname); $oldImport = $this->importDir; $this->importDir = (array) $this->importDir; $this->importDir[] = $pi['dirname'] . '/'; $this->allParsedFiles = array(); $this->addParsedFile($fname); $out = $this->compile(file_get_contents($fname), $fname); $this->importDir = $oldImport; if ($outFname !== null) { /** FOF - BEGIN CHANGE * */ return FOFPlatform::getInstance()->getIntegrationObject('filesystem')->fileWrite($outFname, $out); /** FOF - END CHANGE * */ } return $out; } /** * Compile only if changed input has changed or output doesn't exist * * @param type $in X * @param type $out X * * @return boolean */ public function checkedCompile($in, $out) { if (!is_file($out) || filemtime($in) > filemtime($out)) { $this->compileFile($in, $out); return true; } return false; } /** * Execute lessphp on a .less file or a lessphp cache structure * * The lessphp cache structure contains information about a specific * less file having been parsed. It can be used as a hint for future * calls to determine whether or not a rebuild is required. * * The cache structure contains two important keys that may be used * externally: * * compiled: The final compiled CSS * updated: The time (in seconds) the CSS was last compiled * * The cache structure is a plain-ol' PHP associative array and can * be serialized and unserialized without a hitch. * * @param mixed $in Input * @param bool $force Force rebuild? * * @return array lessphp cache structure */ public function cachedCompile($in, $force = false) { // Assume no root $root = null; if (is_string($in)) { $root = $in; } elseif (is_array($in) and isset($in['root'])) { if ($force or !isset($in['files'])) { /** * If we are forcing a recompile or if for some reason the * structure does not contain any file information we should * specify the root to trigger a rebuild. */ $root = $in['root']; } elseif (isset($in['files']) and is_array($in['files'])) { foreach ($in['files'] as $fname => $ftime) { if (!file_exists($fname) or filemtime($fname) > $ftime) { /** * One of the files we knew about previously has changed * so we should look at our incoming root again. */ $root = $in['root']; break; } } } } else { /** * TODO: Throw an exception? We got neither a string nor something * that looks like a compatible lessphp cache structure. */ return null; } if ($root !== null) { // If we have a root value which means we should rebuild. $out = array(); $out['root'] = $root; $out['compiled'] = $this->compileFile($root); $out['files'] = $this->allParsedFiles(); $out['updated'] = time(); return $out; } else { // No changes, pass back the structure // we were given initially. return $in; } } // // This is deprecated /** * Parse and compile buffer * * @param null $str X * @param type $initialVariables X * * @return type * * @throws Exception * * @deprecated 2.0 */ public function parse($str = null, $initialVariables = null) { if (is_array($str)) { $initialVariables = $str; $str = null; } $oldVars = $this->registeredVars; if ($initialVariables !== null) { $this->setVariables($initialVariables); } if ($str == null) { if (empty($this->_parseFile)) { throw new exception("nothing to parse"); } $out = $this->compileFile($this->_parseFile); } else { $out = $this->compile($str); } $this->registeredVars = $oldVars; return $out; } /** * Make parser * * @param type $name X * * @return FOFLessParser */ protected function makeParser($name) { /** FOF -- BEGIN CHANGE * */ $parser = new FOFLessParser($this, $name); /** FOF -- END CHANGE * */ $parser->writeComments = $this->preserveComments; return $parser; } /** * Set Formatter * * @param type $name X * * @return void */ public function setFormatter($name) { $this->formatterName = $name; } /** * New formatter * * @return FOFLessFormatterLessjs */ protected function newFormatter() { /** FOF -- BEGIN CHANGE * */ $className = "FOFLessFormatterLessjs"; /** FOF -- END CHANGE * */ if (!empty($this->formatterName)) { if (!is_string($this->formatterName)) return $this->formatterName; /** FOF -- BEGIN CHANGE * */ $className = "FOFLessFormatter" . ucfirst($this->formatterName); /** FOF -- END CHANGE * */ } return new $className; } /** * Set preserve comments * * @param type $preserve X * * @return void */ public function setPreserveComments($preserve) { $this->preserveComments = $preserve; } /** * Register function * * @param type $name X * @param type $func X * * @return void */ public function registerFunction($name, $func) { $this->libFunctions[$name] = $func; } /** * Unregister function * * @param type $name X * * @return void */ public function unregisterFunction($name) { unset($this->libFunctions[$name]); } /** * Set variables * * @param type $variables X * * @return void */ public function setVariables($variables) { $this->registeredVars = array_merge($this->registeredVars, $variables); } /** * Unset variable * * @param type $name X * * @return void */ public function unsetVariable($name) { unset($this->registeredVars[$name]); } /** * Set import dir * * @param type $dirs X * * @return void */ public function setImportDir($dirs) { $this->importDir = (array) $dirs; } /** * Add import dir * * @param type $dir X * * @return void */ public function addImportDir($dir) { $this->importDir = (array) $this->importDir; $this->importDir[] = $dir; } /** * All parsed files * * @return type */ public function allParsedFiles() { return $this->allParsedFiles; } /** * Add parsed file * * @param type $file X * * @return void */ protected function addParsedFile($file) { $this->allParsedFiles[realpath($file)] = filemtime($file); } /** * Uses the current value of $this->count to show line and line number * * @param type $msg X * * @return void */ protected function throwError($msg = null) { if ($this->sourceLoc >= 0) { $this->sourceParser->throwError($msg, $this->sourceLoc); } throw new exception($msg); } /** * Compile file $in to file $out if $in is newer than $out * Returns true when it compiles, false otherwise * * @param type $in X * @param type $out X * @param self $less X * * @return type */ public static function ccompile($in, $out, $less = null) { if ($less === null) { $less = new self; } return $less->checkedCompile($in, $out); } /** * Compile execute * * @param type $in X * @param type $force X * @param self $less X * * @return type */ public static function cexecute($in, $force = false, $less = null) { if ($less === null) { $less = new self; } return $less->cachedCompile($in, $force); } protected static $cssColors = array( 'aliceblue' => '240,248,255', 'antiquewhite' => '250,235,215', 'aqua' => '0,255,255', 'aquamarine' => '127,255,212', 'azure' => '240,255,255', 'beige' => '245,245,220', 'bisque' => '255,228,196', 'black' => '0,0,0', 'blanchedalmond' => '255,235,205', 'blue' => '0,0,255', 'blueviolet' => '138,43,226', 'brown' => '165,42,42', 'burlywood' => '222,184,135', 'cadetblue' => '95,158,160', 'chartreuse' => '127,255,0', 'chocolate' => '210,105,30', 'coral' => '255,127,80', 'cornflowerblue' => '100,149,237', 'cornsilk' => '255,248,220', 'crimson' => '220,20,60', 'cyan' => '0,255,255', 'darkblue' => '0,0,139', 'darkcyan' => '0,139,139', 'darkgoldenrod' => '184,134,11', 'darkgray' => '169,169,169', 'darkgreen' => '0,100,0', 'darkgrey' => '169,169,169', 'darkkhaki' => '189,183,107', 'darkmagenta' => '139,0,139', 'darkolivegreen' => '85,107,47', 'darkorange' => '255,140,0', 'darkorchid' => '153,50,204', 'darkred' => '139,0,0', 'darksalmon' => '233,150,122', 'darkseagreen' => '143,188,143', 'darkslateblue' => '72,61,139', 'darkslategray' => '47,79,79', 'darkslategrey' => '47,79,79', 'darkturquoise' => '0,206,209', 'darkviolet' => '148,0,211', 'deeppink' => '255,20,147', 'deepskyblue' => '0,191,255', 'dimgray' => '105,105,105', 'dimgrey' => '105,105,105', 'dodgerblue' => '30,144,255', 'firebrick' => '178,34,34', 'floralwhite' => '255,250,240', 'forestgreen' => '34,139,34', 'fuchsia' => '255,0,255', 'gainsboro' => '220,220,220', 'ghostwhite' => '248,248,255', 'gold' => '255,215,0', 'goldenrod' => '218,165,32', 'gray' => '128,128,128', 'green' => '0,128,0', 'greenyellow' => '173,255,47', 'grey' => '128,128,128', 'honeydew' => '240,255,240', 'hotpink' => '255,105,180', 'indianred' => '205,92,92', 'indigo' => '75,0,130', 'ivory' => '255,255,240', 'khaki' => '240,230,140', 'lavender' => '230,230,250', 'lavenderblush' => '255,240,245', 'lawngreen' => '124,252,0', 'lemonchiffon' => '255,250,205', 'lightblue' => '173,216,230', 'lightcoral' => '240,128,128', 'lightcyan' => '224,255,255', 'lightgoldenrodyellow' => '250,250,210', 'lightgray' => '211,211,211', 'lightgreen' => '144,238,144', 'lightgrey' => '211,211,211', 'lightpink' => '255,182,193', 'lightsalmon' => '255,160,122', 'lightseagreen' => '32,178,170', 'lightskyblue' => '135,206,250', 'lightslategray' => '119,136,153', 'lightslategrey' => '119,136,153', 'lightsteelblue' => '176,196,222', 'lightyellow' => '255,255,224', 'lime' => '0,255,0', 'limegreen' => '50,205,50', 'linen' => '250,240,230', 'magenta' => '255,0,255', 'maroon' => '128,0,0', 'mediumaquamarine' => '102,205,170', 'mediumblue' => '0,0,205', 'mediumorchid' => '186,85,211', 'mediumpurple' => '147,112,219', 'mediumseagreen' => '60,179,113', 'mediumslateblue' => '123,104,238', 'mediumspringgreen' => '0,250,154', 'mediumturquoise' => '72,209,204', 'mediumvioletred' => '199,21,133', 'midnightblue' => '25,25,112', 'mintcream' => '245,255,250', 'mistyrose' => '255,228,225', 'moccasin' => '255,228,181', 'navajowhite' => '255,222,173', 'navy' => '0,0,128', 'oldlace' => '253,245,230', 'olive' => '128,128,0', 'olivedrab' => '107,142,35', 'orange' => '255,165,0', 'orangered' => '255,69,0', 'orchid' => '218,112,214', 'palegoldenrod' => '238,232,170', 'palegreen' => '152,251,152', 'paleturquoise' => '175,238,238', 'palevioletred' => '219,112,147', 'papayawhip' => '255,239,213', 'peachpuff' => '255,218,185', 'peru' => '205,133,63', 'pink' => '255,192,203', 'plum' => '221,160,221', 'powderblue' => '176,224,230', 'purple' => '128,0,128', 'red' => '255,0,0', 'rosybrown' => '188,143,143', 'royalblue' => '65,105,225', 'saddlebrown' => '139,69,19', 'salmon' => '250,128,114', 'sandybrown' => '244,164,96', 'seagreen' => '46,139,87', 'seashell' => '255,245,238', 'sienna' => '160,82,45', 'silver' => '192,192,192', 'skyblue' => '135,206,235', 'slateblue' => '106,90,205', 'slategray' => '112,128,144', 'slategrey' => '112,128,144', 'snow' => '255,250,250', 'springgreen' => '0,255,127', 'steelblue' => '70,130,180', 'tan' => '210,180,140', 'teal' => '0,128,128', 'thistle' => '216,191,216', 'tomato' => '255,99,71', 'transparent' => '0,0,0,0', 'turquoise' => '64,224,208', 'violet' => '238,130,238', 'wheat' => '245,222,179', 'white' => '255,255,255', 'whitesmoke' => '245,245,245', 'yellow' => '255,255,0', 'yellowgreen' => '154,205,50' ); } PK���\k��1�1�$libraries/fof/less/parser/parser.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage less * @copyright Copyright (C) 2010 - 2015 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; /** * This class is taken verbatim from: * * lessphp v0.3.9 * http://leafo.net/lessphp * * LESS css compiler, adapted from http://lesscss.org * * Copyright 2012, Leaf Corcoran <leafot@gmail.com> * Licensed under MIT or GPLv3, see LICENSE * * Responsible for taking a string of LESS code and converting it into a syntax tree * * @since 2.0 */ class FOFLessParser { // Used to uniquely identify blocks protected static $nextBlockId = 0; protected static $precedence = array( '=<' => 0, '>=' => 0, '=' => 0, '<' => 0, '>' => 0, '+' => 1, '-' => 1, '*' => 2, '/' => 2, '%' => 2, ); protected static $whitePattern; protected static $commentMulti; protected static $commentSingle = "//"; protected static $commentMultiLeft = "/*"; protected static $commentMultiRight = "*/"; // Regex string to match any of the operators protected static $operatorString; // These properties will supress division unless it's inside parenthases protected static $supressDivisionProps = array('/border-radius$/i', '/^font$/i'); protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document"); protected $lineDirectives = array("charset"); /** * if we are in parens we can be more liberal with whitespace around * operators because it must evaluate to a single value and thus is less * ambiguous. * * Consider: * property1: 10 -5; // is two numbers, 10 and -5 * property2: (10 -5); // should evaluate to 5 */ protected $inParens = false; // Caches preg escaped literals protected static $literalCache = array(); /** * Constructor * * @param [type] $lessc [description] * @param string $sourceName [description] */ public function __construct($lessc, $sourceName = null) { $this->eatWhiteDefault = true; // Reference to less needed for vPrefix, mPrefix, and parentSelector $this->lessc = $lessc; // Name used for error messages $this->sourceName = $sourceName; $this->writeComments = false; if (!self::$operatorString) { self::$operatorString = '(' . implode('|', array_map(array('FOFLess', 'preg_quote'), array_keys(self::$precedence))) . ')'; $commentSingle = FOFLess::preg_quote(self::$commentSingle); $commentMultiLeft = FOFLess::preg_quote(self::$commentMultiLeft); $commentMultiRight = FOFLess::preg_quote(self::$commentMultiRight); self::$commentMulti = $commentMultiLeft . '.*?' . $commentMultiRight; self::$whitePattern = '/' . $commentSingle . '[^\n]*\s*|(' . self::$commentMulti . ')\s*|\s+/Ais'; } } /** * Parse text * * @param string $buffer [description] * * @return [type] [description] */ public function parse($buffer) { $this->count = 0; $this->line = 1; // Block stack $this->env = null; $this->buffer = $this->writeComments ? $buffer : $this->removeComments($buffer); $this->pushSpecialBlock("root"); $this->eatWhiteDefault = true; $this->seenComments = array(); /* * trim whitespace on head * if (preg_match('/^\s+/', $this->buffer, $m)) { * $this->line += substr_count($m[0], "\n"); * $this->buffer = ltrim($this->buffer); * } */ $this->whitespace(); // Parse the entire file $lastCount = $this->count; while (false !== $this->parseChunk()); if ($this->count != strlen($this->buffer)) { $this->throwError(); } // TODO report where the block was opened if (!is_null($this->env->parent)) { throw new exception('parse error: unclosed block'); } return $this->env; } /** * Parse a single chunk off the head of the buffer and append it to the * current parse environment. * Returns false when the buffer is empty, or when there is an error. * * This function is called repeatedly until the entire document is * parsed. * * This parser is most similar to a recursive descent parser. Single * functions represent discrete grammatical rules for the language, and * they are able to capture the text that represents those rules. * * Consider the function lessc::keyword(). (all parse functions are * structured the same) * * The function takes a single reference argument. When calling the * function it will attempt to match a keyword on the head of the buffer. * If it is successful, it will place the keyword in the referenced * argument, advance the position in the buffer, and return true. If it * fails then it won't advance the buffer and it will return false. * * All of these parse functions are powered by lessc::match(), which behaves * the same way, but takes a literal regular expression. Sometimes it is * more convenient to use match instead of creating a new function. * * Because of the format of the functions, to parse an entire string of * grammatical rules, you can chain them together using &&. * * But, if some of the rules in the chain succeed before one fails, then * the buffer position will be left at an invalid state. In order to * avoid this, lessc::seek() is used to remember and set buffer positions. * * Before parsing a chain, use $s = $this->seek() to remember the current * position into $s. Then if a chain fails, use $this->seek($s) to * go back where we started. * * @return boolean */ protected function parseChunk() { if (empty($this->buffer)) { return false; } $s = $this->seek(); // Setting a property if ($this->keyword($key) && $this->assign() && $this->propertyValue($value, $key) && $this->end()) { $this->append(array('assign', $key, $value), $s); return true; } else { $this->seek($s); } // Look for special css blocks if ($this->literal('@', false)) { $this->count--; // Media if ($this->literal('@media')) { if (($this->mediaQueryList($mediaQueries) || true) && $this->literal('{')) { $media = $this->pushSpecialBlock("media"); $media->queries = is_null($mediaQueries) ? array() : $mediaQueries; return true; } else { $this->seek($s); return false; } } if ($this->literal("@", false) && $this->keyword($dirName)) { if ($this->isDirective($dirName, $this->blockDirectives)) { if (($this->openString("{", $dirValue, null, array(";")) || true) && $this->literal("{")) { $dir = $this->pushSpecialBlock("directive"); $dir->name = $dirName; if (isset($dirValue)) { $dir->value = $dirValue; } return true; } } elseif ($this->isDirective($dirName, $this->lineDirectives)) { if ($this->propertyValue($dirValue) && $this->end()) { $this->append(array("directive", $dirName, $dirValue)); return true; } } } $this->seek($s); } // Setting a variable if ($this->variable($var) && $this->assign() && $this->propertyValue($value) && $this->end()) { $this->append(array('assign', $var, $value), $s); return true; } else { $this->seek($s); } if ($this->import($importValue)) { $this->append($importValue, $s); return true; } // Opening parametric mixin if ($this->tag($tag, true) && $this->argumentDef($args, $isVararg) && ($this->guards($guards) || true) && $this->literal('{')) { $block = $this->pushBlock($this->fixTags(array($tag))); $block->args = $args; $block->isVararg = $isVararg; if (!empty($guards)) { $block->guards = $guards; } return true; } else { $this->seek($s); } // Opening a simple block if ($this->tags($tags) && $this->literal('{')) { $tags = $this->fixTags($tags); $this->pushBlock($tags); return true; } else { $this->seek($s); } // Closing a block if ($this->literal('}', false)) { try { $block = $this->pop(); } catch (exception $e) { $this->seek($s); $this->throwError($e->getMessage()); } $hidden = false; if (is_null($block->type)) { $hidden = true; if (!isset($block->args)) { foreach ($block->tags as $tag) { if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) { $hidden = false; break; } } } foreach ($block->tags as $tag) { if (is_string($tag)) { $this->env->children[$tag][] = $block; } } } if (!$hidden) { $this->append(array('block', $block), $s); } // This is done here so comments aren't bundled into he block that was just closed $this->whitespace(); return true; } // Mixin if ($this->mixinTags($tags) && ($this->argumentValues($argv) || true) && ($this->keyword($suffix) || true) && $this->end()) { $tags = $this->fixTags($tags); $this->append(array('mixin', $tags, $argv, $suffix), $s); return true; } else { $this->seek($s); } // Spare ; if ($this->literal(';')) { return true; } // Got nothing, throw error return false; } /** * [isDirective description] * * @param string $dirname [description] * @param [type] $directives [description] * * @return boolean */ protected function isDirective($dirname, $directives) { // TODO: cache pattern in parser $pattern = implode("|", array_map(array("FOFLess", "preg_quote"), $directives)); $pattern = '/^(-[a-z-]+-)?(' . $pattern . ')$/i'; return preg_match($pattern, $dirname); } /** * [fixTags description] * * @param [type] $tags [description] * * @return [type] [description] */ protected function fixTags($tags) { // Move @ tags out of variable namespace foreach ($tags as &$tag) { if ($tag{0} == $this->lessc->vPrefix) { $tag[0] = $this->lessc->mPrefix; } } return $tags; } /** * a list of expressions * * @param [type] &$exps [description] * * @return boolean */ protected function expressionList(&$exps) { $values = array(); while ($this->expression($exp)) { $values[] = $exp; } if (count($values) == 0) { return false; } $exps = FOFLess::compressList($values, ' '); return true; } /** * Attempt to consume an expression. * * @param string &$out [description] * * @link http://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudo-code * * @return boolean */ protected function expression(&$out) { if ($this->value($lhs)) { $out = $this->expHelper($lhs, 0); // Look for / shorthand if (!empty($this->env->supressedDivision)) { unset($this->env->supressedDivision); $s = $this->seek(); if ($this->literal("/") && $this->value($rhs)) { $out = array("list", "", array($out, array("keyword", "/"), $rhs)); } else { $this->seek($s); } } return true; } return false; } /** * Recursively parse infix equation with $lhs at precedence $minP * * @param type $lhs [description] * @param type $minP [description] * * @return string */ protected function expHelper($lhs, $minP) { $this->inExp = true; $ss = $this->seek(); while (true) { $whiteBefore = isset($this->buffer[$this->count - 1]) && ctype_space($this->buffer[$this->count - 1]); // If there is whitespace before the operator, then we require // whitespace after the operator for it to be an expression $needWhite = $whiteBefore && !$this->inParens; if ($this->match(self::$operatorString . ($needWhite ? '\s' : ''), $m) && self::$precedence[$m[1]] >= $minP) { if (!$this->inParens && isset($this->env->currentProperty) && $m[1] == "/" && empty($this->env->supressedDivision)) { foreach (self::$supressDivisionProps as $pattern) { if (preg_match($pattern, $this->env->currentProperty)) { $this->env->supressedDivision = true; break 2; } } } $whiteAfter = isset($this->buffer[$this->count - 1]) && ctype_space($this->buffer[$this->count - 1]); if (!$this->value($rhs)) { break; } // Peek for next operator to see what to do with rhs if ($this->peek(self::$operatorString, $next) && self::$precedence[$next[1]] > self::$precedence[$m[1]]) { $rhs = $this->expHelper($rhs, self::$precedence[$next[1]]); } $lhs = array('expression', $m[1], $lhs, $rhs, $whiteBefore, $whiteAfter); $ss = $this->seek(); continue; } break; } $this->seek($ss); return $lhs; } /** * Consume a list of values for a property * * @param [type] &$value [description] * @param [type] $keyName [description] * * @return boolean */ public function propertyValue(&$value, $keyName = null) { $values = array(); if ($keyName !== null) { $this->env->currentProperty = $keyName; } $s = null; while ($this->expressionList($v)) { $values[] = $v; $s = $this->seek(); if (!$this->literal(',')) { break; } } if ($s) { $this->seek($s); } if ($keyName !== null) { unset($this->env->currentProperty); } if (count($values) == 0) { return false; } $value = FOFLess::compressList($values, ', '); return true; } /** * [parenValue description] * * @param [type] &$out [description] * * @return boolean */ protected function parenValue(&$out) { $s = $this->seek(); // Speed shortcut if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "(") { return false; } $inParens = $this->inParens; if ($this->literal("(") && ($this->inParens = true) && $this->expression($exp) && $this->literal(")")) { $out = $exp; $this->inParens = $inParens; return true; } else { $this->inParens = $inParens; $this->seek($s); } return false; } /** * a single value * * @param [type] &$value [description] * * @return boolean */ protected function value(&$value) { $s = $this->seek(); // Speed shortcut if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "-") { // Negation if ($this->literal("-", false) &&(($this->variable($inner) && $inner = array("variable", $inner)) || $this->unit($inner) || $this->parenValue($inner))) { $value = array("unary", "-", $inner); return true; } else { $this->seek($s); } } if ($this->parenValue($value)) { return true; } if ($this->unit($value)) { return true; } if ($this->color($value)) { return true; } if ($this->func($value)) { return true; } if ($this->string($value)) { return true; } if ($this->keyword($word)) { $value = array('keyword', $word); return true; } // Try a variable if ($this->variable($var)) { $value = array('variable', $var); return true; } // Unquote string (should this work on any type? if ($this->literal("~") && $this->string($str)) { $value = array("escape", $str); return true; } else { $this->seek($s); } // Css hack: \0 if ($this->literal('\\') && $this->match('([0-9]+)', $m)) { $value = array('keyword', '\\' . $m[1]); return true; } else { $this->seek($s); } return false; } /** * an import statement * * @param [type] &$out [description] * * @return boolean */ protected function import(&$out) { $s = $this->seek(); if (!$this->literal('@import')) { return false; } /* * @import "something.css" media; * @import url("something.css") media; * @import url(something.css) media; */ if ($this->propertyValue($value)) { $out = array("import", $value); return true; } } /** * [mediaQueryList description] * * @param [type] &$out [description] * * @return boolean */ protected function mediaQueryList(&$out) { if ($this->genericList($list, "mediaQuery", ",", false)) { $out = $list[2]; return true; } return false; } /** * [mediaQuery description] * * @param [type] &$out [description] * * @return [type] [description] */ protected function mediaQuery(&$out) { $s = $this->seek(); $expressions = null; $parts = array(); if (($this->literal("only") && ($only = true) || $this->literal("not") && ($not = true) || true) && $this->keyword($mediaType)) { $prop = array("mediaType"); if (isset($only)) { $prop[] = "only"; } if (isset($not)) { $prop[] = "not"; } $prop[] = $mediaType; $parts[] = $prop; } else { $this->seek($s); } if (!empty($mediaType) && !$this->literal("and")) { // ~ } else { $this->genericList($expressions, "mediaExpression", "and", false); if (is_array($expressions)) { $parts = array_merge($parts, $expressions[2]); } } if (count($parts) == 0) { $this->seek($s); return false; } $out = $parts; return true; } /** * [mediaExpression description] * * @param [type] &$out [description] * * @return boolean */ protected function mediaExpression(&$out) { $s = $this->seek(); $value = null; if ($this->literal("(") && $this->keyword($feature) && ($this->literal(":") && $this->expression($value) || true) && $this->literal(")")) { $out = array("mediaExp", $feature); if ($value) { $out[] = $value; } return true; } elseif ($this->variable($variable)) { $out = array('variable', $variable); return true; } $this->seek($s); return false; } /** * An unbounded string stopped by $end * * @param [type] $end [description] * @param [type] &$out [description] * @param [type] $nestingOpen [description] * @param [type] $rejectStrs [description] * * @return boolean */ protected function openString($end, &$out, $nestingOpen = null, $rejectStrs = null) { $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; $stop = array("'", '"', "@{", $end); $stop = array_map(array("FOFLess", "preg_quote"), $stop); // $stop[] = self::$commentMulti; if (!is_null($rejectStrs)) { $stop = array_merge($stop, $rejectStrs); } $patt = '(.*?)(' . implode("|", $stop) . ')'; $nestingLevel = 0; $content = array(); while ($this->match($patt, $m, false)) { if (!empty($m[1])) { $content[] = $m[1]; if ($nestingOpen) { $nestingLevel += substr_count($m[1], $nestingOpen); } } $tok = $m[2]; $this->count -= strlen($tok); if ($tok == $end) { if ($nestingLevel == 0) { break; } else { $nestingLevel--; } } if (($tok == "'" || $tok == '"') && $this->string($str)) { $content[] = $str; continue; } if ($tok == "@{" && $this->interpolation($inter)) { $content[] = $inter; continue; } if (in_array($tok, $rejectStrs)) { $count = null; break; } $content[] = $tok; $this->count += strlen($tok); } $this->eatWhiteDefault = $oldWhite; if (count($content) == 0) return false; // Trim the end if (is_string(end($content))) { $content[count($content) - 1] = rtrim(end($content)); } $out = array("string", "", $content); return true; } /** * [string description] * * @param [type] &$out [description] * * @return boolean */ protected function string(&$out) { $s = $this->seek(); if ($this->literal('"', false)) { $delim = '"'; } elseif ($this->literal("'", false)) { $delim = "'"; } else { return false; } $content = array(); // Look for either ending delim , escape, or string interpolation $patt = '([^\n]*?)(@\{|\\\\|' . FOFLess::preg_quote($delim) . ')'; $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; while ($this->match($patt, $m, false)) { $content[] = $m[1]; if ($m[2] == "@{") { $this->count -= strlen($m[2]); if ($this->interpolation($inter, false)) { $content[] = $inter; } else { $this->count += strlen($m[2]); // Ignore it $content[] = "@{"; } } elseif ($m[2] == '\\') { $content[] = $m[2]; if ($this->literal($delim, false)) { $content[] = $delim; } } else { $this->count -= strlen($delim); // Delim break; } } $this->eatWhiteDefault = $oldWhite; if ($this->literal($delim)) { $out = array("string", $delim, $content); return true; } $this->seek($s); return false; } /** * [interpolation description] * * @param [type] &$out [description] * * @return boolean */ protected function interpolation(&$out) { $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = true; $s = $this->seek(); if ($this->literal("@{") && $this->openString("}", $interp, null, array("'", '"', ";")) && $this->literal("}", false)) { $out = array("interpolate", $interp); $this->eatWhiteDefault = $oldWhite; if ($this->eatWhiteDefault) { $this->whitespace(); } return true; } $this->eatWhiteDefault = $oldWhite; $this->seek($s); return false; } /** * [unit description] * * @param [type] &$unit [description] * * @return boolean */ protected function unit(&$unit) { // Speed shortcut if (isset($this->buffer[$this->count])) { $char = $this->buffer[$this->count]; if (!ctype_digit($char) && $char != ".") { return false; } } if ($this->match('([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m)) { $unit = array("number", $m[1], empty($m[2]) ? "" : $m[2]); return true; } return false; } /** * a # color * * @param [type] &$out [description] * * @return boolean */ protected function color(&$out) { if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) { if (strlen($m[1]) > 7) { $out = array("string", "", array($m[1])); } else { $out = array("raw_color", $m[1]); } return true; } return false; } /** * Consume a list of property values delimited by ; and wrapped in () * * @param [type] &$args [description] * @param [type] $delim [description] * * @return boolean */ protected function argumentValues(&$args, $delim = ',') { $s = $this->seek(); if (!$this->literal('(')) { return false; } $values = array(); while (true) { if ($this->expressionList($value)) { $values[] = $value; } if (!$this->literal($delim)) { break; } else { if ($value == null) { $values[] = null; } $value = null; } } if (!$this->literal(')')) { $this->seek($s); return false; } $args = $values; return true; } /** * Consume an argument definition list surrounded by () * each argument is a variable name with optional value * or at the end a ... or a variable named followed by ... * * @param [type] &$args [description] * @param [type] &$isVararg [description] * @param [type] $delim [description] * * @return boolean */ protected function argumentDef(&$args, &$isVararg, $delim = ',') { $s = $this->seek(); if (!$this->literal('(')) return false; $values = array(); $isVararg = false; while (true) { if ($this->literal("...")) { $isVararg = true; break; } if ($this->variable($vname)) { $arg = array("arg", $vname); $ss = $this->seek(); if ($this->assign() && $this->expressionList($value)) { $arg[] = $value; } else { $this->seek($ss); if ($this->literal("...")) { $arg[0] = "rest"; $isVararg = true; } } $values[] = $arg; if ($isVararg) { break; } continue; } if ($this->value($literal)) { $values[] = array("lit", $literal); } if (!$this->literal($delim)) { break; } } if (!$this->literal(')')) { $this->seek($s); return false; } $args = $values; return true; } /** * Consume a list of tags * This accepts a hanging delimiter * * @param [type] &$tags [description] * @param [type] $simple [description] * @param [type] $delim [description] * * @return boolean */ protected function tags(&$tags, $simple = false, $delim = ',') { $tags = array(); while ($this->tag($tt, $simple)) { $tags[] = $tt; if (!$this->literal($delim)) { break; } } if (count($tags) == 0) { return false; } return true; } /** * List of tags of specifying mixin path * Optionally separated by > (lazy, accepts extra >) * * @param [type] &$tags [description] * * @return boolean */ protected function mixinTags(&$tags) { $s = $this->seek(); $tags = array(); while ($this->tag($tt, true)) { $tags[] = $tt; $this->literal(">"); } if (count($tags) == 0) { return false; } return true; } /** * A bracketed value (contained within in a tag definition) * * @param [type] &$value [description] * * @return boolean */ protected function tagBracket(&$value) { // Speed shortcut if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") { return false; } $s = $this->seek(); if ($this->literal('[') && $this->to(']', $c, true) && $this->literal(']', false)) { $value = '[' . $c . ']'; // Whitespace? if ($this->whitespace()) { $value .= " "; } // Escape parent selector, (yuck) $value = str_replace($this->lessc->parentSelector, "$&$", $value); return true; } $this->seek($s); return false; } /** * [tagExpression description] * * @param [type] &$value [description] * * @return boolean */ protected function tagExpression(&$value) { $s = $this->seek(); if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) { $value = array('exp', $exp); return true; } $this->seek($s); return false; } /** * A single tag * * @param [type] &$tag [description] * @param boolean $simple [description] * * @return boolean */ protected function tag(&$tag, $simple = false) { if ($simple) { $chars = '^@,:;{}\][>\(\) "\''; } else { $chars = '^@,;{}["\''; } $s = $this->seek(); if (!$simple && $this->tagExpression($tag)) { return true; } $hasExpression = false; $parts = array(); while ($this->tagBracket($first)) { $parts[] = $first; } $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; while (true) { if ($this->match('([' . $chars . '0-9][' . $chars . ']*)', $m)) { $parts[] = $m[1]; if ($simple) { break; } while ($this->tagBracket($brack)) { $parts[] = $brack; } continue; } if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "@") { if ($this->interpolation($interp)) { $hasExpression = true; // Don't unescape $interp[2] = true; $parts[] = $interp; continue; } if ($this->literal("@")) { $parts[] = "@"; continue; } } // For keyframes if ($this->unit($unit)) { $parts[] = $unit[1]; $parts[] = $unit[2]; continue; } break; } $this->eatWhiteDefault = $oldWhite; if (!$parts) { $this->seek($s); return false; } if ($hasExpression) { $tag = array("exp", array("string", "", $parts)); } else { $tag = trim(implode($parts)); } $this->whitespace(); return true; } /** * A css function * * @param [type] &$func [description] * * @return boolean */ protected function func(&$func) { $s = $this->seek(); if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) { $fname = $m[1]; $sPreArgs = $this->seek(); $args = array(); while (true) { $ss = $this->seek(); // This ugly nonsense is for ie filter properties if ($this->keyword($name) && $this->literal('=') && $this->expressionList($value)) { $args[] = array("string", "", array($name, "=", $value)); } else { $this->seek($ss); if ($this->expressionList($value)) { $args[] = $value; } } if (!$this->literal(',')) { break; } } $args = array('list', ',', $args); if ($this->literal(')')) { $func = array('function', $fname, $args); return true; } elseif ($fname == 'url') { // Couldn't parse and in url? treat as string $this->seek($sPreArgs); if ($this->openString(")", $string) && $this->literal(")")) { $func = array('function', $fname, $string); return true; } } } $this->seek($s); return false; } /** * Consume a less variable * * @param [type] &$name [description] * * @return boolean */ protected function variable(&$name) { $s = $this->seek(); if ($this->literal($this->lessc->vPrefix, false) && ($this->variable($sub) || $this->keyword($name))) { if (!empty($sub)) { $name = array('variable', $sub); } else { $name = $this->lessc->vPrefix . $name; } return true; } $name = null; $this->seek($s); return false; } /** * Consume an assignment operator * Can optionally take a name that will be set to the current property name * * @param string $name [description] * * @return boolean */ protected function assign($name = null) { if ($name) { $this->currentProperty = $name; } return $this->literal(':') || $this->literal('='); } /** * Consume a keyword * * @param [type] &$word [description] * * @return boolean */ protected function keyword(&$word) { if ($this->match('([\w_\-\*!"][\w\-_"]*)', $m)) { $word = $m[1]; return true; } return false; } /** * Consume an end of statement delimiter * * @return boolean */ protected function end() { if ($this->literal(';')) { return true; } elseif ($this->count == strlen($this->buffer) || $this->buffer{$this->count} == '}') { // If there is end of file or a closing block next then we don't need a ; return true; } return false; } /** * [guards description] * * @param [type] &$guards [description] * * @return boolean */ protected function guards(&$guards) { $s = $this->seek(); if (!$this->literal("when")) { $this->seek($s); return false; } $guards = array(); while ($this->guardGroup($g)) { $guards[] = $g; if (!$this->literal(",")) { break; } } if (count($guards) == 0) { $guards = null; $this->seek($s); return false; } return true; } /** * A bunch of guards that are and'd together * * @param [type] &$guardGroup [description] * * @todo rename to guardGroup * * @return boolean */ protected function guardGroup(&$guardGroup) { $s = $this->seek(); $guardGroup = array(); while ($this->guard($guard)) { $guardGroup[] = $guard; if (!$this->literal("and")) { break; } } if (count($guardGroup) == 0) { $guardGroup = null; $this->seek($s); return false; } return true; } /** * [guard description] * * @param [type] &$guard [description] * * @return boolean */ protected function guard(&$guard) { $s = $this->seek(); $negate = $this->literal("not"); if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) { $guard = $exp; if ($negate) { $guard = array("negate", $guard); } return true; } $this->seek($s); return false; } /* raw parsing functions */ /** * [literal description] * * @param [type] $what [description] * @param [type] $eatWhitespace [description] * * @return boolean */ protected function literal($what, $eatWhitespace = null) { if ($eatWhitespace === null) { $eatWhitespace = $this->eatWhiteDefault; } // Shortcut on single letter if (!isset($what[1]) && isset($this->buffer[$this->count])) { if ($this->buffer[$this->count] == $what) { if (!$eatWhitespace) { $this->count++; return true; } } else { return false; } } if (!isset(self::$literalCache[$what])) { self::$literalCache[$what] = FOFLess::preg_quote($what); } return $this->match(self::$literalCache[$what], $m, $eatWhitespace); } /** * [genericList description] * * @param [type] &$out [description] * @param [type] $parseItem [description] * @param string $delim [description] * @param boolean $flatten [description] * * @return boolean */ protected function genericList(&$out, $parseItem, $delim = "", $flatten = true) { $s = $this->seek(); $items = array(); while ($this->$parseItem($value)) { $items[] = $value; if ($delim) { if (!$this->literal($delim)) { break; } } } if (count($items) == 0) { $this->seek($s); return false; } if ($flatten && count($items) == 1) { $out = $items[0]; } else { $out = array("list", $delim, $items); } return true; } /** * Advance counter to next occurrence of $what * $until - don't include $what in advance * $allowNewline, if string, will be used as valid char set * * @param [type] $what [description] * @param [type] &$out [description] * @param boolean $until [description] * @param boolean $allowNewline [description] * * @return boolean */ protected function to($what, &$out, $until = false, $allowNewline = false) { if (is_string($allowNewline)) { $validChars = $allowNewline; } else { $validChars = $allowNewline ? "." : "[^\n]"; } if (!$this->match('(' . $validChars . '*?)' . FOFLess::preg_quote($what), $m, !$until)) { return false; } if ($until) { // Give back $what $this->count -= strlen($what); } $out = $m[1]; return true; } /** * Try to match something on head of buffer * * @param [type] $regex [description] * @param [type] &$out [description] * @param [type] $eatWhitespace [description] * * @return boolean */ protected function match($regex, &$out, $eatWhitespace = null) { if ($eatWhitespace === null) { $eatWhitespace = $this->eatWhiteDefault; } $r = '/' . $regex . ($eatWhitespace && !$this->writeComments ? '\s*' : '') . '/Ais'; if (preg_match($r, $this->buffer, $out, null, $this->count)) { $this->count += strlen($out[0]); if ($eatWhitespace && $this->writeComments) { $this->whitespace(); } return true; } return false; } /** * Watch some whitespace * * @return boolean */ protected function whitespace() { if ($this->writeComments) { $gotWhite = false; while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) { if (isset($m[1]) && empty($this->commentsSeen[$this->count])) { $this->append(array("comment", $m[1])); $this->commentsSeen[$this->count] = true; } $this->count += strlen($m[0]); $gotWhite = true; } return $gotWhite; } else { $this->match("", $m); return strlen($m[0]) > 0; } } /** * Match something without consuming it * * @param [type] $regex [description] * @param [type] &$out [description] * @param [type] $from [description] * * @return boolean */ protected function peek($regex, &$out = null, $from = null) { if (is_null($from)) { $from = $this->count; } $r = '/' . $regex . '/Ais'; $result = preg_match($r, $this->buffer, $out, null, $from); return $result; } /** * Seek to a spot in the buffer or return where we are on no argument * * @param [type] $where [description] * * @return boolean */ protected function seek($where = null) { if ($where === null) { return $this->count; } else { $this->count = $where; } return true; } /* misc functions */ /** * [throwError description] * * @param string $msg [description] * @param [type] $count [description] * * @return void */ public function throwError($msg = "parse error", $count = null) { $count = is_null($count) ? $this->count : $count; $line = $this->line + substr_count(substr($this->buffer, 0, $count), "\n"); if (!empty($this->sourceName)) { $loc = "$this->sourceName on line $line"; } else { $loc = "line: $line"; } // TODO this depends on $this->count if ($this->peek("(.*?)(\n|$)", $m, $count)) { throw new exception("$msg: failed at `$m[1]` $loc"); } else { throw new exception("$msg: $loc"); } } /** * [pushBlock description] * * @param [type] $selectors [description] * @param [type] $type [description] * * @return stdClass */ protected function pushBlock($selectors = null, $type = null) { $b = new stdclass; $b->parent = $this->env; $b->type = $type; $b->id = self::$nextBlockId++; // TODO: kill me from here $b->isVararg = false; $b->tags = $selectors; $b->props = array(); $b->children = array(); $this->env = $b; return $b; } /** * Push a block that doesn't multiply tags * * @param [type] $type [description] * * @return stdClass */ protected function pushSpecialBlock($type) { return $this->pushBlock(null, $type); } /** * Append a property to the current block * * @param [type] $prop [description] * @param [type] $pos [description] * * @return void */ protected function append($prop, $pos = null) { if ($pos !== null) { $prop[-1] = $pos; } $this->env->props[] = $prop; } /** * Pop something off the stack * * @return [type] [description] */ protected function pop() { $old = $this->env; $this->env = $this->env->parent; return $old; } /** * Remove comments from $text * * @param [type] $text [description] * * @todo: make it work for all functions, not just url * * @return [type] [description] */ protected function removeComments($text) { $look = array( 'url(', '//', '/*', '"', "'" ); $out = ''; $min = null; while (true) { // Find the next item foreach ($look as $token) { $pos = strpos($text, $token); if ($pos !== false) { if (!isset($min) || $pos < $min[1]) { $min = array($token, $pos); } } } if (is_null($min)) break; $count = $min[1]; $skip = 0; $newlines = 0; switch ($min[0]) { case 'url(': if (preg_match('/url\(.*?\)/', $text, $m, 0, $count)) { $count += strlen($m[0]) - strlen($min[0]); } break; case '"': case "'": if (preg_match('/' . $min[0] . '.*?' . $min[0] . '/', $text, $m, 0, $count)) { $count += strlen($m[0]) - 1; } break; case '//': $skip = strpos($text, "\n", $count); if ($skip === false) { $skip = strlen($text) - $count; } else { $skip -= $count; } break; case '/*': if (preg_match('/\/\*.*?\*\//s', $text, $m, 0, $count)) { $skip = strlen($m[0]); $newlines = substr_count($m[0], "\n"); } break; } if ($skip == 0) { $count += strlen($min[0]); } $out .= substr($text, 0, $count) . str_repeat("\n", $newlines); $text = substr($text, $count + $skip); $min = null; } return $out . $text; } } PK���\��r r (libraries/fof/less/formatter/classic.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage less * @copyright Copyright (C) 2010 - 2015 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; /** * This class is taken verbatim from: * * lessphp v0.3.9 * http://leafo.net/lessphp * * LESS css compiler, adapted from http://lesscss.org * * Copyright 2012, Leaf Corcoran <leafot@gmail.com> * Licensed under MIT or GPLv3, see LICENSE * * @package FrameworkOnFramework * @since 2.0 */ class FOFLessFormatterClassic { public $indentChar = " "; public $break = "\n"; public $open = " {"; public $close = "}"; public $selectorSeparator = ", "; public $assignSeparator = ":"; public $openSingle = " { "; public $closeSingle = " }"; public $disableSingle = false; public $breakSelectors = false; public $compressColors = false; /** * Public constructor */ public function __construct() { $this->indentLevel = 0; } /** * Indent a string by $n positions * * @param integer $n How many positions to indent * * @return string The indented string */ public function indentStr($n = 0) { return str_repeat($this->indentChar, max($this->indentLevel + $n, 0)); } /** * Return the code for a property * * @param string $name The name of the porperty * @param string $value The value of the porperty * * @return string The CSS code */ public function property($name, $value) { return $name . $this->assignSeparator . $value . ";"; } /** * Is a block empty? * * @param stdClass $block The block to check * * @return boolean True if the block has no lines or children */ protected function isEmpty($block) { if (empty($block->lines)) { foreach ($block->children as $child) { if (!$this->isEmpty($child)) { return false; } } return true; } return false; } /** * Output a CSS block * * @param stdClass $block The block definition to output * * @return void */ public function block($block) { if ($this->isEmpty($block)) { return; } $inner = $pre = $this->indentStr(); $isSingle = !$this->disableSingle && is_null($block->type) && count($block->lines) == 1; if (!empty($block->selectors)) { $this->indentLevel++; if ($this->breakSelectors) { $selectorSeparator = $this->selectorSeparator . $this->break . $pre; } else { $selectorSeparator = $this->selectorSeparator; } echo $pre . implode($selectorSeparator, $block->selectors); if ($isSingle) { echo $this->openSingle; $inner = ""; } else { echo $this->open . $this->break; $inner = $this->indentStr(); } } if (!empty($block->lines)) { $glue = $this->break . $inner; echo $inner . implode($glue, $block->lines); if (!$isSingle && !empty($block->children)) { echo $this->break; } } foreach ($block->children as $child) { $this->block($child); } if (!empty($block->selectors)) { if (!$isSingle && empty($block->children)) { echo $this->break; } if ($isSingle) { echo $this->closeSingle . $this->break; } else { echo $pre . $this->close . $this->break; } $this->indentLevel--; } } } PK���\ Ws::'libraries/fof/less/formatter/lessjs.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage less * @copyright Copyright (C) 2010 - 2015 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; /** * This class is taken verbatim from: * * lessphp v0.3.9 * http://leafo.net/lessphp * * LESS css compiler, adapted from http://lesscss.org * * Copyright 2012, Leaf Corcoran <leafot@gmail.com> * Licensed under MIT or GPLv3, see LICENSE * * @package FrameworkOnFramework * @since 2.0 */ class FOFLessFormatterLessjs extends FOFLessFormatterClassic { public $disableSingle = true; public $breakSelectors = true; public $assignSeparator = ": "; public $selectorSeparator = ","; } PK���\�}�WW'libraries/fof/less/formatter/joomla.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage less * @copyright Copyright (C) 2010 - 2015 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; /** * This class is taken verbatim from: * * lessphp v0.3.9 * http://leafo.net/lessphp * * LESS css compiler, adapted from http://lesscss.org * * Copyright 2012, Leaf Corcoran <leafot@gmail.com> * Licensed under MIT or GPLv3, see LICENSE * * @package FrameworkOnFramework * @since 2.1 */ class FOFLessFormatterJoomla extends FOFLessFormatterClassic { public $disableSingle = true; public $breakSelectors = true; public $assignSeparator = ": "; public $selectorSeparator = ","; public $indentChar = "\t"; } PK���\�_^�66+libraries/fof/less/formatter/compressed.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage less * @copyright Copyright (C) 2010 - 2015 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; /** * This class is taken verbatim from: * * lessphp v0.3.9 * http://leafo.net/lessphp * * LESS css compiler, adapted from http://lesscss.org * * Copyright 2012, Leaf Corcoran <leafot@gmail.com> * Licensed under MIT or GPLv3, see LICENSE * * @package FrameworkOnFramework * @since 2.0 */ class FOFLessFormatterCompressed extends FOFLessFormatterClassic { public $disableSingle = true; public $open = "{"; public $selectorSeparator = ","; public $assignSeparator = ":"; public $break = ""; public $compressColors = true; /** * Indent a string by $n positions * * @param integer $n How many positions to indent * * @return string The indented string */ public function indentStr($n = 0) { return ""; } } PK���\�uB--'libraries/fof/controller/controller.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage controller * @copyright Copyright (C) 2010 - 2015 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 controller class. FOF is based on the thin controller * paradigm, where the controller is mainly used to set up the model state and * spawn the view. * * @package FrameworkOnFramework * @since 1.0 */ class FOFController extends FOFUtilsObject { /** * @var int Bit mask to enable Routing on redirects. * 0 = never * 1 = frontend only * 2 = backend only * 3 = always */ protected $autoRouting = 0; /** * The current component's name without the com_ prefix * * @var string */ protected $bareComponent = 'foobar'; /** * The base path of the controller * * @var string */ protected $basePath; /** * The tasks for which caching should be enabled by default * * @var array */ protected $cacheableTasks = array('browse', 'read'); /** * The current component's name; you can override it in the configuration * * @var string */ protected $component = 'com_foobar'; /** * A cached copy of the class configuration parameter passed during initialisation * * @var array */ protected $config = array(); /** * An instance of FOFConfigProvider to provision configuration overrides * * @var FOFConfigProvider */ protected $configProvider = null; /** * Set to true to enable CSRF protection on selected tasks. The possible * values are: * 0 Disabled; no token checks are performed * 1 Enabled; token checks are always performed * 2 Only on HTML requests and backend; token checks are always performed in the back-end and in the front-end only when format is 'html' * 3 Only on back-end; token checks are performer only in the back-end * * @var integer */ protected $csrfProtection = 2; /** * The default view for the display method. * * @var string */ protected $default_view; /** * The mapped task that was performed. * * @var string */ protected $doTask; /** * The input object for this MVC triad; you can override it in the configuration * * @var FOFInput */ protected $input = array(); /** * Redirect message. * * @var string */ protected $message; /** * Redirect message type. * * @var string */ protected $messageType; /** * The current layout; you can override it in the configuration * * @var string */ protected $layout = null; /** * Array of class methods * * @var array */ protected $methods; /** * The prefix of the models * * @var string */ protected $model_prefix; /** * Overrides the name of the view's default model * * @var string */ protected $modelName = null; /** * The set of search directories for resources (views). * * @var array */ protected $paths; /** * URL for redirection. * * @var string */ protected $redirect; /** * Current or most recently performed task. * * @var string */ protected $task; /** * Array of class methods to call for a given task. * * @var array */ protected $taskMap; /** * The name of the controller * * @var array */ protected $name; /** * The current view name; you can override it in the configuration * * @var string */ protected $view = ''; /** * Overrides the name of the view's default view * * @var string */ protected $viewName = null; /** * A copy of the FOFView object used in this triad * * @var FOFView */ private $_viewObject = null; /** * A cache for the view item objects created in this controller * * @var array */ protected $viewsCache = array(); /** * A copy of the FOFModel object used in this triad * * @var FOFModel */ private $_modelObject = null; /** * Does this tried have a FOFForm which will be used to render it? * * @var boolean */ protected $hasForm = false; /** * Gets a static (Singleton) instance of a controller class. It loads the * relevant controller file from the component's directory or, if it doesn't * exist, creates a new controller object out of thin air. * * @param string $option Component name, e.g. com_foobar * @param string $view The view name, also used for the controller name * @param array $config Configuration parameters * * @return FOFController */ public static function &getAnInstance($option = null, $view = null, $config = array()) { static $instances = array(); // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } $hash = $option . $view; if (!array_key_exists($hash, $instances)) { $instances[$hash] = self::getTmpInstance($option, $view, $config); } return $instances[$hash]; } /** * Gets a temporary instance of a controller object. A temporary instance is * not a Singleton and can be disposed off after use. * * @param string $option The component name, e.g. com_foobar * @param string $view The view name, e.g. cpanel * @param array $config Configuration parameters * * @return \FOFController A disposable class instance */ public static function &getTmpInstance($option = null, $view = null, $config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } // Get an input object if (array_key_exists('input', $config)) { $input = $config['input']; } else { $input = null; } if (array_key_exists('input_options', $config)) { $input_options = $config['input_options']; } else { $input_options = array(); } if (!($input instanceof FOFInput)) { $input = new FOFInput($input, $input_options); } // Determine the option (component name) and view $config['option'] = !is_null($option) ? $option : $input->getCmd('option', 'com_foobar'); $config['view'] = !is_null($view) ? $view : $input->getCmd('view', 'cpanel'); // Get the class base name, e.g. FoobarController $classBaseName = ucfirst(str_replace('com_', '', $config['option'])) . 'Controller'; // Get the class name suffixes, in the order to be searched for: plural, singular, 'default' $classSuffixes = array( FOFInflector::pluralize($config['view']), FOFInflector::singularize($config['view']), 'default' ); // Get the path names for the component $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($config['option']); $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); // Look for the best classname match foreach ($classSuffixes as $suffix) { $className = $classBaseName . ucfirst($suffix); if (class_exists($className)) { // The class is already loaded. We have a match! break; } // The class is not already loaded. Try to find and load it. $searchPaths = array( $componentPaths['main'] . '/controllers', $componentPaths['admin'] . '/controllers' ); // If we have a searchpath in the configuration please search it first if (array_key_exists('searchpath', $config)) { array_unshift($searchPaths, $config['searchpath']); } else { $configProvider = new FOFConfigProvider; $searchPath = $configProvider->get($config['option'] . '.views.' . FOFInflector::singularize($config['view']) . '.config.searchpath', null); if ($searchPath) { array_unshift($searchPaths, $componentPaths['admin'] . '/' . $searchPath); array_unshift($searchPaths, $componentPaths['main'] . '/' . $searchPath); } } /** * Try to find the path to this file. First try to find the * format-specific controller file, e.g. foobar.json.php for * format=json, then the regular one-size-fits-all controller */ $format = $input->getCmd('format', 'html'); $path = null; if (!empty($format)) { $path = $filesystem->pathFind( $searchPaths, strtolower($suffix) . '.' . strtolower($format) . '.php' ); } if (!$path) { $path = $filesystem->pathFind( $searchPaths, strtolower($suffix) . '.php' ); } // The path is found. Load the file and make sure the expected class name exists. if ($path) { require_once $path; if (class_exists($className)) { // The class was loaded successfully. We have a match! break; } } } if (!class_exists($className)) { // If no specialised class is found, instantiate the generic FOFController $className = 'FOFController'; } $instance = new $className($config); return $instance; } /** * Public constructor of the Controller class * * @param array $config Optional configuration parameters */ public function __construct($config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } $this->methods = array(); $this->message = null; $this->messageType = 'message'; $this->paths = array(); $this->redirect = null; $this->taskMap = array(); // Cache the config $this->config = $config; // Get the input for this MVC triad if (array_key_exists('input', $config)) { $input = $config['input']; } else { $input = null; } if (array_key_exists('input_options', $config)) { $input_options = $config['input_options']; } else { $input_options = array(); } if ($input instanceof FOFInput) { $this->input = $input; } else { $this->input = new FOFInput($input, $input_options); } // Load the configuration provider $this->configProvider = new FOFConfigProvider; // Determine the methods to exclude from the base class. $xMethods = get_class_methods('FOFController'); // Some methods must always be considered valid tasks $iMethods = array('accesspublic', 'accessregistered', 'accessspecial', 'add', 'apply', 'browse', 'cancel', 'copy', 'edit', 'orderdown', 'orderup', 'publish', 'read', 'remove', 'save', 'savenew', 'saveorder', 'unpublish', 'display', 'archive', 'trash', 'loadhistory'); // Get the public methods in this class using reflection. $r = new ReflectionClass($this); $rMethods = $r->getMethods(ReflectionMethod::IS_PUBLIC); foreach ($rMethods as $rMethod) { $mName = $rMethod->getName(); // Add default display method if not explicitly declared. if (!in_array($mName, $xMethods) || in_array($mName, $iMethods)) { $this->methods[] = strtolower($mName); // Auto register the methods as tasks. $this->taskMap[strtolower($mName)] = $mName; } } // Get the default values for the component and view names $classNameParts = FOFInflector::explode(get_class($this)); if (count($classNameParts) == 3) { $defComponent = "com_" . $classNameParts[0]; $defView = $classNameParts[2]; } else { $defComponent = 'com_foobar'; $defView = 'cpanel'; } $this->component = $this->input->get('option', $defComponent, 'cmd'); $this->view = $this->input->get('view', $defView, 'cmd'); $this->layout = $this->input->get('layout', null, 'cmd'); // Overrides from the config if (array_key_exists('option', $config)) { $this->component = $config['option']; } if (array_key_exists('view', $config)) { $this->view = $config['view']; } if (array_key_exists('layout', $config)) { $this->layout = $config['layout']; } $this->layout = $this->configProvider->get($this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.layout', $this->layout); $this->input->set('option', $this->component); // Set the bareComponent variable $this->bareComponent = str_replace('com_', '', strtolower($this->component)); // Set the $name variable $this->name = $this->bareComponent; // Set the basePath variable $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($this->component); $basePath = $componentPaths['main']; if (array_key_exists('base_path', $config)) { $basePath = $config['base_path']; } $altBasePath = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.base_path', null ); if (!is_null($altBasePath)) { $platformDirs = FOFPlatform::getInstance()->getPlatformBaseDirs(); $basePath = $platformDirs['public'] . '/' . $altBasePath; } $this->basePath = $basePath; // If the default task is set, register it as such $defaultTask = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.default_task', 'display' ); if (array_key_exists('default_task', $config)) { $this->registerDefaultTask($config['default_task']); } else { $this->registerDefaultTask($defaultTask); } // Set the models prefix if (empty($this->model_prefix)) { if (array_key_exists('model_prefix', $config)) { // User-defined prefix $this->model_prefix = $config['model_prefix']; } else { $this->model_prefix = $this->name . 'Model'; $this->model_prefix = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.model_prefix', $this->model_prefix ); } } // Set the default model search path if (array_key_exists('model_path', $config)) { // User-defined dirs $this->addModelPath($config['model_path'], $this->model_prefix); } else { $modelPath = $this->basePath . '/models'; $altModelPath = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.model_path', null ); if (!is_null($altModelPath)) { $modelPath = $this->basePath . '/' . $altModelPath; } $this->addModelPath($modelPath, $this->model_prefix); } // Set the default view search path if (array_key_exists('view_path', $config)) { // User-defined dirs $this->setPath('view', $config['view_path']); } else { $viewPath = $this->basePath . '/views'; $altViewPath = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.view_path', null ); if (!is_null($altViewPath)) { $viewPath = $this->basePath . '/' . $altViewPath; } $this->setPath('view', $viewPath); } // Set the default view. if (array_key_exists('default_view', $config)) { $this->default_view = $config['default_view']; } else { if (empty($this->default_view)) { $this->default_view = $this->getName(); } $this->default_view = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.default_view', $this->default_view ); } // Set the CSRF protection if (array_key_exists('csrf_protection', $config)) { $this->csrfProtection = $config['csrf_protection']; } $this->csrfProtection = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.csrf_protection', $this->csrfProtection ); // Set any model/view name overrides if (array_key_exists('viewName', $config)) { $this->setThisViewName($config['viewName']); } else { $overrideViewName = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.viewName', null ); if ($overrideViewName) { $this->setThisViewName($overrideViewName); } } if (array_key_exists('modelName', $config)) { $this->setThisModelName($config['modelName']); } else { $overrideModelName = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.modelName', null ); if ($overrideModelName) { $this->setThisModelName($overrideModelName); } } // Caching if (array_key_exists('cacheableTasks', $config)) { if (is_array($config['cacheableTasks'])) { $this->cacheableTasks = $config['cacheableTasks']; } } else { $cacheableTasks = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.cacheableTasks', null ); if ($cacheableTasks) { $cacheableTasks = explode(',', $cacheableTasks); if (count($cacheableTasks)) { $temp = array(); foreach ($cacheableTasks as $t) { $temp[] = trim($t); } $temp = array_unique($temp); $this->cacheableTasks = $temp; } } } // Bit mask for auto routing on setRedirect $this->autoRouting = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.config.autoRouting', $this->autoRouting ); if (array_key_exists('autoRouting', $config)) { $this->autoRouting = $config['autoRouting']; } // Apply task map $taskmap = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.taskmap' ); if (is_array($taskmap) && !empty($taskmap)) { foreach ($taskmap as $aliasedtask => $realmethod) { $this->registerTask($aliasedtask, $realmethod); } } } /** * Adds to the stack of model paths in LIFO order. * * @param mixed $path The directory (string) , or list of directories (array) to add. * @param string $prefix A prefix for models * * @return void */ public static function addModelPath($path, $prefix = '') { FOFModel::addIncludePath($path, $prefix); } /** * Adds to the search path for templates and resources. * * @param string $type The path type (e.g. 'model', 'view'). * @param mixed $path The directory string or stream array to search. * * @return FOFController A FOFController object to support chaining. */ protected function addPath($type, $path) { // Just force path to array settype($path, 'array'); $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); if (!isset($this->paths[$type])) { $this->paths[$type] = array(); } // Loop through the path directories foreach ($path as $dir) { // No surrounding spaces allowed! $dir = rtrim($filesystem->pathCheck($dir, '/'), '/') . '/'; // Add to the top of the search dirs array_unshift($this->paths[$type], $dir); } return $this; } /** * Add one or more view paths to the controller's stack, in LIFO order. * * @param mixed $path The directory (string) or list of directories (array) to add. * * @return FOFController This object to support chaining. */ public function addViewPath($path) { $this->addPath('view', $path); return $this; } /** * Authorisation check * * @param string $task The ACO Section Value to check access on. * * @return boolean True if authorised * * @deprecated 2.0 Use JAccess instead. */ public function authorise($task) { FOFPlatform::getInstance()->logDeprecated(__CLASS__ . '::' .__METHOD__ . ' is deprecated. Use checkACL() instead.'); return true; } /** * Create the filename for a resource. * * @param string $type The resource type to create the filename for. * @param array $parts An associative array of filename information. Optional. * * @return string The filename. */ protected static function createFileName($type, $parts = array()) { $filename = ''; switch ($type) { case 'controller': if (!empty($parts['format'])) { if ($parts['format'] == 'html') { $parts['format'] = ''; } else { $parts['format'] = '.' . $parts['format']; } } else { $parts['format'] = ''; } $filename = strtolower($parts['name'] . $parts['format'] . '.php'); break; case 'view': if (!empty($parts['type'])) { $parts['type'] = '.' . $parts['type']; } else { $parts['type'] = ''; } $filename = strtolower($parts['name'] . '/view' . $parts['type'] . '.php'); break; } return $filename; } /** * Executes a given controller task. The onBefore<task> and onAfter<task> * methods are called automatically if they exist. * * @param string $task The task to execute, e.g. "browse" * * @throws Exception Exception thrown if the onBefore<task> returns false * * @return null|bool False on execution failure */ public function execute($task) { $this->task = $task; $method_name = 'onBefore' . ucfirst($task); if (!method_exists($this, $method_name)) { $result = $this->onBeforeGenericTask($task); } elseif (method_exists($this, $method_name)) { $result = $this->$method_name(); } else { $result = true; } if ($result) { $plugin_event = FOFInflector::camelize('on before ' . $this->bareComponent . ' controller ' . $this->view . ' ' . $task); $plugin_result = FOFPlatform::getInstance()->runPlugins($plugin_event, array(&$this, &$this->input)); if (in_array(false, $plugin_result, true)) { $result = false; } } if (!$result) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403); } // Do not allow the display task to be directly called $task = strtolower($task); if (isset($this->taskMap[$task])) { $doTask = $this->taskMap[$task]; } elseif (isset($this->taskMap['__default'])) { $doTask = $this->taskMap['__default']; } else { $doTask = null; } if ($doTask == 'display') { FOFPlatform::getInstance()->setHeader('Status', '400 Bad Request', true); throw new Exception('Bad Request', 400); } $this->doTask = $doTask; $ret = $this->$doTask(); $method_name = 'onAfter' . ucfirst($task); if (method_exists($this, $method_name)) { $result = $this->$method_name(); } else { $result = true; } if ($result) { $plugin_event = FOFInflector::camelize('on after ' . $this->bareComponent . ' controller ' . $this->view . ' ' . $task); $plugin_result = FOFPlatform::getInstance()->runPlugins($plugin_event, array(&$this, &$this->input, &$ret)); if (in_array(false, $plugin_result, true)) { $result = false; } } if (!$result) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403); } return $ret; } /** * Default task. Assigns a model to the view and asks the view to render * itself. * * YOU MUST NOT USETHIS TASK DIRECTLY IN A URL. It is supposed to be * used ONLY inside your code. In the URL, use task=browse instead. * * @param bool $cachable Is this view cacheable? * @param bool $urlparams Add your safe URL parameters (see further down in the code) * @param string $tpl The name of the template file to parse * * @return bool */ public function display($cachable = false, $urlparams = false, $tpl = null) { $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { $viewType = $document->getType(); } else { $viewType = $this->input->getCmd('format', 'html'); } $view = $this->getThisView(); // Get/Create the model if ($model = $this->getThisModel()) { // Push the model into the view (as default) $view->setModel($model, true); } // Set the layout $view->setLayout(is_null($this->layout) ? 'default' : $this->layout); // Display the view $conf = FOFPlatform::getInstance()->getConfig(); if (FOFPlatform::getInstance()->isFrontend() && $cachable && ($viewType != 'feed') && $conf->get('caching') >= 1) { // Get a JCache object $option = $this->input->get('option', 'com_foobar', 'cmd'); $cache = JFactory::getCache($option, 'view'); // Set up a cache ID based on component, view, task and user group assignment $user = FOFPlatform::getInstance()->getUser(); if ($user->guest) { $groups = array(); } else { $groups = $user->groups; } // Set up safe URL parameters if (!is_array($urlparams)) { $urlparams = array( 'option' => 'CMD', 'view' => 'CMD', 'task' => 'CMD', 'format' => 'CMD', 'layout' => 'CMD', 'id' => 'INT', ); } if (is_array($urlparams)) { $app = JFactory::getApplication(); $registeredurlparams = null; if (version_compare(JVERSION, '3.0', 'ge')) { if (property_exists($app, 'registeredurlparams')) { $registeredurlparams = $app->registeredurlparams; } } else { $registeredurlparams = $app->get('registeredurlparams'); } if (empty($registeredurlparams)) { $registeredurlparams = new stdClass; } foreach ($urlparams AS $key => $value) { // Add your safe url parameters with variable type as value {@see JFilterInput::clean()}. $registeredurlparams->$key = $value; } if (version_compare(JVERSION, '3.0', 'ge')) { $app->registeredurlparams = $registeredurlparams; } else { $app->set('registeredurlparams', $registeredurlparams); } } // Create the cache ID after setting the registered URL params, as they are used to generate the ID $cacheId = md5(serialize(array(JCache::makeId(), $view->getName(), $this->doTask, $groups))); // Get the cached view or cache the current view $cache->get($view, 'display', $cacheId); } else { // Display without caching $view->display($tpl); } return true; } /** * Implements a default browse task, i.e. read a bunch of records and send * them to the browser. * * @return boolean */ public function browse() { if ($this->input->get('savestate', -999, 'int') == -999) { $this->input->set('savestate', true); } // Do I have a form? $model = $this->getThisModel(); if (empty($this->layout)) { $formname = 'form.default'; } else { $formname = 'form.' . $this->layout; } $model->setState('form_name', $formname); $form = $model->getForm(); if ($form !== false) { $this->hasForm = true; } $this->display(in_array('browse', $this->cacheableTasks)); return true; } /** * Single record read. The id set in the request is passed to the model and * then the item layout is used to render the result. * * @return bool */ public function read() { // Load the model $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } // Set the layout to item, if it's not set in the URL if (is_null($this->layout)) { $this->layout = 'item'; } // Do I have a form? $model->setState('form_name', 'form.' . $this->layout); $item = $model->getItem(); if (!($item instanceof FOFTable)) { return false; } $itemKey = $item->getKeyName(); if ($item->$itemKey != $model->getId()) { return false; } $formData = is_object($item) ? $item->getData() : array(); $form = $model->getForm($formData); if ($form !== false) { $this->hasForm = true; } // Display $this->display(in_array('read', $this->cacheableTasks)); return true; } /** * Single record add. The form layout is used to present a blank page. * * @return false|void */ public function add() { // Load and reset the model $model = $this->getThisModel(); $model->reset(); // Set the layout to form, if it's not set in the URL if (!$this->layout) { $this->layout = 'form'; } // Do I have a form? $model->setState('form_name', 'form.' . $this->layout); $item = $model->getItem(); if (!($item instanceof FOFTable)) { return false; } $formData = is_object($item) ? $item->getData() : array(); $form = $model->getForm($formData); if ($form !== false) { $this->hasForm = true; } // Display $this->display(in_array('add', $this->cacheableTasks)); } /** * Single record edit. The ID set in the request is passed to the model, * then the form layout is used to edit the result. * * @return bool */ public function edit() { // Load the model $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $status = $model->checkout(); if (!$status) { // Redirect on error if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); $this->setRedirect($url, $model->getError(), 'error'); return false; } // Set the layout to form, if it's not set in the URL if (is_null($this->layout)) { $this->layout = 'form'; } // Do I have a form? $model->setState('form_name', 'form.' . $this->layout); $item = $model->getItem(); if (!($item instanceof FOFTable)) { return false; } $itemKey = $item->getKeyName(); if ($item->$itemKey != $model->getId()) { return false; } $formData = is_object($item) ? $item->getData() : array(); $form = $model->getForm($formData); if ($form !== false) { $this->hasForm = true; } // Display $this->display(in_array('edit', $this->cacheableTasks)); return true; } /** * Save the incoming data and then return to the Edit task * * @return bool */ public function apply() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } $model = $this->getThisModel(); $result = $this->applySave(); // Redirect to the edit task if ($result) { $id = $this->input->get('id', 0, 'int'); $textkey = strtoupper($this->component) . '_LBL_' . strtoupper($this->view) . '_SAVED'; if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . $this->view . '&task=edit&id=' . $id . $this->getItemidURLSuffix(); $this->setRedirect($url, JText::_($textkey)); } return $result; } /** * Duplicates selected items * * @return bool */ public function copy() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $status = $model->copy(); // Redirect if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); if (!$status) { $this->setRedirect($url, $model->getError(), 'error'); return false; } else { if(!FOFPlatform::getInstance()->isCli()) { FOFPlatform::getInstance()->setHeader('Status', '201 Created', true); } $this->setRedirect($url); return true; } } /** * Save the incoming data and then return to the Browse task * * @return bool */ public function save() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } $result = $this->applySave(); // Redirect to the display task if ($result) { $textkey = strtoupper($this->component) . '_LBL_' . strtoupper($this->view) . '_SAVED'; if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); $this->setRedirect($url, JText::_($textkey)); } return $result; } /** * Save the incoming data and then return to the Add task * * @return bool */ public function savenew() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } $result = $this->applySave(); // Redirect to the display task if ($result) { $textkey = strtoupper($this->component) . '_LBL_' . strtoupper($this->view) . '_SAVED'; if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . $this->view . '&task=add' . $this->getItemidURLSuffix(); $this->setRedirect($url, JText::_($textkey)); } return $result; } /** * Cancel the edit, check in the record and return to the Browse task * * @return bool */ public function cancel() { $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $model->checkin(); // Remove any saved data JFactory::getSession()->set($model->getHash() . 'savedata', null); // Redirect to the display task if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); $this->setRedirect($url); return true; } /** * Method to load a row from version history * * @return boolean True if the content history is reverted, false otherwise * * @since 2.2 */ public function loadhistory() { $app = JFactory::getApplication(); $lang = JFactory::getLanguage(); $model = $this->getThisModel(); $table = $model->getTable(); $historyId = $app->input->get('version_id', null, 'integer'); $status = $model->checkout(); $alias = $this->component . '.' . $this->view; if (!$model->loadhistory($historyId, $table, $alias)) { $this->setMessage($model->getError(), 'error'); $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); $this->setRedirect($url); return false; } // Determine the name of the primary key for the data. if (empty($key)) { $key = $table->getKeyName(); } $recordId = $table->$key; // To avoid data collisions the urlVar may be different from the primary key. $urlVar = empty($this->urlVar) ? $key : $this->urlVar; // Access check. $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.edit', 'core.edit' ); if (!$this->checkACL($privilege)) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); $this->setRedirect($url); $table->checkin(); return false; } $table->store(); $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); $this->setRedirect($url); $this->setMessage(JText::sprintf('JLIB_APPLICATION_SUCCESS_LOAD_HISTORY', $model->getState('save_date'), $model->getState('version_note'))); return true; } /** * Sets the access to public. Joomla! 1.5 compatibility. * * @return bool * * @deprecated since 2.0 */ public function accesspublic() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } return $this->setaccess(0); } /** * Sets the access to registered. Joomla! 1.5 compatibility. * * @return bool * * @deprecated since 2.0 */ public function accessregistered() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } return $this->setaccess(1); } /** * Sets the access to special. Joomla! 1.5 compatibility. * * @return bool * * @deprecated since 2.0 */ public function accessspecial() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } return $this->setaccess(2); } /** * Publish (set enabled = 1) an item. * * @return bool */ public function publish() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } return $this->setstate(1); } /** * Unpublish (set enabled = 0) an item. * * @return bool */ public function unpublish() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } return $this->setstate(0); } /** * Archive (set enabled = 2) an item. * * @return bool */ public function archive() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } return $this->setstate(2); } /** * Trash (set enabled = -2) an item. * * @return bool */ public function trash() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } return $this->setstate(-2); } /** * Saves the order of the items * * @return bool */ public function saveorder() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $ordering = $model->getTable()->getColumnAlias('ordering'); $ids = $model->getIds(); $orders = $this->input->get('order', array(), 'array'); if ($n = count($ids)) { for ($i = 0; $i < $n; $i++) { $model->setId($ids[$i]); $neworder = (int) $orders[$i]; $item = $model->getItem(); if (!($item instanceof FOFTable)) { return false; } $key = $item->getKeyName(); if ($item->$key == $ids[$i]) { $item->$ordering = $neworder; $model->save($item); } } } $status = $model->reorder(); // Redirect if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); $this->setRedirect($url); return $status; } /** * Moves selected items one position down the ordering list * * @return bool */ public function orderdown() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $status = $model->move(1); // Redirect if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); if (!$status) { $this->setRedirect($url, $model->getError(), 'error'); } else { $this->setRedirect($url); } return $status; } /** * Moves selected items one position up the ordering list * * @return bool */ public function orderup() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $status = $model->move(-1); // Redirect if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); if (!$status) { $this->setRedirect($url, $model->getError(), 'error'); } else { $this->setRedirect($url); } return $status; } /** * Delete selected item(s) * * @return bool */ public function remove() { // CSRF prevention if ($this->csrfProtection) { $this->_csrfProtection(); } $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $status = $model->delete(); // Redirect if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); if (!$status) { $this->setRedirect($url, $model->getError(), 'error'); } else { $this->setRedirect($url); } return $status; } /** * Redirects the browser or returns false if no redirect is set. * * @return boolean False if no redirect exists. */ public function redirect() { if ($this->redirect) { $app = JFactory::getApplication(); $app->enqueueMessage($this->message, $this->messageType); $app->redirect($this->redirect); return true; } return false; } /** * Returns true if there is a redirect set in the controller * * @return boolean */ public function hasRedirect() { return !empty($this->redirect); } /** * Register the default task to perform if a mapping is not found. * * @param string $method The name of the method in the derived class to perform if a named task is not found. * * @return FOFController A FOFController object to support chaining. */ public function registerDefaultTask($method) { $this->registerTask('__default', $method); return $this; } /** * Register (map) a task to a method in the class. * * @param string $task The task. * @param string $method The name of the method in the derived class to perform for this task. * * @return FOFController A FOFController object to support chaining. */ public function registerTask($task, $method) { if (in_array(strtolower($method), $this->methods)) { $this->taskMap[strtolower($task)] = $method; } return $this; } /** * Unregister (unmap) a task in the class. * * @param string $task The task. * * @return FOFController This object to support chaining. */ public function unregisterTask($task) { unset($this->taskMap[strtolower($task)]); return $this; } /** * Sets the internal message that is passed with a redirect * * @param string $text Message to display on redirect. * @param string $type Message type. Optional, defaults to 'message'. * * @return string Previous message */ public function setMessage($text, $type = 'message') { $previous = $this->message; $this->message = $text; $this->messageType = $type; return $previous; } /** * Sets an entire array of search paths for resources. * * @param string $type The type of path to set, typically 'view' or 'model'. * @param string $path The new set of search paths. If null or false, resets to the current directory only. * * @return void */ protected function setPath($type, $path) { // Clear out the prior search dirs $this->paths[$type] = array(); // Actually add the user-specified directories $this->addPath($type, $path); } /** * Registers a redirection with an optional message. The redirection is * carried out when you use the redirect method. * * @param string $url The URL to redirect to * @param string $msg The message to be pushed to the application * @param string $type The message type to be pushed to the application, e.g. 'error' * * @return FOFController This object to support chaining */ public function setRedirect($url, $msg = null, $type = null) { // Do the logic only if we're parsing a raw url (index.php?foo=bar&etc=etc) if (strpos($url, 'index.php') === 0) { $isAdmin = FOFPlatform::getInstance()->isBackend(); $auto = false; if (($this->autoRouting == 2 || $this->autoRouting == 3) && $isAdmin) { $auto = true; } elseif (($this->autoRouting == 1 || $this->autoRouting == 3) && !$isAdmin) { $auto = true; } if ($auto) { $url = JRoute::_($url, false); } } $this->redirect = $url; if ($msg !== null) { // Controller may have set this directly $this->message = $msg; } // Ensure the type is not overwritten by a previous call to setMessage. if (empty($type)) { if (empty($this->messageType)) { $this->messageType = 'message'; } } // If the type is explicitly set, set it. else { $this->messageType = $type; } return $this; } /** * Sets the published state (the enabled field) of the selected item(s) * * @param integer $state The desired state. 0 is unpublished, 1 is published. * * @return bool */ protected function setstate($state = 0) { $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $status = $model->publish($state); // Redirect if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); if (!$status) { $this->setRedirect($url, $model->getError(), 'error'); } else { $this->setRedirect($url); } return $status; } /** * Sets the access level of the selected item(s). * * @param integer $level The desired viewing access level ID * * @return bool */ protected function setaccess($level = 0) { $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $id = $model->getId(); $item = $model->getItem(); if (!($item instanceof FOFTable)) { return false; } $accessField = $item->getColumnAlias('access'); $key = $item->getKeyName(); $loadedid = $item->$key; if ($id == $loadedid) { $item->$accessField = $level; $status = $model->save($item); } else { $status = false; } // Redirect if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . FOFInflector::pluralize($this->view) . $this->getItemidURLSuffix(); if (!$status) { $this->setRedirect($url, $model->getError(), 'error'); } else { $this->setRedirect($url); } return $status; } /** * Common method to handle apply and save tasks * * @return boolean Returns true on success */ final private function applySave() { // Load the model $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $id = $model->getId(); $data = $this->input->getData(); if (!$this->onBeforeApplySave($data)) { return false; } // Set the layout to form, if it's not set in the URL if (is_null($this->layout)) { $this->layout = 'form'; } // Do I have a form? $model->setState('form_name', 'form.' . $this->layout); $status = $model->save($data); if ($status && ($id != 0)) { FOFPlatform::getInstance()->setHeader('Status', '201 Created', true); // Try to check-in the record if it's not a new one $status = $model->checkin(); } if ($status) { $status = $this->onAfterApplySave(); } $this->input->set('id', $model->getId()); if (!$status) { // Redirect on error $id = $model->getId(); if ($customURL = $this->input->get('returnurl', '', 'string')) { $customURL = base64_decode($customURL); } if (!empty($customURL)) { $url = $customURL; } elseif ($id != 0) { $url = 'index.php?option=' . $this->component . '&view=' . $this->view . '&task=edit&id=' . $id . $this->getItemidURLSuffix(); } else { $url = 'index.php?option=' . $this->component . '&view=' . $this->view . '&task=add' . $this->getItemidURLSuffix(); } $this->setRedirect($url, '<li>' . implode('</li><li>', $model->getErrors()) . '</li>', 'error'); return false; } else { $session = JFactory::getSession(); $session->set($model->getHash() . 'savedata', null); return true; } } /** * Returns the default model associated with the current view * * @param array $config Configuration variables for the model * * @return FOFModel The global instance of the model (singleton) */ final public function getThisModel($config = array()) { if (!is_object($this->_modelObject)) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } if (!empty($this->modelName)) { $parts = FOFInflector::explode($this->modelName); $modelName = ucfirst(array_pop($parts)); $prefix = FOFInflector::implode($parts); } else { $prefix = ucfirst($this->bareComponent) . 'Model'; $modelName = ucfirst(FOFInflector::pluralize($this->view)); } if (!array_key_exists('input', $config) || !($config['input'] instanceof FOFInput)) { $config['input'] = $this->input; } $this->_modelObject = $this->getModel($modelName, $prefix, $config); } return $this->_modelObject; } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return object The model. */ public function getModel($name = '', $prefix = '', $config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config) || empty($config)) { // array_merge is required to create a copy instead of assigning by reference $config = array_merge($this->config); } if (empty($name)) { $name = $this->getName(); } if (empty($prefix)) { $prefix = $this->model_prefix; } if ($model = $this->createModel($name, $prefix, $config)) { // Task is a reserved state $model->setState('task', $this->task); // Let's get the application object and set menu information if it's available if (!FOFPlatform::getInstance()->isCli()) { $app = JFactory::getApplication(); $menu = $app->getMenu(); if (is_object($menu)) { if ($item = $menu->getActive()) { $params = $menu->getParams($item->id); // Set default state data $model->setState('parameters.menu', $params); } } } } return $model; } /** * Returns current view object * * @param array $config Configuration variables for the model * * @return FOFView The global instance of the view object (singleton) */ final public function getThisView($config = array()) { if (!is_object($this->_viewObject)) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config) || empty($config)) { // array_merge is required to create a copy instead of assigning by reference $config = array_merge($this->config); } $prefix = null; $viewName = null; $viewType = null; if (!empty($this->viewName)) { $parts = FOFInflector::explode($this->viewName); $viewName = ucfirst(array_pop($parts)); $prefix = FOFInflector::implode($parts); } else { $prefix = ucfirst($this->bareComponent) . 'View'; $viewName = ucfirst($this->view); } $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { $viewType = $document->getType(); } else { $viewType = $this->input->getCmd('format', 'html'); } if (($viewType == 'html') && $this->hasForm) { $viewType = 'form'; } if (!array_key_exists('input', $config) || !($config['input'] instanceof FOFInput)) { $config['input'] = $this->input; } $config['input']->set('base_path', $this->basePath); $this->_viewObject = $this->getView($viewName, $viewType, $prefix, $config); } return $this->_viewObject; } /** * Method to get the controller name * * The dispatcher name is set by default parsed using the classname, or it can be set * by passing a $config['name'] in the class constructor * * @throws Exception * * @return string The name of the dispatcher */ public function getName() { if (empty($this->name)) { if (empty($this->bareComponent)) { $r = null; if (!preg_match('/(.*)Controller/i', get_class($this), $r)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500); } $this->name = strtolower($r[1]); } else { $this->name = $this->bareComponent; } } return $this->name; } /** * Get the last task that is being performed or was most recently performed. * * @return string The task that is being performed or was most recently performed. */ public function getTask() { return $this->task; } /** * Gets the available tasks in the controller. * * @return array Array[i] of task names. */ public function getTasks() { return $this->methods; } /** * Method to get a reference to the current view and load it if necessary. * * @param string $name The view name. Optional, defaults to the controller name. * @param string $type The view type. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for view. Optional. * * @throws Exception * * @return FOFView Reference to the view or an error. */ public function getView($name = '', $type = '', $prefix = '', $config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } if (empty($name)) { $name = $this->getName(); } if (empty($prefix)) { $prefix = $this->getName() . 'View'; } $signature = md5($name . $type . $prefix . serialize($config)); if (empty($this->viewsCache[$signature])) { if ($view = $this->createView($name, $prefix, $type, $config)) { $this->viewsCache[$signature] = & $view; } else { throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_VIEW_NOT_FOUND', $name, $type, $prefix), 500); } } return $this->viewsCache[$signature]; } /** * Creates a new model object * * @param string $name The name of the model class, e.g. Items * @param string $prefix The prefix of the model class, e.g. FoobarModel * @param array $config The configuration parameters for the model class * * @return FOFModel The model object */ protected function createModel($name, $prefix = '', $config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } $result = null; // Clean the model name $modelName = preg_replace('/[^A-Z0-9_]/i', '', $name); $classPrefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix); $result = FOFModel::getAnInstance($modelName, $classPrefix, $config); return $result; } /** * Method to load and return a model object. * * @param string $name The name of the model. * @param string $prefix Optional model prefix. * @param array $config Configuration array for the model. Optional. * * @return mixed Model object on success; otherwise null */ protected function &_createModel($name, $prefix = '', $config = array()) { FOFPlatform::getInstance()->logDeprecated(__CLASS__ . '::' .__METHOD__ . ' is deprecated. Use createModel() instead.'); return $this->createModel($name, $prefix, $config); } /** * Creates a View object instance and returns it * * @param string $name The name of the view, e.g. Items * @param string $prefix The prefix of the view, e.g. FoobarView * @param string $type The type of the view, usually one of Html, Raw, Json or Csv * @param array $config The configuration variables to use for creating the view * * @return FOFView */ protected function createView($name, $prefix = '', $type = '', $config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } $result = null; // Clean the view name $viewName = preg_replace('/[^A-Z0-9_]/i', '', $name); $classPrefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix); $viewType = preg_replace('/[^A-Z0-9_]/i', '', $type); if (!isset($config['input'])) { $config['input'] = $this->input; } if (($config['input'] instanceof FOFInput)) { $tmpInput = $config['input']; } else { $tmpInput = new FOFInput($config['input']); } // Guess the component name and view if (!empty($prefix)) { preg_match('/(.*)View$/', $prefix, $m); $component = 'com_' . strtolower($m[1]); } else { $component = ''; } if (empty($component) && array_key_exists('input', $config)) { $component = $tmpInput->get('option', $component, 'cmd'); } if (array_key_exists('option', $config)) { if ($config['option']) { $component = $config['option']; } } $config['option'] = $component; $view = strtolower($viewName); if (empty($view) && array_key_exists('input', $config)) { $view = $tmpInput->get('view', $view, 'cmd'); } if (array_key_exists('view', $config)) { if ($config['view']) { $view = $config['view']; } } $config['view'] = $view; if (array_key_exists('input', $config)) { $tmpInput->set('option', $config['option']); $tmpInput->set('view', $config['view']); $config['input'] = $tmpInput; } // Get the component directories $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($config['option']); // Get the base paths where the view class files are expected to live $basePaths = array( $componentPaths['main'], $componentPaths['alt'] ); $basePaths = array_merge($this->paths['view']); // Get the alternate (singular/plural) view name $altViewName = FOFInflector::isPlural($viewName) ? FOFInflector::singularize($viewName) : FOFInflector::pluralize($viewName); $suffixes = array( $viewName, $altViewName, 'default' ); $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); foreach ($suffixes as $suffix) { // Build the view class name $viewClass = $classPrefix . ucfirst($suffix); if (class_exists($viewClass)) { // The class is already loaded break; } // The class is not loaded. Let's load it! $viewPath = $this->createFileName('view', array('name' => $suffix, 'type' => $viewType)); $path = $filesystem->pathFind($basePaths, $viewPath); if ($path) { require_once $path; } if (class_exists($viewClass)) { // The class was loaded successfully break; } } if (!class_exists($viewClass)) { $viewClass = 'FOFView' . ucfirst($type); } $templateOverridePath = FOFPlatform::getInstance()->getTemplateOverridePath($config['option']); // Setup View configuration options if (!array_key_exists('template_path', $config)) { $config['template_path'][] = $componentPaths['main'] . '/views/' . FOFInflector::pluralize($config['view']) . '/tmpl'; if ($templateOverridePath) { $config['template_path'][] = $templateOverridePath . '/' . FOFInflector::pluralize($config['view']); } $config['template_path'][] = $componentPaths['main'] . '/views/' . FOFInflector::singularize($config['view']) . '/tmpl'; if ($templateOverridePath) { $config['template_path'][] = $templateOverridePath . '/' . FOFInflector::singularize($config['view']); } $config['template_path'][] = $componentPaths['main'] . '/views/' . $config['view'] . '/tmpl'; if ($templateOverridePath) { $config['template_path'][] = $templateOverridePath . '/' . $config['view']; } } $extraTemplatePath = $this->configProvider->get($config['option'] . '.views.' . $config['view'] . '.config.template_path', null); if ($extraTemplatePath) { array_unshift($config['template_path'], $componentPaths['main'] . '/' . $extraTemplatePath); } if (!array_key_exists('helper_path', $config)) { $config['helper_path'] = array( $componentPaths['main'] . '/helpers', $componentPaths['admin'] . '/helpers' ); } $extraHelperPath = $this->configProvider->get($config['option'] . '.views.' . $config['view'] . '.config.helper_path', null); if ($extraHelperPath) { $config['helper_path'][] = $componentPaths['main'] . '/' . $extraHelperPath; } // Set up the page title $setFrontendPageTitle = $this->configProvider->get($config['option'] . '.views.' . $config['view'] . '.config.setFrontendPageTitle', null); if ($setFrontendPageTitle) { $setFrontendPageTitle = strtolower($setFrontendPageTitle); $config['setFrontendPageTitle'][] = in_array($setFrontendPageTitle, array('1', 'yes', 'true', 'on')); } $defaultPageTitle = $this->configProvider->get($config['option'] . '.views.' . $config['view'] . '.config.defaultPageTitle', null); if ($defaultPageTitle) { $config['defaultPageTitle'][] = in_array($defaultPageTitle, array('1', 'yes', 'true', 'on')); } // Set the use_hypermedia flag in $config if it's not already set if (!isset($config['use_hypermedia'])) { $config['use_hypermedia'] = $this->configProvider->get($config['option'] . '.views.' . $config['view'] . '.config.use_hypermedia', false); } // Set also the linkbar_style if (!isset($config['linkbar_style'])) { $style = $this->configProvider->get($config['option'] . '.views.' . $config['view'] . '.config.linkbar_style', false); if ($style) { $config['linkbar_style'] = $style; } } /** * Some administrative templates force format=utf (yeah, I know, what the heck, right?) when a format * URL parameter does not exist in the URL. Of course there is no such thing as FOFViewUtf (why the heck would * it be, there is no such thing as a format=utf in Joomla! for crying out loud) which causes a Fatal Error. So * we have to detect that and force $type='html'... */ if (!class_exists($viewClass) && ($type != 'html')) { $type = 'html'; $result = $this->createView($name, $prefix, $type, $config); } else { $result = new $viewClass($config); } return $result; } /** * Deprecated function to create a View object instance * * @param string $name The name of the view, e.g. 'Items' * @param string $prefix The prefix of the view, e.g. 'FoobarView' * @param string $type The view type, e.g. 'html' * @param array $config The configuration array for the view * * @return FOFView * * @see FOFController::createView * * @deprecated since version 2.0 */ protected function &_createView($name, $prefix = '', $type = '', $config = array()) { FOFPlatform::getInstance()->logDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated. Use createView() instead.'); return $this->createView($name, $prefix, $type, $config); } /** * Set the name of the view to be used by this Controller * * @param string $viewName The name of the view * * @return void */ public function setThisViewName($viewName) { $this->viewName = $viewName; } /** * Set the name of the model to be used by this Controller * * @param string $modelName The name of the model * * @return void */ public function setThisModelName($modelName) { $this->modelName = $modelName; } /** * Checks if the current user has enough privileges for the requested ACL * area. * * @param string $area The ACL area, e.g. core.manage. * * @return boolean True if the user has the ACL privilege specified */ protected function checkACL($area) { if (in_array(strtolower($area), array('false','0','no','403'))) { return false; } if (in_array(strtolower($area), array('true','1','yes'))) { return true; } elseif (empty($area)) { return true; } else { // Check if we're dealing with ids $ids = null; // First, check if there is an asset for this record $table = $this->getThisModel()->getTable(); if ($table && $table->isAssetsTracked()) { $ids = $this->getThisModel()->getId() ? $this->getThisModel()->getId() : null; } // Generic or Asset tracking if (empty($ids)) { return FOFPlatform::getInstance()->authorise($area, $this->component); } else { if (!is_array($ids)) { $ids = array($ids); } $resource = FOFInflector::singularize($this->view); $isEditState = ($area == 'core.edit.state'); foreach ($ids as $id) { $asset = $this->component . '.' . $resource . '.' . $id; // Dedicated permission found, check it! if (FOFPlatform::getInstance()->authorise($area, $asset) ) { return true; } // Fallback on edit.own, if not edit.state. First test if the permission is available. if ((!$isEditState) && (FOFPlatform::getInstance()->authorise('core.edit.own', $asset))) { $table = $this->getThisModel()->getTable(); $table->load($id); $created_by = $table->getColumnAlias('created_by'); if ($table && isset($table->$created_by)) { // Now test the owner is the user. $owner_id = (int) $table->$created_by; // If the owner matches 'me' then do the test. if ($owner_id == FOFPlatform::getInstance()->getUser()->id) { return true; } else { return false; } } else { return false; } } } } } return false; } /** * A catch-all method for all tasks without a corresponding onBefore * method. Applies the ACL preferences defined in fof.xml. * * @param string $task The task being executed * * @return boolean True to allow execution of the task */ protected function onBeforeGenericTask($task) { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.' . $task, '' ); return $this->checkACL($privilege); } /** * Execute something before applySave is called. Return false to prevent * applySave from executing. * * @param array &$data The data upon which applySave will act * * @return boolean True to allow applySave to run */ protected function onBeforeApplySave(&$data) { return true; } /** * Execute something after applySave has run. * * @return boolean True to allow normal return, false to cause a 403 error */ protected function onAfterApplySave() { return true; } /** * ACL check before changing the access level; override to customise * * @return boolean True to allow accesspublic() to run */ protected function onBeforeAccesspublic() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.accesspublic', 'core.edit.state'); return $this->checkACL($privilege); } /** * ACL check before changing the access level; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeAccessregistered() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.accessregistered', 'core.edit.state' ); return $this->checkACL($privilege); } /** * ACL check before changing the access level; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeAccessspecial() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.accessspecial', 'core.edit.state' ); return $this->checkACL($privilege); } /** * ACL check before adding a new record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeAdd() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.add', 'core.create' ); return $this->checkACL($privilege); } /** * ACL check before saving a new/modified record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeApply() { $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $id = $model->getId(); if(!$id) { $defaultPrivilege = 'core.create'; } else { $defaultPrivilege = 'core.edit'; } $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.apply', $defaultPrivilege ); return $this->checkACL($privilege); } /** * ACL check before allowing someone to browse * * @return boolean True to allow the method to run */ protected function onBeforeBrowse() { $defaultPrivilege = ''; $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.browse', $defaultPrivilege ); return $this->checkACL($privilege); } /** * ACL check before cancelling an edit * * @return boolean True to allow the method to run */ protected function onBeforeCancel() { $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $id = $model->getId(); if(!$id) { $defaultPrivilege = 'core.create'; } else { $defaultPrivilege = 'core.edit'; } $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.cancel', $defaultPrivilege ); return $this->checkACL($privilege); } /** * ACL check before editing a record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeEdit() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.edit', 'core.edit' ); return $this->checkACL($privilege); } /** * ACL check before changing the ordering of a record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeOrderdown() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.orderdown', 'core.edit.state' ); return $this->checkACL($privilege); } /** * ACL check before changing the ordering of a record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeOrderup() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.orderup', 'core.edit.state' ); return $this->checkACL($privilege); } /** * ACL check before changing the publish status of a record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforePublish() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.publish', 'core.edit.state' ); return $this->checkACL($privilege); } /** * ACL check before removing a record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeRemove() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.remove', 'core.delete' ); return $this->checkACL($privilege); } /** * ACL check before saving a new/modified record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeSave() { $model = $this->getThisModel(); if (!$model->getId()) { $model->setIDsFromRequest(); } $id = $model->getId(); if(!$id) { $defaultPrivilege = 'core.create'; } else { $defaultPrivilege = 'core.edit'; } $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.save', $defaultPrivilege ); return $this->checkACL($privilege); } /** * ACL check before saving a new/modified record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeSavenew() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.savenew', 'core.create' ); return $this->checkACL($privilege); } /** * ACL check before changing the ordering of a record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeSaveorder() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.saveorder', 'core.edit.state' ); return $this->checkACL($privilege); } /** * ACL check before changing the publish status of a record; override to customise * * @return boolean True to allow the method to run */ protected function onBeforeUnpublish() { $privilege = $this->configProvider->get( $this->component . '.views.' . FOFInflector::singularize($this->view) . '.acl.unpublish', 'core.edit.state' ); return $this->checkACL($privilege); } /** * Gets a URL suffix with the Itemid parameter. If it's not the front-end of the site, or if * there is no Itemid set it returns an empty string. * * @return string The &Itemid=123 URL suffix, or an empty string if Itemid is not applicable */ public function getItemidURLSuffix() { if (FOFPlatform::getInstance()->isFrontend() && ($this->input->getCmd('Itemid', 0) != 0)) { return '&Itemid=' . $this->input->getInt('Itemid', 0); } else { return ''; } } /** * Applies CSRF protection by means of a standard Joomla! token (nonce) check. * Raises a 403 Access Forbidden error through the platform if the check fails. * * TODO Move this check inside the platform * * @return boolean True if the CSRF check is successful * * @throws Exception */ protected function _csrfProtection() { static $isCli = null, $isAdmin = null; if (is_null($isCli)) { $isCli = FOFPlatform::getInstance()->isCli(); $isAdmin = FOFPlatform::getInstance()->isBackend(); } switch ($this->csrfProtection) { // Never case 0: return true; break; // Always case 1: break; // Only back-end and HTML format case 2: if ($isCli) { return true; } elseif (!$isAdmin && ($this->input->get('format', 'html', 'cmd') != 'html')) { return true; } break; // Only back-end case 3: if (!$isAdmin) { return true; } break; } $hasToken = false; $session = JFactory::getSession(); // Joomla! 1.5/1.6/1.7/2.5 (classic Joomla! API) method if (method_exists('JUtility', 'getToken')) { $token = JUtility::getToken(); $hasToken = $this->input->get($token, false, 'none') == 1; if (!$hasToken) { $hasToken = $this->input->get('_token', null, 'none') == $token; } } // Joomla! 2.5+ (Platform 12.1+) method if (!$hasToken) { if (method_exists($session, 'getToken')) { $token = $session->getToken(); $hasToken = $this->input->get($token, false, 'none') == 1; if (!$hasToken) { $hasToken = $this->input->get('_token', null, 'none') == $token; } } } // Joomla! 2.5+ formToken method if (!$hasToken) { if (method_exists($session, 'getFormToken')) { $token = $session->getFormToken(); $hasToken = $this->input->get($token, false, 'none') == 1; if (!$hasToken) { $hasToken = $this->input->get('_token', null, 'none') == $token; } } } if (!$hasToken) { FOFPlatform::getInstance()->raiseError(403, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN')); return false; } } } PK���\��,� � libraries/fof/autoloader/fof.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage autoloader * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ defined('FOF_INCLUDED') or die(); /** * The main class autoloader for FOF itself * * @package FrameworkOnFramework * @subpackage autoloader * @since 2.1 */ class FOFAutoloaderFof { /** * An instance of this autoloader * * @var FOFAutoloaderFof */ public static $autoloader = null; /** * The path to the FOF root directory * * @var string */ public static $fofPath = null; /** * Initialise this autoloader * * @return FOFAutoloaderFof */ public static function init() { if (self::$autoloader == null) { self::$autoloader = new self; } return self::$autoloader; } /** * Public constructor. Registers the autoloader with PHP. */ public function __construct() { self::$fofPath = realpath(__DIR__ . '/../'); spl_autoload_register(array($this,'autoload_fof_core')); } /** * The actual autoloader * * @param string $class_name The name of the class to load * * @return void */ public function autoload_fof_core($class_name) { // Make sure the class has a FOF prefix if (substr($class_name, 0, 3) != 'FOF') { return; } // Remove the prefix $class = substr($class_name, 3); // Change from camel cased (e.g. ViewHtml) into a lowercase array (e.g. 'view','html') $class = preg_replace('/(\s)+/', '_', $class); $class = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $class)); $class = explode('_', $class); // First try finding in structured directory format (preferred) $path = self::$fofPath . '/' . implode('/', $class) . '.php'; if (@file_exists($path)) { include_once $path; } // Then try the duplicate last name structured directory format (not recommended) if (!class_exists($class_name, false)) { reset($class); $lastPart = end($class); $path = self::$fofPath . '/' . implode('/', $class) . '/' . $lastPart . '.php'; if (@file_exists($path)) { include_once $path; } } // If it still fails, try looking in the legacy folder (used for backwards compatibility) if (!class_exists($class_name, false)) { $path = self::$fofPath . '/legacy/' . implode('/', $class) . '.php'; if (@file_exists($path)) { include_once $path; } } } } PK���\���8NN&libraries/fof/autoloader/component.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage autoloader * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ defined('FOF_INCLUDED') or die(); /** * An autoloader for FOF-powered components. It allows the autoloading of * various classes related to the operation of a component, from Controllers * and Models to Helpers and Fields. If a class doesn't exist, it will be * created on the fly. * * @package FrameworkOnFramework * @subpackage autoloader * @since 2.1 */ class FOFAutoloaderComponent { /** * An instance of this autoloader * * @var FOFAutoloaderComponent */ public static $autoloader = null; /** * The path to the FOF root directory * * @var string */ public static $fofPath = null; /** * An array holding component names and their FOF-ness status * * @var array */ protected static $fofComponents = array(); /** * Initialise this autoloader * * @return FOFAutoloaderComponent */ public static function init() { if (self::$autoloader == null) { self::$autoloader = new self; } return self::$autoloader; } /** * Public constructor. Registers the autoloader with PHP. */ public function __construct() { self::$fofPath = realpath(__DIR__ . '/../'); spl_autoload_register(array($this,'autoload_fof_controller')); spl_autoload_register(array($this,'autoload_fof_model')); spl_autoload_register(array($this,'autoload_fof_view')); spl_autoload_register(array($this,'autoload_fof_table')); spl_autoload_register(array($this,'autoload_fof_helper')); spl_autoload_register(array($this,'autoload_fof_toolbar')); spl_autoload_register(array($this,'autoload_fof_field')); } /** * Returns true if this is a FOF-powered component, i.e. if it has a fof.xml * file in its main directory. * * @param string $component The component's name * * @return boolean */ public function isFOFComponent($component) { if (!isset($fofComponents[$component])) { $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($component); $fofComponents[$component] = file_exists($componentPaths['admin'] . '/fof.xml'); } return $fofComponents[$component]; } /** * Creates class aliases. On systems where eval() is enabled it creates a * real class. On other systems it merely creates an alias. The eval() * method is preferred as class_aliases result in the name of the class * being instanciated not being available, making it impossible to create * a class instance without passing a $config array :( * * @param string $original The name of the original (existing) class * @param string $alias The name of the new (aliased) class * @param boolean $autoload Should I try to autoload the $original class? * * @return void */ private function class_alias($original, $alias, $autoload = true) { static $hasEval = null; if (is_null($hasEval)) { $hasEval = false; if (function_exists('ini_get')) { $disabled_functions = ini_get('disabled_functions'); if (!is_string($disabled_functions)) { $hasEval = true; } else { $disabled_functions = explode(',', $disabled_functions); $hasEval = !in_array('eval', $disabled_functions); } } } if (!class_exists($original, $autoload)) { return; } if ($hasEval) { $phpCode = "class $alias extends $original {}"; eval($phpCode); } else { class_alias($original, $alias, $autoload); } } /** * Autoload Controllers * * @param string $class_name The name of the class to load * * @return void */ public function autoload_fof_controller($class_name) { FOFPlatform::getInstance()->logDebug(__METHOD__ . "() autoloading $class_name"); static $isCli = null, $isAdmin = null; if (is_null($isCli) && is_null($isAdmin)) { list($isCli, $isAdmin) = FOFDispatcher::isCliAdmin(); } if (strpos($class_name, 'Controller') === false) { return; } // Change from camel cased into a lowercase array $class_modified = preg_replace('/(\s)+/', '_', $class_name); $class_modified = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $class_modified)); $parts = explode('_', $class_modified); // We need three parts in the name if (count($parts) != 3) { return; } // We need the second part to be "controller" if ($parts[1] != 'controller') { return; } // Get the information about this class $component_raw = $parts[0]; $component = 'com_' . $parts[0]; $view = $parts[2]; // Is this an FOF 2.1 or later component? if (!$this->isFOFComponent($component)) { return; } // Get the alternate view and class name (opposite singular/plural name) $alt_view = FOFInflector::isSingular($view) ? FOFInflector::pluralize($view) : FOFInflector::singularize($view); $alt_class = FOFInflector::camelize($component_raw . '_controller_' . $alt_view); // Get the component's paths $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($component); // Get the proper and alternate paths and file names $file = "/controllers/$view.php"; $altFile = "/controllers/$alt_view.php"; $path = $componentPaths['main']; $altPath = $componentPaths['alt']; // Try to find the proper class in the proper path if (file_exists($path . $file)) { @include_once $path . $file; } // Try to find the proper class in the alternate path if (!class_exists($class_name) && file_exists($altPath . $file)) { @include_once $altPath . $file; } // Try to find the alternate class in the proper path if (!class_exists($alt_class) && file_exists($path . $altFile)) { @include_once $path . $altFile; } // Try to find the alternate class in the alternate path if (!class_exists($alt_class) && file_exists($altPath . $altFile)) { @include_once $altPath . $altFile; } // If the alternate class exists just map the class to the alternate if (!class_exists($class_name) && class_exists($alt_class)) { $this->class_alias($alt_class, $class_name); } // No class found? Map to FOFController elseif (!class_exists($class_name)) { if ($view != 'default') { $defaultClass = FOFInflector::camelize($component_raw . '_controller_default'); $this->class_alias($defaultClass, $class_name); } else { $this->class_alias('FOFController', $class_name); } } } /** * Autoload Models * * @param string $class_name The name of the class to load * * @return void */ public function autoload_fof_model($class_name) { FOFPlatform::getInstance()->logDebug(__METHOD__ . "() autoloading $class_name"); static $isCli = null, $isAdmin = null; if (is_null($isCli) && is_null($isAdmin)) { list($isCli, $isAdmin) = FOFDispatcher::isCliAdmin(); } if (strpos($class_name, 'Model') === false) { return; } // Change from camel cased into a lowercase array $class_modified = preg_replace('/(\s)+/', '_', $class_name); $class_modified = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $class_modified)); $parts = explode('_', $class_modified); // We need three parts in the name if (count($parts) != 3) { return; } // We need the second part to be "model" if ($parts[1] != 'model') { return; } // Get the information about this class $component_raw = $parts[0]; $component = 'com_' . $parts[0]; $view = $parts[2]; // Is this an FOF 2.1 or later component? if (!$this->isFOFComponent($component)) { return; } // Get the alternate view and class name (opposite singular/plural name) $alt_view = FOFInflector::isSingular($view) ? FOFInflector::pluralize($view) : FOFInflector::singularize($view); $alt_class = FOFInflector::camelize($component_raw . '_model_' . $alt_view); // Get the proper and alternate paths and file names $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($component); $file = "/models/$view.php"; $altFile = "/models/$alt_view.php"; $path = $componentPaths['main']; $altPath = $componentPaths['alt']; // Try to find the proper class in the proper path if (file_exists($path . $file)) { @include_once $path . $file; } // Try to find the proper class in the alternate path if (!class_exists($class_name) && file_exists($altPath . $file)) { @include_once $altPath . $file; } // Try to find the alternate class in the proper path if (!class_exists($alt_class) && file_exists($path . $altFile)) { @include_once $path . $altFile; } // Try to find the alternate class in the alternate path if (!class_exists($alt_class) && file_exists($altPath . $altFile)) { @include_once $altPath . $altFile; } // If the alternate class exists just map the class to the alternate if (!class_exists($class_name) && class_exists($alt_class)) { $this->class_alias($alt_class, $class_name); } // No class found? Map to FOFModel elseif (!class_exists($class_name)) { if ($view != 'default') { $defaultClass = FOFInflector::camelize($component_raw . '_model_default'); $this->class_alias($defaultClass, $class_name); } else { $this->class_alias('FOFModel', $class_name, true); } } } /** * Autoload Views * * @param string $class_name The name of the class to load * * @return void */ public function autoload_fof_view($class_name) { FOFPlatform::getInstance()->logDebug(__METHOD__ . "() autoloading $class_name"); static $isCli = null, $isAdmin = null; if (is_null($isCli) && is_null($isAdmin)) { list($isCli, $isAdmin) = FOFDispatcher::isCliAdmin(); } if (strpos($class_name, 'View') === false) { return; } // Change from camel cased into a lowercase array $class_modified = preg_replace('/(\s)+/', '_', $class_name); $class_modified = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $class_modified)); $parts = explode('_', $class_modified); // We need at least three parts in the name if (count($parts) < 3) { return; } // We need the second part to be "view" if ($parts[1] != 'view') { return; } // Get the information about this class $component_raw = $parts[0]; $component = 'com_' . $parts[0]; $view = $parts[2]; if (count($parts) > 3) { $format = $parts[3]; } else { $input = new FOFInput; $format = $input->getCmd('format', 'html', 'cmd'); } // Is this an FOF 2.1 or later component? if (!$this->isFOFComponent($component)) { return; } // Get the alternate view and class name (opposite singular/plural name) $alt_view = FOFInflector::isSingular($view) ? FOFInflector::pluralize($view) : FOFInflector::singularize($view); $alt_class = FOFInflector::camelize($component_raw . '_view_' . $alt_view); // Get the proper and alternate paths and file names $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($component); $protoFile = "/models/$view"; $protoAltFile = "/models/$alt_view"; $path = $componentPaths['main']; $altPath = $componentPaths['alt']; $formats = array($format); if ($format != 'html') { $formats[] = 'raw'; } foreach ($formats as $currentFormat) { $file = $protoFile . '.' . $currentFormat . '.php'; $altFile = $protoAltFile . '.' . $currentFormat . '.php'; // Try to find the proper class in the proper path if (!class_exists($class_name) && file_exists($path . $file)) { @include_once $path . $file; } // Try to find the proper class in the alternate path if (!class_exists($class_name) && file_exists($altPath . $file)) { @include_once $altPath . $file; } // Try to find the alternate class in the proper path if (!class_exists($alt_class) && file_exists($path . $altFile)) { @include_once $path . $altFile; } // Try to find the alternate class in the alternate path if (!class_exists($alt_class) && file_exists($altPath . $altFile)) { @include_once $altPath . $altFile; } } // If the alternate class exists just map the class to the alternate if (!class_exists($class_name) && class_exists($alt_class)) { $this->class_alias($alt_class, $class_name); } // No class found? Map to FOFModel elseif (!class_exists($class_name)) { if ($view != 'default') { $defaultClass = FOFInflector::camelize($component_raw . '_view_default'); $this->class_alias($defaultClass, $class_name); } else { if (!file_exists(self::$fofPath . '/view/' . $format . '.php')) { $default_class = 'FOFView'; } else { $default_class = 'FOFView' . ucfirst($format); } $this->class_alias($default_class, $class_name, true); } } } /** * Autoload Tables * * @param string $class_name The name of the class to load * * @return void */ public function autoload_fof_table($class_name) { FOFPlatform::getInstance()->logDebug(__METHOD__ . "() autoloading $class_name"); static $isCli = null, $isAdmin = null; if (is_null($isCli) && is_null($isAdmin)) { list($isCli, $isAdmin) = FOFDispatcher::isCliAdmin(); } if (strpos($class_name, 'Table') === false) { return; } // Change from camel cased into a lowercase array $class_modified = preg_replace('/(\s)+/', '_', $class_name); $class_modified = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $class_modified)); $parts = explode('_', $class_modified); // We need three parts in the name if (count($parts) != 3) { return; } // We need the second part to be "model" if ($parts[1] != 'table') { return; } // Get the information about this class $component_raw = $parts[0]; $component = 'com_' . $parts[0]; $view = $parts[2]; // Is this an FOF 2.1 or later component? if (!$this->isFOFComponent($component)) { return; } // Get the alternate view and class name (opposite singular/plural name) $alt_view = FOFInflector::isSingular($view) ? FOFInflector::pluralize($view) : FOFInflector::singularize($view); $alt_class = FOFInflector::camelize($component_raw . '_table_' . $alt_view); // Get the proper and alternate paths and file names $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($component); $file = "/tables/$view.php"; $altFile = "/tables/$alt_view.php"; $path = $componentPaths['admin']; // Try to find the proper class in the proper path if (file_exists($path . $file)) { @include_once $path . $file; } // Try to find the alternate class in the proper path if (!class_exists($alt_class) && file_exists($path . $altFile)) { @include_once $path . $altFile; } // If the alternate class exists just map the class to the alternate if (!class_exists($class_name) && class_exists($alt_class)) { $this->class_alias($alt_class, $class_name); } // No class found? Map to FOFModel elseif (!class_exists($class_name)) { if ($view != 'default') { $defaultClass = FOFInflector::camelize($component_raw . '_table_default'); $this->class_alias($defaultClass, $class_name); } else { $this->class_alias('FOFTable', $class_name, true); } } } /** * Autoload Helpers * * @param string $class_name The name of the class to load * * @return void */ public function autoload_fof_helper($class_name) { FOFPlatform::getInstance()->logDebug(__METHOD__ . "() autoloading $class_name"); static $isCli = null, $isAdmin = null; if (is_null($isCli) && is_null($isAdmin)) { list($isCli, $isAdmin) = FOFDispatcher::isCliAdmin(); } if (strpos($class_name, 'Helper') === false) { return; } // Change from camel cased into a lowercase array $class_modified = preg_replace('/(\s)+/', '_', $class_name); $class_modified = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $class_modified)); $parts = explode('_', $class_modified); // We need three parts in the name if (count($parts) != 3) { return; } // We need the second part to be "model" if ($parts[1] != 'helper') { return; } // Get the information about this class $component_raw = $parts[0]; $component = 'com_' . $parts[0]; $view = $parts[2]; // Is this an FOF 2.1 or later component? if (!$this->isFOFComponent($component)) { return; } // Get the alternate view and class name (opposite singular/plural name) $alt_view = FOFInflector::isSingular($view) ? FOFInflector::pluralize($view) : FOFInflector::singularize($view); $alt_class = FOFInflector::camelize($component_raw . '_helper_' . $alt_view); // Get the proper and alternate paths and file names $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($component); $file = "/helpers/$view.php"; $altFile = "/helpers/$alt_view.php"; $path = $componentPaths['main']; $altPath = $componentPaths['alt']; // Try to find the proper class in the proper path if (file_exists($path . $file)) { @include_once $path . $file; } // Try to find the proper class in the alternate path if (!class_exists($class_name) && file_exists($altPath . $file)) { @include_once $altPath . $file; } // Try to find the alternate class in the proper path if (!class_exists($alt_class) && file_exists($path . $altFile)) { @include_once $path . $altFile; } // Try to find the alternate class in the alternate path if (!class_exists($alt_class) && file_exists($altPath . $altFile)) { @include_once $altPath . $altFile; } // If the alternate class exists just map the class to the alternate if (!class_exists($class_name) && class_exists($alt_class)) { $this->class_alias($alt_class, $class_name); } } /** * Autoload Toolbars * * @param string $class_name The name of the class to load * * @return void */ public function autoload_fof_toolbar($class_name) { FOFPlatform::getInstance()->logDebug(__METHOD__ . "() autoloading $class_name"); static $isCli = null, $isAdmin = null; if (is_null($isCli) && is_null($isAdmin)) { list($isCli, $isAdmin) = FOFDispatcher::isCliAdmin(); } if (strpos($class_name, 'Toolbar') === false) { return; } // Change from camel cased into a lowercase array $class_modified = preg_replace('/(\s)+/', '_', $class_name); $class_modified = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $class_modified)); $parts = explode('_', $class_modified); // We need two parts in the name if (count($parts) != 2) { return; } // We need the second part to be "model" if ($parts[1] != 'toolbar') { return; } // Get the information about this class $component_raw = $parts[0]; $component = 'com_' . $parts[0]; $platformDirs = FOFPlatform::getInstance()->getPlatformBaseDirs(); // Get the proper and alternate paths and file names $file = "/components/$component/toolbar.php"; $path = ($isAdmin || $isCli) ? $platformDirs['admin'] : $platformDirs['public']; $altPath = ($isAdmin || $isCli) ? $platformDirs['public'] : $platformDirs['admin']; // Try to find the proper class in the proper path if (file_exists($path . $file)) { @include_once $path . $file; } // Try to find the proper class in the alternate path if (!class_exists($class_name) && file_exists($altPath . $file)) { @include_once $altPath . $file; } // No class found? Map to FOFToolbar if (!class_exists($class_name)) { $this->class_alias('FOFToolbar', $class_name, true); } } /** * Autoload Fields * * @param string $class_name The name of the class to load * * @return void */ public function autoload_fof_field($class_name) { FOFPlatform::getInstance()->logDebug(__METHOD__ . "() autoloading $class_name"); // @todo } } PK���\��LDD'libraries/fof/dispatcher/dispatcher.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage dispatcher * @copyright Copyright (C) 2010 - 2015 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 dispatcher class * * FrameworkOnFramework is a set of classes which extend Joomla! 1.5 and later's * MVC framework with features making maintaining complex software much easier, * without tedious repetitive copying of the same code over and over again. * * @package FrameworkOnFramework * @since 1.0 */ class FOFDispatcher extends FOFUtilsObject { /** @var array Configuration variables */ protected $config = array(); /** @var FOFInput Input variables */ protected $input = array(); /** @var string The name of the default view, in case none is specified */ public $defaultView = 'cpanel'; // Variables for FOF's transparent user authentication. You can override them // in your Dispatcher's __construct() method. /** @var int The Time Step for the TOTP used in FOF's transparent user authentication */ protected $fofAuth_timeStep = 6; /** @var string The key for the TOTP, Base32 encoded (watch out; Base32, NOT Base64!) */ protected $fofAuth_Key = null; /** @var array Which formats to be handled by transparent authentication */ protected $fofAuth_Formats = array('json', 'csv', 'xml', 'raw'); /** * Should I logout the transparently authenticated user on logout? * Recommended to leave it on in order to avoid crashing the sessions table. * * @var boolean */ protected $fofAuth_LogoutOnReturn = true; /** @var array Which methods to use to fetch authentication credentials and in which order */ protected $fofAuth_AuthMethods = array( /* HTTP Basic Authentication using encrypted information protected * with a TOTP (the username must be "_fof_auth") */ 'HTTPBasicAuth_TOTP', /* Encrypted information protected with a TOTP passed in the * _fofauthentication query string parameter */ 'QueryString_TOTP', /* HTTP Basic Authentication using a username and password pair in plain text */ 'HTTPBasicAuth_Plaintext', /* Plaintext, JSON-encoded username and password pair passed in the * _fofauthentication query string parameter */ 'QueryString_Plaintext', /* Plaintext username and password in the _fofauthentication_username * and _fofauthentication_username query string parameters */ 'SplitQueryString_Plaintext', ); /** @var bool Did we successfully and transparently logged in a user? */ private $_fofAuth_isLoggedIn = false; /** @var string The calculated encryption key for the _TOTP methods, used if we have to encrypt the reply */ private $_fofAuth_CryptoKey = ''; /** * Get a static (Singleton) instance of a particular Dispatcher * * @param string $option The component name * @param string $view The View name * @param array $config Configuration data * * @staticvar array $instances Holds the array of Dispatchers FOF knows about * * @return FOFDispatcher */ public static function &getAnInstance($option = null, $view = null, $config = array()) { static $instances = array(); $hash = $option . $view; if (!array_key_exists($hash, $instances)) { $instances[$hash] = self::getTmpInstance($option, $view, $config); } return $instances[$hash]; } /** * Gets a temporary instance of a Dispatcher * * @param string $option The component name * @param string $view The View name * @param array $config Configuration data * * @return FOFDispatcher */ public static function &getTmpInstance($option = null, $view = null, $config = array()) { if (array_key_exists('input', $config)) { if ($config['input'] instanceof FOFInput) { $input = $config['input']; } else { if (!is_array($config['input'])) { $config['input'] = (array) $config['input']; } $config['input'] = array_merge($_REQUEST, $config['input']); $input = new FOFInput($config['input']); } } else { $input = new FOFInput; } $config['option'] = !is_null($option) ? $option : $input->getCmd('option', 'com_foobar'); $config['view'] = !is_null($view) ? $view : $input->getCmd('view', ''); $input->set('option', $config['option']); $input->set('view', $config['view']); $config['input'] = $input; $className = ucfirst(str_replace('com_', '', $config['option'])) . 'Dispatcher'; if (!class_exists($className)) { $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($config['option']); $searchPaths = array( $componentPaths['main'], $componentPaths['main'] . '/dispatchers', $componentPaths['admin'], $componentPaths['admin'] . '/dispatchers' ); if (array_key_exists('searchpath', $config)) { array_unshift($searchPaths, $config['searchpath']); } $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); $path = $filesystem->pathFind( $searchPaths, 'dispatcher.php' ); if ($path) { require_once $path; } } if (!class_exists($className)) { $className = 'FOFDispatcher'; } $instance = new $className($config); return $instance; } /** * Public constructor * * @param array $config The configuration variables */ public function __construct($config = array()) { // Cache the config $this->config = $config; // Get the input for this MVC triad if (array_key_exists('input', $config)) { $this->input = $config['input']; } else { $this->input = new FOFInput; } // Get the default values for the component name $this->component = $this->input->getCmd('option', 'com_foobar'); // Load the component's fof.xml configuration file $configProvider = new FOFConfigProvider; $this->defaultView = $configProvider->get($this->component . '.dispatcher.default_view', $this->defaultView); // Get the default values for the view name $this->view = $this->input->getCmd('view', null); if (empty($this->view)) { // Do we have a task formatted as controller.task? $task = $this->input->getCmd('task', ''); if (!empty($task) && (strstr($task, '.') !== false)) { list($this->view, $task) = explode('.', $task, 2); $this->input->set('task', $task); } } if (empty($this->view)) { $this->view = $this->defaultView; } $this->layout = $this->input->getCmd('layout', null); // Overrides from the config if (array_key_exists('option', $config)) { $this->component = $config['option']; } if (array_key_exists('view', $config)) { $this->view = empty($config['view']) ? $this->view : $config['view']; } if (array_key_exists('layout', $config)) { $this->layout = $config['layout']; } $this->input->set('option', $this->component); $this->input->set('view', $this->view); $this->input->set('layout', $this->layout); if (array_key_exists('authTimeStep', $config)) { $this->fofAuth_timeStep = empty($config['authTimeStep']) ? 6 : $config['authTimeStep']; } } /** * The main code of the Dispatcher. It spawns the necessary controller and * runs it. * * @throws Exception * * @return void|Exception */ public function dispatch() { $platform = FOFPlatform::getInstance(); if (!$platform->authorizeAdmin($this->input->getCmd('option', 'com_foobar'))) { return $platform->raiseError(403, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN')); } $this->transparentAuthentication(); // Merge English and local translations $platform->loadTranslations($this->component); $canDispatch = true; if ($platform->isCli()) { $canDispatch = $canDispatch && $this->onBeforeDispatchCLI(); } $canDispatch = $canDispatch && $this->onBeforeDispatch(); if (!$canDispatch) { // We can set header only if we're not in CLI if(!$platform->isCli()) { $platform->setHeader('Status', '403 Forbidden', true); } return $platform->raiseError(403, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN')); } // Get and execute the controller $option = $this->input->getCmd('option', 'com_foobar'); $view = $this->input->getCmd('view', $this->defaultView); $task = $this->input->getCmd('task', null); if (empty($task)) { $task = $this->getTask($view); } // Pluralise/sungularise the view name for typical tasks if (in_array($task, array('edit', 'add', 'read'))) { $view = FOFInflector::singularize($view); } elseif (in_array($task, array('browse'))) { $view = FOFInflector::pluralize($view); } $this->input->set('view', $view); $this->input->set('task', $task); $config = $this->config; $config['input'] = $this->input; $controller = FOFController::getTmpInstance($option, $view, $config); $status = $controller->execute($task); if (!$this->onAfterDispatch()) { // We can set header only if we're not in CLI if(!$platform->isCli()) { $platform->setHeader('Status', '403 Forbidden', true); } return $platform->raiseError(403, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN')); } $format = $this->input->get('format', 'html', 'cmd'); $format = empty($format) ? 'html' : $format; if ($controller->hasRedirect()) { $controller->redirect(); } } /** * Tries to guess the controller task to execute based on the view name and * the HTTP request method. * * @param string $view The name of the view * * @return string The best guess of the task to execute */ protected function getTask($view) { // Get a default task based on plural/singular view $request_task = $this->input->getCmd('task', null); $task = FOFInflector::isPlural($view) ? 'browse' : 'edit'; // Get a potential ID, we might need it later $id = $this->input->get('id', null, 'int'); if ($id == 0) { $ids = $this->input->get('ids', array(), 'array'); if (!empty($ids)) { $id = array_shift($ids); } } // Check the request method if (!isset($_SERVER['REQUEST_METHOD'])) { $_SERVER['REQUEST_METHOD'] = 'GET'; } $requestMethod = strtoupper($_SERVER['REQUEST_METHOD']); switch ($requestMethod) { case 'POST': case 'PUT': if (!is_null($id)) { $task = 'save'; } break; case 'DELETE': if ($id != 0) { $task = 'delete'; } break; case 'GET': default: // If it's an edit without an ID or ID=0, it's really an add if (($task == 'edit') && ($id == 0)) { $task = 'add'; } // If it's an edit in the frontend, it's really a read elseif (($task == 'edit') && FOFPlatform::getInstance()->isFrontend()) { $task = 'read'; } break; } return $task; } /** * Executes right before the dispatcher tries to instantiate and run the * controller. * * @return boolean Return false to abort */ public function onBeforeDispatch() { return true; } /** * Sets up some environment variables, so we can work as usually on CLI, too. * * @return boolean Return false to abort */ public function onBeforeDispatchCLI() { JLoader::import('joomla.environment.uri'); JLoader::import('joomla.application.component.helper'); // Trick to create a valid url used by JURI $this->_originalPhpScript = ''; // We have no Application Helper (there is no Application!), so I have to define these constants manually $option = $this->input->get('option', '', 'cmd'); if ($option) { $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($option); if (!defined('JPATH_COMPONENT')) { define('JPATH_COMPONENT', $componentPaths['main']); } if (!defined('JPATH_COMPONENT_SITE')) { define('JPATH_COMPONENT_SITE', $componentPaths['site']); } if (!defined('JPATH_COMPONENT_ADMINISTRATOR')) { define('JPATH_COMPONENT_ADMINISTRATOR', $componentPaths['admin']); } } return true; } /** * Executes right after the dispatcher runs the controller. * * @return boolean Return false to abort */ public function onAfterDispatch() { // If we have to log out the user, please do so now if ($this->fofAuth_LogoutOnReturn && $this->_fofAuth_isLoggedIn) { FOFPlatform::getInstance()->logoutUser(); } return true; } /** * Transparently authenticates a user * * @return void */ public function transparentAuthentication() { // Only run when there is no logged in user if (!FOFPlatform::getInstance()->getUser()->guest) { return; } // @todo Check the format $format = $this->input->getCmd('format', 'html'); if (!in_array($format, $this->fofAuth_Formats)) { return; } foreach ($this->fofAuth_AuthMethods as $method) { // If we're already logged in, don't bother if ($this->_fofAuth_isLoggedIn) { continue; } // This will hold our authentication data array (username, password) $authInfo = null; switch ($method) { case 'HTTPBasicAuth_TOTP': if (empty($this->fofAuth_Key)) { continue; } if (!isset($_SERVER['PHP_AUTH_USER'])) { continue; } if (!isset($_SERVER['PHP_AUTH_PW'])) { continue; } if ($_SERVER['PHP_AUTH_USER'] != '_fof_auth') { continue; } $encryptedData = $_SERVER['PHP_AUTH_PW']; $authInfo = $this->_decryptWithTOTP($encryptedData); break; case 'QueryString_TOTP': $encryptedData = $this->input->get('_fofauthentication', '', 'raw'); if (empty($encryptedData)) { continue; } $authInfo = $this->_decryptWithTOTP($encryptedData); break; case 'HTTPBasicAuth_Plaintext': if (!isset($_SERVER['PHP_AUTH_USER'])) { continue; } if (!isset($_SERVER['PHP_AUTH_PW'])) { continue; } $authInfo = array( 'username' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP_AUTH_PW'] ); break; case 'QueryString_Plaintext': $jsonencoded = $this->input->get('_fofauthentication', '', 'raw'); if (empty($jsonencoded)) { continue; } $authInfo = json_decode($jsonencoded, true); if (!is_array($authInfo)) { $authInfo = null; } elseif (!array_key_exists('username', $authInfo) || !array_key_exists('password', $authInfo)) { $authInfo = null; } break; case 'SplitQueryString_Plaintext': $authInfo = array( 'username' => $this->input->get('_fofauthentication_username', '', 'raw'), 'password' => $this->input->get('_fofauthentication_password', '', 'raw'), ); if (empty($authInfo['username'])) { $authInfo = null; } break; default: continue; break; } // No point trying unless we have a username and password if (!is_array($authInfo)) { continue; } $this->_fofAuth_isLoggedIn = FOFPlatform::getInstance()->loginUser($authInfo); } } /** * Decrypts a transparent authentication message using a TOTP * * @param string $encryptedData The encrypted data * * @codeCoverageIgnore * @return array The decrypted data */ private function _decryptWithTOTP($encryptedData) { if (empty($this->fofAuth_Key)) { $this->_fofAuth_CryptoKey = null; return null; } $totp = new FOFEncryptTotp($this->fofAuth_timeStep); $period = $totp->getPeriod(); $period--; for ($i = 0; $i <= 2; $i++) { $time = ($period + $i) * $this->fofAuth_timeStep; $otp = $totp->getCode($this->fofAuth_Key, $time); $this->_fofAuth_CryptoKey = hash('sha256', $this->fofAuth_Key . $otp); $aes = new FOFEncryptAes($this->_fofAuth_CryptoKey); $ret = $aes->decryptString($encryptedData); $ret = rtrim($ret, "\000"); $ret = json_decode($ret, true); if (!is_array($ret)) { continue; } if (!array_key_exists('username', $ret)) { continue; } if (!array_key_exists('password', $ret)) { continue; } // Successful decryption! return $ret; } // Obviously if we're here we could not decrypt anything. Bail out. $this->_fofAuth_CryptoKey = null; return null; } /** * Creates a decryption key for use with the TOTP decryption method * * @param integer $time The timestamp used for TOTP calculation, leave empty to use current timestamp * * @codeCoverageIgnore * @return string THe encryption key */ private function _createDecryptionKey($time = null) { $totp = new FOFEncryptTotp($this->fofAuth_timeStep); $otp = $totp->getCode($this->fofAuth_Key, $time); $key = hash('sha256', $this->fofAuth_Key . $otp); return $key; } /** * Main function to detect if we're running in a CLI environment and we're admin * * @return array isCLI and isAdmin. It's not an associtive array, so we can use list. */ public static function isCliAdmin() { static $isCLI = null; static $isAdmin = null; if (is_null($isCLI) && is_null($isAdmin)) { $isCLI = FOFPlatform::getInstance()->isCli(); $isAdmin = FOFPlatform::getInstance()->isBackend(); } return array($isCLI, $isAdmin); } } PK���\�M���libraries/fof/layout/helper.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage layout * @copyright Copyright (C) 2010 - 2015 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; /** * Helper to render a FOFLayout object, storing a base path * * @package FrameworkOnFramework * @since x.y */ class FOFLayoutHelper extends JLayoutHelper { /** * Method to render the layout. * * @param string $layoutFile Dot separated path to the layout file, relative to base path * @param object $displayData Object which properties are used inside the layout file to build displayed output * @param string $basePath Base path to use when loading layout files * * @return string */ public static function render($layoutFile, $displayData = null, $basePath = '') { $basePath = empty($basePath) ? self::$defaultBasePath : $basePath; // Make sure we send null to FOFLayoutFile if no path set $basePath = empty($basePath) ? null : $basePath; $layout = new FOFLayoutFile($layoutFile, $basePath); $renderedLayout = $layout->render($displayData); return $renderedLayout; } } PK���\Ex&���libraries/fof/layout/file.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage layout * @copyright Copyright (C) 2010 - 2015 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; /** * Base class for rendering a display layout * loaded from from a layout file * * This class searches for Joomla! version override Layouts. For example, * if you have run this under Joomla! 3.0 and you try to load * mylayout.default it will automatically search for the * layout files default.j30.php, default.j3.php and default.php, in this * order. * * @package FrameworkOnFramework * @since 1.0 */ class FOFLayoutFile extends JLayoutFile { /** * Method to finds the full real file path, checking possible overrides * * @return string The full path to the layout file */ protected function getPath() { $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); if (is_null($this->fullPath) && !empty($this->layoutId)) { $parts = explode('.', $this->layoutId); $file = array_pop($parts); $filePath = implode('/', $parts); $suffixes = FOFPlatform::getInstance()->getTemplateSuffixes(); foreach ($suffixes as $suffix) { $files[] = $file . $suffix . '.php'; } $files[] = $file . '.php'; $platformDirs = FOFPlatform::getInstance()->getPlatformBaseDirs(); $prefix = FOFPlatform::getInstance()->isBackend() ? $platformDirs['admin'] : $platformDirs['root']; $possiblePaths = array( $prefix . '/templates/' . JFactory::getApplication()->getTemplate() . '/html/layouts/' . $filePath, $this->basePath . '/' . $filePath ); reset($files); while ((list(, $fileName) = each($files)) && is_null($this->fullPath)) { $r = $filesystem->pathFind($possiblePaths, $fileName); $this->fullPath = $r === false ? null : $r; } } return $this->fullPath; } } PK���\R�ƾ&&libraries/fof/view/json.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage view * @copyright Copyright (C) 2010 - 2015 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 JSON View class. Renders the data as a JSON object or * array. It can optionally output HAL links as well. * * @package FrameworkOnFramework * @since 2.0 */ class FOFViewJson extends FOFViewHtml { /** * When set to true we'll add hypermedia to the output, implementing the * HAL specification (http://stateless.co/hal_specification.html) * * @var boolean */ public $useHypermedia = false; /** * Public constructor * * @param array $config The component's configuration array */ public function __construct($config = array()) { parent::__construct($config); if (isset($config['use_hypermedia'])) { $this->useHypermedia = (bool) $config['use_hypermedia']; } } /** * The event which runs when we are displaying the record list JSON view * * @param string $tpl The view sub-template to use * * @return boolean True to allow display of the view */ protected function onDisplay($tpl = null) { // Load the model $model = $this->getModel(); $items = $model->getItemList(); $this->items = $items; $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { if ($this->useHypermedia) { $document->setMimeEncoding('application/hal+json'); } else { $document->setMimeEncoding('application/json'); } } if (is_null($tpl)) { $tpl = 'json'; } FOFPlatform::getInstance()->setErrorHandling(E_ALL, 'ignore'); $hasFailed = false; try { $result = $this->loadTemplate($tpl, true); if ($result instanceof Exception) { $hasFailed = true; } } catch (Exception $e) { $hasFailed = true; } if ($hasFailed) { // Default JSON behaviour in case the template isn't there! if ($this->useHypermedia) { $haldocument = $this->_createDocumentWithHypermedia($items, $model); $json = $haldocument->render('json'); } else { $json = json_encode($items); } // JSONP support $callback = $this->input->getVar('callback', null); if (!empty($callback)) { echo $callback . '(' . $json . ')'; } else { $defaultName = $this->input->getCmd('view', 'joomla'); $filename = $this->input->getCmd('basename', $defaultName); $document->setName($filename); echo $json; } return false; } else { echo $result; return false; } } /** * The event which runs when we are displaying a single item JSON view * * @param string $tpl The view sub-template to use * * @return boolean True to allow display of the view */ protected function onRead($tpl = null) { $model = $this->getModel(); $item = $model->getItem(); $this->item = $item; $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { if ($this->useHypermedia) { $document->setMimeEncoding('application/hal+json'); } else { $document->setMimeEncoding('application/json'); } } if (is_null($tpl)) { $tpl = 'json'; } FOFPlatform::getInstance()->setErrorHandling(E_ALL, 'ignore'); $hasFailed = false; try { $result = $this->loadTemplate($tpl, true); if ($result instanceof Exception) { $hasFailed = true; } } catch (Exception $e) { $hasFailed = true; } if ($hasFailed) { // Default JSON behaviour in case the template isn't there! if ($this->useHypermedia) { $haldocument = $this->_createDocumentWithHypermedia($item, $model); $json = $haldocument->render('json'); } else { $json = json_encode($item); } // JSONP support $callback = $this->input->get('callback', null); if (!empty($callback)) { echo $callback . '(' . $json . ')'; } else { $defaultName = $this->input->getCmd('view', 'joomla'); $filename = $this->input->getCmd('basename', $defaultName); $document->setName($filename); echo $json; } return false; } else { echo $result; return false; } } /** * Creates a FOFHalDocument using the provided data * * @param array $data The data to put in the document * @param FOFModel $model The model of this view * * @return FOFHalDocument A HAL-enabled document */ protected function _createDocumentWithHypermedia($data, $model = null) { // Create a new HAL document if (is_array($data)) { $count = count($data); } else { $count = null; } if ($count == 1) { reset($data); $document = new FOFHalDocument(end($data)); } else { $document = new FOFHalDocument($data); } // Create a self link $uri = (string) (JUri::getInstance()); $uri = $this->_removeURIBase($uri); $uri = JRoute::_($uri); $document->addLink('self', new FOFHalLink($uri)); // Create relative links in a record list context if (is_array($data) && ($model instanceof FOFModel)) { $pagination = $model->getPagination(); if ($pagination->get('pages.total') > 1) { // Try to guess URL parameters and create a prototype URL // NOTE: You are better off specialising this method $protoUri = $this->_getPrototypeURIForPagination(); // The "first" link $uri = clone $protoUri; $uri->setVar('limitstart', 0); $uri = JRoute::_((string) $uri); $document->addLink('first', new FOFHalLink($uri)); // Do we need a "prev" link? if ($pagination->get('pages.current') > 1) { $prevPage = $pagination->get('pages.current') - 1; $limitstart = ($prevPage - 1) * $pagination->limit; $uri = clone $protoUri; $uri->setVar('limitstart', $limitstart); $uri = JRoute::_((string) $uri); $document->addLink('prev', new FOFHalLink($uri)); } // Do we need a "next" link? if ($pagination->get('pages.current') < $pagination->get('pages.total')) { $nextPage = $pagination->get('pages.current') + 1; $limitstart = ($nextPage - 1) * $pagination->limit; $uri = clone $protoUri; $uri->setVar('limitstart', $limitstart); $uri = JRoute::_((string) $uri); $document->addLink('next', new FOFHalLink($uri)); } // The "last" link? $lastPage = $pagination->get('pages.total'); $limitstart = ($lastPage - 1) * $pagination->limit; $uri = clone $protoUri; $uri->setVar('limitstart', $limitstart); $uri = JRoute::_((string) $uri); $document->addLink('last', new FOFHalLink($uri)); } } return $document; } /** * Convert an absolute URI to a relative one * * @param string $uri The URI to convert * * @return string The relative URL */ protected function _removeURIBase($uri) { static $root = null, $rootlen = 0; if (is_null($root)) { $root = rtrim(FOFPlatform::getInstance()->URIbase(), '/'); $rootlen = strlen($root); } if (substr($uri, 0, $rootlen) == $root) { $uri = substr($uri, $rootlen); } return ltrim($uri, '/'); } /** * Returns a JUri instance with a prototype URI used as the base for the * other URIs created by the JSON renderer * * @return JUri The prototype JUri instance */ protected function _getPrototypeURIForPagination() { $protoUri = new JUri('index.php'); $protoUri->setQuery($this->input->getData()); $protoUri->delVar('savestate'); $protoUri->delVar('base_path'); return $protoUri; } } PK���\++cclibraries/fof/view/form.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage view * @copyright Copyright (C) 2010 - 2015 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 Form class. It preferrably renders an XML view template * instead of a traditional PHP-based view template. * * @package FrameworkOnFramework * @since 2.0 */ class FOFViewForm extends FOFViewHtml { /** @var FOFForm The form to render */ protected $form; /** * Displays the view * * @param string $tpl The template to use * * @return boolean|null False if we can't render anything */ public function display($tpl = null) { $model = $this->getModel(); // Get the form $this->form = $model->getForm(); $this->form->setModel($model); $this->form->setView($this); // Get the task set in the model $task = $model->getState('task', 'browse'); // Call the relevant method $method_name = 'on' . ucfirst($task); if (method_exists($this, $method_name)) { $result = $this->$method_name($tpl); } else { $result = $this->onDisplay(); } // Bail out if we're told not to render anything if ($result === false) { return; } // Show the view // -- Output HTML before the view template $this->preRender(); // -- Try to load a view template; if not exists render the form directly $basePath = FOFPlatform::getInstance()->isBackend() ? 'admin:' : 'site:'; $basePath .= $this->config['option'] . '/'; $basePath .= $this->config['view'] . '/'; $path = $basePath . $this->getLayout(); if ($tpl) { $path .= '_' . $tpl; } $viewTemplate = $this->loadAnyTemplate($path); // If there was no template file found, display the form if ($viewTemplate instanceof Exception) { $viewTemplate = $this->getRenderedForm(); } // -- Output the view template echo $viewTemplate; // -- Output HTML after the view template $this->postRender(); } /** * Returns the HTML rendering of the FOFForm attached to this view. Very * useful for customising a form page without having to meticulously hand- * code the entire form. * * @return string The HTML of the rendered form */ public function getRenderedForm() { $html = ''; $renderer = $this->getRenderer(); if ($renderer instanceof FOFRenderAbstract) { // Load CSS and Javascript files defined in the form $this->form->loadCSSFiles(); $this->form->loadJSFiles(); // Get the form's HTML $html = $renderer->renderForm($this->form, $this->getModel(), $this->input); } return $html; } /** * The event which runs when we are displaying the Add page * * @param string $tpl The view sub-template to use * * @return boolean True to allow display of the view */ protected function onAdd($tpl = null) { // Hide the main menu JRequest::setVar('hidemainmenu', true); // Get the model $model = $this->getModel(); // Assign the item and form to the view $this->item = $model->getItem(); return true; } } PK���\�h����libraries/fof/view/csv.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage view * @copyright Copyright (C) 2010 - 2015 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 CSV View class. Automatically renders the data in CSV * format. * * @package FrameworkOnFramework * @since 1.0 */ class FOFViewCsv extends FOFViewHtml { /** * Should I produce a CSV header row. * * @var boolean */ protected $csvHeader = true; /** * The filename of the downloaded CSV file. * * @var string */ protected $csvFilename = null; /** * The columns to include in the CSV output. If it's empty it will be ignored. * * @var array */ protected $csvFields = array(); /** * Public constructor. Instantiates a FOFViewCsv object. * * @param array $config The configuration data array */ public function __construct($config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } parent::__construct($config); if (array_key_exists('csv_header', $config)) { $this->csvHeader = $config['csv_header']; } else { $this->csvHeader = $this->input->getBool('csv_header', true); } if (array_key_exists('csv_filename', $config)) { $this->csvFilename = $config['csv_filename']; } else { $this->csvFilename = $this->input->getString('csv_filename', ''); } if (empty($this->csvFilename)) { $view = $this->input->getCmd('view', 'cpanel'); $view = FOFInflector::pluralize($view); $this->csvFilename = strtolower($view); } if (array_key_exists('csv_fields', $config)) { $this->csvFields = $config['csv_fields']; } } /** * Executes before rendering a generic page, default to actions necessary for the Browse task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page */ protected function onDisplay($tpl = null) { // Load the model $model = $this->getModel(); $items = $model->getItemList(); $this->items = $items; $platform = FOFPlatform::getInstance(); $document = $platform->getDocument(); if ($document instanceof JDocument) { $document->setMimeEncoding('text/csv'); } $platform->setHeader('Pragma', 'public'); $platform->setHeader('Expires', '0'); $platform->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0'); $platform->setHeader('Cache-Control', 'public', false); $platform->setHeader('Content-Description', 'File Transfer'); $platform->setHeader('Content-Disposition', 'attachment; filename="' . $this->csvFilename . '"'); if (is_null($tpl)) { $tpl = 'csv'; } FOFPlatform::getInstance()->setErrorHandling(E_ALL, 'ignore'); $hasFailed = false; try { $result = $this->loadTemplate($tpl, true); if ($result instanceof Exception) { $hasFailed = true; } } catch (Exception $e) { $hasFailed = true; } if (!$hasFailed) { echo $result; } else { // Default CSV behaviour in case the template isn't there! if (empty($items)) { return; } $item = array_pop($items); $keys = get_object_vars($item); $keys = array_keys($keys); $items[] = $item; reset($items); if (!empty($this->csvFields)) { $temp = array(); foreach ($this->csvFields as $f) { if (in_array($f, $keys)) { $temp[] = $f; } } $keys = $temp; } if ($this->csvHeader) { $csv = array(); foreach ($keys as $k) { $k = str_replace('"', '""', $k); $k = str_replace("\r", '\\r', $k); $k = str_replace("\n", '\\n', $k); $k = '"' . $k . '"'; $csv[] = $k; } echo implode(",", $csv) . "\r\n"; } foreach ($items as $item) { $csv = array(); $item = (array) $item; foreach ($keys as $k) { if (!isset($item[$k])) { $v = ''; } else { $v = $item[$k]; } if (is_array($v)) { $v = 'Array'; } elseif (is_object($v)) { $v = 'Object'; } $v = str_replace('"', '""', $v); $v = str_replace("\r", '\\r', $v); $v = str_replace("\n", '\\n', $v); $v = '"' . $v . '"'; $csv[] = $v; } echo implode(",", $csv) . "\r\n"; } } return false; } } PK���\�Άlibraries/fof/view/html.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage view * @copyright Copyright (C) 2010 - 2015 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 HTML output class. Together with PHP-based view tempalates * it will render your data into an HTML representation. * * @package FrameworkOnFramework * @since 2.1 */ class FOFViewHtml extends FOFViewRaw { /** @var bool Should I set the page title in the front-end of the site? */ public $setFrontendPageTitle = false; /** @var string The translation key for the default page title */ public $defaultPageTitle = null; /** * Class constructor * * @param array $config Configuration parameters */ public function __construct($config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array)$config; } elseif (!is_array($config)) { $config = array(); } if (isset($config['setFrontendPageTitle'])) { $this->setFrontendPageTitle = (bool)$config['setFrontendPageTitle']; } if (isset($config['defaultPageTitle'])) { $this->defaultPageTitle = $config['defaultPageTitle']; } parent::__construct($config); } /** * Runs before rendering the view template, echoing HTML to put before the * view template's generated HTML * * @return void */ protected function preRender() { $view = $this->input->getCmd('view', 'cpanel'); $task = $this->getModel()->getState('task', 'browse'); // Don't load the toolbar on CLI if (!FOFPlatform::getInstance()->isCli()) { $toolbar = FOFToolbar::getAnInstance($this->input->getCmd('option', 'com_foobar'), $this->config); $toolbar->perms = $this->perms; $toolbar->renderToolbar($view, $task, $this->input); } if (FOFPlatform::getInstance()->isFrontend()) { if ($this->setFrontendPageTitle) { $this->setPageTitle(); } } $renderer = $this->getRenderer(); $renderer->preRender($view, $task, $this->input, $this->config); } /** * Runs after rendering the view template, echoing HTML to put after the * view template's generated HTML * * @return void */ protected function postRender() { $view = $this->input->getCmd('view', 'cpanel'); $task = $this->getModel()->getState('task', 'browse'); $renderer = $this->getRenderer(); if ($renderer instanceof FOFRenderAbstract) { $renderer->postRender($view, $task, $this->input, $this->config); } } public function setPageTitle() { $document = JFactory::getDocument(); $app = JFactory::getApplication(); $menus = $app->getMenu(); $menu = $menus->getActive(); $title = null; // Get the option and view name $option = empty($this->option) ? $this->input->getCmd('option', 'com_foobar') : $this->option; $view = empty($this->view) ? $this->input->getCmd('view', $this->getName()) : $this->view; // Get the default page title translation key $default = empty($this->defaultPageTitle) ? $option . '_TITLE_' . $view : $this->defaultPageTitle; $params = $app->getPageParameters($option); // Set the default value for page_heading if ($menu) { $params->def('page_heading', $params->get('page_title', $menu->title)); } else { $params->def('page_heading', JText::_($default)); } // Set the document title $title = $params->get('page_title', ''); $sitename = $app->getCfg('sitename'); if ($title == $sitename) { $title = JText::_($default); } if (empty($title)) { $title = $sitename; } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename')); } $document->setTitle($title); // Set meta if ($params->get('menu-meta_description')) { $document->setDescription($params->get('menu-meta_description')); } if ($params->get('menu-meta_keywords')) { $document->setMetadata('keywords', $params->get('menu-meta_keywords')); } if ($params->get('robots')) { $document->setMetadata('robots', $params->get('robots')); } return $title; } } PK���\:V��f�flibraries/fof/view/view.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage view * @copyright Copyright (C) 2010 - 2015 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 View class. The View is the MVC component which gets the * raw data from a Model and renders it in a way that makes sense. The usual * rendering is HTML, but you can also output JSON, CSV, XML, or even media * (images, videos, ...) and documents (Word, PDF, Excel...). * * @package FrameworkOnFramework * @since 1.0 */ abstract class FOFView extends FOFUtilsObject { /** * The name of the view * * @var array */ protected $_name = null; /** * Registered models * * @var array */ protected $_models = array(); /** * The base path of the view * * @var string */ protected $_basePath = null; /** * The default model * * @var string */ protected $_defaultModel = null; /** * Layout name * * @var string */ protected $_layout = 'default'; /** * Layout extension * * @var string */ protected $_layoutExt = 'php'; /** * Layout template * * @var string */ protected $_layoutTemplate = '_'; /** * The set of search directories for resources (templates) * * @var array */ protected $_path = array('template' => array(), 'helper' => array()); /** * The name of the default template source file. * * @var string */ protected $_template = null; /** * The output of the template script. * * @var string */ protected $_output = null; /** * Callback for escaping. * * @var string * @deprecated 13.3 */ protected $_escape = 'htmlspecialchars'; /** * Charset to use in escaping mechanisms; defaults to urf8 (UTF-8) * * @var string */ protected $_charset = 'UTF-8'; /** * The available renderer objects we can use to render views * * @var array Contains objects of the FOFRenderAbstract class */ public static $renderers = array(); /** * Cache of the configuration array * * @var array */ protected $config = array(); /** * The input object of this view * * @var FOFInput */ protected $input = null; /** * The chosen renderer object * * @var FOFRenderAbstract */ protected $rendererObject = null; /** * Should I run the pre-render step? * * @var boolean */ protected $doPreRender = true; /** * Should I run the post-render step? * * @var boolean */ protected $doPostRender = true; /** * Public constructor. Instantiates a FOFView object. * * @param array $config The configuration data array */ public function __construct($config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } // Get the input if (array_key_exists('input', $config)) { if ($config['input'] instanceof FOFInput) { $this->input = $config['input']; } else { $this->input = new FOFInput($config['input']); } } else { $this->input = new FOFInput; } parent::__construct($config); $component = 'com_foobar'; // Get the component name if (array_key_exists('input', $config)) { if ($config['input'] instanceof FOFInput) { $tmpInput = $config['input']; } else { $tmpInput = new FOFInput($config['input']); } $component = $tmpInput->getCmd('option', ''); } else { $tmpInput = $this->input; } if (array_key_exists('option', $config)) { if ($config['option']) { $component = $config['option']; } } $config['option'] = $component; // Get the view name $view = null; if (array_key_exists('input', $config)) { $view = $tmpInput->getCmd('view', ''); } if (array_key_exists('view', $config)) { if ($config['view']) { $view = $config['view']; } } $config['view'] = $view; // Set the component and the view to the input array if (array_key_exists('input', $config)) { $tmpInput->set('option', $config['option']); $tmpInput->set('view', $config['view']); } // Set the view name if (array_key_exists('name', $config)) { $this->_name = $config['name']; } else { $this->_name = $config['view']; } $tmpInput->set('view', $this->_name); $config['input'] = $tmpInput; $config['name'] = $this->_name; $config['view'] = $this->_name; // Get the component directories $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($config['option']); // Set the charset (used by the variable escaping functions) if (array_key_exists('charset', $config)) { FOFPlatform::getInstance()->logDeprecated('Setting a custom charset for escaping in FOFView\'s constructor is deprecated. Override FOFView::escape() instead.'); $this->_charset = $config['charset']; } // User-defined escaping callback if (array_key_exists('escape', $config)) { $this->setEscape($config['escape']); } // Set a base path for use by the view if (array_key_exists('base_path', $config)) { $this->_basePath = $config['base_path']; } else { $this->_basePath = $componentPaths['main']; } // Set the default template search path if (array_key_exists('template_path', $config)) { // User-defined dirs $this->_setPath('template', $config['template_path']); } else { $altView = FOFInflector::isSingular($this->getName()) ? FOFInflector::pluralize($this->getName()) : FOFInflector::singularize($this->getName()); $this->_setPath('template', $this->_basePath . '/views/' . $altView . '/tmpl'); $this->_addPath('template', $this->_basePath . '/views/' . $this->getName() . '/tmpl'); } // Set the default helper search path if (array_key_exists('helper_path', $config)) { // User-defined dirs $this->_setPath('helper', $config['helper_path']); } else { $this->_setPath('helper', $this->_basePath . '/helpers'); } // Set the layout if (array_key_exists('layout', $config)) { $this->setLayout($config['layout']); } else { $this->setLayout('default'); } $this->config = $config; if (!FOFPlatform::getInstance()->isCli()) { $this->baseurl = FOFPlatform::getInstance()->URIbase(true); $fallback = FOFPlatform::getInstance()->getTemplateOverridePath($component) . '/' . $this->getName(); $this->_addPath('template', $fallback); } } /** * Loads a template given any path. The path is in the format: * [admin|site]:com_foobar/viewname/templatename * e.g. admin:com_foobar/myview/default * * This function searches for Joomla! version override templates. For example, * if you have run this under Joomla! 3.0 and you try to load * admin:com_foobar/myview/default it will automatically search for the * template files default.j30.php, default.j3.php and default.php, in this * order. * * @param string $path See above * @param array $forceParams A hash array of variables to be extracted in the local scope of the template file * * @return boolean False if loading failed */ public function loadAnyTemplate($path = '', $forceParams = array()) { // Automatically check for a Joomla! version specific override $throwErrorIfNotFound = true; $suffixes = FOFPlatform::getInstance()->getTemplateSuffixes(); foreach ($suffixes as $suffix) { if (substr($path, -strlen($suffix)) == $suffix) { $throwErrorIfNotFound = false; break; } } if ($throwErrorIfNotFound) { foreach ($suffixes as $suffix) { $result = $this->loadAnyTemplate($path . $suffix, $forceParams); if ($result !== false) { return $result; } } } $layoutTemplate = $this->getLayoutTemplate(); // Parse the path $templateParts = $this->_parseTemplatePath($path); // Get the paths $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($templateParts['component']); $templatePath = FOFPlatform::getInstance()->getTemplateOverridePath($templateParts['component']); // Get the default paths $paths = array(); $paths[] = $templatePath . '/' . $templateParts['view']; $paths[] = ($templateParts['admin'] ? $componentPaths['admin'] : $componentPaths['site']) . '/views/' . $templateParts['view'] . '/tmpl'; if (isset($this->_path) || property_exists($this, '_path')) { $paths = array_merge($paths, $this->_path['template']); } elseif (isset($this->path) || property_exists($this, 'path')) { $paths = array_merge($paths, $this->path['template']); } // Look for a template override if (isset($layoutTemplate) && $layoutTemplate != '_' && $layoutTemplate != $template) { $apath = array_shift($paths); array_unshift($paths, str_replace($template, $layoutTemplate, $apath)); } $filetofind = $templateParts['template'] . '.php'; $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); $this->_tempFilePath = $filesystem->pathFind($paths, $filetofind); if ($this->_tempFilePath) { // Unset from local scope unset($template); unset($layoutTemplate); unset($paths); unset($path); unset($filetofind); // Never allow a 'this' property if (isset($this->this)) { unset($this->this); } // Force parameters into scope if (!empty($forceParams)) { extract($forceParams); } // Start capturing output into a buffer ob_start(); // Include the requested template filename in the local scope (this will execute the view logic). include $this->_tempFilePath; // Done with the requested template; get the buffer and clear it. $this->_output = ob_get_contents(); ob_end_clean(); return $this->_output; } else { if ($throwErrorIfNotFound) { return new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $path), 500); } return false; } } /** * Overrides the default method to execute and display a template script. * Instead of loadTemplate is uses loadAnyTemplate which allows for automatic * Joomla! version overrides. A little slice of awesome pie! * * @param string $tpl The name of the template file to parse * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = null) { FOFPlatform::getInstance()->setErrorHandling(E_ALL, 'ignore'); $result = $this->loadTemplate($tpl); if ($result instanceof Exception) { FOFPlatform::getInstance()->raiseError($result->getCode(), $result->getMessage()); return $result; } echo $result; } /** * Assigns variables to the view script via differing strategies. * * This method is overloaded; you can assign all the properties of * an object, an associative array, or a single value by name. * * You are not allowed to set variables that begin with an underscore; * these are either private properties for FOFView or private variables * within the template script itself. * * @return boolean True on success, false on failure. * * @deprecated 13.3 Use native PHP syntax. */ public function assign() { FOFPlatform::getInstance()->logDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated. Use native PHP syntax.'); // Get the arguments; there may be 1 or 2. $arg0 = @func_get_arg(0); $arg1 = @func_get_arg(1); // Assign by object if (is_object($arg0)) { // Assign public properties foreach (get_object_vars($arg0) as $key => $val) { if (substr($key, 0, 1) != '_') { $this->$key = $val; } } return true; } // Assign by associative array if (is_array($arg0)) { foreach ($arg0 as $key => $val) { if (substr($key, 0, 1) != '_') { $this->$key = $val; } } return true; } // Assign by string name and mixed value. We use array_key_exists() instead of isset() // because isset() fails if the value is set to null. if (is_string($arg0) && substr($arg0, 0, 1) != '_' && func_num_args() > 1) { $this->$arg0 = $arg1; return true; } // $arg0 was not object, array, or string. return false; } /** * Assign variable for the view (by reference). * * You are not allowed to set variables that begin with an underscore; * these are either private properties for FOFView or private variables * within the template script itself. * * @param string $key The name for the reference in the view. * @param mixed &$val The referenced variable. * * @return boolean True on success, false on failure. * * @deprecated 13.3 Use native PHP syntax. */ public function assignRef($key, &$val) { FOFPlatform::getInstance()->logDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated. Use native PHP syntax.'); if (is_string($key) && substr($key, 0, 1) != '_') { $this->$key = &$val; return true; } return false; } /** * Escapes a value for output in a view script. * * If escaping mechanism is either htmlspecialchars or htmlentities, uses * {@link $_encoding} setting. * * @param mixed $var The output to escape. * * @return mixed The escaped value. */ public function escape($var) { if (in_array($this->_escape, array('htmlspecialchars', 'htmlentities'))) { return call_user_func($this->_escape, $var, ENT_COMPAT, $this->_charset); } return call_user_func($this->_escape, $var); } /** * Method to get data from a registered model or a property of the view * * @param string $property The name of the method to call on the model or the property to get * @param string $default The name of the model to reference or the default value [optional] * * @return mixed The return value of the method */ public function get($property, $default = null) { // If $model is null we use the default model if (is_null($default)) { $model = $this->_defaultModel; } else { $model = strtolower($default); } // First check to make sure the model requested exists if (isset($this->_models[$model])) { // Model exists, let's build the method name $method = 'get' . ucfirst($property); // Does the method exist? if (method_exists($this->_models[$model], $method)) { // The method exists, let's call it and return what we get $result = $this->_models[$model]->$method(); return $result; } } // Degrade to FOFUtilsObject::get $result = parent::get($property, $default); return $result; } /** * Method to get the model object * * @param string $name The name of the model (optional) * * @return mixed FOFModel object */ public function getModel($name = null) { if ($name === null) { $name = $this->_defaultModel; } return $this->_models[strtolower($name)]; } /** * Get the layout. * * @return string The layout name */ public function getLayout() { return $this->_layout; } /** * Get the layout template. * * @return string The layout template name */ public function getLayoutTemplate() { return $this->_layoutTemplate; } /** * Method to get the view name * * The model name by default parsed using the classname, or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the model */ public function getName() { if (empty($this->_name)) { $classname = get_class($this); $viewpos = strpos($classname, 'View'); if ($viewpos === false) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'), 500); } $this->_name = strtolower(substr($classname, $viewpos + 4)); } return $this->_name; } /** * Method to add a model to the view. * * @param FOFMOdel $model The model to add to the view. * @param boolean $default Is this the default model? * @param String $name optional index name to store the model * * @return object The added model. */ public function setModel($model, $default = false, $name = null) { if (is_null($name)) { $name = $model->getName(); } $name = strtolower($name); $this->_models[$name] = $model; if ($default) { $this->_defaultModel = $name; } return $model; } /** * Sets the layout name to use * * @param string $layout The layout name or a string in format <template>:<layout file> * * @return string Previous value. */ public function setLayout($layout) { $previous = $this->_layout; if (strpos($layout, ':') === false) { $this->_layout = $layout; } else { // Convert parameter to array based on : $temp = explode(':', $layout); $this->_layout = $temp[1]; // Set layout template $this->_layoutTemplate = $temp[0]; } return $previous; } /** * Allows a different extension for the layout files to be used * * @param string $value The extension. * * @return string Previous value */ public function setLayoutExt($value) { $previous = $this->_layoutExt; if ($value = preg_replace('#[^A-Za-z0-9]#', '', trim($value))) { $this->_layoutExt = $value; } return $previous; } /** * Sets the _escape() callback. * * @param mixed $spec The callback for _escape() to use. * * @return void * * @deprecated 2.1 Override FOFView::escape() instead. */ public function setEscape($spec) { FOFPlatform::getInstance()->logDeprecated(__CLASS__ . '::' . __METHOD__ . ' is deprecated. Override FOFView::escape() instead.'); $this->_escape = $spec; } /** * Adds to the stack of view script paths in LIFO order. * * @param mixed $path A directory path or an array of paths. * * @return void */ public function addTemplatePath($path) { $this->_addPath('template', $path); } /** * Adds to the stack of helper script paths in LIFO order. * * @param mixed $path A directory path or an array of paths. * * @return void */ public function addHelperPath($path) { $this->_addPath('helper', $path); } /** * Overrides the built-in loadTemplate function with an FOF-specific one. * Our overriden function uses loadAnyTemplate to provide smarter view * template loading. * * @param string $tpl The name of the template file to parse * @param boolean $strict Should we use strict naming, i.e. force a non-empty $tpl? * * @return mixed A string if successful, otherwise a JError object */ public function loadTemplate($tpl = null, $strict = false) { $paths = FOFPlatform::getInstance()->getViewTemplatePaths( $this->input->getCmd('option', ''), $this->input->getCmd('view', ''), $this->getLayout(), $tpl, $strict ); foreach ($paths as $path) { $result = $this->loadAnyTemplate($path); if (!($result instanceof Exception)) { break; } } if ($result instanceof Exception) { FOFPlatform::getInstance()->raiseError($result->getCode(), $result->getMessage()); } return $result; } /** * Parses a template path in the form of admin:/component/view/layout or * site:/component/view/layout to an array which can be used by * loadAnyTemplate to locate and load the view template file. * * @param string $path The template path to parse * * @return array A hash array with the parsed path parts */ private function _parseTemplatePath($path = '') { $parts = array( 'admin' => 0, 'component' => $this->config['option'], 'view' => $this->config['view'], 'template' => 'default' ); if (substr($path, 0, 6) == 'admin:') { $parts['admin'] = 1; $path = substr($path, 6); } elseif (substr($path, 0, 5) == 'site:') { $path = substr($path, 5); } if (empty($path)) { return; } $pathparts = explode('/', $path, 3); switch (count($pathparts)) { case 3: $parts['component'] = array_shift($pathparts); case 2: $parts['view'] = array_shift($pathparts); case 1: $parts['template'] = array_shift($pathparts); break; } return $parts; } /** * Get the renderer object for this view * * @return FOFRenderAbstract */ public function &getRenderer() { if (!($this->rendererObject instanceof FOFRenderAbstract)) { $this->rendererObject = $this->findRenderer(); } return $this->rendererObject; } /** * Sets the renderer object for this view * * @param FOFRenderAbstract &$renderer The render class to use * * @return void */ public function setRenderer(FOFRenderAbstract &$renderer) { $this->rendererObject = $renderer; } /** * Finds a suitable renderer * * @return FOFRenderAbstract */ protected function findRenderer() { $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); // Try loading the stock renderers shipped with FOF if (empty(self::$renderers) || !class_exists('FOFRenderJoomla', false)) { $path = dirname(__FILE__) . '/../render/'; $renderFiles = $filesystem->folderFiles($path, '.php'); if (!empty($renderFiles)) { foreach ($renderFiles as $filename) { if ($filename == 'abstract.php') { continue; } @include_once $path . '/' . $filename; $camel = FOFInflector::camelize($filename); $className = 'FOFRender' . ucfirst(FOFInflector::getPart($camel, 0)); $o = new $className; self::registerRenderer($o); } } } // Try to detect the most suitable renderer $o = null; $priority = 0; if (!empty(self::$renderers)) { foreach (self::$renderers as $r) { $info = $r->getInformation(); if (!$info->enabled) { continue; } if ($info->priority > $priority) { $priority = $info->priority; $o = $r; } } } // Return the current renderer return $o; } /** * Registers a renderer object with the view * * @param FOFRenderAbstract &$renderer The render object to register * * @return void */ public static function registerRenderer(FOFRenderAbstract &$renderer) { self::$renderers[] = $renderer; } /** * Sets the pre-render flag * * @param boolean $value True to enable the pre-render step * * @return void */ public function setPreRender($value) { $this->doPreRender = $value; } /** * Sets the post-render flag * * @param boolean $value True to enable the post-render step * * @return void */ public function setPostRender($value) { $this->doPostRender = $value; } /** * Load a helper file * * @param string $hlp The name of the helper source file automatically searches the helper paths and compiles as needed. * * @return void */ public function loadHelper($hlp = null) { // Clean the file name $file = preg_replace('/[^A-Z0-9_\.-]/i', '', $hlp); // Load the template script using the default Joomla! features $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); $helper = $filesystem->pathFind($this->_path['helper'], $this->_createFileName('helper', array('name' => $file))); if ($helper == false) { $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($this->config['option']); $path = $componentPaths['main'] . '/helpers'; $helper = $filesystem->pathFind($path, $this->_createFileName('helper', array('name' => $file))); if ($helper == false) { $path = $path = $componentPaths['alt'] . '/helpers'; $helper = $filesystem->pathFind($path, $this->_createFileName('helper', array('name' => $file))); } } if ($helper != false) { // Include the requested template filename in the local scope include_once $helper; } } /** * Returns the view's option (component name) and view name in an * associative array. * * @return array */ public function getViewOptionAndName() { return array( 'option' => $this->config['option'], 'view' => $this->config['view'], ); } /** * Sets an entire array of search paths for templates or resources. * * @param string $type The type of path to set, typically 'template'. * @param mixed $path The new search path, or an array of search paths. If null or false, resets to the current directory only. * * @return void */ protected function _setPath($type, $path) { // Clear out the prior search dirs $this->_path[$type] = array(); // Actually add the user-specified directories $this->_addPath($type, $path); // Always add the fallback directories as last resort switch (strtolower($type)) { case 'template': // Set the alternative template search dir if (!FOFPlatform::getInstance()->isCli()) { $fallback = FOFPlatform::getInstance()->getTemplateOverridePath($this->input->getCmd('option', '')) . '/' . $this->getName(); $this->_addPath('template', $fallback); } break; } } /** * Adds to the search path for templates and resources. * * @param string $type The type of path to add. * @param mixed $path The directory or stream, or an array of either, to search. * * @return void */ protected function _addPath($type, $path) { // Just force to array settype($path, 'array'); // Loop through the path directories foreach ($path as $dir) { // No surrounding spaces allowed! $dir = trim($dir); // Add trailing separators as needed if (substr($dir, -1) != DIRECTORY_SEPARATOR) { // Directory $dir .= DIRECTORY_SEPARATOR; } // Add to the top of the search dirs array_unshift($this->_path[$type], $dir); } } /** * Create the filename for a resource * * @param string $type The resource type to create the filename for * @param array $parts An associative array of filename information * * @return string The filename */ protected function _createFileName($type, $parts = array()) { $filename = ''; switch ($type) { case 'template': $filename = strtolower($parts['name']) . '.' . $this->_layoutExt; break; default: $filename = strtolower($parts['name']) . '.php'; break; } return $filename; } } PK���\�g��!�!libraries/fof/view/raw.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage view * @copyright Copyright (C) 2010 - 2015 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 raw output class. It works like an HTML view, but the * output is bare HTML. * * @package FrameworkOnFramework * @since 2.1 */ class FOFViewRaw extends FOFView { /** @var array Data lists */ protected $lists = null; /** @var array Permissions map */ protected $perms = null; /** * Class constructor * * @param array $config Configuration parameters */ public function __construct($config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } parent::__construct($config); $this->config = $config; // Get the input if (array_key_exists('input', $config)) { if ($config['input'] instanceof FOFInput) { $this->input = $config['input']; } else { $this->input = new FOFInput($config['input']); } } else { $this->input = new FOFInput; } if (!array_key_exists('option', $this->config)) { $this->config['option'] = $this->input->getCmd('option', 'com_foobar'); } if (!array_key_exists('view', $this->config)) { $this->config['view'] = $this->input->getCmd('view', 'cpanel'); } $this->lists = new FOFUtilsObject; if (!FOFPlatform::getInstance()->isCli()) { $platform = FOFPlatform::getInstance(); $perms = (object) array( 'create' => $platform->authorise('core.create' , $this->input->getCmd('option', 'com_foobar')), 'edit' => $platform->authorise('core.edit' , $this->input->getCmd('option', 'com_foobar')), 'editown' => $platform->authorise('core.edit.own' , $this->input->getCmd('option', 'com_foobar')), 'editstate' => $platform->authorise('core.edit.state' , $this->input->getCmd('option', 'com_foobar')), 'delete' => $platform->authorise('core.delete' , $this->input->getCmd('option', 'com_foobar')), ); $this->aclperms = $perms; $this->perms = $perms; } } /** * Displays the view * * @param string $tpl The template to use * * @return boolean|null False if we can't render anything */ public function display($tpl = null) { // Get the task set in the model $model = $this->getModel(); $task = $model->getState('task', 'browse'); // Call the relevant method $method_name = 'on' . ucfirst($task); if (method_exists($this, $method_name)) { $result = $this->$method_name($tpl); } else { $result = $this->onDisplay(); } if ($result === false) { return; } // Show the view if ($this->doPreRender) { $this->preRender(); } parent::display($tpl); if ($this->doPostRender) { $this->postRender(); } } /** * Last chance to output something before rendering the view template * * @return void */ protected function preRender() { } /** * Last chance to output something after rendering the view template and * before returning to the caller * * @return void */ protected function postRender() { } /** * Executes before rendering the page for the Browse task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page */ protected function onBrowse($tpl = null) { // When in interactive browsing mode, save the state to the session $this->getModel()->savestate(1); return $this->onDisplay($tpl); } /** * Executes before rendering a generic page, default to actions necessary * for the Browse task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page */ protected function onDisplay($tpl = null) { $view = $this->input->getCmd('view', 'cpanel'); if (in_array($view, array('cpanel', 'cpanels'))) { return; } // Load the model $model = $this->getModel(); // ...ordering $this->lists->set('order', $model->getState('filter_order', 'id', 'cmd')); $this->lists->set('order_Dir', $model->getState('filter_order_Dir', 'DESC', 'cmd')); // Assign data to the view $this->items = $model->getItemList(); $this->pagination = $model->getPagination(); // Pass page params on frontend only if (FOFPlatform::getInstance()->isFrontend()) { $params = JFactory::getApplication()->getParams(); $this->params = $params; } return true; } /** * Executes before rendering the page for the Add task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page */ protected function onAdd($tpl = null) { JRequest::setVar('hidemainmenu', true); $model = $this->getModel(); $this->item = $model->getItem(); return true; } /** * Executes before rendering the page for the Edit task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page */ protected function onEdit($tpl = null) { // This perms are used only for hestetic reasons (ie showing toolbar buttons), "real" checks // are made by the controller // It seems that I can't edit records, maybe I can edit only this one due asset tracking? if (!$this->perms->edit || !$this->perms->editown) { $model = $this->getModel(); if($model) { $table = $model->getTable(); // Ok, record is tracked, let's see if I can this record if($table->isAssetsTracked()) { $platform = FOFPlatform::getInstance(); if(!$this->perms->edit) { $this->perms->edit = $platform->authorise('core.edit', $table->getAssetName()); } if(!$this->perms->editown) { $this->perms->editown = $platform->authorise('core.edit.own', $table->getAssetName()); } } } } return $this->onAdd($tpl); } /** * Executes before rendering the page for the Read task. * * @param string $tpl Subtemplate to use * * @return boolean Return true to allow rendering of the page */ protected function onRead($tpl = null) { // All I need is to read the record return $this->onAdd($tpl); } /** * Determines if the current Joomla! version and your current table support * AJAX-powered drag and drop reordering. If they do, it will set up the * drag & drop reordering feature. * * @return boolean|array False if not suported, a table with necessary * information (saveOrder: should you enabled DnD * reordering; orderingColumn: which column has the * ordering information). */ public function hasAjaxOrderingSupport() { if (version_compare(JVERSION, '3.0', 'lt')) { return false; } $model = $this->getModel(); if (!method_exists($model, 'getTable')) { return false; } $table = $this->getModel()->getTable(); if (!method_exists($table, 'getColumnAlias') || !method_exists($table, 'getTableFields')) { return false; } $orderingColumn = $table->getColumnAlias('ordering'); $fields = $table->getTableFields(); if (!is_array($fields) || !array_key_exists($orderingColumn, $fields)) { return false; } $listOrder = $this->escape($model->getState('filter_order', null, 'cmd')); $listDirn = $this->escape($model->getState('filter_order_Dir', 'ASC', 'cmd')); $saveOrder = $listOrder == $orderingColumn; if ($saveOrder) { $saveOrderingUrl = 'index.php?option=' . $this->config['option'] . '&view=' . $this->config['view'] . '&task=saveorder&format=json'; JHtml::_('sortablelist.sortable', 'itemsList', 'adminForm', strtolower($listDirn), $saveOrderingUrl); } return array( 'saveOrder' => $saveOrder, 'orderingColumn' => $orderingColumn ); } /** * Returns the internal list of useful variables to the benefit of * FOFFormHeader fields. * * @return array * * @since 2.0 */ public function getLists() { return $this->lists; } /** * Returns a reference to the permissions object of this view * * @return stdClass */ public function getPerms() { return $this->perms; } } PK���\�����%libraries/fof/utils/cache/cleaner.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * A utility class to help you quickly clean the Joomla! cache */ class FOFUtilsCacheCleaner { /** * Clears the com_modules and com_plugins cache. You need to call this whenever you alter the publish state or * parameters of a module or plugin from your code. * * @return void */ public static function clearPluginsAndModulesCache() { self::clearPluginsCache(); self::clearModulesCache(); } /** * Clears the com_plugins cache. You need to call this whenever you alter the publish state or parameters of a * plugin from your code. * * @return void */ public static function clearPluginsCache() { self::clearCacheGroups(array('com_plugins'), array(0,1)); } /** * Clears the com_modules cache. You need to call this whenever you alter the publish state or parameters of a * module from your code. * * @return void */ public static function clearModulesCache() { self::clearCacheGroups(array('com_modules'), array(0,1)); } /** * Clears the specified cache groups. * * @param array $clearGroups Which cache groups to clear. Usually this is com_yourcomponent to clear your * component's cache. * @param array $cacheClients Which cache clients to clear. 0 is the back-end, 1 is the front-end. If you do not * specify anything, both cache clients will be cleared. * * @return void */ public static function clearCacheGroups(array $clearGroups, array $cacheClients = array(0, 1)) { $conf = JFactory::getConfig(); foreach ($clearGroups as $group) { foreach ($cacheClients as $client_id) { try { $options = array( 'defaultgroup' => $group, 'cachebase' => ($client_id) ? JPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', JPATH_SITE . '/cache') ); $cache = JCache::getInstance('callback', $options); $cache->clean(); } catch (Exception $e) { // suck it up } } } } } PK���\��>��#libraries/fof/utils/timer/timer.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * An execution timer monitor class */ class FOFUtilsTimer { /** @var float Maximum execution time allowance */ private $max_exec_time = null; /** @var float Timestamp of execution start */ private $start_time = null; /** * Public constructor, creates the timer object and calculates the execution * time limits. * * @param float $max_exec_time Maximum execution time allowance * @param float $runtime_bias Execution time bias (expressed as % of $max_exec_time) */ public function __construct($max_exec_time = 5.0, $runtime_bias = 75.0) { // Initialize start time $this->start_time = $this->microtime_float(); $this->max_exec_time = $max_exec_time * $runtime_bias / 100.0; } /** * Wake-up function to reset internal timer when we get unserialized */ public function __wakeup() { // Re-initialize start time on wake-up $this->start_time = $this->microtime_float(); } /** * Gets the number of seconds left, before we hit the "must break" threshold. Negative * values mean that we have already crossed that threshold. * * @return float */ public function getTimeLeft() { return $this->max_exec_time - $this->getRunningTime(); } /** * Gets the time elapsed since object creation/unserialization, effectively * how long we are running * * @return float */ public function getRunningTime() { return $this->microtime_float() - $this->start_time; } /** * Returns the current timestamp in decimal seconds * * @return float */ private function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } /** * Reset the timer */ public function resetTime() { $this->start_time = $this->microtime_float(); } }PK���\t�9�1�1#libraries/fof/utils/array/array.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * A utility class to handle array manipulation. * * Based on the JArrayHelper class as found in Joomla! 3.2.0 */ abstract class FOFUtilsArray { /** * Option to perform case-sensitive sorts. * * @var mixed Boolean or array of booleans. */ protected static $sortCase; /** * Option to set the sort direction. * * @var mixed Integer or array of integers. */ protected static $sortDirection; /** * Option to set the object key to sort on. * * @var string */ protected static $sortKey; /** * Option to perform a language aware sort. * * @var mixed Boolean or array of booleans. */ protected static $sortLocale; /** * Function to convert array to integer values * * @param array &$array The source array to convert * @param mixed $default A default value (int|array) to assign if $array is not an array * * @return void */ public static function toInteger(&$array, $default = null) { if (is_array($array)) { foreach ($array as $i => $v) { $array[$i] = (int) $v; } } else { if ($default === null) { $array = array(); } elseif (is_array($default)) { self::toInteger($default, null); $array = $default; } else { $array = array((int) $default); } } } /** * Utility function to map an array to a stdClass object. * * @param array &$array The array to map. * @param string $class Name of the class to create * * @return object The object mapped from the given array */ public static function toObject(&$array, $class = 'stdClass') { $obj = null; if (is_array($array)) { $obj = new $class; foreach ($array as $k => $v) { if (is_array($v)) { $obj->$k = self::toObject($v, $class); } else { $obj->$k = $v; } } } return $obj; } /** * Utility function to map an array to a string. * * @param array $array The array to map. * @param string $inner_glue The glue (optional, defaults to '=') between the key and the value. * @param string $outer_glue The glue (optional, defaults to ' ') between array elements. * @param boolean $keepOuterKey True if final key should be kept. * * @return string The string mapped from the given array */ public static function toString($array = null, $inner_glue = '=', $outer_glue = ' ', $keepOuterKey = false) { $output = array(); if (is_array($array)) { foreach ($array as $key => $item) { if (is_array($item)) { if ($keepOuterKey) { $output[] = $key; } // This is value is an array, go and do it again! $output[] = self::toString($item, $inner_glue, $outer_glue, $keepOuterKey); } else { $output[] = $key . $inner_glue . '"' . $item . '"'; } } } return implode($outer_glue, $output); } /** * Utility function to map an object to an array * * @param object $p_obj The source object * @param boolean $recurse True to recurse through multi-level objects * @param string $regex An optional regular expression to match on field names * * @return array The array mapped from the given object */ public static function fromObject($p_obj, $recurse = true, $regex = null) { if (is_object($p_obj)) { return self::_fromObject($p_obj, $recurse, $regex); } else { return null; } } /** * Utility function to map an object or array to an array * * @param mixed $item The source object or array * @param boolean $recurse True to recurse through multi-level objects * @param string $regex An optional regular expression to match on field names * * @return array The array mapped from the given object */ protected static function _fromObject($item, $recurse, $regex) { if (is_object($item)) { $result = array(); foreach (get_object_vars($item) as $k => $v) { if (!$regex || preg_match($regex, $k)) { if ($recurse) { $result[$k] = self::_fromObject($v, $recurse, $regex); } else { $result[$k] = $v; } } } } elseif (is_array($item)) { $result = array(); foreach ($item as $k => $v) { $result[$k] = self::_fromObject($v, $recurse, $regex); } } else { $result = $item; } return $result; } /** * Extracts a column from an array of arrays or objects * * @param array &$array The source array * @param string $index The index of the column or name of object property * * @return array Column of values from the source array */ public static function getColumn(&$array, $index) { $result = array(); if (is_array($array)) { foreach ($array as &$item) { if (is_array($item) && isset($item[$index])) { $result[] = $item[$index]; } elseif (is_object($item) && isset($item->$index)) { $result[] = $item->$index; } // Else ignore the entry } } return $result; } /** * Utility function to return a value from a named array or a specified default * * @param array &$array A named array * @param string $name The key to search for * @param mixed $default The default value to give if no key found * @param string $type Return type for the variable (INT, FLOAT, STRING, WORD, BOOLEAN, ARRAY) * * @return mixed The value from the source array */ public static function getValue(&$array, $name, $default = null, $type = '') { $result = null; if (isset($array[$name])) { $result = $array[$name]; } // Handle the default case if (is_null($result)) { $result = $default; } // Handle the type constraint switch (strtoupper($type)) { case 'INT': case 'INTEGER': // Only use the first integer value @preg_match('/-?[0-9]+/', $result, $matches); $result = @(int) $matches[0]; break; case 'FLOAT': case 'DOUBLE': // Only use the first floating point value @preg_match('/-?[0-9]+(\.[0-9]+)?/', $result, $matches); $result = @(float) $matches[0]; break; case 'BOOL': case 'BOOLEAN': $result = (bool) $result; break; case 'ARRAY': if (!is_array($result)) { $result = array($result); } break; case 'STRING': $result = (string) $result; break; case 'WORD': $result = (string) preg_replace('#\W#', '', $result); break; case 'NONE': default: // No casting necessary break; } return $result; } /** * Takes an associative array of arrays and inverts the array keys to values using the array values as keys. * * Example: * $input = array( * 'New' => array('1000', '1500', '1750'), * 'Used' => array('3000', '4000', '5000', '6000') * ); * $output = FOFUtilsArray::invert($input); * * Output would be equal to: * $output = array( * '1000' => 'New', * '1500' => 'New', * '1750' => 'New', * '3000' => 'Used', * '4000' => 'Used', * '5000' => 'Used', * '6000' => 'Used' * ); * * @param array $array The source array. * * @return array The inverted array. */ public static function invert($array) { $return = array(); foreach ($array as $base => $values) { if (!is_array($values)) { continue; } foreach ($values as $key) { // If the key isn't scalar then ignore it. if (is_scalar($key)) { $return[$key] = $base; } } } return $return; } /** * Method to determine if an array is an associative array. * * @param array $array An array to test. * * @return boolean True if the array is an associative array. */ public static function isAssociative($array) { if (is_array($array)) { foreach (array_keys($array) as $k => $v) { if ($k !== $v) { return true; } } } return false; } /** * Pivots an array to create a reverse lookup of an array of scalars, arrays or objects. * * @param array $source The source array. * @param string $key Where the elements of the source array are objects or arrays, the key to pivot on. * * @return array An array of arrays pivoted either on the value of the keys, or an individual key of an object or array. */ public static function pivot($source, $key = null) { $result = array(); $counter = array(); foreach ($source as $index => $value) { // Determine the name of the pivot key, and its value. if (is_array($value)) { // If the key does not exist, ignore it. if (!isset($value[$key])) { continue; } $resultKey = $value[$key]; $resultValue = &$source[$index]; } elseif (is_object($value)) { // If the key does not exist, ignore it. if (!isset($value->$key)) { continue; } $resultKey = $value->$key; $resultValue = &$source[$index]; } else { // Just a scalar value. $resultKey = $value; $resultValue = $index; } // The counter tracks how many times a key has been used. if (empty($counter[$resultKey])) { // The first time around we just assign the value to the key. $result[$resultKey] = $resultValue; $counter[$resultKey] = 1; } elseif ($counter[$resultKey] == 1) { // If there is a second time, we convert the value into an array. $result[$resultKey] = array( $result[$resultKey], $resultValue, ); $counter[$resultKey]++; } else { // After the second time, no need to track any more. Just append to the existing array. $result[$resultKey][] = $resultValue; } } unset($counter); return $result; } /** * Utility function to sort an array of objects on a given field * * @param array &$a An array of objects * @param mixed $k The key (string) or a array of key to sort on * @param mixed $direction Direction (integer) or an array of direction to sort in [1 = Ascending] [-1 = Descending] * @param mixed $caseSensitive Boolean or array of booleans to let sort occur case sensitive or insensitive * @param mixed $locale Boolean or array of booleans to let sort occur using the locale language or not * * @return array The sorted array of objects */ public static function sortObjects(&$a, $k, $direction = 1, $caseSensitive = true, $locale = false) { if (!is_array($locale) || !is_array($locale[0])) { $locale = array($locale); } self::$sortCase = (array) $caseSensitive; self::$sortDirection = (array) $direction; self::$sortKey = (array) $k; self::$sortLocale = $locale; usort($a, array(__CLASS__, '_sortObjects')); self::$sortCase = null; self::$sortDirection = null; self::$sortKey = null; self::$sortLocale = null; return $a; } /** * Callback function for sorting an array of objects on a key * * @param array &$a An array of objects * @param array &$b An array of objects * * @return integer Comparison status * * @see FOFUtilsArray::sortObjects() */ protected static function _sortObjects(&$a, &$b) { $key = self::$sortKey; for ($i = 0, $count = count($key); $i < $count; $i++) { if (isset(self::$sortDirection[$i])) { $direction = self::$sortDirection[$i]; } if (isset(self::$sortCase[$i])) { $caseSensitive = self::$sortCase[$i]; } if (isset(self::$sortLocale[$i])) { $locale = self::$sortLocale[$i]; } $va = $a->{$key[$i]}; $vb = $b->{$key[$i]}; if ((is_bool($va) || is_numeric($va)) && (is_bool($vb) || is_numeric($vb))) { $cmp = $va - $vb; } elseif ($caseSensitive) { $cmp = JString::strcmp($va, $vb, $locale); } else { $cmp = JString::strcasecmp($va, $vb, $locale); } if ($cmp > 0) { return $direction; } if ($cmp < 0) { return -$direction; } } return 0; } /** * Multidimensional array safe unique test * * @param array $myArray The array to make unique. * * @return array * * @see http://php.net/manual/en/function.array-unique.php */ public static function arrayUnique($myArray) { if (!is_array($myArray)) { return $myArray; } foreach ($myArray as &$myvalue) { $myvalue = serialize($myvalue); } $myArray = array_unique($myArray); foreach ($myArray as &$myvalue) { $myvalue = unserialize($myvalue); } return $myArray; } } PK���\|��++libraries/fof/utils/ip/ip.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * IP address utilities */ abstract class FOFUtilsIp { /** @var string The IP address of the current visitor */ protected static $ip = null; /** * Get the current visitor's IP address * * @return string */ public static function getIp() { if (is_null(static::$ip)) { $ip = self::detectAndCleanIP(); if (!empty($ip) && ($ip != '0.0.0.0') && function_exists('inet_pton') && function_exists('inet_ntop')) { $myIP = @inet_pton($ip); if ($myIP !== false) { $ip = inet_ntop($myIP); } } static::setIp($ip); } return static::$ip; } /** * Set the IP address of the current visitor * * @param string $ip * * @return void */ public static function setIp($ip) { static::$ip = $ip; } /** * Is it an IPv6 IP address? * * @param string $ip An IPv4 or IPv6 address * * @return boolean True if it's IPv6 */ public static function isIPv6($ip) { if (strstr($ip, ':')) { return true; } return false; } /** * Checks if an IP is contained in a list of IPs or IP expressions * * @param string $ip The IPv4/IPv6 address to check * @param array|string $ipTable An IP expression (or a comma-separated or array list of IP expressions) to check against * * @return null|boolean True if it's in the list */ public static function IPinList($ip, $ipTable = '') { // No point proceeding with an empty IP list if (empty($ipTable)) { return false; } // If the IP list is not an array, convert it to an array if (!is_array($ipTable)) { if (strpos($ipTable, ',') !== false) { $ipTable = explode(',', $ipTable); $ipTable = array_map(function($x) { return trim($x); }, $ipTable); } else { $ipTable = trim($ipTable); $ipTable = array($ipTable); } } // If no IP address is found, return false if ($ip == '0.0.0.0') { return false; } // If no IP is given, return false if (empty($ip)) { return false; } // Sanity check if (!function_exists('inet_pton')) { return false; } // Get the IP's in_adds representation $myIP = @inet_pton($ip); // If the IP is in an unrecognisable format, quite if ($myIP === false) { return false; } $ipv6 = self::isIPv6($ip); foreach ($ipTable as $ipExpression) { $ipExpression = trim($ipExpression); // Inclusive IP range, i.e. 123.123.123.123-124.125.126.127 if (strstr($ipExpression, '-')) { list($from, $to) = explode('-', $ipExpression, 2); if ($ipv6 && (!self::isIPv6($from) || !self::isIPv6($to))) { // Do not apply IPv4 filtering on an IPv6 address continue; } elseif (!$ipv6 && (self::isIPv6($from) || self::isIPv6($to))) { // Do not apply IPv6 filtering on an IPv4 address continue; } $from = @inet_pton(trim($from)); $to = @inet_pton(trim($to)); // Sanity check if (($from === false) || ($to === false)) { continue; } // Swap from/to if they're in the wrong order if ($from > $to) { list($from, $to) = array($to, $from); } if (($myIP >= $from) && ($myIP <= $to)) { return true; } } // Netmask or CIDR provided elseif (strstr($ipExpression, '/')) { $binaryip = self::inet_to_bits($myIP); list($net, $maskbits) = explode('/', $ipExpression, 2); if ($ipv6 && !self::isIPv6($net)) { // Do not apply IPv4 filtering on an IPv6 address continue; } elseif (!$ipv6 && self::isIPv6($net)) { // Do not apply IPv6 filtering on an IPv4 address continue; } elseif ($ipv6 && strstr($maskbits, ':')) { // Perform an IPv6 CIDR check if (self::checkIPv6CIDR($myIP, $ipExpression)) { return true; } // If we didn't match it proceed to the next expression continue; } elseif (!$ipv6 && strstr($maskbits, '.')) { // Convert IPv4 netmask to CIDR $long = ip2long($maskbits); $base = ip2long('255.255.255.255'); $maskbits = 32 - log(($long ^ $base) + 1, 2); } // Convert network IP to in_addr representation $net = @inet_pton($net); // Sanity check if ($net === false) { continue; } // Get the network's binary representation $binarynet = self::inet_to_bits($net); $expectedNumberOfBits = $ipv6 ? 128 : 24; $binarynet = str_pad($binarynet, $expectedNumberOfBits, '0', STR_PAD_RIGHT); // Check the corresponding bits of the IP and the network $ip_net_bits = substr($binaryip, 0, $maskbits); $net_bits = substr($binarynet, 0, $maskbits); if ($ip_net_bits == $net_bits) { return true; } } else { // IPv6: Only single IPs are supported if ($ipv6) { $ipExpression = trim($ipExpression); if (!self::isIPv6($ipExpression)) { continue; } $ipCheck = @inet_pton($ipExpression); if ($ipCheck === false) { continue; } if ($ipCheck == $myIP) { return true; } } else { // Standard IPv4 address, i.e. 123.123.123.123 or partial IP address, i.e. 123.[123.][123.][123] $dots = 0; if (substr($ipExpression, -1) == '.') { // Partial IP address. Convert to CIDR and re-match foreach (count_chars($ipExpression, 1) as $i => $val) { if ($i == 46) { $dots = $val; } } switch ($dots) { case 1: $netmask = '255.0.0.0'; $ipExpression .= '0.0.0'; break; case 2: $netmask = '255.255.0.0'; $ipExpression .= '0.0'; break; case 3: $netmask = '255.255.255.0'; $ipExpression .= '0'; break; default: $dots = 0; } if ($dots) { $binaryip = self::inet_to_bits($myIP); // Convert netmask to CIDR $long = ip2long($netmask); $base = ip2long('255.255.255.255'); $maskbits = 32 - log(($long ^ $base) + 1, 2); $net = @inet_pton($ipExpression); // Sanity check if ($net === false) { continue; } // Get the network's binary representation $binarynet = self::inet_to_bits($net); $expectedNumberOfBits = $ipv6 ? 128 : 24; $binarynet = str_pad($binarynet, $expectedNumberOfBits, '0', STR_PAD_RIGHT); // Check the corresponding bits of the IP and the network $ip_net_bits = substr($binaryip, 0, $maskbits); $net_bits = substr($binarynet, 0, $maskbits); if ($ip_net_bits == $net_bits) { return true; } } } if (!$dots) { $ip = @inet_pton(trim($ipExpression)); if ($ip == $myIP) { return true; } } } } } return false; } /** * Works around the REMOTE_ADDR not containing the user's IP */ public static function workaroundIPIssues() { $ip = self::getIp(); if ($_SERVER['REMOTE_ADDR'] == $ip) { return; } if (array_key_exists('REMOTE_ADDR', $_SERVER)) { $_SERVER['FOF_REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR']; } elseif (function_exists('getenv')) { if (getenv('REMOTE_ADDR')) { $_SERVER['FOF_REMOTE_ADDR'] = getenv('REMOTE_ADDR'); } } $_SERVER['REMOTE_ADDR'] = $ip; } /** * Gets the visitor's IP address. Automatically handles reverse proxies * reporting the IPs of intermediate devices, like load balancers. Examples: * https://www.akeebabackup.com/support/admin-tools/13743-double-ip-adresses-in-security-exception-log-warnings.html * http://stackoverflow.com/questions/2422395/why-is-request-envremote-addr-returning-two-ips * The solution used is assuming that the last IP address is the external one. * * @return string */ protected static function detectAndCleanIP() { $ip = self::detectIP(); if ((strstr($ip, ',') !== false) || (strstr($ip, ' ') !== false)) { $ip = str_replace(' ', ',', $ip); $ip = str_replace(',,', ',', $ip); $ips = explode(',', $ip); $ip = ''; while (empty($ip) && !empty($ips)) { $ip = array_pop($ips); $ip = trim($ip); } } else { $ip = trim($ip); } return $ip; } /** * Gets the visitor's IP address * * @return string */ protected static function detectIP() { // Normally the $_SERVER superglobal is set if (isset($_SERVER)) { // Do we have an x-forwarded-for HTTP header (e.g. NginX)? if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) { return $_SERVER['HTTP_X_FORWARDED_FOR']; } // Do we have a client-ip header (e.g. non-transparent proxy)? if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) { return $_SERVER['HTTP_CLIENT_IP']; } // Normal, non-proxied server or server behind a transparent proxy return $_SERVER['REMOTE_ADDR']; } // This part is executed on PHP running as CGI, or on SAPIs which do // not set the $_SERVER superglobal // If getenv() is disabled, you're screwed if (!function_exists('getenv')) { return ''; } // Do we have an x-forwarded-for HTTP header? if (getenv('HTTP_X_FORWARDED_FOR')) { return getenv('HTTP_X_FORWARDED_FOR'); } // Do we have a client-ip header? if (getenv('HTTP_CLIENT_IP')) { return getenv('HTTP_CLIENT_IP'); } // Normal, non-proxied server or server behind a transparent proxy if (getenv('REMOTE_ADDR')) { return getenv('REMOTE_ADDR'); } // Catch-all case for broken servers, apparently return ''; } /** * Converts inet_pton output to bits string * * @param string $inet The in_addr representation of an IPv4 or IPv6 address * * @return string */ protected static function inet_to_bits($inet) { if (strlen($inet) == 4) { $unpacked = unpack('A4', $inet); } else { $unpacked = unpack('A16', $inet); } $unpacked = str_split($unpacked[1]); $binaryip = ''; foreach ($unpacked as $char) { $binaryip .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT); } return $binaryip; } /** * Checks if an IPv6 address $ip is part of the IPv6 CIDR block $cidrnet * * @param string $ip The IPv6 address to check, e.g. 21DA:00D3:0000:2F3B:02AC:00FF:FE28:9C5A * @param string $cidrnet The IPv6 CIDR block, e.g. 21DA:00D3:0000:2F3B::/64 * * @return bool */ protected static function checkIPv6CIDR($ip, $cidrnet) { $ip = inet_pton($ip); $binaryip=self::inet_to_bits($ip); list($net,$maskbits)=explode('/',$cidrnet); $net=inet_pton($net); $binarynet=self::inet_to_bits($net); $ip_net_bits=substr($binaryip,0,$maskbits); $net_bits =substr($binarynet,0,$maskbits); return $ip_net_bits === $net_bits; } }PK���\]���pp-libraries/fof/utils/observable/dispatcher.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Class to handle dispatching of events. * * This is the Observable part of the Observer design pattern * for the event architecture. * * This class is based on JEventDispatcher as found in Joomla! 3.2.0 */ class FOFUtilsObservableDispatcher extends FOFUtilsObject { /** * An array of Observer objects to notify * * @var array */ protected $_observers = array(); /** * The state of the observable object * * @var mixed */ protected $_state = null; /** * A multi dimensional array of [function][] = key for observers * * @var array */ protected $_methods = array(); /** * Stores the singleton instance of the dispatcher. * * @var FOFUtilsObservableDispatcher */ protected static $instance = null; /** * Returns the global Event Dispatcher object, only creating it * if it doesn't already exist. * * @return FOFUtilsObservableDispatcher The EventDispatcher object. */ public static function getInstance() { if (self::$instance === null) { self::$instance = new static; } return self::$instance; } /** * Get the state of the FOFUtilsObservableDispatcher object * * @return mixed The state of the object. */ public function getState() { return $this->_state; } /** * Registers an event handler to the event dispatcher * * @param string $event Name of the event to register handler for * @param string $handler Name of the event handler * * @return void * * @throws InvalidArgumentException */ public function register($event, $handler) { // Are we dealing with a class or callback type handler? if (is_callable($handler)) { // Ok, function type event handler... let's attach it. $method = array('event' => $event, 'handler' => $handler); $this->attach($method); } elseif (class_exists($handler)) { // Ok, class type event handler... let's instantiate and attach it. $this->attach(new $handler($this)); } else { throw new InvalidArgumentException('Invalid event handler.'); } } /** * Triggers an event by dispatching arguments to all observers that handle * the event and returning their return values. * * @param string $event The event to trigger. * @param array $args An array of arguments. * * @return array An array of results from each function call. */ public function trigger($event, $args = array()) { $result = array(); /* * If no arguments were passed, we still need to pass an empty array to * the call_user_func_array function. */ $args = (array) $args; $event = strtolower($event); // Check if any plugins are attached to the event. if (!isset($this->_methods[$event]) || empty($this->_methods[$event])) { // No Plugins Associated To Event! return $result; } // Loop through all plugins having a method matching our event foreach ($this->_methods[$event] as $key) { // Check if the plugin is present. if (!isset($this->_observers[$key])) { continue; } // Fire the event for an object based observer. if (is_object($this->_observers[$key])) { $args['event'] = $event; $value = $this->_observers[$key]->update($args); } // Fire the event for a function based observer. elseif (is_array($this->_observers[$key])) { $value = call_user_func_array($this->_observers[$key]['handler'], $args); } if (isset($value)) { $result[] = $value; } } return $result; } /** * Attach an observer object * * @param object $observer An observer object to attach * * @return void */ public function attach($observer) { if (is_array($observer)) { if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler'])) { return; } // Make sure we haven't already attached this array as an observer foreach ($this->_observers as $check) { if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler']) { return; } } $this->_observers[] = $observer; end($this->_observers); $methods = array($observer['event']); } else { if (!($observer instanceof FOFUtilsObservableEvent)) { return; } // Make sure we haven't already attached this object as an observer $class = get_class($observer); foreach ($this->_observers as $check) { if ($check instanceof $class) { return; } } $this->_observers[] = $observer; $methods = array(); foreach(get_class_methods($observer) as $obs_method) { // Magic methods are not allowed if(strpos('__', $obs_method) === 0) { continue; } $methods[] = $obs_method; } //$methods = get_class_methods($observer); } $key = key($this->_observers); foreach ($methods as $method) { $method = strtolower($method); if (!isset($this->_methods[$method])) { $this->_methods[$method] = array(); } $this->_methods[$method][] = $key; } } /** * Detach an observer object * * @param object $observer An observer object to detach. * * @return boolean True if the observer object was detached. */ public function detach($observer) { $retval = false; $key = array_search($observer, $this->_observers); if ($key !== false) { unset($this->_observers[$key]); $retval = true; foreach ($this->_methods as &$method) { $k = array_search($key, $method); if ($k !== false) { unset($method[$k]); } } } return $retval; } } PK���\����(libraries/fof/utils/observable/event.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Defines an observable event. * * This class is based on JEvent as found in Joomla! 3.2.0 */ abstract class FOFUtilsObservableEvent extends FOFUtilsObject { /** * Event object to observe. * * @var object */ protected $_subject = null; /** * Constructor * * @param object &$subject The object to observe. */ public function __construct(&$subject) { // Register the observer ($this) so we can be notified $subject->attach($this); // Set the subject to observe $this->_subject = &$subject; } /** * Method to trigger events. * The method first generates the even from the argument array. Then it unsets the argument * since the argument has no bearing on the event handler. * If the method exists it is called and returns its return value. If it does not exist it * returns null. * * @param array &$args Arguments * * @return mixed Routine return value */ public function update(&$args) { // First let's get the event from the argument array. Next we will unset the // event argument as it has no bearing on the method to handle the event. $event = $args['event']; unset($args['event']); /* * If the method to handle an event exists, call it and return its return * value. If it does not exist, return null. */ if (method_exists($this, $event)) { return call_user_func_array(array($this, $event), $args); } else { return null; } } } PK���\��C?����3libraries/fof/utils/installscript/installscript.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; JLoader::import('joomla.filesystem.folder'); JLoader::import('joomla.filesystem.file'); JLoader::import('joomla.installer.installer'); JLoader::import('joomla.utilities.date'); /** * A helper class which you can use to create component installation scripts */ abstract class FOFUtilsInstallscript { /** * The component's name * * @var string */ protected $componentName = 'com_foobar'; /** * The title of the component (printed on installation and uninstallation messages) * * @var string */ protected $componentTitle = 'Foobar Component'; /** * The list of extra modules and plugins to install on component installation / update and remove on component * uninstallation. * * @var array */ protected $installation_queue = array( // modules => { (folder) => { (module) => { (position), (published) } }* }* 'modules' => array( 'admin' => array(), 'site' => array() ), // plugins => { (folder) => { (element) => (published) }* }* 'plugins' => array( 'system' => array(), ) ); /** * The list of obsolete extra modules and plugins to uninstall on component upgrade / installation. * * @var array */ protected $uninstallation_queue = array( // modules => { (folder) => { (module) }* }* 'modules' => array( 'admin' => array(), 'site' => array() ), // plugins => { (folder) => { (element) }* }* 'plugins' => array( 'system' => array(), ) ); /** * Obsolete files and folders to remove from the free version only. This is used when you move a feature from the * free version of your extension to its paid version. If you don't have such a distinction you can ignore this. * * @var array */ protected $removeFilesFree = array( 'files' => array( // Use pathnames relative to your site's root, e.g. // 'administrator/components/com_foobar/helpers/whatever.php' ), 'folders' => array( // Use pathnames relative to your site's root, e.g. // 'administrator/components/com_foobar/baz' ) ); /** * Obsolete files and folders to remove from both paid and free releases. This is used when you refactor code and * some files inevitably become obsolete and need to be removed. * * @var array */ protected $removeFilesAllVersions = array( 'files' => array( // Use pathnames relative to your site's root, e.g. // 'administrator/components/com_foobar/helpers/whatever.php' ), 'folders' => array( // Use pathnames relative to your site's root, e.g. // 'administrator/components/com_foobar/baz' ) ); /** * A list of scripts to be copied to the "cli" directory of the site * * @var array */ protected $cliScriptFiles = array( // Use just the filename, e.g. // 'my-cron-script.php' ); /** * The path inside your package where cli scripts are stored * * @var string */ protected $cliSourcePath = 'cli'; /** * The path inside your package where FOF is stored * * @var string */ protected $fofSourcePath = 'fof'; /** * The path inside your package where Akeeba Strapper is stored * * @var string */ protected $strapperSourcePath = 'strapper'; /** * The path inside your package where extra modules are stored * * @var string */ protected $modulesSourcePath = 'modules'; /** * The path inside your package where extra plugins are stored * * @var string */ protected $pluginsSourcePath = 'plugins'; /** * Is the schemaXmlPath class variable a relative path? If set to true the schemaXmlPath variable contains a path * relative to the component's back-end directory. If set to false the schemaXmlPath variable contains an absolute * filesystem path. * * @var boolean */ protected $schemaXmlPathRelative = true; /** * The path where the schema XML files are stored. Its contents depend on the schemaXmlPathRelative variable above * true => schemaXmlPath contains a path relative to the component's back-end directory * false => schemaXmlPath contains an absolute filesystem path * * @var string */ protected $schemaXmlPath = 'sql/xml'; /** * The minimum PHP version required to install this extension * * @var string */ protected $minimumPHPVersion = '5.3.3'; /** * The minimum Joomla! version required to install this extension * * @var string */ protected $minimumJoomlaVersion = '2.5.6'; /** * The maximum Joomla! version this extension can be installed on * * @var string */ protected $maximumJoomlaVersion = '3.9.99'; /** * Is this the paid version of the extension? This only determines which files / extensions will be removed. * * @var boolean */ protected $isPaid = false; /** * Post-installation message definitions for Joomla! 3.2 or later. * * This array contains the message definitions for the Post-installation Messages component added in Joomla! 3.2 and * later versions. Each element is also a hashed array. For the keys used in these message definitions please * @see FOFUtilsInstallscript::addPostInstallationMessage * * @var array */ protected $postInstallationMessages = array(); /** * Joomla! pre-flight event. This runs before Joomla! installs or updates the component. This is our last chance to * tell Joomla! if it should abort the installation. * * @param string $type Installation type (install, update, discover_install) * @param JInstaller $parent Parent object * * @return boolean True to let the installation proceed, false to halt the installation */ public function preflight($type, $parent) { // Check the minimum PHP version if (!empty($this->minimumPHPVersion)) { if (defined('PHP_VERSION')) { $version = PHP_VERSION; } elseif (function_exists('phpversion')) { $version = phpversion(); } else { $version = '5.0.0'; // all bets are off! } if (!version_compare($version, $this->minimumPHPVersion, 'ge')) { $msg = "<p>You need PHP $this->minimumPHPVersion or later to install this component</p>"; if (version_compare(JVERSION, '3.0', 'gt')) { JLog::add($msg, JLog::WARNING, 'jerror'); } else { JError::raiseWarning(100, $msg); } return false; } } // Check the minimum Joomla! version if (!empty($this->minimumJoomlaVersion) && !version_compare(JVERSION, $this->minimumJoomlaVersion, 'ge')) { $msg = "<p>You need Joomla! $this->minimumJoomlaVersion or later to install this component</p>"; if (version_compare(JVERSION, '3.0', 'gt')) { JLog::add($msg, JLog::WARNING, 'jerror'); } else { JError::raiseWarning(100, $msg); } return false; } // Check the maximum Joomla! version if (!empty($this->maximumJoomlaVersion) && !version_compare(JVERSION, $this->maximumJoomlaVersion, 'le')) { $msg = "<p>You need Joomla! $this->maximumJoomlaVersion or earlier to install this component</p>"; if (version_compare(JVERSION, '3.0', 'gt')) { JLog::add($msg, JLog::WARNING, 'jerror'); } else { JError::raiseWarning(100, $msg); } return false; } // Workarounds for notorious JInstaller bugs we submitted patches for but were rejected – yet the bugs were // never fixed. Way to go, Joomla!... if (in_array($type, array('install', 'discover_install'))) { // Bugfix for "Database function returned no error" $this->bugfixDBFunctionReturnedNoError(); } else { // Bugfix for "Can not build admin menus" $this->bugfixCantBuildAdminMenus(); } return true; } /** * Runs after install, update or discover_update. In other words, it executes after Joomla! has finished installing * or updating your component. This is the last chance you've got to perform any additional installations, clean-up, * database updates and similar housekeeping functions. * * @param string $type install, update or discover_update * @param JInstaller $parent Parent object */ public function postflight($type, $parent) { // Install or update database $dbInstaller = new FOFDatabaseInstaller(array( 'dbinstaller_directory' => ($this->schemaXmlPathRelative ? JPATH_ADMINISTRATOR . '/components/' . $this->componentName : '') . '/' . $this->schemaXmlPath )); $dbInstaller->updateSchema(); // Install subextensions $status = $this->installSubextensions($parent); // Install FOF $fofInstallationStatus = $this->installFOF($parent); // Install Akeeba Straper $strapperInstallationStatus = $this->installStrapper($parent); // Make sure menu items are installed $this->_createAdminMenus($parent); // Make sure menu items are published (surprise goal in the 92' by JInstaller wins the cup for "most screwed up // bug in the history of Joomla!") $this->_reallyPublishAdminMenuItems($parent); // Which files should I remove? if ($this->isPaid) { // This is the paid version, only remove the removeFilesAllVersions files $removeFiles = $this->removeFilesAllVersions; } else { // This is the free version, remove the removeFilesAllVersions and removeFilesFree files $removeFiles = array('files' => array(), 'folders' => array()); if (isset($this->removeFilesAllVersions['files'])) { if (isset($this->removeFilesFree['files'])) { $removeFiles['files'] = array_merge($this->removeFilesAllVersions['files'], $this->removeFilesFree['files']); } else { $removeFiles['files'] = $this->removeFilesAllVersions['files']; } } elseif (isset($this->removeFilesFree['files'])) { $removeFiles['files'] = $this->removeFilesFree['files']; } if (isset($this->removeFilesAllVersions['folders'])) { if (isset($this->removeFilesFree['folders'])) { $removeFiles['folders'] = array_merge($this->removeFilesAllVersions['folders'], $this->removeFilesFree['folders']); } else { $removeFiles['folders'] = $this->removeFilesAllVersions['folders']; } } elseif (isset($this->removeFilesFree['folders'])) { $removeFiles['folders'] = $this->removeFilesFree['folders']; } } // Remove obsolete files and folders $this->removeFilesAndFolders($removeFiles); // Copy the CLI files (if any) $this->copyCliFiles($parent); // Show the post-installation page $this->renderPostInstallation($status, $fofInstallationStatus, $strapperInstallationStatus, $parent); // Uninstall obsolete subextensions $uninstall_status = $this->uninstallObsoleteSubextensions($parent); // Clear the FOF cache $platform = FOFPlatform::getInstance(); if (method_exists($platform, 'clearCache')) { FOFPlatform::getInstance()->clearCache(); } // Make sure the Joomla! menu structure is correct $this->_rebuildMenu(); // Add post-installation messages on Joomla! 3.2 and later $this->_applyPostInstallationMessages(); } /** * Runs on uninstallation * * @param JInstaller $parent The parent object */ public function uninstall($parent) { // Uninstall database $dbInstaller = new FOFDatabaseInstaller(array( 'dbinstaller_directory' => ($this->schemaXmlPathRelative ? JPATH_ADMINISTRATOR . '/components/' . $this->componentName : '') . '/' . $this->schemaXmlPath )); $dbInstaller->removeSchema(); // Uninstall modules and plugins $status = $this->uninstallSubextensions($parent); // Uninstall post-installation messages on Joomla! 3.2 and later $this->uninstallPostInstallationMessages(); // Show the post-uninstallation page $this->renderPostUninstallation($status, $parent); } /** * Copies the CLI scripts into Joomla!'s cli directory * * @param JInstaller $parent */ protected function copyCliFiles($parent) { $src = $parent->getParent()->getPath('source'); foreach ($this->cliScriptFiles as $script) { if (JFile::exists(JPATH_ROOT . '/cli/' . $script)) { JFile::delete(JPATH_ROOT . '/cli/' . $script); } if (JFile::exists($src . '/' . $this->cliSourcePath . '/' . $script)) { JFile::copy($src . '/' . $this->cliSourcePath . '/' . $script, JPATH_ROOT . '/cli/' . $script); } } } /** * Renders the message after installing or upgrading the component */ protected function renderPostInstallation($status, $fofInstallationStatus, $strapperInstallationStatus, $parent) { $rows = 0; ?> <table class="adminlist table table-striped" width="100%"> <thead> <tr> <th class="title" colspan="2">Extension</th> <th width="30%">Status</th> </tr> </thead> <tfoot> <tr> <td colspan="3"></td> </tr> </tfoot> <tbody> <tr class="row<?php echo($rows++ % 2); ?>"> <td class="key" colspan="2"><?php echo $this->componentTitle ?></td> <td><strong style="color: green">Installed</strong></td> </tr> <?php if ($fofInstallationStatus['required']): ?> <tr class="row<?php echo($rows++ % 2); ?>"> <td class="key" colspan="2"> <strong>Framework on Framework (FOF) <?php echo $fofInstallationStatus['version'] ?></strong> [<?php echo $fofInstallationStatus['date'] ?>] </td> <td><strong> <span style="color: <?php echo $fofInstallationStatus['required'] ? ($fofInstallationStatus['installed'] ? 'green' : 'red') : '#660' ?>; font-weight: bold;"> <?php echo $fofInstallationStatus['required'] ? ($fofInstallationStatus['installed'] ? 'Installed' : 'Not Installed') : 'Already up-to-date'; ?> </span> </strong></td> </tr> <?php endif; ?> <?php if ($strapperInstallationStatus['required']): ?> <tr class="row<?php echo($rows++ % 2); ?>"> <td class="key" colspan="2"> <strong>Akeeba Strapper <?php echo $strapperInstallationStatus['version'] ?></strong> [<?php echo $strapperInstallationStatus['date'] ?>] </td> <td><strong> <span style="color: <?php echo $strapperInstallationStatus['required'] ? ($strapperInstallationStatus['installed'] ? 'green' : 'red') : '#660' ?>; font-weight: bold;"> <?php echo $strapperInstallationStatus['required'] ? ($strapperInstallationStatus['installed'] ? 'Installed' : 'Not Installed') : 'Already up-to-date'; ?> </span> </strong></td> </tr> <?php endif; ?> <?php if (count($status->modules)) : ?> <tr> <th>Module</th> <th>Client</th> <th></th> </tr> <?php foreach ($status->modules as $module) : ?> <tr class="row<?php echo($rows++ % 2); ?>"> <td class="key"><?php echo $module['name']; ?></td> <td class="key"><?php echo ucfirst($module['client']); ?></td> <td><strong style="color: <?php echo ($module['result']) ? "green" : "red" ?>"><?php echo ($module['result']) ? 'Installed' : 'Not installed'; ?></strong> </td> </tr> <?php endforeach; ?> <?php endif; ?> <?php if (count($status->plugins)) : ?> <tr> <th>Plugin</th> <th>Group</th> <th></th> </tr> <?php foreach ($status->plugins as $plugin) : ?> <tr class="row<?php echo($rows++ % 2); ?>"> <td class="key"><?php echo ucfirst($plugin['name']); ?></td> <td class="key"><?php echo ucfirst($plugin['group']); ?></td> <td><strong style="color: <?php echo ($plugin['result']) ? "green" : "red" ?>"><?php echo ($plugin['result']) ? 'Installed' : 'Not installed'; ?></strong> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> <?php } /** * Renders the message after uninstalling the component */ protected function renderPostUninstallation($status, $parent) { $rows = 1; ?> <table class="adminlist table table-striped" width="100%"> <thead> <tr> <th class="title" colspan="2"><?php echo JText::_('Extension'); ?></th> <th width="30%"><?php echo JText::_('Status'); ?></th> </tr> </thead> <tfoot> <tr> <td colspan="3"></td> </tr> </tfoot> <tbody> <tr class="row<?php echo($rows++ % 2); ?>"> <td class="key" colspan="2"><?php echo $this->componentTitle; ?></td> <td><strong style="color: green">Removed</strong></td> </tr> <?php if (count($status->modules)) : ?> <tr> <th>Module</th> <th>Client</th> <th></th> </tr> <?php foreach ($status->modules as $module) : ?> <tr class="row<?php echo($rows++ % 2); ?>"> <td class="key"><?php echo $module['name']; ?></td> <td class="key"><?php echo ucfirst($module['client']); ?></td> <td><strong style="color: <?php echo ($module['result']) ? "green" : "red" ?>"><?php echo ($module['result']) ? 'Removed' : 'Not removed'; ?></strong> </td> </tr> <?php endforeach; ?> <?php endif; ?> <?php if (count($status->plugins)) : ?> <tr> <th>Plugin</th> <th>Group</th> <th></th> </tr> <?php foreach ($status->plugins as $plugin) : ?> <tr class="row<?php echo($rows++ % 2); ?>"> <td class="key"><?php echo ucfirst($plugin['name']); ?></td> <td class="key"><?php echo ucfirst($plugin['group']); ?></td> <td><strong style="color: <?php echo ($plugin['result']) ? "green" : "red" ?>"><?php echo ($plugin['result']) ? 'Removed' : 'Not removed'; ?></strong> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> <?php } /** * Bugfix for "DB function returned no error" */ protected function bugfixDBFunctionReturnedNoError() { $db = JFactory::getDbo(); // Fix broken #__assets records $query = $db->getQuery(true); $query->select('id') ->from('#__assets') ->where($db->qn('name') . ' = ' . $db->q($this->componentName)); $db->setQuery($query); try { $ids = $db->loadColumn(); } catch (Exception $exc) { return; } if (!empty($ids)) { foreach ($ids as $id) { $query = $db->getQuery(true); $query->delete('#__assets') ->where($db->qn('id') . ' = ' . $db->q($id)); $db->setQuery($query); try { $db->execute(); } catch (Exception $exc) { // Nothing } } } // Fix broken #__extensions records $query = $db->getQuery(true); $query->select('extension_id') ->from('#__extensions') ->where($db->qn('element') . ' = ' . $db->q($this->componentName)); $db->setQuery($query); $ids = $db->loadColumn(); if (!empty($ids)) { foreach ($ids as $id) { $query = $db->getQuery(true); $query->delete('#__extensions') ->where($db->qn('extension_id') . ' = ' . $db->q($id)); $db->setQuery($query); try { $db->execute(); } catch (Exception $exc) { // Nothing } } } // Fix broken #__menu records $query = $db->getQuery(true); $query->select('id') ->from('#__menu') ->where($db->qn('type') . ' = ' . $db->q('component')) ->where($db->qn('menutype') . ' = ' . $db->q('main')) ->where($db->qn('link') . ' LIKE ' . $db->q('index.php?option=' . $this->componentName)); $db->setQuery($query); $ids = $db->loadColumn(); if (!empty($ids)) { foreach ($ids as $id) { $query = $db->getQuery(true); $query->delete('#__menu') ->where($db->qn('id') . ' = ' . $db->q($id)); $db->setQuery($query); try { $db->execute(); } catch (Exception $exc) { // Nothing } } } } /** * Joomla! 1.6+ bugfix for "Can not build admin menus" */ protected function bugfixCantBuildAdminMenus() { $db = JFactory::getDbo(); // If there are multiple #__extensions record, keep one of them $query = $db->getQuery(true); $query->select('extension_id') ->from('#__extensions') ->where($db->qn('element') . ' = ' . $db->q($this->componentName)); $db->setQuery($query); try { $ids = $db->loadColumn(); } catch (Exception $exc) { return; } if (count($ids) > 1) { asort($ids); $extension_id = array_shift($ids); // Keep the oldest id foreach ($ids as $id) { $query = $db->getQuery(true); $query->delete('#__extensions') ->where($db->qn('extension_id') . ' = ' . $db->q($id)); $db->setQuery($query); try { $db->execute(); } catch (Exception $exc) { // Nothing } } } // If there are multiple assets records, delete all except the oldest one $query = $db->getQuery(true); $query->select('id') ->from('#__assets') ->where($db->qn('name') . ' = ' . $db->q($this->componentName)); $db->setQuery($query); $ids = $db->loadObjectList(); if (count($ids) > 1) { asort($ids); $asset_id = array_shift($ids); // Keep the oldest id foreach ($ids as $id) { $query = $db->getQuery(true); $query->delete('#__assets') ->where($db->qn('id') . ' = ' . $db->q($id)); $db->setQuery($query); try { $db->execute(); } catch (Exception $exc) { // Nothing } } } // Remove #__menu records for good measure! –– I think this is not necessary and causes the menu item to // disappear on extension update. /** $query = $db->getQuery(true); $query->select('id') ->from('#__menu') ->where($db->qn('type') . ' = ' . $db->q('component')) ->where($db->qn('menutype') . ' = ' . $db->q('main')) ->where($db->qn('link') . ' LIKE ' . $db->q('index.php?option=' . $this->componentName)); $db->setQuery($query); try { $ids1 = $db->loadColumn(); } catch (Exception $exc) { $ids1 = array(); } if (empty($ids1)) { $ids1 = array(); } $query = $db->getQuery(true); $query->select('id') ->from('#__menu') ->where($db->qn('type') . ' = ' . $db->q('component')) ->where($db->qn('menutype') . ' = ' . $db->q('main')) ->where($db->qn('link') . ' LIKE ' . $db->q('index.php?option=' . $this->componentName . '&%')); $db->setQuery($query); try { $ids2 = $db->loadColumn(); } catch (Exception $exc) { $ids2 = array(); } if (empty($ids2)) { $ids2 = array(); } $ids = array_merge($ids1, $ids2); if (!empty($ids)) { foreach ($ids as $id) { $query = $db->getQuery(true); $query->delete('#__menu') ->where($db->qn('id') . ' = ' . $db->q($id)); $db->setQuery($query); try { $db->execute(); } catch (Exception $exc) { // Nothing } } } /**/ } /** * Installs subextensions (modules, plugins) bundled with the main extension * * @param JInstaller $parent * * @return JObject The subextension installation status */ protected function installSubextensions($parent) { $src = $parent->getParent()->getPath('source'); $db = JFactory::getDbo(); $status = new JObject(); $status->modules = array(); $status->plugins = array(); // Modules installation if (isset($this->installation_queue['modules']) && count($this->installation_queue['modules'])) { foreach ($this->installation_queue['modules'] as $folder => $modules) { if (count($modules)) { foreach ($modules as $module => $modulePreferences) { // Install the module if (empty($folder)) { $folder = 'site'; } $path = "$src/" . $this->modulesSourcePath . "/$folder/$module"; if (!is_dir($path)) { $path = "$src/" . $this->modulesSourcePath . "/$folder/mod_$module"; } if (!is_dir($path)) { $path = "$src/" . $this->modulesSourcePath . "/$module"; } if (!is_dir($path)) { $path = "$src/" . $this->modulesSourcePath . "/mod_$module"; } if (!is_dir($path)) { continue; } // Was the module already installed? $sql = $db->getQuery(true) ->select('COUNT(*)') ->from('#__modules') ->where($db->qn('module') . ' = ' . $db->q('mod_' . $module)); $db->setQuery($sql); try { $count = $db->loadResult(); } catch (Exception $exc) { $count = 0; } $installer = new JInstaller; $result = $installer->install($path); $status->modules[] = array( 'name' => 'mod_' . $module, 'client' => $folder, 'result' => $result ); // Modify where it's published and its published state if (!$count) { // A. Position and state list($modulePosition, $modulePublished) = $modulePreferences; $sql = $db->getQuery(true) ->update($db->qn('#__modules')) ->set($db->qn('position') . ' = ' . $db->q($modulePosition)) ->where($db->qn('module') . ' = ' . $db->q('mod_' . $module)); if ($modulePublished) { $sql->set($db->qn('published') . ' = ' . $db->q('1')); } $db->setQuery($sql); try { $db->execute(); } catch (Exception $exc) { // Nothing } // B. Change the ordering of back-end modules to 1 + max ordering if ($folder == 'admin') { try { $query = $db->getQuery(true); $query->select('MAX(' . $db->qn('ordering') . ')') ->from($db->qn('#__modules')) ->where($db->qn('position') . '=' . $db->q($modulePosition)); $db->setQuery($query); $position = $db->loadResult(); $position++; $query = $db->getQuery(true); $query->update($db->qn('#__modules')) ->set($db->qn('ordering') . ' = ' . $db->q($position)) ->where($db->qn('module') . ' = ' . $db->q('mod_' . $module)); $db->setQuery($query); $db->execute(); } catch (Exception $exc) { // Nothing } } // C. Link to all pages try { $query = $db->getQuery(true); $query->select('id')->from($db->qn('#__modules')) ->where($db->qn('module') . ' = ' . $db->q('mod_' . $module)); $db->setQuery($query); $moduleid = $db->loadResult(); $query = $db->getQuery(true); $query->select('*')->from($db->qn('#__modules_menu')) ->where($db->qn('moduleid') . ' = ' . $db->q($moduleid)); $db->setQuery($query); $assignments = $db->loadObjectList(); $isAssigned = !empty($assignments); if (!$isAssigned) { $o = (object)array( 'moduleid' => $moduleid, 'menuid' => 0 ); $db->insertObject('#__modules_menu', $o); } } catch (Exception $exc) { // Nothing } } } } } } // Plugins installation if (isset($this->installation_queue['plugins']) && count($this->installation_queue['plugins'])) { foreach ($this->installation_queue['plugins'] as $folder => $plugins) { if (count($plugins)) { foreach ($plugins as $plugin => $published) { $path = "$src/" . $this->pluginsSourcePath . "/$folder/$plugin"; if (!is_dir($path)) { $path = "$src/" . $this->pluginsSourcePath . "/$folder/plg_$plugin"; } if (!is_dir($path)) { $path = "$src/" . $this->pluginsSourcePath . "/$plugin"; } if (!is_dir($path)) { $path = "$src/" . $this->pluginsSourcePath . "/plg_$plugin"; } if (!is_dir($path)) { continue; } // Was the plugin already installed? $query = $db->getQuery(true) ->select('COUNT(*)') ->from($db->qn('#__extensions')) ->where($db->qn('element') . ' = ' . $db->q($plugin)) ->where($db->qn('folder') . ' = ' . $db->q($folder)); $db->setQuery($query); try { $count = $db->loadResult(); } catch (Exception $exc) { $count = 0; } $installer = new JInstaller; $result = $installer->install($path); $status->plugins[] = array('name' => 'plg_' . $plugin, 'group' => $folder, 'result' => $result); if ($published && !$count) { $query = $db->getQuery(true) ->update($db->qn('#__extensions')) ->set($db->qn('enabled') . ' = ' . $db->q('1')) ->where($db->qn('element') . ' = ' . $db->q($plugin)) ->where($db->qn('folder') . ' = ' . $db->q($folder)); $db->setQuery($query); try { $db->execute(); } catch (Exception $exc) { // Nothing } } } } } } // Clear com_modules and com_plugins cache (needed when we alter module/plugin state) FOFUtilsCacheCleaner::clearPluginsAndModulesCache(); return $status; } /** * Uninstalls subextensions (modules, plugins) bundled with the main extension * * @param JInstaller $parent The parent object * * @return stdClass The subextension uninstallation status */ protected function uninstallSubextensions($parent) { $db = JFactory::getDBO(); $status = new stdClass(); $status->modules = array(); $status->plugins = array(); $src = $parent->getParent()->getPath('source'); // Modules uninstallation if (isset($this->installation_queue['modules']) && count($this->installation_queue['modules'])) { foreach ($this->installation_queue['modules'] as $folder => $modules) { if (count($modules)) { foreach ($modules as $module => $modulePreferences) { // Find the module ID $sql = $db->getQuery(true) ->select($db->qn('extension_id')) ->from($db->qn('#__extensions')) ->where($db->qn('element') . ' = ' . $db->q('mod_' . $module)) ->where($db->qn('type') . ' = ' . $db->q('module')); $db->setQuery($sql); try { $id = $db->loadResult(); } catch (Exception $exc) { $id = 0; } // Uninstall the module if ($id) { $installer = new JInstaller; $result = $installer->uninstall('module', $id, 1); $status->modules[] = array( 'name' => 'mod_' . $module, 'client' => $folder, 'result' => $result ); } } } } } // Plugins uninstallation if (isset($this->installation_queue['plugins']) && count($this->installation_queue['plugins'])) { foreach ($this->installation_queue['plugins'] as $folder => $plugins) { if (count($plugins)) { foreach ($plugins as $plugin => $published) { $sql = $db->getQuery(true) ->select($db->qn('extension_id')) ->from($db->qn('#__extensions')) ->where($db->qn('type') . ' = ' . $db->q('plugin')) ->where($db->qn('element') . ' = ' . $db->q($plugin)) ->where($db->qn('folder') . ' = ' . $db->q($folder)); $db->setQuery($sql); try { $id = $db->loadResult(); } catch (Exception $exc) { $id = 0; } if ($id) { $installer = new JInstaller; $result = $installer->uninstall('plugin', $id, 1); $status->plugins[] = array( 'name' => 'plg_' . $plugin, 'group' => $folder, 'result' => $result ); } } } } } // Clear com_modules and com_plugins cache (needed when we alter module/plugin state) FOFUtilsCacheCleaner::clearPluginsAndModulesCache(); return $status; } /** * Removes obsolete files and folders * * @param array $removeList The files and directories to remove */ protected function removeFilesAndFolders($removeList) { // Remove files if (isset($removeList['files']) && !empty($removeList['files'])) { foreach ($removeList['files'] as $file) { $f = JPATH_ROOT . '/' . $file; if (!JFile::exists($f)) { continue; } JFile::delete($f); } } // Remove folders if (isset($removeList['folders']) && !empty($removeList['folders'])) { foreach ($removeList['folders'] as $folder) { $f = JPATH_ROOT . '/' . $folder; if (!JFolder::exists($f)) { continue; } JFolder::delete($f); } } } /** * Installs FOF if necessary * * @param JInstaller $parent The parent object * * @return array The installation status */ protected function installFOF($parent) { // Get the source path $src = $parent->getParent()->getPath('source'); $source = $src . '/' . $this->fofSourcePath; if (!JFolder::exists($source)) { return array( 'required' => false, 'installed' => false, 'version' => '0.0.0', 'date' => '2011-01-01', ); } // Get the target path if (!defined('JPATH_LIBRARIES')) { $target = JPATH_ROOT . '/libraries/fof'; } else { $target = JPATH_LIBRARIES . '/fof'; } // Do I have to install FOF? $haveToInstallFOF = false; if (!JFolder::exists($target)) { // FOF is not installed; install now $haveToInstallFOF = true; } else { // FOF is already installed; check the version $fofVersion = array(); if (JFile::exists($target . '/version.txt')) { $rawData = JFile::read($target . '/version.txt'); $rawData = ($rawData === false) ? "0.0.0\n2011-01-01\n" : $rawData; $info = explode("\n", $rawData); $fofVersion['installed'] = array( 'version' => trim($info[0]), 'date' => new JDate(trim($info[1])) ); } else { $fofVersion['installed'] = array( 'version' => '0.0', 'date' => new JDate('2011-01-01') ); } $rawData = @file_get_contents($source . '/version.txt'); $rawData = ($rawData === false) ? "0.0.0\n2011-01-01\n" : $rawData; $info = explode("\n", $rawData); $fofVersion['package'] = array( 'version' => trim($info[0]), 'date' => new JDate(trim($info[1])) ); $haveToInstallFOF = $fofVersion['package']['date']->toUNIX() > $fofVersion['installed']['date']->toUNIX(); } $installedFOF = false; if ($haveToInstallFOF) { $versionSource = 'package'; $installer = new JInstaller; $installedFOF = $installer->install($source); } else { $versionSource = 'installed'; } if (!isset($fofVersion)) { $fofVersion = array(); if (JFile::exists($target . '/version.txt')) { $rawData = @file_get_contents($source . '/version.txt'); $rawData = ($rawData === false) ? "0.0.0\n2011-01-01\n" : $rawData; $info = explode("\n", $rawData); $fofVersion['installed'] = array( 'version' => trim($info[0]), 'date' => new JDate(trim($info[1])) ); } else { $fofVersion['installed'] = array( 'version' => '0.0', 'date' => new JDate('2011-01-01') ); } $rawData = @file_get_contents($source . '/version.txt'); $rawData = ($rawData === false) ? "0.0.0\n2011-01-01\n" : $rawData; $info = explode("\n", $rawData); $fofVersion['package'] = array( 'version' => trim($info[0]), 'date' => new JDate(trim($info[1])) ); $versionSource = 'installed'; } if (!($fofVersion[$versionSource]['date'] instanceof JDate)) { $fofVersion[$versionSource]['date'] = new JDate(); } return array( 'required' => $haveToInstallFOF, 'installed' => $installedFOF, 'version' => $fofVersion[$versionSource]['version'], 'date' => $fofVersion[$versionSource]['date']->format('Y-m-d'), ); } /** * Installs Akeeba Strapper if necessary * * @param JInstaller $parent The parent object * * @return array The installation status */ protected function installStrapper($parent) { $src = $parent->getParent()->getPath('source'); $source = $src . '/' . $this->strapperSourcePath; $target = JPATH_ROOT . '/media/akeeba_strapper'; if (!JFolder::exists($source)) { return array( 'required' => false, 'installed' => false, 'version' => '0.0.0', 'date' => '2011-01-01', ); } $haveToInstallStrapper = false; if (!JFolder::exists($target)) { $haveToInstallStrapper = true; } else { $strapperVersion = array(); if (JFile::exists($target . '/version.txt')) { $rawData = JFile::read($target . '/version.txt'); $rawData = ($rawData === false) ? "0.0.0\n2011-01-01\n" : $rawData; $info = explode("\n", $rawData); $strapperVersion['installed'] = array( 'version' => trim($info[0]), 'date' => new JDate(trim($info[1])) ); } else { $strapperVersion['installed'] = array( 'version' => '0.0', 'date' => new JDate('2011-01-01') ); } $rawData = JFile::read($source . '/version.txt'); $rawData = ($rawData === false) ? "0.0.0\n2011-01-01\n" : $rawData; $info = explode("\n", $rawData); $strapperVersion['package'] = array( 'version' => trim($info[0]), 'date' => new JDate(trim($info[1])) ); $haveToInstallStrapper = $strapperVersion['package']['date']->toUNIX() > $strapperVersion['installed']['date']->toUNIX(); } $installedStraper = false; if ($haveToInstallStrapper) { $versionSource = 'package'; $installer = new JInstaller; $installedStraper = $installer->install($source); } else { $versionSource = 'installed'; } if (!isset($strapperVersion)) { $strapperVersion = array(); if (JFile::exists($target . '/version.txt')) { $rawData = JFile::read($target . '/version.txt'); $rawData = ($rawData === false) ? "0.0.0\n2011-01-01\n" : $rawData; $info = explode("\n", $rawData); $strapperVersion['installed'] = array( 'version' => trim($info[0]), 'date' => new JDate(trim($info[1])) ); } else { $strapperVersion['installed'] = array( 'version' => '0.0', 'date' => new JDate('2011-01-01') ); } $rawData = JFile::read($source . '/version.txt'); $rawData = ($rawData === false) ? "0.0.0\n2011-01-01\n" : $rawData; $info = explode("\n", $rawData); $strapperVersion['package'] = array( 'version' => trim($info[0]), 'date' => new JDate(trim($info[1])) ); $versionSource = 'installed'; } if (!($strapperVersion[$versionSource]['date'] instanceof JDate)) { $strapperVersion[$versionSource]['date'] = new JDate(); } return array( 'required' => $haveToInstallStrapper, 'installed' => $installedStraper, 'version' => $strapperVersion[$versionSource]['version'], 'date' => $strapperVersion[$versionSource]['date']->format('Y-m-d'), ); } /** * Uninstalls obsolete subextensions (modules, plugins) bundled with the main extension * * @param JInstaller $parent The parent object * * @return stdClass The subextension uninstallation status */ protected function uninstallObsoleteSubextensions($parent) { JLoader::import('joomla.installer.installer'); $db = JFactory::getDBO(); $status = new stdClass(); $status->modules = array(); $status->plugins = array(); $src = $parent->getParent()->getPath('source'); // Modules uninstallation if (isset($this->uninstallation_queue['modules']) && count($this->uninstallation_queue['modules'])) { foreach ($this->uninstallation_queue['modules'] as $folder => $modules) { if (count($modules)) { foreach ($modules as $module) { // Find the module ID $sql = $db->getQuery(true) ->select($db->qn('extension_id')) ->from($db->qn('#__extensions')) ->where($db->qn('element') . ' = ' . $db->q('mod_' . $module)) ->where($db->qn('type') . ' = ' . $db->q('module')); $db->setQuery($sql); $id = $db->loadResult(); // Uninstall the module if ($id) { $installer = new JInstaller; $result = $installer->uninstall('module', $id, 1); $status->modules[] = array( 'name' => 'mod_' . $module, 'client' => $folder, 'result' => $result ); } } } } } // Plugins uninstallation if (isset($this->uninstallation_queue['plugins']) && count($this->uninstallation_queue['plugins'])) { foreach ($this->uninstallation_queue['plugins'] as $folder => $plugins) { if (count($plugins)) { foreach ($plugins as $plugin) { $sql = $db->getQuery(true) ->select($db->qn('extension_id')) ->from($db->qn('#__extensions')) ->where($db->qn('type') . ' = ' . $db->q('plugin')) ->where($db->qn('element') . ' = ' . $db->q($plugin)) ->where($db->qn('folder') . ' = ' . $db->q($folder)); $db->setQuery($sql); $id = $db->loadResult(); if ($id) { $installer = new JInstaller; $result = $installer->uninstall('plugin', $id, 1); $status->plugins[] = array( 'name' => 'plg_' . $plugin, 'group' => $folder, 'result' => $result ); } } } } } return $status; } /** * @param JInstallerAdapterComponent $parent * * @return bool * * @throws Exception When the Joomla! menu is FUBAR */ private function _createAdminMenus($parent) { $db = $parent->getParent()->getDbo(); /** @var JTableMenu $table */ $table = JTable::getInstance('menu'); $option = $parent->get('element'); // If a component exists with this option in the table then we don't need to add menus $query = $db->getQuery(true) ->select('m.id, e.extension_id') ->from('#__menu AS m') ->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id') ->where('m.parent_id = 1') ->where('m.client_id = 1') ->where('e.element = ' . $db->quote($option)); $db->setQuery($query); $componentrow = $db->loadObject(); // Check if menu items exist if ($componentrow) { // @todo Return if the menu item already exists to save some time //return true; } // Let's find the extension id $query->clear() ->select('e.extension_id') ->from('#__extensions AS e') ->where('e.element = ' . $db->quote($option)); $db->setQuery($query); $component_id = $db->loadResult(); // Ok, now its time to handle the menus. Start with the component root menu, then handle submenus. $menuElement = $parent->get('manifest')->administration->menu; // We need to insert the menu item as the last child of Joomla!'s menu root node. By default this is the // menu item with ID=1. However, some crappy upgrade scripts enjoy screwing it up. Hey, ho, the workaround // way I go. $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->where($db->qn('id') . ' = ' . $db->q(1)); $rootItemId = $db->setQuery($query)->loadResult(); if (is_null($rootItemId)) { // Guess what? The Problem has happened. Let's find the root node by title. $rootItemId = null; $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->where($db->qn('title') . ' = ' . $db->q('Menu_Item_Root')); $rootItemId = $db->setQuery($query, 0, 1)->loadResult(); } if (is_null($rootItemId)) { // For crying out loud, did that idiot changed the title too?! Let's find it by alias. $rootItemId = null; $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->where($db->qn('alias') . ' = ' . $db->q('root')); $rootItemId = $db->setQuery($query, 0, 1)->loadResult(); } if (is_null($rootItemId)) { // Dude. Dude! Duuuuuuude! The alias is screwed up, too?! Find it by component ID. $rootItemId = null; $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->where($db->qn('component_id') . ' = ' . $db->q('0')); $rootItemId = $db->setQuery($query, 0, 1)->loadResult(); } if (is_null($rootItemId)) { // Your site is more of a "shite" than a "site". Let's try with minimum lft value. $rootItemId = null; $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->order($db->qn('lft') . ' ASC'); $rootItemId = $db->setQuery($query, 0, 1)->loadResult(); } if (is_null($rootItemId)) { // I quit. Your site is broken. What the hell are you doing with it? I'll just throw an error. throw new Exception("Your site is broken. There is no root menu item. As a result it is impossible to create menu items. The installation of this component has failed. Please fix your database and retry!", 500); } if ($menuElement) { $data = array(); $data['menutype'] = 'main'; $data['client_id'] = 1; $data['title'] = (string)trim($menuElement); $data['alias'] = (string)$menuElement; $data['link'] = 'index.php?option=' . $option; $data['type'] = 'component'; $data['published'] = 0; $data['parent_id'] = 1; $data['component_id'] = $component_id; $data['img'] = ((string)$menuElement->attributes()->img) ? (string)$menuElement->attributes()->img : 'class:component'; $data['home'] = 0; } // No menu element was specified, Let's make a generic menu item else { $data = array(); $data['menutype'] = 'main'; $data['client_id'] = 1; $data['title'] = $option; $data['alias'] = $option; $data['link'] = 'index.php?option=' . $option; $data['type'] = 'component'; $data['published'] = 0; $data['parent_id'] = 1; $data['component_id'] = $component_id; $data['img'] = 'class:component'; $data['home'] = 0; } try { $table->setLocation($rootItemId, 'last-child'); } catch (InvalidArgumentException $e) { JLog::add($e->getMessage(), JLog::WARNING, 'jerror'); return false; } if (!$table->bind($data) || !$table->check() || !$table->store()) { // The menu item already exists. Delete it and retry instead of throwing an error. $query->clear() ->select('id') ->from('#__menu') ->where('menutype = ' . $db->quote('main')) ->where('client_id = 1') ->where('link = ' . $db->quote('index.php?option=' . $option)) ->where('type = ' . $db->quote('component')) ->where('parent_id = 1') ->where('home = 0'); $db->setQuery($query); $menu_ids_level1 = $db->loadColumn(); if (empty($menu_ids_level1)) { // Oops! Could not get the menu ID. Go back and rollback changes. JError::raiseWarning(1, $table->getError()); return false; } else { $ids = implode(',', $menu_ids_level1); $query->clear() ->select('id') ->from('#__menu') ->where('menutype = ' . $db->quote('main')) ->where('client_id = 1') ->where('type = ' . $db->quote('component')) ->where('parent_id in (' . $ids . ')') ->where('level = 2') ->where('home = 0'); $db->setQuery($query); $menu_ids_level2 = $db->loadColumn(); $ids = implode(',', array_merge($menu_ids_level1, $menu_ids_level2)); // Remove the old menu item $query->clear() ->delete('#__menu') ->where('id in (' . $ids . ')'); $db->setQuery($query); $db->query(); // Retry creating the menu item $table->setLocation($rootItemId, 'last-child'); if (!$table->bind($data) || !$table->check() || !$table->store()) { // Install failed, warn user and rollback changes JError::raiseWarning(1, $table->getError()); return false; } } } /* * Since we have created a menu item, we add it to the installation step stack * so that if we have to rollback the changes we can undo it. */ $parent->getParent()->pushStep(array('type' => 'menu', 'id' => $component_id)); /* * Process SubMenus */ if (!$parent->get('manifest')->administration->submenu) { return true; } $parent_id = $table->id; foreach ($parent->get('manifest')->administration->submenu->menu as $child) { $data = array(); $data['menutype'] = 'main'; $data['client_id'] = 1; $data['title'] = (string)trim($child); $data['alias'] = (string)$child; $data['type'] = 'component'; $data['published'] = 0; $data['parent_id'] = $parent_id; $data['component_id'] = $component_id; $data['img'] = ((string)$child->attributes()->img) ? (string)$child->attributes()->img : 'class:component'; $data['home'] = 0; // Set the sub menu link if ((string)$child->attributes()->link) { $data['link'] = 'index.php?' . $child->attributes()->link; } else { $request = array(); if ((string)$child->attributes()->act) { $request[] = 'act=' . $child->attributes()->act; } if ((string)$child->attributes()->task) { $request[] = 'task=' . $child->attributes()->task; } if ((string)$child->attributes()->controller) { $request[] = 'controller=' . $child->attributes()->controller; } if ((string)$child->attributes()->view) { $request[] = 'view=' . $child->attributes()->view; } if ((string)$child->attributes()->layout) { $request[] = 'layout=' . $child->attributes()->layout; } if ((string)$child->attributes()->sub) { $request[] = 'sub=' . $child->attributes()->sub; } $qstring = (count($request)) ? '&' . implode('&', $request) : ''; $data['link'] = 'index.php?option=' . $option . $qstring; } $table = JTable::getInstance('menu'); try { $table->setLocation($parent_id, 'last-child'); } catch (InvalidArgumentException $e) { return false; } if (!$table->bind($data) || !$table->check() || !$table->store()) { // Install failed, rollback changes return false; } /* * Since we have created a menu item, we add it to the installation step stack * so that if we have to rollback the changes we can undo it. */ $parent->getParent()->pushStep(array('type' => 'menu', 'id' => $component_id)); } return true; } /** * Make sure the Component menu items are really published! * * @param JInstallerAdapterComponent $parent * * @return bool */ private function _reallyPublishAdminMenuItems($parent) { $db = $parent->getParent()->getDbo(); $option = $parent->get('element'); $query = $db->getQuery(true) ->update('#__menu AS m') ->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id') ->set($db->qn('published') . ' = ' . $db->q(1)) ->where('m.parent_id = 1') ->where('m.client_id = 1') ->where('e.element = ' . $db->quote($option)); $db->setQuery($query); try { $db->execute(); } catch (Exception $e) { // If it fails, it fails. Who cares. } } /** * Tells Joomla! to rebuild its menu structure to make triple-sure that the Components menu items really do exist * in the correct place and can really be rendered. */ private function _rebuildMenu() { /** @var JTableMenu $table */ $table = JTable::getInstance('menu'); $db = $table->getDbo(); // We need to rebuild the menu based on its root item. By default this is the menu item with ID=1. However, some // crappy upgrade scripts enjoy screwing it up. Hey, ho, the workaround way I go. $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->where($db->qn('id') . ' = ' . $db->q(1)); $rootItemId = $db->setQuery($query)->loadResult(); if (is_null($rootItemId)) { // Guess what? The Problem has happened. Let's find the root node by title. $rootItemId = null; $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->where($db->qn('title') . ' = ' . $db->q('Menu_Item_Root')); $rootItemId = $db->setQuery($query, 0, 1)->loadResult(); } if (is_null($rootItemId)) { // For crying out loud, did that idiot changed the title too?! Let's find it by alias. $rootItemId = null; $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->where($db->qn('alias') . ' = ' . $db->q('root')); $rootItemId = $db->setQuery($query, 0, 1)->loadResult(); } if (is_null($rootItemId)) { // Dude. Dude! Duuuuuuude! The alias is screwed up, too?! Find it by component ID. $rootItemId = null; $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->where($db->qn('component_id') . ' = ' . $db->q('0')); $rootItemId = $db->setQuery($query, 0, 1)->loadResult(); } if (is_null($rootItemId)) { // Your site is more of a "shite" than a "site". Let's try with minimum lft value. $rootItemId = null; $query = $db->getQuery(true) ->select($db->qn('id')) ->from($db->qn('#__menu')) ->order($db->qn('lft') . ' ASC'); $rootItemId = $db->setQuery($query, 0, 1)->loadResult(); } if (is_null($rootItemId)) { // I quit. Your site is broken. return false; } $table->rebuild($rootItemId); } /** * Adds or updates a post-installation message (PIM) definition for Joomla! 3.2 or later. You can use this in your * post-installation script using this code: * * The $options array contains the following mandatory keys: * * extension_id The numeric ID of the extension this message is for (see the #__extensions table) * * type One of message, link or action. Their meaning is: * message Informative message. The user can dismiss it. * link The action button links to a URL. The URL is defined in the action parameter. * action A PHP action takes place when the action button is clicked. You need to specify the * action_file (RAD path to the PHP file) and action (PHP function name) keys. See * below for more information. * * title_key The JText language key for the title of this PIM * Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_TITLE * * description_key The JText language key for the main body (description) of this PIM * Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_DESCRIPTION * * action_key The JText language key for the action button. Ignored and not required when type=message * Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_ACTION * * language_extension The extension name which holds the language keys used above. For example, com_foobar, * mod_something, plg_system_whatever, tpl_mytemplate * * language_client_id Should we load the front-end (0) or back-end (1) language keys? * * version_introduced Which was the version of your extension where this message appeared for the first time? * Example: 3.2.1 * * enabled Must be 1 for this message to be enabled. If you omit it, it defaults to 1. * * condition_file The RAD path to a PHP file containing a PHP function which determines whether this message * should be shown to the user. @see FOFTemplateUtils::parsePath() for RAD path format. Joomla! * will include this file before calling the condition_method. * Example: admin://components/com_foobar/helpers/postinstall.php * * condition_method The name of a PHP function which will be used to determine whether to show this message to * the user. This must be a simple PHP user function (not a class method, static method etc) * which returns true to show the message and false to hide it. This function is defined in the * condition_file. * Example: com_foobar_postinstall_messageone_condition * * When type=message no additional keys are required. * * When type=link the following additional keys are required: * * action The URL which will open when the user clicks on the PIM's action button * Example: index.php?option=com_foobar&view=tools&task=installSampleData * * Then type=action the following additional keys are required: * * action_file The RAD path to a PHP file containing a PHP function which performs the action of this PIM. * * @see FOFTemplateUtils::parsePath() for RAD path format. Joomla! will include this file * before calling the function defined in the action key below. * Example: admin://components/com_foobar/helpers/postinstall.php * * action The name of a PHP function which will be used to run the action of this PIM. This must be a * simple PHP user function (not a class method, static method etc) which returns no result. * Example: com_foobar_postinstall_messageone_action * * @param array $options See description * * @return void * * @throws Exception */ protected function addPostInstallationMessage(array $options) { // Make sure there are options set if (!is_array($options)) { throw new Exception('Post-installation message definitions must be of type array', 500); } // Initialise array keys $defaultOptions = array( 'extension_id' => '', 'type' => '', 'title_key' => '', 'description_key' => '', 'action_key' => '', 'language_extension' => '', 'language_client_id' => '', 'action_file' => '', 'action' => '', 'condition_file' => '', 'condition_method' => '', 'version_introduced' => '', 'enabled' => '1', ); $options = array_merge($defaultOptions, $options); // Array normalisation. Removes array keys not belonging to a definition. $defaultKeys = array_keys($defaultOptions); $allKeys = array_keys($options); $extraKeys = array_diff($allKeys, $defaultKeys); if (!empty($extraKeys)) { foreach ($extraKeys as $key) { unset($options[$key]); } } // Normalisation of integer values $options['extension_id'] = (int)$options['extension_id']; $options['language_client_id'] = (int)$options['language_client_id']; $options['enabled'] = (int)$options['enabled']; // Normalisation of 0/1 values foreach (array('language_client_id', 'enabled') as $key) { $options[$key] = $options[$key] ? 1 : 0; } // Make sure there's an extension_id if (!(int)$options['extension_id']) { throw new Exception('Post-installation message definitions need an extension_id', 500); } // Make sure there's a valid type if (!in_array($options['type'], array('message', 'link', 'action'))) { throw new Exception('Post-installation message definitions need to declare a type of message, link or action', 500); } // Make sure there's a title key if (empty($options['title_key'])) { throw new Exception('Post-installation message definitions need a title key', 500); } // Make sure there's a description key if (empty($options['description_key'])) { throw new Exception('Post-installation message definitions need a description key', 500); } // If the type is anything other than message you need an action key if (($options['type'] != 'message') && empty($options['action_key'])) { throw new Exception('Post-installation message definitions need an action key when they are of type "' . $options['type'] . '"', 500); } // You must specify the language extension if (empty($options['language_extension'])) { throw new Exception('Post-installation message definitions need to specify which extension contains their language keys', 500); } // The action file and method are only required for the "action" type if ($options['type'] == 'action') { if (empty($options['action_file'])) { throw new Exception('Post-installation message definitions need an action file when they are of type "action"', 500); } $file_path = FOFTemplateUtils::parsePath($options['action_file'], true); if (!@is_file($file_path)) { throw new Exception('The action file ' . $options['action_file'] . ' of your post-installation message definition does not exist', 500); } if (empty($options['action'])) { throw new Exception('Post-installation message definitions need an action (function name) when they are of type "action"', 500); } } if ($options['type'] == 'link') { if (empty($options['link'])) { throw new Exception('Post-installation message definitions need an action (URL) when they are of type "link"', 500); } } // The condition file and method are only required when the type is not "message" if ($options['type'] != 'message') { if (empty($options['condition_file'])) { throw new Exception('Post-installation message definitions need a condition file when they are of type "' . $options['type'] . '"', 500); } $file_path = FOFTemplateUtils::parsePath($options['condition_file'], true); if (!@is_file($file_path)) { throw new Exception('The condition file ' . $options['condition_file'] . ' of your post-installation message definition does not exist', 500); } if (empty($options['condition_method'])) { throw new Exception('Post-installation message definitions need a condition method (function name) when they are of type "' . $options['type'] . '"', 500); } } // Check if the definition exists $tableName = '#__postinstall_messages'; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('*') ->from($db->qn($tableName)) ->where($db->qn('extension_id') . ' = ' . $db->q($options['extension_id'])) ->where($db->qn('type') . ' = ' . $db->q($options['type'])) ->where($db->qn('title_key') . ' = ' . $db->q($options['title_key'])); $existingRow = $db->setQuery($query)->loadAssoc(); // Is the existing definition the same as the one we're trying to save (ignore the enabled flag)? if (!empty($existingRow)) { $same = true; foreach ($options as $k => $v) { if ($k == 'enabled') { continue; } if ($existingRow[$k] != $v) { $same = false; break; } } // Trying to add the same row as the existing one; quit if ($same) { return; } // Otherwise it's not the same row. Remove the old row before insert a new one. $query = $db->getQuery(true) ->delete($db->qn($tableName)) ->where($db->q('extension_id') . ' = ' . $db->q($options['extension_id'])) ->where($db->q('type') . ' = ' . $db->q($options['type'])) ->where($db->q('title_key') . ' = ' . $db->q($options['title_key'])); $db->setQuery($query)->execute(); } // Insert the new row $options = (object)$options; $db->insertObject($tableName, $options); } /** * Applies the post-installation messages for Joomla! 3.2 or later * * @return void */ protected function _applyPostInstallationMessages() { // Make sure it's Joomla! 3.2.0 or later if (!version_compare(JVERSION, '3.2.0', 'ge')) { return; } // Make sure there are post-installation messages if (empty($this->postInstallationMessages)) { return; } // Get the extension ID for our component $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('extension_id') ->from('#__extensions') ->where($db->qn('element') . ' = ' . $db->q($this->componentName)); $db->setQuery($query); try { $ids = $db->loadColumn(); } catch (Exception $exc) { return; } if (empty($ids)) { return; } $extension_id = array_shift($ids); foreach ($this->postInstallationMessages as $message) { $message['extension_id'] = $extension_id; $this->addPostInstallationMessage($message); } } protected function uninstallPostInstallationMessages() { // Make sure it's Joomla! 3.2.0 or later if (!version_compare(JVERSION, '3.2.0', 'ge')) { return; } // Make sure there are post-installation messages if (empty($this->postInstallationMessages)) { return; } // Get the extension ID for our component $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('extension_id') ->from('#__extensions') ->where($db->qn('element') . ' = ' . $db->q($this->componentName)); $db->setQuery($query); try { $ids = $db->loadColumn(); } catch (Exception $exc) { return; } if (empty($ids)) { return; } $extension_id = array_shift($ids); $query = $db->getQuery(true) ->delete($this->postInstallationMessages) ->where($db->qn('extension_id') . ' = ' . $db->q($extension_id)); try { $db->setQuery($query)->execute(); } catch (Exception $e) { return; } } } PK���\MRW��#�#%libraries/fof/utils/update/update.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 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; /** * A helper Model to interact with Joomla!'s extensions update feature */ class FOFUtilsUpdate extends FOFModel { /** @var JUpdater The Joomla! updater object */ protected $updater = null; /** @var int The extension_id of this component */ protected $extension_id = 0; /** @var string The currently installed version, as reported by the #__extensions table */ protected $version = 'dev'; /** @var string The name of the component e.g. com_something */ protected $component = 'com_foobar'; /** @var string The URL to the component's update XML stream */ protected $updateSite = null; /** @var string The name to the component's update site (description of the update XML stream) */ protected $updateSiteName = null; /** @var string The extra query to append to (commercial) components' download URLs */ protected $extraQuery = null; /** * Public constructor. Initialises the protected members as well. Useful $config keys: * update_component The component name, e.g. com_foobar * update_version The default version if the manifest cache is unreadable * update_site The URL to the component's update XML stream * update_extraquery The extra query to append to (commercial) components' download URLs * update_sitename The update site's name (description) * * @param array $config */ public function __construct($config = array()) { parent::__construct($config); // Get an instance of the updater class $this->updater = JUpdater::getInstance(); // Get the component name if (isset($config['update_component'])) { $this->component = $config['update_component']; } else { $this->component = $this->input->getCmd('option', ''); } // Get the component version if (isset($config['update_version'])) { $this->version = $config['update_version']; } // Get the update site if (isset($config['update_site'])) { $this->updateSite = $config['update_site']; } // Get the extra query if (isset($config['update_extraquery'])) { $this->extraQuery = $config['update_extraquery']; } // Get the extra query if (isset($config['update_sitename'])) { $this->updateSiteName = $config['update_sitename']; } // Find the extension ID $db = $this->getDbo(); $query = $db->getQuery(true) ->select('*') ->from($db->qn('#__extensions')) ->where($db->qn('type') . ' = ' . $db->q('component')) ->where($db->qn('element') . ' = ' . $db->q($this->component)); $db->setQuery($query); $extension = $db->loadObject(); if (is_object($extension)) { $this->extension_id = $extension->extension_id; $data = json_decode($extension->manifest_cache, true); if (isset($data['version'])) { $this->version = $data['version']; } } } /** * Retrieves the update information of the component, returning an array with the following keys: * * hasUpdate True if an update is available * version The version of the available update * infoURL The URL to the download page of the update * * @param bool $force Set to true if you want to forcibly reload the update information * * @return array See the method description for more information */ public function getUpdates($force = false) { $db = $this->getDbo(); // Default response (no update) $updateResponse = array( 'hasUpdate' => false, 'version' => '', 'infoURL' => '' ); if (empty($this->extension_id)) { return $updateResponse; } // If we are forcing the reload, set the last_check_timestamp to 0 // and remove cached component update info in order to force a reload if ($force) { // Find the update site IDs $updateSiteIds = $this->getUpdateSiteIds(); if (empty($updateSiteIds)) { return $updateResponse; } // Set the last_check_timestamp to 0 $query = $db->getQuery(true) ->update($db->qn('#__update_sites')) ->set($db->qn('last_check_timestamp') . ' = ' . $db->q('0')) ->where($db->qn('update_site_id') .' IN ('.implode(', ', $updateSiteIds).')'); $db->setQuery($query); $db->execute(); // Remove cached component update info from #__updates $query = $db->getQuery(true) ->delete($db->qn('#__updates')) ->where($db->qn('update_site_id') .' IN ('.implode(', ', $updateSiteIds).')'); $db->setQuery($query); $db->execute(); } // Use the update cache timeout specified in com_installer $comInstallerParams = JComponentHelper::getParams('com_installer', false); $timeout = 3600 * $comInstallerParams->get('cachetimeout', '6'); // Load any updates from the network into the #__updates table $this->updater->findUpdates($this->extension_id, $timeout); // Get the update record from the database $query = $db->getQuery(true) ->select('*') ->from($db->qn('#__updates')) ->where($db->qn('extension_id') . ' = ' . $db->q($this->extension_id)); $db->setQuery($query); $updateRecord = $db->loadObject(); // If we have an update record in the database return the information found there if (is_object($updateRecord)) { $updateResponse = array( 'hasUpdate' => true, 'version' => $updateRecord->version, 'infoURL' => $updateRecord->infourl, ); } return $updateResponse; } /** * Gets the update site Ids for our extension. * * @return mixed An array of Ids or null if the query failed. */ public function getUpdateSiteIds() { $db = $this->getDbo(); $query = $db->getQuery(true) ->select($db->qn('update_site_id')) ->from($db->qn('#__update_sites_extensions')) ->where($db->qn('extension_id') . ' = ' . $db->q($this->extension_id)); $db->setQuery($query); $updateSiteIds = $db->loadColumn(0); return $updateSiteIds; } /** * Get the currently installed version as reported by the #__extensions table * * @return string */ public function getVersion() { return $this->version; } /** * Override the currently installed version as reported by the #__extensions table * * @param string $version */ public function setVersion($version) { $this->version = $version; } /** * Refreshes the Joomla! update sites for this extension as needed * * @return void */ public function refreshUpdateSite() { if (empty($this->extension_id)) { return; } // Create the update site definition we want to store to the database $update_site = array( 'name' => $this->updateSiteName, 'type' => 'extension', 'location' => $this->updateSite, 'enabled' => 1, 'last_check_timestamp' => 0, 'extra_query' => $this->extraQuery ); // Get a reference to the db driver $db = $this->getDbo(); // Get the #__update_sites columns $columns = $db->getTableColumns('#__update_sites', true); if (version_compare(JVERSION, '3.0.0', 'lt') || !array_key_exists('extra_query', $columns)) { unset($update_site['extra_query']); } // Get the update sites for our extension $updateSiteIds = $this->getUpdateSiteIds(); if (!count($updateSiteIds)) { // No update sites defined. Create a new one. $newSite = (object)$update_site; $db->insertObject('#__update_sites', $newSite); $id = $db->insertid(); $updateSiteExtension = (object)array( 'update_site_id' => $id, 'extension_id' => $this->extension_id, ); $db->insertObject('#__update_sites_extensions', $updateSiteExtension); } else { // Loop through all update sites foreach ($updateSiteIds as $id) { $query = $db->getQuery(true) ->select('*') ->from($db->qn('#__update_sites')) ->where($db->qn('update_site_id') . ' = ' . $db->q($id)); $db->setQuery($query); $aSite = $db->loadObject(); if (empty($aSite)) { // Update site not defined. Create a new one. $update_site['update_site_id'] = $id; $newSite = (object)$update_site; $db->insertObject('#__update_sites', $newSite); // Update site is now up-to-date, don't need to refresh it anymore. continue; } // Is it enabled (Joomla! seriously sucks: IT DISABLES UPDATE SITES WITHOUT THE POSSIBILITY TO RE-ENABLE THEM!) if ($aSite->enabled) { // Does the name and location match? if (($aSite->name == $update_site['name']) && ($aSite->location == $update_site['location'])) { // Do we have the extra_query property (J 3.2+) and does it match? if (property_exists($aSite, 'extra_query') && isset($update_site['extra_query'])) { if ($aSite->extra_query == $update_site['extra_query']) { continue; } } else { // Joomla! 3.1 or earlier. Updates may or may not work. continue; } } } $update_site['update_site_id'] = $id; $newSite = (object)$update_site; $db->updateObject('#__update_sites', $newSite, 'update_site_id', true); } } } }PK���\�yC.'.')libraries/fof/utils/update/collection.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 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; /** * A helper class to read and parse "collection" update XML files over the web */ class FOFUtilsUpdateCollection { /** * Reads a "collection" XML update source and returns the complete tree of categories * and extensions applicable for platform version $jVersion * * @param string $url The collection XML update source URL to read from * @param string $jVersion Joomla! version to fetch updates for, or null to use JVERSION * * @return array A list of update sources applicable to $jVersion */ public function getAllUpdates($url, $jVersion = null) { // Get the target platform if (is_null($jVersion)) { $jVersion = JVERSION; } // Initialise return value $updates = array( 'metadata' => array( 'name' => '', 'description' => '', ), 'categories' => array(), 'extensions' => array(), ); // Download and parse the XML file $donwloader = new FOFDownload(); $xmlSource = $donwloader->getFromURL($url); try { $xml = new SimpleXMLElement($xmlSource, LIBXML_NONET); } catch(Exception $e) { return $updates; } // Sanity check if (($xml->getName() != 'extensionset')) { unset($xml); return $updates; } // Initialise return value with the stream metadata (name, description) $rootAttributes = $xml->attributes(); foreach ($rootAttributes as $k => $v) { $updates['metadata'][$k] = (string)$v; } // Initialise the raw list of updates $rawUpdates = array( 'categories' => array(), 'extensions' => array(), ); // Segregate the raw list to a hierarchy of extension and category entries /** @var SimpleXMLElement $extension */ foreach ($xml->children() as $extension) { switch ($extension->getName()) { case 'category': // These are the parameters we expect in a category $params = array( 'name' => '', 'description' => '', 'category' => '', 'ref' => '', 'targetplatformversion' => $jVersion, ); // These are the attributes of the element $attributes = $extension->attributes(); // Merge them all foreach ($attributes as $k => $v) { $params[$k] = (string)$v; } // We can't have a category with an empty category name if (empty($params['category'])) { continue; } // We can't have a category with an empty ref if (empty($params['ref'])) { continue; } if (empty($params['description'])) { $params['description'] = $params['category']; } if (!array_key_exists($params['category'], $rawUpdates['categories'])) { $rawUpdates['categories'][$params['category']] = array(); } $rawUpdates['categories'][$params['category']][] = $params; break; case 'extension': // These are the parameters we expect in a category $params = array( 'element' => '', 'type' => '', 'version' => '', 'name' => '', 'detailsurl' => '', 'targetplatformversion' => $jVersion, ); // These are the attributes of the element $attributes = $extension->attributes(); // Merge them all foreach ($attributes as $k => $v) { $params[$k] = (string)$v; } // We can't have an extension with an empty element if (empty($params['element'])) { continue; } // We can't have an extension with an empty type if (empty($params['type'])) { continue; } // We can't have an extension with an empty version if (empty($params['version'])) { continue; } if (empty($params['name'])) { $params['name'] = $params['element'] . ' ' . $params['version']; } if (!array_key_exists($params['type'], $rawUpdates['extensions'])) { $rawUpdates['extensions'][$params['type']] = array(); } if (!array_key_exists($params['element'], $rawUpdates['extensions'][$params['type']])) { $rawUpdates['extensions'][$params['type']][$params['element']] = array(); } $rawUpdates['extensions'][$params['type']][$params['element']][] = $params; break; default: break; } } unset($xml); if (!empty($rawUpdates['categories'])) { foreach ($rawUpdates['categories'] as $category => $entries) { $update = $this->filterListByPlatform($entries, $jVersion); $updates['categories'][$category] = $update; } } if (!empty($rawUpdates['extensions'])) { foreach ($rawUpdates['extensions'] as $type => $extensions) { $updates['extensions'][$type] = array(); if (!empty($extensions)) { foreach ($extensions as $element => $entries) { $update = $this->filterListByPlatform($entries, $jVersion); $updates['extensions'][$type][$element] = $update; } } } } return $updates; } /** * Filters a list of updates, returning only those available for the * specified platform version $jVersion * * @param array $updates An array containing update definitions (categories or extensions) * @param string $jVersion Joomla! version to fetch updates for, or null to use JVERSION * * @return array|null The update definition that is compatible, or null if none is compatible */ private function filterListByPlatform($updates, $jVersion = null) { // Get the target platform if (is_null($jVersion)) { $jVersion = JVERSION; } $versionParts = explode('.', $jVersion, 4); $platformVersionMajor = $versionParts[0]; $platformVersionMinor = (count($versionParts) > 1) ? $platformVersionMajor . '.' . $versionParts[1] : $platformVersionMajor; $platformVersionNormal = (count($versionParts) > 2) ? $platformVersionMinor . '.' . $versionParts[2] : $platformVersionMinor; $platformVersionFull = (count($versionParts) > 3) ? $platformVersionNormal . '.' . $versionParts[3] : $platformVersionNormal; $pickedExtension = null; $pickedSpecificity = -1; foreach ($updates as $update) { // Test the target platform $targetPlatform = (string)$update['targetplatformversion']; if ($targetPlatform === $platformVersionFull) { $pickedExtension = $update; $pickedSpecificity = 4; } elseif (($targetPlatform === $platformVersionNormal) && ($pickedSpecificity <= 3)) { $pickedExtension = $update; $pickedSpecificity = 3; } elseif (($targetPlatform === $platformVersionMinor) && ($pickedSpecificity <= 2)) { $pickedExtension = $update; $pickedSpecificity = 2; } elseif (($targetPlatform === $platformVersionMajor) && ($pickedSpecificity <= 1)) { $pickedExtension = $update; $pickedSpecificity = 1; } } return $pickedExtension; } /** * Returns only the category definitions of a collection * * @param string $url The URL of the collection update source * @param string $jVersion Joomla! version to fetch updates for, or null to use JVERSION * * @return array An array of category update definitions */ public function getCategories($url, $jVersion = null) { $allUpdates = $this->getAllUpdates($url, $jVersion); return $allUpdates['categories']; } /** * Returns the update source for a specific category * * @param string $url The URL of the collection update source * @param string $category The category name you want to get the update source URL of * @param string $jVersion Joomla! version to fetch updates for, or null to use JVERSION * * @return string|null The update stream URL, or null if it's not found */ public function getCategoryUpdateSource($url, $category, $jVersion = null) { $allUpdates = $this->getAllUpdates($url, $jVersion); if (array_key_exists($category, $allUpdates['categories'])) { return $allUpdates['categories'][$category]['ref']; } else { return null; } } /** * Get a list of updates for extensions only, optionally of a specific type * * @param string $url The URL of the collection update source * @param string $type The extension type you want to get the update source URL of, empty to get all * extension types * @param string $jVersion Joomla! version to fetch updates for, or null to use JVERSION * * @return array|null An array of extension update definitions or null if none is found */ public function getExtensions($url, $type = null, $jVersion = null) { $allUpdates = $this->getAllUpdates($url, $jVersion); if (empty($type)) { return $allUpdates['extensions']; } elseif (array_key_exists($type, $allUpdates['extensions'])) { return $allUpdates['extensions'][$type]; } else { return null; } } /** * Get the update source URL for a specific extension, based on the type and element, e.g. * type=file and element=joomla is Joomla! itself. * * @param string $url The URL of the collection update source * @param string $type The extension type you want to get the update source URL of * @param string $element The extension element you want to get the update source URL of * @param string $jVersion Joomla! version to fetch updates for, or null to use JVERSION * * @return string|null The update source URL or null if the extension is not found */ public function getExtensionUpdateSource($url, $type, $element, $jVersion = null) { $allUpdates = $this->getExtensions($url, $type, $jVersion); if (empty($allUpdates)) { return null; } elseif (array_key_exists($element, $allUpdates)) { return $allUpdates[$element]['detailsurl']; } else { return null; } } }PK���\xpN`3`3%libraries/fof/utils/update/joomla.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 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; /** * A helper class which provides update information for the Joomla! CMS itself. This is slightly different than the * regular "extension" files as we need to know if a Joomla! version is STS, LTS, testing, current and so on. */ class FOFUtilsUpdateJoomla extends FOFUtilsUpdateExtension { /** * The source for LTS updates * * @var string */ protected static $lts_url = 'http://update.joomla.org/core/list.xml'; /** * The source for STS updates * * @var string */ protected static $sts_url = 'http://update.joomla.org/core/sts/list_sts.xml'; /** * The source for test release updates * * @var string */ protected static $test_url = 'http://update.joomla.org/core/test/list_test.xml'; /** * Reads a "collection" XML update source and picks the correct source URL * for the extension update source. * * @param string $url The collection XML update source URL to read from * @param string $jVersion Joomla! version to fetch updates for, or null to use JVERSION * * @return string The URL of the extension update source, or empty if no updates are provided / fetching failed */ public function getUpdateSourceFromCollection($url, $jVersion = null) { $provider = new FOFUtilsUpdateCollection; return $provider->getExtensionUpdateSource($url, 'file', 'joomla', $jVersion); } /** * Determines the properties of a version: STS/LTS, normal or testing * * @param string $jVersion The version number to check * @param string $currentVersion The current Joomla! version number * * @return array The properties analysis */ public function getVersionProperties($jVersion, $currentVersion = null) { // Initialise $ret = array( 'lts' => true, // Is this an LTS release? False means STS. 'current' => false, // Is this a release in the $currentVersion branch? 'upgrade' => 'none', // Upgrade relation of $jVersion to $currentVersion: 'none' (can't upgrade), 'lts' (next or current LTS), 'sts' (next or current STS) or 'current' (same release, no upgrade available) 'testing' => false, // Is this a testing (alpha, beta, RC) release? ); // Get the current version if none is defined if (is_null($currentVersion)) { $currentVersion = JVERSION; } // Sanitise version numbers $jVersion = $this->sanitiseVersion($jVersion); $currentVersion = $this->sanitiseVersion($currentVersion); // Get the base version $baseVersion = substr($jVersion, 0, 3); // Get the minimum and maximum current version numbers $current_minimum = substr($currentVersion, 0, 3); $current_maximum = $current_minimum . '.9999'; // Initialise STS/LTS version numbers $sts_minimum = false; $sts_maximum = false; $lts_minimum = false; // Is it an LTS or STS release? switch ($baseVersion) { case '1.5': $ret['lts'] = true; break; case '1.6': $ret['lts'] = false; $sts_minimum = '1.7'; $sts_maximum = '1.7.999'; $lts_minimum = '2.5'; break; case '1.7': $ret['lts'] = false; $sts_minimum = false; $lts_minimum = '2.5'; break; default: $majorVersion = (int)substr($jVersion, 0, 1); $minorVersion = (int)substr($jVersion, 2, 1); if ($minorVersion == 5) { $ret['lts'] = true; // This is an LTS release, it can be superseded by .0 through .4 STS releases on the next branch... $sts_minimum = ($majorVersion + 1) . '.0'; $sts_maximum = ($majorVersion + 1) . '.4.9999'; // ...or a .5 LTS on the next branch $lts_minimum = ($majorVersion + 1) . '.5'; } else { $ret['lts'] = false; // This is an STS release, it can be superseded by a .1/.2/.3/.4 STS release on the same branch... $sts_minimum = $majorVersion . '.1'; $sts_maximum = $majorVersion . '.4.9999'; // ...or a .5 LTS on the same branch $lts_minimum = $majorVersion . '.5'; } break; } // Is it a current release? if (version_compare($jVersion, $current_minimum, 'ge') && version_compare($jVersion, $current_maximum, 'le')) { $ret['current'] = true; } // Is this a testing release? $versionParts = explode('.', $jVersion); $lastVersionPart = array_pop($versionParts); if (in_array(substr($lastVersionPart, 0, 1), array('a', 'b'))) { $ret['testing'] = true; } elseif (substr($lastVersionPart, 0, 2) == 'rc') { $ret['testing'] = true; } elseif (substr($lastVersionPart, 0, 3) == 'dev') { $ret['testing'] = true; } // Find the upgrade relation of $jVersion to $currentVersion if (version_compare($jVersion, $currentVersion, 'eq')) { $ret['upgrade'] = 'current'; } elseif(($sts_minimum !== false) && version_compare($jVersion, $sts_minimum, 'ge') && version_compare($jVersion, $sts_maximum, 'le')) { $ret['upgrade'] = 'sts'; } elseif(($lts_minimum !== false) && version_compare($jVersion, $lts_minimum, 'ge')) { $ret['upgrade'] = 'lts'; } elseif($baseVersion == $current_minimum) { $ret['upgrade'] = $ret['lts'] ? 'lts' : 'sts'; } else { $ret['upgrade'] = 'none'; } return $ret; } /** * Filters a list of updates, making sure they apply to the specifed CMS * release. * * @param array $updates A list of update records returned by the getUpdatesFromExtension method * @param string $jVersion The current Joomla! version number * * @return array A filtered list of updates. Each update record also includes version relevance information. */ public function filterApplicableUpdates($updates, $jVersion = null) { if (empty($jVersion)) { $jVersion = JVERSION; } $versionParts = explode('.', $jVersion, 4); $platformVersionMajor = $versionParts[0]; $platformVersionMinor = $platformVersionMajor . '.' . $versionParts[1]; $platformVersionNormal = $platformVersionMinor . '.' . $versionParts[2]; $platformVersionFull = (count($versionParts) > 3) ? $platformVersionNormal . '.' . $versionParts[3] : $platformVersionNormal; $ret = array(); foreach ($updates as $update) { // Check each update for platform match if (strtolower($update['targetplatform']['name']) != 'joomla') { continue; } $targetPlatformVersion = $update['targetplatform']['version']; if (($targetPlatformVersion !== $platformVersionMajor) && ($targetPlatformVersion !== $platformVersionMinor) && ($targetPlatformVersion !== $platformVersionNormal) && ($targetPlatformVersion !== $platformVersionFull)) { continue; } // Get some information from the version number $updateVersion = $update['version']; $versionProperties = $this->getVersionProperties($updateVersion, $jVersion); if ($versionProperties['upgrade'] == 'none') { continue; } // The XML files are ill-maintained. Maybe we already have this update? if (!array_key_exists($updateVersion, $ret)) { $ret[$updateVersion] = array_merge($update, $versionProperties); } } return $ret; } /** * Joomla! has a lousy track record in naming its alpha, beta and release * candidate releases. The convention used seems to be "what the hell the * current package maintainer thinks looks better". This method tries to * figure out what was in the mind of the maintainer and translate the * funky version number to an actual PHP-format version string. * * @param string $version The whatever-format version number * * @return string A standard formatted version number */ public function sanitiseVersion($version) { $test = strtolower($version); $alphaQualifierPosition = strpos($test, 'alpha-'); $betaQualifierPosition = strpos($test, 'beta-'); $rcQualifierPosition = strpos($test, 'rc-'); $rcQualifierPosition2 = strpos($test, 'rc'); $devQualifiedPosition = strpos($test, 'dev'); if ($alphaQualifierPosition !== false) { $betaRevision = substr($test, $alphaQualifierPosition + 6); if (!$betaRevision) { $betaRevision = 1; } $test = substr($test, 0, $alphaQualifierPosition) . '.a' . $betaRevision; } elseif ($betaQualifierPosition !== false) { $betaRevision = substr($test, $betaQualifierPosition + 5); if (!$betaRevision) { $betaRevision = 1; } $test = substr($test, 0, $betaQualifierPosition) . '.b' . $betaRevision; } elseif ($rcQualifierPosition !== false) { $betaRevision = substr($test, $rcQualifierPosition + 5); if (!$betaRevision) { $betaRevision = 1; } $test = substr($test, 0, $rcQualifierPosition) . '.rc' . $betaRevision; } elseif ($rcQualifierPosition2 !== false) { $betaRevision = substr($test, $rcQualifierPosition2 + 5); if (!$betaRevision) { $betaRevision = 1; } $test = substr($test, 0, $rcQualifierPosition2) . '.rc' . $betaRevision; } elseif ($devQualifiedPosition !== false) { $betaRevision = substr($test, $devQualifiedPosition + 6); if (!$betaRevision) { $betaRevision = ''; } $test = substr($test, 0, $devQualifiedPosition) . '.dev' . $betaRevision; } return $test; } /** * Reloads the list of all updates available for the specified Joomla! version * from the network. * * @param array $sources The enabled sources to look into * @param string $jVersion The Joomla! version we are checking updates for * * @return array A list of updates for the installed, current, lts and sts versions */ public function getUpdates($sources = array(), $jVersion = null) { // Make sure we have a valid list of sources if (empty($sources) || !is_array($sources)) { $sources = array(); } $defaultSources = array('lts' => true, 'sts' => true, 'test' => true, 'custom' => ''); $sources = array_merge($defaultSources, $sources); // Use the current JVERSION if none is specified if (empty($jVersion)) { $jVersion = JVERSION; } // Get the current branch' min/max versions $versionParts = explode('.', $jVersion, 4); $currentMinVersion = $versionParts[0] . '.' . $versionParts[1]; $currentMaxVersion = $versionParts[0] . '.' . $versionParts[1] . '.9999'; // Retrieve all updates $allUpdates = array(); foreach ($sources as $source => $value) { if (($value === false) || empty($value)) { continue; } switch ($source) { case 'lts': $url = self::$lts_url; break; case 'sts': $url = self::$sts_url; break; case 'test': $url = self::$test_url; break; case 'custom': $url = $value; break; } $url = $this->getUpdateSourceFromCollection($url, $jVersion); if (!empty($url)) { $updates = $this->getUpdatesFromExtension($url); if (!empty($updates)) { $applicableUpdates = $this->filterApplicableUpdates($updates, $jVersion); if (!empty($applicableUpdates)) { $allUpdates = array_merge($allUpdates, $applicableUpdates); } } } } $ret = array( // Currently installed version (used to reinstall, if available) 'installed' => array( 'version' => '', 'package' => '', 'infourl' => '', ), // Current branch 'current' => array( 'version' => '', 'package' => '', 'infourl' => '', ), // Upgrade to STS release 'sts' => array( 'version' => '', 'package' => '', 'infourl' => '', ), // Upgrade to LTS release 'lts' => array( 'version' => '', 'package' => '', 'infourl' => '', ), // Upgrade to LTS release 'test' => array( 'version' => '', 'package' => '', 'infourl' => '', ), ); foreach ($allUpdates as $update) { $sections = array(); if ($update['upgrade'] == 'current') { $sections[0] = 'installed'; } elseif(version_compare($update['version'], $currentMinVersion, 'ge') && version_compare($update['version'], $currentMaxVersion, 'le')) { $sections[0] = 'current'; } else { $sections[0] = ''; } $sections[1] = $update['lts'] ? 'lts' : 'sts'; if ($update['testing']) { $sections = array('test'); } foreach ($sections as $section) { if (empty($section)) { continue; } $existingVersionForSection = $ret[$section]['version']; if (empty($existingVersionForSection)) { $existingVersionForSection = '0.0.0'; } if (version_compare($update['version'], $existingVersionForSection, 'ge')) { $ret[$section]['version'] = $update['version']; $ret[$section]['package'] = $update['downloads'][0]['url']; $ret[$section]['infourl'] = $update['infourl']['url']; } } } // Catch the case when the latest current branch version is the installed version (up to date site) if (empty($ret['current']['version']) && !empty($ret['installed']['version'])) { $ret['current'] = $ret['installed']; } return $ret; } }PK���\��^�7 7 (libraries/fof/utils/update/extension.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 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; /** * A helper class to read and parse "extension" update XML files over the web */ class FOFUtilsUpdateExtension { /** * Reads an "extension" XML update source and returns all listed update entries. * * If you have a "collection" XML update source you should do something like this: * $collection = new FOFUtilsUpdateCollection(); * $extensionUpdateURL = $collection->getExtensionUpdateSource($url, 'component', 'com_foobar', JVERSION); * $extension = new FOFUtilsUpdateExtension(); * $updates = $extension->getUpdatesFromExtension($extensionUpdateURL); * * @param string $url The extension XML update source URL to read from * * @return array An array of update entries */ public function getUpdatesFromExtension($url) { // Initialise $ret = array(); // Get and parse the XML source $downloader = new FOFDownload(); $xmlSource = $downloader->getFromURL($url); try { $xml = new SimpleXMLElement($xmlSource, LIBXML_NONET); } catch(Exception $e) { return $ret; } // Sanity check if (($xml->getName() != 'updates')) { unset($xml); return $ret; } // Let's populate the list of updates /** @var SimpleXMLElement $update */ foreach ($xml->children() as $update) { // Sanity check if ($update->getName() != 'update') { continue; } $entry = array( 'infourl' => array('title' => '', 'url' => ''), 'downloads' => array(), 'tags' => array(), 'targetplatform' => array(), ); $properties = get_object_vars($update); foreach ($properties as $nodeName => $nodeContent) { switch ($nodeName) { default: $entry[$nodeName] = $nodeContent; break; case 'infourl': case 'downloads': case 'tags': case 'targetplatform': break; } } $infourlNode = $update->xpath('infourl'); $entry['infourl']['title'] = (string)$infourlNode[0]['title']; $entry['infourl']['url'] = (string)$infourlNode[0]; $downloadNodes = $update->xpath('downloads/downloadurl'); foreach ($downloadNodes as $downloadNode) { $entry['downloads'][] = array( 'type' => (string)$downloadNode['type'], 'format' => (string)$downloadNode['format'], 'url' => (string)$downloadNode, ); } $tagNodes = $update->xpath('tags/tag'); foreach ($tagNodes as $tagNode) { $entry['tags'][] = (string)$tagNode; } /** @var SimpleXMLElement $targetPlatformNode */ $targetPlatformNode = $update->xpath('targetplatform'); $entry['targetplatform']['name'] = (string)$targetPlatformNode[0]['name']; $entry['targetplatform']['version'] = (string)$targetPlatformNode[0]['version']; $client = $targetPlatformNode[0]->xpath('client'); $entry['targetplatform']['client'] = (is_array($client) && count($client)) ? (string)$client[0] : ''; $folder = $targetPlatformNode[0]->xpath('folder'); $entry['targetplatform']['folder'] = is_array($folder) && count($folder) ? (string)$folder[0] : ''; $ret[] = $entry; } unset($xml); return $ret; } }PK���\��(���-libraries/fof/utils/filescheck/filescheck.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * A utility class to check that your extension's files are not missing and have not been tampered with. * * You need a file called fileslist.php in your component's administrator root directory with the following contents: * * $phpFileChecker = array( * 'version' => 'revCEE2DAB', * 'date' => '2014-10-16', * 'directories' => array( * 'administrator/components/com_foobar', * .... * ), * 'files' => array( * 'administrator/components/com_foobar/access.xml' => array('705', '09aa0351a316bf011ecc8c1145134761', 'b95f00c7b49a07a60570dc674f2497c45c4e7152'), * .... * ) * ); * * All directory and file paths are relative to the site's root * * The directories array is a list of */ class FOFUtilsFilescheck { /** @var string The name of the component */ protected $option = ''; /** @var string Current component version */ protected $version = null; /** @var string Current component release date */ protected $date = null; /** @var array List of files to check as filepath => (filesize, md5, sha1) */ protected $fileList = array(); /** @var array List of directories to check that exist */ protected $dirList = array(); /** @var bool Is the reported component version different than the version of the #__extensions table? */ protected $wrongComponentVersion = false; /** @var bool Is the fileslist.php reporting a version different than the reported component version? */ protected $wrongFilesVersion = false; /** * Create and initialise the object * * @param string $option Component name, e.g. com_foobar * @param string $version The current component version, as reported by the component * @param string $date The current component release date, as reported by the component */ public function __construct($option, $version, $date) { // Initialise from parameters $this->option = $option; $this->version = $version; $this->date = $date; // Retrieve the date and version from the #__extensions table $db = JFactory::getDbo(); $query = $db->getQuery(true)->select('*')->from($db->qn('#__extensions')) ->where($db->qn('element') . ' = ' . $db->q($this->option)) ->where($db->qn('type') . ' = ' . $db->q('component')); $extension = $db->setQuery($query)->loadObject(); // Check the version and date against those from #__extensions. I hate heavily nested IFs as much as the next // guy, but what can you do... if (!is_null($extension)) { $manifestCache = $extension->manifest_cache; if (!empty($manifestCache)) { $manifestCache = json_decode($manifestCache, true); if (is_array($manifestCache) && isset($manifestCache['creationDate']) && isset($manifestCache['version'])) { // Make sure the fileslist.php version and date match the component's version if ($this->version != $manifestCache['version']) { $this->wrongComponentVersion = true; } if ($this->date != $manifestCache['creationDate']) { $this->wrongComponentVersion = true; } } } } // Try to load the fileslist.php file from the component's back-end root $filePath = JPATH_ADMINISTRATOR . '/components/' . $this->option . '/fileslist.php'; if (!file_exists($filePath)) { return; } include $filePath; // Make sure the fileslist.php version and date match the component's version if ($this->version != $phpFileChecker['version']) { $this->wrongFilesVersion = true; } if ($this->date != $phpFileChecker['date']) { $this->wrongFilesVersion = true; } // Initialise the files and directories lists $this->fileList = $phpFileChecker['files']; $this->dirList = $phpFileChecker['directories']; } /** * Is the reported component version different than the version of the #__extensions table? * * @return boolean */ public function isWrongComponentVersion() { return $this->wrongComponentVersion; } /** * Is the fileslist.php reporting a version different than the reported component version? * * @return boolean */ public function isWrongFilesVersion() { return $this->wrongFilesVersion; } /** * Performs a fast check of file and folders. If even one of the files/folders doesn't exist, or even one file has * the wrong file size it will return false. * * @return bool False when there are mismatched files and directories */ public function fastCheck() { // Check that all directories exist foreach ($this->dirList as $directory) { $directory = JPATH_ROOT . '/' . $directory; if (!@is_dir($directory)) { return false; } } // Check that all files exist and have the right size foreach ($this->fileList as $filePath => $fileData) { $filePath = JPATH_ROOT . '/' . $filePath; if (!@file_exists($filePath)) { return false; } $fileSize = @filesize($filePath); if ($fileSize != $fileData[0]) { return false; } } return true; } /** * Performs a slow, thorough check of all files and folders (including MD5/SHA1 sum checks) * * @param int $idx The index from where to start * * @return array Progress report */ public function slowCheck($idx = 0) { $ret = array( 'done' => false, 'files' => array(), 'folders' => array(), 'idx' => $idx ); $totalFiles = count($this->fileList); $totalFolders = count($this->dirList); $fileKeys = array_keys($this->fileList); $timer = new FOFUtilsTimer(3.0, 75.0); while ($timer->getTimeLeft() && (($idx < $totalFiles) || ($idx < $totalFolders))) { if ($idx < $totalFolders) { $directory = JPATH_ROOT . '/' . $this->dirList[$idx]; if (!@is_dir($directory)) { $ret['folders'][] = $directory; } } if ($idx < $totalFiles) { $fileKey = $fileKeys[$idx]; $filePath = JPATH_ROOT . '/' . $fileKey; $fileData = $this->fileList[$fileKey]; if (!@file_exists($filePath)) { $ret['files'][] = $fileKey . ' (missing)'; } elseif (@filesize($filePath) != $fileData[0]) { $ret['files'][] = $fileKey . ' (size ' . @filesize($filePath) . ' ≠ ' . $fileData[0] . ')'; } else { if (function_exists('sha1_file')) { $fileSha1 = @sha1_file($filePath); if ($fileSha1 != $fileData[2]) { $ret['files'][] = $fileKey . ' (SHA1 ' . $fileSha1 . ' ≠ ' . $fileData[2] . ')'; } } elseif (function_exists('md5_file')) { $fileMd5 = @md5_file($filePath); if ($fileMd5 != $fileData[1]) { $ret['files'][] = $fileKey . ' (MD5 ' . $fileMd5 . ' ≠ ' . $fileData[1] . ')'; } } } } $idx++; } if (($idx >= $totalFiles) && ($idx >= $totalFolders)) { $ret['done'] = true; } $ret['idx'] = $idx; return $ret; } }PK���\�լee%libraries/fof/utils/object/object.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Temporary class for backwards compatibility. You should not be using this * in your code. It is currently present to handle the validation error stack * for FOFTable::check() and will be removed in an upcoming version. * * This class is based on JObject as found in Joomla! 3.2.1 * * @deprecated 2.1 * @codeCoverageIgnore */ class FOFUtilsObject { /** * An array of error messages or Exception objects. * * @var array */ protected $_errors = array(); /** * Class constructor, overridden in descendant classes. * * @param mixed $properties Either and associative array or another * object to set the initial properties of the object. */ public function __construct($properties = null) { if ($properties !== null) { $this->setProperties($properties); } } /** * Magic method to convert the object to a string gracefully. * * @return string The classname. */ public function __toString() { return get_class($this); } /** * Sets a default value if not alreay assigned * * @param string $property The name of the property. * @param mixed $default The default value. * * @return mixed */ public function def($property, $default = null) { $value = $this->get($property, $default); return $this->set($property, $value); } /** * Returns a property of the object or the default value if the property is not set. * * @param string $property The name of the property. * @param mixed $default The default value. * * @return mixed The value of the property. */ public function get($property, $default = null) { if (isset($this->$property)) { return $this->$property; } return $default; } /** * Returns an associative array of object properties. * * @param boolean $public If true, returns only the public properties. * * @return array */ public function getProperties($public = true) { $vars = get_object_vars($this); if ($public) { foreach ($vars as $key => $value) { if ('_' == substr($key, 0, 1)) { unset($vars[$key]); } } } return $vars; } /** * Get the most recent error message. * * @param integer $i Option error index. * @param boolean $toString Indicates if JError objects should return their error message. * * @return string Error message */ public function getError($i = null, $toString = true) { // Find the error if ($i === null) { // Default, return the last message $error = end($this->_errors); } elseif (!array_key_exists($i, $this->_errors)) { // If $i has been specified but does not exist, return false return false; } else { $error = $this->_errors[$i]; } // Check if only the string is requested if ($error instanceof Exception && $toString) { return (string) $error; } return $error; } /** * Return all errors, if any. * * @return array Array of error messages or JErrors. */ public function getErrors() { return $this->_errors; } /** * Modifies a property of the object, creating it if it does not already exist. * * @param string $property The name of the property. * @param mixed $value The value of the property to set. * * @return mixed Previous value of the property. */ public function set($property, $value = null) { $previous = isset($this->$property) ? $this->$property : null; $this->$property = $value; return $previous; } /** * Set the object properties based on a named array/hash. * * @param mixed $properties Either an associative array or another object. * * @return boolean */ public function setProperties($properties) { if (is_array($properties) || is_object($properties)) { foreach ((array) $properties as $k => $v) { // Use the set function which might be overridden. $this->set($k, $v); } return true; } return false; } /** * Add an error message. * * @param string $error Error message. * * @return void */ public function setError($error) { array_push($this->_errors, $error); } } PK���\�kӫ�� libraries/fof/table/behavior.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage table * @copyright Copyright (C) 2010 - 2015 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 table behavior class. It defines the events which are * called by a Table. * * @codeCoverageIgnore * @package FrameworkOnFramework * @since 2.1 */ abstract class FOFTableBehavior extends FOFUtilsObservableEvent { /** * This event runs before binding data to the table * * @param FOFTable &$table The table which calls this event * @param array &$data The data to bind * * @return boolean True on success */ public function onBeforeBind(&$table, &$data) { return true; } /** * The event which runs after binding data to the table * * @param FOFTable &$table The table which calls this event * @param object|array &$src The data to bind * * @return boolean True on success */ public function onAfterBind(&$table, &$src) { return true; } /** * The event which runs after loading a record from the database * * @param FOFTable &$table The table which calls this event * @param boolean &$result Did the load succeeded? * * @return void */ public function onAfterLoad(&$table, &$result) { } /** * The event which runs before storing (saving) data to the database * * @param FOFTable &$table The table which calls this event * @param boolean $updateNulls Should nulls be saved as nulls (true) or just skipped over (false)? * * @return boolean True to allow saving */ public function onBeforeStore(&$table, $updateNulls) { return true; } /** * The event which runs after storing (saving) data to the database * * @param FOFTable &$table The table which calls this event * * @return boolean True to allow saving without an error */ public function onAfterStore(&$table) { return true; } /** * The event which runs before moving a record * * @param FOFTable &$table The table which calls this event * @param boolean $updateNulls Should nulls be saved as nulls (true) or just skipped over (false)? * * @return boolean True to allow moving */ public function onBeforeMove(&$table, $updateNulls) { return true; } /** * The event which runs after moving a record * * @param FOFTable &$table The table which calls this event * * @return boolean True to allow moving without an error */ public function onAfterMove(&$table) { return true; } /** * The event which runs before reordering a table * * @param FOFTable &$table The table which calls this event * @param string $where The WHERE clause of the SQL query to run on reordering (record filter) * * @return boolean True to allow reordering */ public function onBeforeReorder(&$table, $where = '') { return true; } /** * The event which runs after reordering a table * * @param FOFTable &$table The table which calls this event * * @return boolean True to allow the reordering to complete without an error */ public function onAfterReorder(&$table) { return true; } /** * The event which runs before deleting a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record to delete * * @return boolean True to allow the deletion */ public function onBeforeDelete(&$table, $oid) { return true; } /** * The event which runs after deleting a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record which was deleted * * @return boolean True to allow the deletion without errors */ public function onAfterDelete(&$table, $oid) { return true; } /** * The event which runs before hitting a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record to hit * @param boolean $log Should we log the hit? * * @return boolean True to allow the hit */ public function onBeforeHit(&$table, $oid, $log) { return true; } /** * The event which runs after hitting a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record which was hit * * @return boolean True to allow the hitting without errors */ public function onAfterHit(&$table, $oid) { return true; } /** * The even which runs before copying a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record being copied * * @return boolean True to allow the copy to take place */ public function onBeforeCopy(&$table, $oid) { return true; } /** * The even which runs after copying a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record which was copied (not the new one) * * @return boolean True to allow the copy without errors */ public function onAfterCopy(&$table, $oid) { return true; } /** * The event which runs before a record is (un)published * * @param FOFTable &$table The table which calls this event * @param integer|array &$cid The PK IDs of the records being (un)published * @param integer $publish 1 to publish, 0 to unpublish * * @return boolean True to allow the (un)publish to proceed */ public function onBeforePublish(&$table, &$cid, $publish) { return true; } /** * The event which runs after the object is reset to its default values. * * @param FOFTable &$table The table which calls this event * * @return boolean True to allow the reset to complete without errors */ public function onAfterReset(&$table) { return true; } /** * The even which runs before the object is reset to its default values. * * @param FOFTable &$table The table which calls this event * * @return boolean True to allow the reset to complete */ public function onBeforeReset(&$table) { return true; } } PK���\-� �+libraries/fof/table/dispatcher/behavior.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage table * @copyright Copyright (C) 2010 - 2015 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 table behavior dispatcher class * * @codeCoverageIgnore * @package FrameworkOnFramework * @since 2.1 */ class FOFTableDispatcherBehavior extends FOFUtilsObservableDispatcher { } PK���\��w����!libraries/fof/table/relations.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage table * @copyright Copyright (C) 2010 - 2015 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; class FOFTableRelations { /** * Holds all known relation definitions * * @var array */ protected $relations = array( 'child' => array(), 'parent' => array(), 'children' => array(), 'multiple' => array(), ); /** * Holds the default relations' keys * * @var array */ protected $defaultRelation = array( 'child' => null, 'parent' => null, 'children' => null, 'multiple' => null, ); /** * The table these relations are attached to * * @var FOFTable */ protected $table = null; /** * The name of the component used by our attached table * * @var string */ protected $componentName = 'joomla'; /** * The type (table name without prefix and component name) of our attached table * * @var string */ protected $tableType = ''; /** * Create a relations object based on the provided FOFTable instance * * @param FOFTable $table The table instance used to initialise the relations */ public function __construct(FOFTable $table) { // Store the table $this->table = $table; // Get the table's type from its name $tableName = $table->getTableName(); $tableName = str_replace('#__', '', $tableName); $type = explode("_", $tableName); if (count($type) == 1) { $this->tableType = array_pop($type); } else { $this->componentName = array_shift($type); $this->tableType = array_pop($type); } $this->tableType = FOFInflector::singularize($this->tableType); $tableKey = $table->getKeyName(); unset($type); // Scan all table keys and look for foo_bar_id fields. These fields are used to populate parent relations. foreach ($table->getKnownFields() as $field) { // Skip the table key name if ($field == $tableKey) { continue; } if (substr($field, -3) != '_id') { continue; } $parts = explode('_', $field); // If the component type of the field is not set assume 'joomla' if (count($parts) == 2) { array_unshift($parts, 'joomla'); } // Sanity check if (count($parts) != 3) { continue; } // Make sure we skip any references back to ourselves (should be redundant, due to key field check above) if ($parts[1] == $this->tableType) { continue; } // Default item name: the name of the table, singular $itemName = FOFInflector::singularize($parts[1]); // Prefix the item name with the component name if we refer to a different component if ($parts[0] != $this->componentName) { $itemName = $parts[0] . '_' . $itemName; } // Figure out the table class $tableClass = ucfirst($parts[0]) . 'Table' . ucfirst($parts[1]); $default = empty($this->relations['parent']); $this->addParentRelation($itemName, $tableClass, $field, $field, $default); } // Get the relations from the configuration provider $key = $table->getConfigProviderKey() . '.relations'; $configRelations = $table->getConfigProvider()->get($key, array()); if (!empty($configRelations)) { foreach ($configRelations as $relation) { if (empty($relation['type'])) { continue; } if (isset($relation['pivotTable'])) { $this->addMultipleRelation($relation['itemName'], $relation['tableClass'], $relation['localKey'], $relation['ourPivotKey'], $relation['theirPivotKey'], $relation['remoteKey'], $relation['pivotTable'], $relation['default']); } else { $method = 'add' . ucfirst($relation['type']). 'Relation'; if (!method_exists($this, $method)) { continue; } $this->$method($relation['itemName'], $relation['tableClass'], $relation['localKey'], $relation['remoteKey'], $relation['default']); } } } } /** * Add a 1:1 forward (child) relation. This adds relations for the getChild() method. * * In other words: does a table HAVE ONE child * * Parent and child relations works the same way. We have them separated as it makes more sense for us humans to * read code like $item->getParent() and $item->getChild() than $item->getRelatedObject('someRandomKeyName') * * @param string $itemName is how it will be known locally to the getRelatedItem method (singular) * @param string $tableClass if skipped it is defined automatically as ComponentnameTableItemname * @param string $localKey is the column containing our side of the FK relation, default: our primary key * @param string $remoteKey is the remote table's FK column, default: componentname_itemname_id * @param boolean $default add as the default child relation? * * @return void */ public function addChildRelation($itemName, $tableClass = null, $localKey = null, $remoteKey = null, $default = true) { $itemName = $this->normaliseItemName($itemName, false); if (empty($localKey)) { $localKey = $this->table->getKeyName(); } $this->addBespokeSimpleRelation('child', $itemName, $tableClass, $localKey, $remoteKey, $default); } /** * Defining an inverse 1:1 (parent) relation. You must specify at least the $tableClass or the $localKey. * This adds relations for the getParent() method. * * In other words: does a table BELONG TO ONE parent * * Parent and child relations works the same way. We have them separated as it makes more sense for us humans to * read code like $item->getParent() and $item->getChild() than $item->getRelatedObject('someRandomKeyName') * * @param string $itemName is how it will be known locally to the getRelatedItem method (singular) * @param string $tableClass if skipped it is defined automatically as ComponentnameTableItemname * @param string $localKey is the column containing our side of the FK relation, default: componentname_itemname_id * @param string $remoteKey is the remote table's FK column, default: componentname_itemname_id * @param boolean $default Is this the default parent relationship? * * @return void */ public function addParentRelation($itemName, $tableClass = null, $localKey = null, $remoteKey = null, $default = true) { $itemName = $this->normaliseItemName($itemName, false); $this->addBespokeSimpleRelation('parent', $itemName, $tableClass, $localKey, $remoteKey, $default); } /** * Defining a forward 1:∞ (children) relation. This adds relations to the getChildren() method. * * In other words: does a table HAVE MANY children? * * The children relation works very much the same as the parent and child relation. The difference is that the * parent and child relations return a single table object, whereas the children relation returns an iterator to * many objects. * * @param string $itemName is how it will be known locally to the getRelatedItems method (plural) * @param string $tableClass if skipped it is defined automatically as ComponentnameTableItemname * @param string $localKey is the column containing our side of the FK relation, default: our primary key * @param string $remoteKey is the remote table's FK column, default: componentname_itemname_id * @param boolean $default is this the default children relationship? * * @return void */ public function addChildrenRelation($itemName, $tableClass = null, $localKey = null, $remoteKey = null, $default = true) { $itemName = $this->normaliseItemName($itemName, true); if (empty($localKey)) { $localKey = $this->table->getKeyName(); } $this->addBespokeSimpleRelation('children', $itemName, $tableClass, $localKey, $remoteKey, $default); } /** * Defining a ∞:∞ (multiple) relation. This adds relations to the getMultiple() method. * * In other words: is a table RELATED TO MANY other records? * * @param string $itemName is how it will be known locally to the getRelatedItems method (plural) * @param string $tableClass if skipped it is defined automatically as ComponentnameTableItemname * @param string $localKey is the column containing our side of the FK relation, default: our primary key field name * @param string $ourPivotKey is the column containing our side of the FK relation in the pivot table, default: $localKey * @param string $theirPivotKey is the column containing the other table's side of the FK relation in the pivot table, default $remoteKey * @param string $remoteKey is the remote table's FK column, default: componentname_itemname_id * @param string $glueTable is the name of the glue (pivot) table, default: #__componentname_thisclassname_itemname with plural items (e.g. #__foobar_users_roles) * @param boolean $default is this the default multiple relation? */ public function addMultipleRelation($itemName, $tableClass = null, $localKey = null, $ourPivotKey = null, $theirPivotKey = null, $remoteKey = null, $glueTable = null, $default = true) { $itemName = $this->normaliseItemName($itemName, true); if (empty($localKey)) { $localKey = $this->table->getKeyName(); } $this->addBespokePivotRelation('multiple', $itemName, $tableClass, $localKey, $remoteKey, $ourPivotKey, $theirPivotKey, $glueTable, $default); } /** * Removes a previously defined relation by name. You can optionally specify the relation type. * * @param string $itemName The name of the relation to remove * @param string $type [optional] The relation type (child, parent, children, ...) * * @return void */ public function removeRelation($itemName, $type = null) { $types = array_keys($this->relations); if (in_array($type, $types)) { $types = array($type); } foreach ($types as $type) { foreach ($this->relations[$type] as $key => $relations) { if ($itemName == $key) { unset ($this->relations[$type][$itemName]); // If it's the default one, remove it from the default array, too if($this->defaultRelation[$type] == $itemName) { $this->defaultRelation[$type] = null; } return; } } } } /** * Removes all existing relations * * @param string $type The type or relations to remove, omit to remove all relation types * * @return void */ public function clearRelations($type = null) { $types = array_keys($this->relations); if (in_array($type, $types)) { $types = array($type); } foreach ($types as $type) { $this->relations[$type] = array(); // Remove the relation from the default stack, too $this->defaultRelation[$type] = null; } } /** * Does the named relation exist? You can optionally specify the type. * * @param string $itemName The name of the relation to check * @param string $type [optional] The relation type (child, parent, children, ...) * * @return boolean */ public function hasRelation($itemName, $type = null) { $types = array_keys($this->relations); if (in_array($type, $types)) { $types = array($type); } foreach ($types as $type) { foreach ($this->relations[$type] as $key => $relations) { if ($itemName == $key) { return true; } } } return false; } /** * Get the definition of a relation * * @param string $itemName The name of the relation to check * @param string $type [optional] The relation type (child, parent, children, ...) * * @return array * * @throws RuntimeException When the relation is not found */ public function getRelation($itemName, $type) { $types = array_keys($this->relations); if (in_array($type, $types)) { $types = array($type); } foreach ($types as $type) { foreach ($this->relations[$type] as $key => $relations) { if ($itemName == $key) { $temp = $relations; $temp['type'] = $type; return $temp; } } } throw new RuntimeException("Relation $itemName not found in table {$this->tableType}", 500); } /** * Gets the item referenced by a named relation. You can optionally specify the type. Only single item relation * types will be searched. * * @param string $itemName The name of the relation to use * @param string $type [optional] The relation type (child, parent) * * @return FOFTable * * @throws RuntimeException If the named relation doesn't exist or isn't supposed to return single items */ public function getRelatedItem($itemName, $type = null) { if (empty($type)) { $relation = $this->getRelation($itemName, $type); $type = $relation['type']; } switch ($type) { case 'parent': return $this->getParent($itemName); break; case 'child': return $this->getChild($itemName); break; default: throw new RuntimeException("Invalid relation type $type for returning a single related item", 500); break; } } /** * Gets the iterator for the items referenced by a named relation. You can optionally specify the type. Only * multiple item relation types will be searched. * * @param string $itemName The name of the relation to use * @param string $type [optional] The relation type (children, multiple) * * @return FOFDatabaseIterator * * @throws RuntimeException If the named relation doesn't exist or isn't supposed to return single items */ public function getRelatedItems($itemName, $type = null) { if (empty($type)) { $relation = $this->getRelation($itemName, $type); $type = $relation['type']; } switch ($type) { case 'children': return $this->getChildren($itemName); break; case 'multiple': return $this->getMultiple($itemName); break; case 'siblings': return $this->getSiblings($itemName); break; default: throw new RuntimeException("Invalid relation type $type for returning a collection of related items", 500); break; } } /** * Gets a parent item * * @param string $itemName [optional] The name of the relation to use, skip to use the default parent relation * * @return FOFTable * * @throws RuntimeException When the relation is not found */ public function getParent($itemName = null) { if (empty($itemName)) { $itemName = $this->defaultRelation['parent']; } if (empty($itemName)) { throw new RuntimeException(sprintf('Default parent relation for %s not found', $this->table->getTableName()), 500); } if (!isset($this->relations['parent'][$itemName])) { throw new RuntimeException(sprintf('Parent relation %s for %s not found', $itemName, $this->table->getTableName()), 500); } return $this->getTableFromRelation($this->relations['parent'][$itemName]); } /** * Gets a child item * * @param string $itemName [optional] The name of the relation to use, skip to use the default child relation * * @return FOFTable * * @throws RuntimeException When the relation is not found */ public function getChild($itemName = null) { if (empty($itemName)) { $itemName = $this->defaultRelation['child']; } if (empty($itemName)) { throw new RuntimeException(sprintf('Default child relation for %s not found', $this->table->getTableName()), 500); } if (!isset($this->relations['child'][$itemName])) { throw new RuntimeException(sprintf('Child relation %s for %s not found', $itemName, $this->table->getTableName()), 500); } return $this->getTableFromRelation($this->relations['child'][$itemName]); } /** * Gets an iterator for the children items * * @param string $itemName [optional] The name of the relation to use, skip to use the default children relation * * @return FOFDatabaseIterator * * @throws RuntimeException When the relation is not found */ public function getChildren($itemName = null) { if (empty($itemName)) { $itemName = $this->defaultRelation['children']; } if (empty($itemName)) { throw new RuntimeException(sprintf('Default children relation for %s not found', $this->table->getTableName()), 500); } if (!isset($this->relations['children'][$itemName])) { throw new RuntimeException(sprintf('Children relation %s for %s not found', $itemName, $this->table->getTableName()), 500); } return $this->getIteratorFromRelation($this->relations['children'][$itemName]); } /** * Gets an iterator for the sibling items. This relation is inferred from the parent relation. It returns all * elements on the same table which have the same parent. * * @param string $itemName [optional] The name of the relation to use, skip to use the default children relation * * @return FOFDatabaseIterator * * @throws RuntimeException When the relation is not found */ public function getSiblings($itemName = null) { if (empty($itemName)) { $itemName = $this->defaultRelation['parent']; } if (empty($itemName)) { throw new RuntimeException(sprintf('Default siblings relation for %s not found', $this->table->getTableName()), 500); } if (!isset($this->relations['parent'][$itemName])) { throw new RuntimeException(sprintf('Sibling relation %s for %s not found', $itemName, $this->table->getTableName()), 500); } // Get my table class $tableName = $this->table->getTableName(); $tableName = str_replace('#__', '', $tableName); $tableNameParts = explode('_', $tableName, 2); $tableClass = ucfirst($tableNameParts[0]) . 'Table' . ucfirst(FOFInflector::singularize($tableNameParts[1])); $parentRelation = $this->relations['parent'][$itemName]; $relation = array( 'tableClass' => $tableClass, 'localKey' => $parentRelation['localKey'], 'remoteKey' => $parentRelation['localKey'], ); return $this->getIteratorFromRelation($relation); } /** * Gets an iterator for the multiple items * * @param string $itemName [optional] The name of the relation to use, skip to use the default multiple relation * * @return FOFDatabaseIterator * * @throws RuntimeException When the relation is not found */ public function getMultiple($itemName = null) { if (empty($itemName)) { $itemName = $this->defaultRelation['multiple']; } if (empty($itemName)) { throw new RuntimeException(sprintf('Default multiple relation for %s not found', $this->table->getTableName()), 500); } if (!isset($this->relations['multiple'][$itemName])) { throw new RuntimeException(sprintf('Multiple relation %s for %s not found', $itemName, $this->table->getTableName()), 500); } return $this->getIteratorFromRelation($this->relations['multiple'][$itemName]); } /** * Returns a FOFTable object based on a given relation * * @param array $relation Indexed array holding relation definition. * tableClass => name of the related table class * localKey => name of the local key * remoteKey => name of the remote key * * @return FOFTable * * @throws RuntimeException * @throws InvalidArgumentException */ protected function getTableFromRelation($relation) { // Sanity checks if( !isset($relation['tableClass']) || !isset($relation['remoteKey']) || !isset($relation['localKey']) || !$relation['tableClass'] || !$relation['remoteKey'] || !$relation['localKey'] ) { throw new InvalidArgumentException('Missing array index for the '.__METHOD__.' method. Please check method signature', 500); } // Get a table object from the table class name $tableClass = $relation['tableClass']; $tableClassParts = FOFInflector::explode($tableClass); if(count($tableClassParts) < 3) { throw new InvalidArgumentException('Invalid table class named. It should be something like FooTableBar'); } $table = FOFTable::getInstance($tableClassParts[2], ucfirst($tableClassParts[0]) . ucfirst($tableClassParts[1])); // Get the table name $tableName = $table->getTableName(); // Get the remote and local key names $remoteKey = $relation['remoteKey']; $localKey = $relation['localKey']; // Get the local key's value $value = $this->table->$localKey; // If there's no value for the primary key, let's stop here if(!$value) { throw new RuntimeException('Missing value for the primary key of the table '.$this->table->getTableName(), 500); } // This is required to prevent one relation from killing the db cursor used in a different relation... $oldDb = $this->table->getDbo(); $oldDb->disconnect(); // YES, WE DO NEED TO DISCONNECT BEFORE WE CLONE THE DB OBJECT. ARGH! $db = clone $oldDb; $query = $db->getQuery(true) ->select('*') ->from($db->qn($tableName)) ->where($db->qn($remoteKey) . ' = ' . $db->q($value)); $db->setQuery($query, 0, 1); $data = $db->loadObject(); if (!is_object($data)) { throw new RuntimeException(sprintf('Cannot load item from relation against table %s column %s', $tableName, $remoteKey), 500); } $table->bind($data); return $table; } /** * Returns a FOFDatabaseIterator based on a given relation * * @param array $relation Indexed array holding relation definition. * tableClass => name of the related table class * localKey => name of the local key * remoteKey => name of the remote key * pivotTable => name of the pivot table (optional) * theirPivotKey => name of the remote key in the pivot table (mandatory if pivotTable is set) * ourPivotKey => name of our key in the pivot table (mandatory if pivotTable is set) * * @return FOFDatabaseIterator * * @throws RuntimeException * @throws InvalidArgumentException */ protected function getIteratorFromRelation($relation) { // Sanity checks if( !isset($relation['tableClass']) || !isset($relation['remoteKey']) || !isset($relation['localKey']) || !$relation['tableClass'] || !$relation['remoteKey'] || !$relation['localKey'] ) { throw new InvalidArgumentException('Missing array index for the '.__METHOD__.' method. Please check method signature', 500); } if(array_key_exists('pivotTable', $relation)) { if( !isset($relation['theirPivotKey']) || !isset($relation['ourPivotKey']) || !$relation['pivotTable'] || !$relation['theirPivotKey'] || !$relation['ourPivotKey'] ) { throw new InvalidArgumentException('Missing array index for the '.__METHOD__.' method. Please check method signature', 500); } } // Get a table object from the table class name $tableClass = $relation['tableClass']; $tableClassParts = FOFInflector::explode($tableClass); if(count($tableClassParts) < 3) { throw new InvalidArgumentException('Invalid table class named. It should be something like FooTableBar'); } $table = FOFTable::getInstance($tableClassParts[2], ucfirst($tableClassParts[0]) . ucfirst($tableClassParts[1])); // Get the table name $tableName = $table->getTableName(); // Get the remote and local key names $remoteKey = $relation['remoteKey']; $localKey = $relation['localKey']; // Get the local key's value $value = $this->table->$localKey; // If there's no value for the primary key, let's stop here if(!$value) { throw new RuntimeException('Missing value for the primary key of the table '.$this->table->getTableName(), 500); } // This is required to prevent one relation from killing the db cursor used in a different relation... $oldDb = $this->table->getDbo(); $oldDb->disconnect(); // YES, WE DO NEED TO DISCONNECT BEFORE WE CLONE THE DB OBJECT. ARGH! $db = clone $oldDb; // Begin the query $query = $db->getQuery(true) ->select('*') ->from($db->qn($tableName)); // Do we have a pivot table? $hasPivot = array_key_exists('pivotTable', $relation); // If we don't have pivot it's a straightforward query if (!$hasPivot) { $query->where($db->qn($remoteKey) . ' = ' . $db->q($value)); } // If we have a pivot table we have to do a subquery else { $subQuery = $db->getQuery(true) ->select($db->qn($relation['theirPivotKey'])) ->from($db->qn($relation['pivotTable'])) ->where($db->qn($relation['ourPivotKey']) . ' = ' . $db->q($value)); $query->where($db->qn($remoteKey) . ' IN (' . $subQuery . ')'); } $db->setQuery($query); $cursor = $db->execute(); $iterator = FOFDatabaseIterator::getIterator($db->name, $cursor, null, $tableClass); return $iterator; } /** * Add any bespoke relation which doesn't involve a pivot table. * * @param string $relationType The type of the relationship (parent, child, children) * @param string $itemName is how it will be known locally to the getRelatedItems method * @param string $tableClass if skipped it is defined automatically as ComponentnameTableItemname * @param string $localKey is the column containing our side of the FK relation, default: componentname_itemname_id * @param string $remoteKey is the remote table's FK column, default: componentname_itemname_id * @param boolean $default is this the default children relationship? * * @return void */ protected function addBespokeSimpleRelation($relationType, $itemName, $tableClass, $localKey, $remoteKey, $default) { $ourPivotKey = null; $theirPivotKey = null; $pivotTable = null; $this->normaliseParameters(false, $itemName, $tableClass, $localKey, $remoteKey, $ourPivotKey, $theirPivotKey, $pivotTable); $this->relations[$relationType][$itemName] = array( 'tableClass' => $tableClass, 'localKey' => $localKey, 'remoteKey' => $remoteKey, ); if ($default) { $this->defaultRelation[$relationType] = $itemName; } } /** * Add any bespoke relation which involves a pivot table. * * @param string $relationType The type of the relationship (multiple) * @param string $itemName is how it will be known locally to the getRelatedItems method * @param string $tableClass if skipped it is defined automatically as ComponentnameTableItemname * @param string $localKey is the column containing our side of the FK relation, default: componentname_itemname_id * @param string $remoteKey is the remote table's FK column, default: componentname_itemname_id * @param string $ourPivotKey is the column containing our side of the FK relation in the pivot table, default: $localKey * @param string $theirPivotKey is the column containing the other table's side of the FK relation in the pivot table, default $remoteKey * @param string $pivotTable is the name of the glue (pivot) table, default: #__componentname_thisclassname_itemname with plural items (e.g. #__foobar_users_roles) * @param boolean $default is this the default children relationship? * * @return void */ protected function addBespokePivotRelation($relationType, $itemName, $tableClass, $localKey, $remoteKey, $ourPivotKey, $theirPivotKey, $pivotTable, $default) { $this->normaliseParameters(true, $itemName, $tableClass, $localKey, $remoteKey, $ourPivotKey, $theirPivotKey, $pivotTable); $this->relations[$relationType][$itemName] = array( 'tableClass' => $tableClass, 'localKey' => $localKey, 'remoteKey' => $remoteKey, 'ourPivotKey' => $ourPivotKey, 'theirPivotKey' => $theirPivotKey, 'pivotTable' => $pivotTable, ); if ($default) { $this->defaultRelation[$relationType] = $itemName; } } /** * Normalise the parameters of a relation, guessing missing values * * @param boolean $pivot Is this a many to many relation involving a pivot table? * @param string $itemName is how it will be known locally to the getRelatedItems method (plural) * @param string $tableClass if skipped it is defined automatically as ComponentnameTableItemname * @param string $localKey is the column containing our side of the FK relation, default: componentname_itemname_id * @param string $remoteKey is the remote table's FK column, default: componentname_itemname_id * @param string $ourPivotKey is the column containing our side of the FK relation in the pivot table, default: $localKey * @param string $theirPivotKey is the column containing the other table's side of the FK relation in the pivot table, default $remoteKey * @param string $pivotTable is the name of the glue (pivot) table, default: #__componentname_thisclassname_itemname with plural items (e.g. #__foobar_users_roles) * * @return void */ protected function normaliseParameters($pivot = false, &$itemName, &$tableClass, &$localKey, &$remoteKey, &$ourPivotKey, &$theirPivotKey, &$pivotTable) { // Get a default table class if none is provided if (empty($tableClass)) { $tableClassParts = explode('_', $itemName, 3); if (count($tableClassParts) == 1) { array_unshift($tableClassParts, $this->componentName); } if ($tableClassParts[0] == 'joomla') { $tableClassParts[0] = 'J'; } $tableClass = ucfirst($tableClassParts[0]) . 'Table' . ucfirst(FOFInflector::singularize($tableClassParts[1])); } // Make sure we have both a local and remote key if (empty($localKey) && empty($remoteKey)) { // WARNING! If we have a pivot table, this behavior is wrong! // Infact if we have `parts` and `groups` the local key should be foobar_part_id and the remote one foobar_group_id. // However, this isn't a real issue because: // 1. we have no way to detect the local key of a multiple relation // 2. this scenario never happens, since, in this class, if we're adding a multiple relation we always supply the local key $tableClassParts = FOFInflector::explode($tableClass); $localKey = $tableClassParts[0] . '_' . $tableClassParts[2] . '_id'; $remoteKey = $localKey; } elseif (empty($localKey) && !empty($remoteKey)) { $localKey = $remoteKey; } elseif (!empty($localKey) && empty($remoteKey)) { if($pivot) { $tableClassParts = FOFInflector::explode($tableClass); $remoteKey = $tableClassParts[0] . '_' . $tableClassParts[2] . '_id'; } else { $remoteKey = $localKey; } } // If we don't have a pivot table nullify the relevant variables and return if (!$pivot) { $ourPivotKey = null; $theirPivotKey = null; $pivotTable = null; return; } if (empty($ourPivotKey)) { $ourPivotKey = $localKey; } if (empty($theirPivotKey)) { $theirPivotKey = $remoteKey; } if (empty($pivotTable)) { $pivotTable = '#__' . strtolower($this->componentName) . '_' . strtolower(FOFInflector::pluralize($this->tableType)) . '_'; $itemNameParts = explode('_', $itemName); $lastPart = array_pop($itemNameParts); $pivotTable .= strtolower($lastPart); } } /** * Normalises the format of a relation name * * @param string $itemName The raw relation name * @param boolean $pluralise Should I pluralise the name? If not, I will singularise it * * @return string The normalised relation key name */ protected function normaliseItemName($itemName, $pluralise = false) { // Explode the item name $itemNameParts = explode('_', $itemName); // If we have multiple parts the first part is considered to be the component name if (count($itemNameParts) > 1) { $prefix = array_shift($itemNameParts); } else { $prefix = null; } // If we still have multiple parts we need to pluralise/singularise the last part and join everything in // CamelCase format if (count($itemNameParts) > 1) { $name = array_pop($itemNameParts); $name = $pluralise ? FOFInflector::pluralize($name) : FOFInflector::singularize($name); $itemNameParts[] = $name; $itemName = FOFInflector::implode($itemNameParts); } // Otherwise we singularise/pluralise the remaining part else { $name = array_pop($itemNameParts); $itemName = $pluralise ? FOFInflector::pluralize($name) : FOFInflector::singularize($name); } if (!empty($prefix)) { $itemName = $prefix . '_' . $itemName; } return $itemName; } }PK���\<m'libraries/fof/table/behavior/assets.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage table * @copyright Copyright (C) 2010 - 2015 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 table behavior class for assets * * @package FrameworkOnFramework * @since 2.1 */ class FOFTableBehaviorAssets extends FOFTableBehavior { /** * The event which runs after storing (saving) data to the database * * @param FOFTable &$table The table which calls this event * * @return boolean True to allow saving */ public function onAfterStore(&$table) { $result = true; $asset_id_field = $table->getColumnAlias('asset_id'); if (in_array($asset_id_field, $table->getKnownFields())) { if (!empty($table->$asset_id_field)) { $currentAssetId = $table->$asset_id_field; } // The asset id field is managed privately by this class. if ($table->isAssetsTracked()) { unset($table->$asset_id_field); } } // Create the object used for inserting/udpating data to the database $fields = $table->getTableFields(); // Let's remove the asset_id field, since we unset the property above and we would get a PHP notice if (isset($fields[$asset_id_field])) { unset($fields[$asset_id_field]); } // Asset Tracking if (in_array($asset_id_field, $table->getKnownFields()) && $table->isAssetsTracked()) { $parentId = $table->getAssetParentId(); try{ $name = $table->getAssetName(); } catch(Exception $e) { $table->setError($e->getMessage()); return false; } $title = $table->getAssetTitle(); $asset = JTable::getInstance('Asset'); $asset->loadByName($name); // Re-inject the asset id. $this->$asset_id_field = $asset->id; // Check for an error. $error = $asset->getError(); // Since we are using JTable, there is no way to mock it and test for failures :( // @codeCoverageIgnoreStart if ($error) { $table->setError($error); return false; } // @codeCoverageIgnoreEnd // Specify how a new or moved node asset is inserted into the tree. // Since we're unsetting the table field before, this statement is always true... if (empty($table->$asset_id_field) || $asset->parent_id != $parentId) { $asset->setLocation($parentId, 'last-child'); } // Prepare the asset to be stored. $asset->parent_id = $parentId; $asset->name = $name; $asset->title = $title; if ($table->getRules() instanceof JAccessRules) { $asset->rules = (string) $table->getRules(); } // Since we are using JTable, there is no way to mock it and test for failures :( // @codeCoverageIgnoreStart if (!$asset->check() || !$asset->store()) { $table->setError($asset->getError()); return false; } // @codeCoverageIgnoreEnd // Create an asset_id or heal one that is corrupted. if (empty($table->$asset_id_field) || (($currentAssetId != $table->$asset_id_field) && !empty($table->$asset_id_field))) { // Update the asset_id field in this table. $table->$asset_id_field = (int) $asset->id; $k = $table->getKeyName(); $db = $table->getDbo(); $query = $db->getQuery(true) ->update($db->qn($table->getTableName())) ->set($db->qn($asset_id_field).' = ' . (int) $table->$asset_id_field) ->where($db->qn($k) . ' = ' . (int) $table->$k); $db->setQuery($query)->execute(); } $result = true; } return $result; } /** * The event which runs after binding data to the table * * @param FOFTable &$table The table which calls this event * @param object|array &$src The data to bind * * @return boolean True on success */ public function onAfterBind(&$table, &$src) { // Set rules for assets enabled tables if ($table->isAssetsTracked()) { // Bind the rules. if (isset($src['rules']) && is_array($src['rules'])) { // We have to manually remove any empty value, since they will be converted to int, // and "Inherited" values will become "Denied". Joomla is doing this manually, too. // @todo Should we move this logic inside the setRules method? $rules = array(); foreach ($src['rules'] as $action => $ids) { // Build the rules array. $rules[$action] = array(); foreach ($ids as $id => $p) { if ($p !== '') { $rules[$action][$id] = ($p == '1' || $p == 'true') ? true : false; } } } $table->setRules($rules); } } return true; } /** * The event which runs before deleting a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record to delete * * @return boolean True to allow the deletion */ public function onBeforeDelete(&$table, $oid) { // If tracking assets, remove the asset first. if ($table->isAssetsTracked()) { $k = $table->getKeyName(); // If the table is not loaded, let's try to load it with the id if(!$table->$k) { $table->load($oid); } // If I have an invalid assetName I have to stop try { $name = $table->getAssetName(); } catch(Exception $e) { $table->setError($e->getMessage()); return false; } // Do NOT touch JTable here -- we are loading the core asset table which is a JTable, not a FOFTable $asset = JTable::getInstance('Asset'); if ($asset->loadByName($name)) { // Since we are using JTable, there is no way to mock it and test for failures :( // @codeCoverageIgnoreStart if (!$asset->delete()) { $table->setError($asset->getError()); return false; } // @codeCoverageIgnoreEnd } else { // I'll simply return true even if I couldn't load the asset. In this way I can still // delete a broken record return true; } } return true; } } PK���\ւ0��%libraries/fof/table/behavior/tags.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage table * @copyright Copyright (C) 2010 - 2015 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 table behavior class for tags * * @package FrameworkOnFramework * @since 2.1 */ class FOFTableBehaviorTags extends FOFTableBehavior { /** * The event which runs after binding data to the table * * @param FOFTable &$table The table which calls this event * @param object|array &$src The data to bind * @param array $options The options of the table * * @return boolean True on success */ public function onAfterBind(&$table, &$src, $options = array()) { // Bind tags if ($table->hasTags()) { if ((!empty($src['tags']) && $src['tags'][0] != '')) { $table->newTags = $src['tags']; } // Check if the content type exists, and create it if it does not $table->checkContentType(); $tagsTable = clone($table); $tagsHelper = new JHelperTags(); $tagsHelper->typeAlias = $table->getContentType(); // TODO: This little guy here fails because JHelperTags // need a JTable object to work, while our is FOFTable // Need probably to write our own FOFHelperTags // Thank you com_tags if (!$tagsHelper->postStoreProcess($tagsTable)) { $table->setError('Error storing tags'); return false; } } return true; } /** * The event which runs before storing (saving) data to the database * * @param FOFTable &$table The table which calls this event * @param boolean $updateNulls Should nulls be saved as nulls (true) or just skipped over (false)? * * @return boolean True to allow saving */ public function onBeforeStore(&$table, $updateNulls) { if ($table->hasTags()) { $tagsHelper = new JHelperTags(); $tagsHelper->typeAlias = $table->getContentType(); // TODO: JHelperTags sucks in Joomla! 3.1, it requires that tags are // stored in the metadata property. Not our case, therefore we need // to add it in a fake object. We sent a PR to Joomla! CMS to fix // that. Once it's accepted, we'll have to remove the attrocity // here... $tagsTable = clone($table); $tagsHelper->preStoreProcess($tagsTable); } } /** * The event which runs after deleting a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record which was deleted * * @return boolean True to allow the deletion without errors */ public function onAfterDelete(&$table, $oid) { // If this resource has tags, delete the tags first if ($table->hasTags()) { $tagsHelper = new JHelperTags(); $tagsHelper->typeAlias = $table->getContentType(); if (!$tagsHelper->deleteTagData($table, $oid)) { $table->setError('Error deleting Tags'); return false; } } } } PK���\c�0hh/libraries/fof/table/behavior/contenthistory.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage table * @copyright Copyright (C) 2010 - 2015 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 table behavior class for content History * * @package FrameworkOnFramework * @since 2.2.0 */ class FOFTableBehaviorContenthistory extends FOFTableBehavior { /** * The event which runs after storing (saving) data to the database * * @param FOFTable &$table The table which calls this event * * @return boolean True to allow saving without an error */ public function onAfterStore(&$table) { $aliasParts = explode('.', $table->getContentType()); $table->checkContentType(); if (JComponentHelper::getParams($aliasParts[0])->get('save_history', 0)) { $historyHelper = new JHelperContenthistory($table->getContentType()); $historyHelper->store($table); } return true; } /** * The event which runs before deleting a record * * @param FOFTable &$table The table which calls this event * @param integer $oid The PK value of the record to delete * * @return boolean True to allow the deletion */ public function onBeforeDelete(&$table, $oid) { $aliasParts = explode('.', $table->getContentType()); if (JComponentHelper::getParams($aliasParts[0])->get('save_history', 0)) { $historyHelper = new JHelperContenthistory($table->getContentType()); $historyHelper->deleteHistory($table); } return true; } } PK���\,,�EaEalibraries/fof/table/table.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage table * @copyright Copyright (C) 2010 - 2015 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; /** * Normally this shouldn't be required. Some PHP versions, however, seem to * require this. Why? No idea whatsoever. If I remove it, FOF crashes on some * hosts. Same PHP version on another host and no problem occurs. Any takers? */ if (class_exists('FOFTable', false)) { return; } if (!interface_exists('JTableInterface', true)) { interface JTableInterface {} } /** * FrameworkOnFramework Table class. The Table is one part controller, one part * model and one part data adapter. It's supposed to handle operations for single * records. * * @package FrameworkOnFramework * @since 1.0 */ class FOFTable extends FOFUtilsObject implements JTableInterface { /** * Cache array for instances * * @var array */ protected static $instances = array(); /** * Include paths for searching for FOFTable classes. * * @var array */ protected static $_includePaths = array(); /** * The configuration parameters array * * @var array */ protected $config = array(); /** * Name of the database table to model. * * @var string */ protected $_tbl = ''; /** * Name of the primary key field in the table. * * @var string */ protected $_tbl_key = ''; /** * JDatabaseDriver object. * * @var JDatabaseDriver */ protected $_db; /** * Should rows be tracked as ACL assets? * * @var boolean */ protected $_trackAssets = false; /** * Does the resource support joomla tags? * * @var boolean */ protected $_has_tags = false; /** * The rules associated with this record. * * @var JAccessRules A JAccessRules object. */ protected $_rules; /** * Indicator that the tables have been locked. * * @var boolean */ protected $_locked = false; /** * If this is set to true, it triggers automatically plugin events for * table actions * * @var boolean */ protected $_trigger_events = false; /** * Table alias used in queries * * @var string */ protected $_tableAlias = false; /** * Array with alias for "special" columns such as ordering, hits etc etc * * @var array */ protected $_columnAlias = array(); /** * If set to true, it enabled automatic checks on fields based on columns properties * * @var boolean */ protected $_autoChecks = false; /** * Array with fields that should be skipped by automatic checks * * @var array */ protected $_skipChecks = array(); /** * Does the table actually exist? We need that to avoid PHP notices on * table-less views. * * @var boolean */ protected $_tableExists = true; /** * The asset key for items in this table. It's usually something in the * com_example.viewname format. They asset name will be this key appended * with the item's ID, e.g. com_example.viewname.123 * * @var string */ protected $_assetKey = ''; /** * The input data * * @var FOFInput */ protected $input = null; /** * Extended query including joins with other tables * * @var JDatabaseQuery */ protected $_queryJoin = null; /** * The prefix for the table class * * @var string */ protected $_tablePrefix = ''; /** * The known fields for this table * * @var array */ protected $knownFields = array(); /** * A list of table fields, keyed per table * * @var array */ protected static $tableFieldCache = array(); /** * A list of tables in the database * * @var array */ protected static $tableCache = array(); /** * An instance of FOFConfigProvider to provision configuration overrides * * @var FOFConfigProvider */ protected $configProvider = null; /** * FOFTableDispatcherBehavior for dealing with extra behaviors * * @var FOFTableDispatcherBehavior */ protected $tableDispatcher = null; /** * List of default behaviors to apply to the table * * @var array */ protected $default_behaviors = array('tags', 'assets'); /** * The relations object of the table. It's lazy-loaded by getRelations(). * * @var FOFTableRelations */ protected $_relations = null; /** * The configuration provider's key for this table, e.g. foobar.tables.bar for the #__foobar_bars table. This is set * automatically by the constructor * * @var string */ protected $_configProviderKey = ''; /** * The content type of the table. Required if using tags or content history behaviour * * @var string */ protected $contentType = null; /** * Returns a static object instance of a particular table type * * @param string $type The table name * @param string $prefix The prefix of the table class * @param array $config Optional configuration variables * * @return FOFTable */ public static function getInstance($type, $prefix = 'JTable', $config = array()) { return self::getAnInstance($type, $prefix, $config); } /** * Returns a static object instance of a particular table type * * @param string $type The table name * @param string $prefix The prefix of the table class * @param array $config Optional configuration variables * * @return FOFTable */ public static function &getAnInstance($type = null, $prefix = 'JTable', $config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } // Guess the component name if (!array_key_exists('input', $config)) { $config['input'] = new FOFInput; } if ($config['input'] instanceof FOFInput) { $tmpInput = $config['input']; } else { $tmpInput = new FOFInput($config['input']); } $option = $tmpInput->getCmd('option', ''); $tmpInput->set('option', $option); $config['input'] = $tmpInput; if (!in_array($prefix, array('Table', 'JTable'))) { preg_match('/(.*)Table$/', $prefix, $m); $option = 'com_' . strtolower($m[1]); } if (array_key_exists('option', $config)) { $option = $config['option']; } $config['option'] = $option; if (!array_key_exists('view', $config)) { $config['view'] = $config['input']->getCmd('view', 'cpanel'); } if (is_null($type)) { if ($prefix == 'JTable') { $prefix = 'Table'; } $type = $config['view']; } $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix . ucfirst($type); $config['_table_type'] = $type; $config['_table_class'] = $tableClass; $configProvider = new FOFConfigProvider; $configProviderKey = $option . '.views.' . FOFInflector::singularize($type) . '.config.'; if (!array_key_exists($tableClass, self::$instances)) { if (!class_exists($tableClass)) { $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($config['option']); $searchPaths = array( $componentPaths['main'] . '/tables', $componentPaths['admin'] . '/tables' ); if (array_key_exists('tablepath', $config)) { array_unshift($searchPaths, $config['tablepath']); } $altPath = $configProvider->get($configProviderKey . 'table_path', null); if ($altPath) { array_unshift($searchPaths, $componentPaths['admin'] . '/' . $altPath); } $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); $path = $filesystem->pathFind( $searchPaths, strtolower($type) . '.php' ); if ($path) { require_once $path; } } if (!class_exists($tableClass)) { $tableClass = 'FOFTable'; } $component = str_replace('com_', '', $config['option']); $tbl_common = $component . '_'; if (!array_key_exists('tbl', $config)) { $config['tbl'] = strtolower('#__' . $tbl_common . strtolower(FOFInflector::pluralize($type))); } $altTbl = $configProvider->get($configProviderKey . 'tbl', null); if ($altTbl) { $config['tbl'] = $altTbl; } if (!array_key_exists('tbl_key', $config)) { $keyName = FOFInflector::singularize($type); $config['tbl_key'] = strtolower($tbl_common . $keyName . '_id'); } $altTblKey = $configProvider->get($configProviderKey . 'tbl_key', null); if ($altTblKey) { $config['tbl_key'] = $altTblKey; } if (!array_key_exists('db', $config)) { $config['db'] = FOFPlatform::getInstance()->getDbo(); } // Assign the correct table alias if (array_key_exists('table_alias', $config)) { $table_alias = $config['table_alias']; } else { $configProviderTableAliasKey = $option . '.tables.' . FOFInflector::singularize($type) . '.tablealias'; $table_alias = $configProvider->get($configProviderTableAliasKey, false ); } // Can we use the FOF cache? if (!array_key_exists('use_table_cache', $config)) { $config['use_table_cache'] = FOFPlatform::getInstance()->isGlobalFOFCacheEnabled(); } $alt_use_table_cache = $configProvider->get($configProviderKey . 'use_table_cache', null); if (!is_null($alt_use_table_cache)) { $config['use_table_cache'] = $alt_use_table_cache; } // Create a new table instance $instance = new $tableClass($config['tbl'], $config['tbl_key'], $config['db'], $config); $instance->setInput($tmpInput); $instance->setTablePrefix($prefix); $instance->setTableAlias($table_alias); // Determine and set the asset key for this table $assetKey = 'com_' . $component . '.' . strtolower(FOFInflector::singularize($type)); $assetKey = $configProvider->get($configProviderKey . 'asset_key', $assetKey); $instance->setAssetKey($assetKey); if (array_key_exists('trigger_events', $config)) { $instance->setTriggerEvents($config['trigger_events']); } if (version_compare(JVERSION, '3.1', 'ge')) { if (array_key_exists('has_tags', $config)) { $instance->setHasTags($config['has_tags']); } $altHasTags = $configProvider->get($configProviderKey . 'has_tags', null); if ($altHasTags) { $instance->setHasTags($altHasTags); } } else { $instance->setHasTags(false); } $configProviderFieldmapKey = $option . '.tables.' . FOFInflector::singularize($type) . '.field'; $aliases = $configProvider->get($configProviderFieldmapKey, $instance->_columnAlias); $instance->_columnAlias = array_merge($instance->_columnAlias, $aliases); self::$instances[$tableClass] = $instance; } return self::$instances[$tableClass]; } /** * Force an instance inside class cache. Setting arguments to null nukes all or part of the cache * * @param string|null $key TableClass to replace. Set it to null to nuke the entire cache * @param FOFTable|null $instance Instance to replace. Set it to null to nuke $key instances * * @return bool Did I correctly switch the instance? */ public static function forceInstance($key = null, $instance = null) { if(is_null($key)) { self::$instances = array(); return true; } elseif($key && isset(self::$instances[$key])) { // I'm forcing an instance, but it's not a FOFTable, abort! abort! if(!$instance || ($instance && $instance instanceof FOFTable)) { self::$instances[$key] = $instance; return true; } } return false; } /** * Class Constructor. * * @param string $table Name of the database table to model. * @param string $key Name of the primary key field in the table. * @param JDatabaseDriver &$db Database driver * @param array $config The configuration parameters array */ public function __construct($table, $key, &$db, $config = array()) { $this->_tbl = $table; $this->_tbl_key = $key; $this->_db = $db; // Make sure the use FOF cache information is in the config if (!array_key_exists('use_table_cache', $config)) { $config['use_table_cache'] = FOFPlatform::getInstance()->isGlobalFOFCacheEnabled(); } $this->config = $config; // Load the configuration provider $this->configProvider = new FOFConfigProvider; // Load the behavior dispatcher $this->tableDispatcher = new FOFTableDispatcherBehavior; // Initialise the table properties. if ($fields = $this->getTableFields()) { // Do I have anything joined? $j_fields = $this->getQueryJoinFields(); if ($j_fields) { $fields = array_merge($fields, $j_fields); } $this->setKnownFields(array_keys($fields), true); $this->reset(); } else { $this->_tableExists = false; } // Get the input if (array_key_exists('input', $config)) { if ($config['input'] instanceof FOFInput) { $this->input = $config['input']; } else { $this->input = new FOFInput($config['input']); } } else { $this->input = new FOFInput; } // Set the $name/$_name variable $component = $this->input->getCmd('option', 'com_foobar'); if (array_key_exists('option', $config)) { $component = $config['option']; } $this->input->set('option', $component); // Apply table behaviors $type = explode("_", $this->_tbl); $type = $type[count($type) - 1]; $this->_configProviderKey = $component . '.tables.' . FOFInflector::singularize($type); $configKey = $this->_configProviderKey . '.behaviors'; if (isset($config['behaviors'])) { $behaviors = (array) $config['behaviors']; } elseif ($behaviors = $this->configProvider->get($configKey, null)) { $behaviors = explode(',', $behaviors); } else { $behaviors = $this->default_behaviors; } if (is_array($behaviors) && count($behaviors)) { foreach ($behaviors as $behavior) { $this->addBehavior($behavior); } } // If we are tracking assets, make sure an access field exists and initially set the default. $asset_id_field = $this->getColumnAlias('asset_id'); $access_field = $this->getColumnAlias('access'); if (in_array($asset_id_field, $this->getKnownFields())) { JLoader::import('joomla.access.rules'); $this->_trackAssets = true; } // If the access property exists, set the default. if (in_array($access_field, $this->getKnownFields())) { $this->$access_field = (int) FOFPlatform::getInstance()->getConfig()->get('access'); } $this->config = $config; } /** * Replace the entire known fields array * * @param array $fields A simple array of known field names * @param boolean $initialise Should we initialise variables to null? * * @return void */ public function setKnownFields($fields, $initialise = false) { $this->knownFields = $fields; if ($initialise) { foreach ($this->knownFields as $field) { $this->$field = null; } } } /** * Get the known fields array * * @return array */ public function getKnownFields() { return $this->knownFields; } /** * Does the specified field exist? * * @param string $fieldName The field name to search (it's OK to use aliases) * * @return bool */ public function hasField($fieldName) { $search = $this->getColumnAlias($fieldName); return in_array($search, $this->knownFields); } /** * Add a field to the known fields array * * @param string $field The name of the field to add * @param boolean $initialise Should we initialise the variable to null? * * @return void */ public function addKnownField($field, $initialise = false) { if (!in_array($field, $this->knownFields)) { $this->knownFields[] = $field; if ($initialise) { $this->$field = null; } } } /** * Remove a field from the known fields array * * @param string $field The name of the field to remove * * @return void */ public function removeKnownField($field) { if (in_array($field, $this->knownFields)) { $pos = array_search($field, $this->knownFields); unset($this->knownFields[$pos]); } } /** * Adds a behavior to the table * * @param string $name The name of the behavior * @param array $config Optional Behavior configuration * * @return boolean */ public function addBehavior($name, $config = array()) { // First look for ComponentnameTableViewnameBehaviorName (e.g. FoobarTableItemsBehaviorTags) if (isset($this->config['option'])) { $option_name = str_replace('com_', '', $this->config['option']); $behaviorClass = $this->config['_table_class'] . 'Behavior' . ucfirst(strtolower($name)); if (class_exists($behaviorClass)) { $behavior = new $behaviorClass($this->tableDispatcher, $config); return true; } // Then look for ComponentnameTableBehaviorName (e.g. FoobarTableBehaviorTags) $option_name = str_replace('com_', '', $this->config['option']); $behaviorClass = ucfirst($option_name) . 'TableBehavior' . ucfirst(strtolower($name)); if (class_exists($behaviorClass)) { $behavior = new $behaviorClass($this->tableDispatcher, $config); return true; } } // Nothing found? Return false. $behaviorClass = 'FOFTableBehavior' . ucfirst(strtolower($name)); if (class_exists($behaviorClass) && $this->tableDispatcher) { $behavior = new $behaviorClass($this->tableDispatcher, $config); return true; } return false; } /** * Sets the events trigger switch state * * @param boolean $newState The new state of the switch (what else could it be?) * * @return void */ public function setTriggerEvents($newState = false) { $this->_trigger_events = $newState ? true : false; } /** * Gets the events trigger switch state * * @return boolean */ public function getTriggerEvents() { return $this->_trigger_events; } /** * Gets the has tags switch state * * @return bool */ public function hasTags() { return $this->_has_tags; } /** * Sets the has tags switch state * * @param bool $newState */ public function setHasTags($newState = false) { $this->_has_tags = false; // Tags are available only in 3.1+ if (version_compare(JVERSION, '3.1', 'ge')) { $this->_has_tags = $newState ? true : false; } } /** * Set the class prefix * * @param string $prefix The prefix */ public function setTablePrefix($prefix) { $this->_tablePrefix = $prefix; } /** * Sets fields to be skipped from automatic checks. * * @param array/string $skip Fields to be skipped by automatic checks * * @return void */ public function setSkipChecks($skip) { $this->_skipChecks = (array) $skip; } /** * Method to load a row from the database by primary key and bind the fields * to the FOFTable instance properties. * * @param mixed $keys An optional primary key value to load the row by, or an array of fields to match. If not * set the instance property value is used. * @param boolean $reset True to reset the default values before loading the new row. * * @return boolean True if successful. False if row not found. * * @throws RuntimeException * @throws UnexpectedValueException */ public function load($keys = null, $reset = true) { if (!$this->_tableExists) { $result = false; return $this->onAfterLoad($result); } if (empty($keys)) { // If empty, use the value of the current key $keyName = $this->_tbl_key; if (isset($this->$keyName)) { $keyValue = $this->$keyName; } else { $keyValue = null; } // If empty primary key there's is no need to load anything if (empty($keyValue)) { $result = true; return $this->onAfterLoad($result); } $keys = array($keyName => $keyValue); } elseif (!is_array($keys)) { // Load by primary key. $keys = array($this->_tbl_key => $keys); } if ($reset) { $this->reset(); } // Initialise the query. $query = $this->_db->getQuery(true); $query->select($this->_tbl . '.*'); $query->from($this->_tbl); // Joined fields are ok, since I initialized them in the constructor $fields = $this->getKnownFields(); foreach ($keys as $field => $value) { // Check that $field is in the table. if (!in_array($field, $fields)) { throw new UnexpectedValueException(sprintf('Missing field in table %s : %s.', $this->_tbl, $field)); } // Add the search tuple to the query. $query->where($this->_db->qn($this->_tbl . '.' . $field) . ' = ' . $this->_db->q($value)); } // Do I have any joined table? $j_query = $this->getQueryJoin(); if ($j_query) { if ($j_query->select && $j_query->select->getElements()) { //$query->select($this->normalizeSelectFields($j_query->select->getElements(), true)); $query->select($j_query->select->getElements()); } if ($j_query->join) { foreach ($j_query->join as $join) { $t = (string) $join; // Joomla doesn't provide any access to the "name" variable, so I have to work with strings... if (stripos($t, 'inner') !== false) { $query->innerJoin($join->getElements()); } elseif (stripos($t, 'left') !== false) { $query->leftJoin($join->getElements()); } elseif (stripos($t, 'right') !== false) { $query->rightJoin($join->getElements()); } elseif (stripos($t, 'outer') !== false) { $query->outerJoin($join->getElements()); } } } } $this->_db->setQuery($query); $row = $this->_db->loadAssoc(); // Check that we have a result. if (empty($row)) { $result = false; return $this->onAfterLoad($result); } // Bind the object with the row and return. $result = $this->bind($row); $this->onAfterLoad($result); return $result; } /** * Based on fields properties (nullable column), checks if the field is required or not * * @return boolean */ public function check() { if (!$this->_autoChecks) { return true; } $fields = $this->getTableFields(); // No fields? Why in the hell am I here? if(!$fields) { return false; } $result = true; $known = $this->getKnownFields(); $skipFields[] = $this->_tbl_key; if(in_array($this->getColumnAlias('title'), $known) && in_array($this->getColumnAlias('slug'), $known)) $skipFields[] = $this->getColumnAlias('slug'); if(in_array($this->getColumnAlias('hits'), $known)) $skipFields[] = $this->getColumnAlias('hits'); if(in_array($this->getColumnAlias('created_on'), $known)) $skipFields[] = $this->getColumnAlias('created_on'); if(in_array($this->getColumnAlias('created_by'), $known)) $skipFields[] = $this->getColumnAlias('created_by'); if(in_array($this->getColumnAlias('modified_on'), $known)) $skipFields[] = $this->getColumnAlias('modified_on'); if(in_array($this->getColumnAlias('modified_by'), $known)) $skipFields[] = $this->getColumnAlias('modified_by'); if(in_array($this->getColumnAlias('locked_by'), $known)) $skipFields[] = $this->getColumnAlias('locked_by'); if(in_array($this->getColumnAlias('locked_on'), $known)) $skipFields[] = $this->getColumnAlias('locked_on'); // Let's merge it with custom skips $skipFields = array_merge($skipFields, $this->_skipChecks); foreach ($fields as $field) { $fieldName = $field->Field; if (empty($fieldName)) { $fieldName = $field->column_name; } // Field is not nullable but it's null, set error if ($field->Null == 'NO' && $this->$fieldName == '' && !in_array($fieldName, $skipFields)) { $text = str_replace('#__', 'COM_', $this->getTableName()) . '_ERR_' . $fieldName; $this->setError(JText::_(strtoupper($text))); $result = false; } } return $result; } /** * Method to reset class properties to the defaults set in the class * definition. It will ignore the primary key as well as any private class * properties. * * @return void */ public function reset() { if (!$this->onBeforeReset()) { return false; } // Get the default values for the class from the table. $fields = $this->getTableFields(); $j_fields = $this->getQueryJoinFields(); if ($j_fields) { $fields = array_merge($fields, $j_fields); } if (is_array($fields) && !empty($fields)) { foreach ($fields as $k => $v) { // If the property is not the primary key or private, reset it. if ($k != $this->_tbl_key && (strpos($k, '_') !== 0)) { $this->$k = $v->Default; } } if (!$this->onAfterReset()) { return false; } } } /** * Clones the current object, after resetting it * * @return static */ public function getClone() { $clone = clone $this; $clone->reset(); $key = $this->getKeyName(); $clone->$key = null; return $clone; } /** * Generic check for whether dependencies exist for this object in the db schema * * @param integer $oid The primary key of the record to delete * @param array $joins Any joins to foreign table, used to determine if dependent records exist * * @return boolean True if the record can be deleted */ public function canDelete($oid = null, $joins = null) { $k = $this->_tbl_key; if ($oid) { $this->$k = intval($oid); } if (is_array($joins)) { $db = $this->_db; $query = $db->getQuery(true) ->select($db->qn('master') . '.' . $db->qn($k)) ->from($db->qn($this->_tbl) . ' AS ' . $db->qn('master')); $tableNo = 0; foreach ($joins as $table) { $tableNo++; $query->select( array( 'COUNT(DISTINCT ' . $db->qn('t' . $tableNo) . '.' . $db->qn($table['idfield']) . ') AS ' . $db->qn($table['idalias']) ) ); $query->join('LEFT', $db->qn($table['name']) . ' AS ' . $db->qn('t' . $tableNo) . ' ON ' . $db->qn('t' . $tableNo) . '.' . $db->qn($table['joinfield']) . ' = ' . $db->qn('master') . '.' . $db->qn($k) ); } $query->where($db->qn('master') . '.' . $db->qn($k) . ' = ' . $db->q($this->$k)); $query->group($db->qn('master') . '.' . $db->qn($k)); $this->_db->setQuery((string) $query); if (version_compare(JVERSION, '3.0', 'ge')) { try { $obj = $this->_db->loadObject(); } catch (JDatabaseException $e) { $this->setError($e->getMessage()); } } else { if (!$obj = $this->_db->loadObject()) { $this->setError($this->_db->getErrorMsg()); return false; } } $msg = array(); $i = 0; foreach ($joins as $table) { $k = $table['idalias']; if ($obj->$k > 0) { $msg[] = JText::_($table['label']); } $i++; } if (count($msg)) { $option = $this->input->getCmd('option', 'com_foobar'); $comName = str_replace('com_', '', $option); $tview = str_replace('#__' . $comName . '_', '', $this->_tbl); $prefix = $option . '_' . $tview . '_NODELETE_'; foreach ($msg as $key) { $this->setError(JText::_($prefix . $key)); } return false; } else { return true; } } return true; } /** * Method to bind an associative array or object to the FOFTable instance.This * method only binds properties that are publicly accessible and optionally * takes an array of properties to ignore when binding. * * @param mixed $src An associative array or object to bind to the FOFTable instance. * @param mixed $ignore An optional array or space separated list of properties to ignore while binding. * * @return boolean True on success. * * @throws InvalidArgumentException */ public function bind($src, $ignore = array()) { if (!$this->onBeforeBind($src)) { return false; } // If the source value is not an array or object return false. if (!is_object($src) && !is_array($src)) { throw new InvalidArgumentException(sprintf('%s::bind(*%s*)', get_class($this), gettype($src))); } // If the source value is an object, get its accessible properties. if (is_object($src)) { $src = get_object_vars($src); } // If the ignore value is a string, explode it over spaces. if (!is_array($ignore)) { $ignore = explode(' ', $ignore); } // Bind the source value, excluding the ignored fields. foreach ($this->getKnownFields() as $k) { // Only process fields not in the ignore array. if (!in_array($k, $ignore)) { if (isset($src[$k])) { $this->$k = $src[$k]; } } } $result = $this->onAfterBind($src); return $result; } /** * Method to store a row in the database from the FOFTable instance properties. * If a primary key value is set the row with that primary key value will be * updated with the instance property values. If no primary key value is set * a new row will be inserted into the database with the properties from the * FOFTable instance. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. */ public function store($updateNulls = false) { if (!$this->onBeforeStore($updateNulls)) { return false; } $k = $this->_tbl_key; if ($this->$k == 0) { $this->$k = null; } // Create the object used for inserting/updating data to the database $fields = $this->getTableFields(); $properties = $this->getKnownFields(); $keys = array(); foreach ($properties as $property) { // 'input' property is a reserved name if (isset($fields[$property])) { $keys[] = $property; } } $updateObject = array(); foreach ($keys as $key) { $updateObject[$key] = $this->$key; } $updateObject = (object)$updateObject; // If a primary key exists update the object, otherwise insert it. if ($this->$k) { $result = $this->_db->updateObject($this->_tbl, $updateObject, $this->_tbl_key, $updateNulls); } else { $result = $this->_db->insertObject($this->_tbl, $updateObject, $this->_tbl_key); } if ($result !== true) { $this->setError($this->_db->getErrorMsg()); return false; } $this->bind($updateObject); if ($this->_locked) { $this->_unlock(); } $result = $this->onAfterStore(); return $result; } /** * Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause. * Negative numbers move the row up in the sequence and positive numbers move it down. * * @param integer $delta The direction and magnitude to move the row in the ordering sequence. * @param string $where WHERE clause to use for limiting the selection of rows to compact the * ordering values. * * @return mixed Boolean True on success. * * @throws UnexpectedValueException */ public function move($delta, $where = '') { if (!$this->onBeforeMove($delta, $where)) { return false; } // If there is no ordering field set an error and return false. $ordering_field = $this->getColumnAlias('ordering'); if (!in_array($ordering_field, $this->getKnownFields())) { throw new UnexpectedValueException(sprintf('%s does not support ordering.', $this->_tbl)); } // If the change is none, do nothing. if (empty($delta)) { $result = $this->onAfterMove(); return $result; } $k = $this->_tbl_key; $row = null; $query = $this->_db->getQuery(true); // If the table is not loaded, return false if (empty($this->$k)) { return false; } // Select the primary key and ordering values from the table. $query->select(array($this->_db->qn($this->_tbl_key), $this->_db->qn($ordering_field))); $query->from($this->_tbl); // If the movement delta is negative move the row up. if ($delta < 0) { $query->where($this->_db->qn($ordering_field) . ' < ' . $this->_db->q((int) $this->$ordering_field)); $query->order($this->_db->qn($ordering_field) . ' DESC'); } // If the movement delta is positive move the row down. elseif ($delta > 0) { $query->where($this->_db->qn($ordering_field) . ' > ' . $this->_db->q((int) $this->$ordering_field)); $query->order($this->_db->qn($ordering_field) . ' ASC'); } // Add the custom WHERE clause if set. if ($where) { $query->where($where); } // Select the first row with the criteria. $this->_db->setQuery($query, 0, 1); $row = $this->_db->loadObject(); // If a row is found, move the item. if (!empty($row)) { // Update the ordering field for this instance to the row's ordering value. $query = $this->_db->getQuery(true); $query->update($this->_tbl); $query->set($this->_db->qn($ordering_field) . ' = ' . $this->_db->q((int) $row->$ordering_field)); $query->where($this->_tbl_key . ' = ' . $this->_db->q($this->$k)); $this->_db->setQuery($query); $this->_db->execute(); // Update the ordering field for the row to this instance's ordering value. $query = $this->_db->getQuery(true); $query->update($this->_tbl); $query->set($this->_db->qn($ordering_field) . ' = ' . $this->_db->q((int) $this->$ordering_field)); $query->where($this->_tbl_key . ' = ' . $this->_db->q($row->$k)); $this->_db->setQuery($query); $this->_db->execute(); // Update the instance value. $this->$ordering_field = $row->$ordering_field; } else { // Update the ordering field for this instance. $query = $this->_db->getQuery(true); $query->update($this->_tbl); $query->set($this->_db->qn($ordering_field) . ' = ' . $this->_db->q((int) $this->$ordering_field)); $query->where($this->_tbl_key . ' = ' . $this->_db->q($this->$k)); $this->_db->setQuery($query); $this->_db->execute(); } $result = $this->onAfterMove(); return $result; } /** * Change the ordering of the records of the table * * @param string $where The WHERE clause of the SQL used to fetch the order * * @return boolean True is successful * * @throws UnexpectedValueException */ public function reorder($where = '') { if (!$this->onBeforeReorder($where)) { return false; } // If there is no ordering field set an error and return false. $order_field = $this->getColumnAlias('ordering'); if (!in_array($order_field, $this->getKnownFields())) { throw new UnexpectedValueException(sprintf('%s does not support ordering.', $this->_tbl_key)); } $k = $this->_tbl_key; // Get the primary keys and ordering values for the selection. $query = $this->_db->getQuery(true); $query->select($this->_tbl_key . ', ' . $this->_db->qn($order_field)); $query->from($this->_tbl); $query->where($this->_db->qn($order_field) . ' >= ' . $this->_db->q(0)); $query->order($this->_db->qn($order_field)); // Setup the extra where and ordering clause data. if ($where) { $query->where($where); } $this->_db->setQuery($query); $rows = $this->_db->loadObjectList(); // Compact the ordering values. foreach ($rows as $i => $row) { // Make sure the ordering is a positive integer. if ($row->$order_field >= 0) { // Only update rows that are necessary. if ($row->$order_field != $i + 1) { // Update the row ordering field. $query = $this->_db->getQuery(true); $query->update($this->_tbl); $query->set($this->_db->qn($order_field) . ' = ' . $this->_db->q($i + 1)); $query->where($this->_tbl_key . ' = ' . $this->_db->q($row->$k)); $this->_db->setQuery($query); $this->_db->execute(); } } } $result = $this->onAfterReorder(); return $result; } /** * Check out (lock) a record * * @param integer $userId The locking user's ID * @param integer $oid The primary key value of the record to lock * * @return boolean True on success */ public function checkout($userId, $oid = null) { $fldLockedBy = $this->getColumnAlias('locked_by'); $fldLockedOn = $this->getColumnAlias('locked_on'); if (!(in_array($fldLockedBy, $this->getKnownFields()) || in_array($fldLockedOn, $this->getKnownFields()))) { return true; } $k = $this->_tbl_key; if ($oid !== null) { $this->$k = $oid; } // No primary key defined, stop here if (!$this->$k) { return false; } $date = FOFPlatform::getInstance()->getDate(); $time = $date->toSql(); $query = $this->_db->getQuery(true) ->update($this->_db->qn($this->_tbl)) ->set( array( $this->_db->qn($fldLockedBy) . ' = ' . $this->_db->q((int) $userId), $this->_db->qn($fldLockedOn) . ' = ' . $this->_db->q($time) ) ) ->where($this->_db->qn($this->_tbl_key) . ' = ' . $this->_db->q($this->$k)); $this->_db->setQuery((string) $query); $this->$fldLockedBy = $userId; $this->$fldLockedOn = $time; return $this->_db->execute(); } /** * Check in (unlock) a record * * @param integer $oid The primary key value of the record to unlock * * @return boolean True on success */ public function checkin($oid = null) { $fldLockedBy = $this->getColumnAlias('locked_by'); $fldLockedOn = $this->getColumnAlias('locked_on'); if (!(in_array($fldLockedBy, $this->getKnownFields()) || in_array($fldLockedOn, $this->getKnownFields()))) { return true; } $k = $this->_tbl_key; if ($oid !== null) { $this->$k = $oid; } if ($this->$k == null) { return false; } $query = $this->_db->getQuery(true) ->update($this->_db->qn($this->_tbl)) ->set( array( $this->_db->qn($fldLockedBy) . ' = 0', $this->_db->qn($fldLockedOn) . ' = ' . $this->_db->q($this->_db->getNullDate()) ) ) ->where($this->_db->qn($this->_tbl_key) . ' = ' . $this->_db->q($this->$k)); $this->_db->setQuery((string) $query); $this->$fldLockedBy = 0; $this->$fldLockedOn = ''; return $this->_db->execute(); } /** * Is a record locked? * * @param integer $with The userid to preform the match with. If an item is checked * out by this user the function will return false. * @param integer $unused_against Junk inherited from JTable; ignore * * @throws UnexpectedValueException * * @return boolean True if the record is locked by another user */ public function isCheckedOut($with = 0, $unused_against = null) { $against = null; $fldLockedBy = $this->getColumnAlias('locked_by'); $k = $this->_tbl_key; // If no primary key is given, return false. if ($this->$k === null) { throw new UnexpectedValueException('Null primary key not allowed.'); } if (isset($this) && is_a($this, 'FOFTable') && !$against) { $against = $this->get($fldLockedBy); } // Item is not checked out, or being checked out by the same user if (!$against || $against == $with) { return false; } $session = JTable::getInstance('session'); return $session->exists($against); } /** * Copy (duplicate) one or more records * * @param integer|array $cid The primary key value (or values) or the record(s) to copy * * @return boolean True on success */ public function copy($cid = null) { //We have to cast the id as array, or the helper function will return an empty set if($cid) { $cid = (array) $cid; } FOFUtilsArray::toInteger($cid); $k = $this->_tbl_key; if (count($cid) < 1) { if ($this->$k) { $cid = array($this->$k); } else { $this->setError("No items selected."); return false; } } $created_by = $this->getColumnAlias('created_by'); $created_on = $this->getColumnAlias('created_on'); $modified_by = $this->getColumnAlias('modified_by'); $modified_on = $this->getColumnAlias('modified_on'); $locked_byName = $this->getColumnAlias('locked_by'); $checkin = in_array($locked_byName, $this->getKnownFields()); foreach ($cid as $item) { // Prevent load with id = 0 if (!$item) { continue; } $this->load($item); if ($checkin) { // We're using the checkin and the record is used by someone else if ($this->isCheckedOut($item)) { continue; } } if (!$this->onBeforeCopy($item)) { continue; } $this->$k = null; $this->$created_by = null; $this->$created_on = null; $this->$modified_on = null; $this->$modified_by = null; // Let's fire the event only if everything is ok if ($this->store()) { $this->onAfterCopy($item); } $this->reset(); } return true; } /** * Publish or unpublish records * * @param integer|array $cid The primary key value(s) of the item(s) to publish/unpublish * @param integer $publish 1 to publish an item, 0 to unpublish * @param integer $user_id The user ID of the user (un)publishing the item. * * @return boolean True on success, false on failure (e.g. record is locked) */ public function publish($cid = null, $publish = 1, $user_id = 0) { $enabledName = $this->getColumnAlias('enabled'); $locked_byName = $this->getColumnAlias('locked_by'); // Mhm... you called the publish method on a table without publish support... if(!in_array($enabledName, $this->getKnownFields())) { return false; } //We have to cast the id as array, or the helper function will return an empty set if($cid) { $cid = (array) $cid; } FOFUtilsArray::toInteger($cid); $user_id = (int) $user_id; $publish = (int) $publish; $k = $this->_tbl_key; if (count($cid) < 1) { if ($this->$k) { $cid = array($this->$k); } else { $this->setError("No items selected."); return false; } } if (!$this->onBeforePublish($cid, $publish)) { return false; } $query = $this->_db->getQuery(true) ->update($this->_db->qn($this->_tbl)) ->set($this->_db->qn($enabledName) . ' = ' . (int) $publish); $checkin = in_array($locked_byName, $this->getKnownFields()); if ($checkin) { $query->where( ' (' . $this->_db->qn($locked_byName) . ' = 0 OR ' . $this->_db->qn($locked_byName) . ' = ' . (int) $user_id . ')', 'AND' ); } // TODO Rewrite this statment using IN. Check if it work in SQLServer and PostgreSQL $cids = $this->_db->qn($k) . ' = ' . implode(' OR ' . $this->_db->qn($k) . ' = ', $cid); $query->where('(' . $cids . ')'); $this->_db->setQuery((string) $query); if (version_compare(JVERSION, '3.0', 'ge')) { try { $this->_db->execute(); } catch (JDatabaseException $e) { $this->setError($e->getMessage()); } } else { if (!$this->_db->execute()) { $this->setError($this->_db->getErrorMsg()); return false; } } if (count($cid) == 1 && $checkin) { if ($this->_db->getAffectedRows() == 1) { $this->checkin($cid[0]); if ($this->$k == $cid[0]) { $this->$enabledName = $publish; } } } $this->setError(''); return true; } /** * Delete a record * * @param integer $oid The primary key value of the item to delete * * @throws UnexpectedValueException * * @return boolean True on success */ public function delete($oid = null) { if ($oid) { $this->load($oid); } $k = $this->_tbl_key; $pk = (!$oid) ? $this->$k : $oid; // If no primary key is given, return false. if (!$pk) { throw new UnexpectedValueException('Null primary key not allowed.'); } // Execute the logic only if I have a primary key, otherwise I could have weird results if (!$this->onBeforeDelete($oid)) { return false; } // Delete the row by primary key. $query = $this->_db->getQuery(true); $query->delete(); $query->from($this->_tbl); $query->where($this->_tbl_key . ' = ' . $this->_db->q($pk)); $this->_db->setQuery($query); $this->_db->execute(); $result = $this->onAfterDelete($oid); return $result; } /** * Register a hit on a record * * @param integer $oid The primary key value of the record * @param boolean $log Should I log the hit? * * @return boolean True on success */ public function hit($oid = null, $log = false) { if (!$this->onBeforeHit($oid, $log)) { return false; } // If there is no hits field, just return true. $hits_field = $this->getColumnAlias('hits'); if (!in_array($hits_field, $this->getKnownFields())) { return true; } $k = $this->_tbl_key; $pk = ($oid) ? $oid : $this->$k; // If no primary key is given, return false. if (!$pk) { $result = false; } else { // Check the row in by primary key. $query = $this->_db->getQuery(true) ->update($this->_tbl) ->set($this->_db->qn($hits_field) . ' = (' . $this->_db->qn($hits_field) . ' + 1)') ->where($this->_tbl_key . ' = ' . $this->_db->q($pk)); $this->_db->setQuery($query)->execute(); // In order to update the table object, I have to load the table if(!$this->$k) { $query = $this->_db->getQuery(true) ->select($this->_db->qn($hits_field)) ->from($this->_db->qn($this->_tbl)) ->where($this->_db->qn($this->_tbl_key) . ' = ' . $this->_db->q($pk)); $this->$hits_field = $this->_db->setQuery($query)->loadResult(); } else { // Set table values in the object. $this->$hits_field++; } $result = true; } if ($result) { $result = $this->onAfterHit($oid); } return $result; } /** * Export the item as a CSV line * * @param string $separator CSV separator. Tip: use "\t" to get a TSV file instead. * * @return string The CSV line */ public function toCSV($separator = ',') { $csv = array(); foreach (get_object_vars($this) as $k => $v) { if (!in_array($k, $this->getKnownFields())) { continue; } $csv[] = '"' . str_replace('"', '""', $v) . '"'; } $csv = implode($separator, $csv); return $csv; } /** * Exports the table in array format * * @return array */ public function getData() { $ret = array(); foreach (get_object_vars($this) as $k => $v) { if (!in_array($k, $this->getKnownFields())) { continue; } $ret[$k] = $v; } return $ret; } /** * Get the header for exporting item list to CSV * * @param string $separator CSV separator. Tip: use "\t" to get a TSV file instead. * * @return string The CSV file's header */ public function getCSVHeader($separator = ',') { $csv = array(); foreach (get_object_vars($this) as $k => $v) { if (!in_array($k, $this->getKnownFields())) { continue; } $csv[] = '"' . str_replace('"', '\"', $k) . '"'; } $csv = implode($separator, $csv); return $csv; } /** * Get the columns from a database table. * * @param string $tableName Table name. If null current table is used * * @return mixed An array of the field names, or false if an error occurs. */ public function getTableFields($tableName = null) { // Should I load the cached data? $useCache = array_key_exists('use_table_cache', $this->config) ? $this->config['use_table_cache'] : false; // Make sure we have a list of tables in this db if (empty(self::$tableCache)) { if ($useCache) { // Try to load table cache from a cache file $cacheData = FOFPlatform::getInstance()->getCache('tables', null); // Unserialise the cached data, or set the table cache to empty // if the cache data wasn't loaded. if (!is_null($cacheData)) { self::$tableCache = json_decode($cacheData, true); } else { self::$tableCache = array(); } } // This check is true if the cache data doesn't exist / is not loaded if (empty(self::$tableCache)) { self::$tableCache = $this->_db->getTableList(); if ($useCache) { FOFPlatform::getInstance()->setCache('tables', json_encode(self::$tableCache)); } } } // Make sure the cached table fields cache is loaded if (empty(self::$tableFieldCache)) { if ($useCache) { // Try to load table cache from a cache file $cacheData = FOFPlatform::getInstance()->getCache('tablefields', null); // Unserialise the cached data, or set to empty if the cache // data wasn't loaded. if (!is_null($cacheData)) { $decoded = json_decode($cacheData, true); $tableCache = array(); if (count($decoded)) { foreach ($decoded as $myTableName => $tableFields) { $temp = array(); if (is_array($tableFields)) { foreach($tableFields as $field => $def) { $temp[$field] = (object)$def; } $tableCache[$myTableName] = $temp; } elseif (is_object($tableFields) || is_bool($tableFields)) { $tableCache[$myTableName] = $tableFields; } } } self::$tableFieldCache = $tableCache; } else { self::$tableFieldCache = array(); } } } if (!$tableName) { $tableName = $this->_tbl; } // Try to load again column specifications if the table is not loaded OR if it's loaded and // the previous call returned an error if (!array_key_exists($tableName, self::$tableFieldCache) || (isset(self::$tableFieldCache[$tableName]) && !self::$tableFieldCache[$tableName])) { // Lookup the fields for this table only once. $name = $tableName; $prefix = $this->_db->getPrefix(); if (substr($name, 0, 3) == '#__') { $checkName = $prefix . substr($name, 3); } else { $checkName = $name; } if (!in_array($checkName, self::$tableCache)) { // The table doesn't exist. Return false. self::$tableFieldCache[$tableName] = false; } elseif (version_compare(JVERSION, '3.0', 'ge')) { $fields = $this->_db->getTableColumns($name, false); if (empty($fields)) { $fields = false; } self::$tableFieldCache[$tableName] = $fields; } else { $fields = $this->_db->getTableFields($name, false); if (!isset($fields[$name])) { $fields = false; } self::$tableFieldCache[$tableName] = $fields[$name]; } // PostgreSQL date type compatibility if (($this->_db->name == 'postgresql') && (self::$tableFieldCache[$tableName] != false)) { foreach (self::$tableFieldCache[$tableName] as $field) { if (strtolower($field->type) == 'timestamp without time zone') { if (stristr($field->Default, '\'::timestamp without time zone')) { list ($date, $junk) = explode('::', $field->Default, 2); $field->Default = trim($date, "'"); } } } } // Save the data for this table into the cache if ($useCache) { $cacheData = FOFPlatform::getInstance()->setCache('tablefields', json_encode(self::$tableFieldCache)); } } return self::$tableFieldCache[$tableName]; } public function getTableAlias() { return $this->_tableAlias; } public function setTableAlias($string) { $string = preg_replace('#[^A-Z0-9_]#i', '', $string); $this->_tableAlias = $string; } /** * Method to return the real name of a "special" column such as ordering, hits, published * etc etc. In this way you are free to follow your db naming convention and use the * built in Joomla functions. * * @param string $column Name of the "special" column (ie ordering, hits etc etc) * * @return string The string that identify the special */ public function getColumnAlias($column) { if (isset($this->_columnAlias[$column])) { $return = $this->_columnAlias[$column]; } else { $return = $column; } $return = preg_replace('#[^A-Z0-9_]#i', '', $return); return $return; } /** * Method to register a column alias for a "special" column. * * @param string $column The "special" column (ie ordering) * @param string $columnAlias The real column name (ie foo_ordering) * * @return void */ public function setColumnAlias($column, $columnAlias) { $column = strtolower($column); $column = preg_replace('#[^A-Z0-9_]#i', '', $column); $this->_columnAlias[$column] = $columnAlias; } /** * Get a JOIN query, used to join other tables * * @param boolean $asReference Return an object reference instead of a copy * * @return JDatabaseQuery Query used to join other tables */ public function getQueryJoin($asReference = false) { if ($asReference) { return $this->_queryJoin; } else { if ($this->_queryJoin) { return clone $this->_queryJoin; } else { return null; } } } /** * Sets the query with joins to other tables * * @param JDatabaseQuery $query The JOIN query to use * * @return void */ public function setQueryJoin(JDatabaseQuery $query) { $this->_queryJoin = $query; } /** * Extracts the fields from the join query * * @return array Fields contained in the join query */ protected function getQueryJoinFields() { $query = $this->getQueryJoin(); if (!$query) { return array(); } $tables = array(); $j_tables = array(); $j_fields = array(); // Get joined tables. Ignore FROM clause, since it should not be used (the starting point is the table "table") $joins = $query->join; foreach ($joins as $join) { $tables = array_merge($tables, $join->getElements()); } // Clean up table names foreach($tables as $table) { preg_match('#(.*)((\w)*(on|using))(.*)#i', $table, $matches); if($matches && isset($matches[1])) { // I always want the first part, no matter what $parts = explode(' ', $matches[1]); $t_table = $parts[0]; if($this->isQuoted($t_table)) { $t_table = substr($t_table, 1, strlen($t_table) - 2); } if(!in_array($t_table, $j_tables)) { $j_tables[] = $t_table; } } } // Do I have the current table inside the query join? Remove it (its fields are already ok) $find = array_search($this->getTableName(), $j_tables); if($find !== false) { unset($j_tables[$find]); } // Get table fields $fields = array(); foreach ($j_tables as $table) { $t_fields = $this->getTableFields($table); if ($t_fields) { $fields = array_merge($fields, $t_fields); } } // Remove any fields that aren't in the joined select $j_select = $query->select; if ($j_select && $j_select->getElements()) { $j_fields = $this->normalizeSelectFields($j_select->getElements()); } // I can intesect the keys $fields = array_intersect_key($fields, $j_fields); // Now I walk again the array to change the key of columns that have an alias foreach ($j_fields as $column => $alias) { if ($column != $alias) { $fields[$alias] = $fields[$column]; unset($fields[$column]); } } return $fields; } /** * Normalizes the fields, returning an associative array with all the fields. * Ie array('foobar as foo, bar') becomes array('foobar' => 'foo', 'bar' => 'bar') * * @param array $fields Array with column fields * * @return array Normalized array */ protected function normalizeSelectFields($fields) { $db = FOFPlatform::getInstance()->getDbo(); $return = array(); foreach ($fields as $field) { $t_fields = explode(',', $field); foreach ($t_fields as $t_field) { // Is there any alias? $parts = preg_split('#\sas\s#i', $t_field); // Do I have a table.column situation? Let's get the field name $tableField = explode('.', $parts[0]); if(isset($tableField[1])) { $column = trim($tableField[1]); } else { $column = trim($tableField[0]); } // Is this field quoted? If so, remove the quotes if($this->isQuoted($column)) { $column = substr($column, 1, strlen($column) - 2); } if(isset($parts[1])) { $alias = trim($parts[1]); // Is this field quoted? If so, remove the quotes if($this->isQuoted($alias)) { $alias = substr($alias, 1, strlen($alias) - 2); } } else { $alias = $column; } $return[$column] = $alias; } } return $return; } /** * Is the field quoted? * * @param string $column Column field * * @return bool Is the field quoted? */ protected function isQuoted($column) { // Empty string, un-quoted by definition if(!$column) { return false; } // I need some "magic". If the first char is not a letter, a number // an underscore or # (needed for table), then most likely the field is quoted preg_match_all('/^[a-z0-9_#]/i', $column, $matches); if(!$matches[0]) { return true; } return false; } /** * The event which runs before binding data to the table * * NOTE TO 3RD PARTY DEVELOPERS: * * When you override the following methods in your child classes, * be sure to call parent::method *AFTER* your code, otherwise the * plugin events do NOT get triggered * * Example: * protected function onBeforeBind(){ * // Your code here * return parent::onBeforeBind() && $your_result; * } * * Do not do it the other way around, e.g. return $your_result && parent::onBeforeBind() * Due to PHP short-circuit boolean evaluation the parent::onBeforeBind() * will not be called if $your_result is false. * * @param object|array &$from The data to bind * * @return boolean True on success */ protected function onBeforeBind(&$from) { // Call the behaviors $result = $this->tableDispatcher->trigger('onBeforeBind', array(&$this, &$from)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onBeforeBind' . ucfirst($name), array(&$this, &$from)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs after loading a record from the database * * @param boolean &$result Did the load succeeded? * * @return void */ protected function onAfterLoad(&$result) { // Call the behaviors $eventResult = $this->tableDispatcher->trigger('onAfterLoad', array(&$this, &$result)); if (in_array(false, $eventResult, true)) { // Behavior failed, return false $result = false; return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); FOFPlatform::getInstance()->runPlugins('onAfterLoad' . ucfirst($name), array(&$this, &$result)); } } /** * The event which runs before storing (saving) data to the database * * @param boolean $updateNulls Should nulls be saved as nulls (true) or just skipped over (false)? * * @return boolean True to allow saving */ protected function onBeforeStore($updateNulls) { // Do we have a "Created" set of fields? $created_on = $this->getColumnAlias('created_on'); $created_by = $this->getColumnAlias('created_by'); $modified_on = $this->getColumnAlias('modified_on'); $modified_by = $this->getColumnAlias('modified_by'); $locked_on = $this->getColumnAlias('locked_on'); $locked_by = $this->getColumnAlias('locked_by'); $title = $this->getColumnAlias('title'); $slug = $this->getColumnAlias('slug'); $hasCreatedOn = in_array($created_on, $this->getKnownFields()); $hasCreatedBy = in_array($created_by, $this->getKnownFields()); if ($hasCreatedOn && $hasCreatedBy) { $hasModifiedOn = in_array($modified_on, $this->getKnownFields()); $hasModifiedBy = in_array($modified_by, $this->getKnownFields()); $nullDate = $this->_db->getNullDate(); if (empty($this->$created_by) || ($this->$created_on == $nullDate) || empty($this->$created_on)) { $uid = FOFPlatform::getInstance()->getUser()->id; if ($uid) { $this->$created_by = FOFPlatform::getInstance()->getUser()->id; } $date = FOFPlatform::getInstance()->getDate('now', null, false); $this->$created_on = $date->toSql(); } elseif ($hasModifiedOn && $hasModifiedBy) { $uid = FOFPlatform::getInstance()->getUser()->id; if ($uid) { $this->$modified_by = FOFPlatform::getInstance()->getUser()->id; } $date = FOFPlatform::getInstance()->getDate('now', null, false); $this->$modified_on = $date->toSql(); } } // Do we have a set of title and slug fields? $hasTitle = in_array($title, $this->getKnownFields()); $hasSlug = in_array($slug, $this->getKnownFields()); if ($hasTitle && $hasSlug) { if (empty($this->$slug)) { // Create a slug from the title $this->$slug = FOFStringUtils::toSlug($this->$title); } else { // Filter the slug for invalid characters $this->$slug = FOFStringUtils::toSlug($this->$slug); } // Make sure we don't have a duplicate slug on this table $db = $this->getDbo(); $query = $db->getQuery(true) ->select($db->qn($slug)) ->from($this->_tbl) ->where($db->qn($slug) . ' = ' . $db->q($this->$slug)) ->where('NOT ' . $db->qn($this->_tbl_key) . ' = ' . $db->q($this->{$this->_tbl_key})); $db->setQuery($query); $existingItems = $db->loadAssocList(); $count = 0; $newSlug = $this->$slug; while (!empty($existingItems)) { $count++; $newSlug = $this->$slug . '-' . $count; $query = $db->getQuery(true) ->select($db->qn($slug)) ->from($this->_tbl) ->where($db->qn($slug) . ' = ' . $db->q($newSlug)) ->where('NOT '. $db->qn($this->_tbl_key) . ' = ' . $db->q($this->{$this->_tbl_key})); $db->setQuery($query); $existingItems = $db->loadAssocList(); } $this->$slug = $newSlug; } // Call the behaviors $result = $this->tableDispatcher->trigger('onBeforeStore', array(&$this, $updateNulls)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } // Execute onBeforeStore<tablename> events in loaded plugins if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onBeforeStore' . ucfirst($name), array(&$this, $updateNulls)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs after binding data to the class * * @param object|array &$src The data to bind * * @return boolean True to allow binding without an error */ protected function onAfterBind(&$src) { // Call the behaviors $options = array( 'component' => $this->input->get('option'), 'view' => $this->input->get('view'), 'table_prefix' => $this->_tablePrefix ); $result = $this->tableDispatcher->trigger('onAfterBind', array(&$this, &$src, $options)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onAfterBind' . ucfirst($name), array(&$this, &$src)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs after storing (saving) data to the database * * @return boolean True to allow saving without an error */ protected function onAfterStore() { // Call the behaviors $result = $this->tableDispatcher->trigger('onAfterStore', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onAfterStore' . ucfirst($name), array(&$this)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs before moving a record * * @param boolean $updateNulls Should nulls be saved as nulls (true) or just skipped over (false)? * * @return boolean True to allow moving */ protected function onBeforeMove($updateNulls) { // Call the behaviors $result = $this->tableDispatcher->trigger('onBeforeMove', array(&$this, $updateNulls)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onBeforeMove' . ucfirst($name), array(&$this, $updateNulls)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs after moving a record * * @return boolean True to allow moving without an error */ protected function onAfterMove() { // Call the behaviors $result = $this->tableDispatcher->trigger('onAfterMove', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onAfterMove' . ucfirst($name), array(&$this)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs before reordering a table * * @param string $where The WHERE clause of the SQL query to run on reordering (record filter) * * @return boolean True to allow reordering */ protected function onBeforeReorder($where = '') { // Call the behaviors $result = $this->tableDispatcher->trigger('onBeforeReorder', array(&$this, $where)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onBeforeReorder' . ucfirst($name), array(&$this, $where)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs after reordering a table * * @return boolean True to allow the reordering to complete without an error */ protected function onAfterReorder() { // Call the behaviors $result = $this->tableDispatcher->trigger('onAfterReorder', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onAfterReorder' . ucfirst($name), array(&$this)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs before deleting a record * * @param integer $oid The PK value of the record to delete * * @return boolean True to allow the deletion */ protected function onBeforeDelete($oid) { // Call the behaviors $result = $this->tableDispatcher->trigger('onBeforeDelete', array(&$this, $oid)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onBeforeDelete' . ucfirst($name), array(&$this, $oid)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs after deleting a record * * @param integer $oid The PK value of the record which was deleted * * @return boolean True to allow the deletion without errors */ protected function onAfterDelete($oid) { // Call the behaviors $result = $this->tableDispatcher->trigger('onAfterDelete', array(&$this, $oid)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onAfterDelete' . ucfirst($name), array(&$this, $oid)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs before hitting a record * * @param integer $oid The PK value of the record to hit * @param boolean $log Should we log the hit? * * @return boolean True to allow the hit */ protected function onBeforeHit($oid, $log) { // Call the behaviors $result = $this->tableDispatcher->trigger('onBeforeHit', array(&$this, $oid, $log)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onBeforeHit' . ucfirst($name), array(&$this, $oid, $log)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs after hitting a record * * @param integer $oid The PK value of the record which was hit * * @return boolean True to allow the hitting without errors */ protected function onAfterHit($oid) { // Call the behaviors $result = $this->tableDispatcher->trigger('onAfterHit', array(&$this, $oid)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onAfterHit' . ucfirst($name), array(&$this, $oid)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The even which runs before copying a record * * @param integer $oid The PK value of the record being copied * * @return boolean True to allow the copy to take place */ protected function onBeforeCopy($oid) { // Call the behaviors $result = $this->tableDispatcher->trigger('onBeforeCopy', array(&$this, $oid)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onBeforeCopy' . ucfirst($name), array(&$this, $oid)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The even which runs after copying a record * * @param integer $oid The PK value of the record which was copied (not the new one) * * @return boolean True to allow the copy without errors */ protected function onAfterCopy($oid) { // Call the behaviors $result = $this->tableDispatcher->trigger('onAfterCopy', array(&$this, $oid)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onAfterCopy' . ucfirst($name), array(&$this, $oid)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs before a record is (un)published * * @param integer|array &$cid The PK IDs of the records being (un)published * @param integer $publish 1 to publish, 0 to unpublish * * @return boolean True to allow the (un)publish to proceed */ protected function onBeforePublish(&$cid, $publish) { // Call the behaviors $result = $this->tableDispatcher->trigger('onBeforePublish', array(&$this, &$cid, $publish)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onBeforePublish' . ucfirst($name), array(&$this, &$cid, $publish)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The event which runs after the object is reset to its default values. * * @return boolean True to allow the reset to complete without errors */ protected function onAfterReset() { // Call the behaviors $result = $this->tableDispatcher->trigger('onAfterReset', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onAfterReset' . ucfirst($name), array(&$this)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * The even which runs before the object is reset to its default values. * * @return boolean True to allow the reset to complete */ protected function onBeforeReset() { // Call the behaviors $result = $this->tableDispatcher->trigger('onBeforeReset', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } if ($this->_trigger_events) { $name = FOFInflector::pluralize($this->getKeyName()); $result = FOFPlatform::getInstance()->runPlugins('onBeforeReset' . ucfirst($name), array(&$this)); if (in_array(false, $result, true)) { return false; } else { return true; } } return true; } /** * Replace the input object of this table with the provided FOFInput object * * @param FOFInput $input The new input object * * @return void */ public function setInput(FOFInput $input) { $this->input = $input; } /** * Get the columns from database table. * * @return mixed An array of the field names, or false if an error occurs. * * @deprecated 2.1 */ public function getFields() { return $this->getTableFields(); } /** * Add a filesystem path where FOFTable should search for table class files. * You may either pass a string or an array of paths. * * @param mixed $path A filesystem path or array of filesystem paths to add. * * @return array An array of filesystem paths to find FOFTable classes in. */ public static function addIncludePath($path = null) { // If the internal paths have not been initialised, do so with the base table path. if (empty(self::$_includePaths)) { self::$_includePaths = array(__DIR__); } // Convert the passed path(s) to add to an array. settype($path, 'array'); // If we have new paths to add, do so. if (!empty($path) && !in_array($path, self::$_includePaths)) { // Check and add each individual new path. foreach ($path as $dir) { // Sanitize path. $dir = trim($dir); // Add to the front of the list so that custom paths are searched first. array_unshift(self::$_includePaths, $dir); } } return self::$_includePaths; } /** * Loads the asset table related to this table. * This will help tests, too, since we can mock this function. * * @return bool|JTableAsset False on failure, otherwise JTableAsset */ protected function getAsset() { $name = $this->_getAssetName(); // Do NOT touch JTable here -- we are loading the core asset table which is a JTable, not a FOFTable $asset = JTable::getInstance('Asset'); if (!$asset->loadByName($name)) { return false; } return $asset; } /** * Method to compute the default name of the asset. * The default name is in the form table_name.id * where id is the value of the primary key of the table. * * @throws UnexpectedValueException * * @return string */ public function getAssetName() { $k = $this->_tbl_key; // If there is no assetKey defined, stop here, or we'll get a wrong name if(!$this->_assetKey || !$this->$k) { throw new UnexpectedValueException('Table must have an asset key defined and a value for the table id in order to track assets'); } return $this->_assetKey . '.' . (int) $this->$k; } /** * Method to compute the default name of the asset. * The default name is in the form table_name.id * where id is the value of the primary key of the table. * * @throws UnexpectedValueException * * @return string */ public function getAssetKey() { return $this->_assetKey; } /** * Method to return the title to use for the asset table. In * tracking the assets a title is kept for each asset so that there is some * context available in a unified access manager. Usually this would just * return $this->title or $this->name or whatever is being used for the * primary name of the row. If this method is not overridden, the asset name is used. * * @return string The string to use as the title in the asset table. */ public function getAssetTitle() { return $this->getAssetName(); } /** * Method to get the parent asset under which to register this one. * By default, all assets are registered to the ROOT node with ID, * which will default to 1 if none exists. * The extended class can define a table and id to lookup. If the * asset does not exist it will be created. * * @param FOFTable $table A FOFTable object for the asset parent. * @param integer $id Id to look up * * @return integer */ public function getAssetParentId($table = null, $id = null) { // For simple cases, parent to the asset root. $assets = JTable::getInstance('Asset', 'JTable', array('dbo' => $this->getDbo())); $rootId = $assets->getRootId(); if (!empty($rootId)) { return $rootId; } return 1; } /** * This method sets the asset key for the items of this table. Obviously, it * is only meant to be used when you have a table with an asset field. * * @param string $assetKey The name of the asset key to use * * @return void */ public function setAssetKey($assetKey) { $this->_assetKey = $assetKey; } /** * Method to get the database table name for the class. * * @return string The name of the database table being modeled. */ public function getTableName() { return $this->_tbl; } /** * Method to get the primary key field name for the table. * * @return string The name of the primary key for the table. */ public function getKeyName() { return $this->_tbl_key; } /** * Returns the identity value of this record * * @return mixed */ public function getId() { $key = $this->getKeyName(); return $this->$key; } /** * Method to get the JDatabaseDriver object. * * @return JDatabaseDriver The internal database driver object. */ public function getDbo() { return $this->_db; } /** * Method to set the JDatabaseDriver object. * * @param JDatabaseDriver $db A JDatabaseDriver object to be used by the table object. * * @return boolean True on success. */ public function setDBO(JDatabaseDriver $db) { $this->_db = $db; return true; } /** * Method to set rules for the record. * * @param mixed $input A JAccessRules object, JSON string, or array. * * @return void */ public function setRules($input) { if ($input instanceof JAccessRules) { $this->_rules = $input; } else { $this->_rules = new JAccessRules($input); } } /** * Method to get the rules for the record. * * @return JAccessRules object */ public function getRules() { return $this->_rules; } /** * Method to check if the record is treated as an ACL asset * * @return boolean [description] */ public function isAssetsTracked() { return $this->_trackAssets; } /** * Method to manually set this record as ACL asset or not. * We have to do this since the automatic check is made in the constructor, but here we can't set any alias. * So, even if you have an alias for `asset_id`, it wouldn't be reconized and assets won't be tracked. * * @param $state */ public function setAssetsTracked($state) { $state = (bool) $state; if($state) { JLoader::import('joomla.access.rules'); } $this->_trackAssets = $state; } /** * Method to provide a shortcut to binding, checking and storing a FOFTable * instance to the database table. The method will check a row in once the * data has been stored and if an ordering filter is present will attempt to * reorder the table rows based on the filter. The ordering filter is an instance * property name. The rows that will be reordered are those whose value matches * the FOFTable instance for the property specified. * * @param mixed $src An associative array or object to bind to the FOFTable instance. * @param string $orderingFilter Filter for the order updating * @param mixed $ignore An optional array or space separated list of properties * to ignore while binding. * * @return boolean True on success. */ public function save($src, $orderingFilter = '', $ignore = '') { // Attempt to bind the source to the instance. if (!$this->bind($src, $ignore)) { return false; } // Run any sanity checks on the instance and verify that it is ready for storage. if (!$this->check()) { return false; } // Attempt to store the properties to the database table. if (!$this->store()) { return false; } // Attempt to check the row in, just in case it was checked out. if (!$this->checkin()) { return false; } // If an ordering filter is set, attempt reorder the rows in the table based on the filter and value. if ($orderingFilter) { $filterValue = $this->$orderingFilter; $this->reorder($orderingFilter ? $this->_db->qn($orderingFilter) . ' = ' . $this->_db->q($filterValue) : ''); } // Set the error to empty and return true. $this->setError(''); return true; } /** * Method to get the next ordering value for a group of rows defined by an SQL WHERE clause. * This is useful for placing a new item last in a group of items in the table. * * @param string $where WHERE clause to use for selecting the MAX(ordering) for the table. * * @return mixed Boolean false an failure or the next ordering value as an integer. */ public function getNextOrder($where = '') { // If there is no ordering field set an error and return false. $ordering = $this->getColumnAlias('ordering'); if (!in_array($ordering, $this->getKnownFields())) { throw new UnexpectedValueException(sprintf('%s does not support ordering.', get_class($this))); } // Get the largest ordering value for a given where clause. $query = $this->_db->getQuery(true); $query->select('MAX('.$this->_db->qn($ordering).')'); $query->from($this->_tbl); if ($where) { $query->where($where); } $this->_db->setQuery($query); $max = (int) $this->_db->loadResult(); // Return the largest ordering value + 1. return ($max + 1); } /** * Method to lock the database table for writing. * * @return boolean True on success. * * @throws RuntimeException */ protected function _lock() { $this->_db->lockTable($this->_tbl); $this->_locked = true; return true; } /** * Method to unlock the database table for writing. * * @return boolean True on success. */ protected function _unlock() { $this->_db->unlockTables(); $this->_locked = false; return true; } public function setConfig(array $config) { $this->config = $config; } /** * Get the content type for ucm * * @return string The content type alias */ public function getContentType() { if ($this->contentType) { return $this->contentType; } /** * When tags was first introduced contentType variable didn't exist - so we guess one * This will fail if content history behvaiour is enabled. This code is deprecated * and will be removed in FOF 3.0 in favour of the content type class variable */ $component = $this->input->get('option'); $view = FOFInflector::singularize($this->input->get('view')); $alias = $component . '.' . $view; return $alias; } /** * Returns the table relations object of the current table, lazy-loading it if necessary * * @return FOFTableRelations */ public function getRelations() { if (is_null($this->_relations)) { $this->_relations = new FOFTableRelations($this); } return $this->_relations; } /** * Gets a reference to the configuration parameters provider for this table * * @return FOFConfigProvider */ public function getConfigProvider() { return $this->configProvider; } /** * Returns the configuration parameters provider's key for this table * * @return string */ public function getConfigProviderKey() { return $this->_configProviderKey; } /** * Check if a UCM content type exists for this resource, and * create it if it does not * * @param string $alias The content type alias (optional) * * @return null */ public function checkContentType($alias = null) { $contentType = new JTableContenttype($this->getDbo()); if (!$alias) { $alias = $this->getContentType(); } $aliasParts = explode('.', $alias); // Fetch the extension name $component = $aliasParts[0]; $component = JComponentHelper::getComponent($component); // Fetch the name using the menu item $query = $this->getDbo()->getQuery(true); $query->select('title')->from('#__menu')->where('component_id = ' . (int) $component->id); $this->getDbo()->setQuery($query); $component_name = JText::_($this->getDbo()->loadResult()); $name = $component_name . ' ' . ucfirst($aliasParts[1]); // Create a new content type for our resource if (!$contentType->load(array('type_alias' => $alias))) { $contentType->type_title = $name; $contentType->type_alias = $alias; $contentType->table = json_encode( array( 'special' => array( 'dbtable' => $this->getTableName(), 'key' => $this->getKeyName(), 'type' => $name, 'prefix' => $this->_tablePrefix, 'class' => 'FOFTable', 'config' => 'array()' ), 'common' => array( 'dbtable' => '#__ucm_content', 'key' => 'ucm_id', 'type' => 'CoreContent', 'prefix' => 'JTable', 'config' => 'array()' ) ) ); $contentType->field_mappings = json_encode( array( 'common' => array( 0 => array( "core_content_item_id" => $this->getKeyName(), "core_title" => $this->getUcmCoreAlias('title'), "core_state" => $this->getUcmCoreAlias('enabled'), "core_alias" => $this->getUcmCoreAlias('alias'), "core_created_time" => $this->getUcmCoreAlias('created_on'), "core_modified_time" => $this->getUcmCoreAlias('created_by'), "core_body" => $this->getUcmCoreAlias('body'), "core_hits" => $this->getUcmCoreAlias('hits'), "core_publish_up" => $this->getUcmCoreAlias('publish_up'), "core_publish_down" => $this->getUcmCoreAlias('publish_down'), "core_access" => $this->getUcmCoreAlias('access'), "core_params" => $this->getUcmCoreAlias('params'), "core_featured" => $this->getUcmCoreAlias('featured'), "core_metadata" => $this->getUcmCoreAlias('metadata'), "core_language" => $this->getUcmCoreAlias('language'), "core_images" => $this->getUcmCoreAlias('images'), "core_urls" => $this->getUcmCoreAlias('urls'), "core_version" => $this->getUcmCoreAlias('version'), "core_ordering" => $this->getUcmCoreAlias('ordering'), "core_metakey" => $this->getUcmCoreAlias('metakey'), "core_metadesc" => $this->getUcmCoreAlias('metadesc'), "core_catid" => $this->getUcmCoreAlias('cat_id'), "core_xreference" => $this->getUcmCoreAlias('xreference'), "asset_id" => $this->getUcmCoreAlias('asset_id') ) ), 'special' => array( 0 => array( ) ) ) ); $ignoreFields = array( $this->getUcmCoreAlias('modified_on', null), $this->getUcmCoreAlias('modified_by', null), $this->getUcmCoreAlias('locked_by', null), $this->getUcmCoreAlias('locked_on', null), $this->getUcmCoreAlias('hits', null), $this->getUcmCoreAlias('version', null) ); $contentType->content_history_options = json_encode( array( "ignoreChanges" => array_filter($ignoreFields, 'strlen') ) ); $contentType->router = ''; $contentType->store(); } } /** * Utility methods that fetches the column name for the field. * If it does not exists, returns a "null" string * * @param string $alias The alias for the column * @param string $null What to return if no column exists * * @return string The column name */ protected function getUcmCoreAlias($alias, $null = "null") { $alias = $this->getColumnAlias($alias); if (in_array($alias, $this->getKnownFields())) { return $alias; } return $null; } } PK���\!�+cE�E�libraries/fof/table/nested.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage table * @copyright Copyright (C) 2010 - 2015 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; /** * A class to manage tables holding nested sets (hierarchical data) * * @property int $lft Left value (for nested set implementation) * @property int $rgt Right value (for nested set implementation) * @property string $hash Slug hash (optional; for faster searching) * @property string $slug Node's slug (optional) * @property string $title Title of the node (optional) */ class FOFTableNested extends FOFTable { /** @var int The level (depth) of this node in the tree */ protected $treeDepth = null; /** @var FOFTableNested The root node in the tree */ protected $treeRoot = null; /** @var FOFTableNested The parent node of ourselves */ protected $treeParent = null; /** @var bool Should I perform a nested get (used to query ascendants/descendants) */ protected $treeNestedGet = false; /** @var array A collection of custom, additional where clauses to apply during buildQuery */ protected $whereClauses = array(); /** * Public constructor. Overrides the parent constructor, making sure there are lft/rgt columns which make it * compatible with nested sets. * * @param string $table Name of the database table to model. * @param string $key Name of the primary key field in the table. * @param JDatabaseDriver &$db Database driver * @param array $config The configuration parameters array * * @throws \RuntimeException When lft/rgt columns are not found */ public function __construct($table, $key, &$db, $config = array()) { parent::__construct($table, $key, $db, $config); if (!$this->hasField('lft') || !$this->hasField('rgt')) { throw new \RuntimeException("Table " . $this->getTableName() . " is not compatible with FOFTableNested: it does not have lft/rgt columns"); } } /** * Overrides the automated table checks to handle the 'hash' column for faster searching * * @return boolean */ public function check() { // Create a slug if there is a title and an empty slug if ($this->hasField('title') && $this->hasField('slug') && empty($this->slug)) { $this->slug = FOFStringUtils::toSlug($this->title); } // Create the SHA-1 hash of the slug for faster searching (make sure the hash column is CHAR(64) to take // advantage of MySQL's optimised searching for fixed size CHAR columns) if ($this->hasField('hash') && $this->hasField('slug')) { $this->hash = sha1($this->slug); } // Reset cached values $this->resetTreeCache(); return parent::check(); } /** * Delete a node, either the currently loaded one or the one specified in $id. If an $id is specified that node * is loaded before trying to delete it. In the end the data model is reset. If the node has any children nodes * they will be removed before the node itself is deleted. * * @param integer $oid The primary key value of the item to delete * * @throws UnexpectedValueException * * @return boolean True on success */ public function delete($oid = null) { // Load the specified record (if necessary) if (!empty($oid)) { $this->load($oid); } $k = $this->_tbl_key; $pk = (!$oid) ? $this->$k : $oid; // If no primary key is given, return false. if (!$pk) { throw new UnexpectedValueException('Null primary key not allowed.'); } // Execute the logic only if I have a primary key, otherwise I could have weird results // Perform the checks on the current node *BEFORE* starting to delete the children if (!$this->onBeforeDelete($oid)) { return false; } $result = true; // Recursively delete all children nodes as long as we are not a leaf node and $recursive is enabled if (!$this->isLeaf()) { // Get all sub-nodes $table = $this->getClone(); $table->bind($this->getData()); $subNodes = $table->getDescendants(); // Delete all subnodes (goes through the model to trigger the observers) if (!empty($subNodes)) { /** @var FOFTableNested $item */ foreach ($subNodes as $item) { // We have to pass the id, so we are getting it again from the database. // We have to do in this way, since a previous child could have changed our lft and rgt values if(!$item->delete($item->$k)) { // A subnode failed or prevents the delete, continue deleting other nodes, // but preserve the current node (ie the parent) $result = false; } }; // Load it again, since while deleting a children we could have updated ourselves, too $this->load($pk); } } if($result) { // Delete the row by primary key. $query = $this->_db->getQuery(true); $query->delete(); $query->from($this->_tbl); $query->where($this->_tbl_key . ' = ' . $this->_db->q($pk)); $this->_db->setQuery($query)->execute(); $result = $this->onAfterDelete($oid); } return $result; } protected function onAfterDelete($oid) { $db = $this->getDbo(); $myLeft = $this->lft; $myRight = $this->rgt; $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); // Move all siblings to the left $width = $this->rgt - $this->lft + 1; // Wrap everything in a transaction $db->transactionStart(); try { // Shrink lft values $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldLft . ' = ' . $fldLft . ' - '.$width) ->where($fldLft . ' > ' . $db->q($myLeft)); $db->setQuery($query)->execute(); // Shrink rgt values $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldRgt . ' = ' . $fldRgt . ' - '.$width) ->where($fldRgt . ' > ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Commit the transaction $db->transactionCommit(); } catch (\Exception $e) { // Roll back the transaction on error $db->transactionRollback(); throw $e; } return parent::onAfterDelete($oid); } /** * Not supported in nested sets * * @param string $where Ignored * * @return void * * @throws RuntimeException */ public function reorder($where = '') { throw new RuntimeException('reorder() is not supported by FOFTableNested'); } /** * Not supported in nested sets * * @param integer $delta Ignored * @param string $where Ignored * * @return void * * @throws RuntimeException */ public function move($delta, $where = '') { throw new RuntimeException('move() is not supported by FOFTableNested'); } /** * Create a new record with the provided data. It is inserted as the last child of the current node's parent * * @param array $data The data to use in the new record * * @return static The new node */ public function create($data) { $newNode = $this->getClone(); $newNode->reset(); $newNode->bind($data); if ($this->isRoot()) { return $newNode->insertAsChildOf($this); } else { return $newNode->insertAsChildOf($this->getParent()); } } /** * Makes a copy of the record, inserting it as the last child of the given node's parent. * * @param integer|array $cid The primary key value (or values) or the record(s) to copy. * If null, the current record will be copied * * @return self|FOFTableNested The last copied node */ public function copy($cid = null) { //We have to cast the id as array, or the helper function will return an empty set if($cid) { $cid = (array) $cid; } FOFUtilsArray::toInteger($cid); $k = $this->_tbl_key; if (count($cid) < 1) { if ($this->$k) { $cid = array($this->$k); } else { // Even if it's null, let's still create the record $this->create($this->getData()); return $this; } } foreach ($cid as $item) { // Prevent load with id = 0 if (!$item) { continue; } $this->load($item); $this->create($this->getData()); } return $this; } /** * Method to reset class properties to the defaults set in the class * definition. It will ignore the primary key as well as any private class * properties. * * @return void */ public function reset() { $this->resetTreeCache(); parent::reset(); } /** * Insert the current node as a tree root. It is a good idea to never use this method, instead providing a root node * in your schema installation and then sticking to only one root. * * @return self */ public function insertAsRoot() { // You can't insert a node that is already saved i.e. the table has an id if($this->getId()) { throw new RuntimeException(__METHOD__.' can be only used with new nodes'); } // First we need to find the right value of the last parent, a.k.a. the max(rgt) of the table $db = $this->getDbo(); // Get the lft/rgt names $fldRgt = $db->qn($this->getColumnAlias('rgt')); $query = $db->getQuery(true) ->select('MAX(' . $fldRgt . ')') ->from($db->qn($this->getTableName())); $maxRgt = $db->setQuery($query, 0, 1)->loadResult(); if (empty($maxRgt)) { $maxRgt = 0; } $this->lft = ++$maxRgt; $this->rgt = ++$maxRgt; $this->store(); return $this; } /** * Insert the current node as the first (leftmost) child of a parent node. * * WARNING: If it's an existing node it will be COPIED, not moved. * * @param FOFTableNested $parentNode The node which will become our parent * * @return $this for chaining * * @throws Exception * @throws RuntimeException */ public function insertAsFirstChildOf(FOFTableNested &$parentNode) { if($parentNode->lft >= $parentNode->rgt) { throw new RuntimeException('Invalid position values for the parent node'); } // Get a reference to the database $db = $this->getDbo(); // Get the field names $fldRgt = $db->qn($this->getColumnAlias('rgt')); $fldLft = $db->qn($this->getColumnAlias('lft')); // Nullify the PK, so a new record will be created $pk = $this->getKeyName(); $this->$pk = null; // Get the value of the parent node's rgt $myLeft = $parentNode->lft; // Update my lft/rgt values $this->lft = $myLeft + 1; $this->rgt = $myLeft + 2; // Update parent node's right (we added two elements in there, remember?) $parentNode->rgt += 2; // Wrap everything in a transaction $db->transactionStart(); try { // Make a hole (2 queries) $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldLft . ' = ' . $fldLft . '+2') ->where($fldLft . ' > ' . $db->q($myLeft)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldRgt . ' = ' . $fldRgt . '+ 2') ->where($fldRgt . '>' . $db->q($myLeft)); $db->setQuery($query)->execute(); // Insert the new node $this->store(); // Commit the transaction $db->transactionCommit(); } catch (\Exception $e) { // Roll back the transaction on error $db->transactionRollback(); throw $e; } return $this; } /** * Insert the current node as the last (rightmost) child of a parent node. * * WARNING: If it's an existing node it will be COPIED, not moved. * * @param FOFTableNested $parentNode The node which will become our parent * * @return $this for chaining * * @throws Exception * @throws RuntimeException */ public function insertAsLastChildOf(FOFTableNested &$parentNode) { if($parentNode->lft >= $parentNode->rgt) { throw new RuntimeException('Invalid position values for the parent node'); } // Get a reference to the database $db = $this->getDbo(); // Get the field names $fldRgt = $db->qn($this->getColumnAlias('rgt')); $fldLft = $db->qn($this->getColumnAlias('lft')); // Nullify the PK, so a new record will be created $pk = $this->getKeyName(); $this->$pk = null; // Get the value of the parent node's lft $myRight = $parentNode->rgt; // Update my lft/rgt values $this->lft = $myRight; $this->rgt = $myRight + 1; // Update parent node's right (we added two elements in there, remember?) $parentNode->rgt += 2; // Wrap everything in a transaction $db->transactionStart(); try { // Make a hole (2 queries) $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldRgt . ' = ' . $fldRgt . '+2') ->where($fldRgt . '>=' . $db->q($myRight)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldLft . ' = ' . $fldLft . '+2') ->where($fldLft . '>' . $db->q($myRight)); $db->setQuery($query)->execute(); // Insert the new node $this->store(); // Commit the transaction $db->transactionCommit(); } catch (\Exception $e) { // Roll back the transaction on error $db->transactionRollback(); throw $e; } return $this; } /** * Alias for insertAsLastchildOf * * @codeCoverageIgnore * @param FOFTableNested $parentNode * * @return $this for chaining * * @throws Exception */ public function insertAsChildOf(FOFTableNested &$parentNode) { return $this->insertAsLastChildOf($parentNode); } /** * Insert the current node to the left of (before) a sibling node * * WARNING: If it's an existing node it will be COPIED, not moved. * * @param FOFTableNested $siblingNode We will be inserted before this node * * @return $this for chaining * * @throws Exception * @throws RuntimeException */ public function insertLeftOf(FOFTableNested &$siblingNode) { if($siblingNode->lft >= $siblingNode->rgt) { throw new RuntimeException('Invalid position values for the sibling node'); } // Get a reference to the database $db = $this->getDbo(); // Get the field names $fldRgt = $db->qn($this->getColumnAlias('rgt')); $fldLft = $db->qn($this->getColumnAlias('lft')); // Nullify the PK, so a new record will be created $pk = $this->getKeyName(); $this->$pk = null; // Get the value of the parent node's rgt $myLeft = $siblingNode->lft; // Update my lft/rgt values $this->lft = $myLeft; $this->rgt = $myLeft + 1; // Update sibling's lft/rgt values $siblingNode->lft += 2; $siblingNode->rgt += 2; $db->transactionStart(); try { $db->setQuery( $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldLft . ' = ' . $fldLft . '+2') ->where($fldLft . ' >= ' . $db->q($myLeft)) )->execute(); $db->setQuery( $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldRgt . ' = ' . $fldRgt . '+2') ->where($fldRgt . ' > ' . $db->q($myLeft)) )->execute(); $this->store(); // Commit the transaction $db->transactionCommit(); } catch (\Exception $e) { $db->transactionRollback(); throw $e; } return $this; } /** * Insert the current node to the right of (after) a sibling node * * WARNING: If it's an existing node it will be COPIED, not moved. * * @param FOFTableNested $siblingNode We will be inserted after this node * * @return $this for chaining * @throws Exception * @throws RuntimeException */ public function insertRightOf(FOFTableNested &$siblingNode) { if($siblingNode->lft >= $siblingNode->rgt) { throw new RuntimeException('Invalid position values for the sibling node'); } // Get a reference to the database $db = $this->getDbo(); // Get the field names $fldRgt = $db->qn($this->getColumnAlias('rgt')); $fldLft = $db->qn($this->getColumnAlias('lft')); // Nullify the PK, so a new record will be created $pk = $this->getKeyName(); $this->$pk = null; // Get the value of the parent node's lft $myRight = $siblingNode->rgt; // Update my lft/rgt values $this->lft = $myRight + 1; $this->rgt = $myRight + 2; $db->transactionStart(); try { $db->setQuery( $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldRgt . ' = ' . $fldRgt . '+2') ->where($fldRgt . ' > ' . $db->q($myRight)) )->execute(); $db->setQuery( $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($fldLft . ' = ' . $fldLft . '+2') ->where($fldLft . ' > ' . $db->q($myRight)) )->execute(); $this->store(); // Commit the transaction $db->transactionCommit(); } catch (\Exception $e) { $db->transactionRollback(); throw $e; } return $this; } /** * Alias for insertRightOf * * @codeCoverageIgnore * @param FOFTableNested $siblingNode * * @return $this for chaining */ public function insertAsSiblingOf(FOFTableNested &$siblingNode) { return $this->insertRightOf($siblingNode); } /** * Move the current node (and its subtree) one position to the left in the tree, i.e. before its left-hand sibling * * @throws RuntimeException * * @return $this */ public function moveLeft() { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } // If it is a root node we will not move the node (roots don't participate in tree ordering) if ($this->isRoot()) { return $this; } // Are we already the leftmost node? $parentNode = $this->getParent(); if ($parentNode->lft == ($this->lft - 1)) { return $this; } // Get the sibling to the left $db = $this->getDbo(); $table = $this->getClone(); $table->reset(); $leftSibling = $table->whereRaw($db->qn($this->getColumnAlias('rgt')) . ' = ' . $db->q($this->lft - 1)) ->get(0, 1)->current(); // Move the node if (is_object($leftSibling) && ($leftSibling instanceof FOFTableNested)) { return $this->moveToLeftOf($leftSibling); } return false; } /** * Move the current node (and its subtree) one position to the right in the tree, i.e. after its right-hand sibling * * @throws RuntimeException * * @return $this */ public function moveRight() { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } // If it is a root node we will not move the node (roots don't participate in tree ordering) if ($this->isRoot()) { return $this; } // Are we already the rightmost node? $parentNode = $this->getParent(); if ($parentNode->rgt == ($this->rgt + 1)) { return $this; } // Get the sibling to the right $db = $this->getDbo(); $table = $this->getClone(); $table->reset(); $rightSibling = $table->whereRaw($db->qn($this->getColumnAlias('lft')) . ' = ' . $db->q($this->rgt + 1)) ->get(0, 1)->current(); // Move the node if (is_object($rightSibling) && ($rightSibling instanceof FOFTableNested)) { return $this->moveToRightOf($rightSibling); } return false; } /** * Moves the current node (and its subtree) to the left of another node. The other node can be in a different * position in the tree or even under a different root. * * @param FOFTableNested $siblingNode * * @return $this for chaining * * @throws Exception * @throws RuntimeException */ public function moveToLeftOf(FOFTableNested $siblingNode) { // Sanity checks on current and sibling node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } if($siblingNode->lft >= $siblingNode->rgt) { throw new RuntimeException('Invalid position values for the sibling node'); } $db = $this->getDbo(); $left = $db->qn($this->getColumnAlias('lft')); $right = $db->qn($this->getColumnAlias('rgt')); // Get node metrics $myLeft = $this->lft; $myRight = $this->rgt; $myWidth = $myRight - $myLeft + 1; // Get sibling metrics $sibLeft = $siblingNode->lft; // Start the transaction $db->transactionStart(); try { // Temporary remove subtree being moved $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set("$left = " . $db->q(0) . " - $left") ->set("$right = " . $db->q(0) . " - $right") ->where($left . ' >= ' . $db->q($myLeft)) ->where($right . ' <= ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Close hole left behind $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $left . ' - ' . $db->q($myWidth)) ->where($left . ' > ' . $db->q($myRight)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($right . ' = ' . $right . ' - ' . $db->q($myWidth)) ->where($right . ' > ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Make a hole for the new items $newSibLeft = ($sibLeft > $myRight) ? $sibLeft - $myWidth : $sibLeft; $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($right . ' = ' . $right . ' + ' . $db->q($myWidth)) ->where($right . ' >= ' . $db->q($newSibLeft)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $left . ' + ' . $db->q($myWidth)) ->where($left . ' >= ' . $db->q($newSibLeft)); $db->setQuery($query)->execute(); // Move node and subnodes $moveRight = $newSibLeft - $myLeft; $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $db->q(0) . ' - ' . $left . ' + ' . $db->q($moveRight)) ->set($right . ' = ' . $db->q(0) . ' - ' . $right . ' + ' . $db->q($moveRight)) ->where($left . ' <= 0 - ' . $db->q($myLeft)) ->where($right . ' >= 0 - ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Commit the transaction $db->transactionCommit(); } catch (\Exception $e) { $db->transactionRollback(); throw $e; } // Let's load the record again to fetch the new values for lft and rgt $this->load(); return $this; } /** * Moves the current node (and its subtree) to the right of another node. The other node can be in a different * position in the tree or even under a different root. * * @param FOFTableNested $siblingNode * * @return $this for chaining * * @throws Exception * @throws RuntimeException */ public function moveToRightOf(FOFTableNested $siblingNode) { // Sanity checks on current and sibling node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } if($siblingNode->lft >= $siblingNode->rgt) { throw new RuntimeException('Invalid position values for the sibling node'); } $db = $this->getDbo(); $left = $db->qn($this->getColumnAlias('lft')); $right = $db->qn($this->getColumnAlias('rgt')); // Get node metrics $myLeft = $this->lft; $myRight = $this->rgt; $myWidth = $myRight - $myLeft + 1; // Get parent metrics $sibRight = $siblingNode->rgt; // Start the transaction $db->transactionStart(); try { // Temporary remove subtree being moved $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set("$left = " . $db->q(0) . " - $left") ->set("$right = " . $db->q(0) . " - $right") ->where($left . ' >= ' . $db->q($myLeft)) ->where($right . ' <= ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Close hole left behind $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $left . ' - ' . $db->q($myWidth)) ->where($left . ' > ' . $db->q($myRight)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($right . ' = ' . $right . ' - ' . $db->q($myWidth)) ->where($right . ' > ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Make a hole for the new items $newSibRight = ($sibRight > $myRight) ? $sibRight - $myWidth : $sibRight; $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $left . ' + ' . $db->q($myWidth)) ->where($left . ' > ' . $db->q($newSibRight)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($right . ' = ' . $right . ' + ' . $db->q($myWidth)) ->where($right . ' > ' . $db->q($newSibRight)); $db->setQuery($query)->execute(); // Move node and subnodes $moveRight = ($sibRight > $myRight) ? $sibRight - $myRight : $sibRight - $myRight + $myWidth; $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $db->q(0) . ' - ' . $left . ' + ' . $db->q($moveRight)) ->set($right . ' = ' . $db->q(0) . ' - ' . $right . ' + ' . $db->q($moveRight)) ->where($left . ' <= 0 - ' . $db->q($myLeft)) ->where($right . ' >= 0 - ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Commit the transaction $db->transactionCommit(); } catch (\Exception $e) { $db->transactionRollback(); throw $e; } // Let's load the record again to fetch the new values for lft and rgt $this->load(); return $this; } /** * Alias for moveToRightOf * * @codeCoverageIgnore * @param FOFTableNested $siblingNode * * @return $this for chaining */ public function makeNextSiblingOf(FOFTableNested $siblingNode) { return $this->moveToRightOf($siblingNode); } /** * Alias for makeNextSiblingOf * * @codeCoverageIgnore * @param FOFTableNested $siblingNode * * @return $this for chaining */ public function makeSiblingOf(FOFTableNested $siblingNode) { return $this->makeNextSiblingOf($siblingNode); } /** * Alias for moveToLeftOf * * @codeCoverageIgnore * @param FOFTableNested $siblingNode * * @return $this for chaining */ public function makePreviousSiblingOf(FOFTableNested $siblingNode) { return $this->moveToLeftOf($siblingNode); } /** * Moves a node and its subtree as a the first (leftmost) child of $parentNode * * @param FOFTableNested $parentNode * * @return $this for chaining * * @throws Exception */ public function makeFirstChildOf(FOFTableNested $parentNode) { // Sanity checks on current and sibling node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } if($parentNode->lft >= $parentNode->rgt) { throw new RuntimeException('Invalid position values for the parent node'); } $db = $this->getDbo(); $left = $db->qn($this->getColumnAlias('lft')); $right = $db->qn($this->getColumnAlias('rgt')); // Get node metrics $myLeft = $this->lft; $myRight = $this->rgt; $myWidth = $myRight - $myLeft + 1; // Get parent metrics $parentLeft = $parentNode->lft; // Start the transaction $db->transactionStart(); try { // Temporary remove subtree being moved $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set("$left = " . $db->q(0) . " - $left") ->set("$right = " . $db->q(0) . " - $right") ->where($left . ' >= ' . $db->q($myLeft)) ->where($right . ' <= ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Close hole left behind $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $left . ' - ' . $db->q($myWidth)) ->where($left . ' > ' . $db->q($myRight)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($right . ' = ' . $right . ' - ' . $db->q($myWidth)) ->where($right . ' > ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Make a hole for the new items $newParentLeft = ($parentLeft > $myRight) ? $parentLeft - $myWidth : $parentLeft; $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($right . ' = ' . $right . ' + ' . $db->q($myWidth)) ->where($right . ' >= ' . $db->q($newParentLeft)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $left . ' + ' . $db->q($myWidth)) ->where($left . ' > ' . $db->q($newParentLeft)); $db->setQuery($query)->execute(); // Move node and subnodes $moveRight = $newParentLeft - $myLeft + 1; $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $db->q(0) . ' - ' . $left . ' + ' . $db->q($moveRight)) ->set($right . ' = ' . $db->q(0) . ' - ' . $right . ' + ' . $db->q($moveRight)) ->where($left . ' <= 0 - ' . $db->q($myLeft)) ->where($right . ' >= 0 - ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Commit the transaction $db->transactionCommit(); } catch (\Exception $e) { $db->transactionRollback(); throw $e; } // Let's load the record again to fetch the new values for lft and rgt $this->load(); return $this; } /** * Moves a node and its subtree as a the last (rightmost) child of $parentNode * * @param FOFTableNested $parentNode * * @return $this for chaining * * @throws Exception * @throws RuntimeException */ public function makeLastChildOf(FOFTableNested $parentNode) { // Sanity checks on current and sibling node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } if($parentNode->lft >= $parentNode->rgt) { throw new RuntimeException('Invalid position values for the parent node'); } $db = $this->getDbo(); $left = $db->qn($this->getColumnAlias('lft')); $right = $db->qn($this->getColumnAlias('rgt')); // Get node metrics $myLeft = $this->lft; $myRight = $this->rgt; $myWidth = $myRight - $myLeft + 1; // Get parent metrics $parentRight = $parentNode->rgt; // Start the transaction $db->transactionStart(); try { // Temporary remove subtree being moved $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set("$left = " . $db->q(0) . " - $left") ->set("$right = " . $db->q(0) . " - $right") ->where($left . ' >= ' . $db->q($myLeft)) ->where($right . ' <= ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Close hole left behind $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $left . ' - ' . $db->q($myWidth)) ->where($left . ' > ' . $db->q($myRight)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($right . ' = ' . $right . ' - ' . $db->q($myWidth)) ->where($right . ' > ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Make a hole for the new items $newLeft = ($parentRight > $myRight) ? $parentRight - $myWidth : $parentRight; $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $left . ' + ' . $db->q($myWidth)) ->where($left . ' >= ' . $db->q($newLeft)); $db->setQuery($query)->execute(); $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($right . ' = ' . $right . ' + ' . $db->q($myWidth)) ->where($right . ' >= ' . $db->q($newLeft)); $db->setQuery($query)->execute(); // Move node and subnodes $moveRight = ($parentRight > $myRight) ? $parentRight - $myRight - 1 : $parentRight - $myRight - 1 + $myWidth; $query = $db->getQuery(true) ->update($db->qn($this->getTableName())) ->set($left . ' = ' . $db->q(0) . ' - ' . $left . ' + ' . $db->q($moveRight)) ->set($right . ' = ' . $db->q(0) . ' - ' . $right . ' + ' . $db->q($moveRight)) ->where($left . ' <= 0 - ' . $db->q($myLeft)) ->where($right . ' >= 0 - ' . $db->q($myRight)); $db->setQuery($query)->execute(); // Commit the transaction $db->transactionCommit(); } catch (\Exception $e) { $db->transactionRollback(); throw $e; } // Let's load the record again to fetch the new values for lft and rgt $this->load(); return $this; } /** * Alias for makeLastChildOf * * @codeCoverageIgnore * @param FOFTableNested $parentNode * * @return $this for chaining */ public function makeChildOf(FOFTableNested $parentNode) { return $this->makeLastChildOf($parentNode); } /** * Makes the current node a root (and moving its entire subtree along the way). This is achieved by moving the node * to the right of its root node * * @return $this for chaining */ public function makeRoot() { // Make sure we are not a root if ($this->isRoot()) { return $this; } // Get a reference to my root $myRoot = $this->getRoot(); // Double check I am not a root if ($this->equals($myRoot)) { return $this; } // Move myself to the right of my root $this->moveToRightOf($myRoot); $this->treeDepth = 0; return $this; } /** * Gets the level (depth) of this node in the tree. The result is cached in $this->treeDepth for faster retrieval. * * @throws RuntimeException * * @return int|mixed */ public function getLevel() { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } if (is_null($this->treeDepth)) { $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $query = $db->getQuery(true) ->select('(COUNT(' . $db->qn('parent') . '.' . $fldLft . ') - 1) AS ' . $db->qn('depth')) ->from($db->qn($this->getTableName()) . ' AS ' . $db->qn('node')) ->join('CROSS', $db->qn($this->getTableName()) . ' AS ' . $db->qn('parent')) ->where($db->qn('node') . '.' . $fldLft . ' >= ' . $db->qn('parent') . '.' . $fldLft) ->where($db->qn('node') . '.' . $fldLft . ' <= ' . $db->qn('parent') . '.' . $fldRgt) ->where($db->qn('node') . '.' . $fldLft . ' = ' . $db->q($this->lft)) ->group($db->qn('node') . '.' . $fldLft) ->order($db->qn('node') . '.' . $fldLft . ' ASC'); $this->treeDepth = $db->setQuery($query, 0, 1)->loadResult(); } return $this->treeDepth; } /** * Returns the immediate parent of the current node * * @throws RuntimeException * * @return FOFTableNested */ public function getParent() { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } if ($this->isRoot()) { return $this; } if (empty($this->treeParent) || !is_object($this->treeParent) || !($this->treeParent instanceof FOFTableNested)) { $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $query = $db->getQuery(true) ->select($db->qn('parent') . '.' . $fldLft) ->from($db->qn($this->getTableName()) . ' AS ' . $db->qn('node')) ->join('CROSS', $db->qn($this->getTableName()) . ' AS ' . $db->qn('parent')) ->where($db->qn('node') . '.' . $fldLft . ' > ' . $db->qn('parent') . '.' . $fldLft) ->where($db->qn('node') . '.' . $fldLft . ' <= ' . $db->qn('parent') . '.' . $fldRgt) ->where($db->qn('node') . '.' . $fldLft . ' = ' . $db->q($this->lft)) ->order($db->qn('parent') . '.' . $fldLft . ' DESC'); $targetLft = $db->setQuery($query, 0, 1)->loadResult(); $table = $this->getClone(); $table->reset(); $this->treeParent = $table ->whereRaw($fldLft . ' = ' . $db->q($targetLft)) ->get()->current(); } return $this->treeParent; } /** * Is this a top-level root node? * * @return bool */ public function isRoot() { // If lft=1 it is necessarily a root node if ($this->lft == 1) { return true; } // Otherwise make sure its level is 0 return $this->getLevel() == 0; } /** * Is this a leaf node (a node without children)? * * @throws RuntimeException * * @return bool */ public function isLeaf() { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } return ($this->rgt - 1) == $this->lft; } /** * Is this a child node (not root)? * * @codeCoverageIgnore * * @return bool */ public function isChild() { return !$this->isRoot(); } /** * Returns true if we are a descendant of $otherNode * * @param FOFTableNested $otherNode * * @throws RuntimeException * * @return bool */ public function isDescendantOf(FOFTableNested $otherNode) { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } if($otherNode->lft >= $otherNode->rgt) { throw new RuntimeException('Invalid position values for the other node'); } return ($otherNode->lft < $this->lft) && ($otherNode->rgt > $this->rgt); } /** * Returns true if $otherNode is ourselves or if we are a descendant of $otherNode * * @param FOFTableNested $otherNode * * @throws RuntimeException * * @return bool */ public function isSelfOrDescendantOf(FOFTableNested $otherNode) { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } if($otherNode->lft >= $otherNode->rgt) { throw new RuntimeException('Invalid position values for the other node'); } return ($otherNode->lft <= $this->lft) && ($otherNode->rgt >= $this->rgt); } /** * Returns true if we are an ancestor of $otherNode * * @codeCoverageIgnore * @param FOFTableNested $otherNode * * @return bool */ public function isAncestorOf(FOFTableNested $otherNode) { return $otherNode->isDescendantOf($this); } /** * Returns true if $otherNode is ourselves or we are an ancestor of $otherNode * * @codeCoverageIgnore * @param FOFTableNested $otherNode * * @return bool */ public function isSelfOrAncestorOf(FOFTableNested $otherNode) { return $otherNode->isSelfOrDescendantOf($this); } /** * Is $node this very node? * * @param FOFTableNested $node * * @throws RuntimeException * * @return bool */ public function equals(FOFTableNested &$node) { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } if($node->lft >= $node->rgt) { throw new RuntimeException('Invalid position values for the other node'); } return ( ($this->getId() == $node->getId()) && ($this->lft == $node->lft) && ($this->rgt == $node->rgt) ); } /** * Alias for isDescendantOf * * @codeCoverageIgnore * @param FOFTableNested $otherNode * * @return bool */ public function insideSubtree(FOFTableNested $otherNode) { return $this->isDescendantOf($otherNode); } /** * Returns true if both this node and $otherNode are root, leaf or child (same tree scope) * * @param FOFTableNested $otherNode * * @return bool */ public function inSameScope(FOFTableNested $otherNode) { if ($this->isLeaf()) { return $otherNode->isLeaf(); } elseif ($this->isRoot()) { return $otherNode->isRoot(); } elseif ($this->isChild()) { return $otherNode->isChild(); } else { return false; } } /** * get() will return all ancestor nodes and ourselves * * @return void */ protected function scopeAncestorsAndSelf() { $this->treeNestedGet = true; $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' >= ' . $db->qn('node') . '.' . $fldLft); $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' <= ' . $db->qn('node') . '.' . $fldRgt); $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' = ' . $db->q($this->lft)); } /** * get() will return all ancestor nodes but not ourselves * * @return void */ protected function scopeAncestors() { $this->treeNestedGet = true; $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' > ' . $db->qn('node') . '.' . $fldLft); $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' < ' . $db->qn('node') . '.' . $fldRgt); $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' = ' . $db->q($this->lft)); } /** * get() will return all sibling nodes and ourselves * * @return void */ protected function scopeSiblingsAndSelf() { $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $parent = $this->getParent(); $this->whereRaw($db->qn('node') . '.' . $fldLft . ' > ' . $db->q($parent->lft)); $this->whereRaw($db->qn('node') . '.' . $fldRgt . ' < ' . $db->q($parent->rgt)); } /** * get() will return all sibling nodes but not ourselves * * @codeCoverageIgnore * * @return void */ protected function scopeSiblings() { $this->scopeSiblingsAndSelf(); $this->scopeWithoutSelf(); } /** * get() will return only leaf nodes * * @return void */ protected function scopeLeaves() { $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $this->whereRaw($db->qn('node') . '.' . $fldLft . ' = ' . $db->qn('node') . '.' . $fldRgt . ' - ' . $db->q(1)); } /** * get() will return all descendants (even subtrees of subtrees!) and ourselves * * @return void */ protected function scopeDescendantsAndSelf() { $this->treeNestedGet = true; $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $this->whereRaw($db->qn('node') . '.' . $fldLft . ' >= ' . $db->qn('parent') . '.' . $fldLft); $this->whereRaw($db->qn('node') . '.' . $fldLft . ' <= ' . $db->qn('parent') . '.' . $fldRgt); $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' = ' . $db->q($this->lft)); } /** * get() will return all descendants (even subtrees of subtrees!) but not ourselves * * @return void */ protected function scopeDescendants() { $this->treeNestedGet = true; $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $this->whereRaw($db->qn('node') . '.' . $fldLft . ' > ' . $db->qn('parent') . '.' . $fldLft); $this->whereRaw($db->qn('node') . '.' . $fldLft . ' < ' . $db->qn('parent') . '.' . $fldRgt); $this->whereRaw($db->qn('parent') . '.' . $fldLft . ' = ' . $db->q($this->lft)); } /** * get() will only return immediate descendants (first level children) of the current node * * @return void */ protected function scopeImmediateDescendants() { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $subQuery = $db->getQuery(true) ->select(array( $db->qn('node') . '.' . $fldLft, '(COUNT(*) - 1) AS ' . $db->qn('depth') )) ->from($db->qn($this->getTableName()) . ' AS ' . $db->qn('node')) ->from($db->qn($this->getTableName()) . ' AS ' . $db->qn('parent')) ->where($db->qn('node') . '.' . $fldLft . ' >= ' . $db->qn('parent') . '.' . $fldLft) ->where($db->qn('node') . '.' . $fldLft . ' <= ' . $db->qn('parent') . '.' . $fldRgt) ->where($db->qn('node') . '.' . $fldLft . ' = ' . $db->q($this->lft)) ->group($db->qn('node') . '.' . $fldLft) ->order($db->qn('node') . '.' . $fldLft . ' ASC'); $query = $db->getQuery(true) ->select(array( $db->qn('node') . '.' . $fldLft, '(COUNT(' . $db->qn('parent') . '.' . $fldLft . ') - (' . $db->qn('sub_tree') . '.' . $db->qn('depth') . ' + 1)) AS ' . $db->qn('depth') )) ->from($db->qn($this->getTableName()) . ' AS ' . $db->qn('node')) ->join('CROSS', $db->qn($this->getTableName()) . ' AS ' . $db->qn('parent')) ->join('CROSS', $db->qn($this->getTableName()) . ' AS ' . $db->qn('sub_parent')) ->join('CROSS', '(' . $subQuery . ') AS ' . $db->qn('sub_tree')) ->where($db->qn('node') . '.' . $fldLft . ' >= ' . $db->qn('parent') . '.' . $fldLft) ->where($db->qn('node') . '.' . $fldLft . ' <= ' . $db->qn('parent') . '.' . $fldRgt) ->where($db->qn('node') . '.' . $fldLft . ' >= ' . $db->qn('sub_parent') . '.' . $fldLft) ->where($db->qn('node') . '.' . $fldLft . ' <= ' . $db->qn('sub_parent') . '.' . $fldRgt) ->where($db->qn('sub_parent') . '.' . $fldLft . ' = ' . $db->qn('sub_tree') . '.' . $fldLft) ->group($db->qn('node') . '.' . $fldLft) ->having(array( $db->qn('depth') . ' > ' . $db->q(0), $db->qn('depth') . ' <= ' . $db->q(1), )) ->order($db->qn('node') . '.' . $fldLft . ' ASC'); $leftValues = $db->setQuery($query)->loadColumn(); if (empty($leftValues)) { $leftValues = array(0); } array_walk($leftValues, function (&$item, $key) use (&$db) { $item = $db->q($item); }); $this->whereRaw($db->qn('node') . '.' . $fldLft . ' IN (' . implode(',', $leftValues) . ')'); } /** * get() will not return the selected node if it's part of the query results * * @param FOFTableNested $node The node to exclude from the results * * @return void */ public function withoutNode(FOFTableNested $node) { $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $this->whereRaw('NOT(' . $db->qn('node') . '.' . $fldLft . ' = ' . $db->q($node->lft) . ')'); } /** * get() will not return ourselves if it's part of the query results * * @codeCoverageIgnore * * @return void */ protected function scopeWithoutSelf() { $this->withoutNode($this); } /** * get() will not return our root if it's part of the query results * * @codeCoverageIgnore * * @return void */ protected function scopeWithoutRoot() { $rootNode = $this->getRoot(); $this->withoutNode($rootNode); } /** * Returns the root node of the tree this node belongs to * * @return self * * @throws \RuntimeException */ public function getRoot() { // Sanity checks on current node position if($this->lft >= $this->rgt) { throw new RuntimeException('Invalid position values for the current node'); } // If this is a root node return itself (there is no such thing as the root of a root node) if ($this->isRoot()) { return $this; } if (empty($this->treeRoot) || !is_object($this->treeRoot) || !($this->treeRoot instanceof FOFTableNested)) { $this->treeRoot = null; // First try to get the record with the minimum ID $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); $subQuery = $db->getQuery(true) ->select('MIN(' . $fldLft . ')') ->from($db->qn($this->getTableName())); try { $table = $this->getClone(); $table->reset(); $root = $table ->whereRaw($fldLft . ' = (' . (string)$subQuery . ')') ->get(0, 1)->current(); if ($this->isDescendantOf($root)) { $this->treeRoot = $root; } } catch (\RuntimeException $e) { // If there is no root found throw an exception. Basically: your table is FUBAR. throw new \RuntimeException("No root found for table " . $this->getTableName() . ", node lft=" . $this->lft); } // If the above method didn't work, get all roots and select the one with the appropriate lft/rgt values if (is_null($this->treeRoot)) { // Find the node with depth = 0, lft < our lft and rgt > our right. That's our root node. $query = $db->getQuery(true) ->select(array( $db->qn('node') . '.' . $fldLft, '(COUNT(' . $db->qn('parent') . '.' . $fldLft . ') - 1) AS ' . $db->qn('depth') )) ->from($db->qn($this->getTableName()) . ' AS ' . $db->qn('node')) ->join('CROSS', $db->qn($this->getTableName()) . ' AS ' . $db->qn('parent')) ->where($db->qn('node') . '.' . $fldLft . ' >= ' . $db->qn('parent') . '.' . $fldLft) ->where($db->qn('node') . '.' . $fldLft . ' <= ' . $db->qn('parent') . '.' . $fldRgt) ->where($db->qn('node') . '.' . $fldLft . ' < ' . $db->q($this->lft)) ->where($db->qn('node') . '.' . $fldRgt . ' > ' . $db->q($this->rgt)) ->having($db->qn('depth') . ' = ' . $db->q(0)) ->group($db->qn('node') . '.' . $fldLft); // Get the lft value $targetLeft = $db->setQuery($query)->loadResult(); if (empty($targetLeft)) { // If there is no root found throw an exception. Basically: your table is FUBAR. throw new \RuntimeException("No root found for table " . $this->getTableName() . ", node lft=" . $this->lft); } try { $table = $this->getClone(); $table->reset(); $this->treeRoot = $table ->whereRaw($fldLft . ' = ' . $db->q($targetLeft)) ->get(0, 1)->current(); } catch (\RuntimeException $e) { // If there is no root found throw an exception. Basically: your table is FUBAR. throw new \RuntimeException("No root found for table " . $this->getTableName() . ", node lft=" . $this->lft); } } } return $this->treeRoot; } /** * Get all ancestors to this node and the node itself. In other words it gets the full path to the node and the node * itself. * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getAncestorsAndSelf() { $this->scopeAncestorsAndSelf(); return $this->get(); } /** * Get all ancestors to this node and the node itself, but not the root node. If you want to * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getAncestorsAndSelfWithoutRoot() { $this->scopeAncestorsAndSelf(); $this->scopeWithoutRoot(); return $this->get(); } /** * Get all ancestors to this node but not the node itself. In other words it gets the path to the node, without the * node itself. * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getAncestors() { $this->scopeAncestorsAndSelf(); $this->scopeWithoutSelf(); return $this->get(); } /** * Get all ancestors to this node but not the node itself and its root. * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getAncestorsWithoutRoot() { $this->scopeAncestors(); $this->scopeWithoutRoot(); return $this->get(); } /** * Get all sibling nodes, including ourselves * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getSiblingsAndSelf() { $this->scopeSiblingsAndSelf(); return $this->get(); } /** * Get all sibling nodes, except ourselves * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getSiblings() { $this->scopeSiblings(); return $this->get(); } /** * Get all leaf nodes in the tree. You may want to use the scopes to narrow down the search in a specific subtree or * path. * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getLeaves() { $this->scopeLeaves(); return $this->get(); } /** * Get all descendant (children) nodes and ourselves. * * Note: all descendant nodes, even descendants of our immediate descendants, will be returned. * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getDescendantsAndSelf() { $this->scopeDescendantsAndSelf(); return $this->get(); } /** * Get only our descendant (children) nodes, not ourselves. * * Note: all descendant nodes, even descendants of our immediate descendants, will be returned. * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getDescendants() { $this->scopeDescendants(); return $this->get(); } /** * Get the immediate descendants (children). Unlike getDescendants it only goes one level deep into the tree * structure. Descendants of descendant nodes will not be returned. * * @codeCoverageIgnore * * @return FOFDatabaseIterator */ public function getImmediateDescendants() { $this->scopeImmediateDescendants(); return $this->get(); } /** * Returns a hashed array where each element's key is the value of the $key column (default: the ID column of the * table) and its value is the value of the $column column (default: title). Each nesting level will have the value * of the $column column prefixed by a number of $separator strings, as many as its nesting level (depth). * * This is useful for creating HTML select elements showing the hierarchy in a human readable format. * * @param string $column * @param null $key * @param string $seperator * * @return array */ public function getNestedList($column = 'title', $key = null, $seperator = ' ') { $db = $this->getDbo(); $fldLft = $db->qn($this->getColumnAlias('lft')); $fldRgt = $db->qn($this->getColumnAlias('rgt')); if (empty($key) || !$this->hasField($key)) { $key = $this->getKeyName(); } if (empty($column)) { $column = 'title'; } $fldKey = $db->qn($this->getColumnAlias($key)); $fldColumn = $db->qn($this->getColumnAlias($column)); $query = $db->getQuery(true) ->select(array( $db->qn('node') . '.' . $fldKey, $db->qn('node') . '.' . $fldColumn, '(COUNT(' . $db->qn('parent') . '.' . $fldKey . ') - 1) AS ' . $db->qn('depth') )) ->from($db->qn($this->getTableName()) . ' AS ' . $db->qn('node')) ->join('CROSS', $db->qn($this->getTableName()) . ' AS ' . $db->qn('parent')) ->where($db->qn('node') . '.' . $fldLft . ' >= ' . $db->qn('parent') . '.' . $fldLft) ->where($db->qn('node') . '.' . $fldLft . ' <= ' . $db->qn('parent') . '.' . $fldRgt) ->group($db->qn('node') . '.' . $fldLft) ->order($db->qn('node') . '.' . $fldLft . ' ASC'); $tempResults = $db->setQuery($query)->loadAssocList(); $ret = array(); if (!empty($tempResults)) { foreach ($tempResults as $row) { $ret[$row[$key]] = str_repeat($seperator, $row['depth']) . $row[$column]; } } return $ret; } /** * Locate a node from a given path, e.g. "/some/other/leaf" * * Notes: * - This will only work when you have a "slug" and a "hash" field in your table. * - If the path starts with "/" we will use the root with lft=1. Otherwise the first component of the path is * supposed to be the slug of the root node. * - If the root node is not found you'll get null as the return value * - You will also get null if any component of the path is not found * * @param string $path The path to locate * * @return FOFTableNested|null The found node or null if nothing is found */ public function findByPath($path) { // @todo } public function isValid() { // @todo } public function rebuild() { // @todo } /** * Resets cached values used to speed up querying the tree * * @return static for chaining */ protected function resetTreeCache() { $this->treeDepth = null; $this->treeRoot = null; $this->treeParent = null; $this->treeNestedGet = false; return $this; } /** * Add custom, pre-compiled WHERE clauses for use in buildQuery. The raw WHERE clause you specify is added as is to * the query generated by buildQuery. You are responsible for quoting and escaping the field names and data found * inside the WHERE clause. * * @param string $rawWhereClause The raw WHERE clause to add * * @return $this For chaining */ public function whereRaw($rawWhereClause) { $this->whereClauses[] = $rawWhereClause; return $this; } /** * Builds the query for the get() method * * @return JDatabaseQuery */ protected function buildQuery() { $db = $this->getDbo(); $query = $db->getQuery(true) ->select($db->qn('node') . '.*') ->from($db->qn($this->getTableName()) . ' AS ' . $db->qn('node')); if ($this->treeNestedGet) { $query ->join('CROSS', $db->qn($this->getTableName()) . ' AS ' . $db->qn('parent')); } // Apply custom WHERE clauses if (count($this->whereClauses)) { foreach ($this->whereClauses as $clause) { $query->where($clause); } } return $query; } /** * Returns a database iterator to retrieve records. Use the scope methods and the whereRaw method to define what * exactly will be returned. * * @param integer $limitstart How many items to skip from the start, only when $overrideLimits = true * @param integer $limit How many items to return, only when $overrideLimits = true * * @return FOFDatabaseIterator The data collection */ public function get($limitstart = 0, $limit = 0) { $limitstart = max($limitstart, 0); $limit = max($limit, 0); $query = $this->buildQuery(); $db = $this->getDbo(); $db->setQuery($query, $limitstart, $limit); $cursor = $db->execute(); $dataCollection = FOFDatabaseIterator::getIterator($db->name, $cursor, null, $this->config['_table_class']); return $dataCollection; } } PK���\]L�)libraries/fof/database/iterator/mysql.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage database * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; /** * MySQL database iterator. */ class FOFDatabaseIteratorMysql extends FOFDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @see Countable::count() */ public function count() { return @mysql_num_rows($this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. */ protected function fetchObject() { return @mysql_fetch_object($this->cursor, $this->class); } /** * Method to free up the memory used for the result set. * * @return void */ protected function freeResult() { @mysql_free_result($this->cursor); } } PK���\�jR(*libraries/fof/database/iterator/sqlsrv.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage database * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; /** * SQL server database iterator. */ class FOFDatabaseIteratorSqlsrv extends FOFDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @see Countable::count() */ public function count() { return @sqlsrv_num_rows($this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. */ protected function fetchObject() { return @sqlsrv_fetch_object($this->cursor, $this->class); } /** * Method to free up the memory used for the result set. * * @return void */ protected function freeResult() { @sqlsrv_free_stmt($this->cursor); } } PK���\�w2*libraries/fof/database/iterator/mysqli.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage database * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; /** * MySQLi database iterator. */ class FOFDatabaseIteratorMysqli extends FOFDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @see Countable::count() */ public function count() { return @mysqli_num_rows($this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. */ protected function fetchObject() { return @mysqli_fetch_object($this->cursor, $this->class); } /** * Method to free up the memory used for the result set. * * @return void */ protected function freeResult() { @mysqli_free_result($this->cursor); } } PK���\Q�<.libraries/fof/database/iterator/postgresql.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage database * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; /** * PostgreSQL database iterator. */ class FOFDatabaseIteratorPostgresql extends FOFDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @see Countable::count() */ public function count() { return @pg_num_rows($this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. */ protected function fetchObject() { return @pg_fetch_object($this->cursor, null, $this->class); } /** * Method to free up the memory used for the result set. * * @return void */ protected function freeResult() { @pg_free_result($this->cursor); } } PK���\N�S�))'libraries/fof/database/iterator/pdo.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage database * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; /** * PDO database iterator. */ class FOFDatabaseIteratorPdo extends FOFDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @see Countable::count() */ public function count() { if (!empty($this->cursor) && $this->cursor instanceof PDOStatement) { return @$this->cursor->rowCount(); } else { return 0; } } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. */ protected function fetchObject() { if (!empty($this->cursor) && $this->cursor instanceof PDOStatement) { return @$this->cursor->fetchObject($this->class); } else { return false; } } /** * Method to free up the memory used for the result set. * * @return void */ protected function freeResult() { if (!empty($this->cursor) && $this->cursor instanceof PDOStatement) { @$this->cursor->closeCursor(); } } } PK���\���SS)libraries/fof/database/iterator/azure.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage database * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; /** * SQL azure database iterator. */ class FOFDatabaseIteratorAzure extends FOFDatabaseIteratorSqlsrv { } PK���\���T""#libraries/fof/database/iterator.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage database * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; /** * Database iterator */ abstract class FOFDatabaseIterator implements Iterator { /** * The database cursor. * * @var mixed */ protected $cursor; /** * The class of object to create. * * @var string */ protected $class; /** * The name of the column to use for the key of the database record. * * @var mixed */ private $_column; /** * The current database record. * * @var mixed */ private $_current; /** * The current database record as a FOFTable object. * * @var FOFTable */ private $_currentTable; /** * A numeric or string key for the current database record. * * @var scalar */ private $_key; /** * The number of fetched records. * * @var integer */ private $_fetched = 0; /** * A FOFTable object created using the class type $class, used by getTable * * @var FOFTable */ private $_tableObject = null; /** * Returns an iterator object for a specific database type * * @param string $dbName The database type, e.g. mysql, mysqli, sqlazure etc. * @param mixed $cursor The database cursor * @param string $column An option column to use as the iterator key * @param string $class The table class of the returned objects * @param array $config Configuration parameters to push to the table class * * @return FOFDatabaseIterator * * @throws InvalidArgumentException */ public static function &getIterator($dbName, $cursor, $column = null, $class, $config = array()) { $className = 'FOFDatabaseIterator' . ucfirst($dbName); $object = new $className($cursor, $column, $class, $config); return $object; } /** * Database iterator constructor. * * @param mixed $cursor The database cursor. * @param string $column An option column to use as the iterator key. * @param string $class The table class of the returned objects. * @param array $config Configuration parameters to push to the table class * * @throws InvalidArgumentException */ public function __construct($cursor, $column = null, $class, $config = array()) { // Figure out the type and prefix of the class by the class name $parts = FOFInflector::explode($class); if(count($parts) != 3) { throw new InvalidArgumentException('Invalid table name, expected a pattern like ComponentTableFoobar got '.$class); } $this->_tableObject = FOFTable::getInstance($parts[2], ucfirst($parts[0]) . ucfirst($parts[1]))->getClone(); $this->cursor = $cursor; $this->class = 'stdClass'; $this->_column = $column; $this->_fetched = 0; $this->next(); } /** * Database iterator destructor. */ public function __destruct() { if ($this->cursor) { $this->freeResult($this->cursor); } } /** * The current element in the iterator. * * @return object * * @see Iterator::current() */ public function current() { return $this->_currentTable; } /** * The key of the current element in the iterator. * * @return scalar * * @see Iterator::key() */ public function key() { return $this->_key; } /** * Moves forward to the next result from the SQL query. * * @return void * * @see Iterator::next() */ public function next() { // Set the default key as being the number of fetched object $this->_key = $this->_fetched; // Try to get an object $this->_current = $this->fetchObject(); // If an object has been found if ($this->_current) { $this->_currentTable = $this->getTable(); // Set the key as being the indexed column (if it exists) if (isset($this->_current->{$this->_column})) { $this->_key = $this->_current->{$this->_column}; } // Update the number of fetched object $this->_fetched++; } } /** * Rewinds the iterator. * * This iterator cannot be rewound. * * @return void * * @see Iterator::rewind() */ public function rewind() { } /** * Checks if the current position of the iterator is valid. * * @return boolean * * @see Iterator::valid() */ public function valid() { return (boolean) $this->_current; } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. */ abstract protected function fetchObject(); /** * Method to free up the memory used for the result set. * * @return void */ abstract protected function freeResult(); /** * Returns the data in $this->_current as a FOFTable instance * * @return FOFTable * * @throws OutOfBoundsException */ protected function getTable() { if (!$this->valid()) { throw new OutOfBoundsException('Cannot get item past iterator\'s bounds', 500); } $this->_tableObject->bind($this->_current); return $this->_tableObject; } } PK���\M]2J�,�,$libraries/fof/database/installer.phpnu�[���<?php /** * @package fof * @copyright 2014 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU GPL version 3 or later */ class FOFDatabaseInstaller { /** @var JDatabase The database connector object */ private $db = null; /** * @var FOFInput Input variables */ protected $input = array(); /** @var string The directory where the XML schema files are stored */ private $xmlDirectory = null; /** @var array A list of the base names of the XML schema files */ public $xmlFiles = array('mysql', 'mysqli', 'pdomysql', 'postgresql', 'sqlsrv', 'mssql'); /** * Public constructor * * @param array $config The configuration array */ public function __construct($config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } // Get the input if (array_key_exists('input', $config)) { if ($config['input'] instanceof FOFInput) { $this->input = $config['input']; } else { $this->input = new FOFInput($config['input']); } } else { $this->input = new FOFInput; } // Set the database object if (array_key_exists('dbo', $config)) { $this->db = $config['dbo']; } else { $this->db = FOFPlatform::getInstance()->getDbo(); } // Set the $name/$_name variable $component = $this->input->getCmd('option', 'com_foobar'); if (array_key_exists('option', $config)) { $component = $config['option']; } // Figure out where the XML schema files are stored if (array_key_exists('dbinstaller_directory', $config)) { $this->xmlDirectory = $config['dbinstaller_directory']; } else { // Nothing is defined, assume the files are stored in the sql/xml directory inside the component's administrator section $directories = FOFPlatform::getInstance()->getComponentBaseDirs($component); $this->setXmlDirectory($directories['admin'] . '/sql/xml'); } // Do we have a set of XML files to look for? if (array_key_exists('dbinstaller_files', $config)) { $files = $config['dbinstaller_files']; if (!is_array($files)) { $files = explode(',', $files); } $this->xmlFiles = $files; } } /** * Sets the directory where XML schema files are stored * * @param string $xmlDirectory */ public function setXmlDirectory($xmlDirectory) { $this->xmlDirectory = $xmlDirectory; } /** * Returns the directory where XML schema files are stored * * @return string */ public function getXmlDirectory() { return $this->xmlDirectory; } /** * Creates or updates the database schema * * @return void * * @throws Exception When a database query fails and it doesn't have the canfail flag */ public function updateSchema() { // Get the schema XML file $xml = $this->findSchemaXml(); if (empty($xml)) { return; } // Make sure there are SQL commands in this file if (!$xml->sql) { return; } // Walk the sql > action tags to find all tables $tables = array(); /** @var SimpleXMLElement $actions */ $actions = $xml->sql->children(); /** @var SimpleXMLElement $action */ foreach ($actions as $action) { // Get the attributes $attributes = $action->attributes(); // Get the table / view name $table = $attributes->table ? $attributes->table : ''; if (empty($table)) { continue; } // Am I allowed to let this action fail? $canFailAction = $attributes->canfail ? $attributes->canfail : 0; // Evaluate conditions $shouldExecute = true; /** @var SimpleXMLElement $node */ foreach ($action->children() as $node) { if ($node->getName() == 'condition') { // Get the operator $operator = $node->attributes()->operator ? (string)$node->attributes()->operator : 'and'; $operator = empty($operator) ? 'and' : $operator; $condition = $this->conditionMet($table, $node); switch ($operator) { case 'not': $shouldExecute = $shouldExecute && !$condition; break; case 'or': $shouldExecute = $shouldExecute || $condition; break; case 'nor': $shouldExecute = $shouldExecute || !$condition; break; case 'xor': $shouldExecute = ($shouldExecute xor $condition); break; case 'maybe': $shouldExecute = $condition ? true : $shouldExecute; break; default: $shouldExecute = $shouldExecute && $condition; break; } } if (!$shouldExecute) { break; } } // Make sure all conditions are met if (!$shouldExecute) { continue; } // Execute queries foreach ($action->children() as $node) { if ($node->getName() == 'query') { $canFail = $node->attributes->canfail ? $node->attributes->canfail : $canFailAction; $this->db->setQuery((string) $node); try { if (version_compare(JVERSION, '3.1', 'lt')) { $handlers = array( E_NOTICE => JError::getErrorHandling(E_NOTICE), E_WARNING => JError::getErrorHandling(E_WARNING), E_ERROR => JError::getErrorHandling(E_ERROR), ); $handlers[E_NOTICE]['options'] = isset($handlers[E_NOTICE]['options']) ? $handlers[E_NOTICE]['options'] : null; $handlers[E_WARNING]['options'] = isset($handlers[E_WARNING]['options']) ? $handlers[E_WARNING]['options'] : null; $handlers[E_ERROR]['options'] = isset($handlers[E_ERROR]['options']) ? $handlers[E_ERROR]['options'] : null; JError::setErrorHandling(E_NOTICE, 'ignore'); JError::setErrorHandling(E_WARNING, 'ignore'); JError::setErrorHandling(E_ERROR, 'ignore'); } $this->db->execute(); if (version_compare(JVERSION, '3.1', 'lt')) { JError::setErrorHandling(E_NOTICE, $handlers[E_NOTICE]['mode'], $handlers[E_NOTICE]['options']); JError::setErrorHandling(E_WARNING, $handlers[E_WARNING]['mode'], $handlers[E_WARNING]['options']); JError::setErrorHandling(E_ERROR, $handlers[E_ERROR]['mode'], $handlers[E_ERROR]['options']); } if (version_compare(JVERSION, '3.1', 'lt') && $this->db->getErrorNum()) { if (!$canFail) { JError::raise(E_WARNING, $this->db->getErrorNum(), $this->db->getErrorMsg()); } } /**/ } catch (Exception $e) { // If we are not allowed to fail, throw back the exception we caught if (!$canFail) { throw $e; } } } } } } /** * Uninstalls the database schema * * @return void */ public function removeSchema() { // Get the schema XML file $xml = $this->findSchemaXml(); if (empty($xml)) { return; } // Make sure there are SQL commands in this file if (!$xml->sql) { return; } // Walk the sql > action tags to find all tables $tables = array(); /** @var SimpleXMLElement $actions */ $actions = $xml->sql->children(); /** @var SimpleXMLElement $action */ foreach ($actions as $action) { $attributes = $action->attributes(); $tables[] = (string)$attributes->table; } // Simplify the tables list $tables = array_unique($tables); // Start dropping tables foreach ($tables as $table) { try { $this->db->dropTable($table); } catch (Exception $e) { // Do not fail if I can't drop the table } } } /** * Find an suitable schema XML file for this database type and return the SimpleXMLElement holding its information * * @return null|SimpleXMLElement Null if no suitable schema XML file is found */ protected function findSchemaXml() { $driverType = $this->db->name; $xml = null; // And now look for the file foreach ($this->xmlFiles as $baseName) { // Remove any accidental whitespace $baseName = trim($baseName); // Get the full path to the file $fileName = $this->xmlDirectory . '/' . $baseName . '.xml'; // Make sure the file exists if (!@file_exists($fileName)) { continue; } // Make sure the file is a valid XML document try { $xml = new SimpleXMLElement($fileName, LIBXML_NONET, true); } catch (Exception $e) { $xml = null; continue; } // Make sure the file is an XML schema file if ($xml->getName() != 'schema') { $xml = null; continue; } if (!$xml->meta) { $xml = null; continue; } if (!$xml->meta->drivers) { $xml = null; continue; } /** @var SimpleXMLElement $drivers */ $drivers = $xml->meta->drivers; // Strict driver name match foreach ($drivers->children() as $driverTypeTag) { $thisDriverType = (string)$driverTypeTag; if ($thisDriverType == $driverType) { return $xml; } } // Some custom database drivers use a non-standard $name variable. Let try a relaxed match. foreach ($drivers->children() as $driverTypeTag) { $thisDriverType = (string)$driverTypeTag; if ( // e.g. $driverType = 'mysqlistupid', $thisDriverType = 'mysqli' => driver matched strpos($driverType, $thisDriverType) === 0 // e.g. $driverType = 'stupidmysqli', $thisDriverType = 'mysqli' => driver matched || (substr($driverType, -strlen($thisDriverType)) == $thisDriverType) ) { return $xml; } } $xml = null; } return $xml; } /** * Checks if a condition is met * * @param string $table The table we're operating on * @param SimpleXMLElement $node The condition definition node * * @return bool */ protected function conditionMet($table, SimpleXMLElement $node) { static $allTables = null; if (empty($allTables)) { $allTables = $this->db->getTableList(); } // Does the table exist? $tableNormal = $this->db->replacePrefix($table); $tableExists = in_array($tableNormal, $allTables); // Initialise $condition = false; // Get the condition's attributes $attributes = $node->attributes(); $type = $attributes->type ? $attributes->type : null; $value = $attributes->value ? (string) $attributes->value : null; switch ($type) { // Check if a table or column is missing case 'missing': $tableName = (string)$table; $fieldName = (string)$value; if (empty($fieldName)) { $condition = !$tableExists; } else { $tableColumns = $this->db->getTableColumns($tableNormal, true); $condition = !array_key_exists($fieldName, $tableColumns); } break; // Check if a column type matches the "coltype" attribute case 'type': $tableColumns = $this->db->getTableColumns($table, false); $condition = false; if (array_key_exists($value, $tableColumns)) { $coltype = $attributes->coltype ? $attributes->coltype : null; if (!empty($coltype)) { $coltype = strtolower($coltype); $currentType = strtolower($tableColumns[$value]->Type); $condition = ($coltype == $currentType); } } break; // Check if the result of a query matches our expectation case 'equals': $query = (string)$node; $this->db->setQuery($query); try { $result = $this->db->loadResult(); $condition = ($result == $value); } catch (Exception $e) { return false; } break; // Always returns true case 'true': return true; break; default: return false; break; } return $condition; } } PK���\�6� ��/libraries/fof/platform/filesystem/interface.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage platformFilesystem * @copyright Copyright (C) 2010 - 2015 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; interface FOFPlatformFilesystemInterface { /** * Does the file exists? * * @param $path string Path to the file to test * * @return bool */ public function fileExists($path); /** * Delete a file or array of files * * @param mixed $file The file name or an array of file names * * @return boolean True on success * */ public function fileDelete($file); /** * Copies a file * * @param string $src The path to the source file * @param string $dest The path to the destination file * * @return boolean True on success */ public function fileCopy($src, $dest); /** * Write contents to a file * * @param string $file The full file path * @param string &$buffer The buffer to write * * @return boolean True on success */ public function fileWrite($file, &$buffer); /** * Checks for snooping outside of the file system root. * * @param string $path A file system path to check. * * @return string A cleaned version of the path or exit on error. * * @throws Exception */ public function pathCheck($path); /** * Function to strip additional / or \ in a path name. * * @param string $path The path to clean. * @param string $ds Directory separator (optional). * * @return string The cleaned path. * * @throws UnexpectedValueException */ public function pathClean($path, $ds = DIRECTORY_SEPARATOR); /** * Searches the directory paths for a given file. * * @param mixed $paths An path string or array of path strings to search in * @param string $file The file name to look for. * * @return mixed The full path and file name for the target file, or boolean false if the file is not found in any of the paths. */ public function pathFind($paths, $file); /** * Wrapper for the standard file_exists function * * @param string $path Folder name relative to installation dir * * @return boolean True if path is a folder */ public function folderExists($path); /** * Utility function to read the files in a folder. * * @param string $path The path of the folder to read. * @param string $filter A filter for file names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $full True to return the full path to the file. * @param array $exclude Array with names of files which should not be shown in the result. * @param array $excludefilter Array of filter to exclude * * @return array Files in the given folder. */ public function folderFiles($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*', '.*~')); /** * Utility function to read the folders in a folder. * * @param string $path The path of the folder to read. * @param string $filter A filter for folder names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $full True to return the full path to the folders. * @param array $exclude Array with names of folders which should not be shown in the result. * @param array $excludefilter Array with regular expressions matching folders which should not be shown in the result. * * @return array Folders in the given folder. */ public function folderFolders($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*')); /** * Create a folder -- and all necessary parent folders. * * @param string $path A path to create from the base path. * @param integer $mode Directory permissions to set for folders created. 0755 by default. * * @return boolean True if successful. */ public function folderCreate($path = '', $mode = 0755); }PK���\*�{��0libraries/fof/platform/filesystem/filesystem.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage platform * @copyright Copyright (C) 2010 - 2015 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; abstract class FOFPlatformFilesystem implements FOFPlatformFilesystemInterface { /** * The list of paths where platform class files will be looked for * * @var array */ protected static $paths = array(); /** * This method will crawl a starting directory and get all the valid files that will be analyzed by getInstance. * Then it organizes them into an associative array. * * @param string $path Folder where we should start looking * @param array $ignoreFolders Folder ignore list * @param array $ignoreFiles File ignore list * * @return array Associative array, where the `fullpath` key contains the path to the file, * and the `classname` key contains the name of the class */ protected static function getFiles($path, array $ignoreFolders = array(), array $ignoreFiles = array()) { $return = array(); $files = self::scanDirectory($path, $ignoreFolders, $ignoreFiles); // Ok, I got the files, now I have to organize them foreach($files as $file) { $clean = str_replace($path, '', $file); $clean = trim(str_replace('\\', '/', $clean), '/'); $parts = explode('/', $clean); // If I have less than 3 fragments, it means that the file was inside the generic folder // (interface + abstract) so I have to skip it if(count($parts) < 3) { continue; } $return[] = array( 'fullpath' => $file, 'classname' => 'FOFPlatform'.ucfirst($parts[0]).ucfirst(basename($parts[1], '.php')) ); } return $return; } /** * Recursive function that will scan every directory unless it's in the ignore list. Files that aren't in the * ignore list are returned. * * @param string $path Folder where we should start looking * @param array $ignoreFolders Folder ignore list * @param array $ignoreFiles File ignore list * * @return array List of all the files */ protected static function scanDirectory($path, array $ignoreFolders = array(), array $ignoreFiles = array()) { $return = array(); $handle = @opendir($path); if(!$handle) { return $return; } while (($file = readdir($handle)) !== false) { if($file == '.' || $file == '..') { continue; } $fullpath = $path . '/' . $file; if((is_dir($fullpath) && in_array($file, $ignoreFolders)) || (is_file($fullpath) && in_array($file, $ignoreFiles))) { continue; } if(is_dir($fullpath)) { $return = array_merge(self::scanDirectory($fullpath, $ignoreFolders, $ignoreFiles), $return); } else { $return[] = $path . '/' . $file; } } return $return; } /** * Gets the extension of a file name * * @param string $file The file name * * @return string The file extension */ public function getExt($file) { $dot = strrpos($file, '.') + 1; return substr($file, $dot); } /** * Strips the last extension off of a file name * * @param string $file The file name * * @return string The file name without the extension */ public function stripExt($file) { return preg_replace('#\.[^.]*$#', '', $file); } }PK���\&M�pApA$libraries/fof/platform/interface.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage platform * @copyright Copyright (C) 2010 - 2015 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; /** * Part of the FOF Platform Abstraction Layer. It implements everything that * depends on the platform FOF is running under, e.g. the Joomla! CMS front-end, * the Joomla! CMS back-end, a CLI Joomla! Platform app, a bespoke Joomla! * Platform / Framework web application and so on. * * This is the abstract class implementing some basic housekeeping functionality * and provides the static interface to get the appropriate Platform object for * use in the rest of the framework. * * @package FrameworkOnFramework * @since 2.1 */ interface FOFPlatformInterface { /** * Checks if the current script is run inside a valid CMS execution * * @return bool */ public function checkExecution(); /** * Set the error Handling, if possible * * @param integer $level PHP error level (E_ALL) * @param string $log_level What to do with the error (ignore, callback) * @param array $options Options for the error handler * * @return void */ public function setErrorHandling($level, $log_level, $options = array()); /** * Raises an error, using the logic requested by the CMS (PHP Exception or dedicated class) * * @param integer $code * @param string $message * * @return mixed */ public function raiseError($code, $message); /** * Returns the ordering of the platform class. Files with a lower ordering * number will be loaded first. * * @return integer */ public function getOrdering(); /** * Returns a platform integration object * * @param string $key The key name of the platform integration object, e.g. 'filesystem' * * @return object * * @since 2.1.2 */ public function getIntegrationObject($key); /** * Forces a platform integration object instance * * @param string $key The key name of the platform integration object, e.g. 'filesystem' * @param object $object The object to force for this key * * @return object * * @since 2.1.2 */ public function setIntegrationObject($key, $object); /** * Is this platform enabled? This is used for automatic platform detection. * If the environment we're currently running in doesn't seem to be your * platform return false. If many classes return true, the one with the * lowest order will be picked by FOFPlatform. * * @return boolean */ public function isEnabled(); /** * Returns the (internal) name of the platform implementation, e.g. * "joomla", "foobar123" etc. This MUST be the last part of the platform * class name. For example, if you have a plaform implementation class * FOFPlatformFoobar you MUST return "foobar" (all lowercase). * * @return string * * @since 2.1.2 */ public function getPlatformName(); /** * Returns the version number string of the platform, e.g. "4.5.6". If * implementation integrates with a CMS or a versioned foundation (e.g. * a framework) it is advisable to return that version. * * @return string * * @since 2.1.2 */ public function getPlatformVersion(); /** * Returns the human readable platform name, e.g. "Joomla!", "Joomla! * Framework", "Something Something Something Framework" etc. * * @return string * * @since 2.1.2 */ public function getPlatformHumanName(); /** * Returns absolute path to directories used by the CMS. * * The return is a table with the following key: * * root Path to the site root * * public Path to the public area of the site * * admin Path to the administrative area of the site * * tmp Path to the temp directory * * log Path to the log directory * * @return array A hash array with keys root, public, admin, tmp and log. */ public function getPlatformBaseDirs(); /** * Returns the base (root) directories for a given component. The * "component" is used in the sense of what we call "component" in Joomla!, * "plugin" in WordPress and "module" in Drupal, i.e. an application which * is running inside our main application (CMS). * * The return is a table with the following keys: * * main The normal location of component files. For a back-end Joomla! * component this is the administrator/components/com_example * directory. * * alt The alternate location of component files. For a back-end * Joomla! component this is the front-end directory, e.g. * components/com_example * * site The location of the component files serving the public part of * the application. * * admin The location of the component files serving the administrative * part of the application. * * All paths MUST be absolute. All four paths MAY be the same if the * platform doesn't make a distinction between public and private parts, * or when the component does not provide both a public and private part. * All of the directories MUST be defined and non-empty. * * @param string $component The name of the component. For Joomla! this * is something like "com_example" * * @return array A hash array with keys main, alt, site and admin. */ public function getComponentBaseDirs($component); /** * Return a list of the view template paths for this component. The paths * are in the format site:/component_name/view_name/layout_name or * admin:/component_name/view_name/layout_name * * The list of paths returned is a prioritised list. If a file is * found in the first path the other paths will not be scanned. * * @param string $component The name of the component. For Joomla! this * is something like "com_example" * @param string $view The name of the view you're looking a * template for * @param string $layout The layout name to load, e.g. 'default' * @param string $tpl The sub-template name to load (null by default) * @param boolean $strict If true, only the specified layout will be * searched for. Otherwise we'll fall back to * the 'default' layout if the specified layout * is not found. * * @return array */ public function getViewTemplatePaths($component, $view, $layout = 'default', $tpl = null, $strict = false); /** * Get application-specific suffixes to use with template paths. This allows * you to look for view template overrides based on the application version. * * @return array A plain array of suffixes to try in template names */ public function getTemplateSuffixes(); /** * Return the absolute path to the application's template overrides * directory for a specific component. We will use it to look for template * files instead of the regular component directorues. If the application * does not have such a thing as template overrides return an empty string. * * @param string $component The name of the component for which to fetch the overrides * @param boolean $absolute Should I return an absolute or relative path? * * @return string The path to the template overrides directory */ public function getTemplateOverridePath($component, $absolute = true); /** * Load the translation files for a given component. The * "component" is used in the sense of what we call "component" in Joomla!, * "plugin" in WordPress and "module" in Drupal, i.e. an application which * is running inside our main application (CMS). * * @param string $component The name of the component. For Joomla! this * is something like "com_example" * * @return void */ public function loadTranslations($component); /** * By default FOF will only use the Controller's onBefore* methods to * perform user authorisation. In some cases, like the Joomla! back-end, * you alos need to perform component-wide user authorisation in the * Dispatcher. This method MUST implement this authorisation check. If you * do not need this in your platform, please always return true. * * @param string $component The name of the component. * * @return boolean True to allow loading the component, false to halt loading */ public function authorizeAdmin($component); /** * This method will try retrieving a variable from the request (input) data. * If it doesn't exist it will be loaded from the user state, typically * stored in the session. If it doesn't exist there either, the $default * value will be used. If $setUserState is set to true, the retrieved * variable will be stored in the user session. * * @param string $key The user state key for the variable * @param string $request The request variable name for the variable * @param FOFInput $input The FOFInput object with the request (input) data * @param mixed $default The default value. Default: null * @param string $type The filter type for the variable data. Default: none (no filtering) * @param boolean $setUserState Should I set the user state with the fetched value? * * @return mixed The value of the variable */ public function getUserStateFromRequest($key, $request, $input, $default = null, $type = 'none', $setUserState = true); /** * Load plugins of a specific type. Obviously this seems to only be required * in the Joomla! CMS. * * @param string $type The type of the plugins to be loaded * * @return void */ public function importPlugin($type); /** * Execute plugins (system-level triggers) and fetch back an array with * their return values. * * @param string $event The event (trigger) name, e.g. onBeforeScratchMyEar * @param array $data A hash array of data sent to the plugins as part of the trigger * * @return array A simple array containing the resutls of the plugins triggered */ public function runPlugins($event, $data); /** * Perform an ACL check. Please note that FOF uses by default the Joomla! * CMS convention for ACL privileges, e.g core.edit for the edit privilege. * If your platform uses different conventions you'll have to override the * FOF defaults using fof.xml or by specialising the controller. * * @param string $action The ACL privilege to check, e.g. core.edit * @param string $assetname The asset name to check, typically the component's name * * @return boolean True if the user is allowed this action */ public function authorise($action, $assetname); /** * Returns a user object. * * @param integer $id The user ID to load. Skip or use null to retrieve * the object for the currently logged in user. * * @return JUser The JUser object for the specified user */ public function getUser($id = null); /** * Returns the JDocument object which handles this component's response. You * may also return null and FOF will a. try to figure out the output type by * examining the "format" input parameter (or fall back to "html") and b. * FOF will not attempt to load CSS and Javascript files (as it doesn't make * sense if there's no JDocument to handle them). * * @return JDocument */ public function getDocument(); /** * Returns an object to handle dates * * @param mixed $time The initial time * @param null $tzOffest The timezone offset * @param bool $locale Should I try to load a specific class for current language? * * @return JDate object */ public function getDate($time = 'now', $tzOffest = null, $locale = true); public function getLanguage(); public function getDbo(); /** * Is this the administrative section of the component? * * @return boolean */ public function isBackend(); /** * Is this the public section of the component? * * @return boolean */ public function isFrontend(); /** * Is this a component running in a CLI application? * * @return boolean */ public function isCli(); /** * Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All * other platforms should return false and never ask why. * * @return boolean */ public function supportsAjaxOrdering(); /** * Performs a check between two versions. Use this function instead of PHP version_compare * so we can mock it while testing * * @param string $version1 First version number * @param string $version2 Second version number * @param string $operator Operator (see version_compare for valid operators) * * @deprecated Use PHP's version_compare against JVERSION in your code. This method is scheduled for removal in FOF 3.0 * * @return boolean */ public function checkVersion($version1, $version2, $operator); /** * Saves something to the cache. This is supposed to be used for system-wide * FOF data, not application data. * * @param string $key The key of the data to save * @param string $content The actual data to save * * @return boolean True on success */ public function setCache($key, $content); /** * Retrieves data from the cache. This is supposed to be used for system-side * FOF data, not application data. * * @param string $key The key of the data to retrieve * @param string $default The default value to return if the key is not found or the cache is not populated * * @return string The cached value */ public function getCache($key, $default = null); /** * Clears the cache of system-wide FOF data. You are supposed to call this in * your components' installation script post-installation and post-upgrade * methods or whenever you are modifying the structure of database tables * accessed by FOF. Please note that FOF's cache never expires and is not * purged by Joomla!. You MUST use this method to manually purge the cache. * * @return boolean True on success */ public function clearCache(); /** * Returns an object that holds the configuration of the current site. * * @return mixed */ public function getConfig(); /** * Is the global FOF cache enabled? * * @return boolean */ public function isGlobalFOFCacheEnabled(); /** * logs in a user * * @param array $authInfo authentification information * * @return boolean True on success */ public function loginUser($authInfo); /** * logs out a user * * @return boolean True on success */ public function logoutUser(); public function logAddLogger($file); /** * Logs a deprecated practice. In Joomla! this results in the $message being output in the * deprecated log file, found in your site's log directory. * * @param string $message The deprecated practice log message * * @return void */ public function logDeprecated($message); public function logDebug($message); /** * Returns the root URI for the request. * * @param boolean $pathonly If false, prepend the scheme, host and port information. Default is false. * @param string $path The path * * @return string The root URI string. */ public function URIroot($pathonly = false, $path = null); /** * Returns the base URI for the request. * * @param boolean $pathonly If false, prepend the scheme, host and port information. Default is false. * | * @return string The base URI string */ public function URIbase($pathonly = false); /** * Method to set a response header. If the replace flag is set then all headers * with the given name will be replaced by the new one (only if the current platform supports header caching) * * @param string $name The name of the header to set. * @param string $value The value of the header to set. * @param boolean $replace True to replace any headers with the same name. * * @return void */ public function setHeader($name, $value, $replace = false); /** * In platforms that perform header caching, send all headers. * * @return void */ public function sendHeaders(); } PK���\ ��F�F#libraries/fof/platform/platform.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage platform * @copyright Copyright (C) 2010 - 2015 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; /** * Part of the FOF Platform Abstraction Layer. It implements everything that * depends on the platform FOF is running under, e.g. the Joomla! CMS front-end, * the Joomla! CMS back-end, a CLI Joomla! Platform app, a bespoke Joomla! * Platform / Framework web application and so on. * * This is the abstract class implementing some basic housekeeping functionality * and provides the static interface to get the appropriate Platform object for * use in the rest of the framework. * * @package FrameworkOnFramework * @since 2.1 */ abstract class FOFPlatform implements FOFPlatformInterface { /** * The ordering for this platform class. The lower this number is, the more * important this class becomes. Most important enabled class ends up being * used. * * @var integer */ public $ordering = 100; /** * The internal name of this platform implementation. It must match the * last part of the platform class name and be in all lowercase letters, * e.g. "foobar" for FOFPlatformFoobar * * @var string * * @since 2.1.2 */ public $name = ''; /** * The human readable platform name * * @var string * * @since 2.1.2 */ public $humanReadableName = 'Unknown Platform'; /** * The platform version string * * @var string * * @since 2.1.2 */ public $version = ''; /** * Caches the enabled status of this platform class. * * @var boolean */ protected $isEnabled = null; /** * Filesystem integration objects cache * * @var object * * @since 2.1.2 */ protected $objectCache = array(); /** * The list of paths where platform class files will be looked for * * @var array */ protected static $paths = array(); /** * The platform class instance which will be returned by getInstance * * @var FOFPlatformInterface */ protected static $instance = null; // ======================================================================== // Public API for platform integration handling // ======================================================================== /** * Register a path where platform files will be looked for. These take * precedence over the built-in platform files. * * @param string $path The path to add * * @return void */ public static function registerPlatformPath($path) { if (!in_array($path, self::$paths)) { self::$paths[] = $path; self::$instance = null; } } /** * Unregister a path where platform files will be looked for. * * @param string $path The path to remove * * @return void */ public static function unregisterPlatformPath($path) { $pos = array_search($path, self::$paths); if ($pos !== false) { unset(self::$paths[$pos]); self::$instance = null; } } /** * Force a specific platform object to be used. If null, nukes the cache * * @param FOFPlatformInterface|null $instance The Platform object to be used * * @return void */ public static function forceInstance($instance) { if ($instance instanceof FOFPlatformInterface || is_null($instance)) { self::$instance = $instance; } } /** * Find and return the most relevant platform object * * @return FOFPlatformInterface */ public static function getInstance() { if (!is_object(self::$instance)) { // Where to look for platform integrations $paths = array(__DIR__ . '/../integration'); if (is_array(self::$paths)) { $paths = array_merge($paths, self::$paths); } // Get a list of folders inside this directory $integrations = array(); foreach ($paths as $path) { if (!is_dir($path)) { continue; } $di = new DirectoryIterator($path); $temp = array(); foreach ($di as $fileSpec) { if (!$fileSpec->isDir()) { continue; } $fileName = $fileSpec->getFilename(); if (substr($fileName, 0, 1) == '.') { continue; } $platformFilename = $path . '/' . $fileName . '/platform.php'; if (!file_exists($platformFilename)) { continue; } $temp[] = array( 'classname' => 'FOFIntegration' . ucfirst($fileName) . 'Platform', 'fullpath' => $path . '/' . $fileName . '/platform.php', ); } $integrations = array_merge($integrations, $temp); } // Loop all paths foreach ($integrations as $integration) { // Get the class name for this platform class $class_name = $integration['classname']; // Load the file if the class doesn't exist if (!class_exists($class_name, false)) { @include_once $integration['fullpath']; } // If the class still doesn't exist this file didn't // actually contain a platform class; skip it if (!class_exists($class_name, false)) { continue; } // If it doesn't implement FOFPlatformInterface, skip it if (!class_implements($class_name, 'FOFPlatformInterface')) { continue; } // Get an object of this platform $o = new $class_name; // If it's not enabled, skip it if (!$o->isEnabled()) { continue; } if (is_object(self::$instance)) { // Replace self::$instance if this object has a // lower order number $current_order = self::$instance->getOrdering(); $new_order = $o->getOrdering(); if ($new_order < $current_order) { self::$instance = null; self::$instance = $o; } } else { // There is no self::$instance already, so use the // object we just created. self::$instance = $o; } } } return self::$instance; } /** * Returns the ordering of the platform class. * * @see FOFPlatformInterface::getOrdering() * * @return integer */ public function getOrdering() { return $this->ordering; } /** * Is this platform enabled? * * @see FOFPlatformInterface::isEnabled() * * @return boolean */ public function isEnabled() { if (is_null($this->isEnabled)) { $this->isEnabled = false; } return $this->isEnabled; } /** * Returns a platform integration object * * @param string $key The key name of the platform integration object, e.g. 'filesystem' * * @return object * * @since 2.1.2 */ public function getIntegrationObject($key) { $hasObject = false; if (array_key_exists($key, $this->objectCache)) { if (is_object($this->objectCache[$key])) { $hasObject = true; } } if (!$hasObject) { // Instantiate a new platform integration object $className = 'FOFIntegration' . ucfirst($this->getPlatformName()) . ucfirst($key); $this->objectCache[$key] = new $className; } return $this->objectCache[$key]; } /** * Forces a platform integration object instance * * @param string $key The key name of the platform integration object, e.g. 'filesystem' * @param object $object The object to force for this key * * @return object * * @since 2.1.2 */ public function setIntegrationObject($key, $object) { $this->objectCache[$key] = $object; } // ======================================================================== // Default implementation // ======================================================================== /** * Set the error Handling, if possible * * @param integer $level PHP error level (E_ALL) * @param string $log_level What to do with the error (ignore, callback) * @param array $options Options for the error handler * * @return void */ public function setErrorHandling($level, $log_level, $options = array()) { if (version_compare(JVERSION, '3.0', 'lt') ) { return JError::setErrorHandling($level, $log_level, $options); } } /** * Returns the base (root) directories for a given component. * * @param string $component The name of the component. For Joomla! this * is something like "com_example" * * @see FOFPlatformInterface::getComponentBaseDirs() * * @return array A hash array with keys main, alt, site and admin. */ public function getComponentBaseDirs($component) { return array( 'main' => '', 'alt' => '', 'site' => '', 'admin' => '', ); } /** * Return a list of the view template directories for this component. * * @param string $component The name of the component. For Joomla! this * is something like "com_example" * @param string $view The name of the view you're looking a * template for * @param string $layout The layout name to load, e.g. 'default' * @param string $tpl The sub-template name to load (null by default) * @param boolean $strict If true, only the specified layout will be * searched for. Otherwise we'll fall back to * the 'default' layout if the specified layout * is not found. * * @see FOFPlatformInterface::getViewTemplateDirs() * * @return array */ public function getViewTemplatePaths($component, $view, $layout = 'default', $tpl = null, $strict = false) { return array(); } /** * Get application-specific suffixes to use with template paths. This allows * you to look for view template overrides based on the application version. * * @return array A plain array of suffixes to try in template names */ public function getTemplateSuffixes() { return array(); } /** * Return the absolute path to the application's template overrides * directory for a specific component. We will use it to look for template * files instead of the regular component directorues. If the application * does not have such a thing as template overrides return an empty string. * * @param string $component The name of the component for which to fetch the overrides * @param boolean $absolute Should I return an absolute or relative path? * * @return string The path to the template overrides directory */ public function getTemplateOverridePath($component, $absolute = true) { return ''; } /** * Load the translation files for a given component. * * @param string $component The name of the component. For Joomla! this * is something like "com_example" * * @see FOFPlatformInterface::loadTranslations() * * @return void */ public function loadTranslations($component) { return null; } /** * Authorise access to the component in the back-end. * * @param string $component The name of the component. * * @see FOFPlatformInterface::authorizeAdmin() * * @return boolean True to allow loading the component, false to halt loading */ public function authorizeAdmin($component) { return true; } /** * Returns the JUser object for the current user * * @param integer $id The ID of the user to fetch * * @see FOFPlatformInterface::getUser() * * @return JDocument */ public function getUser($id = null) { return null; } /** * Returns the JDocument object which handles this component's response. * * @see FOFPlatformInterface::getDocument() * * @return JDocument */ public function getDocument() { return null; } /** * This method will try retrieving a variable from the request (input) data. * * @param string $key The user state key for the variable * @param string $request The request variable name for the variable * @param FOFInput $input The FOFInput object with the request (input) data * @param mixed $default The default value. Default: null * @param string $type The filter type for the variable data. Default: none (no filtering) * @param boolean $setUserState Should I set the user state with the fetched value? * * @see FOFPlatformInterface::getUserStateFromRequest() * * @return mixed The value of the variable */ public function getUserStateFromRequest($key, $request, $input, $default = null, $type = 'none', $setUserState = true) { return $input->get($request, $default, $type); } /** * Load plugins of a specific type. Obviously this seems to only be required * in the Joomla! CMS. * * @param string $type The type of the plugins to be loaded * * @see FOFPlatformInterface::importPlugin() * * @return void */ public function importPlugin($type) { } /** * Execute plugins (system-level triggers) and fetch back an array with * their return values. * * @param string $event The event (trigger) name, e.g. onBeforeScratchMyEar * @param array $data A hash array of data sent to the plugins as part of the trigger * * @see FOFPlatformInterface::runPlugins() * * @return array A simple array containing the results of the plugins triggered */ public function runPlugins($event, $data) { return array(); } /** * Perform an ACL check. * * @param string $action The ACL privilege to check, e.g. core.edit * @param string $assetname The asset name to check, typically the component's name * * @see FOFPlatformInterface::authorise() * * @return boolean True if the user is allowed this action */ public function authorise($action, $assetname) { return true; } /** * Is this the administrative section of the component? * * @see FOFPlatformInterface::isBackend() * * @return boolean */ public function isBackend() { return true; } /** * Is this the public section of the component? * * @see FOFPlatformInterface::isFrontend() * * @return boolean */ public function isFrontend() { return true; } /** * Is this a component running in a CLI application? * * @see FOFPlatformInterface::isCli() * * @return boolean */ public function isCli() { return true; } /** * Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All * other platforms should return false and never ask why. * * @see FOFPlatformInterface::supportsAjaxOrdering() * * @return boolean */ public function supportsAjaxOrdering() { return true; } /** * Performs a check between two versions. Use this function instead of PHP version_compare * so we can mock it while testing * * @param string $version1 First version number * @param string $version2 Second version number * @param string $operator Operator (see version_compare for valid operators) * * @return boolean */ public function checkVersion($version1, $version2, $operator) { return version_compare($version1, $version2, $operator); } /** * Saves something to the cache. This is supposed to be used for system-wide * FOF data, not application data. * * @param string $key The key of the data to save * @param string $content The actual data to save * * @return boolean True on success */ public function setCache($key, $content) { return false; } /** * Retrieves data from the cache. This is supposed to be used for system-side * FOF data, not application data. * * @param string $key The key of the data to retrieve * @param string $default The default value to return if the key is not found or the cache is not populated * * @return string The cached value */ public function getCache($key, $default = null) { return false; } /** * Is the global FOF cache enabled? * * @return boolean */ public function isGlobalFOFCacheEnabled() { return true; } /** * Clears the cache of system-wide FOF data. You are supposed to call this in * your components' installation script post-installation and post-upgrade * methods or whenever you are modifying the structure of database tables * accessed by FOF. Please note that FOF's cache never expires and is not * purged by Joomla!. You MUST use this method to manually purge the cache. * * @return boolean True on success */ public function clearCache() { return false; } /** * logs in a user * * @param array $authInfo authentification information * * @return boolean True on success */ public function loginUser($authInfo) { return true; } /** * logs out a user * * @return boolean True on success */ public function logoutUser() { return true; } /** * Logs a deprecated practice. In Joomla! this results in the $message being output in the * deprecated log file, found in your site's log directory. * * @param $message The deprecated practice log message * * @return void */ public function logDeprecated($message) { // The default implementation does nothing. Override this in your platform classes. } /** * Returns the (internal) name of the platform implementation, e.g. * "joomla", "foobar123" etc. This MUST be the last part of the platform * class name. For example, if you have a plaform implementation class * FOFPlatformFoobar you MUST return "foobar" (all lowercase). * * @return string * * @since 2.1.2 */ public function getPlatformName() { return $this->name; } /** * Returns the version number string of the platform, e.g. "4.5.6". If * implementation integrates with a CMS or a versioned foundation (e.g. * a framework) it is advisable to return that version. * * @return string * * @since 2.1.2 */ public function getPlatformVersion() { return $this->version; } /** * Returns the human readable platform name, e.g. "Joomla!", "Joomla! * Framework", "Something Something Something Framework" etc. * * @return string * * @since 2.1.2 */ public function getPlatformHumanName() { return $this->humanReadableName; } } PK���\^%mmlibraries/fof/hal/link.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage hal * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Implementation of the Hypertext Application Language link in PHP. * * @package FrameworkOnFramework * @since 2.1 */ class FOFHalLink { /** * For indicating the target URI. Corresponds with the ’Target IRI’ as * defined in Web Linking (RFC 5988). This attribute MAY contain a URI * Template (RFC6570) and in which case, SHOULD be complemented by an * additional templated attribtue on the link with a boolean value true. * * @var string */ protected $_href = ''; /** * This attribute SHOULD be present with a boolean value of true when the * href of the link contains a URI Template (RFC6570). * * @var boolean */ protected $_templated = false; /** * For distinguishing between Resource and Link elements that share the * same relation * * @var string */ protected $_name = null; /** * For indicating what the language of the result of dereferencing the link should be. * * @var string */ protected $_hreflang = null; /** * For labeling the destination of a link with a human-readable identifier. * * @var string */ protected $_title = null; /** * Public constructor of a FOFHalLink object * * @param string $href See $this->_href * @param boolean $templated See $this->_templated * @param string $name See $this->_name * @param string $hreflang See $this->_hreflang * @param string $title See $this->_title * * @throws RuntimeException If $href is empty */ public function __construct($href, $templated = false, $name = null, $hreflang = null, $title = null) { if (empty($href)) { throw new RuntimeException('A HAL link must always have a non-empty href'); } $this->_href = $href; $this->_templated = $templated; $this->_name = $name; $this->_hreflang = $hreflang; $this->_title = $title; } /** * Is this a valid link? Checks the existence of required fields, not their * values. * * @return boolean */ public function check() { return !empty($this->_href); } /** * Magic getter for the protected properties * * @param string $name The name of the property to retrieve, sans the underscore * * @return mixed Null will always be returned if the property doesn't exist */ public function __get($name) { $property = '_' . $name; if (property_exists($this, $property)) { return $this->$property; } else { return null; } } /** * Magic setter for the protected properties * * @param string $name The name of the property to set, sans the underscore * @param mixed $value The value of the property to set * * @return void */ public function __set($name, $value) { if (($name == 'href') && empty($value)) { return; } $property = '_' . $name; if (property_exists($this, $property)) { $this->$property = $value; } } } PK���\=���libraries/fof/hal/document.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage hal * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Implementation of the Hypertext Application Language document in PHP. It can * be used to provide hypermedia in a web service context. * * @package FrameworkOnFramework * @since 2.1 */ class FOFHalDocument { /** * The collection of links of this document * * @var FOFHalLinks */ private $_links = null; /** * The data (resource state or collection of resource state objects) of the * document. * * @var array */ private $_data = null; /** * Embedded documents. This is an array of FOFHalDocument instances. * * @var array */ private $_embedded = array(); /** * When $_data is an array we'll output the list of data under this key * (JSON) or tag (XML) * * @var string */ private $_dataKey = '_list'; /** * Public constructor * * @param mixed $data The data of the document (usually, the resource state) */ public function __construct($data = null) { $this->_data = $data; $this->_links = new FOFHalLinks; } /** * Add a link to the document * * @param string $rel The relation of the link to the document. * See RFC 5988 http://tools.ietf.org/html/rfc5988#section-6.2.2 A document MUST always have * a "self" link. * @param FOFHalLink $link The actual link object * @param boolean $overwrite When false and a link of $rel relation exists, an array of links is created. Otherwise the * existing link is overwriten with the new one * * @see FOFHalLinks::addLink * * @return boolean True if the link was added to the collection */ public function addLink($rel, FOFHalLink $link, $overwrite = true) { return $this->_links->addLink($rel, $link, $overwrite); } /** * Add links to the document * * @param string $rel The relation of the link to the document. See RFC 5988 * @param array $links An array of FOFHalLink objects * @param boolean $overwrite When false and a link of $rel relation exists, an array of * links is created. Otherwise the existing link is overwriten * with the new one * * @see FOFHalLinks::addLinks * * @return boolean */ public function addLinks($rel, array $links, $overwrite = true) { return $this->_links->addLinks($rel, $links, $overwrite); } /** * Add data to the document * * @param stdClass $data The data to add * @param boolean $overwrite Should I overwrite existing data? * * @return void */ public function addData($data, $overwrite = true) { if (is_array($data)) { $data = (object) $data; } if ($overwrite) { $this->_data = $data; } else { if (!is_array($this->_data)) { $this->_data = array($this->_data); } $this->_data[] = $data; } } /** * Add an embedded document * * @param string $rel The relation of the embedded document to its container document * @param FOFHalDocument $document The document to add * @param boolean $overwrite Should I overwrite existing data with the same relation? * * @return boolean */ public function addEmbedded($rel, FOFHalDocument $document, $overwrite = true) { if (!array_key_exists($rel, $this->_embedded) || !$overwrite) { $this->_embedded[$rel] = $document; } elseif (array_key_exists($rel, $this->_embedded) && !$overwrite) { if (!is_array($this->_embedded[$rel])) { $this->_embedded[$rel] = array($this->_embedded[$rel]); } $this->_embedded[$rel][] = $document; } else { return false; } } /** * Returns the collection of links of this document * * @param string $rel The relation of the links to fetch. Skip to get all links. * * @return array */ public function getLinks($rel = null) { return $this->_links->getLinks($rel); } /** * Returns the collection of embedded documents * * @param string $rel Optional; the relation to return the embedded documents for * * @return array|FOFHalDocument */ public function getEmbedded($rel = null) { if (empty($rel)) { return $this->_embedded; } elseif (isset($this->_embedded[$rel])) { return $this->_embedded[$rel]; } else { return array(); } } /** * Return the data attached to this document * * @return array|stdClass */ public function getData() { return $this->_data; } /** * Instantiate and call a suitable renderer class to render this document * into the specified format. * * @param string $format The format to render the document into, e.g. 'json' * * @return string The rendered document * * @throws RuntimeException If the format is unknown, i.e. there is no suitable renderer */ public function render($format = 'json') { $class_name = 'FOFHalRender' . ucfirst($format); if (!class_exists($class_name, true)) { throw new RuntimeException("Unsupported HAL Document format '$format'. Render aborted."); } $renderer = new $class_name($this); return $renderer->render( array( 'data_key' => $this->_dataKey ) ); } } PK���\O}�uulibraries/fof/hal/links.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage hal * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Implementation of the Hypertext Application Language links in PHP. This is * actually a collection of links. * * @package FrameworkOnFramework * @since 2.1 */ class FOFHalLinks { /** * The collection of links, sorted by relation * * @var array */ private $_links = array(); /** * Add a single link to the links collection * * @param string $rel The relation of the link to the document. See RFC 5988 * http://tools.ietf.org/html/rfc5988#section-6.2.2 A document * MUST always have a "self" link. * @param FOFHalLink $link The actual link object * @param boolean $overwrite When false and a link of $rel relation exists, an array of * links is created. Otherwise the existing link is overwriten * with the new one * * @return boolean True if the link was added to the collection */ public function addLink($rel, FOFHalLink $link, $overwrite = true) { if (!$link->check()) { return false; } if (!array_key_exists($rel, $this->_links) || $overwrite) { $this->_links[$rel] = $link; } elseif (array_key_exists($rel, $this->_links) && !$overwrite) { if (!is_array($this->_links[$rel])) { $this->_links[$rel] = array($this->_links[$rel]); } $this->_links[$rel][] = $link; } else { return false; } } /** * Add multiple links to the links collection * * @param string $rel The relation of the links to the document. See RFC 5988. * @param array $links An array of FOFHalLink objects * @param boolean $overwrite When false and a link of $rel relation exists, an array * of links is created. Otherwise the existing link is * overwriten with the new one * * @return boolean True if the link was added to the collection */ public function addLinks($rel, array $links, $overwrite = true) { if (empty($links)) { return false; } $localOverwrite = $overwrite; foreach ($links as $link) { if ($link instanceof FOFHalLink) { $this->addLink($rel, $link, $localOverwrite); } // After the first time we call this with overwrite on we have to // turn it off so that the other links are added to the set instead // of overwriting the first item that's already added. if ($localOverwrite) { $localOverwrite = false; } } } /** * Returns the collection of links * * @param string $rel Optional; the relation to return the links for * * @return array|FOFHalLink */ public function getLinks($rel = null) { if (empty($rel)) { return $this->_links; } elseif (isset($this->_links[$rel])) { return $this->_links[$rel]; } else { return array(); } } } PK���\`E/B B !libraries/fof/hal/render/json.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage hal * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Implements the HAL over JSON renderer * * @package FrameworkOnFramework * @since 2.1 */ class FOFHalRenderJson implements FOFHalRenderInterface { /** * When data is an array we'll output the list of data under this key * * @var string */ private $_dataKey = '_list'; /** * The document to render * * @var FOFHalDocument */ protected $_document; /** * Public constructor * * @param FOFHalDocument &$document The document to render */ public function __construct(&$document) { $this->_document = $document; } /** * Render a HAL document in JSON format * * @param array $options Rendering options. You can currently only set json_options (json_encode options) * * @return string The JSON representation of the HAL document */ public function render($options = array()) { if (isset($options['data_key'])) { $this->_dataKey = $options['data_key']; } if (isset($options['json_options'])) { $jsonOptions = $options['json_options']; } else { $jsonOptions = 0; } $serialiseThis = new stdClass; // Add links $collection = $this->_document->getLinks(); $serialiseThis->_links = new stdClass; foreach ($collection as $rel => $links) { if (!is_array($links)) { $serialiseThis->_links->$rel = $this->_getLink($links); } else { $serialiseThis->_links->$rel = array(); foreach ($links as $link) { array_push($serialiseThis->_links->$rel, $this->_getLink($link)); } } } // Add embedded documents $collection = $this->_document->getEmbedded(); if (!empty($collection)) { $serialiseThis->_embedded->$rel = new stdClass; foreach ($collection as $rel => $embeddeddocs) { if (!is_array($embeddeddocs)) { $embeddeddocs = array($embeddeddocs); } foreach ($embeddeddocs as $embedded) { $renderer = new FOFHalRenderJson($embedded); array_push($serialiseThis->_embedded->$rel, $renderer->render($options)); } } } // Add data $data = $this->_document->getData(); if (is_object($data)) { if ($data instanceof FOFTable) { $data = $data->getData(); } else { $data = (array) $data; } if (!empty($data)) { foreach ($data as $k => $v) { $serialiseThis->$k = $v; } } } elseif (is_array($data)) { $serialiseThis->{$this->_dataKey} = $data; } return json_encode($serialiseThis, $jsonOptions); } /** * Converts a FOFHalLink object into a stdClass object which will be used * for JSON serialisation * * @param FOFHalLink $link The link you want converted * * @return stdClass The converted link object */ protected function _getLink(FOFHalLink $link) { $ret = array( 'href' => $link->href ); if ($link->templated) { $ret['templated'] = 'true'; } if (!empty($link->name)) { $ret['name'] = $link->name; } if (!empty($link->hreflang)) { $ret['hreflang'] = $link->hreflang; } if (!empty($link->title)) { $ret['title'] = $link->title; } return (object) $ret; } } PK���\�l�{{&libraries/fof/hal/render/interface.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage hal * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Interface for HAL document renderers * * @package FrameworkOnFramework * @since 2.1 */ interface FOFHalRenderInterface { /** * Render a HAL document into a representation suitable for consumption. * * @param array $options Renderer-specific options * * @return void */ public function render($options = array()); } PK���\�L<��� libraries/fof/query/abstract.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage query * @copyright Copyright (C) 2010 - 2015 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 query base class; for compatibility purposes * * @package FrameworkOnFramework * @since 2.1 * @deprecated 2.1 */ abstract class FOFQueryAbstract { /** * Returns a new database query class * * @param JDatabaseDriver $db The DB driver which will provide us with a query object * * @return FOFQueryAbstract */ public static function &getNew($db = null) { FOFPlatform::getInstance()->logDeprecated('FOFQueryAbstract is deprecated. Use JDatabaseQuery instead.'); if (is_null($db)) { $ret = FOFPlatform::getInstance()->getDbo()->getQuery(true); } else { $ret = $db->getQuery(true); } return $ret; } } PK���\a�Y��o�o!libraries/fof/toolbar/toolbar.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage toolbar * @copyright Copyright (C) 2010 - 2015 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; /** * The Toolbar class renders the back-end component title area and the back- * and front-end toolbars. * * @package FrameworkOnFramework * @since 1.0 */ class FOFToolbar { /** @var array Configuration parameters */ protected $config = array(); /** @var array Input (e.g. request) variables */ protected $input = array(); /** @var array Permissions map, see the __construct method for more information */ public $perms = array(); /** @var array The links to be rendered in the toolbar */ protected $linkbar = array(); /** @var bool Should I render the submenu in the front-end? */ protected $renderFrontendSubmenu = false; /** @var bool Should I render buttons in the front-end? */ protected $renderFrontendButtons = false; /** * Gets an instance of a component's toolbar * * @param string $option The name of the component * @param array $config The configuration array for the component * * @return FOFToolbar The toolbar instance for the component */ public static function &getAnInstance($option = null, $config = array()) { static $instances = array(); // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } $hash = $option; if (!array_key_exists($hash, $instances)) { if (array_key_exists('input', $config)) { if ($config['input'] instanceof FOFInput) { $input = $config['input']; } else { $input = new FOFInput($config['input']); } } else { $input = new FOFInput; } $config['option'] = !is_null($option) ? $option : $input->getCmd('option', 'com_foobar'); $input->set('option', $config['option']); $config['input'] = $input; $className = ucfirst(str_replace('com_', '', $config['option'])) . 'Toolbar'; if (!class_exists($className)) { $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($config['option']); $searchPaths = array( $componentPaths['main'], $componentPaths['main'] . '/toolbars', $componentPaths['alt'], $componentPaths['alt'] . '/toolbars' ); if (array_key_exists('searchpath', $config)) { array_unshift($searchPaths, $config['searchpath']); } $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); $path = $filesystem->pathFind( $searchPaths, 'toolbar.php' ); if ($path) { require_once $path; } } if (!class_exists($className)) { $className = 'FOFToolbar'; } $instance = new $className($config); $instances[$hash] = $instance; } return $instances[$hash]; } /** * Public constructor * * @param array $config The configuration array of the component */ public function __construct($config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } // Cache the config $this->config = $config; // Get the input for this MVC triad if (array_key_exists('input', $config)) { $this->input = $config['input']; } else { $this->input = new FOFInput; } // Get the default values for the component and view names $this->component = $this->input->getCmd('option', 'com_foobar'); // Overrides from the config if (array_key_exists('option', $config)) { $this->component = $config['option']; } $this->input->set('option', $this->component); // Get default permissions (can be overriden by the view) $platform = FOFPlatform::getInstance(); $perms = (object) array( 'manage' => $platform->authorise('core.manage', $this->input->getCmd('option', 'com_foobar')), 'create' => $platform->authorise('core.create', $this->input->getCmd('option', 'com_foobar')), 'edit' => $platform->authorise('core.edit', $this->input->getCmd('option', 'com_foobar')), 'editstate' => $platform->authorise('core.edit.state', $this->input->getCmd('option', 'com_foobar')), 'delete' => $platform->authorise('core.delete', $this->input->getCmd('option', 'com_foobar')), ); // Save front-end toolbar and submenu rendering flags if present in the config if (array_key_exists('renderFrontendButtons', $config)) { $this->renderFrontendButtons = $config['renderFrontendButtons']; } if (array_key_exists('renderFrontendSubmenu', $config)) { $this->renderFrontendSubmenu = $config['renderFrontendSubmenu']; } // If not in the administrative area, load the JToolbarHelper if (!FOFPlatform::getInstance()->isBackend()) { // Needed for tests, so we can inject our "special" helper class if(!class_exists('JToolbarHelper')) { $platformDirs = FOFPlatform::getInstance()->getPlatformBaseDirs(); require_once $platformDirs['root'] . '/administrator/includes/toolbar.php'; } // Things to do if we have to render a front-end toolbar if ($this->renderFrontendButtons) { // Load back-end toolbar language files in front-end FOFPlatform::getInstance()->loadTranslations(''); // Needed for tests (we can fake we're not in the backend, but we are still in CLI!) if(!FOFPlatform::getInstance()->isCli()) { // Load the core Javascript if (version_compare(JVERSION, '3.0', 'ge')) { JHtml::_('jquery.framework'); JHtml::_('behavior.core'); } else { JHtml::_('behavior.framework'); } } } } // Store permissions in the local toolbar object $this->perms = $perms; } /** * Renders the toolbar for the current view and task * * @param string $view The view of the component * @param string $task The exact task of the view * @param FOFInput $input An optional input object used to determine the defaults * * @return void */ public function renderToolbar($view = null, $task = null, $input = null) { if (!empty($input)) { $saveInput = $this->input; $this->input = $input; } // If tmpl=component the default behaviour is to not render the toolbar if ($this->input->getCmd('tmpl', '') == 'component') { $render_toolbar = false; } else { $render_toolbar = true; } // If there is a render_toolbar=0 in the URL, do not render a toolbar $render_toolbar = $this->input->getBool('render_toolbar', $render_toolbar); if (!$render_toolbar) { return; } // Get the view and task if (empty($view)) { $view = $this->input->getCmd('view', 'cpanel'); } if (empty($task)) { $task = $this->input->getCmd('task', 'default'); } $this->view = $view; $this->task = $task; $view = FOFInflector::pluralize($view); $component = $this->input->get('option', 'com_foobar', 'cmd'); $configProvider = new FOFConfigProvider; $toolbar = $configProvider->get( $component . '.views.' . $view . '.toolbar.' . $task ); // If we have a toolbar config specified if (!empty($toolbar)) { return $this->renderFromConfig($toolbar); } // Check for an onViewTask method $methodName = 'on' . ucfirst($view) . ucfirst($task); if (method_exists($this, $methodName)) { return $this->$methodName(); } // Check for an onView method $methodName = 'on' . ucfirst($view); if (method_exists($this, $methodName)) { return $this->$methodName(); } // Check for an onTask method $methodName = 'on' . ucfirst($task); if (method_exists($this, $methodName)) { return $this->$methodName(); } if (!empty($input)) { $this->input = $saveInput; } } /** * Renders the toolbar for the component's Control Panel page * * @return void */ public function onCpanelsBrowse() { if (FOFPlatform::getInstance()->isBackend() || $this->renderFrontendSubmenu) { $this->renderSubmenu(); } if (!FOFPlatform::getInstance()->isBackend() && !$this->renderFrontendButtons) { return; } $option = $this->input->getCmd('option', 'com_foobar'); JToolBarHelper::title(JText::_(strtoupper($option)), str_replace('com_', '', $option)); JToolBarHelper::preferences($option, 550, 875); } /** * Renders the toolbar for the component's Browse pages (the plural views) * * @return void */ public function onBrowse() { // On frontend, buttons must be added specifically if (FOFPlatform::getInstance()->isBackend() || $this->renderFrontendSubmenu) { $this->renderSubmenu(); } if (!FOFPlatform::getInstance()->isBackend() && !$this->renderFrontendButtons) { return; } // Set toolbar title $option = $this->input->getCmd('option', 'com_foobar'); $subtitle_key = strtoupper($option . '_TITLE_' . $this->input->getCmd('view', 'cpanel')); JToolBarHelper::title(JText::_(strtoupper($option)) . ': ' . JText::_($subtitle_key), str_replace('com_', '', $option)); // Add toolbar buttons if ($this->perms->create) { if (version_compare(JVERSION, '3.0', 'ge')) { JToolBarHelper::addNew(); } else { JToolBarHelper::addNewX(); } } if ($this->perms->edit) { if (version_compare(JVERSION, '3.0', 'ge')) { JToolBarHelper::editList(); } else { JToolBarHelper::editListX(); } } if ($this->perms->create || $this->perms->edit) { JToolBarHelper::divider(); } if ($this->perms->editstate) { JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::divider(); } if ($this->perms->delete) { $msg = JText::_($this->input->getCmd('option', 'com_foobar') . '_CONFIRM_DELETE'); JToolBarHelper::deleteList(strtoupper($msg)); } } /** * Renders the toolbar for the component's Read pages * * @return void */ public function onRead() { // On frontend, buttons must be added specifically if (FOFPlatform::getInstance()->isBackend() || $this->renderFrontendSubmenu) { $this->renderSubmenu(); } if (!FOFPlatform::getInstance()->isBackend() && !$this->renderFrontendButtons) { return; } $option = $this->input->getCmd('option', 'com_foobar'); $componentName = str_replace('com_', '', $option); // Set toolbar title $subtitle_key = strtoupper($option . '_TITLE_' . $this->input->getCmd('view', 'cpanel') . '_READ'); JToolBarHelper::title(JText::_(strtoupper($option)) . ': ' . JText::_($subtitle_key), $componentName); // Set toolbar icons JToolBarHelper::back(); } /** * Renders the toolbar for the component's Add pages * * @return void */ public function onAdd() { // On frontend, buttons must be added specifically if (!FOFPlatform::getInstance()->isBackend() && !$this->renderFrontendButtons) { return; } $option = $this->input->getCmd('option', 'com_foobar'); $componentName = str_replace('com_', '', $option); // Set toolbar title $subtitle_key = strtoupper($option . '_TITLE_' . FOFInflector::pluralize($this->input->getCmd('view', 'cpanel'))) . '_EDIT'; JToolBarHelper::title(JText::_(strtoupper($option)) . ': ' . JText::_($subtitle_key), $componentName); // Set toolbar icons if ($this->perms->edit || $this->perms->editown) { // Show the apply button only if I can edit the record, otherwise I'll return to the edit form and get a // 403 error since I can't do that JToolBarHelper::apply(); } JToolBarHelper::save(); if ($this->perms->create) { JToolBarHelper::custom('savenew', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } JToolBarHelper::cancel(); } /** * Renders the toolbar for the component's Edit pages * * @return void */ public function onEdit() { // On frontend, buttons must be added specifically if (!FOFPlatform::getInstance()->isBackend() && !$this->renderFrontendButtons) { return; } $this->onAdd(); } /** * Removes all links from the link bar * * @return void */ public function clearLinks() { $this->linkbar = array(); } /** * Get the link bar's link definitions * * @return array */ public function &getLinks() { return $this->linkbar; } /** * Append a link to the link bar * * @param string $name The text of the link * @param string|null $link The link to render; set to null to render a separator * @param boolean $active True if it's an active link * @param string|null $icon Icon class (used by some renderers, like the Bootstrap renderer) * @param string|null $parent The parent element (referenced by name)) Thsi will create a dropdown list * * @return void */ public function appendLink($name, $link = null, $active = false, $icon = null, $parent = '') { $linkDefinition = array( 'name' => $name, 'link' => $link, 'active' => $active, 'icon' => $icon ); if (empty($parent)) { if(array_key_exists($name, $this->linkbar)) { $this->linkbar[$name] = array_merge($this->linkbar[$name], $linkDefinition); // If there already are some children, I have to put this view link in the "items" array in the first place if(array_key_exists('items', $this->linkbar[$name])) { array_unshift($this->linkbar[$name]['items'], $linkDefinition); } } else { $this->linkbar[$name] = $linkDefinition; } } else { if (!array_key_exists($parent, $this->linkbar)) { $parentElement = $linkDefinition; $parentElement['name'] = $parent; $parentElement['link'] = null; $this->linkbar[$parent] = $parentElement; $parentElement['items'] = array(); } else { $parentElement = $this->linkbar[$parent]; if (!array_key_exists('dropdown', $parentElement) && !empty($parentElement['link'])) { $newSubElement = $parentElement; $parentElement['items'] = array($newSubElement); } } $parentElement['items'][] = $linkDefinition; $parentElement['dropdown'] = true; if($active) { $parentElement['active'] = true; } $this->linkbar[$parent] = $parentElement; } } /** * Prefixes (some people erroneously call this "prepend" – there is no such word) a link to the link bar * * @param string $name The text of the link * @param string|null $link The link to render; set to null to render a separator * @param boolean $active True if it's an active link * @param string|null $icon Icon class (used by some renderers, like the Bootstrap renderer) * * @return void */ public function prefixLink($name, $link = null, $active = false, $icon = null) { $linkDefinition = array( 'name' => $name, 'link' => $link, 'active' => $active, 'icon' => $icon ); array_unshift($this->linkbar, $linkDefinition); } /** * Renders the submenu (toolbar links) for all detected views of this component * * @return void */ public function renderSubmenu() { $views = $this->getMyViews(); if (empty($views)) { return; } $activeView = $this->input->getCmd('view', 'cpanel'); foreach ($views as $view) { // Get the view name $key = strtoupper($this->component) . '_TITLE_' . strtoupper($view); //Do we have a translation for this key? if (strtoupper(JText::_($key)) == $key) { $altview = FOFInflector::isPlural($view) ? FOFInflector::singularize($view) : FOFInflector::pluralize($view); $key2 = strtoupper($this->component) . '_TITLE_' . strtoupper($altview); // Maybe we have for the alternative view? if (strtoupper(JText::_($key2)) == $key2) { // Nope, let's use the raw name $name = ucfirst($view); } else { $name = JText::_($key2); } } else { $name = JText::_($key); } $link = 'index.php?option=' . $this->component . '&view=' . $view; $active = $view == $activeView; $this->appendLink($name, $link, $active); } } /** * Automatically detects all views of the component * * @return array A list of all views, in the order to be displayed in the toolbar submenu */ protected function getMyViews() { $views = array(); $t_views = array(); $using_meta = false; $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($this->component); $searchPath = $componentPaths['main'] . '/views'; $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); $allFolders = $filesystem->folderFolders($searchPath); if (!empty($allFolders)) { foreach ($allFolders as $folder) { $view = $folder; // View already added if (in_array(FOFInflector::pluralize($view), $t_views)) { continue; } // Do we have a 'skip.xml' file in there? $files = $filesystem->folderFiles($searchPath . '/' . $view, '^skip\.xml$'); if (!empty($files)) { continue; } // Do we have extra information about this view? (ie. ordering) $meta = $filesystem->folderFiles($searchPath . '/' . $view, '^metadata\.xml$'); // Not found, do we have it inside the plural one? if (!$meta) { $plural = FOFInflector::pluralize($view); if (in_array($plural, $allFolders)) { $view = $plural; $meta = $filesystem->folderFiles($searchPath . '/' . $view, '^metadata\.xml$'); } } if (!empty($meta)) { $using_meta = true; $xml = simplexml_load_file($searchPath . '/' . $view . '/' . $meta[0]); $order = (int) $xml->foflib->ordering; } else { // Next place. It's ok since the index are 0-based and count is 1-based if (!isset($to_order)) { $to_order = array(); } $order = count($to_order); } $view = FOFInflector::pluralize($view); $t_view = new stdClass; $t_view->ordering = $order; $t_view->view = $view; $to_order[] = $t_view; $t_views[] = $view; } } FOFUtilsArray::sortObjects($to_order, 'ordering'); $views = FOFUtilsArray::getColumn($to_order, 'view'); // If not using the metadata file, let's put the cpanel view on top if (!$using_meta) { $cpanel = array_search('cpanels', $views); if ($cpanel !== false) { unset($views[$cpanel]); array_unshift($views, 'cpanels'); } } return $views; } /** * Return the front-end toolbar rendering flag * * @return boolean */ public function getRenderFrontendButtons() { return $this->renderFrontendButtons; } /** * Return the front-end submenu rendering flag * * @return boolean */ public function getRenderFrontendSubmenu() { return $this->renderFrontendSubmenu; } /** * Render the toolbar from the configuration. * * @param array $toolbar The toolbar definition * * @return void */ private function renderFromConfig(array $toolbar) { if (FOFPlatform::getInstance()->isBackend() || $this->renderFrontendSubmenu) { $this->renderSubmenu(); } if (!FOFPlatform::getInstance()->isBackend() && !$this->renderFrontendButtons) { return; } // Render each element foreach ($toolbar as $elementType => $elementAttributes) { $value = isset($elementAttributes['value']) ? $elementAttributes['value'] : null; $this->renderToolbarElement($elementType, $value, $elementAttributes); } return; } /** * Render a toolbar element. * * @param string $type The element type. * @param mixed $value The element value. * @param array $attributes The element attributes. * * @return void * * @codeCoverageIgnore * @throws InvalidArgumentException */ private function renderToolbarElement($type, $value = null, array $attributes = array()) { switch ($type) { case 'title': $icon = isset($attributes['icon']) ? $attributes['icon'] : 'generic.png'; JToolbarHelper::title($value, $icon); break; case 'divider': JToolbarHelper::divider(); break; case 'custom': $task = isset($attributes['task']) ? $attributes['task'] : ''; $icon = isset($attributes['icon']) ? $attributes['icon'] : ''; $iconOver = isset($attributes['icon_over']) ? $attributes['icon_over'] : ''; $alt = isset($attributes['alt']) ? $attributes['alt'] : ''; $listSelect = isset($attributes['list_select']) ? FOFStringUtils::toBool($attributes['list_select']) : true; JToolbarHelper::custom($task, $icon, $iconOver, $alt, $listSelect); break; case 'preview': $url = isset($attributes['url']) ? $attributes['url'] : ''; $update_editors = isset($attributes['update_editors']) ? FOFStringUtils::toBool($attributes['update_editors']) : false; JToolbarHelper::preview($url, $update_editors); break; case 'help': if (!isset($attributes['help'])) { throw new InvalidArgumentException( 'The help attribute is missing in the help button type.' ); } $ref = $attributes['help']; $com = isset($attributes['com']) ? FOFStringUtils::toBool($attributes['com']) : false; $override = isset($attributes['override']) ? $attributes['override'] : null; $component = isset($attributes['component']) ? $attributes['component'] : null; JToolbarHelper::help($ref, $com, $override, $component); break; case 'back': $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_BACK'; $href = isset($attributes['href']) ? $attributes['href'] : 'javascript:history.back();'; JToolbarHelper::back($alt, $href); break; case 'media_manager': $directory = isset($attributes['directory']) ? $attributes['directory'] : ''; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_UPLOAD'; JToolbarHelper::media_manager($directory, $alt); break; case 'assign': $task = isset($attributes['task']) ? $attributes['task'] : 'assign'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_ASSIGN'; JToolbarHelper::assign($task, $alt); break; case 'new': if ($this->perms->create) { $task = isset($attributes['task']) ? $attributes['task'] : 'add'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_NEW'; $check = isset($attributes['check']) ? FOFStringUtils::toBool($attributes['check']) : false; JToolbarHelper::addNew($task, $alt, $check); } break; case 'publish': if ($this->perms->editstate) { $task = isset($attributes['task']) ? $attributes['task'] : 'publish'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_PUBLISH'; $check = isset($attributes['check']) ? FOFStringUtils::toBool($attributes['check']) : false; JToolbarHelper::publish($task, $alt, $check); } break; case 'publishList': if ($this->perms->editstate) { $task = isset($attributes['task']) ? $attributes['task'] : 'publish'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_PUBLISH'; JToolbarHelper::publishList($task, $alt); } break; case 'unpublish': if ($this->perms->editstate) { $task = isset($attributes['task']) ? $attributes['task'] : 'unpublish'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_UNPUBLISH'; $check = isset($attributes['check']) ? FOFStringUtils::toBool($attributes['check']) : false; JToolbarHelper::unpublish($task, $alt, $check); } break; case 'unpublishList': if ($this->perms->editstate) { $task = isset($attributes['task']) ? $attributes['task'] : 'unpublish'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_UNPUBLISH'; JToolbarHelper::unpublishList($task, $alt); } break; case 'archiveList': if ($this->perms->editstate) { $task = isset($attributes['task']) ? $attributes['task'] : 'archive'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_ARCHIVE'; JToolbarHelper::archiveList($task, $alt); } break; case 'unarchiveList': if ($this->perms->editstate) { $task = isset($attributes['task']) ? $attributes['task'] : 'unarchive'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_UNARCHIVE'; JToolbarHelper::unarchiveList($task, $alt); } break; case 'editList': if ($this->perms->edit) { $task = isset($attributes['task']) ? $attributes['task'] : 'edit'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_EDIT'; JToolbarHelper::editList($task, $alt); } break; case 'editHtml': $task = isset($attributes['task']) ? $attributes['task'] : 'edit_source'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_EDIT_HTML'; JToolbarHelper::editHtml($task, $alt); break; case 'editCss': $task = isset($attributes['task']) ? $attributes['task'] : 'edit_css'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_EDIT_CSS'; JToolbarHelper::editCss($task, $alt); break; case 'deleteList': if ($this->perms->delete) { $msg = isset($attributes['msg']) ? $attributes['msg'] : ''; $task = isset($attributes['task']) ? $attributes['task'] : 'remove'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_DELETE'; JToolbarHelper::deleteList($msg, $task, $alt); } break; case 'trash': if ($this->perms->editstate) { $task = isset($attributes['task']) ? $attributes['task'] : 'remove'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_TRASH'; $check = isset($attributes['check']) ? FOFStringUtils::toBool($attributes['check']) : true; JToolbarHelper::trash($task, $alt, $check); } break; case 'apply': $task = isset($attributes['task']) ? $attributes['task'] : 'apply'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_APPLY'; JToolbarHelper::apply($task, $alt); break; case 'save': $task = isset($attributes['task']) ? $attributes['task'] : 'save'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_SAVE'; JToolbarHelper::save($task, $alt); break; case 'save2new': $task = isset($attributes['task']) ? $attributes['task'] : 'save2new'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_SAVE_AND_NEW'; JToolbarHelper::save2new($task, $alt); break; case 'save2copy': $task = isset($attributes['task']) ? $attributes['task'] : 'save2copy'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_SAVE_AS_COPY'; JToolbarHelper::save2copy($task, $alt); break; case 'checkin': $task = isset($attributes['task']) ? $attributes['task'] : 'checkin'; $alt = isset($attributes['alt']) ? $attributes['alt'] :'JTOOLBAR_CHECKIN'; $check = isset($attributes['check']) ? FOFStringUtils::toBool($attributes['check']) : true; JToolbarHelper::checkin($task, $alt, $check); break; case 'cancel': $task = isset($attributes['task']) ? $attributes['task'] : 'cancel'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JTOOLBAR_CANCEL'; JToolbarHelper::cancel($task, $alt); break; case 'preferences': if (!isset($attributes['component'])) { throw new InvalidArgumentException( 'The component attribute is missing in the preferences button type.' ); } $component = $attributes['component']; $height = isset($attributes['height']) ? $attributes['height'] : '550'; $width = isset($attributes['width']) ? $attributes['width'] : '875'; $alt = isset($attributes['alt']) ? $attributes['alt'] : 'JToolbar_Options'; $path = isset($attributes['path']) ? $attributes['path'] : ''; JToolbarHelper::preferences($component, $height, $width, $alt, $path); break; default: throw new InvalidArgumentException(sprintf('Unknown button type %s', $type)); } } } PK���\�}66libraries/fof/include.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage include * @copyright Copyright (C) 2010-2015 Nicholas K. Dionysopoulos * @license GNU General Public License version 2, or later * * Initializes FOF */ defined('_JEXEC') or die(); if (!defined('FOF_INCLUDED')) { define('FOF_INCLUDED', '2.4.3'); // Register the FOF autoloader require_once __DIR__ . '/autoloader/fof.php'; FOFAutoloaderFof::init(); // Register a debug log if (defined('JDEBUG') && JDEBUG) { FOFPlatform::getInstance()->logAddLogger('fof.log.php'); } }PK���\Y�bM�:�:libraries/fof/form/form.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * FOFForm is an extension to JForm which support not only edit views but also * browse (record list) and read (single record display) views based on XML * forms. * * @package FrameworkOnFramework * @since 2.0 */ class FOFForm extends JForm { /** * The model attached to this view * * @var FOFModel */ protected $model; /** * The view used to render this form * * @var FOFView */ protected $view; /** * Method to get an instance of a form. * * @param string $name The name of the form. * @param string $data The name of an XML file or string to load as the form definition. * @param array $options An array of form options. * @param bool $replace Flag to toggle whether form fields should be replaced if a field * already exists with the same group/name. * @param bool|string $xpath An optional xpath to search for the fields. * * @return object FOFForm instance. * * @since 2.0 * @throws InvalidArgumentException if no data provided. * @throws RuntimeException if the form could not be loaded. */ public static function getInstance($name, $data = null, $options = array(), $replace = true, $xpath = false) { // Reference to array with form instances $forms = &self::$forms; // Only instantiate the form if it does not already exist. if (!isset($forms[$name])) { $data = trim($data); if (empty($data)) { throw new InvalidArgumentException(sprintf('FOFForm::getInstance(name, *%s*)', gettype($data))); } // Instantiate the form. $forms[$name] = new FOFForm($name, $options); // Load the data. if (substr(trim($data), 0, 1) == '<') { if ($forms[$name]->load($data, $replace, $xpath) == false) { throw new RuntimeException('FOFForm::getInstance could not load form'); } } else { if ($forms[$name]->loadFile($data, $replace, $xpath) == false) { throw new RuntimeException('FOFForm::getInstance could not load file ' . $data . '.xml'); } } } return $forms[$name]; } /** * Returns the value of an attribute of the form itself * * @param string $attribute The name of the attribute * @param mixed $default Optional default value to return * * @return mixed * * @since 2.0 */ public function getAttribute($attribute, $default = null) { $value = $this->xml->attributes()->$attribute; if (is_null($value)) { return $default; } else { return (string) $value; } } /** * Loads the CSS files defined in the form, based on its cssfiles attribute * * @return void * * @since 2.0 */ public function loadCSSFiles() { // Support for CSS files $cssfiles = $this->getAttribute('cssfiles'); if (!empty($cssfiles)) { $cssfiles = explode(',', $cssfiles); foreach ($cssfiles as $cssfile) { FOFTemplateUtils::addCSS(trim($cssfile)); } } // Support for LESS files $lessfiles = $this->getAttribute('lessfiles'); if (!empty($lessfiles)) { $lessfiles = explode(',', $lessfiles); foreach ($lessfiles as $def) { $parts = explode('||', $def, 2); $lessfile = $parts[0]; $alt = (count($parts) > 1) ? trim($parts[1]) : null; FOFTemplateUtils::addLESS(trim($lessfile), $alt); } } } /** * Loads the Javascript files defined in the form, based on its jsfiles attribute * * @return void * * @since 2.0 */ public function loadJSFiles() { $jsfiles = $this->getAttribute('jsfiles'); if (empty($jsfiles)) { return; } $jsfiles = explode(',', $jsfiles); foreach ($jsfiles as $jsfile) { FOFTemplateUtils::addJS(trim($jsfile)); } } /** * Returns a reference to the protected $data object, allowing direct * access to and manipulation of the form's data. * * @return JRegistry The form's data registry * * @since 2.0 */ public function getData() { return $this->data; } /** * Attaches a FOFModel to this form * * @param FOFModel &$model The model to attach to the form * * @return void */ public function setModel(FOFModel &$model) { $this->model = $model; } /** * Returns the FOFModel attached to this form * * @return FOFModel */ public function &getModel() { return $this->model; } /** * Attaches a FOFView to this form * * @param FOFView &$view The view to attach to the form * * @return void */ public function setView(FOFView &$view) { $this->view = $view; } /** * Returns the FOFView attached to this form * * @return FOFView */ public function &getView() { return $this->view; } /** * Method to get an array of FOFFormHeader objects in the headerset. * * @return array The array of FOFFormHeader objects in the headerset. * * @since 2.0 */ public function getHeaderset() { $fields = array(); $elements = $this->findHeadersByGroup(); // If no field elements were found return empty. if (empty($elements)) { return $fields; } // Build the result array from the found field elements. foreach ($elements as $element) { // Get the field groups for the element. $attrs = $element->xpath('ancestor::headers[@name]/@name'); $groups = array_map('strval', $attrs ? $attrs : array()); $group = implode('.', $groups); // If the field is successfully loaded add it to the result array. if ($field = $this->loadHeader($element, $group)) { $fields[$field->id] = $field; } } return $fields; } /** * Method to get an array of <header /> elements from the form XML document which are * in a control group by name. * * @param mixed $group The optional dot-separated form group path on which to find the fields. * Null will return all fields. False will return fields not in a group. * @param boolean $nested True to also include fields in nested groups that are inside of the * group for which to find fields. * * @return mixed Boolean false on error or array of SimpleXMLElement objects. * * @since 2.0 */ protected function &findHeadersByGroup($group = null, $nested = false) { $false = false; $fields = array(); // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return $false; } // Get only fields in a specific group? if ($group) { // Get the fields elements for a given group. $elements = &$this->findHeader($group); // Get all of the field elements for the fields elements. foreach ($elements as $element) { // If there are field elements add them to the return result. if ($tmp = $element->xpath('descendant::header')) { // If we also want fields in nested groups then just merge the arrays. if ($nested) { $fields = array_merge($fields, $tmp); } // If we want to exclude nested groups then we need to check each field. else { $groupNames = explode('.', $group); foreach ($tmp as $field) { // Get the names of the groups that the field is in. $attrs = $field->xpath('ancestor::headers[@name]/@name'); $names = array_map('strval', $attrs ? $attrs : array()); // If the field is in the specific group then add it to the return list. if ($names == (array) $groupNames) { $fields = array_merge($fields, array($field)); } } } } } } elseif ($group === false) { // Get only field elements not in a group. $fields = $this->xml->xpath('descendant::headers[not(@name)]/header | descendant::headers[not(@name)]/headerset/header '); } else { // Get an array of all the <header /> elements. $fields = $this->xml->xpath('//header'); } return $fields; } /** * Method to get a header field represented as a FOFFormHeader object. * * @param string $name The name of the header field. * @param string $group The optional dot-separated form group path on which to find the field. * @param mixed $value The optional value to use as the default for the field. * * @return mixed The FOFFormHeader object for the field or boolean false on error. * * @since 2.0 */ public function getHeader($name, $group = null, $value = null) { // Make sure there is a valid FOFForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return false; } // Attempt to find the field by name and group. $element = $this->findHeader($name, $group); // If the field element was not found return false. if (!$element) { return false; } return $this->loadHeader($element, $group, $value); } /** * Method to get a header field represented as an XML element object. * * @param string $name The name of the form field. * @param string $group The optional dot-separated form group path on which to find the field. * * @return mixed The XML element object for the field or boolean false on error. * * @since 2.0 */ protected function findHeader($name, $group = null) { $element = false; $fields = array(); // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return false; } // Let's get the appropriate field element based on the method arguments. if ($group) { // Get the fields elements for a given group. $elements = &$this->findGroup($group); // Get all of the field elements with the correct name for the fields elements. foreach ($elements as $element) { // If there are matching field elements add them to the fields array. if ($tmp = $element->xpath('descendant::header[@name="' . $name . '"]')) { $fields = array_merge($fields, $tmp); } } // Make sure something was found. if (!$fields) { return false; } // Use the first correct match in the given group. $groupNames = explode('.', $group); foreach ($fields as &$field) { // Get the group names as strings for ancestor fields elements. $attrs = $field->xpath('ancestor::headerfields[@name]/@name'); $names = array_map('strval', $attrs ? $attrs : array()); // If the field is in the exact group use it and break out of the loop. if ($names == (array) $groupNames) { $element = &$field; break; } } } else { // Get an array of fields with the correct name. $fields = $this->xml->xpath('//header[@name="' . $name . '"]'); // Make sure something was found. if (!$fields) { return false; } // Search through the fields for the right one. foreach ($fields as &$field) { // If we find an ancestor fields element with a group name then it isn't what we want. if ($field->xpath('ancestor::headerfields[@name]')) { continue; } // Found it! else { $element = &$field; break; } } } return $element; } /** * Method to load, setup and return a FOFFormHeader object based on field data. * * @param string $element The XML element object representation of the form field. * @param string $group The optional dot-separated form group path on which to find the field. * @param mixed $value The optional value to use as the default for the field. * * @return mixed The FOFFormHeader object for the field or boolean false on error. * * @since 2.0 */ protected function loadHeader($element, $group = null, $value = null) { // Make sure there is a valid SimpleXMLElement. if (!($element instanceof SimpleXMLElement)) { return false; } // Get the field type. $type = $element['type'] ? (string) $element['type'] : 'field'; // Load the JFormField object for the field. $field = $this->loadHeaderType($type); // If the object could not be loaded, get a text field object. if ($field === false) { $field = $this->loadHeaderType('field'); } // Setup the FOFFormHeader object. $field->setForm($this); if ($field->setup($element, $value, $group)) { return $field; } else { return false; } } /** * Proxy for {@link FOFFormHelper::loadFieldType()}. * * @param string $type The field type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed FOFFormField object on success, false otherwise. * * @since 2.0 */ protected function loadFieldType($type, $new = true) { return FOFFormHelper::loadFieldType($type, $new); } /** * Proxy for {@link FOFFormHelper::loadHeaderType()}. * * @param string $type The field type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed FOFFormHeader object on success, false otherwise. * * @since 2.0 */ protected function loadHeaderType($type, $new = true) { return FOFFormHelper::loadHeaderType($type, $new); } /** * Proxy for {@link FOFFormHelper::loadRuleType()}. * * @param string $type The rule type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed JFormRule object on success, false otherwise. * * @see FOFFormHelper::loadRuleType() * @since 2.0 */ protected function loadRuleType($type, $new = true) { return FOFFormHelper::loadRuleType($type, $new); } /** * Proxy for {@link FOFFormHelper::addFieldPath()}. * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @since 2.0 */ public static function addFieldPath($new = null) { return FOFFormHelper::addFieldPath($new); } /** * Proxy for {@link FOFFormHelper::addHeaderPath()}. * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @since 2.0 */ public static function addHeaderPath($new = null) { return FOFFormHelper::addHeaderPath($new); } /** * Proxy for FOFFormHelper::addFormPath(). * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @see FOFFormHelper::addFormPath() * @since 2.0 */ public static function addFormPath($new = null) { return FOFFormHelper::addFormPath($new); } /** * Proxy for FOFFormHelper::addRulePath(). * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @see FOFFormHelper::addRulePath() * @since 2.0 */ public static function addRulePath($new = null) { return FOFFormHelper::addRulePath($new); } } PK���\�7w��libraries/fof/form/field.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic interface that a FOF form field class must implement * * @package FrameworkOnFramework * @since 2.0 */ interface FOFFormField { /** * Get the rendering of this field type for static display, e.g. in a single * item view (typically a "read" task). * * @return string The field HTML * * @since 2.0 */ public function getStatic(); /** * Get the rendering of this field type for a repeatable (grid) display, * e.g. in a view listing many item (typically a "browse" task) * * @return string The field HTML * * @since 2.0 */ public function getRepeatable(); } PK���\g``libraries/fof/form/helper.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; JLoader::import('joomla.form.helper'); /** * FOFForm's helper class. * Provides a storage for filesystem's paths where FOFForm's entities reside and * methods for creating those entities. Also stores objects with entities' * prototypes for further reusing. * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHelper extends JFormHelper { /** * Method to load a form field object given a type. * * @param string $type The field type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed JFormField object on success, false otherwise. * * @since 11.1 */ public static function loadFieldType($type, $new = true) { return self::loadType('field', $type, $new); } /** * Method to load a form field object given a type. * * @param string $type The field type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed JFormField object on success, false otherwise. * * @since 11.1 */ public static function loadHeaderType($type, $new = true) { return self::loadType('header', $type, $new); } /** * Method to load a form entity object given a type. * Each type is loaded only once and then used as a prototype for other objects of same type. * Please, use this method only with those entities which support types (forms don't support them). * * @param string $entity The entity. * @param string $type The entity type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed Entity object on success, false otherwise. * * @since 11.1 */ protected static function loadType($entity, $type, $new = true) { // Reference to an array with current entity's type instances $types = &self::$entities[$entity]; $key = md5($type); // Return an entity object if it already exists and we don't need a new one. if (isset($types[$key]) && $new === false) { return $types[$key]; } $class = self::loadClass($entity, $type); if ($class !== false) { // Instantiate a new type object. $types[$key] = new $class; return $types[$key]; } else { return false; } } /** * Attempt to import the JFormField class file if it isn't already imported. * You can use this method outside of JForm for loading a field for inheritance or composition. * * @param string $type Type of a field whose class should be loaded. * * @return mixed Class name on success or false otherwise. * * @since 11.1 */ public static function loadFieldClass($type) { return self::loadClass('field', $type); } /** * Attempt to import the FOFFormHeader class file if it isn't already imported. * You can use this method outside of JForm for loading a field for inheritance or composition. * * @param string $type Type of a field whose class should be loaded. * * @return mixed Class name on success or false otherwise. * * @since 11.1 */ public static function loadHeaderClass($type) { return self::loadClass('header', $type); } /** * Load a class for one of the form's entities of a particular type. * Currently, it makes sense to use this method for the "field" and "rule" entities * (but you can support more entities in your subclass). * * @param string $entity One of the form entities (field or rule). * @param string $type Type of an entity. * * @return mixed Class name on success or false otherwise. * * @since 2.0 */ public static function loadClass($entity, $type) { if (strpos($type, '.')) { list($prefix, $type) = explode('.', $type); $altPrefix = $prefix; } else { $prefix = 'FOF'; $altPrefix = 'J'; } $class = JString::ucfirst($prefix, '_') . 'Form' . JString::ucfirst($entity, '_') . JString::ucfirst($type, '_'); $altClass = JString::ucfirst($altPrefix, '_') . 'Form' . JString::ucfirst($entity, '_') . JString::ucfirst($type, '_'); if (class_exists($class)) { return $class; } elseif (class_exists($altClass)) { return $altClass; } // Get the field search path array. $paths = self::addPath($entity); // If the type is complex, add the base type to the paths. if ($pos = strpos($type, '_')) { // Add the complex type prefix to the paths. for ($i = 0, $n = count($paths); $i < $n; $i++) { // Derive the new path. $path = $paths[$i] . '/' . strtolower(substr($type, 0, $pos)); // If the path does not exist, add it. if (!in_array($path, $paths)) { $paths[] = $path; } } // Break off the end of the complex type. $type = substr($type, $pos + 1); } // Try to find the class file. $type = strtolower($type) . '.php'; $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); foreach ($paths as $path) { if ($file = $filesystem->pathFind($path, $type)) { require_once $file; if (class_exists($class)) { break; } elseif (class_exists($altClass)) { break; } } } // Check for all if the class exists. if (class_exists($class)) { return $class; } elseif (class_exists($altClass)) { return $altClass; } else { return false; } } /** * Method to add a path to the list of header include paths. * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. */ public static function addHeaderPath($new = null) { return self::addPath('header', $new); } } PK���\zyff'libraries/fof/form/header/filtersql.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic filter, drop-down based on SQL query * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderFiltersql extends FOFFormHeaderFieldsql { /** * Get the header * * @return string The header HTML */ protected function getHeader() { return ''; } } PK���\ւ����'libraries/fof/form/header/rowselect.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Row selection checkbox * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderRowselect extends FOFFormHeader { /** * Get the header * * @return string The header HTML */ protected function getHeader() { return '<input type="checkbox" name="checkall-toggle" value="" title="' . JText::_('JGLOBAL_CHECK_ALL') . '" onclick="Joomla.checkAll(this)" />'; } } PK���\b;/��#libraries/fof/form/header/field.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic field header, without any filters * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderField extends FOFFormHeader { /** * Get the header * * @return string The header HTML */ protected function getHeader() { $sortable = ($this->element['sortable'] != 'false'); $label = $this->getLabel(); if ($sortable) { $view = $this->form->getView(); return JHTML::_('grid.sort', $label, $this->name, $view->getLists()->order_Dir, $view->getLists()->order, $this->form->getModel()->task ); } else { return JText::_($label); } } } PK���\���)||.libraries/fof/form/header/filterfilterable.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic filter, text box entry with optional buttons * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderFilterfilterable extends FOFFormHeaderFieldfilterable { /** * Get the header * * @return string The header HTML */ protected function getHeader() { return ''; } } PK���\���� � -libraries/fof/form/header/fieldfilterable.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic field header, with text input (search) filter * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderFieldfilterable extends FOFFormHeaderFieldsearchable { /** * Get the filter field * * @return string The HTML */ protected function getFilter() { $valide = array('yes', 'true', '1'); // Initialize some field(s) attributes. $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : ''; $filterclass = $this->element['filterclass'] ? ' class="' . (string) $this->element['filterclass'] . '"' : ''; $placeholder = $this->element['placeholder'] ? $this->element['placeholder'] : $this->getLabel(); $name = $this->element['searchfieldname'] ? $this->element['searchfieldname'] : $this->name; $placeholder = ' placeholder="' . JText::_($placeholder) . '"'; $single = in_array($this->element['single'], $valide) ? true : false; $showMethod = in_array($this->element['showmethod'], $valide) ? true : false; $method = $this->element['method'] ? $this->element['method'] : 'between'; $fromName = $this->element['fromname'] ? $this->element['fromname'] : 'from'; $toName = $this->element['toname'] ? $this->element['toname'] : 'to'; $values = $this->form->getModel()->getState($name); $fromValue = $values[$fromName]; $toValue = $values[$toName]; // Initialize JavaScript field attributes. if ($this->element['onchange']) { $onchange = ' onchange="' . (string) $this->element['onchange'] . '"'; } else { $onchange = ' onchange="document.adminForm.submit();"'; } if ($showMethod) { $html = '<input type="text" name="' . $name . '[method]" value="'. $method . '" />'; } else { $html = '<input type="hidden" name="' . $name . '[method]" value="'. $method . '" />'; } $html .= '<input type="text" name="' . $name . '[from]" id="' . $this->id . '_' . $fromName . '"' . ' value="' . htmlspecialchars($fromValue, ENT_COMPAT, 'UTF-8') . '"' . $filterclass . $size . $placeholder . $onchange . $maxLength . '/>'; if (!$single) { $html .= '<input type="text" name="' . $name . '[to]" id="' . $this->id . '_' . $toName . '"' . ' value="' . htmlspecialchars($toValue, ENT_COMPAT, 'UTF-8') . '"' . $filterclass . $size . $placeholder . $onchange . $maxLength . '/>'; } return $html; } }PK���\1��&libraries/fof/form/header/language.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Language field header * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderLanguage extends FOFFormHeaderFieldselectable { /** * Method to get the filter options. * * @return array The filter option objects. * * @since 2.0 */ protected function getOptions() { // Initialize some field attributes. $client = (string) $this->element['client']; if ($client != 'site' && $client != 'administrator') { $client = 'site'; } // Merge any additional options in the XML definition. $options = array_merge( parent::getOptions(), JLanguageHelper::createLanguageList($this->value, constant('JPATH_' . strtoupper($client)), true, true) ); return $options; } } PK���\�PI� � -libraries/fof/form/header/fieldsearchable.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic field header, with text input (search) filter * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderFieldsearchable extends FOFFormHeaderField { /** * Get the filter field * * @return string The HTML */ protected function getFilter() { // Initialize some field attributes. $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : ''; $filterclass = $this->element['filterclass'] ? ' class="' . (string) $this->element['filterclass'] . '"' : ''; $placeholder = $this->element['placeholder'] ? $this->element['placeholder'] : $this->getLabel(); $name = $this->element['searchfieldname'] ? $this->element['searchfieldname'] : $this->name; $placeholder = ' placeholder="' . JText::_($placeholder) . '"'; if ($this->element['searchfieldname']) { $model = $this->form->getModel(); $searchvalue = $model->getState((string) $this->element['searchfieldname']); } else { $searchvalue = $this->value; } // Initialize JavaScript field attributes. if ($this->element['onchange']) { $onchange = ' onchange="' . (string) $this->element['onchange'] . '"'; } else { $onchange = ' onchange="document.adminForm.submit();"'; } return '<input type="text" name="' . $name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($searchvalue, ENT_COMPAT, 'UTF-8') . '"' . $filterclass . $size . $placeholder . $onchange . $maxLength . '/>'; } /** * Get the buttons HTML code * * @return string The HTML */ protected function getButtons() { $buttonclass = $this->element['buttonclass'] ? (string) $this->element['buttonclass'] : 'btn hasTip hasTooltip'; $buttonsState = strtolower($this->element['buttons']); $show_buttons = !in_array($buttonsState, array('no', 'false', '0')); if (!$show_buttons) { return ''; } $html = ''; $html .= '<button class="' . $buttonclass . '" onclick="this.form.submit();" title="' . JText::_('JSEARCH_FILTER') . '" >' . "\n"; $html .= '<i class="icon-search"></i>'; $html .= '</button>' . "\n"; $html .= '<button class="' . $buttonclass . '" onclick="document.adminForm.' . $this->id . '.value=\'\';this.form.submit();" title="' . JText::_('JSEARCH_RESET') . '">' . "\n"; $html .= '<i class="icon-remove"></i>'; $html .= '</button>' . "\n"; return $html; } } PK���\��}'libraries/fof/form/header/published.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Field header for Published (enabled) columns * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderPublished extends FOFFormHeaderFieldselectable { /** * Create objects for the options * * @return array The array of option objects */ protected function getOptions() { $config = array( 'published' => 1, 'unpublished' => 1, 'archived' => 0, 'trash' => 0, 'all' => 0, ); $stack = array(); if ($this->element['show_published'] == 'false') { $config['published'] = 0; } if ($this->element['show_unpublished'] == 'false') { $config['unpublished'] = 0; } if ($this->element['show_archived'] == 'true') { $config['archived'] = 1; } if ($this->element['show_trash'] == 'true') { $config['trash'] = 1; } if ($this->element['show_all'] == 'true') { $config['all'] = 1; } $options = JHtml::_('jgrid.publishedOptions', $config); reset($options); return $options; } } PK���\�L3%��&libraries/fof/form/header/fieldsql.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic field header, with drop down filters based on a SQL query * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderFieldsql extends FOFFormHeaderFieldselectable { /** * Create objects for the options * * @return array The array of option objects */ protected function getOptions() { $options = array(); // Initialize some field attributes. $key = $this->element['key_field'] ? (string) $this->element['key_field'] : 'value'; $value = $this->element['value_field'] ? (string) $this->element['value_field'] : (string) $this->element['name']; $translate = $this->element['translate'] ? (string) $this->element['translate'] : false; $query = (string) $this->element['query']; // Get the database object. $db = FOFPlatform::getInstance()->getDbo(); // Set the query and get the result list. $db->setQuery($query); $items = $db->loadObjectlist(); // Build the field options. if (!empty($items)) { foreach ($items as $item) { if ($translate == true) { $options[] = JHtml::_('select.option', $item->$key, JText::_($item->$value)); } else { $options[] = JHtml::_('select.option', $item->$key, $item->$value); } } } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } } PK���\� (||.libraries/fof/form/header/filtersearchable.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic filter, text box entry with optional buttons * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderFiltersearchable extends FOFFormHeaderFieldsearchable { /** * Get the header * * @return string The header HTML */ protected function getHeader() { return ''; } } PK���\�'��ii#libraries/fof/form/header/model.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; if (!class_exists('JFormFieldSql')) { require_once JPATH_LIBRARIES . '/joomla/form/fields/sql.php'; } /** * Form Field class for FOF * Generic list from a model's results * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderModel extends FOFFormHeaderFieldselectable { /** * Method to get the field options. * * @return array The field option objects. */ protected function getOptions() { $options = array(); // Initialize some field attributes. $key = $this->element['key_field'] ? (string) $this->element['key_field'] : 'value'; $value = $this->element['value_field'] ? (string) $this->element['value_field'] : (string) $this->element['name']; $applyAccess = $this->element['apply_access'] ? (string) $this->element['apply_access'] : 'false'; $modelName = (string) $this->element['model']; $nonePlaceholder = (string) $this->element['none']; $translate = empty($this->element['translate']) ? 'true' : (string) $this->element['translate']; $translate = in_array(strtolower($translate), array('true','yes','1','on')) ? true : false; if (!empty($nonePlaceholder)) { $options[] = JHtml::_('select.option', null, JText::_($nonePlaceholder)); } // Process field atrtibutes $applyAccess = strtolower($applyAccess); $applyAccess = in_array($applyAccess, array('yes', 'on', 'true', '1')); // Explode model name into model name and prefix $parts = 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; } } PK���\��)libraries/fof/form/header/accesslevel.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Access level field header * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderAccesslevel extends FOFFormHeaderFieldselectable { /** * Method to get the list of access levels * * @return array A list of access levels. * * @since 2.0 */ protected function 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(); return $options; } } PK���\o�#� -libraries/fof/form/header/fieldselectable.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic field header, with drop down filters * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderFieldselectable extends FOFFormHeaderField { /** * Create objects for the options * * @return array The array of option objects */ protected function getOptions() { $options = array(); // Get the field $options foreach ($this->element->children() as $option) { // Only add <option /> elements. if ($option->getName() != 'option') { continue; } // Create a new option object based on the <option /> element. $options[] = JHtml::_( 'select.option', (string) $option['value'], JText::alt( trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname) ), 'value', 'text', ((string) $option['disabled'] == 'true') ); } // Do we have a class and method source for our options? $source_file = empty($this->element['source_file']) ? '' : (string) $this->element['source_file']; $source_class = empty($this->element['source_class']) ? '' : (string) $this->element['source_class']; $source_method = empty($this->element['source_method']) ? '' : (string) $this->element['source_method']; $source_key = empty($this->element['source_key']) ? '*' : (string) $this->element['source_key']; $source_value = empty($this->element['source_value']) ? '*' : (string) $this->element['source_value']; $source_translate = empty($this->element['source_translate']) ? 'true' : (string) $this->element['source_translate']; $source_translate = in_array(strtolower($source_translate), array('true','yes','1','on')) ? true : false; $source_format = empty($this->element['source_format']) ? '' : (string) $this->element['source_format']; if ($source_class && $source_method) { // Maybe we have to load a file? if (!empty($source_file)) { $source_file = 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 { $source_data = $source_class::$source_method(); // Loop through the data and prime the $options array foreach ($source_data as $k => $v) { $key = (empty($source_key) || ($source_key == '*')) ? $k : $v[$source_key]; $value = (empty($source_value) || ($source_value == '*')) ? $v : $v[$source_value]; if ($source_translate) { $value = JText::_($value); } $options[] = JHtml::_('select.option', $key, $value, 'value', 'text'); } } } } } reset($options); return $options; } } PK���\:S9�qq(libraries/fof/form/header/filterdate.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic filter, text box entry with calendar button * * @package FrameworkOnFramework * @since 2.3.3 */ class FOFFormHeaderFilterdate extends FOFFormHeaderFielddate { /** * Get the header * * @return string The header HTML */ protected function getHeader() { return ''; } } PK���\[�{�xx.libraries/fof/form/header/filterselectable.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic filter, drop-down based on fixed options * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderFilterselectable extends FOFFormHeaderFieldselectable { /** * Get the header * * @return string The header HTML */ protected function getHeader() { return ''; } } PK���\_k%#99&libraries/fof/form/header/ordering.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Ordering field header * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderOrdering extends FOFFormHeader { /** * Get the header * * @return string The header HTML */ protected function getHeader() { $sortable = ($this->element['sortable'] != 'false'); $view = $this->form->getView(); $model = $this->form->getModel(); $hasAjaxOrderingSupport = $view->hasAjaxOrderingSupport(); if (!$sortable) { // Non sortable?! I'm not sure why you'd want that, but if you insist... return JText::_('JGRID_HEADING_ORDERING'); } if (!$hasAjaxOrderingSupport) { // Ye olde Joomla! 2.5 method $html = JHTML::_('grid.sort', 'JFIELD_ORDERING_LABEL', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, 'browse'); $html .= JHTML::_('grid.order', $model->getList()); return $html; } else { // The new, drag'n'drop ordering support WITH a save order button $html = JHtml::_( 'grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, null, 'asc', 'JGRID_HEADING_ORDERING' ); $ordering = $view->getLists()->order == 'ordering'; if ($ordering) { $html .= '<a href="javascript:saveorder(' . (count($model->getList()) - 1) . ', \'saveorder\')" ' . 'rel="tooltip" class="save-order btn btn-micro pull-right" title="' . JText::_('JLIB_HTML_SAVE_ORDER') . '">' . '<span class="icon-ok"></span></a>'; } return $html; } } } PK���\����'libraries/fof/form/header/fielddate.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * Generic field header, with text input (search) filter * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormHeaderFielddate extends FOFFormHeaderField { /** * Get the filter field * * @return string The HTML */ protected function getFilter() { // Initialize some field attributes. $format = $this->element['format'] ? (string) $this->element['format'] : '%Y-%m-%d'; $attributes = array(); if ($this->element['size']) { $attributes['size'] = (int) $this->element['size']; } if ($this->element['maxlength']) { $attributes['maxlength'] = (int) $this->element['maxlength']; } if ($this->element['filterclass']) { $attributes['class'] = (string) $this->element['filterclass']; } if ((string) $this->element['readonly'] == 'true') { $attributes['readonly'] = 'readonly'; } if ((string) $this->element['disabled'] == 'true') { $attributes['disabled'] = 'disabled'; } if ($this->element['onchange']) { $attributes['onchange'] = (string) $this->element['onchange']; } else { $onchange = 'document.adminForm.submit()'; } if ((string) $this->element['placeholder']) { $attributes['placeholder'] = JText::_((string) $this->element['placeholder']); } $name = $this->element['searchfieldname'] ? $this->element['searchfieldname'] : $this->name; if ($this->element['searchfieldname']) { $model = $this->form->getModel(); $searchvalue = $model->getState((string) $this->element['searchfieldname']); } else { $searchvalue = $this->value; } // Get some system objects. $config = FOFPlatform::getInstance()->getConfig(); $user = JFactory::getUser(); // If a known filter is given use it. switch (strtoupper((string) $this->element['filter'])) { case 'SERVER_UTC': // Convert a date to UTC based on the server timezone. if ((int) $this->value) { // Get a date object based on the correct timezone. $date = FOFPlatform::getInstance()->getDate($searchvalue, 'UTC'); $date->setTimezone(new DateTimeZone($config->get('offset'))); // Transform the date string. $searchvalue = $date->format('Y-m-d H:i:s', true, false); } break; case 'USER_UTC': // Convert a date to UTC based on the user timezone. if ((int) $searchvalue) { // Get a date object based on the correct timezone. $date = FOFPlatform::getInstance()->getDate($this->value, 'UTC'); $date->setTimezone(new DateTimeZone($user->getParam('timezone', $config->get('offset')))); // Transform the date string. $searchvalue = $date->format('Y-m-d H:i:s', true, false); } break; } return JHtml::_('calendar', $searchvalue, $name, $name, $format, $attributes); } /** * Get the buttons HTML code * * @return string The HTML */ protected function getButtons() { return ''; } } PK���\��ǂ�,�,libraries/fof/form/header.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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; /** * An interface for FOFFormHeader fields, used to define the filters and the * elements of the header row in repeatable (browse) views * * @package FrameworkOnFramework * @since 2.0 */ abstract class FOFFormHeader { /** * The description text for the form field. Usually used in tooltips. * * @var string * @since 2.0 */ protected $description; /** * The SimpleXMLElement object of the <field /> XML element that describes the header field. * * @var SimpleXMLElement * @since 2.0 */ protected $element; /** * The FOFForm object of the form attached to the header field. * * @var FOFForm * @since 2.0 */ protected $form; /** * The label for the header field. * * @var string * @since 2.0 */ protected $label; /** * The header HTML. * * @var string|null * @since 2.0 */ protected $header; /** * The filter HTML. * * @var string|null * @since 2.0 */ protected $filter; /** * The buttons HTML. * * @var string|null * @since 2.0 */ protected $buttons; /** * The options for a drop-down filter. * * @var array|null * @since 2.0 */ protected $options; /** * The name of the form field. * * @var string * @since 2.0 */ protected $name; /** * The name of the field. * * @var string * @since 2.0 */ protected $fieldname; /** * The group of the field. * * @var string * @since 2.0 */ protected $group; /** * The form field type. * * @var string * @since 2.0 */ protected $type; /** * The value of the filter. * * @var mixed * @since 2.0 */ protected $value; /** * The intended table data width (in pixels or percent). * * @var mixed * @since 2.0 */ protected $tdwidth; /** * The key of the filter value in the model state. * * @var mixed * @since 2.0 */ protected $filterSource; /** * Is this a sortable column? * * @var bool * @since 2.0 */ protected $sortable = false; /** * Method to instantiate the form field object. * * @param FOFForm $form The form to attach to the form field object. * * @since 2.0 */ public function __construct(FOFForm $form = null) { // If there is a form passed into the constructor set the form and form control properties. if ($form instanceof FOFForm) { $this->form = $form; } } /** * 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 'description': case 'name': case 'type': case 'fieldname': case 'group': case 'tdwidth': return $this->$name; break; case 'label': if (empty($this->label)) { $this->label = $this->getLabel(); } return $this->label; case 'value': if (empty($this->value)) { $this->value = $this->getValue(); } return $this->value; break; case 'header': if (empty($this->header)) { $this->header = $this->getHeader(); } return $this->header; break; case 'filter': if (empty($this->filter)) { $this->filter = $this->getFilter(); } return $this->filter; break; case 'buttons': if (empty($this->buttons)) { $this->buttons = $this->getButtons(); } return $this->buttons; break; case 'options': if (empty($this->options)) { $this->options = $this->getOptions(); } return $this->options; break; case 'sortable': if (empty($this->sortable)) { $this->sortable = $this->getSortable(); } return $this->sortable; break; } return null; } /** * Method to attach a JForm object to the field. * * @param FOFForm $form The JForm object to attach to the form field. * * @return FOFFormHeader The form field object so that the method can be used in a chain. * * @since 2.0 */ public function setForm(FOFForm $form) { $this->form = $form; return $this; } /** * Method to attach a FOFForm 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 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. * * @since 2.0 */ public function setup(SimpleXMLElement $element, $value, $group = null) { // Make sure there is a valid JFormField XML element. if ((string) $element->getName() != 'header') { return false; } // Reset the internal fields $this->label = null; $this->header = null; $this->filter = null; $this->buttons = null; $this->options = null; $this->value = null; $this->filterSource = null; // Set the XML element object. $this->element = $element; // Get some important attributes from the form field element. $class = (string) $element['class']; $id = (string) $element['id']; $name = (string) $element['name']; $filterSource = (string) $element['filter_source']; $tdwidth = (string) $element['tdwidth']; // Set the field description text. $this->description = (string) $element['description']; // Set the group of the field. $this->group = $group; // Set the td width of the field. $this->tdwidth = $tdwidth; // Set the field name and id. $this->fieldname = $this->getFieldName($name); $this->name = $this->getName($this->fieldname); $this->id = $this->getId($id, $this->fieldname); $this->filterSource = $this->getFilterSource($filterSource); // Set the field default value. $this->value = $this->getValue(); return true; } /** * Method to get the id used for the field input tag. * * @param string $fieldId The field element id. * @param string $fieldName The field element name. * * @return string The id to be used for the field input tag. * * @since 2.0 */ protected function getId($fieldId, $fieldName) { $id = ''; // If the field is in a group add the group control to the field id. if ($this->group) { // If we already have an id segment add the group control as another level. if ($id) { $id .= '_' . str_replace('.', '_', $this->group); } else { $id .= str_replace('.', '_', $this->group); } } // If we already have an id segment add the field id/name as another level. if ($id) { $id .= '_' . ($fieldId ? $fieldId : $fieldName); } else { $id .= ($fieldId ? $fieldId : $fieldName); } // Clean up any invalid characters. $id = preg_replace('#\W#', '_', $id); return $id; } /** * Method to get the name used for the field input tag. * * @param string $fieldName The field element name. * * @return string The name to be used for the field input tag. * * @since 2.0 */ protected function getName($fieldName) { $name = ''; // If the field is in a group add the group control to the field name. if ($this->group) { // If we already have a name segment add the group control as another level. $groups = explode('.', $this->group); if ($name) { foreach ($groups as $group) { $name .= '[' . $group . ']'; } } else { $name .= array_shift($groups); foreach ($groups as $group) { $name .= '[' . $group . ']'; } } } // If we already have a name segment add the field name as another level. if ($name) { $name .= '[' . $fieldName . ']'; } else { $name .= $fieldName; } return $name; } /** * Method to get the field name used. * * @param string $fieldName The field element name. * * @return string The field name * * @since 2.0 */ protected function getFieldName($fieldName) { return $fieldName; } /** * Method to get the field label. * * @return string The field label. * * @since 2.0 */ protected function getLabel() { // Get the label text from the XML element, defaulting to the element name. $title = $this->element['label'] ? (string) $this->element['label'] : ''; if (empty($title)) { $view = $this->form->getView(); $params = $view->getViewOptionAndName(); $title = $params['option'] . '_' . FOFInflector::pluralize($params['view']) . '_FIELD_' . (string) $this->element['name']; $title = strtoupper($title); $result = JText::_($title); if ($result === $title) { $title = ucfirst((string) $this->element['name']); } } return $title; } /** * Get the filter value for this header field * * @return mixed The filter value */ protected function getValue() { $model = $this->form->getModel(); return $model->getState($this->filterSource); } /** * Return the key of the filter value in the model state or, if it's not set, * the name of the field. * * @param string $filterSource The filter source value to return * * @return string */ protected function getFilterSource($filterSource) { if ($filterSource) { return $filterSource; } else { return $this->name; } } /** * Is this a sortable field? * * @return boolean True if it's sortable */ protected function getSortable() { $sortable = ($this->element['sortable'] != 'false'); if ($sortable) { if (empty($this->header)) { $this->header = $this->getHeader(); } $sortable = !empty($this->header); } return $sortable; } /** * Returns the HTML for the header row, or null if this element should * render no header element * * @return string|null HTML code or null if nothing is to be rendered * * @since 2.0 */ protected function getHeader() { return null; } /** * Returns the HTML for a text filter to be rendered in the filter row, * or null if this element should render no text input filter. * * @return string|null HTML code or null if nothing is to be rendered * * @since 2.0 */ protected function getFilter() { return null; } /** * Returns the HTML for the buttons to be rendered in the filter row, * next to the text input filter, or null if this element should render no * text input filter buttons. * * @return string|null HTML code or null if nothing is to be rendered * * @since 2.0 */ protected function getButtons() { return null; } /** * Returns the JHtml options for a drop-down filter. Do not include an * empty option, it is added automatically. * * @return array The JHtml options for a drop-down filter * * @since 2.0 */ protected function getOptions() { return array(); } } PK���\38BK� � libraries/fof/form/field/url.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\U�D� � $libraries/fof/form/field/plugins.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\���qq!libraries/fof/form/field/user.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\��P��*libraries/fof/form/field/groupedbutton.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�����#libraries/fof/form/field/hidden.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\��u�CC'libraries/fof/form/field/components.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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 * 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���\��(��%libraries/fof/form/field/checkbox.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\s�'��� libraries/fof/form/field/tag.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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('a.id AS value, a.path, a.title AS text, a.level, a.published') ->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(); } // Ajax tag only loads assigned values if (!$this->isNested()) { // Only item assigned values $values = (array) $this->value; FOFUtilsArray::toInteger($values); $query->where('a.id IN (' . implode(',', $values) . ')'); } // Filter language if (!empty($this->element['language'])) { $query->where('a.language = ' . $db->quote($this->element['language'])); } $query->where($db->quoteName('a.alias') . ' <> ' . $db->quote('root')); // 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->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.published, a.path') ->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���\�k��d�d"libraries/fof/form/field/rules.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\���$��%libraries/fof/form/field/calendar.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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('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(new DateTimeZone($user->getParam('timezone', $config->get('offset')))); } 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���\a��� � +libraries/fof/form/field/sessionhandler.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\��^� � &libraries/fof/form/field/usergroup.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @subpackage form * @copyright Copyright (C) 2010 - 2015 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 = JFactory::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 = JFactory::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���\�FL�� � 'libraries/fof/form/field/checkboxes.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\I�C�AA$libraries/fof/form/field/actions.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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 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���\+�ߙ #libraries/fof/form/field/editor.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\��ss&libraries/fof/form/field/imagelist.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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('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���\�c�xx#libraries/fof/form/field/button.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\IԂ� %libraries/fof/form/field/timezone.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\���� � %libraries/fof/form/field/password.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\��>>%libraries/fof/form/field/language.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�K��&libraries/fof/form/field/published.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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 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���\C���&libraries/fof/form/field/selectrow.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�(1�� � libraries/fof/form/field/sql.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�1� � "libraries/fof/form/field/radio.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\/�;��%libraries/fof/form/field/textarea.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�V�&�&!libraries/fof/form/field/list.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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 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���\Oa�"libraries/fof/form/field/model.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�� � $libraries/fof/form/field/integer.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\a~ݱ� � libraries/fof/form/field/tel.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\ڢ?���(libraries/fof/form/field/accesslevel.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�xoc��$libraries/fof/form/field/captcha.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\[K�m��!libraries/fof/form/field/text.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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 one line text field. * * @package FrameworkOnFramework * @since 2.0 */ class FOFFormFieldText extends JFormFieldText implements FOFFormField { protected $static; protected $repeatable; /** @var FOFTable The item being rendered in a repeatable form field */ public $item; /** @var int A monotonically increasing number, denoting the row number in a repeatable view */ public $rowid; /** * Method to get certain otherwise inaccessible properties from the form field object. * * @param string $name The property name for which to the the value. * * @return mixed The property value or null. * * @since 2.0 */ public function __get($name) { switch ($name) { case 'static': if (empty($this->static)) { $this->static = $this->getStatic(); } return $this->static; break; case 'repeatable': if (empty($this->repeatable)) { $this->repeatable = $this->getRepeatable(); } return $this->repeatable; break; default: return parent::__get($name); } } /** * Get the rendering of this field type for static display, e.g. in a single * item view (typically a "read" task). * * @since 2.0 * * @return string The field HTML */ public function getStatic() { $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; $empty_replacement = ''; if ($this->element['empty_replacement']) { $empty_replacement = (string) $this->element['empty_replacement']; } if (!empty($empty_replacement) && empty($this->value)) { $this->value = JText::_($empty_replacement); } return '<span id="' . $this->id . '" ' . $class . '>' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '</span>'; } /** * Get the rendering of this field type for a repeatable (grid) display, * e.g. in a view listing many item (typically a "browse" task) * * @since 2.0 * * @return string The field HTML */ public function getRepeatable() { // Initialise $class = $this->id; $format_string = ''; $format_if_not_empty = false; $parse_value = false; $show_link = false; $link_url = ''; $empty_replacement = ''; // Get field parameters if ($this->element['class']) { $class = (string) $this->element['class']; } if ($this->element['format']) { $format_string = (string) $this->element['format']; } if ($this->element['show_link'] == 'true') { $show_link = true; } if ($this->element['format_if_not_empty'] == 'true') { $format_if_not_empty = true; } if ($this->element['parse_value'] == 'true') { $parse_value = true; } if ($this->element['url']) { $link_url = $this->element['url']; } else { $show_link = false; } if ($show_link && ($this->item instanceof FOFTable)) { $link_url = $this->parseFieldTags($link_url); } else { $show_link = false; } if ($this->element['empty_replacement']) { $empty_replacement = (string) $this->element['empty_replacement']; } // Get the (optionally formatted) value $value = $this->value; if (!empty($empty_replacement) && empty($this->value)) { $value = JText::_($empty_replacement); } if ($parse_value) { $value = $this->parseFieldTags($value); } if (!empty($format_string) && (!$format_if_not_empty || ($format_if_not_empty && !empty($this->value)))) { $format_string = $this->parseFieldTags($format_string); $value = sprintf($format_string, $value); } else { $value = htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); } // Create the HTML $html = '<span class="' . $class . '">'; if ($show_link) { $html .= '<a href="' . $link_url . '">'; } $html .= $value; if ($show_link) { $html .= '</a>'; } $html .= '</span>'; return $html; } /** * Replace string with tags that reference fields * * @param string $text Text to process * * @return string Text with tags replace */ protected function parseFieldTags($text) { $ret = $text; // Replace [ITEM:ID] in the URL with the item's key value (usually: // the auto-incrementing numeric ID) $keyfield = $this->item->getKeyName(); $replace = $this->item->$keyfield; $ret = str_replace('[ITEM:ID]', $replace, $ret); // Replace the [ITEMID] in the URL with the current Itemid parameter $ret = str_replace('[ITEMID]', JFactory::getApplication()->input->getInt('Itemid', 0), $ret); // Replace other field variables in the URL $fields = $this->item->getTableFields(); foreach ($fields as $fielddata) { $fieldname = $fielddata->Field; if (empty($fieldname)) { $fieldname = $fielddata->column_name; } $search = '[ITEM:' . strtoupper($fieldname) . ']'; $replace = $this->item->$fieldname; $ret = str_replace($search, $replace, $ret); } return $ret; } } PK���\��O"""libraries/fof/form/field/title.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\`�X��"libraries/fof/form/field/media.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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('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���\\Ku��#libraries/fof/form/field/spacer.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�x���%libraries/fof/form/field/ordering.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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 JDatabaseQuery 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 = JFactory::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���\��&ɾ � )libraries/fof/form/field/cachehandler.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\ŘxI,,(libraries/fof/form/field/groupedlist.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\HA1)$$"libraries/fof/form/field/image.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�s/fgg"libraries/fof/form/field/email.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\��6�vv%libraries/fof/form/field/relation.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage form * @copyright Copyright (C) 2010 - 2015 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���\�����8�8 libraries/fof/template/utils.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage template * @copyright Copyright (C) 2010 - 2015 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; /** * A utility class to load view templates, media files and modules. * * @package FrameworkOnFramework * @since 1.0 */ class FOFTemplateUtils { /** * Add a CSS file to the page generated by the CMS * * @param string $path A fancy path definition understood by parsePath * * @see FOFTemplateUtils::parsePath * * @return void */ public static function addCSS($path) { $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { if (method_exists($document, 'addStyleSheet')) { $url = self::parsePath($path); $document->addStyleSheet($url); } } } /** * Add a JS script file to the page generated by the CMS. * * There are three combinations of defer and async (see http://www.w3schools.com/tags/att_script_defer.asp): * * $defer false, $async true: The script is executed asynchronously with the rest of the page * (the script will be executed while the page continues the parsing) * * $defer true, $async false: The script is executed when the page has finished parsing. * * $defer false, $async false. (default) The script is loaded and executed immediately. When it finishes * loading the browser continues parsing the rest of the page. * * When you are using $defer = true there is no guarantee about the load order of the scripts. Whichever * script loads first will be executed first. The order they appear on the page is completely irrelevant. * * @param string $path A fancy path definition understood by parsePath * @param boolean $defer Adds the defer attribute, meaning that your script * will only load after the page has finished parsing. * @param boolean $async Adds the async attribute, meaning that your script * will be executed while the resto of the page * continues parsing. * * @see FOFTemplateUtils::parsePath * * @return void */ public static function addJS($path, $defer = false, $async = false) { $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { if (method_exists($document, 'addScript')) { $url = self::parsePath($path); $document->addScript($url, "text/javascript", $defer, $async); } } } /** * Compile a LESS file into CSS and add it to the page generated by the CMS. * This method has integrated cache support. The compiled LESS files will be * written to the media/lib_fof/compiled directory of your site. If the file * cannot be written we will use the $altPath, if specified * * @param string $path A fancy path definition understood by parsePath pointing to the source LESS file * @param string $altPath A fancy path definition understood by parsePath pointing to a precompiled CSS file, * used when we can't write the generated file to the output directory * @param boolean $returnPath Return the URL of the generated CSS file but do not include it. If it can't be * generated, false is returned and the alt files are not included * * @see FOFTemplateUtils::parsePath * * @since 2.0 * * @return mixed True = successfully included generated CSS, False = the alternate CSS file was used, null = the source file does not exist */ public static function addLESS($path, $altPath = null, $returnPath = false) { // Does the cache directory exists and is writeable static $sanityCheck = null; // Get the local LESS file $localFile = self::parsePath($path, true); $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); $platformDirs = FOFPlatform::getInstance()->getPlatformBaseDirs(); if (is_null($sanityCheck)) { // Make sure the cache directory exists if (!is_dir($platformDirs['public'] . '/media/lib_fof/compiled/')) { $sanityCheck = $filesystem->folderCreate($platformDirs['public'] . '/media/lib_fof/compiled/'); } else { $sanityCheck = true; } } // No point continuing if the source file is not there or we can't write to the cache if (!$sanityCheck || !is_file($localFile)) { if (!$returnPath) { if (is_string($altPath)) { self::addCSS($altPath); } elseif (is_array($altPath)) { foreach ($altPath as $anAltPath) { self::addCSS($anAltPath); } } } return false; } // Get the source file's unique ID $id = md5(filemtime($localFile) . filectime($localFile) . $localFile); // Get the cached file path $cachedPath = $platformDirs['public'] . '/media/lib_fof/compiled/' . $id . '.css'; // Get the LESS compiler $lessCompiler = new FOFLess; $lessCompiler->formatterName = 'compressed'; // Should I add an alternative import path? $altFiles = self::getAltPaths($path); if (isset($altFiles['alternate'])) { $currentLocation = realpath(dirname($localFile)); $normalLocation = realpath(dirname($altFiles['normal'])); $alternateLocation = realpath(dirname($altFiles['alternate'])); if ($currentLocation == $normalLocation) { $lessCompiler->importDir = array($alternateLocation, $currentLocation); } else { $lessCompiler->importDir = array($currentLocation, $normalLocation); } } // Compile the LESS file $lessCompiler->checkedCompile($localFile, $cachedPath); // Add the compiled CSS to the page $base_url = rtrim(FOFPlatform::getInstance()->URIbase(), '/'); if (substr($base_url, -14) == '/administrator') { $base_url = substr($base_url, 0, -14); } $url = $base_url . '/media/lib_fof/compiled/' . $id . '.css'; if ($returnPath) { return $url; } else { $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { if (method_exists($document, 'addStyleSheet')) { $document->addStyleSheet($url); } } return true; } } /** * Creates a SEF compatible sort header. Standard Joomla function will add a href="#" tag, so with SEF * enabled, the browser will follow the fake link instead of processing the onSubmit event; so we * need a fix. * * @param string $text Header text * @param string $field Field used for sorting * @param FOFUtilsObject $list Object holding the direction and the ordering field * * @return string HTML code for sorting */ public static function sefSort($text, $field, $list) { $sort = JHTML::_('grid.sort', JText::_(strtoupper($text)) . ' ', $field, $list->order_Dir, $list->order); return str_replace('href="#"', 'href="javascript:void(0);"', $sort); } /** * Parse a fancy path definition into a path relative to the site's root, * respecting template overrides, suitable for inclusion of media files. * For example, media://com_foobar/css/test.css is parsed into * media/com_foobar/css/test.css if no override is found, or * templates/mytemplate/media/com_foobar/css/test.css if the current * template is called mytemplate and there's a media override for it. * * The valid protocols are: * media:// The media directory or a media override * admin:// Path relative to administrator directory (no overrides) * site:// Path relative to site's root (no overrides) * * @param string $path Fancy path * @param boolean $localFile When true, it returns the local path, not the URL * * @return string Parsed path */ public static function parsePath($path, $localFile = false) { $platformDirs = FOFPlatform::getInstance()->getPlatformBaseDirs(); if ($localFile) { $url = rtrim($platformDirs['root'], DIRECTORY_SEPARATOR) . '/'; } else { $url = FOFPlatform::getInstance()->URIroot(); } $altPaths = self::getAltPaths($path); $filePath = $altPaths['normal']; // If JDEBUG is enabled, prefer that path, else prefer an alternate path if present if (defined('JDEBUG') && JDEBUG && isset($altPaths['debug'])) { if (file_exists($platformDirs['public'] . '/' . $altPaths['debug'])) { $filePath = $altPaths['debug']; } } elseif (isset($altPaths['alternate'])) { if (file_exists($platformDirs['public'] . '/' . $altPaths['alternate'])) { $filePath = $altPaths['alternate']; } } $url .= $filePath; return $url; } /** * Parse a fancy path definition into a path relative to the site's root. * It returns both the normal and alternative (template media override) path. * For example, media://com_foobar/css/test.css is parsed into * array( * 'normal' => 'media/com_foobar/css/test.css', * 'alternate' => 'templates/mytemplate/media/com_foobar/css//test.css' * ); * * The valid protocols are: * media:// The media directory or a media override * admin:// Path relative to administrator directory (no alternate) * site:// Path relative to site's root (no alternate) * * @param string $path Fancy path * * @return array Array of normal and alternate parsed path */ public static function getAltPaths($path) { $protoAndPath = explode('://', $path, 2); if (count($protoAndPath) < 2) { $protocol = 'media'; } else { $protocol = $protoAndPath[0]; $path = $protoAndPath[1]; } $path = ltrim($path, '/' . DIRECTORY_SEPARATOR); switch ($protocol) { case 'media': // Do we have a media override in the template? $pathAndParams = explode('?', $path, 2); $ret = array( 'normal' => 'media/' . $pathAndParams[0], 'alternate' => FOFPlatform::getInstance()->getTemplateOverridePath('media:/' . $pathAndParams[0], false), ); break; case 'admin': $ret = array( 'normal' => 'administrator/' . $path ); break; default: case 'site': $ret = array( 'normal' => $path ); break; } // For CSS and JS files, add a debug path if the supplied file is compressed $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); $ext = $filesystem->getExt($ret['normal']); if (in_array($ext, array('css', 'js'))) { $file = basename($filesystem->stripExt($ret['normal'])); /* * Detect if we received a file in the format name.min.ext * If so, strip the .min part out, otherwise append -uncompressed */ if (strlen($file) > 4 && strrpos($file, '.min', '-4')) { $position = strrpos($file, '.min', '-4'); $filename = str_replace('.min', '.', $file, $position) . $ext; } else { $filename = $file . '-uncompressed.' . $ext; } // Clone the $ret array so we can manipulate the 'normal' path a bit $t1 = (object) $ret; $temp = clone $t1; unset($t1); $temp = (array)$temp; $normalPath = explode('/', $temp['normal']); array_pop($normalPath); $normalPath[] = $filename; $ret['debug'] = implode('/', $normalPath); } return $ret; } /** * Returns the contents of a module position * * @param string $position The position name, e.g. "position-1" * @param int $style Rendering style; please refer to Joomla!'s code for more information * * @return string The contents of the module position */ public static function loadPosition($position, $style = -2) { $document = FOFPlatform::getInstance()->getDocument(); if (!($document instanceof JDocument)) { return ''; } if (!method_exists($document, 'loadRenderer')) { return ''; } try { $renderer = $document->loadRenderer('module'); } catch (Exception $exc) { return ''; } $params = array('style' => $style); $contents = ''; foreach (JModuleHelper::getModules($position) as $mod) { $contents .= $renderer->render($mod, $params); } return $contents; } /** * Merges the current url with new or changed parameters. * * This method merges the route string with the url parameters defined * in current url. The parameters defined in current url, but not given * in route string, will automatically reused in the resulting url. * But only these following parameters will be reused: * * option, view, layout, format * * Example: * * Assuming that current url is: * http://fobar.com/index.php?option=com_foo&view=cpanel * * <code> * <?php echo FOFTemplateutils::route('view=categories&layout=tree'); ?> * </code> * * Result: * http://fobar.com/index.php?option=com_foo&view=categories&layout=tree * * @param string $route The parameters string * * @return string The human readable, complete url */ public static function route($route = '') { $route = trim($route); // Special cases if ($route == 'index.php' || $route == 'index.php?') { $result = $route; } elseif (substr($route, 0, 1) == '&') { $url = JURI::getInstance(); $vars = array(); parse_str($route, $vars); $url->setQuery(array_merge($url->getQuery(true), $vars)); $result = 'index.php?' . $url->getQuery(); } else { $url = JURI::getInstance(); $props = $url->getQuery(true); // Strip 'index.php?' if (substr($route, 0, 10) == 'index.php?') { $route = substr($route, 10); } // Parse route $parts = array(); parse_str($route, $parts); $result = array(); // Check to see if there is component information in the route if not add it if (!isset($parts['option']) && isset($props['option'])) { $result[] = 'option=' . $props['option']; } // Add the layout information to the route only if it's not 'default' if (!isset($parts['view']) && isset($props['view'])) { $result[] = 'view=' . $props['view']; if (!isset($parts['layout']) && isset($props['layout'])) { $result[] = 'layout=' . $props['layout']; } } // Add the format information to the URL only if it's not 'html' if (!isset($parts['format']) && isset($props['format']) && $props['format'] != 'html') { $result[] = 'format=' . $props['format']; } // Reconstruct the route if (!empty($route)) { $result[] = $route; } $result = 'index.php?' . implode('&', $result); } return JRoute::_($result); } } PK���\�$~�libraries/fof/version.txtnu�[���2.4.3 2015-04-22 13:15:32PK���\��d:libraries/fof/integration/joomla/filesystem/filesystem.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage platformFilesystem * @copyright Copyright (C) 2010 - 2015 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; class FOFIntegrationJoomlaFilesystem extends FOFPlatformFilesystem implements FOFPlatformFilesystemInterface { public function __construct() { if (class_exists('JLoader')) { JLoader::import('joomla.filesystem.path'); JLoader::import('joomla.filesystem.folder'); JLoader::import('joomla.filesystem.file'); } } /** * Does the file exists? * * @param $path string Path to the file to test * * @return bool */ public function fileExists($path) { return JFile::exists($path); } /** * Delete a file or array of files * * @param mixed $file The file name or an array of file names * * @return boolean True on success * */ public function fileDelete($file) { return JFile::delete($file); } /** * Copies a file * * @param string $src The path to the source file * @param string $dest The path to the destination file * @param string $path An optional base path to prefix to the file names * @param boolean $use_streams True to use streams * * @return boolean True on success */ public function fileCopy($src, $dest, $path = null, $use_streams = false) { return JFile::copy($src, $dest, $path, $use_streams); } /** * Write contents to a file * * @param string $file The full file path * @param string &$buffer The buffer to write * @param boolean $use_streams Use streams * * @return boolean True on success */ public function fileWrite($file, &$buffer, $use_streams = false) { return JFile::write($file, $buffer, $use_streams); } /** * Checks for snooping outside of the file system root. * * @param string $path A file system path to check. * * @return string A cleaned version of the path or exit on error. * * @throws Exception */ public function pathCheck($path) { return JPath::check($path); } /** * Function to strip additional / or \ in a path name. * * @param string $path The path to clean. * @param string $ds Directory separator (optional). * * @return string The cleaned path. * * @throws UnexpectedValueException */ public function pathClean($path, $ds = DIRECTORY_SEPARATOR) { return JPath::clean($path, $ds); } /** * Searches the directory paths for a given file. * * @param mixed $paths An path string or array of path strings to search in * @param string $file The file name to look for. * * @return mixed The full path and file name for the target file, or boolean false if the file is not found in any of the paths. */ public function pathFind($paths, $file) { return JPath::find($paths, $file); } /** * Wrapper for the standard file_exists function * * @param string $path Folder name relative to installation dir * * @return boolean True if path is a folder */ public function folderExists($path) { return JFolder::exists($path); } /** * Utility function to read the files in a folder. * * @param string $path The path of the folder to read. * @param string $filter A filter for file names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $full True to return the full path to the file. * @param array $exclude Array with names of files which should not be shown in the result. * @param array $excludefilter Array of filter to exclude * @param boolean $naturalSort False for asort, true for natsort * * @return array Files in the given folder. */ public function folderFiles($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*', '.*~'), $naturalSort = false) { return JFolder::files($path, $filter, $recurse, $full, $exclude, $excludefilter, $naturalSort); } /** * Utility function to read the folders in a folder. * * @param string $path The path of the folder to read. * @param string $filter A filter for folder names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $full True to return the full path to the folders. * @param array $exclude Array with names of folders which should not be shown in the result. * @param array $excludefilter Array with regular expressions matching folders which should not be shown in the result. * * @return array Folders in the given folder. */ public function folderFolders($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*')) { return JFolder::folders($path, $filter, $recurse, $full, $exclude, $excludefilter); } /** * Create a folder -- and all necessary parent folders. * * @param string $path A path to create from the base path. * @param integer $mode Directory permissions to set for folders created. 0755 by default. * * @return boolean True if successful. */ public function folderCreate($path = '', $mode = 0755) { return JFolder::create($path, $mode); } }PK���\�.Yپ^�^-libraries/fof/integration/joomla/platform.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage platform * @copyright Copyright (C) 2010 - 2015 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; /** * Part of the FOF Platform Abstraction Layer. * * This implements the platform class for Joomla! 2.5 or later * * @package FrameworkOnFramework * @since 2.1 */ class FOFIntegrationJoomlaPlatform extends FOFPlatform implements FOFPlatformInterface { /** * The table and table field cache object, used to speed up database access * * @var JRegistry|null */ private $_cache = null; /** * Public constructor */ public function __construct() { $this->name = 'joomla'; $this->humanReadableName = 'Joomla!'; $this->version = defined('JVERSION') ? JVERSION : '0.0'; } /** * Checks if the current script is run inside a valid CMS execution * * @see FOFPlatformInterface::checkExecution() * * @return bool */ public function checkExecution() { return defined('_JEXEC'); } public function raiseError($code, $message) { if (version_compare($this->version, '3.0', 'ge')) { throw new Exception($message, $code); } else { return JError::raiseError($code, $message); } } /** * Is this platform enabled? * * @see FOFPlatformInterface::isEnabled() * * @return boolean */ public function isEnabled() { if (is_null($this->isEnabled)) { $this->isEnabled = true; // Make sure _JEXEC is defined if (!defined('_JEXEC')) { $this->isEnabled = false; } // We need JVERSION to be defined if ($this->isEnabled) { if (!defined('JVERSION')) { $this->isEnabled = false; } } // Check if JFactory exists if ($this->isEnabled) { if (!class_exists('JFactory')) { $this->isEnabled = false; } } // Check if JApplication exists if ($this->isEnabled) { $appExists = class_exists('JApplication'); $appExists = $appExists || class_exists('JCli'); $appExists = $appExists || class_exists('JApplicationCli'); if (!$appExists) { $this->isEnabled = false; } } } return $this->isEnabled; } /** * Main function to detect if we're running in a CLI environment and we're admin * * @return array isCLI and isAdmin. It's not an associtive array, so we can use list. */ protected function isCliAdmin() { static $isCLI = null; static $isAdmin = null; if (is_null($isCLI) && is_null($isAdmin)) { try { if (is_null(JFactory::$application)) { $isCLI = true; } else { $app = JFactory::getApplication(); $isCLI = $app instanceof JException || $app instanceof JApplicationCli; } } catch (Exception $e) { $isCLI = true; } if ($isCLI) { $isAdmin = false; } else { $isAdmin = !JFactory::$application ? false : JFactory::getApplication()->isAdmin(); } } return array($isCLI, $isAdmin); } /** * Returns absolute path to directories used by the CMS. * * @see FOFPlatformInterface::getPlatformBaseDirs() * * @return array A hash array with keys root, public, admin, tmp and log. */ public function getPlatformBaseDirs() { return array( 'root' => JPATH_ROOT, 'public' => JPATH_SITE, 'admin' => JPATH_ADMINISTRATOR, 'tmp' => JFactory::getConfig()->get('tmp_dir'), 'log' => JFactory::getConfig()->get('log_dir') ); } /** * Returns the base (root) directories for a given component. * * @param string $component The name of the component. For Joomla! this * is something like "com_example" * * @see FOFPlatformInterface::getComponentBaseDirs() * * @return array A hash array with keys main, alt, site and admin. */ public function getComponentBaseDirs($component) { if ($this->isFrontend()) { $mainPath = JPATH_SITE . '/components/' . $component; $altPath = JPATH_ADMINISTRATOR . '/components/' . $component; } else { $mainPath = JPATH_ADMINISTRATOR . '/components/' . $component; $altPath = JPATH_SITE . '/components/' . $component; } return array( 'main' => $mainPath, 'alt' => $altPath, 'site' => JPATH_SITE . '/components/' . $component, 'admin' => JPATH_ADMINISTRATOR . '/components/' . $component, ); } /** * Return a list of the view template paths for this component. * * @param string $component The name of the component. For Joomla! this * is something like "com_example" * @param string $view The name of the view you're looking a * template for * @param string $layout The layout name to load, e.g. 'default' * @param string $tpl The sub-template name to load (null by default) * @param boolean $strict If true, only the specified layout will be searched for. * Otherwise we'll fall back to the 'default' layout if the * specified layout is not found. * * @see FOFPlatformInterface::getViewTemplateDirs() * * @return array */ public function getViewTemplatePaths($component, $view, $layout = 'default', $tpl = null, $strict = false) { $isAdmin = $this->isBackend(); $basePath = $isAdmin ? 'admin:' : 'site:'; $basePath .= $component . '/'; $altBasePath = $basePath; $basePath .= $view . '/'; $altBasePath .= (FOFInflector::isSingular($view) ? FOFInflector::pluralize($view) : FOFInflector::singularize($view)) . '/'; if ($strict) { $paths = array( $basePath . $layout . ($tpl ? "_$tpl" : ''), $altBasePath . $layout . ($tpl ? "_$tpl" : ''), ); } else { $paths = array( $basePath . $layout . ($tpl ? "_$tpl" : ''), $basePath . $layout, $basePath . 'default' . ($tpl ? "_$tpl" : ''), $basePath . 'default', $altBasePath . $layout . ($tpl ? "_$tpl" : ''), $altBasePath . $layout, $altBasePath . 'default' . ($tpl ? "_$tpl" : ''), $altBasePath . 'default', ); $paths = array_unique($paths); } return $paths; } /** * Get application-specific suffixes to use with template paths. This allows * you to look for view template overrides based on the application version. * * @return array A plain array of suffixes to try in template names */ public function getTemplateSuffixes() { $jversion = new JVersion; $versionParts = explode('.', $jversion->RELEASE); $majorVersion = array_shift($versionParts); $suffixes = array( '.j' . str_replace('.', '', $jversion->getHelpVersion()), '.j' . $majorVersion, ); return $suffixes; } /** * Return the absolute path to the application's template overrides * directory for a specific component. We will use it to look for template * files instead of the regular component directorues. If the application * does not have such a thing as template overrides return an empty string. * * @param string $component The name of the component for which to fetch the overrides * @param boolean $absolute Should I return an absolute or relative path? * * @return string The path to the template overrides directory */ public function getTemplateOverridePath($component, $absolute = true) { list($isCli, $isAdmin) = $this->isCliAdmin(); if (!$isCli) { if ($absolute) { $path = JPATH_THEMES . '/'; } else { $path = $isAdmin ? 'administrator/templates/' : 'templates/'; } if (substr($component, 0, 7) == 'media:/') { $directory = 'media/' . substr($component, 7); } else { $directory = 'html/' . $component; } $path .= JFactory::getApplication()->getTemplate() . '/' . $directory; } else { $path = ''; } return $path; } /** * Load the translation files for a given component. * * @param string $component The name of the component. For Joomla! this * is something like "com_example" * * @see FOFPlatformInterface::loadTranslations() * * @return void */ public function loadTranslations($component) { if ($this->isBackend()) { $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR); } else { $paths = array(JPATH_ADMINISTRATOR, JPATH_ROOT); } $jlang = JFactory::getLanguage(); $jlang->load($component, $paths[0], 'en-GB', true); $jlang->load($component, $paths[0], null, true); $jlang->load($component, $paths[1], 'en-GB', true); $jlang->load($component, $paths[1], null, true); } /** * Authorise access to the component in the back-end. * * @param string $component The name of the component. * * @see FOFPlatformInterface::authorizeAdmin() * * @return boolean True to allow loading the component, false to halt loading */ public function authorizeAdmin($component) { if ($this->isBackend()) { // Master access check for the back-end, Joomla! 1.6 style. $user = JFactory::getUser(); if (!$user->authorise('core.manage', $component) && !$user->authorise('core.admin', $component)) { return false; } } return true; } /** * Return a user object. * * @param integer $id The user ID to load. Skip or use null to retrieve * the object for the currently logged in user. * * @see FOFPlatformInterface::getUser() * * @return JUser The JUser object for the specified user */ public function getUser($id = null) { return JFactory::getUser($id); } /** * Returns the JDocument object which handles this component's response. * * @see FOFPlatformInterface::getDocument() * * @return JDocument */ public function getDocument() { $document = null; if (!$this->isCli()) { try { $document = JFactory::getDocument(); } catch (Exception $exc) { $document = null; } } return $document; } /** * Returns an object to handle dates * * @param mixed $time The initial time * @param null $tzOffest The timezone offset * @param bool $locale Should I try to load a specific class for current language? * * @return JDate object */ public function getDate($time = 'now', $tzOffest = null, $locale = true) { if($locale) { return JFactory::getDate($time, $tzOffest); } else { return new JDate($time, $tzOffest); } } public function getLanguage() { return JFactory::getLanguage(); } public function getDbo() { return JFactory::getDbo(); } /** * This method will try retrieving a variable from the request (input) data. * * @param string $key The user state key for the variable * @param string $request The request variable name for the variable * @param FOFInput $input The FOFInput object with the request (input) data * @param mixed $default The default value. Default: null * @param string $type The filter type for the variable data. Default: none (no filtering) * @param boolean $setUserState Should I set the user state with the fetched value? * * @see FOFPlatformInterface::getUserStateFromRequest() * * @return mixed The value of the variable */ public function getUserStateFromRequest($key, $request, $input, $default = null, $type = 'none', $setUserState = true) { list($isCLI, $isAdmin) = $this->isCliAdmin(); if ($isCLI) { return $input->get($request, $default, $type); } $app = JFactory::getApplication(); if (method_exists($app, 'getUserState')) { $old_state = $app->getUserState($key, $default); } else { $old_state = null; } $cur_state = (!is_null($old_state)) ? $old_state : $default; $new_state = $input->get($request, null, $type); // Save the new value only if it was set in this request if ($setUserState) { if ($new_state !== null) { $app->setUserState($key, $new_state); } else { $new_state = $cur_state; } } elseif (is_null($new_state)) { $new_state = $cur_state; } return $new_state; } /** * Load plugins of a specific type. Obviously this seems to only be required * in the Joomla! CMS. * * @param string $type The type of the plugins to be loaded * * @see FOFPlatformInterface::importPlugin() * * @return void */ public function importPlugin($type) { if (!$this->isCli()) { JLoader::import('joomla.plugin.helper'); JPluginHelper::importPlugin($type); } } /** * Execute plugins (system-level triggers) and fetch back an array with * their return values. * * @param string $event The event (trigger) name, e.g. onBeforeScratchMyEar * @param array $data A hash array of data sent to the plugins as part of the trigger * * @see FOFPlatformInterface::runPlugins() * * @return array A simple array containing the results of the plugins triggered */ public function runPlugins($event, $data) { if (!$this->isCli()) { // IMPORTANT: DO NOT REPLACE THIS INSTANCE OF JDispatcher WITH ANYTHING ELSE. WE NEED JOOMLA!'S PLUGIN EVENT // DISPATCHER HERE, NOT OUR GENERIC EVENTS DISPATCHER if (version_compare($this->version, '3.0', 'ge')) { $dispatcher = JEventDispatcher::getInstance(); } else { $dispatcher = JDispatcher::getInstance(); } return $dispatcher->trigger($event, $data); } else { return array(); } } /** * Perform an ACL check. * * @param string $action The ACL privilege to check, e.g. core.edit * @param string $assetname The asset name to check, typically the component's name * * @see FOFPlatformInterface::authorise() * * @return boolean True if the user is allowed this action */ public function authorise($action, $assetname) { if ($this->isCli()) { return true; } return JFactory::getUser()->authorise($action, $assetname); } /** * Is this the administrative section of the component? * * @see FOFPlatformInterface::isBackend() * * @return boolean */ public function isBackend() { list ($isCli, $isAdmin) = $this->isCliAdmin(); return $isAdmin && !$isCli; } /** * Is this the public section of the component? * * @see FOFPlatformInterface::isFrontend() * * @return boolean */ public function isFrontend() { list ($isCli, $isAdmin) = $this->isCliAdmin(); return !$isAdmin && !$isCli; } /** * Is this a component running in a CLI application? * * @see FOFPlatformInterface::isCli() * * @return boolean */ public function isCli() { list ($isCli, $isAdmin) = $this->isCliAdmin(); return !$isAdmin && $isCli; } /** * Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All * other platforms should return false and never ask why. * * @see FOFPlatformInterface::supportsAjaxOrdering() * * @return boolean */ public function supportsAjaxOrdering() { return version_compare(JVERSION, '3.0', 'ge'); } /** * Is the global FOF cache enabled? * * @return boolean */ public function isGlobalFOFCacheEnabled() { return !(defined('JDEBUG') && JDEBUG); } /** * Saves something to the cache. This is supposed to be used for system-wide * FOF data, not application data. * * @param string $key The key of the data to save * @param string $content The actual data to save * * @return boolean True on success */ public function setCache($key, $content) { $registry = $this->getCacheObject(); $registry->set($key, $content); return $this->saveCache(); } /** * Retrieves data from the cache. This is supposed to be used for system-side * FOF data, not application data. * * @param string $key The key of the data to retrieve * @param string $default The default value to return if the key is not found or the cache is not populated * * @return string The cached value */ public function getCache($key, $default = null) { $registry = $this->getCacheObject(); return $registry->get($key, $default); } /** * Gets a reference to the cache object, loading it from the disk if * needed. * * @param boolean $force Should I forcibly reload the registry? * * @return JRegistry */ private function &getCacheObject($force = false) { // Check if we have to load the cache file or we are forced to do that if (is_null($this->_cache) || $force) { // Create a new JRegistry object JLoader::import('joomla.registry.registry'); $this->_cache = new JRegistry; // Try to get data from Joomla!'s cache $cache = JFactory::getCache('fof', ''); $data = $cache->get('cache', 'fof'); // If data is not found, fall back to the legacy (FOF 2.1.rc3 and earlier) method if ($data === false) { // Find the path to the file $cachePath = JPATH_CACHE . '/fof'; $filename = $cachePath . '/cache.php'; $filesystem = $this->getIntegrationObject('filesystem'); // Load the cache file if it exists. JRegistryFormatPHP fails // miserably, so I have to work around it. if ($filesystem->fileExists($filename)) { @include_once $filename; $filesystem->fileDelete($filename); $className = 'FOFCacheStorage'; if (class_exists($className)) { $object = new $className; $this->_cache->loadObject($object); $options = array( 'class' => 'FOFCacheStorage' ); $cache->store($this->_cache, 'cache', 'fof'); } } } else { $this->_cache = $data; } } return $this->_cache; } /** * Save the cache object back to disk * * @return boolean True on success */ private function saveCache() { // Get the JRegistry object of our cached data $registry = $this->getCacheObject(); $cache = JFactory::getCache('fof', ''); return $cache->store($registry, 'cache', 'fof'); } /** * Clears the cache of system-wide FOF data. You are supposed to call this in * your components' installation script post-installation and post-upgrade * methods or whenever you are modifying the structure of database tables * accessed by FOF. Please note that FOF's cache never expires and is not * purged by Joomla!. You MUST use this method to manually purge the cache. * * @return boolean True on success */ public function clearCache() { $false = false; $cache = JFactory::getCache('fof', ''); $cache->store($false, 'cache', 'fof'); } public function getConfig() { return JFactory::getConfig(); } /** * logs in a user * * @param array $authInfo authentification information * * @return boolean True on success */ public function loginUser($authInfo) { JLoader::import('joomla.user.authentication'); $options = array('remember' => false); $authenticate = JAuthentication::getInstance(); $response = $authenticate->authenticate($authInfo, $options); // User failed to authenticate: maybe he enabled two factor authentication? // Let's try again "manually", skipping the check vs two factor auth // Due the big mess with encryption algorithms and libraries, we are doing this extra check only // if we're in Joomla 2.5.18+ or 3.2.1+ if($response->status != JAuthentication::STATUS_SUCCESS && method_exists('JUserHelper', 'verifyPassword')) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('id, password') ->from('#__users') ->where('username=' . $db->quote($authInfo['username'])); $result = $db->setQuery($query)->loadObject(); if ($result) { $match = JUserHelper::verifyPassword($authInfo['password'], $result->password, $result->id); if ($match === true) { // Bring this in line with the rest of the system $user = JUser::getInstance($result->id); $response->email = $user->email; $response->fullname = $user->name; if (JFactory::getApplication()->isAdmin()) { $response->language = $user->getParam('admin_language'); } else { $response->language = $user->getParam('language'); } $response->status = JAuthentication::STATUS_SUCCESS; $response->error_message = ''; } } } if ($response->status == JAuthentication::STATUS_SUCCESS) { $this->importPlugin('user'); $results = $this->runPlugins('onLoginUser', array((array) $response, $options)); JLoader::import('joomla.user.helper'); $userid = JUserHelper::getUserId($response->username); $user = $this->getUser($userid); $session = JFactory::getSession(); $session->set('user', $user); return true; } return false; } /** * logs out a user * * @return boolean True on success */ public function logoutUser() { JLoader::import('joomla.user.authentication'); $app = JFactory::getApplication(); $options = array('remember' => false); $parameters = array('username' => $this->getUser()->username); return $app->triggerEvent('onLogoutUser', array($parameters, $options)); } public function logAddLogger($file) { JLog::addLogger(array('text_file' => $file), JLog::ALL, array('fof')); } /** * Logs a deprecated practice. In Joomla! this results in the $message being output in the * deprecated log file, found in your site's log directory. * * @param string $message The deprecated practice log message * * @return void */ public function logDeprecated($message) { JLog::add($message, JLog::WARNING, 'deprecated'); } public function logDebug($message) { JLog::add($message, JLog::DEBUG, 'fof'); } /** * Returns the root URI for the request. * * @param boolean $pathonly If false, prepend the scheme, host and port information. Default is false. * @param string $path The path * * @return string The root URI string. */ public function URIroot($pathonly = false, $path = null) { JLoader::import('joomla.environment.uri'); return JUri::root($pathonly, $path); } /** * Returns the base URI for the request. * * @param boolean $pathonly If false, prepend the scheme, host and port information. Default is false. * | * @return string The base URI string */ public function URIbase($pathonly = false) { JLoader::import('joomla.environment.uri'); return JUri::base($pathonly); } /** * Method to set a response header. If the replace flag is set then all headers * with the given name will be replaced by the new one (only if the current platform supports header caching) * * @param string $name The name of the header to set. * @param string $value The value of the header to set. * @param boolean $replace True to replace any headers with the same name. * * @return void */ public function setHeader($name, $value, $replace = false) { if (version_compare($this->version, '3.2', 'ge')) { JFactory::getApplication()->setHeader($name, $value, $replace); } else { JResponse::setHeader($name, $value, $replace); } } public function sendHeaders() { if (version_compare($this->version, '3.2', 'ge')) { JFactory::getApplication()->sendHeaders(); } else { JResponse::sendHeaders(); } } } PK���\���DAA libraries/fof/model/behavior.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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. It defines the events which are * called by a Model. * * @codeCoverageIgnore * @package FrameworkOnFramework * @since 2.1 */ abstract class FOFModelBehavior extends FOFUtilsObservableEvent { /** * This event runs before saving data in the model * * @param FOFModel &$model The model which calls this event * @param array &$data The data to save * * @return void */ public function onBeforeSave(&$model, &$data) { } /** * This event runs before deleting a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onBeforeDelete(&$model) { } /** * This event runs before copying a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onBeforeCopy(&$model) { } /** * This event runs before publishing a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onBeforePublish(&$model) { } /** * This event runs before registering a hit on a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onBeforeHit(&$model) { } /** * This event runs before moving a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onBeforeMove(&$model) { } /** * This event runs before changing the records' order in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onBeforeReorder(&$model) { } /** * This event runs when we are building the query used to fetch a record * list in a model * * @param FOFModel &$model The model which calls this event * @param JDatabaseQuery &$query The query being built * * @return void */ public function onBeforeBuildQuery(&$model, &$query) { } /** * This event runs after saving a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onAfterSave(&$model) { } /** * This event runs after deleting a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onAfterDelete(&$model) { } /** * This event runs after copying a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onAfterCopy(&$model) { } /** * This event runs after publishing a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onAfterPublish(&$model) { } /** * This event runs after registering a hit on a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onAfterHit(&$model) { } /** * This event runs after moving a record in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onAfterMove(&$model) { } /** * This event runs after reordering records in a model * * @param FOFModel &$model The model which calls this event * * @return void */ public function onAfterReorder(&$model) { } /** * This event runs after we have built the query used to fetch a record * list in a model * * @param FOFModel &$model The model which calls this event * @param JDatabaseQuery &$query The query being built * * @return void */ public function onAfterBuildQuery(&$model, &$query) { } /** * This event runs after getting a single item * * @param FOFModel &$model The model which calls this event * @param FOFTable &$record The record loaded by this model * * @return void */ public function onAfterGetItem(&$model, &$record) { } } PK���\�2"� � libraries/fof/model/field.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 */ abstract class FOFModelField { protected $_db = null; /** * The column name of the table field * * @var string */ protected $name = ''; /** * The column type of the table field * * @var string */ protected $type = ''; /** * The alias of the table used for filtering * * @var string */ protected $table_alias = false; /** * The null value for this type * * @var mixed */ public $null_value = null; /** * Constructor * * @param JDatabaseDriver $db The database object * @param object $field The field informations as taken from the db * @param string $table_alias The table alias to use when filtering */ public function __construct($db, $field, $table_alias = false) { $this->_db = $db; $this->name = $field->name; $this->type = $field->type; $this->filterzero = $field->filterzero; $this->table_alias = $table_alias; } /** * Is it a null or otherwise empty value? * * @param mixed $value The value to test for emptiness * * @return boolean */ public function isEmpty($value) { return (($value === $this->null_value) || empty($value)) && !($this->filterzero && $value === "0"); } /** * Returns the default search method for a field. This always returns 'exact' * and you are supposed to override it in specialised classes. The possible * values are exact, partial, between and outside, unless something * different is returned by getSearchMethods(). * * @see self::getSearchMethods() * * @return string */ public function getDefaultSearchMethod() { return 'exact'; } /** * Return the search methods available for this field class, * * @return array */ public function getSearchMethods() { $ignore = array('isEmpty', 'getField', 'getFieldType', '__construct', 'getDefaultSearchMethod', 'getSearchMethods'); $class = new ReflectionClass(__CLASS__); $methods = $class->getMethods(ReflectionMethod::IS_PUBLIC); $tmp = array(); foreach ($methods as $method) { $tmp[] = $method->name; } $methods = $tmp; if ($methods = array_diff($methods, $ignore)) { return $methods; } return array(); } /** * Perform an exact match (equality matching) * * @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 ''; } if (is_array($value)) { $db = FOFPlatform::getInstance()->getDbo(); $value = array_map(array($db, 'quote'), $value); return '(' . $this->getFieldName() . ' IN (' . implode(',', $value) . '))'; } else { return $this->search($value, '='); } } /** * Perform a partial match (usually: search in string) * * @param mixed $value The value to compare to * * @return string The SQL where clause for this search */ abstract public function partial($value); /** * Perform a between limits match (usually: search for a value between * two numbers or a date between two preset dates). 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 */ abstract public function between($from, $to, $include = true); /** * Perform an outside limits match (usually: search for a value outside an * area or a date outside a preset period). 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 */ abstract public function outside($from, $to, $include = false); /** * Perform an interval search (usually: a date interval check) * * @param string $from The value to search * @param string|array|object $interval The interval * * @return string The SQL where clause for this search */ abstract public function interval($from, $interval); /** * Perform a between limits match (usually: search for a value between * two numbers or a date between two preset dates). 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 */ abstract public function range($from, $to, $include = true); /** * Perform an modulo search * * @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 */ abstract public function modulo($from, $interval, $include = true); /** * Return the SQL where clause for a search * * @param mixed $value The value to search for * @param string $operator The operator to use * * @return string The SQL where clause for this search */ public function search($value, $operator = '=') { if ($this->isEmpty($value)) { return ''; } return '(' . $this->getFieldName() . ' ' . $operator . ' ' . $this->_db->quote($value) . ')'; } /** * Get the field name with the given table alias * * @return string The field name */ public function getFieldName() { $name = $this->_db->qn($this->name); if ($this->table_alias) { $name = $this->_db->qn($this->table_alias) . '.' . $name; } return $name; } /** * Creates a field Object based on the field column type * * @param object $field The field informations * @param array $config The field configuration (like the db object to use) * * @return FOFModelField The Field object */ public static function getField($field, $config = array()) { $type = $field->type; $classType = self::getFieldType($type); $className = 'FOFModelField' . $classType; if (class_exists($className)) { if (isset($config['dbo'])) { $db = $config['dbo']; } else { $db = FOFPlatform::getInstance()->getDbo(); } if (isset($config['table_alias'])) { $table_alias = $config['table_alias']; } else { $table_alias = false; } $field = new $className($db, $field, $table_alias); return $field; } return false; } /** * Get the classname based on the field Type * * @param string $type The type of the field * * @return string the class suffix */ public static function getFieldType($type) { switch ($type) { case 'varchar': case 'text': case 'smalltext': case 'longtext': case 'char': case 'mediumtext': case 'character varying': case 'nvarchar': case 'nchar': $type = 'Text'; break; case 'date': case 'datetime': case 'time': case 'year': case 'timestamp': case 'timestamp without time zone': case 'timestamp with time zone': $type = 'Date'; break; case 'tinyint': case 'smallint': $type = 'Boolean'; break; default: $type = 'Number'; break; } return $type; } } PK���\�,v�+libraries/fof/model/dispatcher/behavior.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 dispatcher class * * @package FrameworkOnFramework * @since 2.1 */ class FOFModelDispatcherBehavior extends FOFUtilsObservableDispatcher { } PK���\;�@�� � libraries/fof/model/model.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 class. The Model is the workhorse. It performs all * of the business logic based on its state and then returns the raw (processed) * data to the caller, or modifies its own state. It's important to note that * the model doesn't get data directly from the request (this is the * Controller's business) and that it doesn't output anything (that the View's * business). * * @package FrameworkOnFramework * @since 1.0 */ class FOFModel extends FOFUtilsObject { /** * Indicates if the internal state has been set * * @var boolean * @since 12.2 */ protected $__state_set = null; /** * Database Connector * * @var object * @since 12.2 */ protected $_db; /** * The event to trigger after deleting the data. * @var string */ protected $event_after_delete = 'onContentAfterDelete'; /** * The event to trigger after saving the data. * @var string */ protected $event_after_save = 'onContentAfterSave'; /** * The event to trigger before deleting the data. * @var string */ protected $event_before_delete = 'onContentBeforeDelete'; /** * The event to trigger before saving the data. * @var string */ protected $event_before_save = 'onContentBeforeSave'; /** * The event to trigger after changing the published state of the data. * @var string */ protected $event_change_state = 'onContentChangeState'; /** * The event to trigger when cleaning cache. * * @var string * @since 12.2 */ protected $event_clean_cache = null; /** * Stores a list of IDs passed to the model's state * @var array */ protected $id_list = array(); /** * The first row ID passed to the model's state * @var int */ protected $id = null; /** * Input variables, passed on from the controller, in an associative array * @var FOFInput */ protected $input = array(); /** * The list of records made available through getList * @var array */ protected $list = null; /** * The model (base) name * * @var string * @since 12.2 */ protected $name; /** * The URL option for the component. * * @var string * @since 12.2 */ protected $option = null; /** * The table object, populated when saving data * @var FOFTable */ protected $otable = null; /** * Pagination object * @var JPagination */ protected $pagination = null; /** * The table object, populated when retrieving data * @var FOFTable */ protected $record = null; /** * A state object * * @var string * @since 12.2 */ protected $state; /** * The name of the table to use * @var string */ protected $table = null; /** * Total rows based on the filters set in the model's state * @var int */ protected $total = null; /** * Should I save the model's state in the session? * @var bool */ protected $_savestate = null; /** * Array of form objects. * * @var array * @since 2.0 */ protected $_forms = array(); /** * The data to load into a form * * @var array * @since 2.0 */ protected $_formData = array(); /** * An instance of FOFConfigProvider to provision configuration overrides * * @var FOFConfigProvider */ protected $configProvider = null; /** * FOFModelDispatcherBehavior for dealing with extra behaviors * * @var FOFModelDispatcherBehavior */ protected $modelDispatcher = null; /** * Default behaviors to apply to the model * * @var array */ protected $default_behaviors = array('filters'); /** * Behavior parameters * * @var array */ protected $_behaviorParams = array(); /** * Returns a new model object. Unless overriden by the $config array, it will * try to automatically populate its state from the request variables. * * @param string $type Model type, e.g. 'Items' * @param string $prefix Model prefix, e.g. 'FoobarModel' * @param array $config Model configuration variables * * @return FOFModel */ public static function &getAnInstance($type, $prefix = '', $config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $modelClass = $prefix . ucfirst($type); $result = false; // Guess the component name and include path if (!empty($prefix)) { preg_match('/(.*)Model$/', $prefix, $m); $component = 'com_' . strtolower($m[1]); } else { $component = ''; } if (array_key_exists('input', $config)) { if (!($config['input'] instanceof FOFInput)) { if (!is_array($config['input'])) { $config['input'] = (array) $config['input']; } $config['input'] = array_merge($_REQUEST, $config['input']); $config['input'] = new FOFInput($config['input']); } } else { $config['input'] = new FOFInput; } if (empty($component)) { $component = $config['input']->get('option', 'com_foobar'); } $config['option'] = $component; $needsAView = true; if (array_key_exists('view', $config)) { if (!empty($config['view'])) { $needsAView = false; } } if ($needsAView) { $config['view'] = strtolower($type); } $config['input']->set('option', $config['option']); // Get the component directories $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($component); $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); // Try to load the requested model class if (!class_exists($modelClass)) { $include_paths = self::addIncludePath(); $extra_paths = array( $componentPaths['main'] . '/models', $componentPaths['alt'] . '/models' ); $include_paths = array_merge($extra_paths, $include_paths); // Try to load the model file $path = $filesystem->pathFind( $include_paths, self::_createFileName('model', array('name' => $type)) ); if ($path) { require_once $path; } } // Fallback to the Default model class, e.g. FoobarModelDefault if (!class_exists($modelClass)) { $modelClass = $prefix . 'Default'; if (!class_exists($modelClass)) { $include_paths = self::addIncludePath(); $extra_paths = array( $componentPaths['main'] . '/models', $componentPaths['alt'] . '/models' ); $include_paths = array_merge($extra_paths, $include_paths); // Try to load the model file $path = $filesystem->pathFind( $include_paths, self::_createFileName('model', array('name' => 'default')) ); if ($path) { require_once $path; } } } // Fallback to the generic FOFModel model class if (!class_exists($modelClass)) { $modelClass = 'FOFModel'; } $result = new $modelClass($config); return $result; } /** * Adds a behavior to the model * * @param string $name The name of the behavior * @param array $config Optional Behavior configuration * * @return boolean True if the behavior is found and added */ public function addBehavior($name, $config = array()) { // Sanity check: this objects needs a non-null behavior handler if (!is_object($this->modelDispatcher)) { return false; } // Sanity check: this objects needs a behavior handler of the correct class type if (!($this->modelDispatcher instanceof FOFModelDispatcherBehavior)) { return false; } // First look for ComponentnameModelViewnameBehaviorName (e.g. FoobarModelItemsBehaviorFilter) $option_name = str_replace('com_', '', $this->option); $behaviorClass = ucfirst($option_name) . 'Model' . FOFInflector::pluralize($this->name) . 'Behavior' . ucfirst(strtolower($name)); if (class_exists($behaviorClass)) { $behavior = new $behaviorClass($this->modelDispatcher, $config); return true; } // Then look for ComponentnameModelBehaviorName (e.g. FoobarModelBehaviorFilter) $option_name = str_replace('com_', '', $this->option); $behaviorClass = ucfirst($option_name) . 'ModelBehavior' . ucfirst(strtolower($name)); if (class_exists($behaviorClass)) { $behavior = new $behaviorClass($this->modelDispatcher, $config); return true; } // Then look for FOFModelBehaviorName (e.g. FOFModelBehaviorFilter) $behaviorClassAlt = 'FOFModelBehavior' . ucfirst(strtolower($name)); if (class_exists($behaviorClassAlt)) { $behavior = new $behaviorClassAlt($this->modelDispatcher, $config); return true; } // Nothing found? Return false. return false; } /** * Returns a new instance of a model, with the state reset to defaults * * @param string $type Model type, e.g. 'Items' * @param string $prefix Model prefix, e.g. 'FoobarModel' * @param array $config Model configuration variables * * @return FOFModel */ public static function &getTmpInstance($type, $prefix = '', $config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } if (!array_key_exists('savestate', $config)) { $config['savestate'] = false; } $ret = self::getAnInstance($type, $prefix, $config) ->getClone() ->clearState() ->clearInput() ->reset() ->savestate(0) ->limitstart(0) ->limit(0); return $ret; } /** * Add a directory where FOFModel should search for models. You may * either pass a string or an array of directories. * * @param mixed $path A path or array[sting] of paths to search. * @param string $prefix A prefix for models. * * @return array An array with directory elements. If prefix is equal to '', all directories are returned. * * @since 12.2 */ public static function addIncludePath($path = '', $prefix = '') { static $paths; if (!isset($paths)) { $paths = array(); } if (!isset($paths[$prefix])) { $paths[$prefix] = array(); } if (!isset($paths[''])) { $paths[''] = array(); } if (!empty($path)) { $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); if (!in_array($path, $paths[$prefix])) { array_unshift($paths[$prefix], $filesystem->pathClean($path)); } if (!in_array($path, $paths[''])) { array_unshift($paths[''], $filesystem->pathClean($path)); } } return $paths[$prefix]; } /** * Adds to the stack of model table paths in LIFO order. * * @param mixed $path The directory as a string or directories as an array to add. * * @return void * * @since 12.2 */ public static function addTablePath($path) { FOFTable::addIncludePath($path); } /** * Create the filename for a resource * * @param string $type The resource type to create the filename for. * @param array $parts An associative array of filename information. * * @return string The filename * * @since 12.2 */ protected static function _createFileName($type, $parts = array()) { $filename = ''; switch ($type) { case 'model': $filename = strtolower($parts['name']) . '.php'; break; } return $filename; } /** * Public class constructor * * @param array $config The configuration array */ public function __construct($config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } // Get the input if (array_key_exists('input', $config)) { if ($config['input'] instanceof FOFInput) { $this->input = $config['input']; } else { $this->input = new FOFInput($config['input']); } } else { $this->input = new FOFInput; } // Load the configuration provider $this->configProvider = new FOFConfigProvider; // Load the behavior dispatcher $this->modelDispatcher = new FOFModelDispatcherBehavior; // Set the $name/$_name variable $component = $this->input->getCmd('option', 'com_foobar'); if (array_key_exists('option', $config)) { $component = $config['option']; } // Set the $name variable $this->input->set('option', $component); $component = $this->input->getCmd('option', 'com_foobar'); if (array_key_exists('option', $config)) { $component = $config['option']; } $this->input->set('option', $component); $bareComponent = str_replace('com_', '', strtolower($component)); // Get the view name $className = get_class($this); if ($className == 'FOFModel') { if (array_key_exists('view', $config)) { $view = $config['view']; } if (empty($view)) { $view = $this->input->getCmd('view', 'cpanel'); } } else { if (array_key_exists('view', $config)) { $view = $config['view']; } if (empty($view)) { $eliminatePart = ucfirst($bareComponent) . 'Model'; $view = strtolower(str_replace($eliminatePart, '', $className)); } } if (array_key_exists('name', $config)) { $name = $config['name']; } else { $name = $view; } $this->name = $name; $this->option = $component; // Set the model state if (array_key_exists('state', $config)) { $this->state = $config['state']; } else { $this->state = new FOFUtilsObject; } // Set the model dbo if (array_key_exists('dbo', $config)) { $this->_db = $config['dbo']; } else { $this->_db = FOFPlatform::getInstance()->getDbo(); } // Set the default view search path if (array_key_exists('table_path', $config)) { $this->addTablePath($config['table_path']); } else { $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($this->option); $path = $componentPaths['admin'] . '/tables'; $altPath = $this->configProvider->get($this->option . '.views.' . FOFInflector::singularize($this->name) . '.config.table_path', null); if ($altPath) { $path = $componentPaths['main'] . '/' . $altPath; } $this->addTablePath($path); } // Assign the correct table if (array_key_exists('table', $config)) { $this->table = $config['table']; } else { $table = $this->configProvider->get( $this->option . '.views.' . FOFInflector::singularize($this->name) . '.config.table', FOFInflector::singularize($view) ); $this->table = $table; } // Set the internal state marker - used to ignore setting state from the request if (!empty($config['ignore_request']) || !is_null( $this->configProvider->get( $this->option . '.views.' . FOFInflector::singularize($this->name) . '.config.ignore_request', null ) )) { $this->__state_set = true; } // Get and store the pagination request variables $defaultSaveState = array_key_exists('savestate', $config) ? $config['savestate'] : -999; $this->populateSavestate($defaultSaveState); if (FOFPlatform::getInstance()->isCli()) { $limit = 20; $limitstart = 0; } else { $app = JFactory::getApplication(); if (method_exists($app, 'getCfg')) { $default_limit = $app->getCfg('list_limit'); } else { $default_limit = 20; } $limit = $this->getUserStateFromRequest($component . '.' . $view . '.limit', 'limit', $default_limit, 'int', $this->_savestate); $limitstart = $this->getUserStateFromRequest($component . '.' . $view . '.limitstart', 'limitstart', 0, 'int', $this->_savestate); } $this->setState('limit', $limit); $this->setState('limitstart', $limitstart); // Get the ID or list of IDs from the request or the configuration if (array_key_exists('cid', $config)) { $cid = $config['cid']; } elseif ($cid = $this->configProvider->get( $this->option . '.views.' . FOFInflector::singularize($this->name) . '.config.cid', null ) ) { $cid = explode(',', $cid); } else { $cid = $this->input->get('cid', array(), 'array'); } if (array_key_exists('id', $config)) { $id = $config['id']; } elseif ($id = $this->configProvider->get( $this->option . '.views.' . FOFInflector::singularize($this->name) . '.config.id', null ) ) { $id = explode(',', $id); $id = array_shift($id); } else { $id = $this->input->getInt('id', 0); } if (is_array($cid) && !empty($cid)) { $this->setIds($cid); } else { $this->setId($id); } // Populate the event names from the $config array $configKey = $this->option . '.views.' . FOFInflector::singularize($view) . '.config.'; // Assign after delete event handler if (isset($config['event_after_delete'])) { $this->event_after_delete = $config['event_after_delete']; } else { $this->event_after_delete = $this->configProvider->get( $configKey . 'event_after_delete', $this->event_after_delete ); } // Assign after save event handler if (isset($config['event_after_save'])) { $this->event_after_save = $config['event_after_save']; } else { $this->event_after_save = $this->configProvider->get( $configKey . 'event_after_save', $this->event_after_save ); } // Assign before delete event handler if (isset($config['event_before_delete'])) { $this->event_before_delete = $config['event_before_delete']; } else { $this->event_before_delete = $this->configProvider->get( $configKey . 'event_before_delete', $this->event_before_delete ); } // Assign before save event handler if (isset($config['event_before_save'])) { $this->event_before_save = $config['event_before_save']; } else { $this->event_before_save = $this->configProvider->get( $configKey . 'event_before_save', $this->event_before_save ); } // Assign state change event handler if (isset($config['event_change_state'])) { $this->event_change_state = $config['event_change_state']; } else { $this->event_change_state = $this->configProvider->get( $configKey . 'event_change_state', $this->event_change_state ); } // Assign cache clean event handler if (isset($config['event_clean_cache'])) { $this->event_clean_cache = $config['event_clean_cache']; } else { $this->event_clean_cache = $this->configProvider->get( $configKey . 'event_clean_cache', $this->event_clean_cache ); } // Apply model behaviors if (isset($config['behaviors'])) { $behaviors = (array) $config['behaviors']; } elseif ($behaviors = $this->configProvider->get($configKey . 'behaviors', null)) { $behaviors = explode(',', $behaviors); } else { $behaviors = $this->default_behaviors; } if (is_array($behaviors) && count($behaviors)) { foreach ($behaviors as $behavior) { $this->addBehavior($behavior); } } } /** * Sets the list of IDs from the request data * * @return FOFModel */ public function setIDsFromRequest() { // Get the ID or list of IDs from the request or the configuration $cid = $this->input->get('cid', array(), 'array'); $id = $this->input->getInt('id', 0); $kid = $this->input->getInt($this->getTable($this->table)->getKeyName(), 0); if (is_array($cid) && !empty($cid)) { $this->setIds($cid); } else { if (empty($id)) { $this->setId($kid); } else { $this->setId($id); } } return $this; } /** * Sets the ID and resets internal data * * @param integer $id The ID to use * * @throws InvalidArgumentException * * @return FOFModel */ public function setId($id = 0) { // If this is an array extract the first item if (is_array($id)) { FOFPlatform::getInstance()->logDeprecated('Passing arrays to FOFModel::setId is deprecated. Use setIds() instead.'); $id = array_shift($id); } // No string or no integer? What are you trying to do??? if (!is_string($id) && !is_numeric($id)) { throw new InvalidArgumentException(sprintf('%s::setId()', get_class($this))); } $this->reset(); $this->id = (int) $id; $this->id_list = array($this->id); return $this; } /** * Returns the currently set ID * * @return integer */ public function getId() { return $this->id; } /** * Sets a list of IDs for batch operations from an array and resets the model * * @param array $idlist An array of item IDs to be set to the model's state * * @return FOFModel */ public function setIds($idlist) { $this->reset(); $this->id_list = array(); $this->id = 0; if (is_array($idlist) && !empty($idlist)) { foreach ($idlist as $value) { // Protect vs fatal error (objects) and wrong behavior (nested array) if(!is_object($value) && !is_array($value)) { $this->id_list[] = (int) $value; } } if(count($this->id_list)) { $this->id = $this->id_list[0]; } } return $this; } /** * Returns the list of IDs for batch operations * * @return array An array of integers */ public function getIds() { return $this->id_list; } /** * Resets the model, like it was freshly loaded * * @return FOFModel */ public function reset() { $this->id = 0; $this->id_list = null; $this->record = null; $this->list = null; $this->pagination = null; $this->total = null; $this->otable = null; return $this; } /** * Clears the model state, but doesn't touch the internal lists of records, * record tables or record id variables. To clear these values, please use * reset(). * * @return FOFModel */ public function clearState() { $this->state = new FOFUtilsObject; return $this; } /** * Clears the input array. * * @return FOFModel */ public function clearInput() { $defSource = array(); $this->input = new FOFInput($defSource); return $this; } /** * Set the internal input field * * @param $input * * @return FOFModel */ public function setInput($input) { if (!($input instanceof FOFInput)) { if (!is_array($input)) { $input = (array) $input; } $input = array_merge($_REQUEST, $input); $input = new FOFInput($input); } $this->input = $input; return $this; } /** * Resets the saved state for this view * * @return FOFModel */ public function resetSavedState() { JFactory::getApplication()->setUserState(substr($this->getHash(), 0, -1), null); return $this; } /** * Method to load a row for editing from the version history table. * * @param integer $version_id Key to the version history table. * @param FOFTable &$table Content table object being loaded. * @param string $alias The type_alias in #__content_types * * @return boolean False on failure or error, true otherwise. * * @since 2.3 */ public function loadhistory($version_id, FOFTable &$table, $alias) { // Only attempt to check the row in if it exists. if ($version_id) { $user = JFactory::getUser(); // Get an instance of the row to checkout. $historyTable = JTable::getInstance('Contenthistory'); if (!$historyTable->load($version_id)) { $this->setError($historyTable->getError()); return false; } $rowArray = JArrayHelper::fromObject(json_decode($historyTable->version_data)); $typeId = JTable::getInstance('Contenttype')->getTypeId($alias); if ($historyTable->ucm_type_id != $typeId) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_HISTORY_ID_MISMATCH')); $key = $table->getKeyName(); if (isset($rowArray[$key])) { $table->checkIn($rowArray[$key]); } return false; } } $this->setState('save_date', $historyTable->save_date); $this->setState('version_note', $historyTable->version_note); return $table->bind($rowArray); } /** * Returns a single item. It uses the id set with setId, or the first ID in * the list of IDs for batch operations * * @param integer $id Force a primary key ID to the model. Use null to use the id from the state. * * @return FOFTable A copy of the item's FOFTable array */ public function &getItem($id = null) { if (!is_null($id)) { $this->record = null; $this->setId($id); } if (empty($this->record)) { $table = $this->getTable($this->table); $table->load($this->id); $this->record = $table; // Do we have saved data? $session = JFactory::getSession(); if ($this->_savestate) { $serialized = $session->get($this->getHash() . 'savedata', null); if (!empty($serialized)) { $data = @unserialize($serialized); if ($data !== false) { $k = $table->getKeyName(); if (!array_key_exists($k, $data)) { $data[$k] = null; } if ($data[$k] != $this->id) { $session->set($this->getHash() . 'savedata', null); } else { $this->record->bind($data); } } } } $this->onAfterGetItem($this->record); } return $this->record; } /** * Alias for getItemList * * @param boolean $overrideLimits Should I override set limits? * @param string $group The group by clause * @codeCoverageIgnore * * @return array */ public function &getList($overrideLimits = false, $group = '') { return $this->getItemList($overrideLimits, $group); } /** * Returns a list of items * * @param boolean $overrideLimits Should I override set limits? * @param string $group The group by clause * * @return array */ public function &getItemList($overrideLimits = false, $group = '') { if (empty($this->list)) { $query = $this->buildQuery($overrideLimits); if (!$overrideLimits) { $limitstart = $this->getState('limitstart'); $limit = $this->getState('limit'); $this->list = $this->_getList((string) $query, $limitstart, $limit, $group); } else { $this->list = $this->_getList((string) $query, 0, 0, $group); } } return $this->list; } /** * Returns a FOFDatabaseIterator over a list of items. * * THERE BE DRAGONS. Unlike the getItemList() you have a few restrictions: * - The onProcessList event does not run when you get an iterator * - The Iterator returns FOFTable instances. By default, $this->table is used. If you have JOINs, GROUPs or a * complex query in general you will need to create a custom FOFTable subclass and pass its type in $tableType. * * The getIterator() method is a great way to sift through a large amount of records which would otherwise not fit * in memory since it only keeps one record in PHP memory at a time. It works best with simple models, returning * all the contents of a single database table. * * @param boolean $overrideLimits Should I ignore set limits? * @param string $tableClass The table class for the iterator, e.g. FoobarTableBar. Leave empty to use * the default Table class for this Model. * * @return FOFDatabaseIterator */ public function &getIterator($overrideLimits = false, $tableClass = null) { // Get the table name (required by the Iterator) if (empty($tableClass)) { $name = $this->table; if (empty($name)) { $name = FOFInflector::singularize($this->getName()); } $bareComponent = str_replace('com_', '', $this->option); $prefix = ucfirst($bareComponent) . 'Table'; $tableClass = $prefix . ucfirst($name); } // Get the query $query = $this->buildQuery($overrideLimits); // Apply limits if ($overrideLimits) { $limitStart = 0; $limit = 0; } else { $limitStart = $this->getState('limitstart'); $limit = $this->getState('limit'); } // This is required to prevent one relation from killing the db cursor used in a different relation... $oldDb = $this->getDbo(); $oldDb->disconnect(); // YES, WE DO NEED TO DISCONNECT BEFORE WE CLONE THE DB OBJECT. ARGH! $db = clone $oldDb; // Execute the query, get a db cursor and return the iterator $db->setQuery($query, $limitStart, $limit); $cursor = $db->execute(); $iterator = FOFDatabaseIterator::getIterator($db->name, $cursor, null, $tableClass); return $iterator; } /** * A cross-breed between getItem and getItemList. It runs the complete query, * like getItemList does. However, instead of returning an array of ad-hoc * objects, it binds the data from the first item fetched on the list to an * instance of the table object and returns that table object instead. * * @param boolean $overrideLimits Should I override set limits? * * @return FOFTable */ public function &getFirstItem($overrideLimits = false) { /** * We have to clone the instance, or when multiple getFirstItem calls occur, * we'll update EVERY instance created */ $table = clone $this->getTable($this->table); $list = $this->getItemList($overrideLimits); if (!empty($list)) { $firstItem = array_shift($list); $table->bind($firstItem); } unset($list); return $table; } /** * Binds the data to the model and tries to save it * * @param array|object $data The source data array or object * * @return boolean True on success */ public function save($data) { $this->otable = null; $table = $this->getTable($this->table); if (is_object($data)) { $data = clone($data); } $key = $table->getKeyName(); if (array_key_exists($key, (array) $data)) { $aData = (array) $data; $oid = $aData[$key]; $table->load($oid); } if ($data instanceof FOFTable) { $allData = $data->getData(); } elseif (is_object($data)) { $allData = (array) $data; } else { $allData = $data; } // Get the form if there is any $form = $this->getForm($allData, false); if ($form instanceof FOFForm) { // Make sure that $allData has for any field a key $fieldset = $form->getFieldset(); foreach ($fieldset as $nfield => $fldset) { if (!array_key_exists($nfield, $allData)) { $field = $form->getField($fldset->fieldname, $fldset->group); $type = strtolower($field->type); switch ($type) { case 'checkbox': $allData[$nfield] = 0; break; default: $allData[$nfield] = ''; break; } } } $serverside_validate = strtolower($form->getAttribute('serverside_validate')); $validateResult = true; if (in_array($serverside_validate, array('true', 'yes', '1', 'on'))) { $validateResult = $this->validateForm($form, $allData); } if ($validateResult === false) { if ($this->_savestate) { $session = JFactory::getSession(); $hash = $this->getHash() . 'savedata'; $session->set($hash, serialize($allData)); } return false; } } if (!$this->onBeforeSave($allData, $table)) { if ($this->_savestate) { $session = JFactory::getSession(); $hash = $this->getHash() . 'savedata'; $session->set($hash, serialize($allData)); } return false; } else { // If onBeforeSave successful, refetch the possibly modified data if ($data instanceof FOFTable) { $data->bind($allData); } elseif (is_object($data)) { $data = (object) $allData; } else { $data = $allData; } } if (!$table->save($data)) { foreach ($table->getErrors() as $error) { if (!empty($error)) { $this->setError($error); $session = JFactory::getSession(); $tableprops = $table->getProperties(true); unset($tableprops['input']); unset($tableprops['config']['input']); unset($tableprops['config']['db']); unset($tableprops['config']['dbo']); if ($this->_savestate) { $hash = $this->getHash() . 'savedata'; $session->set($hash, serialize($tableprops)); } } } return false; } else { $this->id = $table->$key; // Remove the session data if ($this->_savestate) { JFactory::getSession()->set($this->getHash() . 'savedata', null); } } $this->onAfterSave($table); $this->otable = $table; return true; } /** * Copy one or more records * * @return boolean True on success */ public function copy() { if (is_array($this->id_list) && !empty($this->id_list)) { $table = $this->getTable($this->table); if (!$this->onBeforeCopy($table)) { return false; } if (!$table->copy($this->id_list)) { $this->setError($table->getError()); return false; } else { // Call our internal event $this->onAfterCopy($table); // @todo Should we fire the content plugin? } } return true; } /** * Returns the table object after the last save() operation * * @return FOFTable */ public function getSavedTable() { return $this->otable; } /** * Deletes one or several items * * @return boolean True on success */ public function delete() { if (is_array($this->id_list) && !empty($this->id_list)) { $table = $this->getTable($this->table); foreach ($this->id_list as $id) { if (!$this->onBeforeDelete($id, $table)) { continue; } if (!$table->delete($id)) { $this->setError($table->getError()); return false; } else { $this->onAfterDelete($id); } } } return true; } /** * Toggles the published state of one or several items * * @param integer $publish The publishing state to set (e.g. 0 is unpublished) * @param integer $user The user ID performing this action * * @return boolean True on success */ public function publish($publish = 1, $user = null) { if (is_array($this->id_list) && !empty($this->id_list)) { if (empty($user)) { $oUser = FOFPlatform::getInstance()->getUser(); $user = $oUser->id; } $table = $this->getTable($this->table); if (!$this->onBeforePublish($table)) { return false; } if (!$table->publish($this->id_list, $publish, $user)) { $this->setError($table->getError()); return false; } else { // Call our internal event $this->onAfterPublish($table); // Call the plugin events FOFPlatform::getInstance()->importPlugin('content'); $name = $this->name; $context = $this->option . '.' . $name; // @TODO should we do anything with this return value? $result = FOFPlatform::getInstance()->runPlugins($this->event_change_state, array($context, $this->id_list, $publish)); } } return true; } /** * Checks out the current item * * @return boolean */ public function checkout() { $table = $this->getTable($this->table); $status = $table->checkout(FOFPlatform::getInstance()->getUser()->id, $this->id); if (!$status) { $this->setError($table->getError()); } return $status; } /** * Checks in the current item * * @return boolean */ public function checkin() { $table = $this->getTable($this->table); $status = $table->checkin($this->id); if (!$status) { $this->setError($table->getError()); } return $status; } /** * Tells you if the current item is checked out or not * * @return boolean */ public function isCheckedOut() { $table = $this->getTable($this->table); $status = $table->isCheckedOut($this->id); if (!$status) { $this->setError($table->getError()); } return $status; } /** * Increments the hit counter * * @return boolean */ public function hit() { $table = $this->getTable($this->table); if (!$this->onBeforeHit($table)) { return false; } $status = $table->hit($this->id); if (!$status) { $this->setError($table->getError()); } else { $this->onAfterHit($table); } return $status; } /** * Moves the current item up or down in the ordering list * * @param string $dirn The direction and magnitude to use (2 means move up by 2 positions, -3 means move down three positions) * * @return boolean True on success */ public function move($dirn) { $table = $this->getTable($this->table); $id = $this->getId(); $status = $table->load($id); if (!$status) { $this->setError($table->getError()); } if (!$status) { return false; } if (!$this->onBeforeMove($table)) { return false; } $status = $table->move($dirn); if (!$status) { $this->setError($table->getError()); } else { $this->onAfterMove($table); } return $status; } /** * Reorders all items in the table * * @return boolean */ public function reorder() { $table = $this->getTable($this->table); if (!$this->onBeforeReorder($table)) { return false; } $status = $table->reorder($this->getReorderWhere()); if (!$status) { $this->setError($table->getError()); } else { if (!$this->onAfterReorder($table)) { return false; } } return $status; } /** * Get a pagination object * * @return JPagination */ public function getPagination() { if (empty($this->pagination)) { // Import the pagination library JLoader::import('joomla.html.pagination'); // Prepare pagination values $total = $this->getTotal(); $limitstart = $this->getState('limitstart'); $limit = $this->getState('limit'); // Create the pagination object $this->pagination = new JPagination($total, $limitstart, $limit); } return $this->pagination; } /** * Get the number of all items * * @return integer */ public function getTotal() { if (is_null($this->total)) { $query = $this->buildCountQuery(); if ($query === false) { $subquery = $this->buildQuery(false); $subquery->clear('order'); $query = $this->_db->getQuery(true) ->select('COUNT(*)') ->from("(" . (string) $subquery . ") AS a"); } $this->_db->setQuery((string) $query); $this->total = $this->_db->loadResult(); } return $this->total; } /** * Returns a record count for the query * * @param string $query The query. * * @return integer Number of rows for query * * @since 12.2 */ protected function _getListCount($query) { return $this->getTotal(); } /** * Get a filtered state variable * * @param string $key The name of the state variable * @param mixed $default The default value to use * @param string $filter_type Filter type * * @return mixed The variable's value */ public function getState($key = null, $default = null, $filter_type = 'raw') { if (empty($key)) { return $this->_real_getState(); } // Get the savestate status $value = $this->_real_getState($key); if (is_null($value)) { $value = $this->getUserStateFromRequest($this->getHash() . $key, $key, $value, 'none', $this->_savestate); if (is_null($value)) { return $default; } } if (strtoupper($filter_type) == 'RAW') { return $value; } else { JLoader::import('joomla.filter.filterinput'); $filter = new JFilterInput; return $filter->clean($value, $filter_type); } } /** * 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 12.2 */ protected function _real_getState($property = null, $default = null) { if (!$this->__state_set) { // Protected method to auto-populate the model state. $this->populateState(); // Set the model state set flag to true. $this->__state_set = true; } return $property === null ? $this->state : $this->state->get($property, $default); } /** * Returns a hash for this component and view, e.g. "foobar.items.", used * for determining the keys of the variables which will be placed in the * session storage. * * @return string The hash */ public function getHash() { $option = $this->input->getCmd('option', 'com_foobar'); $view = FOFInflector::pluralize($this->input->getCmd('view', 'cpanel')); return "$option.$view."; } /** * Gets the value of a user state variable. * * @param string $key The key of the user state variable. * @param string $request The name of the variable passed in a request. * @param string $default The default value for the variable if not found. Optional. * @param string $type Filter for the variable, for valid values see {@link JFilterInput::clean()}. Optional. * @param boolean $setUserState Should I save the variable in the user state? Default: true. Optional. * * @return string The request user state. */ protected function getUserStateFromRequest($key, $request, $default = null, $type = 'none', $setUserState = true) { return FOFPlatform::getInstance()->getUserStateFromRequest($key, $request, $this->input, $default, $type, $setUserState); } /** * Returns an object list * * @param string $query The query * @param integer $limitstart Offset from start * @param integer $limit The number of records * @param string $group The group by clause * * @return array Array of objects */ protected function &_getList($query, $limitstart = 0, $limit = 0, $group = '') { $this->_db->setQuery($query, $limitstart, $limit); $result = $this->_db->loadObjectList($group); $this->onProcessList($result); return $result; } /** * Method to get a table object, load it if necessary. * * @param string $name The table name. Optional. * @param string $prefix The class prefix. Optional. * @param array $options Configuration array for model. Optional. * * @throws Exception * * @return FOFTable A FOFTable object */ public function getTable($name = '', $prefix = null, $options = array()) { if (empty($name)) { $name = $this->table; if (empty($name)) { $name = FOFInflector::singularize($this->getName()); } } if (empty($prefix)) { $bareComponent = str_replace('com_', '', $this->option); $prefix = ucfirst($bareComponent) . 'Table'; } if (empty($options)) { $options = array('input' => $this->input); } if ($table = $this->_createTable($name, $prefix, $options)) { return $table; } FOFPlatform::getInstance()->raiseError(0, JText::sprintf('JLIB_APPLICATION_ERROR_TABLE_NAME_NOT_SUPPORTED', $name)); return null; } /** * Method to load and return a model object. * * @param string $name The name of the view * @param string $prefix The class prefix. Optional. * @param array $config The configuration array to pass to the table * * @return FOFTable Table object or boolean false if failed */ protected function &_createTable($name, $prefix = 'Table', $config = array()) { // Make sure $config is an array if (is_object($config)) { $config = (array) $config; } elseif (!is_array($config)) { $config = array(); } $result = null; // Clean the model name $name = preg_replace('/[^A-Z0-9_]/i', '', $name); $prefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix); // Make sure we are returning a DBO object if (!array_key_exists('dbo', $config)) { $config['dbo'] = $this->getDBO(); } $instance = FOFTable::getAnInstance($name, $prefix, $config); return $instance; } /** * Creates the WHERE part of the reorder query * * @return string */ public function getReorderWhere() { return ''; } /** * Builds the SELECT query * * @param boolean $overrideLimits Are we requested to override the set limits? * * @return JDatabaseQuery */ public function buildQuery($overrideLimits = false) { $table = $this->getTable(); $tableName = $table->getTableName(); $tableKey = $table->getKeyName(); $db = $this->getDbo(); $query = $db->getQuery(true); // Call the behaviors $this->modelDispatcher->trigger('onBeforeBuildQuery', array(&$this, &$query)); $alias = $this->getTableAlias(); if ($alias) { $alias = ' AS ' . $db->qn($alias); } else { $alias = ''; } $select = $this->getTableAlias() ? $db->qn($this->getTableAlias()) . '.*' : $db->qn($tableName) . '.*'; $query->select($select)->from($db->qn($tableName) . $alias); if (!$overrideLimits) { $order = $this->getState('filter_order', null, 'cmd'); if (!in_array($order, array_keys($table->getData()))) { $order = $tableKey; } $order = $db->qn($order); if ($alias) { $order = $db->qn($this->getTableAlias()) . '.' . $order; } $dir = strtoupper($this->getState('filter_order_Dir', 'ASC', 'cmd')); $dir = in_array($dir, array('DESC', 'ASC')) ? $dir : 'ASC'; // If the table cache is broken you may end up with an empty order by. if (!empty($order) && ($order != $db->qn(''))) { $query->order($order . ' ' . $dir); } } // Call the behaviors $this->modelDispatcher->trigger('onAfterBuildQuery', array(&$this, &$query)); return $query; } /** * Returns a list of the fields of the table associated with this model * * @return array */ public function getTableFields() { $tableName = $this->getTable()->getTableName(); if (version_compare(JVERSION, '3.0', 'ge')) { $fields = $this->getDbo()->getTableColumns($tableName, true); } else { $fieldsArray = $this->getDbo()->getTableFields($tableName, true); $fields = array_shift($fieldsArray); } return $fields; } /** * Get the alias set for this model's table * * @return string The table alias */ public function getTableAlias() { return $this->getTable($this->table)->getTableAlias(); } /** * Builds the count query used in getTotal() * * @return boolean */ public function buildCountQuery() { return false; } /** * Clones the model object and returns the clone * * @return FOFModel */ public function &getClone() { $clone = clone($this); return $clone; } /** * Magic getter; allows to use the name of model state keys as properties * * @param string $name The name of the variable to get * * @return mixed The value of the variable */ public function __get($name) { return $this->getState($name); } /** * Magic setter; allows to use the name of model state keys as properties * * @param string $name The name of the variable * @param mixed $value The value to set the variable to * * @return void */ public function __set($name, $value) { return $this->setState($name, $value); } /** * Magic caller; allows to use the name of model state keys as methods to * set their values. * * @param string $name The name of the state variable to set * @param mixed $arguments The value to set the state variable to * * @return FOFModel Reference to self */ public function __call($name, $arguments) { $arg1 = array_shift($arguments); $this->setState($name, $arg1); return $this; } /** * Sets the model state auto-save status. By default the model is set up to * save its state to the session. * * @param boolean $newState True to save the state, false to not save it. * * @return FOFModel Reference to self */ public function &savestate($newState) { $this->_savestate = $newState ? true : false; return $this; } /** * Initialises the _savestate variable * * @param integer $defaultSaveState The default value for the savestate * * @return void */ public function populateSavestate($defaultSaveState = -999) { if (is_null($this->_savestate)) { $savestate = $this->input->getInt('savestate', $defaultSaveState); if ($savestate == -999) { $savestate = true; } $this->savestate($savestate); } } /** * Method to auto-populate the model state. * * This method should only be called once per instantiation and is designed * to be called on the first call to the getState() method unless the model * configuration flag to ignore the request is set. * * @return void * * @note Calling getState in this method will result in recursion. * @since 12.2 */ protected function populateState() { } /** * Applies view access level filtering for the specified user. Useful to * filter a front-end items listing. * * @param integer $userID The user ID to use. Skip it to use the currently logged in user. * * @return FOFModel Reference to self */ public function applyAccessFiltering($userID = null) { $user = FOFPlatform::getInstance()->getUser($userID); $table = $this->getTable(); $accessField = $table->getColumnAlias('access'); $this->setState($accessField, $user->getAuthorisedViewLevels()); return $this; } /** * A method for getting the form from the model. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * @param boolean $source The name of the form. If not set we'll try the form_name state variable or fall back to default. * * @return mixed A FOFForm object on success, false on failure * * @since 2.0 */ public function getForm($data = array(), $loadData = true, $source = null) { $this->_formData = $data; if (empty($source)) { $source = $this->getState('form_name', null); } if (empty($source)) { $source = 'form.' . $this->name; } $name = $this->input->getCmd('option', 'com_foobar') . '.' . $this->name . '.' . $source; $options = array( 'control' => false, 'load_data' => $loadData, ); $this->onBeforeLoadForm($name, $source, $options); $form = $this->loadForm($name, $source, $options); if ($form instanceof FOFForm) { $this->onAfterLoadForm($form, $name, $source, $options); } return $form; } /** * Method to get a form object. * * @param string $name The name of the form. * @param string $source The form filename (e.g. form.browse) * @param array $options Optional array of options for the form creation. * @param boolean $clear Optional argument to force load a new form. * @param bool|string $xpath An optional xpath to search for the fields. * * @return mixed FOFForm object on success, False on error. * * @throws Exception * * @see FOFForm * @since 2.0 */ protected function loadForm($name, $source, $options = array(), $clear = false, $xpath = false) { // Handle the optional arguments. $options['control'] = isset($options['control']) ? $options['control'] : false; // Create a signature hash. $hash = md5($source . serialize($options)); // Check if we can use a previously loaded form. if (isset($this->_forms[$hash]) && !$clear) { return $this->_forms[$hash]; } // Try to find the name and path of the form to load $formFilename = $this->findFormFilename($source); // No form found? Quit! if ($formFilename === false) { return false; } // Set up the form name and path $source = basename($formFilename, '.xml'); FOFForm::addFormPath(dirname($formFilename)); // Set up field paths $option = $this->input->getCmd('option', 'com_foobar'); $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($option); $view = $this->name; $file_root = $componentPaths['main']; $alt_file_root = $componentPaths['alt']; FOFForm::addFieldPath($file_root . '/fields'); FOFForm::addFieldPath($file_root . '/models/fields'); FOFForm::addFieldPath($alt_file_root . '/fields'); FOFForm::addFieldPath($alt_file_root . '/models/fields'); FOFForm::addHeaderPath($file_root . '/fields/header'); FOFForm::addHeaderPath($file_root . '/models/fields/header'); FOFForm::addHeaderPath($alt_file_root . '/fields/header'); FOFForm::addHeaderPath($alt_file_root . '/models/fields/header'); // Get the form. try { $form = FOFForm::getInstance($name, $source, $options, false, $xpath); if (isset($options['load_data']) && $options['load_data']) { // Get the data for the form. $data = $this->loadFormData(); } else { $data = array(); } // Allows data and form manipulation before preprocessing the form $this->onBeforePreprocessForm($form, $data); // Allow for additional modification of the form, and events to be triggered. // We pass the data because plugins may require it. $this->preprocessForm($form, $data); // Allows data and form manipulation After preprocessing the form $this->onAfterPreprocessForm($form, $data); // Load the data into the form after the plugins have operated. $form->bind($data); } catch (Exception $e) { // The above try-catch statement will catch EVERYTHING, even PhpUnit exceptions while testing if(stripos(get_class($e), 'phpunit') !== false) { throw $e; } else { $this->setError($e->getMessage()); return false; } } // Store the form for later. $this->_forms[$hash] = $form; return $form; } /** * Guesses the best candidate for the path to use for a particular form. * * @param string $source The name of the form file to load, without the .xml extension. * @param array $paths The paths to look into. You can declare this to override the default FOF paths. * * @return mixed A string if the path and filename of the form to load is found, false otherwise. * * @since 2.0 */ public function findFormFilename($source, $paths = array()) { // TODO Should we read from internal variables instead of the input? With a temp instance we have no input $option = $this->input->getCmd('option', 'com_foobar'); $view = $this->name; $componentPaths = FOFPlatform::getInstance()->getComponentBaseDirs($option); $file_root = $componentPaths['main']; $alt_file_root = $componentPaths['alt']; $template_root = FOFPlatform::getInstance()->getTemplateOverridePath($option); if (empty($paths)) { // Set up the paths to look into // PLEASE NOTE: If you ever change this, please update Model Unit tests, too, since we have to // copy these default folders (we have to add the protocol for the virtual filesystem) $paths = array( // In the template override $template_root . '/' . $view, $template_root . '/' . FOFInflector::singularize($view), $template_root . '/' . FOFInflector::pluralize($view), // In this side of the component $file_root . '/views/' . $view . '/tmpl', $file_root . '/views/' . FOFInflector::singularize($view) . '/tmpl', $file_root . '/views/' . FOFInflector::pluralize($view) . '/tmpl', // In the other side of the component $alt_file_root . '/views/' . $view . '/tmpl', $alt_file_root . '/views/' . FOFInflector::singularize($view) . '/tmpl', $alt_file_root . '/views/' . FOFInflector::pluralize($view) . '/tmpl', // In the models/forms of this side $file_root . '/models/forms', // In the models/forms of the other side $alt_file_root . '/models/forms', ); } $paths = array_unique($paths); // Set up the suffixes to look into $suffixes = array(); $temp_suffixes = FOFPlatform::getInstance()->getTemplateSuffixes(); if (!empty($temp_suffixes)) { foreach ($temp_suffixes as $suffix) { $suffixes[] = $suffix . '.xml'; } } $suffixes[] = '.xml'; // Look for all suffixes in all paths $result = false; $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem'); foreach ($paths as $path) { foreach ($suffixes as $suffix) { $filename = $path . '/' . $source . $suffix; if ($filesystem->fileExists($filename)) { $result = $filename; break; } } if ($result) { break; } } return $result; } /** * Method to get the data that should be injected in the form. * * @return array The default data is an empty array. * * @since 2.0 */ protected function loadFormData() { if (empty($this->_formData)) { return array(); } else { return $this->_formData; } } /** * Method to allow derived classes to preprocess the form. * * @param FOFForm $form A FOFForm object. * @param mixed &$data The data expected for the form. * @param string $group The name of the plugin group to import (defaults to "content"). * * @return void * * @see FOFFormField * @since 2.0 * @throws Exception if there is an error in the form event. */ protected function preprocessForm(FOFForm &$form, &$data, $group = 'content') { // Import the appropriate plugin group. FOFPlatform::getInstance()->importPlugin($group); // Trigger the form preparation event. $results = FOFPlatform::getInstance()->runPlugins('onContentPrepareForm', array($form, $data)); // Check for errors encountered while preparing the form. if (count($results) && in_array(false, $results, true)) { // Get the last error. $dispatcher = FOFUtilsObservableDispatcher::getInstance(); $error = $dispatcher->getError(); if (!($error instanceof Exception)) { throw new Exception($error); } } } /** * Method to validate the form data. * * @param FOFForm $form The form to validate against. * @param array $data The data to validate. * @param string $group The name of the field group to validate. * * @return mixed Array of filtered data if valid, false otherwise. * * @see JFormRule * @see JFilterInput * @since 2.0 */ public function validateForm($form, $data, $group = null) { // Filter and validate the form data. $data = $form->filter($data); $return = $form->validate($data, $group); // Check for an error. if ($return instanceof Exception) { $this->setError($return->getMessage()); return false; } // Check the validation results. if ($return === false) { // Get the validation messages from the form. foreach ($form->getErrors() as $message) { if ($message instanceof Exception) { $this->setError($message->getMessage()); } else { $this->setError($message); } } return false; } return $data; } /** * Allows the manipulation before the form is loaded * * @param string &$name The name of the form. * @param string &$source The form source. Can be XML string if file flag is set to false. * @param array &$options Optional array of options for the form creation. * @codeCoverageIgnore * * @return void */ public function onBeforeLoadForm(&$name, &$source, &$options) { } /** * Allows the manipulation after the form is loaded * * @param FOFForm $form A FOFForm object. * @param string &$name The name of the form. * @param string &$source The form source. Can be XML string if file flag is set to false. * @param array &$options Optional array of options for the form creation. * @codeCoverageIgnore * * @return void */ public function onAfterLoadForm(FOFForm &$form, &$name, &$source, &$options) { } /** * Allows data and form manipulation before preprocessing the form * * @param FOFForm $form A FOFForm object. * @param array &$data The data expected for the form. * @codeCoverageIgnore * * @return void */ public function onBeforePreprocessForm(FOFForm &$form, &$data) { } /** * Allows data and form manipulation after preprocessing the form * * @param FOFForm $form A FOFForm object. * @param array &$data The data expected for the form. * @codeCoverageIgnore * * @return void */ public function onAfterPreprocessForm(FOFForm &$form, &$data) { } /** * This method can be overriden to automatically do something with the * list results array. You are supposed to modify the list which was passed * in the parameters; DO NOT return a new array! * * @param array &$resultArray An array of objects, each row representing a record * * @return void */ protected function onProcessList(&$resultArray) { } /** * This method runs after an item has been gotten from the database in a read * operation. You can modify it before it's returned to the MVC triad for * further processing. * * @param FOFTable &$record The table instance we fetched * * @return void */ protected function onAfterGetItem(&$record) { try { // Call the behaviors $result = $this->modelDispatcher->trigger('onAfterGetItem', array(&$this, &$record)); } catch (Exception $e) { // Oops, an exception occured! $this->setError($e->getMessage()); } } /** * This method runs before the $data is saved to the $table. Return false to * stop saving. * * @param array &$data The data to save * @param FOFTable &$table The table to save the data to * * @return boolean Return false to prevent saving, true to allow it */ protected function onBeforeSave(&$data, &$table) { // Let's import the plugin only if we're not in CLI (content plugin needs a user) FOFPlatform::getInstance()->importPlugin('content'); try { // Do I have a new record? $key = $table->getKeyName(); $pk = (!empty($data[$key])) ? $data[$key] : 0; $this->_isNewRecord = $pk <= 0; // Bind the data $table->bind($data); // Call the behaviors $result = $this->modelDispatcher->trigger('onBeforeSave', array(&$this, &$data)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } // Call the plugin $name = $this->name; $result = FOFPlatform::getInstance()->runPlugins($this->event_before_save, array($this->option . '.' . $name, &$table, $this->_isNewRecord)); if (in_array(false, $result, true)) { // Plugin failed, return false $this->setError($table->getError()); return false; } } catch (Exception $e) { // Oops, an exception occured! $this->setError($e->getMessage()); return false; } return true; } /** * This method runs after the data is saved to the $table. * * @param FOFTable &$table The table which was saved * * @return boolean */ protected function onAfterSave(&$table) { // Let's import the plugin only if we're not in CLI (content plugin needs a user) FOFPlatform::getInstance()->importPlugin('content'); try { // Call the behaviors $result = $this->modelDispatcher->trigger('onAfterSave', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } $name = $this->name; FOFPlatform::getInstance()->runPlugins($this->event_after_save, array($this->option . '.' . $name, &$table, $this->_isNewRecord)); return true; } catch (Exception $e) { // Oops, an exception occured! $this->setError($e->getMessage()); return false; } } /** * This method runs before the record with key value of $id is deleted from $table * * @param integer &$id The ID of the record being deleted * @param FOFTable &$table The table instance used to delete the record * * @return boolean */ protected function onBeforeDelete(&$id, &$table) { // Let's import the plugin only if we're not in CLI (content plugin needs a user) FOFPlatform::getInstance()->importPlugin('content'); try { $table->load($id); // Call the behaviors $result = $this->modelDispatcher->trigger('onBeforeDelete', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } $name = $this->name; $context = $this->option . '.' . $name; $result = FOFPlatform::getInstance()->runPlugins($this->event_before_delete, array($context, $table)); if (in_array(false, $result, true)) { // Plugin failed, return false $this->setError($table->getError()); return false; } $this->_recordForDeletion = clone $table; } catch (Exception $e) { // Oops, an exception occured! $this->setError($e->getMessage()); return false; } return true; } /** * This method runs after a record with key value $id is deleted * * @param integer $id The id of the record which was deleted * * @return boolean Return false to raise an error, true otherwise */ protected function onAfterDelete($id) { FOFPlatform::getInstance()->importPlugin('content'); // Call the behaviors $result = $this->modelDispatcher->trigger('onAfterDelete', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } try { $name = $this->name; $context = $this->option . '.' . $name; $result = FOFPlatform::getInstance()->runPlugins($this->event_after_delete, array($context, $this->_recordForDeletion)); unset($this->_recordForDeletion); } catch (Exception $e) { // Oops, an exception occured! $this->setError($e->getMessage()); return false; } } /** * This method runs before a record is copied * * @param FOFTable &$table The table instance of the record being copied * * @return boolean True to allow the copy */ protected function onBeforeCopy(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onBeforeCopy', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * This method runs after a record has been copied * * @param FOFTable &$table The table instance of the record which was copied * * @return boolean True to allow the copy */ protected function onAfterCopy(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onAfterCopy', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * This method runs before a record is published * * @param FOFTable &$table The table instance of the record being published * * @return boolean True to allow the operation */ protected function onBeforePublish(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onBeforePublish', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * This method runs after a record has been published * * @param FOFTable &$table The table instance of the record which was published * * @return boolean True to allow the operation */ protected function onAfterPublish(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onAfterPublish', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * This method runs before a record is hit * * @param FOFTable &$table The table instance of the record being hit * * @return boolean True to allow the operation */ protected function onBeforeHit(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onBeforeHit', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * This method runs after a record has been hit * * @param FOFTable &$table The table instance of the record which was hit * * @return boolean True to allow the operation */ protected function onAfterHit(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onAfterHit', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * This method runs before a record is moved * * @param FOFTable &$table The table instance of the record being moved * * @return boolean True to allow the operation */ protected function onBeforeMove(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onBeforeMove', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * This method runs after a record has been moved * * @param FOFTable &$table The table instance of the record which was moved * * @return boolean True to allow the operation */ protected function onAfterMove(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onAfterMove', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * This method runs before a table is reordered * * @param FOFTable &$table The table instance being reordered * * @return boolean True to allow the operation */ protected function onBeforeReorder(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onBeforeReorder', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * This method runs after a table is reordered * * @param FOFTable &$table The table instance which was reordered * * @return boolean True to allow the operation */ protected function onAfterReorder(&$table) { // Call the behaviors $result = $this->modelDispatcher->trigger('onAfterReorder', array(&$this)); if (in_array(false, $result, true)) { // Behavior failed, return false return false; } return true; } /** * Method to get the database driver object * * @return JDatabaseDriver */ public function getDbo() { return $this->_db; } /** * Method to get the model name * * The model name. By default parsed using the classname or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the model * * @throws Exception */ public function getName() { if (empty($this->name)) { $r = null; if (!preg_match('/Model(.*)/i', get_class($this), $r)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'), 500); } $this->name = strtolower($r[1]); } return $this->name; } /** * Method to set the database driver object * * @param JDatabaseDriver $db A JDatabaseDriver based object * * @return void */ public function setDbo($db) { $this->_db = $db; } /** * Method to set model state variables * * @param string $property The name of the property. * @param mixed $value The value of the property to set or null. * * @return mixed The previous value of the property or null if not set. */ public function setState($property, $value = null) { return $this->state->set($property, $value); } /** * Clean the cache * * @param string $group The cache group * @param integer $client_id The ID of the client * * @return void */ protected function cleanCache($group = null, $client_id = 0) { $conf = JFactory::getConfig(); $platformDirs = FOFPlatform::getInstance()->getPlatformBaseDirs(); $options = array( 'defaultgroup' => ($group) ? $group : (isset($this->option) ? $this->option : JFactory::getApplication()->input->get('option')), 'cachebase' => ($client_id) ? $platformDirs['admin'] . '/cache' : $conf->get('cache_path', $platformDirs['public'] . '/cache')); $cache = JCache::getInstance('callback', $options); $cache->clean(); // Trigger the onContentCleanCache event. FOFPlatform::getInstance()->runPlugins($this->event_clean_cache, $options); } /** * Set a behavior param * * @param string $name The name of the param * @param mixed $value The param value to set * * @return FOFModel */ public function setBehaviorParam($name, $value) { $this->_behaviorParams[$name] = $value; return $this; } /** * Get a behavior param * * @param string $name The name of the param * @param mixed $default The default value returned if not set * * @return mixed */ public function getBehaviorParam($name, $default = null) { return isset($this->_behaviorParams[$name]) ? $this->_behaviorParams[$name] : $default; } /** * Set or get the backlisted filters * * @param mixed $list A filter or list of filters to backlist. If null return the list of backlisted filter * @param boolean $reset Reset the blacklist if true * * @return void|array Return an array of value if $list is null */ public function blacklistFilters($list = null, $reset = false) { if (!isset($list)) { return $this->getBehaviorParam('blacklistFilters', array()); } if (is_string($list)) { $list = (array) $list; } if (!$reset) { $list = array_unique(array_merge($this->getBehaviorParam('blacklistFilters', array()), $list)); } $this->setBehaviorParam('blacklistFilters', $list); } } PK���\�'ް � (libraries/fof/model/behavior/private.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 to filter front-end access to items * craeted by the currently logged in user only. * * @package FrameworkOnFramework * @since 2.1 */ class FOFModelBehaviorPrivate extends FOFModelBehavior { /** * This event runs after we have built the query used to fetch a record * list in a model. It is used to apply automatic query filters. * * @param FOFModel &$model The model which calls this event * @param JDatabaseQuery &$query The model which calls this event * * @return void */ public function onAfterBuildQuery(&$model, &$query) { // This behavior only applies to the front-end. if (!FOFPlatform::getInstance()->isFrontend()) { return; } // Get the name of the access field $table = $model->getTable(); $createdField = $table->getColumnAlias('created_by'); // Make sure the access field actually exists if (!in_array($createdField, $table->getKnownFields())) { return; } // Get the current user's id $user_id = FOFPlatform::getInstance()->getUser()->id; // And filter the query output by the user id $db = FOFPlatform::getInstance()->getDbo(); $alias = $model->getTableAlias(); $alias = $alias ? $db->qn($alias) . '.' : ''; $query->where($alias . $db->qn($createdField) . ' = ' . $db->q($user_id)); } /** * The event runs after FOFModel has called FOFTable and retrieved a single * item from the database. It is used to apply automatic filters. * * @param FOFModel &$model The model which was called * @param FOFTable &$record The record loaded from the databae * * @return void */ public function onAfterGetItem(&$model, &$record) { if ($record instanceof FOFTable) { $keyName = $record->getKeyName(); if ($record->$keyName === null) { return; } $fieldName = $record->getColumnAlias('created_by'); // Make sure the field actually exists if (!in_array($fieldName, $record->getKnownFields())) { return; } $user_id = FOFPlatform::getInstance()->getUser()->id; if ($record->$fieldName != $user_id) { $record = null; } } } } PK���\"/�>)libraries/fof/model/behavior/language.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 to filter front-end access to items * based on the language. * * @package FrameworkOnFramework * @since 2.1 */ class FOFModelBehaviorLanguage extends FOFModelBehavior { /** * This event runs before we have built the query used to fetch a record * list in a model. It is used to blacklist the language filter * * @param FOFModel &$model The model which calls this event * @param JDatabaseQuery &$query The model which calls this event * * @return void */ public function onBeforeBuildQuery(&$model, &$query) { if (FOFPlatform::getInstance()->isFrontend()) { $model->blacklistFilters('language'); } } /** * This event runs after we have built the query used to fetch a record * list in a model. It is used to apply automatic query filters. * * @param FOFModel &$model The model which calls this event * @param JDatabaseQuery &$query The model which calls this event * * @return void */ public function onAfterBuildQuery(&$model, &$query) { // This behavior only applies to the front-end. if (!FOFPlatform::getInstance()->isFrontend()) { return; } // Get the name of the language field $table = $model->getTable(); $languageField = $table->getColumnAlias('language'); // Make sure the access field actually exists if (!in_array($languageField, $table->getKnownFields())) { return; } // Make sure it is a multilingual site and get a list of languages $app = JFactory::getApplication(); $hasLanguageFilter = method_exists($app, 'getLanguageFilter'); if ($hasLanguageFilter) { $hasLanguageFilter = $app->getLanguageFilter(); } if (!$hasLanguageFilter) { return; } $lang_filter_plugin = JPluginHelper::getPlugin('system', 'languagefilter'); $lang_filter_params = new JRegistry($lang_filter_plugin->params); $languages = array('*'); if ($lang_filter_params->get('remove_default_prefix')) { // Get default site language $lg = FOFPlatform::getInstance()->getLanguage(); $languages[] = $lg->getTag(); } else { $languages[] = JFactory::getApplication()->input->getCmd('language', '*'); } // Filter out double languages $languages = array_unique($languages); // And filter the query output by these languages $db = FOFPlatform::getInstance()->getDbo(); // Alias $alias = $model->getTableAlias(); $alias = $alias ? $db->qn($alias) . '.' : ''; $languages = array_map(array($db, 'quote'), $languages); $query->where($alias . $db->qn($languageField) . ' IN (' . implode(',', $languages) . ')'); } /** * The event runs after FOFModel has called FOFTable and retrieved a single * item from the database. It is used to apply automatic filters. * * @param FOFModel &$model The model which was called * @param FOFTable &$record The record loaded from the databae * * @return void */ public function onAfterGetItem(&$model, &$record) { if ($record instanceof FOFTable) { $fieldName = $record->getColumnAlias('language'); // Make sure the field actually exists if (!in_array($fieldName, $record->getKnownFields())) { return; } // Make sure it is a multilingual site and get a list of languages $app = JFactory::getApplication(); $hasLanguageFilter = method_exists($app, 'getLanguageFilter'); if ($hasLanguageFilter) { $hasLanguageFilter = $app->getLanguageFilter(); } if (!$hasLanguageFilter) { return; } $lang_filter_plugin = JPluginHelper::getPlugin('system', 'languagefilter'); $lang_filter_params = new JRegistry($lang_filter_plugin->params); $languages = array('*'); if ($lang_filter_params->get('remove_default_prefix')) { // Get default site language $lg = FOFPlatform::getInstance()->getLanguage(); $languages[] = $lg->getTag(); } else { $languages[] = JFactory::getApplication()->input->getCmd('language', '*'); } // Filter out double languages $languages = array_unique($languages); if (!in_array($record->$fieldName, $languages)) { $record = null; } } } } PK���\����(libraries/fof/model/behavior/enabled.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 to filter front-end access to items * that are enabled. * * @package FrameworkOnFramework * @since 2.1 */ class FOFModelBehaviorEnabled extends FOFModelBehavior { /** * This event runs after we have built the query used to fetch a record * list in a model. It is used to apply automatic query filters. * * @param FOFModel &$model The model which calls this event * @param JDatabaseQuery &$query The model which calls this event * * @return void */ public function onAfterBuildQuery(&$model, &$query) { // This behavior only applies to the front-end. if (!FOFPlatform::getInstance()->isFrontend()) { return; } // Get the name of the enabled field $table = $model->getTable(); $enabledField = $table->getColumnAlias('enabled'); // Make sure the field actually exists if (!in_array($enabledField, $table->getKnownFields())) { return; } // Filter by enabled fields only $db = FOFPlatform::getInstance()->getDbo(); // Alias $alias = $model->getTableAlias(); $alias = $alias ? $db->qn($alias) . '.' : ''; $query->where($alias . $db->qn($enabledField) . ' = ' . $db->q(1)); } /** * The event runs after FOFModel has called FOFTable and retrieved a single * item from the database. It is used to apply automatic filters. * * @param FOFModel &$model The model which was called * @param FOFTable &$record The record loaded from the databae * * @return void */ public function onAfterGetItem(&$model, &$record) { if ($record instanceof FOFTable) { $fieldName = $record->getColumnAlias('enabled'); // Make sure the field actually exists if (!in_array($fieldName, $record->getKnownFields())) { return; } if ($record->$fieldName != 1) { $record = null; } } } } PK���\���.[['libraries/fof/model/behavior/access.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 to filter front-end access to items * based on the viewing access levels. * * @package FrameworkOnFramework * @since 2.1 */ class FOFModelBehaviorAccess extends FOFModelBehavior { /** * This event runs after we have built the query used to fetch a record * list in a model. It is used to apply automatic query filters. * * @param FOFModel &$model The model which calls this event * @param JDatabaseQuery &$query The model which calls this event * * @return void */ public function onAfterBuildQuery(&$model, &$query) { // This behavior only applies to the front-end. if (!FOFPlatform::getInstance()->isFrontend()) { return; } // Get the name of the access field $table = $model->getTable(); $accessField = $table->getColumnAlias('access'); // Make sure the field actually exists if (!in_array($accessField, $table->getKnownFields())) { return; } $model->applyAccessFiltering(null); } /** * The event runs after FOFModel has called FOFTable and retrieved a single * item from the database. It is used to apply automatic filters. * * @param FOFModel &$model The model which was called * @param FOFTable &$record The record loaded from the databae * * @return void */ public function onAfterGetItem(&$model, &$record) { if ($record instanceof FOFTable) { $fieldName = $record->getColumnAlias('access'); // Make sure the field actually exists if (!in_array($fieldName, $record->getKnownFields())) { return; } // Get the user $user = FOFPlatform::getInstance()->getUser(); // Filter by authorised access levels if (!in_array($record->$fieldName, $user->getAuthorisedViewLevels())) { $record = null; } } } } PK���\�kZZ-libraries/fof/model/behavior/emptynonzero.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 FOFModelBehaviorEmptynonzero extends FOFModelBehavior { /** * This event runs when we are building the query used to fetch a record * list in a model * * @param FOFModel &$model The model which calls this event * @param JDatabaseQuery &$query The query being built * * @return void */ public function onBeforeBuildQuery(&$model, &$query) { $model->setState('_emptynonzero', '1'); } } PK���\C�n�e e (libraries/fof/model/behavior/filters.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 FOFModelBehaviorFilters extends FOFModelBehavior { /** * This event runs after we have built the query used to fetch a record * list in a model. It is used to apply automatic query filters. * * @param FOFModel &$model The model which calls this event * @param JDatabaseQuery &$query The model which calls this event * * @return void */ public function onAfterBuildQuery(&$model, &$query) { $table = $model->getTable(); $tableName = $table->getTableName(); $tableKey = $table->getKeyName(); $db = $model->getDBO(); $filterzero = $model->getState('_emptynonzero', null); $fields = $model->getTableFields(); $backlist = $model->blacklistFilters(); foreach ($fields as $fieldname => $fieldtype) { if (in_array($fieldname, $backlist)) { continue; } $field = new stdClass; $field->name = $fieldname; $field->type = $fieldtype; $field->filterzero = $filterzero; $filterName = ($field->name == $tableKey) ? 'id' : $field->name; $filterState = $model->getState($filterName, null); $field = FOFModelField::getField($field, array('dbo' => $db, 'table_alias' => $model->getTableAlias())); if ((is_array($filterState) && ( array_key_exists('value', $filterState) || array_key_exists('from', $filterState) || array_key_exists('to', $filterState) )) || is_object($filterState)) { $options = new JRegistry($filterState); } else { $options = new JRegistry; $options->set('value', $filterState); } $methods = $field->getSearchMethods(); $method = $options->get('method', $field->getDefaultSearchMethod()); if (!in_array($method, $methods)) { $method = 'exact'; } switch ($method) { case 'between': case 'outside': case 'range' : $sql = $field->$method($options->get('from', null), $options->get('to')); break; case 'interval': case 'modulo': $sql = $field->$method($options->get('value', null), $options->get('interval')); break; case 'exact': case 'partial': case 'search': default: $sql = $field->$method($options->get('value', null)); break; } if ($sql) { $query->where($sql); } } } } PK���\�}���%libraries/fof/model/field/boolean.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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���\�F��"libraries/fof/model/field/date.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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���\_��$libraries/fof/model/field/number.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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; } } PK���\�ζ��"libraries/fof/model/field/text.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage model * @copyright Copyright (C) 2010 - 2015 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 JDatabaseDriver $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���\πS�sslibraries/fof/string/utils.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage utils * @copyright Copyright (C) 2010 - 2015 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; /** * Helper class with utilitarian functions concerning strings * * @package FrameworkOnFramework * @since 2.0 */ abstract class FOFStringUtils { /** * Convert a string into a slug (alias), suitable for use in URLs. Please * note that transliteration suupport is rudimentary at this stage. * * @param string $value A string to convert to slug * * @return string The slug */ public static function toSlug($value) { // Remove any '-' from the string they will be used as concatonater $value = str_replace('-', ' ', $value); // Convert to ascii characters $value = self::toASCII($value); // Lowercase and trim $value = trim(strtolower($value)); // Remove any duplicate whitespace, and ensure all characters are alphanumeric $value = preg_replace(array('/\s+/', '/[^A-Za-z0-9\-_]/'), array('-', ''), $value); // Limit length if (strlen($value) > 100) { $value = substr($value, 0, 100); } return $value; } /** * Convert common norhern European languages' letters into plain ASCII. This * is a rudimentary transliteration. * * @param string $value The value to convert to ASCII * * @return string The converted string */ public static function toASCII($value) { $string = htmlentities(utf8_decode($value), null, 'ISO-8859-1'); $string = preg_replace( array('/ß/', '/&(..)lig;/', '/&([aouAOU])uml;/', '/&(.)[^;]*;/'), array('ss', "$1", "$1" . 'e', "$1"), $string ); return $string; } /** * Convert a string to a boolean. * * @param string $string The string. * * @return boolean The converted string */ public static function toBool($string) { $string = trim((string) $string); if ($string == 'true') { return true; } if ($string == 'false') { return false; } return (bool) $string; } } PK���\��-ББ!libraries/fof/render/strapper.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage render * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Akeeba Strapper view renderer class. * * @package FrameworkOnFramework * @since 2.0 */ class FOFRenderStrapper extends FOFRenderAbstract { /** * Public constructor. Determines the priority of this class and if it should be enabled */ public function __construct() { $this->priority = 60; $this->enabled = class_exists('AkeebaStrapper'); } /** * Echoes any HTML to show before the view template * * @param string $view The current view * @param string $task The current task * @param FOFInput $input The input array (request parameters) * @param array $config The view configuration array * * @return void */ public function preRender($view, $task, $input, $config = array()) { $format = $input->getCmd('format', 'html'); if (empty($format)) { $format = 'html'; } if ($format != 'html') { return; } $platform = FOFPlatform::getInstance(); if ($platform->isCli()) { return; } if (version_compare(JVERSION, '3.0.0', 'lt')) { JHtml::_('behavior.framework'); } else { JHtml::_('behavior.core'); JHtml::_('jquery.framework'); } // Wrap output in various classes $version = new JVersion; $versionParts = explode('.', $version->RELEASE); $minorVersion = str_replace('.', '', $version->RELEASE); $majorVersion = array_shift($versionParts); if ($platform->isBackend()) { $area = $platform->isBackend() ? 'admin' : 'site'; $option = $input->getCmd('option', ''); $view = $input->getCmd('view', ''); $layout = $input->getCmd('layout', ''); $task = $input->getCmd('task', ''); $classes = array( 'joomla-version-' . $majorVersion, 'joomla-version-' . $minorVersion, $area, $option, 'view-' . $view, 'layout-' . $layout, 'task-' . $task, // We have a floating sidebar, they said. It looks great, they said. They must've been blind, I say! 'j-toggle-main', 'j-toggle-transition', 'span12', ); } elseif ($platform->isFrontend()) { // @TODO: Remove the frontend Joomla! version classes in FOF 3 $classes = array( 'joomla-version-' . $majorVersion, 'joomla-version-' . $minorVersion, ); } // Wrap output in divs echo '<div id="akeeba-bootstrap" class="' . implode($classes, ' ') . "\">\n"; echo "<div class=\"akeeba-bootstrap\">\n"; echo "<div class=\"row-fluid\">\n"; // Render submenu and toolbar (only if asked to) if ($input->getBool('render_toolbar', true)) { $this->renderButtons($view, $task, $input, $config); $this->renderLinkbar($view, $task, $input, $config); } } /** * Echoes any HTML to show after the view template * * @param string $view The current view * @param string $task The current task * @param FOFInput $input The input array (request parameters) * @param array $config The view configuration array * * @return void */ public function postRender($view, $task, $input, $config = array()) { $format = $input->getCmd('format', 'html'); if ($format != 'html' || FOFPlatform::getInstance()->isCli()) { return; } if (!FOFPlatform::getInstance()->isCli() && version_compare(JVERSION, '3.0', 'ge')) { $sidebarEntries = JHtmlSidebar::getEntries(); if (!empty($sidebarEntries)) { echo '</div>'; } } echo "</div>\n"; // Closes row-fluid div echo "</div>\n"; // Closes akeeba-bootstrap div echo "</div>\n"; // Closes joomla-version div } /** * Loads the validation script for an edit form * * @param FOFForm &$form The form we are rendering * * @return void */ protected function loadValidationScript(FOFForm &$form) { $message = $form->getView()->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED')); $js = <<<JS Joomla.submitbutton = function(task) { if (task == 'cancel' || document.formvalidator.isValid(document.id('adminForm'))) { Joomla.submitform(task, document.getElementById('adminForm')); } else { alert('$message'); } }; JS; $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { $document->addScriptDeclaration($js); } } /** * Renders the submenu (link bar) * * @param string $view The active view name * @param string $task The current task * @param FOFInput $input The input object * @param array $config Extra configuration variables for the toolbar * * @return void */ protected function renderLinkbar($view, $task, $input, $config = array()) { $style = 'classic'; if (array_key_exists('linkbar_style', $config)) { $style = $config['linkbar_style']; } if (!version_compare(JVERSION, '3.0', 'ge')) { $style = 'classic'; } switch ($style) { case 'joomla': $this->renderLinkbar_joomla($view, $task, $input); break; case 'classic': default: $this->renderLinkbar_classic($view, $task, $input); break; } } /** * Renders the submenu (link bar) in FOF's classic style, using a Bootstrapped * tab bar. * * @param string $view The active view name * @param string $task The current task * @param FOFInput $input The input object * @param array $config Extra configuration variables for the toolbar * * @return void */ protected function renderLinkbar_classic($view, $task, $input, $config = array()) { if (FOFPlatform::getInstance()->isCli()) { return; } // Do not render a submenu unless we are in the the admin area $toolbar = FOFToolbar::getAnInstance($input->getCmd('option', 'com_foobar'), $config); $renderFrontendSubmenu = $toolbar->getRenderFrontendSubmenu(); if (!FOFPlatform::getInstance()->isBackend() && !$renderFrontendSubmenu) { return; } $links = $toolbar->getLinks(); if (!empty($links)) { echo "<ul class=\"nav nav-tabs\">\n"; foreach ($links as $link) { $dropdown = false; if (array_key_exists('dropdown', $link)) { $dropdown = $link['dropdown']; } if ($dropdown) { echo "<li"; $class = 'dropdown'; if ($link['active']) { $class .= ' active'; } echo ' class="' . $class . '">'; echo '<a class="dropdown-toggle" data-toggle="dropdown" href="#">'; if ($link['icon']) { echo "<i class=\"icon icon-" . $link['icon'] . "\"></i>"; } echo $link['name']; echo '<b class="caret"></b>'; echo '</a>'; echo "\n<ul class=\"dropdown-menu\">"; foreach ($link['items'] as $item) { echo "<li"; if ($item['active']) { echo ' class="active"'; } echo ">"; if ($item['icon']) { echo "<i class=\"icon icon-" . $item['icon'] . "\"></i>"; } if ($item['link']) { echo "<a href=\"" . $item['link'] . "\">" . $item['name'] . "</a>"; } else { echo $item['name']; } echo "</li>"; } echo "</ul>\n"; } else { echo "<li"; if ($link['active']) { echo ' class="active"'; } echo ">"; if ($link['icon']) { echo "<i class=\"icon icon-" . $link['icon'] . "\"></i>"; } if ($link['link']) { echo "<a href=\"" . $link['link'] . "\">" . $link['name'] . "</a>"; } else { echo $link['name']; } } echo "</li>\n"; } echo "</ul>\n"; } } /** * Renders the submenu (link bar) using Joomla!'s style. On Joomla! 2.5 this * is a list of bar separated links, on Joomla! 3 it's a sidebar at the * left-hand side of the page. * * @param string $view The active view name * @param string $task The current task * @param FOFInput $input The input object * @param array $config Extra configuration variables for the toolbar * * @return void */ protected function renderLinkbar_joomla($view, $task, $input, $config = array()) { // On command line don't do anything if (FOFPlatform::getInstance()->isCli()) { return; } // Do not render a submenu unless we are in the the admin area $toolbar = FOFToolbar::getAnInstance($input->getCmd('option', 'com_foobar'), $config); $renderFrontendSubmenu = $toolbar->getRenderFrontendSubmenu(); if (!FOFPlatform::getInstance()->isBackend() && !$renderFrontendSubmenu) { return; } $this->renderLinkbarItems($toolbar); } /** * do the rendering job for the linkbar * * @param FOFToolbar $toolbar A toolbar object * * @return void */ protected function renderLinkbarItems($toolbar) { $links = $toolbar->getLinks(); if (!empty($links)) { foreach ($links as $link) { JHtmlSidebar::addEntry($link['name'], $link['link'], $link['active']); $dropdown = false; if (array_key_exists('dropdown', $link)) { $dropdown = $link['dropdown']; } if ($dropdown) { foreach ($link['items'] as $item) { JHtmlSidebar::addEntry('– ' . $item['name'], $item['link'], $item['active']); } } } } } /** * Renders the toolbar buttons * * @param string $view The active view name * @param string $task The current task * @param FOFInput $input The input object * @param array $config Extra configuration variables for the toolbar * * @return void */ protected function renderButtons($view, $task, $input, $config = array()) { if (FOFPlatform::getInstance()->isCli()) { return; } // Do not render buttons unless we are in the the frontend area and we are asked to do so $toolbar = FOFToolbar::getAnInstance($input->getCmd('option', 'com_foobar'), $config); $renderFrontendButtons = $toolbar->getRenderFrontendButtons(); // Load main backend language, in order to display toolbar strings // (JTOOLBAR_BACK, JTOOLBAR_PUBLISH etc etc) FOFPlatform::getInstance()->loadTranslations('joomla'); if (FOFPlatform::getInstance()->isBackend() || !$renderFrontendButtons) { return; } $bar = JToolBar::getInstance('toolbar'); $items = $bar->getItems(); $substitutions = array( 'icon-32-new' => 'icon-plus', 'icon-32-publish' => 'icon-eye-open', 'icon-32-unpublish' => 'icon-eye-close', 'icon-32-delete' => 'icon-trash', 'icon-32-edit' => 'icon-edit', 'icon-32-copy' => 'icon-th-large', 'icon-32-cancel' => 'icon-remove', 'icon-32-back' => 'icon-circle-arrow-left', 'icon-32-apply' => 'icon-ok', 'icon-32-save' => 'icon-hdd', 'icon-32-save-new' => 'icon-repeat', ); if(isset(JFactory::getApplication()->JComponentTitle)) { $title = JFactory::getApplication()->JComponentTitle; } else { $title = ''; } $html = array(); $actions = array(); // For BC we have to use the same id we're using inside other renderers (FOFHeaderHolder) //$html[] = '<div class="well" id="' . $bar->getName() . '">'; $html[] = '<div class="well" id="FOFHeaderHolder">'; $html[] = '<div class="titleHolder">'.$title.'</div>'; $html[] = '<div class="buttonsHolder">'; foreach ($items as $node) { $type = $node[0]; $button = $bar->loadButtonType($type); if ($button !== false) { if (method_exists($button, 'fetchId')) { $id = call_user_func_array(array(&$button, 'fetchId'), $node); } else { $id = null; } $action = call_user_func_array(array(&$button, 'fetchButton'), $node); $action = str_replace('class="toolbar"', 'class="toolbar btn"', $action); $action = str_replace('<span ', '<i ', $action); $action = str_replace('</span>', '</i>', $action); $action = str_replace(array_keys($substitutions), array_values($substitutions), $action); $actions[] = $action; } } $html = array_merge($html, $actions); $html[] = '</div>'; $html[] = '</div>'; echo implode("\n", $html); } /** * Renders a FOFForm for a Browse view and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * * @return string The HTML rendering of the form */ protected function renderFormBrowse(FOFForm &$form, FOFModel $model, FOFInput $input) { $html = ''; JHtml::_('behavior.multiselect'); // Joomla! 3.0+ support if (version_compare(JVERSION, '3.0', 'ge')) { JHtml::_('bootstrap.tooltip'); JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); $view = $form->getView(); $order = $view->escape($view->getLists()->order); $html .= <<<HTML <script type="text/javascript"> Joomla.orderTable = function() { table = document.getElementById("sortTable"); direction = document.getElementById("directionTable"); order = table.options[table.selectedIndex].value; if (order != '$order') { dirn = 'asc'; } else { dirn = direction.options[direction.selectedIndex].value; } Joomla.tableOrdering(order, dirn); }; </script> HTML; } else { JHtml::_('behavior.tooltip'); } // Getting all header row elements $headerFields = $form->getHeaderset(); // Get form parameters $show_header = $form->getAttribute('show_header', 1); $show_filters = $form->getAttribute('show_filters', 1); $show_pagination = $form->getAttribute('show_pagination', 1); $norows_placeholder = $form->getAttribute('norows_placeholder', ''); // Joomla! 3.0 sidebar support if (version_compare(JVERSION, '3.0', 'gt')) { $form_class = ''; if ($show_filters) { JHtmlSidebar::setAction("index.php?option=" . $input->getCmd('option') . "&view=" . FOFInflector::pluralize($input->getCmd('view')) ); } // Reorder the fields with ordering first $tmpFields = array(); $i = 1; foreach ($headerFields as $tmpField) { if ($tmpField instanceof FOFFormHeaderOrdering) { $tmpFields[0] = $tmpField; } else { $tmpFields[$i] = $tmpField; } $i++; } $headerFields = $tmpFields; ksort($headerFields, SORT_NUMERIC); } else { $form_class = 'class="form-horizontal"'; } // Pre-render the header and filter rows $header_html = ''; $filter_html = ''; $sortFields = array(); if ($show_header || $show_filters) { foreach ($headerFields as $headerField) { $header = $headerField->header; $filter = $headerField->filter; $buttons = $headerField->buttons; $options = $headerField->options; $sortable = $headerField->sortable; $tdwidth = $headerField->tdwidth; // Under Joomla! < 3.0 we can't have filter-only fields if (version_compare(JVERSION, '3.0', 'lt') && empty($header)) { continue; } // If it's a sortable field, add to the list of sortable fields if ($sortable) { $sortFields[$headerField->name] = JText::_($headerField->label); } // Get the table data width, if set if (!empty($tdwidth)) { $tdwidth = 'width="' . $tdwidth . '"'; } else { $tdwidth = ''; } if (!empty($header)) { $header_html .= "\t\t\t\t\t<th $tdwidth>" . PHP_EOL; $header_html .= "\t\t\t\t\t\t" . $header; $header_html .= "\t\t\t\t\t</th>" . PHP_EOL; } if (version_compare(JVERSION, '3.0', 'ge')) { // Joomla! 3.0 or later if (!empty($filter)) { $filter_html .= '<div class="filter-search btn-group pull-left">' . "\n"; $filter_html .= "\t" . '<label for="title" class="element-invisible">'; $filter_html .= JText::_($headerField->label); $filter_html .= "</label>\n"; $filter_html .= "\t$filter\n"; $filter_html .= "</div>\n"; if (!empty($buttons)) { $filter_html .= '<div class="btn-group pull-left hidden-phone">' . "\n"; $filter_html .= "\t$buttons\n"; $filter_html .= '</div>' . "\n"; } } elseif (!empty($options)) { $label = $headerField->label; JHtmlSidebar::addFilter( '- ' . JText::_($label) . ' -', (string) $headerField->name, JHtml::_( 'select.options', $options, 'value', 'text', $model->getState($headerField->name, ''), true ) ); } } else { // Joomla! 2.5 $filter_html .= "\t\t\t\t\t<td>" . PHP_EOL; if (!empty($filter)) { $filter_html .= "\t\t\t\t\t\t$filter" . PHP_EOL; if (!empty($buttons)) { $filter_html .= '<div class="btn-group hidden-phone">' . PHP_EOL; $filter_html .= "\t\t\t\t\t\t$buttons" . PHP_EOL; $filter_html .= '</div>' . PHP_EOL; } } elseif (!empty($options)) { $label = $headerField->label; $emptyOption = JHtml::_('select.option', '', '- ' . JText::_($label) . ' -'); array_unshift($options, $emptyOption); $attribs = array( 'onchange' => 'document.adminForm.submit();' ); $filter = JHtml::_('select.genericlist', $options, $headerField->name, $attribs, 'value', 'text', $headerField->value, false, true); $filter_html .= "\t\t\t\t\t\t$filter" . PHP_EOL; } $filter_html .= "\t\t\t\t\t</td>" . PHP_EOL; } } } // Start the form $filter_order = $form->getView()->getLists()->order; $filter_order_Dir = $form->getView()->getLists()->order_Dir; $actionUrl = FOFPlatform::getInstance()->isBackend() ? 'index.php' : JUri::root().'index.php'; if (FOFPlatform::getInstance()->isFrontend() && ($input->getCmd('Itemid', 0) != 0)) { $itemid = $input->getCmd('Itemid', 0); $uri = new JUri($actionUrl); if ($itemid) { $uri->setVar('Itemid', $itemid); } $actionUrl = JRoute::_($uri->toString()); } $html .= '<form action="'.$actionUrl.'" method="post" name="adminForm" id="adminForm" ' . $form_class . '>' . PHP_EOL; if (version_compare(JVERSION, '3.0', 'ge')) { // Joomla! 3.0+ // Get and output the sidebar, if present $sidebar = JHtmlSidebar::render(); if ($show_filters && !empty($sidebar)) { $html .= '<div id="j-sidebar-container" class="span2">' . "\n"; $html .= "\t$sidebar\n"; $html .= "</div>\n"; $html .= '<div id="j-main-container" class="span10">' . "\n"; } else { $html .= '<div id="j-main-container">' . "\n"; } // Render header search fields, if the header is enabled if ($show_header) { $html .= "\t" . '<div id="filter-bar" class="btn-toolbar">' . "\n"; $html .= "$filter_html\n"; if ($show_pagination) { // Render the pagination rows per page selection box, if the pagination is enabled $html .= "\t" . '<div class="btn-group pull-right hidden-phone">' . "\n"; $html .= "\t\t" . '<label for="limit" class="element-invisible">' . JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC') . '</label>' . "\n"; $html .= "\t\t" . $model->getPagination()->getLimitBox() . "\n"; $html .= "\t" . '</div>' . "\n"; } if (!empty($sortFields)) { // Display the field sort order $asc_sel = ($view->getLists()->order_Dir == 'asc') ? 'selected="selected"' : ''; $desc_sel = ($view->getLists()->order_Dir == 'desc') ? 'selected="selected"' : ''; $html .= "\t" . '<div class="btn-group pull-right hidden-phone">' . "\n"; $html .= "\t\t" . '<label for="directionTable" class="element-invisible">' . JText::_('JFIELD_ORDERING_DESC') . '</label>' . "\n"; $html .= "\t\t" . '<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">' . "\n"; $html .= "\t\t\t" . '<option value="">' . JText::_('JFIELD_ORDERING_DESC') . '</option>' . "\n"; $html .= "\t\t\t" . '<option value="asc" ' . $asc_sel . '>' . JText::_('JGLOBAL_ORDER_ASCENDING') . '</option>' . "\n"; $html .= "\t\t\t" . '<option value="desc" ' . $desc_sel . '>' . JText::_('JGLOBAL_ORDER_DESCENDING') . '</option>' . "\n"; $html .= "\t\t" . '</select>' . "\n"; $html .= "\t" . '</div>' . "\n\n"; // Display the sort fields $html .= "\t" . '<div class="btn-group pull-right">' . "\n"; $html .= "\t\t" . '<label for="sortTable" class="element-invisible">' . JText::_('JGLOBAL_SORT_BY') . '</label>' . "\n"; $html .= "\t\t" . '<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">' . "\n"; $html .= "\t\t\t" . '<option value="">' . JText::_('JGLOBAL_SORT_BY') . '</option>' . "\n"; $html .= "\t\t\t" . JHtml::_('select.options', $sortFields, 'value', 'text', $view->getLists()->order) . "\n"; $html .= "\t\t" . '</select>' . "\n"; $html .= "\t" . '</div>' . "\n"; } $html .= "\t</div>\n\n"; $html .= "\t" . '<div class="clearfix"> </div>' . "\n\n"; } } // Start the table output $html .= "\t\t" . '<table class="table table-striped" id="itemsList">' . PHP_EOL; // Open the table header region if required if ($show_header || ($show_filters && version_compare(JVERSION, '3.0', 'lt'))) { $html .= "\t\t\t<thead>" . PHP_EOL; } // Render the header row, if enabled if ($show_header) { $html .= "\t\t\t\t<tr>" . PHP_EOL; $html .= $header_html; $html .= "\t\t\t\t</tr>" . PHP_EOL; } // Render filter row if enabled if ($show_filters && version_compare(JVERSION, '3.0', 'lt')) { $html .= "\t\t\t\t<tr>"; $html .= $filter_html; $html .= "\t\t\t\t</tr>"; } // Close the table header region if required if ($show_header || ($show_filters && version_compare(JVERSION, '3.0', 'lt'))) { $html .= "\t\t\t</thead>" . PHP_EOL; } // Loop through rows and fields, or show placeholder for no rows $html .= "\t\t\t<tbody>" . PHP_EOL; $fields = $form->getFieldset('items'); $num_columns = count($fields); $items = $model->getItemList(); if ($count = count($items)) { $m = 1; foreach ($items as $i => $item) { $table_item = $model->getTable(); $table_item->reset(); $table_item->bind($item); $form->bind($item); $m = 1 - $m; $class = 'row' . $m; $html .= "\t\t\t\t<tr class=\"$class\">" . PHP_EOL; $fields = $form->getFieldset('items'); // Reorder the fields to have ordering first if (version_compare(JVERSION, '3.0', 'gt')) { $tmpFields = array(); $j = 1; foreach ($fields as $tmpField) { if ($tmpField instanceof FOFFormFieldOrdering) { $tmpFields[0] = $tmpField; } else { $tmpFields[$j] = $tmpField; } $j++; } $fields = $tmpFields; ksort($fields, SORT_NUMERIC); } foreach ($fields as $field) { $field->rowid = $i; $field->item = $table_item; $labelClass = $field->labelClass ? $field->labelClass : $field->labelclass; // Joomla! 2.5/3.x use different case for the same name $class = $labelClass ? 'class ="' . $labelClass . '"' : ''; $html .= "\t\t\t\t\t<td $class>" . $field->getRepeatable() . '</td>' . PHP_EOL; } $html .= "\t\t\t\t</tr>" . PHP_EOL; } } elseif ($norows_placeholder) { $html .= "\t\t\t\t<tr><td colspan=\"$num_columns\">"; $html .= JText::_($norows_placeholder); $html .= "</td></tr>\n"; } $html .= "\t\t\t</tbody>" . PHP_EOL; // Render the pagination bar, if enabled, on J! 2.5 if ($show_pagination && version_compare(JVERSION, '3.0', 'lt')) { $pagination = $model->getPagination(); $html .= "\t\t\t<tfoot>" . PHP_EOL; $html .= "\t\t\t\t<tr><td colspan=\"$num_columns\">"; if (($pagination->total > 0)) { $html .= $pagination->getListFooter(); } $html .= "</td></tr>\n"; $html .= "\t\t\t</tfoot>" . PHP_EOL; } // End the table output $html .= "\t\t" . '</table>' . PHP_EOL; // Render the pagination bar, if enabled, on J! 3.0+ if ($show_pagination && version_compare(JVERSION, '3.0', 'ge')) { $html .= $model->getPagination()->getListFooter(); } // Close the wrapper element div on Joomla! 3.0+ if (version_compare(JVERSION, '3.0', 'ge')) { $html .= "</div>\n"; } $html .= "\t" . '<input type="hidden" name="option" value="' . $input->getCmd('option') . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="view" value="' . FOFInflector::pluralize($input->getCmd('view')) . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="task" value="' . $input->getCmd('task', 'browse') . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="layout" value="' . $input->getCmd('layout', '') . '" />' . PHP_EOL; // The id field is required in Joomla! 3 front-end to prevent the pagination limit box from screwing it up. Huh!! if (version_compare(JVERSION, '3.0', 'ge') && FOFPlatform::getInstance()->isFrontend()) { $html .= "\t" . '<input type="hidden" name="id" value="' . $input->getCmd('id', '') . '" />' . PHP_EOL; } $html .= "\t" . '<input type="hidden" name="boxchecked" value="" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="hidemainmenu" value="" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="filter_order" value="' . $filter_order . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="filter_order_Dir" value="' . $filter_order_Dir . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="' . JFactory::getSession()->getFormToken() . '" value="1" />' . PHP_EOL; // End the form $html .= '</form>' . PHP_EOL; return $html; } /** * Renders a FOFForm for a Read view and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * * @return string The HTML rendering of the form */ protected function renderFormRead(FOFForm &$form, FOFModel $model, FOFInput $input) { $html = $this->renderFormRaw($form, $model, $input, 'read'); return $html; } /** * Renders a FOFForm for an Edit view and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * * @return string The HTML rendering of the form */ protected function renderFormEdit(FOFForm &$form, FOFModel $model, FOFInput $input) { // Get the key for this model's table $key = $model->getTable()->getKeyName(); $keyValue = $model->getId(); $html = ''; $validate = strtolower($form->getAttribute('validate')); if (in_array($validate, array('true', 'yes', '1', 'on'))) { JHtml::_('behavior.formvalidation'); $class = ' form-validate'; $this->loadValidationScript($form); } else { $class = ''; } // Check form enctype. Use enctype="multipart/form-data" to upload binary files in your form. $template_form_enctype = $form->getAttribute('enctype'); if (!empty($template_form_enctype)) { $enctype = ' enctype="' . $form->getAttribute('enctype') . '" '; } else { $enctype = ''; } // Check form name. Use name="yourformname" to modify the name of your form. $formname = $form->getAttribute('name'); if (empty($formname)) { $formname = 'adminForm'; } // Check form ID. Use id="yourformname" to modify the id of your form. $formid = $form->getAttribute('name'); if (empty($formid)) { $formid = 'adminForm'; } // Check if we have a custom task $customTask = $form->getAttribute('customTask'); if (empty($customTask)) { $customTask = ''; } // Get the form action URL $actionUrl = FOFPlatform::getInstance()->isBackend() ? 'index.php' : JUri::root().'index.php'; if (FOFPlatform::getInstance()->isFrontend() && ($input->getCmd('Itemid', 0) != 0)) { $itemid = $input->getCmd('Itemid', 0); $uri = new JUri($actionUrl); if ($itemid) { $uri->setVar('Itemid', $itemid); } $actionUrl = JRoute::_($uri->toString()); } $html .= '<form action="'.$actionUrl.'" method="post" name="' . $formname . '" id="' . $formid . '"' . $enctype . ' class="form-horizontal' . $class . '">' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="option" value="' . $input->getCmd('option') . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="view" value="' . $input->getCmd('view', 'edit') . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="task" value="' . $customTask . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="' . $key . '" value="' . $keyValue . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="' . JFactory::getSession()->getFormToken() . '" value="1" />' . PHP_EOL; $html .= $this->renderFormRaw($form, $model, $input, 'edit'); $html .= '</form>'; return $html; } /** * Renders a raw FOFForm and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * @param string $formType The form type e.g. 'edit' or 'read' * * @return string The HTML rendering of the form */ protected function renderFormRaw(FOFForm &$form, FOFModel $model, FOFInput $input, $formType) { $html = ''; $tabHtml = array(); // Do we have a tabbed form? $isTabbed = $form->getAttribute('tabbed', '0'); $isTabbed = in_array($isTabbed, array('true', 'yes', 'on', '1')); foreach ($form->getFieldsets() as $fieldset) { if ($isTabbed && $this->isTabFieldset($fieldset)) { continue; } elseif ($isTabbed && isset($fieldset->innertab)) { $inTab = $fieldset->innertab; } else { $inTab = '__outer'; } $tabHtml[$inTab][] = $this->renderFieldset($fieldset, $form, $model, $input, $formType, false); } // If the form is tabbed, render the tabs bars if ($isTabbed) { $html .= '<ul class="nav nav-tabs">' . PHP_EOL; foreach ($form->getFieldsets() as $fieldset) { // Only create tabs for tab fieldsets $isTabbedFieldset = $this->isTabFieldset($fieldset); if (!$isTabbedFieldset) { continue; } // Only create tabs if we do have a label if (!isset($fieldset->label) || empty($fieldset->label)) { continue; } $label = JText::_($fieldset->label); $name = $fieldset->name; $liClass = ($isTabbedFieldset == 2) ? 'class="active"' : ''; $html .= "<li $liClass><a href=\"#$name\" data-toggle=\"tab\">$label</a></li>" . PHP_EOL; } $html .= '</ul>' . "\n\n<div class=\"tab-content\">" . PHP_EOL; foreach ($form->getFieldsets() as $fieldset) { if (!$this->isTabFieldset($fieldset)) { continue; } $html .= $this->renderFieldset($fieldset, $form, $model, $input, $formType, false, $tabHtml); } $html .= "</div>\n"; } if (isset($tabHtml['__outer'])) { $html .= implode('', $tabHtml['__outer']); } return $html; } /** * Renders a raw fieldset of a FOFForm and returns the corresponding HTML * * @param stdClass &$fieldset The fieldset to render * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * @param string $formType The form type e.g. 'edit' or 'read' * @param boolean $showHeader Should I render the fieldset's header? * * @return string The HTML rendering of the fieldset */ protected function renderFieldset(stdClass &$fieldset, FOFForm &$form, FOFModel $model, FOFInput $input, $formType, $showHeader = true, &$innerHtml = null) { $html = ''; $fields = $form->getFieldset($fieldset->name); if (isset($fieldset->class)) { $class = 'class="' . $fieldset->class . '"'; } else { $class = ''; } if (isset($innerHtml[$fieldset->name])) { $innerclass = isset($fieldset->innerclass) ? ' class="' . $fieldset->innerclass . '"' : ''; $html .= "\t" . '<div id="' . $fieldset->name . '" ' . $class . '>' . PHP_EOL; $html .= "\t\t" . '<div' . $innerclass . '>' . PHP_EOL; } else { $html .= "\t" . '<div id="' . $fieldset->name . '" ' . $class . '>' . PHP_EOL; } $isTabbedFieldset = $this->isTabFieldset($fieldset); if (isset($fieldset->label) && !empty($fieldset->label) && !$isTabbedFieldset) { $html .= "\t\t" . '<h3>' . JText::_($fieldset->label) . '</h3>' . PHP_EOL; } foreach ($fields as $field) { $groupClass = $form->getFieldAttribute($field->fieldname, 'groupclass', '', $field->group); // Auto-generate label and description if needed // Field label $title = $form->getFieldAttribute($field->fieldname, 'label', '', $field->group); $emptylabel = $form->getFieldAttribute($field->fieldname, 'emptylabel', false, $field->group); if (empty($title) && !$emptylabel) { $model->getName(); $title = strtoupper($input->get('option') . '_' . $model->getName() . '_' . $field->id . '_LABEL'); } // Field description $description = $form->getFieldAttribute($field->fieldname, 'description', '', $field->group); /** * The following code is backwards incompatible. Most forms don't require a description in their form * fields. Having to use emptydescription="1" on each one of them is an overkill. Removed. */ /* $emptydescription = $form->getFieldAttribute($field->fieldname, 'emptydescription', false, $field->group); if (empty($description) && !$emptydescription) { $description = strtoupper($input->get('option') . '_' . $model->getName() . '_' . $field->id . '_DESC'); } */ if ($formType == 'read') { $inputField = $field->static; } elseif ($formType == 'edit') { $inputField = $field->input; } if (empty($title)) { $html .= "\t\t\t" . $inputField . PHP_EOL; if (!empty($description) && $formType == 'edit') { $html .= "\t\t\t\t" . '<span class="help-block">'; $html .= JText::_($description) . '</span>' . PHP_EOL; } } else { $html .= "\t\t\t" . '<div class="control-group ' . $groupClass . '">' . PHP_EOL; $html .= $this->renderFieldsetLabel($field, $form, $title); $html .= "\t\t\t\t" . '<div class="controls">' . PHP_EOL; $html .= "\t\t\t\t\t" . $inputField . PHP_EOL; if (!empty($description)) { $html .= "\t\t\t\t" . '<span class="help-block">'; $html .= JText::_($description) . '</span>' . PHP_EOL; } $html .= "\t\t\t\t" . '</div>' . PHP_EOL; $html .= "\t\t\t" . '</div>' . PHP_EOL; } } if (isset($innerHtml[$fieldset->name])) { $html .= "\t\t" . '</div>' . PHP_EOL; $html .= implode('', $innerHtml[$fieldset->name]) . PHP_EOL; $html .= "\t" . '</div>' . PHP_EOL; } else { $html .= "\t" . '</div>' . PHP_EOL; } return $html; } /** * Renders a label for a fieldset. * * @param object $field The field of the label to render * @param FOFForm &$form The form to render * @param string $title The title of the label * * @return string The rendered label */ protected function renderFieldsetLabel($field, FOFForm &$form, $title) { $html = ''; $labelClass = $field->labelClass ? $field->labelClass : $field->labelclass; // Joomla! 2.5/3.x use different case for the same name $required = $field->required; $tooltip = $form->getFieldAttribute($field->fieldname, 'tooltip', '', $field->group); if (!empty($tooltip)) { if (version_compare(JVERSION, '3.0', 'ge')) { static $loadedTooltipScript = false; if (!$loadedTooltipScript) { $js = <<<JS (function($) { $(document).ready(function() { $('.fof-tooltip').tooltip({placement: 'top'}); }); })(akeeba.jQuery); JS; $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { $document->addScriptDeclaration($js); } $loadedTooltipScript = true; } $tooltipText = '<strong>' . JText::_($title) . '</strong><br />' . JText::_($tooltip); $html .= "\t\t\t\t" . '<label class="control-label fof-tooltip ' . $labelClass . '" for="' . $field->id . '" title="' . $tooltipText . '" data-toggle="fof-tooltip">'; } else { // Joomla! 2.5 has a conflict with the jQueryUI tooltip, therefore we // have to use native Joomla! 2.5 tooltips JHtml::_('behavior.tooltip'); $tooltipText = JText::_($title) . '::' . JText::_($tooltip); $html .= "\t\t\t\t" . '<label class="control-label hasTip ' . $labelClass . '" for="' . $field->id . '" title="' . $tooltipText . '" rel="tooltip">'; } } else { $html .= "\t\t\t\t" . '<label class="control-label ' . $labelClass . '" for="' . $field->id . '">'; } $html .= JText::_($title); if ($required) { $html .= ' *'; } $html .= '</label>' . PHP_EOL; return $html; } } PK���\e��rr!libraries/fof/render/abstract.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage render * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Abstract view renderer class. The renderer is what turns XML view templates * into actual HTML code, renders the submenu links and potentially wraps the * HTML output in a div with a component-specific ID. * * @package FrameworkOnFramework * @since 2.0 */ abstract class FOFRenderAbstract { /** @var int Priority of this renderer. Higher means more important */ protected $priority = 50; /** @var int Is this renderer enabled? */ protected $enabled = false; /** * Returns the information about this renderer * * @return object */ public function getInformation() { return (object) array( 'priority' => $this->priority, 'enabled' => $this->enabled, ); } /** * Echoes any HTML to show before the view template * * @param string $view The current view * @param string $task The current task * @param FOFInput $input The input array (request parameters) * @param array $config The view configuration array * * @return void */ abstract public function preRender($view, $task, $input, $config = array()); /** * Echoes any HTML to show after the view template * * @param string $view The current view * @param string $task The current task * @param FOFInput $input The input array (request parameters) * @param array $config The view configuration array * * @return void */ abstract public function postRender($view, $task, $input, $config = array()); /** * Renders a FOFForm and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * @param string $formType The form type: edit, browse or read * @param boolean $raw If true, the raw form fields rendering (without the surrounding form tag) is returned. * * @return string The HTML rendering of the form */ public function renderForm(FOFForm &$form, FOFModel $model, FOFInput $input, $formType = null, $raw = false) { if (is_null($formType)) { $formType = $form->getAttribute('type', 'edit'); } else { $formType = strtolower($formType); } switch ($formType) { case 'browse': return $this->renderFormBrowse($form, $model, $input); break; case 'read': if ($raw) { return $this->renderFormRaw($form, $model, $input, 'read'); } else { return $this->renderFormRead($form, $model, $input); } break; default: if ($raw) { return $this->renderFormRaw($form, $model, $input, 'edit'); } else { return $this->renderFormEdit($form, $model, $input); } break; } } /** * Renders the submenu (link bar) for a category view when it is used in a * extension * * Note: this function has to be called from the addSubmenu function in * the ExtensionNameHelper class located in * administrator/components/com_ExtensionName/helpers/Extensionname.php * * Example Code: * * class ExtensionNameHelper * { * public static function addSubmenu($vName) * { * // Load FOF * include_once JPATH_LIBRARIES . '/fof/include.php'; * * if (!defined('FOF_INCLUDED')) * { * JError::raiseError('500', 'FOF is not installed'); * } * * if (version_compare(JVERSION, '3.0', 'ge')) * { * $strapper = new FOFRenderJoomla3; * } * else * { * $strapper = new FOFRenderJoomla; * } * * $strapper->renderCategoryLinkbar('com_babioonevent'); * } * } * * @param string $extension The name of the extension * @param array $config Extra configuration variables for the toolbar * * @return void */ public function renderCategoryLinkbar($extension, $config = array()) { // On command line don't do anything if (FOFPlatform::getInstance()->isCli()) { return; } // Do not render a category submenu unless we are in the the admin area if (!FOFPlatform::getInstance()->isBackend()) { return; } $toolbar = FOFToolbar::getAnInstance($extension, $config); $toolbar->renderSubmenu(); $this->renderLinkbarItems($toolbar); } /** * Renders a FOFForm for a Browse view and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * * @return string The HTML rendering of the form */ abstract protected function renderFormBrowse(FOFForm &$form, FOFModel $model, FOFInput $input); /** * Renders a FOFForm for a Read view and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * * @return string The HTML rendering of the form */ abstract protected function renderFormRead(FOFForm &$form, FOFModel $model, FOFInput $input); /** * Renders a FOFForm for an Edit view and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * * @return string The HTML rendering of the form */ abstract protected function renderFormEdit(FOFForm &$form, FOFModel $model, FOFInput $input); /** * Renders a raw FOFForm and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * @param string $formType The form type e.g. 'edit' or 'read' * * @return string The HTML rendering of the form */ abstract protected function renderFormRaw(FOFForm &$form, FOFModel $model, FOFInput $input, $formType); /** * Renders a raw fieldset of a FOFForm and returns the corresponding HTML * * @TODO: Convert to an abstract method or interface at FOF3 * * @param stdClass &$fieldset The fieldset to render * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * @param string $formType The form type e.g. 'edit' or 'read' * @param boolean $showHeader Should I render the fieldset's header? * * @return string The HTML rendering of the fieldset */ protected function renderFieldset(stdClass &$fieldset, FOFForm &$form, FOFModel $model, FOFInput $input, $formType, $showHeader = true) { } /** * Renders a label for a fieldset. * * @TODO: Convert to an abstract method or interface at FOF3 * * @param object $field The field of the label to render * @param FOFForm &$form The form to render * @param string $title The title of the label * * @return string The rendered label */ protected function renderFieldsetLabel($field, FOFForm &$form, $title) { } /** * Checks if the fieldset defines a tab pane * * @param SimpleXMLElement $fieldset * * @return boolean */ protected function isTabFieldset($fieldset) { if (!isset($fieldset->class) || !$fieldset->class) { return false; } $class = $fieldset->class; $classes = explode(' ', $class); if (!in_array('tab-pane', $classes)) { return false; } else { return in_array('active', $classes) ? 2 : 1; } } } PK���\� zGTGTlibraries/fof/render/joomla.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage render * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Default Joomla! 1.5, 1.7, 2.5 view renderer class * * @package FrameworkOnFramework * @since 2.0 */ class FOFRenderJoomla extends FOFRenderAbstract { /** * Public constructor. Determines the priority of this class and if it should be enabled */ public function __construct() { $this->priority = 50; $this->enabled = true; } /** * Echoes any HTML to show before the view template * * @param string $view The current view * @param string $task The current task * @param FOFInput $input The input array (request parameters) * @param array $config The view configuration array * * @return void */ public function preRender($view, $task, $input, $config = array()) { $format = $input->getCmd('format', 'html'); if (empty($format)) { $format = 'html'; } if ($format != 'html') { return; } $platform = FOFPlatform::getInstance(); if ($platform->isCli()) { return; } if (version_compare(JVERSION, '3.0.0', 'lt')) { JHtml::_('behavior.framework'); } else { JHtml::_('behavior.core'); JHtml::_('jquery.framework'); } // Wrap output in various classes $version = new JVersion; $versionParts = explode('.', $version->RELEASE); $minorVersion = str_replace('.', '', $version->RELEASE); $majorVersion = array_shift($versionParts); if ($platform->isBackend()) { $area = $platform->isBackend() ? 'admin' : 'site'; $option = $input->getCmd('option', ''); $view = $input->getCmd('view', ''); $layout = $input->getCmd('layout', ''); $task = $input->getCmd('task', ''); $classes = array( 'joomla-version-' . $majorVersion, 'joomla-version-' . $minorVersion, $area, $option, 'view-' . $view, 'layout-' . $layout, 'task-' . $task, ); } elseif ($platform->isFrontend()) { // @TODO: Remove the frontend Joomla! version classes in FOF 3 $classes = array( 'joomla-version-' . $majorVersion, 'joomla-version-' . $minorVersion, ); } echo '<div id="akeeba-renderjoomla" class="' . implode($classes, ' ') . "\">\n"; // Render submenu and toolbar (only if asked to) if ($input->getBool('render_toolbar', true)) { $this->renderButtons($view, $task, $input, $config); $this->renderLinkbar($view, $task, $input, $config); } } /** * Echoes any HTML to show after the view template * * @param string $view The current view * @param string $task The current task * @param FOFInput $input The input array (request parameters) * @param array $config The view configuration array * * @return void */ public function postRender($view, $task, $input, $config = array()) { $format = $input->getCmd('format', 'html'); if (empty($format)) { $format = 'html'; } if ($format != 'html') { return; } // Closing tag only if we're not in CLI if (FOFPlatform::getInstance()->isCli()) { return; } echo "</div>\n"; // Closes akeeba-renderjoomla div } /** * Renders a FOFForm for a Browse view and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * * @return string The HTML rendering of the form */ protected function renderFormBrowse(FOFForm &$form, FOFModel $model, FOFInput $input) { JHtml::_('behavior.multiselect'); // Getting all header row elements $headerFields = $form->getHeaderset(); // Start the form $html = ''; $filter_order = $form->getView()->getLists()->order; $filter_order_Dir = $form->getView()->getLists()->order_Dir; $actionUrl = FOFPlatform::getInstance()->isBackend() ? 'index.php' : JUri::root().'index.php'; if (FOFPlatform::getInstance()->isFrontend() && ($input->getCmd('Itemid', 0) != 0)) { $itemid = $input->getCmd('Itemid', 0); $uri = new JUri($actionUrl); if ($itemid) { $uri->setVar('Itemid', $itemid); } $actionUrl = JRoute::_($uri->toString()); } $html .= '<form action="'.$actionUrl.'" method="post" name="adminForm" id="adminForm">' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="option" value="' . $input->getCmd('option') . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="view" value="' . FOFInflector::pluralize($input->getCmd('view')) . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="task" value="" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="layout" value="' . $input->getCmd('layout', '') . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="boxchecked" value="" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="hidemainmenu" value="" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="filter_order" value="' . $filter_order . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="filter_order_Dir" value="' . $filter_order_Dir . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="' . JFactory::getSession()->getFormToken() . '" value="1" />' . PHP_EOL; // Start the table output $html .= "\t\t" . '<table class="adminlist" id="adminList">' . PHP_EOL; // Get form parameters $show_header = $form->getAttribute('show_header', 1); $show_filters = $form->getAttribute('show_filters', 1); $show_pagination = $form->getAttribute('show_pagination', 1); $norows_placeholder = $form->getAttribute('norows_placeholder', ''); // Open the table header region if required if ($show_header || $show_filters) { $html .= "\t\t\t<thead>" . PHP_EOL; } // Pre-render the header and filter rows if ($show_header || $show_filters) { $header_html = ''; $filter_html = ''; foreach ($headerFields as $header) { // Make sure we have a header field. Under Joomla! 2.5 we cannot // render filter-only fields. $tmpHeader = $header->header; if (empty($tmpHeader)) { continue; } $tdwidth = $header->tdwidth; if (!empty($tdwidth)) { $tdwidth = 'width="' . $tdwidth . '"'; } else { $tdwidth = ''; } $header_html .= "\t\t\t\t\t<th $tdwidth>" . PHP_EOL; $header_html .= "\t\t\t\t\t\t" . $tmpHeader; $header_html .= "\t\t\t\t\t</th>" . PHP_EOL; $filter = $header->filter; $buttons = $header->buttons; $options = $header->options; $filter_html .= "\t\t\t\t\t<td>" . PHP_EOL; if (!empty($filter)) { $filter_html .= "\t\t\t\t\t\t$filter" . PHP_EOL; if (!empty($buttons)) { $filter_html .= "\t\t\t\t\t\t<nobr>$buttons</nobr>" . PHP_EOL; } } elseif (!empty($options)) { $label = $header->label; $emptyOption = JHtml::_('select.option', '', '- ' . JText::_($label) . ' -'); array_unshift($options, $emptyOption); $attribs = array( 'onchange' => 'document.adminForm.submit();' ); $filter = JHtml::_('select.genericlist', $options, $header->name, $attribs, 'value', 'text', $header->value, false, true); $filter_html .= "\t\t\t\t\t\t$filter" . PHP_EOL; } $filter_html .= "\t\t\t\t\t</td>" . PHP_EOL; } } // Render header if enabled if ($show_header) { $html .= "\t\t\t\t<tr>" . PHP_EOL; $html .= $header_html; $html .= "\t\t\t\t</tr>" . PHP_EOL; } // Render filter row if enabled if ($show_filters) { $html .= "\t\t\t\t<tr>"; $html .= $filter_html; $html .= "\t\t\t\t</tr>"; } // Close the table header region if required if ($show_header || $show_filters) { $html .= "\t\t\t</thead>" . PHP_EOL; } // Loop through rows and fields, or show placeholder for no rows $html .= "\t\t\t<tbody>" . PHP_EOL; $fields = $form->getFieldset('items'); $num_columns = count($fields); $items = $form->getModel()->getItemList(); if ($count = count($items)) { $m = 1; foreach ($items as $i => $item) { $table_item = $form->getModel()->getTable(); $table_item->reset(); $table_item->bind($item); $form->bind($item); $m = 1 - $m; $class = 'row' . $m; $html .= "\t\t\t\t<tr class=\"$class\">" . PHP_EOL; $fields = $form->getFieldset('items'); foreach ($fields as $field) { $field->rowid = $i; $field->item = $table_item; $labelClass = $field->labelClass ? $field->labelClass : $field->labelclass; // Joomla! 2.5/3.x use different case for the same name $class = $labelClass ? 'class ="' . $labelClass . '"' : ''; $html .= "\t\t\t\t\t<td $class>" . $field->getRepeatable() . '</td>' . PHP_EOL; } $html .= "\t\t\t\t</tr>" . PHP_EOL; } } elseif ($norows_placeholder) { $html .= "\t\t\t\t<tr><td colspan=\"$num_columns\">"; $html .= JText::_($norows_placeholder); $html .= "</td></tr>\n"; } $html .= "\t\t\t</tbody>" . PHP_EOL; // Render the pagination bar, if enabled if ($show_pagination) { $pagination = $form->getModel()->getPagination(); $html .= "\t\t\t<tfoot>" . PHP_EOL; $html .= "\t\t\t\t<tr><td colspan=\"$num_columns\">"; if (($pagination->total > 0)) { $html .= $pagination->getListFooter(); } $html .= "</td></tr>\n"; $html .= "\t\t\t</tfoot>" . PHP_EOL; } // End the table output $html .= "\t\t" . '</table>' . PHP_EOL; // End the form $html .= '</form>' . PHP_EOL; return $html; } /** * Renders a FOFForm for a Read view and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * * @return string The HTML rendering of the form */ protected function renderFormRead(FOFForm &$form, FOFModel $model, FOFInput $input) { $html = $this->renderFormRaw($form, $model, $input, 'read'); return $html; } /** * Renders a FOFForm for an Edit view and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * * @return string The HTML rendering of the form */ protected function renderFormEdit(FOFForm &$form, FOFModel $model, FOFInput $input) { // Get the key for this model's table $key = $model->getTable()->getKeyName(); $keyValue = $model->getId(); JHTML::_('behavior.tooltip'); $html = ''; $validate = strtolower($form->getAttribute('validate')); $class = ''; if (in_array($validate, array('true', 'yes', '1', 'on'))) { JHtml::_('behavior.formvalidation'); $class = 'form-validate '; $this->loadValidationScript($form); } // Check form enctype. Use enctype="multipart/form-data" to upload binary files in your form. $template_form_enctype = $form->getAttribute('enctype'); if (!empty($template_form_enctype)) { $enctype = ' enctype="' . $form->getAttribute('enctype') . '" '; } else { $enctype = ''; } // Check form name. Use name="yourformname" to modify the name of your form. $formname = $form->getAttribute('name'); if (empty($formname)) { $formname = 'adminForm'; } // Check form ID. Use id="yourformname" to modify the id of your form. $formid = $form->getAttribute('name'); if (empty($formid)) { $formid = 'adminForm'; } // Check if we have a custom task $customTask = $form->getAttribute('customTask'); if (empty($customTask)) { $customTask = ''; } // Get the form action URL $actionUrl = FOFPlatform::getInstance()->isBackend() ? 'index.php' : JUri::root().'index.php'; if (FOFPlatform::getInstance()->isFrontend() && ($input->getCmd('Itemid', 0) != 0)) { $itemid = $input->getCmd('Itemid', 0); $uri = new JUri($actionUrl); if ($itemid) { $uri->setVar('Itemid', $itemid); } $actionUrl = JRoute::_($uri->toString()); } $html .= '<form action="'.$actionUrl.'" method="post" name="' . $formname . '" id="' . $formid . '"' . $enctype . ' class="' . $class . '">' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="option" value="' . $input->getCmd('option') . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="view" value="' . $input->getCmd('view', 'edit') . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="task" value="' . $customTask . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="' . $key . '" value="' . $keyValue . '" />' . PHP_EOL; $html .= "\t" . '<input type="hidden" name="' . JFactory::getSession()->getFormToken() . '" value="1" />' . PHP_EOL; $html .= $this->renderFormRaw($form, $model, $input, 'edit'); $html .= '</form>'; return $html; } /** * Renders a raw FOFForm and returns the corresponding HTML * * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * @param string $formType The form type e.g. 'edit' or 'read' * * @return string The HTML rendering of the form */ protected function renderFormRaw(FOFForm &$form, FOFModel $model, FOFInput $input, $formType) { $html = ''; foreach ($form->getFieldsets() as $fieldset) { $html .= $this->renderFieldset($fieldset, $form, $model, $input, $formType, false); } return $html; } /** * Renders a raw fieldset of a FOFForm and returns the corresponding HTML * * @param stdClass &$fieldset The fieldset to render * @param FOFForm &$form The form to render * @param FOFModel $model The model providing our data * @param FOFInput $input The input object * @param string $formType The form type e.g. 'edit' or 'read' * @param boolean $showHeader Should I render the fieldset's header? * * @return string The HTML rendering of the fieldset */ protected function renderFieldset(stdClass &$fieldset, FOFForm &$form, FOFModel $model, FOFInput $input, $formType, $showHeader = true) { $html = ''; $fields = $form->getFieldset($fieldset->name); if (isset($fieldset->class)) { $class = 'class="' . $fieldset->class . '"'; } else { $class = ''; } $element = empty($fields) ? 'div' : 'fieldset'; $html .= "\t" . '<' . $element . ' id="' . $fieldset->name . '" ' . $class . '>' . PHP_EOL; $isTabbedFieldset = $this->isTabFieldset($fieldset); if (isset($fieldset->label) && !empty($fieldset->label) && !$isTabbedFieldset) { $html .= "\t\t" . '<h3>' . JText::_($fieldset->label) . '</h3>' . PHP_EOL; } foreach ($fields as $field) { $groupClass = $form->getFieldAttribute($field->fieldname, 'groupclass', '', $field->group); // Auto-generate label and description if needed // Field label $title = $form->getFieldAttribute($field->fieldname, 'label', '', $field->group); $emptylabel = $form->getFieldAttribute($field->fieldname, 'emptylabel', false, $field->group); if (empty($title) && !$emptylabel) { $model->getName(); $title = strtoupper($input->get('option') . '_' . $model->getName() . '_' . $field->id . '_LABEL'); } // Field description $description = $form->getFieldAttribute($field->fieldname, 'description', '', $field->group); /** * The following code is backwards incompatible. Most forms don't require a description in their form * fields. Having to use emptydescription="1" on each one of them is an overkill. Removed. */ /* $emptydescription = $form->getFieldAttribute($field->fieldname, 'emptydescription', false, $field->group); if (empty($description) && !$emptydescription) { $description = strtoupper($input->get('option') . '_' . $model->getName() . '_' . $field->id . '_DESC'); } */ if ($formType == 'read') { $inputField = $field->static; } elseif ($formType == 'edit') { $inputField = $field->input; } if (empty($title)) { $html .= "\t\t\t" . $inputField . PHP_EOL; if (!empty($description) && $formType == 'edit') { $html .= "\t\t\t\t" . '<span class="help-block">'; $html .= JText::_($description) . '</span>' . PHP_EOL; } } else { $html .= "\t\t\t" . '<div class="fof-row ' . $groupClass . '">' . PHP_EOL; $html .= $this->renderFieldsetLabel($field, $form, $title); $html .= "\t\t\t\t" . $inputField . PHP_EOL; if (!empty($description)) { $html .= "\t\t\t\t" . '<span class="help-block">'; $html .= JText::_($description) . '</span>' . PHP_EOL; } $html .= "\t\t\t" . '</div>' . PHP_EOL; } } $element = empty($fields) ? 'div' : 'fieldset'; $html .= "\t" . '</' . $element . '>' . PHP_EOL; return $html; } /** * Renders a label for a fieldset. * * @param object $field The field of the label to render * @param FOFForm &$form The form to render * @param string $title The title of the label * * @return string The rendered label */ protected function renderFieldsetLabel($field, FOFForm &$form, $title) { $html = ''; $labelClass = $field->labelClass ? $field->labelClass : $field->labelclass; // Joomla! 2.5/3.x use different case for the same name $required = $field->required; if ($required) { $labelClass .= ' required'; } $tooltip = $form->getFieldAttribute($field->fieldname, 'tooltip', '', $field->group); if (!empty($tooltip)) { JHtml::_('behavior.tooltip'); $tooltipText = JText::_($title) . '::' . JText::_($tooltip); $labelClass .= ' hasTip'; $html .= "\t\t\t\t" . '<label id="' . $field->id . '-lbl" class="' . $labelClass . '" for="' . $field->id . '" title="' . $tooltipText . '" rel="tooltip">'; } else { $html .= "\t\t\t\t" . '<label class="' . $labelClass . '" for="' . $field->id . '">'; } $html .= JText::_($title); if ($required) { $html .= '<span class="star"> *</span>'; } $html .= "\t\t\t\t" . '</label>' . PHP_EOL; return $html; } /** * Loads the validation script for an edit form * * @param FOFForm &$form The form we are rendering * * @return void */ protected function loadValidationScript(FOFForm &$form) { $message = $form->getView()->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED')); $js = <<<JS Joomla.submitbutton = function(task) { if (task == 'cancel' || document.formvalidator.isValid(document.id('adminForm'))) { Joomla.submitform(task, document.getElementById('adminForm')); } else { alert('$message'); } }; JS; $document = FOFPlatform::getInstance()->getDocument(); if ($document instanceof JDocument) { $document->addScriptDeclaration($js); } } /** * Renders the submenu (link bar) * * @param string $view The active view name * @param string $task The current task * @param FOFInput $input The input object * @param array $config Extra configuration variables for the toolbar * * @return void */ protected function renderLinkbar($view, $task, $input, $config = array()) { // On command line don't do anything if (FOFPlatform::getInstance()->isCli()) { return; } // Do not render a submenu unless we are in the the admin area $toolbar = FOFToolbar::getAnInstance($input->getCmd('option', 'com_foobar'), $config); $renderFrontendSubmenu = $toolbar->getRenderFrontendSubmenu(); if (!FOFPlatform::getInstance()->isBackend() && !$renderFrontendSubmenu) { return; } $this->renderLinkbarItems($toolbar); } /** * do the rendering job for the linkbar * * @param FOFToolbar $toolbar A toolbar object * * @return void */ protected function renderLinkbarItems($toolbar) { $links = $toolbar->getLinks(); if (!empty($links)) { foreach ($links as $link) { JSubMenuHelper::addEntry($link['name'], $link['link'], $link['active']); } } } /** * Renders the toolbar buttons * * @param string $view The active view name * @param string $task The current task * @param FOFInput $input The input object * @param array $config Extra configuration variables for the toolbar * * @return void */ protected function renderButtons($view, $task, $input, $config = array()) { // On command line don't do anything if (FOFPlatform::getInstance()->isCli()) { return; } // Do not render buttons unless we are in the the frontend area and we are asked to do so $toolbar = FOFToolbar::getAnInstance($input->getCmd('option', 'com_foobar'), $config); $renderFrontendButtons = $toolbar->getRenderFrontendButtons(); if (FOFPlatform::getInstance()->isBackend() || !$renderFrontendButtons) { return; } // Load main backend language, in order to display toolbar strings // (JTOOLBAR_BACK, JTOOLBAR_PUBLISH etc etc) FOFPlatform::getInstance()->loadTranslations('joomla'); $title = JFactory::getApplication()->get('JComponentTitle'); $bar = JToolBar::getInstance('toolbar'); // Delete faux links, since if SEF is on, Joomla will follow the link instead of submitting the form $bar_content = str_replace('href="#"', '', $bar->render()); echo '<div id="FOFHeaderHolder">', $bar_content, $title, '<div style="clear:both"></div>', '</div>'; } } PK���\��& libraries/fof/render/joomla3.phpnu�[���<?php /** * @package FrameworkOnFramework * @subpackage render * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; /** * Joomla! 3 view renderer class * * @package FrameworkOnFramework * @since 2.0 */ class FOFRenderJoomla3 extends FOFRenderStrapper { /** * Public constructor. Determines the priority of this class and if it should be enabled */ public function __construct() { $this->priority = 55; $this->enabled = version_compare(JVERSION, '3.0', 'ge'); } /** * Echoes any HTML to show before the view template * * @param string $view The current view * @param string $task The current task * @param FOFInput $input The input array (request parameters) * @param array $config The view configuration array * * @return void */ public function preRender($view, $task, $input, $config = array()) { $format = $input->getCmd('format', 'html'); if (empty($format)) { $format = 'html'; } if ($format != 'html') { return; } $platform = FOFPlatform::getInstance(); if ($platform->isCli()) { return; } JHtml::_('behavior.core'); JHtml::_('jquery.framework'); if ($platform->isBackend()) { // Wrap output in various classes $version = new JVersion; $versionParts = explode('.', $version->RELEASE); $minorVersion = str_replace('.', '', $version->RELEASE); $majorVersion = array_shift($versionParts); $option = $input->getCmd('option', ''); $view = $input->getCmd('view', ''); $layout = $input->getCmd('layout', ''); $task = $input->getCmd('task', ''); $classes = ' class="' . implode(array( 'joomla-version-' . $majorVersion, 'joomla-version-' . $minorVersion, 'admin', $option, 'view-' . $view, 'layout-' . $layout, 'task-' . $task, ), ' ') . '"'; } else { $classes = ''; } echo '<div id="akeeba-renderjoomla"' . $classes . ">\n"; // Render the submenu and toolbar if ($input->getBool('render_toolbar', true)) { $this->renderButtons($view, $task, $input, $config); $this->renderLinkbar($view, $task, $input, $config); } } /** * Echoes any HTML to show after the view template * * @param string $view The current view * @param string $task The current task * @param FOFInput $input The input array (request parameters) * @param array $config The view configuration array * * @return void */ public function postRender($view, $task, $input, $config = array()) { $format = $input->getCmd('format', 'html'); if (empty($format)) { $format = 'html'; } if ($format != 'html') { return; } // Closing tag only if we're not in CLI if (FOFPlatform::getInstance()->isCli()) { return; } echo "</div>\n"; // Closes akeeba-renderjoomla div } /** * Renders the submenu (link bar) * * @param string $view The active view name * @param string $task The current task * @param FOFInput $input The input object * @param array $config Extra configuration variables for the toolbar * * @return void */ protected function renderLinkbar($view, $task, $input, $config = array()) { $style = 'joomla'; if (array_key_exists('linkbar_style', $config)) { $style = $config['linkbar_style']; } switch ($style) { case 'joomla': $this->renderLinkbar_joomla($view, $task, $input); break; case 'classic': default: $this->renderLinkbar_classic($view, $task, $input); break; } } /** * Renders a label for a fieldset. * * @param object $field The field of the label to render * @param FOFForm &$form The form to render * @param string $title The title of the label * * @return string The rendered label */ protected function renderFieldsetLabel($field, FOFForm &$form, $title) { $html = ''; $labelClass = $field->labelClass ? $field->labelClass : $field->labelclass; // Joomla! 2.5/3.x use different case for the same name $required = $field->required; $tooltip = $form->getFieldAttribute($field->fieldname, 'tooltip', '', $field->group); if (!empty($tooltip)) { JHtml::_('bootstrap.tooltip'); $tooltipText = '<strong>' . JText::_($title) . '</strong><br />' . JText::_($tooltip); $html .= "\t\t\t\t" . '<label class="control-label hasTooltip ' . $labelClass . '" for="' . $field->id . '" title="' . $tooltipText . '" rel="tooltip">'; } else { $html .= "\t\t\t\t" . '<label class="control-label ' . $labelClass . '" for="' . $field->id . '">'; } $html .= JText::_($title); if ($required) { $html .= ' *'; } $html .= '</label>' . PHP_EOL; return $html; } } PK���\�V�libraries/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\��#�+�+libraries/idna_convert/uctc.phpnu�[���<?php /** * UCTC - The Unicode Transcoder * * Converts between various flavours of Unicode representations like UCS-4 or UTF-8 * Supported schemes: * - UCS-4 Little Endian / Big Endian / Array (partially) * - UTF-16 Little Endian / Big Endian (not yet) * - UTF-8 * - UTF-7 * - UTF-7 IMAP (modified UTF-7) * * @package phlyMail Nahariya 4.0+ Default branch * @author Matthias Sommerfeld <mso@phlyLabs.de> * @copyright 2003-2009 phlyLabs Berlin, http://phlylabs.de * @version 0.0.6 2009-05-10 */ class uctc { private static $mechs = array('ucs4', /*'ucs4le', 'ucs4be', */'ucs4array', /*'utf16', 'utf16le', 'utf16be', */'utf8', 'utf7', 'utf7imap'); private static $allow_overlong = false; private static $safe_mode; private static $safe_char; /** * The actual conversion routine * * @param mixed $data The data to convert, usually a string, array when converting from UCS-4 array * @param string $from Original encoding of the data * @param string $to Target encoding of the data * @param bool $safe_mode SafeMode tries to correct invalid codepoints * @return mixed False on failure, String or array on success, depending on target encoding * @access public * @since 0.0.1 */ public static function convert($data, $from, $to, $safe_mode = false, $safe_char = 0xFFFC) { self::$safe_mode = ($safe_mode) ? true : false; self::$safe_char = ($safe_char) ? $safe_char : 0xFFFC; if (self::$safe_mode) self::$allow_overlong = true; if (!in_array($from, self::$mechs)) throw new Exception('Invalid input format specified'); if (!in_array($to, self::$mechs)) throw new Exception('Invalid output format specified'); if ($from != 'ucs4array') eval('$data = self::'.$from.'_ucs4array($data);'); if ($to != 'ucs4array') eval('$data = self::ucs4array_'.$to.'($data);'); return $data; } /** * This converts an UTF-8 encoded string to its UCS-4 representation * * @param string $input The UTF-8 string to convert * @return array Array of 32bit values representing each codepoint * @access private */ private static function utf8_ucs4array($input) { $output = array(); $out_len = 0; $inp_len = strlen($input); $mode = 'next'; $test = 'none'; for ($k = 0; $k < $inp_len; ++$k) { $v = ord($input{$k}); // Extract byte from input string if ($v < 128) { // We found an ASCII char - put into stirng as is $output[$out_len] = $v; ++$out_len; if ('add' == $mode) { if (self::$safe_mode) { $output[$out_len-2] = self::$safe_char; $mode = 'next'; } else { throw new Exception('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); } } continue; } if ('next' == $mode) { // Try to find the next start byte; determine the width of the Unicode char $start_byte = $v; $mode = 'add'; $test = 'range'; if ($v >> 5 == 6) { // &110xxxxx 10xxxxx $next_byte = 0; // Tells, how many times subsequent bitmasks must rotate 6bits to the left $v = ($v - 192) << 6; } elseif ($v >> 4 == 14) { // &1110xxxx 10xxxxxx 10xxxxxx $next_byte = 1; $v = ($v - 224) << 12; } elseif ($v >> 3 == 30) { // &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx $next_byte = 2; $v = ($v - 240) << 18; } elseif (self::$safe_mode) { $mode = 'next'; $output[$out_len] = self::$safe_char; ++$out_len; continue; } else { throw new Exception('This might be UTF-8, but I don\'t understand it at byte '.$k); } if ($inp_len-$k-$next_byte < 2) { $output[$out_len] = self::$safe_char; $mode = 'no'; continue; } if ('add' == $mode) { $output[$out_len] = (int) $v; ++$out_len; continue; } } if ('add' == $mode) { if (!self::$allow_overlong && $test == 'range') { $test = 'none'; if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { throw new Exception('Bogus UTF-8 character detected (out of legal range) at byte '.$k); } } if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx $v = ($v-128) << ($next_byte*6); $output[($out_len-1)] += $v; --$next_byte; } else { if (self::$safe_mode) { $output[$out_len-1] = ord(self::$safe_char); $k--; $mode = 'next'; continue; } else { throw new Exception('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); } } if ($next_byte < 0) { $mode = 'next'; } } } // for return $output; } /** * Convert UCS-4 string into UTF-8 string * See utf8_ucs4array() for details * @access private */ private static function ucs4array_utf8($input) { $output = ''; foreach ($input as $v) { if ($v < 128) { // 7bit are transferred literally $output .= chr($v); } elseif ($v < (1 << 11)) { // 2 bytes $output .= chr(192+($v >> 6)).chr(128+($v & 63)); } elseif ($v < (1 << 16)) { // 3 bytes $output .= chr(224+($v >> 12)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63)); } elseif ($v < (1 << 21)) { // 4 bytes $output .= chr(240+($v >> 18)).chr(128+(($v >> 12) & 63)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63)); } elseif (self::$safe_mode) { $output .= self::$safe_char; } else { throw new Exception('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k); } } return $output; } private static function utf7imap_ucs4array($input) { return self::utf7_ucs4array(str_replace(',', '/', $input), '&'); } private static function utf7_ucs4array($input, $sc = '+') { $output = array(); $out_len = 0; $inp_len = strlen($input); $mode = 'd'; $b64 = ''; for ($k = 0; $k < $inp_len; ++$k) { $c = $input{$k}; if (0 == ord($c)) continue; // Ignore zero bytes if ('b' == $mode) { // Sequence got terminated if (!preg_match('![A-Za-z0-9/'.preg_quote($sc, '!').']!', $c)) { if ('-' == $c) { if ($b64 == '') { $output[$out_len] = ord($sc); $out_len++; $mode = 'd'; continue; } } $tmp = base64_decode($b64); $tmp = substr($tmp, -1 * (strlen($tmp) % 2)); for ($i = 0; $i < strlen($tmp); $i++) { if ($i % 2) { $output[$out_len] += ord($tmp{$i}); $out_len++; } else { $output[$out_len] = ord($tmp{$i}) << 8; } } $mode = 'd'; $b64 = ''; continue; } else { $b64 .= $c; } } if ('d' == $mode) { if ($sc == $c) { $mode = 'b'; continue; } $output[$out_len] = ord($c); $out_len++; } } return $output; } private static function ucs4array_utf7imap($input) { return str_replace('/', ',', self::ucs4array_utf7($input, '&')); } private static function ucs4array_utf7($input, $sc = '+') { $output = ''; $mode = 'd'; $b64 = ''; while (true) { $v = (!empty($input)) ? array_shift($input) : false; $is_direct = (false !== $v) ? (0x20 <= $v && $v <= 0x7e && $v != ord($sc)) : true; if ($mode == 'b') { if ($is_direct) { if ($b64 == chr(0).$sc) { $output .= $sc.'-'; $b64 = ''; } elseif ($b64) { $output .= $sc.str_replace('=', '', base64_encode($b64)).'-'; $b64 = ''; } $mode = 'd'; } elseif (false !== $v) { $b64 .= chr(($v >> 8) & 255). chr($v & 255); } } if ($mode == 'd' && false !== $v) { if ($is_direct) { $output .= chr($v); } else { $b64 = chr(($v >> 8) & 255). chr($v & 255); $mode = 'b'; } } if (false === $v && $b64 == '') break; } return $output; } /** * Convert UCS-4 array into UCS-4 string (Little Endian at the moment) * @access private */ private static function ucs4array_ucs4($input) { $output = ''; foreach ($input as $v) { $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255); } return $output; } /** * Convert UCS-4 string (LE in the moment) into UCS-4 garray * @access private */ private static function ucs4_ucs4array($input) { $output = array(); $inp_len = strlen($input); // Input length must be dividable by 4 if ($inp_len % 4) { throw new Exception('Input UCS4 string is broken'); } // Empty input - return empty output if (!$inp_len) return $output; for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) { if (!($i % 4)) { // Increment output position every 4 input bytes $out_len++; $output[$out_len] = 0; } $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); } return $output; } } ?>PK���\w<z��!libraries/idna_convert/ReadMe.txtnu�[���******************************************************************************* * * * IDNA Convert (idna_convert.class.php) * * * * http://idnaconv.phlymail.de mailto:phlymail@phlylabs.de * ******************************************************************************* * (c) 2004-2011 phlyLabs, Berlin * * This file is encoded in UTF-8 * ******************************************************************************* Introduction ------------ The class idna_convert allows to convert internationalized domain names (see RFC 3490, 3491, 3492 and 3454 for detials) as they can be used with various registries worldwide to be translated between their original (localized) form and their encoded form as it will be used in the DNS (Domain Name System). The class provides two public methods, encode() and decode(), which do exactly what you would expect them to do. You are allowed to use complete domain names, simple strings and complete email addresses as well. That means, that you might use any of the following notations: - www.nörgler.com - xn--nrgler-wxa - xn--brse-5qa.xn--knrz-1ra.info Errors, incorrectly encoded or invalid strings will lead to either a FALSE response (when in strict mode) or to only partially converted strings. You can query the occured error by calling the method get_last_error(). Unicode strings are expected to be either UTF-8 strings, UCS-4 strings or UCS-4 arrays. The default format is UTF-8. For setting different encodings, you can call the method setParams() - please see the inline documentation for details. ACE strings (the Punycode form) are always 7bit ASCII strings. ATTENTION: As of version 0.6.0 this class is written in the OOP style of PHP5. Since PHP4 is no longer actively maintained, you should switch to PHP5 as fast as possible. We expect to see no compatibility issues with the upcoming PHP6, too. ATTENTION: BC break! As of version 0.6.4 the class per default allows the German ligature ß to be encoded as the DeNIC, the registry for .DE allows domains containing ß. In older builds "ß" was mapped to "ss". Should you still need this behaviour, see example 5 below. ATTENTION: As of version 0.8.0 the class fully supports IDNA 2008. Thus the aforementioned parameter is deprecated and replaced by a parameter to switch between the standards. See the updated example 5 below. Files ----- idna_convert.class.php - The actual class example.php - An example web page for converting transcode_wrapper.php - Convert various encodings, see below uctc.php - phlyLabs' Unicode Transcoder, see below ReadMe.txt - This file LICENCE - The LGPL licence file The class is contained in idna_convert.class.php. Examples -------- 1. Say we wish to encode the domain name nörgler.com: // Include the class require_once('idna_convert.class.php'); // Instantiate it $IDN = new idna_convert(); // The input string, if input is not UTF-8 or UCS-4, it must be converted before $input = utf8_encode('nörgler.com'); // Encode it to its punycode presentation $output = $IDN->encode($input); // Output, what we got now echo $output; // This will read: xn--nrgler-wxa.com 2. We received an email from a punycoded domain and are willing to learn, how the domain name reads originally // Include the class require_once('idna_convert.class.php'); // Instantiate it $IDN = new idna_convert(); // The input string $input = 'andre@xn--brse-5qa.xn--knrz-1ra.info'; // Encode it to its punycode presentation $output = $IDN->decode($input); // Output, what we got now, if output should be in a format different to UTF-8 // or UCS-4, you will have to convert it before outputting it echo utf8_decode($output); // This will read: andre@börse.knörz.info 3. The input is read from a UCS-4 coded file and encoded line by line. By appending the optional second parameter we tell enode() about the input format to be used // Include the class require_once('idna_convert.class.php'); // Instantiate it $IDN = new dinca_convert(); // Iterate through the input file line by line foreach (file('ucs4-domains.txt') as $line) { echo $IDN->encode(trim($line), 'ucs4_string'); echo "\n"; } 4. We wish to convert a whole URI into the IDNA form, but leave the path or query string component of it alone. Just using encode() would lead to mangled paths or query strings. Here the public method encode_uri() comes into play: // Include the class require_once('idna_convert.class.php'); // Instantiate it $IDN = new idna_convert(); // The input string, a whole URI in UTF-8 (!) $input = 'http://nörgler:secret@nörgler.com/my_päth_is_not_ÄSCII/'); // Encode it to its punycode presentation $output = $IDN->encode_uri($input); // Output, what we got now echo $output; // http://nörgler:secret@xn--nrgler-wxa.com/my_päth_is_not_ÄSCII/ 5. To support IDNA 2008, the class needs to be invoked with an additional parameter. This can also be achieved on an instance. // Include the class require_once('idna_convert.class.php'); // Instantiate it $IDN = new idna_convert(array('idn_version' => 2008)); // Sth. containing the German letter ß $input = 'meine-straße.de'); // Encode it to its punycode presentation $output = $IDN->encode_uri($input); // Output, what we got now echo $output; // xn--meine-strae-46a.de // Switch back to old IDNA 2003, the original standard $IDN->set_parameter('idn_version', 2003); // Sth. containing the German letter ß $input = 'meine-straße.de'); // Encode it to its punycode presentation $output = $IDN->encode_uri($input); // Output, what we got now echo $output; // meine-strasse.de Transcode wrapper ----------------- In case you have strings in different encoding than ISO-8859-1 and UTF-8 you might need to translate these strings to UTF-8 before feeding the IDNA converter with it. PHP's built in functions utf8_encode() and utf8_decode() can only deal with ISO-8859-1. Use the file transcode_wrapper.php for the conversion. It requires either iconv, libiconv or mbstring installed together with one of the relevant PHP extensions. The functions you will find useful are encode_utf8() as a replacement for utf8_encode() and decode_utf8() as a replacement for utf8_decode(). Example usage: <?php require_once('idna_convert.class.php'); require_once('transcode_wrapper.php'); $mystring = '<something in e.g. ISO-8859-15'; $mystring = encode_utf8($mystring, 'ISO-8859-15'); echo $IDN->encode($mystring); ?> UCTC - Unicode Transcoder ------------------------- Another class you might find useful when dealing with one or more of the Unicode encoding flavours. The class is static, it requires PHP5. It can transcode into each other: - UCS-4 string / array - UTF-8 - UTF-7 - UTF-7 IMAP (modified UTF-7) All encodings expect / return a string in the given format, with one major exception: UCS-4 array is jsut an array, where each value represents one codepoint in the string, i.e. every value is a 32bit integer value. Example usage: <?php require_once('uctc.php'); $mystring = 'nörgler.com'; echo uctc::convert($mystring, 'utf8', 'utf7imap'); ?> Contact us ---------- In case of errors, bugs, questions, wishes, please don't hesitate to contact us under the email address above. The team of phlyLabs http://phlylabs.de mailto:phlymail@phlylabs.dePK���\�(:rrrr-libraries/idna_convert/idna_convert.class.phpnu�[���<?php // {{{ license /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */ // // +----------------------------------------------------------------------+ // | This library is free software; you can redistribute it and/or modify | // | it under the terms of the GNU Lesser General Public License as | // | published by the Free Software Foundation; either version 2.1 of the | // | License, or (at your option) any later version. | // | | // | This library is distributed in the hope that it will be useful, but | // | WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | // | Lesser General Public License for more details. | // | | // | You should have received a copy of the GNU Lesser General Public | // | License along with this library; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | // | USA. | // +----------------------------------------------------------------------+ // // }}} /** * Encode/decode Internationalized Domain Names. * * The class allows to convert internationalized domain names * (see RFC 3490 for details) as they can be used with various registries worldwide * to be translated between their original (localized) form and their encoded form * as it will be used in the DNS (Domain Name System). * * The class provides two public methods, encode() and decode(), which do exactly * what you would expect them to do. You are allowed to use complete domain names, * simple strings and complete email addresses as well. That means, that you might * use any of the following notations: * * - www.nörgler.com * - xn--nrgler-wxa * - xn--brse-5qa.xn--knrz-1ra.info * * Unicode input might be given as either UTF-8 string, UCS-4 string or UCS-4 array. * Unicode output is available in the same formats. * You can select your preferred format via {@link set_paramter()}. * * ACE input and output is always expected to be ASCII. * * @author Matthias Sommerfeld <mso@phlylabs.de> * @copyright 2004-2011 phlyLabs Berlin, http://phlylabs.de * @version 0.8.0 2011-03-11 */ class idna_convert { // NP See below // Internal settings, do not mess with them protected $_punycode_prefix = 'xn--'; protected $_invalid_ucs = 0x80000000; protected $_max_ucs = 0x10FFFF; protected $_base = 36; protected $_tmin = 1; protected $_tmax = 26; protected $_skew = 38; protected $_damp = 700; protected $_initial_bias = 72; protected $_initial_n = 0x80; protected $_sbase = 0xAC00; protected $_lbase = 0x1100; protected $_vbase = 0x1161; protected $_tbase = 0x11A7; protected $_lcount = 19; protected $_vcount = 21; protected $_tcount = 28; protected $_ncount = 588; // _vcount * _tcount protected $_scount = 11172; // _lcount * _tcount * _vcount protected $_error = false; protected static $_mb_string_overload = null; // See {@link set_paramter()} for details of how to change the following // settings from within your script / application protected $_api_encoding = 'utf8'; // Default input charset is UTF-8 protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden protected $_strict_mode = false; // Behave strict or not protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008 /** * the constructor * * @param array $options * @return boolean * @since 0.5.2 */ public function __construct($options = false) { $this->slast = $this->_sbase + $this->_lcount * $this->_vcount * $this->_tcount; // If parameters are given, pass these to the respective method if (is_array($options)) { $this->set_parameter($options); } // populate mbstring overloading cache if not set if (self::$_mb_string_overload === null) { self::$_mb_string_overload = (extension_loaded('mbstring') && (ini_get('mbstring.func_overload') & 0x02) === 0x02); } } /** * Sets a new option value. Available options and values: * [encoding - Use either UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8, * 'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always UTF-8] * [overlong - Unicode does not allow unnecessarily long encodings of chars, * to allow this, set this parameter to true, else to false; * default is false.] * [strict - true: strict mode, good for registration purposes - Causes errors * on failures; false: loose mode, ideal for "wildlife" applications * by silently ignoring errors and returning the original input instead * * @param mixed Parameter to set (string: single parameter; array of Parameter => Value pairs) * @param string Value to use (if parameter 1 is a string) * @return boolean true on success, false otherwise */ public function set_parameter($option, $value = false) { if (!is_array($option)) { $option = array($option => $value); } foreach ($option as $k => $v) { switch ($k) { case 'encoding': switch ($v) { case 'utf8': case 'ucs4_string': case 'ucs4_array': $this->_api_encoding = $v; break; default: $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); return false; } break; case 'overlong': $this->_allow_overlong = ($v) ? true : false; break; case 'strict': $this->_strict_mode = ($v) ? true : false; break; case 'idn_version': if (in_array($v, array('2003', '2008'))) { $this->_idn_version = $v; } else { $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); } break; case 'encode_german_sz': // Deprecated if (!$v) { self::$NP['replacemaps'][0xDF] = array(0x73, 0x73); } else { unset(self::$NP['replacemaps'][0xDF]); } break; default: $this->_error('Set Parameter: Unknown option '.$k); return false; } } return true; } /** * Decode a given ACE domain name * @param string Domain name (ACE string) * [@param string Desired output encoding, see {@link set_parameter}] * @return string Decoded Domain name (UTF-8 or UCS-4) */ public function decode($input, $one_time_encoding = false) { // Optionally set if ($one_time_encoding) { switch ($one_time_encoding) { case 'utf8': case 'ucs4_string': case 'ucs4_array': break; default: $this->_error('Unknown encoding '.$one_time_encoding); return false; } } // Make sure to drop any newline characters around $input = trim($input); // Negotiate input and try to determine, whether it is a plain string, // an email address or something like a complete URL if (strpos($input, '@')) { // Maybe it is an email address // No no in strict mode if ($this->_strict_mode) { $this->_error('Only simple domain name parts can be handled in strict mode'); return false; } list ($email_pref, $input) = explode('@', $input, 2); $arr = explode('.', $input); foreach ($arr as $k => $v) { if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { $conv = $this->_decode($v); if ($conv) $arr[$k] = $conv; } } $input = join('.', $arr); $arr = explode('.', $email_pref); foreach ($arr as $k => $v) { if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { $conv = $this->_decode($v); if ($conv) $arr[$k] = $conv; } } $email_pref = join('.', $arr); $return = $email_pref . '@' . $input; } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters) // No no in strict mode if ($this->_strict_mode) { $this->_error('Only simple domain name parts can be handled in strict mode'); return false; } $parsed = parse_url($input); if (isset($parsed['host'])) { $arr = explode('.', $parsed['host']); foreach ($arr as $k => $v) { $conv = $this->_decode($v); if ($conv) $arr[$k] = $conv; } $parsed['host'] = join('.', $arr); $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')) .(empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@') .$parsed['host'] .(empty($parsed['port']) ? '' : ':'.$parsed['port']) .(empty($parsed['path']) ? '' : $parsed['path']) .(empty($parsed['query']) ? '' : '?'.$parsed['query']) .(empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']); } else { // parse_url seems to have failed, try without it $arr = explode('.', $input); foreach ($arr as $k => $v) { $conv = $this->_decode($v); $arr[$k] = ($conv) ? $conv : $v; } $return = join('.', $arr); } } else { // Otherwise we consider it being a pure domain name string $return = $this->_decode($input); if (!$return) $return = $input; } // The output is UTF-8 by default, other output formats need conversion here // If one time encoding is given, use this, else the objects property switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { case 'utf8': return $return; break; case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); break; case 'ucs4_array': return $this->_utf8_to_ucs4($return); break; default: $this->_error('Unsupported output format'); return false; } } /** * Encode a given UTF-8 domain name * @param string Domain name (UTF-8 or UCS-4) * [@param string Desired input encoding, see {@link set_parameter}] * @return string Encoded Domain name (ACE string) */ public function encode($decoded, $one_time_encoding = false) { // Forcing conversion of input to UCS4 array // If one time encoding is given, use this, else the objects property switch ($one_time_encoding ? $one_time_encoding : $this->_api_encoding) { case 'utf8': $decoded = $this->_utf8_to_ucs4($decoded); break; case 'ucs4_string': $decoded = $this->_ucs4_string_to_ucs4($decoded); case 'ucs4_array': break; default: $this->_error('Unsupported input format: '.($one_time_encoding ? $one_time_encoding : $this->_api_encoding)); return false; } // No input, no output, what else did you expect? if (empty($decoded)) return ''; // Anchors for iteration $last_begin = 0; // Output string $output = ''; foreach ($decoded as $k => $v) { // Make sure to use just the plain dot switch($v) { case 0x3002: case 0xFF0E: case 0xFF61: $decoded[$k] = 0x2E; // Right, no break here, the above are converted to dots anyway // Stumbling across an anchoring character case 0x2E: case 0x2F: case 0x3A: case 0x3F: case 0x40: // Neither email addresses nor URLs allowed in strict mode if ($this->_strict_mode) { $this->_error('Neither email addresses nor URLs are allowed in strict mode.'); return false; } else { // Skip first char if ($k) { $encoded = ''; $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin))); if ($encoded) { $output .= $encoded; } else { $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin))); } $output .= chr($decoded[$k]); } $last_begin = $k + 1; } } } // Catch the rest of the string if ($last_begin) { $inp_len = sizeof($decoded); $encoded = ''; $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len)-$last_begin))); if ($encoded) { $output .= $encoded; } else { $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len)-$last_begin))); } return $output; } else { if ($output = $this->_encode($decoded)) { return $output; } else { return $this->_ucs4_to_utf8($decoded); } } } /** * Removes a weakness of encode(), which cannot properly handle URIs but instead encodes their * path or query components, too. * @param string $uri Expects the URI as a UTF-8 (or ASCII) string * @return string The URI encoded to Punycode, everything but the host component is left alone * @since 0.6.4 */ public function encode_uri($uri) { $parsed = parse_url($uri); if (!isset($parsed['host'])) { $this->_error('The given string does not look like a URI'); return false; } $arr = explode('.', $parsed['host']); foreach ($arr as $k => $v) { $conv = $this->encode($v, 'utf8'); if ($conv) $arr[$k] = $conv; } $parsed['host'] = join('.', $arr); $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')) .(empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@') .$parsed['host'] .(empty($parsed['port']) ? '' : ':'.$parsed['port']) .(empty($parsed['path']) ? '' : $parsed['path']) .(empty($parsed['query']) ? '' : '?'.$parsed['query']) .(empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']); return $return; } /** * Use this method to get the last error ocurred * @param void * @return string The last error, that occured */ public function get_last_error() { return $this->_error; } /** * The actual decoding algorithm * @param string * @return mixed */ protected function _decode($encoded) { $decoded = array(); // find the Punycode prefix if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) { $this->_error('This is not a punycode string'); return false; } $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded); // If nothing left after removing the prefix, it is hopeless if (!$encode_test) { $this->_error('The given encoded string was empty'); return false; } // Find last occurence of the delimiter $delim_pos = strrpos($encoded, '-'); if ($delim_pos > self::byteLength($this->_punycode_prefix)) { for ($k = self::byteLength($this->_punycode_prefix); $k < $delim_pos; ++$k) { $decoded[] = ord($encoded{$k}); } } $deco_len = count($decoded); $enco_len = self::byteLength($encoded); // Wandering through the strings; init $is_first = true; $bias = $this->_initial_bias; $idx = 0; $char = $this->_initial_n; for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) { for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) { $digit = $this->_decode_digit($encoded{$enco_idx++}); $idx += $digit * $w; $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); if ($digit < $t) break; $w = (int) ($w * ($this->_base - $t)); } $bias = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first); $is_first = false; $char += (int) ($idx / ($deco_len + 1)); $idx %= ($deco_len + 1); if ($deco_len > 0) { // Make room for the decoded char for ($i = $deco_len; $i > $idx; $i--) $decoded[$i] = $decoded[($i - 1)]; } $decoded[$idx++] = $char; } return $this->_ucs4_to_utf8($decoded); } /** * The actual encoding algorithm * @param string * @return mixed */ protected function _encode($decoded) { // We cannot encode a domain name containing the Punycode prefix $extract = self::byteLength($this->_punycode_prefix); $check_pref = $this->_utf8_to_ucs4($this->_punycode_prefix); $check_deco = array_slice($decoded, 0, $extract); if ($check_pref == $check_deco) { $this->_error('This is already a punycode string'); return false; } // We will not try to encode strings consisting of basic code points only $encodable = false; foreach ($decoded as $k => $v) { if ($v > 0x7a) { $encodable = true; break; } } if (!$encodable) { $this->_error('The given string does not contain encodable chars'); return false; } // Do NAMEPREP $decoded = $this->_nameprep($decoded); if (!$decoded || !is_array($decoded)) return false; // NAMEPREP failed $deco_len = count($decoded); if (!$deco_len) return false; // Empty array $codecount = 0; // How many chars have been consumed $encoded = ''; // Copy all basic code points to output for ($i = 0; $i < $deco_len; ++$i) { $test = $decoded[$i]; // Will match [-0-9a-zA-Z] if ((0x2F < $test && $test < 0x40) || (0x40 < $test && $test < 0x5B) || (0x60 < $test && $test <= 0x7B) || (0x2D == $test)) { $encoded .= chr($decoded[$i]); $codecount++; } } if ($codecount == $deco_len) return $encoded; // All codepoints were basic ones // Start with the prefix; copy it to output $encoded = $this->_punycode_prefix.$encoded; // If we have basic code points in output, add an hyphen to the end if ($codecount) $encoded .= '-'; // Now find and encode all non-basic code points $is_first = true; $cur_code = $this->_initial_n; $bias = $this->_initial_bias; $delta = 0; while ($codecount < $deco_len) { // Find the smallest code point >= the current code point and // remember the last ouccrence of it in the input for ($i = 0, $next_code = $this->_max_ucs; $i < $deco_len; $i++) { if ($decoded[$i] >= $cur_code && $decoded[$i] <= $next_code) { $next_code = $decoded[$i]; } } $delta += ($next_code - $cur_code) * ($codecount + 1); $cur_code = $next_code; // Scan input again and encode all characters whose code point is $cur_code for ($i = 0; $i < $deco_len; $i++) { if ($decoded[$i] < $cur_code) { $delta++; } elseif ($decoded[$i] == $cur_code) { for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) { $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); if ($q < $t) break; $encoded .= $this->_encode_digit(intval($t + (($q - $t) % ($this->_base - $t)))); //v0.4.5 Changed from ceil() to intval() $q = (int) (($q - $t) / ($this->_base - $t)); } $encoded .= $this->_encode_digit($q); $bias = $this->_adapt($delta, $codecount+1, $is_first); $codecount++; $delta = 0; $is_first = false; } } $delta++; $cur_code++; } return $encoded; } /** * Adapt the bias according to the current code point and position * @param int $delta * @param int $npoints * @param int $is_first * @return int */ protected function _adapt($delta, $npoints, $is_first) { $delta = intval($is_first ? ($delta / $this->_damp) : ($delta / 2)); $delta += intval($delta / $npoints); for ($k = 0; $delta > (($this->_base - $this->_tmin) * $this->_tmax) / 2; $k += $this->_base) { $delta = intval($delta / ($this->_base - $this->_tmin)); } return intval($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew)); } /** * Encoding a certain digit * @param int $d * @return string */ protected function _encode_digit($d) { return chr($d + 22 + 75 * ($d < 26)); } /** * Decode a certain digit * @param int $cp * @return int */ protected function _decode_digit($cp) { $cp = ord($cp); return ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $this->_base)); } /** * Internal error handling method * @param string $error */ protected function _error($error = '') { $this->_error = $error; } /** * Do Nameprep according to RFC3491 and RFC3454 * @param array Unicode Characters * @return string Unicode Characters, Nameprep'd */ protected function _nameprep($input) { $output = array(); $error = false; // // Mapping // Walking through the input array, performing the required steps on each of // the input chars and putting the result into the output array // While mapping required chars we apply the cannonical ordering foreach ($input as $v) { // Map to nothing == skip that code point if (in_array($v, self::$NP['map_nothing'])) continue; // Try to find prohibited input if (in_array($v, self::$NP['prohibit']) || in_array($v, self::$NP['general_prohibited'])) { $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); return false; } foreach (self::$NP['prohibit_ranges'] as $range) { if ($range[0] <= $v && $v <= $range[1]) { $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); return false; } } if (0xAC00 <= $v && $v <= 0xD7AF) { // Hangul syllable decomposition foreach ($this->_hangul_decompose($v) as $out) { $output[] = (int) $out; } } elseif (($this->_idn_version == '2003') && isset(self::$NP['replacemaps'][$v])) { // There's a decomposition mapping for that code point // Decompositions only in version 2003 (original) of IDNA foreach ($this->_apply_cannonical_ordering(self::$NP['replacemaps'][$v]) as $out) { $output[] = (int) $out; } } else { $output[] = (int) $v; } } // Before applying any Combining, try to rearrange any Hangul syllables $output = $this->_hangul_compose($output); // // Combine code points // $last_class = 0; $last_starter = 0; $out_len = count($output); for ($i = 0; $i < $out_len; ++$i) { $class = $this->_get_combining_class($output[$i]); if ((!$last_class || $last_class > $class) && $class) { // Try to match $seq_len = $i - $last_starter; $out = $this->_combine(array_slice($output, $last_starter, $seq_len)); // On match: Replace the last starter with the composed character and remove // the now redundant non-starter(s) if ($out) { $output[$last_starter] = $out; if (count($out) != $seq_len) { for ($j = $i+1; $j < $out_len; ++$j) $output[$j-1] = $output[$j]; unset($output[$out_len]); } // Rewind the for loop by one, since there can be more possible compositions $i--; $out_len--; $last_class = ($i == $last_starter) ? 0 : $this->_get_combining_class($output[$i-1]); continue; } } // The current class is 0 if (!$class) $last_starter = $i; $last_class = $class; } return $output; } /** * Decomposes a Hangul syllable * (see http://www.unicode.org/unicode/reports/tr15/#Hangul * @param integer 32bit UCS4 code point * @return array Either Hangul Syllable decomposed or original 32bit value as one value array */ protected function _hangul_decompose($char) { $sindex = (int) $char - $this->_sbase; if ($sindex < 0 || $sindex >= $this->_scount) return array($char); $result = array(); $result[] = (int) $this->_lbase + $sindex / $this->_ncount; $result[] = (int) $this->_vbase + ($sindex % $this->_ncount) / $this->_tcount; $T = intval($this->_tbase + $sindex % $this->_tcount); if ($T != $this->_tbase) $result[] = $T; return $result; } /** * Ccomposes a Hangul syllable * (see http://www.unicode.org/unicode/reports/tr15/#Hangul * @param array Decomposed UCS4 sequence * @return array UCS4 sequence with syllables composed */ protected function _hangul_compose($input) { $inp_len = count($input); if (!$inp_len) return array(); $result = array(); $last = (int) $input[0]; $result[] = $last; // copy first char from input to output for ($i = 1; $i < $inp_len; ++$i) { $char = (int) $input[$i]; $sindex = $last - $this->_sbase; $lindex = $last - $this->_lbase; $vindex = $char - $this->_vbase; $tindex = $char - $this->_tbase; // Find out, whether two current characters are LV and T if (0 <= $sindex && $sindex < $this->_scount && ($sindex % $this->_tcount == 0) && 0 <= $tindex && $tindex <= $this->_tcount) { // create syllable of form LVT $last += $tindex; $result[(count($result) - 1)] = $last; // reset last continue; // discard char } // Find out, whether two current characters form L and V if (0 <= $lindex && $lindex < $this->_lcount && 0 <= $vindex && $vindex < $this->_vcount) { // create syllable of form LV $last = (int) $this->_sbase + ($lindex * $this->_vcount + $vindex) * $this->_tcount; $result[(count($result) - 1)] = $last; // reset last continue; // discard char } // if neither case was true, just add the character $last = $char; $result[] = $char; } return $result; } /** * Returns the combining class of a certain wide char * @param integer Wide char to check (32bit integer) * @return integer Combining class if found, else 0 */ protected function _get_combining_class($char) { return isset(self::$NP['norm_combcls'][$char]) ? self::$NP['norm_combcls'][$char] : 0; } /** * Applies the cannonical ordering of a decomposed UCS4 sequence * @param array Decomposed UCS4 sequence * @return array Ordered USC4 sequence */ protected function _apply_cannonical_ordering($input) { $swap = true; $size = count($input); while ($swap) { $swap = false; $last = $this->_get_combining_class(intval($input[0])); for ($i = 0; $i < $size-1; ++$i) { $next = $this->_get_combining_class(intval($input[$i+1])); if ($next != 0 && $last > $next) { // Move item leftward until it fits for ($j = $i + 1; $j > 0; --$j) { if ($this->_get_combining_class(intval($input[$j-1])) <= $next) break; $t = intval($input[$j]); $input[$j] = intval($input[$j-1]); $input[$j-1] = $t; $swap = true; } // Reentering the loop looking at the old character again $next = $last; } $last = $next; } } return $input; } /** * Do composition of a sequence of starter and non-starter * @param array UCS4 Decomposed sequence * @return array Ordered USC4 sequence */ protected function _combine($input) { $inp_len = count($input); foreach (self::$NP['replacemaps'] as $np_src => $np_target) { if ($np_target[0] != $input[0]) continue; if (count($np_target) != $inp_len) continue; $hit = false; foreach ($input as $k2 => $v2) { if ($v2 == $np_target[$k2]) { $hit = true; } else { $hit = false; break; } } if ($hit) return $np_src; } return false; } /** * This converts an UTF-8 encoded string to its UCS-4 representation * By talking about UCS-4 "strings" we mean arrays of 32bit integers representing * each of the "chars". This is due to PHP not being able to handle strings with * bit depth different from 8. This apllies to the reverse method _ucs4_to_utf8(), too. * The following UTF-8 encodings are supported: * bytes bits representation * 1 7 0xxxxxxx * 2 11 110xxxxx 10xxxxxx * 3 16 1110xxxx 10xxxxxx 10xxxxxx * 4 21 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx * 5 26 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx * 6 31 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx * Each x represents a bit that can be used to store character data. * The five and six byte sequences are part of Annex D of ISO/IEC 10646-1:2000 * @param string $input * @return string */ protected function _utf8_to_ucs4($input) { $output = array(); $out_len = 0; $inp_len = self::byteLength($input); $mode = 'next'; $test = 'none'; for ($k = 0; $k < $inp_len; ++$k) { $v = ord($input{$k}); // Extract byte from input string if ($v < 128) { // We found an ASCII char - put into stirng as is $output[$out_len] = $v; ++$out_len; if ('add' == $mode) { $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); return false; } continue; } if ('next' == $mode) { // Try to find the next start byte; determine the width of the Unicode char $start_byte = $v; $mode = 'add'; $test = 'range'; if ($v >> 5 == 6) { // &110xxxxx 10xxxxx $next_byte = 0; // Tells, how many times subsequent bitmasks must rotate 6bits to the left $v = ($v - 192) << 6; } elseif ($v >> 4 == 14) { // &1110xxxx 10xxxxxx 10xxxxxx $next_byte = 1; $v = ($v - 224) << 12; } elseif ($v >> 3 == 30) { // &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx $next_byte = 2; $v = ($v - 240) << 18; } elseif ($v >> 2 == 62) { // &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx $next_byte = 3; $v = ($v - 248) << 24; } elseif ($v >> 1 == 126) { // &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx $next_byte = 4; $v = ($v - 252) << 30; } else { $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k); return false; } if ('add' == $mode) { $output[$out_len] = (int) $v; ++$out_len; continue; } } if ('add' == $mode) { if (!$this->_allow_overlong && $test == 'range') { $test = 'none'; if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k); return false; } } if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx $v = ($v - 128) << ($next_byte * 6); $output[($out_len - 1)] += $v; --$next_byte; } else { $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); return false; } if ($next_byte < 0) { $mode = 'next'; } } } // for return $output; } /** * Convert UCS-4 string into UTF-8 string * See _utf8_to_ucs4() for details * @param string $input * @return string */ protected function _ucs4_to_utf8($input) { $output = ''; foreach ($input as $k => $v) { if ($v < 128) { // 7bit are transferred literally $output .= chr($v); } elseif ($v < (1 << 11)) { // 2 bytes $output .= chr(192+($v >> 6)).chr(128+($v & 63)); } elseif ($v < (1 << 16)) { // 3 bytes $output .= chr(224+($v >> 12)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63)); } elseif ($v < (1 << 21)) { // 4 bytes $output .= chr(240+($v >> 18)).chr(128+(($v >> 12) & 63)).chr(128+(($v >> 6) & 63)).chr(128+($v & 63)); } elseif (self::$safe_mode) { $output .= self::$safe_char; } else { $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k); return false; } } return $output; } /** * Convert UCS-4 array into UCS-4 string * * @param array $input * @return string */ protected function _ucs4_to_ucs4_string($input) { $output = ''; // Take array values and split output to 4 bytes per value // The bit mask is 255, which reads &11111111 foreach ($input as $v) { $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255); } return $output; } /** * Convert UCS-4 strin into UCS-4 garray * * @param string $input * @return array */ protected function _ucs4_string_to_ucs4($input) { $output = array(); $inp_len = self::byteLength($input); // Input length must be dividable by 4 if ($inp_len % 4) { $this->_error('Input UCS4 string is broken'); return false; } // Empty input - return empty output if (!$inp_len) return $output; for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) { // Increment output position every 4 input bytes if (!($i % 4)) { $out_len++; $output[$out_len] = 0; } $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); } return $output; } /** * Gets the length of a string in bytes even if mbstring function * overloading is turned on * * @param string $string the string for which to get the length. * @return integer the length of the string in bytes. */ protected static function byteLength($string) { if (self::$_mb_string_overload) { return mb_strlen($string, '8bit'); } return strlen((binary) $string); } /** * Attempts to return a concrete IDNA instance. * * @param array $params Set of paramaters * @return idna_convert * @access public */ public function getInstance($params = array()) { return new idna_convert($params); } /** * Attempts to return a concrete IDNA instance for either php4 or php5, * only creating a new instance if no IDNA instance with the same * parameters currently exists. * * @param array $params Set of paramaters * * @return object idna_convert * @access public */ public function singleton($params = array()) { static $instances; if (!isset($instances)) { $instances = array(); } $signature = serialize($params); if (!isset($instances[$signature])) { $instances[$signature] = idna_convert::getInstance($params); } return $instances[$signature]; } /** * Holds all relevant mapping tables * See RFC3454 for details * * @private array * @since 0.5.2 */ protected static $NP = array ('map_nothing' => array(0xAD, 0x34F, 0x1806, 0x180B, 0x180C, 0x180D, 0x200B, 0x200C ,0x200D, 0x2060, 0xFE00, 0xFE01, 0xFE02, 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07 ,0xFE08, 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFE0E, 0xFE0F, 0xFEFF ) ,'general_prohibited' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ,20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 ,33, 34, 35, 36, 37, 38, 39, 40, 41, 42 ,43, 44, 47, 59, 60, 61, 62, 63, 64, 91, 92, 93, 94, 95, 96, 123, 124, 125, 126, 127, 0x3002 ) ,'prohibit' => array(0xA0, 0x340, 0x341, 0x6DD, 0x70F, 0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003 ,0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x200B, 0x200C, 0x200D, 0x200E, 0x200F ,0x2028, 0x2029, 0x202A, 0x202B, 0x202C, 0x202D, 0x202E, 0x202F, 0x205F, 0x206A, 0x206B, 0x206C ,0x206D, 0x206E, 0x206F, 0x3000, 0xFEFF, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFF ,0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE, 0x5FFFF, 0x6FFFE ,0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE, 0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE, 0xBFFFF ,0xCFFFE, 0xCFFFF, 0xDFFFE, 0xDFFFF, 0xE0001, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE, 0x10FFFF ) ,'prohibit_ranges' => array(array(0x80, 0x9F), array(0x2060, 0x206F), array(0x1D173, 0x1D17A) ,array(0xE000, 0xF8FF) ,array(0xF0000, 0xFFFFD), array(0x100000, 0x10FFFD) ,array(0xFDD0, 0xFDEF), array(0xD800, 0xDFFF), array(0x2FF0, 0x2FFB), array(0xE0020, 0xE007F) ) ,'replacemaps' => array(0x41 => array(0x61), 0x42 => array(0x62), 0x43 => array(0x63) ,0x44 => array(0x64), 0x45 => array(0x65), 0x46 => array(0x66), 0x47 => array(0x67) ,0x48 => array(0x68), 0x49 => array(0x69), 0x4A => array(0x6A), 0x4B => array(0x6B) ,0x4C => array(0x6C), 0x4D => array(0x6D), 0x4E => array(0x6E), 0x4F => array(0x6F) ,0x50 => array(0x70), 0x51 => array(0x71), 0x52 => array(0x72), 0x53 => array(0x73) ,0x54 => array(0x74), 0x55 => array(0x75), 0x56 => array(0x76), 0x57 => array(0x77) ,0x58 => array(0x78), 0x59 => array(0x79), 0x5A => array(0x7A), 0xB5 => array(0x3BC) ,0xC0 => array(0xE0), 0xC1 => array(0xE1), 0xC2 => array(0xE2), 0xC3 => array(0xE3) ,0xC4 => array(0xE4), 0xC5 => array(0xE5), 0xC6 => array(0xE6), 0xC7 => array(0xE7) ,0xC8 => array(0xE8), 0xC9 => array(0xE9), 0xCA => array(0xEA), 0xCB => array(0xEB) ,0xCC => array(0xEC), 0xCD => array(0xED), 0xCE => array(0xEE), 0xCF => array(0xEF) ,0xD0 => array(0xF0), 0xD1 => array(0xF1), 0xD2 => array(0xF2), 0xD3 => array(0xF3) ,0xD4 => array(0xF4), 0xD5 => array(0xF5), 0xD6 => array(0xF6), 0xD8 => array(0xF8) ,0xD9 => array(0xF9), 0xDA => array(0xFA), 0xDB => array(0xFB), 0xDC => array(0xFC) ,0xDD => array(0xFD), 0xDE => array(0xFE), 0xDF => array(0x73, 0x73) ,0x100 => array(0x101), 0x102 => array(0x103), 0x104 => array(0x105) ,0x106 => array(0x107), 0x108 => array(0x109), 0x10A => array(0x10B) ,0x10C => array(0x10D), 0x10E => array(0x10F), 0x110 => array(0x111) ,0x112 => array(0x113), 0x114 => array(0x115), 0x116 => array(0x117) ,0x118 => array(0x119), 0x11A => array(0x11B), 0x11C => array(0x11D) ,0x11E => array(0x11F), 0x120 => array(0x121), 0x122 => array(0x123) ,0x124 => array(0x125), 0x126 => array(0x127), 0x128 => array(0x129) ,0x12A => array(0x12B), 0x12C => array(0x12D), 0x12E => array(0x12F) ,0x130 => array(0x69, 0x307), 0x132 => array(0x133), 0x134 => array(0x135) ,0x136 => array(0x137), 0x139 => array(0x13A), 0x13B => array(0x13C) ,0x13D => array(0x13E), 0x13F => array(0x140), 0x141 => array(0x142) ,0x143 => array(0x144), 0x145 => array(0x146), 0x147 => array(0x148) ,0x149 => array(0x2BC, 0x6E), 0x14A => array(0x14B), 0x14C => array(0x14D) ,0x14E => array(0x14F), 0x150 => array(0x151), 0x152 => array(0x153) ,0x154 => array(0x155), 0x156 => array(0x157), 0x158 => array(0x159) ,0x15A => array(0x15B), 0x15C => array(0x15D), 0x15E => array(0x15F) ,0x160 => array(0x161), 0x162 => array(0x163), 0x164 => array(0x165) ,0x166 => array(0x167), 0x168 => array(0x169), 0x16A => array(0x16B) ,0x16C => array(0x16D), 0x16E => array(0x16F), 0x170 => array(0x171) ,0x172 => array(0x173), 0x174 => array(0x175), 0x176 => array(0x177) ,0x178 => array(0xFF), 0x179 => array(0x17A), 0x17B => array(0x17C) ,0x17D => array(0x17E), 0x17F => array(0x73), 0x181 => array(0x253) ,0x182 => array(0x183), 0x184 => array(0x185), 0x186 => array(0x254) ,0x187 => array(0x188), 0x189 => array(0x256), 0x18A => array(0x257) ,0x18B => array(0x18C), 0x18E => array(0x1DD), 0x18F => array(0x259) ,0x190 => array(0x25B), 0x191 => array(0x192), 0x193 => array(0x260) ,0x194 => array(0x263), 0x196 => array(0x269), 0x197 => array(0x268) ,0x198 => array(0x199), 0x19C => array(0x26F), 0x19D => array(0x272) ,0x19F => array(0x275), 0x1A0 => array(0x1A1), 0x1A2 => array(0x1A3) ,0x1A4 => array(0x1A5), 0x1A6 => array(0x280), 0x1A7 => array(0x1A8) ,0x1A9 => array(0x283), 0x1AC => array(0x1AD), 0x1AE => array(0x288) ,0x1AF => array(0x1B0), 0x1B1 => array(0x28A), 0x1B2 => array(0x28B) ,0x1B3 => array(0x1B4), 0x1B5 => array(0x1B6), 0x1B7 => array(0x292) ,0x1B8 => array(0x1B9), 0x1BC => array(0x1BD), 0x1C4 => array(0x1C6) ,0x1C5 => array(0x1C6), 0x1C7 => array(0x1C9), 0x1C8 => array(0x1C9) ,0x1CA => array(0x1CC), 0x1CB => array(0x1CC), 0x1CD => array(0x1CE) ,0x1CF => array(0x1D0), 0x1D1 => array(0x1D2), 0x1D3 => array(0x1D4) ,0x1D5 => array(0x1D6), 0x1D7 => array(0x1D8), 0x1D9 => array(0x1DA) ,0x1DB => array(0x1DC), 0x1DE => array(0x1DF), 0x1E0 => array(0x1E1) ,0x1E2 => array(0x1E3), 0x1E4 => array(0x1E5), 0x1E6 => array(0x1E7) ,0x1E8 => array(0x1E9), 0x1EA => array(0x1EB), 0x1EC => array(0x1ED) ,0x1EE => array(0x1EF), 0x1F0 => array(0x6A, 0x30C), 0x1F1 => array(0x1F3) ,0x1F2 => array(0x1F3), 0x1F4 => array(0x1F5), 0x1F6 => array(0x195) ,0x1F7 => array(0x1BF), 0x1F8 => array(0x1F9), 0x1FA => array(0x1FB) ,0x1FC => array(0x1FD), 0x1FE => array(0x1FF), 0x200 => array(0x201) ,0x202 => array(0x203), 0x204 => array(0x205), 0x206 => array(0x207) ,0x208 => array(0x209), 0x20A => array(0x20B), 0x20C => array(0x20D) ,0x20E => array(0x20F), 0x210 => array(0x211), 0x212 => array(0x213) ,0x214 => array(0x215), 0x216 => array(0x217), 0x218 => array(0x219) ,0x21A => array(0x21B), 0x21C => array(0x21D), 0x21E => array(0x21F) ,0x220 => array(0x19E), 0x222 => array(0x223), 0x224 => array(0x225) ,0x226 => array(0x227), 0x228 => array(0x229), 0x22A => array(0x22B) ,0x22C => array(0x22D), 0x22E => array(0x22F), 0x230 => array(0x231) ,0x232 => array(0x233), 0x345 => array(0x3B9), 0x37A => array(0x20, 0x3B9) ,0x386 => array(0x3AC), 0x388 => array(0x3AD), 0x389 => array(0x3AE) ,0x38A => array(0x3AF), 0x38C => array(0x3CC), 0x38E => array(0x3CD) ,0x38F => array(0x3CE), 0x390 => array(0x3B9, 0x308, 0x301) ,0x391 => array(0x3B1), 0x392 => array(0x3B2), 0x393 => array(0x3B3) ,0x394 => array(0x3B4), 0x395 => array(0x3B5), 0x396 => array(0x3B6) ,0x397 => array(0x3B7), 0x398 => array(0x3B8), 0x399 => array(0x3B9) ,0x39A => array(0x3BA), 0x39B => array(0x3BB), 0x39C => array(0x3BC) ,0x39D => array(0x3BD), 0x39E => array(0x3BE), 0x39F => array(0x3BF) ,0x3A0 => array(0x3C0), 0x3A1 => array(0x3C1), 0x3A3 => array(0x3C3) ,0x3A4 => array(0x3C4), 0x3A5 => array(0x3C5), 0x3A6 => array(0x3C6) ,0x3A7 => array(0x3C7), 0x3A8 => array(0x3C8), 0x3A9 => array(0x3C9) ,0x3AA => array(0x3CA), 0x3AB => array(0x3CB), 0x3B0 => array(0x3C5, 0x308, 0x301) ,0x3C2 => array(0x3C3), 0x3D0 => array(0x3B2), 0x3D1 => array(0x3B8) ,0x3D2 => array(0x3C5), 0x3D3 => array(0x3CD), 0x3D4 => array(0x3CB) ,0x3D5 => array(0x3C6), 0x3D6 => array(0x3C0), 0x3D8 => array(0x3D9) ,0x3DA => array(0x3DB), 0x3DC => array(0x3DD), 0x3DE => array(0x3DF) ,0x3E0 => array(0x3E1), 0x3E2 => array(0x3E3), 0x3E4 => array(0x3E5) ,0x3E6 => array(0x3E7), 0x3E8 => array(0x3E9), 0x3EA => array(0x3EB) ,0x3EC => array(0x3ED), 0x3EE => array(0x3EF), 0x3F0 => array(0x3BA) ,0x3F1 => array(0x3C1), 0x3F2 => array(0x3C3), 0x3F4 => array(0x3B8) ,0x3F5 => array(0x3B5), 0x400 => array(0x450), 0x401 => array(0x451) ,0x402 => array(0x452), 0x403 => array(0x453), 0x404 => array(0x454) ,0x405 => array(0x455), 0x406 => array(0x456), 0x407 => array(0x457) ,0x408 => array(0x458), 0x409 => array(0x459), 0x40A => array(0x45A) ,0x40B => array(0x45B), 0x40C => array(0x45C), 0x40D => array(0x45D) ,0x40E => array(0x45E), 0x40F => array(0x45F), 0x410 => array(0x430) ,0x411 => array(0x431), 0x412 => array(0x432), 0x413 => array(0x433) ,0x414 => array(0x434), 0x415 => array(0x435), 0x416 => array(0x436) ,0x417 => array(0x437), 0x418 => array(0x438), 0x419 => array(0x439) ,0x41A => array(0x43A), 0x41B => array(0x43B), 0x41C => array(0x43C) ,0x41D => array(0x43D), 0x41E => array(0x43E), 0x41F => array(0x43F) ,0x420 => array(0x440), 0x421 => array(0x441), 0x422 => array(0x442) ,0x423 => array(0x443), 0x424 => array(0x444), 0x425 => array(0x445) ,0x426 => array(0x446), 0x427 => array(0x447), 0x428 => array(0x448) ,0x429 => array(0x449), 0x42A => array(0x44A), 0x42B => array(0x44B) ,0x42C => array(0x44C), 0x42D => array(0x44D), 0x42E => array(0x44E) ,0x42F => array(0x44F), 0x460 => array(0x461), 0x462 => array(0x463) ,0x464 => array(0x465), 0x466 => array(0x467), 0x468 => array(0x469) ,0x46A => array(0x46B), 0x46C => array(0x46D), 0x46E => array(0x46F) ,0x470 => array(0x471), 0x472 => array(0x473), 0x474 => array(0x475) ,0x476 => array(0x477), 0x478 => array(0x479), 0x47A => array(0x47B) ,0x47C => array(0x47D), 0x47E => array(0x47F), 0x480 => array(0x481) ,0x48A => array(0x48B), 0x48C => array(0x48D), 0x48E => array(0x48F) ,0x490 => array(0x491), 0x492 => array(0x493), 0x494 => array(0x495) ,0x496 => array(0x497), 0x498 => array(0x499), 0x49A => array(0x49B) ,0x49C => array(0x49D), 0x49E => array(0x49F), 0x4A0 => array(0x4A1) ,0x4A2 => array(0x4A3), 0x4A4 => array(0x4A5), 0x4A6 => array(0x4A7) ,0x4A8 => array(0x4A9), 0x4AA => array(0x4AB), 0x4AC => array(0x4AD) ,0x4AE => array(0x4AF), 0x4B0 => array(0x4B1), 0x4B2 => array(0x4B3) ,0x4B4 => array(0x4B5), 0x4B6 => array(0x4B7), 0x4B8 => array(0x4B9) ,0x4BA => array(0x4BB), 0x4BC => array(0x4BD), 0x4BE => array(0x4BF) ,0x4C1 => array(0x4C2), 0x4C3 => array(0x4C4), 0x4C5 => array(0x4C6) ,0x4C7 => array(0x4C8), 0x4C9 => array(0x4CA), 0x4CB => array(0x4CC) ,0x4CD => array(0x4CE), 0x4D0 => array(0x4D1), 0x4D2 => array(0x4D3) ,0x4D4 => array(0x4D5), 0x4D6 => array(0x4D7), 0x4D8 => array(0x4D9) ,0x4DA => array(0x4DB), 0x4DC => array(0x4DD), 0x4DE => array(0x4DF) ,0x4E0 => array(0x4E1), 0x4E2 => array(0x4E3), 0x4E4 => array(0x4E5) ,0x4E6 => array(0x4E7), 0x4E8 => array(0x4E9), 0x4EA => array(0x4EB) ,0x4EC => array(0x4ED), 0x4EE => array(0x4EF), 0x4F0 => array(0x4F1) ,0x4F2 => array(0x4F3), 0x4F4 => array(0x4F5), 0x4F8 => array(0x4F9) ,0x500 => array(0x501), 0x502 => array(0x503), 0x504 => array(0x505) ,0x506 => array(0x507), 0x508 => array(0x509), 0x50A => array(0x50B) ,0x50C => array(0x50D), 0x50E => array(0x50F), 0x531 => array(0x561) ,0x532 => array(0x562), 0x533 => array(0x563), 0x534 => array(0x564) ,0x535 => array(0x565), 0x536 => array(0x566), 0x537 => array(0x567) ,0x538 => array(0x568), 0x539 => array(0x569), 0x53A => array(0x56A) ,0x53B => array(0x56B), 0x53C => array(0x56C), 0x53D => array(0x56D) ,0x53E => array(0x56E), 0x53F => array(0x56F), 0x540 => array(0x570) ,0x541 => array(0x571), 0x542 => array(0x572), 0x543 => array(0x573) ,0x544 => array(0x574), 0x545 => array(0x575), 0x546 => array(0x576) ,0x547 => array(0x577), 0x548 => array(0x578), 0x549 => array(0x579) ,0x54A => array(0x57A), 0x54B => array(0x57B), 0x54C => array(0x57C) ,0x54D => array(0x57D), 0x54E => array(0x57E), 0x54F => array(0x57F) ,0x550 => array(0x580), 0x551 => array(0x581), 0x552 => array(0x582) ,0x553 => array(0x583), 0x554 => array(0x584), 0x555 => array(0x585) ,0x556 => array(0x586), 0x587 => array(0x565, 0x582), 0xE33 => array(0xE4D, 0xE32) ,0x1E00 => array(0x1E01), 0x1E02 => array(0x1E03), 0x1E04 => array(0x1E05) ,0x1E06 => array(0x1E07), 0x1E08 => array(0x1E09), 0x1E0A => array(0x1E0B) ,0x1E0C => array(0x1E0D), 0x1E0E => array(0x1E0F), 0x1E10 => array(0x1E11) ,0x1E12 => array(0x1E13), 0x1E14 => array(0x1E15), 0x1E16 => array(0x1E17) ,0x1E18 => array(0x1E19), 0x1E1A => array(0x1E1B), 0x1E1C => array(0x1E1D) ,0x1E1E => array(0x1E1F), 0x1E20 => array(0x1E21), 0x1E22 => array(0x1E23) ,0x1E24 => array(0x1E25), 0x1E26 => array(0x1E27), 0x1E28 => array(0x1E29) ,0x1E2A => array(0x1E2B), 0x1E2C => array(0x1E2D), 0x1E2E => array(0x1E2F) ,0x1E30 => array(0x1E31), 0x1E32 => array(0x1E33), 0x1E34 => array(0x1E35) ,0x1E36 => array(0x1E37), 0x1E38 => array(0x1E39), 0x1E3A => array(0x1E3B) ,0x1E3C => array(0x1E3D), 0x1E3E => array(0x1E3F), 0x1E40 => array(0x1E41) ,0x1E42 => array(0x1E43), 0x1E44 => array(0x1E45), 0x1E46 => array(0x1E47) ,0x1E48 => array(0x1E49), 0x1E4A => array(0x1E4B), 0x1E4C => array(0x1E4D) ,0x1E4E => array(0x1E4F), 0x1E50 => array(0x1E51), 0x1E52 => array(0x1E53) ,0x1E54 => array(0x1E55), 0x1E56 => array(0x1E57), 0x1E58 => array(0x1E59) ,0x1E5A => array(0x1E5B), 0x1E5C => array(0x1E5D), 0x1E5E => array(0x1E5F) ,0x1E60 => array(0x1E61), 0x1E62 => array(0x1E63), 0x1E64 => array(0x1E65) ,0x1E66 => array(0x1E67), 0x1E68 => array(0x1E69), 0x1E6A => array(0x1E6B) ,0x1E6C => array(0x1E6D), 0x1E6E => array(0x1E6F), 0x1E70 => array(0x1E71) ,0x1E72 => array(0x1E73), 0x1E74 => array(0x1E75), 0x1E76 => array(0x1E77) ,0x1E78 => array(0x1E79), 0x1E7A => array(0x1E7B), 0x1E7C => array(0x1E7D) ,0x1E7E => array(0x1E7F), 0x1E80 => array(0x1E81), 0x1E82 => array(0x1E83) ,0x1E84 => array(0x1E85), 0x1E86 => array(0x1E87), 0x1E88 => array(0x1E89) ,0x1E8A => array(0x1E8B), 0x1E8C => array(0x1E8D), 0x1E8E => array(0x1E8F) ,0x1E90 => array(0x1E91), 0x1E92 => array(0x1E93), 0x1E94 => array(0x1E95) ,0x1E96 => array(0x68, 0x331), 0x1E97 => array(0x74, 0x308), 0x1E98 => array(0x77, 0x30A) ,0x1E99 => array(0x79, 0x30A), 0x1E9A => array(0x61, 0x2BE), 0x1E9B => array(0x1E61) ,0x1EA0 => array(0x1EA1), 0x1EA2 => array(0x1EA3), 0x1EA4 => array(0x1EA5) ,0x1EA6 => array(0x1EA7), 0x1EA8 => array(0x1EA9), 0x1EAA => array(0x1EAB) ,0x1EAC => array(0x1EAD), 0x1EAE => array(0x1EAF), 0x1EB0 => array(0x1EB1) ,0x1EB2 => array(0x1EB3), 0x1EB4 => array(0x1EB5), 0x1EB6 => array(0x1EB7) ,0x1EB8 => array(0x1EB9), 0x1EBA => array(0x1EBB), 0x1EBC => array(0x1EBD) ,0x1EBE => array(0x1EBF), 0x1EC0 => array(0x1EC1), 0x1EC2 => array(0x1EC3) ,0x1EC4 => array(0x1EC5), 0x1EC6 => array(0x1EC7), 0x1EC8 => array(0x1EC9) ,0x1ECA => array(0x1ECB), 0x1ECC => array(0x1ECD), 0x1ECE => array(0x1ECF) ,0x1ED0 => array(0x1ED1), 0x1ED2 => array(0x1ED3), 0x1ED4 => array(0x1ED5) ,0x1ED6 => array(0x1ED7), 0x1ED8 => array(0x1ED9), 0x1EDA => array(0x1EDB) ,0x1EDC => array(0x1EDD), 0x1EDE => array(0x1EDF), 0x1EE0 => array(0x1EE1) ,0x1EE2 => array(0x1EE3), 0x1EE4 => array(0x1EE5), 0x1EE6 => array(0x1EE7) ,0x1EE8 => array(0x1EE9), 0x1EEA => array(0x1EEB), 0x1EEC => array(0x1EED) ,0x1EEE => array(0x1EEF), 0x1EF0 => array(0x1EF1), 0x1EF2 => array(0x1EF3) ,0x1EF4 => array(0x1EF5), 0x1EF6 => array(0x1EF7), 0x1EF8 => array(0x1EF9) ,0x1F08 => array(0x1F00), 0x1F09 => array(0x1F01), 0x1F0A => array(0x1F02) ,0x1F0B => array(0x1F03), 0x1F0C => array(0x1F04), 0x1F0D => array(0x1F05) ,0x1F0E => array(0x1F06), 0x1F0F => array(0x1F07), 0x1F18 => array(0x1F10) ,0x1F19 => array(0x1F11), 0x1F1A => array(0x1F12), 0x1F1B => array(0x1F13) ,0x1F1C => array(0x1F14), 0x1F1D => array(0x1F15), 0x1F28 => array(0x1F20) ,0x1F29 => array(0x1F21), 0x1F2A => array(0x1F22), 0x1F2B => array(0x1F23) ,0x1F2C => array(0x1F24), 0x1F2D => array(0x1F25), 0x1F2E => array(0x1F26) ,0x1F2F => array(0x1F27), 0x1F38 => array(0x1F30), 0x1F39 => array(0x1F31) ,0x1F3A => array(0x1F32), 0x1F3B => array(0x1F33), 0x1F3C => array(0x1F34) ,0x1F3D => array(0x1F35), 0x1F3E => array(0x1F36), 0x1F3F => array(0x1F37) ,0x1F48 => array(0x1F40), 0x1F49 => array(0x1F41), 0x1F4A => array(0x1F42) ,0x1F4B => array(0x1F43), 0x1F4C => array(0x1F44), 0x1F4D => array(0x1F45) ,0x1F50 => array(0x3C5, 0x313), 0x1F52 => array(0x3C5, 0x313, 0x300) ,0x1F54 => array(0x3C5, 0x313, 0x301), 0x1F56 => array(0x3C5, 0x313, 0x342) ,0x1F59 => array(0x1F51), 0x1F5B => array(0x1F53), 0x1F5D => array(0x1F55) ,0x1F5F => array(0x1F57), 0x1F68 => array(0x1F60), 0x1F69 => array(0x1F61) ,0x1F6A => array(0x1F62), 0x1F6B => array(0x1F63), 0x1F6C => array(0x1F64) ,0x1F6D => array(0x1F65), 0x1F6E => array(0x1F66), 0x1F6F => array(0x1F67) ,0x1F80 => array(0x1F00, 0x3B9), 0x1F81 => array(0x1F01, 0x3B9) ,0x1F82 => array(0x1F02, 0x3B9), 0x1F83 => array(0x1F03, 0x3B9) ,0x1F84 => array(0x1F04, 0x3B9), 0x1F85 => array(0x1F05, 0x3B9) ,0x1F86 => array(0x1F06, 0x3B9), 0x1F87 => array(0x1F07, 0x3B9) ,0x1F88 => array(0x1F00, 0x3B9), 0x1F89 => array(0x1F01, 0x3B9) ,0x1F8A => array(0x1F02, 0x3B9), 0x1F8B => array(0x1F03, 0x3B9) ,0x1F8C => array(0x1F04, 0x3B9), 0x1F8D => array(0x1F05, 0x3B9) ,0x1F8E => array(0x1F06, 0x3B9), 0x1F8F => array(0x1F07, 0x3B9) ,0x1F90 => array(0x1F20, 0x3B9), 0x1F91 => array(0x1F21, 0x3B9) ,0x1F92 => array(0x1F22, 0x3B9), 0x1F93 => array(0x1F23, 0x3B9) ,0x1F94 => array(0x1F24, 0x3B9), 0x1F95 => array(0x1F25, 0x3B9) ,0x1F96 => array(0x1F26, 0x3B9), 0x1F97 => array(0x1F27, 0x3B9) ,0x1F98 => array(0x1F20, 0x3B9), 0x1F99 => array(0x1F21, 0x3B9) ,0x1F9A => array(0x1F22, 0x3B9), 0x1F9B => array(0x1F23, 0x3B9) ,0x1F9C => array(0x1F24, 0x3B9), 0x1F9D => array(0x1F25, 0x3B9) ,0x1F9E => array(0x1F26, 0x3B9), 0x1F9F => array(0x1F27, 0x3B9) ,0x1FA0 => array(0x1F60, 0x3B9), 0x1FA1 => array(0x1F61, 0x3B9) ,0x1FA2 => array(0x1F62, 0x3B9), 0x1FA3 => array(0x1F63, 0x3B9) ,0x1FA4 => array(0x1F64, 0x3B9), 0x1FA5 => array(0x1F65, 0x3B9) ,0x1FA6 => array(0x1F66, 0x3B9), 0x1FA7 => array(0x1F67, 0x3B9) ,0x1FA8 => array(0x1F60, 0x3B9), 0x1FA9 => array(0x1F61, 0x3B9) ,0x1FAA => array(0x1F62, 0x3B9), 0x1FAB => array(0x1F63, 0x3B9) ,0x1FAC => array(0x1F64, 0x3B9), 0x1FAD => array(0x1F65, 0x3B9) ,0x1FAE => array(0x1F66, 0x3B9), 0x1FAF => array(0x1F67, 0x3B9) ,0x1FB2 => array(0x1F70, 0x3B9), 0x1FB3 => array(0x3B1, 0x3B9) ,0x1FB4 => array(0x3AC, 0x3B9), 0x1FB6 => array(0x3B1, 0x342) ,0x1FB7 => array(0x3B1, 0x342, 0x3B9), 0x1FB8 => array(0x1FB0) ,0x1FB9 => array(0x1FB1), 0x1FBA => array(0x1F70), 0x1FBB => array(0x1F71) ,0x1FBC => array(0x3B1, 0x3B9), 0x1FBE => array(0x3B9) ,0x1FC2 => array(0x1F74, 0x3B9), 0x1FC3 => array(0x3B7, 0x3B9) ,0x1FC4 => array(0x3AE, 0x3B9), 0x1FC6 => array(0x3B7, 0x342) ,0x1FC7 => array(0x3B7, 0x342, 0x3B9), 0x1FC8 => array(0x1F72) ,0x1FC9 => array(0x1F73), 0x1FCA => array(0x1F74), 0x1FCB => array(0x1F75) ,0x1FCC => array(0x3B7, 0x3B9), 0x1FD2 => array(0x3B9, 0x308, 0x300) ,0x1FD3 => array(0x3B9, 0x308, 0x301), 0x1FD6 => array(0x3B9, 0x342) ,0x1FD7 => array(0x3B9, 0x308, 0x342), 0x1FD8 => array(0x1FD0) ,0x1FD9 => array(0x1FD1), 0x1FDA => array(0x1F76) ,0x1FDB => array(0x1F77), 0x1FE2 => array(0x3C5, 0x308, 0x300) ,0x1FE3 => array(0x3C5, 0x308, 0x301), 0x1FE4 => array(0x3C1, 0x313) ,0x1FE6 => array(0x3C5, 0x342), 0x1FE7 => array(0x3C5, 0x308, 0x342) ,0x1FE8 => array(0x1FE0), 0x1FE9 => array(0x1FE1) ,0x1FEA => array(0x1F7A), 0x1FEB => array(0x1F7B) ,0x1FEC => array(0x1FE5), 0x1FF2 => array(0x1F7C, 0x3B9) ,0x1FF3 => array(0x3C9, 0x3B9), 0x1FF4 => array(0x3CE, 0x3B9) ,0x1FF6 => array(0x3C9, 0x342), 0x1FF7 => array(0x3C9, 0x342, 0x3B9) ,0x1FF8 => array(0x1F78), 0x1FF9 => array(0x1F79), 0x1FFA => array(0x1F7C) ,0x1FFB => array(0x1F7D), 0x1FFC => array(0x3C9, 0x3B9) ,0x20A8 => array(0x72, 0x73), 0x2102 => array(0x63), 0x2103 => array(0xB0, 0x63) ,0x2107 => array(0x25B), 0x2109 => array(0xB0, 0x66), 0x210B => array(0x68) ,0x210C => array(0x68), 0x210D => array(0x68), 0x2110 => array(0x69) ,0x2111 => array(0x69), 0x2112 => array(0x6C), 0x2115 => array(0x6E) ,0x2116 => array(0x6E, 0x6F), 0x2119 => array(0x70), 0x211A => array(0x71) ,0x211B => array(0x72), 0x211C => array(0x72), 0x211D => array(0x72) ,0x2120 => array(0x73, 0x6D), 0x2121 => array(0x74, 0x65, 0x6C) ,0x2122 => array(0x74, 0x6D), 0x2124 => array(0x7A), 0x2126 => array(0x3C9) ,0x2128 => array(0x7A), 0x212A => array(0x6B), 0x212B => array(0xE5) ,0x212C => array(0x62), 0x212D => array(0x63), 0x2130 => array(0x65) ,0x2131 => array(0x66), 0x2133 => array(0x6D), 0x213E => array(0x3B3) ,0x213F => array(0x3C0), 0x2145 => array(0x64) ,0x2160 => array(0x2170) ,0x2161 => array(0x2171), 0x2162 => array(0x2172), 0x2163 => array(0x2173) ,0x2164 => array(0x2174), 0x2165 => array(0x2175), 0x2166 => array(0x2176) ,0x2167 => array(0x2177), 0x2168 => array(0x2178), 0x2169 => array(0x2179) ,0x216A => array(0x217A), 0x216B => array(0x217B), 0x216C => array(0x217C) ,0x216D => array(0x217D), 0x216E => array(0x217E), 0x216F => array(0x217F) ,0x24B6 => array(0x24D0), 0x24B7 => array(0x24D1), 0x24B8 => array(0x24D2) ,0x24B9 => array(0x24D3), 0x24BA => array(0x24D4), 0x24BB => array(0x24D5) ,0x24BC => array(0x24D6), 0x24BD => array(0x24D7), 0x24BE => array(0x24D8) ,0x24BF => array(0x24D9), 0x24C0 => array(0x24DA), 0x24C1 => array(0x24DB) ,0x24C2 => array(0x24DC), 0x24C3 => array(0x24DD), 0x24C4 => array(0x24DE) ,0x24C5 => array(0x24DF), 0x24C6 => array(0x24E0), 0x24C7 => array(0x24E1) ,0x24C8 => array(0x24E2), 0x24C9 => array(0x24E3), 0x24CA => array(0x24E4) ,0x24CB => array(0x24E5), 0x24CC => array(0x24E6), 0x24CD => array(0x24E7) ,0x24CE => array(0x24E8), 0x24CF => array(0x24E9), 0x3371 => array(0x68, 0x70, 0x61) ,0x3373 => array(0x61, 0x75), 0x3375 => array(0x6F, 0x76) ,0x3380 => array(0x70, 0x61), 0x3381 => array(0x6E, 0x61) ,0x3382 => array(0x3BC, 0x61), 0x3383 => array(0x6D, 0x61) ,0x3384 => array(0x6B, 0x61), 0x3385 => array(0x6B, 0x62) ,0x3386 => array(0x6D, 0x62), 0x3387 => array(0x67, 0x62) ,0x338A => array(0x70, 0x66), 0x338B => array(0x6E, 0x66) ,0x338C => array(0x3BC, 0x66), 0x3390 => array(0x68, 0x7A) ,0x3391 => array(0x6B, 0x68, 0x7A), 0x3392 => array(0x6D, 0x68, 0x7A) ,0x3393 => array(0x67, 0x68, 0x7A), 0x3394 => array(0x74, 0x68, 0x7A) ,0x33A9 => array(0x70, 0x61), 0x33AA => array(0x6B, 0x70, 0x61) ,0x33AB => array(0x6D, 0x70, 0x61), 0x33AC => array(0x67, 0x70, 0x61) ,0x33B4 => array(0x70, 0x76), 0x33B5 => array(0x6E, 0x76) ,0x33B6 => array(0x3BC, 0x76), 0x33B7 => array(0x6D, 0x76) ,0x33B8 => array(0x6B, 0x76), 0x33B9 => array(0x6D, 0x76) ,0x33BA => array(0x70, 0x77), 0x33BB => array(0x6E, 0x77) ,0x33BC => array(0x3BC, 0x77), 0x33BD => array(0x6D, 0x77) ,0x33BE => array(0x6B, 0x77), 0x33BF => array(0x6D, 0x77) ,0x33C0 => array(0x6B, 0x3C9), 0x33C1 => array(0x6D, 0x3C9) /* ,0x33C2 => array(0x61, 0x2E, 0x6D, 0x2E) */ ,0x33C3 => array(0x62, 0x71), 0x33C6 => array(0x63, 0x2215, 0x6B, 0x67) ,0x33C7 => array(0x63, 0x6F, 0x2E), 0x33C8 => array(0x64, 0x62) ,0x33C9 => array(0x67, 0x79), 0x33CB => array(0x68, 0x70) ,0x33CD => array(0x6B, 0x6B), 0x33CE => array(0x6B, 0x6D) ,0x33D7 => array(0x70, 0x68), 0x33D9 => array(0x70, 0x70, 0x6D) ,0x33DA => array(0x70, 0x72), 0x33DC => array(0x73, 0x76) ,0x33DD => array(0x77, 0x62), 0xFB00 => array(0x66, 0x66) ,0xFB01 => array(0x66, 0x69), 0xFB02 => array(0x66, 0x6C) ,0xFB03 => array(0x66, 0x66, 0x69), 0xFB04 => array(0x66, 0x66, 0x6C) ,0xFB05 => array(0x73, 0x74), 0xFB06 => array(0x73, 0x74) ,0xFB13 => array(0x574, 0x576), 0xFB14 => array(0x574, 0x565) ,0xFB15 => array(0x574, 0x56B), 0xFB16 => array(0x57E, 0x576) ,0xFB17 => array(0x574, 0x56D), 0xFF21 => array(0xFF41) ,0xFF22 => array(0xFF42), 0xFF23 => array(0xFF43), 0xFF24 => array(0xFF44) ,0xFF25 => array(0xFF45), 0xFF26 => array(0xFF46), 0xFF27 => array(0xFF47) ,0xFF28 => array(0xFF48), 0xFF29 => array(0xFF49), 0xFF2A => array(0xFF4A) ,0xFF2B => array(0xFF4B), 0xFF2C => array(0xFF4C), 0xFF2D => array(0xFF4D) ,0xFF2E => array(0xFF4E), 0xFF2F => array(0xFF4F), 0xFF30 => array(0xFF50) ,0xFF31 => array(0xFF51), 0xFF32 => array(0xFF52), 0xFF33 => array(0xFF53) ,0xFF34 => array(0xFF54), 0xFF35 => array(0xFF55), 0xFF36 => array(0xFF56) ,0xFF37 => array(0xFF57), 0xFF38 => array(0xFF58), 0xFF39 => array(0xFF59) ,0xFF3A => array(0xFF5A), 0x10400 => array(0x10428), 0x10401 => array(0x10429) ,0x10402 => array(0x1042A), 0x10403 => array(0x1042B), 0x10404 => array(0x1042C) ,0x10405 => array(0x1042D), 0x10406 => array(0x1042E), 0x10407 => array(0x1042F) ,0x10408 => array(0x10430), 0x10409 => array(0x10431), 0x1040A => array(0x10432) ,0x1040B => array(0x10433), 0x1040C => array(0x10434), 0x1040D => array(0x10435) ,0x1040E => array(0x10436), 0x1040F => array(0x10437), 0x10410 => array(0x10438) ,0x10411 => array(0x10439), 0x10412 => array(0x1043A), 0x10413 => array(0x1043B) ,0x10414 => array(0x1043C), 0x10415 => array(0x1043D), 0x10416 => array(0x1043E) ,0x10417 => array(0x1043F), 0x10418 => array(0x10440), 0x10419 => array(0x10441) ,0x1041A => array(0x10442), 0x1041B => array(0x10443), 0x1041C => array(0x10444) ,0x1041D => array(0x10445), 0x1041E => array(0x10446), 0x1041F => array(0x10447) ,0x10420 => array(0x10448), 0x10421 => array(0x10449), 0x10422 => array(0x1044A) ,0x10423 => array(0x1044B), 0x10424 => array(0x1044C), 0x10425 => array(0x1044D) ,0x1D400 => array(0x61), 0x1D401 => array(0x62), 0x1D402 => array(0x63) ,0x1D403 => array(0x64), 0x1D404 => array(0x65), 0x1D405 => array(0x66) ,0x1D406 => array(0x67), 0x1D407 => array(0x68), 0x1D408 => array(0x69) ,0x1D409 => array(0x6A), 0x1D40A => array(0x6B), 0x1D40B => array(0x6C) ,0x1D40C => array(0x6D), 0x1D40D => array(0x6E), 0x1D40E => array(0x6F) ,0x1D40F => array(0x70), 0x1D410 => array(0x71), 0x1D411 => array(0x72) ,0x1D412 => array(0x73), 0x1D413 => array(0x74), 0x1D414 => array(0x75) ,0x1D415 => array(0x76), 0x1D416 => array(0x77), 0x1D417 => array(0x78) ,0x1D418 => array(0x79), 0x1D419 => array(0x7A), 0x1D434 => array(0x61) ,0x1D435 => array(0x62), 0x1D436 => array(0x63), 0x1D437 => array(0x64) ,0x1D438 => array(0x65), 0x1D439 => array(0x66), 0x1D43A => array(0x67) ,0x1D43B => array(0x68), 0x1D43C => array(0x69), 0x1D43D => array(0x6A) ,0x1D43E => array(0x6B), 0x1D43F => array(0x6C), 0x1D440 => array(0x6D) ,0x1D441 => array(0x6E), 0x1D442 => array(0x6F), 0x1D443 => array(0x70) ,0x1D444 => array(0x71), 0x1D445 => array(0x72), 0x1D446 => array(0x73) ,0x1D447 => array(0x74), 0x1D448 => array(0x75), 0x1D449 => array(0x76) ,0x1D44A => array(0x77), 0x1D44B => array(0x78), 0x1D44C => array(0x79) ,0x1D44D => array(0x7A), 0x1D468 => array(0x61), 0x1D469 => array(0x62) ,0x1D46A => array(0x63), 0x1D46B => array(0x64), 0x1D46C => array(0x65) ,0x1D46D => array(0x66), 0x1D46E => array(0x67), 0x1D46F => array(0x68) ,0x1D470 => array(0x69), 0x1D471 => array(0x6A), 0x1D472 => array(0x6B) ,0x1D473 => array(0x6C), 0x1D474 => array(0x6D), 0x1D475 => array(0x6E) ,0x1D476 => array(0x6F), 0x1D477 => array(0x70), 0x1D478 => array(0x71) ,0x1D479 => array(0x72), 0x1D47A => array(0x73), 0x1D47B => array(0x74) ,0x1D47C => array(0x75), 0x1D47D => array(0x76), 0x1D47E => array(0x77) ,0x1D47F => array(0x78), 0x1D480 => array(0x79), 0x1D481 => array(0x7A) ,0x1D49C => array(0x61), 0x1D49E => array(0x63), 0x1D49F => array(0x64) ,0x1D4A2 => array(0x67), 0x1D4A5 => array(0x6A), 0x1D4A6 => array(0x6B) ,0x1D4A9 => array(0x6E), 0x1D4AA => array(0x6F), 0x1D4AB => array(0x70) ,0x1D4AC => array(0x71), 0x1D4AE => array(0x73), 0x1D4AF => array(0x74) ,0x1D4B0 => array(0x75), 0x1D4B1 => array(0x76), 0x1D4B2 => array(0x77) ,0x1D4B3 => array(0x78), 0x1D4B4 => array(0x79), 0x1D4B5 => array(0x7A) ,0x1D4D0 => array(0x61), 0x1D4D1 => array(0x62), 0x1D4D2 => array(0x63) ,0x1D4D3 => array(0x64), 0x1D4D4 => array(0x65), 0x1D4D5 => array(0x66) ,0x1D4D6 => array(0x67), 0x1D4D7 => array(0x68), 0x1D4D8 => array(0x69) ,0x1D4D9 => array(0x6A), 0x1D4DA => array(0x6B), 0x1D4DB => array(0x6C) ,0x1D4DC => array(0x6D), 0x1D4DD => array(0x6E), 0x1D4DE => array(0x6F) ,0x1D4DF => array(0x70), 0x1D4E0 => array(0x71), 0x1D4E1 => array(0x72) ,0x1D4E2 => array(0x73), 0x1D4E3 => array(0x74), 0x1D4E4 => array(0x75) ,0x1D4E5 => array(0x76), 0x1D4E6 => array(0x77), 0x1D4E7 => array(0x78) ,0x1D4E8 => array(0x79), 0x1D4E9 => array(0x7A), 0x1D504 => array(0x61) ,0x1D505 => array(0x62), 0x1D507 => array(0x64), 0x1D508 => array(0x65) ,0x1D509 => array(0x66), 0x1D50A => array(0x67), 0x1D50D => array(0x6A) ,0x1D50E => array(0x6B), 0x1D50F => array(0x6C), 0x1D510 => array(0x6D) ,0x1D511 => array(0x6E), 0x1D512 => array(0x6F), 0x1D513 => array(0x70) ,0x1D514 => array(0x71), 0x1D516 => array(0x73), 0x1D517 => array(0x74) ,0x1D518 => array(0x75), 0x1D519 => array(0x76), 0x1D51A => array(0x77) ,0x1D51B => array(0x78), 0x1D51C => array(0x79), 0x1D538 => array(0x61) ,0x1D539 => array(0x62), 0x1D53B => array(0x64), 0x1D53C => array(0x65) ,0x1D53D => array(0x66), 0x1D53E => array(0x67), 0x1D540 => array(0x69) ,0x1D541 => array(0x6A), 0x1D542 => array(0x6B), 0x1D543 => array(0x6C) ,0x1D544 => array(0x6D), 0x1D546 => array(0x6F), 0x1D54A => array(0x73) ,0x1D54B => array(0x74), 0x1D54C => array(0x75), 0x1D54D => array(0x76) ,0x1D54E => array(0x77), 0x1D54F => array(0x78), 0x1D550 => array(0x79) ,0x1D56C => array(0x61), 0x1D56D => array(0x62), 0x1D56E => array(0x63) ,0x1D56F => array(0x64), 0x1D570 => array(0x65), 0x1D571 => array(0x66) ,0x1D572 => array(0x67), 0x1D573 => array(0x68), 0x1D574 => array(0x69) ,0x1D575 => array(0x6A), 0x1D576 => array(0x6B), 0x1D577 => array(0x6C) ,0x1D578 => array(0x6D), 0x1D579 => array(0x6E), 0x1D57A => array(0x6F) ,0x1D57B => array(0x70), 0x1D57C => array(0x71), 0x1D57D => array(0x72) ,0x1D57E => array(0x73), 0x1D57F => array(0x74), 0x1D580 => array(0x75) ,0x1D581 => array(0x76), 0x1D582 => array(0x77), 0x1D583 => array(0x78) ,0x1D584 => array(0x79), 0x1D585 => array(0x7A), 0x1D5A0 => array(0x61) ,0x1D5A1 => array(0x62), 0x1D5A2 => array(0x63), 0x1D5A3 => array(0x64) ,0x1D5A4 => array(0x65), 0x1D5A5 => array(0x66), 0x1D5A6 => array(0x67) ,0x1D5A7 => array(0x68), 0x1D5A8 => array(0x69), 0x1D5A9 => array(0x6A) ,0x1D5AA => array(0x6B), 0x1D5AB => array(0x6C), 0x1D5AC => array(0x6D) ,0x1D5AD => array(0x6E), 0x1D5AE => array(0x6F), 0x1D5AF => array(0x70) ,0x1D5B0 => array(0x71), 0x1D5B1 => array(0x72), 0x1D5B2 => array(0x73) ,0x1D5B3 => array(0x74), 0x1D5B4 => array(0x75), 0x1D5B5 => array(0x76) ,0x1D5B6 => array(0x77), 0x1D5B7 => array(0x78), 0x1D5B8 => array(0x79) ,0x1D5B9 => array(0x7A), 0x1D5D4 => array(0x61), 0x1D5D5 => array(0x62) ,0x1D5D6 => array(0x63), 0x1D5D7 => array(0x64), 0x1D5D8 => array(0x65) ,0x1D5D9 => array(0x66), 0x1D5DA => array(0x67), 0x1D5DB => array(0x68) ,0x1D5DC => array(0x69), 0x1D5DD => array(0x6A), 0x1D5DE => array(0x6B) ,0x1D5DF => array(0x6C), 0x1D5E0 => array(0x6D), 0x1D5E1 => array(0x6E) ,0x1D5E2 => array(0x6F), 0x1D5E3 => array(0x70), 0x1D5E4 => array(0x71) ,0x1D5E5 => array(0x72), 0x1D5E6 => array(0x73), 0x1D5E7 => array(0x74) ,0x1D5E8 => array(0x75), 0x1D5E9 => array(0x76), 0x1D5EA => array(0x77) ,0x1D5EB => array(0x78), 0x1D5EC => array(0x79), 0x1D5ED => array(0x7A) ,0x1D608 => array(0x61), 0x1D609 => array(0x62) ,0x1D60A => array(0x63) ,0x1D60B => array(0x64), 0x1D60C => array(0x65), 0x1D60D => array(0x66) ,0x1D60E => array(0x67), 0x1D60F => array(0x68), 0x1D610 => array(0x69) ,0x1D611 => array(0x6A), 0x1D612 => array(0x6B), 0x1D613 => array(0x6C) ,0x1D614 => array(0x6D), 0x1D615 => array(0x6E), 0x1D616 => array(0x6F) ,0x1D617 => array(0x70), 0x1D618 => array(0x71), 0x1D619 => array(0x72) ,0x1D61A => array(0x73), 0x1D61B => array(0x74), 0x1D61C => array(0x75) ,0x1D61D => array(0x76), 0x1D61E => array(0x77), 0x1D61F => array(0x78) ,0x1D620 => array(0x79), 0x1D621 => array(0x7A), 0x1D63C => array(0x61) ,0x1D63D => array(0x62), 0x1D63E => array(0x63), 0x1D63F => array(0x64) ,0x1D640 => array(0x65), 0x1D641 => array(0x66), 0x1D642 => array(0x67) ,0x1D643 => array(0x68), 0x1D644 => array(0x69), 0x1D645 => array(0x6A) ,0x1D646 => array(0x6B), 0x1D647 => array(0x6C), 0x1D648 => array(0x6D) ,0x1D649 => array(0x6E), 0x1D64A => array(0x6F), 0x1D64B => array(0x70) ,0x1D64C => array(0x71), 0x1D64D => array(0x72), 0x1D64E => array(0x73) ,0x1D64F => array(0x74), 0x1D650 => array(0x75), 0x1D651 => array(0x76) ,0x1D652 => array(0x77), 0x1D653 => array(0x78), 0x1D654 => array(0x79) ,0x1D655 => array(0x7A), 0x1D670 => array(0x61), 0x1D671 => array(0x62) ,0x1D672 => array(0x63), 0x1D673 => array(0x64), 0x1D674 => array(0x65) ,0x1D675 => array(0x66), 0x1D676 => array(0x67), 0x1D677 => array(0x68) ,0x1D678 => array(0x69), 0x1D679 => array(0x6A), 0x1D67A => array(0x6B) ,0x1D67B => array(0x6C), 0x1D67C => array(0x6D), 0x1D67D => array(0x6E) ,0x1D67E => array(0x6F), 0x1D67F => array(0x70), 0x1D680 => array(0x71) ,0x1D681 => array(0x72), 0x1D682 => array(0x73), 0x1D683 => array(0x74) ,0x1D684 => array(0x75), 0x1D685 => array(0x76), 0x1D686 => array(0x77) ,0x1D687 => array(0x78), 0x1D688 => array(0x79), 0x1D689 => array(0x7A) ,0x1D6A8 => array(0x3B1), 0x1D6A9 => array(0x3B2), 0x1D6AA => array(0x3B3) ,0x1D6AB => array(0x3B4), 0x1D6AC => array(0x3B5), 0x1D6AD => array(0x3B6) ,0x1D6AE => array(0x3B7), 0x1D6AF => array(0x3B8), 0x1D6B0 => array(0x3B9) ,0x1D6B1 => array(0x3BA), 0x1D6B2 => array(0x3BB), 0x1D6B3 => array(0x3BC) ,0x1D6B4 => array(0x3BD), 0x1D6B5 => array(0x3BE), 0x1D6B6 => array(0x3BF) ,0x1D6B7 => array(0x3C0), 0x1D6B8 => array(0x3C1), 0x1D6B9 => array(0x3B8) ,0x1D6BA => array(0x3C3), 0x1D6BB => array(0x3C4), 0x1D6BC => array(0x3C5) ,0x1D6BD => array(0x3C6), 0x1D6BE => array(0x3C7), 0x1D6BF => array(0x3C8) ,0x1D6C0 => array(0x3C9), 0x1D6D3 => array(0x3C3), 0x1D6E2 => array(0x3B1) ,0x1D6E3 => array(0x3B2), 0x1D6E4 => array(0x3B3), 0x1D6E5 => array(0x3B4) ,0x1D6E6 => array(0x3B5), 0x1D6E7 => array(0x3B6), 0x1D6E8 => array(0x3B7) ,0x1D6E9 => array(0x3B8), 0x1D6EA => array(0x3B9), 0x1D6EB => array(0x3BA) ,0x1D6EC => array(0x3BB), 0x1D6ED => array(0x3BC), 0x1D6EE => array(0x3BD) ,0x1D6EF => array(0x3BE), 0x1D6F0 => array(0x3BF), 0x1D6F1 => array(0x3C0) ,0x1D6F2 => array(0x3C1), 0x1D6F3 => array(0x3B8) ,0x1D6F4 => array(0x3C3) ,0x1D6F5 => array(0x3C4), 0x1D6F6 => array(0x3C5), 0x1D6F7 => array(0x3C6) ,0x1D6F8 => array(0x3C7), 0x1D6F9 => array(0x3C8) ,0x1D6FA => array(0x3C9) ,0x1D70D => array(0x3C3), 0x1D71C => array(0x3B1), 0x1D71D => array(0x3B2) ,0x1D71E => array(0x3B3), 0x1D71F => array(0x3B4), 0x1D720 => array(0x3B5) ,0x1D721 => array(0x3B6), 0x1D722 => array(0x3B7), 0x1D723 => array(0x3B8) ,0x1D724 => array(0x3B9), 0x1D725 => array(0x3BA), 0x1D726 => array(0x3BB) ,0x1D727 => array(0x3BC), 0x1D728 => array(0x3BD), 0x1D729 => array(0x3BE) ,0x1D72A => array(0x3BF), 0x1D72B => array(0x3C0), 0x1D72C => array(0x3C1) ,0x1D72D => array(0x3B8), 0x1D72E => array(0x3C3), 0x1D72F => array(0x3C4) ,0x1D730 => array(0x3C5), 0x1D731 => array(0x3C6), 0x1D732 => array(0x3C7) ,0x1D733 => array(0x3C8), 0x1D734 => array(0x3C9), 0x1D747 => array(0x3C3) ,0x1D756 => array(0x3B1), 0x1D757 => array(0x3B2), 0x1D758 => array(0x3B3) ,0x1D759 => array(0x3B4), 0x1D75A => array(0x3B5), 0x1D75B => array(0x3B6) ,0x1D75C => array(0x3B7), 0x1D75D => array(0x3B8), 0x1D75E => array(0x3B9) ,0x1D75F => array(0x3BA), 0x1D760 => array(0x3BB), 0x1D761 => array(0x3BC) ,0x1D762 => array(0x3BD), 0x1D763 => array(0x3BE), 0x1D764 => array(0x3BF) ,0x1D765 => array(0x3C0), 0x1D766 => array(0x3C1), 0x1D767 => array(0x3B8) ,0x1D768 => array(0x3C3), 0x1D769 => array(0x3C4), 0x1D76A => array(0x3C5) ,0x1D76B => array(0x3C6), 0x1D76C => array(0x3C7), 0x1D76D => array(0x3C8) ,0x1D76E => array(0x3C9), 0x1D781 => array(0x3C3), 0x1D790 => array(0x3B1) ,0x1D791 => array(0x3B2), 0x1D792 => array(0x3B3), 0x1D793 => array(0x3B4) ,0x1D794 => array(0x3B5), 0x1D795 => array(0x3B6), 0x1D796 => array(0x3B7) ,0x1D797 => array(0x3B8), 0x1D798 => array(0x3B9), 0x1D799 => array(0x3BA) ,0x1D79A => array(0x3BB), 0x1D79B => array(0x3BC), 0x1D79C => array(0x3BD) ,0x1D79D => array(0x3BE), 0x1D79E => array(0x3BF), 0x1D79F => array(0x3C0) ,0x1D7A0 => array(0x3C1), 0x1D7A1 => array(0x3B8), 0x1D7A2 => array(0x3C3) ,0x1D7A3 => array(0x3C4), 0x1D7A4 => array(0x3C5), 0x1D7A5 => array(0x3C6) ,0x1D7A6 => array(0x3C7), 0x1D7A7 => array(0x3C8), 0x1D7A8 => array(0x3C9) ,0x1D7BB => array(0x3C3), 0x3F9 => array(0x3C3), 0x1D2C => array(0x61) ,0x1D2D => array(0xE6), 0x1D2E => array(0x62), 0x1D30 => array(0x64) ,0x1D31 => array(0x65), 0x1D32 => array(0x1DD), 0x1D33 => array(0x67) ,0x1D34 => array(0x68), 0x1D35 => array(0x69), 0x1D36 => array(0x6A) ,0x1D37 => array(0x6B), 0x1D38 => array(0x6C), 0x1D39 => array(0x6D) ,0x1D3A => array(0x6E), 0x1D3C => array(0x6F), 0x1D3D => array(0x223) ,0x1D3E => array(0x70), 0x1D3F => array(0x72), 0x1D40 => array(0x74) ,0x1D41 => array(0x75), 0x1D42 => array(0x77), 0x213B => array(0x66, 0x61, 0x78) ,0x3250 => array(0x70, 0x74, 0x65), 0x32CC => array(0x68, 0x67) ,0x32CE => array(0x65, 0x76), 0x32CF => array(0x6C, 0x74, 0x64) ,0x337A => array(0x69, 0x75), 0x33DE => array(0x76, 0x2215, 0x6D) ,0x33DF => array(0x61, 0x2215, 0x6D) ) ,'norm_combcls' => array(0x334 => 1, 0x335 => 1, 0x336 => 1, 0x337 => 1 ,0x338 => 1, 0x93C => 7, 0x9BC => 7, 0xA3C => 7, 0xABC => 7 ,0xB3C => 7, 0xCBC => 7, 0x1037 => 7, 0x3099 => 8, 0x309A => 8 ,0x94D => 9, 0x9CD => 9, 0xA4D => 9, 0xACD => 9, 0xB4D => 9 ,0xBCD => 9, 0xC4D => 9, 0xCCD => 9, 0xD4D => 9, 0xDCA => 9 ,0xE3A => 9, 0xF84 => 9, 0x1039 => 9, 0x1714 => 9, 0x1734 => 9 ,0x17D2 => 9, 0x5B0 => 10, 0x5B1 => 11, 0x5B2 => 12, 0x5B3 => 13 ,0x5B4 => 14, 0x5B5 => 15, 0x5B6 => 16, 0x5B7 => 17, 0x5B8 => 18 ,0x5B9 => 19, 0x5BB => 20, 0x5Bc => 21, 0x5BD => 22, 0x5BF => 23 ,0x5C1 => 24, 0x5C2 => 25, 0xFB1E => 26, 0x64B => 27, 0x64C => 28 ,0x64D => 29, 0x64E => 30, 0x64F => 31, 0x650 => 32, 0x651 => 33 ,0x652 => 34, 0x670 => 35, 0x711 => 36, 0xC55 => 84, 0xC56 => 91 ,0xE38 => 103, 0xE39 => 103, 0xE48 => 107, 0xE49 => 107, 0xE4A => 107 ,0xE4B => 107, 0xEB8 => 118, 0xEB9 => 118, 0xEC8 => 122, 0xEC9 => 122 ,0xECA => 122, 0xECB => 122, 0xF71 => 129, 0xF72 => 130, 0xF7A => 130 ,0xF7B => 130, 0xF7C => 130, 0xF7D => 130, 0xF80 => 130, 0xF74 => 132 ,0x321 => 202, 0x322 => 202, 0x327 => 202, 0x328 => 202, 0x31B => 216 ,0xF39 => 216, 0x1D165 => 216, 0x1D166 => 216, 0x1D16E => 216, 0x1D16F => 216 ,0x1D170 => 216, 0x1D171 => 216, 0x1D172 => 216, 0x302A => 218, 0x316 => 220 ,0x317 => 220, 0x318 => 220, 0x319 => 220, 0x31C => 220, 0x31D => 220 ,0x31E => 220, 0x31F => 220, 0x320 => 220, 0x323 => 220, 0x324 => 220 ,0x325 => 220, 0x326 => 220, 0x329 => 220, 0x32A => 220, 0x32B => 220 ,0x32C => 220, 0x32D => 220, 0x32E => 220, 0x32F => 220, 0x330 => 220 ,0x331 => 220, 0x332 => 220, 0x333 => 220, 0x339 => 220, 0x33A => 220 ,0x33B => 220, 0x33C => 220, 0x347 => 220, 0x348 => 220, 0x349 => 220 ,0x34D => 220, 0x34E => 220, 0x353 => 220, 0x354 => 220, 0x355 => 220 ,0x356 => 220, 0x591 => 220, 0x596 => 220, 0x59B => 220, 0x5A3 => 220 ,0x5A4 => 220, 0x5A5 => 220, 0x5A6 => 220, 0x5A7 => 220, 0x5AA => 220 ,0x655 => 220, 0x656 => 220, 0x6E3 => 220, 0x6EA => 220, 0x6ED => 220 ,0x731 => 220, 0x734 => 220, 0x737 => 220, 0x738 => 220, 0x739 => 220 ,0x73B => 220, 0x73C => 220, 0x73E => 220, 0x742 => 220, 0x744 => 220 ,0x746 => 220, 0x748 => 220, 0x952 => 220, 0xF18 => 220, 0xF19 => 220 ,0xF35 => 220, 0xF37 => 220, 0xFC6 => 220, 0x193B => 220, 0x20E8 => 220 ,0x1D17B => 220, 0x1D17C => 220, 0x1D17D => 220, 0x1D17E => 220, 0x1D17F => 220 ,0x1D180 => 220, 0x1D181 => 220, 0x1D182 => 220, 0x1D18A => 220, 0x1D18B => 220 ,0x59A => 222, 0x5AD => 222, 0x1929 => 222, 0x302D => 222, 0x302E => 224 ,0x302F => 224, 0x1D16D => 226, 0x5AE => 228, 0x18A9 => 228, 0x302B => 228 ,0x300 => 230, 0x301 => 230, 0x302 => 230, 0x303 => 230, 0x304 => 230 ,0x305 => 230, 0x306 => 230, 0x307 => 230, 0x308 => 230, 0x309 => 230 ,0x30A => 230, 0x30B => 230, 0x30C => 230, 0x30D => 230, 0x30E => 230 ,0x30F => 230, 0x310 => 230, 0x311 => 230, 0x312 => 230, 0x313 => 230 ,0x314 => 230, 0x33D => 230, 0x33E => 230, 0x33F => 230, 0x340 => 230 ,0x341 => 230, 0x342 => 230, 0x343 => 230, 0x344 => 230, 0x346 => 230 ,0x34A => 230, 0x34B => 230, 0x34C => 230, 0x350 => 230, 0x351 => 230 ,0x352 => 230, 0x357 => 230, 0x363 => 230, 0x364 => 230, 0x365 => 230 ,0x366 => 230, 0x367 => 230, 0x368 => 230, 0x369 => 230, 0x36A => 230 ,0x36B => 230, 0x36C => 230, 0x36D => 230, 0x36E => 230, 0x36F => 230 ,0x483 => 230, 0x484 => 230, 0x485 => 230, 0x486 => 230, 0x592 => 230 ,0x593 => 230, 0x594 => 230, 0x595 => 230, 0x597 => 230, 0x598 => 230 ,0x599 => 230, 0x59C => 230, 0x59D => 230, 0x59E => 230, 0x59F => 230 ,0x5A0 => 230, 0x5A1 => 230, 0x5A8 => 230, 0x5A9 => 230, 0x5AB => 230 ,0x5AC => 230, 0x5AF => 230, 0x5C4 => 230, 0x610 => 230, 0x611 => 230 ,0x612 => 230, 0x613 => 230, 0x614 => 230, 0x615 => 230, 0x653 => 230 ,0x654 => 230, 0x657 => 230, 0x658 => 230, 0x6D6 => 230, 0x6D7 => 230 ,0x6D8 => 230, 0x6D9 => 230, 0x6DA => 230, 0x6DB => 230, 0x6DC => 230 ,0x6DF => 230, 0x6E0 => 230, 0x6E1 => 230, 0x6E2 => 230, 0x6E4 => 230 ,0x6E7 => 230, 0x6E8 => 230, 0x6EB => 230, 0x6EC => 230, 0x730 => 230 ,0x732 => 230, 0x733 => 230, 0x735 => 230, 0x736 => 230, 0x73A => 230 ,0x73D => 230, 0x73F => 230, 0x740 => 230, 0x741 => 230, 0x743 => 230 ,0x745 => 230, 0x747 => 230, 0x749 => 230, 0x74A => 230, 0x951 => 230 ,0x953 => 230, 0x954 => 230, 0xF82 => 230, 0xF83 => 230, 0xF86 => 230 ,0xF87 => 230, 0x170D => 230, 0x193A => 230, 0x20D0 => 230, 0x20D1 => 230 ,0x20D4 => 230, 0x20D5 => 230, 0x20D6 => 230, 0x20D7 => 230, 0x20DB => 230 ,0x20DC => 230, 0x20E1 => 230, 0x20E7 => 230, 0x20E9 => 230, 0xFE20 => 230 ,0xFE21 => 230, 0xFE22 => 230, 0xFE23 => 230, 0x1D185 => 230, 0x1D186 => 230 ,0x1D187 => 230, 0x1D189 => 230, 0x1D188 => 230, 0x1D1AA => 230, 0x1D1AB => 230 ,0x1D1AC => 230, 0x1D1AD => 230, 0x315 => 232, 0x31A => 232, 0x302C => 232 ,0x35F => 233, 0x362 => 233, 0x35D => 234, 0x35E => 234, 0x360 => 234 ,0x361 => 234, 0x345 => 240 ) ); } ?>PK���\%��@�g�glibraries/idna_convert/LICENCEnu�[��� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! PK���\��-..,libraries/idna_convert/transcode_wrapper.phpnu�[���<?php /** * transcode wrapper functions * @package IDNA Convert * @subpackage charset transcoding * @author Matthias Sommerfeld, <mso@phlylabs.de> * @version 0.1.0 */ /** * Convert a string from any of various encodings to UTF-8 * * @param string String to encode *[@param string Encoding; Default: ISO-8859-1] *[@param bool Safe Mode: if set to TRUE, the original string is retunred on errors] * @return string The encoded string or false on failure * @since 0.0.1 */ function encode_utf8($string = '', $encoding = 'iso-8859-1', $safe_mode = false) { $safe = ($safe_mode) ? $string : false; if (strtoupper($encoding) == 'UTF-8' || strtoupper($encoding) == 'UTF8') { return $string; } elseif (strtoupper($encoding) == 'ISO-8859-1') { return utf8_encode($string); } elseif (strtoupper($encoding) == 'WINDOWS-1252') { return utf8_encode(map_w1252_iso8859_1($string)); } elseif (strtoupper($encoding) == 'UNICODE-1-1-UTF-7') { $encoding = 'utf-7'; } if (function_exists('mb_convert_encoding')) { $conv = @mb_convert_encoding($string, 'UTF-8', strtoupper($encoding)); if ($conv) return $conv; } if (function_exists('iconv')) { $conv = @iconv(strtoupper($encoding), 'UTF-8', $string); if ($conv) return $conv; } if (function_exists('libiconv')) { $conv = @libiconv(strtoupper($encoding), 'UTF-8', $string); if ($conv) return $conv; } return $safe; } /** * Convert a string from UTF-8 to any of various encodings * * @param string String to decode *[@param string Encoding; Default: ISO-8859-1] *[@param bool Safe Mode: if set to TRUE, the original string is retunred on errors] * @return string The decoded string or false on failure * @since 0.0.1 */ function decode_utf8($string = '', $encoding = 'iso-8859-1', $safe_mode = false) { $safe = ($safe_mode) ? $string : false; if (!$encoding) $encoding = 'ISO-8859-1'; if (strtoupper($encoding) == 'UTF-8' || strtoupper($encoding) == 'UTF8') { return $string; } elseif (strtoupper($encoding) == 'ISO-8859-1') { return utf8_decode($string); } elseif (strtoupper($encoding) == 'WINDOWS-1252') { return map_iso8859_1_w1252(utf8_decode($string)); } elseif (strtoupper($encoding) == 'UNICODE-1-1-UTF-7') { $encoding = 'utf-7'; } if (function_exists('mb_convert_encoding')) { $conv = @mb_convert_encoding($string, strtoupper($encoding), 'UTF-8'); if ($conv) return $conv; } if (function_exists('iconv')) { $conv = @iconv('UTF-8', strtoupper($encoding), $string); if ($conv) return $conv; } if (function_exists('libiconv')) { $conv = @libiconv('UTF-8', strtoupper($encoding), $string); if ($conv) return $conv; } return $safe; } /** * Special treatment for our guys in Redmond * Windows-1252 is basically ISO-8859-1 -- with some exceptions, which get accounted for here * @param string Your input in Win1252 * @param string The resulting ISO-8859-1 string * @since 3.0.8 */ function map_w1252_iso8859_1($string = '') { if ($string == '') return ''; $return = ''; for ($i = 0; $i < strlen($string); ++$i) { $c = ord($string{$i}); switch ($c) { case 129: $return .= chr(252); break; case 132: $return .= chr(228); break; case 142: $return .= chr(196); break; case 148: $return .= chr(246); break; case 153: $return .= chr(214); break; case 154: $return .= chr(220); break; case 225: $return .= chr(223); break; default: $return .= chr($c); break; } } return $return; } /** * Special treatment for our guys in Redmond * Windows-1252 is basically ISO-8859-1 -- with some exceptions, which get accounted for here * @param string Your input in ISO-8859-1 * @param string The resulting Win1252 string * @since 3.0.8 */ function map_iso8859_1_w1252($string = '') { if ($string == '') return ''; $return = ''; for ($i = 0; $i < strlen($string); ++$i) { $c = ord($string{$i}); switch ($c) { case 196: $return .= chr(142); break; case 214: $return .= chr(153); break; case 220: $return .= chr(154); break; case 223: $return .= chr(225); break; case 228: $return .= chr(132); break; case 246: $return .= chr(148); break; case 252: $return .= chr(129); break; default: $return .= chr($c); break; } } return $return; } ?>PK���\�hz���libraries/import.legacy.phpnu�[���<?php /** * Bootstrap file for the Joomla Platform [with legacy libraries]. Including this file into your application * will make Joomla Platform libraries [including legacy libraries] available for use. * * @package Joomla.Platform * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ // Set the platform root path as a constant if necessary. if (!defined('JPATH_PLATFORM')) { define('JPATH_PLATFORM', __DIR__); } // Detect the native operating system type. $os = strtoupper(substr(PHP_OS, 0, 3)); if (!defined('IS_WIN')) { define('IS_WIN', ($os === 'WIN') ? true : false); } if (!defined('IS_UNIX')) { define('IS_UNIX', (($os !== 'MAC') && ($os !== 'WIN')) ? true : false); } /** * @deprecated 13.3 Use IS_UNIX instead */ if (!defined('IS_MAC')) { define('IS_MAC', (IS_UNIX === true && ($os === 'DAR' || $os === 'MAC')) ? true : false); } // Import the platform version library if necessary. if (!class_exists('JPlatform')) { require_once JPATH_PLATFORM . '/platform.php'; } // Import the library loader if necessary. if (!class_exists('JLoader')) { require_once JPATH_PLATFORM . '/loader.php'; } // Make sure that the Joomla Platform has been successfully loaded. if (!class_exists('JLoader')) { throw new RuntimeException('Joomla Platform not loaded.'); } // Setup the autoloaders. JLoader::setup(); JLoader::registerPrefix('J', JPATH_PLATFORM . '/legacy'); // Import the Joomla Factory. JLoader::import('joomla.factory'); // Register classes that don't follow one file per class naming conventions. JLoader::register('JText', JPATH_PLATFORM . '/joomla/language/text.php'); JLoader::register('JRoute', JPATH_PLATFORM . '/joomla/application/route.php'); // Check if the JsonSerializable interface exists already if (!interface_exists('JsonSerializable')) { JLoader::register('JsonSerializable', JPATH_PLATFORM . '/vendor/joomla/compat/src/JsonSerializable.php'); } // Add deprecated constants // @deprecated 4.0 define('JPATH_ISWIN', IS_WIN); define('JPATH_ISMAC', IS_MAC); // Register the PasswordHash lib JLoader::register('PasswordHash', JPATH_PLATFORM . '/phpass/PasswordHash.php'); // Register classes where the names have been changed to fit the autoloader rules // @deprecated 4.0 JLoader::register('JSimpleCrypt', JPATH_PLATFORM . '/legacy/simplecrypt/simplecrypt.php'); JLoader::register('JTree', JPATH_PLATFORM . '/legacy/base/tree.php'); JLoader::register('JNode', JPATH_PLATFORM . '/legacy/base/node.php'); JLoader::register('JObserver', JPATH_PLATFORM . '/legacy/base/observer.php'); JLoader::register('JObservable', JPATH_PLATFORM . '/legacy/base/observable.php'); JLoader::register('LogException', JPATH_PLATFORM . '/legacy/log/logexception.php'); JLoader::register('JXMLElement', JPATH_PLATFORM . '/legacy/utilities/xmlelement.php'); JLoader::register('JRule', JPATH_PLATFORM . '/legacy/access/rule.php'); JLoader::register('JRules', JPATH_PLATFORM . '/legacy/access/rules.php'); JLoader::register('JCli', JPATH_PLATFORM . '/legacy/application/cli.php'); JLoader::register('JDaemon', JPATH_PLATFORM . '/legacy/application/daemon.php'); JLoader::register('JApplication', JPATH_LIBRARIES . '/legacy/application/application.php'); PK���\��XX$libraries/phputf8/substr_replace.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware substr_replace. * Note: requires utf8_substr to be loaded * @see http://www.php.net/substr_replace * @see utf8_strlen * @see utf8_substr */ function utf8_substr_replace($str, $repl, $start , $length = NULL ) { preg_match_all('/./us', $str, $ar); preg_match_all('/./us', $repl, $rar); if( $length === NULL ) { $length = utf8_strlen($str); } array_splice( $ar[0], $start, $length, $rar[0] ); return join('',$ar[0]); } PK���\�7�k>g>glibraries/phputf8/LICENSEnu�[��� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! PK���\L�����libraries/phputf8/utf8.phpnu�[���<?php /** * This is the dynamic loader for the library. It checks whether you have * the mbstring extension available and includes relevant files * on that basis, falling back to the native (as in written in PHP) version * if mbstring is unavailabe. * * It's probably easiest to use this, if you don't want to understand * the dependencies involved, in conjunction with PHP versions etc. At * the same time, you might get better performance by managing loading * yourself. The smartest way to do this, bearing in mind performance, * is probably to "load on demand" - i.e. just before you use these * functions in your code, load the version you need. * * It makes sure the the following functions are available; * utf8_strlen, utf8_strpos, utf8_strrpos, utf8_substr, * utf8_strtolower, utf8_strtoupper * Other functions in the ./native directory depend on these * six functions being available * @package utf8 */ /** * Put the current directory in this constant */ if ( !defined('UTF8') ) { define('UTF8',dirname(__FILE__)); } /** * If string overloading is active, it will break many of the * native implementations. mbstring.func_overload must be set * to 0, 1 or 4 in php.ini (string overloading disabled). * Also need to check we have the correct internal mbstring * encoding */ if ( extension_loaded('mbstring')) { if ( ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING ) { trigger_error('String functions are overloaded by mbstring',E_USER_ERROR); } mb_internal_encoding('UTF-8'); } /** * Check whether PCRE has been compiled with UTF-8 support */ $UTF8_ar = array(); if ( preg_match('/^.{1}$/u',"ñ",$UTF8_ar) != 1 ) { trigger_error('PCRE is not compiled with UTF-8 support',E_USER_ERROR); } unset($UTF8_ar); /** * Load the smartest implementations of utf8_strpos, utf8_strrpos * and utf8_substr */ if ( !defined('UTF8_CORE') ) { if ( function_exists('mb_substr') ) { require_once UTF8 . '/mbstring/core.php'; } else { require_once UTF8 . '/utils/unicode.php'; require_once UTF8 . '/native/core.php'; } } /** * Load the native implementation of utf8_substr_replace */ require_once UTF8 . '/substr_replace.php'; /** * You should now be able to use all the other utf_* string functions */ PK���\|g:Թ�libraries/phputf8/trim.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware replacement for ltrim() * Note: you only need to use this if you are supplying the charlist * optional arg and it contains UTF-8 characters. Otherwise ltrim will * work normally on a UTF-8 string * @author Andreas Gohr <andi@splitbrain.org> * @see http://www.php.net/ltrim * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @return string * @package utf8 * @subpackage strings */ function utf8_ltrim( $str, $charlist = FALSE ) { if($charlist === FALSE) return ltrim($str); //quote charlist for use in a characterclass $charlist = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$charlist); return preg_replace('/^['.$charlist.']+/u','',$str); } //--------------------------------------------------------------- /** * UTF-8 aware replacement for rtrim() * Note: you only need to use this if you are supplying the charlist * optional arg and it contains UTF-8 characters. Otherwise rtrim will * work normally on a UTF-8 string * @author Andreas Gohr <andi@splitbrain.org> * @see http://www.php.net/rtrim * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @return string * @package utf8 * @subpackage strings */ function utf8_rtrim( $str, $charlist = FALSE ) { if($charlist === FALSE) return rtrim($str); //quote charlist for use in a characterclass $charlist = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$charlist); return preg_replace('/['.$charlist.']+$/u','',$str); } //--------------------------------------------------------------- /** * UTF-8 aware replacement for trim() * Note: you only need to use this if you are supplying the charlist * optional arg and it contains UTF-8 characters. Otherwise trim will * work normally on a UTF-8 string * @author Andreas Gohr <andi@splitbrain.org> * @see http://www.php.net/trim * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @return string * @package utf8 * @subpackage strings */ function utf8_trim( $str, $charlist = FALSE ) { if($charlist === FALSE) return trim($str); return utf8_ltrim(utf8_rtrim($str, $charlist), $charlist); }PK���\� ��c c libraries/phputf8/ord.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to ord * Returns the unicode ordinal for a character * @param string UTF-8 encoded character * @return int unicode ordinal for the character * @see http://www.php.net/ord * @see http://www.php.net/manual/en/function.ord.php#46267 */ function utf8_ord($chr) { $ord0 = ord($chr); if ( $ord0 >= 0 && $ord0 <= 127 ) { return $ord0; } if ( !isset($chr{1}) ) { trigger_error('Short sequence - at least 2 bytes expected, only 1 seen'); return FALSE; } $ord1 = ord($chr{1}); if ( $ord0 >= 192 && $ord0 <= 223 ) { return ( $ord0 - 192 ) * 64 + ( $ord1 - 128 ); } if ( !isset($chr{2}) ) { trigger_error('Short sequence - at least 3 bytes expected, only 2 seen'); return FALSE; } $ord2 = ord($chr{2}); if ( $ord0 >= 224 && $ord0 <= 239 ) { return ($ord0-224)*4096 + ($ord1-128)*64 + ($ord2-128); } if ( !isset($chr{3}) ) { trigger_error('Short sequence - at least 4 bytes expected, only 3 seen'); return FALSE; } $ord3 = ord($chr{3}); if ($ord0>=240 && $ord0<=247) { return ($ord0-240)*262144 + ($ord1-128)*4096 + ($ord2-128)*64 + ($ord3-128); } if ( !isset($chr{4}) ) { trigger_error('Short sequence - at least 5 bytes expected, only 4 seen'); return FALSE; } $ord4 = ord($chr{4}); if ($ord0>=248 && $ord0<=251) { return ($ord0-248)*16777216 + ($ord1-128)*262144 + ($ord2-128)*4096 + ($ord3-128)*64 + ($ord4-128); } if ( !isset($chr{5}) ) { trigger_error('Short sequence - at least 6 bytes expected, only 5 seen'); return FALSE; } if ($ord0>=252 && $ord0<=253) { return ($ord0-252) * 1073741824 + ($ord1-128)*16777216 + ($ord2-128)*262144 + ($ord3-128)*4096 + ($ord4-128)*64 + (ord($chr{5})-128); } if ( $ord0 >= 254 && $ord0 <= 255 ) { trigger_error('Invalid UTF-8 with surrogate ordinal '.$ord0); return FALSE; } } PK���\��9��"libraries/phputf8/str_ireplace.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to str_ireplace * Case-insensitive version of str_replace * Note: requires utf8_strtolower * Note: it's not fast and gets slower if $search / $replace is array * Notes: it's based on the assumption that the lower and uppercase * versions of a UTF-8 character will have the same length in bytes * which is currently true given the hash table to strtolower * @param string * @return string * @see http://www.php.net/str_ireplace * @see utf8_strtolower * @package utf8 * @subpackage strings */ function utf8_ireplace($search, $replace, $str, $count = NULL){ if ( !is_array($search) ) { $slen = strlen($search); if ( $slen == 0 ) { return $str; } $lendif = strlen($replace) - strlen($search); $search = utf8_strtolower($search); $search = preg_quote($search, '/'); $lstr = utf8_strtolower($str); $i = 0; $matched = 0; while ( preg_match('/(.*)'.$search.'/Us',$lstr, $matches) ) { if ( $i === $count ) { break; } $mlen = strlen($matches[0]); $lstr = substr($lstr, $mlen); $str = substr_replace($str, $replace, $matched+strlen($matches[1]), $slen); $matched += $mlen + $lendif; $i++; } return $str; } else { foreach ( array_keys($search) as $k ) { if ( is_array($replace) ) { if ( array_key_exists($k,$replace) ) { $str = utf8_ireplace($search[$k], $replace[$k], $str, $count); } else { $str = utf8_ireplace($search[$k], '', $str, $count); } } else { $str = utf8_ireplace($search[$k], $replace, $str, $count); } } return $str; } } PK���\��kk#libraries/phputf8/mbstring/core.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ /** * Define UTF8_CORE as required */ if ( !defined('UTF8_CORE') ) { define('UTF8_CORE',TRUE); } //-------------------------------------------------------------------- /** * Wrapper round mb_strlen * Assumes you have mb_internal_encoding to UTF-8 already * Note: this function does not count bad bytes in the string - these * are simply ignored * @param string UTF-8 string * @return int number of UTF-8 characters in string * @package utf8 * @subpackage strings */ function utf8_strlen($str){ return mb_strlen($str); } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_strpos * Find position of first occurrence of a string * @param string haystack * @param string needle (you should validate this with utf8_is_valid) * @param integer offset in characters (from left) * @return mixed integer position or FALSE on failure * @package utf8 * @subpackage strings */ function utf8_strpos($str, $search, $offset = FALSE){ if ( $offset === FALSE ) { return mb_strpos($str, $search); } else { return mb_strpos($str, $search, $offset); } } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_strrpos * Find position of last occurrence of a char in a string * @param string haystack * @param string needle (you should validate this with utf8_is_valid) * @param integer (optional) offset (from left) * @return mixed integer position or FALSE on failure * @package utf8 * @subpackage strings */ function utf8_strrpos($str, $search, $offset = FALSE){ if ( $offset === FALSE ) { # Emulate behaviour of strrpos rather than raising warning if ( empty($str) ) { return FALSE; } return mb_strrpos($str, $search); } else { if ( !is_int($offset) ) { trigger_error('utf8_strrpos expects parameter 3 to be long',E_USER_WARNING); return FALSE; } $str = mb_substr($str, $offset); if ( FALSE !== ( $pos = mb_strrpos($str, $search) ) ) { return $pos + $offset; } return FALSE; } } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_substr * Return part of a string given character offset (and optionally length) * @param string * @param integer number of UTF-8 characters offset (from left) * @param integer (optional) length in UTF-8 characters from offset * @return mixed string or FALSE if failure * @package utf8 * @subpackage strings */ function utf8_substr($str, $offset, $length = FALSE){ if ( $length === FALSE ) { return mb_substr($str, $offset); } else { return mb_substr($str, $offset, $length); } } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_strtolower * Make a string lowercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * @param string * @return mixed either string in lowercase or FALSE is UTF-8 invalid * @package utf8 * @subpackage strings */ function utf8_strtolower($str){ return mb_strtolower($str); } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_strtoupper * Make a string uppercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * @param string * @return mixed either string in lowercase or FALSE is UTF-8 invalid * @package utf8 * @subpackage strings */ function utf8_strtoupper($str){ return mb_strtoupper($str); } PK���\L&'���$libraries/phputf8/utils/specials.phpnu�[���<?php /** * Utilities for processing "special" characters in UTF-8. "Special" largely means anything which would * be regarded as a non-word character, like ASCII control characters and punctuation. This has a "Roman" * bias - it would be unaware of modern Chinese "punctuation" characters for example. * Note: requires utils/unicode.php to be loaded * @version $Id$ * @package utf8 * @subpackage utils * @see utf8_is_valid */ //-------------------------------------------------------------------- /** * Used internally. Builds a PCRE pattern from the $UTF8_SPECIAL_CHARS * array defined in this file * The $UTF8_SPECIAL_CHARS should contain all special characters (non-letter/non-digit) * defined in the various local charsets - it's not a complete list of * non-alphanum characters in UTF-8. It's not perfect but should match most * cases of special chars. * This function adds the control chars 0x00 to 0x19 to the array of * special chars (they are not included in $UTF8_SPECIAL_CHARS) * @package utf8 * @subpackage utils * @return string * @see utf8_from_unicode * @see utf8_is_word_chars * @see utf8_strip_specials */ function utf8_specials_pattern() { static $pattern = NULL; if ( !$pattern ) { $UTF8_SPECIAL_CHARS = array( 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002f, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00d7, 0x00f7, 0x02c7, 0x02d8, 0x02d9, 0x02da, 0x02db, 0x02dc, 0x02dd, 0x0300, 0x0301, 0x0303, 0x0309, 0x0323, 0x0384, 0x0385, 0x0387, 0x03b2, 0x03c6, 0x03d1, 0x03d2, 0x03d5, 0x03d6, 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7, 0x05b8, 0x05b9, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf, 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05f3, 0x05f4, 0x060c, 0x061b, 0x061f, 0x0640, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, 0x0650, 0x0651, 0x0652, 0x066a, 0x0e3f, 0x200c, 0x200d, 0x200e, 0x200f, 0x2013, 0x2014, 0x2015, 0x2017, 0x2018, 0x2019, 0x201a, 0x201c, 0x201d, 0x201e, 0x2020, 0x2021, 0x2022, 0x2026, 0x2030, 0x2032, 0x2033, 0x2039, 0x203a, 0x2044, 0x20a7, 0x20aa, 0x20ab, 0x20ac, 0x2116, 0x2118, 0x2122, 0x2126, 0x2135, 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x21b5, 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x2200, 0x2202, 0x2203, 0x2205, 0x2206, 0x2207, 0x2208, 0x2209, 0x220b, 0x220f, 0x2211, 0x2212, 0x2215, 0x2217, 0x2219, 0x221a, 0x221d, 0x221e, 0x2220, 0x2227, 0x2228, 0x2229, 0x222a, 0x222b, 0x2234, 0x223c, 0x2245, 0x2248, 0x2260, 0x2261, 0x2264, 0x2265, 0x2282, 0x2283, 0x2284, 0x2286, 0x2287, 0x2295, 0x2297, 0x22a5, 0x22c5, 0x2310, 0x2320, 0x2321, 0x2329, 0x232a, 0x2469, 0x2500, 0x2502, 0x250c, 0x2510, 0x2514, 0x2518, 0x251c, 0x2524, 0x252c, 0x2534, 0x253c, 0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, 0x255f, 0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590, 0x2591, 0x2592, 0x2593, 0x25a0, 0x25b2, 0x25bc, 0x25c6, 0x25ca, 0x25cf, 0x25d7, 0x2605, 0x260e, 0x261b, 0x261e, 0x2660, 0x2663, 0x2665, 0x2666, 0x2701, 0x2702, 0x2703, 0x2704, 0x2706, 0x2707, 0x2708, 0x2709, 0x270c, 0x270d, 0x270e, 0x270f, 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717, 0x2718, 0x2719, 0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f, 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e, 0x272f, 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738, 0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f, 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747, 0x2748, 0x2749, 0x274a, 0x274b, 0x274d, 0x274f, 0x2750, 0x2751, 0x2752, 0x2756, 0x2758, 0x2759, 0x275a, 0x275b, 0x275c, 0x275d, 0x275e, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, 0x277f, 0x2789, 0x2793, 0x2794, 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e, 0x279f, 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7, 0x27a8, 0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af, 0x27b1, 0x27b2, 0x27b3, 0x27b4, 0x27b5, 0x27b6, 0x27b7, 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd, 0x27be, 0xf6d9, 0xf6da, 0xf6db, 0xf8d7, 0xf8d8, 0xf8d9, 0xf8da, 0xf8db, 0xf8dc, 0xf8dd, 0xf8de, 0xf8df, 0xf8e0, 0xf8e1, 0xf8e2, 0xf8e3, 0xf8e4, 0xf8e5, 0xf8e6, 0xf8e7, 0xf8e8, 0xf8e9, 0xf8ea, 0xf8eb, 0xf8ec, 0xf8ed, 0xf8ee, 0xf8ef, 0xf8f0, 0xf8f1, 0xf8f2, 0xf8f3, 0xf8f4, 0xf8f5, 0xf8f6, 0xf8f7, 0xf8f8, 0xf8f9, 0xf8fa, 0xf8fb, 0xf8fc, 0xf8fd, 0xf8fe, 0xfe7c, 0xfe7d, ); $pattern = preg_quote(utf8_from_unicode($UTF8_SPECIAL_CHARS), '/'); $pattern = '/[\x00-\x19'.$pattern.']/u'; } return $pattern; } //-------------------------------------------------------------------- /** * Checks a string for whether it contains only word characters. This * is logically equivalent to the \w PCRE meta character. Note that * this is not a 100% guarantee that the string only contains alpha / * numeric characters but just that common non-alphanumeric are not * in the string, including ASCII device control characters. * @package utf8 * @subpackage utils * @param string to check * @return boolean TRUE if the string only contains word characters * @see utf8_specials_pattern */ function utf8_is_word_chars($str) { return !(bool)preg_match(utf8_specials_pattern(),$str); } //-------------------------------------------------------------------- /** * Removes special characters (nonalphanumeric) from a UTF-8 string * * This can be useful as a helper for sanitizing a string for use as * something like a file name or a unique identifier. Be warned though * it does not handle all possible non-alphanumeric characters and is * not intended is some kind of security / injection filter. * * @package utf8 * @subpackage utils * @author Andreas Gohr <andi@splitbrain.org> * @param string $string The UTF8 string to strip of special chars * @param string (optional) $repl Replace special with this string * @return string with common non-alphanumeric characters removed * @see utf8_specials_pattern */ function utf8_strip_specials($string, $repl=''){ return preg_replace(utf8_specials_pattern(), $repl, $string); } PK���\�7t$t$#libraries/phputf8/utils/unicode.phpnu�[���<?php /** * @version $Id$ * Tools for conversion between UTF-8 and unicode * The Original Code is Mozilla Communicator client code. * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * Ported to PHP by Henri Sivonen (http://hsivonen.iki.fi) * Slight modifications to fit with phputf8 library by Harry Fuecks (hfuecks gmail com) * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUTF8ToUnicode.cpp * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUnicodeToUTF8.cpp * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 * @subpackage unicode */ //-------------------------------------------------------------------- /** * Takes an UTF-8 string and returns an array of ints representing the * Unicode characters. Astral planes are supported ie. the ints in the * output can be > 0xFFFF. Occurrances of the BOM are ignored. Surrogates * are not allowed. * Returns false if the input string isn't a valid UTF-8 octet sequence * and raises a PHP error at level E_USER_WARNING * Note: this function has been modified slightly in this library to * trigger errors on encountering bad bytes * @author <hsivonen@iki.fi> * @param string UTF-8 encoded string * @return mixed array of unicode code points or FALSE if UTF-8 invalid * @see utf8_from_unicode * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 * @subpackage unicode */ function utf8_to_unicode($str) { $mState = 0; // cached expected number of octets after the current octet // until the beginning of the next UTF8 character sequence $mUcs4 = 0; // cached Unicode character $mBytes = 1; // cached expected number of octets in the current sequence $out = array(); $len = strlen($str); for($i = 0; $i < $len; $i++) { $in = ord($str{$i}); if ( $mState == 0) { // When mState is zero we expect either a US-ASCII character or a // multi-octet sequence. if (0 == (0x80 & ($in))) { // US-ASCII, pass straight through. $out[] = $in; $mBytes = 1; } else if (0xC0 == (0xE0 & ($in))) { // First octet of 2 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x1F) << 6; $mState = 1; $mBytes = 2; } else if (0xE0 == (0xF0 & ($in))) { // First octet of 3 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x0F) << 12; $mState = 2; $mBytes = 3; } else if (0xF0 == (0xF8 & ($in))) { // First octet of 4 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x07) << 18; $mState = 3; $mBytes = 4; } else if (0xF8 == (0xFC & ($in))) { /* First octet of 5 octet sequence. * * This is illegal because the encoded codepoint must be either * (a) not the shortest form or * (b) outside the Unicode range of 0-0x10FFFF. * Rather than trying to resynchronize, we will carry on until the end * of the sequence and let the later error handling code catch it. */ $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x03) << 24; $mState = 4; $mBytes = 5; } else if (0xFC == (0xFE & ($in))) { // First octet of 6 octet sequence, see comments for 5 octet sequence. $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 1) << 30; $mState = 5; $mBytes = 6; } else { /* Current octet is neither in the US-ASCII range nor a legal first * octet of a multi-octet sequence. */ trigger_error( 'utf8_to_unicode: Illegal sequence identifier '. 'in UTF-8 at byte '.$i, E_USER_WARNING ); return FALSE; } } else { // When mState is non-zero, we expect a continuation of the multi-octet // sequence if (0x80 == (0xC0 & ($in))) { // Legal continuation. $shift = ($mState - 1) * 6; $tmp = $in; $tmp = ($tmp & 0x0000003F) << $shift; $mUcs4 |= $tmp; /** * End of the multi-octet sequence. mUcs4 now contains the final * Unicode codepoint to be output */ if (0 == --$mState) { /* * Check for illegal sequences and codepoints. */ // From Unicode 3.1, non-shortest form is illegal if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || ((3 == $mBytes) && ($mUcs4 < 0x0800)) || ((4 == $mBytes) && ($mUcs4 < 0x10000)) || (4 < $mBytes) || // From Unicode 3.2, surrogate characters are illegal (($mUcs4 & 0xFFFFF800) == 0xD800) || // Codepoints outside the Unicode range are illegal ($mUcs4 > 0x10FFFF)) { trigger_error( 'utf8_to_unicode: Illegal sequence or codepoint '. 'in UTF-8 at byte '.$i, E_USER_WARNING ); return FALSE; } if (0xFEFF != $mUcs4) { // BOM is legal but we don't want to output it $out[] = $mUcs4; } //initialize UTF8 cache $mState = 0; $mUcs4 = 0; $mBytes = 1; } } else { /** *((0xC0 & (*in) != 0x80) && (mState != 0)) * Incomplete multi-octet sequence. */ trigger_error( 'utf8_to_unicode: Incomplete multi-octet '. ' sequence in UTF-8 at byte '.$i, E_USER_WARNING ); return FALSE; } } } return $out; } //-------------------------------------------------------------------- /** * Takes an array of ints representing the Unicode characters and returns * a UTF-8 string. Astral planes are supported ie. the ints in the * input can be > 0xFFFF. Occurrances of the BOM are ignored. Surrogates * are not allowed. * Returns false if the input array contains ints that represent * surrogates or are outside the Unicode range * and raises a PHP error at level E_USER_WARNING * Note: this function has been modified slightly in this library to use * output buffering to concatenate the UTF-8 string (faster) as well as * reference the array by it's keys * @param array of unicode code points representing a string * @return mixed UTF-8 string or FALSE if array contains invalid code points * @author <hsivonen@iki.fi> * @see utf8_to_unicode * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 * @subpackage unicode */ function utf8_from_unicode($arr) { ob_start(); foreach (array_keys($arr) as $k) { # ASCII range (including control chars) if ( ($arr[$k] >= 0) && ($arr[$k] <= 0x007f) ) { echo chr($arr[$k]); # 2 byte sequence } else if ($arr[$k] <= 0x07ff) { echo chr(0xc0 | ($arr[$k] >> 6)); echo chr(0x80 | ($arr[$k] & 0x003f)); # Byte order mark (skip) } else if($arr[$k] == 0xFEFF) { // nop -- zap the BOM # Test for illegal surrogates } else if ($arr[$k] >= 0xD800 && $arr[$k] <= 0xDFFF) { // found a surrogate trigger_error( 'utf8_from_unicode: Illegal surrogate '. 'at index: '.$k.', value: '.$arr[$k], E_USER_WARNING ); return FALSE; # 3 byte sequence } else if ($arr[$k] <= 0xffff) { echo chr(0xe0 | ($arr[$k] >> 12)); echo chr(0x80 | (($arr[$k] >> 6) & 0x003f)); echo chr(0x80 | ($arr[$k] & 0x003f)); # 4 byte sequence } else if ($arr[$k] <= 0x10ffff) { echo chr(0xf0 | ($arr[$k] >> 18)); echo chr(0x80 | (($arr[$k] >> 12) & 0x3f)); echo chr(0x80 | (($arr[$k] >> 6) & 0x3f)); echo chr(0x80 | ($arr[$k] & 0x3f)); } else { trigger_error( 'utf8_from_unicode: Codepoint out of Unicode range '. 'at index: '.$k.', value: '.$arr[$k], E_USER_WARNING ); // out of range return FALSE; } } $result = ob_get_contents(); ob_end_clean(); return $result; } PK���\�ͮ>�6�6libraries/phputf8/utils/bad.phpnu�[���<?php /** * @version $Id$ * Tools for locating / replacing bad bytes in UTF-8 strings * The Original Code is Mozilla Communicator client code. * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * Ported to PHP by Henri Sivonen (http://hsivonen.iki.fi) * Slight modifications to fit with phputf8 library by Harry Fuecks (hfuecks gmail com) * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUTF8ToUnicode.cpp * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUnicodeToUTF8.cpp * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 * @subpackage bad * @see utf8_is_valid */ //-------------------------------------------------------------------- /** * Locates the first bad byte in a UTF-8 string returning it's * byte index in the string * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @param string * @return mixed integer byte index or FALSE if no bad found * @package utf8 * @subpackage bad */ function utf8_bad_find($str) { $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte $pos = 0; $badList = array(); while (preg_match('/'.$UTF8_BAD.'/S', $str, $matches)) { $bytes = strlen($matches[0]); if ( isset($matches[2])) { return $pos; } $pos += $bytes; $str = substr($str,$bytes); } return FALSE; } //-------------------------------------------------------------------- /** * Locates all bad bytes in a UTF-8 string and returns a list of their * byte index in the string * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @param string * @return mixed array of integers or FALSE if no bad found * @package utf8 * @subpackage bad */ function utf8_bad_findall($str) { $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte $pos = 0; $badList = array(); while (preg_match('/'.$UTF8_BAD.'/S', $str, $matches)) { $bytes = strlen($matches[0]); if ( isset($matches[2])) { $badList[] = $pos; } $pos += $bytes; $str = substr($str,$bytes); } if ( count($badList) > 0 ) { return $badList; } return FALSE; } //-------------------------------------------------------------------- /** * Strips out any bad bytes from a UTF-8 string and returns the rest * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @param string * @return string * @package utf8 * @subpackage bad */ function utf8_bad_strip($str) { $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte ob_start(); while (preg_match('/'.$UTF8_BAD.'/S', $str, $matches)) { if ( !isset($matches[2])) { echo $matches[0]; } $str = substr($str,strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //-------------------------------------------------------------------- /** * Replace bad bytes with an alternative character - ASCII character * recommended is replacement char * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @param string to search * @param string to replace bad bytes with (defaults to '?') - use ASCII * @return string * @package utf8 * @subpackage bad */ function utf8_bad_replace($str, $replace = '?') { $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte ob_start(); while (preg_match('/'.$UTF8_BAD.'/S', $str, $matches)) { if ( !isset($matches[2])) { echo $matches[0]; } else { echo $replace; } $str = substr($str,strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //-------------------------------------------------------------------- /** * Return code from utf8_bad_identify() when a five octet sequence is detected. * Note: 5 octets sequences are valid UTF-8 but are not supported by Unicode so * do not represent a useful character * @see utf8_bad_identify * @package utf8 * @subpackage bad */ define('UTF8_BAD_5OCTET',1); /** * Return code from utf8_bad_identify() when a six octet sequence is detected. * Note: 6 octets sequences are valid UTF-8 but are not supported by Unicode so * do not represent a useful character * @see utf8_bad_identify * @package utf8 * @subpackage bad */ define('UTF8_BAD_6OCTET',2); /** * Return code from utf8_bad_identify(). * Invalid octet for use as start of multi-byte UTF-8 sequence * @see utf8_bad_identify * @package utf8 * @subpackage bad */ define('UTF8_BAD_SEQID',3); /** * Return code from utf8_bad_identify(). * From Unicode 3.1, non-shortest form is illegal * @see utf8_bad_identify * @package utf8 * @subpackage bad */ define('UTF8_BAD_NONSHORT',4); /** * Return code from utf8_bad_identify(). * From Unicode 3.2, surrogate characters are illegal * @see utf8_bad_identify * @package utf8 * @subpackage bad */ define('UTF8_BAD_SURROGATE',5); /** * Return code from utf8_bad_identify(). * Codepoints outside the Unicode range are illegal * @see utf8_bad_identify * @package utf8 * @subpackage bad */ define('UTF8_BAD_UNIOUTRANGE',6); /** * Return code from utf8_bad_identify(). * Incomplete multi-octet sequence * Note: this is kind of a "catch-all" * @see utf8_bad_identify * @package utf8 * @subpackage bad */ define('UTF8_BAD_SEQINCOMPLETE',7); //-------------------------------------------------------------------- /** * Reports on the type of bad byte found in a UTF-8 string. Returns a * status code on the first bad byte found * @author <hsivonen@iki.fi> * @param string UTF-8 encoded string * @return mixed integer constant describing problem or FALSE if valid UTF-8 * @see utf8_bad_explain * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 * @subpackage bad */ function utf8_bad_identify($str, &$i) { $mState = 0; // cached expected number of octets after the current octet // until the beginning of the next UTF8 character sequence $mUcs4 = 0; // cached Unicode character $mBytes = 1; // cached expected number of octets in the current sequence $len = strlen($str); for($i = 0; $i < $len; $i++) { $in = ord($str{$i}); if ( $mState == 0) { // When mState is zero we expect either a US-ASCII character or a // multi-octet sequence. if (0 == (0x80 & ($in))) { // US-ASCII, pass straight through. $mBytes = 1; } else if (0xC0 == (0xE0 & ($in))) { // First octet of 2 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x1F) << 6; $mState = 1; $mBytes = 2; } else if (0xE0 == (0xF0 & ($in))) { // First octet of 3 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x0F) << 12; $mState = 2; $mBytes = 3; } else if (0xF0 == (0xF8 & ($in))) { // First octet of 4 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x07) << 18; $mState = 3; $mBytes = 4; } else if (0xF8 == (0xFC & ($in))) { /* First octet of 5 octet sequence. * * This is illegal because the encoded codepoint must be either * (a) not the shortest form or * (b) outside the Unicode range of 0-0x10FFFF. */ return UTF8_BAD_5OCTET; } else if (0xFC == (0xFE & ($in))) { // First octet of 6 octet sequence, see comments for 5 octet sequence. return UTF8_BAD_6OCTET; } else { // Current octet is neither in the US-ASCII range nor a legal first // octet of a multi-octet sequence. return UTF8_BAD_SEQID; } } else { // When mState is non-zero, we expect a continuation of the multi-octet // sequence if (0x80 == (0xC0 & ($in))) { // Legal continuation. $shift = ($mState - 1) * 6; $tmp = $in; $tmp = ($tmp & 0x0000003F) << $shift; $mUcs4 |= $tmp; /** * End of the multi-octet sequence. mUcs4 now contains the final * Unicode codepoint to be output */ if (0 == --$mState) { // From Unicode 3.1, non-shortest form is illegal if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || ((3 == $mBytes) && ($mUcs4 < 0x0800)) || ((4 == $mBytes) && ($mUcs4 < 0x10000)) ) { return UTF8_BAD_NONSHORT; // From Unicode 3.2, surrogate characters are illegal } else if (($mUcs4 & 0xFFFFF800) == 0xD800) { return UTF8_BAD_SURROGATE; // Codepoints outside the Unicode range are illegal } else if ($mUcs4 > 0x10FFFF) { return UTF8_BAD_UNIOUTRANGE; } //initialize UTF8 cache $mState = 0; $mUcs4 = 0; $mBytes = 1; } } else { // ((0xC0 & (*in) != 0x80) && (mState != 0)) // Incomplete multi-octet sequence. $i--; return UTF8_BAD_SEQINCOMPLETE; } } } if ( $mState != 0 ) { // Incomplete multi-octet sequence. $i--; return UTF8_BAD_SEQINCOMPLETE; } // No bad octets found $i = NULL; return FALSE; } //-------------------------------------------------------------------- /** * Takes a return code from utf8_bad_identify() are returns a message * (in English) explaining what the problem is. * @param int return code from utf8_bad_identify * @return mixed string message or FALSE if return code unknown * @see utf8_bad_identify * @package utf8 * @subpackage bad */ function utf8_bad_explain($code) { switch ($code) { case UTF8_BAD_5OCTET: return 'Five octet sequences are valid UTF-8 but are not supported by Unicode'; break; case UTF8_BAD_6OCTET: return 'Six octet sequences are valid UTF-8 but are not supported by Unicode'; break; case UTF8_BAD_SEQID: return 'Invalid octet for use as start of multi-byte UTF-8 sequence'; break; case UTF8_BAD_NONSHORT: return 'From Unicode 3.1, non-shortest form is illegal'; break; case UTF8_BAD_SURROGATE: return 'From Unicode 3.2, surrogate characters are illegal'; break; case UTF8_BAD_UNIOUTRANGE: return 'Codepoints outside the Unicode range are illegal'; break; case UTF8_BAD_SEQINCOMPLETE: return 'Incomplete multi-octet sequence'; break; } trigger_error('Unknown error code: '.$code,E_USER_WARNING); return FALSE; } PK���\6GNˡ!�!!libraries/phputf8/utils/ascii.phpnu�[���<?php /** * Tools to help with ASCII in UTF-8 * @version $Id$ * @package utf8 * @subpackage ascii */ //-------------------------------------------------------------------- /** * Tests whether a string contains only 7bit ASCII bytes. * You might use this to conditionally check whether a string * needs handling as UTF-8 or not, potentially offering performance * benefits by using the native PHP equivalent if it's just ASCII e.g.; * * <code> * if ( utf8_is_ascii($someString) ) { * // It's just ASCII - use the native PHP version * $someString = strtolower($someString); * } else { * $someString = utf8_strtolower($someString); * } * </code> * * @param string * @return boolean TRUE if it's all ASCII * @package utf8 * @subpackage ascii * @see utf8_is_ascii_ctrl */ function utf8_is_ascii($str) { // Search for any bytes which are outside the ASCII range... return (preg_match('/(?:[^\x00-\x7F])/',$str) !== 1); } //-------------------------------------------------------------------- /** * Tests whether a string contains only 7bit ASCII bytes with device * control codes omitted. The device control codes can be found on the * second table here: http://www.w3schools.com/tags/ref_ascii.asp * * @param string * @return boolean TRUE if it's all ASCII without device control codes * @package utf8 * @subpackage ascii * @see utf8_is_ascii */ function utf8_is_ascii_ctrl($str) { if ( strlen($str) > 0 ) { // Search for any bytes which are outside the ASCII range, // or are device control codes return (preg_match('/[^\x09\x0A\x0D\x20-\x7E]/',$str) !== 1); } return FALSE; } //-------------------------------------------------------------------- /** * Strip out all non-7bit ASCII bytes * If you need to transmit a string to system which you know can only * support 7bit ASCII, you could use this function. * @param string * @return string with non ASCII bytes removed * @package utf8 * @subpackage ascii * @see utf8_strip_non_ascii_ctrl */ function utf8_strip_non_ascii($str) { ob_start(); while ( preg_match( '/^([\x00-\x7F]+)|([^\x00-\x7F]+)/S', $str, $matches) ) { if ( !isset($matches[2]) ) { echo $matches[0]; } $str = substr($str, strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //-------------------------------------------------------------------- /** * Strip out device control codes in the ASCII range * which are not permitted in XML. Note that this leaves * multi-byte characters untouched - it only removes device * control codes * @see http://hsivonen.iki.fi/producing-xml/#controlchar * @param string * @return string control codes removed */ function utf8_strip_ascii_ctrl($str) { ob_start(); while ( preg_match( '/^([^\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+)|([\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+)/S', $str, $matches) ) { if ( !isset($matches[2]) ) { echo $matches[0]; } $str = substr($str, strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //-------------------------------------------------------------------- /** * Strip out all non 7bit ASCII bytes and ASCII device control codes. * For a list of ASCII device control codes see the 2nd table here: * http://www.w3schools.com/tags/ref_ascii.asp * * @param string * @return boolean TRUE if it's all ASCII * @package utf8 * @subpackage ascii */ function utf8_strip_non_ascii_ctrl($str) { ob_start(); while ( preg_match( '/^([\x09\x0A\x0D\x20-\x7E]+)|([^\x09\x0A\x0D\x20-\x7E]+)/S', $str, $matches) ) { if ( !isset($matches[2]) ) { echo $matches[0]; } $str = substr($str, strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //--------------------------------------------------------------- /** * Replace accented UTF-8 characters by unaccented ASCII-7 "equivalents". * The purpose of this function is to replace characters commonly found in Latin * alphabets with something more or less equivalent from the ASCII range. This can * be useful for converting a UTF-8 to something ready for a filename, for example. * Following the use of this function, you would probably also pass the string * through utf8_strip_non_ascii to clean out any other non-ASCII chars * Use the optional parameter to just deaccent lower ($case = -1) or upper ($case = 1) * letters. Default is to deaccent both cases ($case = 0) * * For a more complete implementation of transliteration, see the utf8_to_ascii package * available from the phputf8 project downloads: * http://prdownloads.sourceforge.net/phputf8 * * @param string UTF-8 string * @param int (optional) -1 lowercase only, +1 uppercase only, 1 both cases * @param string UTF-8 with accented characters replaced by ASCII chars * @return string accented chars replaced with ascii equivalents * @author Andreas Gohr <andi@splitbrain.org> * @package utf8 * @subpackage ascii */ function utf8_accents_to_ascii( $str, $case=0 ){ static $UTF8_LOWER_ACCENTS = NULL; static $UTF8_UPPER_ACCENTS = NULL; if($case <= 0){ if ( is_null($UTF8_LOWER_ACCENTS) ) { $UTF8_LOWER_ACCENTS = array( 'à' => 'a', 'ô' => 'o', 'ď' => 'd', 'ḟ' => 'f', 'ë' => 'e', 'š' => 's', 'ơ' => 'o', 'ß' => 'ss', 'ă' => 'a', 'ř' => 'r', 'ț' => 't', 'ň' => 'n', 'ā' => 'a', 'ķ' => 'k', 'ŝ' => 's', 'ỳ' => 'y', 'ņ' => 'n', 'ĺ' => 'l', 'ħ' => 'h', 'ṗ' => 'p', 'ó' => 'o', 'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', 'ẁ' => 'w', 'ċ' => 'c', 'õ' => 'o', 'ṡ' => 's', 'ø' => 'o', 'ģ' => 'g', 'ŧ' => 't', 'ș' => 's', 'ė' => 'e', 'ĉ' => 'c', 'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'ŵ' => 'w', 'ṫ' => 't', 'ū' => 'u', 'č' => 'c', 'ö' => 'oe', 'è' => 'e', 'ŷ' => 'y', 'ą' => 'a', 'ł' => 'l', 'ų' => 'u', 'ů' => 'u', 'ş' => 's', 'ğ' => 'g', 'ļ' => 'l', 'ƒ' => 'f', 'ž' => 'z', 'ẃ' => 'w', 'ḃ' => 'b', 'å' => 'a', 'ì' => 'i', 'ï' => 'i', 'ḋ' => 'd', 'ť' => 't', 'ŗ' => 'r', 'ä' => 'ae', 'í' => 'i', 'ŕ' => 'r', 'ê' => 'e', 'ü' => 'ue', 'ò' => 'o', 'ē' => 'e', 'ñ' => 'n', 'ń' => 'n', 'ĥ' => 'h', 'ĝ' => 'g', 'đ' => 'd', 'ĵ' => 'j', 'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o', 'â' => 'a', 'ľ' => 'l', 'ẅ' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g', 'ṁ' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a', 'û' => 'u', 'þ' => 'th', 'ð' => 'dh', 'æ' => 'ae', 'µ' => 'u', 'ĕ' => 'e', ); } $str = str_replace( array_keys($UTF8_LOWER_ACCENTS), array_values($UTF8_LOWER_ACCENTS), $str ); } if($case >= 0){ if ( is_null($UTF8_UPPER_ACCENTS) ) { $UTF8_UPPER_ACCENTS = array( 'À' => 'A', 'Ô' => 'O', 'Ď' => 'D', 'Ḟ' => 'F', 'Ë' => 'E', 'Š' => 'S', 'Ơ' => 'O', 'Ă' => 'A', 'Ř' => 'R', 'Ț' => 'T', 'Ň' => 'N', 'Ā' => 'A', 'Ķ' => 'K', 'Ŝ' => 'S', 'Ỳ' => 'Y', 'Ņ' => 'N', 'Ĺ' => 'L', 'Ħ' => 'H', 'Ṗ' => 'P', 'Ó' => 'O', 'Ú' => 'U', 'Ě' => 'E', 'É' => 'E', 'Ç' => 'C', 'Ẁ' => 'W', 'Ċ' => 'C', 'Õ' => 'O', 'Ṡ' => 'S', 'Ø' => 'O', 'Ģ' => 'G', 'Ŧ' => 'T', 'Ș' => 'S', 'Ė' => 'E', 'Ĉ' => 'C', 'Ś' => 'S', 'Î' => 'I', 'Ű' => 'U', 'Ć' => 'C', 'Ę' => 'E', 'Ŵ' => 'W', 'Ṫ' => 'T', 'Ū' => 'U', 'Č' => 'C', 'Ö' => 'Oe', 'È' => 'E', 'Ŷ' => 'Y', 'Ą' => 'A', 'Ł' => 'L', 'Ų' => 'U', 'Ů' => 'U', 'Ş' => 'S', 'Ğ' => 'G', 'Ļ' => 'L', 'Ƒ' => 'F', 'Ž' => 'Z', 'Ẃ' => 'W', 'Ḃ' => 'B', 'Å' => 'A', 'Ì' => 'I', 'Ï' => 'I', 'Ḋ' => 'D', 'Ť' => 'T', 'Ŗ' => 'R', 'Ä' => 'Ae', 'Í' => 'I', 'Ŕ' => 'R', 'Ê' => 'E', 'Ü' => 'Ue', 'Ò' => 'O', 'Ē' => 'E', 'Ñ' => 'N', 'Ń' => 'N', 'Ĥ' => 'H', 'Ĝ' => 'G', 'Đ' => 'D', 'Ĵ' => 'J', 'Ÿ' => 'Y', 'Ũ' => 'U', 'Ŭ' => 'U', 'Ư' => 'U', 'Ţ' => 'T', 'Ý' => 'Y', 'Ő' => 'O', 'Â' => 'A', 'Ľ' => 'L', 'Ẅ' => 'W', 'Ż' => 'Z', 'Ī' => 'I', 'Ã' => 'A', 'Ġ' => 'G', 'Ṁ' => 'M', 'Ō' => 'O', 'Ĩ' => 'I', 'Ù' => 'U', 'Į' => 'I', 'Ź' => 'Z', 'Á' => 'A', 'Û' => 'U', 'Þ' => 'Th', 'Ð' => 'Dh', 'Æ' => 'Ae', 'Ĕ' => 'E', ); } $str = str_replace( array_keys($UTF8_UPPER_ACCENTS), array_values($UTF8_UPPER_ACCENTS), $str ); } return $str; } PK���\�Üaa$libraries/phputf8/utils/position.phpnu�[���<?php /** * Locate a byte index given a UTF-8 character index * @version $Id$ * @package utf8 * @subpackage position */ //-------------------------------------------------------------------- /** * Given a string and a character index in the string, in * terms of the UTF-8 character position, returns the byte * index of that character. Can be useful when you want to * PHP's native string functions but we warned, locating * the byte can be expensive * Takes variable number of parameters - first must be * the search string then 1 to n UTF-8 character positions * to obtain byte indexes for - it is more efficient to search * the string for multiple characters at once, than make * repeated calls to this function * * @author Chris Smith<chris@jalakai.co.uk> * @param string string to locate index in * @param int (n times) * @return mixed - int if only one input int, array if more * @return boolean TRUE if it's all ASCII * @package utf8 * @subpackage position */ function utf8_byte_position() { $args = func_get_args(); $str =& array_shift($args); if (!is_string($str)) return false; $result = array(); // trivial byte index, character offset pair $prev = array(0,0); // use a short piece of str to estimate bytes per character // $i (& $j) -> byte indexes into $str $i = utf8_locate_next_chr($str, 300); // $c -> character offset into $str $c = strlen(utf8_decode(substr($str,0,$i))); // deal with arguments from lowest to highest sort($args); foreach ($args as $offset) { // sanity checks FIXME // 0 is an easy check if ($offset == 0) { $result[] = 0; continue; } // ensure no endless looping $safety_valve = 50; do { if ( ($c - $prev[1]) == 0 ) { // Hack: gone past end of string $error = 0; $i = strlen($str); break; } $j = $i + (int)(($offset-$c) * ($i - $prev[0]) / ($c - $prev[1])); // correct to utf8 character boundary $j = utf8_locate_next_chr($str, $j); // save the index, offset for use next iteration $prev = array($i,$c); if ($j > $i) { // determine new character offset $c += strlen(utf8_decode(substr($str,$i,$j-$i))); } else { // ditto $c -= strlen(utf8_decode(substr($str,$j,$i-$j))); } $error = abs($c-$offset); // ready for next time around $i = $j; // from 7 it is faster to iterate over the string } while ( ($error > 7) && --$safety_valve) ; if ($error && $error <= 7) { if ($c < $offset) { // move up while ($error--) { $i = utf8_locate_next_chr($str,++$i); } } else { // move down while ($error--) { $i = utf8_locate_current_chr($str,--$i); } } // ready for next arg $c = $offset; } $result[] = $i; } if ( count($result) == 1 ) { return $result[0]; } return $result; } //-------------------------------------------------------------------- /** * Given a string and any byte index, returns the byte index * of the start of the current UTF-8 character, relative to supplied * position. If the current character begins at the same place as the * supplied byte index, that byte index will be returned. Otherwise * this function will step backwards, looking for the index where * curent UTF-8 character begins * @author Chris Smith<chris@jalakai.co.uk> * @param string * @param int byte index in the string * @return int byte index of start of next UTF-8 character * @package utf8 * @subpackage position */ function utf8_locate_current_chr( &$str, $idx ) { if ($idx <= 0) return 0; $limit = strlen($str); if ($idx >= $limit) return $limit; // Binary value for any byte after the first in a multi-byte UTF-8 character // will be like 10xxxxxx so & 0xC0 can be used to detect this kind // of byte - assuming well formed UTF-8 while ($idx && ((ord($str[$idx]) & 0xC0) == 0x80)) $idx--; return $idx; } //-------------------------------------------------------------------- /** * Given a string and any byte index, returns the byte index * of the start of the next UTF-8 character, relative to supplied * position. If the next character begins at the same place as the * supplied byte index, that byte index will be returned. * @author Chris Smith<chris@jalakai.co.uk> * @param string * @param int byte index in the string * @return int byte index of start of next UTF-8 character * @package utf8 * @subpackage position */ function utf8_locate_next_chr( &$str, $idx ) { if ($idx <= 0) return 0; $limit = strlen($str); if ($idx >= $limit) return $limit; // Binary value for any byte after the first in a multi-byte UTF-8 character // will be like 10xxxxxx so & 0xC0 can be used to detect this kind // of byte - assuming well formed UTF-8 while (($idx < $limit) && ((ord($str[$idx]) & 0xC0) == 0x80)) $idx++; return $idx; } PK���\p8���&libraries/phputf8/utils/validation.phpnu�[���<?php /** * @version $Id$ * Tools for validing a UTF-8 string is well formed. * The Original Code is Mozilla Communicator client code. * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * Ported to PHP by Henri Sivonen (http://hsivonen.iki.fi) * Slight modifications to fit with phputf8 library by Harry Fuecks (hfuecks gmail com) * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUTF8ToUnicode.cpp * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUnicodeToUTF8.cpp * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 * @subpackage validation */ //-------------------------------------------------------------------- /** * Tests a string as to whether it's valid UTF-8 and supported by the * Unicode standard * Note: this function has been modified to simple return true or false * @author <hsivonen@iki.fi> * @param string UTF-8 encoded string * @return boolean true if valid * @see http://hsivonen.iki.fi/php-utf8/ * @see utf8_compliant * @package utf8 * @subpackage validation */ function utf8_is_valid($str) { $mState = 0; // cached expected number of octets after the current octet // until the beginning of the next UTF8 character sequence $mUcs4 = 0; // cached Unicode character $mBytes = 1; // cached expected number of octets in the current sequence $len = strlen($str); for($i = 0; $i < $len; $i++) { $in = ord($str{$i}); if ( $mState == 0) { // When mState is zero we expect either a US-ASCII character or a // multi-octet sequence. if (0 == (0x80 & ($in))) { // US-ASCII, pass straight through. $mBytes = 1; } else if (0xC0 == (0xE0 & ($in))) { // First octet of 2 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x1F) << 6; $mState = 1; $mBytes = 2; } else if (0xE0 == (0xF0 & ($in))) { // First octet of 3 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x0F) << 12; $mState = 2; $mBytes = 3; } else if (0xF0 == (0xF8 & ($in))) { // First octet of 4 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x07) << 18; $mState = 3; $mBytes = 4; } else if (0xF8 == (0xFC & ($in))) { /* First octet of 5 octet sequence. * * This is illegal because the encoded codepoint must be either * (a) not the shortest form or * (b) outside the Unicode range of 0-0x10FFFF. * Rather than trying to resynchronize, we will carry on until the end * of the sequence and let the later error handling code catch it. */ $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x03) << 24; $mState = 4; $mBytes = 5; } else if (0xFC == (0xFE & ($in))) { // First octet of 6 octet sequence, see comments for 5 octet sequence. $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 1) << 30; $mState = 5; $mBytes = 6; } else { /* Current octet is neither in the US-ASCII range nor a legal first * octet of a multi-octet sequence. */ return FALSE; } } else { // When mState is non-zero, we expect a continuation of the multi-octet // sequence if (0x80 == (0xC0 & ($in))) { // Legal continuation. $shift = ($mState - 1) * 6; $tmp = $in; $tmp = ($tmp & 0x0000003F) << $shift; $mUcs4 |= $tmp; /** * End of the multi-octet sequence. mUcs4 now contains the final * Unicode codepoint to be output */ if (0 == --$mState) { /* * Check for illegal sequences and codepoints. */ // From Unicode 3.1, non-shortest form is illegal if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || ((3 == $mBytes) && ($mUcs4 < 0x0800)) || ((4 == $mBytes) && ($mUcs4 < 0x10000)) || (4 < $mBytes) || // From Unicode 3.2, surrogate characters are illegal (($mUcs4 & 0xFFFFF800) == 0xD800) || // Codepoints outside the Unicode range are illegal ($mUcs4 > 0x10FFFF)) { return FALSE; } //initialize UTF8 cache $mState = 0; $mUcs4 = 0; $mBytes = 1; } } else { /** *((0xC0 & (*in) != 0x80) && (mState != 0)) * Incomplete multi-octet sequence. */ return FALSE; } } } return TRUE; } //-------------------------------------------------------------------- /** * Tests whether a string complies as UTF-8. This will be much * faster than utf8_is_valid but will pass five and six octet * UTF-8 sequences, which are not supported by Unicode and * so cannot be displayed correctly in a browser. In other words * it is not as strict as utf8_is_valid but it's faster. If you use * is to validate user input, you place yourself at the risk that * attackers will be able to inject 5 and 6 byte sequences (which * may or may not be a significant risk, depending on what you are * are doing) * @see utf8_is_valid * @see http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php#54805 * @param string UTF-8 string to check * @return boolean TRUE if string is valid UTF-8 * @package utf8 * @subpackage validation */ function utf8_compliant($str) { if ( strlen($str) == 0 ) { return TRUE; } // If even just the first character can be matched, when the /u // modifier is used, then it's valid UTF-8. If the UTF-8 is somehow // invalid, nothing at all will match, even if the string contains // some valid sequences return (preg_match('/^.{1}/us',$str,$ar) == 1); } PK���\����$libraries/phputf8/utils/patterns.phpnu�[���<?php /** * PCRE Regular expressions for UTF-8. Note this file is not actually used by * the rest of the library but these regular expressions can be useful to have * available. * @version $Id$ * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @package utf8 * @subpackage patterns */ //-------------------------------------------------------------------- /** * PCRE Pattern to check a UTF-8 string is valid * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @package utf8 * @subpackage patterns */ $UTF8_VALID = '^('. '[\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 ')*$'; //-------------------------------------------------------------------- /** * PCRE Pattern to match single UTF-8 characters * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @package utf8 * @subpackage patterns */ $UTF8_MATCH = '([\x00-\x7F])'. # ASCII (including control chars) '|([\xC2-\xDF][\x80-\xBF])'. # non-overlong 2-byte '|(\xE0[\xA0-\xBF][\x80-\xBF])'. # excluding overlongs '|([\xE1-\xEC\xEE\xEF][\x80-\xBF]{2})'. # straight 3-byte '|(\xED[\x80-\x9F][\x80-\xBF])'. # excluding surrogates '|(\xF0[\x90-\xBF][\x80-\xBF]{2})'. # planes 1-3 '|([\xF1-\xF3][\x80-\xBF]{3})'. # planes 4-15 '|(\xF4[\x80-\x8F][\x80-\xBF]{2})'; # plane 16 //-------------------------------------------------------------------- /** * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @package utf8 * @subpackage patterns */ $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte PK���\/�* * libraries/phputf8/READMEnu�[���++PHP UTF-8++ Version 0.5 ++DOCUMENTATION++ Documentation in progress in ./docs dir http://www.phpwact.org/php/i18n/charsets http://www.phpwact.org/php/i18n/utf-8 Important Note: DO NOT use these functions without understanding WHY you are using them. In particular, do not blindly replace all use of PHP's string functions which functions found here - most of the time you will not need to, and you will be introducing a significant performance overhead to your application. You can get a good idea of when to use what from reading: http://www.phpwact.org/php/i18n/utf-8 Important Note: For sake of performance most of the functions here are not "defensive" (e.g. there is not extensive parameter checking, well formed UTF-8 is assumed). This is particularily relevant when is comes to catching badly formed UTF-8 - you should screen input on the "outer perimeter" with help from functions in the utf8_validation.php and utf8_bad.php files. Important Note: this library treats ALL ASCII characters as valid, including ASCII control characters. But if you use some ASCII control characters in XML, it will render the XML ill-formed. Don't be a bozo: http://hsivonen.iki.fi/producing-xml/#controlchar ++BUGS / SUPPORT / FEATURE REQUESTS ++ Please report bugs to: http://sourceforge.net/tracker/?group_id=142846&atid=753842 - if you are able, please submit a failing unit test (http://www.lastcraft.com/simple_test.php) with your bug report. For feature requests / faster implementation of functions found here, please drop them in via the RFE tracker: http://sourceforge.net/tracker/?group_id=142846&atid=753845 Particularily interested in faster implementations! For general support / help, use: http://sourceforge.net/tracker/?group_id=142846&atid=753843 In the VERY WORST case, you can email me: hfuecks gmail com - I tend to be slow to respond though so be warned. Important Note: when reporting bugs, please provide the following information; PHP version, whether the iconv extension is loaded (in PHP5 it's there by default), whether the mbstring extension is loaded. The following PHP script can be used to determine this information; <?php print "PHP Version: " .phpversion()."<br>"; if ( extension_loaded('mbstring') ) { print "mbstring available<br>"; } else { print "mbstring not available<br>"; } if ( extension_loaded('iconv') ) { print "iconv available<br>"; } else { print "iconv not available<br>"; } ?> ++LICENSING++ Parts of the code in this library come from other places, under different licenses. The authors involved have been contacted (see below). Attribution for which code came from elsewhere can be found in the source code itself. +Andreas Gohr / Chris Smith - Dokuwiki There is a fair degree of collaboration / exchange of ideas and code beteen Dokuwiki's UTF-8 library; http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php and phputf8. Although Dokuwiki is released under GPL, its UTF-8 library is released under LGPL, hence no conflict with phputf8 +Henri Sivonen (http://hsivonen.iki.fi/php-utf8/ / http://hsivonen.iki.fi/php-utf8/) has also given permission for his code to be released under the terms of the LGPL. He ported a Unicode / UTF-8 converter from the Mozilla codebase to PHP, which is re-used in phputf8 PK���\I�u��libraries/phputf8/ucwords.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to ucwords * Uppercase the first character of each word in a string * Note: requires utf8_substr_replace and utf8_strtoupper * @param string * @return string with first char of each word uppercase * @see http://www.php.net/ucwords * @package utf8 * @subpackage strings */ function utf8_ucwords($str) { // Note: [\x0c\x09\x0b\x0a\x0d\x20] matches; // form feeds, horizontal tabs, vertical tabs, linefeeds and carriage returns // This corresponds to the definition of a "word" defined at http://www.php.net/ucwords $pattern = '/(^|([\x0c\x09\x0b\x0a\x0d\x20]+))([^\x0c\x09\x0b\x0a\x0d\x20]{1})[^\x0c\x09\x0b\x0a\x0d\x20]*/u'; return preg_replace_callback($pattern, 'utf8_ucwords_callback',$str); } //--------------------------------------------------------------- /** * Callback function for preg_replace_callback call in utf8_ucwords * You don't need to call this yourself * @param array of matches corresponding to a single word * @return string with first char of the word in uppercase * @see utf8_ucwords * @see utf8_strtoupper * @package utf8 * @subpackage strings */ function utf8_ucwords_callback($matches) { $leadingws = $matches[2]; $ucfirst = utf8_strtoupper($matches[3]); $ucword = utf8_substr_replace(ltrim($matches[0]),$ucfirst,0,1); return $leadingws . $ucword; } PK���\E:\�WWlibraries/phputf8/stristr.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to stristr * Find first occurrence of a string using case insensitive comparison * Note: requires utf8_strtolower * @param string * @param string * @return int * @see http://www.php.net/strcasecmp * @see utf8_strtolower * @package utf8 * @subpackage strings */ function utf8_stristr($str, $search) { if ( strlen($search) == 0 ) { return $str; } $lstr = utf8_strtolower($str); $lsearch = utf8_strtolower($search); //JOOMLA SPECIFIC FIX - BEGIN preg_match('/^(.*)'.preg_quote($lsearch, '/').'/Us',$lstr, $matches); //JOOMLA SPECIFIC FIX - END if ( count($matches) == 2 ) { return substr($str, strlen($matches[1])); } return FALSE; } PK���\�U��88libraries/phputf8/str_split.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to str_split * Convert a string to an array * Note: requires utf8_strlen to be loaded * @param string UTF-8 encoded * @param int number to characters to split string by * @return string characters in string reverses * @see http://www.php.net/str_split * @see utf8_strlen * @package utf8 * @subpackage strings */ function utf8_str_split($str, $split_len = 1) { if ( !preg_match('/^[0-9]+$/',$split_len) || $split_len < 1 ) { return FALSE; } $len = utf8_strlen($str); if ( $len <= $split_len ) { return array($str); } preg_match_all('/.{'.$split_len.'}|[^\x00]{1,'.$split_len.'}$/us', $str, $ar); return $ar[0]; } PK���\כ&~~libraries/phputf8/strcspn.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to strcspn * Find length of initial segment not matching mask * Note: requires utf8_strlen and utf8_substr (if start, length are used) * @param string * @return int * @see http://www.php.net/strcspn * @see utf8_strlen * @package utf8 * @subpackage strings */ function utf8_strcspn($str, $mask, $start = NULL, $length = NULL) { if ( empty($mask) || strlen($mask) == 0 ) { return NULL; } $mask = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$mask); if ( $start !== NULL || $length !== NULL ) { $str = utf8_substr($str, $start, $length); } preg_match('/^[^'.$mask.']+/u',$str, $matches); if ( isset($matches[0]) ) { return utf8_strlen($matches[0]); } return 0; } PK���\Ϗ} ��libraries/phputf8/str_pad.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * Replacement for str_pad. $padStr may contain multi-byte characters. * * @author Oliver Saunders <oliver (a) osinternetservices.com> * @param string $input * @param int $length * @param string $padStr * @param int $type ( same constants as str_pad ) * @return string * @see http://www.php.net/str_pad * @see utf8_substr * @package utf8 * @subpackage strings */ function utf8_str_pad($input, $length, $padStr = ' ', $type = STR_PAD_RIGHT) { $inputLen = utf8_strlen($input); if ($length <= $inputLen) { return $input; } $padStrLen = utf8_strlen($padStr); $padLen = $length - $inputLen; if ($type == STR_PAD_RIGHT) { $repeatTimes = ceil($padLen / $padStrLen); return utf8_substr($input . str_repeat($padStr, $repeatTimes), 0, $length); } if ($type == STR_PAD_LEFT) { $repeatTimes = ceil($padLen / $padStrLen); return utf8_substr(str_repeat($padStr, $repeatTimes), 0, floor($padLen)) . $input; } if ($type == STR_PAD_BOTH) { $padLen/= 2; $padAmountLeft = floor($padLen); $padAmountRight = ceil($padLen); $repeatTimesLeft = ceil($padAmountLeft / $padStrLen); $repeatTimesRight = ceil($padAmountRight / $padStrLen); $paddingLeft = utf8_substr(str_repeat($padStr, $repeatTimesLeft), 0, $padAmountLeft); $paddingRight = utf8_substr(str_repeat($padStr, $repeatTimesRight), 0, $padAmountLeft); return $paddingLeft . $input . $paddingRight; } trigger_error('utf8_str_pad: Unknown padding type (' . $type . ')',E_USER_ERROR); } PK���\�0�QeBeB!libraries/phputf8/native/core.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ /** * Define UTF8_CORE as required */ if ( !defined('UTF8_CORE') ) { define('UTF8_CORE',TRUE); } //-------------------------------------------------------------------- /** * Unicode aware replacement for strlen(). Returns the number * of characters in the string (not the number of bytes), replacing * multibyte characters with a single byte equivalent * utf8_decode() converts characters that are not in ISO-8859-1 * to '?', which, for the purpose of counting, is alright - It's * much faster than iconv_strlen * Note: this function does not count bad UTF-8 bytes in the string * - these are simply ignored * @author <chernyshevsky at hotmail dot com> * @link http://www.php.net/manual/en/function.strlen.php * @link http://www.php.net/manual/en/function.utf8-decode.php * @param string UTF-8 string * @return int number of UTF-8 characters in string * @package utf8 * @subpackage strings */ function utf8_strlen($str){ return strlen(utf8_decode($str)); } //-------------------------------------------------------------------- /** * UTF-8 aware alternative to strpos * Find position of first occurrence of a string * Note: This will get alot slower if offset is used * Note: requires utf8_strlen amd utf8_substr to be loaded * @param string haystack * @param string needle (you should validate this with utf8_is_valid) * @param integer offset in characters (from left) * @return mixed integer position or FALSE on failure * @see http://www.php.net/strpos * @see utf8_strlen * @see utf8_substr * @package utf8 * @subpackage strings */ function utf8_strpos($str, $needle, $offset = NULL) { if ( is_null($offset) ) { $ar = explode($needle, $str, 2); if ( count($ar) > 1 ) { return utf8_strlen($ar[0]); } return FALSE; } else { if ( !is_int($offset) ) { trigger_error('utf8_strpos: Offset must be an integer',E_USER_ERROR); return FALSE; } $str = utf8_substr($str, $offset); if ( FALSE !== ( $pos = utf8_strpos($str, $needle) ) ) { return $pos + $offset; } return FALSE; } } //-------------------------------------------------------------------- /** * UTF-8 aware alternative to strrpos * Find position of last occurrence of a char in a string * Note: This will get alot slower if offset is used * Note: requires utf8_substr and utf8_strlen to be loaded * @param string haystack * @param string needle (you should validate this with utf8_is_valid) * @param integer (optional) offset (from left) * @return mixed integer position or FALSE on failure * @see http://www.php.net/strrpos * @see utf8_substr * @see utf8_strlen * @package utf8 * @subpackage strings */ function utf8_strrpos($str, $needle, $offset = NULL) { if ( is_null($offset) ) { $ar = explode($needle, $str); if ( count($ar) > 1 ) { // Pop off the end of the string where the last match was made array_pop($ar); $str = join($needle,$ar); return utf8_strlen($str); } return FALSE; } else { if ( !is_int($offset) ) { trigger_error('utf8_strrpos expects parameter 3 to be long',E_USER_WARNING); return FALSE; } $str = utf8_substr($str, $offset); if ( FALSE !== ( $pos = utf8_strrpos($str, $needle) ) ) { return $pos + $offset; } return FALSE; } } //-------------------------------------------------------------------- /** * UTF-8 aware alternative to substr * Return part of a string given character offset (and optionally length) * * Note arguments: comparied to substr - if offset or length are * not integers, this version will not complain but rather massages them * into an integer. * * Note on returned values: substr documentation states false can be * returned in some cases (e.g. offset > string length) * mb_substr never returns false, it will return an empty string instead. * This adopts the mb_substr approach * * Note on implementation: PCRE only supports repetitions of less than * 65536, in order to accept up to MAXINT values for offset and length, * we'll repeat a group of 65535 characters when needed. * * Note on implementation: calculating the number of characters in the * string is a relatively expensive operation, so we only carry it out when * necessary. It isn't necessary for +ve offsets and no specified length * * @author Chris Smith<chris@jalakai.co.uk> * @param string * @param integer number of UTF-8 characters offset (from left) * @param integer (optional) length in UTF-8 characters from offset * @return mixed string or FALSE if failure * @package utf8 * @subpackage strings */ function utf8_substr($str, $offset, $length = NULL) { // generates E_NOTICE // for PHP4 objects, but not PHP5 objects $str = (string)$str; $offset = (int)$offset; if (!is_null($length)) $length = (int)$length; // handle trivial cases if ($length === 0) return ''; if ($offset < 0 && $length < 0 && $length < $offset) return ''; // normalise negative offsets (we could use a tail // anchored pattern, but they are horribly slow!) if ($offset < 0) { // see notes $strlen = strlen(utf8_decode($str)); $offset = $strlen + $offset; if ($offset < 0) $offset = 0; } $Op = ''; $Lp = ''; // establish a pattern for offset, a // non-captured group equal in length to offset if ($offset > 0) { $Ox = (int)($offset/65535); $Oy = $offset%65535; if ($Ox) { $Op = '(?:.{65535}){'.$Ox.'}'; } $Op = '^(?:'.$Op.'.{'.$Oy.'})'; } else { // offset == 0; just anchor the pattern $Op = '^'; } // establish a pattern for length if (is_null($length)) { // the rest of the string $Lp = '(.*)$'; } else { if (!isset($strlen)) { // see notes $strlen = strlen(utf8_decode($str)); } // another trivial case if ($offset > $strlen) return ''; if ($length > 0) { // reduce any length that would // go passed the end of the string $length = min($strlen-$offset, $length); $Lx = (int)( $length / 65535 ); $Ly = $length % 65535; // negative length requires a captured group // of length characters if ($Lx) $Lp = '(?:.{65535}){'.$Lx.'}'; $Lp = '('.$Lp.'.{'.$Ly.'})'; } else if ($length < 0) { if ( $length < ($offset - $strlen) ) { return ''; } $Lx = (int)((-$length)/65535); $Ly = (-$length)%65535; // negative length requires ... capture everything // except a group of -length characters // anchored at the tail-end of the string if ($Lx) $Lp = '(?:.{65535}){'.$Lx.'}'; $Lp = '(.*)(?:'.$Lp.'.{'.$Ly.'})$'; } } if (!preg_match( '#'.$Op.$Lp.'#us',$str, $match )) { return ''; } return $match[1]; } //--------------------------------------------------------------- /** * UTF-8 aware alternative to strtolower * Make a string lowercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * Note: requires utf8_to_unicode and utf8_from_unicode * @author Andreas Gohr <andi@splitbrain.org> * @param string * @return mixed either string in lowercase or FALSE is UTF-8 invalid * @see http://www.php.net/strtolower * @see utf8_to_unicode * @see utf8_from_unicode * @see http://www.unicode.org/reports/tr21/tr21-5.html * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @package utf8 * @subpackage strings */ function utf8_strtolower($string){ static $UTF8_UPPER_TO_LOWER = NULL; if ( is_null($UTF8_UPPER_TO_LOWER) ) { $UTF8_UPPER_TO_LOWER = array( 0x0041=>0x0061, 0x03A6=>0x03C6, 0x0162=>0x0163, 0x00C5=>0x00E5, 0x0042=>0x0062, 0x0139=>0x013A, 0x00C1=>0x00E1, 0x0141=>0x0142, 0x038E=>0x03CD, 0x0100=>0x0101, 0x0490=>0x0491, 0x0394=>0x03B4, 0x015A=>0x015B, 0x0044=>0x0064, 0x0393=>0x03B3, 0x00D4=>0x00F4, 0x042A=>0x044A, 0x0419=>0x0439, 0x0112=>0x0113, 0x041C=>0x043C, 0x015E=>0x015F, 0x0143=>0x0144, 0x00CE=>0x00EE, 0x040E=>0x045E, 0x042F=>0x044F, 0x039A=>0x03BA, 0x0154=>0x0155, 0x0049=>0x0069, 0x0053=>0x0073, 0x1E1E=>0x1E1F, 0x0134=>0x0135, 0x0427=>0x0447, 0x03A0=>0x03C0, 0x0418=>0x0438, 0x00D3=>0x00F3, 0x0420=>0x0440, 0x0404=>0x0454, 0x0415=>0x0435, 0x0429=>0x0449, 0x014A=>0x014B, 0x0411=>0x0431, 0x0409=>0x0459, 0x1E02=>0x1E03, 0x00D6=>0x00F6, 0x00D9=>0x00F9, 0x004E=>0x006E, 0x0401=>0x0451, 0x03A4=>0x03C4, 0x0423=>0x0443, 0x015C=>0x015D, 0x0403=>0x0453, 0x03A8=>0x03C8, 0x0158=>0x0159, 0x0047=>0x0067, 0x00C4=>0x00E4, 0x0386=>0x03AC, 0x0389=>0x03AE, 0x0166=>0x0167, 0x039E=>0x03BE, 0x0164=>0x0165, 0x0116=>0x0117, 0x0108=>0x0109, 0x0056=>0x0076, 0x00DE=>0x00FE, 0x0156=>0x0157, 0x00DA=>0x00FA, 0x1E60=>0x1E61, 0x1E82=>0x1E83, 0x00C2=>0x00E2, 0x0118=>0x0119, 0x0145=>0x0146, 0x0050=>0x0070, 0x0150=>0x0151, 0x042E=>0x044E, 0x0128=>0x0129, 0x03A7=>0x03C7, 0x013D=>0x013E, 0x0422=>0x0442, 0x005A=>0x007A, 0x0428=>0x0448, 0x03A1=>0x03C1, 0x1E80=>0x1E81, 0x016C=>0x016D, 0x00D5=>0x00F5, 0x0055=>0x0075, 0x0176=>0x0177, 0x00DC=>0x00FC, 0x1E56=>0x1E57, 0x03A3=>0x03C3, 0x041A=>0x043A, 0x004D=>0x006D, 0x016A=>0x016B, 0x0170=>0x0171, 0x0424=>0x0444, 0x00CC=>0x00EC, 0x0168=>0x0169, 0x039F=>0x03BF, 0x004B=>0x006B, 0x00D2=>0x00F2, 0x00C0=>0x00E0, 0x0414=>0x0434, 0x03A9=>0x03C9, 0x1E6A=>0x1E6B, 0x00C3=>0x00E3, 0x042D=>0x044D, 0x0416=>0x0436, 0x01A0=>0x01A1, 0x010C=>0x010D, 0x011C=>0x011D, 0x00D0=>0x00F0, 0x013B=>0x013C, 0x040F=>0x045F, 0x040A=>0x045A, 0x00C8=>0x00E8, 0x03A5=>0x03C5, 0x0046=>0x0066, 0x00DD=>0x00FD, 0x0043=>0x0063, 0x021A=>0x021B, 0x00CA=>0x00EA, 0x0399=>0x03B9, 0x0179=>0x017A, 0x00CF=>0x00EF, 0x01AF=>0x01B0, 0x0045=>0x0065, 0x039B=>0x03BB, 0x0398=>0x03B8, 0x039C=>0x03BC, 0x040C=>0x045C, 0x041F=>0x043F, 0x042C=>0x044C, 0x00DE=>0x00FE, 0x00D0=>0x00F0, 0x1EF2=>0x1EF3, 0x0048=>0x0068, 0x00CB=>0x00EB, 0x0110=>0x0111, 0x0413=>0x0433, 0x012E=>0x012F, 0x00C6=>0x00E6, 0x0058=>0x0078, 0x0160=>0x0161, 0x016E=>0x016F, 0x0391=>0x03B1, 0x0407=>0x0457, 0x0172=>0x0173, 0x0178=>0x00FF, 0x004F=>0x006F, 0x041B=>0x043B, 0x0395=>0x03B5, 0x0425=>0x0445, 0x0120=>0x0121, 0x017D=>0x017E, 0x017B=>0x017C, 0x0396=>0x03B6, 0x0392=>0x03B2, 0x0388=>0x03AD, 0x1E84=>0x1E85, 0x0174=>0x0175, 0x0051=>0x0071, 0x0417=>0x0437, 0x1E0A=>0x1E0B, 0x0147=>0x0148, 0x0104=>0x0105, 0x0408=>0x0458, 0x014C=>0x014D, 0x00CD=>0x00ED, 0x0059=>0x0079, 0x010A=>0x010B, 0x038F=>0x03CE, 0x0052=>0x0072, 0x0410=>0x0430, 0x0405=>0x0455, 0x0402=>0x0452, 0x0126=>0x0127, 0x0136=>0x0137, 0x012A=>0x012B, 0x038A=>0x03AF, 0x042B=>0x044B, 0x004C=>0x006C, 0x0397=>0x03B7, 0x0124=>0x0125, 0x0218=>0x0219, 0x00DB=>0x00FB, 0x011E=>0x011F, 0x041E=>0x043E, 0x1E40=>0x1E41, 0x039D=>0x03BD, 0x0106=>0x0107, 0x03AB=>0x03CB, 0x0426=>0x0446, 0x00DE=>0x00FE, 0x00C7=>0x00E7, 0x03AA=>0x03CA, 0x0421=>0x0441, 0x0412=>0x0432, 0x010E=>0x010F, 0x00D8=>0x00F8, 0x0057=>0x0077, 0x011A=>0x011B, 0x0054=>0x0074, 0x004A=>0x006A, 0x040B=>0x045B, 0x0406=>0x0456, 0x0102=>0x0103, 0x039B=>0x03BB, 0x00D1=>0x00F1, 0x041D=>0x043D, 0x038C=>0x03CC, 0x00C9=>0x00E9, 0x00D0=>0x00F0, 0x0407=>0x0457, 0x0122=>0x0123, ); } $uni = utf8_to_unicode($string); if ( !$uni ) { return FALSE; } $cnt = count($uni); for ($i=0; $i < $cnt; $i++){ if ( isset($UTF8_UPPER_TO_LOWER[$uni[$i]]) ) { $uni[$i] = $UTF8_UPPER_TO_LOWER[$uni[$i]]; } } return utf8_from_unicode($uni); } //--------------------------------------------------------------- /** * UTF-8 aware alternative to strtoupper * Make a string uppercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * Note: requires utf8_to_unicode and utf8_from_unicode * @author Andreas Gohr <andi@splitbrain.org> * @param string * @return mixed either string in lowercase or FALSE is UTF-8 invalid * @see http://www.php.net/strtoupper * @see utf8_to_unicode * @see utf8_from_unicode * @see http://www.unicode.org/reports/tr21/tr21-5.html * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @package utf8 * @subpackage strings */ function utf8_strtoupper($string){ static $UTF8_LOWER_TO_UPPER = NULL; if ( is_null($UTF8_LOWER_TO_UPPER) ) { $UTF8_LOWER_TO_UPPER = array( 0x0061=>0x0041, 0x03C6=>0x03A6, 0x0163=>0x0162, 0x00E5=>0x00C5, 0x0062=>0x0042, 0x013A=>0x0139, 0x00E1=>0x00C1, 0x0142=>0x0141, 0x03CD=>0x038E, 0x0101=>0x0100, 0x0491=>0x0490, 0x03B4=>0x0394, 0x015B=>0x015A, 0x0064=>0x0044, 0x03B3=>0x0393, 0x00F4=>0x00D4, 0x044A=>0x042A, 0x0439=>0x0419, 0x0113=>0x0112, 0x043C=>0x041C, 0x015F=>0x015E, 0x0144=>0x0143, 0x00EE=>0x00CE, 0x045E=>0x040E, 0x044F=>0x042F, 0x03BA=>0x039A, 0x0155=>0x0154, 0x0069=>0x0049, 0x0073=>0x0053, 0x1E1F=>0x1E1E, 0x0135=>0x0134, 0x0447=>0x0427, 0x03C0=>0x03A0, 0x0438=>0x0418, 0x00F3=>0x00D3, 0x0440=>0x0420, 0x0454=>0x0404, 0x0435=>0x0415, 0x0449=>0x0429, 0x014B=>0x014A, 0x0431=>0x0411, 0x0459=>0x0409, 0x1E03=>0x1E02, 0x00F6=>0x00D6, 0x00F9=>0x00D9, 0x006E=>0x004E, 0x0451=>0x0401, 0x03C4=>0x03A4, 0x0443=>0x0423, 0x015D=>0x015C, 0x0453=>0x0403, 0x03C8=>0x03A8, 0x0159=>0x0158, 0x0067=>0x0047, 0x00E4=>0x00C4, 0x03AC=>0x0386, 0x03AE=>0x0389, 0x0167=>0x0166, 0x03BE=>0x039E, 0x0165=>0x0164, 0x0117=>0x0116, 0x0109=>0x0108, 0x0076=>0x0056, 0x00FE=>0x00DE, 0x0157=>0x0156, 0x00FA=>0x00DA, 0x1E61=>0x1E60, 0x1E83=>0x1E82, 0x00E2=>0x00C2, 0x0119=>0x0118, 0x0146=>0x0145, 0x0070=>0x0050, 0x0151=>0x0150, 0x044E=>0x042E, 0x0129=>0x0128, 0x03C7=>0x03A7, 0x013E=>0x013D, 0x0442=>0x0422, 0x007A=>0x005A, 0x0448=>0x0428, 0x03C1=>0x03A1, 0x1E81=>0x1E80, 0x016D=>0x016C, 0x00F5=>0x00D5, 0x0075=>0x0055, 0x0177=>0x0176, 0x00FC=>0x00DC, 0x1E57=>0x1E56, 0x03C3=>0x03A3, 0x043A=>0x041A, 0x006D=>0x004D, 0x016B=>0x016A, 0x0171=>0x0170, 0x0444=>0x0424, 0x00EC=>0x00CC, 0x0169=>0x0168, 0x03BF=>0x039F, 0x006B=>0x004B, 0x00F2=>0x00D2, 0x00E0=>0x00C0, 0x0434=>0x0414, 0x03C9=>0x03A9, 0x1E6B=>0x1E6A, 0x00E3=>0x00C3, 0x044D=>0x042D, 0x0436=>0x0416, 0x01A1=>0x01A0, 0x010D=>0x010C, 0x011D=>0x011C, 0x00F0=>0x00D0, 0x013C=>0x013B, 0x045F=>0x040F, 0x045A=>0x040A, 0x00E8=>0x00C8, 0x03C5=>0x03A5, 0x0066=>0x0046, 0x00FD=>0x00DD, 0x0063=>0x0043, 0x021B=>0x021A, 0x00EA=>0x00CA, 0x03B9=>0x0399, 0x017A=>0x0179, 0x00EF=>0x00CF, 0x01B0=>0x01AF, 0x0065=>0x0045, 0x03BB=>0x039B, 0x03B8=>0x0398, 0x03BC=>0x039C, 0x045C=>0x040C, 0x043F=>0x041F, 0x044C=>0x042C, 0x00FE=>0x00DE, 0x00F0=>0x00D0, 0x1EF3=>0x1EF2, 0x0068=>0x0048, 0x00EB=>0x00CB, 0x0111=>0x0110, 0x0433=>0x0413, 0x012F=>0x012E, 0x00E6=>0x00C6, 0x0078=>0x0058, 0x0161=>0x0160, 0x016F=>0x016E, 0x03B1=>0x0391, 0x0457=>0x0407, 0x0173=>0x0172, 0x00FF=>0x0178, 0x006F=>0x004F, 0x043B=>0x041B, 0x03B5=>0x0395, 0x0445=>0x0425, 0x0121=>0x0120, 0x017E=>0x017D, 0x017C=>0x017B, 0x03B6=>0x0396, 0x03B2=>0x0392, 0x03AD=>0x0388, 0x1E85=>0x1E84, 0x0175=>0x0174, 0x0071=>0x0051, 0x0437=>0x0417, 0x1E0B=>0x1E0A, 0x0148=>0x0147, 0x0105=>0x0104, 0x0458=>0x0408, 0x014D=>0x014C, 0x00ED=>0x00CD, 0x0079=>0x0059, 0x010B=>0x010A, 0x03CE=>0x038F, 0x0072=>0x0052, 0x0430=>0x0410, 0x0455=>0x0405, 0x0452=>0x0402, 0x0127=>0x0126, 0x0137=>0x0136, 0x012B=>0x012A, 0x03AF=>0x038A, 0x044B=>0x042B, 0x006C=>0x004C, 0x03B7=>0x0397, 0x0125=>0x0124, 0x0219=>0x0218, 0x00FB=>0x00DB, 0x011F=>0x011E, 0x043E=>0x041E, 0x1E41=>0x1E40, 0x03BD=>0x039D, 0x0107=>0x0106, 0x03CB=>0x03AB, 0x0446=>0x0426, 0x00FE=>0x00DE, 0x00E7=>0x00C7, 0x03CA=>0x03AA, 0x0441=>0x0421, 0x0432=>0x0412, 0x010F=>0x010E, 0x00F8=>0x00D8, 0x0077=>0x0057, 0x011B=>0x011A, 0x0074=>0x0054, 0x006A=>0x004A, 0x045B=>0x040B, 0x0456=>0x0406, 0x0103=>0x0102, 0x03BB=>0x039B, 0x00F1=>0x00D1, 0x043D=>0x041D, 0x03CC=>0x038C, 0x00E9=>0x00C9, 0x00F0=>0x00D0, 0x0457=>0x0407, 0x0123=>0x0122, ); } $uni = utf8_to_unicode($string); if ( !$uni ) { return FALSE; } $cnt = count($uni); for ($i=0; $i < $cnt; $i++){ if( isset($UTF8_LOWER_TO_UPPER[$uni[$i]]) ) { $uni[$i] = $UTF8_LOWER_TO_UPPER[$uni[$i]]; } } return utf8_from_unicode($uni); } PK���\"hT���libraries/phputf8/strrev.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to strrev * Reverse a string * @param string UTF-8 encoded * @return string characters in string reverses * @see http://www.php.net/strrev * @package utf8 * @subpackage strings */ function utf8_strrev($str){ preg_match_all('/./us', $str, $ar); return join('',array_reverse($ar[0])); } PK���\��libraries/phputf8/ucfirst.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to ucfirst * Make a string's first character uppercase * Note: requires utf8_strtoupper * @param string * @return string with first character as upper case (if applicable) * @see http://www.php.net/ucfirst * @see utf8_strtoupper * @package utf8 * @subpackage strings */ function utf8_ucfirst($str){ switch ( utf8_strlen($str) ) { case 0: return ''; break; case 1: return utf8_strtoupper($str); break; default: preg_match('/^(.{1})(.*)$/us', $str, $matches); return utf8_strtoupper($matches[1]).$matches[2]; break; } } PK���\{C��"" libraries/phputf8/strcasecmp.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to strcasecmp * A case insensivite string comparison * Note: requires utf8_strtolower * @param string * @param string * @return int * @see http://www.php.net/strcasecmp * @see utf8_strtolower * @package utf8 * @subpackage strings */ function utf8_strcasecmp($strX, $strY) { $strX = utf8_strtolower($strX); $strY = utf8_strtolower($strY); return strcmp($strX, $strY); } PK���\D嬇��libraries/phputf8/strspn.phpnu�[���<?php /** * @version $Id$ * @package utf8 * @subpackage strings */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to strspn * Find length of initial segment matching mask * Note: requires utf8_strlen and utf8_substr (if start, length are used) * @param string * @return int * @see http://www.php.net/strspn * @package utf8 * @subpackage strings */ function utf8_strspn($str, $mask, $start = NULL, $length = NULL) { $mask = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$mask); // Fix for $start but no $length argument. if ($start !== null && $length === null) { $length = utf8_strlen($str); } if ( $start !== NULL || $length !== NULL ) { $str = utf8_substr($str, $start, $length); } preg_match('/^['.$mask.']+/u',$str, $matches); if ( isset($matches[0]) ) { return utf8_strlen($matches[0]); } return 0; } PK���\�6��libraries/cms.phpnu�[���<?php /** * @package Joomla.Libraries * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('_JEXEC') or die; // Set the platform root path as a constant if necessary. if (!defined('JPATH_PLATFORM')) { define('JPATH_PLATFORM', __DIR__); } // Import the library loader if necessary. if (!class_exists('JLoader')) { require_once JPATH_PLATFORM . '/loader.php'; } // Make sure that the Joomla Platform has been successfully loaded. if (!class_exists('JLoader')) { throw new RuntimeException('Joomla Platform not loaded.'); } // Register the library base path for CMS libraries. JLoader::registerPrefix('J', JPATH_PLATFORM . '/cms', false, true); // Create the Composer autoloader $loader = require JPATH_LIBRARIES . '/vendor/autoload.php'; $loader->unregister(); // Decorate Composer autoloader spl_autoload_register(array(new JClassLoader($loader), 'loadClass'), true, true); // Register the class aliases for Framework classes that have replaced their Platform equivilents require_once JPATH_LIBRARIES . '/classmap.php'; // Ensure FOF autoloader included - needed for things like content versioning where we need to get an FOFTable Instance if (!class_exists('FOFAutoloaderFof')) { include_once JPATH_LIBRARIES . '/fof/include.php'; } // Register a handler for uncaught exceptions that shows a pretty error page when possible set_exception_handler(array('JErrorPage', 'render')); // Define the Joomla version if not already defined. if (!defined('JVERSION')) { $jversion = new JVersion; define('JVERSION', $jversion->getShortVersion()); } // Set up the message queue logger for web requests if (array_key_exists('REQUEST_METHOD', $_SERVER)) { JLog::addLogger(array('logger' => 'messagequeue'), JLog::ALL, array('jerror')); } // Register JArrayHelper due to JRegistry moved to composer's vendor folder JLoader::register('JArrayHelper', JPATH_PLATFORM . '/joomla/utilities/arrayhelper.php'); // Register classes where the names have been changed to fit the autoloader rules // @deprecated 4.0 JLoader::register('JToolBar', JPATH_PLATFORM . '/cms/toolbar/toolbar.php'); JLoader::register('JButton', JPATH_PLATFORM . '/cms/toolbar/button.php'); JLoader::register('JInstallerComponent', JPATH_PLATFORM . '/cms/installer/adapter/component.php'); JLoader::register('JInstallerFile', JPATH_PLATFORM . '/cms/installer/adapter/file.php'); JLoader::register('JInstallerLanguage', JPATH_PLATFORM . '/cms/installer/adapter/language.php'); JLoader::register('JInstallerLibrary', JPATH_PLATFORM . '/cms/installer/adapter/library.php'); JLoader::register('JInstallerModule', JPATH_PLATFORM . '/cms/installer/adapter/module.php'); JLoader::register('JInstallerPackage', JPATH_PLATFORM . '/cms/installer/adapter/package.php'); JLoader::register('JInstallerPlugin', JPATH_PLATFORM . '/cms/installer/adapter/plugin.php'); JLoader::register('JInstallerTemplate', JPATH_PLATFORM . '/cms/installer/adapter/template.php'); JLoader::register('JExtension', JPATH_PLATFORM . '/cms/installer/extension.php'); JLoader::registerAlias('JAdministrator', 'JApplicationAdministrator'); JLoader::registerAlias('JSite', 'JApplicationSite'); PK���\f��88libraries/import.phpnu�[���<?php /** * Bootstrap file for the Joomla Platform. Including this file into your application will make Joomla * Platform libraries available for use. * * @package Joomla.Platform * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ // Set the platform root path as a constant if necessary. if (!defined('JPATH_PLATFORM')) { define('JPATH_PLATFORM', __DIR__); } // Detect the native operating system type. $os = strtoupper(substr(PHP_OS, 0, 3)); if (!defined('IS_WIN')) { define('IS_WIN', ($os === 'WIN') ? true : false); } if (!defined('IS_UNIX')) { define('IS_UNIX', (IS_WIN === false) ? true : false); } // Import the platform version library if necessary. if (!class_exists('JPlatform')) { require_once JPATH_PLATFORM . '/platform.php'; } // Import the library loader if necessary. if (!class_exists('JLoader')) { require_once JPATH_PLATFORM . '/loader.php'; } // Make sure that the Joomla Platform has been successfully loaded. if (!class_exists('JLoader')) { throw new RuntimeException('Joomla Platform not loaded.'); } // Setup the autoloaders. JLoader::setup(); // Import the base Joomla Platform libraries. JLoader::import('joomla.factory'); // Check if the JsonSerializable interface exists already if (!interface_exists('JsonSerializable')) { JLoader::register('JsonSerializable', JPATH_PLATFORM . '/vendor/joomla/compat/src/JsonSerializable.php'); } // Register classes that don't follow one file per class naming conventions. JLoader::register('JText', JPATH_PLATFORM . '/joomla/language/text.php'); JLoader::register('JRoute', JPATH_PLATFORM . '/joomla/application/route.php'); // Register the PasswordHash lib JLoader::register('PasswordHash', JPATH_PLATFORM . '/phpass/PasswordHash.php'); PK���\�b>*�A�Alibraries/loader.phpnu�[���<?php /** * @package Joomla.Platform * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Static class to handle loading of libraries. * * @package Joomla.Platform * @since 11.1 */ abstract class JLoader { /** * Container for already imported library paths. * * @var array * @since 11.1 */ protected static $classes = array(); /** * Container for already imported library paths. * * @var array * @since 11.1 */ protected static $imported = array(); /** * Container for registered library class prefixes and path lookups. * * @var array * @since 12.1 */ protected static $prefixes = array(); /** * Holds proxy classes and the class names the proxy. * * @var array * @since 3.2 */ protected static $classAliases = array(); /** * Holds the inverse lookup for proxy classes and the class names the proxy. * * @var array * @since 3.4 */ protected static $classAliasesInverse = array(); /** * Container for namespace => path map. * * @var array * @since 12.3 */ protected static $namespaces = array(); /** * Method to discover classes of a given type in a given path. * * @param string $classPrefix The class name prefix to use for discovery. * @param string $parentPath Full path to the parent folder for the classes to discover. * @param boolean $force True to overwrite the autoload path value for the class if it already exists. * @param boolean $recurse Recurse through all child directories as well as the parent path. * * @return void * * @since 11.1 */ public static function discover($classPrefix, $parentPath, $force = true, $recurse = false) { try { if ($recurse) { $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($parentPath), RecursiveIteratorIterator::SELF_FIRST ); } else { $iterator = new DirectoryIterator($parentPath); } /* @type $file DirectoryIterator */ foreach ($iterator as $file) { $fileName = $file->getFilename(); // Only load for php files. if ($file->isFile() && $file->getExtension() == 'php') { // Get the class name and full path for each file. $class = strtolower($classPrefix . preg_replace('#\.php$#', '', $fileName)); // Register the class with the autoloader if not already registered or the force flag is set. if (empty(self::$classes[$class]) || $force) { self::register($class, $file->getPath() . '/' . $fileName); } } } } catch (UnexpectedValueException $e) { // Exception will be thrown if the path is not a directory. Ignore it. } } /** * Method to get the list of registered classes and their respective file paths for the autoloader. * * @return array The array of class => path values for the autoloader. * * @since 11.1 */ public static function getClassList() { return self::$classes; } /** * Method to get the list of registered namespaces. * * @return array The array of namespace => path values for the autoloader. * * @since 12.3 */ public static function getNamespaces() { return self::$namespaces; } /** * Loads a class from specified directories. * * @param string $key The class name to look for (dot notation). * @param string $base Search this directory for the class. * * @return boolean True on success. * * @since 11.1 */ public static function import($key, $base = null) { // Only import the library if not already attempted. if (!isset(self::$imported[$key])) { // Setup some variables. $success = false; $parts = explode('.', $key); $class = array_pop($parts); $base = (!empty($base)) ? $base : __DIR__; $path = str_replace('.', DIRECTORY_SEPARATOR, $key); // Handle special case for helper classes. if ($class == 'helper') { $class = ucfirst(array_pop($parts)) . ucfirst($class); } // Standard class. else { $class = ucfirst($class); } // If we are importing a library from the Joomla namespace set the class to autoload. if (strpos($path, 'joomla') === 0) { // Since we are in the Joomla namespace prepend the classname with J. $class = 'J' . $class; // Only register the class for autoloading if the file exists. if (is_file($base . '/' . $path . '.php')) { self::$classes[strtolower($class)] = $base . '/' . $path . '.php'; $success = true; } } /* * If we are not importing a library from the Joomla namespace directly include the * file since we cannot assert the file/folder naming conventions. */ else { // If the file exists attempt to include it. if (is_file($base . '/' . $path . '.php')) { $success = (bool) include_once $base . '/' . $path . '.php'; } } // Add the import key to the memory cache container. self::$imported[$key] = $success; } return self::$imported[$key]; } /** * Load the file for a class. * * @param string $class The class to be loaded. * * @return boolean True on success * * @since 11.1 */ public static function load($class) { // Sanitize class name. $class = strtolower($class); // If the class already exists do nothing. if (class_exists($class, false)) { return true; } // If the class is registered include the file. if (isset(self::$classes[$class])) { include_once self::$classes[$class]; return true; } return false; } /** * Directly register a class to the autoload list. * * @param string $class The class name to register. * @param string $path Full path to the file that holds the class to register. * @param boolean $force True to overwrite the autoload path value for the class if it already exists. * * @return void * * @since 11.1 */ public static function register($class, $path, $force = true) { // Sanitize class name. $class = strtolower($class); // Only attempt to register the class if the name and file exist. if (!empty($class) && is_file($path)) { // Register the class with the autoloader if not already registered or the force flag is set. if (empty(self::$classes[$class]) || $force) { self::$classes[$class] = $path; } } } /** * Register a class prefix with lookup path. This will allow developers to register library * packages with different class prefixes to the system autoloader. More than one lookup path * may be registered for the same class prefix, but if this method is called with the reset flag * set to true then any registered lookups for the given prefix will be overwritten with the current * lookup path. When loaded, prefix paths are searched in a "last in, first out" order. * * @param string $prefix The class prefix to register. * @param string $path Absolute file path to the library root where classes with the given prefix can be found. * @param boolean $reset True to reset the prefix with only the given lookup path. * @param boolean $prepend If true, push the path to the beginning of the prefix lookup paths array. * * @return void * * @throws RuntimeException * * @since 12.1 */ public static function registerPrefix($prefix, $path, $reset = false, $prepend = false) { // Verify the library path exists. if (!file_exists($path)) { $path = (str_replace(JPATH_ROOT, '', $path) == $path) ? basename($path) : str_replace(JPATH_ROOT, '', $path); throw new RuntimeException('Library path ' . $path . ' cannot be found.', 500); } // If the prefix is not yet registered or we have an explicit reset flag then set set the path. if (!isset(self::$prefixes[$prefix]) || $reset) { self::$prefixes[$prefix] = array($path); } // Otherwise we want to simply add the path to the prefix. else { if ($prepend) { array_unshift(self::$prefixes[$prefix], $path); } else { self::$prefixes[$prefix][] = $path; } } } /** * Offers the ability for "just in time" usage of `class_alias()`. * You cannot overwrite an existing alias. * * @param string $alias The alias name to register. * @param string $original The original class to alias. * * @return boolean True if registration was successful. False if the alias already exists. * * @since 3.2 */ public static function registerAlias($alias, $original) { if (!isset(self::$classAliases[$alias])) { self::$classAliases[$alias] = $original; // Remove the root backslash if present. if ($original[0] == '\\') { $original = substr($original, 1); } if (!isset(self::$classAliasesInverse[$original])) { self::$classAliasesInverse[$original] = array($alias); } else { self::$classAliasesInverse[$original][] = $alias; } return true; } return false; } /** * Register a namespace to the autoloader. When loaded, namespace paths are searched in a "last in, first out" order. * * @param string $namespace A case sensitive Namespace to register. * @param string $path A case sensitive absolute file path to the library root where classes of the given namespace can be found. * @param boolean $reset True to reset the namespace with only the given lookup path. * @param boolean $prepend If true, push the path to the beginning of the namespace lookup paths array. * * @return void * * @throws RuntimeException * * @since 12.3 */ public static function registerNamespace($namespace, $path, $reset = false, $prepend = false) { // Verify the library path exists. if (!file_exists($path)) { $path = (str_replace(JPATH_ROOT, '', $path) == $path) ? basename($path) : str_replace(JPATH_ROOT, '', $path); throw new RuntimeException('Library path ' . $path . ' cannot be found.', 500); } // If the namespace is not yet registered or we have an explicit reset flag then set the path. if (!isset(self::$namespaces[$namespace]) || $reset) { self::$namespaces[$namespace] = array($path); } // Otherwise we want to simply add the path to the namespace. else { if ($prepend) { array_unshift(self::$namespaces[$namespace], $path); } else { self::$namespaces[$namespace][] = $path; } } } /** * Method to setup the autoloaders for the Joomla Platform. * Since the SPL autoloaders are called in a queue we will add our explicit * class-registration based loader first, then fall back on the autoloader based on conventions. * This will allow people to register a class in a specific location and override platform libraries * as was previously possible. * * @param boolean $enablePsr True to enable autoloading based on PSR-0. * @param boolean $enablePrefixes True to enable prefix based class loading (needed to auto load the Joomla core). * @param boolean $enableClasses True to enable class map based class loading (needed to auto load the Joomla core). * * @return void * * @since 12.3 */ public static function setup($enablePsr = true, $enablePrefixes = true, $enableClasses = true) { if ($enableClasses) { // Register the class map based autoloader. spl_autoload_register(array('JLoader', 'load')); } if ($enablePrefixes) { // Register the J prefix and base path for Joomla platform libraries. self::registerPrefix('J', JPATH_PLATFORM . '/joomla'); // Register the prefix autoloader. spl_autoload_register(array('JLoader', '_autoload')); } if ($enablePsr) { // Register the PSR-0 based autoloader. spl_autoload_register(array('JLoader', 'loadByPsr0')); spl_autoload_register(array('JLoader', 'loadByAlias')); } } /** * Method to autoload classes that are namespaced to the PSR-0 standard. * * @param string $class The fully qualified class name to autoload. * * @return boolean True on success, false otherwise. * * @since 13.1 */ public static function loadByPsr0($class) { // Remove the root backslash if present. if ($class[0] == '\\') { $class = substr($class, 1); } // Find the location of the last NS separator. $pos = strrpos($class, '\\'); // If one is found, we're dealing with a NS'd class. if ($pos !== false) { $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR; $className = substr($class, $pos + 1); } // If not, no need to parse path. else { $classPath = null; $className = $class; } $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; // Loop through registered namespaces until we find a match. foreach (self::$namespaces as $ns => $paths) { if (strpos($class, $ns) === 0) { // Loop through paths registered to this namespace until we find a match. foreach ($paths as $path) { $classFilePath = $path . DIRECTORY_SEPARATOR . $classPath; // We check for class_exists to handle case-sensitive file systems if (file_exists($classFilePath) && !class_exists($class, false)) { return (bool) include_once $classFilePath; } } } } return false; } /** * Method to autoload classes that have been aliased using the registerAlias method. * * @param string $class The fully qualified class name to autoload. * * @return boolean True on success, false otherwise. * * @since 3.2 */ public static function loadByAlias($class) { // Remove the root backslash if present. if ($class[0] == '\\') { $class = substr($class, 1); } if (isset(self::$classAliases[$class])) { // Force auto-load of the regular class class_exists(self::$classAliases[$class], true); // Normally this shouldn't execute as the autoloader will execute applyAliasFor when the regular class is // auto-loaded above. if (!class_exists($class, false) && !interface_exists($class, false)) { class_alias(self::$classAliases[$class], $class); } } } /** * Applies a class alias for an already loaded class, if a class alias was created for it. * * @param string $class We'll look for and register aliases for this (real) class name * * @return void * * @since 3.4 */ public static function applyAliasFor($class) { // Remove the root backslash if present. if ($class[0] == '\\') { $class = substr($class, 1); } if (isset(self::$classAliasesInverse[$class])) { foreach (self::$classAliasesInverse[$class] as $alias) { class_alias($class, $alias); } } } /** * Autoload a class based on name. * * @param string $class The class to be loaded. * * @return boolean True if the class was loaded, false otherwise. * * @since 11.3 */ private static function _autoload($class) { foreach (self::$prefixes as $prefix => $lookup) { $chr = strlen($prefix) < strlen($class) ? $class[strlen($prefix)] : 0; if (strpos($class, $prefix) === 0 && ($chr === strtoupper($chr))) { return self::_load(substr($class, strlen($prefix)), $lookup); } } return false; } /** * Load a class based on name and lookup array. * * @param string $class The class to be loaded (wihtout prefix). * @param array $lookup The array of base paths to use for finding the class file. * * @return boolean True if the class was loaded, false otherwise. * * @since 12.1 */ private static function _load($class, $lookup) { // Split the class name into parts separated by camelCase. $parts = preg_split('/(?<=[a-z0-9])(?=[A-Z])/x', $class); // If there is only one part we want to duplicate that part for generating the path. $parts = (count($parts) === 1) ? array($parts[0], $parts[0]) : $parts; foreach ($lookup as $base) { // Generate the path based on the class name parts. $path = $base . '/' . implode('/', array_map('strtolower', $parts)) . '.php'; // Load the file if it exists. if (file_exists($path)) { return include $path; } } return false; } } /** * Global application exit. * * This function provides a single exit point for the platform. * * @param mixed $message Exit code or string. Defaults to zero. * * @return void * * @codeCoverageIgnore * @since 11.1 */ function jexit($message = 0) { exit($message); } /** * Intelligent file importer. * * @param string $path A dot syntax path. * * @return boolean True on success. * * @since 11.1 */ function jimport($path) { return JLoader::import($path); } PK���\,�؟CC%libraries/legacy/log/logexception.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLog::add('LogException is deprecated, use SPL Exceptions instead.', JLog::WARNING, 'deprecated'); /** * Exception class definition for the Log subpackage. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use semantic exceptions instead */ class LogException extends RuntimeException { } PK���\lY�&libraries/legacy/response/response.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Response * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLog::add('JResponse is deprecated.', JLog::WARNING, 'deprecated'); /** * JResponse Class. * * This class serves to provide the Joomla Platform with a common interface to access * response variables. This includes header and body. * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb instead */ class JResponse { /** * @var array Body * @since 11.1 * @deprecated 4.0 */ protected static $body = array(); /** * @var boolean Cachable * @since 11.1 * @deprecated 4.0 */ protected static $cachable = false; /** * @var array Headers * @since 11.1 * @deprecated 4.0 */ protected static $headers = array(); /** * Set/get cachable state for the response. * * If $allow is set, sets the cachable state of the response. Always returns current state. * * @param boolean $allow True to allow browser caching. * * @return boolean True if browser caching should be allowed * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::allowCache() instead */ public static function allowCache($allow = null) { return JFactory::getApplication()->allowCache($allow); } /** * Set a header. * * If $replace is true, replaces any headers already defined with that $name. * * @param string $name The name of the header to set. * @param string $value The value of the header to set. * @param boolean $replace True to replace any existing headers by name. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::setHeader() instead */ public static function setHeader($name, $value, $replace = false) { JFactory::getApplication()->setHeader($name, $value, $replace); } /** * Return array of headers. * * @return array * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::getHeaders() instead */ public static function getHeaders() { return JFactory::getApplication()->getHeaders(); } /** * Clear headers. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::clearHeaders() instead */ public static function clearHeaders() { JFactory::getApplication()->clearHeaders(); } /** * Send all headers. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::sendHeaders() instead */ public static function sendHeaders() { JFactory::getApplication()->sendHeaders(); } /** * Set body content. * * If body content already defined, this will replace it. * * @param string $content The content to set to the response body. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::setBody() instead */ public static function setBody($content) { JFactory::getApplication()->setBody($content); } /** * Prepend content to the body content * * @param string $content The content to prepend to the response body. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::prependBody() instead */ public static function prependBody($content) { JFactory::getApplication()->prependBody($content); } /** * Append content to the body content * * @param string $content The content to append to the response body. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::appendBody() instead */ public static function appendBody($content) { JFactory::getApplication()->appendBody($content); } /** * Return the body content * * @param boolean $toArray Whether or not to return the body content as an array of strings or as a single string; defaults to false. * * @return string array * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::getBody() instead */ public static function getBody($toArray = false) { return JFactory::getApplication()->getBody($toArray); } /** * Sends all headers prior to returning the string * * @param boolean $compress If true, compress the data * * @return string * * @since 11.1 * @deprecated 4.0 Use JApplicationCms::toString() instead */ public static function toString($compress = false) { return JFactory::getApplication()->toString($compress); } /** * Compress the data * * Checks the accept encoding of the browser and compresses the data before * sending it to the client. * * @param string $data Content to compress for output. * * @return string compressed data * * @note Replaces _compress method in 11.1 * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::compress() instead */ protected static function compress($data) { $encoding = self::clientEncoding(); if (!$encoding) { return $data; } if (!extension_loaded('zlib') || ini_get('zlib.output_compression')) { return $data; } if (headers_sent()) { return $data; } if (connection_status() !== 0) { return $data; } // Ideal level $level = 4; /* $size = strlen($data); $crc = crc32($data); $gzdata = "\x1f\x8b\x08\x00\x00\x00\x00\x00"; $gzdata .= gzcompress($data, $level); $gzdata = substr($gzdata, 0, strlen($gzdata) - 4); $gzdata .= pack("V",$crc) . pack("V", $size); */ $gzdata = gzencode($data, $level); self::setHeader('Content-Encoding', $encoding); // Header will be removed at 4.0 if (JFactory::getConfig()->get('MetaVersion', 0) && defined('JVERSION')) { self::setHeader('X-Content-Encoded-By', 'Joomla! ' . JVERSION); } return $gzdata; } /** * Check, whether client supports compressed data * * @return boolean * * @since 11.1 * @note Replaces _clientEncoding method from 11.1 * @deprecated 4.0 Use JApplicationWebClient instead */ protected static function clientEncoding() { if (!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { return false; } $encoding = false; if (false !== strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { $encoding = 'gzip'; } if (false !== strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip')) { $encoding = 'x-gzip'; } return $encoding; } } PK���\֠b]R]R$libraries/legacy/controller/form.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Controller * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Controller tailored to suit most form-based admin operations. * * @since 12.2 * @todo Add ability to set redirect manually to better cope with frontend usage. */ class JControllerForm extends JControllerLegacy { /** * The context for storing internal data, e.g. record. * * @var string * @since 12.2 */ protected $context; /** * The URL option for the component. * * @var string * @since 12.2 */ protected $option; /** * The URL view item variable. * * @var string * @since 12.2 */ protected $view_item; /** * The URL view list variable. * * @var string * @since 12.2 */ protected $view_list; /** * The prefix to use with controller messages. * * @var string * @since 12.2 */ protected $text_prefix; /** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @see JControllerLegacy * @since 12.2 * @throws Exception */ public function __construct($config = array()) { parent::__construct($config); // Guess the option as com_NameOfController if (empty($this->option)) { $this->option = 'com_' . strtolower($this->getName()); } // Guess the JText message prefix. Defaults to the option. if (empty($this->text_prefix)) { $this->text_prefix = strtoupper($this->option); } // Guess the context as the suffix, eg: OptionControllerContent. if (empty($this->context)) { $r = null; if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500); } $this->context = strtolower($r[2]); } // Guess the item view as the context. if (empty($this->view_item)) { $this->view_item = $this->context; } // Guess the list view as the plural of the item view. if (empty($this->view_list)) { // @TODO Probably worth moving to an inflector class based on // http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/ // Simple pluralisation based on public domain snippet by Paul Osman // For more complex types, just manually set the variable in your class. $plural = array( array('/(x|ch|ss|sh)$/i', "$1es"), array('/([^aeiouy]|qu)y$/i', "$1ies"), array('/([^aeiouy]|qu)ies$/i', "$1y"), array('/(bu)s$/i', "$1ses"), array('/s$/i', "s"), array('/$/', "s")); // Check for matches using regular expressions foreach ($plural as $pattern) { if (preg_match($pattern[0], $this->view_item)) { $this->view_list = preg_replace($pattern[0], $pattern[1], $this->view_item); break; } } } // Apply, Save & New, and Save As copy should be standard on forms. $this->registerTask('apply', 'save'); $this->registerTask('save2new', 'save'); $this->registerTask('save2copy', 'save'); } /** * Method to add a new record. * * @return mixed True if the record can be added, a error object if not. * * @since 12.2 */ public function add() { $app = JFactory::getApplication(); $context = "$this->option.edit.$this->context"; // Access check. if (!$this->allowAdd()) { // Set the internal error and also the redirect error. $this->setError(JText::_('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false ) ); return false; } // Clear the record edit information from the session. $app->setUserState($context . '.data', null); // Redirect to the edit screen. $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend(), false ) ); return true; } /** * Method to check if you can add a new record. * * Extended classes can override this if necessary. * * @param array $data An array of input data. * * @return boolean * * @since 12.2 */ protected function allowAdd($data = array()) { $user = JFactory::getUser(); return ($user->authorise('core.create', $this->option) || count($user->getAuthorisedCategories($this->option, 'core.create'))); } /** * Method to check if you can edit an existing record. * * Extended classes can override this if necessary. * * @param array $data An array of input data. * @param string $key The name of the key for the primary key; default is id. * * @return boolean * * @since 12.2 */ protected function allowEdit($data = array(), $key = 'id') { return JFactory::getUser()->authorise('core.edit', $this->option); } /** * Method to check if you can save a new or existing record. * * Extended classes can override this if necessary. * * @param array $data An array of input data. * @param string $key The name of the key for the primary key. * * @return boolean * * @since 12.2 */ protected function allowSave($data, $key = 'id') { $recordId = isset($data[$key]) ? $data[$key] : '0'; if ($recordId) { return $this->allowEdit($data, $key); } else { return $this->allowAdd($data); } } /** * Method to run batch operations. * * @param JModelLegacy $model The model of the component being processed. * * @return boolean True if successful, false otherwise and internal error is set. * * @since 12.2 */ public function batch($model) { $vars = $this->input->post->get('batch', array(), 'array'); $cid = $this->input->post->get('cid', array(), 'array'); // Build an array of item contexts to check $contexts = array(); foreach ($cid as $id) { // If we're coming from com_categories, we need to use extension vs. option if (isset($this->extension)) { $option = $this->extension; } else { $option = $this->option; } $contexts[$id] = $option . '.' . $this->context . '.' . $id; } // Attempt to run the batch operation. if ($model->batch($vars, $cid, $contexts)) { $this->setMessage(JText::_('JLIB_APPLICATION_SUCCESS_BATCH')); return true; } else { $this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_FAILED', $model->getError()), 'warning'); return false; } } /** * Method to cancel an edit. * * @param string $key The name of the primary key of the URL variable. * * @return boolean True if access level checks pass, false otherwise. * * @since 12.2 */ public function cancel($key = null) { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel(); $table = $model->getTable(); $checkin = property_exists($table, 'checked_out'); $context = "$this->option.edit.$this->context"; if (empty($key)) { $key = $table->getKeyName(); } $recordId = $app->input->getInt($key); // Attempt to check-in the current record. if ($recordId) { if ($checkin) { if ($model->checkin($recordId) === false) { // Check-in failed, go back to the record and display a notice. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError())); $this->setMessage($this->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $key), false ) ); return false; } } } // Clean the session data and redirect. $this->releaseEditId($context, $recordId); $app->setUserState($context . '.data', null); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false ) ); return true; } /** * Method to edit an existing record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key * (sometimes required to avoid router collisions). * * @return boolean True if access level check and checkout passes, false otherwise. * * @since 12.2 */ public function edit($key = null, $urlVar = null) { $app = JFactory::getApplication(); $model = $this->getModel(); $table = $model->getTable(); $cid = $this->input->post->get('cid', array(), 'array'); $context = "$this->option.edit.$this->context"; // Determine the name of the primary key for the data. if (empty($key)) { $key = $table->getKeyName(); } // To avoid data collisions the urlVar may be different from the primary key. if (empty($urlVar)) { $urlVar = $key; } // Get the previous record id (if any) and the current record id. $recordId = (int) (count($cid) ? $cid[0] : $this->input->getInt($urlVar)); $checkin = property_exists($table, 'checked_out'); // Access check. if (!$this->allowEdit(array($key => $recordId), $key)) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false ) ); return false; } // Attempt to check-out the new record for editing and redirect. if ($checkin && !$model->checkout($recordId)) { // Check-out failed, display a notice but allow the user to see the record. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKOUT_FAILED', $model->getError())); $this->setMessage($this->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar), false ) ); return false; } else { // Check-out succeeded, push the new record id into the session. $this->holdEditId($context, $recordId); $app->setUserState($context . '.data', null); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar), false ) ); return true; } } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return object The model. * * @since 12.2 */ public function getModel($name = '', $prefix = '', $config = array('ignore_request' => true)) { if (empty($name)) { $name = $this->context; } return parent::getModel($name, $prefix, $config); } /** * Gets the URL arguments to append to an item redirect. * * @param integer $recordId The primary key id for the item. * @param string $urlVar The name of the URL variable for the id. * * @return string The arguments to append to the redirect URL. * * @since 12.2 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { $tmpl = $this->input->get('tmpl'); $layout = $this->input->get('layout', 'edit', 'string'); $append = ''; // Setup redirect info. if ($tmpl) { $append .= '&tmpl=' . $tmpl; } if ($layout) { $append .= '&layout=' . $layout; } if ($recordId) { $append .= '&' . $urlVar . '=' . $recordId; } return $append; } /** * Gets the URL arguments to append to a list redirect. * * @return string The arguments to append to the redirect URL. * * @since 12.2 */ protected function getRedirectToListAppend() { $tmpl = JFactory::getApplication()->input->get('tmpl'); $append = ''; // Setup redirect info. if ($tmpl) { $append .= '&tmpl=' . $tmpl; } return $append; } /** * Function that allows child controller access to model data * after the data has been saved. * * @param JModelLegacy $model The data model object. * @param array $validData The validated data. * * @return void * * @since 12.2 */ protected function postSaveHook(JModelLegacy $model, $validData = array()) { } /** * Method to load a row from version history * * @return mixed True if the record can be added, a error object if not. * * @since 3.2 */ public function loadhistory() { $app = JFactory::getApplication(); $lang = JFactory::getLanguage(); $model = $this->getModel(); $table = $model->getTable(); $historyId = $app->input->get('version_id', null, 'integer'); $context = "$this->option.edit.$this->context"; if (!$model->loadhistory($historyId, $table)) { $this->setMessage($model->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false ) ); return false; } // Determine the name of the primary key for the data. if (empty($key)) { $key = $table->getKeyName(); } $recordId = $table->$key; // To avoid data collisions the urlVar may be different from the primary key. $urlVar = empty($this->urlVar) ? $key : $this->urlVar; // Access check. if (!$this->allowEdit(array($key => $recordId), $key)) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false ) ); $table->checkin(); return false; } $table->store(); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar), false ) ); $this->setMessage(JText::sprintf('JLIB_APPLICATION_SUCCESS_LOAD_HISTORY', $model->getState('save_date'), $model->getState('version_note'))); // Invoke the postSave method to allow for the child class to access the model. $this->postSaveHook($model); return true; } /** * Method to save a record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). * * @return boolean True if successful, false otherwise. * * @since 12.2 */ public function save($key = null, $urlVar = null) { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $lang = JFactory::getLanguage(); $model = $this->getModel(); $table = $model->getTable(); $data = $this->input->post->get('jform', array(), 'array'); $checkin = property_exists($table, 'checked_out'); $context = "$this->option.edit.$this->context"; $task = $this->getTask(); // Determine the name of the primary key for the data. if (empty($key)) { $key = $table->getKeyName(); } // To avoid data collisions the urlVar may be different from the primary key. if (empty($urlVar)) { $urlVar = $key; } $recordId = $this->input->getInt($urlVar); // Populate the row id from the session. $data[$key] = $recordId; // The save2copy task needs to be handled slightly differently. if ($task == 'save2copy') { // Check-in the original row. if ($checkin && $model->checkin($data[$key]) === false) { // Check-in failed. Go back to the item and display a notice. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError())); $this->setMessage($this->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar), false ) ); return false; } // Reset the ID and then treat the request as for Apply. $data[$key] = 0; $task = 'apply'; } // Access check. if (!$this->allowSave($data, $key)) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED')); $this->setMessage($this->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false ) ); return false; } // Validate the posted data. // Sometimes the form needs some posted data, such as for plugins and modules. $form = $model->getForm($data, false); if (!$form) { $app->enqueueMessage($model->getError(), 'error'); return false; } // Test whether the data is valid. $validData = $model->validate($form, $data); // Check for validation errors. if ($validData === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if ($errors[$i] instanceof Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); } else { $app->enqueueMessage($errors[$i], 'warning'); } } // Save the data in the session. $app->setUserState($context . '.data', $data); // Redirect back to the edit screen. $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar), false ) ); return false; } if (!isset($validData['tags'])) { $validData['tags'] = null; } // Attempt to save the data. if (!$model->save($validData)) { // Save the data in the session. $app->setUserState($context . '.data', $validData); // Redirect back to the edit screen. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError())); $this->setMessage($this->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar), false ) ); return false; } // Save succeeded, so check-in the record. if ($checkin && $model->checkin($validData[$key]) === false) { // Save the data in the session. $app->setUserState($context . '.data', $validData); // Check-in failed, so go back to the record and display a notice. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError())); $this->setMessage($this->getError(), 'error'); $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar), false ) ); return false; } $this->setMessage( JText::_( ($lang->hasKey($this->text_prefix . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS') ? $this->text_prefix : 'JLIB_APPLICATION') . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS' ) ); // Redirect the user and adjust session state based on the chosen task. switch ($task) { case 'apply': // Set the record data in the session. $recordId = $model->getState($this->context . '.id'); $this->holdEditId($context, $recordId); $app->setUserState($context . '.data', null); $model->checkout($recordId); // Redirect back to the edit screen. $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId, $urlVar), false ) ); break; case 'save2new': // Clear the record id and data from the session. $this->releaseEditId($context, $recordId); $app->setUserState($context . '.data', null); // Redirect back to the edit screen. $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend(null, $urlVar), false ) ); break; default: // Clear the record id and data from the session. $this->releaseEditId($context, $recordId); $app->setUserState($context . '.data', null); // Redirect to the list screen. $this->setRedirect( JRoute::_( 'index.php?option=' . $this->option . '&view=' . $this->view_list . $this->getRedirectToListAppend(), false ) ); break; } // Invoke the postSave method to allow for the child class to access the model. $this->postSaveHook($model, $validData); return true; } } PK���\��%��$�$%libraries/legacy/controller/admin.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Controller * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Base class for a Joomla Administrator Controller * * Controller (controllers are where you put all the actual code) Provides basic * functionality, such as rendering views (aka displaying templates). * * @since 12.2 */ class JControllerAdmin extends JControllerLegacy { /** * The URL option for the component. * * @var string * @since 12.2 */ protected $option; /** * The prefix to use with controller messages. * * @var string * @since 12.2 */ protected $text_prefix; /** * The URL view list variable. * * @var string * @since 12.2 */ protected $view_list; /** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @see JControllerLegacy * @since 12.2 * @throws Exception */ public function __construct($config = array()) { parent::__construct($config); // Define standard task mappings. // Value = 0 $this->registerTask('unpublish', 'publish'); // Value = 2 $this->registerTask('archive', 'publish'); // Value = -2 $this->registerTask('trash', 'publish'); // Value = -3 $this->registerTask('report', 'publish'); $this->registerTask('orderup', 'reorder'); $this->registerTask('orderdown', 'reorder'); // Guess the option as com_NameOfController. if (empty($this->option)) { $this->option = 'com_' . strtolower($this->getName()); } // Guess the JText message prefix. Defaults to the option. if (empty($this->text_prefix)) { $this->text_prefix = strtoupper($this->option); } // Guess the list view as the suffix, eg: OptionControllerSuffix. if (empty($this->view_list)) { $r = null; if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500); } $this->view_list = strtolower($r[2]); } } /** * Removes an item. * * @return void * * @since 12.2 */ public function delete() { // Check for request forgeries JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); // Get items to remove from the request. $cid = JFactory::getApplication()->input->get('cid', array(), 'array'); if (!is_array($cid) || count($cid) < 1) { JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror'); } else { // Get the model. $model = $this->getModel(); // Make sure the item ids are integers jimport('joomla.utilities.arrayhelper'); JArrayHelper::toInteger($cid); // Remove the items. if ($model->delete($cid)) { $this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid))); } else { $this->setMessage($model->getError(), 'error'); } // Invoke the postDelete method to allow for the child class to access the model. $this->postDeleteHook($model, $cid); } $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); } /** * Function that allows child controller access to model data * after the item has been deleted. * * @param JModelLegacy $model The data model object. * @param integer $id The validated data. * * @return void * * @since 12.2 */ protected function postDeleteHook(JModelLegacy $model, $id = null) { } /** * Display is not supported by this controller. * * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JControllerLegacy A JControllerLegacy object to support chaining. * * @since 12.2 */ public function display($cachable = false, $urlparams = array()) { return $this; } /** * Method to publish a list of items * * @return void * * @since 12.2 */ public function publish() { // Check for request forgeries JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); // Get items to publish from the request. $cid = JFactory::getApplication()->input->get('cid', array(), 'array'); $data = array('publish' => 1, 'unpublish' => 0, 'archive' => 2, 'trash' => -2, 'report' => -3); $task = $this->getTask(); $value = JArrayHelper::getValue($data, $task, 0, 'int'); if (empty($cid)) { JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror'); } else { // Get the model. $model = $this->getModel(); // Make sure the item ids are integers JArrayHelper::toInteger($cid); // Publish the items. try { $model->publish($cid, $value); if ($value == 1) { $ntext = $this->text_prefix . '_N_ITEMS_PUBLISHED'; } elseif ($value == 0) { $ntext = $this->text_prefix . '_N_ITEMS_UNPUBLISHED'; } elseif ($value == 2) { $ntext = $this->text_prefix . '_N_ITEMS_ARCHIVED'; } else { $ntext = $this->text_prefix . '_N_ITEMS_TRASHED'; } $this->setMessage(JText::plural($ntext, count($cid))); } catch (Exception $e) { $this->setMessage($e->getMessage(), 'error'); } } $extension = $this->input->get('extension'); $extensionURL = ($extension) ? '&extension=' . $extension : ''; $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $extensionURL, false)); } /** * Changes the order of one or more records. * * @return boolean True on success * * @since 12.2 */ public function reorder() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $ids = JFactory::getApplication()->input->post->get('cid', array(), 'array'); $inc = ($this->getTask() == 'orderup') ? -1 : 1; $model = $this->getModel(); $return = $model->reorder($ids, $inc); if ($return === false) { // Reorder failed. $message = JText::sprintf('JLIB_APPLICATION_ERROR_REORDER_FAILED', $model->getError()); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message, 'error'); return false; } else { // Reorder succeeded. $message = JText::_('JLIB_APPLICATION_SUCCESS_ITEM_REORDERED'); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message); return true; } } /** * Method to save the submitted ordering values for records. * * @return boolean True on success * * @since 12.2 */ public function saveorder() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Get the input $pks = $this->input->post->get('cid', array(), 'array'); $order = $this->input->post->get('order', array(), 'array'); // Sanitize the input JArrayHelper::toInteger($pks); JArrayHelper::toInteger($order); // Get the model $model = $this->getModel(); // Save the ordering $return = $model->saveorder($pks, $order); if ($return === false) { // Reorder failed $message = JText::sprintf('JLIB_APPLICATION_ERROR_REORDER_FAILED', $model->getError()); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message, 'error'); return false; } else { // Reorder succeeded. $this->setMessage(JText::_('JLIB_APPLICATION_SUCCESS_ORDERING_SAVED')); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); return true; } } /** * Check in of one or more records. * * @return boolean True on success * * @since 12.2 */ public function checkin() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $ids = JFactory::getApplication()->input->post->get('cid', array(), 'array'); $model = $this->getModel(); $return = $model->checkin($ids); if ($return === false) { // Checkin failed. $message = JText::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message, 'error'); return false; } else { // Checkin succeeded. $message = JText::plural($this->text_prefix . '_N_ITEMS_CHECKED_IN', count($ids)); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false), $message); return true; } } /** * Method to save the submitted ordering values for records via AJAX. * * @return void * * @since 3.0 */ public function saveOrderAjax() { // Get the input $pks = $this->input->post->get('cid', array(), 'array'); $order = $this->input->post->get('order', array(), 'array'); // Sanitize the input JArrayHelper::toInteger($pks); JArrayHelper::toInteger($order); // Get the model $model = $this->getModel(); // Save the ordering $return = $model->saveorder($pks, $order); if ($return) { echo "1"; } // Close the application JFactory::getApplication()->close(); } } PK���\�헫 e e&libraries/legacy/controller/legacy.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Controller * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Base class for a Joomla Controller * * Controller (Controllers are where you put all the actual code.) Provides basic * functionality, such as rendering views (aka displaying templates). * * @since 12.2 */ class JControllerLegacy extends JObject { /** * The base path of the controller * * @var string * @since 12.2 * @note Replaces _basePath. */ protected $basePath; /** * The default view for the display method. * * @var string * @since 12.2 */ protected $default_view; /** * The mapped task that was performed. * * @var string * @since 12.2 * @note Replaces _doTask. */ protected $doTask; /** * Redirect message. * * @var string * @since 12.2 * @note Replaces _message. */ protected $message; /** * Redirect message type. * * @var string * @since 12.2 * @note Replaces _messageType. */ protected $messageType; /** * Array of class methods * * @var array * @since 12.2 * @note Replaces _methods. */ protected $methods; /** * The name of the controller * * @var array * @since 12.2 * @note Replaces _name. */ protected $name; /** * The prefix of the models * * @var string * @since 12.2 */ protected $model_prefix; /** * The set of search directories for resources (views). * * @var array * @since 12.2 * @note Replaces _path. */ protected $paths; /** * URL for redirection. * * @var string * @since 12.2 * @note Replaces _redirect. */ protected $redirect; /** * Current or most recently performed task. * * @var string * @since 12.2 * @note Replaces _task. */ protected $task; /** * Array of class methods to call for a given task. * * @var array * @since 12.2 * @note Replaces _taskMap. */ protected $taskMap; /** * Hold a JInput object for easier access to the input variables. * * @var JInput * @since 12.2 */ protected $input; /** * Instance container. * * @var JControllerLegacy * @since 12.2 */ protected static $instance; /** * Instance container containing the views. * * @var array * @since 3.4 */ protected static $views; /** * Adds to the stack of model paths in LIFO order. * * @param mixed $path The directory (string), or list of directories (array) to add. * @param string $prefix A prefix for models * * @return void */ public static function addModelPath($path, $prefix = '') { JModelLegacy::addIncludePath($path, $prefix); } /** * Create the filename for a resource. * * @param string $type The resource type to create the filename for. * @param array $parts An associative array of filename information. Optional. * * @return string The filename. * * @note Replaced _createFileName. * @since 12.2 */ protected static function createFileName($type, $parts = array()) { $filename = ''; switch ($type) { case 'controller': if (!empty($parts['format'])) { if ($parts['format'] == 'html') { $parts['format'] = ''; } else { $parts['format'] = '.' . $parts['format']; } } else { $parts['format'] = ''; } $filename = strtolower($parts['name'] . $parts['format'] . '.php'); break; case 'view': if (!empty($parts['type'])) { $parts['type'] = '.' . $parts['type']; } else { $parts['type'] = ''; } $filename = strtolower($parts['name'] . '/view' . $parts['type'] . '.php'); break; } return $filename; } /** * Method to get a singleton controller instance. * * @param string $prefix The prefix for the controller. * @param array $config An array of optional constructor options. * * @return JControllerLegacy * * @since 12.2 * @throws Exception if the controller cannot be loaded. */ public static function getInstance($prefix, $config = array()) { if (is_object(self::$instance)) { return self::$instance; } $input = JFactory::getApplication()->input; // Get the environment configuration. $basePath = array_key_exists('base_path', $config) ? $config['base_path'] : JPATH_COMPONENT; $format = $input->getWord('format'); $command = $input->get('task', 'display'); // Check for array format. $filter = JFilterInput::getInstance(); if (is_array($command)) { $command = $filter->clean(array_pop(array_keys($command)), 'cmd'); } else { $command = $filter->clean($command, 'cmd'); } // Check for a controller.task command. if (strpos($command, '.') !== false) { // Explode the controller.task command. list ($type, $task) = explode('.', $command); // Define the controller filename and path. $file = self::createFileName('controller', array('name' => $type, 'format' => $format)); $path = $basePath . '/controllers/' . $file; $backuppath = $basePath . '/controller/' . $file; // Reset the task without the controller context. $input->set('task', $task); } else { // Base controller. $type = null; // Define the controller filename and path. $file = self::createFileName('controller', array('name' => 'controller', 'format' => $format)); $path = $basePath . '/' . $file; $backupfile = self::createFileName('controller', array('name' => 'controller')); $backuppath = $basePath . '/' . $backupfile; } // Get the controller class name. $class = ucfirst($prefix) . 'Controller' . ucfirst($type); // Include the class if not present. if (!class_exists($class)) { // If the controller file path exists, include it. if (file_exists($path)) { require_once $path; } elseif (isset($backuppath) && file_exists($backuppath)) { require_once $backuppath; } else { throw new InvalidArgumentException(JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER', $type, $format)); } } // Instantiate the class. if (class_exists($class)) { self::$instance = new $class($config); } else { throw new InvalidArgumentException(JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER_CLASS', $class)); } return self::$instance; } /** * Constructor. * * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'default_task', 'model_path', and * 'view_path' (this list is not meant to be comprehensive). * * @since 12.2 */ public function __construct($config = array()) { $this->methods = array(); $this->message = null; $this->messageType = 'message'; $this->paths = array(); $this->redirect = null; $this->taskMap = array(); if (defined('JDEBUG') && JDEBUG) { JLog::addLogger(array('text_file' => 'jcontroller.log.php'), JLog::ALL, array('controller')); } $this->input = JFactory::getApplication()->input; // Determine the methods to exclude from the base class. $xMethods = get_class_methods('JControllerLegacy'); // Get the public methods in this class using reflection. $r = new ReflectionClass($this); $rMethods = $r->getMethods(ReflectionMethod::IS_PUBLIC); foreach ($rMethods as $rMethod) { $mName = $rMethod->getName(); // Add default display method if not explicitly declared. if (!in_array($mName, $xMethods) || $mName == 'display') { $this->methods[] = strtolower($mName); // Auto register the methods as tasks. $this->taskMap[strtolower($mName)] = $mName; } } // Set the view name if (empty($this->name)) { if (array_key_exists('name', $config)) { $this->name = $config['name']; } else { $this->name = $this->getName(); } } // Set a base path for use by the controller if (array_key_exists('base_path', $config)) { $this->basePath = $config['base_path']; } else { $this->basePath = JPATH_COMPONENT; } // If the default task is set, register it as such if (array_key_exists('default_task', $config)) { $this->registerDefaultTask($config['default_task']); } else { $this->registerDefaultTask('display'); } // Set the models prefix if (empty($this->model_prefix)) { if (array_key_exists('model_prefix', $config)) { // User-defined prefix $this->model_prefix = $config['model_prefix']; } else { $this->model_prefix = $this->name . 'Model'; } } // Set the default model search path if (array_key_exists('model_path', $config)) { // User-defined dirs $this->addModelPath($config['model_path'], $this->model_prefix); } else { $this->addModelPath($this->basePath . '/models', $this->model_prefix); } // Set the default view search path if (array_key_exists('view_path', $config)) { // User-defined dirs $this->setPath('view', $config['view_path']); } else { $this->setPath('view', $this->basePath . '/views'); } // Set the default view. if (array_key_exists('default_view', $config)) { $this->default_view = $config['default_view']; } elseif (empty($this->default_view)) { $this->default_view = $this->getName(); } } /** * Adds to the search path for templates and resources. * * @param string $type The path type (e.g. 'model', 'view'). * @param mixed $path The directory string or stream array to search. * * @return JControllerLegacy A JControllerLegacy object to support chaining. * * @since 12.2 * @note Replaces _addPath. */ protected function addPath($type, $path) { // Just force path to array settype($path, 'array'); if (!isset($this->paths[$type])) { $this->paths[$type] = array(); } // Loop through the path directories foreach ($path as $dir) { // No surrounding spaces allowed! $dir = rtrim(JPath::check($dir, '/'), '/') . '/'; // Add to the top of the search dirs array_unshift($this->paths[$type], $dir); } return $this; } /** * Add one or more view paths to the controller's stack, in LIFO order. * * @param mixed $path The directory (string) or list of directories (array) to add. * * @return JControllerLegacy This object to support chaining. */ public function addViewPath($path) { $this->addPath('view', $path); return $this; } /** * Authorisation check * * @param string $task The ACO Section Value to check access on. * * @return boolean True if authorised * * @since 12.2 * @deprecated 13.3 Use JAccess instead. */ public function authorise($task) { JLog::add(__METHOD__ . ' is deprecated. Use JAccess instead.', JLog::WARNING, 'deprecated'); return true; } /** * Method to check whether an ID is in the edit list. * * @param string $context The context for the session storage. * @param integer $id The ID of the record to add to the edit list. * * @return boolean True if the ID is in the edit list. * * @since 12.2 */ protected function checkEditId($context, $id) { if ($id) { $app = JFactory::getApplication(); $values = (array) $app->getUserState($context . '.id'); $result = in_array((int) $id, $values); if (defined('JDEBUG') && JDEBUG) { JLog::add( sprintf( 'Checking edit ID %s.%s: %d %s', $context, $id, (int) $result, str_replace("\n", ' ', print_r($values, 1)) ), JLog::INFO, 'controller' ); } return $result; } else { // No id for a new item. return true; } } /** * Method to load and return a model object. * * @param string $name The name of the model. * @param string $prefix Optional model prefix. * @param array $config Configuration array for the model. Optional. * * @return mixed Model object on success; otherwise null failure. * * @since 12.2 * @note Replaces _createModel. */ protected function createModel($name, $prefix = '', $config = array()) { // Clean the model name $modelName = preg_replace('/[^A-Z0-9_]/i', '', $name); $classPrefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix); $result = JModelLegacy::getInstance($modelName, $classPrefix, $config); return $result; } /** * Method to load and return a view object. This method first looks in the * current template directory for a match and, failing that, uses a default * set path to load the view class file. * * Note the "name, prefix, type" order of parameters, which differs from the * "name, type, prefix" order used in related public methods. * * @param string $name The name of the view. * @param string $prefix Optional prefix for the view class name. * @param string $type The type of view. * @param array $config Configuration array for the view. Optional. * * @return mixed View object on success; null or error result on failure. * * @since 12.2 * @note Replaces _createView. * @throws Exception */ protected function createView($name, $prefix = '', $type = '', $config = array()) { // Clean the view name $viewName = preg_replace('/[^A-Z0-9_]/i', '', $name); $classPrefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix); $viewType = preg_replace('/[^A-Z0-9_]/i', '', $type); // Build the view class name $viewClass = $classPrefix . $viewName; if (!class_exists($viewClass)) { jimport('joomla.filesystem.path'); $path = JPath::find($this->paths['view'], $this->createFileName('view', array('name' => $viewName, 'type' => $viewType))); if ($path) { require_once $path; if (!class_exists($viewClass)) { throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_VIEW_CLASS_NOT_FOUND', $viewClass, $path), 500); } } else { return null; } } return new $viewClass($config); } /** * Typical view method for MVC based architecture * * This function is provide as a default implementation, in most cases * you will need to override it in your own controllers. * * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JControllerLegacy A JControllerLegacy object to support chaining. * * @since 12.2 */ public function display($cachable = false, $urlparams = array()) { $document = JFactory::getDocument(); $viewType = $document->getType(); $viewName = $this->input->get('view', $this->default_view); $viewLayout = $this->input->get('layout', 'default', 'string'); $view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout)); // Get/Create the model if ($model = $this->getModel($viewName)) { // Push the model into the view (as default) $view->setModel($model, true); } $view->document = $document; $conf = JFactory::getConfig(); // Display the view if ($cachable && $viewType != 'feed' && $conf->get('caching') >= 1) { $option = $this->input->get('option'); $cache = JFactory::getCache($option, 'view'); if (is_array($urlparams)) { $app = JFactory::getApplication(); if (!empty($app->registeredurlparams)) { $registeredurlparams = $app->registeredurlparams; } else { $registeredurlparams = new stdClass; } foreach ($urlparams as $key => $value) { // Add your safe url parameters with variable type as value {@see JFilterInput::clean()}. $registeredurlparams->$key = $value; } $app->registeredurlparams = $registeredurlparams; } $cache->get($view, 'display'); } else { $view->display(); } return $this; } /** * Execute a task by triggering a method in the derived class. * * @param string $task The task to perform. If no matching task is found, the '__default' task is executed, if defined. * * @return mixed The value returned by the called method, false in error case. * * @since 12.2 * @throws Exception */ public function execute($task) { $this->task = $task; $task = strtolower($task); if (isset($this->taskMap[$task])) { $doTask = $this->taskMap[$task]; } elseif (isset($this->taskMap['__default'])) { $doTask = $this->taskMap['__default']; } else { throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_TASK_NOT_FOUND', $task), 404); } // Record the actual task being fired $this->doTask = $doTask; return $this->$doTask(); } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * * @return object The model. * * @since 12.2 */ public function getModel($name = '', $prefix = '', $config = array()) { if (empty($name)) { $name = $this->getName(); } if (empty($prefix)) { $prefix = $this->model_prefix; } if ($model = $this->createModel($name, $prefix, $config)) { // Task is a reserved state $model->setState('task', $this->task); // Let's get the application object and set menu information if it's available $app = JFactory::getApplication(); $menu = $app->getMenu(); if (is_object($menu)) { if ($item = $menu->getActive()) { $params = $menu->getParams($item->id); // Set default state data $model->setState('parameters.menu', $params); } } } return $model; } /** * Method to get the controller name * * The dispatcher name is set by default parsed using the classname, or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the dispatcher * * @since 12.2 * @throws Exception */ public function getName() { if (empty($this->name)) { $r = null; if (!preg_match('/(.*)Controller/i', get_class($this), $r)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500); } $this->name = strtolower($r[1]); } return $this->name; } /** * Get the last task that is being performed or was most recently performed. * * @return string The task that is being performed or was most recently performed. * * @since 12.2 */ public function getTask() { return $this->task; } /** * Gets the available tasks in the controller. * * @return array Array[i] of task names. * * @since 12.2 */ public function getTasks() { return $this->methods; } /** * Method to get a reference to the current view and load it if necessary. * * @param string $name The view name. Optional, defaults to the controller name. * @param string $type The view type. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for view. Optional. * * @return JViewLegacy Reference to the view or an error. * * @since 12.2 * @throws Exception */ public function getView($name = '', $type = '', $prefix = '', $config = array()) { // @note We use self so we only access stuff in this class rather than in all classes. if (!isset(self::$views)) { self::$views = array(); } if (empty($name)) { $name = $this->getName(); } if (empty($prefix)) { $prefix = $this->getName() . 'View'; } if (empty(self::$views[$name][$type][$prefix])) { if ($view = $this->createView($name, $prefix, $type, $config)) { self::$views[$name][$type][$prefix] = & $view; } else { $response = 500; $app = JFactory::getApplication(); /* * With URL rewriting enabled on the server, all client * requests for non-existent files are being forwarded to * Joomla. Return a 404 response here and assume the client * was requesting a non-existent file for which there is no * view type that matches the file's extension (the most * likely scenario). */ if ($app->get('sef_rewrite')) { $response = 404; } throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_VIEW_NOT_FOUND', $name, $type, $prefix), $response); } } return self::$views[$name][$type][$prefix]; } /** * Method to add a record ID to the edit list. * * @param string $context The context for the session storage. * @param integer $id The ID of the record to add to the edit list. * * @return void * * @since 12.2 */ protected function holdEditId($context, $id) { $app = JFactory::getApplication(); $values = (array) $app->getUserState($context . '.id'); // Add the id to the list if non-zero. if (!empty($id)) { array_push($values, (int) $id); $values = array_unique($values); $app->setUserState($context . '.id', $values); if (defined('JDEBUG') && JDEBUG) { JLog::add( sprintf( 'Holding edit ID %s.%s %s', $context, $id, str_replace("\n", ' ', print_r($values, 1)) ), JLog::INFO, 'controller' ); } } } /** * Redirects the browser or returns false if no redirect is set. * * @return boolean False if no redirect exists. * * @since 12.2 */ public function redirect() { if ($this->redirect) { $app = JFactory::getApplication(); // Enqueue the redirect message $app->enqueueMessage($this->message, $this->messageType); // Execute the redirect $app->redirect($this->redirect); } return false; } /** * Register the default task to perform if a mapping is not found. * * @param string $method The name of the method in the derived class to perform if a named task is not found. * * @return JControllerLegacy A JControllerLegacy object to support chaining. * * @since 12.2 */ public function registerDefaultTask($method) { $this->registerTask('__default', $method); return $this; } /** * Register (map) a task to a method in the class. * * @param string $task The task. * @param string $method The name of the method in the derived class to perform for this task. * * @return JControllerLegacy A JControllerLegacy object to support chaining. * * @since 12.2 */ public function registerTask($task, $method) { if (in_array(strtolower($method), $this->methods)) { $this->taskMap[strtolower($task)] = $method; } return $this; } /** * Unregister (unmap) a task in the class. * * @param string $task The task. * * @return JControllerLegacy This object to support chaining. * * @since 12.2 */ public function unregisterTask($task) { unset($this->taskMap[strtolower($task)]); return $this; } /** * Method to check whether an ID is in the edit list. * * @param string $context The context for the session storage. * @param integer $id The ID of the record to add to the edit list. * * @return void * * @since 12.2 */ protected function releaseEditId($context, $id) { $app = JFactory::getApplication(); $values = (array) $app->getUserState($context . '.id'); // Do a strict search of the edit list values. $index = array_search((int) $id, $values, true); if (is_int($index)) { unset($values[$index]); $app->setUserState($context . '.id', $values); if (defined('JDEBUG') && JDEBUG) { JLog::add( sprintf( 'Releasing edit ID %s.%s %s', $context, $id, str_replace("\n", ' ', print_r($values, 1)) ), JLog::INFO, 'controller' ); } } } /** * Sets the internal message that is passed with a redirect * * @param string $text Message to display on redirect. * @param string $type Message type. Optional, defaults to 'message'. * * @return string Previous message * * @since 12.2 */ public function setMessage($text, $type = 'message') { $previous = $this->message; $this->message = $text; $this->messageType = $type; return $previous; } /** * Sets an entire array of search paths for resources. * * @param string $type The type of path to set, typically 'view' or 'model'. * @param string $path The new set of search paths. If null or false, resets to the current directory only. * * @return void * * @note Replaces _setPath. * @since 12.2 */ protected function setPath($type, $path) { // Clear out the prior search dirs $this->paths[$type] = array(); // Actually add the user-specified directories $this->addPath($type, $path); } /** * Set a URL for browser redirection. * * @param string $url URL to redirect to. * @param string $msg Message to display on redirect. Optional, defaults to value set internally by controller, if any. * @param string $type Message type. Optional, defaults to 'message' or the type set by a previous call to setMessage. * * @return JControllerLegacy This object to support chaining. * * @since 12.2 */ public function setRedirect($url, $msg = null, $type = null) { $this->redirect = $url; if ($msg !== null) { // Controller may have set this directly $this->message = $msg; } // Ensure the type is not overwritten by a previous call to setMessage. if (empty($type)) { if (empty($this->messageType)) { $this->messageType = 'message'; } } // If the type is explicitly set, set it. else { $this->messageType = $type; } return $this; } } PK���\>?�x�O�O*libraries/legacy/categories/categories.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Categories * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * JCategories Class. * * @since 11.1 */ class JCategories { /** * Array to hold the object instances * * @var array * @since 11.1 */ public static $instances = array(); /** * Array of category nodes * * @var mixed * @since 11.1 */ protected $_nodes; /** * Array of checked categories -- used to save values when _nodes are null * * @var array * @since 11.1 */ protected $_checkedCategories; /** * Name of the extension the categories belong to * * @var string * @since 11.1 */ protected $_extension = null; /** * Name of the linked content table to get category content count * * @var string * @since 11.1 */ protected $_table = null; /** * Name of the category field * * @var string * @since 11.1 */ protected $_field = null; /** * Name of the key field * * @var string * @since 11.1 */ protected $_key = null; /** * Name of the items state field * * @var string * @since 11.1 */ protected $_statefield = null; /** * Array of options * * @var array * @since 11.1 */ protected $_options = null; /** * Class constructor * * @param array $options Array of options * * @since 11.1 */ public function __construct($options) { $this->_extension = $options['extension']; $this->_table = $options['table']; $this->_field = (isset($options['field']) && $options['field']) ? $options['field'] : 'catid'; $this->_key = (isset($options['key']) && $options['key']) ? $options['key'] : 'id'; $this->_statefield = (isset($options['statefield'])) ? $options['statefield'] : 'state'; $options['access'] = (isset($options['access'])) ? $options['access'] : 'true'; $options['published'] = (isset($options['published'])) ? $options['published'] : 1; $options['countItems'] = (isset($options['countItems'])) ? $options['countItems'] : 0; $options['currentlang'] = JLanguageMultilang::isEnabled() ? JFactory::getLanguage()->getTag() : 0; $this->_options = $options; return true; } /** * Returns a reference to a JCategories object * * @param string $extension Name of the categories extension * @param array $options An array of options * * @return JCategories JCategories object * * @since 11.1 */ public static function getInstance($extension, $options = array()) { $hash = md5($extension . serialize($options)); if (isset(self::$instances[$hash])) { return self::$instances[$hash]; } $parts = explode('.', $extension); $component = 'com_' . strtolower($parts[0]); $section = count($parts) > 1 ? $parts[1] : ''; $classname = ucfirst(substr($component, 4)) . ucfirst($section) . 'Categories'; if (!class_exists($classname)) { $path = JPATH_SITE . '/components/' . $component . '/helpers/category.php'; if (is_file($path)) { include_once $path; } else { return false; } } self::$instances[$hash] = new $classname($options); return self::$instances[$hash]; } /** * Loads a specific category and all its children in a JCategoryNode object * * @param mixed $id an optional id integer or equal to 'root' * @param boolean $forceload True to force the _load method to execute * * @return mixed JCategoryNode object or null if $id is not valid * * @since 11.1 */ public function get($id = 'root', $forceload = false) { if ($id !== 'root') { $id = (int) $id; if ($id == 0) { $id = 'root'; } } // If this $id has not been processed yet, execute the _load method if ((!isset($this->_nodes[$id]) && !isset($this->_checkedCategories[$id])) || $forceload) { $this->_load($id); } // If we already have a value in _nodes for this $id, then use it. if (isset($this->_nodes[$id])) { return $this->_nodes[$id]; } // If we processed this $id already and it was not valid, then return null. elseif (isset($this->_checkedCategories[$id])) { return null; } return false; } /** * Load method * * @param integer $id Id of category to load * * @return void * * @since 11.1 */ protected function _load($id) { $db = JFactory::getDbo(); $user = JFactory::getUser(); $extension = $this->_extension; // Record that has this $id has been checked $this->_checkedCategories[$id] = true; $query = $db->getQuery(true); // Right join with c for category $query->select('c.id, c.asset_id, c.access, c.alias, c.checked_out, c.checked_out_time, c.created_time, c.created_user_id, c.description, c.extension, c.hits, c.language, c.level, c.lft, c.metadata, c.metadesc, c.metakey, c.modified_time, c.note, c.params, c.parent_id, c.path, c.published, c.rgt, c.title, c.modified_user_id, c.version'); $case_when = ' CASE WHEN '; $case_when .= $query->charLength('c.alias', '!=', '0'); $case_when .= ' THEN '; $c_id = $query->castAsChar('c.id'); $case_when .= $query->concatenate(array($c_id, 'c.alias'), ':'); $case_when .= ' ELSE '; $case_when .= $c_id . ' END as slug'; $query->select($case_when) ->from('#__categories as c') ->where('(c.extension=' . $db->quote($extension) . ' OR c.extension=' . $db->quote('system') . ')'); if ($this->_options['access']) { $query->where('c.access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'); } if ($this->_options['published'] == 1) { $query->where('c.published = 1'); } $query->order('c.lft'); // Note: s for selected id if ($id != 'root') { // Get the selected category $query->join('LEFT', '#__categories AS s ON (s.lft <= c.lft AND s.rgt >= c.rgt) OR (s.lft > c.lft AND s.rgt < c.rgt)') ->where('s.id=' . (int) $id); } $subQuery = ' (SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent ' . 'ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = ' . $db->quote($extension) . ' AND parent.published != 1 GROUP BY cat.id) '; $query->join('LEFT', $subQuery . 'AS badcats ON badcats.id = c.id') ->where('badcats.id is null'); // Note: i for item if ($this->_options['countItems'] == 1) { $queryjoin = $db->quoteName($this->_table) . ' AS i ON i.' . $db->quoteName($this->_field) . ' = c.id'; if ($this->_options['published'] == 1) { $queryjoin .= ' AND i.' . $this->_statefield . ' = 1'; } if ($this->_options['currentlang'] !== 0) { $queryjoin .= ' AND (i.language = ' . $db->quote('*') . ' OR i.language = ' . $db->quote($this->_options['currentlang']) . ')'; } $query->join('LEFT', $queryjoin); $query->select('COUNT(i.' . $db->quoteName($this->_key) . ') AS numitems'); } // Group by $query->group( 'c.id, c.asset_id, c.access, c.alias, c.checked_out, c.checked_out_time, c.created_time, c.created_user_id, c.description, c.extension, c.hits, c.language, c.level, c.lft, c.metadata, c.metadesc, c.metakey, c.modified_time, c.note, c.params, c.parent_id, c.path, c.published, c.rgt, c.title, c.modified_user_id, c.version' ); // Get the results $db->setQuery($query); $results = $db->loadObjectList('id'); $childrenLoaded = false; if (count($results)) { // Foreach categories foreach ($results as $result) { // Deal with root category if ($result->id == 1) { $result->id = 'root'; } // Deal with parent_id if ($result->parent_id == 1) { $result->parent_id = 'root'; } // Create the node if (!isset($this->_nodes[$result->id])) { // Create the JCategoryNode and add to _nodes $this->_nodes[$result->id] = new JCategoryNode($result, $this); // If this is not root and if the current node's parent is in the list or the current node parent is 0 if ($result->id != 'root' && (isset($this->_nodes[$result->parent_id]) || $result->parent_id == 1)) { // Compute relationship between node and its parent - set the parent in the _nodes field $this->_nodes[$result->id]->setParent($this->_nodes[$result->parent_id]); } // If the node's parent id is not in the _nodes list and the node is not root (doesn't have parent_id == 0), // then remove the node from the list if (!(isset($this->_nodes[$result->parent_id]) || $result->parent_id == 0)) { unset($this->_nodes[$result->id]); continue; } if ($result->id == $id || $childrenLoaded) { $this->_nodes[$result->id]->setAllLoaded(); $childrenLoaded = true; } } elseif ($result->id == $id || $childrenLoaded) { // Create the JCategoryNode $this->_nodes[$result->id] = new JCategoryNode($result, $this); if ($result->id != 'root' && (isset($this->_nodes[$result->parent_id]) || $result->parent_id)) { // Compute relationship between node and its parent $this->_nodes[$result->id]->setParent($this->_nodes[$result->parent_id]); } // If the node's parent id is not in the _nodes list and the node is not root (doesn't have parent_id == 0), // then remove the node from the list if (!(isset($this->_nodes[$result->parent_id]) || $result->parent_id == 0)) { unset($this->_nodes[$result->id]); continue; } if ($result->id == $id || $childrenLoaded) { $this->_nodes[$result->id]->setAllLoaded(); $childrenLoaded = true; } } } } else { $this->_nodes[$id] = null; } } } /** * Helper class to load Categorytree * * @since 11.1 */ class JCategoryNode extends JObject { /** * Primary key * * @var integer * @since 11.1 */ public $id = null; /** * The id of the category in the asset table * * @var integer * @since 11.1 */ public $asset_id = null; /** * The id of the parent of category in the asset table, 0 for category root * * @var integer * @since 11.1 */ public $parent_id = null; /** * The lft value for this category in the category tree * * @var integer * @since 11.1 */ public $lft = null; /** * The rgt value for this category in the category tree * * @var integer * @since 11.1 */ public $rgt = null; /** * The depth of this category's position in the category tree * * @var integer * @since 11.1 */ public $level = null; /** * The extension this category is associated with * * @var integer * @since 11.1 */ public $extension = null; /** * The menu title for the category (a short name) * * @var string * @since 11.1 */ public $title = null; /** * The the alias for the category * * @var string * @since 11.1 */ public $alias = null; /** * Description of the category. * * @var string * @since 11.1 */ public $description = null; /** * The publication status of the category * * @var boolean * @since 11.1 */ public $published = null; /** * Whether the category is or is not checked out * * @var boolean * @since 11.1 */ public $checked_out = 0; /** * The time at which the category was checked out * * @var string * @since 11.1 */ public $checked_out_time = 0; /** * Access level for the category * * @var integer * @since 11.1 */ public $access = null; /** * JSON string of parameters * * @var string * @since 11.1 */ public $params = null; /** * Metadata description * * @var string * @since 11.1 */ public $metadesc = null; /** * Key words for meta data * * @var string * @since 11.1 */ public $metakey = null; /** * JSON string of other meta data * * @var string * @since 11.1 */ public $metadata = null; /** * The ID of the user who created the category * * @var integer * @since 11.1 */ public $created_user_id = null; /** * The time at which the category was created * * @var string * @since 11.1 */ public $created_time = null; /** * The ID of the user who last modified the category * * @var integer * @since 11.1 */ public $modified_user_id = null; /** * The time at which the category was modified * * @var string * @since 11.1 */ public $modified_time = null; /** * Nmber of times the category has been viewed * * @var integer * @since 11.1 */ public $hits = null; /** * The language for the category in xx-XX format * * @var string * @since 11.1 */ public $language = null; /** * Number of items in this category or descendants of this category * * @var integer * @since 11.1 */ public $numitems = null; /** * Number of children items * * @var integer * @since 11.1 */ public $childrennumitems = null; /** * Slug fo the category (used in URL) * * @var string * @since 11.1 */ public $slug = null; /** * Array of assets * * @var array * @since 11.1 */ public $assets = null; /** * Parent Category object * * @var object * @since 11.1 */ protected $_parent = null; /** * @var Array of Children * @since 11.1 */ protected $_children = array(); /** * Path from root to this category * * @var array * @since 11.1 */ protected $_path = array(); /** * Category left of this one * * @var integer * @since 11.1 */ protected $_leftSibling = null; /** * Category right of this one * * @var * @since 11.1 */ protected $_rightSibling = null; /** * true if all children have been loaded * * @var boolean * @since 11.1 */ protected $_allChildrenloaded = false; /** * Constructor of this tree * * @var * @since 11.1 */ protected $_constructor = null; /** * Class constructor * * @param array $category The category data. * @param JCategoryNode $constructor The tree constructor. * * @since 11.1 */ public function __construct($category = null, $constructor = null) { if ($category) { $this->setProperties($category); if ($constructor) { $this->_constructor = $constructor; } return true; } return false; } /** * Set the parent of this category * * If the category already has a parent, the link is unset * * @param mixed $parent JCategoryNode for the parent to be set or null * * @return void * * @since 11.1 */ public function setParent($parent) { if ($parent instanceof JCategoryNode || is_null($parent)) { if (!is_null($this->_parent)) { $key = array_search($this, $this->_parent->_children); unset($this->_parent->_children[$key]); } if (!is_null($parent)) { $parent->_children[] = & $this; } $this->_parent = $parent; if ($this->id != 'root') { if ($this->parent_id != 1) { $this->_path = $parent->getPath(); } $this->_path[] = $this->id . ':' . $this->alias; } if (count($parent->_children) > 1) { end($parent->_children); $this->_leftSibling = prev($parent->_children); $this->_leftSibling->_rightsibling = & $this; } } } /** * Add child to this node * * If the child already has a parent, the link is unset * * @param JCategoryNode $child The child to be added. * * @return void * * @since 11.1 */ public function addChild($child) { if ($child instanceof JCategoryNode) { $child->setParent($this); } } /** * Remove a specific child * * @param integer $id ID of a category * * @return void * * @since 11.1 */ public function removeChild($id) { $key = array_search($this, $this->_parent->_children); unset($this->_parent->_children[$key]); } /** * Get the children of this node * * @param boolean $recursive False by default * * @return array The children * * @since 11.1 */ public function &getChildren($recursive = false) { if (!$this->_allChildrenloaded) { $temp = $this->_constructor->get($this->id, true); if ($temp) { $this->_children = $temp->getChildren(); $this->_leftSibling = $temp->getSibling(false); $this->_rightSibling = $temp->getSibling(true); $this->setAllLoaded(); } } if ($recursive) { $items = array(); foreach ($this->_children as $child) { $items[] = $child; $items = array_merge($items, $child->getChildren(true)); } return $items; } return $this->_children; } /** * Get the parent of this node * * @return mixed JCategoryNode or null * * @since 11.1 */ public function getParent() { return $this->_parent; } /** * Test if this node has children * * @return boolean True if there is a child * * @since 11.1 */ public function hasChildren() { return count($this->_children); } /** * Test if this node has a parent * * @return boolean True if there is a parent * * @since 11.1 */ public function hasParent() { return $this->getParent() != null; } /** * Function to set the left or right sibling of a category * * @param JCategoryNode $sibling JCategoryNode object for the sibling * @param boolean $right If set to false, the sibling is the left one * * @return void * * @since 11.1 */ public function setSibling($sibling, $right = true) { if ($right) { $this->_rightSibling = $sibling; } else { $this->_leftSibling = $sibling; } } /** * Returns the right or left sibling of a category * * @param boolean $right If set to false, returns the left sibling * * @return mixed JCategoryNode object with the sibling information or * NULL if there is no sibling on that side. * * @since 11.1 */ public function getSibling($right = true) { if (!$this->_allChildrenloaded) { $temp = $this->_constructor->get($this->id, true); $this->_children = $temp->getChildren(); $this->_leftSibling = $temp->getSibling(false); $this->_rightSibling = $temp->getSibling(true); $this->setAllLoaded(); } if ($right) { return $this->_rightSibling; } else { return $this->_leftSibling; } } /** * Returns the category parameters * * @return Registry * * @since 11.1 */ public function getParams() { if (!($this->params instanceof Registry)) { $temp = new Registry; $temp->loadString($this->params); $this->params = $temp; } return $this->params; } /** * Returns the category metadata * * @return Registry A Registry object containing the metadata * * @since 11.1 */ public function getMetadata() { if (!($this->metadata instanceof Registry)) { $temp = new Registry; $temp->loadString($this->metadata); $this->metadata = $temp; } return $this->metadata; } /** * Returns the category path to the root category * * @return array * * @since 11.1 */ public function getPath() { return $this->_path; } /** * Returns the user that created the category * * @param boolean $modified_user Returns the modified_user when set to true * * @return JUser A JUser object containing a userid * * @since 11.1 */ public function getAuthor($modified_user = false) { if ($modified_user) { return JFactory::getUser($this->modified_user_id); } return JFactory::getUser($this->created_user_id); } /** * Set to load all children * * @return void * * @since 11.1 */ public function setAllLoaded() { $this->_allChildrenloaded = true; foreach ($this->_children as $child) { $child->setAllLoaded(); } } /** * Returns the number of items. * * @param boolean $recursive If false number of children, if true number of descendants * * @return integer Number of children or descendants * * @since 11.1 */ public function getNumItems($recursive = false) { if ($recursive) { $count = $this->numitems; foreach ($this->getChildren() as $child) { $count = $count + $child->getNumItems(true); } return $count; } return $this->numitems; } } PK���\ �cXX)libraries/legacy/utilities/xmlelement.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Utilities * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLog::add('JXMLElement is deprecated. Use SimpleXMLElement.', JLog::WARNING, 'deprecated'); /** * Wrapper class for php SimpleXMLElement. * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) - Use SimpleXMLElement instead. */ class JXMLElement extends SimpleXMLElement { /** * Get the name of the element. * * @return string * * @since 11.1 * @deprecated 13.3 Use SimpleXMLElement::getName() instead. */ public function name() { JLog::add('JXMLElement::name() is deprecated, use SimpleXMLElement::getName() instead.', JLog::WARNING, 'deprecated'); return (string) $this->getName(); } /** * Return a well-formed XML string based on SimpleXML element * * @param boolean $compressed Should we use indentation and newlines ? * @param string $indent Indention character. * @param integer $level The level within the document which informs the indentation. * * @return string * * @since 11.1 * @deprecated 13.3 Use SimpleXMLElement::asXml() instead. */ public function asFormattedXml($compressed = false, $indent = "\t", $level = 0) { JLog::add('JXMLElement::asFormattedXml() is deprecated, use SimpleXMLElement::asXml() instead.', JLog::WARNING, 'deprecated'); $out = ''; // Start a new line, indent by the number indicated in $level $out .= ($compressed) ? '' : "\n" . str_repeat($indent, $level); // Add a <, and add the name of the tag $out .= '<' . $this->getName(); // For each attribute, add attr="value" foreach ($this->attributes() as $attr) { $out .= ' ' . $attr->getName() . '="' . htmlspecialchars((string) $attr, ENT_COMPAT, 'UTF-8') . '"'; } // If there are no children and it contains no data, end it off with a /> if (!count($this->children()) && !(string) $this) { $out .= " />"; } else { // If there are children if (count($this->children())) { // Close off the start tag $out .= '>'; $level++; // For each child, call the asFormattedXML function (this will ensure that all children are added recursively) foreach ($this->children() as $child) { $out .= $child->asFormattedXml($compressed, $indent, $level); } $level--; // Add the newline and indentation to go along with the close tag $out .= ($compressed) ? '' : "\n" . str_repeat($indent, $level); } elseif ((string) $this) { // If there is data, close off the start tag and add the data $out .= '>' . htmlspecialchars((string) $this, ENT_COMPAT, 'UTF-8'); } // Add the end tag $out .= '</' . $this->getName() . '>'; } return $out; } } PK���\w�����*libraries/legacy/dispatcher/dispatcher.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Dispatcher * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Deprecated class placeholder. You should use JEventDispatcher instead. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) * @codeCoverageIgnore */ class JDispatcher extends JEventDispatcher { /** * Constructor. * * @since 11.1 */ public function __construct() { JLog::add('JDispatcher is deprecated. Use JEventDispatcher instead.', JLog::WARNING, 'deprecated'); parent::__construct(); } } PK���\��]P"libraries/legacy/view/category.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage View * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Base HTML View class for the a Category list * * @since 3.2 */ class JViewCategory extends JViewLegacy { /** * State data * * @var \Joomla\Registry\Registry * @since 3.2 */ protected $state; /** * Category items data * * @var array * @since 3.2 */ protected $items; /** * The category model object for this category * * @var JModelCategory * @since 3.2 */ protected $category; /** * The list of other categories for this extension. * * @var array * @since 3.2 */ protected $categories; /** * Pagination object * * @var JPagination * @since 3.2 */ protected $pagination; /** * Child objects * * @var array * @since 3.2 */ protected $children; /** * The name of the extension for the category * * @var string * @since 3.2 */ protected $extension; /** * The name of the view to link individual items to * * @var string * @since 3.2 */ protected $viewName; /** * Default title to use for page title * * @var string * @since 3.2 */ protected $defaultPageTitle; /** * Method with common display elements used in category list displays * * @return void * * @since 3.2 */ public function commonCategoryDisplay() { $app = JFactory::getApplication(); $user = JFactory::getUser(); $params = $app->getParams(); // Get some data from the models $state = $this->get('State'); $items = $this->get('Items'); $category = $this->get('Category'); $children = $this->get('Children'); $parent = $this->get('Parent'); $pagination = $this->get('Pagination'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } if ($category == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } if ($parent == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } // Check whether category access level allows access. $groups = $user->getAuthorisedViewLevels(); if (!in_array($category->access, $groups)) { return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); } // Setup the category parameters. $cparams = $category->getParams(); $category->params = clone $params; $category->params->merge($cparams); $children = array($category->id => $children); // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $maxLevel = $params->get('maxLevel', -1); $this->maxLevel = &$maxLevel; $this->state = &$state; $this->items = &$items; $this->category = &$category; $this->children = &$children; $this->params = &$params; $this->parent = &$parent; $this->pagination = &$pagination; $this->user = &$user; // Check for layout override only if this is not the active menu item // If it is the active menu item, then the view and category id will match $active = $app->getMenu()->getActive(); if ((!$active) || ((strpos($active->link, 'view=category') === false) || (strpos($active->link, '&id=' . (string) $this->category->id) === false))) { if ($layout = $category->params->get('category_layout')) { $this->setLayout($layout); } } elseif (isset($active->query['layout'])) { // We need to set the layout in case this is an alternative menu item (with an alternative layout) $this->setLayout($active->query['layout']); } $this->category->tags = new JHelperTags; $this->category->tags->getItemTags($this->extension . '.category', $this->category->id); } /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. * * @since 3.2 */ public function display($tpl = null) { $this->prepareDocument(); return parent::display($tpl); } /** * Method to prepares the document * * @return void * * @since 3.2 */ protected function prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $this->pathway = $app->getPathway(); $title = null; // Because the application sets a default page title, we need to get it from the menu item itself $this->menu = $menus->getActive(); if ($this->menu) { $this->params->def('page_heading', $this->params->get('page_title', $this->menu->title)); } else { $this->params->def('page_heading', JText::_($this->defaultPageTitle)); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->get('sitename'); } elseif ($app->get('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } /** * Method to add an alternative feed link to a category layout. * * @return void * * @since 3.2 */ protected function addFeed() { if ($this->params->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); } } } PK���\lN ��&libraries/legacy/view/categoryfeed.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage View * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Base feed View class for a category * * @since 3.2 */ class JViewCategoryfeed extends JViewLegacy { /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. * * @since 3.2 */ public function display($tpl = null) { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $extension = $app->input->getString('option'); $contentType = $extension . '.' . $this->viewName; $ucmType = new JUcmType; $ucmRow = $ucmType->getTypeByAlias($contentType); $ucmMapCommon = json_decode($ucmRow->field_mappings)->common; $createdField = null; $titleField = null; if (is_object($ucmMapCommon)) { $createdField = $ucmMapCommon->core_created_time; $titleField = $ucmMapCommon->core_title; } elseif (is_array($ucmMapCommon)) { $createdField = $ucmMapCommon[0]->core_created_time; $titleField = $ucmMapCommon[0]->core_title; } $document->link = JRoute::_(JHelperRoute::getCategoryRoute($app->input->getInt('id'), $language = 0, $extension)); $app->input->set('limit', $app->get('feed_limit')); $siteEmail = $app->get('mailfrom'); $fromName = $app->get('fromname'); $feedEmail = $app->get('feed_email', 'author'); $document->editor = $fromName; if ($feedEmail != 'none') { $document->editorEmail = $siteEmail; } // Get some data from the model $items = $this->get('Items'); $category = $this->get('Category'); foreach ($items as $item) { $this->reconcileNames($item); // Strip html from feed item title if ($titleField) { $title = $this->escape($item->$titleField); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); } else { $title = ''; } // URL link to article $router = new JHelperRoute; $link = JRoute::_($router->getRoute($item->id, $contentType, null, null, $item->catid)); // Strip HTML from feed item description text. $description = $item->description; $author = $item->created_by_alias ? $item->created_by_alias : $item->author; if ($createdField) { $date = isset($item->$createdField) ? date('r', strtotime($item->$createdField)) : ''; } else { $date = ''; } // Load individual item creator class. $feeditem = new JFeedItem; $feeditem->title = $title; $feeditem->link = $link; $feeditem->description = $description; $feeditem->date = $date; $feeditem->category = $category->title; $feeditem->author = $author; // We don't have the author email so we have to use site in both cases. if ($feedEmail == 'site') { $feeditem->authorEmail = $siteEmail; } elseif ($feedEmail === 'author') { $feeditem->authorEmail = $item->author_email; } // Loads item information into RSS array $document->addItem($feeditem); } } /** * Method to reconcile non standard names from components to usage in this class. * Typically overriden in the component feed view class. * * @param object $item The item for a feed, an element of the $items array. * * @return void * * @since 3.2 */ protected function reconcileNames($item) { if (!property_exists($item, 'title') && property_exists($item, 'name')) { $item->title = $item->name; } } } PK���\˝ϊJ�J libraries/legacy/view/legacy.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage View * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Base class for a Joomla View * * Class holding methods for displaying presentation data. * * @since 12.2 */ class JViewLegacy extends JObject { /** * The name of the view * * @var array */ protected $_name = null; /** * Registered models * * @var array */ protected $_models = array(); /** * The base path of the view * * @var string */ protected $_basePath = null; /** * The default model * * @var string */ protected $_defaultModel = null; /** * Layout name * * @var string */ protected $_layout = 'default'; /** * Layout extension * * @var string */ protected $_layoutExt = 'php'; /** * Layout template * * @var string */ protected $_layoutTemplate = '_'; /** * The set of search directories for resources (templates) * * @var array */ protected $_path = array('template' => array(), 'helper' => array()); /** * The name of the default template source file. * * @var string */ protected $_template = null; /** * The output of the template script. * * @var string */ protected $_output = null; /** * Callback for escaping. * * @var string * @deprecated 13.3 */ protected $_escape = 'htmlspecialchars'; /** * Charset to use in escaping mechanisms; defaults to urf8 (UTF-8) * * @var string */ protected $_charset = 'UTF-8'; /** * Constructor * * @param array $config A named configuration array for object construction.<br /> * name: the name (optional) of the view (defaults to the view class name suffix).<br /> * charset: the character set to use for display<br /> * escape: the name (optional) of the function to use for escaping strings<br /> * base_path: the parent path (optional) of the views directory (defaults to the component folder)<br /> * template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name<br /> * helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)<br /> * layout: the layout (optional) to use to display the view<br /> * * @since 12.2 */ public function __construct($config = array()) { // Set the view name if (empty($this->_name)) { if (array_key_exists('name', $config)) { $this->_name = $config['name']; } else { $this->_name = $this->getName(); } } // Set the charset (used by the variable escaping functions) if (array_key_exists('charset', $config)) { JLog::add('Setting a custom charset for escaping is deprecated. Override JViewLegacy::escape() instead.', JLog::WARNING, 'deprecated'); $this->_charset = $config['charset']; } // User-defined escaping callback if (array_key_exists('escape', $config)) { $this->setEscape($config['escape']); } // Set a base path for use by the view if (array_key_exists('base_path', $config)) { $this->_basePath = $config['base_path']; } else { $this->_basePath = JPATH_COMPONENT; } // Set the default template search path if (array_key_exists('template_path', $config)) { // User-defined dirs $this->_setPath('template', $config['template_path']); } elseif (is_dir(JPATH_COMPONENT . '/view')) { $this->_setPath('template', $this->_basePath . '/view/' . $this->getName() . '/tmpl'); } else { $this->_setPath('template', $this->_basePath . '/views/' . $this->getName() . '/tmpl'); } // Set the default helper search path if (array_key_exists('helper_path', $config)) { // User-defined dirs $this->_setPath('helper', $config['helper_path']); } else { $this->_setPath('helper', $this->_basePath . '/helpers'); } // Set the layout if (array_key_exists('layout', $config)) { $this->setLayout($config['layout']); } else { $this->setLayout('default'); } $this->baseurl = JUri::base(true); } /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. * * @see JViewLegacy::loadTemplate() * @since 12.2 */ public function display($tpl = null) { $result = $this->loadTemplate($tpl); if ($result instanceof Exception) { return $result; } echo $result; } /** * Assigns variables to the view script via differing strategies. * * This method is overloaded; you can assign all the properties of * an object, an associative array, or a single value by name. * * You are not allowed to set variables that begin with an underscore; * these are either private properties for JView or private variables * within the template script itself. * * <code> * $view = new JView; * * // Assign directly * $view->var1 = 'something'; * $view->var2 = 'else'; * * // Assign by name and value * $view->assign('var1', 'something'); * $view->assign('var2', 'else'); * * // Assign by assoc-array * $ary = array('var1' => 'something', 'var2' => 'else'); * $view->assign($obj); * * // Assign by object * $obj = new stdClass; * $obj->var1 = 'something'; * $obj->var2 = 'else'; * $view->assign($obj); * * </code> * * @return boolean True on success, false on failure. * * @deprecated 13.3 Use native PHP syntax. */ public function assign() { JLog::add(__METHOD__ . ' is deprecated. Use native PHP syntax.', JLog::WARNING, 'deprecated'); // Get the arguments; there may be 1 or 2. $arg0 = @func_get_arg(0); $arg1 = @func_get_arg(1); // Assign by object if (is_object($arg0)) { // Assign public properties foreach (get_object_vars($arg0) as $key => $val) { if (substr($key, 0, 1) != '_') { $this->$key = $val; } } return true; } // Assign by associative array if (is_array($arg0)) { foreach ($arg0 as $key => $val) { if (substr($key, 0, 1) != '_') { $this->$key = $val; } } return true; } // Assign by string name and mixed value. // We use array_key_exists() instead of isset() because isset() // fails if the value is set to null. if (is_string($arg0) && substr($arg0, 0, 1) != '_' && func_num_args() > 1) { $this->$arg0 = $arg1; return true; } // $arg0 was not object, array, or string. return false; } /** * Assign variable for the view (by reference). * * You are not allowed to set variables that begin with an underscore; * these are either private properties for JView or private variables * within the template script itself. * * <code> * $view = new JView; * * // Assign by name and value * $view->assignRef('var1', $ref); * * // Assign directly * $view->ref = &$var1; * </code> * * @param string $key The name for the reference in the view. * @param mixed &$val The referenced variable. * * @return boolean True on success, false on failure. * * @since 12.2 * @deprecated 13.3 Use native PHP syntax. */ public function assignRef($key, &$val) { JLog::add(__METHOD__ . ' is deprecated. Use native PHP syntax.', JLog::WARNING, 'deprecated'); if (is_string($key) && substr($key, 0, 1) != '_') { $this->$key = &$val; return true; } return false; } /** * Escapes a value for output in a view script. * * If escaping mechanism is either htmlspecialchars or htmlentities, uses * {@link $_encoding} setting. * * @param mixed $var The output to escape. * * @return mixed The escaped value. * * @since 12.2 */ public function escape($var) { if (in_array($this->_escape, array('htmlspecialchars', 'htmlentities'))) { return call_user_func($this->_escape, $var, ENT_COMPAT, $this->_charset); } return call_user_func($this->_escape, $var); } /** * Method to get data from a registered model or a property of the view * * @param string $property The name of the method to call on the model or the property to get * @param string $default The name of the model to reference or the default value [optional] * * @return mixed The return value of the method * * @since 12.2 */ public function get($property, $default = null) { // If $model is null we use the default model if (is_null($default)) { $model = $this->_defaultModel; } else { $model = strtolower($default); } // First check to make sure the model requested exists if (isset($this->_models[$model])) { // Model exists, let's build the method name $method = 'get' . ucfirst($property); // Does the method exist? if (method_exists($this->_models[$model], $method)) { // The method exists, let's call it and return what we get $result = $this->_models[$model]->$method(); return $result; } } // Degrade to JObject::get $result = parent::get($property, $default); return $result; } /** * Method to get the model object * * @param string $name The name of the model (optional) * * @return mixed JModelLegacy object * * @since 12.2 */ public function getModel($name = null) { if ($name === null) { $name = $this->_defaultModel; } return $this->_models[strtolower($name)]; } /** * Get the layout. * * @return string The layout name */ public function getLayout() { return $this->_layout; } /** * Get the layout template. * * @return string The layout template name */ public function getLayoutTemplate() { return $this->_layoutTemplate; } /** * Method to get the view name * * The model name by default parsed using the classname, or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the model * * @since 12.2 * @throws Exception */ public function getName() { if (empty($this->_name)) { $classname = get_class($this); $viewpos = strpos($classname, 'View'); if ($viewpos === false) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'), 500); } $this->_name = strtolower(substr($classname, $viewpos + 4)); } return $this->_name; } /** * Method to add a model to the view. We support a multiple model single * view system by which models are referenced by classname. A caveat to the * classname referencing is that any classname prepended by JModel will be * referenced by the name without JModel, eg. JModelCategory is just * Category. * * @param JModelLegacy $model The model to add to the view. * @param boolean $default Is this the default model? * * @return object The added model. * * @since 12.2 */ public function setModel($model, $default = false) { $name = strtolower($model->getName()); $this->_models[$name] = $model; if ($default) { $this->_defaultModel = $name; } return $model; } /** * Sets the layout name to use * * @param string $layout The layout name or a string in format <template>:<layout file> * * @return string Previous value. * * @since 12.2 */ public function setLayout($layout) { $previous = $this->_layout; if (strpos($layout, ':') === false) { $this->_layout = $layout; } else { // Convert parameter to array based on : $temp = explode(':', $layout); $this->_layout = $temp[1]; // Set layout template $this->_layoutTemplate = $temp[0]; } return $previous; } /** * Allows a different extension for the layout files to be used * * @param string $value The extension. * * @return string Previous value * * @since 12.2 */ public function setLayoutExt($value) { $previous = $this->_layoutExt; if ($value = preg_replace('#[^A-Za-z0-9]#', '', trim($value))) { $this->_layoutExt = $value; } return $previous; } /** * Sets the _escape() callback. * * @param mixed $spec The callback for _escape() to use. * * @return void * * @since 12.2 * @deprecated 13.3 Override JViewLegacy::escape() instead. */ public function setEscape($spec) { JLog::add(__METHOD__ . ' is deprecated. Override JViewLegacy::escape() instead.', JLog::WARNING, 'deprecated'); $this->_escape = $spec; } /** * Adds to the stack of view script paths in LIFO order. * * @param mixed $path A directory path or an array of paths. * * @return void * * @since 12.2 */ public function addTemplatePath($path) { $this->_addPath('template', $path); } /** * Adds to the stack of helper script paths in LIFO order. * * @param mixed $path A directory path or an array of paths. * * @return void * * @since 12.2 */ public function addHelperPath($path) { $this->_addPath('helper', $path); } /** * Load a template file -- first look in the templates folder for an override * * @param string $tpl The name of the template source file; automatically searches the template paths and compiles as needed. * * @return string The output of the the template script. * * @since 12.2 * @throws Exception */ public function loadTemplate($tpl = null) { // Clear prior output $this->_output = null; $template = JFactory::getApplication()->getTemplate(); $layout = $this->getLayout(); $layoutTemplate = $this->getLayoutTemplate(); // Create the template file name based on the layout $file = isset($tpl) ? $layout . '_' . $tpl : $layout; // Clean the file name $file = preg_replace('/[^A-Z0-9_\.-]/i', '', $file); $tpl = isset($tpl) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $tpl) : $tpl; // Load the language file for the template $lang = JFactory::getLanguage(); $lang->load('tpl_' . $template, JPATH_BASE, null, false, true) || $lang->load('tpl_' . $template, JPATH_THEMES . "/$template", null, false, true); // Change the template folder if alternative layout is in different template if (isset($layoutTemplate) && $layoutTemplate != '_' && $layoutTemplate != $template) { $this->_path['template'] = str_replace($template, $layoutTemplate, $this->_path['template']); } // Load the template script jimport('joomla.filesystem.path'); $filetofind = $this->_createFileName('template', array('name' => $file)); $this->_template = JPath::find($this->_path['template'], $filetofind); // If alternate layout can't be found, fall back to default layout if ($this->_template == false) { $filetofind = $this->_createFileName('', array('name' => 'default' . (isset($tpl) ? '_' . $tpl : $tpl))); $this->_template = JPath::find($this->_path['template'], $filetofind); } if ($this->_template != false) { // Unset so as not to introduce into template scope unset($tpl); unset($file); // Never allow a 'this' property if (isset($this->this)) { unset($this->this); } // Start capturing output into a buffer ob_start(); // Include the requested template filename in the local scope // (this will execute the view logic). include $this->_template; // Done with the requested template; get the buffer and // clear it. $this->_output = ob_get_contents(); ob_end_clean(); return $this->_output; } else { throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $file), 500); } } /** * Load a helper file * * @param string $hlp The name of the helper source file automatically searches the helper paths and compiles as needed. * * @return void * * @since 12.2 */ public function loadHelper($hlp = null) { // Clean the file name $file = preg_replace('/[^A-Z0-9_\.-]/i', '', $hlp); // Load the template script jimport('joomla.filesystem.path'); $helper = JPath::find($this->_path['helper'], $this->_createFileName('helper', array('name' => $file))); if ($helper != false) { // Include the requested template filename in the local scope include_once $helper; } } /** * Sets an entire array of search paths for templates or resources. * * @param string $type The type of path to set, typically 'template'. * @param mixed $path The new search path, or an array of search paths. If null or false, resets to the current directory only. * * @return void * * @since 12.2 */ protected function _setPath($type, $path) { $component = JApplicationHelper::getComponentName(); $app = JFactory::getApplication(); // Clear out the prior search dirs $this->_path[$type] = array(); // Actually add the user-specified directories $this->_addPath($type, $path); // Always add the fallback directories as last resort switch (strtolower($type)) { case 'template': // Set the alternative template search dir if (isset($app)) { $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $component); $fallback = JPATH_THEMES . '/' . $app->getTemplate() . '/html/' . $component . '/' . $this->getName(); $this->_addPath('template', $fallback); } break; } } /** * Adds to the search path for templates and resources. * * @param string $type The type of path to add. * @param mixed $path The directory or stream, or an array of either, to search. * * @return void * * @since 12.2 */ protected function _addPath($type, $path) { // Just force to array settype($path, 'array'); // Loop through the path directories foreach ($path as $dir) { jimport('joomla.filesystem.path'); // Clean up the path $dir = JPath::clean($dir); // Add trailing separators as needed if (substr($dir, -1) != DIRECTORY_SEPARATOR) { // Directory $dir .= DIRECTORY_SEPARATOR; } // Add to the top of the search dirs array_unshift($this->_path[$type], $dir); } } /** * Create the filename for a resource * * @param string $type The resource type to create the filename for * @param array $parts An associative array of filename information * * @return string The filename * * @since 12.2 */ protected function _createFileName($type, $parts = array()) { switch ($type) { case 'template': $filename = strtolower($parts['name']) . '.' . $this->_layoutExt; break; default: $filename = strtolower($parts['name']) . '.php'; break; } return $filename; } /** * Returns the form object * * @return mixed A JForm object on success, false on failure * * @since 3.2 */ public function getForm() { if (!is_object($this->form)) { $this->form = $this->get('Form'); } return $this->form; } } PK���\e�~R $libraries/legacy/view/categories.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage View * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Categories view base class. * * @since 3.2 */ class JViewCategories extends JViewLegacy { /** * State data * * @var \Joomla\Registry\Registry * @since 3.2 */ protected $state; /** * Category items data * * @var array * @since 3.2 */ protected $items; /** * Language key for default page heading * * @var string * @since 3.2 */ protected $pageHeading; /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a Error object. * * @since 3.2 */ public function display($tpl = null) { $state = $this->get('State'); $items = $this->get('Items'); $parent = $this->get('Parent'); $app = JFactory::getApplication(); // Check for errors. if (count($errors = $this->get('Errors'))) { $app->enqueueMessage($errors, 'error'); return false; } if ($items === false) { $app->enqueueMessage(JText::_('JGLOBAL_CATEGORY_NOT_FOUND'), 'error'); return false; } if ($parent == false) { $app->enqueueMessage(JText::_('JGLOBAL_CATEGORY_NOT_FOUND'), 'error'); return false; } $params = &$state->params; $items = array($parent->id => $items); // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->maxLevelcat = $params->get('maxLevelcat', -1) < 0 ? PHP_INT_MAX : $params->get('maxLevelcat', PHP_INT_MAX); $this->params = &$params; $this->parent = &$parent; $this->items = &$items; $this->prepareDocument(); return parent::display($tpl); } /** * Prepares the document * * @return void * * @since 3.2 */ protected function prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); // Because the application sets a default page title, we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_($this->pageHeading)); } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->get('sitename'); } elseif ($app->get('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); } $this->document->setTitle($title); if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } } } PK���\�|�:libraries/legacy/web/web.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Deprecated class placeholder. You should use JApplicationWeb instead. * * @since 11.3 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JApplicationWeb instead. * @codeCoverageIgnore */ class JWeb extends JApplicationWeb { /** * Class constructor. * * @param JInput $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInput object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param JApplicationWebClient $client An optional argument to provide dependency injection for the application's * client object. If the argument is a JApplicationWebClient object that object will become * the application's client object, otherwise a default client object is created. * * @since 11.3 * @deprecated 12.3 (Platform) & 4.0 (CMS) Use JApplicationWeb instead. */ public function __construct(JInput $input = null, Registry $config = null, JApplicationWebClient $client = null) { JLog::add('JWeb is deprecated. Use JApplicationWeb instead.', JLog::WARNING, 'deprecated'); parent::__construct($input, $config, $client); } } PK���\�qw�JJlibraries/legacy/web/client.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Deprecated class placeholder. You should use JApplicationWebClient instead. * * @since 11.3 * @deprecated 12.3 (Platform) & 4.0 (CMS) * @codeCoverageIgnore */ class JWebClient extends JApplicationWebClient { /** * Class constructor. * * @param mixed $userAgent The optional user-agent string to parse. * @param mixed $acceptEncoding The optional client accept encoding string to parse. * @param mixed $acceptLanguage The optional client accept language string to parse. * * @since 11.3 */ public function __construct($userAgent = null, $acceptEncoding = null, $acceptLanguage = null) { JLog::add('JWebClient is deprecated. Use JApplicationWebClient instead.', JLog::WARNING, 'deprecated'); parent::__construct($userAgent, $acceptEncoding, $acceptLanguage); } } PK���\����(libraries/legacy/exception/exception.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Exception * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Exception object. * * @since 11.1 * @deprecated 12.1 (Platform) & 4.0 (CMS) */ class JException extends Exception { /** * @var string Error level. * @since 11.1 */ protected $level = null; /** * @var string Error code. * @since 11.1 */ protected $code = null; /** * @var string Error message. * @since 11.1 */ protected $message = null; /** * Additional info about the error relevant to the developer, * for example, if a database connect fails, the dsn used * * @var string * @since 11.1 */ protected $info = ''; /** * Name of the file the error occurred in [Available if backtrace is enabled] * * @var string * @since 11.1 */ protected $file = null; /** * Line number the error occurred in [Available if backtrace is enabled] * * @var int * @since 11.1 */ protected $line = 0; /** * Name of the method the error occurred in [Available if backtrace is enabled] * * @var string * @since 11.1 */ protected $function = null; /** * Name of the class the error occurred in [Available if backtrace is enabled] * * @var string * @since 11.1 */ protected $class = null; /** * @var string Error type. * @since 11.1 */ protected $type = null; /** * Arguments recieved by the method the error occurred in [Available if backtrace is enabled] * * @var array * @since 11.1 */ protected $args = array(); /** * @var mixed Backtrace information. * @since 11.1 */ protected $backtrace = null; /** * Constructor * - used to set up the error with all needed error details. * * @param string $msg The error message * @param string $code The error code from the application * @param integer $level The error level (use the PHP constants E_ALL, E_NOTICE etc.). * @param string $info Optional: The additional error information. * @param boolean $backtrace True if backtrace information is to be collected * * @since 11.1 * * @deprecated 12.1 */ public function __construct($msg, $code = 0, $level = null, $info = null, $backtrace = false) { JLog::add('JException is deprecated.', JLog::WARNING, 'deprecated'); $this->level = $level; $this->code = $code; $this->message = $msg; if ($info != null) { $this->info = $info; } if ($backtrace && function_exists('debug_backtrace')) { $this->backtrace = debug_backtrace(); for ($i = count($this->backtrace) - 1; $i >= 0; --$i) { ++$i; if (isset($this->backtrace[$i]['file'])) { $this->file = $this->backtrace[$i]['file']; } if (isset($this->backtrace[$i]['line'])) { $this->line = $this->backtrace[$i]['line']; } if (isset($this->backtrace[$i]['class'])) { $this->class = $this->backtrace[$i]['class']; } if (isset($this->backtrace[$i]['function'])) { $this->function = $this->backtrace[$i]['function']; } if (isset($this->backtrace[$i]['type'])) { $this->type = $this->backtrace[$i]['type']; } $this->args = false; if (isset($this->backtrace[$i]['args'])) { $this->args = $this->backtrace[$i]['args']; } break; } } // Store exception for debugging purposes! JError::addToStack($this); parent::__construct($msg, (int) $code); } /** * Returns to error message * * @return string Error message * * @since 11.1 * * @deprecated 12.1 */ public function __toString() { JLog::add('JException::__toString is deprecated.', JLog::WARNING, 'deprecated'); return $this->message; } /** * Returns to error message * * @return string Error message * * @since 11.1 * @deprecated 12.1 */ public function toString() { JLog::add('JException::toString is deprecated.', JLog::WARNING, 'deprecated'); return (string) $this; } /** * Returns a property of the object or the default value if the property is not set. * * @param string $property The name of the property * @param mixed $default The default value * * @return mixed The value of the property or null * * @deprecated 12.1 * @see JException::getProperties() * @since 11.1 */ public function get($property, $default = null) { JLog::add('JException::get is deprecated.', JLog::WARNING, 'deprecated'); if (isset($this->$property)) { return $this->$property; } return $default; } /** * Returns an associative array of object properties * * @param boolean $public If true, returns only the public properties * * @return array Object properties * * @deprecated 12.1 * @see JException::get() * @since 11.1 */ public function getProperties($public = true) { JLog::add('JException::getProperties is deprecated.', JLog::WARNING, 'deprecated'); $vars = get_object_vars($this); if ($public) { foreach ($vars as $key => $value) { if ('_' == substr($key, 0, 1)) { unset($vars[$key]); } } } return $vars; } /** * Get the most recent error message * * @param integer $i Option error index * @param boolean $toString Indicates if JError objects should return their error message * * @return string Error message * * @since 11.1 * * @deprecated 12.1 */ public function getError($i = null, $toString = true) { JLog::add('JException::getError is deprecated.', JLog::WARNING, 'deprecated'); // Find the error if ($i === null) { // Default, return the last message $error = end($this->_errors); } elseif (!array_key_exists($i, $this->_errors)) { // If $i has been specified but does not exist, return false return false; } else { $error = $this->_errors[$i]; } // Check if only the string is requested if ($error instanceof Exception && $toString) { return (string) $error; } return $error; } /** * Return all errors, if any * * @return array Array of error messages or JErrors * * @since 11.1 * * @deprecated 12.1 */ public function getErrors() { JLog::add('JException::getErrors is deprecated.', JLog::WARNING, 'deprecated'); return $this->_errors; } /** * Modifies a property of the object, creating it if it does not already exist. * * @param string $property The name of the property * @param mixed $value The value of the property to set * * @return mixed Previous value of the property * * @deprecated 12.1 * @see JException::setProperties() * @since 11.1 */ public function set($property, $value = null) { JLog::add('JException::set is deprecated.', JLog::WARNING, 'deprecated'); $previous = isset($this->$property) ? $this->$property : null; $this->$property = $value; return $previous; } /** * Set the object properties based on a named array/hash * * @param mixed $properties Either and associative array or another object * * @return boolean * * @deprecated 12.1 * @see JException::set() * @since 11.1 */ public function setProperties($properties) { JLog::add('JException::setProperties is deprecated.', JLog::WARNING, 'deprecated'); // Cast to an array $properties = (array) $properties; if (is_array($properties)) { foreach ($properties as $k => $v) { $this->$k = $v; } return true; } return false; } /** * Add an error message * * @param string $error Error message * * @return void * * @since 11.1 * * @deprecated 12.1 */ public function setError($error) { JLog::add('JException::setErrors is deprecated.', JLog::WARNING, 'deprecated'); array_push($this->_errors, $error); } } PK���\����cclibraries/legacy/base/node.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Base * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Tree Node Class. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) * @codeCoverageIgnore */ class JNode extends JObject { /** * Parent node * @var object * * @since 11.1 */ protected $_parent = null; /** * Array of Children * * @var array * @since 11.1 */ protected $_children = array(); /** * Constructor * * @since 11.1 */ public function __construct() { JLog::add('JNode::__construct() is deprecated.', JLog::WARNING, 'deprecated'); return true; } /** * Add child to this node * * If the child already has a parent, the link is unset * * @param JNode &$child The child to be added * * @return void * * @since 11.1 */ public function addChild(&$child) { JLog::add('JNode::addChild() is deprecated.', JLog::WARNING, 'deprecated'); if ($child instanceof Jnode) { $child->setParent($this); } } /** * Set the parent of a this node * * If the node already has a parent, the link is unset * * @param mixed &$parent The JNode for parent to be set or null * * @return void * * @since 11.1 */ public function setParent(&$parent) { JLog::add('JNode::setParent() is deprecated.', JLog::WARNING, 'deprecated'); if ($parent instanceof JNode || is_null($parent)) { $hash = spl_object_hash($this); if (!is_null($this->_parent)) { unset($this->_parent->children[$hash]); } if (!is_null($parent)) { $parent->_children[$hash] = & $this; } $this->_parent = & $parent; } } /** * Get the children of this node * * @return array The children * * @since 11.1 */ public function &getChildren() { JLog::add('JNode::getChildren() is deprecated.', JLog::WARNING, 'deprecated'); return $this->_children; } /** * Get the parent of this node * * @return mixed JNode object with the parent or null for no parent * * @since 11.1 */ public function &getParent() { JLog::add('JNode::getParent() is deprecated.', JLog::WARNING, 'deprecated'); return $this->_parent; } /** * Test if this node has children * * @return boolean True if there are children * * @since 11.1 */ public function hasChildren() { JLog::add('JNode::hasChildren() is deprecated.', JLog::WARNING, 'deprecated'); return (bool) count($this->_children); } /** * Test if this node has a parent * * @return boolean True if there is a parent * * @since 11.1 */ public function hasParent() { JLog::add('JNode::hasParent() is deprecated.', JLog::WARNING, 'deprecated'); return $this->getParent() != null; } } PK���\�z�gg$libraries/legacy/base/observable.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Base * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Abstract observable class to implement the observer design pattern * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) * @codeCoverageIgnore */ class JObservable extends JObject { /** * An array of Observer objects to notify * * @var array * @since 11.1 * @deprecated 12.3 */ protected $_observers = array(); /** * The state of the observable object * * @var mixed * @since 11.1 * @deprecated 12.3 */ protected $_state = null; /** * A multi dimensional array of [function][] = key for observers * * @var array * @since 11.1 * @deprecated 12.3 */ protected $_methods = array(); /** * Constructor * * Note: Make Sure it's not directly instantiated * * @deprecated 12.3 */ public function __construct() { $this->_observers = array(); } /** * Get the state of the JObservable object * * @return mixed The state of the object. * * @since 11.1 * @deprecated 12.3 */ public function getState() { return $this->_state; } /** * Update each attached observer object and return an array of their return values * * @return array Array of return values from the observers * * @since 11.1 * @deprecated 12.3 */ public function notify() { // Iterate through the _observers array foreach ($this->_observers as $observer) { $return[] = $observer->update(); } return $return; } /** * Attach an observer object * * @param object $observer An observer object to attach * * @return void * * @since 11.1 * @deprecated 12.3 */ public function attach($observer) { if (is_array($observer)) { if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler'])) { return; } // Make sure we haven't already attached this array as an observer foreach ($this->_observers as $check) { if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler']) { return; } } $this->_observers[] = $observer; end($this->_observers); $methods = array($observer['event']); } else { if (!($observer instanceof JObserver)) { return; } // Make sure we haven't already attached this object as an observer $class = get_class($observer); foreach ($this->_observers as $check) { if ($check instanceof $class) { return; } } $this->_observers[] = $observer; $methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin')); } $key = key($this->_observers); foreach ($methods as $method) { $method = strtolower($method); if (!isset($this->_methods[$method])) { $this->_methods[$method] = array(); } $this->_methods[$method][] = $key; } } /** * Detach an observer object * * @param object $observer An observer object to detach. * * @return boolean True if the observer object was detached. * * @since 11.1 * @deprecated 12.3 */ public function detach($observer) { $retval = false; $key = array_search($observer, $this->_observers); if ($key !== false) { unset($this->_observers[$key]); $retval = true; foreach ($this->_methods as &$method) { $k = array_search($key, $method); if ($k !== false) { unset($method[$k]); } } } return $retval; } } PK���\y��a��"libraries/legacy/base/observer.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Base * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Abstract observer class to implement the observer design pattern * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) * @codeCoverageIgnore */ abstract class JObserver extends JObject { /** * Event object to observe. * * @var object * @since 11.1 * @deprecated 12.3 */ protected $_subject = null; /** * Constructor * * @param object &$subject The object to observe. * * @since 11.1 * @deprecated 12.3 */ public function __construct(&$subject) { // Register the observer ($this) so we can be notified $subject->attach($this); // Set the subject to observe $this->_subject = &$subject; } /** * Method to update the state of observable objects * * @param array &$args An array of arguments to pass to the listener. * * @return mixed * * @since 11.1 * @deprecated 12.3 */ public abstract function update(&$args); } PK���\�`(��libraries/legacy/base/tree.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Base * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Tree Class. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) * @codeCoverageIgnore */ class JTree extends JObject { /** * Root node * * @var object * @since 11.1 */ protected $_root = null; /** * Current working node * * @var object * @since 11.1 */ protected $_current = null; /** * Constructor * * @since 11.1 */ public function __construct() { JLog::add('JTree::__construct() is deprecated.', JLog::WARNING, 'deprecated'); $this->_root = new JNode('ROOT'); $this->_current = & $this->_root; } /** * Method to add a child * * @param array &$node The node to process * @param boolean $setCurrent True to set as current working node * * @return mixed * * @since 11.1 */ public function addChild(&$node, $setCurrent = false) { JLog::add('JTree::addChild() is deprecated.', JLog::WARNING, 'deprecated'); $this->_current->addChild($node); if ($setCurrent) { $this->_current = &$node; } } /** * Method to get the parent * * @return void * * @since 11.1 */ public function getParent() { JLog::add('JTree::getParent() is deprecated.', JLog::WARNING, 'deprecated'); $this->_current = &$this->_current->getParent(); } /** * Method to get the parent * * @return void * * @since 11.1 */ public function reset() { JLog::add('JTree::reset() is deprecated.', JLog::WARNING, 'deprecated'); $this->_current = &$this->_root; } } PK���\}^B,� � "libraries/legacy/table/content.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Content table * * @since 11.1 * @deprecated Class will be removed upon completion of transition to UCM */ class JTableContent extends JTable { /** * Constructor * * @param JDatabaseDriver $db A database connector object * * @since 11.1 */ public function __construct(JDatabaseDriver $db) { parent::__construct('#__content', 'id', $db); JTableObserverTags::createObserver($this, array('typeAlias' => 'com_content.article')); JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_content.article')); // Set the alias since the column is called state $this->setColumnAlias('published', 'state'); } /** * Method to compute the default name of the asset. * The default name is in the form table_name.id * where id is the value of the primary key of the table. * * @return string * * @since 11.1 */ protected function _getAssetName() { $k = $this->_tbl_key; return 'com_content.article.' . (int) $this->$k; } /** * Method to return the title to use for the asset table. * * @return string * * @since 11.1 */ protected function _getAssetTitle() { return $this->title; } /** * Method to get the parent asset id for the record * * @param JTable $table A JTable object (optional) for the asset parent * @param integer $id The id (optional) of the content. * * @return integer * * @since 11.1 */ protected function _getAssetParentId(JTable $table = null, $id = null) { $assetId = null; // This is a article under a category. if ($this->catid) { // Build the query to get the asset id for the parent category. $query = $this->_db->getQuery(true) ->select($this->_db->quoteName('asset_id')) ->from($this->_db->quoteName('#__categories')) ->where($this->_db->quoteName('id') . ' = ' . (int) $this->catid); // Get the asset id from the database. $this->_db->setQuery($query); if ($result = $this->_db->loadResult()) { $assetId = (int) $result; } } // Return the asset id. if ($assetId) { return $assetId; } else { return parent::_getAssetParentId($table, $id); } } /** * Overloaded bind function * * @param array $array Named array * @param mixed $ignore An optional array or space separated list of properties * to ignore while binding. * * @return mixed Null if operation was satisfactory, otherwise returns an error string * * @see JTable::bind() * @since 11.1 */ public function bind($array, $ignore = '') { // Search for the {readmore} tag and split the text up accordingly. if (isset($array['articletext'])) { $pattern = '#<hr\s+id=("|\')system-readmore("|\')\s*\/*>#i'; $tagPos = preg_match($pattern, $array['articletext']); if ($tagPos == 0) { $this->introtext = $array['articletext']; $this->fulltext = ''; } else { list ($this->introtext, $this->fulltext) = preg_split($pattern, $array['articletext'], 2); } } if (isset($array['attribs']) && is_array($array['attribs'])) { $registry = new Registry; $registry->loadArray($array['attribs']); $array['attribs'] = (string) $registry; } if (isset($array['metadata']) && is_array($array['metadata'])) { $registry = new Registry; $registry->loadArray($array['metadata']); $array['metadata'] = (string) $registry; } // Bind the rules. if (isset($array['rules']) && is_array($array['rules'])) { $rules = new JAccessRules($array['rules']); $this->setRules($rules); } return parent::bind($array, $ignore); } /** * Overloaded check function * * @return boolean True on success, false on failure * * @see JTable::check() * @since 11.1 */ public function check() { if (trim($this->title) == '') { $this->setError(JText::_('COM_CONTENT_WARNING_PROVIDE_VALID_NAME')); return false; } if (trim($this->alias) == '') { $this->alias = $this->title; } $this->alias = JApplicationHelper::stringURLSafe($this->alias); if (trim(str_replace('-', '', $this->alias)) == '') { $this->alias = JFactory::getDate()->format('Y-m-d-H-i-s'); } if (trim(str_replace(' ', '', $this->fulltext)) == '') { $this->fulltext = ''; } /** * Ensure any new items have compulsory fields set. This is needed for things like * frontend editing where we don't show all the fields or using some kind of API */ if (!$this->id) { // Images can be an empty json string if (!isset($this->images)) { $this->images = '{}'; } // URLs can be an empty json string if (!isset($this->urls)) { $this->urls = '{}'; } // Attributes (article params) can be an empty json string if (!isset($this->attribs)) { $this->attribs = '{}'; } // Metadata can be an empty json string if (!isset($this->metadata)) { $this->metadata = '{}'; } // If we don't have any access rules set at this point just use an empty JAccessRules class if (!$this->getRules()) { $rules = $this->getDefaultAssetValues('com_content'); $this->setRules($rules); } } // Check the publish down date is not earlier than publish up. if ($this->publish_down > $this->_db->getNullDate() && $this->publish_down < $this->publish_up) { // Swap the dates. $temp = $this->publish_up; $this->publish_up = $this->publish_down; $this->publish_down = $temp; } // Clean up keywords -- eliminate extra spaces between phrases // and cr (\r) and lf (\n) characters from string if (!empty($this->metakey)) { // Only process if not empty // Array of characters to remove $bad_characters = array("\n", "\r", "\"", "<", ">"); // Remove bad characters $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); // Create array using commas as delimiter $keys = explode(',', $after_clean); $clean_keys = array(); foreach ($keys as $key) { if (trim($key)) { // Ignore blank keywords $clean_keys[] = trim($key); } } // Put array back together delimited by ", " $this->metakey = implode(", ", $clean_keys); } return true; } /** * Gets the default asset values for a component. * * @param $string $component The component asset name to search for * * @return JAccessRules The JAccessRules object for the asset */ protected function getDefaultAssetValues($component) { // Need to find the asset id by the name of the component. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) ->where($db->quoteName('name') . ' = ' . $db->quote($component)); $db->setQuery($query); $assetId = (int) $db->loadResult(); return JAccess::getAssetRules($assetId); } /** * Overrides JTable::store to set modified data and user id. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @since 11.1 */ public function store($updateNulls = false) { $date = JFactory::getDate(); $user = JFactory::getUser(); $this->modified = $date->toSql(); if ($this->id) { // Existing item $this->modified_by = $user->get('id'); } else { // New article. An article created and created_by field can be set by the user, // so we don't touch either of these if they are set. if (!(int) $this->created) { $this->created = $date->toSql(); } if (empty($this->created_by)) { $this->created_by = $user->get('id'); } } // Verify that the alias is unique $table = JTable::getInstance('Content', 'JTable', array('dbo', $this->getDbo())); if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0)) { $this->setError(JText::_('JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS')); return false; } return parent::store($updateNulls); } } PK���\+�����#libraries/legacy/table/category.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Category table * * @since 11.1 */ class JTableCategory extends JTableNested { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct(JDatabaseDriver $db) { parent::__construct('#__categories', 'id', $db); JTableObserverTags::createObserver($this, array('typeAlias' => '{extension}.category')); JTableObserverContenthistory::createObserver($this, array('typeAlias' => '{extension}.category')); $this->access = (int) JFactory::getConfig()->get('access'); } /** * Method to compute the default name of the asset. * The default name is in the form table_name.id * where id is the value of the primary key of the table. * * @return string * * @since 11.1 */ protected function _getAssetName() { $k = $this->_tbl_key; return $this->extension . '.category.' . (int) $this->$k; } /** * Method to return the title to use for the asset table. * * @return string * * @since 11.1 */ protected function _getAssetTitle() { return $this->title; } /** * Get the parent asset id for the record * * @param JTable $table A JTable object for the asset parent. * @param integer $id The id for the asset * * @return integer The id of the asset's parent * * @since 11.1 */ protected function _getAssetParentId(JTable $table = null, $id = null) { $assetId = null; // This is a category under a category. if ($this->parent_id > 1) { // Build the query to get the asset id for the parent category. $query = $this->_db->getQuery(true) ->select($this->_db->quoteName('asset_id')) ->from($this->_db->quoteName('#__categories')) ->where($this->_db->quoteName('id') . ' = ' . $this->parent_id); // Get the asset id from the database. $this->_db->setQuery($query); if ($result = $this->_db->loadResult()) { $assetId = (int) $result; } } // This is a category that needs to parent with the extension. elseif ($assetId === null) { // Build the query to get the asset id for the parent category. $query = $this->_db->getQuery(true) ->select($this->_db->quoteName('id')) ->from($this->_db->quoteName('#__assets')) ->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote($this->extension)); // Get the asset id from the database. $this->_db->setQuery($query); if ($result = $this->_db->loadResult()) { $assetId = (int) $result; } } // Return the asset id. if ($assetId) { return $assetId; } else { return parent::_getAssetParentId($table, $id); } } /** * Override check function * * @return boolean * * @see JTable::check() * @since 11.1 */ public function check() { // Check for a title. if (trim($this->title) == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_CATEGORY')); return false; } $this->alias = trim($this->alias); if (empty($this->alias)) { $this->alias = $this->title; } $this->alias = JApplication::stringURLSafe($this->alias); if (trim(str_replace('-', '', $this->alias)) == '') { $this->alias = JFactory::getDate()->format('Y-m-d-H-i-s'); } return true; } /** * Overloaded bind function. * * @param array $array named array * @param string $ignore An optional array or space separated list of properties * to ignore while binding. * * @return mixed Null if operation was satisfactory, otherwise returns an error * * @see JTable::bind() * @since 11.1 */ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { $registry = new Registry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } if (isset($array['metadata']) && is_array($array['metadata'])) { $registry = new Registry; $registry->loadArray($array['metadata']); $array['metadata'] = (string) $registry; } // Bind the rules. if (isset($array['rules']) && is_array($array['rules'])) { $rules = new JAccessRules($array['rules']); $this->setRules($rules); } return parent::bind($array, $ignore); } /** * Overridden JTable::store to set created/modified and user id. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @since 11.1 */ public function store($updateNulls = false) { $date = JFactory::getDate(); $user = JFactory::getUser(); $this->modified_time = $date->toSql(); if ($this->id) { // Existing category $this->modified_user_id = $user->get('id'); } else { // New category $this->created_time = $date->toSql(); $this->created_user_id = $user->get('id'); } // Verify that the alias is unique $table = JTable::getInstance('Category', 'JTable', array('dbo' => $this->getDbo())); if ($table->load(array('alias' => $this->alias, 'parent_id' => (int) $this->parent_id, 'extension' => $this->extension)) && ($table->id != $this->id || $this->id == 0)) { $this->setError(JText::_('JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS')); return false; } return parent::store($updateNulls); } } PK���\��#KK!libraries/legacy/table/module.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Module table * * @since 11.1 */ class JTableModule extends JTable { /** * Constructor. * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct(JDatabaseDriver $db) { parent::__construct('#__modules', 'id', $db); $this->access = (int) JFactory::getConfig()->get('access'); } /** * Method to compute the default name of the asset. * The default name is in the form table_name.id * where id is the value of the primary key of the table. * * @return string * * @since 11.1 */ protected function _getAssetName() { $k = $this->_tbl_key; return 'com_modules.module.' . (int) $this->$k; } /** * Method to return the title to use for the asset table. * * @return string * * @since 11.1 */ protected function _getAssetTitle() { return $this->title; } /** * Method to get the parent asset id for the record * * @param JTable $table A JTable object (optional) for the asset parent * @param integer $id The id (optional) of the content. * * @return integer * * @since 11.1 */ protected function _getAssetParentId(JTable $table = null, $id = null) { $assetId = null; // This is a module that needs to parent with the extension. if ($assetId === null) { // Build the query to get the asset id of the parent component. $query = $this->_db->getQuery(true) ->select($this->_db->quoteName('id')) ->from($this->_db->quoteName('#__assets')) ->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote('com_modules')); // Get the asset id from the database. $this->_db->setQuery($query); if ($result = $this->_db->loadResult()) { $assetId = (int) $result; } } // Return the asset id. if ($assetId) { return $assetId; } else { return parent::_getAssetParentId($table, $id); } } /** * Overloaded check function. * * @return boolean True if the instance is sane and able to be stored in the database. * * @see JTable::check() * @since 11.1 */ public function check() { // Check for valid name if (trim($this->title) == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MODULE')); return false; } // Check the publish down date is not earlier than publish up. if ((int) $this->publish_down > 0 && $this->publish_down < $this->publish_up) { // Swap the dates. $temp = $this->publish_up; $this->publish_up = $this->publish_down; $this->publish_down = $temp; } return true; } /** * Overloaded bind function. * * @param array $array Named array. * @param mixed $ignore An optional array or space separated list of properties to ignore while binding. * * @return mixed Null if operation was satisfactory, otherwise returns an error * * @see JTable::bind() * @since 11.1 */ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { $registry = new Registry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } // Bind the rules. if (isset($array['rules']) && is_array($array['rules'])) { $rules = new JAccessRules($array['rules']); $this->setRules($rules); } return parent::bind($array, $ignore); } } PK���\��e))$libraries/legacy/table/menu/type.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Menu Types table * * @since 11.1 */ class JTableMenuType extends JTable { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct(JDatabaseDriver $db) { parent::__construct('#__menu_types', 'id', $db); } /** * Overloaded check function * * @return boolean True on success, false on failure * * @see JTable::check() * @since 11.1 */ public function check() { $this->menutype = JApplication::stringURLSafe($this->menutype); if (empty($this->menutype)) { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENUTYPE_EMPTY')); return false; } // Sanitise data. if (trim($this->title) == '') { $this->title = $this->menutype; } // Check for unique menutype. $query = $this->_db->getQuery(true) ->select('COUNT(id)') ->from($this->_db->quoteName('#__menu_types')) ->where($this->_db->quoteName('menutype') . ' = ' . $this->_db->quote($this->menutype)) ->where($this->_db->quoteName('id') . ' <> ' . (int) $this->id); $this->_db->setQuery($query); if ($this->_db->loadResult()) { $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_MENUTYPE_EXISTS', $this->menutype)); return false; } return true; } /** * Method to store a row in the database from the JTable instance properties. * If a primary key value is set the row with that primary key value will be * updated with the instance property values. If no primary key value is set * a new row will be inserted into the database with the properties from the * JTable instance. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/store * @since 11.1 */ public function store($updateNulls = false) { if ($this->id) { // Get the user id $userId = JFactory::getUser()->id; // Get the old value of the table $table = JTable::getInstance('Menutype', 'JTable', array('dbo', $this->getDbo())); $table->load($this->id); // Verify that no items are checked out $query = $this->_db->getQuery(true) ->select('id') ->from('#__menu') ->where('menutype=' . $this->_db->quote($table->menutype)) ->where('checked_out !=' . (int) $userId) ->where('checked_out !=0'); $this->_db->setQuery($query); if ($this->_db->loadRowList()) { $this->setError( JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', get_class($this), JText::_('JLIB_DATABASE_ERROR_MENUTYPE_CHECKOUT')) ); return false; } // Verify that no module for this menu are checked out $query->clear() ->select('id') ->from('#__modules') ->where('module=' . $this->_db->quote('mod_menu')) ->where('params LIKE ' . $this->_db->quote('%"menutype":' . json_encode($table->menutype) . '%')) ->where('checked_out !=' . (int) $userId) ->where('checked_out !=0'); $this->_db->setQuery($query); if ($this->_db->loadRowList()) { $this->setError( JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', get_class($this), JText::_('JLIB_DATABASE_ERROR_MENUTYPE_CHECKOUT')) ); return false; } // Update the menu items $query->clear() ->update('#__menu') ->set('menutype=' . $this->_db->quote($this->menutype)) ->where('menutype=' . $this->_db->quote($table->menutype)); $this->_db->setQuery($query); $this->_db->execute(); // Update the module items $query->clear() ->update('#__modules') ->set( 'params=REPLACE(params,' . $this->_db->quote('"menutype":' . json_encode($table->menutype)) . ',' . $this->_db->quote('"menutype":' . json_encode($this->menutype)) . ')' ); $query->where('module=' . $this->_db->quote('mod_menu')) ->where('params LIKE ' . $this->_db->quote('%"menutype":' . json_encode($table->menutype) . '%')); $this->_db->setQuery($query); $this->_db->execute(); } return parent::store($updateNulls); } /** * Method to delete a row from the database table by primary key value. * * @param mixed $pk An optional primary key value to delete. If not set the instance property value is used. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/delete * @since 11.1 */ public function delete($pk = null) { $k = $this->_tbl_key; $pk = (is_null($pk)) ? $this->$k : $pk; // If no primary key is given, return false. if ($pk !== null) { // Get the user id $userId = JFactory::getUser()->id; // Get the old value of the table $table = JTable::getInstance('Menutype', 'JTable', array('dbo', $this->getDbo())); $table->load($pk); // Verify that no items are checked out $query = $this->_db->getQuery(true) ->select('id') ->from('#__menu') ->where('menutype=' . $this->_db->quote($table->menutype)) ->where('client_id=0') ->where('(checked_out NOT IN (0,' . (int) $userId . ') OR home=1 AND language=' . $this->_db->quote('*') . ')'); $this->_db->setQuery($query); if ($this->_db->loadRowList()) { $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_DELETE_FAILED', get_class($this), JText::_('JLIB_DATABASE_ERROR_MENUTYPE'))); return false; } // Verify that no module for this menu are checked out $query->clear() ->select('id') ->from('#__modules') ->where('module=' . $this->_db->quote('mod_menu')) ->where('params LIKE ' . $this->_db->quote('%"menutype":' . json_encode($table->menutype) . '%')) ->where('checked_out !=' . (int) $userId) ->where('checked_out !=0'); $this->_db->setQuery($query); if ($this->_db->loadRowList()) { $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_DELETE_FAILED', get_class($this), JText::_('JLIB_DATABASE_ERROR_MENUTYPE'))); return false; } // Delete the menu items $query->clear() ->delete('#__menu') ->where('menutype=' . $this->_db->quote($table->menutype)) ->where('client_id=0'); $this->_db->setQuery($query); $this->_db->execute(); // Update the module items $query->clear() ->delete('#__modules') ->where('module=' . $this->_db->quote('mod_menu')) ->where('params LIKE ' . $this->_db->quote('%"menutype":' . json_encode($table->menutype) . '%')); $this->_db->setQuery($query); $this->_db->execute(); } return parent::delete($pk); } } PK���\4��BXXlibraries/legacy/table/menu.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Menu table * * @since 11.1 */ class JTableMenu extends JTableNested { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct(JDatabaseDriver $db) { parent::__construct('#__menu', 'id', $db); // Set the default access level. $this->access = (int) JFactory::getConfig()->get('access'); } /** * Overloaded bind function * * @param array $array Named array * @param mixed $ignore An optional array or space separated list of properties to ignore while binding. * * @return mixed Null if operation was satisfactory, otherwise returns an error * * @see JTable::bind() * @since 11.1 */ public function bind($array, $ignore = '') { // Verify that the default home menu is not unset if ($this->home == '1' && $this->language == '*' && ($array['home'] == '0')) { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT_DEFAULT')); return false; } // Verify that the default home menu set to "all" languages" is not unset if ($this->home == '1' && $this->language == '*' && ($array['language'] != '*')) { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT')); return false; } // Verify that the default home menu is not unpublished if ($this->home == '1' && $this->language == '*' && $array['published'] != '1') { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME')); return false; } if (isset($array['params']) && is_array($array['params'])) { $registry = new Registry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } return parent::bind($array, $ignore); } /** * Overloaded check function * * @return boolean True on success * * @see JTable::check() * @since 11.1 */ public function check() { // Check for a title. if (trim($this->title) == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MENUITEM')); return false; } // Set correct component id to ensure proper 404 messages with separator items if ($this->type == "separator") { $this->component_id = 0; } // If the alias field is empty, set it to the title. $this->alias = trim($this->alias); if ((empty($this->alias)) && ($this->type != 'alias' && $this->type != 'url')) { $this->alias = $this->title; } // Check for a path. if (trim($this->path) == '') { $this->path = $this->alias; } // Check for params. if (trim($this->params) == '') { $this->params = '{}'; } // Check for img. if (trim($this->img) == '') { $this->img = ' '; } // Make the alias URL safe. $this->alias = JApplication::stringURLSafe($this->alias); if (trim(str_replace('-', '', $this->alias)) == '') { $this->alias = JFactory::getDate()->format('Y-m-d-H-i-s'); } // Cast the home property to an int for checking. $this->home = (int) $this->home; // Verify that a first level menu item alias is not 'component'. if ($this->parent_id == 1 && $this->alias == 'component') { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_COMPONENT')); return false; } // Verify that a first level menu item alias is not the name of a folder. jimport('joomla.filesystem.folder'); if ($this->parent_id == 1 && in_array($this->alias, JFolder::folders(JPATH_ROOT))) { $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_FOLDER', $this->alias, $this->alias)); return false; } // Verify that the home item a component. if ($this->home && $this->type != 'component') { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_HOME_NOT_COMPONENT')); return false; } return true; } /** * Overloaded store function * * @param boolean $updateNulls True to update fields even if they are null. * * @return mixed False on failure, positive integer on success. * * @see JTable::store() * @since 11.1 */ public function store($updateNulls = false) { $db = JFactory::getDbo(); // Verify that the alias is unique $table = JTable::getInstance('Menu', 'JTable', array('dbo' => $this->getDbo())); if ($table->load( array( 'alias' => $this->alias, 'parent_id' => $this->parent_id, 'client_id' => (int) $this->client_id, 'language' => $this->language ) ) && ($table->id != $this->id || $this->id == 0)) { if ($this->menutype == $table->menutype) { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS')); } else { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS_ROOT')); } return false; } // Verify that the home page for this language is unique if ($this->home == '1') { $table = JTable::getInstance('Menu', 'JTable', array('dbo' => $this->getDbo())); if ($table->load(array('home' => '1', 'language' => $this->language))) { if ($table->checked_out && $table->checked_out != $this->checked_out) { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_DEFAULT_CHECKIN_USER_MISMATCH')); return false; } $table->home = 0; $table->checked_out = 0; $table->checked_out_time = $db->getNullDate(); $table->store(); } // Verify that the home page for this menu is unique. if ($table->load(array('home' => '1', 'menutype' => $this->menutype)) && ($table->id != $this->id || $this->id == 0)) { $this->setError(JText::_('JLIB_DATABASE_ERROR_MENU_HOME_NOT_UNIQUE_IN_MENU')); return false; } } if (!parent::store($updateNulls)) { return false; } // Get the new path in case the node was moved $pathNodes = $this->getPath(); $segments = array(); foreach ($pathNodes as $node) { // Don't include root in path if ($node->alias != 'root') { $segments[] = $node->alias; } } $newPath = trim(implode('/', $segments), ' /\\'); // Use new path for partial rebuild of table // Rebuild will return positive integer on success, false on failure return ($this->rebuild($this->{$this->_tbl_key}, $this->lft, $this->level, $newPath) > 0); } } PK���\F3L)��"libraries/legacy/table/session.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Session table * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) - Use SQL queries to interact with the session table. */ class JTableSession extends JTable { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 * @deprecated 13.3 Use SQL queries to interact with the session table. */ public function __construct(JDatabaseDriver $db) { JLog::add('JTableSession is deprecated. Use SQL queries directly to interact with the session table.', JLog::WARNING, 'deprecated'); parent::__construct('#__session', 'session_id', $db); $this->guest = 1; $this->username = ''; } /** * Insert a session * * @param string $sessionId The session id * @param integer $clientId The id of the client application * * @return boolean True on success * * @since 11.1 * @deprecated 13.3 Use SQL queries to interact with the session table. */ public function insert($sessionId, $clientId) { $this->session_id = $sessionId; $this->client_id = $clientId; $this->time = time(); $ret = $this->_db->insertObject($this->_tbl, $this, 'session_id'); if (!$ret) { $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', strtolower(get_class($this)), $this->_db->stderr())); return false; } else { return true; } } /** * Updates the session * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @since 11.1 * @deprecated 13.3 Use SQL queries to interact with the session table. */ public function update($updateNulls = false) { $this->time = time(); $ret = $this->_db->updateObject($this->_tbl, $this, 'session_id', $updateNulls); if (!$ret) { $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', strtolower(get_class($this)), $this->_db->stderr())); return false; } else { return true; } } /** * Destroys the pre-existing session * * @param integer $userId Identifier of the user for this session. * @param array $clientIds Array of client ids for which session(s) will be destroyed * * @return boolean True on success. * * @since 11.1 * @deprecated 13.3 Use SQL queries to interact with the session table. */ public function destroy($userId, $clientIds = array()) { $clientIds = implode(',', $clientIds); $query = $this->_db->getQuery(true) ->delete($this->_db->quoteName($this->_tbl)) ->where($this->_db->quoteName('userid') . ' = ' . $this->_db->quote($userId)) ->where($this->_db->quoteName('client_id') . ' IN (' . $clientIds . ')'); $this->_db->setQuery($query); if (!$this->_db->execute()) { $this->setError($this->_db->stderr()); return false; } return true; } /** * Purge old sessions * * @param integer $maxLifetime Session age in seconds * * @return mixed Resource on success, null on fail * * @since 11.1 * @deprecated 13.3 Use SQL queries to interact with the session table. */ public function purge($maxLifetime = 1440) { $past = time() - $maxLifetime; $query = $this->_db->getQuery(true) ->delete($this->_db->quoteName($this->_tbl)) ->where($this->_db->quoteName('time') . ' < ' . (int) $past); $this->_db->setQuery($query); return $this->_db->execute(); } /** * Find out if a user has a one or more active sessions * * @param integer $userid The identifier of the user * * @return boolean True if a session for this user exists * * @since 11.1 * @deprecated 13.3 Use SQL queries to interact with the session table. */ public function exists($userid) { $query = $this->_db->getQuery(true) ->select('COUNT(userid)') ->from($this->_db->quoteName($this->_tbl)) ->where($this->_db->quoteName('userid') . ' = ' . $this->_db->quote($userid)); $this->_db->setQuery($query); if (!$result = $this->_db->loadResult()) { $this->setError($this->_db->stderr()); return false; } return (boolean) $result; } /** * Overloaded delete method * * We must override it because of the non-integer primary key * * @param integer $oid The object id (optional). * * @return mixed True if successful otherwise an error message * * @since 11.1 * @deprecated 13.3 Use SQL queries to interact with the session table. */ public function delete($oid = null) { $k = $this->_tbl_key; if ($oid) { $this->$k = $oid; } $query = $this->_db->getQuery(true) ->delete($this->_db->quoteName($this->_tbl)) ->where($this->_db->quoteName($this->_tbl_key) . ' = ' . $this->_db->quote($this->$k)); $this->_db->setQuery($query); $this->_db->execute(); return true; } } PK���\�� ��:�:$libraries/legacy/request/request.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Request * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Create the request global object */ $GLOBALS['_JREQUEST'] = array(); /** * Set the available masks for cleaning variables */ const JREQUEST_NOTRIM = 1; const JREQUEST_ALLOWRAW = 2; const JREQUEST_ALLOWHTML = 4; JLog::add('JRequest is deprecated.', JLog::WARNING, 'deprecated'); /** * JRequest Class * * This class serves to provide the Joomla Platform with a common interface to access * request variables. This includes $_POST, $_GET, and naturally $_REQUEST. Variables * can be passed through an input filter to avoid injection or returned raw. * * @since 11.1 * @deprecated 12.1 (Platform) & 4.0 (CMS) - Get the JInput object from the application instead */ class JRequest { /** * Gets the full request path. * * @return string * * @since 11.1 * * @deprecated 12.1 */ public static function getUri() { $uri = JUri::getInstance(); return $uri->toString(array('path', 'query')); } /** * Gets the request method. * * @return string * * @since 11.1 * * @deprecated 12.1 Use JInput::getMethod() instead */ public static function getMethod() { $method = strtoupper($_SERVER['REQUEST_METHOD']); return $method; } /** * Fetches and returns a given variable. * * The default behaviour is fetching variables depending on the * current request method: GET and HEAD will result in returning * an entry from $_GET, POST and PUT will result in returning an * entry from $_POST. * * You can force the source by setting the $hash parameter: * * post $_POST * get $_GET * files $_FILES * cookie $_COOKIE * env $_ENV * server $_SERVER * method via current $_SERVER['REQUEST_METHOD'] * default $_REQUEST * * @param string $name Variable name. * @param string $default Default value if the variable does not exist. * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD). * @param string $type Return type for the variable, for valid values see {@link JFilterInput::clean()}. * @param integer $mask Filter mask for the variable. * * @return mixed Requested variable. * * @since 11.1 * * @deprecated 12.1 Use JInput::Get */ public static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0) { // Ensure hash and type are uppercase $hash = strtoupper($hash); if ($hash === 'METHOD') { $hash = strtoupper($_SERVER['REQUEST_METHOD']); } $type = strtoupper($type); $sig = $hash . $type . $mask; // Get the input hash switch ($hash) { case 'GET': $input = &$_GET; break; case 'POST': $input = &$_POST; break; case 'FILES': $input = &$_FILES; break; case 'COOKIE': $input = &$_COOKIE; break; case 'ENV': $input = &$_ENV; break; case 'SERVER': $input = &$_SERVER; break; default: $input = &$_REQUEST; $hash = 'REQUEST'; break; } if (isset($GLOBALS['_JREQUEST'][$name]['SET.' . $hash]) && ($GLOBALS['_JREQUEST'][$name]['SET.' . $hash] === true)) { // Get the variable from the input hash $var = (isset($input[$name]) && $input[$name] !== null) ? $input[$name] : $default; $var = self::_cleanVar($var, $mask, $type); } elseif (!isset($GLOBALS['_JREQUEST'][$name][$sig])) { if (isset($input[$name]) && $input[$name] !== null) { // Get the variable from the input hash and clean it $var = self::_cleanVar($input[$name], $mask, $type); $GLOBALS['_JREQUEST'][$name][$sig] = $var; } elseif ($default !== null) { // Clean the default value $var = self::_cleanVar($default, $mask, $type); } else { $var = $default; } } else { $var = $GLOBALS['_JREQUEST'][$name][$sig]; } return $var; } /** * Fetches and returns a given filtered variable. The integer * filter will allow only digits and the - sign to be returned. This is currently * only a proxy function for getVar(). * * See getVar() for more in-depth documentation on the parameters. * * @param string $name Variable name. * @param string $default Default value if the variable does not exist. * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD). * * @return integer Requested variable. * * @since 11.1 * * @deprecated 12.1 */ public static function getInt($name, $default = 0, $hash = 'default') { return self::getVar($name, $default, $hash, 'int'); } /** * Fetches and returns a given filtered variable. The unsigned integer * filter will allow only digits to be returned. This is currently * only a proxy function for getVar(). * * See getVar() for more in-depth documentation on the parameters. * * @param string $name Variable name. * @param string $default Default value if the variable does not exist. * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD). * * @return integer Requested variable. * * @deprecated 12.1 * @since 11.1 */ public static function getUInt($name, $default = 0, $hash = 'default') { return self::getVar($name, $default, $hash, 'uint'); } /** * Fetches and returns a given filtered variable. The float * filter only allows digits and periods. This is currently * only a proxy function for getVar(). * * See getVar() for more in-depth documentation on the parameters. * * @param string $name Variable name. * @param string $default Default value if the variable does not exist. * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD). * * @return float Requested variable. * * @since 11.1 * * @deprecated 12.1 */ public static function getFloat($name, $default = 0.0, $hash = 'default') { return self::getVar($name, $default, $hash, 'float'); } /** * Fetches and returns a given filtered variable. The bool * filter will only return true/false bool values. This is * currently only a proxy function for getVar(). * * See getVar() for more in-depth documentation on the parameters. * * @param string $name Variable name. * @param string $default Default value if the variable does not exist. * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD). * * @return boolean Requested variable. * * @deprecated 12.1 * @since 11.1 */ public static function getBool($name, $default = false, $hash = 'default') { return self::getVar($name, $default, $hash, 'bool'); } /** * Fetches and returns a given filtered variable. The word * filter only allows the characters [A-Za-z_]. This is currently * only a proxy function for getVar(). * * See getVar() for more in-depth documentation on the parameters. * * @param string $name Variable name. * @param string $default Default value if the variable does not exist. * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD). * * @return string Requested variable. * * @since 11.1 * * @deprecated 12.1 */ public static function getWord($name, $default = '', $hash = 'default') { return self::getVar($name, $default, $hash, 'word'); } /** * Cmd (Word and Integer0 filter * * Fetches and returns a given filtered variable. The cmd * filter only allows the characters [A-Za-z0-9.-_]. This is * currently only a proxy function for getVar(). * * See getVar() for more in-depth documentation on the parameters. * * @param string $name Variable name * @param string $default Default value if the variable does not exist * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) * * @return string Requested variable * * @deprecated 12.1 * @since 11.1 */ public static function getCmd($name, $default = '', $hash = 'default') { return self::getVar($name, $default, $hash, 'cmd'); } /** * Fetches and returns a given filtered variable. The string * filter deletes 'bad' HTML code, if not overridden by the mask. * This is currently only a proxy function for getVar(). * * See getVar() for more in-depth documentation on the parameters. * * @param string $name Variable name * @param string $default Default value if the variable does not exist * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) * @param integer $mask Filter mask for the variable * * @return string Requested variable * * @since 11.1 * * @deprecated 12.1 */ public static function getString($name, $default = '', $hash = 'default', $mask = 0) { // Cast to string, in case JREQUEST_ALLOWRAW was specified for mask return (string) self::getVar($name, $default, $hash, 'string', $mask); } /** * Set a variable in one of the request variables. * * @param string $name Name * @param string $value Value * @param string $hash Hash * @param boolean $overwrite Boolean * * @return string Previous value * * @since 11.1 * * @deprecated 12.1 */ public static function setVar($name, $value = null, $hash = 'method', $overwrite = true) { // If overwrite is true, makes sure the variable hasn't been set yet if (!$overwrite && array_key_exists($name, $_REQUEST)) { return $_REQUEST[$name]; } // Clean global request var $GLOBALS['_JREQUEST'][$name] = array(); // Get the request hash value $hash = strtoupper($hash); if ($hash === 'METHOD') { $hash = strtoupper($_SERVER['REQUEST_METHOD']); } $previous = array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : null; switch ($hash) { case 'GET': $_GET[$name] = $value; $_REQUEST[$name] = $value; break; case 'POST': $_POST[$name] = $value; $_REQUEST[$name] = $value; break; case 'COOKIE': $_COOKIE[$name] = $value; $_REQUEST[$name] = $value; break; case 'FILES': $_FILES[$name] = $value; break; case 'ENV': $_ENV[$name] = $value; break; case 'SERVER': $_SERVER[$name] = $value; break; } // Mark this variable as 'SET' $GLOBALS['_JREQUEST'][$name]['SET.' . $hash] = true; $GLOBALS['_JREQUEST'][$name]['SET.REQUEST'] = true; return $previous; } /** * Fetches and returns a request array. * * The default behaviour is fetching variables depending on the * current request method: GET and HEAD will result in returning * $_GET, POST and PUT will result in returning $_POST. * * You can force the source by setting the $hash parameter: * * post $_POST * get $_GET * files $_FILES * cookie $_COOKIE * env $_ENV * server $_SERVER * method via current $_SERVER['REQUEST_METHOD'] * default $_REQUEST * * @param string $hash to get (POST, GET, FILES, METHOD). * @param integer $mask Filter mask for the variable. * * @return mixed Request hash. * * @deprecated 12.1 User JInput::get * @see JInput * @since 11.1 */ public static function get($hash = 'default', $mask = 0) { $hash = strtoupper($hash); if ($hash === 'METHOD') { $hash = strtoupper($_SERVER['REQUEST_METHOD']); } switch ($hash) { case 'GET': $input = $_GET; break; case 'POST': $input = $_POST; break; case 'FILES': $input = $_FILES; break; case 'COOKIE': $input = $_COOKIE; break; case 'ENV': $input = &$_ENV; break; case 'SERVER': $input = &$_SERVER; break; default: $input = $_REQUEST; break; } $result = self::_cleanVar($input, $mask); return $result; } /** * Sets a request variable. * * @param array $array An associative array of key-value pairs. * @param string $hash The request variable to set (POST, GET, FILES, METHOD). * @param boolean $overwrite If true and an existing key is found, the value is overwritten, otherwise it is ignored. * * @return void * * @deprecated 12.1 Use JInput::set() * @see JInput::set() * @since 11.1 */ public static function set($array, $hash = 'default', $overwrite = true) { foreach ($array as $key => $value) { self::setVar($key, $value, $hash, $overwrite); } } /** * Checks for a form token in the request. * * Use in conjunction with JHtml::_('form.token'). * * @param string $method The request method in which to look for the token key. * * @return boolean True if found and valid, false otherwise. * * @deprecated 12.1 Use JSession::checkToken() instead. Note that 'default' has to become 'request'. * @since 11.1 */ public static function checkToken($method = 'post') { if ($method == 'default') { $method = 'request'; } return JSession::checkToken($method); } /** * Clean up an input variable. * * @param mixed $var The input variable. * @param integer $mask Filter bit mask. * 1 = no trim: If this flag is cleared and the input is a string, the string will have leading and trailing * whitespace trimmed. * 2 = allow_raw: If set, no more filtering is performed, higher bits are ignored. * 4 = allow_html: HTML is allowed, but passed through a safe HTML filter first. If set, no more filtering * is performed. If no bits other than the 1 bit is set, a strict filter is applied. * @param string $type The variable type {@see JFilterInput::clean()}. * * @return mixed Same as $var * * @deprecated 12.1 * @since 11.1 */ protected static function _cleanVar($var, $mask = 0, $type = null) { // If the no trim flag is not set, trim the variable if (!($mask & 1) && is_string($var)) { $var = trim($var); } // Now we handle input filtering if ($mask & 2) { // If the allow raw flag is set, do not modify the variable $var = $var; } elseif ($mask & 4) { // If the allow HTML flag is set, apply a safe HTML filter to the variable $safeHtmlFilter = JFilterInput::getInstance(null, null, 1, 1); $var = $safeHtmlFilter->clean($var, $type); } else { // Since no allow flags were set, we will apply the most strict filter to the variable // $tags, $attr, $tag_method, $attr_method, $xss_auto use defaults. $noHtmlFilter = JFilterInput::getInstance(); $var = $noHtmlFilter->clean($var, $type); } return $var; } } PK���\�]c�ee#libraries/legacy/database/mysql.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLog::add('JDatabaseMysql is deprecated, use JDatabaseDriverMysql instead.', JLog::WARNING, 'deprecated'); /** * MySQL database driver * * @see http://dev.mysql.com/doc/ * @since 11.1 * @deprecated 13.1 (Platform) & 4.0 (CMS) - Use JDatabaseDriverMysql instead. */ class JDatabaseMysql extends JDatabaseDriverMysql { } PK���\P㙚��$libraries/legacy/database/sqlsrv.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLog::add('JDatabaseSqlsrv is deprecated, use JDatabaseDriverSqlsrv instead.', JLog::WARNING, 'deprecated'); /** * SQL Server database driver * * @see http://msdn.microsoft.com/en-us/library/cc296152(SQL.90).aspx * @since 11.1 * @deprecated 13.1 (Platform) & 4.0 (CMS) - Use JDatabaseDriverSqlsrv instead. */ class JDatabaseSqlsrv extends JDatabaseDriverSqlsrv { } PK���\<_p�YY'libraries/legacy/database/exception.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLog::add('JDatabaseException is deprecated, use SPL Exceptions instead.', JLog::WARNING, 'deprecated'); /** * Exception class definition for the Database subpackage. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use semantic exceptions instead */ class JDatabaseException extends RuntimeException { } PK���\f����&libraries/legacy/database/sqlazure.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLog::add('JDatabaseSqlazure is deprecated, use JDatabaseDriverSqlazure instead.', JLog::WARNING, 'deprecated'); /** * SQL Server database driver * * @see http://msdn.microsoft.com/en-us/library/ee336279.aspx * @since 11.1 * @deprecated 13.1 (Platform) & 4.0 (CMS) - Use JDatabaseDriverSqlazure instead. */ class JDatabaseSqlazure extends JDatabaseDriverSqlazure { } PK���\\yK�zz$libraries/legacy/database/mysqli.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLog::add('JDatabaseMysqli is deprecated, use JDatabaseDriverMysqli instead.', JLog::WARNING, 'deprecated'); /** * MySQLi database driver * * @see http://php.net/manual/en/book.mysqli.php * @since 11.1 * @deprecated 13.1 (Platform) & 4.0 (CMS) - Use JDatabaseDriverMysqli instead. */ class JDatabaseMysqli extends JDatabaseDriverMysqli { } PK���\��N���,libraries/legacy/form/field/modulelayout.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ 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 11.1 */ class JFormFieldModulelayout extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'ModuleLayout'; /** * Method to get the field input for module layouts. * * @return string The field input. * * @since 11.1 */ protected function getInput() { // Get the client id. $clientId = $this->element['client_id']; if (is_null($clientId) && $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 ''; } } } PK���\�yd". . (libraries/legacy/form/field/category.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Supports an HTML select list of categories * * @since 11.1 */ class JFormFieldCategory extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ 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 11.1 */ protected function getOptions() { $options = array(); $extension = $this->element['extension'] ? (string) $this->element['extension'] : (string) $this->element['scope']; $published = (string) $this->element['published']; // Load the category options for a given extension. if (!empty($extension)) { // Filter over published state or not depending upon if it is present. if ($published) { $options = JHtml::_('category.options', $extension, array('filter.published' => explode(',', $published))); } else { $options = JHtml::_('category.options', $extension); } // 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) != true) { 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; } } PK���\��D ��/libraries/legacy/form/field/componentlayout.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ 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 11.1 */ class JFormFieldComponentlayout extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'ComponentLayout'; /** * Method to get the field input for a component layout field. * * @return string The field input. * * @since 11.1 */ protected function getInput() { // Get the client id. $clientId = $this->element['client_id']; if (is_null($clientId) && $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 ($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))) { // Files with corresponding XML files are alternate menu items, not alternate layout files // so we need to exclude these files from the list. $xml_files = JFolder::files($template_path, '^[^_]*\.xml$', false, true); for ($j = 0, $count = count($xml_files); $j < $count; $j++) { $xml_files[$j] = basename($xml_files[$j], '.xml'); } foreach ($files as $i => $file) { // Remove layout files that exist in the component folder or that have XML files if ((in_array(basename($file, '.php'), $component_layouts)) || (in_array(basename($file, '.php'), $xml_files))) { 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 ''; } } } PK���\�\R���!libraries/legacy/access/rules.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Access * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Deprecated class placeholder. You should use JAccessRules instead. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) * @codeCoverageIgnore */ class JRules extends JAccessRules { /** * Constructor. * * The input array must be in the form: array('action' => array(-42 => true, 3 => true, 4 => false)) * or an equivalent JSON encoded string, or an object where properties are arrays. * * @param mixed $input A JSON format string (probably from the database) or a nested array. * * @since 11.1 * @deprecated 12.3 */ public function __construct($input = '') { JLog::add('JRules is deprecated. Use JAccessRules instead.', JLog::WARNING, 'deprecated'); parent::__construct($input); } } PK���\���2�� libraries/legacy/access/rule.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Access * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Deprecated class placeholder. You should use JAccessRule instead. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) * @codeCoverageIgnore */ class JRule extends JAccessRule { /** * Constructor. * * The input array must be in the form: array(-42 => true, 3 => true, 4 => false) * or an equivalent JSON encoded string. * * @param mixed $identities A JSON format string (probably from the database) or a named array. * * @since 11.1 * @deprecated 12.3 */ public function __construct($identities) { JLog::add('JRule is deprecated. Use JAccessRule instead.', JLog::WARNING, 'deprecated'); parent::__construct($identities); } } PK���\+��ee&libraries/legacy/simplepie/factory.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Simplepie * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('simplepie.simplepie'); /** * Class to maintain a pathway. * * The user's navigated path within the application. * * @since 12.2 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JFeed or supply your own methods */ class JSimplepieFactory { /** * Get a parsed XML Feed Source * * @param string $url Url for feed source. * @param integer $cache_time Time to cache feed for (using internal cache mechanism). * * @return mixed SimplePie parsed object on success, false on failure. * * @since 12.2 * @deprecated 4.0 Use JFeedFactory($url) instead. * * @note In 3.2 will be proxied to JFeedFactory() */ public static function getFeedParser($url, $cache_time = 0) { JLog::add(__METHOD__ . ' is deprecated. Use JFeedFactory() or supply Simple Pie instead.', JLog::WARNING, 'deprecated'); $cache = JFactory::getCache('feed_parser', 'callback'); if ($cache_time > 0) { $cache->setLifeTime($cache_time); } $simplepie = new SimplePie(null, null, 0); $simplepie->enable_cache(false); $simplepie->set_feed_url($url); $simplepie->force_feed(true); $contents = $cache->get(array($simplepie, 'init'), null, false, false); if ($contents) { return $simplepie; } JLog::add(JText::_('JLIB_UTIL_ERROR_LOADING_FEED_DATA'), JLog::WARNING, 'jerror'); return false; } } PK���\��+&�\�\ libraries/legacy/error/error.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Error * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; // Error Definition: Illegal Options const JERROR_ILLEGAL_OPTIONS = 1; // Error Definition: Callback does not exist const JERROR_CALLBACK_NOT_CALLABLE = 2; // Error Definition: Illegal Handler const JERROR_ILLEGAL_MODE = 3; /** * Error Handling Class * * This class is inspired in design and concept by patErrorManager <http://www.php-tools.net> * * patErrorManager contributors include: * - gERD Schaufelberger <gerd@php-tools.net> * - Sebastian Mordziol <argh@php-tools.net> * - Stephan Schmidt <scst@php-tools.net> * * @since 11.1 * @deprecated 12.1 (Platform) & 4.0 (CMS) - Use PHP Exception */ abstract class JError { /** * Legacy error handling marker * * @var boolean True to enable legacy error handling using JError, false to use exception handling. This flag * is present to allow an easy transition into exception handling for code written against the * existing JError API in Joomla. * @since 11.1 */ public static $legacy = false; /** * Array of message levels * * @var array * @since 11.1 */ protected static $levels = array(E_NOTICE => 'Notice', E_WARNING => 'Warning', E_ERROR => 'Error'); /** * Array of message handlers * @var array * @since 11.1 */ protected static $handlers = array( E_NOTICE => array('mode' => 'ignore'), E_WARNING => array('mode' => 'ignore'), E_ERROR => array('mode' => 'ignore') ); /** * Array containing the error stack * * @var array * @since 11.1 */ protected static $stack = array(); /** * Method to determine if a value is an exception object. * * @param mixed $object Object to check. * * @return boolean True if argument is an exception, false otherwise. * * @deprecated 12.1 * @since 11.1 */ public static function isError($object) { JLog::add('JError::isError() is deprecated.', JLog::WARNING, 'deprecated'); return $object instanceof Exception; } /** * Method for retrieving the last exception object in the error stack * * @param boolean $unset True to remove the error from the stack. * * @return mixed Last exception object in the error stack or boolean false if none exist * * @deprecated 12.1 * @since 11.1 */ public static function getError($unset = false) { JLog::add('JError::getError() is deprecated.', JLog::WARNING, 'deprecated'); if (!isset(self::$stack[0])) { return false; } if ($unset) { $error = array_shift(self::$stack); } else { $error = &self::$stack[0]; } return $error; } /** * Method for retrieving the exception stack * * @return array Chronological array of errors that have been stored during script execution * * @deprecated 12.1 * @since 11.1 */ public static function getErrors() { JLog::add('JError::getErrors() is deprecated.', JLog::WARNING, 'deprecated'); return self::$stack; } /** * Method to add non-JError thrown JExceptions to the JError stack for debugging purposes * * @param JException &$e Add an exception to the stack. * * @return void * * @since 11.1 * @deprecated 12.1 */ public static function addToStack(JException &$e) { JLog::add('JError::addToStack() is deprecated.', JLog::WARNING, 'deprecated'); self::$stack[] = &$e; } /** * Create a new JException object given the passed arguments * * @param integer $level The error level - use any of PHP's own error levels for * this: E_ERROR, E_WARNING, E_NOTICE, E_USER_ERROR, * E_USER_WARNING, E_USER_NOTICE. * @param string $code The application-internal error code for this error * @param string $msg The error message, which may also be shown the user if need be. * @param mixed $info Optional: Additional error information (usually only * developer-relevant information that the user should never see, * like a database DSN). * @param boolean $backtrace Add a stack backtrace to the exception. * * @return mixed The JException object * * @since 11.1 * @deprecated 12.1 Use PHP Exception * @see JException */ public static function raise($level, $code, $msg, $info = null, $backtrace = false) { JLog::add('JError::raise() is deprecated.', JLog::WARNING, 'deprecated'); // Build error object $exception = new JException($msg, $code, $level, $info, $backtrace); return self::throwError($exception); } /** * Throw an error * * @param object &$exception An exception to throw. * * @return reference * * @deprecated 12.1 Use PHP Exception * @see JException * @since 11.1 */ public static function throwError(&$exception) { JLog::add('JError::throwError() is deprecated.', JLog::WARNING, 'deprecated'); static $thrown = false; // If thrown is hit again, we've come back to JError in the middle of throwing another JError, so die! if ($thrown) { self::handleEcho($exception, array()); // Inifite loop. jexit(); } $thrown = true; $level = $exception->get('level'); // See what to do with this kind of error $handler = self::getErrorHandling($level); $function = 'handle' . ucfirst($handler['mode']); if (is_callable(array('JError', $function))) { $reference = call_user_func_array(array('JError', $function), array(&$exception, (isset($handler['options'])) ? $handler['options'] : array())); } else { // This is required to prevent a very unhelpful white-screen-of-death jexit( 'JError::raise -> Static method JError::' . $function . ' does not exist. Contact a developer to debug' . '<br /><strong>Error was</strong> <br />' . $exception->getMessage() ); } // We don't need to store the error, since JException already does that for us! // Remove loop check $thrown = false; return $reference; } /** * Wrapper method for the raise() method with predefined error level of E_ERROR and backtrace set to true. * * @param string $code The application-internal error code for this error * @param string $msg The error message, which may also be shown the user if need be. * @param mixed $info Optional: Additional error information (usually only * developer-relevant information that the user should * never see, like a database DSN). * * @return object $error The configured JError object * * @deprecated 12.1 Use PHP Exception * @see JError::raise() * @since 11.1 */ public static function raiseError($code, $msg, $info = null) { JLog::add('JError::raiseError() is deprecated.', JLog::WARNING, 'deprecated'); return self::raise(E_ERROR, $code, $msg, $info, true); } /** * Wrapper method for the {@link raise()} method with predefined error level of E_WARNING and * backtrace set to false. * * @param string $code The application-internal error code for this error * @param string $msg The error message, which may also be shown the user if need be. * @param mixed $info Optional: Additional error information (usually only * developer-relevant information that * the user should never see, like a database DSN). * * @return object The configured JError object * * @deprecated 12.1 Use PHP Exception * @see JError::raise() * @since 11.1 */ public static function raiseWarning($code, $msg, $info = null) { JLog::add('JError::raiseWarning() is deprecated.', JLog::WARNING, 'deprecated'); return self::raise(E_WARNING, $code, $msg, $info); } /** * Wrapper method for the {@link raise()} method with predefined error * level of E_NOTICE and backtrace set to false. * * @param string $code The application-internal error code for this error * @param string $msg The error message, which may also be shown the user if need be. * @param mixed $info Optional: Additional error information (usually only * developer-relevant information that the user * should never see, like a database DSN). * * @return object The configured JError object * * @deprecated 12.1 Use PHP Exception * @see raise() * @since 11.1 */ public static function raiseNotice($code, $msg, $info = null) { JLog::add('JError::raiseNotice() is deprecated.', JLog::WARNING, 'deprecated'); return self::raise(E_NOTICE, $code, $msg, $info); } /** * Method to get the current error handler settings for a specified error level. * * @param integer $level The error level to retrieve. This can be any of PHP's * own error levels, e.g. E_ALL, E_NOTICE... * * @return array All error handling details * * @deprecated 12.1 Use PHP Exception * @since 11.1 */ public static function getErrorHandling($level) { JLog::add('JError::getErrorHandling() is deprecated.', JLog::WARNING, 'deprecated'); return self::$handlers[$level]; } /** * Method to set the way the JError will handle different error levels. Use this if you want to override the default settings. * * Error handling modes: * - ignore * - echo * - verbose * - die * - message * - log * - callback * * You may also set the error handling for several modes at once using PHP's bit operations. * Examples: * - E_ALL = Set the handling for all levels * - E_ERROR | E_WARNING = Set the handling for errors and warnings * - E_ALL ^ E_ERROR = Set the handling for all levels except errors * * @param integer $level The error level for which to set the error handling * @param string $mode The mode to use for the error handling. * @param mixed $options Optional: Any options needed for the given mode. * * @return mixed True on success or a JException object if failed. * * @deprecated 12.1 Use PHP Exception * @since 11.1 */ public static function setErrorHandling($level, $mode, $options = null) { JLog::add('JError::setErrorHandling() is deprecated.', JLog::WARNING, 'deprecated'); $levels = self::$levels; $function = 'handle' . ucfirst($mode); if (!is_callable(array('JError', $function))) { return self::raiseError(E_ERROR, 'JError:' . JERROR_ILLEGAL_MODE, 'Error Handling mode is not known', 'Mode: ' . $mode . ' is not implemented.'); } foreach ($levels as $eLevel => $eTitle) { if (($level & $eLevel) != $eLevel) { continue; } // Set callback options if ($mode == 'callback') { if (!is_array($options)) { return self::raiseError(E_ERROR, 'JError:' . JERROR_ILLEGAL_OPTIONS, 'Options for callback not valid'); } if (!is_callable($options)) { $tmp = array('GLOBAL'); if (is_array($options)) { $tmp[0] = $options[0]; $tmp[1] = $options[1]; } else { $tmp[1] = $options; } return self::raiseError( E_ERROR, 'JError:' . JERROR_CALLBACK_NOT_CALLABLE, 'Function is not callable', 'Function:' . $tmp[1] . ' scope ' . $tmp[0] . '.' ); } } // Save settings self::$handlers[$eLevel] = array('mode' => $mode); if ($options != null) { self::$handlers[$eLevel]['options'] = $options; } } return true; } /** * Method that attaches the error handler to JError * * @return void * * @deprecated 12.1 * @see set_error_handler * @since 11.1 */ public static function attachHandler() { JLog::add('JError::getErrorHandling() is deprecated.', JLog::WARNING, 'deprecated'); set_error_handler(array('JError', 'customErrorHandler')); } /** * Method that detaches the error handler from JError * * @return void * * @deprecated 12.1 * @see restore_error_handler * @since 11.1 */ public static function detachHandler() { JLog::add('JError::detachHandler() is deprecated.', JLog::WARNING, 'deprecated'); restore_error_handler(); } /** * Method to register a new error level for handling errors * * This allows you to add custom error levels to the built-in * - E_NOTICE * - E_WARNING * - E_NOTICE * * @param integer $level Error level to register * @param string $name Human readable name for the error level * @param string $handler Error handler to set for the new error level [optional] * * @return boolean True on success; false if the level already has been registered * * @deprecated 12.1 * @since 11.1 */ public static function registerErrorLevel($level, $name, $handler = 'ignore') { JLog::add('JError::registerErrorLevel() is deprecated.', JLog::WARNING, 'deprecated'); if (isset(self::$levels[$level])) { return false; } self::$levels[$level] = $name; self::setErrorHandling($level, $handler); return true; } /** * Translate an error level integer to a human readable string * e.g. E_ERROR will be translated to 'Error' * * @param integer $level Error level to translate * * @return mixed Human readable error level name or boolean false if it doesn't exist * * @deprecated 12.1 * @since 11.1 */ public static function translateErrorLevel($level) { JLog::add('JError::translateErrorLevel() is deprecated.', JLog::WARNING, 'deprecated'); if (isset(self::$levels[$level])) { return self::$levels[$level]; } return false; } /** * Ignore error handler * - Ignores the error * * @param object &$error Exception object to handle * @param array $options Handler options * * @return object The exception object * * @deprecated 12.1 * @see JError::raise() * @since 11.1 */ public static function handleIgnore(&$error, $options) { JLog::add('JError::handleIgnore() is deprecated.', JLog::WARNING, 'deprecated'); return $error; } /** * Echo error handler * - Echos the error message to output * * @param object &$error Exception object to handle * @param array $options Handler options * * @return object The exception object * * @deprecated 12.1 * @see JError::raise() * @since 11.1 */ public static function handleEcho(&$error, $options) { JLog::add('JError::handleEcho() is deprecated.', JLog::WARNING, 'deprecated'); $level_human = self::translateErrorLevel($error->get('level')); // If system debug is set, then output some more information. if (JDEBUG) { $backtrace = $error->getTrace(); $trace = ''; for ($i = count($backtrace) - 1; $i >= 0; $i--) { if (isset($backtrace[$i]['class'])) { $trace .= sprintf("\n%s %s %s()", $backtrace[$i]['class'], $backtrace[$i]['type'], $backtrace[$i]['function']); } else { $trace .= sprintf("\n%s()", $backtrace[$i]['function']); } if (isset($backtrace[$i]['file'])) { $trace .= sprintf(' @ %s:%d', $backtrace[$i]['file'], $backtrace[$i]['line']); } } } if (isset($_SERVER['HTTP_HOST'])) { // Output as html echo "<br /><b>jos-$level_human</b>: " . $error->get('message') . "<br />\n" . (JDEBUG ? nl2br($trace) : ''); } else { // Output as simple text if (defined('STDERR')) { fwrite(STDERR, "J$level_human: " . $error->get('message') . "\n"); if (JDEBUG) { fwrite(STDERR, $trace); } } else { echo "J$level_human: " . $error->get('message') . "\n"; if (JDEBUG) { echo $trace; } } } return $error; } /** * Verbose error handler * - Echos the error message to output as well as related info * * @param object &$error Exception object to handle * @param array $options Handler options * * @return object The exception object * * @deprecated 12.1 * @see JError::raise() * @since 11.1 */ public static function handleVerbose(&$error, $options) { JLog::add('JError::handleVerbose() is deprecated.', JLog::WARNING, 'deprecated'); $level_human = self::translateErrorLevel($error->get('level')); $info = $error->get('info'); if (isset($_SERVER['HTTP_HOST'])) { // Output as html echo "<br /><b>J$level_human</b>: " . $error->get('message') . "<br />\n"; if ($info != null) { echo "   " . $info . "<br />\n"; } echo $error->getBacktrace(true); } else { // Output as simple text echo "J$level_human: " . $error->get('message') . "\n"; if ($info != null) { echo "\t" . $info . "\n"; } } return $error; } /** * Die error handler * - Echos the error message to output and then dies * * @param object &$error Exception object to handle * @param array $options Handler options * * @return object The exception object * * @deprecated 12.1 * @see JError::raise() * @since 11.1 */ public static function handleDie(&$error, $options) { JLog::add('JError::handleDie() is deprecated.', JLog::WARNING, 'deprecated'); $level_human = self::translateErrorLevel($error->get('level')); if (isset($_SERVER['HTTP_HOST'])) { // Output as html jexit("<br /><b>J$level_human</b>: " . $error->get('message') . "<br />\n"); } else { // Output as simple text if (defined('STDERR')) { fwrite(STDERR, "J$level_human: " . $error->get('message') . "\n"); jexit(); } else { jexit("J$level_human: " . $error->get('message') . "\n"); } } return $error; } /** * Message error handler * Enqueues the error message into the system queue * * @param object &$error Exception object to handle * @param array $options Handler options * * @return object The exception object * * @deprecated 12.1 * @see JError::raise() * @since 11.1 */ public static function handleMessage(&$error, $options) { JLog::add('JError::hanleMessage() is deprecated.', JLog::WARNING, 'deprecated'); $appl = JFactory::getApplication(); $type = ($error->get('level') == E_NOTICE) ? 'notice' : 'error'; $appl->enqueueMessage($error->get('message'), $type); return $error; } /** * Log error handler * Logs the error message to a system log file * * @param object &$error Exception object to handle * @param array $options Handler options * * @return object The exception object * * @deprecated 12.1 * @see JError::raise() * @since 11.1 */ public static function handleLog(&$error, $options) { JLog::add('JError::handleLog() is deprecated.', JLog::WARNING, 'deprecated'); static $log; if ($log == null) { $options['text_file'] = date('Y-m-d') . '.error.log'; $options['format'] = "{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}"; JLog::addLogger($options, JLog::ALL, array('error')); } $entry = new JLogEntry( str_replace(array("\r", "\n"), array('', '\\n'), $error->get('message')), $error->get('level'), 'error' ); $entry->code = $error->get('code'); JLog::add($entry); return $error; } /** * Callback error handler * - Send the error object to a callback method for error handling * * @param object &$error Exception object to handle * @param array $options Handler options * * @return object The exception object * * @deprecated 12.1 * @see JError::raise() * @since 11.1 */ public static function handleCallback(&$error, $options) { JLog::add('JError::handleCallback() is deprecated.', JLog::WARNING, 'deprecated'); return call_user_func($options, $error); } /** * Display a custom error page and exit gracefully * * @param object &$error Exception object * * @return void * * @deprecated 12.1 * @since 11.1 */ public static function customErrorPage(&$error) { JLog::add('JError::customErrorPage() is deprecated.', JLog::WARNING, 'deprecated'); $app = JFactory::getApplication(); $document = JDocument::getInstance('error'); if ($document) { $config = JFactory::getConfig(); // Get the current template from the application $template = $app->getTemplate(); // Push the error object into the document $document->setError($error); // If site is offline and it's a 404 error, just go to index (to see offline message, instead of 404) if ($error->getCode() == '404' && JFactory::getConfig()->get('offline') == 1) { JFactory::getApplication()->redirect('index.php'); } @ob_end_clean(); $document->setTitle(JText::_('Error') . ': ' . $error->getCode()); $data = $document->render(false, array('template' => $template, 'directory' => JPATH_THEMES, 'debug' => $config->get('debug'))); // Failsafe to get the error displayed. if (empty($data)) { self::handleEcho($error, array()); } else { // Do not allow cache $app->allowCache(false); $app->setBody($data); echo $app->toString(); } } else { // Just echo the error since there is no document // This is a common use case for Command Line Interface applications. self::handleEcho($error, array()); } $app->close(0); } /** * Display a message to the user * * @param integer $level The error level - use any of PHP's own error levels * for this: E_ERROR, E_WARNING, E_NOTICE, E_USER_ERROR, * E_USER_WARNING, E_USER_NOTICE. * @param string $msg Error message, shown to user if need be. * * @return void * * @deprecated 12.1 * @since 11.1 */ public static function customErrorHandler($level, $msg) { JLog::add('JError::customErrorHandler() is deprecated.', JLog::WARNING, 'deprecated'); self::raise($level, '', $msg); } /** * Render the backtrace * * @param integer $error The error * * @return string Contents of the backtrace * * @deprecated 12.1 * @since 11.1 */ public static function renderBacktrace($error) { JLog::add('JError::renderBacktrace() is deprecated.', JLog::WARNING, 'deprecated'); $contents = null; $backtrace = $error->getTrace(); if (is_array($backtrace)) { ob_start(); $j = 1; echo '<table cellpadding="0" cellspacing="0" class="Table">'; echo ' <tr>'; echo ' <td colspan="3" class="TD"><strong>Call stack</strong></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td class="TD"><strong>#</strong></td>'; echo ' <td class="TD"><strong>Function</strong></td>'; echo ' <td class="TD"><strong>Location</strong></td>'; echo ' </tr>'; for ($i = count($backtrace) - 1; $i >= 0; $i--) { echo ' <tr>'; echo ' <td class="TD">' . $j . '</td>'; if (isset($backtrace[$i]['class'])) { echo ' <td class="TD">' . $backtrace[$i]['class'] . $backtrace[$i]['type'] . $backtrace[$i]['function'] . '()</td>'; } else { echo ' <td class="TD">' . $backtrace[$i]['function'] . '()</td>'; } if (isset($backtrace[$i]['file'])) { echo ' <td class="TD">' . $backtrace[$i]['file'] . ':' . $backtrace[$i]['line'] . '</td>'; } else { echo ' <td class="TD"> </td>'; } echo ' </tr>'; $j++; } echo '</table>'; $contents = ob_get_contents(); ob_end_clean(); } return $contents; } } PK���\���;;,libraries/legacy/simplecrypt/simplecrypt.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Simplecrypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JSimpleCrypt is a very simple encryption algorithm for encrypting/decrypting strings * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JCrypt instead. */ class JSimplecrypt { /** * Encryption/Decryption Key * * @var JCrypt * @since 12.1 * @deprecated 12.3 Use JCrypt instead. */ private $_crypt; /** * Object Constructor takes an optional key to be used for encryption/decryption. If no key is given then the * secret word from the configuration object is used. * * @param string $privateKey Optional encryption key * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ public function __construct($privateKey = null) { JLog::add('JSimpleCrypt is deprecated. Use JCrypt instead.', JLog::WARNING, 'deprecated'); if (empty($privateKey)) { $privateKey = md5(JFactory::getConfig()->get('secret')); } // Build the JCryptKey object. $key = new JCryptKey('simple', $privateKey, $privateKey); // Setup the JCrypt object. $this->_crypt = new JCrypt(new JCryptCipherSimple, $key); } /** * Decrypt a string * * @param string $s String to decrypt * * @return string * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ public function decrypt($s) { return $this->_crypt->decrypt($s); } /** * Encrypt a string * * @param string $s String to encrypt * * @return string * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ public function encrypt($s) { return $this->_crypt->encrypt($s); } } PK���\`���Y Y libraries/legacy/model/form.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Model * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Prototype form model. * * @see JForm * @see JFormField * @see JFormRule * @since 12.2 */ abstract class JModelForm extends JModelLegacy { /** * Array of form objects. * * @var array * @since 12.2 */ protected $_forms = array(); /** * Method to checkin a row. * * @param integer $pk The numeric id of the primary key. * * @return boolean False on failure or error, true otherwise. * * @since 12.2 */ public function checkin($pk = null) { // Only attempt to check the row in if it exists. if ($pk) { $user = JFactory::getUser(); // Get an instance of the row to checkin. $table = $this->getTable(); if (!$table->load($pk)) { $this->setError($table->getError()); return false; } // If there is no checked_out or checked_out_time field, just return true. if (!property_exists($table, 'checked_out') || !property_exists($table, 'checked_out_time')) { return true; } // Check if this is the user having previously checked out the row. if ($table->checked_out > 0 && $table->checked_out != $user->get('id') && !$user->authorise('core.admin', 'com_checkin')) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_CHECKIN_USER_MISMATCH')); return false; } // Attempt to check the row in. if (!$table->checkin($pk)) { $this->setError($table->getError()); return false; } } return true; } /** * Method to check-out a row for editing. * * @param integer $pk The numeric id of the primary key. * * @return boolean False on failure or error, true otherwise. * * @since 12.2 */ public function checkout($pk = null) { // Only attempt to check the row in if it exists. if ($pk) { // Get an instance of the row to checkout. $table = $this->getTable(); if (!$table->load($pk)) { $this->setError($table->getError()); return false; } // If there is no checked_out or checked_out_time field, just return true. if (!property_exists($table, 'checked_out') || !property_exists($table, 'checked_out_time')) { return true; } $user = JFactory::getUser(); // Check if this is the user having previously checked out the row. if ($table->checked_out > 0 && $table->checked_out != $user->get('id')) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_CHECKOUT_USER_MISMATCH')); return false; } // Attempt to check the row out. if (!$table->checkout($user->get('id'), $pk)) { $this->setError($table->getError()); return false; } } return true; } /** * Abstract method for getting the form from the model. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return mixed A JForm object on success, false on failure * * @since 12.2 */ abstract public function getForm($data = array(), $loadData = true); /** * Method to get a form object. * * @param string $name The name of the form. * @param string $source The form source. Can be XML string if file flag is set to false. * @param array $options Optional array of options for the form creation. * @param boolean $clear Optional argument to force load a new form. * @param string $xpath An optional xpath to search for the fields. * * @return mixed JForm object on success, False on error. * * @see JForm * @since 12.2 */ protected function loadForm($name, $source = null, $options = array(), $clear = false, $xpath = false) { // Handle the optional arguments. $options['control'] = JArrayHelper::getValue($options, 'control', false); // Create a signature hash. $hash = md5($source . serialize($options)); // Check if we can use a previously loaded form. if (isset($this->_forms[$hash]) && !$clear) { return $this->_forms[$hash]; } // Get the form. JForm::addFormPath(JPATH_COMPONENT . '/models/forms'); JForm::addFieldPath(JPATH_COMPONENT . '/models/fields'); JForm::addFormPath(JPATH_COMPONENT . '/model/form'); JForm::addFieldPath(JPATH_COMPONENT . '/model/field'); try { $form = JForm::getInstance($name, $source, $options, false, $xpath); if (isset($options['load_data']) && $options['load_data']) { // Get the data for the form. $data = $this->loadFormData(); } else { $data = array(); } // Allow for additional modification of the form, and events to be triggered. // We pass the data because plugins may require it. $this->preprocessForm($form, $data); // Load the data into the form after the plugins have operated. $form->bind($data); } catch (Exception $e) { $this->setError($e->getMessage()); return false; } // Store the form for later. $this->_forms[$hash] = $form; return $form; } /** * Method to get the data that should be injected in the form. * * @return array The default data is an empty array. * * @since 12.2 */ protected function loadFormData() { return array(); } /** * Method to allow derived classes to preprocess the data. * * @param string $context The context identifier. * @param mixed &$data The data to be processed. It gets altered directly. * * @return void * * @since 3.1 */ protected function preprocessData($context, &$data) { // Get the dispatcher and load the users plugins. $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('content'); // Trigger the data preparation event. $results = $dispatcher->trigger('onContentPrepareData', array($context, $data)); // Check for errors encountered while preparing the data. if (count($results) > 0 && in_array(false, $results, true)) { $this->setError($dispatcher->getError()); } } /** * Method to allow derived classes to preprocess the form. * * @param JForm $form A JForm object. * @param mixed $data The data expected for the form. * @param string $group The name of the plugin group to import (defaults to "content"). * * @return void * * @see JFormField * @since 12.2 * @throws Exception if there is an error in the form event. */ protected function preprocessForm(JForm $form, $data, $group = 'content') { // Import the appropriate plugin group. JPluginHelper::importPlugin($group); // Get the dispatcher. $dispatcher = JEventDispatcher::getInstance(); // Trigger the form preparation event. $results = $dispatcher->trigger('onContentPrepareForm', array($form, $data)); // Check for errors encountered while preparing the form. if (count($results) && in_array(false, $results, true)) { // Get the last error. $error = $dispatcher->getError(); if (!($error instanceof Exception)) { throw new Exception($error); } } } /** * Method to validate the form data. * * @param JForm $form The form to validate against. * @param array $data The data to validate. * @param string $group The name of the field group to validate. * * @return mixed Array of filtered data if valid, false otherwise. * * @see JFormRule * @see JFilterInput * @since 12.2 */ public function validate($form, $data, $group = null) { // Filter and validate the form data. $data = $form->filter($data); $return = $form->validate($data, $group); // Check for an error. if ($return instanceof Exception) { $this->setError($return->getMessage()); return false; } // Check the validation results. if ($return === false) { // Get the validation messages from the form. foreach ($form->getErrors() as $message) { $this->setError($message); } return false; } // Tags B/C break at 3.1.2 if (isset($data['metadata']['tags']) && !isset($data['tags'])) { $data['tags'] = $data['metadata']['tags']; } return $data; } } PK���\�V{��~�~ libraries/legacy/model/admin.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Model * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Prototype admin model. * * @since 12.2 */ abstract class JModelAdmin extends JModelForm { /** * The prefix to use with controller messages. * * @var string * @since 12.2 */ protected $text_prefix = null; /** * The event to trigger after deleting the data. * * @var string * @since 12.2 */ protected $event_after_delete = null; /** * The event to trigger after saving the data. * * @var string * @since 12.2 */ protected $event_after_save = null; /** * The event to trigger before deleting the data. * * @var string * @since 12.2 */ protected $event_before_delete = null; /** * The event to trigger before saving the data. * * @var string * @since 12.2 */ protected $event_before_save = null; /** * The event to trigger after changing the published state of the data. * * @var string * @since 12.2 */ protected $event_change_state = null; /** * Maps events to plugin groups. * * @var array */ protected $events_map = null; /** * Batch copy/move command. If set to false, * the batch copy/move command is not supported * * @var string */ protected $batch_copymove = 'category_id'; /** * Allowed batch commands * * @var array */ protected $batch_commands = array( 'assetgroup_id' => 'batchAccess', 'language_id' => 'batchLanguage', 'tag' => 'batchTag' ); /** * The context used for the associations table * * @var string * @since 3.4.4 */ protected $associationsContext = null; /** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @see JModelLegacy * @since 12.2 */ public function __construct($config = array()) { parent::__construct($config); if (isset($config['event_after_delete'])) { $this->event_after_delete = $config['event_after_delete']; } elseif (empty($this->event_after_delete)) { $this->event_after_delete = 'onContentAfterDelete'; } if (isset($config['event_after_save'])) { $this->event_after_save = $config['event_after_save']; } elseif (empty($this->event_after_save)) { $this->event_after_save = 'onContentAfterSave'; } if (isset($config['event_before_delete'])) { $this->event_before_delete = $config['event_before_delete']; } elseif (empty($this->event_before_delete)) { $this->event_before_delete = 'onContentBeforeDelete'; } if (isset($config['event_before_save'])) { $this->event_before_save = $config['event_before_save']; } elseif (empty($this->event_before_save)) { $this->event_before_save = 'onContentBeforeSave'; } if (isset($config['event_change_state'])) { $this->event_change_state = $config['event_change_state']; } elseif (empty($this->event_change_state)) { $this->event_change_state = 'onContentChangeState'; } $config['events_map'] = isset($config['events_map']) ? $config['events_map'] : array(); $this->events_map = array_merge( array( 'delete' => 'content', 'save' => 'content', 'change_state' => 'content' ), $config['events_map'] ); // Guess the JText message prefix. Defaults to the option. if (isset($config['text_prefix'])) { $this->text_prefix = strtoupper($config['text_prefix']); } elseif (empty($this->text_prefix)) { $this->text_prefix = strtoupper($this->option); } } /** * Method to perform batch operations on an item or a set of items. * * @param array $commands An array of commands to perform. * @param array $pks An array of item ids. * @param array $contexts An array of item contexts. * * @return boolean Returns true on success, false on failure. * * @since 12.2 */ public function batch($commands, $pks, $contexts) { // Sanitize ids. $pks = array_unique($pks); JArrayHelper::toInteger($pks); // Remove any values of zero. if (array_search(0, $pks, true)) { unset($pks[array_search(0, $pks, true)]); } if (empty($pks)) { $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); return false; } $done = false; // Set some needed variables. $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); $this->contentType = new JUcmType; $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->batchSet = true; if ($this->type == false) { $type = new JUcmType; $this->type = $type->getTypeByAlias($this->typeAlias); } $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); if ($this->batch_copymove && !empty($commands[$this->batch_copymove])) { $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c'); if ($cmd == 'c') { $result = $this->batchCopy($commands[$this->batch_copymove], $pks, $contexts); if (is_array($result)) { foreach ($result as $old => $new) { $contexts[$new] = $contexts[$old]; } $pks = array_values($result); } else { return false; } } elseif ($cmd == 'm' && !$this->batchMove($commands[$this->batch_copymove], $pks, $contexts)) { return false; } $done = true; } foreach ($this->batch_commands as $identifier => $command) { if (strlen($commands[$identifier]) > 0) { if (!$this->$command($commands[$identifier], $pks, $contexts)) { return false; } $done = true; } } if (!$done) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); return false; } // Clear the cache $this->cleanCache(); return true; } /** * Batch access level changes for a group of rows. * * @param integer $value The new value matching an Asset Group ID. * @param array $pks An array of row IDs. * @param array $contexts An array of item contexts. * * @return boolean True if successful, false otherwise and internal error is set. * * @since 12.2 */ protected function batchAccess($value, $pks, $contexts) { if (empty($this->batchSet)) { // Set some needed variables. $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); $this->contentType = new JUcmType; $this->type = $this->contentType->getTypeByTable($this->tableClassName); } foreach ($pks as $pk) { if ($this->user->authorise('core.edit', $contexts[$pk])) { $this->table->reset(); $this->table->load($pk); $this->table->access = (int) $value; if (!empty($this->type)) { $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); } if (!$this->table->store()) { $this->setError($this->table->getError()); return false; } } else { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); return false; } } // Clean the cache $this->cleanCache(); return true; } /** * Batch copy items to a new category or current. * * @param integer $value The new category. * @param array $pks An array of row IDs. * @param array $contexts An array of item contexts. * * @return mixed An array of new IDs on success, boolean false on failure. * * @since 12.2 */ protected function batchCopy($value, $pks, $contexts) { if (empty($this->batchSet)) { // Set some needed variables. $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); $this->contentType = new JUcmType; $this->type = $this->contentType->getTypeByTable($this->tableClassName); } $categoryId = $value; if (!static::checkCategoryId($categoryId)) { return false; } $newIds = array(); // Parent exists so let's proceed while (!empty($pks)) { // Pop the first ID off the stack $pk = array_shift($pks); $this->table->reset(); // Check that the row actually exists if (!$this->table->load($pk)) { if ($error = $this->table->getError()) { // Fatal error $this->setError($error); return false; } else { // Not fatal error $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); continue; } } static::generateTitle($categoryId, $this->table); // Reset the ID because we are making a copy $this->table->id = 0; // Unpublish because we are making a copy if (isset($this->table->published)) { $this->table->published = 0; } elseif (isset($this->table->state)) { $this->table->state = 0; } // New category ID $this->table->catid = $categoryId; // TODO: Deal with ordering? // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) { $this->setError($this->table->getError()); return false; } if (!empty($this->type)) { $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); } // Store the row. if (!$this->table->store()) { $this->setError($this->table->getError()); return false; } // Get the new item ID $newId = $this->table->get('id'); // Add the new ID to the array $newIds[$pk] = $newId; } // Clean the cache $this->cleanCache(); return $newIds; } /** * Batch language changes for a group of rows. * * @param string $value The new value matching a language. * @param array $pks An array of row IDs. * @param array $contexts An array of item contexts. * * @return boolean True if successful, false otherwise and internal error is set. * * @since 11.3 */ protected function batchLanguage($value, $pks, $contexts) { if (empty($this->batchSet)) { // Set some needed variables. $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); $this->contentType = new JUcmType; $this->type = $this->contentType->getTypeByTable($this->tableClassName); } foreach ($pks as $pk) { if ($this->user->authorise('core.edit', $contexts[$pk])) { $this->table->reset(); $this->table->load($pk); $this->table->language = $value; if (!empty($this->type)) { $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); } if (!$this->table->store()) { $this->setError($this->table->getError()); return false; } } else { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); return false; } } // Clean the cache $this->cleanCache(); return true; } /** * Batch move items to a new category * * @param integer $value The new category ID. * @param array $pks An array of row IDs. * @param array $contexts An array of item contexts. * * @return boolean True if successful, false otherwise and internal error is set. * * @since 12.2 */ protected function batchMove($value, $pks, $contexts) { if (empty($this->batchSet)) { // Set some needed variables. $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); $this->contentType = new JUcmType; $this->type = $this->contentType->getTypeByTable($this->tableClassName); } $categoryId = (int) $value; if (!static::checkCategoryId($categoryId)) { return false; } // Parent exists so we proceed foreach ($pks as $pk) { if (!$this->user->authorise('core.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); return false; } // Check that the row actually exists if (!$this->table->load($pk)) { if ($error = $this->table->getError()) { // Fatal error $this->setError($error); return false; } else { // Not fatal error $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); continue; } } // Set the new category ID $this->table->catid = $categoryId; // Check the row. if (!$this->table->check()) { $this->setError($this->table->getError()); return false; } if (!empty($this->type)) { $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); } // Store the row. if (!$this->table->store()) { $this->setError($this->table->getError()); return false; } } // Clean the cache $this->cleanCache(); return true; } /** * Batch tag a list of item. * * @param integer $value The value of the new tag. * @param array $pks An array of row IDs. * @param array $contexts An array of item contexts. * * @return void. * * @since 3.1 */ protected function batchTag($value, $pks, $contexts) { // Set the variables $user = JFactory::getUser(); $table = $this->getTable(); foreach ($pks as $pk) { if ($user->authorise('core.edit', $contexts[$pk])) { $table->reset(); $table->load($pk); $tags = array($value); /** * @var JTableObserverTags $tagsObserver */ $tagsObserver = $table->getObserverOfClass('JTableObserverTags'); $result = $tagsObserver->setNewTags($tags, false); if (!$result) { $this->setError($table->getError()); return false; } } else { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); return false; } } // Clean the cache $this->cleanCache(); return true; } /** * Method to test whether a record can be deleted. * * @param object $record A record object. * * @return boolean True if allowed to delete the record. Defaults to the permission for the component. * * @since 12.2 */ protected function canDelete($record) { $user = JFactory::getUser(); return $user->authorise('core.delete', $this->option); } /** * Method to test whether a record can be deleted. * * @param object $record A record object. * * @return boolean True if allowed to change the state of the record. Defaults to the permission for the component. * * @since 12.2 */ protected function canEditState($record) { $user = JFactory::getUser(); return $user->authorise('core.edit.state', $this->option); } /** * Method override to check-in a record or an array of record * * @param mixed $pks The ID of the primary key or an array of IDs * * @return mixed Boolean false if there is an error, otherwise the count of records checked in. * * @since 12.2 */ public function checkin($pks = array()) { $pks = (array) $pks; $table = $this->getTable(); $count = 0; if (empty($pks)) { $pks = array((int) $this->getState($this->getName() . '.id')); } // Check in all items. foreach ($pks as $pk) { if ($table->load($pk)) { if ($table->checked_out > 0) { if (!parent::checkin($pk)) { return false; } $count++; } } else { $this->setError($table->getError()); return false; } } return $count; } /** * Method override to check-out a record. * * @param integer $pk The ID of the primary key. * * @return boolean True if successful, false if an error occurs. * * @since 12.2 */ public function checkout($pk = null) { $pk = (!empty($pk)) ? $pk : (int) $this->getState($this->getName() . '.id'); return parent::checkout($pk); } /** * Method to delete one or more records. * * @param array &$pks An array of record primary keys. * * @return boolean True if successful, false if an error occurs. * * @since 12.2 */ public function delete(&$pks) { $dispatcher = JEventDispatcher::getInstance(); $pks = (array) $pks; $table = $this->getTable(); // Include the plugins for the delete events. JPluginHelper::importPlugin($this->events_map['delete']); // Iterate the items to delete each one. foreach ($pks as $i => $pk) { if ($table->load($pk)) { if ($this->canDelete($table)) { $context = $this->option . '.' . $this->name; // Trigger the before delete event. $result = $dispatcher->trigger($this->event_before_delete, array($context, $table)); if (in_array(false, $result, true)) { $this->setError($table->getError()); return false; } // Multilanguage: if associated, delete the item in the _associations table if ($this->associationsContext && JLanguageAssociations::isEnabled()) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('COUNT(*) as count, ' . $db->quoteName('as1.key')) ->from($db->quoteName('#__associations') . ' AS as1') ->join('LEFT', $db->quoteName('#__associations') . ' AS as2 ON ' . $db->quoteName('as1.key') . ' = ' . $db->quoteName('as2.key')) ->where($db->quoteName('as1.context') . ' = ' . $db->quote($this->associationsContext)) ->where($db->quoteName('as1.id') . ' = ' . (int) $pk); $db->setQuery($query); $row = $db->loadAssoc(); if (!empty($row['count'])) { $query = $db->getQuery(true) ->delete($db->quoteName('#__associations')) ->where($db->quoteName('context') . ' = ' . $db->quote($this->associationsContext)) ->where($db->quoteName('key') . ' = ' . $db->quote($row['key'])); if ($row['count'] > 2) { $query->where($db->quoteName('id') . ' = ' . (int) $pk); } $db->setQuery($query); $db->execute(); } } if (!$table->delete($pk)) { $this->setError($table->getError()); return false; } // Trigger the after event. $dispatcher->trigger($this->event_after_delete, array($context, $table)); } else { // Prune items that you can't change. unset($pks[$i]); $error = $this->getError(); if ($error) { JLog::add($error, JLog::WARNING, 'jerror'); return false; } else { JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), JLog::WARNING, 'jerror'); return false; } } } else { $this->setError($table->getError()); return false; } } // Clear the component's cache $this->cleanCache(); return true; } /** * Method to change the title & alias. * * @param integer $category_id The id of the category. * @param string $alias The alias. * @param string $title The title. * * @return array Contains the modified title and alias. * * @since 12.2 */ protected function generateNewTitle($category_id, $alias, $title) { // Alter the title & alias $table = $this->getTable(); while ($table->load(array('alias' => $alias, 'catid' => $category_id))) { $title = JString::increment($title); $alias = JString::increment($alias, 'dash'); } return array($title, $alias); } /** * Method to get a single record. * * @param integer $pk The id of the primary key. * * @return mixed Object on success, false on failure. * * @since 12.2 */ public function getItem($pk = null) { $pk = (!empty($pk)) ? $pk : (int) $this->getState($this->getName() . '.id'); $table = $this->getTable(); if ($pk > 0) { // Attempt to load the row. $return = $table->load($pk); // Check for a table object error. if ($return === false && $table->getError()) { $this->setError($table->getError()); return false; } } // Convert to the JObject before adding other data. $properties = $table->getProperties(1); $item = JArrayHelper::toObject($properties, 'JObject'); if (property_exists($item, 'params')) { $registry = new Registry; $registry->loadString($item->params); $item->params = $registry->toArray(); } return $item; } /** * A protected method to get a set of ordering conditions. * * @param JTable $table A JTable object. * * @return array An array of conditions to add to ordering queries. * * @since 12.2 */ protected function getReorderConditions($table) { return array(); } /** * Stock method to auto-populate the model state. * * @return void * * @since 12.2 */ protected function populateState() { $table = $this->getTable(); $key = $table->getKeyName(); // Get the pk of the record from the request. $pk = JFactory::getApplication()->input->getInt($key); $this->setState($this->getName() . '.id', $pk); // Load the parameters. $value = JComponentHelper::getParams($this->option); $this->setState('params', $value); } /** * Prepare and sanitise the table data prior to saving. * * @param JTable $table A reference to a JTable object. * * @return void * * @since 12.2 */ protected function prepareTable($table) { // Derived class will provide its own implementation if required. } /** * Method to change the published state of one or more records. * * @param array &$pks A list of the primary keys to change. * @param integer $value The value of the published state. * * @return boolean True on success. * * @since 12.2 */ public function publish(&$pks, $value = 1) { $dispatcher = JEventDispatcher::getInstance(); $user = JFactory::getUser(); $table = $this->getTable(); $pks = (array) $pks; // Include the plugins for the change of state event. JPluginHelper::importPlugin($this->events_map['change_state']); // Access checks. foreach ($pks as $i => $pk) { $table->reset(); if ($table->load($pk)) { if (!$this->canEditState($table)) { // Prune items that you can't change. unset($pks[$i]); JLog::add(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), JLog::WARNING, 'jerror'); return false; } } } // Attempt to change the state of the records. if (!$table->publish($pks, $value, $user->get('id'))) { $this->setError($table->getError()); return false; } $context = $this->option . '.' . $this->name; // Trigger the change state event. $result = $dispatcher->trigger($this->event_change_state, array($context, $pks, $value)); if (in_array(false, $result, true)) { $this->setError($table->getError()); return false; } // Clear the component's cache $this->cleanCache(); return true; } /** * Method to adjust the ordering of a row. * * Returns NULL if the user did not have edit * privileges for any of the selected primary keys. * * @param integer $pks The ID of the primary key to move. * @param integer $delta Increment, usually +1 or -1 * * @return mixed False on failure or error, true on success, null if the $pk is empty (no items selected). * * @since 12.2 */ public function reorder($pks, $delta = 0) { $table = $this->getTable(); $pks = (array) $pks; $result = true; $allowed = true; foreach ($pks as $i => $pk) { $table->reset(); if ($table->load($pk) && $this->checkout($pk)) { // Access checks. if (!$this->canEditState($table)) { // Prune items that you can't change. unset($pks[$i]); $this->checkin($pk); JLog::add(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), JLog::WARNING, 'jerror'); $allowed = false; continue; } $where = $this->getReorderConditions($table); if (!$table->move($delta, $where)) { $this->setError($table->getError()); unset($pks[$i]); $result = false; } $this->checkin($pk); } else { $this->setError($table->getError()); unset($pks[$i]); $result = false; } } if ($allowed === false && empty($pks)) { $result = null; } // Clear the component's cache if ($result == true) { $this->cleanCache(); } return $result; } /** * Method to save the form data. * * @param array $data The form data. * * @return boolean True on success, False on error. * * @since 12.2 */ public function save($data) { $dispatcher = JEventDispatcher::getInstance(); $table = $this->getTable(); $context = $this->option . '.' . $this->name; if ((!empty($data['tags']) && $data['tags'][0] != '')) { $table->newTags = $data['tags']; } $key = $table->getKeyName(); $pk = (!empty($data[$key])) ? $data[$key] : (int) $this->getState($this->getName() . '.id'); $isNew = true; // Include the plugins for the save events. JPluginHelper::importPlugin($this->events_map['save']); // Allow an exception to be thrown. try { // Load the row if saving an existing record. if ($pk > 0) { $table->load($pk); $isNew = false; } // Bind the data. if (!$table->bind($data)) { $this->setError($table->getError()); return false; } // Prepare the row for saving $this->prepareTable($table); // Check the data. if (!$table->check()) { $this->setError($table->getError()); return false; } // Trigger the before save event. $result = $dispatcher->trigger($this->event_before_save, array($context, $table, $isNew)); if (in_array(false, $result, true)) { $this->setError($table->getError()); return false; } // Store the data. if (!$table->store()) { $this->setError($table->getError()); return false; } // Clean the cache. $this->cleanCache(); // Trigger the after save event. $dispatcher->trigger($this->event_after_save, array($context, $table, $isNew)); } catch (Exception $e) { $this->setError($e->getMessage()); return false; } if (isset($table->$key)) { $this->setState($this->getName() . '.id', $table->$key); } $this->setState($this->getName() . '.new', $isNew); if ($this->associationsContext && JLanguageAssociations::isEnabled()) { $associations = $data['associations']; // Unset any invalid associations $associations = Joomla\Utilities\ArrayHelper::toInteger($associations); // Unset any invalid associations foreach ($associations as $tag => $id) { if (!$id) { unset($associations[$tag]); } } // Show a notice if the item isn't assigned to a language but we have associations. if ($associations && ($table->language == '*')) { JFactory::getApplication()->enqueueMessage( JText::_(strtoupper($this->option) . '_ERROR_ALL_LANGUAGE_ASSOCIATED'), 'notice' ); } // Adding self to the association $associations[$table->language] = (int) $table->$key; // Deleting old association for these items $db = $this->getDbo(); $query = $db->getQuery(true) ->delete($db->qn('#__associations')) ->where($db->qn('context') . ' = ' . $db->quote($this->associationsContext)) ->where($db->qn('id') . ' IN (' . implode(',', $associations) . ')'); $db->setQuery($query); $db->execute(); if ((count($associations) > 1) && ($table->language != '*')) { // Adding new association for these items $key = md5(json_encode($associations)); $query = $db->getQuery(true) ->insert('#__associations'); foreach ($associations as $id) { $query->values(((int) $id) . ',' . $db->quote($this->associationsContext) . ',' . $db->quote($key)); } $db->setQuery($query); $db->execute(); } } return true; } /** * Saves the manually set order of records. * * @param array $pks An array of primary key ids. * @param integer $order +1 or -1 * * @return mixed * * @since 12.2 */ public function saveorder($pks = null, $order = null) { $table = $this->getTable(); $tableClassName = get_class($table); $contentType = new JUcmType; $type = $contentType->getTypeByTable($tableClassName); $tagsObserver = $table->getObserverOfClass('JTableObserverTags'); $conditions = array(); if (empty($pks)) { return JError::raiseWarning(500, JText::_($this->text_prefix . '_ERROR_NO_ITEMS_SELECTED')); } // Update ordering values foreach ($pks as $i => $pk) { $table->load((int) $pk); // Access checks. if (!$this->canEditState($table)) { // Prune items that you can't change. unset($pks[$i]); JLog::add(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), JLog::WARNING, 'jerror'); } elseif ($table->ordering != $order[$i]) { $table->ordering = $order[$i]; if ($type) { $this->createTagsHelper($tagsObserver, $type, $pk, $type->type_alias, $table); } if (!$table->store()) { $this->setError($table->getError()); return false; } // Remember to reorder within position and client_id $condition = $this->getReorderConditions($table); $found = false; foreach ($conditions as $cond) { if ($cond[1] == $condition) { $found = true; break; } } if (!$found) { $key = $table->getKeyName(); $conditions[] = array($table->$key, $condition); } } } // Execute reorder for each category. foreach ($conditions as $cond) { $table->load($cond[0]); $table->reorder($cond[1]); } // Clear the component's cache $this->cleanCache(); return true; } /** * Method to create a tags helper to ensure proper management of tags * * @param JTableObserverTags $tagsObserver The tags observer for this table * @param JUcmType $type The type for the table being processed * @param integer $pk Primary key of the item bing processed * @param string $typeAlias The type alias for this table * @param JTable $table The JTable object * * @return void * * @since 3.2 */ public function createTagsHelper($tagsObserver, $type, $pk, $typeAlias, $table) { if (!empty($tagsObserver) && !empty($type)) { $table->tagsHelper = new JHelperTags; $table->tagsHelper->typeAlias = $typeAlias; $table->tagsHelper->tags = explode(',', $table->tagsHelper->getTagIds($pk, $typeAlias)); } } /** * Method to check the validity of the category ID for batch copy and move * * @param integer $categoryId The category ID to check * * @return boolean * * @since 3.2 */ protected function checkCategoryId($categoryId) { // Check that the category exists if ($categoryId) { $categoryTable = JTable::getInstance('Category'); if (!$categoryTable->load($categoryId)) { if ($error = $categoryTable->getError()) { // Fatal error $this->setError($error); return false; } else { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND')); return false; } } } if (empty($categoryId)) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND')); return false; } // Check that the user has create permission for the component $extension = JFactory::getApplication()->input->get('option', ''); if (!$this->user->authorise('core.create', $extension . '.category.' . $categoryId)) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE')); return false; } return true; } /** * A method to preprocess generating a new title in order to allow tables with alternative names * for alias and title to use the batch move and copy methods * * @param integer $categoryId The target category id * @param JTable $table The JTable within which move or copy is taking place * * @return void * * @since 3.2 */ public function generateTitle($categoryId, $table) { // Alter the title & alias $data = $this->generateNewTitle($categoryId, $table->alias, $table->title); $table->title = $data['0']; $table->alias = $data['1']; } } PK���\1��55!libraries/legacy/model/legacy.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Model * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Base class for a Joomla Model * * Acts as a Factory class for application specific objects and * provides many supporting API functions. * * @since 12.2 */ abstract class JModelLegacy extends JObject { /** * Indicates if the internal state has been set * * @var boolean * @since 12.2 */ protected $__state_set = null; /** * Database Connector * * @var JDatabaseDriver * @since 12.2 */ protected $_db; /** * The model (base) name * * @var string * @since 12.2 */ protected $name; /** * The URL option for the component. * * @var string * @since 12.2 */ protected $option = null; /** * A state object * * @var JObject * @since 12.2 */ protected $state; /** * The event to trigger when cleaning cache. * * @var string * @since 12.2 */ protected $event_clean_cache = null; /** * Add a directory where JModelLegacy should search for models. You may * either pass a string or an array of directories. * * @param mixed $path A path or array[sting] of paths to search. * @param string $prefix A prefix for models. * * @return array An array with directory elements. If prefix is equal to '', all directories are returned. * * @since 12.2 */ public static function addIncludePath($path = '', $prefix = '') { static $paths; if (!isset($paths)) { $paths = array(); } if (!isset($paths[$prefix])) { $paths[$prefix] = array(); } if (!isset($paths[''])) { $paths[''] = array(); } if (!empty($path)) { jimport('joomla.filesystem.path'); if (!is_array($path)) { $path = array($path); } foreach ($path as $includePath) { if (!in_array($includePath, $paths[$prefix])) { array_unshift($paths[$prefix], JPath::clean($includePath)); } if (!in_array($includePath, $paths[''])) { array_unshift($paths[''], JPath::clean($includePath)); } } } return $paths[$prefix]; } /** * Adds to the stack of model table paths in LIFO order. * * @param mixed $path The directory as a string or directories as an array to add. * * @return void * * @since 12.2 */ public static function addTablePath($path) { JTable::addIncludePath($path); } /** * Create the filename for a resource * * @param string $type The resource type to create the filename for. * @param array $parts An associative array of filename information. * * @return string The filename * * @since 12.2 */ protected static function _createFileName($type, $parts = array()) { $filename = ''; switch ($type) { case 'model': $filename = strtolower($parts['name']) . '.php'; break; } return $filename; } /** * Returns a Model object, always creating it * * @param string $type The model type to instantiate * @param string $prefix Prefix for the model class name. Optional. * @param array $config Configuration array for model. Optional. * * @return mixed A model object or false on failure * * @since 12.2 */ public static function getInstance($type, $prefix = '', $config = array()) { $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $modelClass = $prefix . ucfirst($type); if (!class_exists($modelClass)) { jimport('joomla.filesystem.path'); $path = JPath::find(self::addIncludePath(null, $prefix), self::_createFileName('model', array('name' => $type))); if (!$path) { $path = JPath::find(self::addIncludePath(null, ''), self::_createFileName('model', array('name' => $type))); } if ($path) { require_once $path; if (!class_exists($modelClass)) { JLog::add(JText::sprintf('JLIB_APPLICATION_ERROR_MODELCLASS_NOT_FOUND', $modelClass), JLog::WARNING, 'jerror'); return false; } } else { return false; } } return new $modelClass($config); } /** * Constructor * * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). * * @since 12.2 * @throws Exception */ public function __construct($config = array()) { // Guess the option from the class name (Option)Model(View). if (empty($this->option)) { $r = null; if (!preg_match('/(.*)Model/i', get_class($this), $r)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'), 500); } $this->option = 'com_' . strtolower($r[1]); } // Set the view name if (empty($this->name)) { if (array_key_exists('name', $config)) { $this->name = $config['name']; } else { $this->name = $this->getName(); } } // Set the model state if (array_key_exists('state', $config)) { $this->state = $config['state']; } else { $this->state = new JObject; } // Set the model dbo if (array_key_exists('dbo', $config)) { $this->_db = $config['dbo']; } else { $this->_db = JFactory::getDbo(); } // Set the default view search path if (array_key_exists('table_path', $config)) { $this->addTablePath($config['table_path']); } // @codeCoverageIgnoreStart elseif (defined('JPATH_COMPONENT_ADMINISTRATOR')) { $this->addTablePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables'); $this->addTablePath(JPATH_COMPONENT_ADMINISTRATOR . '/table'); } // @codeCoverageIgnoreEnd // Set the internal state marker - used to ignore setting state from the request if (!empty($config['ignore_request'])) { $this->__state_set = true; } // Set the clean cache event if (isset($config['event_clean_cache'])) { $this->event_clean_cache = $config['event_clean_cache']; } elseif (empty($this->event_clean_cache)) { $this->event_clean_cache = 'onContentCleanCache'; } } /** * Gets an array of objects from the results of database query. * * @param string $query The query. * @param integer $limitstart Offset. * @param integer $limit The number of records. * * @return array An array of results. * * @since 12.2 * @throws RuntimeException */ protected function _getList($query, $limitstart = 0, $limit = 0) { $this->_db->setQuery($query, $limitstart, $limit); $result = $this->_db->loadObjectList(); return $result; } /** * Returns a record count for the query. * * @param JDatabaseQuery|string $query The query. * * @return integer Number of rows for query. * * @since 12.2 */ protected function _getListCount($query) { // Use fast COUNT(*) on JDatabaseQuery objects if there is no GROUP BY or HAVING clause: if ($query instanceof JDatabaseQuery && $query->type == 'select' && $query->group === null && $query->union === null && $query->unionAll === null && $query->having === null) { $query = clone $query; $query->clear('select')->clear('order')->clear('limit')->clear('offset')->select('COUNT(*)'); $this->_db->setQuery($query); return (int) $this->_db->loadResult(); } // Otherwise fall back to inefficient way of counting all results. // Remove the limit and offset part if it's a JDatabaseQuery object if ($query instanceof JDatabaseQuery) { $query = clone $query; $query->clear('limit')->clear('offset'); } $this->_db->setQuery($query); $this->_db->execute(); return (int) $this->_db->getNumRows(); } /** * Method to load and return a model object. * * @param string $name The name of the view * @param string $prefix The class prefix. Optional. * @param array $config Configuration settings to pass to JTable::getInstance * * @return mixed Model object or boolean false if failed * * @since 12.2 * @see JTable::getInstance() */ protected function _createTable($name, $prefix = 'Table', $config = array()) { // Clean the model name $name = preg_replace('/[^A-Z0-9_]/i', '', $name); $prefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix); // Make sure we are returning a DBO object if (!array_key_exists('dbo', $config)) { $config['dbo'] = $this->getDbo(); } return JTable::getInstance($name, $prefix, $config); } /** * Method to get the database driver object * * @return JDatabaseDriver */ public function getDbo() { return $this->_db; } /** * Method to get the model name * * The model name. By default parsed using the classname or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the model * * @since 12.2 * @throws Exception */ public function getName() { if (empty($this->name)) { $r = null; if (!preg_match('/Model(.*)/i', get_class($this), $r)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_MODEL_GET_NAME'), 500); } $this->name = strtolower($r[1]); } return $this->name; } /** * 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 12.2 */ public function getState($property = null, $default = null) { if (!$this->__state_set) { // Protected method to auto-populate the model state. $this->populateState(); // Set the model state set flag to true. $this->__state_set = true; } return $property === null ? $this->state : $this->state->get($property, $default); } /** * Method to get a table object, load it if necessary. * * @param string $name The table name. Optional. * @param string $prefix The class prefix. Optional. * @param array $options Configuration array for model. Optional. * * @return JTable A JTable object * * @since 12.2 * @throws Exception */ public function getTable($name = '', $prefix = 'Table', $options = array()) { if (empty($name)) { $name = $this->getName(); } if ($table = $this->_createTable($name, $prefix, $options)) { return $table; } throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_TABLE_NAME_NOT_SUPPORTED', $name), 0); } /** * Method to load a row for editing from the version history table. * * @param integer $version_id Key to the version history table. * @param JTable &$table Content table object being loaded. * * @return boolean False on failure or error, true otherwise. * * @since 12.2 */ public function loadHistory($version_id, JTable &$table) { // Only attempt to check the row in if it exists. if ($version_id) { $user = JFactory::getUser(); // Get an instance of the row to checkout. $historyTable = JTable::getInstance('Contenthistory'); if (!$historyTable->load($version_id)) { $this->setError($historyTable->getError()); return false; } $rowArray = JArrayHelper::fromObject(json_decode($historyTable->version_data)); $typeId = JTable::getInstance('Contenttype')->getTypeId($this->typeAlias); if ($historyTable->ucm_type_id != $typeId) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_HISTORY_ID_MISMATCH')); $key = $table->getKeyName(); if (isset($rowArray[$key])) { $table->checkIn($rowArray[$key]); } return false; } } $this->setState('save_date', $historyTable->save_date); $this->setState('version_note', $historyTable->version_note); return $table->bind($rowArray); } /** * Method to auto-populate the model state. * * This method should only be called once per instantiation and is designed * to be called on the first call to the getState() method unless the model * configuration flag to ignore the request is set. * * @return void * * @note Calling getState in this method will result in recursion. * @since 12.2 */ protected function populateState() { } /** * Method to set the database driver object * * @param JDatabaseDriver $db A JDatabaseDriver based object * * @return void * * @since 12.2 */ public function setDbo($db) { $this->_db = $db; } /** * Method to set model state variables * * @param string $property The name of the property. * @param mixed $value The value of the property to set or null. * * @return mixed The previous value of the property or null if not set. * * @since 12.2 */ public function setState($property, $value = null) { return $this->state->set($property, $value); } /** * Clean the cache * * @param string $group The cache group * @param integer $client_id The ID of the client * * @return void * * @since 12.2 */ protected function cleanCache($group = null, $client_id = 0) { $conf = JFactory::getConfig(); $dispatcher = JEventDispatcher::getInstance(); $options = array( 'defaultgroup' => ($group) ? $group : (isset($this->option) ? $this->option : JFactory::getApplication()->input->get('option')), 'cachebase' => ($client_id) ? JPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', JPATH_SITE . '/cache')); $cache = JCache::getInstance('callback', $options); $cache->clean(); // Trigger the onContentCleanCache event. $dispatcher->trigger($this->event_clean_cache, $options); } } PK���\����I�Ilibraries/legacy/model/list.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Model * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Model class for handling lists of items. * * @since 12.2 */ class JModelList extends JModelLegacy { /** * Internal memory based cache array of data. * * @var array * @since 12.2 */ protected $cache = array(); /** * Context string for the model type. This is used to handle uniqueness * when dealing with the getStoreId() method and caching data structures. * * @var string * @since 12.2 */ protected $context = null; /** * Valid filter fields or ordering. * * @var array * @since 12.2 */ protected $filter_fields = array(); /** * An internal cache for the last query used. * * @var JDatabaseQuery * @since 12.2 */ protected $query = array(); /** * Name of the filter form to load * * @var string * @since 3.2 */ protected $filterFormName = null; /** * Associated HTML form * * @var string */ protected $htmlFormName = 'adminForm'; /** * A blacklist of filter variables to not merge into the model's state * * @var array * @since 3.4.5 */ protected $filterBlacklist = array(); /** * A blacklist of list variables to not merge into the model's state * * @var array * @since 3.4.5 */ protected $listBlacklist = array('select'); /** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @see JModelLegacy * @since 12.2 */ public function __construct($config = array()) { parent::__construct($config); // Add the ordering filtering fields white list. if (isset($config['filter_fields'])) { $this->filter_fields = $config['filter_fields']; } // Guess the context as Option.ModelName. if (empty($this->context)) { $this->context = strtolower($this->option . '.' . $this->getName()); } } /** * Method to cache the last query constructed. * * This method ensures that the query is constructed only once for a given state of the model. * * @return JDatabaseQuery A JDatabaseQuery object * * @since 12.2 */ protected function _getListQuery() { // Capture the last store id used. static $lastStoreId; // Compute the current store id. $currentStoreId = $this->getStoreId(); // If the last store id is different from the current, refresh the query. if ($lastStoreId != $currentStoreId || empty($this->query)) { $lastStoreId = $currentStoreId; $this->query = $this->getListQuery(); } return $this->query; } /** * Function to get the active filters * * @return array Associative array in the format: array('filter_published' => 0) * * @since 3.2 */ public function getActiveFilters() { $activeFilters = array(); if (!empty($this->filter_fields)) { foreach ($this->filter_fields as $filter) { $filterName = 'filter.' . $filter; if (property_exists($this->state, $filterName) && (!empty($this->state->{$filterName}) || is_numeric($this->state->{$filterName}))) { $activeFilters[$filter] = $this->state->get($filterName); } } } return $activeFilters; } /** * Method to get an array of data items. * * @return mixed An array of data items on success, false on failure. * * @since 12.2 */ public function getItems() { // Get a storage key. $store = $this->getStoreId(); // Try to load the data from internal storage. if (isset($this->cache[$store])) { return $this->cache[$store]; } // Load the list items. $query = $this->_getListQuery(); try { $items = $this->_getList($query, $this->getStart(), $this->getState('list.limit')); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } // Add the items to the internal cache. $this->cache[$store] = $items; return $this->cache[$store]; } /** * Method to get a JDatabaseQuery object for retrieving the data set from a database. * * @return JDatabaseQuery A JDatabaseQuery object to retrieve the data set. * * @since 12.2 */ protected function getListQuery() { $db = $this->getDbo(); $query = $db->getQuery(true); return $query; } /** * Method to get a JPagination object for the data set. * * @return JPagination A JPagination object for the data set. * * @since 12.2 */ public function getPagination() { // Get a storage key. $store = $this->getStoreId('getPagination'); // Try to load the data from internal storage. if (isset($this->cache[$store])) { return $this->cache[$store]; } // Create the pagination object. $limit = (int) $this->getState('list.limit') - (int) $this->getState('list.links'); $page = new JPagination($this->getTotal(), $this->getStart(), $limit); // Add the object to the internal cache. $this->cache[$store] = $page; return $this->cache[$store]; } /** * Method to get a store id based on the model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id An identifier string to generate the store id. * * @return string A store id. * * @since 12.2 */ protected function getStoreId($id = '') { // Add the list state to the store id. $id .= ':' . $this->getState('list.start'); $id .= ':' . $this->getState('list.limit'); $id .= ':' . $this->getState('list.ordering'); $id .= ':' . $this->getState('list.direction'); return md5($this->context . ':' . $id); } /** * Method to get the total number of items for the data set. * * @return integer The total number of items available in the data set. * * @since 12.2 */ public function getTotal() { // Get a storage key. $store = $this->getStoreId('getTotal'); // Try to load the data from internal storage. if (isset($this->cache[$store])) { return $this->cache[$store]; } // Load the total. $query = $this->_getListQuery(); try { $total = (int) $this->_getListCount($query); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } // Add the total to the internal cache. $this->cache[$store] = $total; return $this->cache[$store]; } /** * Method to get the starting number of items for the data set. * * @return integer The starting number of items available in the data set. * * @since 12.2 */ public function getStart() { $store = $this->getStoreId('getstart'); // Try to load the data from internal storage. if (isset($this->cache[$store])) { return $this->cache[$store]; } $start = $this->getState('list.start'); $limit = $this->getState('list.limit'); $total = $this->getTotal(); if ($start > $total - $limit) { $start = max(0, (int) (ceil($total / $limit) - 1) * $limit); } // Add the total to the internal cache. $this->cache[$store] = $start; return $this->cache[$store]; } /** * Get the filter form * * @param array $data data * @param boolean $loadData load current data * * @return JForm/false the JForm object or false * * @since 3.2 */ public function getFilterForm($data = array(), $loadData = true) { $form = null; // Try to locate the filter form automatically. Example: ContentModelArticles => "filter_articles" if (empty($this->filterFormName)) { $classNameParts = explode('Model', get_called_class()); if (count($classNameParts) == 2) { $this->filterFormName = 'filter_' . strtolower($classNameParts[1]); } } if (!empty($this->filterFormName)) { // Get the form. $form = $this->loadForm($this->context . '.filter', $this->filterFormName, array('control' => '', 'load_data' => $loadData)); } return $form; } /** * Method to get a form object. * * @param string $name The name of the form. * @param string $source The form source. Can be XML string if file flag is set to false. * @param array $options Optional array of options for the form creation. * @param boolean $clear Optional argument to force load a new form. * @param string $xpath An optional xpath to search for the fields. * * @return mixed JForm object on success, False on error. * * @see JForm * @since 3.2 */ protected function loadForm($name, $source = null, $options = array(), $clear = false, $xpath = false) { // Handle the optional arguments. $options['control'] = JArrayHelper::getValue($options, 'control', false); // Create a signature hash. $hash = md5($source . serialize($options)); // Check if we can use a previously loaded form. if (isset($this->_forms[$hash]) && !$clear) { return $this->_forms[$hash]; } // Get the form. JForm::addFormPath(JPATH_COMPONENT . '/models/forms'); JForm::addFieldPath(JPATH_COMPONENT . '/models/fields'); try { $form = JForm::getInstance($name, $source, $options, false, $xpath); if (isset($options['load_data']) && $options['load_data']) { // Get the data for the form. $data = $this->loadFormData(); } else { $data = array(); } // Allow for additional modification of the form, and events to be triggered. // We pass the data because plugins may require it. $this->preprocessForm($form, $data); // Load the data into the form after the plugins have operated. $form->bind($data); } catch (Exception $e) { $this->setError($e->getMessage()); return false; } // Store the form for later. $this->_forms[$hash] = $form; return $form; } /** * Method to get the data that should be injected in the form. * * @return mixed The data for the form. * * @since 3.2 */ protected function loadFormData() { // Check the session for previously entered form data. $data = JFactory::getApplication()->getUserState($this->context, new stdClass); // Pre-fill the list options if (!property_exists($data, 'list')) { $data->list = array( 'direction' => $this->state->{'list.direction'}, 'limit' => $this->state->{'list.limit'}, 'ordering' => $this->state->{'list.ordering'}, 'start' => $this->state->{'list.start'} ); } return $data; } /** * Method to auto-populate the model state. * * This method should only be called once per instantiation and is designed * to be called on the first call to the getState() method unless the model * configuration flag to ignore the request is set. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field. * @param string $direction An optional direction (asc|desc). * * @return void * * @since 12.2 */ protected function populateState($ordering = null, $direction = null) { // If the context is set, assume that stateful lists are used. if ($this->context) { $app = JFactory::getApplication(); $inputFilter = JFilterInput::getInstance(); // Receive & set filters if ($filters = $app->getUserStateFromRequest($this->context . '.filter', 'filter', array(), 'array')) { foreach ($filters as $name => $value) { // Exclude if blacklisted if (!in_array($name, $this->filterBlacklist)) { $this->setState('filter.' . $name, $value); } } } $limit = 0; // Receive & set list options if ($list = $app->getUserStateFromRequest($this->context . '.list', 'list', array(), 'array')) { foreach ($list as $name => $value) { // Exclude if blacklisted if (!in_array($name, $this->listBlacklist)) { // Extra validations switch ($name) { case 'fullordering': $orderingParts = explode(' ', $value); if (count($orderingParts) >= 2) { // Latest part will be considered the direction $fullDirection = end($orderingParts); if (in_array(strtoupper($fullDirection), array('ASC', 'DESC', ''))) { $this->setState('list.direction', $fullDirection); } unset($orderingParts[count($orderingParts) - 1]); // The rest will be the ordering $fullOrdering = implode(' ', $orderingParts); if (in_array($fullOrdering, $this->filter_fields)) { $this->setState('list.ordering', $fullOrdering); } } else { $this->setState('list.ordering', $ordering); $this->setState('list.direction', $direction); } break; case 'ordering': if (!in_array($value, $this->filter_fields)) { $value = $ordering; } break; case 'direction': if (!in_array(strtoupper($value), array('ASC', 'DESC', ''))) { $value = $direction; } break; case 'limit': case 'start': $limit = $inputFilter->clean($value, 'int'); break; case 'select': $explodedValue = explode(',', $value); foreach ($explodedValue as &$field) { $field = $inputFilter->clean($field, 'cmd'); } $value = implode(',', $explodedValue); break; } $this->setState('list.' . $name, $value); } } } else // Keep B/C for components previous to jform forms for filters { // Pre-fill the limits $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint'); $this->setState('list.limit', $limit); // Check if the ordering field is in the white list, otherwise use the incoming value. $value = $app->getUserStateFromRequest($this->context . '.ordercol', 'filter_order', $ordering); if (!in_array($value, $this->filter_fields)) { $value = $ordering; $app->setUserState($this->context . '.ordercol', $value); } $this->setState('list.ordering', $value); // Check if the ordering direction is valid, otherwise use the incoming value. $value = $app->getUserStateFromRequest($this->context . '.orderdirn', 'filter_order_Dir', $direction); if (!in_array(strtoupper($value), array('ASC', 'DESC', ''))) { $value = $direction; $app->setUserState($this->context . '.orderdirn', $value); } $this->setState('list.direction', $value); } // Support old ordering field $oldOrdering = $app->input->get('filter_order'); if (!empty($oldOrdering) && in_array($oldOrdering, $this->filter_fields)) { $this->setState('list.ordering', $oldOrdering); } // Support old direction field $oldDirection = $app->input->get('filter_order_Dir'); if (!empty($oldDirection) && in_array(strtoupper($oldDirection), array('ASC', 'DESC', ''))) { $this->setState('list.direction', $oldDirection); } $value = $app->getUserStateFromRequest($this->context . '.limitstart', 'limitstart', 0); $limitstart = ($limit != 0 ? (floor($value / $limit) * $limit) : 0); $this->setState('list.start', $limitstart); } else { $this->setState('list.start', 0); $this->setState('list.limit', 0); } } /** * Method to allow derived classes to preprocess the form. * * @param JForm $form A JForm object. * @param mixed $data The data expected for the form. * @param string $group The name of the plugin group to import (defaults to "content"). * * @return void * * @since 3.2 * @throws Exception if there is an error in the form event. */ protected function preprocessForm(JForm $form, $data, $group = 'content') { // Import the appropriate plugin group. JPluginHelper::importPlugin($group); // Get the dispatcher. $dispatcher = JDispatcher::getInstance(); // Trigger the form preparation event. $results = $dispatcher->trigger('onContentPrepareForm', array($form, $data)); // Check for errors encountered while preparing the form. if (count($results) && in_array(false, $results, true)) { // Get the last error. $error = $dispatcher->getError(); if (!($error instanceof Exception)) { throw new Exception($error); } } } /** * Gets the value of a user state variable and sets it in the session * * This is the same as the method in JApplication except that this also can optionally * force you back to the first page when a filter has changed * * @param string $key The key of the user state variable. * @param string $request The name of the variable passed in a request. * @param string $default The default value for the variable if not found. Optional. * @param string $type Filter for the variable, for valid values see {@link JFilterInput::clean()}. Optional. * @param boolean $resetPage If true, the limitstart in request is set to zero * * @return The request user state. * * @since 12.2 */ public function getUserStateFromRequest($key, $request, $default = null, $type = 'none', $resetPage = true) { $app = JFactory::getApplication(); $input = $app->input; $old_state = $app->getUserState($key); $cur_state = (!is_null($old_state)) ? $old_state : $default; $new_state = $input->get($request, null, $type); // BC for Search Tools which uses different naming if ($new_state === null && strpos($request, 'filter_') === 0) { $name = substr($request, 7); $filters = $app->input->get('filter', array(), 'array'); if (!empty($filters[$name])) { $new_state = $filters[$name]; } } if (($cur_state != $new_state) && ($resetPage)) { $input->set('limitstart', 0); } // Save the new value only if it is set in this request. if ($new_state !== null) { $app->setUserState($key, $new_state); } else { $new_state = $cur_state; } return $new_state; } /** * Parse and transform the search string into a string fit for regex-ing arbitrary strings against * * @param string $search The search string * @param string $regexDelimiter The regex delimiter to use for the quoting * * @return string Search string escaped for regex */ protected function refineSearchStringToRegex($search, $regexDelimiter = '/') { $searchArr = explode('|', trim($search, ' |')); foreach ($searchArr as $key => $searchString) { if (strlen(trim($searchString)) == 0) { unset($searchArr[$key]); continue; } $searchArr[$key] = str_replace(' ', '.*', preg_quote(trim($searchString), $regexDelimiter)); } return implode('|', $searchArr); } } PK���\T� ��libraries/legacy/model/item.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Model * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Prototype item model. * * @since 12.2 */ abstract class JModelItem extends JModelLegacy { /** * An item. * * @var array */ protected $_item = null; /** * Model context string. * * @var string * @since 12.2 */ protected $_context = 'group.type'; /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id A prefix for the store id. * * @return string A store id. * * @since 12.2 */ protected function getStoreId($id = '') { // Compile the store id. return md5($id); } } PK���\��A��$libraries/legacy/application/cli.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Deprecated class placeholder. You should use JApplicationCli instead. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JApplicationCli instead. * @codeCoverageIgnore */ class JCli extends JApplicationCli { /** * Class constructor. * * @param JInputCli $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInputCli object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param JEventDispatcher $dispatcher An optional argument to provide dependency injection for the application's * event dispatcher. If the argument is a JEventDispatcher object that object will become * the application's event dispatcher, if it is null then the default event dispatcher * will be created based on the application's loadDispatcher() method. * * @see JApplicationBase::loadDispatcher() * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JApplicationCli instead. */ public function __construct(JInputCli $input = null, Registry $config = null, JEventDispatcher $dispatcher = null) { JLog::add('JCli is deprecated. Use JApplicationCli instead.', JLog::WARNING, 'deprecated'); parent::__construct($input, $config, $dispatcher); } } PK���\ ��t�t,libraries/legacy/application/application.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; JLog::add('JApplication is deprecated.', JLog::WARNING, 'deprecated'); /** * Base class for a Joomla! application. * * Acts as a Factory class for application specific objects and provides many * supporting API functions. Derived clases should supply the route(), dispatch() * and render() functions. * * @since 11.1 * @deprecated 4.0 Use JApplicationCms instead unless specified otherwise */ class JApplication extends JApplicationBase { /** * The client identifier. * * @var integer * @since 11.1 * @deprecated 4.0 */ protected $_clientId = null; /** * The application message queue. * * @var array * @since 11.1 * @deprecated 4.0 */ protected $_messageQueue = array(); /** * The name of the application. * * @var array * @since 11.1 * @deprecated 4.0 */ protected $_name = null; /** * The scope of the application. * * @var string * @since 11.1 * @deprecated 4.0 */ public $scope = null; /** * The time the request was made. * * @var date * @since 11.1 * @deprecated 4.0 */ public $requestTime = null; /** * The time the request was made as Unix timestamp. * * @var integer * @since 11.1 * @deprecated 4.0 */ public $startTime = null; /** * @var JApplicationWebClient The application client object. * @since 12.2 * @deprecated 4.0 */ public $client; /** * @var array JApplication instances container. * @since 11.3 * @deprecated 4.0 */ protected static $instances = array(); /** * Class constructor. * * @param array $config A configuration array including optional elements such as session * session_name, clientId and others. This is not exhaustive. * * @since 11.1 * @deprecated 4.0 */ public function __construct($config = array()) { // Set the view name. $this->_name = $this->getName(); // Only set the clientId if available. if (isset($config['clientId'])) { $this->_clientId = $config['clientId']; } // Enable sessions by default. if (!isset($config['session'])) { $config['session'] = true; } // Create the input object $this->input = new JInput; $this->client = new JApplicationWebClient; $this->loadDispatcher(); // Set the session default name. if (!isset($config['session_name'])) { $config['session_name'] = $this->_name; } // Set the default configuration file. if (!isset($config['config_file'])) { $config['config_file'] = 'configuration.php'; } // Create the configuration object. if (file_exists(JPATH_CONFIGURATION . '/' . $config['config_file'])) { $this->_createConfiguration(JPATH_CONFIGURATION . '/' . $config['config_file']); } // Create the session if a session name is passed. if ($config['session'] !== false) { $this->_createSession(self::getHash($config['session_name'])); } $this->requestTime = gmdate('Y-m-d H:i'); // Used by task system to ensure that the system doesn't go over time. $this->startTime = JProfiler::getmicrotime(); } /** * Returns the global JApplicationCms object, only creating it if it * doesn't already exist. * * @param mixed $client A client identifier or name. * @param array $config An optional associative array of configuration settings. * @param string $prefix A prefix for class names * * @return JApplicationCms A JApplicationCms object. * * @since 11.1 * @deprecated 4.0 Use JApplicationCms::getInstance() instead * @note As of 3.2, this proxies to JApplicationCms::getInstance() */ public static function getInstance($client, $config = array(), $prefix = 'J') { return JApplicationCms::getInstance($client); } /** * Initialise the application. * * @param array $options An optional associative array of configuration settings. * * @return void * * @since 11.1 * @deprecated 4.0 */ public function initialise($options = array()) { // Set the language in the class. $config = JFactory::getConfig(); // Check that we were given a language in the array (since by default may be blank). if (isset($options['language'])) { $config->set('language', $options['language']); } // Set user specific editor. $user = JFactory::getUser(); $editor = $user->getParam('editor', $this->getCfg('editor')); if (!JPluginHelper::isEnabled('editors', $editor)) { $editor = $this->getCfg('editor'); if (!JPluginHelper::isEnabled('editors', $editor)) { $editor = 'none'; } } $config->set('editor', $editor); // Trigger the onAfterInitialise event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onAfterInitialise'); } /** * Route the application. * * Routing is the process of examining the request environment to determine which * component should receive the request. The component optional parameters * are then set in the request object to be processed when the application is being * dispatched. * * @return void * * @since 11.1 * @deprecated 4.0 */ public function route() { // Get the full request URI. $uri = clone JUri::getInstance(); $router = $this->getRouter(); $result = $router->parse($uri); foreach ($result as $key => $value) { $this->input->def($key, $value); } // Trigger the onAfterRoute event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onAfterRoute'); } /** * Dispatch the application. * * Dispatching is the process of pulling the option from the request object and * mapping them to a component. If the component does not exist, it handles * determining a default component to dispatch. * * @param string $component The component to dispatch. * * @return void * * @since 11.1 * @deprecated 4.0 */ public function dispatch($component = null) { $document = JFactory::getDocument(); $contents = JComponentHelper::renderComponent($component); $document->setBuffer($contents, 'component'); // Trigger the onAfterDispatch event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onAfterDispatch'); } /** * Render the application. * * Rendering is the process of pushing the document buffers into the template * placeholders, retrieving data from the document and pushing it into * the JResponse buffer. * * @return void * * @since 11.1 * @deprecated 4.0 */ public function render() { $template = $this->getTemplate(true); $params = array('template' => $template->template, 'file' => 'index.php', 'directory' => JPATH_THEMES, 'params' => $template->params); // Parse the document. $document = JFactory::getDocument(); $document->parse($params); // Trigger the onBeforeRender event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onBeforeRender'); // Render the document. $caching = ($this->getCfg('caching') >= 2) ? true : false; JResponse::setBody($document->render($caching, $params)); // Trigger the onAfterRender event. $this->triggerEvent('onAfterRender'); } /** * Redirect to another URL. * * Optionally enqueues a message in the system message queue (which will be displayed * the next time a page is loaded) using the enqueueMessage method. If the headers have * not been sent the redirect will be accomplished using a "301 Moved Permanently" * code in the header pointing to the new location. If the headers have already been * sent this will be accomplished using a JavaScript statement. * * @param string $url The URL to redirect to. Can only be http/https URL * @param string $msg An optional message to display on redirect. * @param string $msgType An optional message type. Defaults to message. * @param boolean $moved True if the page is 301 Permanently Moved, otherwise 303 See Other is assumed. * * @return void Calls exit(). * * @since 11.1 * @deprecated 4.0 * * @see JApplication::enqueueMessage() */ public function redirect($url, $msg = '', $msgType = 'message', $moved = false) { // Check for relative internal links. if (preg_match('#^index2?\.php#', $url)) { $url = JUri::base() . $url; } // Strip out any line breaks. $url = preg_split("/[\r\n]/", $url); $url = $url[0]; /* * If we don't start with a http we need to fix this before we proceed. * We could validly start with something else (e.g. ftp), though this would * be unlikely and isn't supported by this API. */ if (!preg_match('#^http#i', $url)) { $uri = JUri::getInstance(); $prefix = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); if ($url[0] == '/') { // We just need the prefix since we have a path relative to the root. $url = $prefix . $url; } else { // It's relative to where we are now, so lets add that. $parts = explode('/', $uri->toString(array('path'))); array_pop($parts); $path = implode('/', $parts) . '/'; $url = $prefix . $path . $url; } } // If the message exists, enqueue it. if (trim($msg)) { $this->enqueueMessage($msg, $msgType); } // Persist messages if they exist. if (count($this->_messageQueue)) { $session = JFactory::getSession(); $session->set('application.queue', $this->_messageQueue); } // If the headers have been sent, then we cannot send an additional location header // so we will output a javascript redirect statement. if (headers_sent()) { echo "<script>document.location.href='" . str_replace("'", "'", $url) . "';</script>\n"; } else { $document = JFactory::getDocument(); jimport('phputf8.utils.ascii'); if (($this->client->engine == JApplicationWebClient::TRIDENT) && !utf8_is_ascii($url)) { // MSIE type browser and/or server cause issues when url contains utf8 character,so use a javascript redirect method echo '<html><head><meta http-equiv="content-type" content="text/html; charset=' . $document->getCharset() . '" />' . '<script>document.location.href=\'' . str_replace("'", "'", $url) . '\';</script></head></html>'; } else { // All other browsers, use the more efficient HTTP header method header($moved ? 'HTTP/1.1 301 Moved Permanently' : 'HTTP/1.1 303 See other'); header('Location: ' . $url); header('Content-Type: text/html; charset=' . $document->getCharset()); } } $this->close(); } /** * Enqueue a system message. * * @param string $msg The message to enqueue. * @param string $type The message type. Default is message. * * @return void * * @since 11.1 * @deprecated 4.0 */ public function enqueueMessage($msg, $type = 'message') { // For empty queue, if messages exists in the session, enqueue them first. if (!count($this->_messageQueue)) { $session = JFactory::getSession(); $sessionQueue = $session->get('application.queue'); if (count($sessionQueue)) { $this->_messageQueue = $sessionQueue; $session->set('application.queue', null); } } // Enqueue the message. $this->_messageQueue[] = array('message' => $msg, 'type' => strtolower($type)); } /** * Get the system message queue. * * @return array The system message queue. * * @since 11.1 * @deprecated 4.0 */ public function getMessageQueue() { // For empty queue, if messages exists in the session, enqueue them. if (!count($this->_messageQueue)) { $session = JFactory::getSession(); $sessionQueue = $session->get('application.queue'); if (count($sessionQueue)) { $this->_messageQueue = $sessionQueue; $session->set('application.queue', null); } } return $this->_messageQueue; } /** * Gets a configuration value. * * An example is in application/japplication-getcfg.php Getting a configuration * * @param string $varname The name of the value to get. * @param string $default Default value to return * * @return mixed The user state. * * @since 11.1 * @deprecated 4.0 */ public function getCfg($varname, $default = null) { $config = JFactory::getConfig(); return $config->get('' . $varname, $default); } /** * Method to get the application name. * * The dispatcher name is by default parsed using the classname, or it can be set * by passing a $config['name'] in the class constructor. * * @return string The name of the dispatcher. * * @since 11.1 * @deprecated 4.0 */ public function getName() { $name = $this->_name; if (empty($name)) { $r = null; if (!preg_match('/J(.*)/i', get_class($this), $r)) { JLog::add(JText::_('JLIB_APPLICATION_ERROR_APPLICATION_GET_NAME'), JLog::WARNING, 'jerror'); } $name = strtolower($r[1]); } return $name; } /** * Gets a user state. * * @param string $key The path of the state. * @param mixed $default Optional default value, returned if the internal value is null. * * @return mixed The user state or null. * * @since 11.1 * @deprecated 4.0 */ public function getUserState($key, $default = null) { $session = JFactory::getSession(); $registry = $session->get('registry'); if (!is_null($registry)) { return $registry->get($key, $default); } return $default; } /** * Sets the value of a user state variable. * * @param string $key The path of the state. * @param string $value The value of the variable. * * @return mixed The previous state, if one existed. * * @since 11.1 * @deprecated 4.0 */ public function setUserState($key, $value) { $session = JFactory::getSession(); $registry = $session->get('registry'); if (!is_null($registry)) { return $registry->set($key, $value); } return null; } /** * Gets the value of a user state variable. * * @param string $key The key of the user state variable. * @param string $request The name of the variable passed in a request. * @param string $default The default value for the variable if not found. Optional. * @param string $type Filter for the variable, for valid values see {@link JFilterInput::clean()}. Optional. * * @return The request user state. * * @since 11.1 * @deprecated 4.0 */ public function getUserStateFromRequest($key, $request, $default = null, $type = 'none') { $cur_state = $this->getUserState($key, $default); $new_state = $this->input->get($request, null, $type); // Save the new value only if it was set in this request. if ($new_state !== null) { $this->setUserState($key, $new_state); } else { $new_state = $cur_state; } return $new_state; } /** * Login authentication function. * * Username and encoded password are passed the onUserLogin event which * is responsible for the user validation. A successful validation updates * the current session record with the user's details. * * Username and encoded password are sent as credentials (along with other * possibilities) to each observer (authentication plugin) for user * validation. Successful validation will update the current session with * the user details. * * @param array $credentials Array('username' => string, 'password' => string) * @param array $options Array('remember' => boolean) * * @return boolean True on success. * * @since 11.1 * @deprecated 4.0 */ public function login($credentials, $options = array()) { // Get the global JAuthentication object. jimport('joomla.user.authentication'); JPluginHelper::importPlugin('user'); $authenticate = JAuthentication::getInstance(); $response = $authenticate->authenticate($credentials, $options); if ($response->status === JAuthentication::STATUS_SUCCESS) { // Validate that the user should be able to login (different to being authenticated). // This permits authentication plugins blocking the user $authorisations = $authenticate->authorise($response, $options); foreach ($authorisations as $authorisation) { $denied_states = array(JAuthentication::STATUS_EXPIRED, JAuthentication::STATUS_DENIED); if (in_array($authorisation->status, $denied_states)) { // Trigger onUserAuthorisationFailure Event. $this->triggerEvent('onUserAuthorisationFailure', array((array) $authorisation)); // If silent is set, just return false. if (isset($options['silent']) && $options['silent']) { return false; } // Return the error. switch ($authorisation->status) { case JAuthentication::STATUS_EXPIRED: return JError::raiseWarning('102002', JText::_('JLIB_LOGIN_EXPIRED')); break; case JAuthentication::STATUS_DENIED: return JError::raiseWarning('102003', JText::_('JLIB_LOGIN_DENIED')); break; default: return JError::raiseWarning('102004', JText::_('JLIB_LOGIN_AUTHORISATION')); break; } } } // Import the user plugin group. JPluginHelper::importPlugin('user'); // OK, the credentials are authenticated and user is authorised. Let's fire the onLogin event. $results = $this->triggerEvent('onUserLogin', array((array) $response, $options)); /* * If any of the user plugins did not successfully complete the login routine * then the whole method fails. * * Any errors raised should be done in the plugin as this provides the ability * to provide much more information about why the routine may have failed. */ $user = JFactory::getUser(); if ($response->type == 'Cookie') { $user->set('cookieLogin', true); } if (in_array(false, $results, true) == false) { $options['user'] = $user; $options['responseType'] = $response->type; if (isset($response->length) && isset($response->secure) && isset($response->lifetime)) { $options['length'] = $response->length; $options['secure'] = $response->secure; $options['lifetime'] = $response->lifetime; } // The user is successfully logged in. Run the after login events $this->triggerEvent('onUserAfterLogin', array($options)); } return true; } // Trigger onUserLoginFailure Event. $this->triggerEvent('onUserLoginFailure', array((array) $response)); // If silent is set, just return false. if (isset($options['silent']) && $options['silent']) { return false; } // If status is success, any error will have been raised by the user plugin if ($response->status !== JAuthentication::STATUS_SUCCESS) { JLog::add($response->error_message, JLog::WARNING, 'jerror'); } return false; } /** * Logout authentication function. * * Passed the current user information to the onUserLogout event and reverts the current * session record back to 'anonymous' parameters. * If any of the authentication plugins did not successfully complete * the logout routine then the whole method fails. Any errors raised * should be done in the plugin as this provides the ability to give * much more information about why the routine may have failed. * * @param integer $userid The user to load - Can be an integer or string - If string, it is converted to ID automatically * @param array $options Array('clientid' => array of client id's) * * @return boolean True on success * * @since 11.1 * @deprecated 4.0 */ public function logout($userid = null, $options = array()) { // Get a user object from the JApplication. $user = JFactory::getUser($userid); // Build the credentials array. $parameters['username'] = $user->get('username'); $parameters['id'] = $user->get('id'); // Set clientid in the options array if it hasn't been set already. if (!isset($options['clientid'])) { $options['clientid'] = $this->getClientId(); } // Import the user plugin group. JPluginHelper::importPlugin('user'); // OK, the credentials are built. Lets fire the onLogout event. $results = $this->triggerEvent('onUserLogout', array($parameters, $options)); if (!in_array(false, $results, true)) { $options['username'] = $user->get('username'); $results = $this->triggerEvent('onUserAfterLogout', array($options)); return true; } // Trigger onUserLoginFailure Event. $this->triggerEvent('onUserLogoutFailure', array($parameters)); return false; } /** * Gets the name of the current template. * * @param boolean $params An optional associative array of configuration settings * * @return mixed System is the fallback. * * @since 11.1 * @deprecated 4.0 */ public function getTemplate($params = false) { $template = new stdClass; $template->template = 'system'; $template->params = new Registry; if ($params) { return $template; } return $template->template; } /** * Returns the application JRouter object. * * @param string $name The name of the application. * @param array $options An optional associative array of configuration settings. * * @return JRouter A JRouter object * * @since 11.1 * @deprecated 4.0 */ public static function getRouter($name = null, array $options = array()) { if (!isset($name)) { $app = JFactory::getApplication(); $name = $app->getName(); } try { $router = JRouter::getInstance($name, $options); } catch (Exception $e) { return null; } return $router; } /** * This method transliterates a string into an URL * safe string or returns a URL safe UTF-8 string * based on the global configuration * * @param string $string String to process * * @return string Processed string * * @since 11.1 * @deprecated 4.0 Use JApplicationHelper::stringURLSafe instead */ public static function stringURLSafe($string) { return JApplicationHelper::stringURLSafe($string); } /** * Returns the application JPathway object. * * @param string $name The name of the application. * @param array $options An optional associative array of configuration settings. * * @return JPathway A JPathway object * * @since 11.1 * @deprecated 4.0 */ public function getPathway($name = null, $options = array()) { if (!isset($name)) { $name = $this->_name; } try { $pathway = JPathway::getInstance($name, $options); } catch (Exception $e) { return null; } return $pathway; } /** * Returns the application JPathway object. * * @param string $name The name of the application/client. * @param array $options An optional associative array of configuration settings. * * @return JMenu JMenu object. * * @since 11.1 * @deprecated 4.0 */ public function getMenu($name = null, $options = array()) { if (!isset($name)) { $name = $this->_name; } try { $menu = JMenu::getInstance($name, $options); } catch (Exception $e) { return null; } return $menu; } /** * Provides a secure hash based on a seed * * @param string $seed Seed string. * * @return string A secure hash * * @since 11.1 * @deprecated 4.0 Use JApplicationHelper::getHash instead */ public static function getHash($seed) { return JApplicationHelper::getHash($seed); } /** * Create the configuration registry. * * @param string $file The path to the configuration file * * @return JConfig A JConfig object * * @since 11.1 * @deprecated 4.0 */ protected function _createConfiguration($file) { JLoader::register('JConfig', $file); // Create the JConfig object. $config = new JConfig; // Get the global configuration object. $registry = JFactory::getConfig(); // Load the configuration values into the registry. $registry->loadObject($config); return $config; } /** * Create the user session. * * Old sessions are flushed based on the configuration value for the cookie * lifetime. If an existing session, then the last access time is updated. * If a new session, a session id is generated and a record is created in * the #__sessions table. * * @param string $name The sessions name. * * @return JSession JSession on success. May call exit() on database error. * * @since 11.1 * @deprecated 4.0 */ protected function _createSession($name) { $options = array(); $options['name'] = $name; switch ($this->_clientId) { case 0: if ($this->getCfg('force_ssl') == 2) { $options['force_ssl'] = true; } break; case 1: if ($this->getCfg('force_ssl') >= 1) { $options['force_ssl'] = true; } break; } $this->registerEvent('onAfterSessionStart', array($this, 'afterSessionStart')); $session = JFactory::getSession($options); $session->initialise($this->input, $this->dispatcher); $session->start(); // TODO: At some point we need to get away from having session data always in the db. $db = JFactory::getDbo(); // Remove expired sessions from the database. $time = time(); if ($time % 2) { // The modulus introduces a little entropy, making the flushing less accurate // but fires the query less than half the time. $query = $db->getQuery(true) ->delete($db->quoteName('#__session')) ->where($db->quoteName('time') . ' < ' . $db->quote((int) ($time - $session->getExpire()))); $db->setQuery($query); $db->execute(); } // Check to see the the session already exists. $handler = $this->getCfg('session_handler'); if (($handler != 'database' && ($time % 2 || $session->isNew())) || ($handler == 'database' && $session->isNew())) { $this->checkSession(); } return $session; } /** * Checks the user session. * * If the session record doesn't exist, initialise it. * If session is new, create session variables * * @return void * * @since 11.1 * @deprecated 4.0 */ public function checkSession() { $db = JFactory::getDbo(); $session = JFactory::getSession(); $user = JFactory::getUser(); $query = $db->getQuery(true) ->select($db->quoteName('session_id')) ->from($db->quoteName('#__session')) ->where($db->quoteName('session_id') . ' = ' . $db->quote($session->getId())); $db->setQuery($query, 0, 1); $exists = $db->loadResult(); // If the session record doesn't exist initialise it. if (!$exists) { $query->clear(); if ($session->isNew()) { $query->insert($db->quoteName('#__session')) ->columns($db->quoteName('session_id') . ', ' . $db->quoteName('client_id') . ', ' . $db->quoteName('time')) ->values($db->quote($session->getId()) . ', ' . (int) $this->getClientId() . ', ' . $db->quote((int) time())); $db->setQuery($query); } else { $query->insert($db->quoteName('#__session')) ->columns( $db->quoteName('session_id') . ', ' . $db->quoteName('client_id') . ', ' . $db->quoteName('guest') . ', ' . $db->quoteName('time') . ', ' . $db->quoteName('userid') . ', ' . $db->quoteName('username') ) ->values( $db->quote($session->getId()) . ', ' . (int) $this->getClientId() . ', ' . (int) $user->get('guest') . ', ' . $db->quote((int) $session->get('session.timer.start')) . ', ' . (int) $user->get('id') . ', ' . $db->quote($user->get('username')) ); $db->setQuery($query); } // If the insert failed, exit the application. try { $db->execute(); } catch (RuntimeException $e) { jexit($e->getMessage()); } } } /** * After the session has been started we need to populate it with some default values. * * @return void * * @since 12.2 * @deprecated 4.0 */ public function afterSessionStart() { $session = JFactory::getSession(); if ($session->isNew()) { $session->set('registry', new Registry('session')); $session->set('user', new JUser); } } /** * Gets the client id of the current running application. * * @return integer A client identifier. * * @since 11.1 * @deprecated 4.0 */ public function getClientId() { return $this->_clientId; } /** * Is admin interface? * * @return boolean True if this application is administrator. * * @since 11.1 * @deprecated 4.0 */ public function isAdmin() { return ($this->_clientId == 1); } /** * Is site interface? * * @return boolean True if this application is site. * * @since 11.1 * @deprecated 4.0 */ public function isSite() { return ($this->_clientId == 0); } /** * Method to determine if the host OS is Windows * * @return boolean True if Windows OS * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) Use the IS_WIN constant instead. */ public static function isWinOs() { JLog::add('JApplication::isWinOS() is deprecated. Use the IS_WIN constant instead.', JLog::WARNING, 'deprecated'); return IS_WIN; } /** * Determine if we are using a secure (SSL) connection. * * @return boolean True if using SSL, false if not. * * @since 12.2 * @deprecated 4.0 */ public function isSSLConnection() { return ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) || getenv('SSL_PROTOCOL_VERSION')); } /** * Returns the response as a string. * * @return string The response * * @since 11.1 * @deprecated 4.0 */ public function __toString() { $compress = $this->getCfg('gzip', false); return JResponse::toString($compress); } } PK���\������'libraries/legacy/application/daemon.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; JLog::add('JDaemon has been renamed to JApplicationDaemon.', JLog::WARNING, 'deprecated'); /** * Backward Compatability Stub for JApplicationDaemon * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JApplicationDaemon instead. * @codeCoverageIgnore */ class JDaemon extends JApplicationDaemon { /** * Class constructor. * * @param JInputCli $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInputCli object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param JEventDispatcher $dispatcher An optional argument to provide dependency injection for the application's * event dispatcher. If the argument is a JEventDispatcher object that object will become * the application's event dispatcher, if it is null then the default event dispatcher * will be created based on the application's loadDispatcher() method. * * @since 11.1 * @deprecated 12.3 Use JApplicationDaemon instead. * @throws RuntimeException */ public function __construct(JInputCli $input = null, Registry $config = null, JEventDispatcher $dispatcher = null) { JLog::add('JDaemon is deprecated. Use JApplicationDaemon instead.', JLog::WARNING, 'deprecated'); parent::__construct($input, $config, $dispatcher); } } PK���\T7�11libraries/cms/help/help.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Help * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Help system class * * @since 1.5 */ class JHelp { /** * Create a URL for a given help key reference * * @param string $ref The name of the help screen (its key reference) * @param boolean $useComponent Use the help file in the component directory * @param string $override Use this URL instead of any other * @param string $component Name of component (or null for current component) * * @return string * * @since 1.5 */ public static function createUrl($ref, $useComponent = false, $override = null, $component = null) { $local = false; $app = JFactory::getApplication(); if (is_null($component)) { $component = JApplicationHelper::getComponentName(); } // Determine the location of the help file. At this stage the URL // can contain substitution codes that will be replaced later. if ($override) { $url = $override; } else { // Get the user help URL. $user = JFactory::getUser(); $url = $user->getParam('helpsite'); // If user hasn't specified a help URL, then get the global one. if ($url == '') { $url = $app->get('helpurl'); } // Component help URL overrides user and global. if ($useComponent) { // Look for help URL in component parameters. $params = JComponentHelper::getParams($component); $url = $params->get('helpURL'); if ($url == '') { $local = true; $url = 'components/{component}/help/{language}/{keyref}'; } } // Set up a local help URL. if (!$url) { $local = true; $url = 'help/{language}/{keyref}'; } } // If the URL is local then make sure we have a valid file extension on the URL. if ($local) { if (!preg_match('#\.html$|\.xml$#i', $ref)) { $url .= '.html'; } } /* * Replace substitution codes in the URL. */ $lang = JFactory::getLanguage(); $version = new JVersion; $jver = explode('.', $version->getShortVersion()); $jlang = explode('-', $lang->getTag()); $debug = $lang->setDebug(false); $keyref = JText::_($ref); $lang->setDebug($debug); // Replace substitution codes in help URL. $search = array( // Application name (eg. 'Administrator') '{app}', // Component name (eg. 'com_content') '{component}', // Help screen key reference '{keyref}', // Full language code (eg. 'en-GB') '{language}', // Short language code (eg. 'en') '{langcode}', // Region code (eg. 'GB') '{langregion}', // Joomla major version number '{major}', // Joomla minor version number '{minor}', // Joomla maintenance version number '{maintenance}' ); $replace = array( // {app} $app->getName(), // {component} $component, // {keyref} $keyref, // {language} $lang->getTag(), // {langcode} $jlang[0], // {langregion} $jlang[1], // {major} $jver[0], // {minor} $jver[1], // {maintenance} $jver[2] ); // If the help file is local then check it exists. // If it doesn't then fallback to English. if ($local) { $try = str_replace($search, $replace, $url); if (!is_file(JPATH_BASE . '/' . $try)) { $replace[3] = 'en-GB'; $replace[4] = 'en'; $replace[5] = 'GB'; } } $url = str_replace($search, $replace, $url); return $url; } /** * Builds a list of the help sites which can be used in a select option. * * @param string $pathToXml Path to an XML file. * * @return array An array of arrays (text, value, selected). * * @since 1.5 */ public static function createSiteList($pathToXml) { $list = array(); $xml = false; if (!empty($pathToXml)) { $xml = simplexml_load_file($pathToXml); } if (!$xml) { $option['text'] = 'English (GB) help.joomla.org'; $option['value'] = 'http://help.joomla.org'; $list[] = $option; } else { $option = array(); foreach ($xml->sites->site as $site) { $option['text'] = (string) $site; $option['value'] = (string) $site->attributes()->url; $list[] = $option; } } return $list; } } PK���\=�KFF"libraries/cms/schema/changeset.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Schema * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); /** * Contains a set of JSchemaChange objects for a particular instance of Joomla. * Each of these objects contains a DDL query that should have been run against * the database when this database was created or updated. This enables the * Installation Manager to check that the current database schema is up to date. * * @since 2.5 */ class JSchemaChangeset { /** * Array of JSchemaChangeitem objects * * @var array * @since 2.5 */ protected $changeItems = array(); /** * JDatabaseDriver object * * @var JDatabaseDriver * @since 2.5 */ protected $db = null; /** * Folder where SQL update files will be found * * @var string */ protected $folder = null; /** * Constructor: builds array of $changeItems by processing the .sql files in a folder. * The folder for the Joomla core updates is administrator/components/com_admin/sql/updates/<database>. * * @param JDatabaseDriver $db The current database object * @param string $folder The full path to the folder containing the update queries * * @since 2.5 */ public function __construct($db, $folder = null) { $this->db = $db; $this->folder = $folder; $updateFiles = $this->getUpdateFiles(); $updateQueries = $this->getUpdateQueries($updateFiles); foreach ($updateQueries as $obj) { $this->changeItems[] = JSchemaChangeitem::getInstance($db, $obj->file, $obj->updateQuery); } } /** * Returns a reference to the JSchemaChangeset object, only creating it if it doesn't already exist. * * @param JDatabaseDriver $db The current database object * @param string $folder The full path to the folder containing the update queries * * @return JSchemaChangeset * * @since 2.5 */ public static function getInstance($db, $folder) { static $instance; if (!is_object($instance)) { $instance = new JSchemaChangeset($db, $folder); } return $instance; } /** * Checks the database and returns an array of any errors found. * Note these are not database errors but rather situations where * the current schema is not up to date. * * @return array Array of errors if any. * * @since 2.5 */ public function check() { $errors = array(); foreach ($this->changeItems as $item) { if ($item->check() === -2) { // Error found $errors[] = $item; } } return $errors; } /** * Runs the update query to apply the change to the database * * @return void * * @since 2.5 */ public function fix() { $this->check(); foreach ($this->changeItems as $item) { $item->fix(); } } /** * Returns an array of results for this set * * @return array associative array of changeitems grouped by unchecked, ok, error, and skipped * * @since 2.5 */ public function getStatus() { $result = array('unchecked' => array(), 'ok' => array(), 'error' => array(), 'skipped' => array()); foreach ($this->changeItems as $item) { switch ($item->checkStatus) { case 0: $result['unchecked'][] = $item; break; case 1: $result['ok'][] = $item; break; case -2: $result['error'][] = $item; break; case -1: $result['skipped'][] = $item; break; } } return $result; } /** * Gets the current database schema, based on the highest version number. * Note that the .sql files are named based on the version and date, so * the file name of the last file should match the database schema version * in the #__schemas table. * * @return string the schema version for the database * * @since 2.5 */ public function getSchema() { $updateFiles = $this->getUpdateFiles(); $result = new SplFileInfo(array_pop($updateFiles)); return $result->getBasename('.sql'); } /** * Get list of SQL update files for this database * * @return array list of sql update full-path names * * @since 2.5 */ private function getUpdateFiles() { // Get the folder from the database name $sqlFolder = $this->db->name; if ($sqlFolder == 'mysqli' || $sqlFolder == 'pdomysql') { $sqlFolder = 'mysql'; } elseif ($sqlFolder == 'sqlsrv') { $sqlFolder = 'sqlazure'; } // Default folder to core com_admin if (!$this->folder) { $this->folder = JPATH_ADMINISTRATOR . '/components/com_admin/sql/updates/'; } return JFolder::files( $this->folder . '/' . $sqlFolder, '\.sql$', 1, true, array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array('^\..*', '.*~'), true ); } /** * Get array of SQL queries * * @param array $sqlfiles Array of .sql update filenames. * * @return array Array of stdClass objects where: * file=filename, * update_query = text of SQL update query * * @since 2.5 */ private function getUpdateQueries(array $sqlfiles) { // Hold results as array of objects $result = array(); foreach ($sqlfiles as $file) { $buffer = file_get_contents($file); // Create an array of queries from the sql file $queries = JDatabaseDriver::splitSql($buffer); foreach ($queries as $query) { if ($trimmedQuery = $this->trimQuery($query)) { $fileQueries = new stdClass; $fileQueries->file = $file; $fileQueries->updateQuery = $trimmedQuery; $result[] = $fileQueries; } } } return $result; } /** * Trim comment and blank lines out of a query string * * @param string $query query string to be trimmed * * @return string String with leading comment lines removed * * @since 3.1 */ private function trimQuery($query) { $query = trim($query); while (substr($query, 0, 1) == '#' || substr($query, 0, 2) == '--' || substr($query, 0, 2) == '/*') { $endChars = (substr($query, 0, 1) == '#' || substr($query, 0, 2) == '--') ? "\n" : "*/"; if ($position = strpos($query, $endChars)) { $query = trim(substr($query, $position + strlen($endChars))); } else { // If no newline, the rest of the file is a comment, so return an empty string. return ''; } } return trim($query); } } PK���\���Nxx#libraries/cms/schema/changeitem.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Schema * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Each object represents one query, which is one line from a DDL SQL query. * This class is used to check the site's database to see if the DDL query has been run. * If not, it provides the ability to fix the database by re-running the DDL query. * The queries are parsed from the update files in the folder * administrator/components/com_admin/sql/updates/<database>. * These updates are run automatically if the site was updated using com_installer. * However, it is possible that the program files could be updated without udpating * the database (for example, if a user just copies the new files over the top of an * existing installation). * * This is an abstract class. We need to extend it for each database and add a * buildCheckQuery() method that creates the query to check that a DDL query has been run. * * @since 2.5 */ abstract class JSchemaChangeitem { /** * Update file: full path file name where query was found * * @var string * @since 2.5 */ public $file = null; /** * Update query: query used to change the db schema (one line from the file) * * @var string * @since 2.5 */ public $updateQuery = null; /** * Check query: query used to check the db schema * * @var string * @since 2.5 */ public $checkQuery = null; /** * Check query result: expected result of check query if database is up to date * * @var string * @since 2.5 */ public $checkQueryExpected = 1; /** * JDatabaseDriver object * * @var JDatabaseDriver * @since 2.5 */ public $db = null; /** * Query type: To be used in building a language key for a * message to tell user what was checked / changed * Possible values: ADD_TABLE, ADD_COLUMN, CHANGE_COLUMN_TYPE, ADD_INDEX * * @var string * @since 2.5 */ public $queryType = null; /** * Array with values for use in a JText::sprintf statment indicating what was checked * * Tells you what the message should be, based on which elements are defined, as follows: * For ADD_TABLE: table * For ADD_COLUMN: table, column * For CHANGE_COLUMN_TYPE: table, column, type * For ADD_INDEX: table, index * * @var array * @since 2.5 */ public $msgElements = array(); /** * Checked status * * @var integer 0=not checked, -1=skipped, -2=failed, 1=succeeded * @since 2.5 */ public $checkStatus = 0; /** * Rerun status * * @var int 0=not rerun, -1=skipped, -2=failed, 1=succeeded * @since 2.5 */ public $rerunStatus = 0; /** * Constructor: builds check query and message from $updateQuery * * @param JDatabaseDriver $db Database connector object * @param string $file Full path name of the sql file * @param string $query Text of the sql query (one line of the file) * * @since 2.5 */ public function __construct($db, $file, $query) { $this->updateQuery = $query; $this->file = $file; $this->db = $db; $this->buildCheckQuery(); } /** * Returns a reference to the JSchemaChangeitem object. * * @param JDatabaseDriver $db Database connector object * @param string $file Full path name of the sql file * @param string $query Text of the sql query (one line of the file) * * @return JSchemaChangeitem instance based on the database driver * * @since 2.5 * @throws RuntimeException if class for database driver not found */ public static function getInstance($db, $file, $query) { // Get the class name $dbname = $db->name; if ($dbname == 'mysqli' || $dbname == 'pdomysql') { $dbname = 'mysql'; } elseif ($dbname == 'sqlazure') { $dbname = 'sqlsrv'; } $class = 'JSchemaChangeitem' . ucfirst($dbname); // If the class exists, return it. if (class_exists($class)) { return new $class($db, $file, $query); } throw new RuntimeException(sprintf('JSchemaChangeitem child class not found for the %s database driver', $dbname), 500); } /** * Checks a DDL query to see if it is a known type * If yes, build a check query to see if the DDL has been run on the database. * If successful, the $msgElements, $queryType, $checkStatus and $checkQuery fields are populated. * The $msgElements contains the text to create the user message. * The $checkQuery contains the SQL query to check whether the schema change has * been run against the current database. The $queryType contains the type of * DDL query that was run (for example, CREATE_TABLE, ADD_COLUMN, CHANGE_COLUMN_TYPE, ADD_INDEX). * The $checkStatus field is set to zero if the query is created * * If not successful, $checkQuery is empty and , and $checkStatus is -1. * For example, this will happen if the current line is a non-DDL statement. * * @return void * * @since 2.5 */ abstract protected function buildCheckQuery(); /** * Runs the check query and checks that 1 row is returned * If yes, return true, otherwise return false * * @return boolean true on success, false otherwise * * @since 2.5 */ public function check() { $this->checkStatus = -1; if ($this->checkQuery) { $this->db->setQuery($this->checkQuery); try { $rows = $this->db->loadObject(); } catch (RuntimeException $e) { $rows = false; // Still render the error message from the Exception object JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); } if ($rows !== false) { if (count($rows) === $this->checkQueryExpected) { $this->checkStatus = 1; } else { $this->checkStatus = -2; } } else { $this->checkStatus = -2; } } return $this->checkStatus; } /** * Runs the update query to apply the change to the database * * @return void * * @since 2.5 */ public function fix() { if ($this->checkStatus === -2) { // At this point we have a failed query $this->db->setQuery($this->updateQuery); if ($this->db->execute()) { if ($this->check()) { $this->checkStatus = 1; $this->rerunStatus = 1; } else { $this->rerunStatus = -2; } } else { $this->rerunStatus = -2; } } } } PK���\�2���)libraries/cms/schema/changeitem/mysql.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Schema * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Checks the database schema against one MySQL DDL query to see if it has been run. * * @since 2.5 */ class JSchemaChangeitemMysql extends JSchemaChangeitem { /** * Checks a DDL query to see if it is a known type * If yes, build a check query to see if the DDL has been run on the database. * If successful, the $msgElements, $queryType, $checkStatus and $checkQuery fields are populated. * The $msgElements contains the text to create the user message. * The $checkQuery contains the SQL query to check whether the schema change has * been run against the current database. The $queryType contains the type of * DDL query that was run (for example, CREATE_TABLE, ADD_COLUMN, CHANGE_COLUMN_TYPE, ADD_INDEX). * The $checkStatus field is set to zero if the query is created * * If not successful, $checkQuery is empty and , and $checkStatus is -1. * For example, this will happen if the current line is a non-DDL statement. * * @return void * * @since 2.5 */ protected function buildCheckQuery() { // Initialize fields in case we can't create a check query $this->checkStatus = -1; // change status to skipped $result = null; // Remove any newlines $this->updateQuery = str_replace("\n", '', $this->updateQuery); // Fix up extra spaces around () and in general $find = array('#((\s*)\(\s*([^)\s]+)\s*)(\))#', '#(\s)(\s*)#'); $replace = array('($3)', '$1'); $updateQuery = preg_replace($find, $replace, $this->updateQuery); $wordArray = explode(' ', $updateQuery); // First, make sure we have an array of at least 6 elements // if not, we can't make a check query for this one if (count($wordArray) < 6) { // Done with method return; } // We can only make check queries for alter table and create table queries $command = strtoupper($wordArray[0] . ' ' . $wordArray[1]); if ($command === 'ALTER TABLE') { $alterCommand = strtoupper($wordArray[3] . ' ' . $wordArray[4]); if ($alterCommand == 'ADD COLUMN') { $result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = ' . $this->fixQuote($wordArray[5]); $this->queryType = 'ADD_COLUMN'; $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5])); } elseif ($alterCommand == 'ADD INDEX' || $alterCommand == 'ADD UNIQUE') { if ($pos = strpos($wordArray[5], '(')) { $index = $this->fixQuote(substr($wordArray[5], 0, $pos)); } else { $index = $this->fixQuote($wordArray[5]); } $result = 'SHOW INDEXES IN ' . $wordArray[2] . ' WHERE Key_name = ' . $index; $this->queryType = 'ADD_INDEX'; $this->msgElements = array($this->fixQuote($wordArray[2]), $index); } elseif ($alterCommand == 'DROP INDEX') { $index = $this->fixQuote($wordArray[5]); $result = 'SHOW INDEXES IN ' . $wordArray[2] . ' WHERE Key_name = ' . $index; $this->queryType = 'DROP_INDEX'; $this->checkQueryExpected = 0; $this->msgElements = array($this->fixQuote($wordArray[2]), $index); } elseif ($alterCommand == 'DROP COLUMN') { $index = $this->fixQuote($wordArray[5]); $result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE Field = ' . $index; $this->queryType = 'DROP_COLUMN'; $this->checkQueryExpected = 0; $this->msgElements = array($this->fixQuote($wordArray[2]), $index); } elseif (strtoupper($wordArray[3]) == 'MODIFY') { // Kludge to fix problem with "integer unsigned" $type = $this->fixQuote($wordArray[5]); if (isset($wordArray[6])) { $type = $this->fixQuote($this->fixInteger($wordArray[5], $wordArray[6])); } $result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = ' . $this->fixQuote($wordArray[4]) . ' AND type = ' . $type; $this->queryType = 'CHANGE_COLUMN_TYPE'; $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[4]), $type); } elseif (strtoupper($wordArray[3]) == 'CHANGE') { // Kludge to fix problem with "integer unsigned" $type = $this->fixQuote($this->fixInteger($wordArray[6], $wordArray[7])); $result = 'SHOW COLUMNS IN ' . $wordArray[2] . ' WHERE field = ' . $this->fixQuote($wordArray[4]) . ' AND type = ' . $type; $this->queryType = 'CHANGE_COLUMN_TYPE'; $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[4]), $type); } } if ($command == 'CREATE TABLE') { if (strtoupper($wordArray[2] . $wordArray[3] . $wordArray[4]) == 'IFNOTEXISTS') { $table = $wordArray[5]; } else { $table = $wordArray[2]; } $result = 'SHOW TABLES LIKE ' . $this->fixQuote($table); $this->queryType = 'CREATE_TABLE'; $this->msgElements = array($this->fixQuote($table)); } // Set fields based on results if ($this->checkQuery = $result) { // Unchecked status $this->checkStatus = 0; } else { // Skipped $this->checkStatus = -1; } } /** * Fix up integer. Fixes problem with MySQL integer descriptions. * If you change a column to "integer unsigned" it shows * as "int(10) unsigned" in the check query. * * @param string $type1 the column type * @param string $type2 the column attributes * * @return string The original or changed column type. * * @since 2.5 */ private function fixInteger($type1, $type2) { $result = $type1; if (strtolower($type1) == "integer" && strtolower(substr($type2, 0, 8)) == 'unsigned') { $result = 'int(10) unsigned'; } return $result; } /** * Fixes up a string for inclusion in a query. * Replaces name quote character with normal quote for literal. * Drops trailing semi-colon. Injects the database prefix. * * @param string $string The input string to be cleaned up. * * @return string The modified string. * * @since 2.5 */ private function fixQuote($string) { $string = str_replace('`', '', $string); $string = str_replace(';', '', $string); $string = str_replace('#__', $this->db->getPrefix(), $string); return $this->db->quote($string); } } PK���\?h�FF*libraries/cms/schema/changeitem/sqlsrv.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Schema * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Checks the database schema against one SQL Server DDL query to see if it has been run. * * @since 2.5 */ class JSchemaChangeitemSqlsrv extends JSchemaChangeitem { /** * Checks a DDL query to see if it is a known type * If yes, build a check query to see if the DDL has been run on the database. * If successful, the $msgElements, $queryType, $checkStatus and $checkQuery fields are populated. * The $msgElements contains the text to create the user message. * The $checkQuery contains the SQL query to check whether the schema change has * been run against the current database. The $queryType contains the type of * DDL query that was run (for example, CREATE_TABLE, ADD_COLUMN, CHANGE_COLUMN_TYPE, ADD_INDEX). * The $checkStatus field is set to zero if the query is created * * If not successful, $checkQuery is empty and , and $checkStatus is -1. * For example, this will happen if the current line is a non-DDL statement. * * @return void * * @since 2.5 */ protected function buildCheckQuery() { // Initialize fields in case we can't create a check query $this->checkStatus = -1; // change status to skipped $result = null; // Remove any newlines $this->updateQuery = str_replace("\n", '', $this->updateQuery); // Fix up extra spaces around () and in general $find = array('#((\s*)\(\s*([^)\s]+)\s*)(\))#', '#(\s)(\s*)#'); $replace = array('($3)', '$1'); $updateQuery = preg_replace($find, $replace, $this->updateQuery); $wordArray = explode(' ', $updateQuery); // First, make sure we have an array of at least 6 elements // if not, we can't make a check query for this one if (count($wordArray) < 6) { // Done with method return; } // We can only make check queries for alter table and create table queries $command = strtoupper($wordArray[0] . ' ' . $wordArray[1]); if ($command === 'ALTER TABLE') { $alterCommand = strtoupper($wordArray[3] . ' ' . $wordArray[4]); if ($alterCommand == 'ADD') { $result = 'SELECT * FROM INFORMATION_SCHEMA.Columns ' . $wordArray[2] . ' WHERE COLUMN_NAME = ' . $this->fixQuote($wordArray[5]); $this->queryType = 'ADD'; $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5])); } elseif ($alterCommand == 'CREATE INDEX') { $index = $this->fixQuote(substr($wordArray[5], 0, strpos($wordArray[5], '('))); $result = 'SELECT * FROM SYS.INDEXES ' . $wordArray[2] . ' WHERE name = ' . $index; $this->queryType = 'CREATE INDEX'; $this->msgElements = array($this->fixQuote($wordArray[2]), $index); } elseif (strtoupper($wordArray[3]) == 'MODIFY' || strtoupper($wordArray[3]) == 'CHANGE') { $result = 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = ' . $this->fixQuote($wordArray[2]); $this->queryType = 'ALTER COLUMN COLUMN_NAME =' . $this->fixQuote($wordArray[4]); $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[4])); } } if ($command == 'CREATE TABLE') { $table = $wordArray[2]; $result = 'SELECT * FROM sys.TABLES WHERE NAME = ' . $this->fixQuote($table); $this->queryType = 'CREATE_TABLE'; $this->msgElements = array($this->fixQuote($table)); } // Set fields based on results if ($this->checkQuery = $result) { // Unchecked status $this->checkStatus = 0; } else { // Skipped $this->checkStatus = -1; } } /** * Fix up integer. Fixes problem with MySQL integer descriptions. * If you change a column to "integer unsigned" it shows * as "int(10) unsigned" in the check query. * * @param string $type1 the column type * @param string $type2 the column attributes * * @return string The original or changed column type. * * @since 2.5 */ private function fixInteger($type1, $type2) { $result = $type1; if (strtolower($type1) == 'integer' && strtolower(substr($type2, 0, 8)) == 'unsigned') { $result = 'int'; } return $result; } /** * Fixes up a string for inclusion in a query. * Replaces name quote character with normal quote for literal. * Drops trailing semi-colon. Injects the database prefix. * * @param string $string The input string to be cleaned up. * * @return string The modified string. * * @since 2.5 */ private function fixQuote($string) { $string = str_replace('[', '', $string); $string = str_replace(']', '', $string); $string = str_replace('`', '', $string); $string = str_replace(';', '', $string); $string = str_replace('#__', $this->db->getPrefix(), $string); return $this->db->quote($string); } } PK���\�)�77.libraries/cms/schema/changeitem/postgresql.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Schema * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Checks the database schema against one PostgreSQL DDL query to see if it has been run. * * @since 3.0 */ class JSchemaChangeitemPostgresql extends JSchemaChangeitem { /** * Checks a DDL query to see if it is a known type * If yes, build a check query to see if the DDL has been run on the database. * If successful, the $msgElements, $queryType, $checkStatus and $checkQuery fields are populated. * The $msgElements contains the text to create the user message. * The $checkQuery contains the SQL query to check whether the schema change has * been run against the current database. The $queryType contains the type of * DDL query that was run (for example, CREATE_TABLE, ADD_COLUMN, CHANGE_COLUMN_TYPE, ADD_INDEX). * The $checkStatus field is set to zero if the query is created * * If not successful, $checkQuery is empty and , and $checkStatus is -1. * For example, this will happen if the current line is a non-DDL statement. * * @return void * * @since 3.0 */ protected function buildCheckQuery() { // Initialize fields in case we can't create a check query $this->checkStatus = -1; // change status to skipped $result = null; // Remove any newlines $this->updateQuery = str_replace("\n", '', $this->updateQuery); // Fix up extra spaces around () and in general $find = array('#((\s*)\(\s*([^)\s]+)\s*)(\))#', '#(\s)(\s*)#'); $replace = array('($3)', '$1'); $updateQuery = preg_replace($find, $replace, $this->updateQuery); $wordArray = explode(' ', $updateQuery); // First, make sure we have an array of at least 6 elements // if not, we can't make a check query for this one if (count($wordArray) < 6) { // Done with method return; } // We can only make check queries for alter table and create table queries $command = strtoupper($wordArray[0] . ' ' . $wordArray[1]); if ($command === 'ALTER TABLE') { $alterCommand = strtoupper($wordArray[3] . ' ' . $wordArray[4]); if ($alterCommand === 'ADD COLUMN') { $result = 'SELECT column_name FROM information_schema.columns WHERE table_name=' . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]); $this->queryType = 'ADD_COLUMN'; $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5])); } elseif ($alterCommand === 'DROP COLUMN') { $result = 'SELECT column_name FROM information_schema.columns WHERE table_name=' . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]); $this->queryType = 'DROP_COLUMN'; $this->checkQueryExpected = 0; $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5])); } elseif ($alterCommand === 'ALTER COLUMN') { if (strtoupper($wordArray[6]) == 'TYPE') { $type = ''; for ($i = 7; $i < count($wordArray); $i++) { $type .= $wordArray[$i] . ' '; } if ($pos = strpos($type, '(')) { $type = substr($type, 0, $pos); } if ($pos = strpos($type, ';')) { $type = substr($type, 0, $pos); } $result = 'SELECT column_name, data_type FROM information_schema.columns WHERE table_name=' . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]) . ' AND data_type=' . $this->fixQuote($type); $this->queryType = 'CHANGE_COLUMN_TYPE'; $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]), $type); } elseif (strtoupper($wordArray[7] . ' ' . $wordArray[8]) == 'NOT NULL') { if (strtoupper($wordArray[6]) == 'SET') { // SET NOT NULL $isNullable = $this->fixQuote('NO'); } else { // DROP NOT NULL $isNullable = $this->fixQuote('YES'); } $result = 'SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_name=' . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]) . ' AND is_nullable=' . $isNullable; $this->queryType = 'CHANGE_COLUMN_TYPE'; $this->checkQueryExpected = 1; $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]), $isNullable); } elseif (strtoupper($wordArray[7]) === 'DEFAULT') { if (strtoupper($wordArray[6]) == 'SET') { $isNullDef = 'IS NOT NULL'; } else { // DROP DEFAULT $isNullDef = 'IS NULL'; } $result = 'SELECT column_name, data_type, column_default FROM information_schema.columns WHERE table_name=' . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]) . ' AND column_default ' . $isNullDef; $this->queryType = 'CHANGE_COLUMN_TYPE'; $this->checkQueryExpected = 1; $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]), $isNullDef); } } } elseif ($command === 'DROP INDEX') { if (strtoupper($wordArray[2] . $wordArray[3]) == 'IFEXISTS') { $idx = $this->fixQuote($wordArray[4]); } else { $idx = $this->fixQuote($wordArray[2]); } $result = 'SELECT * FROM pg_indexes WHERE indexname=' . $idx; $this->queryType = 'DROP_INDEX'; $this->checkQueryExpected = 0; $this->msgElements = array($this->fixQuote($idx)); } elseif ($command == 'CREATE INDEX' || (strtoupper($command . $wordArray[2]) == 'CREATE UNIQUE INDEX')) { if ($wordArray[1] === 'UNIQUE') { $idx = $this->fixQuote($wordArray[3]); $table = $this->fixQuote($wordArray[5]); } else { $idx = $this->fixQuote($wordArray[2]); $table = $this->fixQuote($wordArray[4]); } $result = 'SELECT * FROM pg_indexes WHERE indexname=' . $idx . ' AND tablename=' . $table; $this->queryType = 'ADD_INDEX'; $this->checkQueryExpected = 1; $this->msgElements = array($table, $idx); } if ($command == 'CREATE TABLE') { if (strtoupper($wordArray[2] . $wordArray[3] . $wordArray[4]) == 'IFNOTEXISTS') { $table = $this->fixQuote($wordArray[5]); } else { $table = $this->fixQuote($wordArray[2]); } $result = 'SELECT table_name FROM information_schema.tables WHERE table_name=' . $table; $this->queryType = 'CREATE_TABLE'; $this->checkQueryExpected = 1; $this->msgElements = array($table); } // Set fields based on results if ($this->checkQuery = $result) { // Unchecked status $this->checkStatus = 0; } else { // Skipped $this->checkStatus = -1; } } /** * Fix up integer. Fixes problem with PostgreSQL integer descriptions. * If you change a column to "integer unsigned" it shows * as "int(10) unsigned" in the check query. * * @param string $type1 the column type * @param string $type2 the column attributes * * @return string The original or changed column type. * * @since 3.0 */ private function fixInteger($type1, $type2) { $result = $type1; if (strtolower($type1) == 'integer' && strtolower(substr($type2, 0, 8)) == 'unsigned') { $result = 'unsigned int(10)'; } return $result; } /** * Fixes up a string for inclusion in a query. * Replaces name quote character with normal quote for literal. * Drops trailing semi-colon. Injects the database prefix. * * @param string $string The input string to be cleaned up. * * @return string The modified string. * * @since 3.0 */ private function fixQuote($string) { $string = str_replace('"', '', $string); $string = str_replace(';', '', $string); $string = str_replace('#__', $this->db->getPrefix(), $string); return $this->db->quote($string); } } PK���\�/o�PP2libraries/cms/component/router/rules/interface.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Component * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ /** * JComponentRouterRules interface for Joomla * * @since 3.4 */ interface JComponentRouterRulesInterface { /** * Prepares a query set to be handed over to the build() method. * This should complete a partial query set to work as a complete non-SEFed * URL and in general make sure that all information is present and properly * formatted. For example, the Itemid should be retrieved and set here. * * @param array &$query The query array to process * * @return void * * @since 3.4 */ public function preprocess(&$query); /** * Parses an URI to retrieve informations for the right route through * the component. * This method should retrieve all its input from its method arguments. * * @param array &$segments The URL segments to parse * @param array &$vars The vars that result from the segments * * @return void * * @since 3.4 */ public function parse(&$segments, &$vars); /** * Builds URI segments from a query to encode the necessary informations * for a route in a human-readable URL. * This method should retrieve all its input from its method arguments. * * @param array &$query The vars that should be converted * @param array &$segments The URL segments to create * * @return void * * @since 3.4 */ public function build(&$query, &$segments); } PK���\��5CC,libraries/cms/component/router/interface.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Component * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Component routing interface * * @since 3.3 */ interface JComponentRouterInterface { /** * Prepare-method for URLs * This method is meant to validate and complete the URL parameters. * For example it can add the Itemid or set a language parameter. * This method is executed on each URL, regardless of SEF mode switched * on or not. * * @param array $query An associative array of URL arguments * * @return array The URL arguments to use to assemble the subsequent URL. * * @since 3.3 */ public function preprocess($query); /** * Build method for URLs * This method is meant to transform the query parameters into a more human * readable form. It is only executed when SEF mode is switched on. * * @param array &$query An array of URL arguments * * @return array The URL arguments to use to assemble the subsequent URL. * * @since 3.3 */ public function build(&$query); /** * Parse method for URLs * This method is meant to transform the human readable URL back into * query parameters. It is only executed when SEF mode is switched on. * * @param array &$segments The segments of the URL to parse. * * @return array The URL attributes to be used by the application. * * @since 3.3 */ public function parse(&$segments); } PK���\p�\Ա�)libraries/cms/component/router/legacy.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Component * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Default routing class for missing or legacy component routers * * @since 3.3 */ class JComponentRouterLegacy implements JComponentRouterInterface { /** * Name of the component * * @var string * @since 3.3 */ protected $component; /** * Constructor * * @param string $component Component name without the com_ prefix this router should react upon * * @since 3.3 */ public function __construct($component) { $this->component = $component; } /** * Generic preprocess function for missing or legacy component router * * @param array $query An associative array of URL arguments * * @return array The URL arguments to use to assemble the subsequent URL. * * @since 3.3 */ public function preprocess($query) { return $query; } /** * Generic build function for missing or legacy component router * * @param array &$query An array of URL arguments * * @return array The URL arguments to use to assemble the subsequent URL. * * @since 3.3 */ public function build(&$query) { $function = $this->component . 'BuildRoute'; if (function_exists($function)) { $segments = $function($query); $total = count($segments); for ($i = 0; $i < $total; $i++) { $segments[$i] = str_replace(':', '-', $segments[$i]); } return $segments; } return array(); } /** * Generic parse function for missing or legacy component router * * @param array &$segments The segments of the URL to parse. * * @return array The URL attributes to be used by the application. * * @since 3.3 */ public function parse(&$segments) { $function = $this->component . 'ParseRoute'; if (function_exists($function)) { $total = count($segments); for ($i = 0; $i < $total; $i++) { $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); } return $function($segments); } return array(); } } PK���\u���oo'libraries/cms/component/router/base.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Component * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Base component routing class * * @since 3.3 */ abstract class JComponentRouterBase implements JComponentRouterInterface { /** * Application object to use in the router * * @var JApplicationCms * @since 3.4 */ public $app; /** * Menu object to use in the router * * @var JMenu * @since 3.4 */ public $menu; /** * Class constructor. * * @param JApplicationCms $app Application-object that the router should use * @param JMenu $menu Menu-object that the router should use * * @since 3.4 */ public function __construct($app = null, $menu = null) { if ($app) { $this->app = $app; } else { $this->app = JFactory::getApplication(); } if ($menu) { $this->menu = $menu; } else { $this->menu = $this->app->getMenu(); } } /** * Generic method to preprocess a URL * * @param array $query An associative array of URL arguments * * @return array The URL arguments to use to assemble the subsequent URL. * * @since 3.3 */ public function preprocess($query) { return $query; } } PK���\�}��L-L-"libraries/cms/component/helper.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Component * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Component helper class * * @since 1.5 */ class JComponentHelper { /** * The component list cache * * @var array * @since 1.6 */ protected static $components = array(); /** * Get the component information. * * @param string $option The component option. * @param boolean $strict If set and the component does not exist, the enabled attribute will be set to false. * * @return object An object with the information for the component. * * @since 1.5 */ public static function getComponent($option, $strict = false) { if (!isset(static::$components[$option])) { if (static::load($option)) { $result = static::$components[$option]; } else { $result = new stdClass; $result->enabled = $strict ? false : true; $result->params = new Registry; } } else { $result = static::$components[$option]; } if (is_string($result->params)) { $temp = new Registry; $temp->loadString(static::$components[$option]->params); static::$components[$option]->params = $temp; } return $result; } /** * Checks if the component is enabled * * @param string $option The component option. * * @return boolean * * @since 1.5 */ public static function isEnabled($option) { $result = static::getComponent($option, true); return $result->enabled; } /** * Checks if a component is installed * * @param string $option The component option. * * @return integer * * @since 3.4 */ public static function isInstalled($option) { $db = JFactory::getDbo(); return (int) $db->setQuery( $db->getQuery(true) ->select('COUNT(extension_id)') ->from('#__extensions') ->where('element = ' . $db->quote($option)) ->where('type = ' . $db->quote('component')) )->loadResult(); } /** * Gets the parameter object for the component * * @param string $option The option for the component. * @param boolean $strict If set and the component does not exist, false will be returned * * @return Registry A Registry object. * * @see Registry * @since 1.5 */ public static function getParams($option, $strict = false) { $component = static::getComponent($option, $strict); return $component->params; } /** * Applies the global text filters to arbitrary text as per settings for current user groups * * @param string $text The string to filter * * @return string The filtered string * * @since 2.5 */ public static function filterText($text) { // Filter settings $config = static::getParams('com_config'); $user = JFactory::getUser(); $userGroups = JAccess::getGroupsByUser($user->get('id')); $filters = $config->get('filters'); $blackListTags = array(); $blackListAttributes = array(); $customListTags = array(); $customListAttributes = array(); $whiteListTags = array(); $whiteListAttributes = array(); $whiteList = false; $blackList = false; $customList = false; $unfiltered = false; // Cycle through each of the user groups the user is in. // Remember they are included in the Public group as well. foreach ($userGroups as $groupId) { // May have added a group by not saved the filters. if (!isset($filters->$groupId)) { continue; } // Each group the user is in could have different filtering properties. $filterData = $filters->$groupId; $filterType = strtoupper($filterData->filter_type); if ($filterType == 'NH') { // Maximum HTML filtering. } elseif ($filterType == 'NONE') { // No HTML filtering. $unfiltered = true; } else { // Black or white list. // Preprocess the tags and attributes. $tags = explode(',', $filterData->filter_tags); $attributes = explode(',', $filterData->filter_attributes); $tempTags = array(); $tempAttributes = array(); foreach ($tags as $tag) { $tag = trim($tag); if ($tag) { $tempTags[] = $tag; } } foreach ($attributes as $attribute) { $attribute = trim($attribute); if ($attribute) { $tempAttributes[] = $attribute; } } // Collect the black or white list tags and attributes. // Each list is cummulative. if ($filterType == 'BL') { $blackList = true; $blackListTags = array_merge($blackListTags, $tempTags); $blackListAttributes = array_merge($blackListAttributes, $tempAttributes); } elseif ($filterType == 'CBL') { // Only set to true if Tags or Attributes were added if ($tempTags || $tempAttributes) { $customList = true; $customListTags = array_merge($customListTags, $tempTags); $customListAttributes = array_merge($customListAttributes, $tempAttributes); } } elseif ($filterType == 'WL') { $whiteList = true; $whiteListTags = array_merge($whiteListTags, $tempTags); $whiteListAttributes = array_merge($whiteListAttributes, $tempAttributes); } } } // Remove duplicates before processing (because the black list uses both sets of arrays). $blackListTags = array_unique($blackListTags); $blackListAttributes = array_unique($blackListAttributes); $customListTags = array_unique($customListTags); $customListAttributes = array_unique($customListAttributes); $whiteListTags = array_unique($whiteListTags); $whiteListAttributes = array_unique($whiteListAttributes); // Unfiltered assumes first priority. if ($unfiltered) { // Dont apply filtering. } else { // Custom blacklist precedes Default blacklist if ($customList) { $filter = JFilterInput::getInstance(array(), array(), 1, 1); // Override filter's default blacklist tags and attributes if ($customListTags) { $filter->tagBlacklist = $customListTags; } if ($customListAttributes) { $filter->attrBlacklist = $customListAttributes; } } // Black lists take second precedence. elseif ($blackList) { // Remove the white-listed tags and attributes from the black-list. $blackListTags = array_diff($blackListTags, $whiteListTags); $blackListAttributes = array_diff($blackListAttributes, $whiteListAttributes); $filter = JFilterInput::getInstance($blackListTags, $blackListAttributes, 1, 1); // Remove white listed tags from filter's default blacklist if ($whiteListTags) { $filter->tagBlacklist = array_diff($filter->tagBlacklist, $whiteListTags); } // Remove white listed attributes from filter's default blacklist if ($whiteListAttributes) { $filter->attrBlacklist = array_diff($filter->attrBlacklist, $whiteListAttributes); } } // White lists take third precedence. elseif ($whiteList) { // Turn off XSS auto clean $filter = JFilterInput::getInstance($whiteListTags, $whiteListAttributes, 0, 0, 0); } // No HTML takes last place. else { $filter = JFilterInput::getInstance(); } $text = $filter->clean($text, 'html'); } return $text; } /** * Render the component. * * @param string $option The component option. * @param array $params The component parameters * * @return object * * @since 1.5 * @throws Exception */ public static function renderComponent($option, $params = array()) { $app = JFactory::getApplication(); // Load template language files. $template = $app->getTemplate(true)->template; $lang = JFactory::getLanguage(); $lang->load('tpl_' . $template, JPATH_BASE, null, false, true) || $lang->load('tpl_' . $template, JPATH_THEMES . "/$template", null, false, true); if (empty($option)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_COMPONENT_NOT_FOUND'), 404); } // Record the scope $scope = $app->scope; // Set scope to component name $app->scope = $option; // Build the component path. $option = preg_replace('/[^A-Z0-9_\.-]/i', '', $option); $file = substr($option, 4); // Define component path. if (!defined('JPATH_COMPONENT')) { define('JPATH_COMPONENT', JPATH_BASE . '/components/' . $option); } if (!defined('JPATH_COMPONENT_SITE')) { define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/' . $option); } if (!defined('JPATH_COMPONENT_ADMINISTRATOR')) { define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/' . $option); } $path = JPATH_COMPONENT . '/' . $file . '.php'; // If component is disabled throw error if (!static::isEnabled($option) || !file_exists($path)) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_COMPONENT_NOT_FOUND'), 404); } // Load common and local language files. $lang->load($option, JPATH_BASE, null, false, true) || $lang->load($option, JPATH_COMPONENT, null, false, true); // Handle template preview outlining. $contents = null; // Execute the component. $contents = static::executeComponent($path); // Revert the scope $app->scope = $scope; return $contents; } /** * Execute the component. * * @param string $path The component path. * * @return string The component output * * @since 1.7 */ protected static function executeComponent($path) { ob_start(); require_once $path; $contents = ob_get_clean(); return $contents; } /** * Load the installed components into the components property. * * @param string $option The element value for the extension * * @return boolean True on success * * @since 1.5 * @deprecated 4.0 Use JComponentHelper::load() instead */ protected static function _load($option) { return static::load($option); } /** * Load the installed components into the components property. * * @param string $option The element value for the extension * * @return boolean True on success * * @since 3.2 */ protected static function load($option) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('extension_id AS id, element AS "option", params, enabled') ->from('#__extensions') ->where($db->quoteName('type') . ' = ' . $db->quote('component')); $db->setQuery($query); $cache = JFactory::getCache('_system', 'callback'); try { $components = $cache->get(array($db, 'loadObjectList'), array('option'), $option, false); /** * Verify $components is an array, some cache handlers return an object even though * the original was a single object array. */ if (!is_array($components)) { static::$components[$option] = $components; } else { static::$components = $components; } } catch (RuntimeException $e) { // Fatal error. JLog::add(JText::sprintf('JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING', $option, $e->getMessage()), JLog::WARNING, 'jerror'); return false; } if (empty(static::$components[$option])) { // Fatal error. $error = JText::_('JLIB_APPLICATION_ERROR_COMPONENT_NOT_FOUND'); JLog::add(JText::sprintf('JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING', $option, $error), JLog::WARNING, 'jerror'); return false; } return true; } } PK���\K��ll libraries/cms/library/helper.phpnu�[���<?php /** * @package Joomla.Legacy * @subpackage Library * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Library helper class * * @since 3.2 */ class JLibraryHelper { /** * The component list cache * * @var array * @since 3.2 */ protected static $libraries = array(); /** * Get the library information. * * @param string $element Element of the library in the extensions table. * @param boolean $strict If set and the library does not exist, the enabled attribute will be set to false. * * @return object An object with the library's information. * * @since 3.2 */ public static function getLibrary($element, $strict = false) { // Is already cached ? if (isset(static::$libraries[$element])) { return static::$libraries[$element]; } if (static::_load($element)) { $result = static::$libraries[$element]; } else { $result = new stdClass; $result->enabled = $strict ? false : true; $result->params = new Registry; } return $result; } /** * Checks if a library is enabled * * @param string $element Element of the library in the extensions table. * * @return boolean * * @since 3.2 */ public static function isEnabled($element) { $result = static::getLibrary($element, true); return $result->enabled; } /** * Gets the parameter object for the library * * @param string $element Element of the library in the extensions table. * @param boolean $strict If set and the library does not exist, false will be returned * * @return Registry A Registry object. * * @see Registry * @since 3.2 */ public static function getParams($element, $strict = false) { $library = static::getLibrary($element, $strict); return $library->params; } /** * Save the parameters object for the library * * @param string $element Element of the library in the extensions table. * @param Registry $params Params to save * * @return Registry A Registry object. * * @see Registry * @since 3.2 */ public static function saveParams($element, $params) { if (static::isEnabled($element)) { // Save params in DB $db = JFactory::getDbo(); $query = $db->getQuery(true) ->update($db->quoteName('#__extensions')) ->set($db->quoteName('params') . ' = ' . $db->quote($params->toString())) ->where($db->quoteName('type') . ' = ' . $db->quote('library')) ->where($db->quoteName('element') . ' = ' . $db->quote($element)); $db->setQuery($query); $result = $db->execute(); // Update params in libraries cache if ($result && isset(static::$libraries[$element])) { static::$libraries[$element]->params = $params; } return $result; } return false; } /** * Load the installed libraryes into the libraries property. * * @param string $element The element value for the extension * * @return boolean True on success * * @since 3.2 */ protected static function _load($element) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('extension_id AS id, element AS "option", params, enabled') ->from('#__extensions') ->where($db->quoteName('type') . ' = ' . $db->quote('library')) ->where($db->quoteName('element') . ' = ' . $db->quote($element)); $db->setQuery($query); $cache = JFactory::getCache('_system', 'callback'); try { static::$libraries[$element] = $cache->get(array($db, 'loadObject'), null, $element, false); } catch (RuntimeException $e) { // Fatal error. JLog::add(JText::sprintf('JLIB_APPLICATION_ERROR_LIBRARY_NOT_LOADING', $element, $e->getMessage()), JLog::WARNING, 'jerror'); return false; } if (empty(static::$libraries[$element])) { // Fatal error. $error = JText::_('JLIB_APPLICATION_ERROR_LIBRARY_NOT_FOUND'); JLog::add(JText::sprintf('JLIB_APPLICATION_ERROR_LIBRARY_NOT_LOADING', $element, $error), JLog::WARNING, 'jerror'); return false; } // Convert the params to an object. if (is_string(static::$libraries[$element]->params)) { $temp = new Registry; $temp->loadString(static::$libraries[$element]->params); static::$libraries[$element]->params = $temp; } return true; } } PK���\�P�? ? libraries/cms/response/json.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Response * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JSON Response class. * * This class serves to provide the Joomla Platform with a common interface to access * response variables for e.g. Ajax requests. * * @since 3.1 */ class JResponseJson { /** * Determines whether the request was successful * * @var boolean * @since 3.1 */ public $success = true; /** * The main response message * * @var string * @since 3.1 */ public $message = null; /** * Array of messages gathered in the JApplication object * * @var array * @since 3.1 */ public $messages = null; /** * The response data * * @var mixed * @since 3.1 */ public $data = null; /** * Constructor * * @param mixed $response The Response data * @param string $message The main response message * @param boolean $error True, if the success flag shall be set to false, defaults to false * @param boolean $ignoreMessages True, if the message queue shouldn't be included, defaults to false * * @since 3.1 */ public function __construct($response = null, $message = null, $error = false, $ignoreMessages = false) { $this->message = $message; // Get the message queue if requested and available $app = JFactory::getApplication(); if (!$ignoreMessages && !is_null($app) && is_callable(array($app, 'getMessageQueue'))) { $messages = $app->getMessageQueue(); // Build the sorted messages list if (is_array($messages) && count($messages)) { foreach ($messages as $message) { if (isset($message['type']) && isset($message['message'])) { $lists[$message['type']][] = $message['message']; } } } // If messages exist add them to the output if (isset($lists) && is_array($lists)) { $this->messages = $lists; } } // Check if we are dealing with an error if ($response instanceof Exception) { // Prepare the error response $this->success = false; $this->message = $response->getMessage(); } else { // Prepare the response data $this->success = !$error; $this->data = $response; } } /** * Magic toString method for sending the response in JSON format * * @return string The response in JSON format * * @since 3.1 */ public function __toString() { return json_encode($this); } } PK���\ /� libraries/cms/less/less.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage LESS * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for lessc * * @package Joomla.Libraries * @subpackage Less * @since 3.4 */ class JLess extends lessc { /** * Constructor * * @param string $fname Filename to process * @param mided $formatter Formatter object * * @since 3.4 */ public function __construct($fname = null, $formatter = null) { parent::__construct($fname); if ($formatter === null) { $formatter = new JLessFormatterJoomla; } $this->setFormatter($formatter); } } PK���\#�l���'libraries/cms/less/formatter/joomla.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Less * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Formatter ruleset for Joomla formatted CSS generated via LESS * * @package Joomla.Libraries * @subpackage Less * @since 3.4 */ class JLessFormatterJoomla extends lessc_formatter_classic { public $disableSingle = true; public $breakSelectors = true; public $assignSeparator = ": "; public $selectorSeparator = ","; public $indentChar = "\t"; } PK���\������#libraries/cms/pagination/object.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Pagination * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Pagination object representing a particular item in the pagination lists. * * @since 1.5 */ class JPaginationObject { /** * @var string The link text. * @since 1.5 */ public $text; /** * @var integer The number of rows as a base offset. * @since 1.5 */ public $base; /** * @var string The link URL. * @since 1.5 */ public $link; /** * @var integer The prefix used for request variables. * @since 1.6 */ public $prefix; /** * @var boolean Flag whether the object is the 'active' page * @since 3.0 */ public $active; /** * Class constructor. * * @param string $text The link text. * @param string $prefix The prefix used for request variables. * @param integer $base The number of rows as a base offset. * @param string $link The link URL. * @param boolean $active Flag whether the object is the 'active' page * * @since 1.5 */ public function __construct($text, $prefix = '', $base = null, $link = null, $active = false) { $this->text = $text; $this->prefix = $prefix; $this->base = $base; $this->link = $link; $this->active = $active; } } PK���\o�ɺ�W�W'libraries/cms/pagination/pagination.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Pagination * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Pagination Class. Provides a common interface for content pagination for the Joomla! CMS. * * @since 1.5 */ class JPagination { /** * @var integer The record number to start displaying from. * @since 1.5 */ public $limitstart = null; /** * @var integer Number of rows to display per page. * @since 1.5 */ public $limit = null; /** * @var integer Total number of rows. * @since 1.5 */ public $total = null; /** * @var integer Prefix used for request variables. * @since 1.6 */ public $prefix = null; /** * @var integer Value pagination object begins at * @since 3.0 */ public $pagesStart; /** * @var integer Value pagination object ends at * @since 3.0 */ public $pagesStop; /** * @var integer Current page * @since 3.0 */ public $pagesCurrent; /** * @var integer Total number of pages * @since 3.0 */ public $pagesTotal; /** * @var boolean View all flag * @since 3.0 */ protected $viewall = false; /** * Additional URL parameters to be added to the pagination URLs generated by the class. These * may be useful for filters and extra values when dealing with lists and GET requests. * * @var array * @since 3.0 */ protected $additionalUrlParams = array(); /** * @var JApplicationCms The application object * @since 3.4 */ protected $app = null; /** * Pagination data object * * @var object * @since 3.4 */ protected $data; /** * Constructor. * * @param integer $total The total number of items. * @param integer $limitstart The offset of the item to start at. * @param integer $limit The number of items to display per page. * @param string $prefix The prefix used for request variables. * @param JApplicationCms $app The application object * * @since 1.5 */ public function __construct($total, $limitstart, $limit, $prefix = '', JApplicationCms $app = null) { // Value/type checking. $this->total = (int) $total; $this->limitstart = (int) max($limitstart, 0); $this->limit = (int) max($limit, 0); $this->prefix = $prefix; $this->app = $app ? $app : JFactory::getApplication(); if ($this->limit > $this->total) { $this->limitstart = 0; } if (!$this->limit) { $this->limit = $total; $this->limitstart = 0; } /* * If limitstart is greater than total (i.e. we are asked to display records that don't exist) * then set limitstart to display the last natural page of results */ if ($this->limitstart > $this->total - $this->limit) { $this->limitstart = max(0, (int) (ceil($this->total / $this->limit) - 1) * $this->limit); } // Set the total pages and current page values. if ($this->limit > 0) { $this->pagesTotal = ceil($this->total / $this->limit); $this->pagesCurrent = ceil(($this->limitstart + 1) / $this->limit); } // Set the pagination iteration loop values. $displayedPages = 10; $this->pagesStart = $this->pagesCurrent - ($displayedPages / 2); if ($this->pagesStart < 1) { $this->pagesStart = 1; } if ($this->pagesStart + $displayedPages > $this->pagesTotal) { $this->pagesStop = $this->pagesTotal; if ($this->pagesTotal < $displayedPages) { $this->pagesStart = 1; } else { $this->pagesStart = $this->pagesTotal - $displayedPages + 1; } } else { $this->pagesStop = $this->pagesStart + $displayedPages - 1; } // If we are viewing all records set the view all flag to true. if ($limit == 0) { $this->viewall = true; } } /** * Method to set an additional URL parameter to be added to all pagination class generated * links. * * @param string $key The name of the URL parameter for which to set a value. * @param mixed $value The value to set for the URL parameter. * * @return mixed The old value for the parameter. * * @since 1.6 */ public function setAdditionalUrlParam($key, $value) { // Get the old value to return and set the new one for the URL parameter. $result = isset($this->additionalUrlParams[$key]) ? $this->additionalUrlParams[$key] : null; // If the passed parameter value is null unset the parameter, otherwise set it to the given value. if ($value === null) { unset($this->additionalUrlParams[$key]); } else { $this->additionalUrlParams[$key] = $value; } return $result; } /** * Method to get an additional URL parameter (if it exists) to be added to * all pagination class generated links. * * @param string $key The name of the URL parameter for which to get the value. * * @return mixed The value if it exists or null if it does not. * * @since 1.6 */ public function getAdditionalUrlParam($key) { $result = isset($this->additionalUrlParams[$key]) ? $this->additionalUrlParams[$key] : null; return $result; } /** * Return the rationalised offset for a row with a given index. * * @param integer $index The row index * * @return integer Rationalised offset for a row with a given index. * * @since 1.5 */ public function getRowOffset($index) { return $index + 1 + $this->limitstart; } /** * Return the pagination data object, only creating it if it doesn't already exist. * * @return object Pagination data object. * * @since 1.5 */ public function getData() { if (!$this->data) { $this->data = $this->_buildDataObject(); } return $this->data; } /** * Create and return the pagination pages counter string, ie. Page 2 of 4. * * @return string Pagination pages counter string. * * @since 1.5 */ public function getPagesCounter() { $html = null; if ($this->pagesTotal > 1) { $html .= JText::sprintf('JLIB_HTML_PAGE_CURRENT_OF_TOTAL', $this->pagesCurrent, $this->pagesTotal); } return $html; } /** * Create and return the pagination result set counter string, e.g. Results 1-10 of 42 * * @return string Pagination result set counter string. * * @since 1.5 */ public function getResultsCounter() { $html = null; $fromResult = $this->limitstart + 1; // If the limit is reached before the end of the list. if ($this->limitstart + $this->limit < $this->total) { $toResult = $this->limitstart + $this->limit; } else { $toResult = $this->total; } // If there are results found. if ($this->total > 0) { $msg = JText::sprintf('JLIB_HTML_RESULTS_OF', $fromResult, $toResult, $this->total); $html .= "\n" . $msg; } else { $html .= "\n" . JText::_('JLIB_HTML_NO_RECORDS_FOUND'); } return $html; } /** * Create and return the pagination page list string, ie. Previous, Next, 1 2 3 ... x. * * @return string Pagination page list string. * * @since 1.5 */ public function getPagesLinks() { // Build the page navigation list. $data = $this->_buildDataObject(); $list = array(); $list['prefix'] = $this->prefix; $itemOverride = false; $listOverride = false; $chromePath = JPATH_THEMES . '/' . $this->app->getTemplate() . '/html/pagination.php'; if (file_exists($chromePath)) { include_once $chromePath; if (function_exists('pagination_item_active') && function_exists('pagination_item_inactive')) { $itemOverride = true; } if (function_exists('pagination_list_render')) { $listOverride = true; } } // Build the select list if ($data->all->base !== null) { $list['all']['active'] = true; $list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all); } else { $list['all']['active'] = false; $list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all); } if ($data->start->base !== null) { $list['start']['active'] = true; $list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start); } else { $list['start']['active'] = false; $list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start); } if ($data->previous->base !== null) { $list['previous']['active'] = true; $list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous); } else { $list['previous']['active'] = false; $list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous); } // Make sure it exists $list['pages'] = array(); foreach ($data->pages as $i => $page) { if ($page->base !== null) { $list['pages'][$i]['active'] = true; $list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page); } else { $list['pages'][$i]['active'] = false; $list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page); } } if ($data->next->base !== null) { $list['next']['active'] = true; $list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next); } else { $list['next']['active'] = false; $list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next); } if ($data->end->base !== null) { $list['end']['active'] = true; $list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end); } else { $list['end']['active'] = false; $list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end); } if ($this->total > $this->limit) { return ($listOverride) ? pagination_list_render($list) : $this->_list_render($list); } else { return ''; } } /** * Get the pagination links * * @param string $layoutId Layout to render the links * @param array $options Optional array with settings for the layout * * @return string Pagination links. * * @since 3.3 */ public function getPaginationLinks($layoutId = 'joomla.pagination.links', $options = array()) { // Allow to receive a null layout $layoutId = (null === $layoutId) ? 'joomla.pagination.links' : $layoutId; $list = array( 'prefix' => $this->prefix, 'limit' => $this->limit, 'limitstart' => $this->limitstart, 'total' => $this->total, 'limitfield' => $this->getLimitBox(), 'pagescounter' => $this->getPagesCounter(), 'pages' => $this->getPaginationPages() ); return JLayoutHelper::render($layoutId, array('list' => $list, 'options' => $options)); } /** * Create and return the pagination pages list, ie. Previous, Next, 1 2 3 ... x. * * @return array Pagination pages list. * * @since 3.3 */ public function getPaginationPages() { $list = array(); if ($this->total > $this->limit) { // Build the page navigation list. $data = $this->_buildDataObject(); // All $list['all']['active'] = (null !== $data->all->base); $list['all']['data'] = $data->all; // Start $list['start']['active'] = (null !== $data->start->base); $list['start']['data'] = $data->start; // Previous link $list['previous']['active'] = (null !== $data->previous->base); $list['previous']['data'] = $data->previous; // Make sure it exists $list['pages'] = array(); foreach ($data->pages as $i => $page) { $list['pages'][$i]['active'] = (null !== $page->base); $list['pages'][$i]['data'] = $page; } $list['next']['active'] = (null !== $data->next->base); $list['next']['data'] = $data->next; $list['end']['active'] = (null !== $data->end->base); $list['end']['data'] = $data->end; } return $list; } /** * Return the pagination footer. * * @return string Pagination footer. * * @since 1.5 */ public function getListFooter() { // Keep B/C for overrides done with chromes $chromePath = JPATH_THEMES . '/' . $this->app->getTemplate() . '/html/pagination.php'; if (file_exists($chromePath)) { $list = array(); $list['prefix'] = $this->prefix; $list['limit'] = $this->limit; $list['limitstart'] = $this->limitstart; $list['total'] = $this->total; $list['limitfield'] = $this->getLimitBox(); $list['pagescounter'] = $this->getPagesCounter(); $list['pageslinks'] = $this->getPagesLinks(); include_once $chromePath; if (function_exists('pagination_list_footer')) { return pagination_list_footer($list); } } return $this->getPaginationLinks(); } /** * Creates a dropdown box for selecting how many records to show per page. * * @return string The HTML for the limit # input box. * * @since 1.5 */ public function getLimitBox() { $limits = array(); // Make the option list. for ($i = 5; $i <= 30; $i += 5) { $limits[] = JHtml::_('select.option', "$i"); } $limits[] = JHtml::_('select.option', '50', JText::_('J50')); $limits[] = JHtml::_('select.option', '100', JText::_('J100')); $limits[] = JHtml::_('select.option', '0', JText::_('JALL')); $selected = $this->viewall ? 0 : $this->limit; // Build the select list. if ($this->app->isAdmin()) { $html = JHtml::_( 'select.genericlist', $limits, $this->prefix . 'limit', 'class="inputbox input-mini" size="1" onchange="Joomla.submitform();"', 'value', 'text', $selected ); } else { $html = JHtml::_( 'select.genericlist', $limits, $this->prefix . 'limit', 'class="inputbox input-mini" size="1" onchange="this.form.submit()"', 'value', 'text', $selected ); } return $html; } /** * Return the icon to move an item UP. * * @param integer $i The row index. * @param boolean $condition True to show the icon. * @param string $task The task to fire. * @param string $alt The image alternative text string. * @param boolean $enabled An optional setting for access control on the action. * @param string $checkbox An optional prefix for checkboxes. * * @return string Either the icon to move an item up or a space. * * @since 1.5 */ public function orderUpIcon($i, $condition = true, $task = 'orderup', $alt = 'JLIB_HTML_MOVE_UP', $enabled = true, $checkbox = 'cb') { if (($i > 0 || ($i + $this->limitstart > 0)) && $condition) { return JHtml::_('jgrid.orderUp', $i, $task, '', $alt, $enabled, $checkbox); } else { return ' '; } } /** * Return the icon to move an item DOWN. * * @param integer $i The row index. * @param integer $n The number of items in the list. * @param boolean $condition True to show the icon. * @param string $task The task to fire. * @param string $alt The image alternative text string. * @param boolean $enabled An optional setting for access control on the action. * @param string $checkbox An optional prefix for checkboxes. * * @return string Either the icon to move an item down or a space. * * @since 1.5 */ public function orderDownIcon($i, $n, $condition = true, $task = 'orderdown', $alt = 'JLIB_HTML_MOVE_DOWN', $enabled = true, $checkbox = 'cb') { if (($i < $n - 1 || $i + $this->limitstart < $this->total - 1) && $condition) { return JHtml::_('jgrid.orderDown', $i, $task, '', $alt, $enabled, $checkbox); } else { return ' '; } } /** * Create the HTML for a list footer * * @param array $list Pagination list data structure. * * @return string HTML for a list footer * * @since 1.5 */ protected function _list_footer($list) { $html = "<div class=\"list-footer\">\n"; $html .= "\n<div class=\"limit\">" . JText::_('JGLOBAL_DISPLAY_NUM') . $list['limitfield'] . "</div>"; $html .= $list['pageslinks']; $html .= "\n<div class=\"counter\">" . $list['pagescounter'] . "</div>"; $html .= "\n<input type=\"hidden\" name=\"" . $list['prefix'] . "limitstart\" value=\"" . $list['limitstart'] . "\" />"; $html .= "\n</div>"; return $html; } /** * Create the html for a list footer * * @param array $list Pagination list data structure. * * @return string HTML for a list start, previous, next,end * * @since 1.5 */ protected function _list_render($list) { // Reverse output rendering for right-to-left display. $html = '<ul>'; $html .= '<li class="pagination-start">' . $list['start']['data'] . '</li>'; $html .= '<li class="pagination-prev">' . $list['previous']['data'] . '</li>'; foreach ($list['pages'] as $page) { $html .= '<li>' . $page['data'] . '</li>'; } $html .= '<li class="pagination-next">' . $list['next']['data'] . '</li>'; $html .= '<li class="pagination-end">' . $list['end']['data'] . '</li>'; $html .= '</ul>'; return $html; } /** * Method to create an active pagination link to the item * * @param JPaginationObject $item The object with which to make an active link. * * @return string HTML link * * @since 1.5 */ protected function _item_active(JPaginationObject $item) { $title = ''; $class = ''; if (!is_numeric($item->text)) { JHtml::_('bootstrap.tooltip'); $title = ' title="' . $item->text . '"'; $class = 'hasTooltip '; } if ($this->app->isAdmin()) { return '<a' . $title . ' href="#" onclick="document.adminForm.' . $this->prefix . 'limitstart.value=' . ($item->base > 0 ? $item->base : '0') . '; Joomla.submitform();return false;">' . $item->text . '</a>'; } else { return '<a' . $title . ' href="' . $item->link . '" class="' . $class . 'pagenav">' . $item->text . '</a>'; } } /** * Method to create an inactive pagination string * * @param JPaginationObject $item The item to be processed * * @return string * * @since 1.5 */ protected function _item_inactive(JPaginationObject $item) { if ($this->app->isAdmin()) { return '<span>' . $item->text . '</span>'; } else { return '<span class="pagenav">' . $item->text . '</span>'; } } /** * Create and return the pagination data object. * * @return object Pagination data object. * * @since 1.5 */ protected function _buildDataObject() { $data = new stdClass; // Build the additional URL parameters string. $params = ''; if (!empty($this->additionalUrlParams)) { foreach ($this->additionalUrlParams as $key => $value) { $params .= '&' . $key . '=' . $value; } } $data->all = new JPaginationObject(JText::_('JLIB_HTML_VIEW_ALL'), $this->prefix); if (!$this->viewall) { $data->all->base = '0'; $data->all->link = JRoute::_($params . '&' . $this->prefix . 'limitstart='); } // Set the start and previous data objects. $data->start = new JPaginationObject(JText::_('JLIB_HTML_START'), $this->prefix); $data->previous = new JPaginationObject(JText::_('JPREV'), $this->prefix); if ($this->pagesCurrent > 1) { $page = ($this->pagesCurrent - 2) * $this->limit; // Set the empty for removal from route // @todo remove code: $page = $page == 0 ? '' : $page; $data->start->base = '0'; $data->start->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=0'); $data->previous->base = $page; $data->previous->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $page); } // Set the next and end data objects. $data->next = new JPaginationObject(JText::_('JNEXT'), $this->prefix); $data->end = new JPaginationObject(JText::_('JLIB_HTML_END'), $this->prefix); if ($this->pagesCurrent < $this->pagesTotal) { $next = $this->pagesCurrent * $this->limit; $end = ($this->pagesTotal - 1) * $this->limit; $data->next->base = $next; $data->next->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $next); $data->end->base = $end; $data->end->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $end); } $data->pages = array(); $stop = $this->pagesStop; for ($i = $this->pagesStart; $i <= $stop; $i++) { $offset = ($i - 1) * $this->limit; $data->pages[$i] = new JPaginationObject($i, $this->prefix); if ($i != $this->pagesCurrent || $this->viewall) { $data->pages[$i]->base = $offset; $data->pages[$i]->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $offset); } else { $data->pages[$i]->active = true; } } return $data; } /** * Modifies a property of the object, creating it if it does not already exist. * * @param string $property The name of the property. * @param mixed $value The value of the property to set. * * @return void * * @since 3.0 * @deprecated 4.0 Access the properties directly. */ public function set($property, $value = null) { JLog::add('JPagination::set() is deprecated. Access the properties directly.', JLog::WARNING, 'deprecated'); if (strpos($property, '.')) { $prop = explode('.', $property); $prop[1] = ucfirst($prop[1]); $property = implode($prop); } $this->$property = $value; } /** * Returns a property of the object or the default value if the property is not set. * * @param string $property The name of the property. * @param mixed $default The default value. * * @return mixed The value of the property. * * @since 3.0 * @deprecated 4.0 Access the properties directly. */ public function get($property, $default = null) { JLog::add('JPagination::get() is deprecated. Access the properties directly.', JLog::WARNING, 'deprecated'); if (strpos($property, '.')) { $prop = explode('.', $property); $prop[1] = ucfirst($prop[1]); $property = implode($prop); } if (isset($this->$property)) { return $this->$property; } return $default; } } PK���\�OBA��libraries/cms/menu/site.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * JMenu class * * @since 1.5 */ class JMenuSite extends JMenu { /** * Loads the entire menu table into memory. * * @return boolean True on success, false on failure * * @since 1.5 */ public function load() { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('m.id, m.menutype, m.title, m.alias, m.note, m.path AS route, m.link, m.type, m.level, m.language') ->select($db->quoteName('m.browserNav') . ', m.access, m.params, m.home, m.img, m.template_style_id, m.component_id, m.parent_id') ->select('e.element as component') ->from('#__menu AS m') ->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id') ->where('m.published = 1') ->where('m.parent_id > 0') ->where('m.client_id = 0') ->order('m.lft'); // Set the query $db->setQuery($query); try { $this->_items = $db->loadObjectList('id'); } catch (RuntimeException $e) { JError::raiseWarning(500, JText::sprintf('JERROR_LOADING_MENUS', $e->getMessage())); return false; } foreach ($this->_items as &$item) { // Get parent information. $parent_tree = array(); if (isset($this->_items[$item->parent_id])) { $parent_tree = $this->_items[$item->parent_id]->tree; } // Create tree. $parent_tree[] = $item->id; $item->tree = $parent_tree; // Create the query array. $url = str_replace('index.php?', '', $item->link); $url = str_replace('&', '&', $url); parse_str($url, $item->query); } return true; } /** * Gets menu items by attribute * * @param string $attributes The field name * @param string $values The value of the field * @param boolean $firstonly If true, only returns the first item found * * @return array * * @since 1.6 */ public function getItems($attributes, $values, $firstonly = false) { $attributes = (array) $attributes; $values = (array) $values; $app = JApplication::getInstance('site'); if ($app->isSite()) { // Filter by language if not set if (($key = array_search('language', $attributes)) === false) { if (JLanguageMultilang::isEnabled()) { $attributes[] = 'language'; $values[] = array(JFactory::getLanguage()->getTag(), '*'); } } elseif ($values[$key] === null) { unset($attributes[$key]); unset($values[$key]); } // Filter by access level if not set if (($key = array_search('access', $attributes)) === false) { $attributes[] = 'access'; $values[] = JFactory::getUser()->getAuthorisedViewLevels(); } elseif ($values[$key] === null) { unset($attributes[$key]); unset($values[$key]); } } // Reset arrays or we get a notice if some values were unset $attributes = array_values($attributes); $values = array_values($values); return parent::getItems($attributes, $values, $firstonly); } /** * Get menu item by id * * @param string $language The language code. * * @return mixed The item object or null when not found for given language * * @since 1.6 */ public function getDefault($language = '*') { if (array_key_exists($language, $this->_default) && JApplication::getInstance('site')->getLanguageFilter()) { return $this->_items[$this->_default[$language]]; } elseif (array_key_exists('*', $this->_default)) { return $this->_items[$this->_default['*']]; } else { return null; } } } PK���\��Z�CClibraries/cms/menu/menu.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * JMenu class * * @since 1.5 */ class JMenu { /** * Array to hold the menu items * * @var array * @since 1.5 * @deprecated 4.0 Will convert to $items */ protected $_items = array(); /** * Identifier of the default menu item * * @var integer * @since 1.5 * @deprecated 4.0 Will convert to $default */ protected $_default = array(); /** * Identifier of the active menu item * * @var integer * @since 1.5 * @deprecated 4.0 Will convert to $active */ protected $_active = 0; /** * @var array JMenu instances container. * @since 1.7 */ protected static $instances = array(); /** * Class constructor * * @param array $options An array of configuration options. * * @since 1.5 */ public function __construct($options = array()) { // Load the menu items $this->load(); foreach ($this->_items as $item) { if ($item->home) { $this->_default[trim($item->language)] = $item->id; } // Decode the item params $result = new Registry; $result->loadString($item->params); $item->params = $result; } } /** * Returns a JMenu object * * @param string $client The name of the client * @param array $options An associative array of options * * @return JMenu A menu object. * * @since 1.5 * @throws Exception */ public static function getInstance($client, $options = array()) { if (empty(self::$instances[$client])) { // Create a JMenu object $classname = 'JMenu' . ucfirst($client); if (!class_exists($classname)) { // @deprecated 4.0 Everything in this block is deprecated but the warning is only logged after the file_exists // Load the menu object $info = JApplicationHelper::getClientInfo($client, true); if (is_object($info)) { $path = $info->path . '/includes/menu.php'; if (file_exists($path)) { JLog::add('Non-autoloadable JMenu subclasses are deprecated, support will be removed in 4.0.', JLog::WARNING, 'deprecated'); include_once $path; } } } if (class_exists($classname)) { self::$instances[$client] = new $classname($options); } else { throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_MENU_LOAD', $client), 500); } } return self::$instances[$client]; } /** * Get menu item by id * * @param integer $id The item id * * @return mixed The item object, or null if not found * * @since 1.5 */ public function getItem($id) { $result = null; if (isset($this->_items[$id])) { $result = &$this->_items[$id]; } return $result; } /** * Set the default item by id and language code. * * @param integer $id The menu item id. * @param string $language The language cod (since 1.6). * * @return boolean True, if successful * * @since 1.5 */ public function setDefault($id, $language = '*') { if (isset($this->_items[$id])) { $this->_default[$language] = $id; return true; } return false; } /** * Get the default item by language code. * * @param string $language The language code, default value of * means all. * * @return mixed The item object or null when not found for given language * * @since 1.5 */ public function getDefault($language = '*') { if (array_key_exists($language, $this->_default)) { return $this->_items[$this->_default[$language]]; } elseif (array_key_exists('*', $this->_default)) { return $this->_items[$this->_default['*']]; } else { return null; } } /** * Set the default item by id * * @param integer $id The item id * * @return mixed If successful the active item, otherwise null * * @since 1.5 */ public function setActive($id) { if (isset($this->_items[$id])) { $this->_active = $id; $result = &$this->_items[$id]; return $result; } return null; } /** * Get menu item by id. * * @return object The item object. * * @since 1.5 */ public function getActive() { if ($this->_active) { $item = &$this->_items[$this->_active]; return $item; } return null; } /** * Gets menu items by attribute * * @param mixed $attributes The field name(s). * @param mixed $values The value(s) of the field. If an array, need to match field names * each attribute may have multiple values to lookup for. * @param boolean $firstonly If true, only returns the first item found * * @return array * * @since 1.5 */ public function getItems($attributes, $values, $firstonly = false) { $items = array(); $attributes = (array) $attributes; $values = (array) $values; foreach ($this->_items as $item) { if (!is_object($item)) { continue; } $test = true; for ($i = 0, $count = count($attributes); $i < $count; $i++) { if (is_array($values[$i])) { if (!in_array($item->{$attributes[$i]}, $values[$i])) { $test = false; break; } } else { if ($item->{$attributes[$i]} != $values[$i]) { $test = false; break; } } } if ($test) { if ($firstonly) { return $item; } $items[] = $item; } } return $items; } /** * Gets the parameter object for a certain menu item * * @param integer $id The item id * * @return Registry A Registry object * * @since 1.5 */ public function getParams($id) { if ($menu = $this->getItem($id)) { return $menu->params; } else { return new Registry; } } /** * Getter for the menu array * * @return array * * @since 1.5 */ public function getMenu() { return $this->_items; } /** * Method to check JMenu object authorization against an access control * object and optionally an access extension object * * @param integer $id The menu id * * @return boolean True if authorised * * @since 1.5 */ public function authorise($id) { $menu = $this->getItem($id); $user = JFactory::getUser(); if ($menu) { return in_array((int) $menu->access, $user->getAuthorisedViewLevels()); } else { return true; } } /** * Loads the menu items * * @return array * * @since 1.5 */ public function load() { return array(); } } PK���\ћ��hh$libraries/cms/menu/administrator.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * JMenu class. * * @since 1.5 */ class JMenuAdministrator extends JMenu { } PK���\O^���#libraries/cms/html/sortablelist.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * HTML utility class for creating a sortable table list * * @since 3.0 */ abstract class JHtmlSortablelist { /** * @var array Array containing information for loaded files * @since 3.0 */ protected static $loaded = array(); /** * Method to load the Sortable script and make table sortable * * @param string $tableId DOM id of the table * @param string $formId DOM id of the form * @param string $sortDir Sort direction * @param string $saveOrderingUrl Save ordering url, ajax-load after an item dropped * @param boolean $proceedSaveOrderButton Set whether a save order button is displayed * @param boolean $nestedList Set whether the list is a nested list * * @return void * * @since 3.0 * * @throws InvalidArgumentException */ public static function sortable($tableId, $formId, $sortDir = 'asc', $saveOrderingUrl = null, $proceedSaveOrderButton = true, $nestedList = false) { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // Note: $i is required but has to be an optional argument in the function call due to argument order if (null === $saveOrderingUrl) { throw new InvalidArgumentException('$saveOrderingUrl is a required argument in JHtmlSortablelist::sortable'); } // Depends on jQuery UI JHtml::_('jquery.ui', array('core', 'sortable')); JHtml::_('script', 'jui/sortablelist.js', false, true); JHtml::_('stylesheet', 'jui/sortablelist.css', false, true, false); // Attach sortable to document JFactory::getDocument()->addScriptDeclaration(" (function ($){ $(document).ready(function (){ var sortableList = new $.JSortableList('#" . $tableId . " tbody','" . $formId . "','" . $sortDir . "' , '" . $saveOrderingUrl . "','','" . $nestedList . "'); }); })(jQuery); " ); if ($proceedSaveOrderButton) { static::_proceedSaveOrderButton(); } // Set static array static::$loaded[__METHOD__] = true; return; } /** * Method to inject script for enabled and disable Save order button * when changing value of ordering input boxes * * @return void * * @since 3.0 */ public static function _proceedSaveOrderButton() { JFactory::getDocument()->addScriptDeclaration( "(function ($){ $(document).ready(function (){ var saveOrderButton = $('.saveorder'); saveOrderButton.css({'opacity':'0.2', 'cursor':'default'}).attr('onclick','return false;'); var oldOrderingValue = ''; $('.text-area-order').focus(function () { oldOrderingValue = $(this).attr('value'); }) .keyup(function (){ var newOrderingValue = $(this).attr('value'); if (oldOrderingValue != newOrderingValue) { saveOrderButton.css({'opacity':'1', 'cursor':'pointer'}).removeAttr('onclick') } }); }); })(jQuery);" ); return; } } PK���\���~~libraries/cms/html/content.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class to fire onContentPrepare for non-article based content. * * @since 1.5 */ abstract class JHtmlContent { /** * Fire onContentPrepare for content that isn't part of an article. * * @param string $text The content to be transformed. * @param array $params The content params. * @param string $context The context of the content to be transformed. * * @return string The content after transformation. * * @since 1.5 */ public static function prepare($text, $params = null, $context = 'text') { if ($params === null) { $params = new JObject; } $article = new stdClass; $article->text = $text; JPluginHelper::importPlugin('content'); $dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger('onContentPrepare', array($context, &$article, &$params, 0)); return $article->text; } } PK���\��x��libraries/cms/html/user.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class working with users * * @since 2.5 */ abstract class JHtmlUser { /** * Displays a list of user groups. * * @param boolean $includeSuperAdmin true to include super admin groups, false to exclude them * * @return array An array containing a list of user groups. * * @since 2.5 */ public static function groups($includeSuperAdmin = false) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level') ->from($db->quoteName('#__usergroups') . ' AS a') ->join('LEFT', $db->quoteName('#__usergroups') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt') ->group('a.id, a.title, a.lft, a.rgt') ->order('a.lft ASC'); $db->setQuery($query); $options = $db->loadObjectList(); for ($i = 0, $n = count($options); $i < $n; $i++) { $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text; $groups[] = JHtml::_('select.option', $options[$i]->value, $options[$i]->text); } // Exclude super admin groups if requested if (!$includeSuperAdmin) { $filteredGroups = array(); foreach ($groups as $group) { if (!JAccess::checkGroup($group->value, 'core.admin')) { $filteredGroups[] = $group; } } $groups = $filteredGroups; } return $groups; } /** * Get a list of users. * * @return string * * @since 2.5 */ public static function userlist() { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value, a.name AS text') ->from('#__users AS a') ->where('a.block = 0') ->order('a.name'); $db->setQuery($query); $items = $db->loadObjectList(); return $items; } } PK���\����@�@libraries/cms/html/jgrid.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for creating HTML Grids * * @since 1.6 */ abstract class JHtmlJGrid { /** * Returns an action on a grid * * @param integer $i The row index * @param string $task The task to fire * @param string|array $prefix An optional task prefix or an array of options * @param string $text An optional text to display [unused - @deprecated 4.0] * @param string $active_title An optional active tooltip to display if $enable is true * @param string $inactive_title An optional inactive tooltip to display if $enable is true * @param boolean $tip An optional setting for tooltip * @param string $active_class An optional active HTML class * @param string $inactive_class An optional inactive HTML class * @param boolean $enabled An optional setting for access control on the action. * @param boolean $translate An optional setting for translation. * @param string $checkbox An optional prefix for checkboxes. * * @return string The HTML markup * * @since 1.6 */ public static function action($i, $task, $prefix = '', $text = '', $active_title = '', $inactive_title = '', $tip = false, $active_class = '', $inactive_class = '', $enabled = true, $translate = true, $checkbox = 'cb') { if (is_array($prefix)) { $options = $prefix; $active_title = array_key_exists('active_title', $options) ? $options['active_title'] : $active_title; $inactive_title = array_key_exists('inactive_title', $options) ? $options['inactive_title'] : $inactive_title; $tip = array_key_exists('tip', $options) ? $options['tip'] : $tip; $active_class = array_key_exists('active_class', $options) ? $options['active_class'] : $active_class; $inactive_class = array_key_exists('inactive_class', $options) ? $options['inactive_class'] : $inactive_class; $enabled = array_key_exists('enabled', $options) ? $options['enabled'] : $enabled; $translate = array_key_exists('translate', $options) ? $options['translate'] : $translate; $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox; $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; } if ($tip) { JHtml::_('bootstrap.tooltip'); $title = $enabled ? $active_title : $inactive_title; $title = $translate ? JText::_($title) : $title; $title = JHtml::tooltipText($title, '', 0); } if ($enabled) { $html[] = '<a class="btn btn-micro' . ($active_class == 'publish' ? ' active' : '') . ($tip ? ' hasTooltip' : '') . '"'; $html[] = ' href="javascript:void(0);" onclick="return listItemTask(\'' . $checkbox . $i . '\',\'' . $prefix . $task . '\')"'; $html[] = $tip ? ' title="' . $title . '"' : ''; $html[] = '>'; $html[] = '<span class="icon-' . $active_class . '"></span>'; $html[] = '</a>'; } else { $html[] = '<a class="btn btn-micro disabled jgrid' . ($tip ? ' hasTooltip' : '') . '"'; $html[] = $tip ? ' title="' . $title . '"' : ''; $html[] = '>'; if ($active_class == "protected") { $html[] = '<span class="icon-lock"></span>'; } else { $html[] = '<span class="icon-' . $inactive_class . '"></span>'; } $html[] = '</a>'; } return implode($html); } /** * Returns a state on a grid * * @param array $states array of value/state. Each state is an array of the form * (task, text, title,html active class, HTML inactive class) * or ('task'=>task, 'text'=>text, 'active_title'=>active title, * 'inactive_title'=>inactive title, 'tip'=>boolean, 'active_class'=>html active class, * 'inactive_class'=>html inactive class) * @param integer $value The state value. * @param integer $i The row index * @param string|array $prefix An optional task prefix or an array of options * @param boolean $enabled An optional setting for access control on the action. * @param boolean $translate An optional setting for translation. * @param string $checkbox An optional prefix for checkboxes. * * @return string The HTML markup * * @since 1.6 */ public static function state($states, $value, $i, $prefix = '', $enabled = true, $translate = true, $checkbox = 'cb') { if (is_array($prefix)) { $options = $prefix; $enabled = array_key_exists('enabled', $options) ? $options['enabled'] : $enabled; $translate = array_key_exists('translate', $options) ? $options['translate'] : $translate; $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox; $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; } $state = JArrayHelper::getValue($states, (int) $value, $states[0]); $task = array_key_exists('task', $state) ? $state['task'] : $state[0]; $text = array_key_exists('text', $state) ? $state['text'] : (array_key_exists(1, $state) ? $state[1] : ''); $active_title = array_key_exists('active_title', $state) ? $state['active_title'] : (array_key_exists(2, $state) ? $state[2] : ''); $inactive_title = array_key_exists('inactive_title', $state) ? $state['inactive_title'] : (array_key_exists(3, $state) ? $state[3] : ''); $tip = array_key_exists('tip', $state) ? $state['tip'] : (array_key_exists(4, $state) ? $state[4] : false); $active_class = array_key_exists('active_class', $state) ? $state['active_class'] : (array_key_exists(5, $state) ? $state[5] : ''); $inactive_class = array_key_exists('inactive_class', $state) ? $state['inactive_class'] : (array_key_exists(6, $state) ? $state[6] : ''); return static::action( $i, $task, $prefix, $text, $active_title, $inactive_title, $tip, $active_class, $inactive_class, $enabled, $translate, $checkbox ); } /** * Returns a published state on a grid * * @param integer $value The state value. * @param integer $i The row index * @param string|array $prefix An optional task prefix or an array of options * @param boolean $enabled An optional setting for access control on the action. * @param string $checkbox An optional prefix for checkboxes. * @param string $publish_up An optional start publishing date. * @param string $publish_down An optional finish publishing date. * * @return string The HTML markup * * @see JHtmlJGrid::state() * @since 1.6 */ public static function published($value, $i, $prefix = '', $enabled = true, $checkbox = 'cb', $publish_up = null, $publish_down = null) { if (is_array($prefix)) { $options = $prefix; $enabled = array_key_exists('enabled', $options) ? $options['enabled'] : $enabled; $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox; $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; } $states = array(1 => array('unpublish', 'JPUBLISHED', 'JLIB_HTML_UNPUBLISH_ITEM', 'JPUBLISHED', true, 'publish', 'publish'), 0 => array('publish', 'JUNPUBLISHED', 'JLIB_HTML_PUBLISH_ITEM', 'JUNPUBLISHED', true, 'unpublish', 'unpublish'), 2 => array('unpublish', 'JARCHIVED', 'JLIB_HTML_UNPUBLISH_ITEM', 'JARCHIVED', true, 'archive', 'archive'), -2 => array('publish', 'JTRASHED', 'JLIB_HTML_PUBLISH_ITEM', 'JTRASHED', true, 'trash', 'trash')); // Special state for dates if ($publish_up || $publish_down) { $nullDate = JFactory::getDbo()->getNullDate(); $nowDate = JFactory::getDate()->toUnix(); $tz = new DateTimeZone(JFactory::getUser()->getParam('timezone', JFactory::getConfig()->get('offset'))); $publish_up = ($publish_up != $nullDate) ? JFactory::getDate($publish_up, 'UTC')->setTimeZone($tz) : false; $publish_down = ($publish_down != $nullDate) ? JFactory::getDate($publish_down, 'UTC')->setTimeZone($tz) : false; // Create tip text, only we have publish up or down settings $tips = array(); if ($publish_up) { $tips[] = JText::sprintf('JLIB_HTML_PUBLISHED_START', $publish_up->format(JDate::$format, true)); } if ($publish_down) { $tips[] = JText::sprintf('JLIB_HTML_PUBLISHED_FINISHED', $publish_down->format(JDate::$format, true)); } $tip = empty($tips) ? false : implode('<br />', $tips); // Add tips and special titles foreach ($states as $key => $state) { // Create special titles for published items if ($key == 1) { $states[$key][2] = $states[$key][3] = 'JLIB_HTML_PUBLISHED_ITEM'; if ($publish_up > $nullDate && $nowDate < $publish_up->toUnix()) { $states[$key][2] = $states[$key][3] = 'JLIB_HTML_PUBLISHED_PENDING_ITEM'; $states[$key][5] = $states[$key][6] = 'pending'; } if ($publish_down > $nullDate && $nowDate > $publish_down->toUnix()) { $states[$key][2] = $states[$key][3] = 'JLIB_HTML_PUBLISHED_EXPIRED_ITEM'; $states[$key][5] = $states[$key][6] = 'expired'; } } // Add tips to titles if ($tip) { $states[$key][1] = JText::_($states[$key][1]); $states[$key][2] = JText::_($states[$key][2]) . '<br />' . $tip; $states[$key][3] = JText::_($states[$key][3]) . '<br />' . $tip; $states[$key][4] = true; } } return static::state($states, $value, $i, array('prefix' => $prefix, 'translate' => !$tip), $enabled, true, $checkbox); } return static::state($states, $value, $i, $prefix, $enabled, true, $checkbox); } /** * Returns a isDefault state on a grid * * @param integer $value The state value. * @param integer $i The row index * @param string|array $prefix An optional task prefix or an array of options * @param boolean $enabled An optional setting for access control on the action. * @param string $checkbox An optional prefix for checkboxes. * * @return string The HTML markup * * @see JHtmlJGrid::state() * @since 1.6 */ public static function isdefault($value, $i, $prefix = '', $enabled = true, $checkbox = 'cb') { if (is_array($prefix)) { $options = $prefix; $enabled = array_key_exists('enabled', $options) ? $options['enabled'] : $enabled; $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox; $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; } $states = array( 0 => array('setDefault', '', 'JLIB_HTML_SETDEFAULT_ITEM', '', 1, 'unfeatured', 'unfeatured'), 1 => array('unsetDefault', 'JDEFAULT', 'JLIB_HTML_UNSETDEFAULT_ITEM', 'JDEFAULT', 1, 'featured', 'featured'), ); return static::state($states, $value, $i, $prefix, $enabled, true, $checkbox); } /** * Returns an array of standard published state filter options. * * @param array $config An array of configuration options. * This array can contain a list of key/value pairs where values are boolean * and keys can be taken from 'published', 'unpublished', 'archived', 'trash', 'all'. * These pairs determine which values are displayed. * * @return string The HTML markup * * @since 1.6 */ public static function publishedOptions($config = array()) { // Build the active state filter options. $options = array(); if (!array_key_exists('published', $config) || $config['published']) { $options[] = JHtml::_('select.option', '1', 'JPUBLISHED'); } if (!array_key_exists('unpublished', $config) || $config['unpublished']) { $options[] = JHtml::_('select.option', '0', 'JUNPUBLISHED'); } if (!array_key_exists('archived', $config) || $config['archived']) { $options[] = JHtml::_('select.option', '2', 'JARCHIVED'); } if (!array_key_exists('trash', $config) || $config['trash']) { $options[] = JHtml::_('select.option', '-2', 'JTRASHED'); } if (!array_key_exists('all', $config) || $config['all']) { $options[] = JHtml::_('select.option', '*', 'JALL'); } return $options; } /** * Returns a checked-out icon * * @param integer $i The row index. * @param string $editorName The name of the editor. * @param string $time The time that the object was checked out. * @param string|array $prefix An optional task prefix or an array of options * @param boolean $enabled True to enable the action. * @param string $checkbox An optional prefix for checkboxes. * * @return string The HTML markup * * @since 1.6 */ public static function checkedout($i, $editorName, $time, $prefix = '', $enabled = false, $checkbox = 'cb') { JHtml::_('bootstrap.tooltip'); if (is_array($prefix)) { $options = $prefix; $enabled = array_key_exists('enabled', $options) ? $options['enabled'] : $enabled; $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox; $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; } $text = $editorName . '<br />' . JHtml::_('date', $time, JText::_('DATE_FORMAT_LC')) . '<br />' . JHtml::_('date', $time, 'H:i'); $active_title = JHtml::tooltipText(JText::_('JLIB_HTML_CHECKIN'), $text, 0); $inactive_title = JHtml::tooltipText(JText::_('JLIB_HTML_CHECKED_OUT'), $text, 0); return static::action( $i, 'checkin', $prefix, JText::_('JLIB_HTML_CHECKED_OUT'), html_entity_decode($active_title, ENT_QUOTES, 'UTF-8'), html_entity_decode($inactive_title, ENT_QUOTES, 'UTF-8'), true, 'checkedout', 'checkedout', $enabled, false, $checkbox ); } /** * Creates a order-up action icon. * * @param integer $i The row index. * @param string $task An optional task to fire. * @param string|array $prefix An optional task prefix or an array of options * @param string $text An optional text to display * @param boolean $enabled An optional setting for access control on the action. * @param string $checkbox An optional prefix for checkboxes. * * @return string The HTML markup * * @since 1.6 */ public static function orderUp($i, $task = 'orderup', $prefix = '', $text = 'JLIB_HTML_MOVE_UP', $enabled = true, $checkbox = 'cb') { if (is_array($prefix)) { $options = $prefix; $text = array_key_exists('text', $options) ? $options['text'] : $text; $enabled = array_key_exists('enabled', $options) ? $options['enabled'] : $enabled; $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox; $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; } return static::action($i, $task, $prefix, $text, $text, $text, false, 'uparrow', 'uparrow_disabled', $enabled, true, $checkbox); } /** * Creates a order-down action icon. * * @param integer $i The row index. * @param string $task An optional task to fire. * @param string|array $prefix An optional task prefix or an array of options * @param string $text An optional text to display * @param boolean $enabled An optional setting for access control on the action. * @param string $checkbox An optional prefix for checkboxes. * * @return string The HTML markup * * @since 1.6 */ public static function orderDown($i, $task = 'orderdown', $prefix = '', $text = 'JLIB_HTML_MOVE_DOWN', $enabled = true, $checkbox = 'cb') { if (is_array($prefix)) { $options = $prefix; $text = array_key_exists('text', $options) ? $options['text'] : $text; $enabled = array_key_exists('enabled', $options) ? $options['enabled'] : $enabled; $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox; $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; } return static::action($i, $task, $prefix, $text, $text, $text, false, 'downarrow', 'downarrow_disabled', $enabled, true, $checkbox); } } PK���\'�Rʺ�libraries/cms/html/category.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for categories * * @since 1.5 */ abstract class JHtmlCategory { /** * Cached array of the category items. * * @var array * @since 1.5 */ protected static $items = array(); /** * Returns an array of categories for the given extension. * * @param string $extension The extension option e.g. com_something. * @param array $config An array of configuration options. By default, only * published and unpublished categories are returned. * * @return array * * @since 1.5 */ public static function options($extension, $config = array('filter.published' => array(0, 1))) { $hash = md5($extension . '.' . serialize($config)); if (!isset(static::$items[$hash])) { $config = (array) $config; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id, a.title, a.level') ->from('#__categories AS a') ->where('a.parent_id > 0'); // Filter on extension. $query->where('extension = ' . $db->quote($extension)); // Filter on the published state if (isset($config['filter.published'])) { if (is_numeric($config['filter.published'])) { $query->where('a.published = ' . (int) $config['filter.published']); } elseif (is_array($config['filter.published'])) { JArrayHelper::toInteger($config['filter.published']); $query->where('a.published IN (' . implode(',', $config['filter.published']) . ')'); } } // Filter on the language if (isset($config['filter.language'])) { if (is_string($config['filter.language'])) { $query->where('a.language = ' . $db->quote($config['filter.language'])); } elseif (is_array($config['filter.language'])) { foreach ($config['filter.language'] as &$language) { $language = $db->quote($language); } $query->where('a.language IN (' . implode(',', $config['filter.language']) . ')'); } } $query->order('a.lft'); $db->setQuery($query); $items = $db->loadObjectList(); // Assemble the list options. static::$items[$hash] = array(); foreach ($items as &$item) { $repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0; $item->title = str_repeat('- ', $repeat) . $item->title; static::$items[$hash][] = JHtml::_('select.option', $item->id, $item->title); } } return static::$items[$hash]; } /** * Returns an array of categories for the given extension. * * @param string $extension The extension option. * @param array $config An array of configuration options. By default, only published and unpublished categories are returned. * * @return array Categories for the extension * * @since 1.6 */ public static function categories($extension, $config = array('filter.published' => array(0, 1))) { $hash = md5($extension . '.' . serialize($config)); if (!isset(static::$items[$hash])) { $config = (array) $config; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id, a.title, a.level, a.parent_id') ->from('#__categories AS a') ->where('a.parent_id > 0'); // Filter on extension. $query->where('extension = ' . $db->quote($extension)); // Filter on the published state if (isset($config['filter.published'])) { if (is_numeric($config['filter.published'])) { $query->where('a.published = ' . (int) $config['filter.published']); } elseif (is_array($config['filter.published'])) { JArrayHelper::toInteger($config['filter.published']); $query->where('a.published IN (' . implode(',', $config['filter.published']) . ')'); } } $query->order('a.lft'); $db->setQuery($query); $items = $db->loadObjectList(); // Assemble the list options. static::$items[$hash] = array(); foreach ($items as &$item) { $repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0; $item->title = str_repeat('- ', $repeat) . $item->title; static::$items[$hash][] = JHtml::_('select.option', $item->id, $item->title); } // Special "Add to root" option: static::$items[$hash][] = JHtml::_('select.option', '1', JText::_('JLIB_HTML_ADD_TO_ROOT')); } return static::$items[$hash]; } } PK���\��c`��libraries/cms/html/tag.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Utility class for tags * * @since 3.1 */ abstract class JHtmlTag { /** * Cached array of the tag items. * * @var array * @since 3.1 */ protected static $items = array(); /** * Returns an array of tags. * * @param array $config An array of configuration options. By default, only * published and unpublished categories are returned. * * @return array * * @since 3.1 */ public static function options($config = array('filter.published' => array(0, 1))) { $hash = md5(serialize($config)); if (!isset(static::$items[$hash])) { $config = (array) $config; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id, a.title, a.level') ->from('#__tags AS a') ->where('a.parent_id > 0'); // Filter on the published state if (isset($config['filter.published'])) { if (is_numeric($config['filter.published'])) { $query->where('a.published = ' . (int) $config['filter.published']); } elseif (is_array($config['filter.published'])) { JArrayHelper::toInteger($config['filter.published']); $query->where('a.published IN (' . implode(',', $config['filter.published']) . ')'); } } // Filter on the language if (isset($config['filter.language'])) { if (is_string($config['filter.language'])) { $query->where('a.language = ' . $db->quote($config['filter.language'])); } elseif (is_array($config['filter.language'])) { foreach ($config['filter.language'] as &$language) { $language = $db->quote($language); } $query->where('a.language IN (' . implode(',', $config['filter.language']) . ')'); } } $query->order('a.lft'); $db->setQuery($query); $items = $db->loadObjectList(); // Assemble the list options. static::$items[$hash] = array(); foreach ($items as &$item) { $repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0; $item->title = str_repeat('- ', $repeat) . $item->title; static::$items[$hash][] = JHtml::_('select.option', $item->id, $item->title); } } return static::$items[$hash]; } /** * Returns an array of tags. * * @param array $config An array of configuration options. By default, only published and unpublished tags are returned. * * @return array Tag data * * @since 3.1 */ public static function tags($config = array('filter.published' => array(0, 1))) { $hash = md5(serialize($config)); $config = (array) $config; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id, a.title, a.level, a.parent_id') ->from('#__tags AS a') ->where('a.parent_id > 0'); // Filter on the published state if (isset($config['filter.published'])) { if (is_numeric($config['filter.published'])) { $query->where('a.published = ' . (int) $config['filter.published']); } elseif (is_array($config['filter.published'])) { JArrayHelper::toInteger($config['filter.published']); $query->where('a.published IN (' . implode(',', $config['filter.published']) . ')'); } } $query->order('a.lft'); $db->setQuery($query); $items = $db->loadObjectList(); // Assemble the list options. static::$items[$hash] = array(); foreach ($items as &$item) { $repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0; $item->title = str_repeat('- ', $repeat) . $item->title; static::$items[$hash][] = JHtml::_('select.option', $item->id, $item->title); } return static::$items[$hash]; } /** * This is just a proxy for the formbehavior.ajaxchosen method * * @param string $selector DOM id of the tag field * @param boolean $allowCustom Flag to allow custom values * * @return void * * @since 3.1 */ public static function ajaxfield($selector='#jform_tags', $allowCustom = true) { // Get the component parameters $params = JComponentHelper::getParams("com_tags"); $minTermLength = (int) $params->get("min_term_length", 3); // Tags field ajax $chosenAjaxSettings = new Registry( array( 'selector' => $selector, 'type' => 'GET', 'url' => JUri::root() . 'index.php?option=com_tags&task=tags.searchAjax', 'dataType' => 'json', 'jsonTermKey' => 'like', 'minTermLength' => $minTermLength ) ); JHtml::_('formbehavior.ajaxchosen', $chosenAjaxSettings); // Allow custom values ? if ($allowCustom) { JFactory::getDocument()->addScriptDeclaration(" (function($){ $(document).ready(function () { var customTagPrefix = '#new#'; // Method to add tags pressing enter $('" . $selector . "_chzn input').keyup(function(event) { // Tag is greater than the minimum required chars and enter pressed if (this.value && this.value.length >= " . $minTermLength . " && (event.which === 13 || event.which === 188)) { // Search an highlighted result var highlighted = $('" . $selector . "_chzn').find('li.active-result.highlighted').first(); // Add the highlighted option if (event.which === 13 && highlighted.text() !== '') { // Extra check. If we have added a custom tag with this text remove it var customOptionValue = customTagPrefix + highlighted.text(); $('" . $selector . " option').filter(function () { return $(this).val() == customOptionValue; }).remove(); // Select the highlighted result var tagOption = $('" . $selector . " option').filter(function () { return $(this).html() == highlighted.text(); }); tagOption.attr('selected', 'selected'); } // Add the custom tag option else { var customTag = this.value; // Extra check. Search if the custom tag already exists (typed faster than AJAX ready) var tagOption = $('" . $selector . " option').filter(function () { return $(this).html() == customTag; }); if (tagOption.text() !== '') { tagOption.attr('selected', 'selected'); } else { var option = $('<option>'); option.text(this.value).val(customTagPrefix + this.value); option.attr('selected','selected'); // Append the option an repopulate the chosen field $('" . $selector . "').append(option); } } this.value = ''; $('" . $selector . "').trigger('liszt:updated'); event.preventDefault(); } }); }); })(jQuery); " ); } } } PK���\�V�Z��libraries/cms/html/form.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for form elements * * @since 1.5 */ abstract class JHtmlForm { /** * Displays a hidden token field to reduce the risk of CSRF exploits * * Use in conjunction with JSession::checkToken() * * @return string A hidden input field with a token * * @see JSession::checkToken() * @since 1.5 */ public static function token() { return '<input type="hidden" name="' . JSession::getFormToken() . '" value="1" />'; } } PK���\��I��h�hlibraries/cms/html/behavior.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for JavaScript behaviors * * @since 1.5 */ abstract class JHtmlBehavior { /** * Array containing information for loaded files * * @var array * @since 2.5 */ protected static $loaded = array(); /** * Method to load the MooTools framework into the document head * * If debugging mode is on an uncompressed version of MooTools is included for easier debugging. * * @param boolean $extras Flag to determine whether to load MooTools More in addition to Core * @param mixed $debug Is debugging mode on? [optional] * * @return void * * @since 1.6 */ public static function framework($extras = false, $debug = null) { $type = $extras ? 'more' : 'core'; // Only load once if (!empty(static::$loaded[__METHOD__][$type])) { return; } // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = $config->get('debug'); } if ($type != 'core' && empty(static::$loaded[__METHOD__]['core'])) { static::framework(false, $debug); } JHtml::_('script', 'system/mootools-' . $type . '.js', false, true, false, false, $debug); // Keep loading core.js for BC reasons static::core(); static::$loaded[__METHOD__][$type] = true; return; } /** * Method to load core.js into the document head. * * Core.js defines the 'Joomla' namespace and contains functions which are used across extensions * * @return void * * @since 3.3 */ public static function core() { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } JHtml::_('script', 'system/core.js', false, true); static::$loaded[__METHOD__] = true; return; } /** * Add unobtrusive JavaScript support for image captions. * * @param string $selector The selector for which a caption behaviour is to be applied. * * @return void * * @since 1.5 */ public static function caption($selector = 'img.caption') { // Only load once if (isset(static::$loaded[__METHOD__][$selector])) { return; } // Include jQuery JHtml::_('jquery.framework'); JHtml::_('script', 'system/caption.js', false, true); // Attach caption to document JFactory::getDocument()->addScriptDeclaration( "jQuery(window).on('load', function() { new JCaption('" . $selector . "'); });" ); // Set static array static::$loaded[__METHOD__][$selector] = true; } /** * Add unobtrusive JavaScript support for form validation. * * To enable form validation the form tag must have class="form-validate". * Each field that needs to be validated needs to have class="validate". * Additional handlers can be added to the handler for username, password, * numeric and email. To use these add class="validate-email" and so on. * * @return void * * @since 1.5 * * @Deprecated 3.4 Use formvalidator instead */ public static function formvalidation() { JLog::add('The use of formvalidation is deprecated use formvalidator instead.', JLog::WARNING, 'deprecated'); // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // Include MooTools framework static::framework(); // Load the new jQuery code static::formvalidator(); } /** * Add unobtrusive JavaScript support for form validation. * * To enable form validation the form tag must have class="form-validate". * Each field that needs to be validated needs to have class="validate". * Additional handlers can be added to the handler for username, password, * numeric and email. To use these add class="validate-email" and so on. * * @return void * * @since 3.4 */ public static function formvalidator() { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // Include core static::core(); // Include jQuery JHtml::_('jquery.framework'); // Add validate.js language strings JText::script('JLIB_FORM_FIELD_INVALID'); JHtml::_('script', 'system/punycode.js', false, true); JHtml::_('script', 'system/validate.js', false, true); static::$loaded[__METHOD__] = true; } /** * Add unobtrusive JavaScript support for submenu switcher support * * @return void * * @since 1.5 */ public static function switcher() { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // Include jQuery JHtml::_('jquery.framework'); JHtml::_('script', 'system/switcher.js', true, true); $script = " document.switcher = null; jQuery(function($){ var toggler = document.getElementById('submenu'); var element = document.getElementById('config-document'); if (element) { document.switcher = new JSwitcher(toggler, element); } });"; JFactory::getDocument()->addScriptDeclaration($script); static::$loaded[__METHOD__] = true; } /** * Add unobtrusive JavaScript support for a combobox effect. * * Note that this control is only reliable in absolutely positioned elements. * Avoid using a combobox in a slider or dynamic pane. * * @return void * * @since 1.5 */ public static function combobox() { if (isset(static::$loaded[__METHOD__])) { return; } // Include core static::core(); JHtml::_('script', 'system/combobox.js', false, true); static::$loaded[__METHOD__] = true; } /** * Add unobtrusive JavaScript support for a hover tooltips. * * Add a title attribute to any element in the form * title="title::text" * * Uses the core Tips class in MooTools. * * @param string $selector The class selector for the tooltip. * @param array $params An array of options for the tooltip. * Options for the tooltip can be: * - maxTitleChars integer The maximum number of characters in the tooltip title (defaults to 50). * - offsets object The distance of your tooltip from the mouse (defaults to {'x': 16, 'y': 16}). * - showDelay integer The millisecond delay the show event is fired (defaults to 100). * - hideDelay integer The millisecond delay the hide hide is fired (defaults to 100). * - className string The className your tooltip container will get. * - fixed boolean If set to true, the toolTip will not follow the mouse. * - onShow function The default function for the show event, passes the tip element * and the currently hovered element. * - onHide function The default function for the hide event, passes the currently * hovered element. * * @return void * * @since 1.5 */ public static function tooltip($selector = '.hasTip', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (isset(static::$loaded[__METHOD__][$sig])) { return; } // Include MooTools framework static::framework(true); // Setup options object $opt['maxTitleChars'] = (isset($params['maxTitleChars']) && ($params['maxTitleChars'])) ? (int) $params['maxTitleChars'] : 50; // Offsets needs an array in the format: array('x'=>20, 'y'=>30) $opt['offset'] = (isset($params['offset']) && (is_array($params['offset']))) ? $params['offset'] : null; $opt['showDelay'] = (isset($params['showDelay'])) ? (int) $params['showDelay'] : null; $opt['hideDelay'] = (isset($params['hideDelay'])) ? (int) $params['hideDelay'] : null; $opt['className'] = (isset($params['className'])) ? $params['className'] : null; $opt['fixed'] = (isset($params['fixed']) && ($params['fixed'])) ? true : false; $opt['onShow'] = (isset($params['onShow'])) ? '\\' . $params['onShow'] : null; $opt['onHide'] = (isset($params['onHide'])) ? '\\' . $params['onHide'] : null; $options = JHtml::getJSObject($opt); // Include jQuery JHtml::_('jquery.framework'); // Attach tooltips to document JFactory::getDocument()->addScriptDeclaration( "jQuery(function($) { $('$selector').each(function() { var title = $(this).attr('title'); if (title) { var parts = title.split('::', 2); var mtelement = document.id(this); mtelement.store('tip:title', parts[0]); mtelement.store('tip:text', parts[1]); } }); var JTooltips = new Tips($('$selector').get(), $options); });" ); // Set static array static::$loaded[__METHOD__][$sig] = true; return; } /** * Add unobtrusive JavaScript support for modal links. * * @param string $selector The selector for which a modal behaviour is to be applied. * @param array $params An array of parameters for the modal behaviour. * Options for the modal behaviour can be: * - ajaxOptions * - size * - shadow * - overlay * - onOpen * - onClose * - onUpdate * - onResize * - onShow * - onHide * * @return void * * @since 1.5 */ public static function modal($selector = 'a.modal', $params = array()) { $document = JFactory::getDocument(); // Load the necessary files if they haven't yet been loaded if (!isset(static::$loaded[__METHOD__])) { // Include MooTools framework static::framework(true); // Load the JavaScript and css JHtml::_('script', 'system/modal.js', true, true); JHtml::_('stylesheet', 'system/modal.css', array(), true); } $sig = md5(serialize(array($selector, $params))); if (isset(static::$loaded[__METHOD__][$sig])) { return; } // Setup options object $opt['ajaxOptions'] = (isset($params['ajaxOptions']) && (is_array($params['ajaxOptions']))) ? $params['ajaxOptions'] : null; $opt['handler'] = (isset($params['handler'])) ? $params['handler'] : null; $opt['parseSecure'] = (isset($params['parseSecure'])) ? (bool) $params['parseSecure'] : null; $opt['closable'] = (isset($params['closable'])) ? (bool) $params['closable'] : null; $opt['closeBtn'] = (isset($params['closeBtn'])) ? (bool) $params['closeBtn'] : null; $opt['iframePreload'] = (isset($params['iframePreload'])) ? (bool) $params['iframePreload'] : null; $opt['iframeOptions'] = (isset($params['iframeOptions']) && (is_array($params['iframeOptions']))) ? $params['iframeOptions'] : null; $opt['size'] = (isset($params['size']) && (is_array($params['size']))) ? $params['size'] : null; $opt['shadow'] = (isset($params['shadow'])) ? $params['shadow'] : null; $opt['overlay'] = (isset($params['overlay'])) ? $params['overlay'] : null; $opt['onOpen'] = (isset($params['onOpen'])) ? $params['onOpen'] : null; $opt['onClose'] = (isset($params['onClose'])) ? $params['onClose'] : null; $opt['onUpdate'] = (isset($params['onUpdate'])) ? $params['onUpdate'] : null; $opt['onResize'] = (isset($params['onResize'])) ? $params['onResize'] : null; $opt['onMove'] = (isset($params['onMove'])) ? $params['onMove'] : null; $opt['onShow'] = (isset($params['onShow'])) ? $params['onShow'] : null; $opt['onHide'] = (isset($params['onHide'])) ? $params['onHide'] : null; // Include jQuery JHtml::_('jquery.framework'); if (isset($params['fullScreen']) && (bool) $params['fullScreen']) { $opt['size'] = array('x' => '\\jQuery(window).width() - 80', 'y' => '\\jQuery(window).height() - 80'); } $options = JHtml::getJSObject($opt); // Attach modal behavior to document $document ->addScriptDeclaration( " jQuery(function($) { SqueezeBox.initialize(" . $options . "); SqueezeBox.assign($('" . $selector . "').get(), { parse: 'rel' }); }); function jModalClose() { SqueezeBox.close(); }" ); // Set static array static::$loaded[__METHOD__][$sig] = true; return; } /** * JavaScript behavior to allow shift select in grids * * @param string $id The id of the form for which a multiselect behaviour is to be applied. * * @return void * * @since 1.7 */ public static function multiselect($id = 'adminForm') { // Only load once if (isset(static::$loaded[__METHOD__][$id])) { return; } // Include core static::core(); // Include jQuery JHtml::_('jquery.framework'); JHtml::_('script', 'system/multiselect.js', false, true); // Attach multiselect to document JFactory::getDocument()->addScriptDeclaration( "jQuery(document).ready(function() { Joomla.JMultiSelect('" . $id . "'); });" ); // Set static array static::$loaded[__METHOD__][$id] = true; return; } /** * Add unobtrusive javascript support for a collapsible tree. * * @param string $id An index * @param array $params An array of options. * @param array $root The root node * * @return void * * @since 1.5 */ public static function tree($id, $params = array(), $root = array()) { // Include MooTools framework static::framework(); JHtml::_('script', 'system/mootree.js', true, true, false, false); JHtml::_('stylesheet', 'system/mootree.css', array(), true); if (isset(static::$loaded[__METHOD__][$id])) { return; } // Include jQuery JHtml::_('jquery.framework'); // Setup options object $opt['div'] = (array_key_exists('div', $params)) ? $params['div'] : $id . '_tree'; $opt['mode'] = (array_key_exists('mode', $params)) ? $params['mode'] : 'folders'; $opt['grid'] = (array_key_exists('grid', $params)) ? '\\' . $params['grid'] : true; $opt['theme'] = (array_key_exists('theme', $params)) ? $params['theme'] : JHtml::_('image', 'system/mootree.gif', '', array(), true, true); // Event handlers $opt['onExpand'] = (array_key_exists('onExpand', $params)) ? '\\' . $params['onExpand'] : null; $opt['onSelect'] = (array_key_exists('onSelect', $params)) ? '\\' . $params['onSelect'] : null; $opt['onClick'] = (array_key_exists('onClick', $params)) ? '\\' . $params['onClick'] : '\\function(node){ window.open(node.data.url, node.data.target != null ? node.data.target : \'_self\'); }'; $options = JHtml::getJSObject($opt); // Setup root node $rt['text'] = (array_key_exists('text', $root)) ? $root['text'] : 'Root'; $rt['id'] = (array_key_exists('id', $root)) ? $root['id'] : null; $rt['color'] = (array_key_exists('color', $root)) ? $root['color'] : null; $rt['open'] = (array_key_exists('open', $root)) ? '\\' . $root['open'] : true; $rt['icon'] = (array_key_exists('icon', $root)) ? $root['icon'] : null; $rt['openicon'] = (array_key_exists('openicon', $root)) ? $root['openicon'] : null; $rt['data'] = (array_key_exists('data', $root)) ? $root['data'] : null; $rootNode = JHtml::getJSObject($rt); $treeName = (array_key_exists('treeName', $params)) ? $params['treeName'] : ''; $js = ' jQuery(function(){ tree' . $treeName . ' = new MooTreeControl(' . $options . ',' . $rootNode . '); tree' . $treeName . '.adopt(\'' . $id . '\');})'; // Attach tooltips to document $document = JFactory::getDocument(); $document->addScriptDeclaration($js); // Set static array static::$loaded[__METHOD__][$id] = true; return; } /** * Add unobtrusive JavaScript support for a calendar control. * * @return void * * @since 1.5 */ public static function calendar() { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } $document = JFactory::getDocument(); $tag = JFactory::getLanguage()->getTag(); JHtml::_('stylesheet', 'system/calendar-jos.css', array(' title' => JText::_('JLIB_HTML_BEHAVIOR_GREEN'), ' media' => 'all'), true); JHtml::_('script', $tag . '/calendar.js', false, true); JHtml::_('script', $tag . '/calendar-setup.js', false, true); $translation = static::calendartranslation(); if ($translation) { $document->addScriptDeclaration($translation); } static::$loaded[__METHOD__] = true; } /** * Add unobtrusive JavaScript support for a color picker. * * @return void * * @since 1.7 */ public static function colorpicker() { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // Include jQuery JHtml::_('jquery.framework'); JHtml::_('script', 'jui/jquery.minicolors.min.js', false, true); JHtml::_('stylesheet', 'jui/jquery.minicolors.css', false, true); JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function (){ jQuery('.minicolors').each(function() { jQuery(this).minicolors({ control: jQuery(this).attr('data-control') || 'hue', position: jQuery(this).attr('data-position') || 'right', theme: 'bootstrap' }); }); }); " ); static::$loaded[__METHOD__] = true; } /** * Add unobtrusive JavaScript support for a simple color picker. * * @return void * * @since 3.1 */ public static function simplecolorpicker() { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // Include jQuery JHtml::_('jquery.framework'); JHtml::_('script', 'jui/jquery.simplecolors.min.js', false, true); JHtml::_('stylesheet', 'jui/jquery.simplecolors.css', false, true); JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function (){ jQuery('select.simplecolors').simplecolors(); }); " ); static::$loaded[__METHOD__] = true; } /** * Keep session alive, for example, while editing or creating an article. * * @return void * * @since 1.5 */ public static function keepalive() { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // If the handler is not 'Database', we set a fixed, small refresh value (here: 5 min) if (JFactory::getConfig()->get('session_handler') != 'database') { $refresh_time = 300000; } else { $life_time = JFactory::getConfig()->get('lifetime') * 60000; $refresh_time = ($life_time <= 60000) ? 45000 : $life_time - 60000; // The longest refresh period is one hour to prevent integer overflow. if ($refresh_time > 3600000 || $refresh_time <= 0) { $refresh_time = 3600000; } } // If we are in the frontend or logged in as a user, we can use the ajax component to reduce the load if (JFactory::getApplication()->isSite() || !JFactory::getUser()->guest) { $url = JUri::base(true) . '/index.php?option=com_ajax&format=json'; } else { $url = JUri::base(true) . '/index.php'; } $script = 'window.setInterval(function(){'; $script .= 'var r;'; $script .= 'try{'; $script .= 'r=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")'; $script .= '}catch(e){}'; $script .= 'if(r){r.open("GET","' . $url . '",true);r.send(null)}'; $script .= '},' . $refresh_time . ');'; JFactory::getDocument()->addScriptDeclaration($script); static::$loaded[__METHOD__] = true; return; } /** * Highlight some words via Javascript. * * @param array $terms Array of words that should be highlighted. * @param string $start ID of the element that marks the begin of the section in which words * should be highlighted. Note this element will be removed from the DOM. * @param string $end ID of the element that end this section. * Note this element will be removed from the DOM. * @param string $className Class name of the element highlights are wrapped in. * @param string $tag Tag that will be used to wrap the highlighted words. * * @return void * * @since 2.5 */ public static function highlighter(array $terms, $start = 'highlighter-start', $end = 'highlighter-end', $className = 'highlight', $tag = 'span') { $sig = md5(serialize(array($terms, $start, $end))); if (isset(static::$loaded[__METHOD__][$sig])) { return; } // Include core static::core(); // Include jQuery JHtml::_('jquery.framework'); JHtml::_('script', 'system/highlighter.js', false, true); $terms = str_replace('"', '\"', $terms); $document = JFactory::getDocument(); $document->addScriptDeclaration(" jQuery(function ($) { var start = document.getElementById('" . $start . "'); var end = document.getElementById('" . $end . "'); if (!start || !end || !Joomla.Highlighter) { return true; } highlighter = new Joomla.Highlighter({ startElement: start, endElement: end, className: '" . $className . "', onlyWords: false, tag: '" . $tag . "' }).highlight([\"" . implode('","', $terms) . "\"]); $(start).remove(); $(end).remove(); }); "); static::$loaded[__METHOD__][$sig] = true; return; } /** * Break us out of any containing iframes * * @return void * * @since 1.5 */ public static function noframes() { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // Include core static::core(); // Include jQuery JHtml::_('jquery.framework'); $js = "jQuery(function () {if (top == self) {document.documentElement.style.display = 'block'; }" . " else {top.location = self.location; }});"; $document = JFactory::getDocument(); $document->addStyleDeclaration('html { display:none }'); $document->addScriptDeclaration($js); JFactory::getApplication()->setHeader('X-Frame-Options', 'SAMEORIGIN'); static::$loaded[__METHOD__] = true; } /** * Internal method to get a JavaScript object notation string from an array * * @param array $array The array to convert to JavaScript object notation * * @return string JavaScript object notation representation of the array * * @since 1.5 * @deprecated 13.3 (Platform) & 4.0 (CMS) - Use JHtml::getJSObject() instead. */ protected static function _getJSObject($array = array()) { JLog::add('JHtmlBehavior::_getJSObject() is deprecated. JHtml::getJSObject() instead..', JLog::WARNING, 'deprecated'); return JHtml::getJSObject($array); } /** * Internal method to translate the JavaScript Calendar * * @return string JavaScript that translates the object * * @since 1.5 */ protected static function calendartranslation() { static $jsscript = 0; // Guard clause, avoids unnecessary nesting if ($jsscript) { return false; } $jsscript = 1; // To keep the code simple here, run strings through JText::_() using array_map() $callback = array('JText','_'); $weekdays_full = array_map( $callback, array( 'SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY' ) ); $weekdays_short = array_map( $callback, array( 'SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN' ) ); $months_long = array_map( $callback, array( 'JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY', 'AUGUST', 'SEPTEMBER', 'OCTOBER', 'NOVEMBER', 'DECEMBER' ) ); $months_short = array_map( $callback, array( 'JANUARY_SHORT', 'FEBRUARY_SHORT', 'MARCH_SHORT', 'APRIL_SHORT', 'MAY_SHORT', 'JUNE_SHORT', 'JULY_SHORT', 'AUGUST_SHORT', 'SEPTEMBER_SHORT', 'OCTOBER_SHORT', 'NOVEMBER_SHORT', 'DECEMBER_SHORT' ) ); // This will become an object in Javascript but define it first in PHP for readability $today = " " . JText::_('JLIB_HTML_BEHAVIOR_TODAY') . " "; $text = array( 'INFO' => JText::_('JLIB_HTML_BEHAVIOR_ABOUT_THE_CALENDAR'), 'ABOUT' => "DHTML Date/Time Selector\n" . "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" . "For latest version visit: http://www.dynarch.com/projects/calendar/\n" . "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." . "\n\n" . JText::_('JLIB_HTML_BEHAVIOR_DATE_SELECTION') . JText::_('JLIB_HTML_BEHAVIOR_YEAR_SELECT') . JText::_('JLIB_HTML_BEHAVIOR_MONTH_SELECT') . JText::_('JLIB_HTML_BEHAVIOR_HOLD_MOUSE'), 'ABOUT_TIME' => "\n\n" . "Time selection:\n" . "- Click on any of the time parts to increase it\n" . "- or Shift-click to decrease it\n" . "- or click and drag for faster selection.", 'PREV_YEAR' => JText::_('JLIB_HTML_BEHAVIOR_PREV_YEAR_HOLD_FOR_MENU'), 'PREV_MONTH' => JText::_('JLIB_HTML_BEHAVIOR_PREV_MONTH_HOLD_FOR_MENU'), 'GO_TODAY' => JText::_('JLIB_HTML_BEHAVIOR_GO_TODAY'), 'NEXT_MONTH' => JText::_('JLIB_HTML_BEHAVIOR_NEXT_MONTH_HOLD_FOR_MENU'), 'SEL_DATE' => JText::_('JLIB_HTML_BEHAVIOR_SELECT_DATE'), 'DRAG_TO_MOVE' => JText::_('JLIB_HTML_BEHAVIOR_DRAG_TO_MOVE'), 'PART_TODAY' => $today, 'DAY_FIRST' => JText::_('JLIB_HTML_BEHAVIOR_DISPLAY_S_FIRST'), 'WEEKEND' => JFactory::getLanguage()->getWeekEnd(), 'CLOSE' => JText::_('JLIB_HTML_BEHAVIOR_CLOSE'), 'TODAY' => JText::_('JLIB_HTML_BEHAVIOR_TODAY'), 'TIME_PART' => JText::_('JLIB_HTML_BEHAVIOR_SHIFT_CLICK_OR_DRAG_TO_CHANGE_VALUE'), 'DEF_DATE_FORMAT' => "%Y-%m-%d", 'TT_DATE_FORMAT' => JText::_('JLIB_HTML_BEHAVIOR_TT_DATE_FORMAT'), 'WK' => JText::_('JLIB_HTML_BEHAVIOR_WK'), 'TIME' => JText::_('JLIB_HTML_BEHAVIOR_TIME') ); return 'Calendar._DN = ' . json_encode($weekdays_full) . ';' . ' Calendar._SDN = ' . json_encode($weekdays_short) . ';' . ' Calendar._FD = 0;' . ' Calendar._MN = ' . json_encode($months_long) . ';' . ' Calendar._SMN = ' . json_encode($months_short) . ';' . ' Calendar._TT = ' . json_encode($text) . ';'; } /** * Add unobtrusive JavaScript support to keep a tab state. * * Note that keeping tab state only works for inner tabs if in accordance with the following example * parent tab = permissions * child tab = permission-<identifier> * * Each tab header "a" tag also should have a unique href attribute * * @return void * * @since 3.2 */ public static function tabstate() { if (isset(self::$loaded[__METHOD__])) { return; } // Include jQuery JHtml::_('jquery.framework'); JHtml::_('script', 'system/tabs-state.js', false, true); self::$loaded[__METHOD__] = true; } } PK���\�"M���libraries/cms/html/rules.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Extended Utility class for all HTML drawing classes. * * @since 1.6 */ abstract class JHtmlRules { /** * Creates the HTML for the permissions widget * * @param array $actions Array of action objects * @param integer $assetId Id of a specific asset to create a widget for. * @param integer $parent Id of the parent of the asset * @param string $control The form control * @param string $idPrefix Prefix for the ids assigned to specific action-group pairs * * @return string HTML for the permissions widget * * @see JAccess * @see JFormFieldRules * @since 1.6 */ public static function assetFormWidget($actions, $assetId = null, $parent = null, $control = 'jform[rules]', $idPrefix = 'jform_rules') { $images = static::_getImagesArray(); // Get the user groups. $groups = static::_getUserGroups(); // Get the incoming inherited rules as well as the asset specific rules. $inheriting = JAccess::getAssetRules($parent ? $parent : static::_getParentAssetId($assetId), true); $inherited = JAccess::getAssetRules($assetId, true); $rules = JAccess::getAssetRules($assetId); $html = array(); $html[] = '<div class="acl-options">'; $html[] = JHtml::_('tabs.start', 'acl-rules-' . $assetId, array('useCookie' => 1)); $html[] = JHtml::_('tabs.panel', JText::_('JLIB_HTML_ACCESS_SUMMARY'), 'summary'); $html[] = ' <p>' . JText::_('JLIB_HTML_ACCESS_SUMMARY_DESC') . '</p>'; $html[] = ' <table class="aclsummary-table" summary="' . JText::_('JLIB_HTML_ACCESS_SUMMARY_DESC') . '">'; $html[] = ' <caption>' . JText::_('JLIB_HTML_ACCESS_SUMMARY_DESC_CAPTION') . '</caption>'; $html[] = ' <tr>'; $html[] = ' <th class="col1 hidelabeltxt">' . JText::_('JLIB_RULES_GROUPS') . '</th>'; foreach ($actions as $i => $action) { $html[] = ' <th class="col' . ($i + 2) . '">' . JText::_($action->title) . '</th>'; } $html[] = ' </tr>'; foreach ($groups as $i => $group) { $html[] = ' <tr class="row' . ($i % 2) . '">'; $html[] = ' <td class="col1">' . $group->text . '</td>'; foreach ($actions as $j => $action) { $html[] = ' <td class="col' . ($j + 2) . '">' . ($assetId ? ($inherited->allow($action->name, $group->identities) ? $images['allow'] : $images['deny']) : ($inheriting->allow($action->name, $group->identities) ? $images['allow'] : $images['deny'])) . '</td>'; } $html[] = ' </tr>'; } $html[] = ' </table>'; foreach ($actions as $action) { $actionTitle = JText::_($action->title); $actionDesc = JText::_($action->description); $html[] = JHtml::_('tabs.panel', $actionTitle, $action->name); $html[] = ' <p>' . $actionDesc . '</p>'; $html[] = ' <table class="aclmodify-table" summary="' . strip_tags($actionDesc) . '">'; $html[] = ' <caption>' . JText::_('JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_ACL') . ' ' . $actionTitle . ' ' . JText::_('JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_TABLE') . '</caption>'; $html[] = ' <tr>'; $html[] = ' <th class="col1 hidelabeltxt">' . JText::_('JLIB_RULES_GROUP') . '</th>'; $html[] = ' <th class="col2">' . JText::_('JLIB_RULES_INHERIT') . '</th>'; $html[] = ' <th class="col3 hidelabeltxt">' . JText::_('JMODIFY') . '</th>'; $html[] = ' <th class="col4">' . JText::_('JCURRENT') . '</th>'; $html[] = ' </tr>'; foreach ($groups as $i => $group) { $selected = $rules->allow($action->name, $group->value); $html[] = ' <tr class="row' . ($i % 2) . '">'; $html[] = ' <td class="col1">' . $group->text . '</td>'; $html[] = ' <td class="col2">' . ($inheriting->allow($action->name, $group->identities) ? $images['allow-i'] : $images['deny-i']) . '</td>'; $html[] = ' <td class="col3">'; $html[] = ' <select id="' . $idPrefix . '_' . $action->name . '_' . $group->value . '" class="inputbox" size="1" name="' . $control . '[' . $action->name . '][' . $group->value . ']" title="' . JText::sprintf('JLIB_RULES_SELECT_ALLOW_DENY_GROUP', $actionTitle, $group->text) . '">'; $html[] = ' <option value=""' . ($selected === null ? ' selected="selected"' : '') . '>' . JText::_('JLIB_RULES_INHERIT') . '</option>'; $html[] = ' <option value="1"' . ($selected === true ? ' selected="selected"' : '') . '>' . JText::_('JLIB_RULES_ALLOWED') . '</option>'; $html[] = ' <option value="0"' . ($selected === false ? ' selected="selected"' : '') . '>' . JText::_('JLIB_RULES_DENIED') . '</option>'; $html[] = ' </select>'; $html[] = ' </td>'; $html[] = ' <td class="col4">' . ($assetId ? ($inherited->allow($action->name, $group->identities) ? $images['allow'] : $images['deny']) : ($inheriting->allow($action->name, $group->identities) ? $images['allow'] : $images['deny'])) . '</td>'; $html[] = ' </tr>'; } $html[] = ' </table>'; } $html[] = JHtml::_('tabs.end'); // Build the footer with legend and special purpose buttons. $html[] = ' <div class="clr"></div>'; $html[] = ' <ul class="acllegend fltlft">'; $html[] = ' <li class="acl-allowed">' . JText::_('JLIB_RULES_ALLOWED') . '</li>'; $html[] = ' <li class="acl-denied">' . JText::_('JLIB_RULES_DENIED') . '</li>'; $html[] = ' </ul>'; $html[] = '</div>'; return implode("\n", $html); } /** * Get the id of the parent asset * * @param integer $assetId The asset for which the parentid will be returned * * @return integer The id of the parent asset * * @since 1.6 */ protected static function _getParentAssetId($assetId) { // Get a database object. $db = JFactory::getDbo(); $query = $db->getQuery(true); // Get the user groups from the database. $query->select($db->quoteName('parent_id')) ->from($db->quoteName('#__assets')) ->where($db->quoteName('id') . ' = ' . (int) $assetId); $db->setQuery($query); return (int) $db->loadResult(); } /** * Get the user groups * * @return array Array of user groups * * @since 1.6 */ protected static function _getUserGroups() { // Get a database object. $db = JFactory::getDbo(); // Get the user groups from the database. $db->setQuery( 'SELECT a.id AS value, a.title AS text, b.id as parent' . ' FROM #__usergroups AS a LEFT JOIN #__usergroups AS b ON a.lft >= b.lft AND a.rgt <= b.rgt' . ' ORDER BY a.lft ASC, b.lft ASC' ); $result = $db->loadObjectList(); $options = array(); // Pre-compute additional values. foreach ($result as $option) { $end = end($options); if ($end === false || $end->value != $option->value) { $end = $option; $end->level = 0; $options[] = $end; } else { $end->level++; } $end->identities[] = $option->parent; } return $options; } /** * Get the array of images associate with specific permissions * * @return array An associative array of permissions and images * * @since 1.6 */ protected static function _getImagesArray() { $images['allow-l'] = '<label class="icon-16-allow" title="' . JText::_('JLIB_RULES_ALLOWED') . '">' . JText::_('JLIB_RULES_ALLOWED') . '</label>'; $images['deny-l'] = '<label class="icon-16-deny" title="' . JText::_('JLIB_RULES_DENIED') . '">' . JText::_('JLIB_RULES_DENIED') . '</label>'; $images['allow'] = '<a class="icon-16-allow" title="' . JText::_('JLIB_RULES_ALLOWED') . '"> </a>'; $images['deny'] = '<a class="icon-16-deny" title="' . JText::_('JLIB_RULES_DENIED') . '"> </a>'; $images['allow-i'] = '<a class="icon-16-allowinactive" title="' . JText::_('JRULE_ALLOWED_INHERITED') . '"> </a>'; $images['deny-i'] = '<a class="icon-16-denyinactive" title="' . JText::_('JRULE_DENIED_INHERITED') . '"> </a>'; return $images; } } PK���\���libraries/cms/html/batch.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Extended Utility class for batch processing widgets. * * @since 1.7 */ abstract class JHtmlBatch { /** * Display a batch widget for the access level selector. * * @return string The necessary HTML for the widget. * * @since 1.7 */ public static function access() { JHtml::_('bootstrap.tooltip', '.modalTooltip', array('container' => '.modal-body')); // Create the batch selector to change an access level on a selection list. return '<label id="batch-access-lbl" for="batch-access" class="modalTooltip" ' . 'title="' . JHtml::tooltipText('JLIB_HTML_BATCH_ACCESS_LABEL', 'JLIB_HTML_BATCH_ACCESS_LABEL_DESC') . '">' . JText::_('JLIB_HTML_BATCH_ACCESS_LABEL') . '</label>' . JHtml::_( 'access.assetgrouplist', 'batch[assetgroup_id]', '', 'class="inputbox"', array( 'title' => JText::_('JLIB_HTML_BATCH_NOCHANGE'), 'id' => 'batch-access' ) ); } /** * Displays a batch widget for moving or copying items. * * @param string $extension The extension that owns the category. * * @return string The necessary HTML for the widget. * * @since 1.7 */ public static function item($extension) { // Create the copy/move options. $options = array( JHtml::_('select.option', 'c', JText::_('JLIB_HTML_BATCH_COPY')), JHtml::_('select.option', 'm', JText::_('JLIB_HTML_BATCH_MOVE')) ); // Create the batch selector to change select the category by which to move or copy. return '<label id="batch-choose-action-lbl" for="batch-choose-action">' . JText::_('JLIB_HTML_BATCH_MENU_LABEL') . '</label>' . '<div id="batch-choose-action" class="control-group">' . '<select name="batch[category_id]" class="inputbox" id="batch-category-id">' . '<option value="">' . JText::_('JLIB_HTML_BATCH_NO_CATEGORY') . '</option>' . JHtml::_('select.options', JHtml::_('category.options', $extension)) . '</select>' . '</div>' . '<div id="batch-copy-move" class="control-group radio">' . JText::_('JLIB_HTML_BATCH_MOVE_QUESTION') . JHtml::_('select.radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm') . '</div>'; } /** * Display a batch widget for the language selector. * * @return string The necessary HTML for the widget. * * @since 2.5 */ public static function language() { JHtml::_('bootstrap.tooltip', '.modalTooltip', array('container' => '.modal-body')); JFactory::getDocument()->addScriptDeclaration( ' jQuery(document).ready(function($){ if ($("#batch-category-id").length){var batchSelector = $("#batch-category-id");} if ($("#batch-menu-id").length){var batchSelector = $("#batch-menu-id");} if ($("#batch-position-id").length){var batchSelector = $("#batch-position-id");} if ($("#batch-copy-move").length) { $("#batch-copy-move").hide(); batchSelector.on("change", function(){ if (batchSelector.val() != 0 || batchSelector.val() != "") { $("#batch-copy-move").show(); } else { $("#batch-copy-move").hide(); } }); } }); ' ); // Create the batch selector to change the language on a selection list. return '<label id="batch-language-lbl" for="batch-language-id" class="modalTooltip"' . ' title="' . JHtml::tooltipText('JLIB_HTML_BATCH_LANGUAGE_LABEL', 'JLIB_HTML_BATCH_LANGUAGE_LABEL_DESC') . '">' . JText::_('JLIB_HTML_BATCH_LANGUAGE_LABEL') . '</label>' . '<select name="batch[language_id]" class="inputbox" id="batch-language-id">' . '<option value="">' . JText::_('JLIB_HTML_BATCH_LANGUAGE_NOCHANGE') . '</option>' . JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text') . '</select>'; } /** * Display a batch widget for the user selector. * * @param boolean $noUser Choose to display a "no user" option * * @return string The necessary HTML for the widget. * * @since 2.5 */ public static function user($noUser = true) { JHtml::_('bootstrap.tooltip', '.modalTooltip', array('container' => '.modal-body')); $optionNo = ''; if ($noUser) { $optionNo = '<option value="0">' . JText::_('JLIB_HTML_BATCH_USER_NOUSER') . '</option>'; } // Create the batch selector to select a user on a selection list. return '<label id="batch-user-lbl" for="batch-user" class="modalTooltip"' . ' title="' . JHtml::tooltipText('JLIB_HTML_BATCH_USER_LABEL', 'JLIB_HTML_BATCH_USER_LABEL_DESC') . '">' . JText::_('JLIB_HTML_BATCH_USER_LABEL') . '</label>' . '<select name="batch[user_id]" class="inputbox" id="batch-user-id">' . '<option value="">' . JText::_('JLIB_HTML_BATCH_USER_NOCHANGE') . '</option>' . $optionNo . JHtml::_('select.options', JHtml::_('user.userlist'), 'value', 'text') . '</select>'; } /** * Display a batch widget for the tag selector. * * @return string The necessary HTML for the widget. * * @since 3.1 */ public static function tag() { JHtml::_('bootstrap.tooltip', '.modalTooltip', array('container' => '.modal-body')); // Create the batch selector to tag items on a selection list. return '<label id="batch-tag-lbl" for="batch-tag-id" class="modalTooltip"' . ' title="' . JHtml::tooltipText('JLIB_HTML_BATCH_TAG_LABEL', 'JLIB_HTML_BATCH_TAG_LABEL_DESC') . '">' . JText::_('JLIB_HTML_BATCH_TAG_LABEL') . '</label>' . '<select name="batch[tag]" class="inputbox" id="batch-tag-id">' . '<option value="">' . JText::_('JLIB_HTML_BATCH_TAG_NOCHANGE') . '</option>' . JHtml::_('select.options', JHtml::_('tag.tags', array('filter.published' => array(1))), 'value', 'text') . '</select>'; } } PK���\�s��#�#libraries/cms/html/string.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * HTML helper class for rendering manipulated strings. * * @since 1.6 */ abstract class JHtmlString { /** * Truncates text blocks over the specified character limit and closes * all open HTML tags. The method will optionally not truncate an individual * word, it will find the first space that is within the limit and * truncate at that point. This method is UTF-8 safe. * * @param string $text The text to truncate. * @param integer $length The maximum length of the text. * @param boolean $noSplit Don't split a word if that is where the cutoff occurs (default: true). * @param boolean $allowHtml Allow HTML tags in the output, and close any open tags (default: true). * * @return string The truncated text. * * @since 1.6 */ public static function truncate($text, $length = 0, $noSplit = true, $allowHtml = true) { // Assume a lone open tag is invalid HTML. if ($length == 1 && substr($text, 0, 1) == '<') { return '...'; } // Check if HTML tags are allowed. if (!$allowHtml) { // Deal with spacing issues in the input. $text = str_replace('>', '> ', $text); $text = str_replace(array(' ', ' '), ' ', $text); $text = JString::trim(preg_replace('#\s+#mui', ' ', $text)); // Strip the tags from the input and decode entities. $text = strip_tags($text); $text = html_entity_decode($text, ENT_QUOTES, 'UTF-8'); // Remove remaining extra spaces. $text = str_replace(' ', ' ', $text); $text = JString::trim(preg_replace('#\s+#mui', ' ', $text)); } // Whether or not allowing HTML, truncate the item text if it is too long. if ($length > 0 && JString::strlen($text) > $length) { $tmp = trim(JString::substr($text, 0, $length)); if (substr($tmp, 0, 1) == '<' && strpos($tmp, '>') === false) { return '...'; } // $noSplit true means that we do not allow splitting of words. if ($noSplit) { // Find the position of the last space within the allowed length. $offset = JString::strrpos($tmp, ' '); $tmp = JString::substr($tmp, 0, $offset + 1); // If there are no spaces and the string is longer than the maximum // we need to just use the ellipsis. In that case we are done. if ($offset === false && strlen($text) > $length) { return '...'; } if (JString::strlen($tmp) > $length - 3) { $tmp = trim(JString::substr($tmp, 0, JString::strrpos($tmp, ' '))); } } if ($allowHtml) { // Put all opened tags into an array preg_match_all("#<([a-z][a-z0-9]*)\b.*?(?!/)>#i", $tmp, $result); $openedTags = $result[1]; // Some tags self close so they do not need a separate close tag. $openedTags = array_diff($openedTags, array("img", "hr", "br")); $openedTags = array_values($openedTags); // Put all closed tags into an array preg_match_all("#</([a-z][a-z0-9]*)\b(?:[^>]*?)>#iU", $tmp, $result); $closedTags = $result[1]; $numOpened = count($openedTags); // All tags are closed so trim the text and finish. if (count($closedTags) == $numOpened) { return trim($tmp) . '...'; } // Closing tags need to be in the reverse order of opening tags. $openedTags = array_reverse($openedTags); // Close tags for ($i = 0; $i < $numOpened; $i++) { if (!in_array($openedTags[$i], $closedTags)) { $tmp .= "</" . $openedTags[$i] . ">"; } else { unset($closedTags[array_search($openedTags[$i], $closedTags)]); } } } if ($tmp === false || strlen($text) > strlen($tmp)) { $text = trim($tmp) . '...'; } } // Clean up any internal spaces created by the processing. $text = str_replace(' </', '</', $text); $text = str_replace(' ...', '...', $text); return $text; } /** * Method to extend the truncate method to more complex situations * * The goal is to get the proper length plain text string with as much of * the html intact as possible with all tags properly closed. * * @param string $html The content of the introtext to be truncated * @param integer $maxLength The maximum number of characters to render * @param boolean $noSplit Don't split a word if that is where the cutoff occurs (default: true). * * @return string The truncated string. If the string is truncated an ellipsis * (...) will be appended. * * @note If a maximum length of 3 or less is selected and the text has more than * that number of characters an ellipsis will be displayed. * This method will not create valid HTML from malformed HTML. * * @since 3.1 */ public static function truncateComplex($html, $maxLength = 0, $noSplit = true) { // Start with some basic rules. $baseLength = strlen($html); // If the original HTML string is shorter than the $maxLength do nothing and return that. if ($baseLength <= $maxLength || $maxLength == 0) { return $html; } // Take care of short simple cases. if ($maxLength <= 3 && substr($html, 0, 1) != '<' && strpos(substr($html, 0, $maxLength - 1), '<') === false && $baseLength > $maxLength) { return '...'; } // Deal with maximum length of 1 where the string starts with a tag. if ($maxLength == 1 && substr($html, 0, 1) == '<') { $endTagPos = strlen(strstr($html, '>', true)); $tag = substr($html, 1, $endTagPos); $l = $endTagPos + 1; if ($noSplit) { return substr($html, 0, $l) . '</' . $tag . '...'; } // TODO: $character doesn't seem to be used... $character = substr(strip_tags($html), 0, 1); return substr($html, 0, $l) . '</' . $tag . '...'; } // First get the truncated plain text string. This is the rendered text we want to end up with. $ptString = JHtml::_('string.truncate', $html, $maxLength, $noSplit, $allowHtml = false); // It's all HTML, just return it. if (strlen($ptString) == 0) { return $html; } // If the plain text is shorter than the max length the variable will not end in ... // In that case we use the whole string. if (substr($ptString, -3) != '...') { return $html; } // Regular truncate gives us the ellipsis but we want to go back for text and tags. if ($ptString == '...') { $stripped = substr(strip_tags($html), 0, $maxLength); $ptString = JHtml::_('string.truncate', $stripped, $maxLength, $noSplit, $allowHtml = false); } // We need to trim the ellipsis that truncate adds. $ptString = rtrim($ptString, '.'); // Now deal with more complex truncation. while ($maxLength <= $baseLength) { // Get the truncated string assuming HTML is allowed. $htmlString = JHtml::_('string.truncate', $html, $maxLength, $noSplit, $allowHtml = true); if ($htmlString == '...' && strlen($ptString) + 3 > $maxLength) { return $htmlString; } $htmlString = rtrim($htmlString, '.'); // Now get the plain text from the HTML string and trim it. $htmlStringToPtString = JHtml::_('string.truncate', $htmlString, $maxLength, $noSplit, $allowHtml = false); $htmlStringToPtString = rtrim($htmlStringToPtString, '.'); // If the new plain text string matches the original plain text string we are done. if ($ptString == $htmlStringToPtString) { return $htmlString . '...'; } // Get the number of HTML tag characters in the first $maxLength characters $diffLength = strlen($ptString) - strlen($htmlStringToPtString); if ($diffLength <= 0) { return $htmlString . '...'; } // Set new $maxlength that adjusts for the HTML tags $maxLength += $diffLength; } } /** * Abridges text strings over the specified character limit. The * behavior will insert an ellipsis into the text replacing a section * of variable size to ensure the string does not exceed the defined * maximum length. This method is UTF-8 safe. * * For example, it transforms "Really long title" to "Really...title". * * Note that this method does not scan for HTML tags so will potentially break them. * * @param string $text The text to abridge. * @param integer $length The maximum length of the text (default is 50). * @param integer $intro The maximum length of the intro text (default is 30). * * @return string The abridged text. * * @since 1.6 */ public static function abridge($text, $length = 50, $intro = 30) { // Abridge the item text if it is too long. if (JString::strlen($text) > $length) { // Determine the remaining text length. $remainder = $length - ($intro + 3); // Extract the beginning and ending text sections. $beg = JString::substr($text, 0, $intro); $end = JString::substr($text, JString::strlen($text) - $remainder); // Build the resulting string. $text = $beg . '...' . $end; } return $text; } } PK���\�0�PTTlibraries/cms/html/sliders.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for Sliders elements * * @since 1.6 */ abstract class JHtmlSliders { /** * Creates a panes and loads the javascript behavior for it. * * @param string $group The pane identifier. * @param array $params An array of options. * * @return string * * @since 1.6 */ public static function start($group = 'sliders', $params = array()) { static::loadBehavior($group, $params); return '<div id="' . $group . '" class="pane-sliders"><div style="display:none;"><div>'; } /** * Close the current pane. * * @return string hTML to close the pane * * @since 1.6 */ public static function end() { return '</div></div></div>'; } /** * Begins the display of a new panel. * * @param string $text Text to display. * @param string $id Identifier of the panel. * * @return string HTML to start a panel * * @since 1.6 */ public static function panel($text, $id) { return '</div></div><div class="panel"><h3 class="pane-toggler title" id="' . $id . '"><a href="javascript:void(0);"><span>' . $text . '</span></a></h3><div class="pane-slider content">'; } /** * Load the JavaScript behavior. * * @param string $group The pane identifier. * @param array $params Array of options. * * @return void * * @since 1.6 */ protected static function loadBehavior($group, $params = array()) { static $loaded = array(); if (!array_key_exists($group, $loaded)) { // Get the JInput object $input = JFactory::getApplication()->input; $loaded[$group] = true; // Include mootools framework. JHtml::_('behavior.framework', true); $document = JFactory::getDocument(); $display = (isset($params['startOffset']) && isset($params['startTransition']) && $params['startTransition']) ? (int) $params['startOffset'] : null; $show = (isset($params['startOffset']) && !(isset($params['startTransition']) && $params['startTransition'])) ? (int) $params['startOffset'] : null; $opt['onActive'] = "\\function(toggler, i) {toggler.addClass('pane-toggler-down');" . "toggler.removeClass('pane-toggler');i.addClass('pane-down');i.removeClass('pane-hide');Cookie.write('jpanesliders_" . $group . "',$$('div#" . $group . ".pane-sliders > .panel > h3').indexOf(toggler));}"; $opt['onBackground'] = "\\function(toggler, i) {toggler.addClass('pane-toggler');" . "toggler.removeClass('pane-toggler-down');i.addClass('pane-hide');i.removeClass('pane-down');if($$('div#" . $group . ".pane-sliders > .panel > h3').length==$$('div#" . $group . ".pane-sliders > .panel > h3.pane-toggler').length) Cookie.write('jpanesliders_" . $group . "',-1);}"; $opt['duration'] = (isset($params['duration'])) ? (int) $params['duration'] : 300; $opt['display'] = (isset($params['useCookie']) && $params['useCookie']) ? $input->cookie->get('jpanesliders_' . $group, $display, 'integer') : $display; $opt['show'] = (isset($params['useCookie']) && $params['useCookie']) ? $input->cookie->get('jpanesliders_' . $group, $show, 'integer') : $show; $opt['opacity'] = (isset($params['opacityTransition']) && ($params['opacityTransition'])) ? 'true' : 'false'; $opt['alwaysHide'] = (isset($params['allowAllClose']) && (!$params['allowAllClose'])) ? 'false' : 'true'; $options = JHtml::getJSObject($opt); $js = "window.addEvent('domready', function(){ new Fx.Accordion($$('div#" . $group . ".pane-sliders > .panel > h3.pane-toggler'), $$('div#" . $group . ".pane-sliders > .panel > div.pane-slider'), " . $options . "); });"; $document->addScriptDeclaration($js); } } } PK���\�։�o o libraries/cms/html/menu.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class working with menu select lists * * @since 1.5 */ abstract class JHtmlMenu { /** * Cached array of the menus. * * @var array * @since 1.6 */ protected static $menus = null; /** * Cached array of the menus items. * * @var array * @since 1.6 */ protected static $items = null; /** * Get a list of the available menus. * * @return string * * @since 1.6 */ public static function menus() { if (empty(static::$menus)) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('menutype AS value, title AS text') ->from($db->quoteName('#__menu_types')) ->order('title'); $db->setQuery($query); static::$menus = $db->loadObjectList(); } return static::$menus; } /** * Returns an array of menu items grouped by menu. * * @param array $config An array of configuration options. * * @return array * * @since 1.6 */ public static function menuitems($config = array()) { if (empty(static::$items)) { $menus = static::menus(); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value, a.title AS text, a.level, a.menutype') ->from('#__menu AS a') ->where('a.parent_id > 0') ->where('a.client_id = 0'); // Filter on the published state if (isset($config['published'])) { if (is_numeric($config['published'])) { $query->where('a.published = ' . (int) $config['published']); } elseif ($config['published'] === '') { $query->where('a.published IN (0,1)'); } } $query->order('a.lft'); $db->setQuery($query); $items = $db->loadObjectList(); // Collate menu items based on menutype $lookup = array(); foreach ($items as &$item) { if (!isset($lookup[$item->menutype])) { $lookup[$item->menutype] = array(); } $lookup[$item->menutype][] = &$item; $item->text = str_repeat('- ', $item->level) . $item->text; } static::$items = array(); foreach ($menus as &$menu) { // Start group: static::$items[] = JHtml::_('select.optgroup', $menu->text); // Special "Add to this Menu" option: static::$items[] = JHtml::_('select.option', $menu->value . '.1', JText::_('JLIB_HTML_ADD_TO_THIS_MENU')); // Menu items: if (isset($lookup[$menu->value])) { foreach ($lookup[$menu->value] as &$item) { static::$items[] = JHtml::_('select.option', $menu->value . '.' . $item->value, $item->text); } } // Finish group: static::$items[] = JHtml::_('select.optgroup', $menu->text); } } return static::$items; } /** * Displays an HTML select list of menu items. * * @param string $name The name of the control. * @param string $selected The value of the selected option. * @param string $attribs Attributes for the control. * @param array $config An array of options for the control. * * @return string * * @since 1.6 */ public static function menuitemlist($name, $selected = null, $attribs = null, $config = array()) { static $count; $options = static::menuitems($config); return JHtml::_( 'select.genericlist', $options, $name, array( 'id' => isset($config['id']) ? $config['id'] : 'assetgroups_' . (++$count), 'list.attr' => (is_null($attribs) ? 'class="inputbox" size="1"' : $attribs), 'list.select' => (int) $selected, 'list.translate' => false ) ); } /** * Build the select list for Menu Ordering * * @param object &$row The row object * @param integer $id The id for the row. Must exist to enable menu ordering * * @return string * * @since 1.5 */ public static function ordering(&$row, $id) { if ($id) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('ordering AS value, title AS text') ->from($db->quoteName('#__menu')) ->where($db->quoteName('menutype') . ' = ' . $db->quote($row->menutype)) ->where($db->quoteName('parent_id') . ' = ' . (int) $row->parent_id) ->where($db->quoteName('published') . ' != -2') ->order('ordering'); $order = JHtml::_('list.genericordering', $query); $ordering = JHtml::_( 'select.genericlist', $order, 'ordering', array('list.attr' => 'class="inputbox" size="1"', 'list.select' => (int) $row->ordering) ); } else { $ordering = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />' . JText::_('JGLOBAL_NEWITEMSLAST_DESC'); } return $ordering; } /** * Build the multiple select list for Menu Links/Pages * * @param boolean $all True if all can be selected * @param boolean $unassigned True if unassigned can be selected * * @return string * * @since 1.5 */ public static function linkoptions($all = false, $unassigned = false) { $db = JFactory::getDbo(); // Get a list of the menu items $query = $db->getQuery(true) ->select('m.id, m.parent_id, m.title, m.menutype') ->from($db->quoteName('#__menu') . ' AS m') ->where($db->quoteName('m.published') . ' = 1') ->order('m.menutype, m.parent_id'); $db->setQuery($query); $mitems = $db->loadObjectList(); if (!$mitems) { $mitems = array(); } // Establish the hierarchy of the menu $children = array(); // First pass - collect children foreach ($mitems as $v) { $pt = $v->parent_id; $list = @$children[$pt] ? $children[$pt] : array(); array_push($list, $v); $children[$pt] = $list; } // Second pass - get an indent list of the items $list = static::treerecurse((int) $mitems[0]->parent_id, '', array(), $children, 9999, 0, 0); // Code that adds menu name to Display of Page(s) $mitems = array(); if ($all | $unassigned) { $mitems[] = JHtml::_('select.option', '<OPTGROUP>', JText::_('JOPTION_MENUS')); if ($all) { $mitems[] = JHtml::_('select.option', 0, JText::_('JALL')); } if ($unassigned) { $mitems[] = JHtml::_('select.option', -1, JText::_('JOPTION_UNASSIGNED')); } $mitems[] = JHtml::_('select.option', '</OPTGROUP>'); } $lastMenuType = null; $tmpMenuType = null; foreach ($list as $list_a) { if ($list_a->menutype != $lastMenuType) { if ($tmpMenuType) { $mitems[] = JHtml::_('select.option', '</OPTGROUP>'); } $mitems[] = JHtml::_('select.option', '<OPTGROUP>', $list_a->menutype); $lastMenuType = $list_a->menutype; $tmpMenuType = $list_a->menutype; } $mitems[] = JHtml::_('select.option', $list_a->id, $list_a->title); } if ($lastMenuType !== null) { $mitems[] = JHtml::_('select.option', '</OPTGROUP>'); } return $mitems; } /** * Build the list representing the menu tree * * @param integer $id Id of the menu item * @param string $indent The indentation string * @param array $list The list to process * @param array &$children The children of the current item * @param integer $maxlevel The maximum number of levels in the tree * @param integer $level The starting level * @param int $type Set the type of spacer to use. Use 1 for |_ or 0 for - * * @return array * * @since 1.5 */ public static function treerecurse($id, $indent, $list, &$children, $maxlevel = 9999, $level = 0, $type = 1) { if (@$children[$id] && $level <= $maxlevel) { foreach ($children[$id] as $v) { $id = $v->id; if ($type) { $pre = '<sup>|_</sup> '; $spacer = '.      '; } else { $pre = '- '; $spacer = '  '; } if ($v->parent_id == 0) { $txt = $v->title; } else { $txt = $pre . $v->title; } $list[$id] = $v; $list[$id]->treename = $indent . $txt; $list[$id]->children = count(@$children[$id]); $list = static::treerecurse($id, $indent . $spacer, $list, $children, $maxlevel, $level + 1, $type); } } return $list; } } PK���\p�4h��libraries/cms/html/jquery.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for jQuery JavaScript behaviors * * @since 3.0 */ abstract class JHtmlJquery { /** * @var array Array containing information for loaded files * @since 3.0 */ protected static $loaded = array(); /** * Method to load the jQuery JavaScript framework into the document head * * If debugging mode is on an uncompressed version of jQuery is included for easier debugging. * * @param boolean $noConflict True to load jQuery in noConflict mode [optional] * @param mixed $debug Is debugging mode on? [optional] * @param boolean $migrate True to enable the jQuery Migrate plugin * * @return void * * @since 3.0 */ public static function framework($noConflict = true, $debug = null, $migrate = true) { // Only load once if (!empty(static::$loaded[__METHOD__])) { return; } // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = (boolean) $config->get('debug'); } JHtml::_('script', 'jui/jquery.min.js', false, true, false, false, $debug); // Check if we are loading in noConflict if ($noConflict) { JHtml::_('script', 'jui/jquery-noconflict.js', false, true, false, false, false); } // Check if we are loading Migrate if ($migrate) { JHtml::_('script', 'jui/jquery-migrate.min.js', false, true, false, false, $debug); } static::$loaded[__METHOD__] = true; return; } /** * Method to load the jQuery UI JavaScript framework into the document head * * If debugging mode is on an uncompressed version of jQuery UI is included for easier debugging. * * @param array $components The jQuery UI components to load [optional] * @param mixed $debug Is debugging mode on? [optional] * * @return void * * @since 3.0 */ public static function ui(array $components = array('core'), $debug = null) { // Set an array containing the supported jQuery UI components handled by this method $supported = array('core', 'sortable'); // Include jQuery static::framework(); // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = (boolean) $config->get('debug'); } // Load each of the requested components foreach ($components as $component) { // Only attempt to load the component if it's supported in core and hasn't already been loaded if (in_array($component, $supported) && empty(static::$loaded[__METHOD__][$component])) { JHtml::_('script', 'jui/jquery.ui.' . $component . '.min.js', false, true, false, false, $debug); static::$loaded[__METHOD__][$component] = true; } } return; } } PK���\U:�(�{�{ libraries/cms/html/bootstrap.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for Bootstrap elements. * * @since 3.0 */ abstract class JHtmlBootstrap { /** * @var array Array containing information for loaded files * @since 3.0 */ protected static $loaded = array(); /** * Add javascript support for the Bootstrap affix plugin * * @param string $selector Unique selector for the element to be affixed. * @param array $params An array of options. * Options for the affix plugin can be: * - offset number|function|object Pixels to offset from screen when calculating position of scroll. * If a single number is provided, the offset will be applied in both top * and left directions. To listen for a single direction, or multiple * unique offsets, just provide an object offset: { x: 10 }. * Use a function when you need to dynamically provide an offset * (useful for some responsive designs). * * @return void * * @since 3.1 */ public static function affix($selector = 'affix', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(static::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework static::framework(); // Setup options object $opt['offset'] = isset($params['offset']) ? $params['offset'] : 10; $options = JHtml::getJSObject($opt); // Attach affix to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('#$selector').affix($options); })(jQuery);" ); // Set static array static::$loaded[__METHOD__][$sig] = true; } return; } /** * Add javascript support for Bootstrap alerts * * @param string $selector Common class for the alerts * * @return void * * @since 3.0 */ public static function alert($selector = 'alert') { // Only load once if (isset(static::$loaded[__METHOD__][$selector])) { return; } // Include Bootstrap framework static::framework(); // Attach the alerts to the document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('.$selector').alert(); })(jQuery);" ); static::$loaded[__METHOD__][$selector] = true; return; } /** * Add javascript support for Bootstrap buttons * * @param string $selector Common class for the buttons * * @return void * * @since 3.1 */ public static function button($selector = 'button') { // Only load once if (isset(static::$loaded[__METHOD__][$selector])) { return; } // Include Bootstrap framework static::framework(); // Attach the button to the document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('.$selector').button(); })(jQuery);" ); static::$loaded[__METHOD__][$selector] = true; return; } /** * Add javascript support for Bootstrap carousels * * @param string $selector Common class for the carousels. * @param array $params An array of options for the carousel. * Options for the carousel can be: * - interval number The amount of time to delay between automatically cycling an item. * If false, carousel will not automatically cycle. * - pause string Pauses the cycling of the carousel on mouseenter and resumes the cycling * of the carousel on mouseleave. * * @return void * * @since 3.0 */ public static function carousel($selector = 'carousel', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(static::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework static::framework(); // Setup options object $opt['interval'] = isset($params['interval']) ? (int) $params['interval'] : 5000; $opt['pause'] = isset($params['pause']) ? $params['pause'] : 'hover'; $options = JHtml::getJSObject($opt); // Attach the carousel to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('.$selector').carousel($options); })(jQuery);" ); // Set static array static::$loaded[__METHOD__][$sig] = true; } return; } /** * Add javascript support for Bootstrap dropdowns * * @param string $selector Common class for the dropdowns * * @return void * * @since 3.0 */ public static function dropdown($selector = 'dropdown-toggle') { // Only load once if (isset(static::$loaded[__METHOD__][$selector])) { return; } // Include Bootstrap framework static::framework(); // Attach the dropdown to the document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('.$selector').dropdown(); })(jQuery);" ); static::$loaded[__METHOD__][$selector] = true; return; } /** * Method to load the Bootstrap JavaScript framework into the document head * * If debugging mode is on an uncompressed version of Bootstrap is included for easier debugging. * * @param mixed $debug Is debugging mode on? [optional] * * @return void * * @since 3.0 */ public static function framework($debug = null) { // Only load once if (!empty(static::$loaded[__METHOD__])) { return; } // Load jQuery JHtml::_('jquery.framework'); // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = (boolean) $config->get('debug'); } JHtml::_('script', 'jui/bootstrap.min.js', false, true, false, false, $debug); static::$loaded[__METHOD__] = true; return; } /** * Add javascript support for Bootstrap modals * * @param string $selector The ID selector for the modal. * @param array $params An array of options for the modal. * Options for the modal can be: * - backdrop boolean Includes a modal-backdrop element. * - keyboard boolean Closes the modal when escape key is pressed. * - show boolean Shows the modal when initialized. * - remote string An optional remote URL to load * * @return void * * @since 3.0 * @deprecated 4.0 Unused, JS Not working */ public static function modal($selector = 'modal', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(static::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework static::framework(); // Setup options object $opt['backdrop'] = isset($params['backdrop']) ? (boolean) $params['backdrop'] : true; $opt['keyboard'] = isset($params['keyboard']) ? (boolean) $params['keyboard'] : true; $opt['show'] = isset($params['show']) ? (boolean) $params['show'] : true; $opt['remote'] = isset($params['remote']) ? $params['remote'] : ''; $options = JHtml::getJSObject($opt); // Attach the modal to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('#$selector').modal($options); })(jQuery);" ); // Set static array static::$loaded[__METHOD__][$sig] = true; } return; } /** * Method to render a Bootstrap modal * * @param string $selector The ID selector for the modal. * @param array $params An array of options for the modal. * Options for the modal can be: * - title string The modal title * - backdrop mixed A boolean select if a modal-backdrop element should be included (default = true) * The string 'static' includes a backdrop which doesn't close the modal on click. * - keyboard boolean Closes the modal when escape key is pressed (default = true) * - closeButton boolean Display modal close button (default = true) * - animation boolean Fade in from the top of the page (default = true) * - footer string Optional markup for the modal footer * - url string URL of a resource to be inserted as an <iframe> inside the modal body * - height string height of the <iframe> containing the remote resource * - width string width of the <iframe> containing the remote resource * @param string $body Markup for the modal body. Appended after the <iframe> if the url option is set * * @return string HTML markup for a modal * * @since 3.0 */ public static function renderModal($selector = 'modal', $params = array(), $body = '') { // Include Bootstrap framework static::framework(); $layoutData = array( 'selector' => $selector, 'params' => $params, 'body' => $body ); return JLayoutHelper::render('joomla.modal.main', $layoutData); } /** * Add javascript support for Bootstrap popovers * * Use element's Title as popover content * * @param string $selector Selector for the popover * @param array $params An array of options for the popover. * Options for the popover can be: * animation boolean apply a css fade transition to the popover * html boolean Insert HTML into the popover. If false, jQuery's text method will be used to insert * content into the dom. * placement string|function how to position the popover - top | bottom | left | right * selector string If a selector is provided, popover objects will be delegated to the specified targets. * trigger string how popover is triggered - hover | focus | manual * title string|function default title value if `title` tag isn't present * content string|function default content value if `data-content` attribute isn't present * delay number|object delay showing and hiding the popover (ms) - does not apply to manual trigger type * If a number is supplied, delay is applied to both hide/show * Object structure is: delay: { show: 500, hide: 100 } * container string|boolean Appends the popover to a specific element: { container: 'body' } * * @return void * * @since 3.0 */ public static function popover($selector = '.hasPopover', $params = array()) { // Only load once if (isset(static::$loaded[__METHOD__][$selector])) { return; } // Include Bootstrap framework static::framework(); $opt['animation'] = isset($params['animation']) ? $params['animation'] : null; $opt['html'] = isset($params['html']) ? $params['html'] : true; $opt['placement'] = isset($params['placement']) ? $params['placement'] : null; $opt['selector'] = isset($params['selector']) ? $params['selector'] : null; $opt['title'] = isset($params['title']) ? $params['title'] : null; $opt['trigger'] = isset($params['trigger']) ? $params['trigger'] : 'hover focus'; $opt['content'] = isset($params['content']) ? $params['content'] : null; $opt['delay'] = isset($params['delay']) ? $params['delay'] : null; $opt['container'] = isset($params['container']) ? $params['container'] : 'body'; $options = JHtml::getJSObject($opt); // Attach the popover to the document JFactory::getDocument()->addScriptDeclaration( "jQuery(document).ready(function() { jQuery('" . $selector . "').popover(" . $options . "); });" ); static::$loaded[__METHOD__][$selector] = true; return; } /** * Add javascript support for Bootstrap ScrollSpy * * @param string $selector The ID selector for the ScrollSpy element. * @param array $params An array of options for the ScrollSpy. * Options for the ScrollSpy can be: * - offset number Pixels to offset from top when calculating position of scroll. * * @return void * * @since 3.0 */ public static function scrollspy($selector = 'navbar', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(static::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework static::framework(); // Setup options object $opt['offset'] = isset($params['offset']) ? (int) $params['offset'] : 10; $options = JHtml::getJSObject($opt); // Attach ScrollSpy to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('#$selector').scrollspy($options); })(jQuery);" ); // Set static array static::$loaded[__METHOD__][$sig] = true; } return; } /** * Add javascript support for Bootstrap tooltips * * Add a title attribute to any element in the form * title="title::text" * * @param string $selector The ID selector for the tooltip. * @param array $params An array of options for the tooltip. * Options for the tooltip can be: * - animation boolean Apply a CSS fade transition to the tooltip * - html boolean Insert HTML into the tooltip. If false, jQuery's text method will be used to insert * content into the dom. * - placement string|function How to position the tooltip - top | bottom | left | right * - selector string If a selector is provided, tooltip objects will be delegated to the specified targets. * - title string|function Default title value if `title` tag isn't present * - trigger string How tooltip is triggered - hover | focus | manual * - delay integer Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type * If a number is supplied, delay is applied to both hide/show * Object structure is: delay: { show: 500, hide: 100 } * - container string|boolean Appends the popover to a specific element: { container: 'body' } * * @return void * * @since 3.0 */ public static function tooltip($selector = '.hasTooltip', $params = array()) { if (!isset(static::$loaded[__METHOD__][$selector])) { // Include Bootstrap framework static::framework(); // Setup options object $opt['animation'] = isset($params['animation']) ? (boolean) $params['animation'] : null; $opt['html'] = isset($params['html']) ? (boolean) $params['html'] : true; $opt['placement'] = isset($params['placement']) ? (string) $params['placement'] : null; $opt['selector'] = isset($params['selector']) ? (string) $params['selector'] : null; $opt['title'] = isset($params['title']) ? (string) $params['title'] : null; $opt['trigger'] = isset($params['trigger']) ? (string) $params['trigger'] : null; $opt['delay'] = isset($params['delay']) ? (is_array($params['delay']) ? $params['delay'] : (int) $params['delay']) : null; $opt['container'] = isset($params['container']) ? $params['container'] : 'body'; $opt['template'] = isset($params['template']) ? (string) $params['template'] : null; $onShow = isset($params['onShow']) ? (string) $params['onShow'] : null; $onShown = isset($params['onShown']) ? (string) $params['onShown'] : null; $onHide = isset($params['onHide']) ? (string) $params['onHide'] : null; $onHidden = isset($params['onHidden']) ? (string) $params['onHidden'] : null; $options = JHtml::getJSObject($opt); // Build the script. $script = array(); $script[] = "jQuery(document).ready(function(){"; $script[] = "\tjQuery('" . $selector . "').tooltip(" . $options . ");"; if ($onShow) { $script[] = "\tjQuery('" . $selector . "').on('show.bs.tooltip', " . $onShow . ");"; } if ($onShown) { $script[] = "\tjQuery('" . $selector . "').on('shown.bs.tooltip', " . $onShown . ");"; } if ($onHide) { $script[] = "\tjQuery('" . $selector . "').on('hide.bs.tooltip', " . $onHide . ");"; } if ($onHidden) { $script[] = "\tjQuery('" . $selector . "').on('hidden.bs.tooltip', " . $onHidden . ");"; } $script[] = "});"; // Attach tooltips to document JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); // Set static array static::$loaded[__METHOD__][$selector] = true; } return; } /** * Add javascript support for Bootstrap typeahead * * @param string $selector The selector for the typeahead element. * @param array $params An array of options for the typeahead element. * Options for the tooltip can be: * - source array, function The data source to query against. May be an array of strings or a function. * The function is passed two arguments, the query value in the input field and the * process callback. The function may be used synchronously by returning the data * source directly or asynchronously via the process callback's single argument. * - items number The max number of items to display in the dropdown. * - minLength number The minimum character length needed before triggering autocomplete suggestions * - matcher function The method used to determine if a query matches an item. Accepts a single argument, * the item against which to test the query. Access the current query with this.query. * Return a boolean true if query is a match. * - sorter function Method used to sort autocomplete results. Accepts a single argument items and has * the scope of the typeahead instance. Reference the current query with this.query. * - updater function The method used to return selected item. Accepts a single argument, the item and * has the scope of the typeahead instance. * - highlighter function Method used to highlight autocomplete results. Accepts a single argument item and * has the scope of the typeahead instance. Should return html. * * @return void * * @since 3.0 */ public static function typeahead($selector = '.typeahead', $params = array()) { if (!isset(static::$loaded[__METHOD__][$selector])) { // Include Bootstrap framework static::framework(); // Setup options object $opt['source'] = isset($params['source']) ? $params['source'] : '[]'; $opt['items'] = isset($params['items']) ? (int) $params['items'] : 8; $opt['minLength'] = isset($params['minLength']) ? (int) $params['minLength'] : 1; $opt['matcher'] = isset($params['matcher']) ? (string) $params['matcher'] : null; $opt['sorter'] = isset($params['sorter']) ? (string) $params['sorter'] : null; $opt['updater'] = isset($params['updater']) ? (string) $params['updater'] : null; $opt['highlighter'] = isset($params['highlighter']) ? (int) $params['highlighter'] : null; $options = JHtml::getJSObject($opt); // Attach typehead to document JFactory::getDocument()->addScriptDeclaration( "jQuery(document).ready(function() { jQuery('" . $selector . "').typeahead(" . $options . "); });" ); // Set static array static::$loaded[__METHOD__][$selector] = true; } return; } /** * Add javascript support for Bootstrap accordians and insert the accordian * * @param string $selector The ID selector for the tooltip. * @param array $params An array of options for the tooltip. * Options for the tooltip can be: * - parent selector If selector then all collapsible elements under the specified parent will be closed when this * collapsible item is shown. (similar to traditional accordion behavior) * - toggle boolean Toggles the collapsible element on invocation * - active string Sets the active slide during load * * - onShow function This event fires immediately when the show instance method is called. * - onShown function This event is fired when a collapse element has been made visible to the user * (will wait for css transitions to complete). * - onHide function This event is fired immediately when the hide method has been called. * - onHidden function This event is fired when a collapse element has been hidden from the user * (will wait for css transitions to complete). * * @return string HTML for the accordian * * @since 3.0 */ public static function startAccordion($selector = 'myAccordian', $params = array()) { if (!isset(static::$loaded[__METHOD__][$selector])) { // Include Bootstrap framework static::framework(); // Setup options object $opt['parent'] = isset($params['parent']) ? ($params['parent'] == true ? '#' . $selector : $params['parent']) : false; $opt['toggle'] = isset($params['toggle']) ? (boolean) $params['toggle'] : ($opt['parent'] === false || isset($params['active']) ? false : true); $onShow = isset($params['onShow']) ? (string) $params['onShow'] : null; $onShown = isset($params['onShown']) ? (string) $params['onShown'] : null; $onHide = isset($params['onHide']) ? (string) $params['onHide'] : null; $onHidden = isset($params['onHidden']) ? (string) $params['onHidden'] : null; $options = JHtml::getJSObject($opt); $opt['active'] = isset($params['active']) ? (string) $params['active'] : ''; // Build the script. $script = array(); $script[] = "jQuery(document).ready(function($){"; $script[] = "\t$('#" . $selector . "').collapse(" . $options . ")"; if ($onShow) { $script[] = "\t.on('show', " . $onShow . ")"; } if ($onShown) { $script[] = "\t.on('shown', " . $onShown . ")"; } if ($onHide) { $script[] = "\t.on('hideme', " . $onHide . ")"; } if ($onHidden) { $script[] = "\t.on('hidden', " . $onHidden . ")"; } $script[] = "});"; // Attach accordion to document JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); // Set static array static::$loaded[__METHOD__][$selector] = $opt; return '<div id="' . $selector . '" class="accordion">'; } } /** * Close the current accordion * * @return string HTML to close the accordian * * @since 3.0 */ public static function endAccordion() { return '</div>'; } /** * Begins the display of a new accordion slide. * * @param string $selector Identifier of the accordion group. * @param string $text Text to display. * @param string $id Identifier of the slide. * @param string $class Class of the accordion group. * * @return string HTML to add the slide * * @since 3.0 */ public static function addSlide($selector, $text, $id, $class = '') { $in = (static::$loaded[__CLASS__ . '::startAccordion'][$selector]['active'] == $id) ? ' in' : ''; $parent = static::$loaded[__CLASS__ . '::startAccordion'][$selector]['parent'] ? ' data-parent="' . static::$loaded[__CLASS__ . '::startAccordion'][$selector]['parent'] . '"' : ''; $class = (!empty($class)) ? ' ' . $class : ''; $html = '<div class="accordion-group' . $class . '">' . '<div class="accordion-heading">' . '<strong><a href="#' . $id . '" data-toggle="collapse"' . $parent . ' class="accordion-toggle">' . $text . '</a></strong>' . '</div>' . '<div class="accordion-body collapse' . $in . '" id="' . $id . '">' . '<div class="accordion-inner">'; return $html; } /** * Close the current slide * * @return string HTML to close the slide * * @since 3.0 */ public static function endSlide() { return '</div></div></div>'; } /** * Creates a tab pane * * @param string $selector The pane identifier. * @param array $params The parameters for the pane * * @return string * * @since 3.1 */ public static function startTabSet($selector = 'myTab', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(static::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework static::framework(); // Setup options object $opt['active'] = (isset($params['active']) && ($params['active'])) ? (string) $params['active'] : ''; // Attach tabs to document JFactory::getDocument() ->addScriptDeclaration(JLayoutHelper::render('libraries.cms.html.bootstrap.starttabsetscript', array('selector' => $selector))); // Set static array static::$loaded[__METHOD__][$sig] = true; static::$loaded[__METHOD__][$selector]['active'] = $opt['active']; } $html = JLayoutHelper::render('libraries.cms.html.bootstrap.starttabset', array('selector' => $selector)); return $html; } /** * Close the current tab pane * * @return string HTML to close the pane * * @since 3.1 */ public static function endTabSet() { $html = JLayoutHelper::render('libraries.cms.html.bootstrap.endtabset'); return $html; } /** * Begins the display of a new tab content panel. * * @param string $selector Identifier of the panel. * @param string $id The ID of the div element * @param string $title The title text for the new UL tab * * @return string HTML to start a new panel * * @since 3.1 */ public static function addTab($selector, $id, $title) { static $tabScriptLayout = null; static $tabLayout = null; $tabScriptLayout = is_null($tabScriptLayout) ? new JLayoutFile('libraries.cms.html.bootstrap.addtabscript') : $tabScriptLayout; $tabLayout = is_null($tabLayout) ? new JLayoutFile('libraries.cms.html.bootstrap.addtab') : $tabLayout; $active = (static::$loaded['JHtmlBootstrap::startTabSet'][$selector]['active'] == $id) ? ' active' : ''; // Inject tab into UL JFactory::getDocument() ->addScriptDeclaration($tabScriptLayout->render(array('selector' => $selector,'id' => $id, 'active' => $active, 'title' => $title))); $html = $tabLayout->render(array('id' => $id, 'active' => $active)); return $html; } /** * Close the current tab content panel * * @return string HTML to close the pane * * @since 3.1 */ public static function endTab() { $html = JLayoutHelper::render('libraries.cms.html.bootstrap.endtab'); return $html; } /** * Creates a tab pane * * @param string $selector The pane identifier. * @param array $params The parameters for the pane * * @return string * * @since 3.0 * @deprecated 4.0 Use JHtml::_('bootstrap.startTabSet') instead. */ public static function startPane($selector = 'myTab', $params = array()) { $sig = md5(serialize(array($selector, $params))); if (!isset(static::$loaded['JHtmlBootstrap::startTabSet'][$sig])) { // Include Bootstrap framework static::framework(); // Setup options object $opt['active'] = isset($params['active']) ? (string) $params['active'] : ''; // Attach tab to document JFactory::getDocument()->addScriptDeclaration( "(function($){ $('#$selector a').click(function (e) { e.preventDefault(); $(this).tab('show'); }); })(jQuery);" ); // Set static array static::$loaded['JHtmlBootstrap::startTabSet'][$sig] = true; static::$loaded['JHtmlBootstrap::startTabSet'][$selector]['active'] = $opt['active']; } return '<div class="tab-content" id="' . $selector . 'Content">'; } /** * Close the current tab pane * * @return string HTML to close the pane * * @since 3.0 * @deprecated 4.0 Use JHtml::_('bootstrap.endTabSet') instead. */ public static function endPane() { return '</div>'; } /** * Begins the display of a new tab content panel. * * @param string $selector Identifier of the panel. * @param string $id The ID of the div element * * @return string HTML to start a new panel * * @since 3.0 * @deprecated 4.0 Use JHtml::_('bootstrap.addTab') instead. */ public static function addPanel($selector, $id) { $active = (static::$loaded['JHtmlBootstrap::startTabSet'][$selector]['active'] == $id) ? ' active' : ''; return '<div id="' . $id . '" class="tab-pane' . $active . '">'; } /** * Close the current tab content panel * * @return string HTML to close the pane * * @since 3.0 * @deprecated 4.0 Use JHtml::_('bootstrap.endTab') instead. */ public static function endPanel() { return '</div>'; } /** * Loads CSS files needed by Bootstrap * * @param boolean $includeMainCss If true, main bootstrap.css files are loaded * @param string $direction rtl or ltr direction. If empty, ltr is assumed * @param array $attribs Optional array of attributes to be passed to JHtml::_('stylesheet') * * @return void * * @since 3.0 */ public static function loadCss($includeMainCss = true, $direction = 'ltr', $attribs = array()) { // Load Bootstrap main CSS if ($includeMainCss) { JHtml::_('stylesheet', 'jui/bootstrap.min.css', $attribs, true); JHtml::_('stylesheet', 'jui/bootstrap-responsive.min.css', $attribs, true); JHtml::_('stylesheet', 'jui/bootstrap-extended.css', $attribs, true); } // Load Bootstrap RTL CSS if ($direction === 'rtl') { JHtml::_('stylesheet', 'jui/bootstrap-rtl.css', $attribs, true); } } } PK���\�iȓ��libraries/cms/html/date.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Extended Utility class for handling date display. * * @since 2.5 */ abstract class JHtmlDate { /** * Function to convert a static time into a relative measurement * * @param string $date The date to convert * @param string $unit The optional unit of measurement to return * if the value of the diff is greater than one * @param string $time An optional time to compare to, defaults to now * * @return string The converted time string * * @since 2.5 */ public static function relative($date, $unit = null, $time = null) { if (is_null($time)) { // Get now $time = JFactory::getDate('now'); } // Get the difference in seconds between now and the time $diff = strtotime($time) - strtotime($date); // Less than a minute if ($diff < 60) { return JText::_('JLIB_HTML_DATE_RELATIVE_LESSTHANAMINUTE'); } // Round to minutes $diff = round($diff / 60); // 1 to 59 minutes if ($diff < 60 || $unit == 'minute') { return JText::plural('JLIB_HTML_DATE_RELATIVE_MINUTES', $diff); } // Round to hours $diff = round($diff / 60); // 1 to 23 hours if ($diff < 24 || $unit == 'hour') { return JText::plural('JLIB_HTML_DATE_RELATIVE_HOURS', $diff); } // Round to days $diff = round($diff / 24); // 1 to 6 days if ($diff < 7 || $unit == 'day') { return JText::plural('JLIB_HTML_DATE_RELATIVE_DAYS', $diff); } // Round to weeks $diff = round($diff / 7); // 1 to 4 weeks if ($diff <= 4 || $unit == 'week') { return JText::plural('JLIB_HTML_DATE_RELATIVE_WEEKS', $diff); } // Over a month, return the absolute time return JHtml::_('date', $date); } } PK���\��>">"libraries/cms/html/access.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Extended Utility class for all HTML drawing classes. * * @since 1.6 */ abstract class JHtmlAccess { /** * A cached array of the asset groups * * @var array * @since 1.6 */ protected static $asset_groups = null; /** * Displays a list of the available access view levels * * @param string $name The form field name. * @param string $selected The name of the selected section. * @param string $attribs Additional attributes to add to the select field. * @param mixed $params True to add "All Sections" option or an array of options * @param mixed $id The form field id or false if not used * * @return string The required HTML for the SELECT tag. * * @see JFormFieldAccessLevel * @since 1.6 */ public static function level($name, $selected, $attribs = '', $params = true, $id = false) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('a.id', 'value') . ', ' . $db->quoteName('a.title', 'text')) ->from($db->quoteName('#__viewlevels', 'a')) ->group($db->quoteName(array('a.id', 'a.title', 'a.ordering'))) ->order($db->quoteName('a.ordering') . ' ASC') ->order($db->quoteName('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 JHtml::_( 'select.genericlist', $options, $name, array( 'list.attr' => $attribs, 'list.select' => $selected, 'id' => $id ) ); } /** * Displays a list of the available user groups. * * @param string $name The form field name. * @param string $selected The name of the selected section. * @param string $attribs Additional attributes to add to the select field. * @param boolean $allowAll True to add "All Groups" option. * @param mixed $id The form field id * * @return string The required HTML for the SELECT tag. * * @see JFormFieldUsergroup * @since 1.6 */ public static function usergroup($name, $selected, $attribs = '', $allowAll = true, $id = false) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level') ->from($db->quoteName('#__usergroups') . ' AS a') ->join('LEFT', $db->quoteName('#__usergroups') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt') ->group('a.id, a.title, a.lft, a.rgt') ->order('a.lft ASC'); $db->setQuery($query); $options = $db->loadObjectList(); for ($i = 0, $n = count($options); $i < $n; $i++) { $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text; } // If all usergroups is allowed, push it into the array. if ($allowAll) { array_unshift($options, JHtml::_('select.option', '', JText::_('JOPTION_ACCESS_SHOW_ALL_GROUPS'))); } return JHtml::_('select.genericlist', $options, $name, array('list.attr' => $attribs, 'list.select' => $selected, 'id' => $id)); } /** * Returns a UL list of user groups with check boxes * * @param string $name The name of the checkbox controls array * @param array $selected An array of the checked boxes * @param boolean $checkSuperAdmin If false only super admins can add to super admin groups * * @return string * * @since 1.6 */ public static function usergroups($name, $selected, $checkSuperAdmin = false) { static $count; $count++; $isSuperAdmin = JFactory::getUser()->authorise('core.admin'); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.*, COUNT(DISTINCT b.id) AS level') ->from($db->quoteName('#__usergroups') . ' AS a') ->join('LEFT', $db->quoteName('#__usergroups') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt') ->group('a.id, a.title, a.lft, a.rgt, a.parent_id') ->order('a.lft ASC'); $db->setQuery($query); $groups = $db->loadObjectList(); $html = array(); for ($i = 0, $n = count($groups); $i < $n; $i++) { $item = &$groups[$i]; // If checkSuperAdmin is true, only add item if the user is superadmin or the group is not super admin if ((!$checkSuperAdmin) || $isSuperAdmin || (!JAccess::checkGroup($item->id, 'core.admin'))) { // Setup the variable attributes. $eid = $count . 'group_' . $item->id; // Don't call in_array unless something is selected $checked = ''; if ($selected) { $checked = in_array($item->id, $selected) ? ' checked="checked"' : ''; } $rel = ($item->parent_id > 0) ? ' rel="' . $count . 'group_' . $item->parent_id . '"' : ''; // Build the HTML for the item. $html[] = ' <div class="control-group">'; $html[] = ' <div class="controls">'; $html[] = ' <label class="checkbox" for="' . $eid . '">'; $html[] = ' <input type="checkbox" name="' . $name . '[]" value="' . $item->id . '" id="' . $eid . '"'; $html[] = ' ' . $checked . $rel . ' />'; $html[] = ' ' . str_repeat('<span class="gi">|—</span>', $item->level) . $item->title; $html[] = ' </label>'; $html[] = ' </div>'; $html[] = ' </div>'; } } return implode("\n", $html); } /** * Returns a UL list of actions with check boxes * * @param string $name The name of the checkbox controls array * @param array $selected An array of the checked boxes * @param string $component The component the permissions apply to * @param string $section The section (within a component) the permissions apply to * * @return string * * @see JAccess * @since 1.6 */ public static function actions($name, $selected, $component, $section = 'global') { static $count; $count++; $actions = JAccess::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/' . $component . '/access.xml', "/access/section[@name='" . $section . "']/" ); $html = array(); $html[] = '<ul class="checklist access-actions">'; for ($i = 0, $n = count($actions); $i < $n; $i++) { $item = &$actions[$i]; // Setup the variable attributes. $eid = $count . 'action_' . $item->id; $checked = in_array($item->id, $selected) ? ' checked="checked"' : ''; // Build the HTML for the item. $html[] = ' <li>'; $html[] = ' <input type="checkbox" name="' . $name . '[]" value="' . $item->id . '" id="' . $eid . '"'; $html[] = ' ' . $checked . ' />'; $html[] = ' <label for="' . $eid . '">'; $html[] = ' ' . JText::_($item->title); $html[] = ' </label>'; $html[] = ' </li>'; } $html[] = '</ul>'; return implode("\n", $html); } /** * Gets a list of the asset groups as an array of JHtml compatible options. * * @return mixed An array or false if an error occurs * * @since 1.6 */ public static function assetgroups() { if (empty(static::$asset_groups)) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value, a.title AS text') ->from($db->quoteName('#__viewlevels') . ' AS a') ->group('a.id, a.title, a.ordering') ->order('a.ordering ASC'); $db->setQuery($query); static::$asset_groups = $db->loadObjectList(); } return static::$asset_groups; } /** * Displays a Select list of the available asset groups * * @param string $name The name of the select element * @param mixed $selected The selected asset group id * @param string $attribs Optional attributes for the select field * @param array $config An array of options for the control * * @return mixed An HTML string or null if an error occurs * * @since 1.6 */ public static function assetgrouplist($name, $selected, $attribs = null, $config = array()) { static $count; $options = static::assetgroups(); if (isset($config['title'])) { array_unshift($options, JHtml::_('select.option', '', $config['title'])); } return JHtml::_( 'select.genericlist', $options, $name, array( 'id' => isset($config['id']) ? $config['id'] : 'assetgroups_' . (++$count), 'list.attr' => (is_null($attribs) ? 'class="inputbox" size="3"' : $attribs), 'list.select' => (int) $selected ) ); } } PK���\W�]YY"libraries/cms/html/searchtools.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Searchtools elements. * * @since 3.2 */ abstract class JHtmlSearchtools { /** * @var array Array containing information for loaded files * @since 3.2 */ protected static $loaded = array(); /** * Load the main Searchtools libraries * * @return void * * @since 3.2 */ public static function main() { // Only load once if (empty(static::$loaded[__METHOD__])) { // Requires jQuery but allows to skip its loading if ($loadJquery = (!isset($options['loadJquery']) || $options['loadJquery'] != 0)) { JHtml::_('jquery.framework'); } // Load the jQuery plugin && CSS JHtml::_('script', 'jui/jquery.searchtools.min.js', false, true); JHtml::_('stylesheet', 'jui/jquery.searchtools.css', false, true); static::$loaded[__METHOD__] = true; } return; } /** * Load searchtools for a specific form * * @param mixed $selector Is debugging mode on? [optional] * @param array $options Optional array of parameters for search tools * * @return void * * @since 3.2 */ public static function form($selector = '.js-stools-form', $options = array()) { $sig = md5(serialize(array($selector, $options))); // Only load once if (!isset(static::$loaded[__METHOD__][$sig])) { // Include Bootstrap framework static::main(); // Add the form selector to the search tools options $options['formSelector'] = $selector; // Generate options with default values $options = static::optionsToRegistry($options); $doc = JFactory::getDocument(); $script = " (function($){ $(document).ready(function() { $('" . $selector . "').searchtools( " . $options->toString() . " ); }); })(jQuery); "; $doc->addScriptDeclaration($script); static::$loaded[__METHOD__][$sig] = true; } return; } /** * Function to receive & pre-process javascript options * * @param mixed $options Associative array/Registry object with options * * @return Registry Options converted to Registry object */ private static function optionsToRegistry($options) { // Support options array if (is_array($options)) { $options = new Registry($options); } if (!($options instanceof Registry)) { $options = new Registry; } return $options; } /** * Method to sort a column in a grid * * @param string $title The link title * @param string $order The order field for the column * @param string $direction The current direction * @param mixed $selected The selected ordering * @param string $task An optional task override * @param string $new_direction An optional direction for the new column * @param string $tip An optional text shown as tooltip title instead of $title * @param string $icon Icon to show * @param string $formName Name of the form to submit * * @return string */ public static function sort($title, $order, $direction = 'asc', $selected = 0, $task = null, $new_direction = 'asc', $tip = '', $icon = null, $formName = 'adminForm') { $direction = strtolower($direction); $orderIcons = array('icon-arrow-up-3', 'icon-arrow-down-3'); $index = (int) ($direction == 'desc'); if ($order != $selected) { $direction = $new_direction; } else { $direction = ($direction == 'desc') ? 'asc' : 'desc'; } // Create an object to pass it to the layouts $data = new stdClass; $data->order = $order; $data->direction = $direction; $data->selected = $selected; $data->task = $task; $data->tip = $tip; $data->title = $title; $data->orderIcon = $orderIcons[$index]; $data->icon = $icon; $data->formName = $formName; return JLayoutHelper::render('joomla.searchtools.grid.sort', $data); } } PK���\�w�Plibraries/cms/html/icons.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Utility class for icons. * * @since 2.5 */ abstract class JHtmlIcons { /** * Method to generate html code for a list of buttons * * @param array $buttons Array of buttons * * @return string * * @since 2.5 */ public static function buttons($buttons) { $html = array(); foreach ($buttons as $button) { $html[] = JHtml::_('icons.button', $button); } return implode($html); } /** * Method to generate html code for a list of buttons * * @param array $button Button properties * * @return string * * @since 2.5 */ public static function button($button) { if (isset($button['access'])) { if (is_bool($button['access'])) { if ($button['access'] == false) { return ''; } } else { // Get the user object to verify permissions $user = JFactory::getUser(); // Take each pair of permission, context values. for ($i = 0, $n = count($button['access']); $i < $n; $i += 2) { if (!$user->authorise($button['access'][$i], $button['access'][$i + 1])) { return ''; } } } } // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.quickicons.icon'); return $layout->render($button); } } PK���\�Nxlibraries/cms/html/number.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * HTML helper class for rendering numbers. * * @since 1.6 */ abstract class JHtmlNumber { /** * Converts bytes to more distinguishable formats such as: * kilobytes, megabytes, etc. * * By default, the proper format will automatically be chosen. * However, one of the allowed unit types may also be used instead. * * @param integer $bytes The number of bytes. * @param string $unit The type of unit to return. * @param integer $precision The number of digits to be used after the decimal place. * * @return string The number of bytes in the proper units. * * @since 1.6 */ public static function bytes($bytes, $unit = 'auto', $precision = 2) { // No explicit casting $bytes to integer here, since it might overflow // on 32-bit systems $precision = (int) $precision; if (empty($bytes)) { return 0; } $unitTypes = array('b', 'kb', 'MB', 'GB', 'TB', 'PB'); // Default automatic method. $i = floor(log($bytes, 1024)); // User supplied method: if ($unit !== 'auto' && in_array($unit, $unitTypes)) { $i = array_search($unit, $unitTypes, true); } // TODO Allow conversion of units where $bytes = '32M'. return round($bytes / pow(1024, $i), $precision) . ' ' . $unitTypes[$i]; } } PK���\�2=k'k'libraries/cms/html/grid.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for creating HTML Grids * * @since 1.5 */ abstract class JHtmlGrid { /** * Display a boolean setting widget. * * @param integer $i The row index. * @param integer $value The value of the boolean field. * @param string $taskOn Task to turn the boolean setting on. * @param string $taskOff Task to turn the boolean setting off. * * @return string The boolean setting widget. * * @since 1.6 */ public static function boolean($i, $value, $taskOn = null, $taskOff = null) { // Load the behavior. static::behavior(); JHtml::_('bootstrap.tooltip'); // Build the title. $title = ($value) ? JText::_('JYES') : JText::_('JNO'); $title = JHtml::tooltipText($title, JText::_('JGLOBAL_CLICK_TO_TOGGLE_STATE'), 0); // Build the <a> tag. $bool = ($value) ? 'true' : 'false'; $task = ($value) ? $taskOff : $taskOn; $toggle = (!$task) ? false : true; if ($toggle) { return '<a class="grid_' . $bool . ' hasTooltip" title="' . $title . '" rel="{id:\'cb' . $i . '\', task:\'' . $task . '\'}" href="#toggle"></a>'; } else { return '<a class="grid_' . $bool . '"></a>'; } } /** * Method to sort a column in a grid * * @param string $title The link title * @param string $order The order field for the column * @param string $direction The current direction * @param string $selected The selected ordering * @param string $task An optional task override * @param string $new_direction An optional direction for the new column * @param string $tip An optional text shown as tooltip title instead of $title * * @return string * * @since 1.5 */ public static function sort($title, $order, $direction = 'asc', $selected = '', $task = null, $new_direction = 'asc', $tip = '') { JHtml::_('behavior.core'); JHtml::_('bootstrap.tooltip'); $direction = strtolower($direction); $icon = array('arrow-up-3', 'arrow-down-3'); $index = (int) ($direction == 'desc'); if ($order != $selected) { $direction = $new_direction; } else { $direction = ($direction == 'desc') ? 'asc' : 'desc'; } $html = '<a href="#" onclick="Joomla.tableOrdering(\'' . $order . '\',\'' . $direction . '\',\'' . $task . '\');return false;"' . ' class="hasTooltip" title="' . JHtml::tooltipText(($tip ? $tip : $title), 'JGLOBAL_CLICK_TO_SORT_THIS_COLUMN') . '">'; if (isset($title['0']) && $title['0'] == '<') { $html .= $title; } else { $html .= JText::_($title); } if ($order == $selected) { $html .= ' <span class="icon-' . $icon[$index] . '"></span>'; } $html .= '</a>'; return $html; } /** * Method to check all checkboxes in a grid * * @param string $name The name of the form element * @param string $tip The text shown as tooltip title instead of $tip * @param string $action The action to perform on clicking the checkbox * * @return string * * @since 3.1.2 */ public static function checkall($name = 'checkall-toggle', $tip = 'JGLOBAL_CHECK_ALL', $action = 'Joomla.checkAll(this)') { JHtml::_('bootstrap.tooltip'); return '<input type="checkbox" name="' . $name . '" value="" class="hasTooltip" title="' . JHtml::tooltipText($tip) . '" onclick="' . $action . '" />'; } /** * Method to create a checkbox for a grid row. * * @param integer $rowNum The row index * @param integer $recId The record id * @param boolean $checkedOut True if item is checke out * @param string $name The name of the form element * @param string $stub The name of stub identifier * * @return mixed String of html with a checkbox if item is not checked out, null if checked out. * * @since 1.5 */ public static function id($rowNum, $recId, $checkedOut = false, $name = 'cid', $stub = 'cb') { return $checkedOut ? '' : '<input type="checkbox" id="' . $stub . $rowNum . '" name="' . $name . '[]" value="' . $recId . '" onclick="Joomla.isChecked(this.checked);" />'; } /** * Displays a checked out icon. * * @param object &$row A data object (must contain checkedout as a property). * @param integer $i The index of the row. * @param string $identifier The property name of the primary key or index of the row. * * @return string * * @since 1.5 */ public static function checkedOut(&$row, $i, $identifier = 'id') { $user = JFactory::getUser(); $userid = $user->get('id'); if ($row instanceof JTable) { $result = $row->isCheckedOut($userid); } else { $result = false; } if ($result) { return static::_checkedOut($row); } else { if ($identifier == 'id') { return JHtml::_('grid.id', $i, $row->$identifier); } else { return JHtml::_('grid.id', $i, $row->$identifier, $result, $identifier); } } } /** * Method to create a clickable icon to change the state of an item * * @param mixed $value Either the scalar value or an object (for backward compatibility, deprecated) * @param integer $i The index * @param string $img1 Image for a positive or on value * @param string $img0 Image for the empty or off value * @param string $prefix An optional prefix for the task * * @return string * * @since 1.5 */ public static function published($value, $i, $img1 = 'tick.png', $img0 = 'publish_x.png', $prefix = '') { if (is_object($value)) { $value = $value->published; } $img = $value ? $img1 : $img0; $task = $value ? 'unpublish' : 'publish'; $alt = $value ? JText::_('JPUBLISHED') : JText::_('JUNPUBLISHED'); $action = $value ? JText::_('JLIB_HTML_UNPUBLISH_ITEM') : JText::_('JLIB_HTML_PUBLISH_ITEM'); return '<a href="#" onclick="return listItemTask(\'cb' . $i . '\',\'' . $prefix . $task . '\')" title="' . $action . '">' . JHtml::_('image', 'admin/' . $img, $alt, null, true) . '</a>'; } /** * Method to create a select list of states for filtering * By default the filter shows only published and unpublished items * * @param string $filter_state The initial filter state * @param string $published The JText string for published * @param string $unpublished The JText string for Unpublished * @param string $archived The JText string for Archived * @param string $trashed The JText string for Trashed * * @return string * * @since 1.5 */ public static function state($filter_state = '*', $published = 'Published', $unpublished = 'Unpublished', $archived = null, $trashed = null) { $state = array('' => '- ' . JText::_('JLIB_HTML_SELECT_STATE') . ' -', 'P' => JText::_($published), 'U' => JText::_($unpublished)); if ($archived) { $state['A'] = JText::_($archived); } if ($trashed) { $state['T'] = JText::_($trashed); } return JHtml::_( 'select.genericlist', $state, 'filter_state', array( 'list.attr' => 'class="inputbox" size="1" onchange="Joomla.submitform();"', 'list.select' => $filter_state, 'option.key' => null ) ); } /** * Method to create an icon for saving a new ordering in a grid * * @param array $rows The array of rows of rows * @param string $image The image [UNUSED] * @param string $task The task to use, defaults to save order * * @return string * * @since 1.5 */ public static function order($rows, $image = 'filesave.png', $task = 'saveorder') { return '<a href="javascript:saveorder(' . (count($rows) - 1) . ', \'' . $task . '\')" rel="tooltip" class="saveorder btn btn-micro pull-right" title="' . JText::_('JLIB_HTML_SAVE_ORDER') . '"><span class="icon-menu-2"></span></a>'; } /** * Method to create a checked out icon with optional overlib in a grid. * * @param object &$row The row object * @param boolean $overlib True if an overlib with checkout information should be created. * * @return string HTMl for the icon and overlib * * @since 1.5 */ protected static function _checkedOut(&$row, $overlib = true) { $hover = ''; if ($overlib) { JHtml::_('bootstrap.tooltip'); $date = JHtml::_('date', $row->checked_out_time, JText::_('DATE_FORMAT_LC1')); $time = JHtml::_('date', $row->checked_out_time, 'H:i'); $hover = '<span class="editlinktip hasTooltip" title="' . JHtml::tooltipText('JLIB_HTML_CHECKED_OUT', $row->editor) . '<br />' . $date . '<br />' . $time . '">'; } return $hover . JHtml::_('image', 'admin/checked_out.png', null, null, true) . '</span>'; } /** * Method to build the behavior script and add it to the document head. * * @return void * * @since 1.6 */ public static function behavior() { static $loaded; if (!$loaded) { // Include jQuery JHtml::_('jquery.framework'); // Build the behavior script. $js = ' jQuery(function($){ $actions = $(\'a.move_up, a.move_down, a.grid_true, a.grid_false, a.grid_trash\'); $actions.each(function(){ $(this).on(\'click\', function(){ args = JSON.decode(this.rel); listItemTask(args.id, args.task); }); }); $(\'input.check-all-toggle\').each(function(){ $(this).on(\'click\', function(){ if (this.checked) { $(this).closest(\'form\').find(\'input[type=checkbox]\').each(function(){ this.checked = true; }) } else { $(this).closest(\'form\').find(\'input[type=checkbox]\').each(function(){ this.checked = false; }) } }); }); });'; // Add the behavior to the document head. $document = JFactory::getDocument(); $document->addScriptDeclaration($js); $loaded = true; } } } PK���\/��4}4}libraries/cms/html/html.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.environment.browser'); jimport('joomla.filesystem.file'); jimport('joomla.filesystem.path'); jimport('joomla.utilities.arrayhelper'); /** * Utility class for all HTML drawing classes * * @since 1.5 */ abstract class JHtml { /** * Option values related to the generation of HTML output. Recognized * options are: * fmtDepth, integer. The current indent depth. * fmtEol, string. The end of line string, default is linefeed. * fmtIndent, string. The string to use for indentation, default is * tab. * * @var array * @since 1.5 */ public static $formatOptions = array('format.depth' => 0, 'format.eol' => "\n", 'format.indent' => "\t"); /** * An array to hold included paths * * @var array * @since 1.5 */ protected static $includePaths = array(); /** * An array to hold method references * * @var array * @since 1.6 */ protected static $registry = array(); /** * Method to extract a key * * @param string $key The name of helper method to load, (prefix).(class).function * prefix and class are optional and can be used to load custom html helpers. * * @return array Contains lowercase key, prefix, file, function. * * @since 1.6 */ protected static function extract($key) { $key = preg_replace('#[^A-Z0-9_\.]#i', '', $key); // Check to see whether we need to load a helper file $parts = explode('.', $key); $prefix = (count($parts) == 3 ? array_shift($parts) : 'JHtml'); $file = (count($parts) == 2 ? array_shift($parts) : ''); $func = array_shift($parts); return array(strtolower($prefix . '.' . $file . '.' . $func), $prefix, $file, $func); } /** * Class loader method * * Additional arguments may be supplied and are passed to the sub-class. * Additional include paths are also able to be specified for third-party use * * @param string $key The name of helper method to load, (prefix).(class).function * prefix and class are optional and can be used to load custom * html helpers. * * @return mixed JHtml::call($function, $args) or False on error * * @since 1.5 * @throws InvalidArgumentException */ public static function _($key) { list($key, $prefix, $file, $func) = static::extract($key); if (array_key_exists($key, static::$registry)) { $function = static::$registry[$key]; $args = func_get_args(); // Remove function name from arguments array_shift($args); return static::call($function, $args); } $className = $prefix . ucfirst($file); if (!class_exists($className)) { $path = JPath::find(static::$includePaths, strtolower($file) . '.php'); if ($path) { require_once $path; if (!class_exists($className)) { throw new InvalidArgumentException(sprintf('%s not found.', $className), 500); } } else { throw new InvalidArgumentException(sprintf('%s %s not found.', $prefix, $file), 500); } } $toCall = array($className, $func); if (is_callable($toCall)) { static::register($key, $toCall); $args = func_get_args(); // Remove function name from arguments array_shift($args); return static::call($toCall, $args); } else { throw new InvalidArgumentException(sprintf('%s::%s not found.', $className, $func), 500); } } /** * Registers a function to be called with a specific key * * @param string $key The name of the key * @param string $function Function or method * * @return boolean True if the function is callable * * @since 1.6 */ public static function register($key, $function) { list($key) = static::extract($key); if (is_callable($function)) { static::$registry[$key] = $function; return true; } return false; } /** * Removes a key for a method from registry. * * @param string $key The name of the key * * @return boolean True if a set key is unset * * @since 1.6 */ public static function unregister($key) { list($key) = static::extract($key); if (isset(static::$registry[$key])) { unset(static::$registry[$key]); return true; } return false; } /** * Test if the key is registered. * * @param string $key The name of the key * * @return boolean True if the key is registered. * * @since 1.6 */ public static function isRegistered($key) { list($key) = static::extract($key); return isset(static::$registry[$key]); } /** * Function caller method * * @param callable $function Function or method to call * @param array $args Arguments to be passed to function * * @return mixed Function result or false on error. * * @see http://php.net/manual/en/function.call-user-func-array.php * @since 1.6 * @throws InvalidArgumentException */ protected static function call($function, $args) { if (!is_callable($function)) { throw new InvalidArgumentException('Function not supported', 500); } // PHP 5.3 workaround $temp = array(); foreach ($args as &$arg) { $temp[] = &$arg; } return call_user_func_array($function, $temp); } /** * Write a <a></a> element * * @param string $url The relative URL to use for the href attribute * @param string $text The target attribute to use * @param array $attribs An associative array of attributes to add * * @return string <a></a> string * * @since 1.5 */ public static function link($url, $text, $attribs = null) { if (is_array($attribs)) { $attribs = JArrayHelper::toString($attribs); } return '<a href="' . $url . '" ' . $attribs . '>' . $text . '</a>'; } /** * Write a <iframe></iframe> element * * @param string $url The relative URL to use for the src attribute. * @param string $name The target attribute to use. * @param array $attribs An associative array of attributes to add. * @param string $noFrames The message to display if the iframe tag is not supported. * * @return string <iframe></iframe> element or message if not supported. * * @since 1.5 */ public static function iframe($url, $name, $attribs = null, $noFrames = '') { if (is_array($attribs)) { $attribs = JArrayHelper::toString($attribs); } return '<iframe src="' . $url . '" ' . $attribs . ' name="' . $name . '">' . $noFrames . '</iframe>'; } /** * Compute the files to be included * * @param string $folder folder name to search into (images, css, js, ...). * @param string $file path to file. * @param boolean $relative path to file is relative to /media folder (and searches in template). * @param boolean $detect_browser detect browser to include specific browser files. * @param boolean $detect_debug detect debug to include compressed files if debug is on. * * @return array files to be included. * * @see JBrowser * @since 1.6 */ protected static function includeRelativeFiles($folder, $file, $relative, $detect_browser, $detect_debug) { // If http is present in filename if (strpos($file, 'http') === 0 || strpos($file, '//') === 0) { $includes = array($file); } else { // Extract extension and strip the file $strip = JFile::stripExt($file); $ext = JFile::getExt($file); // Prepare array of files $includes = array(); // Detect browser and compute potential files if ($detect_browser) { $navigator = JBrowser::getInstance(); $browser = $navigator->getBrowser(); $major = $navigator->getMajor(); $minor = $navigator->getMinor(); // Try to include files named filename.ext, filename_browser.ext, filename_browser_major.ext, filename_browser_major_minor.ext // where major and minor are the browser version names $potential = array($strip, $strip . '_' . $browser, $strip . '_' . $browser . '_' . $major, $strip . '_' . $browser . '_' . $major . '_' . $minor); } else { $potential = array($strip); } // If relative search in template directory or media directory if ($relative) { // Get the template $template = JFactory::getApplication()->getTemplate(); // For each potential files foreach ($potential as $strip) { $files = array(); // Detect debug mode if ($detect_debug && JFactory::getConfig()->get('debug')) { /* * Detect if we received a file in the format name.min.ext * If so, strip the .min part out, otherwise append -uncompressed */ if (strrpos($strip, '.min', '-4')) { $position = strrpos($strip, '.min', '-4'); $filename = str_replace('.min', '.', $strip, $position); $files[] = $filename . $ext; } else { $files[] = $strip . '-uncompressed.' . $ext; } } $files[] = $strip . '.' . $ext; /* * Loop on 1 or 2 files and break on first found. * Add the content of the MD5SUM file located in the same folder to url to ensure cache browser refresh * This MD5SUM file must represent the signature of the folder content */ foreach ($files as $file) { // If the file is in the template folder $path = JPATH_THEMES . "/$template/$folder/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::base(true) . "/templates/$template/$folder/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } else { // If the file contains any /: it can be in an media extension subfolder if (strpos($file, '/')) { // Divide the file extracting the extension as the first part before / list($extension, $file) = explode('/', $file, 2); // If the file yet contains any /: it can be a plugin if (strpos($file, '/')) { // Divide the file extracting the element as the first part before / list($element, $file) = explode('/', $file, 2); // Try to deal with plugins group in the media folder $path = JPATH_ROOT . "/media/$extension/$element/$folder/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::root(true) . "/media/$extension/$element/$folder/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } // Try to deal with classical file in a a media subfolder called element $path = JPATH_ROOT . "/media/$extension/$folder/$element/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::root(true) . "/media/$extension/$folder/$element/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } // Try to deal with system files in the template folder $path = JPATH_THEMES . "/$template/$folder/system/$element/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::root(true) . "/templates/$template/$folder/system/$element/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } // Try to deal with system files in the media folder $path = JPATH_ROOT . "/media/system/$folder/$element/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::root(true) . "/media/system/$folder/$element/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } } else { // Try to deals in the extension media folder $path = JPATH_ROOT . "/media/$extension/$folder/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::root(true) . "/media/$extension/$folder/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } // Try to deal with system files in the template folder $path = JPATH_THEMES . "/$template/$folder/system/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::root(true) . "/templates/$template/$folder/system/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } // Try to deal with system files in the media folder $path = JPATH_ROOT . "/media/system/$folder/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::root(true) . "/media/system/$folder/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } } } // Try to deal with system files in the media folder else { $path = JPATH_ROOT . "/media/system/$folder/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::root(true) . "/media/system/$folder/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } } } } } } // If not relative and http is not present in filename else { foreach ($potential as $strip) { $files = array(); // Detect debug mode if ($detect_debug && JFactory::getConfig()->get('debug')) { /* * Detect if we received a file in the format name.min.ext * If so, strip the .min part out, otherwise append -uncompressed */ if (strrpos($strip, '.min', '-4')) { $position = strrpos($strip, '.min', '-4'); $filename = str_replace('.min', '.', $strip, $position); $files[] = $filename . $ext; } else { $files[] = $strip . '-uncompressed.' . $ext; } } $files[] = $strip . '.' . $ext; /* * Loop on 1 or 2 files and break on first found. * Add the content of the MD5SUM file located in the same folder to url to ensure cache browser refresh * This MD5SUM file must represent the signature of the folder content */ foreach ($files as $file) { $path = JPATH_ROOT . "/$file"; if (file_exists($path)) { $md5 = dirname($path) . '/MD5SUM'; $includes[] = JUri::root(true) . "/$file" . (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); break; } } } } } return $includes; } /** * Write a <img></img> element * * @param string $file The relative or absolute URL to use for the src attribute. * @param string $alt The alt text. * @param mixed $attribs String or associative array of attribute(s) to use. * @param boolean $relative Path to file is relative to /media folder (and searches in template). * @param mixed $path_rel Return html tag without (-1) or with file computing(false). Return computed path only (true). * * @return string * * @since 1.5 */ public static function image($file, $alt, $attribs = null, $relative = false, $path_rel = false) { if ($path_rel !== -1) { $includes = static::includeRelativeFiles('images', $file, $relative, false, false); $file = count($includes) ? $includes[0] : null; } // If only path is required if ($path_rel) { return $file; } else { return '<img src="' . $file . '" alt="' . $alt . '" ' . trim((is_array($attribs) ? JArrayHelper::toString($attribs) : $attribs) . ' /') . '>'; } } /** * Write a <link rel="stylesheet" style="text/css" /> element * * @param string $file path to file * @param array $attribs attributes to be added to the stylesheet * @param boolean $relative path to file is relative to /media folder * @param boolean $path_only return the path to the file only * @param boolean $detect_browser detect browser to include specific browser css files * will try to include file, file_*browser*, file_*browser*_*major*, file_*browser*_*major*_*minor* * <table> * <tr><th>Navigator</th> <th>browser</th> <th>major.minor</th></tr> * * <tr><td>Safari 3.0.x</td> <td>konqueror</td> <td>522.x</td></tr> * <tr><td>Safari 3.1.x and 3.2.x</td> <td>konqueror</td> <td>525.x</td></tr> * <tr><td>Safari 4.0 to 4.0.2</td> <td>konqueror</td> <td>530.x</td></tr> * <tr><td>Safari 4.0.3 to 4.0.4</td> <td>konqueror</td> <td>531.x</td></tr> * <tr><td>iOS 4.0 Safari</td> <td>konqueror</td> <td>532.x</td></tr> * <tr><td>Safari 5.0</td> <td>konqueror</td> <td>533.x</td></tr> * * <tr><td>Google Chrome 1.0</td> <td>konqueror</td> <td>528.x</td></tr> * <tr><td>Google Chrome 2.0</td> <td>konqueror</td> <td>530.x</td></tr> * <tr><td>Google Chrome 3.0 and 4.x</td> <td>konqueror</td> <td>532.x</td></tr> * <tr><td>Google Chrome 5.0</td> <td>konqueror</td> <td>533.x</td></tr> * * <tr><td>Internet Explorer 5.5</td> <td>msie</td> <td>5.5</td></tr> * <tr><td>Internet Explorer 6.x</td> <td>msie</td> <td>6.x</td></tr> * <tr><td>Internet Explorer 7.x</td> <td>msie</td> <td>7.x</td></tr> * <tr><td>Internet Explorer 8.x</td> <td>msie</td> <td>8.x</td></tr> * * <tr><td>Firefox</td> <td>mozilla</td> <td>5.0</td></tr> * </table> * a lot of others * @param boolean $detect_debug detect debug to search for compressed files if debug is on * * @return mixed nothing if $path_only is false, null, path or array of path if specific css browser files were detected * * @see JBrowser * @since 1.5 */ public static function stylesheet($file, $attribs = array(), $relative = false, $path_only = false, $detect_browser = true, $detect_debug = true) { $includes = static::includeRelativeFiles('css', $file, $relative, $detect_browser, $detect_debug); // If only path is required if ($path_only) { if (count($includes) == 0) { return null; } elseif (count($includes) == 1) { return $includes[0]; } else { return $includes; } } // If inclusion is required else { $document = JFactory::getDocument(); foreach ($includes as $include) { $document->addStylesheet($include, 'text/css', null, $attribs); } } } /** * Write a <script></script> element * * @param string $file path to file. * @param boolean $framework load the JS framework. * @param boolean $relative path to file is relative to /media folder. * @param boolean $path_only return the path to the file only. * @param boolean $detect_browser detect browser to include specific browser js files. * @param boolean $detect_debug detect debug to search for compressed files if debug is on. * * @return mixed nothing if $path_only is false, null, path or array of path if specific js browser files were detected. * * @see JHtml::stylesheet() * @since 1.5 */ public static function script($file, $framework = false, $relative = false, $path_only = false, $detect_browser = true, $detect_debug = true) { // Include MooTools framework if ($framework) { static::_('behavior.framework'); } $includes = static::includeRelativeFiles('js', $file, $relative, $detect_browser, $detect_debug); // If only path is required if ($path_only) { if (count($includes) == 0) { return null; } elseif (count($includes) == 1) { return $includes[0]; } else { return $includes; } } // If inclusion is required else { $document = JFactory::getDocument(); foreach ($includes as $include) { $document->addScript($include); } } } /** * Set format related options. * * Updates the formatOptions array with all valid values in the passed array. * * @param array $options Option key/value pairs. * * @return void * * @see JHtml::$formatOptions * @since 1.5 */ public static function setFormatOptions($options) { foreach ($options as $key => $val) { if (isset(static::$formatOptions[$key])) { static::$formatOptions[$key] = $val; } } } /** * Returns formated date according to a given format and time zone. * * @param string $input String in a format accepted by date(), defaults to "now". * @param string $format The date format specification string (see {@link PHP_MANUAL#date}). * @param mixed $tz Time zone to be used for the date. Special cases: boolean true for user * setting, boolean false for server setting. * @param boolean $gregorian True to use Gregorian calendar. * * @return string A date translated by the given format and time zone. * * @see strftime * @since 1.5 */ public static function date($input = 'now', $format = null, $tz = true, $gregorian = false) { // Get some system objects. $config = JFactory::getConfig(); $user = JFactory::getUser(); // UTC date converted to user time zone. if ($tz === true) { // Get a date object based on UTC. $date = JFactory::getDate($input, 'UTC'); // Set the correct time zone based on the user configuration. $date->setTimeZone(new DateTimeZone($user->getParam('timezone', $config->get('offset')))); } // UTC date converted to server time zone. elseif ($tz === false) { // Get a date object based on UTC. $date = JFactory::getDate($input, 'UTC'); // Set the correct time zone based on the server configuration. $date->setTimeZone(new DateTimeZone($config->get('offset'))); } // No date conversion. elseif ($tz === null) { $date = JFactory::getDate($input); } // UTC date converted to given time zone. else { // Get a date object based on UTC. $date = JFactory::getDate($input, 'UTC'); // Set the correct time zone based on the server configuration. $date->setTimeZone(new DateTimeZone($tz)); } // If no format is given use the default locale based format. if (!$format) { $format = JText::_('DATE_FORMAT_LC1'); } // $format is an existing language key elseif (JFactory::getLanguage()->hasKey($format)) { $format = JText::_($format); } if ($gregorian) { return $date->format($format, true); } else { return $date->calendar($format, true); } } /** * Creates a tooltip with an image as button * * @param string $tooltip The tip string. * @param mixed $title The title of the tooltip or an associative array with keys contained in * {'title','image','text','href','alt'} and values corresponding to parameters of the same name. * @param string $image The image for the tip, if no text is provided. * @param string $text The text for the tip. * @param string $href An URL that will be used to create the link. * @param string $alt The alt attribute for img tag. * @param string $class CSS class for the tool tip. * * @return string * * @since 1.5 */ public static function tooltip($tooltip, $title = '', $image = 'tooltip.png', $text = '', $href = '', $alt = 'Tooltip', $class = 'hasTooltip') { if (is_array($title)) { foreach (array('image', 'text', 'href', 'alt', 'class') as $param) { if (isset($title[$param])) { $$param = $title[$param]; } } if (isset($title['title'])) { $title = $title['title']; } else { $title = ''; } } if (!$text) { $alt = htmlspecialchars($alt, ENT_COMPAT, 'UTF-8'); $text = static::image($image, $alt, null, true); } if ($href) { $tip = '<a href="' . $href . '">' . $text . '</a>'; } else { $tip = $text; } if ($class == 'hasTip') { // Still using MooTools tooltips! $tooltip = htmlspecialchars($tooltip, ENT_COMPAT, 'UTF-8'); if ($title) { $title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); $tooltip = $title . '::' . $tooltip; } } else { $tooltip = self::tooltipText($title, $tooltip, 0); } return '<span class="' . $class . '" title="' . $tooltip . '">' . $tip . '</span>'; } /** * Converts a double colon seperated string or 2 separate strings to a string ready for bootstrap tooltips * * @param string $title The title of the tooltip (or combined '::' separated string). * @param string $content The content to tooltip. * @param int $translate If true will pass texts through JText. * @param int $escape If true will pass texts through htmlspecialchars. * * @return string The tooltip string * * @since 3.1.2 */ public static function tooltipText($title = '', $content = '', $translate = 1, $escape = 1) { // Initialise return value. $result = ''; // Don't process empty strings if ($content != '' || $title != '') { // Split title into title and content if the title contains '::' (old Mootools format). if ($content == '' && !(strpos($title, '::') === false)) { list($title, $content) = explode('::', $title, 2); } // Pass texts through JText if required. if ($translate) { $title = JText::_($title); $content = JText::_($content); } // Use only the content if no title is given. if ($title == '') { $result = $content; } // Use only the title, if title and text are the same. elseif ($title == $content) { $result = '<strong>' . $title . '</strong>'; } // Use a formatted string combining the title and content. elseif ($content != '') { $result = '<strong>' . $title . '</strong><br />' . $content; } else { $result = $title; } // Escape everything, if required. if ($escape) { $result = htmlspecialchars($result); } } return $result; } /** * Displays a calendar control field * * @param string $value The date value * @param string $name The name of the text field * @param string $id The id of the text field * @param string $format The date format * @param mixed $attribs Additional HTML attributes * * @return string HTML markup for a calendar field * * @since 1.5 */ public static function calendar($value, $name, $id, $format = '%Y-%m-%d', $attribs = null) { static $done; if ($done === null) { $done = array(); } $readonly = isset($attribs['readonly']) && $attribs['readonly'] == 'readonly'; $disabled = isset($attribs['disabled']) && $attribs['disabled'] == 'disabled'; if (is_array($attribs)) { $attribs['class'] = isset($attribs['class']) ? $attribs['class'] : 'input-medium'; $attribs['class'] = trim($attribs['class'] . ' hasTooltip'); $attribs = JArrayHelper::toString($attribs); } static::_('bootstrap.tooltip'); // Format value when not nulldate ('0000-00-00 00:00:00'), otherwise blank it as it would result in 1970-01-01. if ($value && $value != JFactory::getDbo()->getNullDate()) { $tz = date_default_timezone_get(); date_default_timezone_set('UTC'); $inputvalue = strftime($format, strtotime($value)); date_default_timezone_set($tz); } else { $inputvalue = ''; } // Load the calendar behavior static::_('behavior.calendar'); // Only display the triggers once for each control. if (!in_array($id, $done)) { $document = JFactory::getDocument(); $document ->addScriptDeclaration( 'jQuery(document).ready(function($) {Calendar.setup({ // Id of the input field inputField: "' . $id . '", // Format of the input field ifFormat: "' . $format . '", // Trigger for the calendar (button ID) button: "' . $id . '_img", // Alignment (defaults to "Bl") align: "Tl", singleClick: true, firstDay: ' . JFactory::getLanguage()->getFirstDay() . ' });});' ); $done[] = $id; } // Hide button using inline styles for readonly/disabled fields $btn_style = ($readonly || $disabled) ? ' style="display:none;"' : ''; $div_class = (!$readonly && !$disabled) ? ' class="input-append"' : ''; return '<div' . $div_class . '>' . '<input type="text" title="' . ($inputvalue ? static::_('date', $value, null, null) : '') . '" name="' . $name . '" id="' . $id . '" value="' . htmlspecialchars($inputvalue, ENT_COMPAT, 'UTF-8') . '" ' . $attribs . ' />' . '<button type="button" class="btn" id="' . $id . '_img"' . $btn_style . '><span class="icon-calendar"></span></button>' . '</div>'; } /** * Add a directory where JHtml should search for helpers. You may * either pass a string or an array of directories. * * @param string $path A path to search. * * @return array An array with directory elements * * @since 1.5 */ public static function addIncludePath($path = '') { // Force path to array settype($path, 'array'); // Loop through the path directories foreach ($path as $dir) { if (!empty($dir) && !in_array($dir, static::$includePaths)) { array_unshift(static::$includePaths, JPath::clean($dir)); } } return static::$includePaths; } /** * Internal method to get a JavaScript object notation string from an array * * @param array $array The array to convert to JavaScript object notation * * @return string JavaScript object notation representation of the array * * @deprecated 4.0 use json_encode or JRegistry::toString('json') * * @since 3.0 */ public static function getJSObject(array $array = array()) { JLog::add(__METHOD__ . ' is deprecated. Use json_encode instead.', JLog::WARNING, 'deprecated'); $elements = array(); foreach ($array as $k => $v) { // Don't encode either of these types if (is_null($v) || is_resource($v)) { continue; } // Safely encode as a Javascript string $key = json_encode((string) $k); if (is_bool($v)) { $elements[] = $key . ': ' . ($v ? 'true' : 'false'); } elseif (is_numeric($v)) { $elements[] = $key . ': ' . ($v + 0); } elseif (is_string($v)) { if (strpos($v, '\\') === 0) { // Items such as functions and JSON objects are prefixed with \, strip the prefix and don't encode them $elements[] = $key . ': ' . substr($v, 1); } else { // The safest way to insert a string $elements[] = $key . ': ' . json_encode((string) $v); } } else { $elements[] = $key . ': ' . static::getJSObject(is_object($v) ? get_object_vars($v) : $v); } } return '{' . implode(',', $elements) . '}'; } } PK���\��;ememlibraries/cms/html/select.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for creating HTML select lists * * @since 1.5 */ abstract class JHtmlSelect { /** * Default values for options. Organized by option group. * * @var array * @since 1.5 */ protected static $optionDefaults = array( 'option' => array('option.attr' => null, 'option.disable' => 'disable', 'option.id' => null, 'option.key' => 'value', 'option.key.toHtml' => true, 'option.label' => null, 'option.label.toHtml' => true, 'option.text' => 'text', 'option.text.toHtml' => true, 'option.class' => 'class', 'option.onclick' => 'onclick')); /** * Generates a yes/no radio list. * * @param string $name The value of the HTML name attribute * @param array $attribs Additional HTML attributes for the <select> tag * @param string $selected The key that is selected * @param string $yes Language key for Yes * @param string $no Language key for no * @param mixed $id The id for the field or false for no id * * @return string HTML for the radio list * * @since 1.5 * @see JFormFieldRadio */ public static function booleanlist($name, $attribs = array(), $selected = null, $yes = 'JYES', $no = 'JNO', $id = false) { $arr = array(JHtml::_('select.option', '0', JText::_($no)), JHtml::_('select.option', '1', JText::_($yes))); return JHtml::_('select.radiolist', $arr, $name, $attribs, 'value', 'text', (int) $selected, $id); } /** * Generates an HTML selection list. * * @param array $data An array of objects, arrays, or scalars. * @param string $name The value of the HTML name attribute. * @param mixed $attribs Additional HTML attributes for the <select> tag. This * can be an array of attributes, or an array of options. Treated as options * if it is the last argument passed. Valid options are: * Format options, see {@see JHtml::$formatOptions}. * Selection options, see {@see JHtmlSelect::options()}. * list.attr, string|array: Additional attributes for the select * element. * id, string: Value to use as the select element id attribute. * Defaults to the same as the name. * list.select, string|array: Identifies one or more option elements * to be selected, based on the option key values. * @param string $optKey The name of the object variable for the option value. If * set to null, the index of the value array is used. * @param string $optText The name of the object variable for the option text. * @param mixed $selected The key that is selected (accepts an array or a string). * @param mixed $idtag Value of the field id or null by default * @param boolean $translate True to translate * * @return string HTML for the select list. * * @since 1.5 */ public static function genericlist($data, $name, $attribs = null, $optKey = 'value', $optText = 'text', $selected = null, $idtag = false, $translate = false) { // Set default options $options = array_merge(JHtml::$formatOptions, array('format.depth' => 0, 'id' => false)); if (is_array($attribs) && func_num_args() == 3) { // Assume we have an options array $options = array_merge($options, $attribs); } else { // Get options from the parameters $options['id'] = $idtag; $options['list.attr'] = $attribs; $options['list.translate'] = $translate; $options['option.key'] = $optKey; $options['option.text'] = $optText; $options['list.select'] = $selected; } $attribs = ''; if (isset($options['list.attr'])) { if (is_array($options['list.attr'])) { $attribs = JArrayHelper::toString($options['list.attr']); } else { $attribs = $options['list.attr']; } if ($attribs != '') { $attribs = ' ' . $attribs; } } $id = $options['id'] !== false ? $options['id'] : $name; $id = str_replace(array('[', ']'), '', $id); $baseIndent = str_repeat($options['format.indent'], $options['format.depth']++); $html = $baseIndent . '<select' . ($id !== '' ? ' id="' . $id . '"' : '') . ' name="' . $name . '"' . $attribs . '>' . $options['format.eol'] . static::options($data, $options) . $baseIndent . '</select>' . $options['format.eol']; return $html; } /** * Method to build a list with suggestions * * @param array $data An array of objects, arrays, or values. * @param string $optKey The name of the object variable for the option value. If * set to null, the index of the value array is used. * @param string $optText The name of the object variable for the option text. * @param mixed $idtag Value of the field id or null by default * @param boolean $translate True to translate * * @return string HTML for the select list * * @since 3.2 * @deprecated 4.0 Just create the <datalist> directly instead */ public static function suggestionlist($data, $optKey = 'value', $optText = 'text', $idtag = null, $translate = false) { // Log deprecated message JLog::add( 'JHtmlSelect::suggestionlist() is deprecated. Create the <datalist> tag directly instead.', JLog::WARNING, 'deprecated' ); // Note: $idtag is requried but has to be an optional argument in the funtion call due to argument order if (!$idtag) { throw new InvalidArgumentException('$idtag is a required argument in deprecated JHtmlSelect::suggestionlist'); } // Set default options $options = array_merge(JHtml::$formatOptions, array('format.depth' => 0, 'id' => false)); // Get options from the parameters $options['id'] = $idtag; $options['list.attr'] = null; $options['list.translate'] = $translate; $options['option.key'] = $optKey; $options['option.text'] = $optText; $options['list.select'] = null; $id = ' id="' . $idtag . '"'; $baseIndent = str_repeat($options['format.indent'], $options['format.depth']++); $html = $baseIndent . '<datalist' . $id . '>' . $options['format.eol'] . static::options($data, $options) . $baseIndent . '</datalist>' . $options['format.eol']; return $html; } /** * Generates a grouped HTML selection list from nested arrays. * * @param array $data An array of groups, each of which is an array of options. * @param string $name The value of the HTML name attribute * @param array $options Options, an array of key/value pairs. Valid options are: * Format options, {@see JHtml::$formatOptions}. * Selection options. See {@see JHtmlSelect::options()}. * group.id: The property in each group to use as the group id * attribute. Defaults to none. * group.label: The property in each group to use as the group * label. Defaults to "text". If set to null, the data array index key is * used. * group.items: The property in each group to use as the array of * items in the group. Defaults to "items". If set to null, group.id and * group. label are forced to null and the data element is assumed to be a * list of selections. * id: Value to use as the select element id attribute. Defaults to * the same as the name. * list.attr: Attributes for the select element. Can be a string or * an array of key/value pairs. Defaults to none. * list.select: either the value of one selected option or an array * of selected options. Default: none. * list.translate: Boolean. If set, text and labels are translated via * JText::_(). * * @return string HTML for the select list * * @since 1.5 * @throws RuntimeException If a group has contents that cannot be processed. */ public static function groupedlist($data, $name, $options = array()) { // Set default options and overwrite with anything passed in $options = array_merge( JHtml::$formatOptions, array('format.depth' => 0, 'group.items' => 'items', 'group.label' => 'text', 'group.label.toHtml' => true, 'id' => false), $options ); // Apply option rules if ($options['group.items'] === null) { $options['group.label'] = null; } $attribs = ''; if (isset($options['list.attr'])) { if (is_array($options['list.attr'])) { $attribs = JArrayHelper::toString($options['list.attr']); } else { $attribs = $options['list.attr']; } if ($attribs != '') { $attribs = ' ' . $attribs; } } $id = $options['id'] !== false ? $options['id'] : $name; $id = str_replace(array('[', ']'), '', $id); // Disable groups in the options. $options['groups'] = false; $baseIndent = str_repeat($options['format.indent'], $options['format.depth']++); $html = $baseIndent . '<select' . ($id !== '' ? ' id="' . $id . '"' : '') . ' name="' . $name . '"' . $attribs . '>' . $options['format.eol']; $groupIndent = str_repeat($options['format.indent'], $options['format.depth']++); foreach ($data as $dataKey => $group) { $label = $dataKey; $id = ''; $noGroup = is_int($dataKey); if ($options['group.items'] == null) { // Sub-list is an associative array $subList = $group; } elseif (is_array($group)) { // Sub-list is in an element of an array. $subList = $group[$options['group.items']]; if (isset($group[$options['group.label']])) { $label = $group[$options['group.label']]; $noGroup = false; } if (isset($options['group.id']) && isset($group[$options['group.id']])) { $id = $group[$options['group.id']]; $noGroup = false; } } elseif (is_object($group)) { // Sub-list is in a property of an object $subList = $group->$options['group.items']; if (isset($group->$options['group.label'])) { $label = $group->$options['group.label']; $noGroup = false; } if (isset($options['group.id']) && isset($group->$options['group.id'])) { $id = $group->$options['group.id']; $noGroup = false; } } else { throw new RuntimeException('Invalid group contents.', 1); } if ($noGroup) { $html .= static::options($subList, $options); } else { $html .= $groupIndent . '<optgroup' . (empty($id) ? '' : ' id="' . $id . '"') . ' label="' . ($options['group.label.toHtml'] ? htmlspecialchars($label, ENT_COMPAT, 'UTF-8') : $label) . '">' . $options['format.eol'] . static::options($subList, $options) . $groupIndent . '</optgroup>' . $options['format.eol']; } } $html .= $baseIndent . '</select>' . $options['format.eol']; return $html; } /** * Generates a selection list of integers. * * @param integer $start The start integer * @param integer $end The end integer * @param integer $inc The increment * @param string $name The value of the HTML name attribute * @param mixed $attribs Additional HTML attributes for the <select> tag, an array of * attributes, or an array of options. Treated as options if it is the last * argument passed. * @param mixed $selected The key that is selected * @param string $format The printf format to be applied to the number * * @return string HTML for the select list * * @since 1.5 */ public static function integerlist($start, $end, $inc, $name, $attribs = null, $selected = null, $format = '') { // Set default options $options = array_merge(JHtml::$formatOptions, array('format.depth' => 0, 'option.format' => '', 'id' => null)); if (is_array($attribs) && func_num_args() == 5) { // Assume we have an options array $options = array_merge($options, $attribs); // Extract the format and remove it from downstream options $format = $options['option.format']; unset($options['option.format']); } else { // Get options from the parameters $options['list.attr'] = $attribs; $options['list.select'] = $selected; } $start = (int) $start; $end = (int) $end; $inc = (int) $inc; $data = array(); for ($i = $start; $i <= $end; $i += $inc) { $data[$i] = $format ? sprintf($format, $i) : $i; } // Tell genericlist() to use array keys $options['option.key'] = null; return JHtml::_('select.genericlist', $data, $name, $options); } /** * Create a placeholder for an option group. * * @param string $text The text for the option * @param string $optKey The returned object property name for the value * @param string $optText The returned object property name for the text * * @return object * * @deprecated 4.0 Use JHtmlSelect::groupedList() * @see JHtmlSelect::groupedList() * @since 1.5 */ public static function optgroup($text, $optKey = 'value', $optText = 'text') { JLog::add('JHtmlSelect::optgroup() is deprecated, use JHtmlSelect::groupedList() instead.', JLog::WARNING, 'deprecated'); // Set initial state static $state = 'open'; // Toggle between open and close states: switch ($state) { case 'open': $obj = new stdClass; $obj->$optKey = '<OPTGROUP>'; $obj->$optText = $text; $state = 'close'; break; case 'close': $obj = new stdClass; $obj->$optKey = '</OPTGROUP>'; $obj->$optText = $text; $state = 'open'; break; } return $obj; } /** * Create an object that represents an option in an option list. * * @param string $value The value of the option * @param string $text The text for the option * @param mixed $optKey If a string, the returned object property name for * the value. If an array, options. Valid options are: * attr: String|array. Additional attributes for this option. * Defaults to none. * disable: Boolean. If set, this option is disabled. * label: String. The value for the option label. * option.attr: The property in each option array to use for * additional selection attributes. Defaults to none. * option.disable: The property that will hold the disabled state. * Defaults to "disable". * option.key: The property that will hold the selection value. * Defaults to "value". * option.label: The property in each option array to use as the * selection label attribute. If a "label" option is provided, defaults to * "label", if no label is given, defaults to null (none). * option.text: The property that will hold the the displayed text. * Defaults to "text". If set to null, the option array is assumed to be a * list of displayable scalars. * @param string $optText The property that will hold the the displayed text. This * parameter is ignored if an options array is passed. * @param boolean $disable Not used. * * @return object * * @since 1.5 */ public static function option($value, $text = '', $optKey = 'value', $optText = 'text', $disable = false) { $options = array('attr' => null, 'disable' => false, 'option.attr' => null, 'option.disable' => 'disable', 'option.key' => 'value', 'option.label' => null, 'option.text' => 'text'); if (is_array($optKey)) { // Merge in caller's options $options = array_merge($options, $optKey); } else { // Get options from the parameters $options['option.key'] = $optKey; $options['option.text'] = $optText; $options['disable'] = $disable; } $obj = new stdClass; $obj->{$options['option.key']} = $value; $obj->{$options['option.text']} = trim($text) ? $text : $value; /* * If a label is provided, save it. If no label is provided and there is * a label name, initialise to an empty string. */ $hasProperty = $options['option.label'] !== null; if (isset($options['label'])) { $labelProperty = $hasProperty ? $options['option.label'] : 'label'; $obj->$labelProperty = $options['label']; } elseif ($hasProperty) { $obj->{$options['option.label']} = ''; } // Set attributes only if there is a property and a value if ($options['attr'] !== null) { $obj->{$options['option.attr']} = $options['attr']; } // Set disable only if it has a property and a value if ($options['disable'] !== null) { $obj->{$options['option.disable']} = $options['disable']; } return $obj; } /** * Generates the option tags for an HTML select list (with no select tag * surrounding the options). * * @param array $arr An array of objects, arrays, or values. * @param mixed $optKey If a string, this is the name of the object variable for * the option value. If null, the index of the array of objects is used. If * an array, this is a set of options, as key/value pairs. Valid options are: * -Format options, {@see JHtml::$formatOptions}. * -groups: Boolean. If set, looks for keys with the value * "<optgroup>" and synthesizes groups from them. Deprecated. Defaults * true for backwards compatibility. * -list.select: either the value of one selected option or an array * of selected options. Default: none. * -list.translate: Boolean. If set, text and labels are translated via * JText::_(). Default is false. * -option.id: The property in each option array to use as the * selection id attribute. Defaults to none. * -option.key: The property in each option array to use as the * selection value. Defaults to "value". If set to null, the index of the * option array is used. * -option.label: The property in each option array to use as the * selection label attribute. Defaults to null (none). * -option.text: The property in each option array to use as the * displayed text. Defaults to "text". If set to null, the option array is * assumed to be a list of displayable scalars. * -option.attr: The property in each option array to use for * additional selection attributes. Defaults to none. * -option.disable: The property that will hold the disabled state. * Defaults to "disable". * -option.key: The property that will hold the selection value. * Defaults to "value". * -option.text: The property that will hold the the displayed text. * Defaults to "text". If set to null, the option array is assumed to be a * list of displayable scalars. * @param string $optText The name of the object variable for the option text. * @param mixed $selected The key that is selected (accepts an array or a string) * @param boolean $translate Translate the option values. * * @return string HTML for the select list * * @since 1.5 */ public static function options($arr, $optKey = 'value', $optText = 'text', $selected = null, $translate = false) { $options = array_merge( JHtml::$formatOptions, static::$optionDefaults['option'], array('format.depth' => 0, 'groups' => true, 'list.select' => null, 'list.translate' => false) ); if (is_array($optKey)) { // Set default options and overwrite with anything passed in $options = array_merge($options, $optKey); } else { // Get options from the parameters $options['option.key'] = $optKey; $options['option.text'] = $optText; $options['list.select'] = $selected; $options['list.translate'] = $translate; } $html = ''; $baseIndent = str_repeat($options['format.indent'], $options['format.depth']); foreach ($arr as $elementKey => &$element) { $attr = ''; $extra = ''; $label = ''; $id = ''; if (is_array($element)) { $key = $options['option.key'] === null ? $elementKey : $element[$options['option.key']]; $text = $element[$options['option.text']]; if (isset($element[$options['option.attr']])) { $attr = $element[$options['option.attr']]; } if (isset($element[$options['option.id']])) { $id = $element[$options['option.id']]; } if (isset($element[$options['option.label']])) { $label = $element[$options['option.label']]; } if (isset($element[$options['option.disable']]) && $element[$options['option.disable']]) { $extra .= ' disabled="disabled"'; } } elseif (is_object($element)) { $key = $options['option.key'] === null ? $elementKey : $element->{$options['option.key']}; $text = $element->{$options['option.text']}; if (isset($element->{$options['option.attr']})) { $attr = $element->{$options['option.attr']}; } if (isset($element->{$options['option.id']})) { $id = $element->{$options['option.id']}; } if (isset($element->{$options['option.label']})) { $label = $element->{$options['option.label']}; } if (isset($element->{$options['option.disable']}) && $element->{$options['option.disable']}) { $extra .= ' disabled="disabled"'; } if (isset($element->{$options['option.class']}) && $element->{$options['option.class']}) { $extra .= ' class="' . $element->{$options['option.class']} . '"'; } if (isset($element->{$options['option.onclick']}) && $element->{$options['option.onclick']}) { $extra .= ' onclick="' . $element->{$options['option.onclick']} . '"'; } } else { // This is a simple associative array $key = $elementKey; $text = $element; } /* * The use of options that contain optgroup HTML elements was * somewhat hacked for J1.5. J1.6 introduces the grouplist() method * to handle this better. The old solution is retained through the * "groups" option, which defaults true in J1.6, but should be * deprecated at some point in the future. */ $key = (string) $key; if ($options['groups'] && $key == '<OPTGROUP>') { $html .= $baseIndent . '<optgroup label="' . ($options['list.translate'] ? JText::_($text) : $text) . '">' . $options['format.eol']; $baseIndent = str_repeat($options['format.indent'], ++$options['format.depth']); } elseif ($options['groups'] && $key == '</OPTGROUP>') { $baseIndent = str_repeat($options['format.indent'], --$options['format.depth']); $html .= $baseIndent . '</optgroup>' . $options['format.eol']; } else { // If no string after hyphen - take hyphen out $splitText = explode(' - ', $text, 2); $text = $splitText[0]; if (isset($splitText[1]) && $splitText[1] != "" && !preg_match('/^[\s]+$/', $splitText[1])) { $text .= ' - ' . $splitText[1]; } if ($options['list.translate'] && !empty($label)) { $label = JText::_($label); } if ($options['option.label.toHtml']) { $label = htmlentities($label); } if (is_array($attr)) { $attr = JArrayHelper::toString($attr); } else { $attr = trim($attr); } $extra = ($id ? ' id="' . $id . '"' : '') . ($label ? ' label="' . $label . '"' : '') . ($attr ? ' ' . $attr : '') . $extra; if (is_array($options['list.select'])) { foreach ($options['list.select'] as $val) { $key2 = is_object($val) ? $val->$options['option.key'] : $val; if ($key == $key2) { $extra .= ' selected="selected"'; break; } } } elseif ((string) $key == (string) $options['list.select']) { $extra .= ' selected="selected"'; } if ($options['list.translate']) { $text = JText::_($text); } // Generate the option, encoding as required $html .= $baseIndent . '<option value="' . ($options['option.key.toHtml'] ? htmlspecialchars($key, ENT_COMPAT, 'UTF-8') : $key) . '"' . $extra . '>'; $html .= $options['option.text.toHtml'] ? htmlentities(html_entity_decode($text, ENT_COMPAT, 'UTF-8'), ENT_COMPAT, 'UTF-8') : $text; $html .= '</option>' . $options['format.eol']; } } return $html; } /** * Generates an HTML radio list. * * @param array $data An array of objects * @param string $name The value of the HTML name attribute * @param string $attribs Additional HTML attributes for the <select> tag * @param mixed $optKey The key that is selected * @param string $optText The name of the object variable for the option value * @param string $selected The name of the object variable for the option text * @param boolean $idtag Value of the field id or null by default * @param boolean $translate True if options will be translated * * @return string HTML for the select list * * @since 1.5 */ public static function radiolist($data, $name, $attribs = null, $optKey = 'value', $optText = 'text', $selected = null, $idtag = false, $translate = false) { if (is_array($attribs)) { $attribs = JArrayHelper::toString($attribs); } $id_text = $idtag ? $idtag : $name; $html = '<div class="controls">'; foreach ($data as $obj) { $k = $obj->$optKey; $t = $translate ? JText::_($obj->$optText) : $obj->$optText; $id = (isset($obj->id) ? $obj->id : null); $extra = ''; $id = $id ? $obj->id : $id_text . $k; if (is_array($selected)) { foreach ($selected as $val) { $k2 = is_object($val) ? $val->$optKey : $val; if ($k == $k2) { $extra .= ' selected="selected" '; break; } } } else { $extra .= ((string) $k == (string) $selected ? ' checked="checked" ' : ''); } $html .= "\n\t" . '<label for="' . $id . '" id="' . $id . '-lbl" class="radio">'; $html .= "\n\t\n\t" . '<input type="radio" name="' . $name . '" id="' . $id . '" value="' . $k . '" ' . $extra . $attribs . ' >' . $t; $html .= "\n\t" . '</label>'; } $html .= "\n"; $html .= '</div>'; $html .= "\n"; return $html; } } PK���\<�w�SS5libraries/cms/html/language/en-GB/en-GB.jhtmldate.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 JLIB_HTML_DATE_RELATIVE_DAYS="%s days ago" JLIB_HTML_DATE_RELATIVE_DAYS_1="%s day ago" JLIB_HTML_DATE_RELATIVE_DAYS_0="%s days ago" JLIB_HTML_DATE_RELATIVE_HOURS="%s hours ago" JLIB_HTML_DATE_RELATIVE_HOURS_1="%s hour ago" JLIB_HTML_DATE_RELATIVE_HOURS_0="%s hours ago" JLIB_HTML_DATE_RELATIVE_LESSTHANAMINUTE="Less than a minute ago" JLIB_HTML_DATE_RELATIVE_MINUTES="%s minutes ago" JLIB_HTML_DATE_RELATIVE_MINUTES_1="%s minute ago" JLIB_HTML_DATE_RELATIVE_MINUTES_0="%s minutes ago" JLIB_HTML_DATE_RELATIVE_WEEKS="%s weeks ago" JLIB_HTML_DATE_RELATIVE_WEEKS_1="%s week ago" JLIB_HTML_DATE_RELATIVE_WEEKS_0="%s weeks ago" PK���\3H�[� � libraries/cms/html/tabs.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for Tabs elements. * * @since 1.6 */ abstract class JHtmlTabs { /** * Creates a panes and creates the JavaScript object for it. * * @param string $group The pane identifier. * @param array $params An array of option. * * @return string * * @since 1.6 */ public static function start($group = 'tabs', $params = array()) { static::loadBehavior($group, $params); return '<dl class="tabs" id="' . $group . '"><dt style="display:none;"></dt><dd style="display:none;">'; } /** * Close the current pane * * @return string HTML to close the pane * * @since 1.6 */ public static function end() { return '</dd></dl>'; } /** * Begins the display of a new panel. * * @param string $text Text to display. * @param string $id Identifier of the panel. * * @return string HTML to start a new panel * * @since 1.6 */ public static function panel($text, $id) { return '</dd><dt class="tabs ' . $id . '"><span><h3><a href="javascript:void(0);">' . $text . '</a></h3></span></dt><dd class="tabs">'; } /** * Load the JavaScript behavior. * * @param string $group The pane identifier. * @param array $params Array of options. * * @return void * * @since 1.6 */ protected static function loadBehavior($group, $params = array()) { static $loaded = array(); if (!array_key_exists((string) $group, $loaded)) { // Include MooTools framework JHtml::_('behavior.framework', true); $opt['onActive'] = (isset($params['onActive'])) ? '\\' . $params['onActive'] : null; $opt['onBackground'] = (isset($params['onBackground'])) ? '\\' . $params['onBackground'] : null; $opt['display'] = (isset($params['startOffset'])) ? (int) $params['startOffset'] : null; $opt['useStorage'] = (isset($params['useCookie']) && $params['useCookie']) ? true : false; $opt['titleSelector'] = "dt.tabs"; $opt['descriptionSelector'] = "dd.tabs"; $options = JHtml::getJSObject($opt); $js = ' window.addEvent(\'domready\', function(){ $$(\'dl#' . $group . '.tabs\').each(function(tabs){ new JTabs(tabs, ' . $options . '); }); });'; $document = JFactory::getDocument(); $document->addScriptDeclaration($js); JHtml::_('script', 'system/tabs.js', false, true); $loaded[(string) $group] = true; } } } PK���\ �2}##&libraries/cms/html/contentlanguage.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class working with content language select lists * * @since 1.6 */ abstract class JHtmlContentLanguage { /** * Cached array of the content language items. * * @var array * @since 1.6 */ protected static $items = null; /** * Get a list of the available content language items. * * @param boolean $all True to include All (*) * @param boolean $translate True to translate All * * @return string * * @see JFormFieldContentLanguage * @since 1.6 */ public static function existing($all = false, $translate = false) { if (empty(static::$items)) { // Get the database object and a new query object. $db = JFactory::getDbo(); $query = $db->getQuery(true); // Build the query. $query->select('a.lang_code AS value, a.title AS text, a.title_native') ->from('#__languages AS a') ->where('a.published >= 0') ->order('a.title'); // Set the query and load the options. $db->setQuery($query); static::$items = $db->loadObjectList(); } if ($all) { $all_option = array(new JObject(array('value' => '*', 'text' => $translate ? JText::alt('JALL', 'language') : 'JALL_LANGUAGE'))); return array_merge($all_option, static::$items); } else { return static::$items; } } } PK���\�r2Õ�libraries/cms/html/list.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * 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 (JString::strlen($items[$i]->text) > $chop) { $text = JString::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; } } PK���\~-$ %#%#libraries/cms/html/dropdown.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * HTML utility class for building a dropdown menu * * @since 3.0 */ abstract class JHtmlDropdown { /** * @var array Array containing information for loaded files * @since 3.0 */ protected static $loaded = array(); /** * @var string HTML markup for the dropdown list * @since 3.0 */ protected static $dropDownList = null; /** * Method to inject needed script * * @return void * * @since 3.0 */ public static function init() { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // Depends on Bootstrap JHtml::_('bootstrap.framework'); JFactory::getDocument()->addScriptDeclaration(" (function($){ $(document).ready(function (){ $('.has-context') .mouseenter(function (){ $('.btn-group',$(this)).show(); }) .mouseleave(function (){ $('.btn-group',$(this)).hide(); $('.btn-group',$(this)).removeClass('open'); }); contextAction =function (cbId, task) { $('input[name=\"cid[]\"]').removeAttr('checked'); $('#' + cbId).attr('checked','checked'); Joomla.submitbutton(task); } }); })(jQuery); " ); // Set static array static::$loaded[__METHOD__] = true; return; } /** * Method to start a new dropdown menu * * @return void * * @since 3.0 */ public static function start() { // Only start once if (isset(static::$loaded[__METHOD__]) && static::$loaded[__METHOD__] == true) { return; } $dropDownList = '<div class="btn-group" style="margin-left:6px;display:none"> <a href="#" data-toggle="dropdown" class="dropdown-toggle btn btn-mini"> <span class="caret"></span> </a> <ul class="dropdown-menu">'; static::$dropDownList = $dropDownList; static::$loaded[__METHOD__] = true; return; } /** * Method to render current dropdown menu * * @return string HTML markup for the dropdown list * * @since 3.0 */ public static function render() { $dropDownList = static::$dropDownList; $dropDownList .= '</ul></div>'; static::$dropDownList = null; static::$loaded['JHtmlDropdown::start'] = false; return $dropDownList; } /** * Append an edit item to the current dropdown menu * * @param integer $id Record ID * @param string $prefix Task prefix * @param string $customLink The custom link if dont use default Joomla action format * * @return void * * @since 3.0 */ public static function edit($id, $prefix = '', $customLink = '') { static::start(); if (!$customLink) { $option = JFactory::getApplication()->input->getCmd('option'); $link = 'index.php?option=' . $option; } else { $link = $customLink; } $link .= '&task=' . $prefix . 'edit&id=' . $id; $link = JRoute::_($link); static::addCustomItem(JText::_('JACTION_EDIT'), $link); return; } /** * Append a publish item to the current dropdown menu * * @param string $checkboxId ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.0 */ public static function publish($checkboxId, $prefix = '') { $task = $prefix . 'publish'; static::addCustomItem(JText::_('JTOOLBAR_PUBLISH'), 'javascript:void(0)', 'onclick="contextAction(\'' . $checkboxId . '\', \'' . $task . '\')"'); return; } /** * Append an unpublish item to the current dropdown menu * * @param string $checkboxId ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.0 */ public static function unpublish($checkboxId, $prefix = '') { $task = $prefix . 'unpublish'; static::addCustomItem(JText::_('JTOOLBAR_UNPUBLISH'), 'javascript:void(0)', 'onclick="contextAction(\'' . $checkboxId . '\', \'' . $task . '\')"'); return; } /** * Append a featured item to the current dropdown menu * * @param string $checkboxId ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.0 */ public static function featured($checkboxId, $prefix = '') { $task = $prefix . 'featured'; static::addCustomItem(JText::_('JFEATURED'), 'javascript:void(0)', 'onclick="contextAction(\'' . $checkboxId . '\', \'' . $task . '\')"'); return; } /** * Append an unfeatured item to the current dropdown menu * * @param string $checkboxId ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.0 */ public static function unfeatured($checkboxId, $prefix = '') { $task = $prefix . 'unfeatured'; static::addCustomItem(JText::_('JUNFEATURED'), 'javascript:void(0)', 'onclick="contextAction(\'' . $checkboxId . '\', \'' . $task . '\')"'); return; } /** * Append an archive item to the current dropdown menu * * @param string $checkboxId ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.0 */ public static function archive($checkboxId, $prefix = '') { $task = $prefix . 'archive'; static::addCustomItem(JText::_('JTOOLBAR_ARCHIVE'), 'javascript:void(0)', 'onclick="contextAction(\'' . $checkboxId . '\', \'' . $task . '\')"'); return; } /** * Append an unarchive item to the current dropdown menu * * @param string $checkboxId ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.0 */ public static function unarchive($checkboxId, $prefix = '') { $task = $prefix . 'unpublish'; static::addCustomItem(JText::_('JTOOLBAR_UNARCHIVE'), 'javascript:void(0)', 'onclick="contextAction(\'' . $checkboxId . '\', \'' . $task . '\')"'); return; } /** * Append a trash item to the current dropdown menu * * @param string $checkboxId ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.0 */ public static function trash($checkboxId, $prefix = '') { $task = $prefix . 'trash'; static::addCustomItem(JText::_('JTOOLBAR_TRASH'), 'javascript:void(0)', 'onclick="contextAction(\'' . $checkboxId . '\', \'' . $task . '\')"'); return; } /** * Append an untrash item to the current dropdown menu * * @param string $checkboxId ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.0 */ public static function untrash($checkboxId, $prefix = '') { $task = $prefix . 'publish'; static::addCustomItem(JText::_('JTOOLBAR_UNTRASH'), 'javascript:void(0)', 'onclick="contextAction(\'' . $checkboxId . '\', \'' . $task . '\')"'); return; } /** * Append a checkin item to the current dropdown menu * * @param string $checkboxId ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.0 */ public static function checkin($checkboxId, $prefix = '') { $task = $prefix . 'checkin'; static::addCustomItem(JText::_('JTOOLBAR_CHECKIN'), 'javascript:void(0)', 'onclick="contextAction(\'' . $checkboxId . '\', \'' . $task . '\')"'); return; } /** * Writes a divider between dropdown items * * @return void * * @since 3.0 */ public static function divider() { static::$dropDownList .= '<li class="divider"></li>'; return; } /** * Append a custom item to current dropdown menu * * @param string $label The label of item * @param string $link The link of item * @param string $linkAttributes Custom link attributes * @param string $className Class name of item * @param boolean $ajaxLoad True if using ajax load when item clicked * @param string $jsCallBackFunc Javascript function name, called when ajax load successfully * * @return void * * @since 3.0 */ public static function addCustomItem($label, $link = 'javascript:void(0)', $linkAttributes = '', $className = '', $ajaxLoad = false, $jsCallBackFunc = null) { static::start(); if ($ajaxLoad) { $href = ' href = "javascript:void(0)" onclick="loadAjax(\'' . $link . '\', \'' . $jsCallBackFunc . '\')"'; } else { $href = ' href = "' . $link . '" '; } $dropDownList = static::$dropDownList; $dropDownList .= '<li class="' . $className . '"><a ' . $linkAttributes . $href . ' >'; $dropDownList .= $label; $dropDownList .= '</a></li>'; static::$dropDownList = $dropDownList; return; } } PK���\���7XX&libraries/cms/html/actionsdropdown.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * HTML utility class for building a dropdown menu * * @since 3.2 */ abstract class JHtmlActionsDropdown { /** * @var string HTML markup for the dropdown list * @since 3.2 */ protected static $dropDownList = array(); /** * Method to render current dropdown menu * * @param string $item An item to render. * * @return string HTML markup for the dropdown list * * @since 3.2 */ public static function render($item = '') { $html = array(); $html[] = '<button data-toggle="dropdown" class="dropdown-toggle btn btn-micro">'; $html[] = '<span class="caret"></span>'; if ($item) { $html[] = '<span class="element-invisible">' . JText::sprintf('JACTIONS', $item) . '</span>'; } $html[] = '</button>'; $html[] = '<ul class="dropdown-menu">'; $html[] = implode('', static::$dropDownList); $html[] = '</ul>'; static::$dropDownList = null; return implode('', $html); } /** * Append a publish item to the current dropdown menu * * @param string $id ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.2 */ public static function publish($id, $prefix = '') { $task = ($prefix ? $prefix . '.' : '') . 'publish'; static::addCustomItem(JText::_('JTOOLBAR_PUBLISH'), 'publish', $id, $task); } /** * Append an unpublish item to the current dropdown menu * * @param string $id ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.2 */ public static function unpublish($id, $prefix = '') { $task = ($prefix ? $prefix . '.' : '') . 'unpublish'; static::addCustomItem(JText::_('JTOOLBAR_UNPUBLISH'), 'unpublish', $id, $task); } /** * Append a feature item to the current dropdown menu * * @param string $id ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.2 */ public static function feature($id, $prefix = '') { $task = ($prefix ? $prefix . '.' : '') . 'featured'; static::addCustomItem(JText::_('JFEATURE'), 'featured', $id, $task); } /** * Append an unfeature item to the current dropdown menu * * @param string $id ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.2 */ public static function unfeature($id, $prefix = '') { $task = ($prefix ? $prefix . '.' : '') . 'unfeatured'; static::addCustomItem(JText::_('JUNFEATURE'), 'unfeatured', $id, $task); } /** * Append an archive item to the current dropdown menu * * @param string $id ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.2 */ public static function archive($id, $prefix = '') { $task = ($prefix ? $prefix . '.' : '') . 'archive'; static::addCustomItem(JText::_('JTOOLBAR_ARCHIVE'), 'archive', $id, $task); } /** * Append an unarchive item to the current dropdown menu * * @param string $id ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.2 */ public static function unarchive($id, $prefix = '') { $task = ($prefix ? $prefix . '.' : '') . 'unpublish'; static::addCustomItem(JText::_('JTOOLBAR_UNARCHIVE'), 'unarchive', $id, $task); } /** * Append a duplicate item to the current dropdown menu * * @param string $id ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.2 */ public static function duplicate($id, $prefix = '') { $task = ($prefix ? $prefix . '.' : '') . 'duplicate'; static::addCustomItem(JText::_('JTOOLBAR_DUPLICATE'), 'copy', $id, $task); } /** * Append a trash item to the current dropdown menu * * @param string $id ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.2 */ public static function trash($id, $prefix = '') { $task = ($prefix ? $prefix . '.' : '') . 'trash'; static::addCustomItem(JText::_('JTOOLBAR_TRASH'), 'trash', $id, $task); } /** * Append an untrash item to the current dropdown menu * * @param string $id ID of corresponding checkbox of the record * @param string $prefix The task prefix * * @return void * * @since 3.2 */ public static function untrash($id, $prefix = '') { self::publish($id, $prefix); } /** * Writes a divider between dropdown items * * @return void * * @since 3.0 */ public static function divider() { static::$dropDownList[] = '<li class="divider"></li>'; } /** * Append a custom item to current dropdown menu. * * @param string $label The label of the item. * @param string $icon The icon classname. * @param string $id The item id. * @param string $task The task. * * @return void * * @since 3.2 */ public static function addCustomItem($label, $icon = '', $id = '', $task = '') { static::$dropDownList[] = '<li>' . '<a href = "javascript://" onclick="listItemTask(\'' . $id . '\', \'' . $task . '\')">' . ($icon ? '<span class="icon-' . $icon . '"></span> ' : '') . $label . '</a>' . '</li>'; } } PK���\Xn^��libraries/cms/html/tel.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * HTML helper class for rendering telephone numbers. * * @since 1.6 */ abstract class JHtmlTel { /** * Converts strings of integers into more readable telephone format * * By default, the ITU-T format will automatically be used. * However, one of the allowed unit types may also be used instead. * * @param integer $number The integers in a phone number with dot separated country code * ccc.nnnnnnn where ccc represents country code and nnn represents the local number. * @param string $displayplan The numbering plan used to display the numbers. * * @return string The formatted telephone number. * * @see JFormRuleTel * @since 1.6 */ public static function tel($number, $displayplan) { $number = explode('.', $number); $countrycode = $number[0]; $number = $number[1]; if ($displayplan == 'ITU-T' || $displayplan == 'International' || $displayplan == 'int' || $displayplan == 'missdn' || $displayplan == null) { $display[0] = '+'; $display[1] = $countrycode; $display[2] = ' '; $display[3] = implode(str_split($number, 2), ' '); } elseif ($displayplan == 'NANP' || $displayplan == 'northamerica' || $displayplan == 'US') { $display[0] = '('; $display[1] = substr($number, 0, 3); $display[2] = ') '; $display[3] = substr($number, 3, 3); $display[4] = '-'; $display[5] = substr($number, 6, 4); } elseif ($displayplan == 'EPP' || $displayplan == 'IETF') { $display[0] = '+'; $display[1] = $countrycode; $display[2] = '.'; $display[3] = $number; } elseif ($displayplan == 'ARPA' || $displayplan == 'ENUM') { $number = implode(str_split(strrev($number), 1), '.'); $display[0] = '+'; $display[1] = $number; $display[2] = '.'; $display[3] = $countrycode; $display[4] = '.e164.arpa'; } $display = implode($display, ''); return $display; } } PK���\�1���#libraries/cms/html/formbehavior.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Utility class for form related behaviors * * @since 3.0 */ abstract class JHtmlFormbehavior { /** * @var array Array containing information for loaded files * @since 3.0 */ protected static $loaded = array(); /** * Method to load the Chosen JavaScript framework and supporting CSS into the document head * * If debugging mode is on an uncompressed version of Chosen is included for easier debugging. * * @param string $selector Class for Chosen elements. * @param mixed $debug Is debugging mode on? [optional] * @param array $options the possible Chosen options as name => value [optional] * * @return void * * @since 3.0 */ public static function chosen($selector = '.advancedSelect', $debug = null, $options = array()) { if (isset(static::$loaded[__METHOD__][$selector])) { return; } // Include jQuery JHtml::_('jquery.framework'); // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = (boolean) $config->get('debug'); } // Default settings if (!isset($options['disable_search_threshold'])) { $options['disable_search_threshold'] = 10; } if (!isset($options['allow_single_deselect'])) { $options['allow_single_deselect'] = true; } if (!isset($options['placeholder_text_multiple'])) { $options['placeholder_text_multiple'] = JText::_('JGLOBAL_SELECT_SOME_OPTIONS'); } if (!isset($options['placeholder_text_single'])) { $options['placeholder_text_single'] = JText::_('JGLOBAL_SELECT_AN_OPTION'); } if (!isset($options['no_results_text'])) { $options['no_results_text'] = JText::_('JGLOBAL_SELECT_NO_RESULTS_MATCH'); } // Options array to json options string $options_str = json_encode($options, ($debug && defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false)); JHtml::_('script', 'jui/chosen.jquery.min.js', false, true, false, false, $debug); JHtml::_('stylesheet', 'jui/chosen.css', false, true); JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function (){ jQuery('" . $selector . "').chosen(" . $options_str . "); }); " ); static::$loaded[__METHOD__][$selector] = true; return; } /** * Method to load the AJAX Chosen library * * If debugging mode is on an uncompressed version of AJAX Chosen is included for easier debugging. * * @param Registry $options Options in a Registry object * @param mixed $debug Is debugging mode on? [optional] * * @return void * * @since 3.0 */ public static function ajaxchosen(Registry $options, $debug = null) { // Retrieve options/defaults $selector = $options->get('selector', '.tagfield'); $type = $options->get('type', 'GET'); $url = $options->get('url', null); $dataType = $options->get('dataType', 'json'); $jsonTermKey = $options->get('jsonTermKey', 'term'); $afterTypeDelay = $options->get('afterTypeDelay', '500'); $minTermLength = $options->get('minTermLength', '3'); JText::script('JGLOBAL_KEEP_TYPING'); JText::script('JGLOBAL_LOOKING_FOR'); // Ajax URL is mandatory if (!empty($url)) { if (isset(static::$loaded[__METHOD__][$selector])) { return; } // Include jQuery JHtml::_('jquery.framework'); // Requires chosen to work static::chosen($selector, $debug); JHtml::_('script', 'jui/ajax-chosen.min.js', false, true, false, false, $debug); JFactory::getDocument()->addScriptDeclaration(" (function($){ $(document).ready(function () { $('" . $selector . "').ajaxChosen({ type: '" . $type . "', url: '" . $url . "', dataType: '" . $dataType . "', jsonTermKey: '" . $jsonTermKey . "', afterTypeDelay: '" . $afterTypeDelay . "', minTermLength: '" . $minTermLength . "' }, function (data) { var results = []; $.each(data, function (i, val) { results.push({ value: val.value, text: val.text }); }); return results; }); }); })(jQuery); " ); static::$loaded[__METHOD__][$selector] = true; } return; } } PK���\�kǏ�libraries/cms/html/sidebar.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class to render a list view sidebar * * @since 3.0 */ abstract class JHtmlSidebar { /** * Menu entries * * @var array * @since 3.0 */ protected static $entries = array(); /** * Filters * * @var array * @since 3.0 */ protected static $filters = array(); /** * Value for the action attribute of the form. * * @var string * @since 3.0 */ protected static $action = ''; /** * Render the sidebar. * * @return string The necessary HTML to display the sidebar * * @since 3.0 */ public static function render() { // Collect display data $data = new stdClass; $data->list = static::getEntries(); $data->filters = static::getFilters(); $data->action = static::getAction(); $data->displayMenu = count($data->list); $data->displayFilters = count($data->filters); $data->hide = JFactory::getApplication()->input->getBool('hidemainmenu'); // Create a layout object and ask it to render the sidebar $layout = new JLayoutFile('joomla.sidebars.submenu'); $sidebarHtml = $layout->render($data); return $sidebarHtml; } /** * Method to add a menu item to submenu. * * @param string $name Name of the menu item. * @param string $link URL of the menu item. * @param bool $active True if the item is active, false otherwise. * * @return void * * @since 3.0 */ public static function addEntry($name, $link = '', $active = false) { array_push(static::$entries, array($name, $link, $active)); } /** * Returns an array of all submenu entries * * @return array * * @since 3.0 */ public static function getEntries() { return static::$entries; } /** * Method to add a filter to the submenu * * @param string $label Label for the menu item. * @param string $name Name for the filter. Also used as id. * @param string $options Options for the select field. * @param bool $noDefault Don't the label as the empty option * * @return void * * @since 3.0 */ public static function addFilter($label, $name, $options, $noDefault = false) { array_push(static::$filters, array('label' => $label, 'name' => $name, 'options' => $options, 'noDefault' => $noDefault)); } /** * Returns an array of all filters * * @return array * * @since 3.0 */ public static function getFilters() { return static::$filters; } /** * Set value for the action attribute of the filter form * * @param string $action Value for the action attribute of the form * * @return void * * @since 3.0 */ public static function setAction($action) { static::$action = $action; } /** * Get value for the action attribute of the filter form * * @return string * * @since 3.0 */ public static function getAction() { return static::$action; } } PK���\��E/L L libraries/cms/html/email.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class for cloaking email addresses * * @since 1.5 */ abstract class JHtmlEmail { /** * Simple JavaScript email cloaker * * By default replaces an email with a mailto link with email cloaked * * @param string $mail The -mail address to cloak. * @param boolean $mailto True if text and mailing address differ * @param string $text Text for the link * @param boolean $email True if text is an e-mail address * * @return string The cloaked email. * * @since 1.5 */ public static function cloak($mail, $mailto = true, $text = '', $email = true) { // Convert mail $mail = static::convertEncoding($mail); // Split email by @ symbol $mail = explode('@', $mail); $mail_parts = explode('.', $mail[1]); // Random number $rand = rand(1, 100000); $replacement = '<span id="cloak' . $rand . '">' . JText::_('JLIB_HTML_CLOAKING') . '</span>' . "<script type='text/javascript'>"; $replacement .= "\n //<!--"; $replacement .= "\n document.getElementById('cloak$rand').innerHTML = '';"; $replacement .= "\n var prefix = 'ma' + 'il' + 'to';"; $replacement .= "\n var path = 'hr' + 'ef' + '=';"; $replacement .= "\n var addy" . $rand . " = '" . @$mail[0] . "' + '@';"; $replacement .= "\n addy" . $rand . " = addy" . $rand . " + '" . implode("' + '.' + '", $mail_parts) . "';"; if ($mailto) { // Special handling when mail text is different from mail address if ($text) { // Convert text - here is the right place $text = static::convertEncoding($text); if ($email) { // Split email by @ symbol $text = explode('@', $text); $text_parts = explode('.', $text[1]); $replacement .= "\n var addy_text" . $rand . " = '" . @$text[0] . "' + '@' + '" . implode("' + '.' + '", @$text_parts) . "';"; } else { $replacement .= "\n var addy_text" . $rand . " = '" . $text . "';"; } $replacement .= "\n document.getElementById('cloak$rand').innerHTML += '<a ' + path + '\'' + prefix + ':' + addy" . $rand . " + '\'>'+addy_text" . $rand . "+'<\/a>';"; } else { $replacement .= "\n document.getElementById('cloak$rand').innerHTML += '<a ' + path + '\'' + prefix + ':' + addy" . $rand . " + '\'>' +addy" . $rand . "+'<\/a>';"; } } else { $replacement .= "\n document.getElementById('cloak$rand').innerHTML += addy" . $rand . ";"; } $replacement .= "\n //-->"; $replacement .= "\n </script>"; return $replacement; } /** * Convert encoded text * * @param string $text Text to convert * * @return string The converted text. * * @since 1.5 */ protected static function convertEncoding($text) { $text = html_entity_decode($text); // Replace vowels with character encoding $text = str_replace('a', 'a', $text); $text = str_replace('e', 'e', $text); $text = str_replace('i', 'i', $text); $text = str_replace('o', 'o', $text); $text = str_replace('u', 'u', $text); $text = htmlentities($text, ENT_QUOTES, 'UTF-8', false); return $text; } } PK���\�B� libraries/cms/html/links.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Utility class for icons. * * @since 3.2 */ abstract class JHtmlLinks { /** * Method to generate html code for groups of lists of links * * @param array $groupsOfLinks Array of links * * @return string * * @since 3.2 */ public static function linksgroups($groupsOfLinks) { $html = array(); if (count($groupsOfLinks) > 0) { $layout = new JLayoutFile('joomla.links.groupsopen'); $html[] = $layout->render(''); foreach ($groupsOfLinks as $title => $links) { if (isset($links[0]['separategroup'])) { $layout = new JLayoutFile('joomla.links.groupseparator'); $html[] = $layout->render($title); } $layout = new JLayoutFile('joomla.links.groupopen'); $htmlHeader = $layout->render($title); $htmlLinks = JHtml::_('links.links', $links); if ($htmlLinks != '') { $html[] = $htmlHeader; $html[] = $htmlLinks; $layout = new JLayoutFile('joomla.links.groupclose'); $html[] = $layout->render(''); } } $layout = new JLayoutFile('joomla.links.groupsclose'); $html[] = $layout->render(''); } return implode($html); } /** * Method to generate html code for a list of links * * @param array $links Array of links * * @return string * * @since 3.2 */ public static function links($links) { $html = array(); foreach ($links as $link) { $html[] = JHtml::_('links.link', $link); } return implode($html); } /** * Method to generate html code for a list of links * * @param array $link link properties * * @return string * * @since 3.2 */ public static function link($link) { if (isset($link['access'])) { if (is_bool($link['access'])) { if ($link['access'] == false) { return ''; } } else { // Get the user object to verify permissions $user = JFactory::getUser(); // Take each pair of permission, context values. for ($i = 0, $n = count($link['access']); $i < $n; $i += 2) { if (!$user->authorise($link['access'][$i], $link['access'][$i + 1])) { return ''; } } } } // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.links.link'); return $layout->render($link); } } PK���\�9ܘ�libraries/cms/layout/layout.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Interface to handle display layout * * @see https://docs.joomla.org/Sharing_layouts_across_views_or_extensions_with_JLayout * @since 3.0 */ interface JLayout { /** * Method to escape output. * * @param string $output The output to escape. * * @return string The escaped output. * * @since 3.0 */ public function escape($output); /** * Method to render the layout. * * @param object $displayData Object which properties are used inside the layout file to build displayed output * * @return string The rendered layout. * * @since 3.0 */ public function render($displayData); } PK���\m4|Y��libraries/cms/layout/helper.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Helper to render a JLayout object, storing a base path * * @see https://docs.joomla.org/Sharing_layouts_across_views_or_extensions_with_JLayout * @since 3.1 */ class JLayoutHelper { /** * A default base path that will be used if none is provided when calling the render method. * Note that JLayoutFile itself will defaults to JPATH_ROOT . '/layouts' if no basePath is supplied at all * * @var string * @since 3.1 */ public static $defaultBasePath = ''; /** * Method to render the layout. * * @param string $layoutFile Dot separated path to the layout file, relative to base path * @param object $displayData Object which properties are used inside the layout file to build displayed output * @param string $basePath Base path to use when loading layout files * @param mixed $options Optional custom options to load. Registry or array format * * @return string * * @since 3.1 */ public static function render($layoutFile, $displayData = null, $basePath = '', $options = null) { $basePath = empty($basePath) ? self::$defaultBasePath : $basePath; // Make sure we send null to JLayoutFile if no path set $basePath = empty($basePath) ? null : $basePath; $layout = new JLayoutFile($layoutFile, $basePath, $options); $renderedLayout = $layout->render($displayData); return $renderedLayout; } } PK���\)6�;&;&libraries/cms/layout/file.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Base class for rendering a display layout * loaded from from a layout file * * @see https://docs.joomla.org/Sharing_layouts_across_views_or_extensions_with_JLayout * @since 3.0 */ class JLayoutFile extends JLayoutBase { /** * @var string Dot separated path to the layout file, relative to base path * @since 3.0 */ protected $layoutId = ''; /** * @var string Base path to use when loading layout files * @since 3.0 */ protected $basePath = null; /** * @var string Full path to actual layout files, after possible template override check * @since 3.0.3 */ protected $fullPath = null; /** * Paths to search for layouts * * @var array * @since 3.2 */ protected $includePaths = array(); /** * Method to instantiate the file-based layout. * * @param string $layoutId Dot separated path to the layout file, relative to base path * @param string $basePath Base path to use when loading layout files * @param mixed $options Optional custom options to load. Registry or array format [@since 3.2] * * @since 3.0 */ public function __construct($layoutId, $basePath = null, $options = null) { // Initialise / Load options $this->setOptions($options); // Main properties $this->setLayout($layoutId); $this->basePath = $basePath; // Init Enviroment $this->setComponent($this->options->get('component', 'auto')); $this->setClient($this->options->get('client', 'auto')); } /** * Method to render the layout. * * @param object $displayData Object which properties are used inside the layout file to build displayed output * * @return string The necessary HTML to display the layout * * @since 3.0 */ public function render($displayData) { $layoutOutput = ''; // Check possible overrides, and build the full path to layout file $path = $this->getPath(); if ($this->options->get('debug', false)) { echo "<pre>" . $this->renderDebugMessages() . "</pre>"; } // If there exists such a layout file, include it and collect its output if (!empty($path)) { ob_start(); include $path; $layoutOutput = ob_get_contents(); ob_end_clean(); } return $layoutOutput; } /** * Method to finds the full real file path, checking possible overrides * * @return string The full path to the layout file * * @since 3.0 */ protected function getPath() { JLoader::import('joomla.filesystem.path'); if (is_null($this->fullPath) && !empty($this->layoutId)) { $this->addDebugMessage('<strong>Layout:</strong> ' . $this->layoutId); // Refresh paths $this->refreshIncludePaths(); $this->addDebugMessage('<strong>Include Paths:</strong> ' . print_r($this->includePaths, true)); $suffixes = $this->options->get('suffixes', array()); // Search for suffixed versions. Example: tags.j31.php if (!empty($suffixes)) { $this->addDebugMessage('<strong>Suffixes:</strong> ' . print_r($suffixes, true)); foreach ($suffixes as $suffix) { $rawPath = str_replace('.', '/', $this->layoutId) . '.' . $suffix . '.php'; $this->addDebugMessage('<strong>Searching layout for:</strong> ' . $rawPath); if ($this->fullPath = JPath::find($this->includePaths, $rawPath)) { $this->addDebugMessage('<strong>Found layout:</strong> ' . $this->fullPath); return $this->fullPath; } } } // Standard version $rawPath = str_replace('.', '/', $this->layoutId) . '.php'; $this->addDebugMessage('<strong>Searching layout for:</strong> ' . $rawPath); $this->fullPath = JPath::find($this->includePaths, $rawPath); if ($this->fullPath) { $this->addDebugMessage('<strong>Found layout:</strong> ' . $this->fullPath); } } return $this->fullPath; } /** * Add one path to include in layout search. Proxy of addIncludePaths() * * @param string $path The path to search for layouts * * @return void * * @since 3.2 */ public function addIncludePath($path) { $this->addIncludePaths($path); } /** * Add one or more paths to include in layout search * * @param string $paths The path or array of paths to search for layouts * * @return void * * @since 3.2 */ public function addIncludePaths($paths) { if (!empty($paths)) { if (is_array($paths)) { $this->includePaths = array_unique(array_merge($paths, $this->includePaths)); } else { array_unshift($this->includePaths, $paths); } } } /** * Remove one path from the layout search * * @param string $path The path to remove from the layout search * * @return void * * @since 3.2 */ public function removeIncludePath($path) { $this->removeIncludePaths($path); } /** * Remove one or more paths to exclude in layout search * * @param string $paths The path or array of paths to remove for the layout search * * @return void * * @since 3.2 */ public function removeIncludePaths($paths) { if (!empty($paths)) { $paths = (array) $paths; $this->includePaths = array_diff($this->includePaths, $paths); } } /** * Validate that the active component is valid * * @param string $option URL Option of the component. Example: com_content * * @return boolean * * @since 3.2 */ protected function validComponent($option = null) { // By default we will validate the active component $component = ($option !== null) ? $option : $this->options->get('component', null); if (!empty($component)) { // Valid option format if (substr_count($component, 'com_')) { // Latest check: component exists and is enabled return JComponentHelper::isEnabled($component); } } return false; } /** * Method to change the component where search for layouts * * @param string $option URL Option of the component. Example: com_content * * @return mixed Component option string | null for none * * @since 3.2 */ public function setComponent($option) { $component = null; switch ((string) $option) { case 'none': $component = null; break; case 'auto': $component = JApplicationHelper::getComponentName(); break; default: $component = $option; break; } // Extra checks if (!$this->validComponent($component)) { $component = null; } $this->options->set('component', $component); // Refresh include paths $this->refreshIncludePaths(); } /** * Function to initialise the application client * * @param mixed $client Frontend: 'site' or 0 | Backend: 'admin' or 1 * * @return void * * @since 3.2 */ public function setClient($client) { // Force string conversion to avoid unexpected states switch ((string) $client) { case 'site': case '0': $client = 0; break; case 'admin': case '1': $client = 1; break; default: $client = (int) JFactory::getApplication()->isAdmin(); break; } $this->options->set('client', $client); // Refresh include paths $this->refreshIncludePaths(); } /** * Change the layout * * @param string $layoutId Layout to render * * @return void * * @since 3.2 */ public function setLayout($layoutId) { $this->layoutId = $layoutId; $this->fullPath = null; } /** * Refresh the list of include paths * * @return void * * @since 3.2 */ protected function refreshIncludePaths() { // Reset includePaths $this->includePaths = array(); // (1 - lower priority) Frontend base layouts $this->addIncludePaths(JPATH_ROOT . '/layouts'); // (2) Standard Joomla! layouts overriden $this->addIncludePaths(JPATH_THEMES . '/' . JFactory::getApplication()->getTemplate() . '/html/layouts'); // Component layouts & overrides if exist $component = $this->options->get('component', null); if (!empty($component)) { // (3) Component path if ($this->options->get('client') == 0) { $this->addIncludePaths(JPATH_SITE . '/components/' . $component . '/layouts'); } else { $this->addIncludePaths(JPATH_ADMINISTRATOR . '/components/' . $component . '/layouts'); } // (4) Component template overrides path $this->addIncludePath(JPATH_THEMES . '/' . JFactory::getApplication()->getTemplate() . '/html/layouts/' . $component); } // (5 - highest priority) Received a custom high priority path ? if (!is_null($this->basePath)) { $this->addIncludePath(rtrim($this->basePath, DIRECTORY_SEPARATOR)); } } /** * Change the debug mode * * @param boolean $debug Enable / Disable debug * * @return void * * @since 3.2 */ public function setDebug($debug) { $this->options->set('debug', (boolean) $debug); } /** * Render a layout with the same include paths & options * * @param object $layoutId Object which properties are used inside the layout file to build displayed output * @param mixed $displayData Data to be rendered * * @return string The necessary HTML to display the layout * * @since 3.2 */ public function sublayout($layoutId, $displayData) { // Sublayouts are searched in a subfolder with the name of the current layout if (!empty($this->layoutId)) { $layoutId = $this->layoutId . '.' . $layoutId; } $sublayout = new static($layoutId, $this->basePath, $this->options); $sublayout->includePaths = $this->includePaths; return $sublayout->render($displayData); } } PK���\ʕM�lllibraries/cms/layout/base.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Layout * * @copyright Copyright (C) 2005 - 2015 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\Registry\Registry; /** * Base class for rendering a display layout * * @see https://docs.joomla.org/Sharing_layouts_across_views_or_extensions_with_JLayout * @since 3.0 */ class JLayoutBase implements JLayout { /** * Options object * * @var Registry * @since 3.2 */ protected $options = null; /** * Debug information messages * * @var array * @since 3.2 */ protected $debugMessages = array(); /** * Set the options * * @param array|Registry $options Array / Registry object with the options to load * * @return JLayoutBase Instance of $this to allow chaining. * * @since 3.2 */ public function setOptions($options = null) { // Received Registry if ($options instanceof Registry) { $this->options = $options; } // Received array elseif (is_array($options)) { $this->options = new Registry($options); } else { $this->options = new Registry; } return $this; } /** * Get the options * * @return Registry Object with the options * * @since 3.2 */ public function getOptions() { // Always return a Registry instance if (!($this->options instanceof Registry)) { $this->resetOptions(); } return $this->options; } /** * Function to empty all the options * * @return JLayoutBase Instance of $this to allow chaining. * * @since 3.2 */ public function resetOptions() { return $this->setOptions(null); } /** * Method to escape output. * * @param string $output The output to escape. * * @return string The escaped output. * * @since 3.0 */ public function escape($output) { return htmlspecialchars($output, ENT_COMPAT, 'UTF-8'); } /** * Get the debug messages array * * @return array * * @since 3.2 */ public function getDebugMessages() { return $this->debugMessages; } /** * Method to render the layout. * * @param object $displayData Object which properties are used inside the layout file to build displayed output * * @return string The necessary HTML to display the layout * * @since 3.0 */ public function render($displayData) { return ''; } /** * Render the list of debug messages * * @return string Output text/HTML code * * @since 3.2 */ public function renderDebugMessages() { return implode($this->debugMessages, "\n"); } /** * Add a debug message to the debug messages array * * @param string $message Message to save * * @return void * * @since 3.2 */ public function addDebugMessage($message) { $this->debugMessages[] = $message; } } PK���\�Ps�33!libraries/cms/version/version.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Version * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Version information class for the Joomla CMS. * * @since 1.0 */ final class JVersion { /** @var string Product name. */ public $PRODUCT = 'Joomla!'; /** @var string Release version. */ public $RELEASE = '3.4'; /** @var string Maintenance version. */ public $DEV_LEVEL = '8'; /** @var string Development STATUS. */ public $DEV_STATUS = 'Stable'; /** @var string Build number. */ public $BUILD = ''; /** @var string Code name. */ public $CODENAME = 'Ember'; /** @var string Release date. */ public $RELDATE = '24-December-2015'; /** @var string Release time. */ public $RELTIME = '19:30'; /** @var string Release timezone. */ public $RELTZ = 'GMT'; /** @var string Copyright Notice. */ public $COPYRIGHT = 'Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.'; /** @var string Link text. */ public $URL = '<a href="http://www.joomla.org">Joomla!</a> is Free Software released under the GNU General Public License.'; /** * Check if we are in development mode * * @return boolean * * @since 3.4.3 */ public function isInDevelopmentState() { return strtolower($this->DEV_STATUS) != 'stable'; } /** * Compares two a "PHP standardized" version number against the current Joomla version. * * @param string $minimum The minimum version of the Joomla which is compatible. * * @return boolean True if the version is compatible. * * @see http://www.php.net/version_compare * @since 1.0 */ public function isCompatible($minimum) { return version_compare(JVERSION, $minimum, 'ge'); } /** * Method to get the help file version. * * @return string Version suffix for help files. * * @since 1.0 */ public function getHelpVersion() { return '.' . str_replace('.', '', $this->RELEASE); } /** * Gets a "PHP standardized" version string for the current Joomla. * * @return string Version string. * * @since 1.5 */ public function getShortVersion() { return $this->RELEASE . '.' . $this->DEV_LEVEL; } /** * Gets a version string for the current Joomla with all release information. * * @return string Complete version string. * * @since 1.5 */ public function getLongVersion() { return $this->PRODUCT . ' ' . $this->RELEASE . '.' . $this->DEV_LEVEL . ' ' . $this->DEV_STATUS . ' [ ' . $this->CODENAME . ' ] ' . $this->RELDATE . ' ' . $this->RELTIME . ' ' . $this->RELTZ; } /** * Returns the user agent. * * @param string $component Name of the component. * @param bool $mask Mask as Mozilla/5.0 or not. * @param bool $add_version Add version afterwards to component. * * @return string User Agent. * * @since 1.0 */ public function getUserAgent($component = null, $mask = false, $add_version = true) { if ($component === null) { $component = 'Framework'; } if ($add_version) { $component .= '/' . $this->RELEASE; } // If masked pretend to look like Mozilla 5.0 but still identify ourselves. if ($mask) { return 'Mozilla/5.0 ' . $this->PRODUCT . '/' . $this->RELEASE . '.' . $this->DEV_LEVEL . ($component ? ' ' . $component : ''); } else { return $this->PRODUCT . '/' . $this->RELEASE . '.' . $this->DEV_LEVEL . ($component ? ' ' . $component : ''); } } /** * Generate a media version string for assets * Public to allow third party developers to use it * * @return string * * @since 3.2 */ public function generateMediaVersion() { $date = new JDate; $config = JFactory::getConfig(); return md5($this->getLongVersion() . $config->get('secret') . $date->toSql()); } /** * Gets a media version which is used to append to Joomla core media files. * * This media version is used to append to Joomla core media in order to trick browsers into * reloading the CSS and JavaScript, because they think the files are renewed. * The media version is renewed after Joomla core update, install, discover_install and uninstallation. * * @return string The media version. * * @since 3.2 */ public function getMediaVersion() { // Load the media version and cache it for future use static $mediaVersion = null; if ($mediaVersion === null) { $config = JFactory::getConfig(); $debugEnabled = $config->get('debug', 0); // Get the joomla library params $params = JLibraryHelper::getParams('joomla'); // Get the media version $mediaVersion = $params->get('mediaversion', ''); // Refresh assets in debug mode or when the media version is not set if ($debugEnabled || empty($mediaVersion)) { $mediaVersion = $this->generateMediaVersion(); $this->setMediaVersion($mediaVersion); } } return $mediaVersion; } /** * Function to refresh the media version * * @return JVersion Instance of $this to allow chaining. * * @since 3.2 */ public function refreshMediaVersion() { $newMediaVersion = $this->generateMediaVersion(); return $this->setMediaVersion($newMediaVersion); } /** * Sets the media version which is used to append to Joomla core media files. * * @param string $mediaVersion The media version. * * @return JVersion Instance of $this to allow chaining. * * @since 3.2 */ public function setMediaVersion($mediaVersion) { // Do not allow empty media versions if (!empty($mediaVersion)) { // Get library parameters $params = JLibraryHelper::getParams('joomla'); $params->set('mediaversion', $mediaVersion); // Save modified params JLibraryHelper::saveParams('joomla', $params); } return $this; } } PK���\�1M^�C�Clibraries/cms/router/site.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Router * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Class to create and parse routes for the site application * * @since 1.5 */ class JRouterSite extends JRouter { /** * Component-router objects * * @var array * @since 3.3 */ protected $componentRouters = array(); /** * Current JApplication-Object * * @var JApplicationCms * @since 3.4 */ protected $app; /** * Current JMenu-Object * * @var JMenu * @since 3.4 */ protected $menu; /** * Class constructor * * @param array $options Array of options * @param JApplicationCms $app JApplicationCms Object * @param JMenu $menu JMenu object * * @since 3.4 */ public function __construct($options = array(), JApplicationCms $app = null, JMenu $menu = null) { parent::__construct($options); $this->app = $app ? $app : JApplicationCms::getInstance('site'); $this->menu = $menu ? $menu : $this->app->getMenu(); } /** * Function to convert a route to an internal URI * * @param JUri &$uri The uri. * * @return array * * @since 1.5 */ public function parse(&$uri) { $vars = array(); if ($this->app->get('force_ssl') == 2 && strtolower($uri->getScheme()) != 'https') { // Forward to https $uri->setScheme('https'); $this->app->redirect((string) $uri, 301); } // Get the path // Decode URL to convert percent-encoding to unicode so that strings match when routing. $path = urldecode($uri->getPath()); // Remove the base URI path. $path = substr_replace($path, '', 0, strlen(JUri::base(true))); // Check to see if a request to a specific entry point has been made. if (preg_match("#.*?\.php#u", $path, $matches)) { // Get the current entry point path relative to the site path. $scriptPath = realpath($_SERVER['SCRIPT_FILENAME'] ? $_SERVER['SCRIPT_FILENAME'] : str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED'])); $relativeScriptPath = str_replace('\\', '/', str_replace(JPATH_SITE, '', $scriptPath)); // If a php file has been found in the request path, check to see if it is a valid file. // Also verify that it represents the same file from the server variable for entry script. if (file_exists(JPATH_SITE . $matches[0]) && ($matches[0] == $relativeScriptPath)) { // Remove the entry point segments from the request path for proper routing. $path = str_replace($matches[0], '', $path); } } // Identify format if ($this->_mode == JROUTER_MODE_SEF) { if ($this->app->get('sef_suffix') && !(substr($path, -9) == 'index.php' || substr($path, -1) == '/')) { if ($suffix = pathinfo($path, PATHINFO_EXTENSION)) { $vars['format'] = $suffix; } } } // Set the route $uri->setPath(trim($path, '/')); $vars += parent::parse($uri); return $vars; } /** * Function to convert an internal URI to a route * * @param string $url The internal URL * * @return string The absolute search engine friendly URL * * @since 1.5 */ public function build($url) { $uri = parent::build($url); // Get the path data $route = $uri->getPath(); // Add the suffix to the uri if ($this->_mode == JROUTER_MODE_SEF && $route) { if ($this->app->get('sef_suffix') && !(substr($route, -9) == 'index.php' || substr($route, -1) == '/')) { if ($format = $uri->getVar('format', 'html')) { $route .= '.' . $format; $uri->delVar('format'); } } if ($this->app->get('sef_rewrite')) { // Transform the route if ($route == 'index.php') { $route = ''; } else { $route = str_replace('index.php/', '', $route); } } } // Add basepath to the uri $uri->setPath(JUri::base(true) . '/' . $route); return $uri; } /** * Function to convert a raw route to an internal URI * * @param JUri &$uri The raw route * * @return array * * @since 3.2 * @deprecated 4.0 Attach your logic as rule to the main parse stage */ protected function parseRawRoute(&$uri) { $vars = array(); // Handle an empty URL (special case) if (!$uri->getVar('Itemid') && !$uri->getVar('option')) { $item = $this->menu->getDefault($this->app->getLanguage()->getTag()); if (!is_object($item)) { // No default item set return $vars; } // Set the information in the request $vars = $item->query; // Get the itemid $vars['Itemid'] = $item->id; // Set the active menu item $this->menu->setActive($vars['Itemid']); return $vars; } // Get the variables from the uri $this->setVars($uri->getQuery(true)); // Get the itemid, if it hasn't been set force it to null $this->setVar('Itemid', $this->app->input->getInt('Itemid', null)); // Only an Itemid OR if filter language plugin set? Get the full information from the itemid if (count($this->getVars()) == 1 || ($this->app->getLanguageFilter() && count($this->getVars()) == 2 )) { $item = $this->menu->getItem($this->getVar('Itemid')); if ($item !== null && is_array($item->query)) { $vars = $vars + $item->query; } } // Set the active menu item $this->menu->setActive($this->getVar('Itemid')); return $vars; } /** * Function to convert a sef route to an internal URI * * @param JUri &$uri The sef URI * * @return string Internal URI * * @since 3.2 * @deprecated 4.0 Attach your logic as rule to the main parse stage */ protected function parseSefRoute(&$uri) { $route = $uri->getPath(); // Remove the suffix if ($this->app->get('sef_suffix')) { if ($suffix = pathinfo($route, PATHINFO_EXTENSION)) { $route = str_replace('.' . $suffix, '', $route); } } // Get the variables from the uri $vars = $uri->getQuery(true); // Handle an empty URL (special case) if (empty($route)) { // If route is empty AND option is set in the query, assume it's non-sef url, and parse apropriately if (isset($vars['option']) || isset($vars['Itemid'])) { return $this->parseRawRoute($uri); } $item = $this->menu->getDefault($this->app->getLanguage()->getTag()); // If user not allowed to see default menu item then avoid notices if (is_object($item)) { // Set the information in the request $vars = $item->query; // Get the itemid $vars['Itemid'] = $item->id; // Set the active menu item $this->menu->setActive($vars['Itemid']); $this->setVars($vars); } return $vars; } // Parse the application route $segments = explode('/', $route); if (count($segments) > 1 && $segments[0] == 'component') { $vars['option'] = 'com_' . $segments[1]; $vars['Itemid'] = null; $route = implode('/', array_slice($segments, 2)); } else { // Get menu items. $items = $this->menu->getMenu(); $found = false; $route_lowercase = JString::strtolower($route); $lang_tag = $this->app->getLanguage()->getTag(); // Iterate through all items and check route matches. foreach ($items as $item) { if ($item->route && JString::strpos($route_lowercase . '/', $item->route . '/') === 0 && $item->type != 'menulink') { // Usual method for non-multilingual site. if (!$this->app->getLanguageFilter()) { // Exact route match. We can break iteration because exact item was found. if ($item->route == $route_lowercase) { $found = $item; break; } // Partial route match. Item with highest level takes priority. if (!$found || $found->level < $item->level) { $found = $item; } } // Multilingual site. elseif ($item->language == '*' || $item->language == $lang_tag) { // Exact route match. if ($item->route == $route_lowercase) { $found = $item; // Break iteration only if language is matched. if ($item->language == $lang_tag) { break; } } // Partial route match. Item with highest level or same language takes priority. if (!$found || $found->level < $item->level || $item->language == $lang_tag) { $found = $item; } } } } if (!$found) { $found = $this->menu->getDefault($lang_tag); } else { $route = substr($route, strlen($found->route)); if ($route) { $route = substr($route, 1); } } if ($found) { $vars['Itemid'] = $found->id; $vars['option'] = $found->component; } } // Set the active menu item if (isset($vars['Itemid'])) { $this->menu->setActive($vars['Itemid']); } // Set the variables $this->setVars($vars); // Parse the component route if (!empty($route) && isset($this->_vars['option'])) { $segments = explode('/', $route); if (empty($segments[0])) { array_shift($segments); } // Handle component route $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $this->_vars['option']); if (count($segments)) { $crouter = $this->getComponentRouter($component); $vars = $crouter->parse($segments); $this->setVars($vars); } } else { // Set active menu item if ($item = $this->menu->getActive()) { $vars = $item->query; } } return $vars; } /** * Function to build a raw route * * @param JUri &$uri The internal URL * * @return string Raw Route * * @since 3.2 * @deprecated 4.0 Attach your logic as rule to the main build stage */ protected function buildRawRoute(&$uri) { // Get the query data $query = $uri->getQuery(true); if (!isset($query['option'])) { return; } $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $query['option']); $crouter = $this->getComponentRouter($component); $query = $crouter->preprocess($query); $uri->setQuery($query); } /** * Function to build a sef route * * @param JUri &$uri The internal URL * * @return void * * @since 1.5 * @deprecated 4.0 Attach your logic as rule to the main build stage * @codeCoverageIgnore */ protected function _buildSefRoute(&$uri) { $this->buildSefRoute($uri); } /** * Function to build a sef route * * @param JUri &$uri The uri * * @return void * * @since 3.2 * @deprecated 4.0 Attach your logic as rule to the main build stage */ protected function buildSefRoute(&$uri) { // Get the route $route = $uri->getPath(); // Get the query data $query = $uri->getQuery(true); if (!isset($query['option'])) { return; } // Build the component route $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $query['option']); $tmp = ''; $itemID = !empty($query['Itemid']) ? $query['Itemid'] : null; $crouter = $this->getComponentRouter($component); $parts = $crouter->build($query); $result = implode('/', $parts); $tmp = ($result != "") ? $result : ''; // Build the application route $built = false; if (!empty($query['Itemid'])) { $item = $this->menu->getItem($query['Itemid']); if (is_object($item) && $query['option'] == $item->component) { if (!$item->home) { $tmp = !empty($tmp) ? $item->route . '/' . $tmp : $item->route; } $built = true; } } if (empty($query['Itemid']) && !empty($itemID)) { $query['Itemid'] = $itemID; } if (!$built) { $tmp = 'component/' . substr($query['option'], 4) . '/' . $tmp; } if ($tmp) { $route .= '/' . $tmp; } // Unset unneeded query information if (isset($item) && $query['option'] == $item->component) { unset($query['Itemid']); } unset($query['option']); // Set query again in the URI $uri->setQuery($query); $uri->setPath($route); } /** * Process the parsed router variables based on custom defined rules * * @param JUri &$uri The URI to parse * @param string $stage The stage that should be processed. * Possible values: 'preprocess', 'postprocess' * and '' for the main parse stage * * @return array The array of processed URI variables * * @since 3.2 */ protected function processParseRules(&$uri, $stage = self::PROCESS_DURING) { // Process the attached parse rules $vars = parent::processParseRules($uri, $stage); if ($stage == self::PROCESS_DURING) { // Process the pagination support if ($this->_mode == JROUTER_MODE_SEF) { if ($start = $uri->getVar('start')) { $uri->delVar('start'); $vars['limitstart'] = $start; } } } return $vars; } /** * Process the build uri query data based on custom defined rules * * @param JUri &$uri The URI * @param string $stage The stage that should be processed. * Possible values: 'preprocess', 'postprocess' * and '' for the main build stage * * @return void * * @since 3.2 * @deprecated 4.0 The special logic should be implemented as rule */ protected function processBuildRules(&$uri, $stage = self::PROCESS_DURING) { if ($stage == self::PROCESS_DURING) { // Make sure any menu vars are used if no others are specified $query = $uri->getQuery(true); if ($this->_mode != 1 && isset($query['Itemid']) && (count($query) == 2 || (count($query) == 3 && isset($query['lang'])))) { // Get the active menu item $itemid = $uri->getVar('Itemid'); $lang = $uri->getVar('lang'); $item = $this->menu->getItem($itemid); if ($item) { $uri->setQuery($item->query); } $uri->setVar('Itemid', $itemid); if ($lang) { $uri->setVar('lang', $lang); } } } // Process the attached build rules parent::processBuildRules($uri, $stage); if ($stage == self::PROCESS_BEFORE) { // Get the query data $query = $uri->getQuery(true); if (!isset($query['option'])) { return; } // Build the component route $component = preg_replace('/[^A-Z0-9_\.-]/i', '', $query['option']); $router = $this->getComponentRouter($component); $query = $router->preprocess($query); $uri->setQuery($query); } if ($stage == self::PROCESS_DURING) { // Get the path data $route = $uri->getPath(); if ($this->_mode == JROUTER_MODE_SEF && $route) { if ($limitstart = $uri->getVar('limitstart')) { $uri->setVar('start', (int) $limitstart); $uri->delVar('limitstart'); } } $uri->setPath($route); } } /** * Create a uri based on a full or partial url string * * @param string $url The URI * * @return JUri * * @since 3.2 */ protected function createUri($url) { // Create the URI $uri = parent::createUri($url); // Get the itemid form the URI $itemid = $uri->getVar('Itemid'); if (is_null($itemid)) { if ($option = $uri->getVar('option')) { $item = $this->menu->getItem($this->getVar('Itemid')); if (isset($item) && $item->component == $option) { $uri->setVar('Itemid', $item->id); } } else { if ($option = $this->getVar('option')) { $uri->setVar('option', $option); } if ($itemid = $this->getVar('Itemid')) { $uri->setVar('Itemid', $itemid); } } } else { if (!$uri->getVar('option')) { if ($item = $this->menu->getItem($itemid)) { $uri->setVar('option', $item->component); } } } return $uri; } /** * Get component router * * @param string $component Name of the component including com_ prefix * * @return JComponentRouterInterface Component router * * @since 3.3 */ public function getComponentRouter($component) { if (!isset($this->componentRouters[$component])) { $compname = ucfirst(substr($component, 4)); $class = $compname . 'Router'; if (!class_exists($class)) { // Use the component routing handler if it exists $path = JPATH_SITE . '/components/' . $component . '/router.php'; // Use the custom routing handler if it exists if (file_exists($path)) { require_once $path; } } if (class_exists($class)) { $reflection = new ReflectionClass($class); if (in_array('JComponentRouterInterface', $reflection->getInterfaceNames())) { $this->componentRouters[$component] = new $class($this->app, $this->menu); } } if (!isset($this->componentRouters[$component])) { $this->componentRouters[$component] = new JComponentRouterLegacy($compname); } } return $this->componentRouters[$component]; } /** * Set a router for a component * * @param string $component Component name with com_ prefix * @param object $router Component router * * @return boolean True if the router was accepted, false if not * * @since 3.3 */ public function setComponentRouter($component, $router) { $reflection = new ReflectionClass($router); if (in_array('JComponentRouterInterface', $reflection->getInterfaceNames())) { $this->componentRouters[$component] = $router; return true; } else { return false; } } } PK���\�{����&libraries/cms/router/administrator.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Router * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Class to create and parse routes * * @since 1.5 */ class JRouterAdministrator extends JRouter { /** * Function to convert a route to an internal URI. * * @param JUri &$uri The uri. * * @return array * * @since 1.5 */ public function parse(&$uri) { return array(); } /** * Function to convert an internal URI to a route * * @param string $url The internal URL * * @return string The absolute search engine friendly URL * * @since 1.5 */ public function build($url) { // Create the URI object $uri = parent::build($url); // Get the path data $route = $uri->getPath(); // Add basepath to the uri $uri->setPath(JUri::base(true) . '/' . $route); return $uri; } } PK���\��F?F?libraries/cms/router/router.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Router * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Mask for the raw routing mode * * @deprecated 4.0 */ const JROUTER_MODE_RAW = 0; /** * Mask for the SEF routing mode * * @deprecated 4.0 */ const JROUTER_MODE_SEF = 1; /** * Class to create and parse routes * * @since 1.5 */ class JRouter { /** * Mask for the before process stage * * @var string * @since 3.4 */ const PROCESS_BEFORE = 'preprocess'; /** * Mask for the during process stage * * @var string * @since 3.4 */ const PROCESS_DURING = ''; /** * Mask for the after process stage * * @var string * @since 3.4 */ const PROCESS_AFTER = 'postprocess'; /** * The rewrite mode * * @var integer * @since 1.5 */ protected $mode = null; /** * The rewrite mode * * @var integer * @since 1.5 * @deprecated 4.0 Will convert to $mode */ protected $_mode = null; /** * An array of variables * * @var array * @since 1.5 */ protected $vars = array(); /** * An array of variables * * @var array * @since 1.5 * @deprecated 4.0 Will convert to $vars */ protected $_vars = array(); /** * An array of rules * * @var array * @since 1.5 */ protected $rules = array( 'buildpreprocess' => array(), 'build' => array(), 'buildpostprocess' => array(), 'parsepreprocess' => array(), 'parse' => array(), 'parsepostprocess' => array() ); /** * An array of rules * * @var array * @since 1.5 * @deprecated 4.0 Will convert to $rules */ protected $_rules = array( 'buildpreprocess' => array(), 'build' => array(), 'buildpostprocess' => array(), 'parsepreprocess' => array(), 'parse' => array(), 'parsepostprocess' => array() ); /** * Caching of processed URIs * * @var array * @since 3.3 */ protected $cache = array(); /** * JRouter instances container. * * @var array * @since 1.7 */ protected static $instances = array(); /** * Class constructor * * @param array $options Array of options * * @since 1.5 */ public function __construct($options = array()) { if (array_key_exists('mode', $options)) { $this->_mode = $options['mode']; } else { $this->_mode = JROUTER_MODE_RAW; } } /** * Returns the global JRouter object, only creating it if it * doesn't already exist. * * @param string $client The name of the client * @param array $options An associative array of options * * @return JRouter A JRouter object. * * @since 1.5 * @throws RuntimeException */ public static function getInstance($client, $options = array()) { if (empty(self::$instances[$client])) { // Create a JRouter object $classname = 'JRouter' . ucfirst($client); if (!class_exists($classname)) { // @deprecated 4.0 Everything in this block is deprecated but the warning is only logged after the file_exists // Load the router object $info = JApplicationHelper::getClientInfo($client, true); if (is_object($info)) { $path = $info->path . '/includes/router.php'; if (file_exists($path)) { JLog::add('Non-autoloadable JRouter subclasses are deprecated, support will be removed in 4.0.', JLog::WARNING, 'deprecated'); include_once $path; } } } if (class_exists($classname)) { self::$instances[$client] = new $classname($options); } else { throw new RuntimeException(JText::sprintf('JLIB_APPLICATION_ERROR_ROUTER_LOAD', $client), 500); } } return self::$instances[$client]; } /** * Function to convert a route to an internal URI * * @param JUri &$uri The uri. * * @return array * * @since 1.5 */ public function parse(&$uri) { // Do the preprocess stage of the URL build process $vars = $this->processParseRules($uri, self::PROCESS_BEFORE); // Process the parsed variables based on custom defined rules // This is the main parse stage $vars += $this->_processParseRules($uri); // Parse RAW URL if ($this->_mode == JROUTER_MODE_RAW) { $vars += $this->_parseRawRoute($uri); } // Parse SEF URL if ($this->_mode == JROUTER_MODE_SEF) { $vars += $this->_parseSefRoute($uri); } // Do the postprocess stage of the URL build process $vars += $this->processParseRules($uri, self::PROCESS_AFTER); return array_merge($this->getVars(), $vars); } /** * Function to convert an internal URI to a route * * @param string $url The internal URL or an associative array * * @return string The absolute search engine friendly URL * * @since 1.5 */ public function build($url) { $key = md5(serialize($url)); if (isset($this->cache[$key])) { return clone $this->cache[$key]; } // Create the URI object $uri = $this->createUri($url); // Do the preprocess stage of the URL build process $this->processBuildRules($uri, self::PROCESS_BEFORE); // Process the uri information based on custom defined rules. // This is the main build stage $this->_processBuildRules($uri); // Build RAW URL if ($this->_mode == JROUTER_MODE_RAW) { $this->_buildRawRoute($uri); } // Build SEF URL : mysite/route/index.php?var=x if ($this->_mode == JROUTER_MODE_SEF) { $this->_buildSefRoute($uri); } // Do the postprocess stage of the URL build process $this->processBuildRules($uri, self::PROCESS_AFTER); $this->cache[$key] = clone $uri; return $uri; } /** * Get the router mode * * @return integer * * @since 1.5 */ public function getMode() { return $this->_mode; } /** * Set the router mode * * @param integer $mode The routing mode. * * @return void * * @since 1.5 */ public function setMode($mode) { $this->_mode = $mode; } /** * Set a router variable, creating it if it doesn't exist * * @param string $key The name of the variable * @param mixed $value The value of the variable * @param boolean $create If True, the variable will be created if it doesn't exist yet * * @return void * * @since 1.5 */ public function setVar($key, $value, $create = true) { if ($create || array_key_exists($key, $this->_vars)) { $this->_vars[$key] = $value; } } /** * Set the router variable array * * @param array $vars An associative array with variables * @param boolean $merge If True, the array will be merged instead of overwritten * * @return void * * @since 1.5 */ public function setVars($vars = array(), $merge = true) { if ($merge) { $this->_vars = array_merge($this->_vars, $vars); } else { $this->_vars = $vars; } } /** * Get a router variable * * @param string $key The name of the variable * * @return mixed Value of the variable * * @since 1.5 */ public function getVar($key) { $result = null; if (isset($this->_vars[$key])) { $result = $this->_vars[$key]; } return $result; } /** * Get the router variable array * * @return array An associative array of router variables * * @since 1.5 */ public function getVars() { return $this->_vars; } /** * Attach a build rule * * @param callback $callback The function to be called * @param string $stage The stage of the build process that * this should be added to. Possible values: * 'preprocess', '' for the main build process, * 'postprocess' * * @return void * * @since 1.5 */ public function attachBuildRule($callback, $stage = self::PROCESS_DURING) { if (!array_key_exists('build' . $stage, $this->_rules)) { throw new InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); } $this->_rules['build' . $stage][] = $callback; } /** * Attach a parse rule * * @param callback $callback The function to be called. * @param string $stage The stage of the parse process that * this should be added to. Possible values: * 'preprocess', '' for the main parse process, * 'postprocess' * * @return void * * @since 1.5 */ public function attachParseRule($callback, $stage = self::PROCESS_DURING) { if (!array_key_exists('parse' . $stage, $this->_rules)) { throw new InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); } $this->_rules['parse' . $stage][] = $callback; } /** * Function to convert a raw route to an internal URI * * @param JUri &$uri The raw route * * @return boolean * * @since 1.5 * @deprecated 4.0 Attach your logic as rule to the main parse stage */ protected function _parseRawRoute(&$uri) { return $this->parseRawRoute($uri); } /** * Function to convert a raw route to an internal URI * * @param JUri &$uri The raw route * * @return array Array of variables * * @since 3.2 * @deprecated 4.0 Attach your logic as rule to the main parse stage */ protected function parseRawRoute(&$uri) { return array(); } /** * Function to convert a sef route to an internal URI * * @param JUri &$uri The sef URI * * @return string Internal URI * * @since 1.5 * @deprecated 4.0 Attach your logic as rule to the main parse stage */ protected function _parseSefRoute(&$uri) { return $this->parseSefRoute($uri); } /** * Function to convert a sef route to an internal URI * * @param JUri &$uri The sef URI * * @return array Array of variables * * @since 3.2 * @deprecated 4.0 Attach your logic as rule to the main parse stage */ protected function parseSefRoute(&$uri) { return array(); } /** * Function to build a raw route * * @param JUri &$uri The internal URL * * @return string Raw Route * * @since 1.5 * @deprecated 4.0 Attach your logic as rule to the main build stage */ protected function _buildRawRoute(&$uri) { return $this->buildRawRoute($uri); } /** * Function to build a raw route * * @param JUri &$uri The internal URL * * @return string Raw Route * * @since 3.2 * @deprecated 4.0 Attach your logic as rule to the main build stage */ protected function buildRawRoute(&$uri) { } /** * Function to build a sef route * * @param JUri &$uri The uri * * @return string The SEF route * * @since 1.5 * @deprecated 4.0 Attach your logic as rule to the main build stage */ protected function _buildSefRoute(&$uri) { return $this->buildSefRoute($uri); } /** * Function to build a sef route * * @param JUri &$uri The uri * * @return string The SEF route * * @since 3.2 * @deprecated 4.0 Attach your logic as rule to the main build stage */ protected function buildSefRoute(&$uri) { } /** * Process the parsed router variables based on custom defined rules * * @param JUri &$uri The URI to parse * * @return array The array of processed URI variables * * @since 1.5 * @deprecated 4.0 Use processParseRules() instead */ protected function _processParseRules(&$uri) { return $this->processParseRules($uri); } /** * Process the parsed router variables based on custom defined rules * * @param JUri &$uri The URI to parse * @param string $stage The stage that should be processed. * Possible values: 'preprocess', 'postprocess' * and '' for the main parse stage * * @return array The array of processed URI variables * * @since 3.2 */ protected function processParseRules(&$uri, $stage = self::PROCESS_DURING) { if (!array_key_exists('parse' . $stage, $this->_rules)) { throw new InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); } $vars = array(); foreach ($this->_rules['parse' . $stage] as $rule) { $vars += (array) call_user_func_array($rule, array(&$this, &$uri)); } return $vars; } /** * Process the build uri query data based on custom defined rules * * @param JUri &$uri The URI * * @return void * * @since 1.5 * @deprecated 4.0 Use processBuildRules() instead */ protected function _processBuildRules(&$uri) { $this->processBuildRules($uri); } /** * Process the build uri query data based on custom defined rules * * @param JUri &$uri The URI * @param string $stage The stage that should be processed. * Possible values: 'preprocess', 'postprocess' * and '' for the main build stage * * @return void * * @since 3.2 */ protected function processBuildRules(&$uri, $stage = self::PROCESS_DURING) { if (!array_key_exists('build' . $stage, $this->_rules)) { throw new InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); } foreach ($this->_rules['build' . $stage] as $rule) { call_user_func_array($rule, array(&$this, &$uri)); } } /** * Create a uri based on a full or partial url string * * @param string $url The URI * * @return JUri * * @since 1.5 * @deprecated 4.0 Use createUri() instead * @codeCoverageIgnore */ protected function _createUri($url) { return $this->createUri($url); } /** * Create a uri based on a full or partial url string * * @param string $url The URI or an associative array * * @return JUri * * @since 3.2 */ protected function createUri($url) { if (!is_array($url) && substr($url, 0, 1) != '&') { return new JUri($url); } $uri = new JUri('index.php'); if (is_string($url)) { $vars = array(); if (strpos($url, '&') !== false) { $url = str_replace('&', '&', $url); } parse_str($url, $vars); } else { $vars = $url; } $vars = array_merge($this->getVars(), $vars); foreach ($vars as $key => $var) { if ($var == "") { unset($vars[$key]); } } $uri->setQuery($vars); return $uri; } /** * Encode route segments * * @param array $segments An array of route segments * * @return array Array of encoded route segments * * @since 1.5 * @deprecated 4.0 This should be performed in the component router instead * @codeCoverageIgnore */ protected function _encodeSegments($segments) { return $this->encodeSegments($segments); } /** * Encode route segments * * @param array $segments An array of route segments * * @return array Array of encoded route segments * * @since 3.2 * @deprecated 4.0 This should be performed in the component router instead */ protected function encodeSegments($segments) { $total = count($segments); for ($i = 0; $i < $total; $i++) { $segments[$i] = str_replace(':', '-', $segments[$i]); } return $segments; } /** * Decode route segments * * @param array $segments An array of route segments * * @return array Array of decoded route segments * * @since 1.5 * @deprecated 4.0 This should be performed in the component router instead * @codeCoverageIgnore */ protected function _decodeSegments($segments) { return $this->decodeSegments($segments); } /** * Decode route segments * * @param array $segments An array of route segments * * @return array Array of decoded route segments * * @since 3.2 * @deprecated 4.0 This should be performed in the component router instead */ protected function decodeSegments($segments) { $total = count($segments); for ($i = 0; $i < $total; $i++) { $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); } return $segments; } } PK���\T�>>libraries/cms/search/helper.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Search * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Helper class for Joomla! Search components * * @since 3.0 */ class JSearchHelper { /** * Method to log search terms to the database * * @param string $term The term being searched * @param string $component The component being used for the search * * @return void * * @since 3.0 */ public static function logSearch($term, $component) { // Initialise our variables $db = JFactory::getDbo(); $query = $db->getQuery(true); $enable_log_searches = JComponentHelper::getParams($component)->get('enabled'); // Sanitise the term for the database $search_term = $db->escape(trim(strtolower($term))); if ($enable_log_searches) { // Query the table to determine if the term has been searched previously $query->select($db->quoteName('hits')) ->from($db->quoteName('#__core_log_searches')) ->where($db->quoteName('search_term') . ' = ' . $db->quote($search_term)); $db->setQuery($query); $hits = intval($db->loadResult()); // Reset the $query object $query->clear(); // Update the table based on the results if ($hits) { $query->update($db->quoteName('#__core_log_searches')) ->set('hits = (hits + 1)') ->where($db->quoteName('search_term') . ' = ' . $db->quote($search_term)); } else { $query->insert($db->quoteName('#__core_log_searches')) ->columns(array($db->quoteName('search_term'), $db->quoteName('hits'))) ->values($db->quote($search_term) . ', 1'); } // Execute the update query $db->setQuery($query); $db->execute(); } } } PK���\*��;�;libraries/cms/module/helper.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Module * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Module helper class * * @since 1.5 */ abstract class JModuleHelper { /** * Get module by name (real, eg 'Breadcrumbs' or folder, eg 'mod_breadcrumbs') * * @param string $name The name of the module * @param string $title The title of the module, optional * * @return object The Module object * * @since 1.5 */ public static function &getModule($name, $title = null) { $result = null; $modules =& static::load(); $total = count($modules); for ($i = 0; $i < $total; $i++) { // Match the name of the module if ($modules[$i]->name == $name || $modules[$i]->module == $name) { // Match the title if we're looking for a specific instance of the module if (!$title || $modules[$i]->title == $title) { // Found it $result = &$modules[$i]; break; } } } // If we didn't find it, and the name is mod_something, create a dummy object if (is_null($result) && substr($name, 0, 4) == 'mod_') { $result = new stdClass; $result->id = 0; $result->title = ''; $result->module = $name; $result->position = ''; $result->content = ''; $result->showtitle = 0; $result->control = ''; $result->params = ''; } return $result; } /** * Get modules by position * * @param string $position The position of the module * * @return array An array of module objects * * @since 1.5 */ public static function &getModules($position) { $position = strtolower($position); $result = array(); $input = JFactory::getApplication()->input; $modules =& static::load(); $total = count($modules); for ($i = 0; $i < $total; $i++) { if ($modules[$i]->position == $position) { $result[] = &$modules[$i]; } } if (count($result) == 0) { if ($input->getBool('tp') && JComponentHelper::getParams('com_templates')->get('template_positions_display')) { $result[0] = static::getModule('mod_' . $position); $result[0]->title = $position; $result[0]->content = $position; $result[0]->position = $position; } } return $result; } /** * Checks if a module is enabled. A given module will only be returned * if it meets the following criteria: it is enabled, it is assigned to * the current menu item or all items, and the user meets the access level * requirements. * * @param string $module The module name * * @return boolean See description for conditions. * * @since 1.5 */ public static function isEnabled($module) { $result = static::getModule($module); return (!is_null($result) && $result->id !== 0); } /** * Render the module. * * @param object $module A module object. * @param array $attribs An array of attributes for the module (probably from the XML). * * @return string The HTML content of the module output. * * @since 1.5 */ public static function renderModule($module, $attribs = array()) { static $chrome; // Check that $module is a valid module object if (!is_object($module) || !isset($module->module) || !isset($module->params)) { if (JDEBUG) { JLog::addLogger(array('text_file' => 'jmodulehelper.log.php'), JLog::ALL, array('modulehelper')); JLog::add('JModuleHelper::renderModule($module) expects a module object', JLog::DEBUG, 'modulehelper'); } return; } if (JDEBUG) { JProfiler::getInstance('Application')->mark('beforeRenderModule ' . $module->module . ' (' . $module->title . ')'); } $app = JFactory::getApplication(); // Record the scope. $scope = $app->scope; // Set scope to component name $app->scope = $module->module; // Get module parameters $params = new Registry; $params->loadString($module->params); // Get the template $template = $app->getTemplate(); // Get module path $module->module = preg_replace('/[^A-Z0-9_\.-]/i', '', $module->module); $path = JPATH_BASE . '/modules/' . $module->module . '/' . $module->module . '.php'; // Load the module if (file_exists($path)) { $lang = JFactory::getLanguage(); // 1.5 or Core then 1.6 3PD $lang->load($module->module, JPATH_BASE, null, false, true) || $lang->load($module->module, dirname($path), null, false, true); $content = ''; ob_start(); include $path; $module->content = ob_get_contents() . $content; ob_end_clean(); } // Load the module chrome functions if (!$chrome) { $chrome = array(); } include_once JPATH_THEMES . '/system/html/modules.php'; $chromePath = JPATH_THEMES . '/' . $template . '/html/modules.php'; if (!isset($chrome[$chromePath])) { if (file_exists($chromePath)) { include_once $chromePath; } $chrome[$chromePath] = true; } // Check if the current module has a style param to override template module style $paramsChromeStyle = $params->get('style'); if ($paramsChromeStyle) { $attribs['style'] = preg_replace('/^(system|' . $template . ')\-/i', '', $paramsChromeStyle); } // Make sure a style is set if (!isset($attribs['style'])) { $attribs['style'] = 'none'; } // Dynamically add outline style if ($app->input->getBool('tp') && JComponentHelper::getParams('com_templates')->get('template_positions_display')) { $attribs['style'] .= ' outline'; } // If the $module is nulled it will return an empty content, otherwise it will render the module normally. $app->triggerEvent('onRenderModule', array(&$module, &$attribs)); if (is_null($module) || !isset($module->content)) { return ''; } foreach (explode(' ', $attribs['style']) as $style) { $chromeMethod = 'modChrome_' . $style; // Apply chrome and render module if (function_exists($chromeMethod)) { $module->style = $attribs['style']; ob_start(); $chromeMethod($module, $params, $attribs); $module->content = ob_get_contents(); ob_end_clean(); } } // Revert the scope $app->scope = $scope; if (JDEBUG) { JProfiler::getInstance('Application')->mark('afterRenderModule ' . $module->module . ' (' . $module->title . ')'); } return $module->content; } /** * Get the path to a layout for a module * * @param string $module The name of the module * @param string $layout The name of the module layout. If alternative layout, in the form template:filename. * * @return string The path to the module layout * * @since 1.5 */ public static function getLayoutPath($module, $layout = 'default') { $template = JFactory::getApplication()->getTemplate(); $defaultLayout = $layout; if (strpos($layout, ':') !== false) { // Get the template and file name from the string $temp = explode(':', $layout); $template = ($temp[0] == '_') ? $template : $temp[0]; $layout = $temp[1]; $defaultLayout = ($temp[1]) ? $temp[1] : 'default'; } // Build the template and base path for the layout $tPath = JPATH_THEMES . '/' . $template . '/html/' . $module . '/' . $layout . '.php'; $bPath = JPATH_BASE . '/modules/' . $module . '/tmpl/' . $defaultLayout . '.php'; $dPath = JPATH_BASE . '/modules/' . $module . '/tmpl/default.php'; // If the template has a layout override use it if (file_exists($tPath)) { return $tPath; } if (file_exists($bPath)) { return $bPath; } return $dPath; } /** * Load published modules. * * @return array * * @since 1.5 * @deprecated 4.0 Use JModuleHelper::load() instead */ protected static function &_load() { return static::load(); } /** * Load published modules. * * @return array * * @since 3.2 */ protected static function &load() { static $modules; if (isset($modules)) { return $modules; } $app = JFactory::getApplication(); $modules = null; $app->triggerEvent('onPrepareModuleList', array(&$modules)); // If the onPrepareModuleList event returns an array of modules, then ignore the default module list creation if (!is_array($modules)) { $modules = static::getModuleList(); } $app->triggerEvent('onAfterModuleList', array(&$modules)); $modules = static::cleanModuleList($modules); $app->triggerEvent('onAfterCleanModuleList', array(&$modules)); return $modules; } /** * Module list * * @return array */ public static function getModuleList() { $app = JFactory::getApplication(); $Itemid = $app->input->getInt('Itemid'); $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels()); $lang = JFactory::getLanguage()->getTag(); $clientId = (int) $app->getClientId(); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params, mm.menuid') ->from('#__modules AS m') ->join('LEFT', '#__modules_menu AS mm ON mm.moduleid = m.id') ->where('m.published = 1') ->join('LEFT', '#__extensions AS e ON e.element = m.module AND e.client_id = m.client_id') ->where('e.enabled = 1'); $date = JFactory::getDate(); $now = $date->toSql(); $nullDate = $db->getNullDate(); $query->where('(m.publish_up = ' . $db->quote($nullDate) . ' OR m.publish_up <= ' . $db->quote($now) . ')') ->where('(m.publish_down = ' . $db->quote($nullDate) . ' OR m.publish_down >= ' . $db->quote($now) . ')') ->where('m.access IN (' . $groups . ')') ->where('m.client_id = ' . $clientId) ->where('(mm.menuid = ' . (int) $Itemid . ' OR mm.menuid <= 0)'); // Filter by language if ($app->isSite() && $app->getLanguageFilter()) { $query->where('m.language IN (' . $db->quote($lang) . ',' . $db->quote('*') . ')'); } $query->order('m.position, m.ordering'); // Set the query $db->setQuery($query); try { $modules = $db->loadObjectList(); } catch (RuntimeException $e) { JLog::add(JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $e->getMessage()), JLog::WARNING, 'jerror'); return array(); } return $modules; } /** * Clean the module list * * @param array $modules Array with module objects * * @return array */ public static function cleanModuleList($modules) { // Apply negative selections and eliminate duplicates $Itemid = JFactory::getApplication()->input->getInt('Itemid'); $negId = $Itemid ? -(int) $Itemid : false; $clean = array(); $dupes = array(); foreach ($modules as $i => $module) { // The module is excluded if there is an explicit prohibition $negHit = ($negId === (int) $module->menuid); if (isset($dupes[$module->id])) { // If this item has been excluded, keep the duplicate flag set, // but remove any item from the modules array. if ($negHit) { unset($clean[$module->id]); } continue; } $dupes[$module->id] = true; // Only accept modules without explicit exclusions. if ($negHit) { continue; } $module->name = substr($module->module, 4); $module->style = null; $module->position = strtolower($module->position); $clean[$module->id] = $module; } unset($dupes); // Return to simple indexing that matches the query order. return array_values($clean); } /** * Module cache helper * * Caching modes: * To be set in XML: * 'static' One cache file for all pages with the same module parameters * 'oldstatic' 1.5 definition of module caching, one cache file for all pages * with the same module id and user aid, * 'itemid' Changes on itemid change, to be called from inside the module: * 'safeuri' Id created from $cacheparams->modeparams array, * 'id' Module sets own cache id's * * @param object $module Module object * @param object $moduleparams Module parameters * @param object $cacheparams Module cache parameters - id or url parameters, depending on the module cache mode * * @return string * * @see JFilterInput::clean() * @since 1.6 */ public static function moduleCache($module, $moduleparams, $cacheparams) { if (!isset($cacheparams->modeparams)) { $cacheparams->modeparams = null; } if (!isset($cacheparams->cachegroup)) { $cacheparams->cachegroup = $module->module; } $user = JFactory::getUser(); $cache = JFactory::getCache($cacheparams->cachegroup, 'callback'); $conf = JFactory::getConfig(); // Turn cache off for internal callers if parameters are set to off and for all logged in users if ($moduleparams->get('owncache', null) === '0' || $conf->get('caching') == 0 || $user->get('id')) { $cache->setCaching(false); } // Module cache is set in seconds, global cache in minutes, setLifeTime works in minutes $cache->setLifeTime($moduleparams->get('cache_time', $conf->get('cachetime') * 60) / 60); $wrkaroundoptions = array('nopathway' => 1, 'nohead' => 0, 'nomodules' => 1, 'modulemode' => 1, 'mergehead' => 1); $wrkarounds = true; $view_levels = md5(serialize($user->getAuthorisedViewLevels())); switch ($cacheparams->cachemode) { case 'id': $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $cacheparams->modeparams, $wrkarounds, $wrkaroundoptions ); break; case 'safeuri': $secureid = null; if (is_array($cacheparams->modeparams)) { $input = JFactory::getApplication()->input; $uri = $input->getArray(); $safeuri = new stdClass; $noHtmlFilter = JFilterInput::getInstance(); foreach ($cacheparams->modeparams as $key => $value) { // Use int filter for id/catid to clean out spamy slugs if (isset($uri[$key])) { $safeuri->$key = $noHtmlFilter->clean($uri[$key], $value); } } } $secureid = md5(serialize(array($safeuri, $cacheparams->method, $moduleparams))); $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $module->id . $view_levels . $secureid, $wrkarounds, $wrkaroundoptions ); break; case 'static': $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $module->module . md5(serialize($cacheparams->methodparams)), $wrkarounds, $wrkaroundoptions ); break; // Provided for backward compatibility, not really useful. case 'oldstatic': $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $module->id . $view_levels, $wrkarounds, $wrkaroundoptions ); break; case 'itemid': default: $ret = $cache->get( array($cacheparams->class, $cacheparams->method), $cacheparams->methodparams, $module->id . $view_levels . JFactory::getApplication()->input->getInt('Itemid', null), $wrkarounds, $wrkaroundoptions ); break; } return $ret; } } PK���\�ʼn�,,!libraries/cms/captcha/captcha.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Captcha * * @copyright Copyright (C) 2005 - 2015 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\Registry\Registry; /** * Joomla! Captcha base object * * @abstract * @package Joomla.Libraries * @subpackage Captcha * @since 2.5 */ class JCaptcha extends JObject { /** * An array of Observer objects to notify * * @var array * @since 2.5 */ protected $_observers = array(); /** * The state of the observable object * * @var mixed * @since 2.5 */ protected $_state = null; /** * A multi dimensional array of [function][] = key for observers * * @var array * @since 2.5 */ protected $_methods = array(); /** * Captcha Plugin object * * @var JPlugin * @since 2.5 */ private $_captcha; /** * Editor Plugin name * * @var string * @since 2.5 */ private $_name; /** * Array of instances of this class. * * @var array */ private static $_instances = array(); /** * Class constructor. * * @param string $captcha The editor to use. * @param array $options Associative array of options. * * @since 2.5 */ public function __construct($captcha, $options) { $this->_name = $captcha; $this->_load($options); } /** * Returns the global Captcha object, only creating it * if it doesn't already exist. * * @param string $captcha The plugin to use. * @param array $options Associative array of options. * * @return JCaptcha Instance of this class. * * @since 2.5 */ public static function getInstance($captcha, array $options = array()) { $signature = md5(serialize(array($captcha, $options))); if (empty(self::$_instances[$signature])) { try { self::$_instances[$signature] = new JCaptcha($captcha, $options); } catch (RuntimeException $e) { JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); return null; } } return self::$_instances[$signature]; } /** * Fire the onInit event to initialise the captcha plug-in. * * @param string $id The id of the field. * * @return boolean True on success * * @since 2.5 */ public function initialise($id) { $args['id'] = $id; $args['event'] = 'onInit'; try { $this->_captcha->update($args); } catch (Exception $e) { JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); return false; } return true; } /** * Get the HTML for the captcha. * * @param string $name The control name. * @param string $id The id for the control. * @param string $class Value for the HTML class attribute * * @return mixed The return value of the function "onDisplay" of the selected Plugin. * * @since 2.5 */ public function display($name, $id, $class = '') { // Check if captcha is already loaded. if (is_null($this->_captcha)) { return; } // Initialise the Captcha. if (!$this->initialise($id)) { return; } $args['name'] = $name; $args['id'] = $id ? $id : $name; $args['class'] = $class ? 'class="' . $class . '"' : ''; $args['event'] = 'onDisplay'; return $this->_captcha->update($args); } /** * Checks if the answer is correct. * * @param string $code The answer. * * @return mixed The return value of the function "onCheckAnswer" of the selected Plugin. * * @since 2.5 */ public function checkAnswer($code) { // Check if captcha is already loaded if (is_null(($this->_captcha))) { return; } $args['code'] = $code; $args['event'] = 'onCheckAnswer'; return $this->_captcha->update($args); } /** * Load the Captcha plug-in. * * @param array $options Associative array of options. * * @return void * * @since 2.5 * @throws RuntimeException */ private function _load(array $options = array()) { // Build the path to the needed captcha plugin $name = JFilterInput::getInstance()->clean($this->_name, 'cmd'); $path = JPATH_PLUGINS . '/captcha/' . $name . '/' . $name . '.php'; if (!is_file($path)) { throw new RuntimeException(JText::sprintf('JLIB_CAPTCHA_ERROR_PLUGIN_NOT_FOUND', $name)); } // Require plugin file require_once $path; // Get the plugin $plugin = JPluginHelper::getPlugin('captcha', $this->_name); if (!$plugin) { throw new RuntimeException(JText::sprintf('JLIB_CAPTCHA_ERROR_PLUGIN_NOT_FOUND', $name)); } $params = new Registry($plugin->params); $plugin->params = $params; // Build captcha plugin classname $name = 'PlgCaptcha' . $this->_name; $this->_captcha = new $name($this, (array) $plugin, $options); } /** * Get the state of the JEditor object * * @return mixed The state of the object. * * @since 2.5 */ public function getState() { return $this->_state; } /** * Attach an observer object * * @param object $observer An observer object to attach * * @return void * * @since 2.5 */ public function attach($observer) { if (is_array($observer)) { if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler'])) { return; } // Make sure we haven't already attached this array as an observer foreach ($this->_observers as $check) { if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler']) { return; } } $this->_observers[] = $observer; end($this->_observers); $methods = array($observer['event']); } else { if (!($observer instanceof JEditor)) { return; } // Make sure we haven't already attached this object as an observer $class = get_class($observer); foreach ($this->_observers as $check) { if ($check instanceof $class) { return; } } $this->_observers[] = $observer; $methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin')); } $key = key($this->_observers); foreach ($methods as $method) { $method = strtolower($method); if (!isset($this->_methods[$method])) { $this->_methods[$method] = array(); } $this->_methods[$method][] = $key; } } /** * Detach an observer object * * @param object $observer An observer object to detach. * * @return boolean True if the observer object was detached. * * @since 2.5 */ public function detach($observer) { $retval = false; $key = array_search($observer, $this->_observers); if ($key !== false) { unset($this->_observers[$key]); $retval = true; foreach ($this->_methods as &$method) { $k = array_search($key, $method); if ($k !== false) { unset($method[$k]); } } } return $retval; } } PK���\�.I<'('(libraries/cms/editor/editor.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Editor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * JEditor class to handle WYSIWYG editors * * @since 1.5 */ class JEditor extends JObject { /** * An array of Observer objects to notify * * @var array * @since 1.5 */ protected $_observers = array(); /** * The state of the observable object * * @var mixed * @since 1.5 */ protected $_state = null; /** * A multi dimensional array of [function][] = key for observers * * @var array * @since 1.5 */ protected $_methods = array(); /** * Editor Plugin object * * @var object * @since 1.5 */ protected $_editor = null; /** * Editor Plugin name * * @var string * @since 1.5 */ protected $_name = null; /** * Object asset * * @var string * @since 1.6 */ protected $asset = null; /** * Object author * * @var string * @since 1.6 */ protected $author = null; /** * @var array JEditor instances container. * @since 2.5 */ protected static $instances = array(); /** * Constructor * * @param string $editor The editor name */ public function __construct($editor = 'none') { $this->_name = $editor; } /** * Returns the global Editor object, only creating it * if it doesn't already exist. * * @param string $editor The editor to use. * * @return JEditor The Editor object. * * @since 1.5 */ public static function getInstance($editor = 'none') { $signature = serialize($editor); if (empty(self::$instances[$signature])) { self::$instances[$signature] = new JEditor($editor); } return self::$instances[$signature]; } /** * Get the state of the JEditor object * * @return mixed The state of the object. * * @since 1.5 */ public function getState() { return $this->_state; } /** * Attach an observer object * * @param object $observer An observer object to attach * * @return void * * @since 1.5 */ public function attach($observer) { if (is_array($observer)) { if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler'])) { return; } // Make sure we haven't already attached this array as an observer foreach ($this->_observers as $check) { if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler']) { return; } } $this->_observers[] = $observer; end($this->_observers); $methods = array($observer['event']); } else { if (!($observer instanceof JEditor)) { return; } // Make sure we haven't already attached this object as an observer $class = get_class($observer); foreach ($this->_observers as $check) { if ($check instanceof $class) { return; } } $this->_observers[] = $observer; $methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin')); } $key = key($this->_observers); foreach ($methods as $method) { $method = strtolower($method); if (!isset($this->_methods[$method])) { $this->_methods[$method] = array(); } $this->_methods[$method][] = $key; } } /** * Detach an observer object * * @param object $observer An observer object to detach. * * @return boolean True if the observer object was detached. * * @since 1.5 */ public function detach($observer) { $retval = false; $key = array_search($observer, $this->_observers); if ($key !== false) { unset($this->_observers[$key]); $retval = true; foreach ($this->_methods as &$method) { $k = array_search($key, $method); if ($k !== false) { unset($method[$k]); } } } return $retval; } /** * Initialise the editor * * @return void * * @since 1.5 */ public function initialise() { // Check if editor is already loaded if (is_null(($this->_editor))) { return; } $args['event'] = 'onInit'; $return = ''; $results[] = $this->_editor->update($args); foreach ($results as $result) { if (trim($result)) { // @todo remove code: $return .= $result; $return = $result; } } $document = JFactory::getDocument(); if (method_exists($document, "addCustomTag")) { $document->addCustomTag($return); } } /** * Display the editor area. * * @param string $name The control name. * @param string $html The contents of the text area. * @param string $width The width of the text area (px or %). * @param string $height The height of the text area (px or %). * @param integer $col The number of columns for the textarea. * @param integer $row The number of rows for the textarea. * @param boolean $buttons True and the editor buttons will be displayed. * @param string $id An optional ID for the textarea (note: since 1.6). If not supplied the name is used. * @param string $asset The object asset * @param object $author The author. * @param array $params Associative array of editor parameters. * * @return string * * @since 1.5 */ public function display($name, $html, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array()) { $this->asset = $asset; $this->author = $author; $this->_loadEditor($params); // Check whether editor is already loaded if (is_null(($this->_editor))) { return; } // Backwards compatibility. Width and height should be passed without a semicolon from now on. // If editor plugins need a unit like "px" for CSS styling, they need to take care of that $width = str_replace(';', '', $width); $height = str_replace(';', '', $height); $return = null; $args['name'] = $name; $args['content'] = $html; $args['width'] = $width; $args['height'] = $height; $args['col'] = $col; $args['row'] = $row; $args['buttons'] = $buttons; $args['id'] = $id ? $id : $name; $args['event'] = 'onDisplay'; $results[] = $this->_editor->update($args); foreach ($results as $result) { if (trim($result)) { $return .= $result; } } return $return; } /** * Save the editor content * * @param string $editor The name of the editor control * * @return string * * @since 1.5 */ public function save($editor) { $this->_loadEditor(); // Check whether editor is already loaded if (is_null(($this->_editor))) { return; } $args[] = $editor; $args['event'] = 'onSave'; $return = ''; $results[] = $this->_editor->update($args); foreach ($results as $result) { if (trim($result)) { $return .= $result; } } return $return; } /** * Get the editor contents * * @param string $editor The name of the editor control * * @return string * * @since 1.5 */ public function getContent($editor) { $this->_loadEditor(); $args['name'] = $editor; $args['event'] = 'onGetContent'; $return = ''; $results[] = $this->_editor->update($args); foreach ($results as $result) { if (trim($result)) { $return .= $result; } } return $return; } /** * Set the editor contents * * @param string $editor The name of the editor control * @param string $html The contents of the text area * * @return string * * @since 1.5 */ public function setContent($editor, $html) { $this->_loadEditor(); $args['name'] = $editor; $args['html'] = $html; $args['event'] = 'onSetContent'; $return = ''; $results[] = $this->_editor->update($args); foreach ($results as $result) { if (trim($result)) { $return .= $result; } } return $return; } /** * Get the editor extended buttons (usually from plugins) * * @param string $editor The name of the editor. * @param mixed $buttons Can be boolean or array, if boolean defines if the buttons are * displayed, if array defines a list of buttons not to show. * * @return array * * @since 1.5 */ public function getButtons($editor, $buttons = true) { $result = array(); if (is_bool($buttons) && !$buttons) { return $result; } // Get plugins $plugins = JPluginHelper::getPlugin('editors-xtd'); foreach ($plugins as $plugin) { if (is_array($buttons) && in_array($plugin->name, $buttons)) { continue; } JPluginHelper::importPlugin('editors-xtd', $plugin->name, false); $className = 'plgButton' . $plugin->name; if (class_exists($className)) { $plugin = new $className($this, (array) $plugin); } // Try to authenticate if (method_exists($plugin, 'onDisplay') && $temp = $plugin->onDisplay($editor, $this->asset, $this->author)) { $result[] = $temp; } } return $result; } /** * Load the editor * * @param array $config Associative array of editor config paramaters * * @return mixed * * @since 1.5 */ protected function _loadEditor($config = array()) { // Check whether editor is already loaded if (!is_null(($this->_editor))) { return; } // Build the path to the needed editor plugin $name = JFilterInput::getInstance()->clean($this->_name, 'cmd'); $path = JPATH_PLUGINS . '/editors/' . $name . '/' . $name . '.php'; if (!is_file($path)) { JLog::add(JText::_('JLIB_HTML_EDITOR_CANNOT_LOAD'), JLog::WARNING, 'jerror'); return false; } // Require plugin file require_once $path; // Get the plugin $plugin = JPluginHelper::getPlugin('editors', $this->_name); $params = new Registry; $params->loadString($plugin->params); $params->loadArray($config); $plugin->params = $params; // Build editor plugin classname $name = 'plgEditor' . $this->_name; if ($this->_editor = new $name($this, (array) $plugin)) { // Load plugin parameters $this->initialise(); JPluginHelper::importPlugin('editors-xtd'); } } } PK���\�uT,��libraries/cms/class/loader.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Class * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('_JEXEC') or die; use Composer\Autoload\ClassLoader; /** * Decorate Composer ClassLoader for Joomla! * * For backward compatibility due to class aliasing in the CMS, the loadClass() method was modified to call * the JLoader::applyAliasFor() method. * * @since 3.4 */ class JClassLoader { /** * The composer class loader * * @var ClassLoader * @since 3.4 */ private $loader; /** * Constructor * * @param ClassLoader $loader Composer autoloader * * @since 3.4 */ public function __construct(ClassLoader $loader) { $this->loader = $loader; } /** * Loads the given class or interface. * * @param string $class The name of the class * * @return boolean|null True if loaded, null otherwise * * @since 3.4 */ public function loadClass($class) { if ($result = $this->loader->loadClass($class)) { JLoader::applyAliasFor($class); } return $result; } } PK���\"�P��$libraries/cms/installer/manifest.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); /** * Joomla! Package Manifest File * * @since 3.1 */ abstract class JInstallerManifest { /** * Path to the manifest file * * @var string * @since 3.1 */ public $manifest_file = ''; /** * Name of the extension * * @var string * @since 3.1 */ public $name = ''; /** * Version of the extension * * @var string * @since 3.1 */ public $version = ''; /** * Description of the extension * * @var string * @since 3.1 */ public $description = ''; /** * Packager of the extension * * @var string * @since 3.1 */ public $packager = ''; /** * Packager's URL of the extension * * @var string * @since 3.1 */ public $packagerurl = ''; /** * Update site for the extension * * @var string * @since 3.1 */ public $update = ''; /** * List of files in the extension * * @var array * @since 3.1 */ public $filelist = array(); /** * Constructor * * @param string $xmlpath Path to XML manifest file. * * @since 3.1 */ public function __construct($xmlpath = '') { if (strlen($xmlpath)) { $this->loadManifestFromXml($xmlpath); } } /** * Load a manifest from a file * * @param string $xmlfile Path to file to load * * @return boolean * * @since 3.1 */ public function loadManifestFromXml($xmlfile) { $this->manifest_file = basename($xmlfile, '.xml'); $xml = simplexml_load_file($xmlfile); if (!$xml) { $this->_errors[] = JText::sprintf('JLIB_INSTALLER_ERROR_LOAD_XML', $xmlfile); return false; } else { $this->loadManifestFromData($xml); return true; } } /** * Apply manifest data from a SimpleXMLElement to the object. * * @param SimpleXMLElement $xml Data to load * * @return void * * @since 3.1 */ abstract protected function loadManifestFromData(SimpleXmlElement $xml); } PK���\� �Ԭ�"libraries/cms/installer/helper.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.path'); /** * Installer helper class * * @since 3.1 */ abstract class JInstallerHelper { /** * Downloads a package * * @param string $url URL of file to download * @param mixed $target Download target filename or false to get the filename from the URL * * @return mixed Path to downloaded package or boolean false on failure * * @since 3.1 */ public static function downloadPackage($url, $target = false) { $config = JFactory::getConfig(); // Capture PHP errors $track_errors = ini_get('track_errors'); ini_set('track_errors', true); // Set user agent $version = new JVersion; ini_set('user_agent', $version->getUserAgent('Installer')); $http = JHttpFactory::getHttp(); // Load installer plugins, and allow url and headers modification $headers = array(); JPluginHelper::importPlugin('installer'); $dispatcher = JEventDispatcher::getInstance(); $results = $dispatcher->trigger('onInstallerBeforePackageDownload', array(&$url, &$headers)); try { $response = $http->get($url, $headers); } catch (Exception $exception) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_DOWNLOAD_SERVER_CONNECT', $exception->getMessage()), JLog::WARNING, 'jerror'); return false; } if (302 == $response->code && isset($response->headers['Location'])) { return self::downloadPackage($response->headers['Location']); } elseif (200 != $response->code) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_DOWNLOAD_SERVER_CONNECT', $response->code), JLog::WARNING, 'jerror'); return false; } // Parse the Content-Disposition header to get the file name if (isset($response->headers['Content-Disposition']) && preg_match("/\s*filename\s?=\s?(.*)/", $response->headers['Content-Disposition'], $parts)) { $target = trim(rtrim($parts[1], ";"), '"'); } // Set the target path if not given if (!$target) { $target = $config->get('tmp_path') . '/' . self::getFilenameFromUrl($url); } else { $target = $config->get('tmp_path') . '/' . basename($target); } // Write buffer to file JFile::write($target, $response->body); // Restore error tracking to what it was before ini_set('track_errors', $track_errors); // Bump the max execution time because not using built in php zip libs are slow @set_time_limit(ini_get('max_execution_time')); // Return the name of the downloaded package return basename($target); } /** * Unpacks a file and verifies it as a Joomla element package * Supports .gz .tar .tar.gz and .zip * * @param string $p_filename The uploaded package filename or install directory * @param boolean $alwaysReturnArray If should return false (and leave garbage behind) or return $retval['type']=false * * @return mixed Array on success or boolean false on failure * * @since 3.1 */ public static function unpack($p_filename, $alwaysReturnArray = false) { // Path to the archive $archivename = $p_filename; // Temporary folder to extract the archive into $tmpdir = uniqid('install_'); // Clean the paths to use for archive extraction $extractdir = JPath::clean(dirname($p_filename) . '/' . $tmpdir); $archivename = JPath::clean($archivename); // Do the unpacking of the archive try { $extract = JArchive::extract($archivename, $extractdir); } catch (Exception $e) { if ($alwaysReturnArray) { return array( 'extractdir' => null, 'packagefile' => $archivename, 'type' => false ); } return false; } if (!$extract) { if ($alwaysReturnArray) { return array( 'extractdir' => null, 'packagefile' => $archivename, 'type' => false ); } return false; } /* * Let's set the extraction directory and package file in the result array so we can * cleanup everything properly later on. */ $retval['extractdir'] = $extractdir; $retval['packagefile'] = $archivename; /* * Try to find the correct install directory. In case the package is inside a * subdirectory detect this and set the install directory to the correct path. * * List all the items in the installation directory. If there is only one, and * it is a folder, then we will set that folder to be the installation folder. */ $dirList = array_merge(JFolder::files($extractdir, ''), JFolder::folders($extractdir, '')); if (count($dirList) == 1) { if (JFolder::exists($extractdir . '/' . $dirList[0])) { $extractdir = JPath::clean($extractdir . '/' . $dirList[0]); } } /* * We have found the install directory so lets set it and then move on * to detecting the extension type. */ $retval['dir'] = $extractdir; /* * Get the extension type and return the directory/type array on success or * false on fail. */ $retval['type'] = self::detectType($extractdir); if ($retval['type'] || $alwaysReturnArray) { return $retval; } else { return false; } } /** * Method to detect the extension type from a package directory * * @param string $p_dir Path to package directory * * @return mixed Extension type string or boolean false on fail * * @since 3.1 */ public static function detectType($p_dir) { // Search the install dir for an XML file $files = JFolder::files($p_dir, '\.xml$', 1, true); if (!count($files)) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_NOTFINDXMLSETUPFILE'), JLog::WARNING, 'jerror'); return false; } foreach ($files as $file) { $xml = simplexml_load_file($file); if (!$xml) { continue; } if ($xml->getName() != 'extension') { unset($xml); continue; } $type = (string) $xml->attributes()->type; // Free up memory unset($xml); return $type; } JLog::add(JText::_('JLIB_INSTALLER_ERROR_NOTFINDJOOMLAXMLSETUPFILE'), JLog::WARNING, 'jerror'); // Free up memory. unset($xml); return false; } /** * Gets a file name out of a url * * @param string $url URL to get name from * * @return mixed String filename or boolean false if failed * * @since 3.1 */ public static function getFilenameFromUrl($url) { if (is_string($url)) { $parts = explode('/', $url); return $parts[count($parts) - 1]; } return false; } /** * Clean up temporary uploaded package and unpacked extension * * @param string $package Path to the uploaded package file * @param string $resultdir Path to the unpacked extension * * @return boolean True on success * * @since 3.1 */ public static function cleanupInstall($package, $resultdir) { $config = JFactory::getConfig(); // Does the unpacked extension directory exist? if ($resultdir && is_dir($resultdir)) { JFolder::delete($resultdir); } // Is the package file a valid file? if (is_file($package)) { JFile::delete($package); } elseif (is_file(JPath::clean($config->get('tmp_path') . '/' . $package))) { // It might also be just a base filename JFile::delete(JPath::clean($config->get('tmp_path') . '/' . $package)); } } /** * Splits contents of a sql file into array of discreet queries. * Queries need to be delimited with end of statement marker ';' * * @param string $query The SQL statement. * * @return array Array of queries * * @since 3.1 * @deprecated 13.3 Use JDatabaseDriver::splitSql() directly * @codeCoverageIgnore */ public static function splitSql($query) { JLog::add('JInstallerHelper::splitSql() is deprecated. Use JDatabaseDriver::splitSql() instead.', JLog::WARNING, 'deprecated'); $db = JFactory::getDbo(); return $db->splitSql($query); } } PK���\��/1Z1Z#libraries/cms/installer/adapter.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.base.adapterinstance'); /** * Abstract adapter for the installer. * * @method JInstaller getParent() Retrieves the parent object. * @property-read JInstaller $parent Parent object * * @since 3.4 * @note As of 4.0, this class will no longer extend from JAdapterInstance */ abstract class JInstallerAdapter extends JAdapterInstance { /** * ID for the currently installed extension if present * * @var integer * @since 3.4 */ protected $currentExtensionId = null; /** * The unique identifier for the extension (e.g. mod_login) * * @var string * @since 3.4 * */ protected $element = null; /** * JTableExtension object. * * @var JTableExtension * @since 3.4 * */ protected $extension = null; /** * Messages rendered by custom scripts * * @var string * @since 3.4 */ protected $extensionMessage = ''; /** * Copy of the XML manifest file. * * Making this object public allows extensions to customize the manifest in custom scripts. * * @var string * @since 3.4 */ public $manifest = null; /** * A path to the PHP file that the scriptfile declaration in the manifest refers to. * * @var string * @since 3.4 */ protected $manifest_script = null; /** * Name of the extension * * @var string * @since 3.4 */ protected $name = null; /** * Install function routing * * @var string * @since 3.4 */ protected $route = 'install'; /** * Flag if the adapter supports discover installs * * Adapters should override this and set to false if discover install is unsupported * * @var boolean * @since 3.4 */ protected $supportsDiscoverInstall = true; /** * The type of adapter in use * * @var string * @since 3.4 */ protected $type; /** * Constructor * * @param JInstaller $parent Parent object * @param JDatabaseDriver $db Database object * @param array $options Configuration Options * * @since 3.4 */ public function __construct(JInstaller $parent, JDatabaseDriver $db, array $options = array()) { parent::__construct($parent, $db, $options); // Get a generic JTableExtension instance for use if not already loaded if (!($this->extension instanceof JTableInterface)) { $this->extension = JTable::getInstance('extension'); } // Sanity check, make sure the type is set by taking the adapter name from the class name if (!$this->type) { $this->type = strtolower(str_replace('JInstallerAdapter', '', get_called_class())); } } /** * Method to check if the extension is already present in the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function checkExistingExtension() { try { $this->currentExtensionId = $this->extension->find( array('element' => $this->element, 'type' => $this->type) ); // If it does exist, load it if ($this->currentExtensionId) { $this->extension->load(array('element' => $this->element, 'type' => $this->type)); } } catch (RuntimeException $e) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_ROLLBACK', JText::_('JLIB_INSTALLER_' . $this->route), $e->getMessage() ) ); } } /** * Method to check if the extension is present in the filesystem, flags the route as update if so * * @return void * * @since 3.4 * @throws RuntimeException */ protected function checkExtensionInFilesystem() { if (file_exists($this->parent->getPath('extension_root')) && (!$this->parent->isOverwrite() || $this->parent->isUpgrade())) { // Look for an update function or update tag $updateElement = $this->getManifest()->update; // Upgrade manually set or update function available or update tag detected if ($this->parent->isUpgrade() || ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'update')) || $updateElement) { // Force this one $this->parent->setOverwrite(true); $this->parent->setUpgrade(true); if ($this->currentExtensionId) { // If there is a matching extension mark this as an update $this->setRoute('update'); } } elseif (!$this->parent->isOverwrite()) { // We didn't have overwrite set, find an update function or find an update tag so lets call it safe throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_DIRECTORY', JText::_('JLIB_INSTALLER_' . $this->route), $this->type, $this->parent->getPath('extension_root') ) ); } } } /** * Method to copy the extension's base files from the <files> tag(s) and the manifest file * * @return void * * @since 3.4 * @throws RuntimeException */ abstract protected function copyBaseFiles(); /** * Method to create the extension root path if necessary * * @return void * * @since 3.4 * @throws RuntimeException */ protected function createExtensionRoot() { // If the extension directory does not exist, lets create it $created = false; if (!file_exists($this->parent->getPath('extension_root'))) { if (!$created = JFolder::create($this->parent->getPath('extension_root'))) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_CREATE_DIRECTORY', JText::_('JLIB_INSTALLER_' . $this->route), $this->parent->getPath('extension_root') ) ); } } /* * Since we created the extension directory and will want to remove it if * we have to roll back the installation, let's add it to the * installation step stack */ if ($created) { $this->parent->pushStep( array( 'type' => 'folder', 'path' => $this->parent->getPath('extension_root') ) ); } } /** * Generic discover_install method for extensions * * @return boolean True on success * * @since 3.4 */ public function discover_install() { // Get the extension's description $description = (string) $this->getManifest()->description; if ($description) { $this->parent->message = JText::_($description); } else { $this->parent->message = ''; } // Set the extension's name and element $this->name = $this->getName(); $this->element = $this->getElement(); /* * --------------------------------------------------------------------------------------------- * Extension Precheck and Setup Section * --------------------------------------------------------------------------------------------- */ // Setup the install paths and perform other prechecks as necessary try { $this->setupInstallPaths(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } /* * --------------------------------------------------------------------------------------------- * Installer Trigger Loading * --------------------------------------------------------------------------------------------- */ $this->setupScriptfile(); try { $this->triggerManifestScript('preflight'); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } /* * --------------------------------------------------------------------------------------------- * Database Processing Section * --------------------------------------------------------------------------------------------- */ try { $this->storeExtension(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } try { $this->parseQueries(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } // Run the custom install method try { $this->triggerManifestScript('install'); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } /* * --------------------------------------------------------------------------------------------- * Finalization and Cleanup Section * --------------------------------------------------------------------------------------------- */ try { $this->finaliseInstall(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } // And now we run the postflight try { $this->triggerManifestScript('postflight'); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } return $this->extension->extension_id; } /** * Method to handle database transactions for the installer * * @return boolean True on success * * @since 3.4 * @throws RuntimeException */ protected function doDatabaseTransactions() { $route = $this->route == 'discover_install' ? 'install' : $this->route; // Let's run the install queries for the component if (isset($this->getManifest()->{$route}->sql)) { $result = $this->parent->parseSQLFiles($this->getManifest()->{$route}->sql); if ($result === false) { // Only rollback if installing if ($route == 'install') { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_SQL_ERROR', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->parent->getDbo()->stderr(true) ) ); } return false; } } return true; } /** * Load language files * * @param string $extension The name of the extension * @param string $source Path to the extension * @param string $base Base path for the extension language * * @return void * * @since 3.4 */ protected function doLoadLanguage($extension, $source, $base = JPATH_ADMINISTRATOR) { $lang = JFactory::getLanguage(); $lang->load($extension . '.sys', $source, null, false, true) || $lang->load($extension . '.sys', $base, null, false, true); } /** * Checks if the adapter supports discover_install * * @return boolean * * @since 3.4 */ public function getDiscoverInstallSupported() { return $this->supportsDiscoverInstall; } /** * Get the filtered extension element from the manifest * * @param string $element Optional element name to be converted * * @return string The filtered element * * @since 3.4 */ public function getElement($element = null) { if (!$element) { // Ensure the element is a string $element = (string) $this->getManifest()->element; } if (!$element) { $element = $this->getName(); } // Filter the name for illegal characters return strtolower(JFilterInput::getInstance()->clean($element, 'cmd')); } /** * Get the manifest object. * * @return object Manifest object * * @since 3.4 */ public function getManifest() { return $this->manifest; } /** * Get the filtered component name from the manifest * * @return string The filtered name * * @since 3.4 */ public function getName() { // Ensure the name is a string $name = (string) $this->getManifest()->name; // Filter the name for illegal characters $name = JFilterInput::getInstance()->clean($name, 'string'); return $name; } /** * Get the install route being followed * * @return string The install route * * @since 3.4 */ public function getRoute() { return $this->route; } /** * Get the class name for the install adapter script. * * @return string The class name. * * @since 3.4 */ protected function getScriptClassName() { // Support element names like 'en-GB' $className = JFilterInput::getInstance()->clean($this->element, 'cmd') . 'InstallerScript'; // Cannot have - in class names $className = str_replace('-', '', $className); return $className; } /** * Generic install method for extensions * * @return boolean True on success * * @since 3.4 */ public function install() { // Get the extension's description $description = (string) $this->getManifest()->description; if ($description) { $this->parent->message = JText::_($description); } else { $this->parent->message = ''; } // Set the extension's name and element $this->name = $this->getName(); $this->element = $this->getElement(); /* * --------------------------------------------------------------------------------------------- * Extension Precheck and Setup Section * --------------------------------------------------------------------------------------------- */ // Setup the install paths and perform other prechecks as necessary try { $this->setupInstallPaths(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } // Check to see if an extension by the same name is already installed. try { $this->checkExistingExtension(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } // Check if the extension is present in the filesystem try { $this->checkExtensionInFilesystem(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } // If we are on the update route, run any custom setup routines if ($this->route == 'update') { try { $this->setupUpdates(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } } /* * --------------------------------------------------------------------------------------------- * Installer Trigger Loading * --------------------------------------------------------------------------------------------- */ $this->setupScriptfile(); try { $this->triggerManifestScript('preflight'); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } /* * --------------------------------------------------------------------------------------------- * Filesystem Processing Section * --------------------------------------------------------------------------------------------- */ // If the extension directory does not exist, lets create it try { $this->createExtensionRoot(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } // Copy all necessary files try { $this->copyBaseFiles(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } // Parse optional tags $this->parseOptionalTags(); /* * --------------------------------------------------------------------------------------------- * Database Processing Section * --------------------------------------------------------------------------------------------- */ try { $this->storeExtension(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } try { $this->parseQueries(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } // Run the custom method based on the route try { $this->triggerManifestScript($this->route); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } /* * --------------------------------------------------------------------------------------------- * Finalization and Cleanup Section * --------------------------------------------------------------------------------------------- */ try { $this->finaliseInstall(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } // And now we run the postflight try { $this->triggerManifestScript('postflight'); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort($e->getMessage()); return false; } return $this->extension->extension_id; } /** * Method to parse the queries specified in the <sql> tags * * @return void * * @since 3.4 * @throws RuntimeException */ protected function parseQueries() { // Let's run the queries for the extension if (in_array($this->route, array('install', 'discover_install', 'uninstall'))) { // This method may throw an exception, but it is caught by the parent caller if (!$this->doDatabaseTransactions()) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_SQL_ERROR', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->db->stderr(true) ) ); } // Set the schema version to be the latest update version if ($this->getManifest()->update) { $this->parent->setSchemaVersion($this->getManifest()->update->schemas, $this->extension->extension_id); } } elseif ($this->route == 'update') { if ($this->getManifest()->update) { $result = $this->parent->parseSchemaUpdates($this->getManifest()->update->schemas, $this->extension->extension_id); if ($result === false) { // Install failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_SQL_ERROR', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->db->stderr(true) ) ); } } } } /** * Method to parse optional tags in the manifest * * @return void * * @since 3.1 */ protected function parseOptionalTags() { // Some extensions may not have optional tags } /** * Prepares the adapter for a discover_install task * * @return void * * @since 3.4 */ public function prepareDiscoverInstall() { // Adapters may not support discover install or may have overridden the default task and aren't using this } /** * Set the manifest object. * * @param object $manifest The manifest object * * @return JInstallerAdapter Instance of this class to support chaining * * @since 3.4 */ public function setManifest($manifest) { $this->manifest = $manifest; return $this; } /** * Set the install route being followed * * @param string $route The install route being followed * * @return JInstallerAdapter Instance of this class to support chaining * * @since 3.4 */ public function setRoute($route) { $this->route = $route; return $this; } /** * Method to do any prechecks and setup the install paths for the extension * * @return void * * @since 3.4 */ abstract protected function setupInstallPaths(); /** * Setup the manifest script file for those adapters that use it. * * @return void * * @since 3.4 */ protected function setupScriptfile() { // If there is an manifest class file, lets load it; we'll copy it later (don't have dest yet) $manifestScript = (string) $this->getManifest()->scriptfile; if ($manifestScript) { $manifestScriptFile = $this->parent->getPath('source') . '/' . $manifestScript; if (is_file($manifestScriptFile)) { // Load the file include_once $manifestScriptFile; } $classname = $this->getScriptClassName(); if (class_exists($classname)) { // Create a new instance $this->parent->manifestClass = new $classname($this); // And set this so we can copy it later $this->manifest_script = $manifestScript; } } } /** * Method to setup the update routine for the adapter * * @return void * * @since 3.4 */ protected function setupUpdates() { // Some extensions may not have custom setup routines for updates } /** * Method to store the extension to the database * * @return void * * @since 3.4 * @throws RuntimeException */ abstract protected function storeExtension(); /** * Executes a custom install script method * * @param string $method The install method to execute * * @return boolean True on success * * @since 3.4 * @throws RuntimeException */ protected function triggerManifestScript($method) { ob_start(); ob_implicit_flush(false); if ($this->parent->manifestClass && method_exists($this->parent->manifestClass, $method)) { switch ($method) { // The preflight and postflight take the route as a param case 'preflight' : case 'postflight' : if ($this->parent->manifestClass->$method($this->route, $this) === false) { if ($method != 'postflight') { // The script failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_INSTALL_CUSTOM_INSTALL_FAILURE', JText::_('JLIB_INSTALLER_' . $this->route) ) ); } } break; // The install, uninstall, and update methods only pass this object as a param case 'install' : case 'uninstall' : case 'update' : if ($this->parent->manifestClass->$method($this) === false) { if ($method != 'uninstall') { // The script failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_INSTALL_CUSTOM_INSTALL_FAILURE', JText::_('JLIB_INSTALLER_' . $this->route) ) ); } } break; } } // Append to the message object $this->extensionMessage .= ob_get_clean(); // If in postflight or uninstall, set the message for display if (($method == 'uninstall' || $method == 'postflight') && $this->extensionMessage != '') { $this->parent->set('extension_message', $this->extensionMessage); } return true; } /** * Generic update method for extensions * * @return boolean True on success * * @since 3.4 */ public function update() { // Set the overwrite setting $this->parent->setOverwrite(true); $this->parent->setUpgrade(true); // And make sure the route is set correctly $this->setRoute('update'); // Now jump into the install method to run the update return $this->install(); } } PK���\����%libraries/cms/installer/extension.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Extension object * * @since 3.1 */ class JInstallerExtension extends JObject { /** * Filename of the extension * * @var string * @since 3.1 */ public $filename = ''; /** * Type of the extension * * @var string * @since 3.1 */ public $type = ''; /** * Unique Identifier for the extension * * @var string * @since 3.1 */ public $id = ''; /** * The status of the extension * * @var boolean * @since 3.1 */ public $published = false; /** * String representation of client. Valid for modules, templates and languages. * Set by default to site. * * @var string * @since 3.1 */ public $client = 'site'; /** * The group name of the plugin. Not used for other known extension types (only plugins) * * @var string * @since 3.1 */ public $group = ''; /** * An object representation of the manifest file stored metadata * * @var object * @since 3.1 */ public $manifest_cache = null; /** * An object representation of the extension params * * @var object * @since 3.1 */ public $params = null; /** * Constructor * * @param SimpleXMLElement $element A SimpleXMLElement from which to load data from * * @since 3.1 */ public function __construct(SimpleXMLElement $element = null) { if ($element) { $this->type = (string) $element->attributes()->type; $this->id = (string) $element->attributes()->id; switch ($this->type) { case 'component': // By default a component doesn't have anything break; case 'module': case 'template': case 'language': $this->client = (string) $element->attributes()->client; $tmp_client_id = JApplicationHelper::getClientInfo($this->client, 1); if ($tmp_client_id == null) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_EXTENSION_INVALID_CLIENT_IDENTIFIER'), JLog::WARNING, 'jerror'); } else { $this->client_id = $tmp_client_id->id; } break; case 'plugin': $this->group = (string) $element->attributes()->group; break; default: // Catch all // Get and set client and group if we don't recognise the extension if ($element->attributes()->client) { $this->client_id = JApplicationHelper::getClientInfo($this->client, 1); $this->client_id = $this->client_id->id; } if ($element->attributes()->group) { $this->group = (string) $element->attributes()->group; } break; } $this->filename = (string) $element; } } } /** * Deprecated class placeholder. You should use JInstallerExtension instead. * * @since 3.1 * @deprecated 4.0 * @codeCoverageIgnore */ class JExtension extends JInstallerExtension { /** * Constructor * * @param SimpleXMLElement $element A SimpleXMLElement from which to load data from * * @since 3.1 */ public function __construct(SimpleXMLElement $element = null) { parent::__construct($element); } } PK���\a�oFF,libraries/cms/installer/manifest/library.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Library Manifest File * * @since 3.1 */ class JInstallerManifestLibrary extends JInstallerManifest { /** * File system name of the library * * @var string * @since 3.1 */ public $libraryname = ''; /** * Creation Date of the library * * @var string * @since 3.1 */ public $creationDate = ''; /** * Copyright notice for the library * * @var string * @since 3.1 */ public $copyright = ''; /** * License for the library * * @var string * @since 3.1 */ public $license = ''; /** * Author for the library * * @var string * @since 3.1 */ public $author = ''; /** * Author email for the library * * @var string * @since 3.1 */ public $authoremail = ''; /** * Author URL for the library * * @var string * @since 3.1 */ public $authorurl = ''; /** * Apply manifest data from a SimpleXMLElement to the object. * * @param SimpleXMLElement $xml Data to load * * @return void * * @since 3.1 */ protected function loadManifestFromData(SimpleXMLElement $xml) { $this->name = (string) $xml->name; $this->libraryname = (string) $xml->libraryname; $this->version = (string) $xml->version; $this->description = (string) $xml->description; $this->creationdate = (string) $xml->creationDate; $this->author = (string) $xml->author; $this->authoremail = (string) $xml->authorEmail; $this->authorurl = (string) $xml->authorUrl; $this->packager = (string) $xml->packager; $this->packagerurl = (string) $xml->packagerurl; $this->update = (string) $xml->update; if (isset($xml->files) && isset($xml->files->file) && count($xml->files->file)) { foreach ($xml->files->file as $file) { $this->filelist[] = (string) $file; } } } } PK���\�ހP��,libraries/cms/installer/manifest/package.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Package Manifest File * * @since 3.1 */ class JInstallerManifestPackage extends JInstallerManifest { /** * Unique name of the package * * @var string * @since 3.1 */ public $packagename = ''; /** * Website for the package * * @var string * @since 3.1 */ public $url = ''; /** * Scriptfile for the package * * @var string * @since 3.1 */ public $scriptfile = ''; /** * Apply manifest data from a SimpleXMLElement to the object. * * @param SimpleXMLElement $xml Data to load * * @return void * * @since 3.1 */ protected function loadManifestFromData(SimpleXMLElement $xml) { $this->name = (string) $xml->name; $this->packagename = (string) $xml->packagename; $this->update = (string) $xml->update; $this->authorurl = (string) $xml->authorUrl; $this->author = (string) $xml->author; $this->authoremail = (string) $xml->authorEmail; $this->description = (string) $xml->description; $this->packager = (string) $xml->packager; $this->packagerurl = (string) $xml->packagerurl; $this->scriptfile = (string) $xml->scriptfile; $this->version = (string) $xml->version; if (isset($xml->files->file) && count($xml->files->file)) { foreach ($xml->files->file as $file) { // NOTE: JInstallerExtension doesn't expect a string. // DO NOT CAST $file $this->filelist[] = new JInstallerExtension($file); } } } } PK���\�D��o�o�%libraries/cms/installer/installer.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.path'); jimport('joomla.base.adapter'); /** * Joomla base installer class * * @since 3.1 */ class JInstaller extends JAdapter { /** * Array of paths needed by the installer * * @var array * @since 3.1 */ protected $paths = array(); /** * True if package is an upgrade * * @var boolean * @since 3.1 */ protected $upgrade = null; /** * The manifest trigger class * * @var object * @since 3.1 */ public $manifestClass = null; /** * True if existing files can be overwritten * * @var boolean * @since 12.1 */ protected $overwrite = false; /** * Stack of installation steps * - Used for installation rollback * * @var array * @since 3.1 */ protected $stepStack = array(); /** * Extension Table Entry * * @var JTableExtension * @since 3.1 */ public $extension = null; /** * The output from the install/uninstall scripts * * @var string * @since 3.1 * */ public $message = null; /** * The installation manifest XML object * * @var object * @since 3.1 */ public $manifest = null; /** * The extension message that appears * * @var string * @since 3.1 */ protected $extension_message = null; /** * The redirect URL if this extension (can be null if no redirect) * * @var string * @since 3.1 */ protected $redirect_url = null; /** * JInstaller instance container. * * @var JInstaller * @since 3.1 * @deprecated 4.0 */ protected static $instance; /** * JInstaller instances container. * * @var JInstaller[] * @since 3.4 */ protected static $instances; /** * Constructor * * @param string $basepath Base Path of the adapters * @param string $classprefix Class prefix of adapters * @param string $adapterfolder Name of folder to append to base path * * @since 3.1 */ public function __construct($basepath = __DIR__, $classprefix = 'JInstallerAdapter', $adapterfolder = 'adapter') { parent::__construct($basepath, $classprefix, $adapterfolder); $this->extension = JTable::getInstance('extension'); } /** * Returns the global Installer object, only creating it if it doesn't already exist. * * @param string $basepath Base Path of the adapters * @param string $classprefix Class prefix of adapters * @param string $adapterfolder Name of folder to append to base path * * @return JInstaller An installer object * * @since 3.1 */ public static function getInstance($basepath = __DIR__, $classprefix = 'JInstallerAdapter', $adapterfolder = 'adapter') { if (!isset(self::$instances[$basepath])) { self::$instances[$basepath] = new JInstaller($basepath, $classprefix, $adapterfolder); // For B/C, we load the first instance into the static $instance container, remove at 4.0 if (!isset(self::$instance)) { self::$instance = self::$instances[$basepath]; } } return self::$instances[$basepath]; } /** * Get the allow overwrite switch * * @return boolean Allow overwrite switch * * @since 3.1 */ public function isOverwrite() { return $this->overwrite; } /** * Set the allow overwrite switch * * @param boolean $state Overwrite switch state * * @return boolean True it state is set, false if it is not * * @since 3.1 */ public function setOverwrite($state = false) { $tmp = $this->overwrite; if ($state) { $this->overwrite = true; } else { $this->overwrite = false; } return $tmp; } /** * Get the redirect location * * @return string Redirect location (or null) * * @since 3.1 */ public function getRedirectUrl() { return $this->redirect_url; } /** * Set the redirect location * * @param string $newurl New redirect location * * @return void * * @since 3.1 */ public function setRedirectUrl($newurl) { $this->redirect_url = $newurl; } /** * Get the upgrade switch * * @return boolean * * @since 3.1 */ public function isUpgrade() { return $this->upgrade; } /** * Set the upgrade switch * * @param boolean $state Upgrade switch state * * @return boolean True if upgrade, false otherwise * * @since 3.1 */ public function setUpgrade($state = false) { $tmp = $this->upgrade; if ($state) { $this->upgrade = true; } else { $this->upgrade = false; } return $tmp; } /** * Get the installation manifest object * * @return object Manifest object * * @since 3.1 */ public function getManifest() { if (!is_object($this->manifest)) { $this->findManifest(); } return $this->manifest; } /** * Get an installer path by name * * @param string $name Path name * @param string $default Default value * * @return string Path * * @since 3.1 */ public function getPath($name, $default = null) { return (!empty($this->paths[$name])) ? $this->paths[$name] : $default; } /** * Sets an installer path by name * * @param string $name Path name * @param string $value Path * * @return void * * @since 3.1 */ public function setPath($name, $value) { $this->paths[$name] = $value; } /** * Pushes a step onto the installer stack for rolling back steps * * @param array $step Installer step * * @return void * * @since 3.1 */ public function pushStep($step) { $this->stepStack[] = $step; } /** * Installation abort method * * @param string $msg Abort message from the installer * @param string $type Package type if defined * * @return boolean True if successful * * @since 3.1 */ public function abort($msg = null, $type = null) { $retval = true; $step = array_pop($this->stepStack); // Raise abort warning if ($msg) { JLog::add($msg, JLog::WARNING, 'jerror'); } while ($step != null) { switch ($step['type']) { case 'file': // Remove the file $stepval = JFile::delete($step['path']); break; case 'folder': // Remove the folder $stepval = JFolder::delete($step['path']); break; case 'query': // Placeholder in case this is necessary in the future // $stepval is always false because if this step was called it invariably failed $stepval = false; break; case 'extension': // Get database connector object $db = $this->getDbo(); $query = $db->getQuery(true); // Remove the entry from the #__extensions table $query->delete($db->quoteName('#__extensions')) ->where($db->quoteName('extension_id') . ' = ' . (int) $step['id']); $db->setQuery($query); $stepval = $db->execute(); break; default: if ($type && is_object($this->_adapters[$type])) { // Build the name of the custom rollback method for the type $method = '_rollback_' . $step['type']; // Custom rollback method handler if (method_exists($this->_adapters[$type], $method)) { $stepval = $this->_adapters[$type]->$method($step); } } else { // Set it to false $stepval = false; } break; } // Only set the return value if it is false if ($stepval === false) { $retval = false; } // Get the next step and continue $step = array_pop($this->stepStack); } return $retval; } // Adapter functions /** * Package installation method * * @param string $path Path to package source folder * * @return boolean True if successful * * @since 3.1 */ public function install($path = null) { if ($path && JFolder::exists($path)) { $this->setPath('source', $path); } else { $this->abort(JText::_('JLIB_INSTALLER_ABORT_NOINSTALLPATH')); return false; } if (!$adapter = $this->setupInstall('install', true)) { $this->abort(JText::_('JLIB_INSTALLER_ABORT_DETECTMANIFEST')); return false; } if (!is_object($adapter)) { return false; } // Add the languages from the package itself if (method_exists($adapter, 'loadLanguage')) { $adapter->loadLanguage($path); } // Fire the onExtensionBeforeInstall event. JPluginHelper::importPlugin('extension'); $dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger( 'onExtensionBeforeInstall', array( 'method' => 'install', 'type' => $this->manifest->attributes()->type, 'manifest' => $this->manifest, 'extension' => 0 ) ); // Run the install $result = $adapter->install(); // Fire the onExtensionAfterInstall $dispatcher->trigger( 'onExtensionAfterInstall', array('installer' => clone $this, 'eid' => $result) ); if ($result !== false) { // Refresh versionable assets cache JFactory::getApplication()->flushAssets(); return true; } return false; } /** * Discovered package installation method * * @param integer $eid Extension ID * * @return boolean True if successful * * @since 3.1 */ public function discover_install($eid = null) { if (!$eid) { $this->abort(JText::_('JLIB_INSTALLER_ABORT_EXTENSIONNOTVALID')); return false; } if (!$this->extension->load($eid)) { $this->abort(JText::_('JLIB_INSTALLER_ABORT_LOAD_DETAILS')); return false; } if ($this->extension->state != -1) { $this->abort(JText::_('JLIB_INSTALLER_ABORT_ALREADYINSTALLED')); return false; } // Load the adapter(s) for the install manifest $type = $this->extension->type; $params = array( 'extension' => $this->extension, 'route' => 'discover_install' ); $adapter = $this->getAdapter($type, $params); if (!is_object($adapter)) { return false; } if (!method_exists($adapter, 'discover_install') || !$adapter->getDiscoverInstallSupported()) { $this->abort(JText::sprintf('JLIB_INSTALLER_ERROR_DISCOVER_INSTALL_UNSUPPORTED', $type)); return false; } // The adapter needs to prepare itself if (method_exists($adapter, 'prepareDiscoverInstall')) { try { $adapter->prepareDiscoverInstall(); } catch (RuntimeException $e) { $this->abort($e->getMessage()); return false; } } // Add the languages from the package itself if (method_exists($adapter, 'loadLanguage')) { $adapter->loadLanguage(); } // Fire the onExtensionBeforeInstall event. JPluginHelper::importPlugin('extension'); $dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger( 'onExtensionBeforeInstall', array( 'method' => 'discover_install', 'type' => $this->extension->get('type'), 'manifest' => null, 'extension' => $this->extension->get('extension_id') ) ); // Run the install $result = $adapter->discover_install(); // Fire the onExtensionAfterInstall $dispatcher->trigger( 'onExtensionAfterInstall', array('installer' => clone $this, 'eid' => $result) ); if ($result !== false) { // Refresh versionable assets cache JFactory::getApplication()->flushAssets(); return true; } return false; } /** * Extension discover method * * Asks each adapter to find extensions * * @return JInstallerExtension[] * * @since 3.1 */ public function discover() { $this->loadAllAdapters(); $results = array(); foreach ($this->_adapters as $adapter) { // Joomla! 1.5 installation adapter legacy support if (method_exists($adapter, 'discover')) { $tmp = $adapter->discover(); // If its an array and has entries if (is_array($tmp) && count($tmp)) { // Merge it into the system $results = array_merge($results, $tmp); } } } return $results; } /** * Package update method * * @param string $path Path to package source folder * * @return boolean True if successful * * @since 3.1 */ public function update($path = null) { if ($path && JFolder::exists($path)) { $this->setPath('source', $path); } else { $this->abort(JText::_('JLIB_INSTALLER_ABORT_NOUPDATEPATH')); return false; } if (!$adapter = $this->setupInstall('update', true)) { $this->abort(JText::_('JLIB_INSTALLER_ABORT_DETECTMANIFEST')); return false; } if (!is_object($adapter)) { return false; } // Add the languages from the package itself if (method_exists($adapter, 'loadLanguage')) { $adapter->loadLanguage($path); } // Fire the onExtensionBeforeUpdate event. JPluginHelper::importPlugin('extension'); $dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger('onExtensionBeforeUpdate', array('type' => $this->manifest->attributes()->type, 'manifest' => $this->manifest)); // Run the update $result = $adapter->update(); // Fire the onExtensionAfterUpdate $dispatcher->trigger( 'onExtensionAfterUpdate', array('installer' => clone $this, 'eid' => $result) ); if ($result !== false) { return true; } return false; } /** * Package uninstallation method * * @param string $type Package type * @param mixed $identifier Package identifier for adapter * @param integer $cid Application ID; deprecated in 1.6 * * @return boolean True if successful * * @since 3.1 */ public function uninstall($type, $identifier, $cid = 0) { $params = array('extension' => $this->extension, 'route' => 'uninstall'); $adapter = $this->getAdapter($type, $params); if (!is_object($adapter)) { return false; } // We don't load languages here, we get the extension adapter to work it out // Fire the onExtensionBeforeUninstall event. JPluginHelper::importPlugin('extension'); $dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger('onExtensionBeforeUninstall', array('eid' => $identifier)); // Run the uninstall $result = $adapter->uninstall($identifier); // Fire the onExtensionAfterInstall $dispatcher->trigger( 'onExtensionAfterUninstall', array('installer' => clone $this, 'eid' => $identifier, 'result' => $result) ); // Refresh versionable assets cache JFactory::getApplication()->flushAssets(); return $result; } /** * Refreshes the manifest cache stored in #__extensions * * @param integer $eid Extension ID * * @return boolean * * @since 3.1 */ public function refreshManifestCache($eid) { if ($eid) { if (!$this->extension->load($eid)) { $this->abort(JText::_('JLIB_INSTALLER_ABORT_LOAD_DETAILS')); return false; } if ($this->extension->state == -1) { $this->abort(JText::_('JLIB_INSTALLER_ABORT_REFRESH_MANIFEST_CACHE')); return false; } // Fetch the adapter $adapter = $this->getAdapter($this->extension->type); if (!is_object($adapter)) { return false; } if (!method_exists($adapter, 'refreshManifestCache')) { $this->abort(JText::sprintf('JLIB_INSTALLER_ABORT_METHODNOTSUPPORTED_TYPE', $this->extension->type)); return false; } $result = $adapter->refreshManifestCache(); if ($result !== false) { return true; } else { return false; } } $this->abort(JText::_('JLIB_INSTALLER_ABORT_REFRESH_MANIFEST_CACHE_VALID')); return false; } // Utility functions /** * Prepare for installation: this method sets the installation directory, finds * and checks the installation file and verifies the installation type. * * @param string $route The install route being followed * @param boolean $returnAdapter Flag to return the instantiated adapter * * @return boolean|JInstallerAdapter JInstallerAdapter object if explicitly requested otherwise boolean * * @since 3.1 */ public function setupInstall($route = 'install', $returnAdapter = false) { // We need to find the installation manifest file if (!$this->findManifest()) { return false; } // Load the adapter(s) for the install manifest $type = (string) $this->manifest->attributes()->type; $params = array('route' => $route, 'manifest' => $this->getManifest()); // Load the adapter $adapter = $this->getAdapter($type, $params); if ($returnAdapter) { return $adapter; } return true; } /** * Backward compatible method to parse through a queries element of the * installation manifest file and take appropriate action. * * @param SimpleXMLElement $element The XML node to process * * @return mixed Number of queries processed or False on error * * @since 3.1 */ public function parseQueries(SimpleXMLElement $element) { // Get the database connector object $db = & $this->_db; if (!$element || !count($element->children())) { // Either the tag does not exist or has no children therefore we return zero files processed. return 0; } // Get the array of query nodes to process $queries = $element->children(); if (count($queries) == 0) { // No queries to process return 0; } // Process each query in the $queries array (children of $tagName). foreach ($queries as $query) { $db->setQuery($query->data()); if (!$db->execute()) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true)), JLog::WARNING, 'jerror'); return false; } } return (int) count($queries); } /** * Method to extract the name of a discreet installation sql file from the installation manifest file. * * @param object $element The XML node to process * * @return mixed Number of queries processed or False on error * * @since 3.1 */ public function parseSQLFiles($element) { if (!$element || !count($element->children())) { // The tag does not exist. return 0; } $queries = array(); $db = & $this->_db; $dbDriver = strtolower($db->name); if ($dbDriver == 'mysqli' || $dbDriver == 'pdomysql') { $dbDriver = 'mysql'; } // Get the name of the sql file to process foreach ($element->children() as $file) { $fCharset = (strtolower($file->attributes()->charset) == 'utf8') ? 'utf8' : ''; $fDriver = strtolower($file->attributes()->driver); if ($fDriver == 'mysqli' || $fDriver == 'pdomysql') { $fDriver = 'mysql'; } if ($fCharset == 'utf8' && $fDriver == $dbDriver) { $sqlfile = $this->getPath('extension_root') . '/' . trim($file); // Check that sql files exists before reading. Otherwise raise error for rollback if (!file_exists($sqlfile)) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_SQL_FILENOTFOUND', $sqlfile), JLog::WARNING, 'jerror'); return false; } $buffer = file_get_contents($sqlfile); // Graceful exit and rollback if read not successful if ($buffer === false) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_SQL_READBUFFER'), JLog::WARNING, 'jerror'); return false; } // Create an array of queries from the sql file $queries = JDatabaseDriver::splitSql($buffer); if (count($queries) == 0) { // No queries to process return 0; } // Process each query in the $queries array (split out of sql file). foreach ($queries as $query) { $query = trim($query); if ($query != '' && $query{0} != '#') { $db->setQuery($query); if (!$db->execute()) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true)), JLog::WARNING, 'jerror'); return false; } } } } } return (int) count($queries); } /** * Set the schema version for an extension by looking at its latest update * * @param SimpleXMLElement $schema Schema Tag * @param integer $eid Extension ID * * @return void * * @since 3.1 */ public function setSchemaVersion(SimpleXMLElement $schema, $eid) { if ($eid && $schema) { $db = JFactory::getDbo(); $schemapaths = $schema->children(); if (!$schemapaths) { return; } if (count($schemapaths)) { $dbDriver = strtolower($db->name); if ($dbDriver == 'mysqli' || $dbDriver == 'pdomysql') { $dbDriver = 'mysql'; } $schemapath = ''; foreach ($schemapaths as $entry) { $attrs = $entry->attributes(); if ($attrs['type'] == $dbDriver) { $schemapath = $entry; break; } } if (strlen($schemapath)) { $files = str_replace('.sql', '', JFolder::files($this->getPath('extension_root') . '/' . $schemapath, '\.sql$')); usort($files, 'version_compare'); // Update the database $query = $db->getQuery(true) ->delete('#__schemas') ->where('extension_id = ' . $eid); $db->setQuery($query); if ($db->execute()) { $query->clear() ->insert($db->quoteName('#__schemas')) ->columns(array($db->quoteName('extension_id'), $db->quoteName('version_id'))) ->values($eid . ', ' . $db->quote(end($files))); $db->setQuery($query); $db->execute(); } } } } } /** * Method to process the updates for an item * * @param SimpleXMLElement $schema The XML node to process * @param integer $eid Extension Identifier * * @return boolean Result of the operations * * @since 3.1 */ public function parseSchemaUpdates(SimpleXMLElement $schema, $eid) { $update_count = 0; // Ensure we have an XML element and a valid extension id if ($eid && $schema) { $db = JFactory::getDbo(); $schemapaths = $schema->children(); if (count($schemapaths)) { $dbDriver = strtolower($db->name); if ($dbDriver == 'mysqli' || $dbDriver == 'pdomysql') { $dbDriver = 'mysql'; } $schemapath = ''; foreach ($schemapaths as $entry) { $attrs = $entry->attributes(); // Assuming that the type is a mandatory attribute but if it is not mandatory then there should be a discussion for it. $uDriver = strtolower($attrs['type']); if ($uDriver == 'mysqli' || $uDriver == 'pdomysql') { $uDriver = 'mysql'; } if ($uDriver == $dbDriver) { $schemapath = $entry; break; } } if (strlen($schemapath)) { $files = str_replace('.sql', '', JFolder::files($this->getPath('extension_root') . '/' . $schemapath, '\.sql$')); usort($files, 'version_compare'); if (!count($files)) { return false; } $query = $db->getQuery(true) ->select('version_id') ->from('#__schemas') ->where('extension_id = ' . $eid); $db->setQuery($query); $version = $db->loadResult(); // No version - use initial version. if (!$version) { $version = '0.0.0'; } foreach ($files as $file) { if (version_compare($file, $version) > 0) { $buffer = file_get_contents($this->getPath('extension_root') . '/' . $schemapath . '/' . $file . '.sql'); // Graceful exit and rollback if read not successful if ($buffer === false) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_SQL_READBUFFER'), JLog::WARNING, 'jerror'); return false; } // Create an array of queries from the sql file $queries = JDatabaseDriver::splitSql($buffer); if (count($queries) == 0) { // No queries to process continue; } // Process each query in the $queries array (split out of sql file). foreach ($queries as $query) { $query = trim($query); if ($query != '' && $query{0} != '#') { $db->setQuery($query); if (!$db->execute()) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true)), JLog::WARNING, 'jerror'); return false; } else { $queryString = (string) $query; $queryString = str_replace(array("\r", "\n"), array('', ' '), substr($queryString, 0, 80)); JLog::add(JText::sprintf('JLIB_INSTALLER_UPDATE_LOG_QUERY', $file, $queryString), JLog::INFO, 'Update'); } $update_count++; } } } } // Update the database $query = $db->getQuery(true) ->delete('#__schemas') ->where('extension_id = ' . $eid); $db->setQuery($query); if ($db->execute()) { $query->clear() ->insert($db->quoteName('#__schemas')) ->columns(array($db->quoteName('extension_id'), $db->quoteName('version_id'))) ->values($eid . ', ' . $db->quote(end($files))); $db->setQuery($query); $db->execute(); } } } } return $update_count; } /** * Method to parse through a files element of the installation manifest and take appropriate * action. * * @param SimpleXMLElement $element The XML node to process * @param integer $cid Application ID of application to install to * @param array $oldFiles List of old files (SimpleXMLElement's) * @param array $oldMD5 List of old MD5 sums (indexed by filename with value as MD5) * * @return boolean True on success * * @since 3.1 */ public function parseFiles(SimpleXMLElement $element, $cid = 0, $oldFiles = null, $oldMD5 = null) { // Get the array of file nodes to process; we checked whether this had children above. if (!$element || !count($element->children())) { // Either the tag does not exist or has no children (hence no files to process) therefore we return zero files processed. return 0; } $copyfiles = array(); // Get the client info $client = JApplicationHelper::getClientInfo($cid); /* * Here we set the folder we are going to remove the files from. */ if ($client) { $pathname = 'extension_' . $client->name; $destination = $this->getPath($pathname); } else { $pathname = 'extension_root'; $destination = $this->getPath($pathname); } /* * Here we set the folder we are going to copy the files from. * * Does the element have a folder attribute? * * If so this indicates that the files are in a subdirectory of the source * folder and we should append the folder attribute to the source path when * copying files. */ $folder = (string) $element->attributes()->folder; if ($folder && file_exists($this->getPath('source') . '/' . $folder)) { $source = $this->getPath('source') . '/' . $folder; } else { $source = $this->getPath('source'); } // Work out what files have been deleted if ($oldFiles && ($oldFiles instanceof SimpleXMLElement)) { $oldEntries = $oldFiles->children(); if (count($oldEntries)) { $deletions = $this->findDeletedFiles($oldEntries, $element->children()); foreach ($deletions['folders'] as $deleted_folder) { JFolder::delete($destination . '/' . $deleted_folder); } foreach ($deletions['files'] as $deleted_file) { JFile::delete($destination . '/' . $deleted_file); } } } $path = array(); // Copy the MD5SUMS file if it exists if (file_exists($source . '/MD5SUMS')) { $path['src'] = $source . '/MD5SUMS'; $path['dest'] = $destination . '/MD5SUMS'; $path['type'] = 'file'; $copyfiles[] = $path; } // Process each file in the $files array (children of $tagName). foreach ($element->children() as $file) { $path['src'] = $source . '/' . $file; $path['dest'] = $destination . '/' . $file; // Is this path a file or folder? $path['type'] = ($file->getName() == 'folder') ? 'folder' : 'file'; /* * Before we can add a file to the copyfiles array we need to ensure * that the folder we are copying our file to exits and if it doesn't, * we need to create it. */ if (basename($path['dest']) != $path['dest']) { $newdir = dirname($path['dest']); if (!JFolder::create($newdir)) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_CREATE_DIRECTORY', $newdir), JLog::WARNING, 'jerror'); return false; } } // Add the file to the copyfiles array $copyfiles[] = $path; } return $this->copyFiles($copyfiles); } /** * Method to parse through a languages element of the installation manifest and take appropriate * action. * * @param SimpleXMLElement $element The XML node to process * @param integer $cid Application ID of application to install to * * @return boolean True on success * * @since 3.1 */ public function parseLanguages(SimpleXMLElement $element, $cid = 0) { // TODO: work out why the below line triggers 'node no longer exists' errors with files if (!$element || !count($element->children())) { // Either the tag does not exist or has no children therefore we return zero files processed. return 0; } $copyfiles = array(); // Get the client info $client = JApplicationHelper::getClientInfo($cid); // Here we set the folder we are going to copy the files to. // 'languages' Files are copied to JPATH_BASE/language/ folder $destination = $client->path . '/language'; /* * Here we set the folder we are going to copy the files from. * * Does the element have a folder attribute? * * If so this indicates that the files are in a subdirectory of the source * folder and we should append the folder attribute to the source path when * copying files. */ $folder = (string) $element->attributes()->folder; if ($folder && file_exists($this->getPath('source') . '/' . $folder)) { $source = $this->getPath('source') . '/' . $folder; } else { $source = $this->getPath('source'); } // Process each file in the $files array (children of $tagName). foreach ($element->children() as $file) { /* * Language files go in a subfolder based on the language code, ie. * <language tag="en-US">en-US.mycomponent.ini</language> * would go in the en-US subdirectory of the language folder. */ // We will only install language files where a core language pack // already exists. if ((string) $file->attributes()->tag != '') { $path['src'] = $source . '/' . $file; if ((string) $file->attributes()->client != '') { // Override the client $langclient = JApplicationHelper::getClientInfo((string) $file->attributes()->client, true); $path['dest'] = $langclient->path . '/language/' . $file->attributes()->tag . '/' . basename((string) $file); } else { // Use the default client $path['dest'] = $destination . '/' . $file->attributes()->tag . '/' . basename((string) $file); } // If the language folder is not present, then the core pack hasn't been installed... ignore if (!JFolder::exists(dirname($path['dest']))) { continue; } } else { $path['src'] = $source . '/' . $file; $path['dest'] = $destination . '/' . $file; } /* * Before we can add a file to the copyfiles array we need to ensure * that the folder we are copying our file to exits and if it doesn't, * we need to create it. */ if (basename($path['dest']) != $path['dest']) { $newdir = dirname($path['dest']); if (!JFolder::create($newdir)) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_CREATE_DIRECTORY', $newdir), JLog::WARNING, 'jerror'); return false; } } // Add the file to the copyfiles array $copyfiles[] = $path; } return $this->copyFiles($copyfiles); } /** * Method to parse through a media element of the installation manifest and take appropriate * action. * * @param SimpleXMLElement $element The XML node to process * @param integer $cid Application ID of application to install to * * @return boolean True on success * * @since 3.1 */ public function parseMedia(SimpleXMLElement $element, $cid = 0) { if (!$element || !count($element->children())) { // Either the tag does not exist or has no children therefore we return zero files processed. return 0; } $copyfiles = array(); // Here we set the folder we are going to copy the files to. // Default 'media' Files are copied to the JPATH_BASE/media folder $folder = ((string) $element->attributes()->destination) ? '/' . $element->attributes()->destination : null; $destination = JPath::clean(JPATH_ROOT . '/media' . $folder); // Here we set the folder we are going to copy the files from. /* * Does the element have a folder attribute? * If so this indicates that the files are in a subdirectory of the source * folder and we should append the folder attribute to the source path when * copying files. */ $folder = (string) $element->attributes()->folder; if ($folder && file_exists($this->getPath('source') . '/' . $folder)) { $source = $this->getPath('source') . '/' . $folder; } else { $source = $this->getPath('source'); } // Process each file in the $files array (children of $tagName). foreach ($element->children() as $file) { $path['src'] = $source . '/' . $file; $path['dest'] = $destination . '/' . $file; // Is this path a file or folder? $path['type'] = ($file->getName() == 'folder') ? 'folder' : 'file'; /* * Before we can add a file to the copyfiles array we need to ensure * that the folder we are copying our file to exits and if it doesn't, * we need to create it. */ if (basename($path['dest']) != $path['dest']) { $newdir = dirname($path['dest']); if (!JFolder::create($newdir)) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_CREATE_DIRECTORY', $newdir), JLog::WARNING, 'jerror'); return false; } } // Add the file to the copyfiles array $copyfiles[] = $path; } return $this->copyFiles($copyfiles); } /** * Method to parse the parameters of an extension, build the INI * string for its default parameters, and return the INI string. * * @return string INI string of parameter values * * @since 3.1 */ public function getParams() { // Validate that we have a fieldset to use if (!isset($this->manifest->config->fields->fieldset)) { return '{}'; } // Getting the fieldset tags $fieldsets = $this->manifest->config->fields->fieldset; // Creating the data collection variable: $ini = array(); // Iterating through the fieldsets: foreach ($fieldsets as $fieldset) { if (!count($fieldset->children())) { // Either the tag does not exist or has no children therefore we return zero files processed. return null; } // Iterating through the fields and collecting the name/default values: foreach ($fieldset as $field) { // Check against the null value since otherwise default values like "0" // cause entire parameters to be skipped. if (($name = $field->attributes()->name) === null) { continue; } if (($value = $field->attributes()->default) === null) { continue; } $ini[(string) $name] = (string) $value; } } return json_encode($ini); } /** * Copyfiles * * Copy files from source directory to the target directory * * @param array $files Array with filenames * @param boolean $overwrite True if existing files can be replaced * * @return boolean True on success * * @since 3.1 */ public function copyFiles($files, $overwrite = null) { /* * To allow for manual override on the overwriting flag, we check to see if * the $overwrite flag was set and is a boolean value. If not, use the object * allowOverwrite flag. */ if (is_null($overwrite) || !is_bool($overwrite)) { $overwrite = $this->overwrite; } /* * $files must be an array of filenames. Verify that it is an array with * at least one file to copy. */ if (is_array($files) && count($files) > 0) { foreach ($files as $file) { // Get the source and destination paths $filesource = JPath::clean($file['src']); $filedest = JPath::clean($file['dest']); $filetype = array_key_exists('type', $file) ? $file['type'] : 'file'; if (!file_exists($filesource)) { /* * The source file does not exist. Nothing to copy so set an error * and return false. */ JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_NO_FILE', $filesource), JLog::WARNING, 'jerror'); return false; } elseif (($exists = file_exists($filedest)) && !$overwrite) { // It's okay if the manifest already exists if ($this->getPath('manifest') == $filesource) { continue; } // The destination file already exists and the overwrite flag is false. // Set an error and return false. JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_FILE_EXISTS', $filedest), JLog::WARNING, 'jerror'); return false; } else { // Copy the folder or file to the new location. if ($filetype == 'folder') { if (!(JFolder::copy($filesource, $filedest, null, $overwrite))) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_FAIL_COPY_FOLDER', $filesource, $filedest), JLog::WARNING, 'jerror'); return false; } $step = array('type' => 'folder', 'path' => $filedest); } else { if (!(JFile::copy($filesource, $filedest, null))) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_FAIL_COPY_FILE', $filesource, $filedest), JLog::WARNING, 'jerror'); // In 3.2, TinyMCE language handling changed. Display a special notice in case an older language pack is installed. if (strpos($filedest, 'media/editors/tinymce/jscripts/tiny_mce/langs')) { JLog::add(JText::_('JLIB_INSTALLER_NOT_ERROR'), JLog::WARNING, 'jerror'); } return false; } $step = array('type' => 'file', 'path' => $filedest); } /* * Since we copied a file/folder, we want to add it to the installation step stack so that * in case we have to roll back the installation we can remove the files copied. */ if (!$exists) { $this->stepStack[] = $step; } } } } else { // The $files variable was either not an array or an empty array return false; } return count($files); } /** * Method to parse through a files element of the installation manifest and remove * the files that were installed * * @param object $element The XML node to process * @param integer $cid Application ID of application to remove from * * @return boolean True on success * * @since 3.1 */ public function removeFiles($element, $cid = 0) { if (!$element || !count($element->children())) { // Either the tag does not exist or has no children therefore we return zero files processed. return true; } $retval = true; // Get the client info if we're using a specific client if ($cid > -1) { $client = JApplicationHelper::getClientInfo($cid); } else { $client = null; } // Get the array of file nodes to process $files = $element->children(); if (count($files) == 0) { // No files to process return true; } $folder = ''; /* * Here we set the folder we are going to remove the files from. There are a few * special cases that need to be considered for certain reserved tags. */ switch ($element->getName()) { case 'media': if ((string) $element->attributes()->destination) { $folder = (string) $element->attributes()->destination; } else { $folder = ''; } $source = $client->path . '/media/' . $folder; break; case 'languages': $lang_client = (string) $element->attributes()->client; if ($lang_client) { $client = JApplicationHelper::getClientInfo($lang_client, true); $source = $client->path . '/language'; } else { if ($client) { $source = $client->path . '/language'; } else { $source = ''; } } break; default: if ($client) { $pathname = 'extension_' . $client->name; $source = $this->getPath($pathname); } else { $pathname = 'extension_root'; $source = $this->getPath($pathname); } break; } // Process each file in the $files array (children of $tagName). foreach ($files as $file) { /* * If the file is a language, we must handle it differently. Language files * go in a subdirectory based on the language code, ie. * <language tag="en_US">en_US.mycomponent.ini</language> * would go in the en_US subdirectory of the languages directory. */ if ($file->getName() == 'language' && (string) $file->attributes()->tag != '') { if ($source) { $path = $source . '/' . $file->attributes()->tag . '/' . basename((string) $file); } else { $target_client = JApplicationHelper::getClientInfo((string) $file->attributes()->client, true); $path = $target_client->path . '/language/' . $file->attributes()->tag . '/' . basename((string) $file); } // If the language folder is not present, then the core pack hasn't been installed... ignore if (!JFolder::exists(dirname($path))) { continue; } } else { $path = $source . '/' . $file; } // Actually delete the files/folders if (is_dir($path)) { $val = JFolder::delete($path); } else { $val = JFile::delete($path); } if ($val === false) { JLog::add('Failed to delete ' . $path, JLog::WARNING, 'jerror'); $retval = false; } } if (!empty($folder)) { JFolder::delete($source); } return $retval; } /** * Copies the installation manifest file to the extension folder in the given client * * @param integer $cid Where to copy the installfile [optional: defaults to 1 (admin)] * * @return boolean True on success, False on error * * @since 3.1 */ public function copyManifest($cid = 1) { // Get the client info $client = JApplicationHelper::getClientInfo($cid); $path['src'] = $this->getPath('manifest'); if ($client) { $pathname = 'extension_' . $client->name; $path['dest'] = $this->getPath($pathname) . '/' . basename($this->getPath('manifest')); } else { $pathname = 'extension_root'; $path['dest'] = $this->getPath($pathname) . '/' . basename($this->getPath('manifest')); } return $this->copyFiles(array($path), true); } /** * Tries to find the package manifest file * * @return boolean True on success, False on error * * @since 3.1 */ public function findManifest() { // Do nothing if folder does not exist for some reason if (!JFolder::exists($this->getPath('source'))) { return false; } // Main folder manifests (higher priority) $parentXmlfiles = JFolder::files($this->getPath('source'), '.xml$', false, true); // Search for children manifests (lower priority) $allXmlFiles = JFolder::files($this->getPath('source'), '.xml$', 1, true); // Create an unique array of files ordered by priority $xmlfiles = array_unique(array_merge($parentXmlfiles, $allXmlFiles)); // If at least one XML file exists if (!empty($xmlfiles)) { foreach ($xmlfiles as $file) { // Is it a valid Joomla installation manifest file? $manifest = $this->isManifest($file); if (!is_null($manifest)) { // If the root method attribute is set to upgrade, allow file overwrite if ((string) $manifest->attributes()->method == 'upgrade') { $this->upgrade = true; $this->overwrite = true; } // If the overwrite option is set, allow file overwriting if ((string) $manifest->attributes()->overwrite == 'true') { $this->overwrite = true; } // Set the manifest object and path $this->manifest = $manifest; $this->setPath('manifest', $file); // Set the installation source path to that of the manifest file $this->setPath('source', dirname($file)); return true; } } // None of the XML files found were valid install files JLog::add(JText::_('JLIB_INSTALLER_ERROR_NOTFINDJOOMLAXMLSETUPFILE'), JLog::WARNING, 'jerror'); return false; } else { // No XML files were found in the install folder JLog::add(JText::_('JLIB_INSTALLER_ERROR_NOTFINDXMLSETUPFILE'), JLog::WARNING, 'jerror'); return false; } } /** * Is the XML file a valid Joomla installation manifest file. * * @param string $file An xmlfile path to check * * @return mixed A SimpleXMLElement, or null if the file failed to parse * * @since 3.1 */ public function isManifest($file) { $xml = simplexml_load_file($file); // If we cannot load the XML file return null if (!$xml) { return null; } // Check for a valid XML root tag. if ($xml->getName() != 'extension') { return null; } // Valid manifest file return the object return $xml; } /** * Generates a manifest cache * * @return string serialised manifest data * * @since 3.1 */ public function generateManifestCache() { return json_encode(self::parseXMLInstallFile($this->getPath('manifest'))); } /** * Cleans up discovered extensions if they're being installed some other way * * @param string $type The type of extension (component, etc) * @param string $element Unique element identifier (e.g. com_content) * @param string $folder The folder of the extension (plugins; e.g. system) * @param integer $client The client application (administrator or site) * * @return object Result of query * * @since 3.1 */ public function cleanDiscoveredExtension($type, $element, $folder = '', $client = 0) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->delete($db->quoteName('#__extensions')) ->where('type = ' . $db->quote($type)) ->where('element = ' . $db->quote($element)) ->where('folder = ' . $db->quote($folder)) ->where('client_id = ' . (int) $client) ->where('state = -1'); $db->setQuery($query); return $db->execute(); } /** * Compares two "files" entries to find deleted files/folders * * @param array $old_files An array of SimpleXMLElement objects that are the old files * @param array $new_files An array of SimpleXMLElement objects that are the new files * * @return array An array with the delete files and folders in findDeletedFiles[files] and findDeletedFiles[folders] respectively * * @since 3.1 */ public function findDeletedFiles($old_files, $new_files) { // The magic find deleted files function! // The files that are new $files = array(); // The folders that are new $folders = array(); // The folders of the files that are new $containers = array(); // A list of files to delete $files_deleted = array(); // A list of folders to delete $folders_deleted = array(); foreach ($new_files as $file) { switch ($file->getName()) { case 'folder': // Add any folders to the list $folders[] = (string) $file; // add any folders to the list break; case 'file': default: // Add any files to the list $files[] = (string) $file; // Now handle the folder part of the file to ensure we get any containers // Break up the parts of the directory $container_parts = explode('/', dirname((string) $file)); // Make sure this is clean and empty $container = ''; foreach ($container_parts as $part) { // Iterate through each part // Add a slash if its not empty if (!empty($container)) { $container .= '/'; } // Aappend the folder part $container .= $part; if (!in_array($container, $containers)) { // Add the container if it doesn't already exist $containers[] = $container; } } break; } } foreach ($old_files as $file) { switch ($file->getName()) { case 'folder': if (!in_array((string) $file, $folders)) { // See whether the folder exists in the new list if (!in_array((string) $file, $containers)) { // Check if the folder exists as a container in the new list // If it's not in the new list or a container then delete it $folders_deleted[] = (string) $file; } } break; case 'file': default: if (!in_array((string) $file, $files)) { // Look if the file exists in the new list if (!in_array(dirname((string) $file), $folders)) { // Look if the file is now potentially in a folder $files_deleted[] = (string) $file; // not in a folder, doesn't exist, wipe it out! } } break; } } return array('files' => $files_deleted, 'folders' => $folders_deleted); } /** * Loads an MD5SUMS file into an associative array * * @param string $filename Filename to load * * @return array Associative array with filenames as the index and the MD5 as the value * * @since 3.1 */ public function loadMD5Sum($filename) { if (!file_exists($filename)) { // Bail if the file doesn't exist return false; } $data = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $retval = array(); foreach ($data as $row) { // Split up the data $results = explode(' ', $row); // Cull any potential prefix $results[1] = str_replace('./', '', $results[1]); // Throw into the array $retval[$results[1]] = $results[0]; } return $retval; } /** * Parse a XML install manifest file. * * XML Root tag should be 'install' except for languages which use meta file. * * @param string $path Full path to XML file. * * @return array XML metadata. * * @since 12.1 */ public static function parseXMLInstallFile($path) { // Read the file to see if it's a valid component XML file $xml = simplexml_load_file($path); if (!$xml) { return false; } // Check for a valid XML root tag. // Extensions use 'extension' as the root tag. Languages use 'metafile' instead if ($xml->getName() != 'extension' && $xml->getName() != 'metafile') { unset($xml); return false; } $data = array(); $data['name'] = (string) $xml->name; // Check if we're a language. If so use metafile. $data['type'] = $xml->getName() == 'metafile' ? 'language' : (string) $xml->attributes()->type; $data['creationDate'] = ((string) $xml->creationDate) ? (string) $xml->creationDate : JText::_('Unknown'); $data['author'] = ((string) $xml->author) ? (string) $xml->author : JText::_('Unknown'); $data['copyright'] = (string) $xml->copyright; $data['authorEmail'] = (string) $xml->authorEmail; $data['authorUrl'] = (string) $xml->authorUrl; $data['version'] = (string) $xml->version; $data['description'] = (string) $xml->description; $data['group'] = (string) $xml->group; if ($xml->files && count($xml->files->children())) { $filename = JFile::getName($path); $data['filename'] = JFile::stripExt($filename); foreach ($xml->files->children() as $oneFile) { if ((string) $oneFile->attributes()->plugin) { $data['filename'] = (string) $oneFile->attributes()->plugin; break; } } } return $data; } /** * Fetches an adapter and adds it to the internal storage if an instance is not set * while also ensuring its a valid adapter name * * @param string $name Name of adapter to return * @param array $options Adapter options * * @return JInstallerAdapter * * @since 3.4 * @deprecated 4.0 The internal adapter cache will no longer be supported, * use loadAdapter() to fetch an adapter instance */ public function getAdapter($name, $options = array()) { $this->getAdapters($options); if (!$this->setAdapter($name, $this->_adapters[$name])) { return false; } return $this->_adapters[$name]; } /** * Gets a list of available install adapters. * * @param array $options An array of options to inject into the adapter * @param array $custom Array of custom install adapters * * @return array An array of available install adapters. * * @since 3.4 * @note As of 4.0, this method will only return the names of available adapters and will not * instantiate them and store to the $_adapters class var. */ public function getAdapters($options = array(), array $custom = array()) { $files = new DirectoryIterator($this->_basepath . '/' . $this->_adapterfolder); // Process the core adapters foreach ($files as $file) { $fileName = $file->getFilename(); // Only load for php files. if (!$file->isFile() || $file->getExtension() != 'php') { continue; } // Derive the class name from the filename. $name = str_ireplace('.php', '', trim($fileName)); $class = $this->_classprefix . ucfirst($name); // Core adapters should autoload based on classname, keep this fallback just in case if (!class_exists($class)) { // Try to load the adapter object require_once $this->_basepath . '/' . $this->_adapterfolder . '/' . $fileName; if (!class_exists($class)) { // Skip to next one continue; } } $this->_adapters[$name] = $this->loadAdapter($name, $options); } // Add any custom adapters if specified if (count($custom) >= 1) { foreach ($custom as $adapter) { // Setup the class name // TODO - Can we abstract this to not depend on the Joomla class namespace without PHP namespaces? $class = $this->_classprefix . ucfirst(trim($adapter)); // If the class doesn't exist we have nothing left to do but look at the next type. We did our best. if (!class_exists($class)) { continue; } $this->_adapters[$name] = $this->loadAdapter($name, $options); } } return $this->_adapters; } /** * Method to load an adapter instance * * @param string $adapter Adapter name * @param array $options Adapter options * * @return JInstallerAdapter * * @since 3.4 * @throws InvalidArgumentException */ public function loadAdapter($adapter, $options = array()) { $class = $this->_classprefix . ucfirst($adapter); if (!class_exists($class)) { // @deprecated 4.0 - The adapter should be autoloaded or manually included by the caller $path = $this->_basepath . '/' . $this->_adapterfolder . '/' . $adapter . '.php'; // Try to load the adapter object if (!file_exists($path)) { throw new InvalidArgumentException(sprintf('The %s install adapter does not exist.', $adapter)); } // Try once more to find the class require_once $path; if (!class_exists($class)) { throw new InvalidArgumentException(sprintf('The %s install adapter does not exist.', $adapter)); } } // Ensure the adapter type is part of the options array $options['type'] = $adapter; return new $class($this, $this->getDbo(), $options); } /** * Loads all adapters. * * @param array $options Adapter options * * @return void * * @since 3.4 * @deprecated 4.0 Individual adapters should be instantiated as needed * @note This method is serving as a proxy of the legacy JAdapter API into the preferred API */ public function loadAllAdapters($options = array()) { $this->getAdapters($options); } } PK���\`��c8@8@,libraries/cms/installer/adapter/template.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); /** * Template installer * * @since 3.1 */ class JInstallerAdapterTemplate extends JInstallerAdapter { /** * The install client ID * * @var integer * @since 3.4 */ protected $clientId; /** * Method to check if the extension is already present in the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function checkExistingExtension() { try { $this->currentExtensionId = $this->extension->find( array( 'element' => $this->element, 'type' => $this->type, 'client_id' => $this->clientId ) ); } catch (RuntimeException $e) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_ROLLBACK', JText::_('JLIB_INSTALLER_' . $this->route), $e->getMessage() ) ); } } /** * Method to copy the extension's base files from the <files> tag(s) and the manifest file * * @return void * * @since 3.4 * @throws RuntimeException */ protected function copyBaseFiles() { // Copy all the necessary files if ($this->parent->parseFiles($this->getManifest()->files, -1) === false) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_TPL_INSTALL_COPY_FILES', 'files' ) ); } if ($this->parent->parseFiles($this->getManifest()->images, -1) === false) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_TPL_INSTALL_COPY_FILES', 'images' ) ); } if ($this->parent->parseFiles($this->getManifest()->css, -1) === false) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_TPL_INSTALL_COPY_FILES', 'css' ) ); } // If there is a manifest script, let's copy it. if ($this->manifest_script) { $path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script; $path['dest'] = $this->parent->getPath('extension_root') . '/' . $this->manifest_script; if (!file_exists($path['dest']) || $this->parent->isOverwrite()) { if (!$this->parent->copyFiles(array($path))) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_MANIFEST', JText::_('JLIB_INSTALLER_' . strtoupper($this->getRoute())) ) ); } } } } /** * Method to finalise the installation processing * * @return void * * @since 3.1 * @throws RuntimeException */ protected function finaliseInstall() { // Clobber any possible pending updates /** @var JTableUpdate $update */ $update = JTable::getInstance('update'); $uid = $update->find( array( 'element' => $this->element, 'type' => $this->type, 'client_id' => $this->clientId ) ); if ($uid) { $update->delete($uid); } // Lastly, we will copy the manifest file to its appropriate place. if ($this->route != 'discover_install') { if (!$this->parent->copyManifest(-1)) { // Install failed, rollback changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_TPL_INSTALL_COPY_SETUP')); } } } /** * Custom loadLanguage method * * @param string $path The path where to find language files. * * @return JInstallerTemplate * * @since 3.1 */ public function loadLanguage($path = null) { $source = $this->parent->getPath('source'); $basePath = $this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE; if (!$source) { $this->parent->setPath('source', $basePath . '/templates/' . $this->parent->extension->element); } $this->setManifest($this->parent->getManifest()); $client = (string) $this->getManifest()->attributes()->client; // Load administrator language if not set. if (!$client) { $client = 'ADMINISTRATOR'; } $base = constant('JPATH_' . strtoupper($client)); $extension = 'tpl_' . $this->getName(); $source = $path ? $path : $base . '/templates/' . $this->getName(); $this->doLoadLanguage($extension, $source, $base); } /** * Method to parse optional tags in the manifest * * @return void * * @since 3.4 */ protected function parseOptionalTags() { $this->parent->parseMedia($this->getManifest()->media); $this->parent->parseLanguages($this->getManifest()->languages, $this->clientId); } /** * Overloaded method to parse queries for template installations * * @return void * * @since 3.4 * @throws RuntimeException */ protected function parseQueries() { if (in_array($this->route, array('install', 'discover_install'))) { $db = $this->db; $lang = JFactory::getLanguage(); $debug = $lang->setDebug(false); $columns = array($db->quoteName('template'), $db->quoteName('client_id'), $db->quoteName('home'), $db->quoteName('title'), $db->quoteName('params') ); $values = array( $db->quote($this->extension->element), $this->extension->client_id, $db->quote(0), $db->quote(JText::sprintf('JLIB_INSTALLER_DEFAULT_STYLE', JText::_($this->extension->name))), $db->quote($this->extension->params)); $lang->setDebug($debug); // Insert record in #__template_styles $query = $db->getQuery(true); $query->insert($db->quoteName('#__template_styles')) ->columns($columns) ->values(implode(',', $values)); // There is a chance this could fail but we don't care... $db->setQuery($query)->execute(); } } /** * Prepares the adapter for a discover_install task * * @return void * * @since 3.4 */ public function prepareDiscoverInstall() { $client = JApplicationHelper::getClientInfo($this->extension->client_id); $manifestPath = $client->path . '/templates/' . $this->extension->element . '/templateDetails.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $this->setManifest($this->parent->getManifest()); } /** * Method to do any prechecks and setup the install paths for the extension * * @return void * * @since 3.4 * @throws RuntimeException */ protected function setupInstallPaths() { // Get the client application target $cname = (string) $this->getManifest()->attributes()->client; if ($cname) { // Attempt to map the client to a base path $client = JApplicationHelper::getClientInfo($cname, true); if ($client === false) { throw new RuntimeException(JText::sprintf('JLIB_INSTALLER_ABORT_TPL_INSTALL_UNKNOWN_CLIENT', $cname)); } $basePath = $client->path; $this->clientId = $client->id; } else { // No client attribute was found so we assume the site as the client $basePath = JPATH_SITE; $this->clientId = 0; } // Set the template root path if (empty($this->element)) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_MOD_INSTALL_NOFILE', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)) ) ); } $this->parent->setPath('extension_root', $basePath . '/templates/' . $this->element); } /** * Method to store the extension to the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function storeExtension() { // Discover installs are stored a little differently if ($this->route == 'discover_install') { $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->extension->manifest_cache = json_encode($manifest_details); $this->extension->state = 0; $this->extension->name = $manifest_details['name']; $this->extension->enabled = 1; $this->extension->params = $this->parent->getParams(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ERROR_TPL_DISCOVER_STORE_DETAILS')); } return; } // Was there a template already installed with the same name? if ($this->currentExtensionId) { if (!$this->parent->isOverwrite()) { // Install failed, roll back changes throw new RuntimeException( JText::_('JLIB_INSTALLER_ABORT_TPL_INSTALL_ALREADY_INSTALLED') ); } // Load the entry and update the manifest_cache $this->extension->load($this->currentExtensionId); } else { $this->extension->type = 'template'; $this->extension->element = $this->element; // There is no folder for templates $this->extension->folder = ''; $this->extension->enabled = 1; $this->extension->protected = 0; $this->extension->access = 1; $this->extension->client_id = $this->clientId; $this->extension->params = $this->parent->getParams(); // Custom data $this->extension->custom_data = ''; } // Name might change in an update $this->extension->name = $this->name; $this->extension->manifest_cache = $this->parent->generateManifestCache(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_ROLLBACK', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->extension->getError() ) ); } } /** * Custom uninstall method * * @param integer $id The extension ID * * @return boolean True on success * * @since 3.1 */ public function uninstall($id) { // First order of business will be to load the template object table from the database. // This should give us the necessary information to proceed. $row = JTable::getInstance('extension'); if (!$row->load((int) $id) || !strlen($row->element)) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_TPL_UNINSTALL_ERRORUNKOWNEXTENSION'), JLog::WARNING, 'jerror'); return false; } // Is the template we are trying to uninstall a core one? // Because that is not a good idea... if ($row->protected) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_TPL_UNINSTALL_WARNCORETEMPLATE', $row->name), JLog::WARNING, 'jerror'); return false; } $name = $row->element; $clientId = $row->client_id; // For a template the id will be the template name which represents the subfolder of the templates folder that the template resides in. if (!$name) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_ID_EMPTY'), JLog::WARNING, 'jerror'); return false; } // Deny remove default template $db = $this->parent->getDbo(); $query = "SELECT COUNT(*) FROM #__template_styles WHERE home = '1' AND template = " . $db->quote($name); $db->setQuery($query); if ($db->loadResult() != 0) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_DEFAULT'), JLog::WARNING, 'jerror'); return false; } // Get the template root path $client = JApplicationHelper::getClientInfo($clientId); if (!$client) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_CLIENT'), JLog::WARNING, 'jerror'); return false; } $this->parent->setPath('extension_root', $client->path . '/templates/' . strtolower($name)); $this->parent->setPath('source', $this->parent->getPath('extension_root')); // We do findManifest to avoid problem when uninstalling a list of extensions: getManifest cache its manifest file $this->parent->findManifest(); $manifest = $this->parent->getManifest(); if (!($manifest instanceof SimpleXMLElement)) { // Kill the extension entry $row->delete($row->extension_id); unset($row); // Make sure we delete the folders JFolder::delete($this->parent->getPath('extension_root')); JLog::add(JText::_('JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_NOTFOUND_MANIFEST'), JLog::WARNING, 'jerror'); return false; } // Remove files $this->parent->removeFiles($manifest->media); $this->parent->removeFiles($manifest->languages, $clientId); // Delete the template directory if (JFolder::exists($this->parent->getPath('extension_root'))) { $retval = JFolder::delete($this->parent->getPath('extension_root')); } else { JLog::add(JText::_('JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_DIRECTORY'), JLog::WARNING, 'jerror'); $retval = false; } // Set menu that assigned to the template back to default template $query = 'UPDATE #__menu' . ' SET template_style_id = 0' . ' WHERE template_style_id in (' . ' SELECT s.id FROM #__template_styles s' . ' WHERE s.template = ' . $db->quote(strtolower($name)) . ' AND s.client_id = ' . $clientId . ')'; $db->setQuery($query); $db->execute(); $query = $db->getQuery(true) ->delete($db->quoteName('#__template_styles')) ->where($db->quoteName('template') . ' = ' . $db->quote($name)) ->where($db->quoteName('client_id') . ' = ' . $clientId); $db->setQuery($query); $db->execute(); $row->delete($row->extension_id); unset($row); return $retval; } /** * Discover existing but uninstalled templates * * @return array JExtensionTable list */ public function discover() { $results = array(); $site_list = JFolder::folders(JPATH_SITE . '/templates'); $admin_list = JFolder::folders(JPATH_ADMINISTRATOR . '/templates'); $site_info = JApplicationHelper::getClientInfo('site', true); $admin_info = JApplicationHelper::getClientInfo('administrator', true); foreach ($site_list as $template) { if (file_exists(JPATH_SITE . "/templates/$template/templateDetails.xml")) { if ($template == 'system') { // Ignore special system template continue; } $manifest_details = JInstaller::parseXMLInstallFile(JPATH_SITE . "/templates/$template/templateDetails.xml"); $extension = JTable::getInstance('extension'); $extension->set('type', 'template'); $extension->set('client_id', $site_info->id); $extension->set('element', $template); $extension->set('folder', ''); $extension->set('name', $template); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = $extension; } } foreach ($admin_list as $template) { if (file_exists(JPATH_ADMINISTRATOR . "/templates/$template/templateDetails.xml")) { if ($template == 'system') { // Ignore special system template continue; } $manifest_details = JInstaller::parseXMLInstallFile(JPATH_ADMINISTRATOR . "/templates/$template/templateDetails.xml"); $extension = JTable::getInstance('extension'); $extension->set('type', 'template'); $extension->set('client_id', $admin_info->id); $extension->set('element', $template); $extension->set('folder', ''); $extension->set('name', $template); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = $extension; } } return $results; } /** * Refreshes the extension table cache * * @return boolean Result of operation, true if updated, false on failure * * @since 3.1 */ public function refreshManifestCache() { // Need to find to find where the XML file is since we don't store this normally. $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id); $manifestPath = $client->path . '/templates/' . $this->parent->extension->element . '/templateDetails.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->parent->extension->manifest_cache = json_encode($manifest_details); $this->parent->extension->name = $manifest_details['name']; try { return $this->parent->extension->store(); } catch (RuntimeException $e) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_TPL_REFRESH_MANIFEST_CACHE'), JLog::WARNING, 'jerror'); return false; } } } /** * Deprecated class placeholder. You should use JInstallerAdapterTemplate instead. * * @since 3.1 * @deprecated 4.0 * @codeCoverageIgnore */ class JInstallerTemplate extends JInstallerAdapterTemplate { } PK���\Ͷ"*�N�N*libraries/cms/installer/adapter/module.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); /** * Module installer * * @since 3.1 */ class JInstallerAdapterModule extends JInstallerAdapter { /** * The install client ID * * @var integer * @since 3.4 */ protected $clientId; /** * <scriptfile> element of the extension manifest * * @var object * @since 3.1 */ protected $scriptElement = null; /** * Method to check if the extension is already present in the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function checkExistingExtension() { try { $this->currentExtensionId = $this->extension->find( array( 'element' => $this->element, 'type' => $this->type, 'client_id' => $this->clientId ) ); } catch (RuntimeException $e) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_ROLLBACK', JText::_('JLIB_INSTALLER_' . $this->route), $e->getMessage() ) ); } } /** * Method to copy the extension's base files from the <files> tag(s) and the manifest file * * @return void * * @since 3.4 * @throws RuntimeException */ protected function copyBaseFiles() { // Copy all necessary files if ($this->parent->parseFiles($this->getManifest()->files, -1) === false) { throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_MOD_COPY_FILES')); } // If there is a manifest script, let's copy it. if ($this->manifest_script) { $path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script; $path['dest'] = $this->parent->getPath('extension_root') . '/' . $this->manifest_script; if (!file_exists($path['dest']) || $this->parent->isOverwrite()) { if (!$this->parent->copyFiles(array($path))) { // Install failed, rollback changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_MOD_INSTALL_MANIFEST')); } } } } /** * Method to finalise the installation processing * * @return void * * @since 3.4 * @throws RuntimeException */ protected function finaliseInstall() { // Clobber any possible pending updates $update = JTable::getInstance('update'); $uid = $update->find( array( 'element' => $this->element, 'type' => 'module', 'client_id' => $this->clientId ) ); if ($uid) { $update->delete($uid); } // Lastly, we will copy the manifest file to its appropriate place. if ($this->route != 'discover_install') { if (!$this->parent->copyManifest(-1)) { // Install failed, rollback changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_MOD_INSTALL_COPY_SETUP')); } } } /** * Get the filtered extension element from the manifest * * @param string $element Optional element name to be converted * * @return string The filtered element * * @since 3.4 */ public function getElement($element = null) { if (!$element) { if (count($this->getManifest()->files->children())) { foreach ($this->getManifest()->files->children() as $file) { if ((string) $file->attributes()->module) { $element = strtolower((string) $file->attributes()->module); break; } } } } return $element; } /** * Custom loadLanguage method * * @param string $path The path where we find language files * * @return void * * @since 3.4 */ public function loadLanguage($path = null) { $source = $this->parent->getPath('source'); $client = $this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE; if (!$source) { $this->parent->setPath('source', $client . '/modules/' . $this->parent->extension->element); } $this->setManifest($this->parent->getManifest()); if ($this->getManifest()->files) { $extension = $this->getElement(); if ($extension) { $source = $path ? $path : ($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $extension; $folder = (string) $this->getManifest()->files->attributes()->folder; if ($folder && file_exists($path . '/' . $folder)) { $source = $path . '/' . $folder; } $client = (string) $this->getManifest()->attributes()->client; $this->doLoadLanguage($extension, $source, constant('JPATH_' . strtoupper($client))); } } } /** * Method to parse optional tags in the manifest * * @return void * * @since 3.4 */ protected function parseOptionalTags() { // Parse optional tags $this->parent->parseMedia($this->getManifest()->media, $this->clientId); $this->parent->parseLanguages($this->getManifest()->languages, $this->clientId); } /** * Prepares the adapter for a discover_install task * * @return void * * @since 3.4 */ public function prepareDiscoverInstall() { $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id); $manifestPath = $client->path . '/modules/' . $this->parent->extension->element . '/' . $this->parent->extension->element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $this->setManifest($this->parent->getManifest()); } /** * Method to do any prechecks and setup the install paths for the extension * * @return void * * @since 3.4 * @throws RuntimeException */ protected function setupInstallPaths() { // Get the target application $cname = (string) $this->getManifest()->attributes()->client; if ($cname) { // Attempt to map the client to a base path $client = JApplicationHelper::getClientInfo($cname, true); if ($client === false) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_MOD_UNKNOWN_CLIENT', JText::_('JLIB_INSTALLER_' . $this->route), $client->name ) ); } $basePath = $client->path; $this->clientId = $client->id; } else { // No client attribute was found so we assume the site as the client $basePath = JPATH_SITE; $this->clientId = 0; } // Set the installation path if (empty($this->element)) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_MOD_INSTALL_NOFILE', JText::_('JLIB_INSTALLER_' . $this->route) ) ); } $this->parent->setPath('extension_root', $basePath . '/modules/' . $this->element); } /** * Method to store the extension to the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function storeExtension() { // Discover installs are stored a little differently if ($this->route == 'discover_install') { $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->extension->manifest_cache = json_encode($manifest_details); $this->extension->state = 0; $this->extension->name = $manifest_details['name']; $this->extension->enabled = 1; $this->extension->params = $this->parent->getParams(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ERROR_MOD_DISCOVER_STORE_DETAILS')); } return; } // Was there a module already installed with the same name? if ($this->currentExtensionId) { if (!$this->parent->isOverwrite()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_MOD_INSTALL_ALLREADY_EXISTS', JText::_('JLIB_INSTALLER_' . $this->route), $this->name ) ); } // Load the entry and update the manifest_cache $this->extension->load($this->currentExtensionId); // Update name $this->extension->name = $this->name; // Update manifest $this->extension->manifest_cache = $this->parent->generateManifestCache(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_MOD_ROLLBACK', JText::_('JLIB_INSTALLER_' . $this->route), $this->extension->getError() ) ); } } else { $this->extension->name = $this->name; $this->extension->type = 'module'; $this->extension->element = $this->element; // There is no folder for modules $this->extension->folder = ''; $this->extension->enabled = 1; $this->extension->protected = 0; $this->extension->access = $this->clientId == 1 ? 2 : 0; $this->extension->client_id = $this->clientId; $this->extension->params = $this->parent->getParams(); // Custom data $this->extension->custom_data = ''; $this->extension->manifest_cache = $this->parent->generateManifestCache(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_MOD_ROLLBACK', JText::_('JLIB_INSTALLER_' . $this->route), $this->extension->getError() ) ); } // Since we have created a module item, we add it to the installation step stack // so that if we have to rollback the changes we can undo it. $this->parent->pushStep( array( 'type' => 'extension', 'extension_id' => $this->extension->extension_id ) ); // Create unpublished module $name = preg_replace('#[\*?]#', '', JText::_($this->name)); /** @var JTableModule $module */ $module = JTable::getInstance('module'); $module->title = $name; $module->content = ''; $module->module = $this->element; $module->access = '1'; $module->showtitle = '1'; $module->params = ''; $module->client_id = $this->clientId; $module->language = '*'; $module->store(); } } /** * Custom discover method * * @return array JExtension list of extensions available * * @since 3.1 */ public function discover() { $results = array(); $site_list = JFolder::folders(JPATH_SITE . '/modules'); $admin_list = JFolder::folders(JPATH_ADMINISTRATOR . '/modules'); $site_info = JApplicationHelper::getClientInfo('site', true); $admin_info = JApplicationHelper::getClientInfo('administrator', true); foreach ($site_list as $module) { if (file_exists(JPATH_SITE . "/modules/$module/$module.xml")) { $manifest_details = JInstaller::parseXMLInstallFile(JPATH_SITE . "/modules/$module/$module.xml"); $extension = JTable::getInstance('extension'); $extension->set('type', 'module'); $extension->set('client_id', $site_info->id); $extension->set('element', $module); $extension->set('folder', ''); $extension->set('name', $module); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = clone $extension; } } foreach ($admin_list as $module) { if (file_exists(JPATH_ADMINISTRATOR . "/modules/$module/$module.xml")) { $manifest_details = JInstaller::parseXMLInstallFile(JPATH_ADMINISTRATOR . "/modules/$module/$module.xml"); $extension = JTable::getInstance('extension'); $extension->set('type', 'module'); $extension->set('client_id', $admin_info->id); $extension->set('element', $module); $extension->set('folder', ''); $extension->set('name', $module); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = clone $extension; } } return $results; } /** * Refreshes the extension table cache * * @return boolean Result of operation, true if updated, false on failure. * * @since 3.1 */ public function refreshManifestCache() { $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id); $manifestPath = $client->path . '/modules/' . $this->parent->extension->element . '/' . $this->parent->extension->element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->parent->extension->manifest_cache = json_encode($manifest_details); $this->parent->extension->name = $manifest_details['name']; if ($this->parent->extension->store()) { return true; } else { JLog::add(JText::_('JLIB_INSTALLER_ERROR_MOD_REFRESH_MANIFEST_CACHE'), JLog::WARNING, 'jerror'); return false; } } /** * Custom uninstall method * * @param integer $id The id of the module to uninstall * * @return boolean True on success * * @since 3.1 */ public function uninstall($id) { $retval = true; $db = $this->db; // First order of business will be to load the module object table from the database. // This should give us the necessary information to proceed. if (!$this->extension->load((int) $id) || !strlen($this->extension->element)) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_ERRORUNKOWNEXTENSION'), JLog::WARNING, 'jerror'); return false; } // Is the module we are trying to uninstall a core one? // Because that is not a good idea... if ($this->extension->protected) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_WARNCOREMODULE', $this->extension->name), JLog::WARNING, 'jerror'); return false; } // Get the extension root path $element = $this->extension->element; $client = JApplicationHelper::getClientInfo($this->extension->client_id); if ($client === false) { $this->parent->abort( JText::sprintf( 'JLIB_INSTALLER_ERROR_MOD_UNINSTALL_UNKNOWN_CLIENT', $this->extension->client_id ) ); return false; } $this->parent->setPath('extension_root', $client->path . '/modules/' . $element); $this->parent->setPath('source', $this->parent->getPath('extension_root')); // Get the module's manifest objecct // We do findManifest to avoid problem when uninstalling a list of extensions: getManifest cache its manifest file. $this->parent->findManifest(); $this->setManifest($this->parent->getManifest()); // Attempt to load the language file; might have uninstall strings $this->loadLanguage(($this->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $element); // If there is an manifest class file, let's load it $this->scriptElement = $this->getManifest()->scriptfile; $manifestScript = (string) $this->getManifest()->scriptfile; if ($manifestScript) { $manifestScriptFile = $this->parent->getPath('extension_root') . '/' . $manifestScript; if (is_file($manifestScriptFile)) { // Load the file include_once $manifestScriptFile; } // Set the class name $classname = $element . 'InstallerScript'; if (class_exists($classname)) { // Create a new instance $this->parent->manifestClass = new $classname($this); // And set this so we can copy it later $this->set('manifest_script', $manifestScript); } } try { $this->triggerManifestScript('uninstall'); } catch (RuntimeException $e) { // Ignore errors for now } if (!($this->getManifest() instanceof SimpleXMLElement)) { // Make sure we delete the folders JFolder::delete($this->parent->getPath('extension_root')); JLog::add(JText::_('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_INVALID_NOTFOUND_MANIFEST'), JLog::WARNING, 'jerror'); return false; } // Let's run the uninstall queries for the module try { $this->parseQueries(); } catch (RuntimeException $e) { // Install failed, rollback changes JLog::add($e->getMessage(), JLog::WARNING, 'jerror'); $retval = false; } // Remove the schema version $query = $db->getQuery(true) ->delete('#__schemas') ->where('extension_id = ' . $this->extension->extension_id); $db->setQuery($query); $db->execute(); // Remove other files $this->parent->removeFiles($this->getManifest()->media); $this->parent->removeFiles($this->getManifest()->languages, $this->extension->client_id); // Let's delete all the module copies for the type we are uninstalling $query->clear() ->select($db->quoteName('id')) ->from($db->quoteName('#__modules')) ->where($db->quoteName('module') . ' = ' . $db->quote($this->extension->element)) ->where($db->quoteName('client_id') . ' = ' . (int) $this->extension->client_id); $db->setQuery($query); try { $modules = $db->loadColumn(); } catch (RuntimeException $e) { $modules = array(); } // Do we have any module copies? if (count($modules)) { // Ensure the list is sane JArrayHelper::toInteger($modules); $modID = implode(',', $modules); // Wipe out any items assigned to menus $query = $db->getQuery(true) ->delete($db->quoteName('#__modules_menu')) ->where($db->quoteName('moduleid') . ' IN (' . $modID . ')'); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_EXCEPTION', $db->stderr(true)), JLog::WARNING, 'jerror'); $retval = false; } // Wipe out any instances in the modules table /** @var JTableModule $module */ $module = JTable::getInstance('Module'); foreach ($modules as $modInstanceId) { $module->load($modInstanceId); if (!$module->delete()) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_EXCEPTION', $module->getError()), JLog::WARNING, 'jerror'); $retval = false; } } } // Now we will no longer need the module object, so let's delete it and free up memory $this->extension->delete($this->extension->extension_id); $query = $db->getQuery(true) ->delete($db->quoteName('#__modules')) ->where($db->quoteName('module') . ' = ' . $db->quote($this->extension->element)) ->where($db->quote('client_id') . ' = ' . $this->extension->client_id); $db->setQuery($query); try { // Clean up any other ones that might exist as well $db->execute(); } catch (RuntimeException $e) { // Ignore the error... } // Remove the installation folder if (!JFolder::delete($this->parent->getPath('extension_root'))) { // JFolder should raise an error $retval = false; } return $retval; } /** * Custom rollback method * - Roll back the menu item * * @param array $arg Installation step to rollback * * @return boolean True on success * * @since 3.1 */ protected function _rollback_menu($arg) { // Get database connector object $db = $this->parent->getDbo(); // Remove the entry from the #__modules_menu table $query = $db->getQuery(true) ->delete($db->quoteName('#__modules_menu')) ->where($db->quoteName('moduleid') . ' = ' . (int) $arg['id']); $db->setQuery($query); try { return $db->execute(); } catch (RuntimeException $e) { return false; } } /** * Custom rollback method * - Roll back the module item * * @param array $arg Installation step to rollback * * @return boolean True on success * * @since 3.1 */ protected function _rollback_module($arg) { // Get database connector object $db = $this->parent->getDbo(); // Remove the entry from the #__modules table $query = $db->getQuery(true) ->delete($db->quoteName('#__modules')) ->where($db->quoteName('id') . ' = ' . (int) $arg['id']); $db->setQuery($query); try { return $db->execute(); } catch (RuntimeException $e) { return false; } } } /** * Deprecated class placeholder. You should use JInstallerAdapterModule instead. * * @since 3.1 * @deprecated 4.0 * @codeCoverageIgnore */ class JInstallerModule extends JInstallerAdapterModule { } PK���\�C4646+libraries/cms/installer/adapter/library.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); /** * Library installer * * @since 3.1 */ class JInstallerAdapterLibrary extends JInstallerAdapter { /** * Method to check if the extension is present in the filesystem, flags the route as update if so * * @return void * * @since 3.4 * @throws RuntimeException */ protected function checkExtensionInFilesystem() { if ($this->currentExtensionId) { // Already installed, can we upgrade? if ($this->parent->isOverwrite() || $this->parent->isUpgrade()) { // We can upgrade, so uninstall the old one $installer = new JInstaller; // we don't want to compromise this instance! $installer->uninstall('library', $this->currentExtensionId); // Clear the cached data $this->currentExtensionId = null; $this->extension = JTable::getInstance('Extension', 'JTable', array('dbo' => $this->db)); // From this point we'll consider this an update $this->setRoute('update'); } else { // Abort the install, no upgrade possible throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_LIB_INSTALL_ALREADY_INSTALLED')); } } } /** * Method to copy the extension's base files from the <files> tag(s) and the manifest file * * @return void * * @since 3.4 * @throws RuntimeException */ protected function copyBaseFiles() { if ($this->parent->parseFiles($this->getManifest()->files, -1) === false) { throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_LIB_COPY_FILES')); } } /** * Method to finalise the installation processing * * @return void * * @since 3.4 * @throws RuntimeException */ protected function finaliseInstall() { // Clobber any possible pending updates /** @var JTableUpdate $update */ $update = JTable::getInstance('update'); $uid = $update->find( array( 'element' => $this->element, 'type' => $this->type, ) ); if ($uid) { $update->delete($uid); } // Lastly, we will copy the manifest file to its appropriate place. if ($this->route != 'discover_install') { $manifest = array(); $manifest['src'] = $this->parent->getPath('manifest'); $manifest['dest'] = JPATH_MANIFESTS . '/libraries/' . basename($this->parent->getPath('manifest')); if (!$this->parent->copyFiles(array($manifest), true)) { // Install failed, rollback changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_LIB_INSTALL_COPY_SETUP')); } // If there is a manifest script, let's copy it. if ($this->manifest_script) { $path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script; $path['dest'] = $this->parent->getPath('extension_root') . '/' . $this->manifest_script; if (!file_exists($path['dest']) || $this->parent->isOverwrite()) { if (!$this->parent->copyFiles(array($path))) { // Install failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_MANIFEST', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)) ) ); } } } } } /** * Get the filtered extension element from the manifest * * @param string $element Optional element name to be converted * * @return string The filtered element * * @since 3.4 */ public function getElement($element = null) { if (!$element) { $manifestPath = JPath::clean($this->parent->getPath('manifest')); $element = preg_replace('/\.xml/', '', basename($manifestPath)); } return $element; } /** * Custom loadLanguage method * * @param string $path The path where to find language files. * * @return void * * @since 3.1 */ public function loadLanguage($path = null) { $source = $this->parent->getPath('source'); if (!$source) { $this->parent->setPath('source', JPATH_PLATFORM . '/' . $this->getElement()); } $extension = 'lib_' . $this->getElement(); $librarypath = (string) $this->getManifest()->libraryname; $source = $path ? $path : JPATH_PLATFORM . '/' . $librarypath; $this->doLoadLanguage($extension, $source, JPATH_SITE); } /** * Method to parse optional tags in the manifest * * @return void * * @since 3.4 */ protected function parseOptionalTags() { $this->parent->parseLanguages($this->getManifest()->languages); $this->parent->parseMedia($this->getManifest()->media); } /** * Prepares the adapter for a discover_install task * * @return void * * @since 3.4 */ public function prepareDiscoverInstall() { $manifestPath = JPATH_MANIFESTS . '/libraries/' . $this->extension->element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $this->setManifest($this->parent->getManifest()); } /** * Method to do any prechecks and setup the install paths for the extension * * @return void * * @since 3.4 * @throws RuntimeException */ protected function setupInstallPaths() { $group = (string) $this->getManifest()->libraryname; if (!$group) { throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_LIB_INSTALL_NOFILE')); } $this->parent->setPath('extension_root', JPATH_PLATFORM . '/' . implode(DIRECTORY_SEPARATOR, explode('/', $group))); } /** * Method to store the extension to the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function storeExtension() { // Discover installs are stored a little differently if ($this->route == 'discover_install') { $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->extension->manifest_cache = json_encode($manifest_details); $this->extension->state = 0; $this->extension->name = $manifest_details['name']; $this->extension->enabled = 1; $this->extension->params = $this->parent->getParams(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ERROR_LIB_DISCOVER_STORE_DETAILS')); } return; } $this->extension->name = $this->name; $this->extension->type = 'library'; $this->extension->element = $this->element; // There is no folder for libraries $this->extension->folder = ''; $this->extension->enabled = 1; $this->extension->protected = 0; $this->extension->access = 1; $this->extension->client_id = 0; $this->extension->params = $this->parent->getParams(); // Custom data $this->extension->custom_data = ''; // Update the manifest cache for the entry $this->extension->manifest_cache = $this->parent->generateManifestCache(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_LIB_INSTALL_ROLLBACK', $this->extension->getError() ) ); } // Since we have created a library item, we add it to the installation step stack // so that if we have to rollback the changes we can undo it. $this->parent->pushStep(array('type' => 'extension', 'id' => $this->extension->extension_id)); } /** * Custom update method * * @return boolean True on success * * @since 3.1 */ public function update() { // Since this is just files, an update removes old files // Get the extension manifest object $this->setManifest($this->parent->getManifest()); // Set the overwrite setting $this->parent->setOverwrite(true); $this->parent->setUpgrade(true); // And make sure the route is set correctly $this->setRoute('update'); /* * --------------------------------------------------------------------------------------------- * Manifest Document Setup Section * --------------------------------------------------------------------------------------------- */ // Set the extensions name $name = (string) $this->getManifest()->name; $name = JFilterInput::getInstance()->clean($name, 'string'); $element = str_replace('.xml', '', basename($this->parent->getPath('manifest'))); $this->set('name', $name); $this->set('element', $element); // We don't want to compromise this instance! $installer = new JInstaller; $db = $this->parent->getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('extension_id')) ->from($db->quoteName('#__extensions')) ->where($db->quoteName('type') . ' = ' . $db->quote('library')) ->where($db->quoteName('element') . ' = ' . $db->quote($element)); $db->setQuery($query); $result = $db->loadResult(); if ($result) { // Already installed, which would make sense $installer->uninstall('library', $result); // Clear the cached data $this->currentExtensionId = null; $this->extension = JTable::getInstance('Extension', 'JTable', array('dbo' => $this->db)); } // Now create the new files return $this->install(); } /** * Custom uninstall method * * @param string $id The id of the library to uninstall. * * @return boolean True on success * * @since 3.1 */ public function uninstall($id) { $retval = true; // First order of business will be to load the module object table from the database. // This should give us the necessary information to proceed. $row = JTable::getInstance('extension'); if (!$row->load((int) $id) || !strlen($row->element)) { JLog::add(JText::_('ERRORUNKOWNEXTENSION'), JLog::WARNING, 'jerror'); return false; } // Is the library we are trying to uninstall a core one? // Because that is not a good idea... if ($row->protected) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_LIB_UNINSTALL_WARNCORELIBRARY'), JLog::WARNING, 'jerror'); return false; } $manifestFile = JPATH_MANIFESTS . '/libraries/' . $row->element . '.xml'; // Because libraries may not have their own folders we cannot use the standard method of finding an installation manifest if (file_exists($manifestFile)) { $manifest = new JInstallerManifestLibrary($manifestFile); // Set the library root path $this->parent->setPath('extension_root', JPATH_PLATFORM . '/' . $manifest->libraryname); $xml = simplexml_load_file($manifestFile); // If we cannot load the XML file return null if (!$xml) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_LIB_UNINSTALL_LOAD_MANIFEST'), JLog::WARNING, 'jerror'); return false; } // Check for a valid XML root tag. if ($xml->getName() != 'extension') { JLog::add(JText::_('JLIB_INSTALLER_ERROR_LIB_UNINSTALL_INVALID_MANIFEST'), JLog::WARNING, 'jerror'); return false; } $this->parent->removeFiles($xml->files, -1); JFile::delete($manifestFile); } else { // Remove this row entry since its invalid $row->delete($row->extension_id); unset($row); JLog::add(JText::_('JLIB_INSTALLER_ERROR_LIB_UNINSTALL_INVALID_NOTFOUND_MANIFEST'), JLog::WARNING, 'jerror'); return false; } // TODO: Change this so it walked up the path backwards so we clobber multiple empties // If the folder is empty, let's delete it if (JFolder::exists($this->parent->getPath('extension_root'))) { if (is_dir($this->parent->getPath('extension_root'))) { $files = JFolder::files($this->parent->getPath('extension_root')); if (!count($files)) { JFolder::delete($this->parent->getPath('extension_root')); } } } $this->parent->removeFiles($xml->media); $this->parent->removeFiles($xml->languages); $row->delete($row->extension_id); unset($row); return $retval; } /** * Custom discover method * * @return array JExtension list of extensions available * * @since 3.1 */ public function discover() { $results = array(); $file_list = JFolder::files(JPATH_MANIFESTS . '/libraries', '\.xml$'); foreach ($file_list as $file) { $manifest_details = JInstaller::parseXMLInstallFile(JPATH_MANIFESTS . '/libraries/' . $file); $file = JFile::stripExt($file); $extension = JTable::getInstance('extension'); $extension->set('type', 'library'); $extension->set('client_id', 0); $extension->set('element', $file); $extension->set('folder', ''); $extension->set('name', $file); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = $extension; } return $results; } /** * Refreshes the extension table cache * * @return boolean Result of operation, true if updated, false on failure * * @since 3.1 */ public function refreshManifestCache() { // Need to find to find where the XML file is since we don't store this normally $manifestPath = JPATH_MANIFESTS . '/libraries/' . $this->parent->extension->element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->parent->extension->manifest_cache = json_encode($manifest_details); $this->parent->extension->name = $manifest_details['name']; try { return $this->parent->extension->store(); } catch (RuntimeException $e) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_LIB_REFRESH_MANIFEST_CACHE'), JLog::WARNING, 'jerror'); return false; } } } /** * Deprecated class placeholder. You should use JInstallerAdapterLibrary instead. * * @since 3.1 * @deprecated 4.0 * @codeCoverageIgnore */ class JInstallerLibrary extends JInstallerAdapterLibrary { } PK���\��d<5E5E+libraries/cms/installer/adapter/package.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Package installer * * @since 3.1 */ class JInstallerAdapterPackage extends JInstallerAdapter { /** * The results of each installed extensions * * @var array * @since 3.1 */ protected $results = array(); /** * Flag if the adapter supports discover installs * * Adapters should override this and set to false if discover install is unsupported * * @var boolean * @since 3.4 */ protected $supportsDiscoverInstall = false; /** * Method to check if the extension is present in the filesystem, flags the route as update if so * * @return void * * @since 3.4 * @throws RuntimeException */ protected function checkExtensionInFilesystem() { // If the package manifest already exists, then we will assume that the package is already installed. if (file_exists(JPATH_MANIFESTS . '/packages/' . basename($this->parent->getPath('manifest')))) { // Look for an update function or update tag $updateElement = $this->manifest->update; // Upgrade manually set or update function available or update tag detected if ($this->parent->isUpgrade() || ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'update')) || $updateElement) { // Force this one $this->parent->setOverwrite(true); $this->parent->setUpgrade(true); if ($this->currentExtensionId) { // If there is a matching extension mark this as an update $this->setRoute('update'); } } elseif (!$this->parent->isOverwrite()) { // We didn't have overwrite set, find an update function or find an update tag so lets call it safe throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_DIRECTORY', JText::_('JLIB_INSTALLER_' . $this->route), $this->type, $this->parent->getPath('extension_root') ) ); } } } /** * Method to copy the extension's base files from the <files> tag(s) and the manifest file * * @return void * * @since 3.4 * @throws RuntimeException */ protected function copyBaseFiles() { $folder = (string) $this->getManifest()->files->attributes()->folder; $source = $this->parent->getPath('source'); if ($folder) { $source .= '/' . $folder; } // Install all necessary files if (!count($this->getManifest()->files->children())) { throw new RuntimeException( JText::sprintf('JLIB_INSTALLER_ABORT_PACK_INSTALL_NO_FILES', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)) ) ); } foreach ($this->getManifest()->files->children() as $child) { $file = $source . '/' . (string) $child; if (is_dir($file)) { // If it's actually a directory then fill it up $package = array(); $package['dir'] = $file; $package['type'] = JInstallerHelper::detectType($file); } else { // If it's an archive $package = JInstallerHelper::unpack($file); } $tmpInstaller = new JInstaller; $installResult = $tmpInstaller->{$this->route}($package['dir']); if (!$installResult) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PACK_INSTALL_ERROR_EXTENSION', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), basename($file) ) ); } $this->results[] = array( 'name' => (string) $tmpInstaller->manifest->name, 'result' => $installResult ); } } /** * Method to create the extension root path if necessary * * @return void * * @since 3.4 * @throws RuntimeException */ protected function createExtensionRoot() { /* * For packages, we only need the extension root if copying manifest files; this step will be handled * at that point if necessary */ } /** * Method to finalise the installation processing * * @return void * * @since 3.4 * @throws RuntimeException */ protected function finaliseInstall() { // Clobber any possible pending updates /** @var JTableUpdate $update */ $update = JTable::getInstance('update'); $uid = $update->find( array( 'element' => $this->element, 'type' => $this->type, ) ); if ($uid) { $update->delete($uid); } // Lastly, we will copy the manifest file to its appropriate place. $manifest = array(); $manifest['src'] = $this->parent->getPath('manifest'); $manifest['dest'] = JPATH_MANIFESTS . '/packages/' . basename($this->parent->getPath('manifest')); if (!$this->parent->copyFiles(array($manifest), true)) { // Install failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PACK_INSTALL_COPY_SETUP', JText::_('JLIB_INSTALLER_ABORT_PACK_INSTALL_NO_FILES') ) ); } // If there is a manifest script, let's copy it. if ($this->manifest_script) { // First, we have to create a folder for the script if one isn't present if (!file_exists($this->parent->getPath('extension_root'))) { if (!JFolder::create($this->parent->getPath('extension_root'))) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_CREATE_DIRECTORY', JText::_('JLIB_INSTALLER_' . $this->route), $this->parent->getPath('extension_root') ) ); } /* * Since we created the extension directory and will want to remove it if * we have to roll back the installation, let's add it to the * installation step stack */ $this->parent->pushStep( array( 'type' => 'folder', 'path' => $this->parent->getPath('extension_root') ) ); } $path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script; $path['dest'] = $this->parent->getPath('extension_root') . '/' . $this->manifest_script; if (!file_exists($path['dest']) || $this->parent->isOverwrite()) { if (!$this->parent->copyFiles(array($path))) { // Install failed, rollback changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_PACKAGE_INSTALL_MANIFEST')); } } } } /** * Get the filtered extension element from the manifest * * @param string $element Optional element name to be converted * * @return string The filtered element * * @since 3.4 */ public function getElement($element = null) { if (!$element) { // Ensure the element is a string $element = (string) $this->getManifest()->packagename; // Filter the name for illegal characters $element = 'pkg_' . JFilterInput::getInstance()->clean($element, 'cmd'); } return $element; } /** * Load language from a path * * @param string $path The path of the language. * * @return void * * @since 3.1 */ public function loadLanguage($path) { $this->doLoadLanguage($this->getElement(), $path); } /** * Method to parse optional tags in the manifest * * @return void * * @since 3.4 */ protected function parseOptionalTags() { $this->parent->parseLanguages($this->getManifest()->languages); } /** * Method to do any prechecks and setup the install paths for the extension * * @return void * * @since 3.4 * @throws RuntimeException */ protected function setupInstallPaths() { $packagepath = (string) $this->getManifest()->packagename; if (empty($packagepath)) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PACK_INSTALL_NO_PACK', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)) ) ); } $this->parent->setPath('extension_root', JPATH_MANIFESTS . '/packages/' . $packagepath); } /** * Method to store the extension to the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function storeExtension() { if ($this->currentExtensionId) { if (!$this->parent->isOverwrite()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_ALREADY_EXISTS', JText::_('JLIB_INSTALLER_' . $this->route), $this->name ) ); } $this->extension->load($this->currentExtensionId); $this->extension->name = $this->name; } else { $this->extension->name = $this->name; $this->extension->type = 'package'; $this->extension->element = $this->element; // There is no folder for packages $this->extension->folder = ''; $this->extension->enabled = 1; $this->extension->protected = 0; $this->extension->access = 1; $this->extension->client_id = 0; // Custom data $this->extension->custom_data = ''; $this->extension->params = $this->parent->getParams(); } // Update the manifest cache for the entry $this->extension->manifest_cache = $this->parent->generateManifestCache(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PACK_INSTALL_ROLLBACK', $this->extension->getError() ) ); } // Since we have created a package item, we add it to the installation step stack // so that if we have to rollback the changes we can undo it. $this->parent->pushStep(array('type' => 'extension', 'id' => $this->extension->extension_id)); } /** * Executes a custom install script method * * @param string $method The install method to execute * * @return boolean True on success * * @since 3.4 */ protected function triggerManifestScript($method) { ob_start(); ob_implicit_flush(false); if ($this->parent->manifestClass && method_exists($this->parent->manifestClass, $method)) { switch ($method) { // The preflight method takes the route as a param case 'preflight': if ($this->parent->manifestClass->$method($this->route, $this) === false) { // The script failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_INSTALL_CUSTOM_INSTALL_FAILURE', JText::_('JLIB_INSTALLER_' . $this->route) ) ); } break; // The postflight method takes the route and a results array as params case 'postflight': $this->parent->manifestClass->$method($this->route, $this, $this->results); break; // The install, uninstall, and update methods only pass this object as a param case 'install': case 'uninstall': case 'update': if ($this->parent->manifestClass->$method($this) === false) { if ($method != 'uninstall') { // The script failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_INSTALL_CUSTOM_INSTALL_FAILURE', JText::_('JLIB_INSTALLER_' . $this->route) ) ); } } break; } } // Append to the message object $this->extensionMessage .= ob_get_clean(); // If in postflight or uninstall, set the message for display if (($method == 'uninstall' || $method == 'postflight') && $this->extensionMessage != '') { $this->parent->set('extension_message', $this->extensionMessage); } return true; } /** * Custom uninstall method * * @param integer $id The id of the package to uninstall. * * @return boolean True on success * * @since 3.1 */ public function uninstall($id) { $row = null; $retval = true; $row = JTable::getInstance('extension'); $row->load($id); if ($row->protected) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PACK_UNINSTALL_WARNCOREPACK'), JLog::WARNING, 'jerror'); return false; } $manifestFile = JPATH_MANIFESTS . '/packages/' . $row->get('element') . '.xml'; $manifest = new JInstallerManifestPackage($manifestFile); // Set the package root path $this->parent->setPath('extension_root', JPATH_MANIFESTS . '/packages/' . $manifest->packagename); // Because packages may not have their own folders we cannot use the standard method of finding an installation manifest if (!file_exists($manifestFile)) { // TODO: Fail? JLog::add(JText::_('JLIB_INSTALLER_ERROR_PACK_UNINSTALL_MISSINGMANIFEST'), JLog::WARNING, 'jerror'); return false; } $xml = simplexml_load_file($manifestFile); // If we cannot load the XML file return false if (!$xml) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PACK_UNINSTALL_LOAD_MANIFEST'), JLog::WARNING, 'jerror'); return false; } // Check for a valid XML root tag. if ($xml->getName() != 'extension') { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PACK_UNINSTALL_INVALID_MANIFEST'), JLog::WARNING, 'jerror'); return false; } // If there is an manifest class file, let's load it $manifestScript = (string) $manifest->scriptfile; if ($manifestScript) { $manifestScriptFile = $this->parent->getPath('extension_root') . '/' . $manifestScript; if (is_file($manifestScriptFile)) { // Load the file include_once $manifestScriptFile; } // Set the class name $classname = $row->element . 'InstallerScript'; if (class_exists($classname)) { // Create a new instance $this->parent->manifestClass = new $classname($this); // And set this so we can copy it later $this->set('manifest_script', $manifestScript); } } ob_start(); ob_implicit_flush(false); // Run uninstall if possible if ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'uninstall')) { $this->parent->manifestClass->uninstall($this); } $msg = ob_get_contents(); ob_end_clean(); if ($msg != '') { $this->parent->set('extension_message', $msg); } $error = false; foreach ($manifest->filelist as $extension) { $tmpInstaller = new JInstaller; $id = $this->_getExtensionId($extension->type, $extension->id, $extension->client, $extension->group); $client = JApplicationHelper::getClientInfo($extension->client, true); if ($id) { if (!$tmpInstaller->uninstall($extension->type, $id, $client->id)) { $error = true; JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_PACK_UNINSTALL_NOT_PROPER', basename($extension->filename)), JLog::WARNING, 'jerror'); } } else { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PACK_UNINSTALL_UNKNOWN_EXTENSION'), JLog::WARNING, 'jerror'); } } // Remove any language files $this->parent->removeFiles($xml->languages); // Clean up manifest file after we're done if there were no errors if (!$error) { JFile::delete($manifestFile); $folder = $this->parent->getPath('extension_root'); if (JFolder::exists($folder)) { JFolder::delete($folder); } $row->delete(); } else { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PACK_UNINSTALL_MANIFEST_NOT_REMOVED'), JLog::WARNING, 'jerror'); } // Return the result up the line return $retval; } /** * Gets the extension id. * * @param string $type The extension type. * @param string $id The name of the extension (the element field). * @param integer $client The application id (0: Joomla CMS site; 1: Joomla CMS administrator). * @param string $group The extension group (mainly for plugins). * * @return integer * * @since 3.1 */ protected function _getExtensionId($type, $id, $client, $group) { $db = $this->parent->getDbo(); $query = $db->getQuery(true) ->select('extension_id') ->from('#__extensions') ->where('type = ' . $db->quote($type)) ->where('element = ' . $db->quote($id)); switch ($type) { case 'plugin': // Plugins have a folder but not a client $query->where('folder = ' . $db->quote($group)); break; case 'library': case 'package': case 'component': // Components, packages and libraries don't have a folder or client. // Included for completeness. break; case 'language': case 'module': case 'template': // Languages, modules and templates have a client but not a folder $client = JApplicationHelper::getClientInfo($client, true); $query->where('client_id = ' . (int) $client->id); break; } $db->setQuery($query); $result = $db->loadResult(); // Note: For templates, libraries and packages their unique name is their key. // This means they come out the same way they came in. return $result; } /** * Refreshes the extension table cache * * @return boolean Result of operation, true if updated, false on failure * * @since 3.1 */ public function refreshManifestCache() { // Need to find to find where the XML file is since we don't store this normally $manifestPath = JPATH_MANIFESTS . '/packages/' . $this->parent->extension->element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->parent->extension->manifest_cache = json_encode($manifest_details); $this->parent->extension->name = $manifest_details['name']; try { return $this->parent->extension->store(); } catch (RuntimeException $e) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PACK_REFRESH_MANIFEST_CACHE'), JLog::WARNING, 'jerror'); return false; } } } /** * Deprecated class placeholder. You should use JInstallerAdapterPackage instead. * * @since 3.1 * @deprecated 4.0 * @codeCoverageIgnore */ class JInstallerPackage extends JInstallerAdapterPackage { } PK���\�6yRbKbK*libraries/cms/installer/adapter/plugin.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); /** * Plugin installer * * @since 3.1 */ class JInstallerAdapterPlugin extends JInstallerAdapter { /** * <scriptfile> element of the extension manifest * * @var object * @since 3.1 */ protected $scriptElement = null; /** * <files> element of the old extension manifest * * @var object * @since 3.1 */ protected $oldFiles = null; /** * Method to check if the extension is already present in the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function checkExistingExtension() { try { $this->currentExtensionId = $this->extension->find( array('type' => $this->type, 'element' => $this->element, 'folder' => $this->group) ); } catch (RuntimeException $e) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_ROLLBACK', JText::_('JLIB_INSTALLER_' . $this->route), $e->getMessage() ) ); } } /** * Method to copy the extension's base files from the <files> tag(s) and the manifest file * * @return void * * @since 3.4 * @throws RuntimeException */ protected function copyBaseFiles() { // Copy all necessary files if ($this->parent->parseFiles($this->getManifest()->files, -1, $this->oldFiles) === false) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PLG_COPY_FILES', JText::_('JLIB_INSTALLER_' . $this->route) ) ); } // If there is a manifest script, let's copy it. if ($this->manifest_script) { $path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script; $path['dest'] = $this->parent->getPath('extension_root') . '/' . $this->manifest_script; if (!file_exists($path['dest']) || $this->parent->isOverwrite()) { if (!$this->parent->copyFiles(array($path))) { // Install failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PLG_INSTALL_MANIFEST', JText::_('JLIB_INSTALLER_' . $this->route) ) ); } } } } /** * Method to create the extension root path if necessary * * @return void * * @since 3.4 * @throws RuntimeException */ protected function createExtensionRoot() { // Run the common create code first parent::createExtensionRoot(); // If we're updating at this point when there is always going to be an extension_root find the old XML files if ($this->route == 'update') { // Create a new installer because findManifest sets stuff; side effects! $tmpInstaller = new JInstaller; // Look in the extension root $tmpInstaller->setPath('source', $this->parent->getPath('extension_root')); if ($tmpInstaller->findManifest()) { $old_manifest = $tmpInstaller->getManifest(); $this->oldFiles = $old_manifest->files; } } } /** * Method to finalise the installation processing * * @return void * * @since 3.4 * @throws RuntimeException */ protected function finaliseInstall() { // Clobber any possible pending updates /** @var JTableUpdate $update */ $update = JTable::getInstance('update'); $uid = $update->find( array( 'element' => $this->element, 'type' => $this->type, 'folder' => $this->group ) ); if ($uid) { $update->delete($uid); } // Lastly, we will copy the manifest file to its appropriate place. if ($this->route != 'discover_install') { if (!$this->parent->copyManifest(-1)) { // Install failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PLG_INSTALL_COPY_SETUP', JText::_('JLIB_INSTALLER_' . $this->route) ) ); } } } /** * Get the filtered extension element from the manifest * * @param string $element Optional element name to be converted * * @return string The filtered element * * @since 3.4 */ public function getElement($element = null) { if (!$element) { // Backward Compatibility // @todo Deprecate in future version if (count($this->getManifest()->files->children())) { $type = (string) $this->getManifest()->attributes()->type; foreach ($this->getManifest()->files->children() as $file) { if ((string) $file->attributes()->$type) { $element = (string) $file->attributes()->$type; break; } } } } return $element; } /** * Get the class name for the install adapter script. * * @return string The class name. * * @since 3.4 */ protected function getScriptClassName() { return 'Plg' . str_replace('-', '', $this->group) . $this->element . 'InstallerScript'; } /** * Custom loadLanguage method * * @param string $path The path where to find language files. * * @return void * * @since 3.1 */ public function loadLanguage($path = null) { $source = $this->parent->getPath('source'); if (!$source) { $this->parent->setPath( 'source', JPATH_PLUGINS . '/' . $this->parent->extension->folder . '/' . $this->parent->extension->element ); } $element = $this->getManifest()->files; if ($element) { $group = strtolower((string) $this->getManifest()->attributes()->group); $name = ''; if (count($element->children())) { foreach ($element->children() as $file) { if ((string) $file->attributes()->plugin) { $name = strtolower((string) $file->attributes()->plugin); break; } } } if ($name) { $extension = "plg_${group}_${name}"; $source = $path ? $path : JPATH_PLUGINS . "/$group/$name"; $folder = (string) $element->attributes()->folder; if ($folder && file_exists("$path/$folder")) { $source = "$path/$folder"; } $this->doLoadLanguage($extension, $source, JPATH_ADMINISTRATOR); } } } /** * Method to parse optional tags in the manifest * * @return void * * @since 3.4 */ protected function parseOptionalTags() { // Parse optional tags -- media and language files for plugins go in admin app $this->parent->parseMedia($this->getManifest()->media, 1); $this->parent->parseLanguages($this->getManifest()->languages, 1); } /** * Prepares the adapter for a discover_install task * * @return void * * @since 3.4 */ public function prepareDiscoverInstall() { $client = JApplicationHelper::getClientInfo($this->extension->client_id); $basePath = $client->path . '/plugins/' . $this->extension->folder; if (is_dir($basePath . '/' . $this->extension->element)) { $manifestPath = $basePath . '/' . $this->extension->element . '/' . $this->extension->element . '.xml'; } else { // @deprecated 4.0 - This path supports Joomla! 1.5 plugin folder layouts $manifestPath = $basePath . '/' . $this->extension->element . '.xml'; } $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $this->setManifest($this->parent->getManifest()); } /** * Method to do any prechecks and setup the install paths for the extension * * @return void * * @since 3.4 * @throws RuntimeException */ protected function setupInstallPaths() { $this->group = (string) $this->getManifest()->attributes()->group; if (empty($this->element) && empty($this->group)) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PLG_INSTALL_NO_FILE', JText::_('JLIB_INSTALLER_' . $this->route) ) ); } $this->parent->setPath('extension_root', JPATH_PLUGINS . '/' . $this->group . '/' . $this->element); } /** * Method to store the extension to the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function storeExtension() { // Discover installs are stored a little differently if ($this->route == 'discover_install') { $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->extension->manifest_cache = json_encode($manifest_details); $this->extension->state = 0; $this->extension->name = $manifest_details['name']; $this->extension->enabled = ('editors' == $this->extension->folder) ? 1 : 0; $this->extension->params = $this->parent->getParams(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ERROR_PLG_DISCOVER_STORE_DETAILS')); } return; } // Was there a plugin with the same name already installed? if ($this->currentExtensionId) { if (!$this->parent->isOverwrite()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PLG_INSTALL_ALLREADY_EXISTS', JText::_('JLIB_INSTALLER_' . $this->route), $this->name ) ); } $this->extension->load($this->currentExtensionId); $this->extension->name = $this->name; $this->extension->manifest_cache = $this->parent->generateManifestCache(); // Update the manifest cache and name $this->extension->store(); } else { // Store in the extensions table (1.6) $this->extension->name = $this->name; $this->extension->type = 'plugin'; $this->extension->ordering = 0; $this->extension->element = $this->element; $this->extension->folder = $this->group; $this->extension->enabled = 0; $this->extension->protected = 0; $this->extension->access = 1; $this->extension->client_id = 0; $this->extension->params = $this->parent->getParams(); // Custom data $this->extension->custom_data = ''; // System data $this->extension->system_data = ''; $this->extension->manifest_cache = $this->parent->generateManifestCache(); // Editor plugins are published by default if ($this->group == 'editors') { $this->extension->enabled = 1; } if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_PLG_INSTALL_ROLLBACK', JText::_('JLIB_INSTALLER_' . $this->route), $this->extension->getError() ) ); } // Since we have created a plugin item, we add it to the installation step stack // so that if we have to rollback the changes we can undo it. $this->parent->pushStep(array('type' => 'extension', 'id' => $this->extension->extension_id)); } } /** * Custom uninstall method * * @param integer $id The id of the plugin to uninstall * * @return boolean True on success * * @since 3.1 */ public function uninstall($id) { $this->route = 'uninstall'; $row = null; $retval = true; $db = $this->parent->getDbo(); // First order of business will be to load the plugin object table from the database. // This should give us the necessary information to proceed. $row = JTable::getInstance('extension'); if (!$row->load((int) $id)) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PLG_UNINSTALL_ERRORUNKOWNEXTENSION'), JLog::WARNING, 'jerror'); return false; } // Is the plugin we are trying to uninstall a core one? // Because that is not a good idea... if ($row->protected) { JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_PLG_UNINSTALL_WARNCOREPLUGIN', $row->name), JLog::WARNING, 'jerror'); return false; } // Get the plugin folder so we can properly build the plugin path if (trim($row->folder) == '') { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PLG_UNINSTALL_FOLDER_FIELD_EMPTY'), JLog::WARNING, 'jerror'); return false; } // Set the plugin root path $this->parent->setPath('extension_root', JPATH_PLUGINS . '/' . $row->folder . '/' . $row->element); $this->parent->setPath('source', $this->parent->getPath('extension_root')); $this->parent->findManifest(); $this->setManifest($this->parent->getManifest()); // Attempt to load the language file; might have uninstall strings $this->parent->setPath('source', JPATH_PLUGINS . '/' . $row->folder . '/' . $row->element); $this->loadLanguage(JPATH_PLUGINS . '/' . $row->folder . '/' . $row->element); /** * --------------------------------------------------------------------------------------------- * Installer Trigger Loading * --------------------------------------------------------------------------------------------- */ // If there is an manifest class file, let's load it; we'll copy it later (don't have dest yet) $manifestScript = (string) $this->getManifest()->scriptfile; if ($manifestScript) { $manifestScriptFile = $this->parent->getPath('source') . '/' . $manifestScript; if (is_file($manifestScriptFile)) { // Load the file include_once $manifestScriptFile; } // If a dash is present in the folder, remove it $folderClass = str_replace('-', '', $row->folder); // Set the class name $classname = 'Plg' . $folderClass . $row->element . 'InstallerScript'; if (class_exists($classname)) { // Create a new instance $this->parent->manifestClass = new $classname($this); // And set this so we can copy it later $this->set('manifest_script', $manifestScript); } } // Run preflight if possible (since we know we're not an update) ob_start(); ob_implicit_flush(false); if ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'preflight')) { if ($this->parent->manifestClass->preflight($this->route, $this) === false) { // Preflight failed, rollback changes $this->parent->abort(JText::_('JLIB_INSTALLER_ABORT_PLG_INSTALL_CUSTOM_INSTALL_FAILURE')); return false; } } // Create the $msg object and append messages from preflight $msg = ob_get_contents(); ob_end_clean(); // Let's run the queries for the plugin $utfresult = $this->parent->parseSQLFiles($this->getManifest()->uninstall->sql); if ($utfresult === false) { // Install failed, rollback changes $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT_PLG_UNINSTALL_SQL_ERROR', $db->stderr(true))); return false; } // Run the custom uninstall method if possible ob_start(); ob_implicit_flush(false); if ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'uninstall')) { $this->parent->manifestClass->uninstall($this); } // Append messages $msg .= ob_get_contents(); ob_end_clean(); // Remove the plugin files $this->parent->removeFiles($this->getManifest()->files, -1); // Remove all media and languages as well $this->parent->removeFiles($this->getManifest()->media); $this->parent->removeFiles($this->getManifest()->languages, 1); // Remove the schema version $query = $db->getQuery(true) ->delete('#__schemas') ->where('extension_id = ' . $row->extension_id); $db->setQuery($query); $db->execute(); // Now we will no longer need the plugin object, so let's delete it $row->delete($row->extension_id); unset($row); // Remove the plugin's folder JFolder::delete($this->parent->getPath('extension_root')); if ($msg != '') { $this->parent->set('extension_message', $msg); } return $retval; } /** * Custom discover method * * @return array JExtension) list of extensions available * * @since 3.1 */ public function discover() { $results = array(); $folder_list = JFolder::folders(JPATH_SITE . '/plugins'); foreach ($folder_list as $folder) { $file_list = JFolder::files(JPATH_SITE . '/plugins/' . $folder, '\.xml$'); foreach ($file_list as $file) { $manifest_details = JInstaller::parseXMLInstallFile(JPATH_SITE . '/plugins/' . $folder . '/' . $file); $file = JFile::stripExt($file); // Ignore example plugins if ($file == 'example' || $manifest_details === false) { continue; } $element = empty($manifest_details['filename']) ? $file : $manifest_details['filename']; $extension = JTable::getInstance('extension'); $extension->set('type', 'plugin'); $extension->set('client_id', 0); $extension->set('element', $element); $extension->set('folder', $folder); $extension->set('name', $manifest_details['name']); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = $extension; } $folder_list = JFolder::folders(JPATH_SITE . '/plugins/' . $folder); foreach ($folder_list as $plugin_folder) { $file_list = JFolder::files(JPATH_SITE . '/plugins/' . $folder . '/' . $plugin_folder, '\.xml$'); foreach ($file_list as $file) { $manifest_details = JInstaller::parseXMLInstallFile( JPATH_SITE . '/plugins/' . $folder . '/' . $plugin_folder . '/' . $file ); $file = JFile::stripExt($file); if ($file == 'example' || $manifest_details === false) { continue; } $element = empty($manifest_details['filename']) ? $file : $manifest_details['filename']; // Ignore example plugins $extension = JTable::getInstance('extension'); $extension->set('type', 'plugin'); $extension->set('client_id', 0); $extension->set('element', $element); $extension->set('folder', $folder); $extension->set('name', $manifest_details['name']); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = $extension; } } } return $results; } /** * Refreshes the extension table cache. * * @return boolean Result of operation, true if updated, false on failure. * * @since 3.1 */ public function refreshManifestCache() { /* * Plugins use the extensions table as their primary store * Similar to modules and templates, rather easy * If it's not in the extensions table we just add it */ $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id); $manifestPath = $client->path . '/plugins/' . $this->parent->extension->folder . '/' . $this->parent->extension->element . '/' . $this->parent->extension->element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->parent->extension->manifest_cache = json_encode($manifest_details); $this->parent->extension->name = $manifest_details['name']; if ($this->parent->extension->store()) { return true; } else { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PLG_REFRESH_MANIFEST_CACHE'), JLog::WARNING, 'jerror'); return false; } } } /** * Deprecated class placeholder. You should use JInstallerAdapterPlugin instead. * * @since 3.1 * @deprecated 4.0 * @codeCoverageIgnore */ class JInstallerPlugin extends JInstallerAdapterPlugin { } PK���\zg�jLjL,libraries/cms/installer/adapter/language.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; jimport('joomla.filesystem.folder'); /** * Language installer * * @since 3.1 */ class JInstallerAdapterLanguage extends JInstallerAdapter { /** * Core language pack flag * * @var boolean * @since 12.1 */ protected $core = false; /** * Method to copy the extension's base files from the <files> tag(s) and the manifest file * * @return void * * @since 3.4 * @throws RuntimeException */ protected function copyBaseFiles() { // TODO - Refactor adapter to use common code } /** * Method to do any prechecks and setup the install paths for the extension * * @return void * * @since 3.4 */ protected function setupInstallPaths() { // TODO - Refactor adapter to use common code } /** * Method to store the extension to the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function storeExtension() { // TODO - Refactor adapter to use common code } /** * Custom install method * * Note: This behaves badly due to hacks made in the middle of 1.5.x to add * the ability to install multiple distinct packs in one install. The * preferred method is to use a package to install multiple language packs. * * @return boolean True on success * * @since 3.1 */ public function install() { $source = $this->parent->getPath('source'); if (!$source) { $this->parent ->setPath( 'source', ($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/language/' . $this->parent->extension->element ); } $this->setManifest($this->parent->getManifest()); // Get the client application target if ($cname = (string) $this->getManifest()->attributes()->client) { // Attempt to map the client to a base path $client = JApplicationHelper::getClientInfo($cname, true); if ($client === null) { $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', JText::sprintf('JLIB_INSTALLER_ERROR_UNKNOWN_CLIENT_TYPE', $cname))); return false; } $basePath = $client->path; $clientId = $client->id; $element = $this->getManifest()->files; return $this->_install($cname, $basePath, $clientId, $element); } else { // No client attribute was found so we assume the site as the client $cname = 'site'; $basePath = JPATH_SITE; $clientId = 0; $element = $this->getManifest()->files; return $this->_install($cname, $basePath, $clientId, $element); } } /** * Install function that is designed to handle individual clients * * @param string $cname Cname @todo: not used * @param string $basePath The base name. * @param integer $clientId The client id. * @param object &$element The XML element. * * @return boolean * * @since 3.1 */ protected function _install($cname, $basePath, $clientId, &$element) { $this->setManifest($this->parent->getManifest()); // Get the language name // Set the extensions name $name = JFilterInput::getInstance()->clean((string) $this->getManifest()->name, 'cmd'); $this->set('name', $name); // Get the Language tag [ISO tag, eg. en-GB] $tag = (string) $this->getManifest()->tag; // Check if we found the tag - if we didn't, we may be trying to install from an older language package if (!$tag) { $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', JText::_('JLIB_INSTALLER_ERROR_NO_LANGUAGE_TAG'))); return false; } $this->set('tag', $tag); // Set the language installation path $this->parent->setPath('extension_site', $basePath . '/language/' . $tag); // Do we have a meta file in the file list? In other words... is this a core language pack? if ($element && count($element->children())) { $files = $element->children(); foreach ($files as $file) { if ((string) $file->attributes()->file == 'meta') { $this->core = true; break; } } } // If the language directory does not exist, let's create it $created = false; if (!file_exists($this->parent->getPath('extension_site'))) { if (!$created = JFolder::create($this->parent->getPath('extension_site'))) { $this->parent ->abort( JText::sprintf( 'JLIB_INSTALLER_ABORT', JText::sprintf('JLIB_INSTALLER_ERROR_CREATE_FOLDER_FAILED', $this->parent->getPath('extension_site')) ) ); return false; } } else { // Look for an update function or update tag $updateElement = $this->getManifest()->update; // Upgrade manually set or update tag detected if ($this->parent->isUpgrade() || $updateElement) { // Transfer control to the update function return $this->update(); } elseif (!$this->parent->isOverwrite()) { // Overwrite is set // We didn't have overwrite set, find an update function or find an update tag so lets call it safe if (file_exists($this->parent->getPath('extension_site'))) { // If the site exists say so. JLog::add( JText::sprintf('JLIB_INSTALLER_ABORT', JText::sprintf('JLIB_INSTALLER_ERROR_FOLDER_IN_USE', $this->parent->getPath('extension_site'))), JLog::WARNING, 'jerror' ); } else { // If the admin exists say so. JLog::add( JText::sprintf('JLIB_INSTALLER_ABORT', JText::sprintf('JLIB_INSTALLER_ERROR_FOLDER_IN_USE', $this->parent->getPath('extension_administrator'))), JLog::WARNING, 'jerror' ); } return false; } } /* * If we created the language directory we will want to remove it if we * have to roll back the installation, so let's add it to the installation * step stack */ if ($created) { $this->parent->pushStep(array('type' => 'folder', 'path' => $this->parent->getPath('extension_site'))); } // Copy all the necessary files if ($this->parent->parseFiles($element) === false) { // Install failed, rollback changes $this->parent->abort(); return false; } // Parse optional tags $this->parent->parseMedia($this->getManifest()->media); // Copy all the necessary font files to the common pdf_fonts directory $this->parent->setPath('extension_site', $basePath . '/language/pdf_fonts'); $overwrite = $this->parent->setOverwrite(true); if ($this->parent->parseFiles($this->getManifest()->fonts) === false) { // Install failed, rollback changes $this->parent->abort(); return false; } $this->parent->setOverwrite($overwrite); // Get the language description $description = (string) $this->getManifest()->description; if ($description) { $this->parent->set('message', JText::_($description)); } else { $this->parent->set('message', ''); } // Add an entry to the extension table with a whole heap of defaults $row = JTable::getInstance('extension'); $row->set('name', $this->get('name')); $row->set('type', 'language'); $row->set('element', $this->get('tag')); // There is no folder for languages $row->set('folder', ''); $row->set('enabled', 1); $row->set('protected', 0); $row->set('access', 0); $row->set('client_id', $clientId); $row->set('params', $this->parent->getParams()); $row->set('manifest_cache', $this->parent->generateManifestCache()); if (!$row->store()) { // Install failed, roll back changes $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', $row->getError())); return false; } // Clobber any possible pending updates $update = JTable::getInstance('update'); $uid = $update->find(array('element' => $this->get('tag'), 'type' => 'language', 'folder' => '')); if ($uid) { $update->delete($uid); } return $row->get('extension_id'); } /** * Custom update method * * @return boolean True on success, false on failure * * @since 3.1 */ public function update() { $xml = $this->parent->getManifest(); $this->setManifest($xml); $cname = $xml->attributes()->client; // Attempt to map the client to a base path $client = JApplicationHelper::getClientInfo($cname, true); if ($client === null || (empty($cname) && $cname !== 0)) { $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', JText::sprintf('JLIB_INSTALLER_ERROR_UNKNOWN_CLIENT_TYPE', $cname))); return false; } $basePath = $client->path; $clientId = $client->id; // Get the language name // Set the extensions name $name = (string) $this->getManifest()->name; $name = JFilterInput::getInstance()->clean($name, 'cmd'); $this->set('name', $name); // Get the Language tag [ISO tag, eg. en-GB] $tag = (string) $xml->tag; // Check if we found the tag - if we didn't, we may be trying to install from an older language package if (!$tag) { $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', JText::_('JLIB_INSTALLER_ERROR_NO_LANGUAGE_TAG'))); return false; } $this->set('tag', $tag); // Set the language installation path $this->parent->setPath('extension_site', $basePath . '/language/' . $tag); // Do we have a meta file in the file list? In other words... is this a core language pack? if (count($xml->files->children())) { foreach ($xml->files->children() as $file) { if ((string) $file->attributes()->file == 'meta') { $this->core = true; break; } } } // Copy all the necessary files if ($this->parent->parseFiles($xml->files) === false) { // Install failed, rollback changes $this->parent->abort(); return false; } // Parse optional tags $this->parent->parseMedia($xml->media); // Copy all the necessary font files to the common pdf_fonts directory $this->parent->setPath('extension_site', $basePath . '/language/pdf_fonts'); $overwrite = $this->parent->setOverwrite(true); if ($this->parent->parseFiles($xml->fonts) === false) { // Install failed, rollback changes $this->parent->abort(); return false; } $this->parent->setOverwrite($overwrite); // Get the language description and set it as message $this->parent->set('message', (string) $xml->description); /** * --------------------------------------------------------------------------------------------- * Finalization and Cleanup Section * --------------------------------------------------------------------------------------------- */ // Clobber any possible pending updates $update = JTable::getInstance('update'); $uid = $update->find(array('element' => $this->get('tag'), 'type' => 'language', 'client_id' => $clientId)); if ($uid) { $update->delete($uid); } // Update an entry to the extension table $row = JTable::getInstance('extension'); $eid = $row->find(array('element' => strtolower($this->get('tag')), 'type' => 'language', 'client_id' => $clientId)); if ($eid) { $row->load($eid); } else { // Set the defaults // There is no folder for language $row->set('folder', ''); $row->set('enabled', 1); $row->set('protected', 0); $row->set('access', 0); $row->set('client_id', $clientId); $row->set('params', $this->parent->getParams()); } $row->set('name', $this->get('name')); $row->set('type', 'language'); $row->set('element', $this->get('tag')); $row->set('manifest_cache', $this->parent->generateManifestCache()); if (!$row->store()) { // Install failed, roll back changes $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT', $row->getError())); return false; } return $row->get('extension_id'); } /** * Custom uninstall method * * @param string $eid The tag of the language to uninstall * * @return mixed Return value for uninstall method in component uninstall file * * @since 3.1 */ public function uninstall($eid) { // Load up the extension details $extension = JTable::getInstance('extension'); $extension->load($eid); // Grab a copy of the client details $client = JApplicationHelper::getClientInfo($extension->get('client_id')); // Check the element isn't blank to prevent nuking the languages directory...just in case $element = $extension->get('element'); if (empty($element)) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_ELEMENT_EMPTY'), JLog::WARNING, 'jerror'); return false; } // Check that the language is not protected, Normally en-GB. $protected = $extension->get('protected'); if ($protected == 1) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PROTECTED'), JLog::WARNING, 'jerror'); return false; } // Verify that it's not the default language for that client $params = JComponentHelper::getParams('com_languages'); if ($params->get($client->name) == $element) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_DEFAULT'), JLog::WARNING, 'jerror'); return false; } // Construct the path from the client, the language and the extension element name $path = $client->path . '/language/' . $element; // Get the package manifest object and remove media $this->parent->setPath('source', $path); // We do findManifest to avoid problem when uninstalling a list of extension: getManifest cache its manifest file $this->parent->findManifest(); $this->setManifest($this->parent->getManifest()); $this->parent->removeFiles($this->getManifest()->media); // Check it exists if (!JFolder::exists($path)) { // If the folder doesn't exist lets just nuke the row as well and presume the user killed it for us $extension->delete(); JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PATH_EMPTY'), JLog::WARNING, 'jerror'); return false; } if (!JFolder::delete($path)) { // If deleting failed we'll leave the extension entry in tact just in case JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_UNINSTALL_DIRECTORY'), JLog::WARNING, 'jerror'); return false; } // Remove the extension table entry $extension->delete(); // Setting the language of users which have this language as the default language $db = JFactory::getDbo(); $query = $db->getQuery(true) ->from('#__users') ->select('*'); $db->setQuery($query); $users = $db->loadObjectList(); if ($client->name == 'administrator') { $param_name = 'admin_language'; } else { $param_name = 'language'; } $count = 0; foreach ($users as $user) { $registry = new Registry; $registry->loadString($user->params); if ($registry->get($param_name) == $element) { $registry->set($param_name, ''); $query->clear() ->update('#__users') ->set('params=' . $db->quote($registry)) ->where('id=' . (int) $user->id); $db->setQuery($query); $db->execute(); $count++; } } if (!empty($count)) { JLog::add(JText::plural('JLIB_INSTALLER_NOTICE_LANG_RESET_USERS', $count), JLog::NOTICE, 'jerror'); } // All done! return true; } /** * Custom discover method * Finds language files * * @return boolean True on success * * @since 3.1 */ public function discover() { $results = array(); $site_languages = JFolder::folders(JPATH_SITE . '/language'); $admin_languages = JFolder::folders(JPATH_ADMINISTRATOR . '/language'); foreach ($site_languages as $language) { if (file_exists(JPATH_SITE . '/language/' . $language . '/' . $language . '.xml')) { $manifest_details = JInstaller::parseXMLInstallFile(JPATH_SITE . '/language/' . $language . '/' . $language . '.xml'); $extension = JTable::getInstance('extension'); $extension->set('type', 'language'); $extension->set('client_id', 0); $extension->set('element', $language); $extension->set('folder', ''); $extension->set('name', $language); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = $extension; } } foreach ($admin_languages as $language) { if (file_exists(JPATH_ADMINISTRATOR . '/language/' . $language . '/' . $language . '.xml')) { $manifest_details = JInstaller::parseXMLInstallFile(JPATH_ADMINISTRATOR . '/language/' . $language . '/' . $language . '.xml'); $extension = JTable::getInstance('extension'); $extension->set('type', 'language'); $extension->set('client_id', 1); $extension->set('element', $language); $extension->set('folder', ''); $extension->set('name', $language); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = $extension; } } return $results; } /** * Custom discover install method * Basically updates the manifest cache and leaves everything alone * * @return integer The extension id * * @since 3.1 */ public function discover_install() { // Need to find to find where the XML file is since we don't store this normally $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id); $short_element = $this->parent->extension->element; $manifestPath = $client->path . '/language/' . $short_element . '/' . $short_element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $this->parent->setPath('source', $client->path . '/language/' . $short_element); $this->parent->setPath('extension_root', $this->parent->getPath('source')); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->parent->extension->manifest_cache = json_encode($manifest_details); $this->parent->extension->state = 0; $this->parent->extension->name = $manifest_details['name']; $this->parent->extension->enabled = 1; // @todo remove code: $this->parent->extension->params = $this->parent->getParams(); try { $this->parent->extension->store(); } catch (RuntimeException $e) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_LANG_DISCOVER_STORE_DETAILS'), JLog::WARNING, 'jerror'); return false; } return $this->parent->extension->get('extension_id'); } /** * Refreshes the extension table cache * * @return boolean result of operation, true if updated, false on failure * * @since 3.1 */ public function refreshManifestCache() { $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id); $manifestPath = $client->path . '/language/' . $this->parent->extension->element . '/' . $this->parent->extension->element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->parent->extension->manifest_cache = json_encode($manifest_details); $this->parent->extension->name = $manifest_details['name']; if ($this->parent->extension->store()) { return true; } else { JLog::add(JText::_('JLIB_INSTALLER_ERROR_MOD_REFRESH_MANIFEST_CACHE'), JLog::WARNING, 'jerror'); return false; } } } /** * Deprecated class placeholder. You should use JInstallerAdapterLanguage instead. * * @since 3.1 * @deprecated 4.0 * @codeCoverageIgnore */ class JInstallerLanguage extends JInstallerAdapterLanguage { } PK���\X�țR?R?(libraries/cms/installer/adapter/file.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); /** * File installer * * @since 3.1 */ class JInstallerAdapterFile extends JInstallerAdapter { /** * <scriptfile> element of the extension manifest * * @var object * @since 3.1 */ protected $scriptElement = null; /** * Flag if the adapter supports discover installs * * Adapters should override this and set to false if discover install is unsupported * * @var boolean * @since 3.4 */ protected $supportsDiscoverInstall = false; /** * Method to copy the extension's base files from the <files> tag(s) and the manifest file * * @return void * * @since 3.4 * @throws RuntimeException */ protected function copyBaseFiles() { // Populate File and Folder List to copy $this->populateFilesAndFolderList(); // Now that we have folder list, lets start creating them foreach ($this->folderList as $folder) { if (!JFolder::exists($folder)) { if (!$created = JFolder::create($folder)) { throw new RuntimeException( JText::sprintf('JLIB_INSTALLER_ABORT_FILE_INSTALL_FAIL_SOURCE_DIRECTORY', $folder) ); } // Since we created a directory and will want to remove it if we have to roll back. // The installation due to some errors, let's add it to the installation step stack. if ($created) { $this->parent->pushStep(array('type' => 'folder', 'path' => $folder)); } } } // Now that we have file list, let's start copying them $this->parent->copyFiles($this->fileList); } /** * Method to finalise the installation processing * * @return void * * @since 3.4 * @throws RuntimeException */ protected function finaliseInstall() { // Clobber any possible pending updates $update = JTable::getInstance('update'); $uid = $update->find( array( 'element' => $this->element, 'type' => $this->type ) ); if ($uid) { $update->delete($uid); } // Lastly, we will copy the manifest file to its appropriate place. $manifest = array(); $manifest['src'] = $this->parent->getPath('manifest'); $manifest['dest'] = JPATH_MANIFESTS . '/files/' . basename($this->parent->getPath('manifest')); if (!$this->parent->copyFiles(array($manifest), true)) { // Install failed, rollback changes throw new RuntimeException(JText::_('JLIB_INSTALLER_ABORT_FILE_INSTALL_COPY_SETUP')); } // If there is a manifest script, let's copy it. if ($this->manifest_script) { // First, we have to create a folder for the script if one isn't present if (!file_exists($this->parent->getPath('extension_root'))) { JFolder::create($this->parent->getPath('extension_root')); } $path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script; $path['dest'] = $this->parent->getPath('extension_root') . '/' . $this->manifest_script; if (!file_exists($path['dest']) || $this->parent->isOverwrite()) { if (!$this->parent->copyFiles(array($path))) { // Install failed, rollback changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_MANIFEST', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)) ) ); } } } } /** * Get the filtered extension element from the manifest * * @param string $element Optional element name to be converted * * @return string The filtered element * * @since 3.4 */ public function getElement($element = null) { if (!$element) { // Ensure the element is a string $element = (string) $this->getManifest()->name; // Filter the name for illegal characters $element = str_replace('files_', '', JFilterInput::getInstance()->clean($element, 'cmd')); } return $element; } /** * Custom loadLanguage method * * @param string $path The path on which to find language files. * * @return void * * @since 3.1 */ public function loadLanguage($path) { $extension = 'files_' . strtolower(str_replace('files_', '', $this->getElement())); $this->doLoadLanguage($extension, $path, JPATH_SITE); } /** * Method to parse optional tags in the manifest * * @return void * * @since 3.4 */ protected function parseOptionalTags() { // Parse optional tags $this->parent->parseLanguages($this->getManifest()->languages); } /** * Method to do any prechecks and setup the install paths for the extension * * @return void * * @since 3.4 */ protected function setupInstallPaths() { // Set the file root path if ($this->name == 'files_joomla') { // If we are updating the Joomla core, set the root path to the root of Joomla $this->parent->setPath('extension_root', JPATH_ROOT); } else { $this->parent->setPath('extension_root', JPATH_MANIFESTS . '/files/' . $this->element); } } /** * Method to store the extension to the database * * @return void * * @since 3.4 * @throws RuntimeException */ protected function storeExtension() { if ($this->currentExtensionId) { // Load the entry and update the manifest_cache $this->extension->load($this->currentExtensionId); // Update name $this->extension->name = $this->name; // Update manifest $this->extension->manifest_cache = $this->parent->generateManifestCache(); if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_ROLLBACK', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->extension->getError() ) ); } } else { // Add an entry to the extension table with a whole heap of defaults $this->extension->name = $this->name; $this->extension->type = 'file'; $this->extension->element = $this->element; // There is no folder for files so leave it blank $this->extension->folder = ''; $this->extension->enabled = 1; $this->extension->protected = 0; $this->extension->access = 0; $this->extension->client_id = 0; $this->extension->params = ''; $this->extension->system_data = ''; $this->extension->manifest_cache = $this->parent->generateManifestCache(); $this->extension->custom_data = ''; if (!$this->extension->store()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_ROLLBACK', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->extension->getError() ) ); } // Since we have created a module item, we add it to the installation step stack // so that if we have to rollback the changes we can undo it. $this->parent->pushStep(array('type' => 'extension', 'extension_id' => $this->extension->extension_id)); } } /** * Custom uninstall method * * @param string $id The id of the file to uninstall * * @return boolean True on success * * @since 3.1 */ public function uninstall($id) { $row = JTable::getInstance('extension'); if (!$row->load($id)) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_FILE_UNINSTALL_LOAD_ENTRY'), JLog::WARNING, 'jerror'); return false; } if ($row->protected) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_FILE_UNINSTALL_WARNCOREFILE'), JLog::WARNING, 'jerror'); return false; } $retval = true; $manifestFile = JPATH_MANIFESTS . '/files/' . $row->element . '.xml'; // Because files may not have their own folders we cannot use the standard method of finding an installation manifest if (file_exists($manifestFile)) { // Set the files root path $this->parent->setPath('extension_root', JPATH_MANIFESTS . '/files/' . $row->element); $xml = simplexml_load_file($manifestFile); // If we cannot load the XML file return null if (!$xml) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_FILE_UNINSTALL_LOAD_MANIFEST'), JLog::WARNING, 'jerror'); return false; } // Check for a valid XML root tag. if ($xml->getName() != 'extension') { JLog::add(JText::_('JLIB_INSTALLER_ERROR_FILE_UNINSTALL_INVALID_MANIFEST'), JLog::WARNING, 'jerror'); return false; } $this->setManifest($xml); // If there is an manifest class file, let's load it $this->scriptElement = $this->getManifest()->scriptfile; $manifestScript = (string) $this->getManifest()->scriptfile; if ($manifestScript) { $manifestScriptFile = $this->parent->getPath('extension_root') . '/' . $manifestScript; if (is_file($manifestScriptFile)) { // Load the file include_once $manifestScriptFile; } // Set the class name $classname = $row->element . 'InstallerScript'; if (class_exists($classname)) { // Create a new instance $this->parent->manifestClass = new $classname($this); // And set this so we can copy it later $this->set('manifest_script', $manifestScript); } } ob_start(); ob_implicit_flush(false); // Run uninstall if possible if ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'uninstall')) { $this->parent->manifestClass->uninstall($this); } $msg = ob_get_contents(); ob_end_clean(); if ($msg != '') { $this->parent->set('extension_message', $msg); } $db = JFactory::getDbo(); // Let's run the uninstall queries for the extension $result = $this->parent->parseSQLFiles($this->getManifest()->uninstall->sql); if ($result === false) { // Install failed, rollback changes JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_FILE_UNINSTALL_SQL_ERROR', $db->stderr(true)), JLog::WARNING, 'jerror'); $retval = false; } // Remove the schema version $query = $db->getQuery(true) ->delete('#__schemas') ->where('extension_id = ' . $row->extension_id); $db->setQuery($query); $db->execute(); // Loop through all elements and get list of files and folders foreach ($xml->fileset->files as $eFiles) { $target = (string) $eFiles->attributes()->target; // Create folder path if (empty($target)) { $targetFolder = JPATH_ROOT; } else { $targetFolder = JPATH_ROOT . '/' . $target; } $folderList = array(); // Check if all children exists if (count($eFiles->children()) > 0) { // Loop through all filenames elements foreach ($eFiles->children() as $eFileName) { if ($eFileName->getName() == 'folder') { $folderList[] = $targetFolder . '/' . $eFileName; } else { $fileName = $targetFolder . '/' . $eFileName; JFile::delete($fileName); } } } // Delete any folders that don't have any content in them. foreach ($folderList as $folder) { $files = JFolder::files($folder); if (!count($files)) { JFolder::delete($folder); } } } JFile::delete($manifestFile); // Lastly, remove the extension_root $folder = $this->parent->getPath('extension_root'); if (JFolder::exists($folder)) { JFolder::delete($folder); } } else { JLog::add(JText::_('JLIB_INSTALLER_ERROR_FILE_UNINSTALL_INVALID_NOTFOUND_MANIFEST'), JLog::WARNING, 'jerror'); // Delete the row because its broken $row->delete(); return false; } $this->parent->removeFiles($xml->languages); $row->delete(); return $retval; } /** * Function used to check if extension is already installed * * @param string $extension The element name of the extension to install * * @return boolean True if extension exists * * @since 3.1 */ protected function extensionExistsInSystem($extension = null) { // Get a database connector object $db = $this->parent->getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('extension_id')) ->from($db->quoteName('#__extensions')) ->where($db->quoteName('type') . ' = ' . $db->quote('file')) ->where($db->quoteName('element') . ' = ' . $db->quote($extension)); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { // Install failed, roll back changes $this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT_FILE_ROLLBACK', $db->stderr(true))); return false; } $id = $db->loadResult(); if (empty($id)) { return false; } return true; } /** * Function used to populate files and folder list * * @return boolean none * * @since 3.1 */ protected function populateFilesAndFolderList() { // Initialise variable $this->folderList = array(); $this->fileList = array(); // Set root folder names $packagePath = $this->parent->getPath('source'); $jRootPath = JPath::clean(JPATH_ROOT); // Loop through all elements and get list of files and folders foreach ($this->getManifest()->fileset->files as $eFiles) { // Check if the element is files element $folder = (string) $eFiles->attributes()->folder; $target = (string) $eFiles->attributes()->target; // Split folder names into array to get folder names. This will help in creating folders $arrList = preg_split("#/|\\/#", $target); $folderName = $jRootPath; foreach ($arrList as $dir) { if (empty($dir)) { continue; } $folderName .= '/' . $dir; // Check if folder exists, if not then add to the array for folder creation if (!JFolder::exists($folderName)) { array_push($this->folderList, $folderName); } } // Create folder path $sourceFolder = empty($folder) ? $packagePath : $packagePath . '/' . $folder; $targetFolder = empty($target) ? $jRootPath : $jRootPath . '/' . $target; // Check if source folder exists if (!JFolder::exists($sourceFolder)) { JLog::add(JText::sprintf('JLIB_INSTALLER_ABORT_FILE_INSTALL_FAIL_SOURCE_DIRECTORY', $sourceFolder), JLog::WARNING, 'jerror'); // If installation fails, rollback $this->parent->abort(); return false; } // Check if all children exists if (count($eFiles->children())) { // Loop through all filenames elements foreach ($eFiles->children() as $eFileName) { $path['src'] = $sourceFolder . '/' . $eFileName; $path['dest'] = $targetFolder . '/' . $eFileName; $path['type'] = 'file'; if ($eFileName->getName() == 'folder') { $folderName = $targetFolder . '/' . $eFileName; array_push($this->folderList, $folderName); $path['type'] = 'folder'; } array_push($this->fileList, $path); } } else { $files = JFolder::files($sourceFolder); foreach ($files as $file) { $path['src'] = $sourceFolder . '/' . $file; $path['dest'] = $targetFolder . '/' . $file; array_push($this->fileList, $path); } } } } /** * Refreshes the extension table cache * * @return boolean result of operation, true if updated, false on failure * * @since 3.1 */ public function refreshManifestCache() { // Need to find to find where the XML file is since we don't store this normally $manifestPath = JPATH_MANIFESTS . '/files/' . $this->parent->extension->element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->parent->extension->manifest_cache = json_encode($manifest_details); $this->parent->extension->name = $manifest_details['name']; try { return $this->parent->extension->store(); } catch (RuntimeException $e) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_PACK_REFRESH_MANIFEST_CACHE'), JLog::WARNING, 'jerror'); return false; } } } /** * Deprecated class placeholder. You should use JInstallerAdapterFile instead. * * @since 3.1 * @deprecated 4.0 * @codeCoverageIgnore */ class JInstallerFile extends JInstallerAdapterFile { } PK���\#2��`�`�-libraries/cms/installer/adapter/component.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Installer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); /** * Component installer * * @since 3.1 */ class JInstallerAdapterComponent extends JInstallerAdapter { /** * The list of current files fo the Joomla! CMS administrator that are installed and is read * from the manifest on disk in the update area to handle doing a diff * and deleting files that are in the old files list and not in the new * files list. * * @var array * @since 3.1 * */ protected $oldAdminFiles = null; /** * The list of current files that are installed and is read * from the manifest on disk in the update area to handle doing a diff * and deleting files that are in the old files list and not in the new * files list. * * @var array * @since 3.1 * */ protected $oldFiles = null; /** * A path to the PHP file that the scriptfile declaration in * the manifest refers to. * * @var string * @since 3.1 * */ protected $manifest_script = null; /** * For legacy installations this is a path to the PHP file that the scriptfile declaration in the * manifest refers to. * * @var string * @since 3.1 * */ protected $install_script = null; /** * Method to check if the extension is present in the filesystem * * @return boolean * * @since 3.4 * @throws RuntimeException */ protected function checkExtensionInFilesystem() { /* * If the component site or admin directory already exists, then we will assume that the component is already * installed or another component is using that directory. */ if (file_exists($this->parent->getPath('extension_site')) || file_exists($this->parent->getPath('extension_administrator'))) { // Look for an update function or update tag $updateElement = $this->getManifest()->update; // Upgrade manually set or update function available or update tag detected if ($this->parent->isUpgrade() || ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'update')) || $updateElement) { // If there is a matching extension mark this as an update $this->setRoute('update'); } elseif (!$this->parent->isOverwrite()) { // We didn't have overwrite set, find an update function or find an update tag so lets call it safe if (file_exists($this->parent->getPath('extension_site'))) { // If the site exists say so. throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ERROR_COMP_INSTALL_DIR_SITE', $this->parent->getPath('extension_site') ) ); } // If the admin exists say so throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ERROR_COMP_INSTALL_DIR_ADMIN', $this->parent->getPath('extension_administrator') ) ); } } return false; } /** * Method to copy the extension's base files from the <files> tag(s) and the manifest file * * @return void * * @since 3.4 * @throws RuntimeException */ protected function copyBaseFiles() { // Copy site files if ($this->getManifest()->files) { if ($this->route == 'update') { $result = $this->parent->parseFiles($this->getManifest()->files, 0, $this->oldFiles); } else { $result = $this->parent->parseFiles($this->getManifest()->files); } if ($result === false) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_COMP_FAIL_SITE_FILES', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)) ) ); } } // Copy admin files if ($this->getManifest()->administration->files) { if ($this->route == 'update') { $result = $this->parent->parseFiles($this->getManifest()->administration->files, 1, $this->oldAdminFiles); } else { $result = $this->parent->parseFiles($this->getManifest()->administration->files, 1); } if ($result === false) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_COMP_FAIL_ADMIN_FILES', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)) ) ); } } // If there is a manifest script, let's copy it. if ($this->manifest_script) { $path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script; $path['dest'] = $this->parent->getPath('extension_administrator') . '/' . $this->manifest_script; if (!file_exists($path['dest']) || $this->parent->isOverwrite()) { if (!$this->parent->copyFiles(array($path))) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_COMP_COPY_MANIFEST', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)) ) ); } } } } /** * Method to create the extension root path if necessary * * @return void * * @since 3.4 * @throws RuntimeException */ protected function createExtensionRoot() { // If the component directory does not exist, let's create it $created = false; if (!file_exists($this->parent->getPath('extension_site'))) { if (!$created = JFolder::create($this->parent->getPath('extension_site'))) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ERROR_COMP_FAILED_TO_CREATE_DIRECTORY', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->parent->getPath('extension_site') ) ); } } /* * Since we created the component directory and we will want to remove it if we have to roll back * the installation, let's add it to the installation step stack */ if ($created) { $this->parent->pushStep( array( 'type' => 'folder', 'path' => $this->parent->getPath('extension_site') ) ); } // If the component admin directory does not exist, let's create it $created = false; if (!file_exists($this->parent->getPath('extension_administrator'))) { if (!$created = JFolder::create($this->parent->getPath('extension_administrator'))) { throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ERROR_COMP_FAILED_TO_CREATE_DIRECTORY', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->parent->getPath('extension_site') ) ); } } /* * Since we created the component admin directory and we will want to remove it if we have to roll * back the installation, let's add it to the installation step stack */ if ($created) { $this->parent->pushStep( array( 'type' => 'folder', 'path' => $this->parent->getPath('extension_administrator') ) ); } } /** * Method to finalise the installation processing * * @return void * * @since 3.4 * @throws RuntimeException */ protected function finaliseInstall() { /** @var JTableUpdate $update */ $update = JTable::getInstance('update'); // Clobber any possible pending updates $uid = $update->find( array( 'element' => $this->element, 'type' => $this->extension->type, 'client_id' => 1 ) ); if ($uid) { $update->delete($uid); } // We will copy the manifest file to its appropriate place. if ($this->route != 'discover_install') { if (!$this->parent->copyManifest()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_COMP_COPY_SETUP', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)) ) ); } } // Time to build the admin menus if (!$this->_buildAdminMenus($this->extension->extension_id)) { JLog::add(JText::_('JLIB_INSTALLER_ABORT_COMP_BUILDADMINMENUS_FAILED'), JLog::WARNING, 'jerror'); } // Make sure that menu items pointing to the component have correct component id assigned to them. // Prevents message "Component 'com_extension' does not exist." after uninstalling / re-installing component. if (!$this->_updateSiteMenus($this->extension->extension_id)) { JLog::add(JText::_('JLIB_INSTALLER_ABORT_COMP_UPDATESITEMENUS_FAILED'), JLog::WARNING, 'jerror'); } /** @var JTableAsset $asset */ $asset = JTable::getInstance('Asset'); // Check if an asset already exists for this extension and create it if not if (!$asset->loadByName($this->extension->element)) { // Register the component container just under root in the assets table. $asset->name = $this->extension->element; $asset->parent_id = 1; $asset->rules = '{}'; $asset->title = $this->extension->name; $asset->setLocation(1, 'last-child'); if (!$asset->store()) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_ROLLBACK', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->extension->getError() ) ); } } } /** * Get the filtered extension element from the manifest * * @param string $element Optional element name to be converted * * @return string The filtered element * * @since 3.4 */ public function getElement($element = null) { $element = parent::getElement($element); if (substr($element, 0, 4) != 'com_') { $element = 'com_' . $element; } return $element; } /** * Custom loadLanguage method * * @param string $path The path language files are on. * * @return void * * @since 3.1 */ public function loadLanguage($path = null) { $source = $this->parent->getPath('source'); $client = $this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE; if (!$source) { $this->parent->setPath('source', $client . '/components/' . $this->parent->extension->element); } $extension = $this->getElement(); $source = $path ? $path : $client . '/components/' . $extension; if ($this->getManifest()->administration->files) { $element = $this->getManifest()->administration->files; } elseif ($this->getManifest()->files) { $element = $this->getManifest()->files; } else { $element = null; } if ($element) { $folder = (string) $element->attributes()->folder; if ($folder && file_exists($path . '/' . $folder)) { $source = $path . '/' . $folder; } } $this->doLoadLanguage($extension, $source); } /** * Method to parse optional tags in the manifest * * @return void * * @since 3.4 */ protected function parseOptionalTags() { // Parse optional tags $this->parent->parseMedia($this->getManifest()->media); $this->parent->parseLanguages($this->getManifest()->languages); $this->parent->parseLanguages($this->getManifest()->administration->languages, 1); } /** * Prepares the adapter for a discover_install task * * @return void * * @since 3.4 * @throws RuntimeException */ public function prepareDiscoverInstall() { // Need to find to find where the XML file is since we don't store this normally $client = JApplicationHelper::getClientInfo($this->extension->client_id); $short_element = str_replace('com_', '', $this->extension->element); $manifestPath = $client->path . '/components/' . $this->extension->element . '/' . $short_element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $this->parent->setPath('source', $client->path . '/components/' . $this->extension->element); $this->parent->setPath('extension_root', $this->parent->getPath('source')); $this->setManifest($this->parent->getManifest()); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->extension->manifest_cache = json_encode($manifest_details); $this->extension->state = 0; $this->extension->name = $manifest_details['name']; $this->extension->enabled = 1; $this->extension->params = $this->parent->getParams(); $stored = false; try { $this->extension->store(); $stored = true; } catch (RuntimeException $e) { // Try to delete existing failed records before retrying $db = $this->db; $query = $db->getQuery(true) ->select($db->qn('extension_id')) ->from($db->qn('#__extensions')) ->where($db->qn('name') . ' = ' . $db->q($this->extension->name)) ->where($db->qn('type') . ' = ' . $db->q($this->extension->type)) ->where($db->qn('element') . ' = ' . $db->q($this->extension->element)); $db->setQuery($query); $extension_ids = $db->loadColumn(); if (!empty($extension_ids)) { foreach ($extension_ids as $eid) { // Remove leftover admin menus for this extension ID $this->_removeAdminMenus($eid); // Remove the extension record itself /** @var JTableExtension $extensionTable */ $extensionTable = JTable::getInstance('extension'); $extensionTable->delete($eid); } } } if (!$stored) { try { $this->extension->store(); } catch (RuntimeException $e) { throw new RuntimeException(JText::_('JLIB_INSTALLER_ERROR_COMP_DISCOVER_STORE_DETAILS')); } } } /** * Method to do any prechecks and setup the install paths for the extension * * @return void * * @since 3.4 * @throws RuntimeException */ protected function setupInstallPaths() { // Set the installation target paths $this->parent->setPath('extension_site', JPath::clean(JPATH_SITE . '/components/' . $this->element)); $this->parent->setPath('extension_administrator', JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $this->element)); // Copy the admin path as it's used as a common base $this->parent->setPath('extension_root', $this->parent->getPath('extension_administrator')); // Make sure that we have an admin element if (!$this->getManifest()->administration) { throw new RuntimeException(JText::_('JLIB_INSTALLER_ERROR_COMP_INSTALL_ADMIN_ELEMENT')); } } /** * Method to setup the update routine for the adapter * * @return void * * @since 3.4 */ protected function setupUpdates() { // Hunt for the original XML file $old_manifest = null; // Use a temporary instance due to side effects; start in the administrator first $tmpInstaller = new JInstaller; $tmpInstaller->setPath('source', $this->parent->getPath('extension_administrator')); if (!$tmpInstaller->findManifest()) { // Then the site $tmpInstaller->setPath('source', $this->parent->getPath('extension_site')); if ($tmpInstaller->findManifest()) { $old_manifest = $tmpInstaller->getManifest(); } } else { $old_manifest = $tmpInstaller->getManifest(); } if ($old_manifest) { $this->oldAdminFiles = $old_manifest->administration->files; $this->oldFiles = $old_manifest->files; } } /** * Method to store the extension to the database * * @param bool $deleteExisting Should I try to delete existing records of the same component? * * @return void * * @since 3.4 * @throws RuntimeException */ protected function storeExtension($deleteExisting = false) { // The extension is stored during prepareDiscoverInstall for discover installs if ($this->route == 'discover_install') { return; } // Add or update an entry to the extension table $this->extension->name = $this->name; $this->extension->type = 'component'; $this->extension->element = $this->element; // If we are told to delete existing extension entries then do so. if ($deleteExisting) { $db = $this->parent->getDbo(); $query = $db->getQuery(true) ->select($db->qn('extension_id')) ->from($db->qn('#__extensions')) ->where($db->qn('name') . ' = ' . $db->q($this->extension->name)) ->where($db->qn('type') . ' = ' . $db->q($this->extension->type)) ->where($db->qn('element') . ' = ' . $db->q($this->extension->element)); $db->setQuery($query); $extension_ids = $db->loadColumn(); if (!empty($extension_ids)) { foreach ($extension_ids as $eid) { // Remove leftover admin menus for this extension ID $this->_removeAdminMenus($eid); // Remove the extension record itself /** @var JTableExtension $extensionTable */ $extensionTable = JTable::getInstance('extension'); $extensionTable->delete($eid); } } } // If there is not already a row, generate a heap of defaults if (!$this->currentExtensionId) { $this->extension->folder = ''; $this->extension->enabled = 1; $this->extension->protected = 0; $this->extension->access = 0; $this->extension->client_id = 1; $this->extension->params = $this->parent->getParams(); $this->extension->custom_data = ''; } $this->extension->manifest_cache = $this->parent->generateManifestCache(); $couldStore = $this->extension->store(); if (!$couldStore && $deleteExisting) { // Install failed, roll back changes throw new RuntimeException( JText::sprintf( 'JLIB_INSTALLER_ABORT_COMP_INSTALL_ROLLBACK', $this->extension->getError() ) ); } if (!$couldStore && !$deleteExisting) { // Maybe we have a failed installation (e.g. timeout). Let's retry after deleting old records. $this->storeExtension(true); } } /** * Custom uninstall method for components * * @param integer $id The unique extension id of the component to uninstall * * @return mixed Return value for uninstall method in component uninstall file * * @since 3.1 */ public function uninstall($id) { $db = $this->db; $retval = true; // First order of business will be to load the component object table from the database. // This should give us the necessary information to proceed. if (!$this->extension->load((int) $id)) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_COMP_UNINSTALL_ERRORUNKOWNEXTENSION'), JLog::WARNING, 'jerror'); return false; } // Is the component we are trying to uninstall a core one? // Because that is not a good idea... if ($this->extension->protected) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_COMP_UNINSTALL_WARNCORECOMPONENT'), JLog::WARNING, 'jerror'); return false; } // Get the admin and site paths for the component $this->parent->setPath('extension_administrator', JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $this->extension->element)); $this->parent->setPath('extension_site', JPath::clean(JPATH_SITE . '/components/' . $this->extension->element)); // Copy the admin path as it's used as a common base $this->parent->setPath('extension_root', $this->parent->getPath('extension_administrator')); /** * --------------------------------------------------------------------------------------------- * Manifest Document Setup Section * --------------------------------------------------------------------------------------------- */ // Find and load the XML install file for the component $this->parent->setPath('source', $this->parent->getPath('extension_administrator')); // Get the package manifest object // We do findManifest to avoid problem when uninstalling a list of extension: getManifest cache its manifest file $this->parent->findManifest(); $this->setManifest($this->parent->getManifest()); if (!$this->getManifest()) { // Make sure we delete the folders if no manifest exists JFolder::delete($this->parent->getPath('extension_administrator')); JFolder::delete($this->parent->getPath('extension_site')); // Remove the menu $this->_removeAdminMenus($this->extension->extension_id); // Raise a warning JLog::add(JText::_('JLIB_INSTALLER_ERROR_COMP_UNINSTALL_ERRORREMOVEMANUALLY'), JLog::WARNING, 'jerror'); // Return return false; } // Set the extensions name $this->set('name', $this->getName()); $this->set('element', $this->getElement()); // Attempt to load the admin language file; might have uninstall strings $this->loadLanguage(JPATH_ADMINISTRATOR . '/components/' . $this->element); /** * --------------------------------------------------------------------------------------------- * Installer Trigger Loading and Uninstall * --------------------------------------------------------------------------------------------- */ $this->setupScriptfile(); try { $this->triggerManifestScript('uninstall'); } catch (RuntimeException $e) { // Ignore errors for now } /** * --------------------------------------------------------------------------------------------- * Database Processing Section * --------------------------------------------------------------------------------------------- */ // Let's run the uninstall queries for the component try { $this->parseQueries(); } catch (RuntimeException $e) { JLog::add($e->getMessage(), JLog::WARNING, 'jerror'); $retval = false; } $this->_removeAdminMenus($this->extension->extension_id); /** * --------------------------------------------------------------------------------------------- * Filesystem Processing Section * --------------------------------------------------------------------------------------------- */ // Let's remove those language files and media in the JROOT/images/ folder that are // associated with the component we are uninstalling $this->parent->removeFiles($this->getManifest()->media); $this->parent->removeFiles($this->getManifest()->languages); $this->parent->removeFiles($this->getManifest()->administration->languages, 1); // Remove the schema version $query = $db->getQuery(true) ->delete('#__schemas') ->where('extension_id = ' . $id); $db->setQuery($query); $db->execute(); // Remove the component container in the assets table. $asset = JTable::getInstance('Asset'); if ($asset->loadByName($this->element)) { $asset->delete(); } // Remove categories for this component $query->clear() ->delete('#__categories') ->where('extension=' . $db->quote($this->element), 'OR') ->where('extension LIKE ' . $db->quote($this->element . '.%')); $db->setQuery($query); $db->execute(); // Clobber any possible pending updates $update = JTable::getInstance('update'); $uid = $update->find( array( 'element' => $this->extension->element, 'type' => 'component', 'client_id' => 1, 'folder' => '' ) ); if ($uid) { $update->delete($uid); } // Now we need to delete the installation directories. This is the final step in uninstalling the component. if (trim($this->extension->element)) { // Delete the component site directory if (is_dir($this->parent->getPath('extension_site'))) { if (!JFolder::delete($this->parent->getPath('extension_site'))) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_SITE'), JLog::WARNING, 'jerror'); $retval = false; } } // Delete the component admin directory if (is_dir($this->parent->getPath('extension_administrator'))) { if (!JFolder::delete($this->parent->getPath('extension_administrator'))) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_ADMIN'), JLog::WARNING, 'jerror'); $retval = false; } } // Now we will no longer need the extension object, so let's delete it $this->extension->delete($this->extension->extension_id); return $retval; } else { // No component option defined... cannot delete what we don't know about JLog::add(JText::_('JLIB_INSTALLER_ERROR_COMP_UNINSTALL_NO_OPTION'), JLog::WARNING, 'jerror'); return false; } } /** * Method to build menu database entries for a component * * @param int|null $component_id The component ID for which I'm building menus * * @return boolean True if successful * * @since 3.1 */ protected function _buildAdminMenus($component_id = null) { $db = $this->parent->getDbo(); $option = $this->get('element'); // If a component exists with this option in the table then we don't need to add menus $query = $db->getQuery(true) ->select('m.id, e.extension_id') ->from('#__menu AS m') ->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id') ->where('m.parent_id = 1') ->where('m.client_id = 1') ->where('e.element = ' . $db->quote($option)); $db->setQuery($query); // In case of a failed installation (e.g. timeout error) we may have duplicate menu item and extension records. $componentrows = $db->loadObjectList(); // Check if menu items exist if (!empty($componentrows)) { // Don't do anything if overwrite has not been enabled if (!$this->parent->isOverwrite()) { return true; } // Remove all menu items foreach ($componentrows as $componentrow) { // Remove existing menu items if overwrite has been enabled if ($option) { // If something goes wrong, there's no way to rollback TODO: Search for better solution $this->_removeAdminMenus($componentrow->extension_id); } } } // Only try to detect the component ID if it's not provided if (empty($component_id)) { // Lets find the extension id $query->clear() ->select('e.extension_id') ->from('#__extensions AS e') ->where('e.type = ' . $db->quote('component')) ->where('e.element = ' . $db->quote($option)); $db->setQuery($query); $component_id = $db->loadResult(); } // Ok, now its time to handle the menus. Start with the component root menu, then handle submenus. $menuElement = $this->getManifest()->administration->menu; // Just do not create the menu if $menuElement not exist if (!$menuElement) { return true; } // If the menu item is hidden do nothing more, just return if (in_array((string) $menuElement['hidden'], array('true', 'hidden'))) { return true; } // Let's figure out what the menu item data should look like $data = array(); if ($menuElement) { // I have a menu element, use this information $data['menutype'] = 'main'; $data['client_id'] = 1; $data['title'] = (string) trim($menuElement); $data['alias'] = (string) $menuElement; $data['link'] = 'index.php?option=' . $option; $data['type'] = 'component'; $data['published'] = 0; $data['parent_id'] = 1; $data['component_id'] = $component_id; $data['img'] = ((string) $menuElement->attributes()->img) ? (string) $menuElement->attributes()->img : 'class:component'; $data['home'] = 0; $data['path'] = ''; $data['params'] = ''; } else { // No menu element was specified, Let's make a generic menu item $data = array(); $data['menutype'] = 'main'; $data['client_id'] = 1; $data['title'] = $option; $data['alias'] = $option; $data['link'] = 'index.php?option=' . $option; $data['type'] = 'component'; $data['published'] = 0; $data['parent_id'] = 1; $data['component_id'] = $component_id; $data['img'] = 'class:component'; $data['home'] = 0; $data['path'] = ''; $data['params'] = ''; } // Try to create the menu item in the database $parent_id = $this->_createAdminMenuItem($data, 1); if ($parent_id === false) { return false; } /* * Process SubMenus */ if (!$this->getManifest()->administration->submenu) { // No submenu? We're done. return true; } foreach ($this->getManifest()->administration->submenu->menu as $child) { $data = array(); $data['menutype'] = 'main'; $data['client_id'] = 1; $data['title'] = (string) trim($child); $data['alias'] = (string) $child; $data['type'] = 'component'; $data['published'] = 0; $data['parent_id'] = $parent_id; $data['component_id'] = $component_id; $data['img'] = ((string) $child->attributes()->img) ? (string) $child->attributes()->img : 'class:component'; $data['home'] = 0; // Set the sub menu link if ((string) $child->attributes()->link) { $data['link'] = 'index.php?' . $child->attributes()->link; } else { $request = array(); if ((string) $child->attributes()->act) { $request[] = 'act=' . $child->attributes()->act; } if ((string) $child->attributes()->task) { $request[] = 'task=' . $child->attributes()->task; } if ((string) $child->attributes()->controller) { $request[] = 'controller=' . $child->attributes()->controller; } if ((string) $child->attributes()->view) { $request[] = 'view=' . $child->attributes()->view; } if ((string) $child->attributes()->layout) { $request[] = 'layout=' . $child->attributes()->layout; } if ((string) $child->attributes()->sub) { $request[] = 'sub=' . $child->attributes()->sub; } $qstring = (count($request)) ? '&' . implode('&', $request) : ''; $data['link'] = 'index.php?option=' . $option . $qstring; } $submenuId = $this->_createAdminMenuItem($data, $parent_id); if ($submenuId === false) { return false; } /* * Since we have created a menu item, we add it to the installation step stack * so that if we have to rollback the changes we can undo it. */ $this->parent->pushStep(array('type' => 'menu', 'id' => $component_id)); } return true; } /** * Method to remove admin menu references to a component * * @param int $id The ID of the extension whose admin menus will be removed * * @return boolean True if successful. * * @since 3.1 */ protected function _removeAdminMenus($id) { $db = $this->parent->getDbo(); /** @var JTableMenu $table */ $table = JTable::getInstance('menu'); // Get the ids of the menu items $query = $db->getQuery(true) ->select('id') ->from('#__menu') ->where($db->quoteName('client_id') . ' = 1') ->where($db->quoteName('component_id') . ' = ' . (int) $id); $db->setQuery($query); $ids = $db->loadColumn(); $result = true; // Check for error if (!empty($ids)) { // Iterate the items to delete each one. foreach ($ids as $menuid) { if (!$table->delete((int) $menuid)) { $this->setError($table->getError()); $result = false; } } // Rebuild the whole tree $table->rebuild(); } return $result; } /** * Method to update menu database entries for a component in case if the component has been uninstalled before. * * @param int|null $component_id The component ID. * * @return boolean True if successful * * @since 3.4.2 */ protected function _updateSiteMenus($component_id = null) { $db = $this->parent->getDbo(); $option = $this->get('element'); // Update all menu items which contain 'index.php?option=com_extension' or 'index.php?option=com_extension&...' // to use the new component id. $query = $db->getQuery(true) ->update('#__menu') ->set('component_id = ' . $db->quote($component_id)) ->where("type = " . $db->quote('component')) ->where('client_id = 0') ->where('link LIKE ' . $db->quote('index.php?option=' . $option) . " OR link LIKE '" . $db->escape('index.php?option=' . $option . '&') . "%'"); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { return false; } return true; } /** * Custom rollback method * - Roll back the component menu item * * @param array $step Installation step to rollback. * * @return boolean True on success * * @since 3.1 */ protected function _rollback_menu($step) { return $this->_removeAdminMenus($step['id']); } /** * Discover unregistered extensions. * * @return array A list of extensions. * * @since 3.1 */ public function discover() { $results = array(); $site_components = JFolder::folders(JPATH_SITE . '/components'); $admin_components = JFolder::folders(JPATH_ADMINISTRATOR . '/components'); foreach ($site_components as $component) { if (file_exists(JPATH_SITE . '/components/' . $component . '/' . str_replace('com_', '', $component) . '.xml')) { $manifest_details = JInstaller::parseXMLInstallFile( JPATH_SITE . '/components/' . $component . '/' . str_replace('com_', '', $component) . '.xml' ); $extension = JTable::getInstance('extension'); $extension->set('type', 'component'); $extension->set('client_id', 0); $extension->set('element', $component); $extension->set('folder', ''); $extension->set('name', $component); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = $extension; } } foreach ($admin_components as $component) { if (file_exists(JPATH_ADMINISTRATOR . '/components/' . $component . '/' . str_replace('com_', '', $component) . '.xml')) { $manifest_details = JInstaller::parseXMLInstallFile( JPATH_ADMINISTRATOR . '/components/' . $component . '/' . str_replace('com_', '', $component) . '.xml' ); $extension = JTable::getInstance('extension'); $extension->set('type', 'component'); $extension->set('client_id', 1); $extension->set('element', $component); $extension->set('folder', ''); $extension->set('name', $component); $extension->set('state', -1); $extension->set('manifest_cache', json_encode($manifest_details)); $extension->set('params', '{}'); $results[] = $extension; } } return $results; } /** * Refreshes the extension table cache * * @return boolean Result of operation, true if updated, false on failure * * @since 3.1 */ public function refreshManifestCache() { // Need to find to find where the XML file is since we don't store this normally $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id); $short_element = str_replace('com_', '', $this->parent->extension->element); $manifestPath = $client->path . '/components/' . $this->parent->extension->element . '/' . $short_element . '.xml'; $this->parent->manifest = $this->parent->isManifest($manifestPath); $this->parent->setPath('manifest', $manifestPath); $manifest_details = JInstaller::parseXMLInstallFile($this->parent->getPath('manifest')); $this->parent->extension->manifest_cache = json_encode($manifest_details); $this->parent->extension->name = $manifest_details['name']; try { return $this->parent->extension->store(); } catch (RuntimeException $e) { JLog::add(JText::_('JLIB_INSTALLER_ERROR_COMP_REFRESH_MANIFEST_CACHE'), JLog::WARNING, 'jerror'); return false; } } /** * Creates the menu item in the database. If the item already exists it tries to remove it and create it afresh. * * @param array &$data The menu item data to create * @param integer $parentId The parent menu item ID * * @return bool|int Menu item ID on success, false on failure */ protected function _createAdminMenuItem(array &$data, $parentId) { $db = $this->parent->getDbo(); /** @var JTableMenu $table */ $table = JTable::getInstance('menu'); try { $table->setLocation($parentId, 'last-child'); } catch (InvalidArgumentException $e) { JLog::add($e->getMessage(), JLog::WARNING, 'jerror'); return false; } if ( !$table->bind($data) || !$table->check() || !$table->store()) { // The menu item already exists. Delete it and retry instead of throwing an error. $query = $db->getQuery(true) ->select('id') ->from('#__menu') ->where('menutype = ' . $db->q($data['menutype'])) ->where('client_id = 1') ->where('link = ' . $db->q($data['link'])) ->where('type = ' . $db->q($data['type'])) ->where('parent_id = ' . $db->q($data['parent_id'])) ->where('home = ' . $db->q($data['home'])); $db->setQuery($query); $menu_id = $db->loadResult(); if ( !$menu_id) { // Oops! Could not get the menu ID. Go back and rollback changes. JError::raiseWarning(1, $table->getError()); return false; } else { /** @var JTableMenu $temporaryTable */ $temporaryTable = JTable::getInstance('menu'); $temporaryTable->delete($menu_id, true); $temporaryTable->rebuild($data['parent_id']); // Retry creating the menu item $table->setLocation($parentId, 'last-child'); if ( !$table->bind($data) || !$table->check() || !$table->store()) { // Install failed, warn user and rollback changes JError::raiseWarning(1, $table->getError()); return false; } } } return $table->id; } } /** * Deprecated class placeholder. You should use JInstallerAdapterComponent instead. * * @since 3.1 * @deprecated 4.0 * @codeCoverageIgnore */ class JInstallerComponent extends JInstallerAdapterComponent { } PK���\�~�� * *#libraries/cms/table/corecontent.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Core content table * * @since 3.1 */ class JTableCorecontent extends JTable { /** * Constructor * * @param JDatabaseDriver $db A database connector object * * @since 3.1 */ public function __construct($db) { parent::__construct('#__ucm_content', 'core_content_id', $db); } /** * Overloaded bind function * * @param array $array Named array * @param mixed $ignore An optional array or space separated list of properties * to ignore while binding. * * @return mixed Null if operation was satisfactory, otherwise returns an error string * * @see JTable::bind() * @since 3.1 */ public function bind($array, $ignore = '') { if (isset($array['core_params']) && is_array($array['core_params'])) { $registry = new Registry; $registry->loadArray($array['core_params']); $array['core_params'] = (string) $registry; } if (isset($array['core_metadata']) && is_array($array['core_metadata'])) { $registry = new Registry; $registry->loadArray($array['core_metadata']); $array['core_metadata'] = (string) $registry; } if (isset($array['core_images']) && is_array($array['core_images'])) { $registry = new Registry; $registry->loadArray($array['core_images']); $array['core_images'] = (string) $registry; } if (isset($array['core_urls']) && is_array($array['core_urls'])) { $registry = new Registry; $registry->loadArray($array['core_urls']); $array['core_urls'] = (string) $registry; } if (isset($array['core_body']) && is_array($array['core_body'])) { $registry = new Registry; $registry->loadArray($array['core_body']); $array['core_body'] = (string) $registry; } return parent::bind($array, $ignore); } /** * Overloaded check function * * @return boolean True on success, false on failure * * @see JTable::check() * @since 3.1 */ public function check() { if (trim($this->core_title) == '') { $this->setError(JText::_('LIB_CMS_WARNING_PROVIDE_VALID_NAME')); return false; } if (trim($this->core_alias) == '') { $this->core_alias = $this->core_title; } $this->core_alias = JApplication::stringURLSafe($this->core_alias); if (trim(str_replace('-', '', $this->core_alias)) == '') { $this->core_alias = JFactory::getDate()->format('Y-m-d-H-i-s'); } // Not Null sanity check if (empty($this->core_images)) { $this->core_images = '{}'; } if (empty($this->core_urls)) { $this->core_urls = '{}'; } // Check the publish down date is not earlier than publish up. if ($this->core_publish_down > $this->_db->getNullDate() && $this->core_publish_down < $this->core_publish_up) { // Swap the dates. $temp = $this->core_publish_up; $this->core_publish_up = $this->core_publish_down; $this->core_publish_down = $temp; } // Clean up keywords -- eliminate extra spaces between phrases // and cr (\r) and lf (\n) characters from string if (!empty($this->core_metakey)) { // Only process if not empty // Array of characters to remove $bad_characters = array("\n", "\r", "\"", "<", ">"); // Remove bad characters $after_clean = JString::str_ireplace($bad_characters, "", $this->core_metakey); // Create array using commas as delimiter $keys = explode(',', $after_clean); $clean_keys = array(); foreach ($keys as $key) { if (trim($key)) { // Ignore blank keywords $clean_keys[] = trim($key); } } // Put array back together delimited by ", " $this->core_metakey = implode(", ", $clean_keys); } return true; } /** * Override JTable delete method to include deleting corresponding row from #__ucm_base. * * @param integer $pk primary key value to delete. Must be set or throws an exception. * * @return boolean True on success. * * @since 3.1 * @throws UnexpectedValueException */ public function delete($pk = null) { $baseTable = JTable::getInstance('Ucm'); return parent::delete($pk) && $baseTable->delete($pk); } /** * Method to delete a row from the #__ucm_content table by content_item_id. * * @param integer $contentItemId value of the core_content_item_id to delete. Corresponds to the primary key of the content table. * @param string $typeAlias Alias for the content type * * @return boolean True on success. * * @since 3.1 * @throws UnexpectedValueException */ public function deleteByContentId($contentItemId = null, $typeAlias = null) { if ($contentItemId === null || ((int) $contentItemId) === 0) { throw new UnexpectedValueException('Null content item key not allowed.'); } if ($typeAlias === null) { throw new UnexpectedValueException('Null type alias not allowed.'); } $db = $this->getDbo(); $query = $db->getQuery(true); $query->select($db->quoteName('core_content_id')) ->from($db->quoteName('#__ucm_content')) ->where($db->quoteName('core_content_item_id') . ' = ' . (int) $contentItemId) ->where($db->quoteName('core_type_alias') . ' = ' . $db->quote($typeAlias)); $db->setQuery($query); if ($ucmId = $db->loadResult()) { return $this->delete($ucmId); } else { return true; } } /** * Overrides JTable::store to set modified data and user id. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @since 3.1 */ public function store($updateNulls = false) { $date = JFactory::getDate(); $user = JFactory::getUser(); if ($this->core_content_id) { // Existing item $this->core_modified_time = $date->toSql(); $this->core_modified_user_id = $user->get('id'); $isNew = false; } else { // New content item. A content item core_created_time and core_created_user_id field can be set by the user, // so we don't touch either of these if they are set. if (!(int) $this->core_created_time) { $this->core_created_time = $date->toSql(); } if (empty($this->core_created_user_id)) { $this->core_created_user_id = $user->get('id'); } $isNew = true; } $oldRules = $this->getRules(); if (empty($oldRules)) { $this->setRules('{}'); } $result = parent::store($updateNulls); return $result && $this->storeUcmBase($updateNulls, $isNew); } /** * Insert or update row in ucm_base table * * @param boolean $updateNulls True to update fields even if they are null. * @param boolean $isNew if true, need to insert. Otherwise update. * * @return boolean True on success. * * @since 3.1 */ protected function storeUcmBase($updateNulls = false, $isNew = false) { // Store the ucm_base row $db = $this->getDbo(); $query = $db->getQuery(true); $languageId = JHelperContent::getLanguageId($this->core_language); // Selecting "all languages" doesn't give a language id - we can't store a blank string in non mysql databases, so save 0 (the default value) if (!$languageId) { $languageId = '0'; } if ($isNew) { $query->insert($db->quoteName('#__ucm_base')) ->columns(array($db->quoteName('ucm_id'), $db->quoteName('ucm_item_id'), $db->quoteName('ucm_type_id'), $db->quoteName('ucm_language_id'))) ->values( $db->quote($this->core_content_id) . ', ' . $db->quote($this->core_content_item_id) . ', ' . $db->quote($this->core_type_id) . ', ' . $db->quote($languageId) ); } else { $query->update($db->quoteName('#__ucm_base')) ->set($db->quoteName('ucm_item_id') . ' = ' . $db->quote($this->core_content_item_id)) ->set($db->quoteName('ucm_type_id') . ' = ' . $db->quote($this->core_type_id)) ->set($db->quoteName('ucm_language_id') . ' = ' . $db->quote($languageId)) ->where($db->quoteName('ucm_id') . ' = ' . $db->quote($this->core_content_id)); } $db->setQuery($query); return $db->execute(); } /** * Method to set the publishing state for a row or list of rows in the database * table. The method respects checked out rows by other users and will attempt * to checkin rows that it can after adjustments are made. * * @param mixed $pks An optional array of primary key values to update. If not set the instance property value is used. * @param integer $state The publishing state. eg. [0 = unpublished, 1 = published] * @param integer $userId The user id of the user performing the operation. * * @return boolean True on success. * * @since 3.1 */ public function publish($pks = null, $state = 1, $userId = 0) { $k = $this->_tbl_key; // Sanitize input. JArrayHelper::toInteger($pks); $userId = (int) $userId; $state = (int) $state; // If there are no primary keys set check to see if the instance key is set. if (empty($pks)) { if ($this->$k) { $pks = array($this->$k); } // Nothing to set publishing state on, return false. else { $this->setError(JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED')); return false; } } $pksImploded = implode(',', $pks); // Get the JDatabaseQuery object $query = $this->_db->getQuery(true); // Update the publishing state for rows with the given primary keys. $query->update($this->_db->quoteName($this->_tbl)) ->set($this->_db->quoteName('core_state') . ' = ' . (int) $state) ->where($this->_db->quoteName($k) . 'IN (' . $pksImploded . ')'); // Determine if there is checkin support for the table. $checkin = false; if (property_exists($this, 'core_checked_out_user_id') && property_exists($this, 'core_checked_out_time')) { $checkin = true; $query->where( ' (' . $this->_db->quoteName('core_checked_out_user_id') . ' = 0 OR ' . $this->_db->quoteName('core_checked_out_user_id') . ' = ' . (int) $userId . ')' ); } $this->_db->setQuery($query); try { $this->_db->execute(); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } // If checkin is supported and all rows were adjusted, check them in. if ($checkin && (count($pks) == $this->_db->getAffectedRows())) { // Checkin the rows. foreach ($pks as $pk) { $this->checkin($pk); } } // If the JTable instance value is in the list of primary keys that were set, set the instance. if (in_array($this->$k, $pks)) { $this->core_state = $state; } $this->setError(''); return true; } } PK���\�fS� � #libraries/cms/table/contenttype.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Tags table * * @since 3.1 */ class JTableContenttype extends JTable { /** * Constructor * * @param JDatabaseDriver $db A database connector object * * @since 3.1 */ public function __construct($db) { parent::__construct('#__content_types', 'type_id', $db); } /** * Overloaded check method to ensure data integrity. * * @return boolean True on success. * * @since 3.1 * @throws UnexpectedValueException */ public function check() { // Check for valid name. if (trim($this->type_title) == '') { throw new UnexpectedValueException(sprintf('The title is empty')); } $this->type_title = ucfirst($this->type_title); if (empty($this->type_alias)) { throw new UnexpectedValueException(sprintf('The type_alias is empty')); } return true; } /** * Overridden JTable::store. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @since 3.1 */ public function store($updateNulls = false) { // Verify that the alias is unique $table = JTable::getInstance('Contenttype', 'JTable'); if ($table->load(array('type_alias' => $this->type_alias)) && ($table->type_id != $this->type_id || $this->type_id == 0)) { $this->setError(JText::_('COM_TAGS_ERROR_UNIQUE_ALIAS')); return false; } return parent::store($updateNulls); } /** * Method to expand the field mapping * * @param boolean $assoc True to return an associative array. * * @return mixed Array or object with field mappings. Defaults to object. * * @since 3.1 */ public function fieldmapExpand($assoc = true) { return $this->fieldmap = json_decode($this->fieldmappings, $assoc); } /** * Method to get the id given the type alias * * @param string $typeAlias Content type alias (for example, 'com_content.article'). * * @return mixed type_id for this alias if successful, otherwise null. * * @since 3.2 */ public function getTypeId($typeAlias) { $db = $this->_db; $query = $db->getQuery(true); $query->select($db->quoteName('type_id')) ->from($db->quoteName($this->_tbl)) ->where($db->quoteName('type_alias') . ' = ' . $db->quote($typeAlias)); $db->setQuery($query); return $db->loadResult(); } /** * Method to get the JTable object for the content type from the table object. * * @return mixed JTable object on success, otherwise false. * * @since 3.2 * * @throws RuntimeException */ public function getContentTable() { $result = false; $tableInfo = json_decode($this->table); if (is_object($tableInfo) && isset($tableInfo->special)) { if (is_object($tableInfo->special) && isset($tableInfo->special->type) && isset($tableInfo->special->prefix)) { $class = isset($tableInfo->special->class) ? $tableInfo->special->class : 'JTable'; if (!class_implements($class, 'JTableInterface')) { // This isn't an instance of JTableInterface. Abort. throw new RuntimeException('Class must be an instance of JTableInterface'); } $result = $class::getInstance($tableInfo->special->type, $tableInfo->special->prefix); } } return $result; } } PK���\h��n11libraries/cms/table/ucm.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * UCM map table * * @since 3.1 */ class JTableUcm extends JTable { /** * Constructor * * @param JDatabaseDriver $db A database connector object * * @since 3.1 */ public function __construct($db) { parent::__construct('#__ucm_base', 'ucm_id', $db); } } PK���\ �>��&libraries/cms/table/contenthistory.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Content History table. * * @since 3.2 */ class JTableContenthistory extends JTable { /** * Array of object fields to unset from the data object before calculating SHA1 hash. This allows us to detect a meaningful change * in the database row using the hash. This can be read from the #__content_types content_history_options column. * * @var array * @since 3.2 */ public $ignoreChanges = array(); /** * Array of object fields to convert to integers before calculating SHA1 hash. Some values are stored differently * when an item is created than when the item is changed and saved. This works around that issue. * This can be read from the #__content_types content_history_options column. * * @var array * @since 3.2 */ public $convertToInt = array(); /** * Constructor * * @param JDatabaseDriver $db A database connector object * * @since 3.1 */ public function __construct($db) { parent::__construct('#__ucm_history', 'version_id', $db); $this->ignoreChanges = array( 'modified_by', 'modified_user_id', 'modified', 'modified_time', 'checked_out', 'checked_out_time', 'version', 'hits', 'path'); $this->convertToInt = array('publish_up', 'publish_down', 'ordering', 'featured'); } /** * Overrides JTable::store to set modified hash, user id, and save date. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @since 3.2 */ public function store($updateNulls = false) { $this->set('character_count', strlen($this->get('version_data'))); $typeTable = JTable::getInstance('Contenttype'); $typeTable->load($this->ucm_type_id); if (!isset($this->sha1_hash)) { $this->set('sha1_hash', $this->getSha1($this->get('version_data'), $typeTable)); } $this->set('editor_user_id', JFactory::getUser()->id); $this->set('save_date', JFactory::getDate()->toSql()); return parent::store($updateNulls); } /** * Utility method to get the hash after removing selected values. This lets us detect changes other than * modified date (which will change on every save). * * @param mixed $jsonData Either an object or a string with json-encoded data * @param JTableContenttype $typeTable Table object with data for this content type * * @return string SHA1 hash on sucess. Empty string on failure. * * @since 3.2 */ public function getSha1($jsonData, JTableContenttype $typeTable) { $object = (is_object($jsonData)) ? $jsonData : json_decode($jsonData); if (isset($typeTable->content_history_options) && (is_object(json_decode($typeTable->content_history_options)))) { $options = json_decode($typeTable->content_history_options); $this->ignoreChanges = isset($options->ignoreChanges) ? $options->ignoreChanges : $this->ignoreChanges; $this->convertToInt = isset($options->convertToInt) ? $options->convertToInt : $this->convertToInt; } foreach ($this->ignoreChanges as $remove) { if (property_exists($object, $remove)) { unset($object->$remove); } } // Convert integers, booleans, and nulls to strings to get a consistent hash value foreach ($object as $name => $value) { if (is_object($value)) { // Go one level down for JSON column values foreach ($value as $subName => $subValue) { $object->$subName = (is_int($subValue) || is_bool($subValue) || is_null($subValue)) ? (string) $subValue : $subValue; } } else { $object->$name = (is_int($value) || is_bool($value) || is_null($value)) ? (string) $value : $value; } } // Work around empty values foreach ($this->convertToInt as $convert) { if (isset($object->$convert)) { $object->$convert = (int) $object->$convert; } } if (isset($object->review_time)) { $object->review_time = (int) $object->review_time; } return sha1(json_encode($object)); } /** * Utility method to get a matching row based on the hash value and id columns. * This lets us check to make sure we don't save duplicate versions. * * @return string SHA1 hash on sucess. Empty string on failure. * * @since 3.2 */ public function getHashMatch() { $db = $this->_db; $query = $db->getQuery(true); $query->select('*') ->from($db->quoteName('#__ucm_history')) ->where($db->quoteName('ucm_item_id') . ' = ' . $this->get('ucm_item_id')) ->where($db->quoteName('ucm_type_id') . ' = ' . $this->get('ucm_type_id')) ->where($db->quoteName('sha1_hash') . ' = ' . $db->quote($this->get('sha1_hash'))); $db->setQuery($query, 0, 1); return $db->loadObject(); } /** * Utility method to remove the oldest versions of an item, saving only the most recent versions. * * @param integer $maxVersions The maximum number of versions to save. All others will be deleted. * * @return boolean true on sucess, false on failure. * * @since 3.2 */ public function deleteOldVersions($maxVersions) { $result = true; // Get the list of version_id values we want to save $db = $this->_db; $query = $db->getQuery(true); $query->select($db->quoteName('version_id')) ->from($db->quoteName('#__ucm_history')) ->where($db->quoteName('ucm_item_id') . ' = ' . (int) $this->ucm_item_id) ->where($db->quoteName('ucm_type_id') . ' = ' . (int) $this->ucm_type_id) ->where($db->quoteName('keep_forever') . ' != 1') ->order($db->quoteName('save_date') . ' DESC '); $db->setQuery($query, 0, (int) $maxVersions); $idsToSave = $db->loadColumn(0); // Don't process delete query unless we have at least the maximum allowed versions if (count($idsToSave) == (int) $maxVersions) { // Delete any rows not in our list and and not flagged to keep forever. $query = $db->getQuery(true); $query->delete($db->quoteName('#__ucm_history')) ->where($db->quoteName('ucm_item_id') . ' = ' . (int) $this->ucm_item_id) ->where($db->quoteName('ucm_type_id') . ' = ' . (int) $this->ucm_type_id) ->where($db->quoteName('version_id') . ' NOT IN (' . implode(',', $idsToSave) . ')') ->where($db->quoteName('keep_forever') . ' != 1'); $db->setQuery($query); $result = (boolean) $db->execute(); } return $result; } } PK���\:f>>'libraries/cms/language/associations.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 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\Registry\Registry; /** * Utitlity class for associations in multilang * * @since 3.1 */ class JLanguageAssociations { /** * Get the associations. * * @param string $extension The name of the component. * @param string $tablename The name of the table. * @param string $context The context * @param integer $id The primary key value. * @param string $pk The name of the primary key in the given $table. * @param string $aliasField If the table has an alias field set it here. Null to not use it * @param string $catField If the table has a catid field set it here. Null to not use it * * @return array The associated items * * @since 3.1 * * @throws Exception */ public static function getAssociations($extension, $tablename, $context, $id, $pk = 'id', $aliasField = 'alias', $catField = 'catid') { $associations = array(); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('c2.language')) ->from($db->quoteName($tablename, 'c')) ->join('INNER', $db->quoteName('#__associations', 'a') . ' ON a.id = c.' . $db->quoteName($pk) . ' AND a.context=' . $db->quote($context)) ->join('INNER', $db->quoteName('#__associations', 'a2') . ' ON a.key = a2.key') ->join('INNER', $db->quoteName($tablename, 'c2') . ' ON a2.id = c2.' . $db->quoteName($pk)); // Use alias field ? if (!empty($aliasField)) { $query->select( $query->concatenate( array( $db->quoteName('c2.' . $pk), $db->quoteName('c2.' . $aliasField) ), ':' ) . ' AS ' . $db->quoteName($pk) ); } else { $query->select($db->quoteName('c2.' . $pk)); } // Use catid field ? if (!empty($catField)) { $query->join( 'INNER', $db->quoteName('#__categories', 'ca') . ' ON ' . $db->quoteName('c2.' . $catField) . ' = ca.id AND ca.extension = ' . $db->quote($extension) ) ->select( $query->concatenate( array('ca.id', 'ca.alias'), ':' ) . ' AS ' . $db->quoteName($catField) ); } $query->where('c.' . $pk . ' = ' . (int) $id); $db->setQuery($query); try { $items = $db->loadObjectList('language'); } catch (RuntimeException $e) { throw new Exception($e->getMessage(), 500); } if ($items) { foreach ($items as $tag => $item) { // Do not return itself as result if ((int) $item->{$pk} != $id) { $associations[$tag] = $item; } } } return $associations; } /** * Method to determine if the language filter Items Associations parameter is enabled. * This works for both site and administrator. * * @return boolean True if the parameter is implemented; false otherwise. * * @since 3.2 */ public static function isEnabled() { // Flag to avoid doing multiple database queries. static $tested = false; // Status of language filter parameter. static $enabled = false; if (JLanguageMultilang::isEnabled()) { // If already tested, don't test again. if (!$tested) { $plugin = JPluginHelper::getPlugin('system', 'languagefilter'); if (!empty($plugin)) { $params = new Registry($plugin->params); $enabled = (boolean) $params->get('item_associations', true); } $tested = true; } } return $enabled; } } PK���\MA�33$libraries/cms/language/multilang.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Utitlity class for multilang * * @since 2.5.4 */ class JLanguageMultilang { /** * Method to determine if the language filter plugin is enabled. * This works for both site and administrator. * * @return boolean True if site is supporting multiple languages; false otherwise. * * @since 2.5.4 */ public static function isEnabled() { // Flag to avoid doing multiple database queries. static $tested = false; // Status of language filter plugin. static $enabled = false; // Get application object. $app = JFactory::getApplication(); // If being called from the front-end, we can avoid the database query. if ($app->isSite()) { $enabled = $app->getLanguageFilter(); return $enabled; } // If already tested, don't test again. if (!$tested) { // Determine status of language filter plug-in. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('enabled') ->from($db->quoteName('#__extensions')) ->where($db->quoteName('type') . ' = ' . $db->quote('plugin')) ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) ->where($db->quoteName('element') . ' = ' . $db->quote('languagefilter')); $db->setQuery($query); $enabled = $db->loadResult(); $tested = true; } return $enabled; } } PK���\�Ã�UU libraries/cms/helper/content.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Helper * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Helper for standard content style extensions. * This class mainly simplifies static helper methods often repeated in individual components * * @since 3.1 */ class JHelperContent { /** * Configure the Linkbar. Must be implemented by each extension. * * @param string $vName The name of the active view. * * @return void * * @since 3.1 */ public static function addSubmenu($vName) { } /** * Gets a list of the actions that can be performed. * * @param integer $categoryId The category ID. * @param integer $id The item ID. * @param string $assetName The asset name * * @return JObject * * @since 3.1 * @deprecated 3.2 Use JHelperContent::getActions() instead */ public static function _getActions($categoryId = 0, $id = 0, $assetName = '') { // Log usage of deprecated function JLog::add(__METHOD__ . '() is deprecated, use JHelperContent::getActions() with new arguments order instead.', JLog::WARNING, 'deprecated'); // Reverted a change for version 2.5.6 $user = JFactory::getUser(); $result = new JObject; $path = JPATH_ADMINISTRATOR . '/components/' . $assetName . '/access.xml'; if (empty($id) && empty($categoryId)) { $section = 'component'; } elseif (empty($id)) { $section = 'category'; $assetName .= '.category.' . (int) $categoryId; } else { // Used only in com_content $section = 'article'; $assetName .= '.article.' . (int) $id; } $actions = JAccess::getActionsFromFile($path, "/access/section[@name='" . $section . "']/"); foreach ($actions as $action) { $result->set($action->name, $user->authorise($action->name, $assetName)); } return $result; } /** * Gets a list of the actions that can be performed. * * @param string $component The component name. * @param string $section The access section name. * @param integer $id The item ID. * * @return JObject * * @since 3.2 */ public static function getActions($component = '', $section = '', $id = 0) { // Check for deprecated arguments order if (is_int($component) || is_null($component)) { $result = self::_getActions($component, $section, $id); return $result; } $user = JFactory::getUser(); $result = new JObject; $path = JPATH_ADMINISTRATOR . '/components/' . $component . '/access.xml'; if ($section && $id) { $assetName = $component . '.' . $section . '.' . (int) $id; } else { $assetName = $component; } $actions = JAccess::getActionsFromFile($path, "/access/section[@name='component']/"); foreach ($actions as $action) { $result->set($action->name, $user->authorise($action->name, $assetName)); } return $result; } /** * Gets the current language * * @param boolean $detectBrowser Flag indicating whether to use the browser language as a fallback. * * @return string The language string * * @since 3.1 * @note JHelper::getCurrentLanguage is the preferred method */ public static function getCurrentLanguage($detectBrowser = true) { $app = JFactory::getApplication(); $langCode = $app->input->cookie->getString(JApplicationHelper::getHash('language')); // No cookie - let's try to detect browser language or use site default if (!$langCode) { if ($detectBrowser) { $langCode = JLanguageHelper::detectLanguage(); } else { $langCode = JComponentHelper::getParams('com_languages')->get('site', 'en-GB'); } } return $langCode; } /** * Gets the associated language ID * * @param string $langCode The language code to look up * * @return integer The language ID * * @since 3.1 * @note JHelper::getLanguage() is the preferred method. */ public static function getLanguageId($langCode) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('lang_id') ->from('#__languages') ->where($db->quoteName('lang_code') . ' = ' . $db->quote($langCode)); $db->setQuery($query); $id = $db->loadResult(); return $id; } /** * Gets a row of data from a table * * @param JTable $table JTable instance for a row. * * @return array Associative array of all columns and values for a row in a table. * * @since 3.1 */ public function getRowData(JTable $table) { $data = new JHelper; return $data->getRowData($table); } } PK���\C�e�� � libraries/cms/helper/helper.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Helper * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Base Helper class. * * @since 3.2 */ class JHelper { /** * Gets the current language * * @param boolean $detectBrowser Flag indicating whether to use the browser language as a fallback. * * @return string The language string * * @since 3.2 */ public function getCurrentLanguage($detectBrowser = true) { $app = JFactory::getApplication(); $langCode = $app->input->cookie->getString(JApplicationHelper::getHash('language')); // No cookie - let's try to detect browser language or use site default if (!$langCode) { if ($detectBrowser) { $langCode = JLanguageHelper::detectLanguage(); } else { $langCode = JComponentHelper::getParams('com_languages')->get('site', 'en-GB'); } } return $langCode; } /** * Gets the associated language ID * * @param string $langCode The language code to look up * * @return integer The language ID * * @since 3.2 */ public function getLanguageId($langCode) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('lang_id') ->from('#__languages') ->where($db->quoteName('lang_code') . ' = ' . $db->quote($langCode)); $db->setQuery($query); $id = $db->loadResult(); return $id; } /** * Gets a row of data from a table * * @param JTableInterface $table JTable instance for a row. * * @return array Associative array of all columns and values for a row in a table. * * @since 3.2 */ public function getRowData(JTableInterface $table) { $fields = $table->getFields(); $data = array(); foreach ($fields as &$field) { $columnName = $field->Field; $value = $table->$columnName; $data[$columnName] = $value; } return $data; } /** * Method to get an object containing all of the table columns and values. * * @param JTableInterface $table JTable object. * * @return object Contains all of the columns and values. * * @since 3.2 */ public function getDataObject(JTableInterface $table) { $fields = $table->getFields(); $dataObject = new stdClass; foreach ($fields as $field) { $fieldName = $field->Field; $dataObject->$fieldName = $table->get($fieldName); } return $dataObject; } } PK���\�!Fj0p0plibraries/cms/helper/tags.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Helper * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Tags helper class, provides methods to perform various tasks relevant * tagging of content. * * @since 3.1 */ class JHelperTags extends JHelper { /** * Helper object for storing and deleting tag information. * * @var boolean * @since 3.1 */ protected $tagsChanged = false; /** * Whether up replace all tags or just add tags * * @var boolean * @since 3.1 */ protected $replaceTags = false; /** * Alias for querying mapping and content type table. * * @var string * @since 3.1 */ public $typeAlias = null; /** * Method to add tag rows to mapping table. * * @param integer $ucmId ID of the #__ucm_content item being tagged * @param JTableInterface $table JTable object being tagged * @param array $tags Array of tags to be applied. * * @return boolean true on success, otherwise false. * * @since 3.1 */ public function addTagMapping($ucmId, JTableInterface $table, $tags = array()) { $db = $table->getDbo(); $key = $table->getKeyName(); $item = $table->$key; $typeId = $this->getTypeId($this->typeAlias); // Insert the new tag maps if (strpos('#', implode(',', $tags)) === false) { $tags = self::createTagsFromField($tags); } // Prevent saving duplicate tags $tags = array_unique($tags); $query = $db->getQuery(true); $query->insert('#__contentitem_tag_map'); $query->columns( array( $db->quoteName('type_alias'), $db->quoteName('core_content_id'), $db->quoteName('content_item_id'), $db->quoteName('tag_id'), $db->quoteName('tag_date'), $db->quoteName('type_id') ) ); foreach ($tags as $tag) { $query->values( $db->quote($this->typeAlias) . ', ' . (int) $ucmId . ', ' . (int) $item . ', ' . $db->quote($tag) . ', ' . $query->currentTimestamp() . ', ' . (int) $typeId ); } $db->setQuery($query); return (boolean) $db->execute(); } /** * Function that converts tags paths into paths of names * * @param array $tags Array of tags * * @return array * * @since 3.1 */ public static function convertPathsToNames($tags) { // We will replace path aliases with tag names if ($tags) { // Create an array with all the aliases of the results $aliases = array(); foreach ($tags as $tag) { if (!empty($tag->path)) { if ($pathParts = explode('/', $tag->path)) { $aliases = array_merge($aliases, $pathParts); } } } // Get the aliases titles in one single query and map the results if ($aliases) { // Remove duplicates $aliases = array_unique($aliases); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('alias, title') ->from('#__tags') ->where('alias IN (' . implode(',', array_map(array($db, 'quote'), $aliases)) . ')'); $db->setQuery($query); try { $aliasesMapper = $db->loadAssocList('alias'); } catch (RuntimeException $e) { return false; } // Rebuild the items path if ($aliasesMapper) { foreach ($tags as $tag) { $namesPath = array(); if (!empty($tag->path)) { if ($pathParts = explode('/', $tag->path)) { foreach ($pathParts as $alias) { if (isset($aliasesMapper[$alias])) { $namesPath[] = $aliasesMapper[$alias]['title']; } else { $namesPath[] = $alias; } } $tag->text = implode('/', $namesPath); } } } } } } return $tags; } /** * Create any new tags by looking for #new# in the strings * * @param array $tags Tags text array from the field * * @return mixed If successful, metadata with new tag titles replaced by tag ids. Otherwise false. * * @since 3.1 */ public function createTagsFromField($tags) { if (empty($tags) || $tags[0] == '') { return; } else { // We will use the tags table to store them JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables'); $tagTable = JTable::getInstance('Tag', 'TagsTable'); $newTags = array(); foreach ($tags as $key => $tag) { // Remove the #new# prefix that identifies new tags $tagText = str_replace('#new#', '', $tag); if ($tagText == $tag) { $newTags[] = (int) $tag; } else { // Clear old data if exist $tagTable->reset(); // Try to load the selected tag if ($tagTable->load(array('title' => $tagText))) { $newTags[] = (int) $tagTable->id; } else { // Prepare tag data $tagTable->id = 0; $tagTable->title = $tagText; $tagTable->published = 1; // $tagTable->language = property_exists ($item, 'language') ? $item->language : '*'; $tagTable->language = '*'; $tagTable->access = 1; // Make this item a child of the root tag $tagTable->setLocation($tagTable->getRootId(), 'last-child'); // Try to store tag if ($tagTable->check()) { // Assign the alias as path (autogenerated tags have always level 1) $tagTable->path = $tagTable->alias; if ($tagTable->store()) { $newTags[] = (int) $tagTable->id; } } } } } // At this point $tags is an array of all tag ids $this->tags = $newTags; $result = $newTags; } return $result; } /** * Create any new tags by looking for #new# in the metadata * * @param string $metadata Metadata JSON string * * @return mixed If successful, metadata with new tag titles replaced by tag ids. Otherwise false. * * @since 3.1 * @deprecated 4.0 This method is no longer used in the CMS and will not be replaced. */ public function createTagsFromMetadata($metadata) { $metaObject = json_decode($metadata); if (empty($metaObject->tags)) { return $metadata; } $tags = $metaObject->tags; if (empty($tags) || !is_array($tags)) { $result = $metadata; } else { // We will use the tags table to store them JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables'); $tagTable = JTable::getInstance('Tag', 'TagsTable'); $newTags = array(); foreach ($tags as $tag) { // Remove the #new# prefix that identifies new tags $tagText = str_replace('#new#', '', $tag); if ($tagText == $tag) { $newTags[] = (int) $tag; } else { // Clear old data if exist $tagTable->reset(); // Try to load the selected tag if ($tagTable->load(array('title' => $tagText))) { $newTags[] = (int) $tagTable->id; } else { // Prepare tag data $tagTable->id = 0; $tagTable->title = $tagText; $tagTable->published = 1; // $tagTable->language = property_exists ($item, 'language') ? $item->language : '*'; $tagTable->language = '*'; $tagTable->access = 1; // Make this item a child of the root tag $tagTable->setLocation($tagTable->getRootId(), 'last-child'); // Try to store tag if ($tagTable->check()) { // Assign the alias as path (autogenerated tags have always level 1) $tagTable->path = $tagTable->alias; if ($tagTable->store()) { $newTags[] = (int) $tagTable->id; } } } } } // At this point $tags is an array of all tag ids $metaObject->tags = $newTags; $result = json_encode($metaObject); } return $result; } /** * Method to delete the tag mappings and #__ucm_content record for for an item * * @param JTableInterface $table JTable object of content table where delete occurred * @param integer $contentItemId ID of the content item. * * @return boolean true on success, false on failure * * @since 3.1 */ public function deleteTagData(JTableInterface $table, $contentItemId) { $result = $this->unTagItem($contentItemId, $table); /** * @var JTableCorecontent $ucmContentTable */ $ucmContentTable = JTable::getInstance('Corecontent'); return $result && $ucmContentTable->deleteByContentId($contentItemId, $this->typeAlias); } /** * Method to get a list of tags for an item, optionally with the tag data. * * @param integer $contentType Content type alias. Dot separated. * @param integer $id Id of the item to retrieve tags for. * @param boolean $getTagData If true, data from the tags table will be included, defaults to true. * * @return array Array of of tag objects * * @since 3.1 */ public function getItemTags($contentType, $id, $getTagData = true) { // Initialize some variables. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('m.tag_id')) ->from($db->quoteName('#__contentitem_tag_map') . ' AS m ') ->where( array( $db->quoteName('m.type_alias') . ' = ' . $db->quote($contentType), $db->quoteName('m.content_item_id') . ' = ' . (int) $id, $db->quoteName('t.published') . ' = 1' ) ); $user = JFactory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); $query->where('t.access IN (' . $groups . ')'); // Optionally filter on language $language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all'); if ($language != 'all') { if ($language == 'current_language') { $language = $this->getCurrentLanguage(); } $query->where($db->quoteName('language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')'); } if ($getTagData) { $query->select($db->quoteName('t') . '.*'); } $query->join('INNER', $db->quoteName('#__tags') . ' AS t ' . ' ON ' . $db->quoteName('m.tag_id') . ' = ' . $db->quoteName('t.id')); $db->setQuery($query); $this->itemTags = $db->loadObjectList(); return $this->itemTags; } /** * Method to get a list of tags for a given item. * Normally used for displaying a list of tags within a layout * * @param mixed $ids The id or array of ids (primary key) of the item to be tagged. * @param string $prefix Dot separated string with the option and view to be used for a url. * * @return string Comma separated list of tag Ids. * * @since 3.1 */ public function getTagIds($ids, $prefix) { if (empty($ids)) { return; } /** * Ids possible formats: * --------------------- * $id = 1; * $id = array(1,2); * $id = array('1,3,4,19'); * $id = '1,3'; */ $ids = (array) $ids; $ids = implode(',', $ids); $ids = explode(',', $ids); JArrayHelper::toInteger($ids); $db = JFactory::getDbo(); // Load the tags. $query = $db->getQuery(true) ->select($db->quoteName('t.id')) ->from($db->quoteName('#__tags') . ' AS t ') ->join( 'INNER', $db->quoteName('#__contentitem_tag_map') . ' AS m' . ' ON ' . $db->quoteName('m.tag_id') . ' = ' . $db->quoteName('t.id') . ' AND ' . $db->quoteName('m.type_alias') . ' = ' . $db->quote($prefix) . ' AND ' . $db->quoteName('m.content_item_id') . ' IN ( ' . implode(',', $ids) . ')' ); $db->setQuery($query); // Add the tags to the content data. $tagsList = $db->loadColumn(); $this->tags = implode(',', $tagsList); return $this->tags; } /** * Method to get a query to retrieve a detailed list of items for a tag. * * @param mixed $tagId Tag or array of tags to be matched * @param mixed $typesr Null, type or array of type aliases for content types to be included in the results * @param boolean $includeChildren True to include the results from child tags * @param string $orderByOption Column to order the results by * @param string $orderDir Direction to sort the results in * @param boolean $anyOrAll True to include items matching at least one tag, false to include * items all tags in the array. * @param string $languageFilter Optional filter on language. Options are 'all', 'current' or any string. * @param string $stateFilter Optional filtering on publication state, defaults to published or unpublished. * * @return JDatabaseQuery Query to retrieve a list of tags * * @since 3.1 */ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = false, $orderByOption = 'c.core_title', $orderDir = 'ASC', $anyOrAll = true, $languageFilter = 'all', $stateFilter = '0,1') { // Create a new query object. $db = JFactory::getDbo(); $query = $db->getQuery(true); $user = JFactory::getUser(); $nullDate = $db->quote($db->getNullDate()); $nowDate = $db->quote(JFactory::getDate()->toSql()); $ntagsr = substr_count($tagId, ',') + 1; // Force ids to array and sanitize $tagIds = (array) $tagId; $tagIds = implode(',', $tagIds); $tagIds = explode(',', $tagIds); JArrayHelper::toInteger($tagIds); // If we want to include children we have to adjust the list of tags. // We do not search child tags when the match all option is selected. if ($includeChildren) { $tagTreeList = ''; $tagTreeArray = array(); foreach ($tagIds as $tag) { $this->getTagTreeArray($tag, $tagTreeArray); } $tagIds = array_unique(array_merge($tagIds, $tagTreeArray)); } // Sanitize filter states $stateFilters = explode(',', $stateFilter); JArrayHelper::toInteger($stateFilters); // M is the mapping table. C is the core_content table. Ct is the content_types table. $query ->select( 'm.type_alias' . ', ' . 'm.content_item_id' . ', ' . 'm.core_content_id' . ', ' . 'count(m.tag_id) AS match_count' . ', ' . 'MAX(m.tag_date) as tag_date' . ', ' . 'MAX(c.core_title) AS core_title' . ', ' . 'MAX(c.core_params) AS core_params' ) ->select('MAX(c.core_alias) AS core_alias, MAX(c.core_body) AS core_body, MAX(c.core_state) AS core_state, MAX(c.core_access) AS core_access') ->select( 'MAX(c.core_metadata) AS core_metadata' . ', ' . 'MAX(c.core_created_user_id) AS core_created_user_id' . ', ' . 'MAX(c.core_created_by_alias) AS core_created_by_alias' ) ->select('MAX(c.core_created_time) as core_created_time, MAX(c.core_images) as core_images') ->select('CASE WHEN c.core_modified_time = ' . $nullDate . ' THEN c.core_created_time ELSE c.core_modified_time END as core_modified_time') ->select('MAX(c.core_language) AS core_language, MAX(c.core_catid) AS core_catid') ->select('MAX(c.core_publish_up) AS core_publish_up, MAX(c.core_publish_down) as core_publish_down') ->select('MAX(ct.type_title) AS content_type_title, MAX(ct.router) AS router') ->from('#__contentitem_tag_map AS m') ->join( 'INNER', '#__ucm_content AS c ON m.type_alias = c.core_type_alias AND m.core_content_id = c.core_content_id AND c.core_state IN (' . implode(',', $stateFilters) . ')' . (in_array('0', $stateFilters) ? '' : ' AND (c.core_publish_up = ' . $nullDate . ' OR c.core_publish_up <= ' . $nowDate . ') ' . ' AND (c.core_publish_down = ' . $nullDate . ' OR c.core_publish_down >= ' . $nowDate . ')') ) ->join('INNER', '#__content_types AS ct ON ct.type_alias = m.type_alias') // Join over the users for the author and email ->select("CASE WHEN c.core_created_by_alias > ' ' THEN c.core_created_by_alias ELSE ua.name END AS author") ->select("ua.email AS author_email") ->join('LEFT', '#__users AS ua ON ua.id = c.core_created_user_id') ->where('m.tag_id IN (' . implode(',', $tagIds) . ')'); // Optionally filter on language if (empty($language)) { $language = $languageFilter; } if ($language != 'all') { if ($language == 'current_language') { $language = $this->getCurrentLanguage(); } $query->where($db->quoteName('c.core_language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')'); } // Get the type data, limited to types in the request if there are any specified. $typesarray = self::getTypes('assocList', $typesr, false); $typeAliases = array(); foreach ($typesarray as $type) { $typeAliases[] = $db->quote($type['type_alias']); } $query->where('m.type_alias IN (' . implode(',', $typeAliases) . ')'); $groups = '0,' . implode(',', array_unique($user->getAuthorisedViewLevels())); $query->where('c.core_access IN (' . $groups . ')') ->group('m.type_alias, m.content_item_id, m.core_content_id'); // Use HAVING if matching all tags and we are matching more than one tag. if ($ntagsr > 1 && $anyOrAll != 1 && $includeChildren != 1) { // The number of results should equal the number of tags requested. $query->having("COUNT('m.tag_id') = " . (int) $ntagsr); } // Set up the order by using the option chosen if ($orderByOption == 'match_count') { $orderBy = 'COUNT(m.tag_id)'; } else { $orderBy = 'MAX(' . $db->quoteName($orderByOption) . ')'; } $query->order($orderBy . ' ' . $orderDir); return $query; } /** * Function that converts tag ids to their tag names * * @param array $tagIds Array of integer tag ids. * * @return array An array of tag names. * * @since 3.1 */ public function getTagNames($tagIds) { $tagNames = array(); if (is_array($tagIds) && count($tagIds) > 0) { JArrayHelper::toInteger($tagIds); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('title')) ->from($db->quoteName('#__tags')) ->where($db->quoteName('id') . ' IN (' . implode(',', $tagIds) . ')'); $query->order($db->quoteName('title')); $db->setQuery($query); $tagNames = $db->loadColumn(); } return $tagNames; } /** * Method to get an array of tag ids for the current tag and its children * * @param integer $id An optional ID * @param array &$tagTreeArray Array containing the tag tree * * @return mixed * * @since 3.1 */ public function getTagTreeArray($id, &$tagTreeArray = array()) { // Get a level row instance. JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables'); $table = JTable::getInstance('Tag', 'TagsTable'); if ($table->isLeaf($id)) { $tagTreeArray[] = $id; return $tagTreeArray; } $tagTree = $table->getTree($id); // Attempt to load the tree if ($tagTree) { foreach ($tagTree as $tag) { $tagTreeArray[] = $tag->id; } return $tagTreeArray; } } /** * Method to get the type id for a type alias. * * @param string $typeAlias A type alias. * * @return string Name of the table for a type * * @since 3.1 * @deprecated 4.0 Use JUcmType::getTypeId() instead */ public function getTypeId($typeAlias) { $contentType = new JUcmType; return $contentType->getTypeId($typeAlias); } /** * Method to get a list of types with associated data. * * @param string $arrayType Optionally specify that the returned list consist of objects, associative arrays, or arrays. * Options are: rowList, assocList, and objectList * @param array $selectTypes Optional array of type ids to limit the results to. Often from a request. * @param boolean $useAlias If true, the alias is used to match, if false the type_id is used. * * @return array Array of of types * * @since 3.1 */ public static function getTypes($arrayType = 'objectList', $selectTypes = null, $useAlias = true) { // Initialize some variables. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('*'); if (!empty($selectTypes)) { $selectTypes = (array) $selectTypes; if ($useAlias) { $selectTypes = array_map(array($db, 'quote'), $selectTypes); $query->where($db->quoteName('type_alias') . ' IN (' . implode(',', $selectTypes) . ')'); } else { JArrayHelper::toInteger($selectTypes); $query->where($db->quoteName('type_id') . ' IN (' . implode(',', $selectTypes) . ')'); } } $query->from($db->quoteName('#__content_types')); $db->setQuery($query); switch ($arrayType) { case 'assocList': $types = $db->loadAssocList(); break; case 'rowList': $types = $db->loadRowList(); break; case 'objectList': default: $types = $db->loadObjectList(); break; } return $types; } /** * Function that handles saving tags used in a table class after a store() * * @param JTableInterface $table JTable being processed * @param array $newTags Array of new tags * @param boolean $replace Flag indicating if all exising tags should be replaced * * @return boolean * * @since 3.1 */ public function postStoreProcess(JTableInterface $table, $newTags = array(), $replace = true) { if (!empty($table->newTags) && empty($newTags)) { $newTags = $table->newTags; } // If existing row, check to see if tags have changed. $newTable = clone $table; $newTable->reset(); $key = $newTable->getKeyName(); $typeAlias = $this->typeAlias; $result = true; // Process ucm_content and ucm_base if either tags have changed or we have some tags. if ($this->tagsChanged || (!empty($newTags) && $newTags[0] != '')) { if (!$newTags && $replace == true) { // Delete all tags data $key = $table->getKeyName(); $result = $this->deleteTagData($table, $table->$key); } else { // Process the tags $data = $this->getRowData($table); $ucmContentTable = JTable::getInstance('Corecontent'); $ucm = new JUcmContent($table, $this->typeAlias); $ucmData = $data ? $ucm->mapData($data) : $ucm->ucmData; $primaryId = $ucm->getPrimaryKey($ucmData['common']['core_type_id'], $ucmData['common']['core_content_item_id']); $result = $ucmContentTable->load($primaryId); $result = $result && $ucmContentTable->bind($ucmData['common']); $result = $result && $ucmContentTable->check(); $result = $result && $ucmContentTable->store(); $ucmId = $ucmContentTable->core_content_id; // Store the tag data if the article data was saved and run related methods. $result = $result && $this->tagItem($ucmId, $table, $newTags, $replace); } } return $result; } /** * Function that preProcesses data from a table prior to a store() to ensure proper tag handling * * @param JTableInterface $table JTable being processed * @param array $newTags Array of new tags * * @return null * * @since 3.1 */ public function preStoreProcess(JTableInterface $table, $newTags = array()) { if ($newTags != array()) { $this->newTags = $newTags; } // If existing row, check to see if tags have changed. $oldTable = clone $table; $oldTable->reset(); $key = $oldTable->getKeyName(); $typeAlias = $this->typeAlias; if ($oldTable->$key && $oldTable->load()) { $this->oldTags = $this->getTagIds($oldTable->$key, $typeAlias); } // New items with no tags bypass this step. if ((!empty($newTags) && is_string($newTags) || (isset($newTags[0]) && $newTags[0] != '')) || isset($this->oldTags)) { if (is_array($newTags)) { $newTags = implode(',', $newTags); } // We need to process tags if the tags have changed or if we have a new row $this->tagsChanged = (empty($this->oldTags) && !empty($newTags)) ||(!empty($this->oldTags) && $this->oldTags != $newTags) || !$table->$key; } } /** * Function to search tags * * @param array $filters Filter to apply to the search * * @return array * * @since 3.1 */ public static function searchTags($filters = array()) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value') ->select('a.path AS text') ->select('a.path') ->from('#__tags AS a') ->join('LEFT', $db->quoteName('#__tags', 'b') . ' ON a.lft > b.lft AND a.rgt < b.rgt'); // Filter language if (!empty($filters['flanguage'])) { $query->where('a.language IN (' . $db->quote($filters['flanguage']) . ',' . $db->quote('*') . ') '); } // Do not return root $query->where($db->quoteName('a.alias') . ' <> ' . $db->quote('root')); // Search in title or path if (!empty($filters['like'])) { $query->where( '(' . $db->quoteName('a.title') . ' LIKE ' . $db->quote('%' . $filters['like'] . '%') . ' OR ' . $db->quoteName('a.path') . ' LIKE ' . $db->quote('%' . $filters['like'] . '%') . ')' ); } // Filter title if (!empty($filters['title'])) { $query->where($db->quoteName('a.title') . ' = ' . $db->quote($filters['title'])); } // Filter on the published state if (isset($filters['published']) && is_numeric($filters['published'])) { $query->where('a.published = ' . (int) $filters['published']); } // Filter by parent_id if (!empty($filters['parent_id'])) { JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tags/tables'); $tagTable = JTable::getInstance('Tag', 'TagsTable'); if ($children = $tagTable->getTree($filters['parent_id'])) { foreach ($children as $child) { $childrenIds[] = $child->id; } $query->where('a.id IN (' . implode(',', $childrenIds) . ')'); } } $query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.published, a.path') ->order('a.lft ASC'); // Get the options. $db->setQuery($query); try { $results = $db->loadObjectList(); } catch (RuntimeException $e) { return false; } // We will replace path aliases with tag names $results = self::convertPathsToNames($results); return $results; } /** * Method to delete all instances of a tag from the mapping table. Generally used when a tag is deleted. * * @param integer $tag_id The tag_id (primary key) for the deleted tag. * * @return void * * @since 3.1 */ public function tagDeleteInstances($tag_id) { // Delete the old tag maps. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->delete($db->quoteName('#__contentitem_tag_map')) ->where($db->quoteName('tag_id') . ' = ' . (int) $tag_id); $db->setQuery($query); $db->execute(); } /** * Method to add or update tags associated with an item. * * @param integer $ucmId Id of the #__ucm_content item being tagged * @param JTableInterface $table JTable object being tagged * @param array $tags Array of tags to be applied. * @param boolean $replace Flag indicating if all exising tags should be replaced * * @return boolean true on success, otherwise false. * * @since 3.1 */ public function tagItem($ucmId, JTableInterface $table, $tags = array(), $replace = true) { $key = $table->get('_tbl_key'); $oldTags = $this->getTagIds((int) $table->$key, $this->typeAlias); $oldTags = explode(',', $oldTags); $result = $this->unTagItem($ucmId, $table); if ($replace) { $newTags = $tags; } else { if ($tags == array()) { $newTags = $table->newTags; } else { $newTags = $tags; } if ($oldTags[0] != '') { $newTags = array_unique(array_merge($newTags, $oldTags)); } } if (is_array($newTags) && count($newTags) > 0 && $newTags[0] != '') { $result = $result && $this->addTagMapping($ucmId, $table, $newTags); } return $result; } /** * Method to untag an item * * @param integer $contentId ID of the content item being untagged * @param JTableInterface $table JTable object being untagged * @param array $tags Array of tags to be untagged. Use an empty array to untag all existing tags. * * @return boolean true on success, otherwise false. * * @since 3.1 */ public function unTagItem($contentId, JTableInterface $table, $tags = array()) { $key = $table->getKeyName(); $id = $table->$key; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->delete('#__contentitem_tag_map') ->where($db->quoteName('type_alias') . ' = ' . $db->quote($this->typeAlias)) ->where($db->quoteName('content_item_id') . ' = ' . (int) $id); if (is_array($tags) && count($tags) > 0) { JArrayHelper::toInteger($tags); $query->where($db->quoteName('tag_id') . ' IN ' . implode(',', $tags)); } $db->setQuery($query); return (boolean) $db->execute(); } } PK���\w�&���libraries/cms/helper/route.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Helper * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Route Helper * * A class providing basic routing for urls that are for content types found in * the #__content_types table and rows found in the #__ucm_content table. * * @since 3.1 */ class JHelperRoute { /** * @var array Holds the reverse lookup * @since 3.1 */ protected static $lookup; /** * @var string Option for the extension (such as com_content) * @since 3.1 */ protected $extension; /** * @var string Value of the primary key in the content type table * @since 3.1 */ protected $id; /** * @var string Name of the view for the url * @since 3.1 */ protected $view; /** * A method to get the route for a specific item * * @param integer $id Value of the primary key for the item in its content table * @param string $typealias The type_alias for the item being routed. Of the form extension.view. * @param string $link The link to be routed * @param string $language The language of the content for multilingual sites * @param integer $catid Optional category id * * @return string The route of the item * * @since 3.1 */ public function getRoute($id, $typealias, $link = '', $language = null, $catid = null) { $typeExploded = explode('.', $typealias); if (isset($typeExploded[1])) { $this->view = $typeExploded[1]; $this->extension = $typeExploded[0]; } else { $this->view = JFactory::getApplication()->input->getString('view'); $this->extension = JFactory::getApplication()->input->getCmd('option'); } $name = ucfirst(substr_replace($this->extension, '', 0, 4)); $needles = array(); if (isset($this->view)) { $needles[$this->view] = array((int) $id); } if (empty($link)) { // Create the link $link = 'index.php?option=' . $this->extension . '&view=' . $this->view . '&id=' . $id; } if ($catid > 1) { $categories = JCategories::getInstance($name); if ($categories) { $category = $categories->get((int) $catid); if ($category) { $needles['category'] = array_reverse($category->getPath()); $needles['categories'] = $needles['category']; $link .= '&catid=' . $catid; } } } // Deal with languages only if needed if (!empty($language) && $language != '*' && JLanguageMultilang::isEnabled()) { $link .= '&lang=' . $language; $needles['language'] = $language; } if ($item = $this->findItem($needles)) { $link .= '&Itemid=' . $item; } return $link; } /** * Method to find the item in the menu structure * * @param array $needles Array of lookup values * * @return mixed * * @since 3.1 */ protected function findItem($needles = array()) { $app = JFactory::getApplication(); $menus = $app->getMenu('site'); $language = isset($needles['language']) ? $needles['language'] : '*'; // $this->extension may not be set if coming from a static method, check it if (is_null($this->extension)) { $this->extension = $app->input->getCmd('option'); } // Prepare the reverse lookup array. if (!isset(static::$lookup[$language])) { static::$lookup[$language] = array(); $component = JComponentHelper::getComponent($this->extension); $attributes = array('component_id'); $values = array($component->id); if ($language != '*') { $attributes[] = 'language'; $values[] = array($needles['language'], '*'); } $items = $menus->getItems($attributes, $values); foreach ($items as $item) { if (isset($item->query) && isset($item->query['view'])) { $view = $item->query['view']; if (!isset(static::$lookup[$language][$view])) { static::$lookup[$language][$view] = array(); } if (isset($item->query['id'])) { if (is_array($item->query['id'])) { $item->query['id'] = $item->query['id'][0]; } /* * Here it will become a bit tricky * $language != * can override existing entries * $language == * cannot override existing entries */ if (!isset(static::$lookup[$language][$view][$item->query['id']]) || $item->language != '*') { static::$lookup[$language][$view][$item->query['id']] = $item->id; } } } } } if ($needles) { foreach ($needles as $view => $ids) { if (isset(static::$lookup[$language][$view])) { foreach ($ids as $id) { if (isset(static::$lookup[$language][$view][(int) $id])) { return static::$lookup[$language][$view][(int) $id]; } } } } } $active = $menus->getActive(); if ($active && $active->component == $this->extension && ($active->language == '*' || !JLanguageMultilang::isEnabled())) { return $active->id; } // If not found, return language specific home link $default = $menus->getDefault($language); return !empty($default->id) ? $default->id : null; } /** * Fetches the category route * * @param mixed $catid Category ID or JCategoryNode instance * @param mixed $language Language code * @param string $extension Extension to lookup * * @return string * * @since 3.2 * * @throws InvalidArgumentException */ public static function getCategoryRoute($catid, $language = 0, $extension = '') { // Note: $extension is required but has to be an optional argument in the function call due to argument order if (empty($extension)) { throw new InvalidArgumentException('$extension is a required argument in JHelperRoute::getCategoryRoute'); } if ($catid instanceof JCategoryNode) { $id = $catid->id; $category = $catid; } else { $extensionName = ucfirst(substr($extension, 4)); $id = (int) $catid; $category = JCategories::getInstance($extensionName)->get($id); } if ($id < 1) { $link = ''; } else { $link = 'index.php?option=' . $extension . '&view=category&id=' . $id; $needles = array( 'category' => array($id) ); if ($language && $language != '*' && JLanguageMultilang::isEnabled()) { $link .= '&lang=' . $language; $needles['language'] = $language; } // Create the link if ($category) { $catids = array_reverse($category->getPath()); $needles['category'] = $catids; $needles['categories'] = $catids; } if ($item = static::lookupItem($needles)) { $link .= '&Itemid=' . $item; } } return $link; } /** * Static alias to findItem() used to find the item in the menu structure * * @param array $needles Array of lookup values * * @return mixed * * @since 3.2 */ protected static function lookupItem($needles = array()) { $instance = new static; return $instance->findItem($needles); } } PK���\�_��'libraries/cms/helper/contenthistory.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Helper * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Versions helper class, provides methods to perform various tasks relevant * versioning of content. * * @since 3.2 */ class JHelperContenthistory extends JHelper { /** * Alias for storing type in versions table * * @var string * @since 3.2 */ public $typeAlias = null; /** * Constructor * * @param string $typeAlias The type of content to be versioned (for example, 'com_content.article'). * * @since 3.2 */ public function __construct($typeAlias = null) { $this->typeAlias = $typeAlias; } /** * Method to delete the history for an item. * * @param JTable $table JTable object being versioned * * @return boolean true on success, otherwise false. * * @since 3.2 */ public function deleteHistory($table) { $key = $table->getKeyName(); $id = $table->$key; $typeTable = JTable::getInstance('Contenttype', 'JTable'); $typeId = $typeTable->getTypeId($this->typeAlias); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->delete($db->quoteName('#__ucm_history')) ->where($db->quoteName('ucm_item_id') . ' = ' . (int) $id) ->where($db->quoteName('ucm_type_id') . ' = ' . (int) $typeId); $db->setQuery($query); return $db->execute(); } /** * Method to get a list of available versions of this item. * * @param integer $typeId Type id for this component item. * @param mixed $id Primary key of row to get history for. * * @return mixed The return value or null if the query failed. * * @since 3.2 */ public function getHistory($typeId, $id) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select($db->quoteName('h.version_note') . ',' . $db->quoteName('h.save_date') . ',' . $db->quoteName('u.name')) ->from($db->quoteName('#__ucm_history') . ' AS h ') ->leftJoin($db->quoteName('#__users') . ' AS u ON ' . $db->quoteName('u.id') . ' = ' . $db->quoteName('h.editor_user_id')) ->where($db->quoteName('ucm_item_id') . ' = ' . $db->quote($id)) ->where($db->quoteName('ucm_type_id') . ' = ' . (int) $typeId) ->order($db->quoteName('save_date') . ' DESC '); $db->setQuery($query); return $db->loadObjectList(); } /** * Method to save a version snapshot to the content history table. * * @param JTable $table JTable object being versioned * * @return boolean True on success, otherwise false. * * @since 3.2 */ public function store($table) { $dataObject = $this->getDataObject($table); $historyTable = JTable::getInstance('Contenthistory', 'JTable'); $typeTable = JTable::getInstance('Contenttype', 'JTable'); $typeTable->load(array('type_alias' => $this->typeAlias)); $historyTable->set('ucm_type_id', $typeTable->type_id); $key = $table->getKeyName(); $historyTable->set('ucm_item_id', $table->$key); // Don't store unless we have a non-zero item id if (!$historyTable->ucm_item_id) { return true; } $historyTable->set('version_data', json_encode($dataObject)); $input = JFactory::getApplication()->input; $data = $input->get('jform', array(), 'array'); $versionName = false; if (isset($data['version_note'])) { $versionName = JFilterInput::getInstance()->clean($data['version_note'], 'string'); $historyTable->set('version_note', $versionName); } // Don't save if hash already exists and same version note $historyTable->set('sha1_hash', $historyTable->getSha1($dataObject, $typeTable)); if ($historyRow = $historyTable->getHashMatch()) { if (!$versionName || ($historyRow->version_note == $versionName)) { return true; } else { // Update existing row to set version note $historyTable->set('version_id', $historyRow->version_id); } } $result = $historyTable->store(); // Load history_limit config from extension. $aliasParts = explode('.', $this->typeAlias); if ($maxVersions = JComponentHelper::getParams($aliasParts[0])->get('history_limit', 0)) { $historyTable->deleteOldVersions($maxVersions); } return $result; } } PK���\��N�k"k"libraries/cms/helper/media.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Helper * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Media helper class * * @since 3.2 */ class JHelperMedia { /** * Checks if the file is an image * * @param string $fileName The filename * * @return boolean * * @since 3.2 */ public function isImage($fileName) { static $imageTypes = 'xcf|odg|gif|jpg|png|bmp'; return preg_match("/\.(?:$imageTypes)$/i", $fileName); } /** * Gets the file extension for purposed of using an icon * * @param string $fileName The filename * * @return string File extension to determine icon * * @since 3.2 */ public static function getTypeIcon($fileName) { return strtolower(substr($fileName, strrpos($fileName, '.') + 1)); } /** * Checks if the file can be uploaded * * @param array $file File information * @param string $component The option name for the component storing the parameters * * @return boolean * * @since 3.2 */ public function canUpload($file, $component = 'com_media') { $app = JFactory::getApplication(); $params = JComponentHelper::getParams($component); if (empty($file['name'])) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_UPLOAD_INPUT'), 'notice'); return false; } jimport('joomla.filesystem.file'); if (str_replace(' ', '', $file['name']) != $file['name'] || $file['name'] !== JFile::makeSafe($file['name'])) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNFILENAME'), 'notice'); return false; } $filetypes = explode('.', $file['name']); if (count($filetypes) < 2) { // There seems to be no extension $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNFILETYPE'), 'notice'); return false; } array_shift($filetypes); // Media file names should never have executable extensions buried in them. $executable = array( 'php', 'js', 'exe', 'phtml', 'java', 'perl', 'py', 'asp','dll', 'go', 'ade', 'adp', 'bat', 'chm', 'cmd', 'com', 'cpl', 'hta', 'ins', 'isp', 'jse', 'lib', 'mde', 'msc', 'msp', 'mst', 'pif', 'scr', 'sct', 'shb', 'sys', 'vb', 'vbe', 'vbs', 'vxd', 'wsc', 'wsf', 'wsh' ); $check = array_intersect($filetypes, $executable); if (!empty($check)) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNFILETYPE'), 'notice'); return false; } $filetype = array_pop($filetypes); $allowable = array_map('trim', explode(',', $params->get('upload_extensions'))); $ignored = array_map('trim', explode(',', $params->get('ignore_extensions'))); if ($filetype == '' || $filetype == false || (!in_array($filetype, $allowable) && !in_array($filetype, $ignored))) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNFILETYPE'), 'notice'); return false; } $maxSize = (int) ($params->get('upload_maxsize', 0) * 1024 * 1024); if ($maxSize > 0 && (int) $file['size'] > $maxSize) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNFILETOOLARGE'), 'notice'); return false; } if ($params->get('restrict_uploads', 1)) { $images = array_map('trim', explode(',', $params->get('image_extensions'))); if (in_array($filetype, $images)) { // If it is an image run it through getimagesize // If tmp_name is empty, then the file was bigger than the PHP limit if (!empty($file['tmp_name'])) { if (($imginfo = getimagesize($file['tmp_name'])) === false) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNINVALID_IMG'), 'notice'); return false; } } else { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNFILETOOLARGE'), 'notice'); return false; } } elseif (!in_array($filetype, $ignored)) { // If it's not an image, and we're not ignoring it $allowed_mime = array_map('trim', explode(',', $params->get('upload_mime'))); $illegal_mime = array_map('trim', explode(',', $params->get('upload_mime_illegal'))); if (function_exists('finfo_open') && $params->get('check_mime', 1)) { // We have fileinfo $finfo = finfo_open(FILEINFO_MIME); $type = finfo_file($finfo, $file['tmp_name']); if (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNINVALID_MIME'), 'notice'); return false; } finfo_close($finfo); } elseif (function_exists('mime_content_type') && $params->get('check_mime', 1)) { // We have mime magic. $type = mime_content_type($file['tmp_name']); if (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNINVALID_MIME'), 'notice'); return false; } } elseif (!JFactory::getUser()->authorise('core.manage', $component)) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNNOTADMIN'), 'notice'); return false; } } } $xss_check = file_get_contents($file['tmp_name'], false, null, -1, 256); $html_tags = array( 'abbr', 'acronym', 'address', 'applet', 'area', 'audioscope', 'base', 'basefont', 'bdo', 'bgsound', 'big', 'blackface', 'blink', 'blockquote', 'body', 'bq', 'br', 'button', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'comment', 'custom', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'fn', 'font', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html', 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'keygen', 'kbd', 'label', 'layer', 'legend', 'li', 'limittext', 'link', 'listing', 'map', 'marquee', 'menu', 'meta', 'multicol', 'nobr', 'noembed', 'noframes', 'noscript', 'nosmartquotes', 'object', 'ol', 'optgroup', 'option', 'param', 'plaintext', 'pre', 'rt', 'ruby', 's', 'samp', 'script', 'select', 'server', 'shadow', 'sidebar', 'small', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'tt', 'ul', 'var', 'wbr', 'xml', 'xmp', '!DOCTYPE', '!--' ); foreach ($html_tags as $tag) { // A tag is '<tagname ', so we need to add < and a space or '<tagname>' if (stristr($xss_check, '<' . $tag . ' ') || stristr($xss_check, '<' . $tag . '>')) { $app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNIEXSS'), 'notice'); return false; } } return true; } /** * Calculate the size of a resized image * * @param integer $width Image width * @param integer $height Image height * @param integer $target Target size * * @return array The new width and height * * @since 3.2 */ public static function imageResize($width, $height, $target) { /* * Takes the larger size of the width and height and applies the * formula accordingly. This is so this script will work * dynamically with any size image */ if ($width > $height) { $percentage = ($target / $width); } else { $percentage = ($target / $height); } // Gets the new value and applies the percentage, then rounds the value $width = round($width * $percentage); $height = round($height * $percentage); return array($width, $height); } /** * Counts the files and directories in a directory that are not php or html files. * * @param string $dir Directory name * * @return array The number of media files and directories in the given directory * * @since 3.2 */ public function countFiles($dir) { $total_file = 0; $total_dir = 0; if (is_dir($dir)) { $d = dir($dir); while (false !== ($entry = $d->read())) { if (substr($entry, 0, 1) != '.' && is_file($dir . DIRECTORY_SEPARATOR . $entry) && strpos($entry, '.html') === false && strpos($entry, '.php') === false) { $total_file++; } if (substr($entry, 0, 1) != '.' && is_dir($dir . DIRECTORY_SEPARATOR . $entry)) { $total_dir++; } } $d->close(); } return array($total_file, $total_dir); } /** * Small helper function that properly converts any * configuration options to their byte representation. * * @param string|integer $val The value to be converted to bytes. * * @return integer The calculated bytes value from the input. * * @since 3.3 */ public function toBytes($val) { switch ($val[strlen($val) - 1]) { case 'M': case 'm': return (int) $val * 1048576; case 'K': case 'k': return (int) $val * 1024; case 'G': case 'g': return (int) $val * 1073741824; default: return $val; } } } PK���\B��4LL*libraries/cms/toolbar/button/separator.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Renders a button separator * * @since 3.0 */ class JToolbarButtonSeparator extends JToolbarButton { /** * Button type * * @var string */ protected $_name = 'Separator'; /** * Get the HTML for a separator in the toolbar * * @param array &$definition Class name and custom width * * @return string The HTML for the separator * * @see JToolbarButton::render() * @since 3.0 */ public function render(&$definition) { // Store all data to the options array for use with JLayout $options = array(); // Separator class name $options['class'] = (empty($definition[1])) ? '' : $definition[1]; // Custom width $options['style'] = (empty($definition[2])) ? '' : ' style="width:' . (int) $definition[2] . 'px;"'; // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.separator'); return $layout->render($options); } /** * Empty implementation (not required for separator) * * @return void * * @since 3.0 */ public function fetchButton() { } } PK���\t1�"X X 'libraries/cms/toolbar/button/slider.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Renders a button to render an HTML element in a slider container * * @since 3.0 */ class JToolbarButtonSlider extends JToolbarButton { /** * Button type * * @var string */ protected $_name = 'Slider'; /** * Fetch the HTML for the button * * @param string $type Unused string, formerly button type. * @param string $name Button name * @param string $text The link text * @param string $url URL for popup * @param integer $width Width of popup * @param integer $height Height of popup * @param string $onClose JavaScript for the onClose event. * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Slider', $name = '', $text = '', $url = '', $width = 640, $height = 480, $onClose = '') { JHtml::_('script', 'jui/cms.js', false, true); // Store all data to the options array for use with JLayout $options = array(); $options['text'] = JText::_($text); $options['name'] = $name; $options['class'] = $this->fetchIconClass($name); $options['onClose'] = ''; $doTask = $this->_getCommand($url); $options['doTask'] = 'Joomla.setcollapse(\'' . $doTask . '\', \'' . $name . '\', \'' . $height . '\');'; if ($onClose) { $options['onClose'] = ' rel="{onClose: function() {' . $onClose . '}}"'; } // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.slider'); return $layout->render($options); } /** * Get the button id * * @param string $type Button type * @param string $name Button name * * @return string Button CSS Id * * @since 3.0 */ public function fetchId($type, $name) { return $this->_parent->getName() . '-slider-' . $name; } /** * Get the JavaScript command for the button * * @param string $url URL for popup * * @return string JavaScript command string * * @since 3.0 */ private function _getCommand($url) { if (substr($url, 0, 4) !== 'http') { $url = JUri::base() . $url; } return $url; } } PK���\,�u���'libraries/cms/toolbar/button/custom.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Renders a custom button * * @since 3.0 */ class JToolbarButtonCustom extends JToolbarButton { /** * Button type * * @var string */ protected $_name = 'Custom'; /** * Fetch the HTML for the button * * @param string $type Button type, unused string. * @param string $html HTML strng for the button * @param string $id CSS id for the button * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Custom', $html = '', $id = 'custom') { return $html; } /** * Get the button CSS Id * * @param string $type Not used. * @param string $html Not used. * @param string $id The id prefix for the button. * * @return string Button CSS Id * * @since 3.0 */ public function fetchId($type = 'Custom', $html = '', $id = 'custom') { return $this->_parent->getName() . '-' . $id; } } PK���\�`���(libraries/cms/toolbar/button/confirm.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Renders a standard button with a confirm dialog * * @since 3.0 */ class JToolbarButtonConfirm extends JToolbarButton { /** * Button type * * @var string */ protected $_name = 'Confirm'; /** * Fetch the HTML for the button * * @param string $type Unused string. * @param string $msg Message to render * @param string $name Name to be used as apart of the id * @param string $text Button text * @param string $task The task associated with the button * @param boolean $list True to allow use of lists * @param boolean $hideMenu True to hide the menu on click * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Confirm', $msg = '', $name = '', $text = '', $task = '', $list = true, $hideMenu = false) { // Store all data to the options array for use with JLayout $options = array(); $options['text'] = JText::_($text); $options['msg'] = JText::_($msg, true); $options['class'] = $this->fetchIconClass($name); $options['doTask'] = $this->_getCommand($options['msg'], $name, $task, $list); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.confirm'); return $layout->render($options); } /** * Get the button CSS Id * * @param string $type Button type * @param string $msg Message to display * @param string $name Name to be used as apart of the id * @param string $text Button text * @param string $task The task associated with the button * @param boolean $list True to allow use of lists * @param boolean $hideMenu True to hide the menu on click * * @return string Button CSS Id * * @since 3.0 */ public function fetchId($type = 'Confirm', $msg = '', $name = '', $text = '', $task = '', $list = true, $hideMenu = false) { return $this->_parent->getName() . '-' . $name; } /** * Get the JavaScript command for the button * * @param object $msg The message to display. * @param string $name Not used. * @param string $task The task used by the application * @param boolean $list True is requires a list confirmation. * * @return string JavaScript command string * * @since 3.0 */ protected function _getCommand($msg, $name, $task, $list) { $message = JText::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'); $message = addslashes($message); if ($list) { $cmd = "if (document.adminForm.boxchecked.value==0){alert('$message');}else{if (confirm('$msg')){Joomla.submitbutton('$task');}}"; } else { $cmd = "if (confirm('$msg')){Joomla.submitbutton('$task');}"; } return $cmd; } } PK���\��LL)libraries/cms/toolbar/button/standard.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Renders a standard button * * @since 3.0 */ class JToolbarButtonStandard extends JToolbarButton { /** * Button type * * @var string */ protected $_name = 'Standard'; /** * Fetch the HTML for the button * * @param string $type Unused string. * @param string $name The name of the button icon class. * @param string $text Button text. * @param string $task Task associated with the button. * @param boolean $list True to allow lists * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Standard', $name = '', $text = '', $task = '', $list = true) { // Store all data to the options array for use with JLayout $options = array(); $options['text'] = JText::_($text); $options['class'] = $this->fetchIconClass($name); $options['doTask'] = $this->_getCommand($options['text'], $task, $list); if ($name == 'apply' || $name == 'new') { $options['btnClass'] = 'btn btn-small btn-success'; $options['class'] .= ' icon-white'; } else { $options['btnClass'] = 'btn btn-small'; } // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.standard'); return $layout->render($options); } /** * Get the button CSS Id * * @param string $type Unused string. * @param string $name Name to be used as apart of the id * @param string $text Button text * @param string $task The task associated with the button * @param boolean $list True to allow use of lists * @param boolean $hideMenu True to hide the menu on click * * @return string Button CSS Id * * @since 3.0 */ public function fetchId($type = 'Standard', $name = '', $text = '', $task = '', $list = true, $hideMenu = false) { return $this->_parent->getName() . '-' . $name; } /** * Get the JavaScript command for the button * * @param string $name The task name as seen by the user * @param string $task The task used by the application * @param boolean $list True is requires a list confirmation. * * @return string JavaScript command string * * @since 3.0 */ protected function _getCommand($name, $task, $list) { $message = JText::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'); $message = addslashes($message); if ($list) { $cmd = "if (document.adminForm.boxchecked.value==0){alert('$message');}else{ Joomla.submitbutton('$task')}"; } else { $cmd = "Joomla.submitbutton('$task')"; } return $cmd; } } PK���\!O�� &libraries/cms/toolbar/button/popup.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Renders a modal window button * * @since 3.0 */ class JToolbarButtonPopup extends JToolbarButton { /** * Button type * * @var string */ protected $_name = 'Popup'; /** * Fetch the HTML for the button * * @param string $type Unused string, formerly button type. * @param string $name Modal name, used to generate element ID * @param string $text The link text * @param string $url URL for popup * @param integer $width Width of popup * @param integer $height Height of popup * @param integer $top Top attribute. [@deprecated Unused, will be removed in 4.0] * @param integer $left Left attribute. [@deprecated Unused, will be removed in 4.0] * @param string $onClose JavaScript for the onClose event. * @param string $title The title text * @param string $footer The footer html * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Modal', $name = '', $text = '', $url = '', $width = 640, $height = 480, $top = 0, $left = 0, $onClose = '', $title = '', $footer = null) { // If no $title is set, use the $text element if (strlen($title) == 0) { $title = $text; } // Store all data to the options array for use with JLayout $options = array(); $options['name'] = $name; $options['text'] = JText::_($text); $options['title'] = JText::_($title); $options['class'] = $this->fetchIconClass($name); $options['doTask'] = $this->_getCommand($url); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.popup'); $html = array(); $html[] = $layout->render($options); // Place modal div and scripts in a new div $html[] = '<div class="btn-group" style="width: 0; margin: 0">'; // Build the options array for the modal $params = array(); $params['title'] = $options['title']; $params['url'] = $options['doTask']; $params['height'] = $height; $params['width'] = $width; if (isset($footer)) { $params['footer'] = $footer; } $html[] = JHtml::_('bootstrap.renderModal', 'modal-' . $name, $params); // If an $onClose event is passed, add it to the modal JS object if (strlen($onClose) >= 1) { $html[] = '<script>' . 'jQuery(\'#modal-' . $name . '\').on(\'hide\', function () {' . $onClose . ';});' . '</script>'; } $html[] = '</div>'; return implode("\n", $html); } /** * Get the button id * * @param string $type Button type * @param string $name Button name * * @return string Button CSS Id * * @since 3.0 */ public function fetchId($type, $name) { return $this->_parent->getName() . '-popup-' . $name; } /** * Get the JavaScript command for the button * * @param string $url URL for popup * * @return string JavaScript command string * * @since 3.0 */ private function _getCommand($url) { if (substr($url, 0, 4) !== 'http') { $url = JUri::base() . $url; } return $url; } } PK���\��iH H %libraries/cms/toolbar/button/help.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Renders a help popup window button * * @since 3.0 */ class JToolbarButtonHelp extends JToolbarButton { /** * @var string Button type */ protected $_name = 'Help'; /** * Fetches the button HTML code. * * @param string $type Unused string. * @param string $ref The name of the help screen (its key reference). * @param boolean $com Use the help file in the component directory. * @param string $override Use this URL instead of any other. * @param string $component Name of component to get Help (null for current component) * * @return string * * @since 3.0 */ public function fetchButton($type = 'Help', $ref = '', $com = false, $override = null, $component = null) { // Store all data to the options array for use with JLayout $options = array(); $options['text'] = JText::_('JTOOLBAR_HELP'); $options['doTask'] = $this->_getCommand($ref, $com, $override, $component); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.help'); return $layout->render($options); } /** * Get the button id * * Redefined from JButton class * * @return string Button CSS Id * * @since 3.0 */ public function fetchId() { return $this->_parent->getName() . '-help'; } /** * Get the JavaScript command for the button * * @param string $ref The name of the help screen (its key reference). * @param boolean $com Use the help file in the component directory. * @param string $override Use this URL instead of any other. * @param string $component Name of component to get Help (null for current component) * * @return string JavaScript command string * * @since 3.0 */ protected function _getCommand($ref, $com, $override, $component) { // Get Help URL $url = JHelp::createUrl($ref, $com, $override, $component); $url = htmlspecialchars($url, ENT_QUOTES); $cmd = "Joomla.popupWindow('$url', '" . JText::_('JHELP', true) . "', 700, 500, 1)"; return $cmd; } } PK���\��=��%libraries/cms/toolbar/button/link.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Renders a link button * * @since 3.0 */ class JToolbarButtonLink extends JToolbarButton { /** * Button type * @var string */ protected $_name = 'Link'; /** * Fetch the HTML for the button * * @param string $type Unused string. * @param string $name Name to be used as apart of the id * @param string $text Button text * @param string $url The link url * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Link', $name = 'back', $text = '', $url = null) { // Store all data to the options array for use with JLayout $options = array(); $options['text'] = JText::_($text); $options['class'] = $this->fetchIconClass($name); $options['doTask'] = $this->_getCommand($url); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.link'); return $layout->render($options); } /** * Get the button CSS Id * * @param string $type The button type. * @param string $name The name of the button. * * @return string Button CSS Id * * @since 3.0 */ public function fetchId($type = 'Link', $name = '') { return $this->_parent->getName() . '-' . $name; } /** * Get the JavaScript command for the button * * @param object $url Button definition * * @return string JavaScript command string * * @since 3.0 */ protected function _getCommand($url) { return $url; } } PK���\&�N libraries/cms/toolbar/button.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Button base class * * The JButton is the base class for all JButton types * * @since 3.0 */ abstract class JToolbarButton { /** * element name * * This has to be set in the final renderer classes. * * @var string */ protected $_name = null; /** * reference to the object that instantiated the element * * @var JButton */ protected $_parent = null; /** * Constructor * * @param object $parent The parent */ public function __construct($parent = null) { $this->_parent = $parent; } /** * Get the element name * * @return string type of the parameter * * @since 3.0 */ public function getName() { return $this->_name; } /** * Get the HTML to render the button * * @param array &$definition Parameters to be passed * * @return string * * @since 3.0 */ public function render(&$definition) { /* * Initialise some variables */ $id = call_user_func_array(array(&$this, 'fetchId'), $definition); $action = call_user_func_array(array(&$this, 'fetchButton'), $definition); // Build id attribute if ($id) { $id = ' id="' . $id . '"'; } // Build the HTML Button $options = array(); $options['id'] = $id; $options['action'] = $action; $layout = new JLayoutFile('joomla.toolbar.base'); return $layout->render($options); } /** * Method to get the CSS class name for an icon identifier * * Can be redefined in the final class * * @param string $identifier Icon identification string * * @return string CSS class name * * @since 3.0 */ public function fetchIconClass($identifier) { // It's an ugly hack, but this allows templates to define the icon classes for the toolbar $layout = new JLayoutFile('joomla.toolbar.iconclass'); return $layout->render(array('icon' => $identifier)); } /** * Get the button * * Defined in the final button class * * @return string * * @since 3.0 */ abstract public function fetchButton(); } /** * Deprecated class placeholder. You should use JToolbarButton instead. * * @since 1.5 * @deprecated 4.0 Use JToolbarButton instead. * @codeCoverageIgnore */ abstract class JButton extends JToolbarButton { /** * Constructor * * @param object $parent The parent * * @deprecated 4.0 Use JToolbarButton instead. */ public function __construct($parent = null) { JLog::add('JButton is deprecated. Use JToolbarButton instead.', JLog::WARNING, 'deprecated'); parent::__construct($parent); } } PK���\��311!libraries/cms/toolbar/toolbar.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * ToolBar handler * * @since 1.5 */ class JToolbar { /** * Toolbar name * * @var string */ protected $_name = array(); /** * Toolbar array * * @var array */ protected $_bar = array(); /** * Loaded buttons * * @var array */ protected $_buttons = array(); /** * Directories, where button types can be stored. * * @var array */ protected $_buttonPath = array(); /** * Stores the singleton instances of various toolbar. * * @var JToolbar * @since 2.5 */ protected static $instances = array(); /** * Constructor * * @param string $name The toolbar name. * * @since 1.5 */ public function __construct($name = 'toolbar') { $this->_name = $name; // Set base path to find buttons. $this->_buttonPath[] = __DIR__ . '/button'; } /** * Returns the global JToolbar object, only creating it if it * doesn't already exist. * * @param string $name The name of the toolbar. * * @return JToolbar The JToolbar object. * * @since 1.5 */ public static function getInstance($name = 'toolbar') { if (empty(self::$instances[$name])) { self::$instances[$name] = new JToolbar($name); } return self::$instances[$name]; } /** * Set a value * * @return string The set value. * * @since 1.5 */ public function appendButton() { // Push button onto the end of the toolbar array. $btn = func_get_args(); array_push($this->_bar, $btn); return true; } /** * Get the list of toolbar links. * * @return array * * @since 1.6 */ public function getItems() { return $this->_bar; } /** * Get the name of the toolbar. * * @return string * * @since 1.6 */ public function getName() { return $this->_name; } /** * Get a value. * * @return string * * @since 1.5 */ public function prependButton() { // Insert button into the front of the toolbar array. $btn = func_get_args(); array_unshift($this->_bar, $btn); return true; } /** * Render a tool bar. * * @return string HTML for the toolbar. * * @since 1.5 */ public function render() { $html = array(); // Start toolbar div. $layout = new JLayoutFile('joomla.toolbar.containeropen'); $html[] = $layout->render(array('id' => $this->_name)); // Render each button in the toolbar. foreach ($this->_bar as $button) { $html[] = $this->renderButton($button); } // End toolbar div. $layout = new JLayoutFile('joomla.toolbar.containerclose'); $html[] = $layout->render(array()); return implode('', $html); } /** * Render a button. * * @param object &$node A toolbar node. * * @return string * * @since 1.5 */ public function renderButton(&$node) { // Get the button type. $type = $node[0]; $button = $this->loadButtonType($type); // Check for error. if ($button === false) { return JText::sprintf('JLIB_HTML_BUTTON_NOT_DEFINED', $type); } return $button->render($node); } /** * Loads a button type. * * @param string $type Button Type * @param boolean $new False by default * * @return boolean * * @since 1.5 */ public function loadButtonType($type, $new = false) { $signature = md5($type); if (isset($this->_buttons[$signature]) && $new === false) { return $this->_buttons[$signature]; } if (!class_exists('JToolbarButton')) { JLog::add(JText::_('JLIB_HTML_BUTTON_BASE_CLASS'), JLog::WARNING, 'jerror'); return false; } $buttonClass = 'JToolbarButton' . ucfirst($type); // @deprecated 12.3 Remove the acceptance of legacy classes starting with JButton. $buttonClassOld = 'JButton' . ucfirst($type); if (!class_exists($buttonClass)) { if (!class_exists($buttonClassOld)) { if (isset($this->_buttonPath)) { $dirs = $this->_buttonPath; } else { $dirs = array(); } $file = JFilterInput::getInstance()->clean(str_replace('_', DIRECTORY_SEPARATOR, strtolower($type)) . '.php', 'path'); jimport('joomla.filesystem.path'); if ($buttonFile = JPath::find($dirs, $file)) { include_once $buttonFile; } else { JLog::add(JText::sprintf('JLIB_HTML_BUTTON_NO_LOAD', $buttonClass, $buttonFile), JLog::WARNING, 'jerror'); return false; } } } if (!class_exists($buttonClass) && !class_exists($buttonClassOld)) { // @todo remove code: return JError::raiseError('SOME_ERROR_CODE', "Module file $buttonFile does not contain class $buttonClass."); return false; } $this->_buttons[$signature] = new $buttonClass($this); return $this->_buttons[$signature]; } /** * Add a directory where JToolbar should search for button types in LIFO order. * * You may either pass a string or an array of directories. * * JToolbar will be searching for an element type in the same order you * added them. If the parameter type cannot be found in the custom folders, * it will look in libraries/joomla/html/toolbar/button. * * @param mixed $path Directory or directories to search. * * @return void * * @since boolean * @see JToolbar */ public function addButtonPath($path) { // Just force path to array. settype($path, 'array'); // Loop through the path directories. foreach ($path as $dir) { // No surrounding spaces allowed! $dir = trim($dir); // Add trailing separators as needed. if (substr($dir, -1) != DIRECTORY_SEPARATOR) { // Directory $dir .= DIRECTORY_SEPARATOR; } // Add to the top of the search dirs. array_unshift($this->_buttonPath, $dir); } } } PK���\�uV�hh%libraries/cms/form/rule/notequals.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Form Rule class for the Joomla Platform. * * @since 11.1 */ class JFormRuleNotequals extends JFormRule { /** * Method to test if two values are not equal. To use this rule, the form * XML needs a validate attribute of equals and a field attribute * that is equal to the field to test against. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.1 * @throws InvalidArgumentException * @throws UnexpectedValueException */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { $field = (string) $element['field']; // Check that a validation field is set. if (!$field) { throw new UnexpectedValueException(sprintf('$field empty in %s::test', get_class($this))); } if (is_null($input)) { throw new InvalidArgumentException(sprintf('The value for $input must not be null in %s', get_class($this))); } // Test the two values against each other. if ($value != $input->get($field)) { return true; } return false; } } PK���\�"Y)��$libraries/cms/form/rule/password.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Form Rule class for the Joomla Platform. * * @since 3.1.2 */ class JFormRulePassword extends JFormRule { /** * Method to test if two values are not equal. To use this rule, the form * XML needs a validate attribute of equals and a field attribute * that is equal to the field to test against. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 3.1.2 * @throws InvalidArgumentException * @throws UnexpectedValueException */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { $meter = isset($element['strengthmeter']) ? ' meter="0"' : '1'; $threshold = isset($element['threshold']) ? (int) $element['threshold'] : 66; $minimumLength = isset($element['minimum_length']) ? (int) $element['minimum_length'] : 4; $minimumIntegers = isset($element['minimum_integers']) ? (int) $element['minimum_integers'] : 0; $minimumSymbols = isset($element['minimum_symbols']) ? (int) $element['minimum_symbols'] : 0; $minimumUppercase = isset($element['minimum_uppercase']) ? (int) $element['minimum_uppercase'] : 0; // If we have parameters from com_users, use those instead. // Some of these may be empty for legacy reasons. $params = JComponentHelper::getParams('com_users'); if (!empty($params)) { $minimumLengthp = $params->get('minimum_length'); $minimumIntegersp = $params->get('minimum_integers'); $minimumSymbolsp = $params->get('minimum_symbols'); $minimumUppercasep = $params->get('minimum_uppercase'); $meterp = $params->get('meter'); $thresholdp = $params->get('threshold'); empty($minimumLengthp) ? : $minimumLength = (int) $minimumLengthp; empty($minimumIntegersp) ? : $minimumIntegers = (int) $minimumIntegersp; empty($minimumSymbolsp) ? : $minimumSymbols = (int) $minimumSymbolsp; empty($minimumUppercasep) ? : $minimumUppercase = (int) $minimumUppercasep; empty($meterp) ? : $meter = $meterp; empty($thresholdp) ? : $threshold = $thresholdp; } // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required'); if (!$required && empty($value)) { return true; } $valueLength = strlen($value); // We set a maximum length to prevent abuse since it is unfiltered. if ($valueLength > 4096) { JFactory::getApplication()->enqueueMessage(JText::_('COM_USERS_MSG_PASSWORD_TOO_LONG'), 'warning'); } // We don't allow white space inside passwords $valueTrim = trim($value); // Set a variable to check if any errors are made in password $validPassword = true; if (strlen($valueTrim) != $valueLength) { JFactory::getApplication()->enqueueMessage( JText::_('COM_USERS_MSG_SPACES_IN_PASSWORD'), 'warning' ); $validPassword = false; } // Minimum number of integers required if (!empty($minimumIntegers)) { $nInts = preg_match_all('/[0-9]/', $value, $imatch); if ($nInts < $minimumIntegers) { JFactory::getApplication()->enqueueMessage( JText::plural('COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N', $minimumIntegers), 'warning' ); $validPassword = false; } } // Minimum number of symbols required if (!empty($minimumSymbols)) { $nsymbols = preg_match_all('[\W]', $value, $smatch); if ($nsymbols < $minimumSymbols) { JFactory::getApplication()->enqueueMessage( JText::plural('COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N', $minimumSymbols), 'warning' ); $validPassword = false; } } // Minimum number of upper case ASII characters required if (!empty($minimumUppercase)) { $nUppercase = preg_match_all("/[A-Z]/", $value, $umatch); if ($nUppercase < $minimumUppercase) { JFactory::getApplication()->enqueueMessage( JText::plural('COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N', $minimumUppercase), 'warning' ); $validPassword = false; } } // Minimum length option if (!empty($minimumLength)) { if (strlen((string) $value) < $minimumLength) { JFactory::getApplication()->enqueueMessage( JText::plural('COM_USERS_MSG_PASSWORD_TOO_SHORT_N', $minimumLength), 'warning' ); $validPassword = false; } } // If valid has violated any rules above return false. if (!$validPassword) { return false; } return true; } } PK���\y�l�--#libraries/cms/form/rule/captcha.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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\Registry\Registry; /** * Form Rule class for the Joomla Framework. * * @since 2.5 */ class JFormRuleCaptcha extends JFormRule { /** * Method to test if the Captcha is correct. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 2.5 */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { $plugin = $element['plugin'] ?: JFactory::getApplication()->getParams()->get('captcha', JFactory::getConfig()->get('captcha', 0)); $namespace = $element['namespace'] ?: $form->getName(); // Use 0 for none if ($plugin === 0 || $plugin === '0') { return true; } else { $captcha = JCaptcha::getInstance((string) $plugin, array('namespace' => (string) $namespace)); } // Test the value. if (!$captcha->checkAnswer($value)) { $error = $captcha->getError(); if ($error instanceof Exception) { return $error; } else { return new JException($error); } } return true; } } PK���\��`�PP*libraries/cms/form/field/templatestyle.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('groupedlist'); /** * Form Field class for the Joomla CMS. * Supports a select grouped list of template styles * * @since 1.6 */ class JFormFieldTemplatestyle extends JFormFieldGroupedList { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'TemplateStyle'; /** * The client name. * * @var mixed * @since 3.2 */ protected $clientName; /** * The template. * * @var mixed * @since 3.2 */ protected $template; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'clientName': case 'template': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'clientName': case 'template': $this->$name = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); if ($result == true) { // Get the clientName template. $this->clientName = $this->element['client'] ? (string) $this->element['client'] : 'site'; $this->template = (string) $this->element['template']; } return $result; } /** * Method to get the list of template style options grouped by template. * Use the client attribute to specify a specific client. * Use the template attribute to specify a specific template * * @return array The field option objects as a nested array in groups. * * @since 1.6 */ protected function getGroups() { $groups = array(); $lang = JFactory::getLanguage(); // Get the client and client_id. $client = JApplicationHelper::getClientInfo($this->clientName, true); // Get the template. $template = $this->template; // Get the database object and a new query object. $db = JFactory::getDbo(); $query = $db->getQuery(true); // Build the query. $query->select('s.id, s.title, e.name as name, s.template') ->from('#__template_styles as s') ->where('s.client_id = ' . (int) $client->id) ->order('template') ->order('title'); if ($template) { $query->where('s.template = ' . $db->quote($template)); } $query->join('LEFT', '#__extensions as e on e.element=s.template') ->where('e.enabled = 1') ->where($db->quoteName('e.type') . ' = ' . $db->quote('template')); // Set the query and load the styles. $db->setQuery($query); $styles = $db->loadObjectList(); // Build the grouped list array. if ($styles) { foreach ($styles as $style) { $template = $style->template; $lang->load('tpl_' . $template . '.sys', $client->path, null, false, true) || $lang->load('tpl_' . $template . '.sys', $client->path . '/templates/' . $template, null, false, true); $name = JText::_($style->name); // Initialize the group if necessary. if (!isset($groups[$name])) { $groups[$name] = array(); } $groups[$name][] = JHtml::_('select.option', $style->id, $style->title); } } // Merge any additional groups in the XML definition. $groups = array_merge(parent::getGroups(), $groups); return $groups; } } PK���\��n���#libraries/cms/form/field/author.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field to load a list of content authors * * @since 3.2 */ class JFormFieldAuthor extends JFormFieldList { /** * The form field type. * * @var string * @since 3.2 */ public $type = 'Author'; /** * Cached array of the category items. * * @var array * @since 3.2 */ protected static $options = array(); /** * Method to get the options to populate list * * @return array The field option objects. * * @since 3.2 */ protected function getOptions() { // Accepted modifiers $hash = md5($this->element); if (!isset(static::$options[$hash])) { static::$options[$hash] = parent::getOptions(); $options = array(); $db = JFactory::getDbo(); // Construct the query $query = $db->getQuery(true) ->select('u.id AS value, u.name AS text') ->from('#__users AS u') ->join('INNER', '#__content AS c ON c.created_by = u.id') ->group('u.id, u.name') ->order('u.name'); // Setup the query $db->setQuery($query); // Return the result if ($options = $db->loadObjectList()) { static::$options[$hash] = array_merge(static::$options[$hash], $options); } } return static::$options[$hash]; } } PK���\����(libraries/cms/form/field/chromestyle.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('groupedlist'); /** * Chrome Styles Form Field class for the Joomla Platform. * * @since 3.0 */ class JFormFieldChromeStyle extends JFormFieldGroupedList { /** * The form field type. * * @var string * @since 3.0 */ public $type = 'ChromeStyle'; /** * Method to get the list of template chrome style options * grouped by template. * * @return array The field option objects as a nested array in groups. * * @since 3.0 */ protected function getGroups() { $groups = array(); // Add Module Style Field $tmp = '---' . JText::_('JLIB_FORM_VALUE_FROM_TEMPLATE') . '---'; $groups[$tmp][] = JHtml::_('select.option', '0', JText::_('JLIB_FORM_VALUE_INHERITED')); $templateStyles = $this->getTemplateModuleStyles(); // Create one new option object for each available style, grouped by templates foreach ($templateStyles as $template => $styles) { $template = ucfirst($template); $groups[$template] = array(); foreach ($styles as $style) { $tmp = JHtml::_('select.option', $template . '-' . $style, $style); $groups[$template][] = $tmp; } } reset($groups); return $groups; } /** * Method to get the templates module styles. * * @return array The array of styles, grouped by templates. * * @since 3.0 */ protected function getTemplateModuleStyles() { $moduleStyles = array(); $templates = array($this->getSystemTemplate()); $templates = array_merge($templates, $this->getTemplates()); foreach ($templates as $template) { $modulesFilePath = JPATH_SITE . '/templates/' . $template->element . '/html/modules.php'; // Is there modules.php for that template? if (file_exists($modulesFilePath)) { $modulesFileData = file_get_contents($modulesFilePath); preg_match_all('/function[\s\t]*modChrome\_([a-z0-9\-\_]*)[\s\t]*\(/i', $modulesFileData, $styles); if (!array_key_exists($template->element, $moduleStyles)) { $moduleStyles[$template->element] = array(); } $moduleStyles[$template->element] = $styles[1]; } } return $moduleStyles; } /** * Method to get the system template as an object. * * @return array The object of system template. * * @since 3.0 */ protected function getSystemTemplate() { $template = new stdClass; $template->element = 'system'; $template->name = 'system'; $template->enabled = 1; return $template; } /** * Return a list of templates * * @return array List of templates * * @since 3.2.1 */ protected function getTemplates() { $db = JFactory::getDbo(); // Get the database object and a new query object. $query = $db->getQuery(true); // Build the query. $query->select('element, name, enabled') ->from('#__extensions') ->where('client_id = 0') ->where('type = ' . $db->quote('template')); // Set the query and load the templates. $db->setQuery($query); $templates = $db->loadObjectList('element'); return $templates; } } PK���\��w\!libraries/cms/form/field/user.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Field to select a user ID from a modal list. * * @since 1.6 */ class JFormFieldUser extends JFormField { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'User'; /** * Method to get the user field input markup. * * @return string The field input markup. * * @since 1.6 */ protected function getInput() { $html = array(); $groups = $this->getGroups(); $excluded = $this->getExcluded(); $link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&field=' . $this->id . (isset($groups) ? ('&groups=' . base64_encode(json_encode($groups))) : '') . (isset($excluded) ? ('&excluded=' . base64_encode(json_encode($excluded))) : ''); // Initialize some field attributes. $attr = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $attr .= !empty($this->size) ? ' size="' . $this->size . '"' : ''; $attr .= $this->required ? ' required' : ''; // Load the modal behavior script. JHtml::_('behavior.modal', 'a.modal_' . $this->id); // Build the script. $script = array(); $script[] = ' function jSelectUser_' . $this->id . '(id, title) {'; $script[] = ' var old_id = document.getElementById("' . $this->id . '_id").value;'; $script[] = ' if (old_id != id) {'; $script[] = ' document.getElementById("' . $this->id . '_id").value = id;'; $script[] = ' document.getElementById("' . $this->id . '").value = title;'; $script[] = ' document.getElementById("' . $this->id . '").className = document.getElementById("' . $this->id . '").className.replace(" invalid" , "");'; $script[] = ' ' . $this->onchange; $script[] = ' }'; $script[] = ' jModalClose();'; $script[] = ' }'; // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); // Load the current username if available. $table = JTable::getInstance('user'); if (is_numeric($this->value)) { $table->load($this->value); } // Handle the special case for "current". elseif (strtoupper($this->value) == 'CURRENT') { // 'CURRENT' is not a reasonable value to be placed in the html $this->value = JFactory::getUser()->id; $table->load($this->value); } else { $table->name = JText::_('JLIB_FORM_SELECT_USER'); } // Create a dummy text field with the user name. $html[] = '<div class="input-append">'; $html[] = ' <input type="text" id="' . $this->id . '" value="' . htmlspecialchars($table->name, ENT_COMPAT, 'UTF-8') . '"' . ' readonly' . $attr . ' />'; // Create the user select button. if ($this->readonly === false) { $html[] = ' <a class="btn btn-primary modal_' . $this->id . '" title="' . JText::_('JLIB_FORM_CHANGE_USER') . '" href="' . $link . '"' . ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}">'; $html[] = '<span class="icon-user"></span></a>'; } $html[] = '</div>'; // Create the real field, hidden, that stored the user id. $html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . $this->value . '" />'; return implode("\n", $html); } /** * Method to get the filtering groups (null means no filtering) * * @return mixed array of filtering groups or null. * * @since 1.6 */ protected function getGroups() { return null; } /** * Method to get the users to exclude from the list of users * * @return mixed Array of users to exclude or null to to not exclude them * * @since 1.6 */ protected function getExcluded() { return null; } } PK���\�ݛ�%libraries/cms/form/field/helpsite.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Provides a select list of help sites. * * @since 1.6 */ class JFormFieldHelpsite extends JFormFieldList { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'Helpsite'; /** * Method to get the help site field options. * * @return array The field option objects. * * @since 1.6 */ protected function getOptions() { // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml', $this->value)); return $options; } /** * Override to add refresh button * * @return string The field input markup. * * @since 3.2 */ protected function getInput() { JHtml::script('system/helpsite.js', false, true); JFactory::getDocument()->addScriptDeclaration( 'var helpsite_base = "' . addslashes(JUri::root()) . '";' ); $html = parent::getInput(); $button = '<button type="button" class="btn btn-small" id="helpsite-refresh" rel="' . $this->id . '" > <span>' . JText::_('JGLOBAL_HELPREFRESH_BUTTON') . '</span> </button>'; return $html . $button; } } PK���\��2�� � (libraries/cms/form/field/moduleorder.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla! CMS. * * @since 1.6 */ class JFormFieldModuleOrder extends JFormField { /** * The form field type. * * @var string * @since 1.6 */ protected $type = 'ModuleOrder'; /** * Method to get the field input markup. * * @return string The field input markup. * * @since 1.6 */ 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 . '"' : ''; $html[] = '<script type="text/javascript">'; $ordering = $this->form->getValue('ordering'); $position = $this->form->getValue('position'); $clientId = $this->form->getValue('client_id'); $html[] = 'var originalOrder = "' . $ordering . '";'; $html[] = 'var originalPos = "' . $position . '";'; $html[] = 'var orders = new Array();'; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('position, ordering, title') ->from('#__modules') ->where('client_id = ' . (int) $clientId) ->order('ordering'); $db->setQuery($query); try { $orders = $db->loadObjectList(); } catch (RuntimeException $e) { JError::raiseWarning(500, $e->getMessage()); return false; } $orders2 = array(); for ($i = 0, $n = count($orders); $i < $n; $i++) { if (!isset($orders2[$orders[$i]->position])) { $orders2[$orders[$i]->position] = 0; } $orders2[$orders[$i]->position]++; $ord = $orders2[$orders[$i]->position]; $title = JText::sprintf('COM_MODULES_OPTION_ORDER_POSITION', $ord, addslashes($orders[$i]->title)); $html[] = 'orders[' . $i . '] = new Array("' . $orders[$i]->position . '","' . $ord . '","' . $title . '");'; } $html[] = 'writeDynaList(\'name="' . $this->name . '" id="' . $this->id . '"' . $attr . '\', orders, originalPos, originalPos, originalOrder);'; $html[] = '</script>'; return implode("\n", $html); } } PK���\��q� libraries/cms/form/field/tag.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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 Framework. * * @since 3.1 */ class JFormFieldTag extends JFormFieldList { /** * A flexible tag list that respects access controls * * @var string * @since 3.1 */ public $type = 'Tag'; /** * Flag to work with nested tag field * * @var boolean * @since 3.1 */ public $isNested = null; /** * com_tags parameters * * @var \Joomla\Registry\Registry * @since 3.1 */ protected $comParams = null; /** * Constructor * * @since 3.1 */ public function __construct() { parent::__construct(); // Load com_tags config $this->comParams = JComponentHelper::getParams('com_tags'); } /** * Method to get the field input for a tag field. * * @return string The field input. * * @since 3.1 */ protected function getInput() { // AJAX mode requires ajax-chosen if (!$this->isNested()) { // Get the field id $id = isset($this->element['id']) ? $this->element['id'] : null; $cssId = '#' . $this->getId($id, $this->element['name']); // Load the ajax-chosen customised field JHtml::_('tag.ajaxfield', $cssId, $this->allowCustom()); } if (!is_array($this->value) && !empty($this->value)) { if ($this->value instanceof JHelperTags) { if (empty($this->value->tags)) { $this->value = array(); } else { $this->value = $this->value->tags; } } // String in format 2,5,4 if (is_string($this->value)) { $this->value = explode(',', $this->value); } } $input = parent::getInput(); return $input; } /** * Method to get a list of tags * * @return array The field option objects. * * @since 3.1 */ protected function getOptions() { $published = $this->element['published']? $this->element['published'] : array(0,1); $db = JFactory::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->qn('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt'); // Filter language if (!empty($this->element['language'])) { $query->where('a.language = ' . $db->q($this->element['language'])); } $query->where($db->qn('a.lft') . ' > 0'); // Filter on the published state if (is_numeric($published)) { $query->where('a.published = ' . (int) $published); } elseif (is_array($published)) { JArrayHelper::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; } // Block the possibility to set a tag as it own parent if ($this->form->getName() == 'com_tags.tag') { $id = (int) $this->form->getValue('id', 0); foreach ($options as $option) { if ($option->value == $id) { $option->disable = true; } } } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); // Prepare nested data if ($this->isNested()) { $this->prepareOptionsNested($options); } else { $options = JHelperTags::convertPathsToNames($options); } return $options; } /** * Add "-" before nested tags, depending on level * * @param array &$options Array of tags * * @return array The field option objects. * * @since 3.1 */ protected function prepareOptionsNested(&$options) { if ($options) { foreach ($options as &$option) { $repeat = (isset($option->level) && $option->level - 1 >= 0) ? $option->level - 1 : 0; $option->text = str_repeat('- ', $repeat) . $option->text; } } return $options; } /** * Determine if the field has to be tagnested * * @return boolean * * @since 3.1 */ public function isNested() { if (is_null($this->isNested)) { // If mode="nested" || ( mode not set & config = nested ) if ((isset($this->element['mode']) && $this->element['mode'] == 'nested') || (!isset($this->element['mode']) && $this->comParams->get('tag_field_ajax_mode', 1) == 0)) { $this->isNested = true; } } return $this->isNested; } /** * Determines if the field allows or denies custom values * * @return boolean */ public function allowCustom() { if (isset($this->element['custom']) && $this->element['custom'] == 'deny') { return false; } return true; } } PK���\�����%libraries/cms/form/field/limitbox.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Field to load a list of posible item count limits * * @since 3.2 */ class JFormFieldLimitbox extends JFormFieldList { /** * The form field type. * * @var string * @since 3.2 */ public $type = 'Limitbox'; /** * Cached array of the category items. * * @var array * @since 3.2 */ protected static $options = array(); /** * Default options * * @var array */ protected $defaultLimits = array(5, 10, 15, 20, 25, 30, 50, 100); /** * Method to get the options to populate to populate list * * @return array The field option objects. * * @since 3.2 */ protected function getOptions() { // Accepted modifiers $hash = md5($this->element); if (!isset(static::$options[$hash])) { static::$options[$hash] = parent::getOptions(); $options = array(); $limits = $this->defaultLimits; // Limits manually specified if (isset($this->element['limits'])) { $limits = explode(',', $this->element['limits']); } // User wants to add custom limits if (isset($this->element['append'])) { $limits = array_unique(array_merge($limits, explode(',', $this->element['append']))); } // User wants to remove some default limits if (isset($this->element['remove'])) { $limits = array_diff($limits, explode(',', $this->element['remove'])); } // Order the options asort($limits); // Add an option to show all? $showAll = isset($this->element['showall']) ? ($this->element['showall'] == "true") : true; if ($showAll) { $limits[] = 0; } if (!empty($limits)) { foreach ($limits as $value) { $options[] = (object) array( 'value' => $value, 'text' => ($value != 0) ? JText::_('J' . $value) : JText::_('JALL') ); } static::$options[$hash] = array_merge(static::$options[$hash], $options); } } return static::$options[$hash]; } } PK���\[�K���&libraries/cms/form/field/headertag.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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! CMS. * * @since 3.0 */ class JFormFieldHeadertag extends JFormFieldList { /** * The form field type. * * @var string * @since 3.0 */ protected $type = 'HeaderTag'; /** * Method to get the field options. * * @return array The field option objects. * * @since 3.0 */ protected function getOptions() { $options = array(); $tags = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'div'); // Create one new option object for each tag foreach ($tags as $tag) { $tmp = JHtml::_('select.option', $tag, $tag); $options[] = $tmp; } reset($options); return $options; } } PK���\��Ϳ��!libraries/cms/form/field/menu.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); // Import the com_menus helper. require_once realpath(JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); /** * Supports an HTML select list of menus * * @since 1.6 */ class JFormFieldMenu extends JFormFieldList { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'Menu'; /** * Method to get the list of menus for the field options. * * @return array The field option objects. * * @since 1.6 */ protected function getOptions() { // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), JHtml::_('menu.menus')); return $options; } } PK���\<�}� (libraries/cms/form/field/contenttype.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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 Framework. * * @since 3.1 */ class JFormFieldContenttype extends JFormFieldList { /** * A flexible tag list that respects access controls * * @var string * @since 3.1 */ public $type = 'Contenttype'; /** * Method to get the field input for a list of content types. * * @return string The field input. * * @since 3.1 */ protected function getInput() { if (!is_array($this->value)) { if (is_object($this->value)) { $this->value = $this->value->tags; } if (is_string($this->value)) { $this->value = explode(',', $this->value); } } $input = parent::getInput(); return $input; } /** * Method to get a list of content types * * @return array The field option objects. * * @since 3.1 */ protected function getOptions() { $lang = JFactory::getLanguage(); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.type_id AS value, a.type_title AS text, a.type_alias AS alias') ->from('#__content_types AS a') ->order('a.type_title ASC'); // Get the options. $db->setQuery($query); try { $options = $db->loadObjectList(); } catch (RuntimeException $e) { return false; } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); foreach ($options as $option) { // Make up the string from the component sys.ini file $parts = explode('.', $option->alias); $comp = array_shift($parts); // Make sure the component sys.ini is loaded $lang->load($comp . '.sys', JPATH_ADMINISTRATOR, null, false, true) || $lang->load($comp . '.sys', JPATH_ADMINISTRATOR . '/components/' . $comp, null, false, true); $option->string = implode('_', $parts); $option->string = $comp . '_CONTENT_TYPE_' . $option->string; if ($lang->hasKey($option->string)) { $option->text = JText::_($option->string); } } return $options; } } PK���\jU�WW'libraries/cms/form/field/useractive.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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('predefinedlist'); /** * Field to show a list of available user active statuses * * @since 3.2 */ class JFormFieldUserActive extends JFormFieldPredefinedList { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'UserActive'; /** * Available statuses * * @var array * @since 3.2 */ protected $predefinedOptions = array( '0' => 'COM_USERS_ACTIVATED', '1' => 'COM_USERS_UNACTIVATED' ); /** * Method to instantiate the form field object. * * @param JForm $form The form to attach to the form field object. * * @since 11.1 */ public function __construct($form = null) { parent::__construct($form); // Load the required language $lang = JFactory::getLanguage(); $lang->load('com_users', JPATH_ADMINISTRATOR); } } PK���\�f���#libraries/cms/form/field/editor.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('textarea'); /** * Form Field class for the Joomla CMS. * A textarea field for content creation * * @see JEditor * @since 1.6 */ class JFormFieldEditor extends JFormFieldTextarea { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'Editor'; /** * The JEditor object. * * @var JEditor * @since 1.6 */ protected $editor; /** * The height of the editor. * * @var string * @since 3.2 */ protected $height; /** * The width of the editor. * * @var string * @since 3.2 */ protected $width; /** * The assetField of the editor. * * @var string * @since 3.2 */ protected $assetField; /** * The authorField of the editor. * * @var string * @since 3.2 */ protected $authorField; /** * The asset of the editor. * * @var string * @since 3.2 */ protected $asset; /** * The buttons of the editor. * * @var mixed * @since 3.2 */ protected $buttons; /** * The hide of the editor. * * @var array * @since 3.2 */ protected $hide; /** * The editorType of the editor. * * @var array * @since 3.2 */ protected $editorType; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'height': case 'width': case 'assetField': case 'authorField': case 'asset': case 'buttons': case 'hide': case 'editorType': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'height': case 'width': case 'assetField': case 'authorField': case 'asset': $this->$name = (string) $value; break; case 'buttons': $value = (string) $value; if ($value == 'true' || $value == 'yes' || $value == '1') { $this->buttons = true; } elseif ($value == 'false' || $value == 'no' || $value == '0') { $this->buttons = false; } else { $this->buttons = explode(',', $value); } break; case 'hide': $value = (string) $value; $this->hide = $value ? explode(',', $value) : array(); break; case 'editorType': // Can be in the form of: editor="desired|alternative". $this->editorType = explode('|', trim((string) $value)); break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); if ($result == true) { $this->height = $this->element['height'] ? (string) $this->element['height'] : '500'; $this->width = $this->element['width'] ? (string) $this->element['width'] : '100%'; $this->assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id'; $this->authorField = $this->element['created_by_field'] ? (string) $this->element['created_by_field'] : 'created_by'; $this->asset = $this->form->getValue($this->assetField) ? $this->form->getValue($this->assetField) : (string) $this->element['asset_id']; $buttons = (string) $this->element['buttons']; $hide = (string) $this->element['hide']; $editorType = (string) $this->element['editor']; if ($buttons == 'true' || $buttons == 'yes' || $buttons == '1') { $this->buttons = true; } elseif ($buttons == 'false' || $buttons == 'no' || $buttons == '0') { $this->buttons = false; } else { $this->buttons = !empty($hide) ? explode(',', $buttons) : array(); } $this->hide = !empty($hide) ? explode(',', (string) $this->element['hide']) : array(); $this->editorType = !empty($editorType) ? explode('|', trim($editorType)) : array(); } return $result; } /** * Method to get the field input markup for the editor area * * @return string The field input markup. * * @since 1.6 */ protected function getInput() { // Get an editor object. $editor = $this->getEditor(); return $editor->display( $this->name, htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'), $this->width, $this->height, $this->columns, $this->rows, $this->buttons ? (is_array($this->buttons) ? array_merge($this->buttons, $this->hide) : $this->hide) : false, $this->id, $this->asset, $this->form->getValue($this->authorField), array('syntax' => (string) $this->element['syntax']) ); } /** * Method to get a JEditor object based on the form field. * * @return JEditor The JEditor object. * * @since 1.6 */ protected function getEditor() { // Only create the editor if it is not already created. if (empty($this->editor)) { $editor = null; if ($this->editorType) { // Get the list of editor types. $types = $this->editorType; // Get the database object. $db = JFactory::getDbo(); // Iterate over teh types looking for an existing editor. foreach ($types as $element) { // Build the query. $query = $db->getQuery(true) ->select('element') ->from('#__extensions') ->where('element = ' . $db->quote($element)) ->where('folder = ' . $db->quote('editors')) ->where('enabled = 1'); // Check of the editor exists. $db->setQuery($query, 0, 1); $editor = $db->loadResult(); // If an editor was found stop looking. if ($editor) { break; } } } // Create the JEditor instance based on the given editor. if (is_null($editor)) { $conf = JFactory::getConfig(); $editor = $conf->get('editor'); } $this->editor = JEditor::getInstance($editor); } return $this->editor; } /** * Method to get the JEditor output for an onSave event. * * @return string The JEditor object output. * * @since 1.6 */ public function save() { return $this->getEditor()->save($this->id); } } PK���\��S���*libraries/cms/form/field/usergrouplist.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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'); /** * Field to load a drop down list of available user groups * * @since 3.2 */ class JFormFieldUserGroupList extends JFormFieldList { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'UserGroupList'; /** * Cached array of the category items. * * @var array * @since 3.2 */ protected static $options = array(); /** * Method to get the options to populate list * * @return array The field option objects. * * @since 3.2 */ protected function getOptions() { // Hash for caching $hash = md5($this->element); if (!isset(static::$options[$hash])) { static::$options[$hash] = parent::getOptions(); $options = array(); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value') ->select('a.title AS text') ->select('COUNT(DISTINCT b.id) AS level') ->from('#__usergroups as a') ->join('LEFT', '#__usergroups AS b ON a.lft > b.lft AND a.rgt < b.rgt') ->group('a.id, a.title, a.lft, a.rgt') ->order('a.lft ASC'); $db->setQuery($query); if ($options = $db->loadObjectList()) { foreach ($options as &$option) { $option->text = str_repeat('- ', $option->level) . $option->text; } static::$options[$hash] = array_merge(static::$options[$hash], $options); } } return static::$options[$hash]; } } PK���\�����&libraries/cms/form/field/moduletag.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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! CMS. * * @since 3.0 */ class JFormFieldModuletag extends JFormFieldList { /** * The form field type. * * @var string * @since 3.0 */ protected $type = 'ModuleTag'; /** * Method to get the field options. * * @return array The field option objects. * * @since 3.0 */ protected function getOptions() { $options = array(); $tags = array('div', 'section', 'aside', 'nav', 'address', 'article'); // Create one new option object for each tag foreach ($tags as $tag) { $tmp = JHtml::_('select.option', $tag, $tag); $options[] = $tmp; } reset($options); return $options; } } PK���\Oe���2libraries/cms/form/field/registrationdaterange.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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('predefinedlist'); /** * Field to show a list of available user active statuses * * @since 3.2 */ class JFormFieldRegistrationDateRange extends JFormFieldPredefinedList { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'RegistrationDateRange'; /** * Available options * * @var array * @since 3.2 */ protected $predefinedOptions = array( 'today' => 'COM_USERS_OPTION_RANGE_TODAY', 'past_week' => 'COM_USERS_OPTION_RANGE_PAST_WEEK', 'past_1month' => 'COM_USERS_OPTION_RANGE_PAST_1MONTH', 'past_3month' => 'COM_USERS_OPTION_RANGE_PAST_3MONTH', 'past_6month' => 'COM_USERS_OPTION_RANGE_PAST_6MONTH', 'past_year' => 'COM_USERS_OPTION_RANGE_PAST_YEAR', 'post_year' => 'COM_USERS_OPTION_RANGE_POST_YEAR', ); /** * Method to instantiate the form field object. * * @param JForm $form The form to attach to the form field object. * * @since 11.1 */ public function __construct($form = null) { parent::__construct($form); // Load the required language $lang = JFactory::getLanguage(); $lang->load('com_users', JPATH_ADMINISTRATOR); } } PK���\��K���+libraries/cms/form/field/moduleposition.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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('text'); /** * Form Field class for the Joomla! CMS. * * @since 1.6 */ class JFormFieldModulePosition extends JFormFieldText { /** * The form field type. * * @var string * @since 1.6 */ protected $type = 'ModulePosition'; /** * The client ID. * * @var integer * @since 3.2 */ protected $clientId; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'clientId': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'clientId': $this->clientId = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); if ($result == true) { // Get the client id. $clientId = $this->element['client_id']; if (!isset($clientId)) { $clientName = $this->element['client']; if (isset($clientName)) { $client = JApplicationHelper::getClientInfo($clientName, true); $clientId = $client->id; } } if (!isset($clientId) && $this->form instanceof JForm) { $clientId = $this->form->getValue('client_id'); } $this->clientId = (int) $clientId; } return $result; } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 1.6 */ protected function getInput() { // Load the modal behavior script. JHtml::_('behavior.modal', 'a.modal'); // Build the script. $script = array(); $script[] = ' function jSelectPosition_' . $this->id . '(name) {'; $script[] = ' document.getElementById("' . $this->id . '").value = name;'; $script[] = ' jModalClose();'; $script[] = ' }'; // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); // Setup variables for display. $html = array(); $link = 'index.php?option=com_modules&view=positions&layout=modal&tmpl=component&function=jSelectPosition_' . $this->id . '&client_id=' . $this->clientId; // The current user display field. $html[] = '<div class="input-append">'; $html[] = parent::getInput() . '<a class="btn modal" title="' . JText::_('COM_MODULES_CHANGE_POSITION_TITLE') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">' . JText::_('COM_MODULES_CHANGE_POSITION_BUTTON') . '</a>'; $html[] = '</div>'; return implode("\n", $html); } } PK���\�r��,libraries/cms/form/field/contentlanguage.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Provides a list of content languages * * @see JFormFieldLanguage for a select list of application languages. * @since 1.6 */ class JFormFieldContentlanguage extends JFormFieldList { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'ContentLanguage'; /** * Method to get the field options for content languages. * * @return array The options the field is going to show. * * @since 1.6 */ protected function getOptions() { return array_merge(parent::getOptions(), JHtml::_('contentlanguage.existing')); } } PK���\o�h�NN%libraries/cms/form/field/menuitem.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('groupedlist'); // Import the com_menus helper. require_once realpath(JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); /** * Supports an HTML grouped select list of menu item grouped by menu * * @since 1.6 */ class JFormFieldMenuitem extends JFormFieldGroupedList { /** * The form field type. * * @var string * @since 1.6 */ public $type = 'MenuItem'; /** * The menu type. * * @var string * @since 3.2 */ protected $menuType; /** * The language. * * @var array * @since 3.2 */ protected $language; /** * The published status. * * @var array * @since 3.2 */ protected $published; /** * The disabled status. * * @var array * @since 3.2 */ protected $disable; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'menuType': case 'language': case 'published': case 'disable': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'menuType': $this->menuType = (string) $value; break; case 'language': case 'published': case 'disable': $value = (string) $value; $this->$name = $value ? explode(',', $value) : array(); break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); if ($result == true) { $this->menuType = (string) $this->element['menu_type']; $this->published = $this->element['published'] ? explode(',', (string) $this->element['published']) : array(); $this->disable = $this->element['disable'] ? explode(',', (string) $this->element['disable']) : array(); $this->language = $this->element['language'] ? explode(',', (string) $this->element['language']) : array(); } return $result; } /** * Method to get the field option groups. * * @return array The field option objects as a nested array in groups. * * @since 1.6 */ protected function getGroups() { $groups = array(); $menuType = $this->menuType; // Get the menu items. $items = MenusHelper::getMenuLinks($menuType, 0, 0, $this->published, $this->language); // Build group for a specific menu type. if ($menuType) { // Initialize the group. $groups[$menuType] = array(); // Build the options array. foreach ($items as $link) { $groups[$menuType][] = JHtml::_('select.option', $link->value, $link->text, 'value', 'text', in_array($link->type, $this->disable)); } } // Build groups for all menu types. else { // Build the groups arrays. foreach ($items as $menu) { // Initialize the group. $groups[$menu->menutype] = array(); // Build the options array. foreach ($menu->links as $link) { $groups[$menu->menutype][] = JHtml::_( 'select.option', $link->value, $link->text, 'value', 'text', in_array($link->type, $this->disable) ); } } } // Merge any additional groups in the XML definition. $groups = array_merge(parent::getGroups(), $groups); return $groups; } } PK���\�3�O $libraries/cms/form/field/captcha.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2009 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Framework. * * @since 2.5 */ class JFormFieldCaptcha extends JFormField { /** * The field type. * * @var string */ protected $type = 'Captcha'; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'plugin': case 'namespace': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'plugin': case 'namespace': $this->$name = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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. * * @since 2.5 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); $plugin = $this->element['plugin'] ? (string) $this->element['plugin'] : JFactory::getApplication()->getParams()->get('captcha', JFactory::getConfig()->get('captcha')); $this->plugin = $plugin; if ($plugin === 0 || $plugin === '0' || $plugin === '' || $plugin === null) { $this->hidden = true; } else { // Force field to be required. There's no reason to have a captcha if it is not required. // Obs: Don't put required="required" in the xml file, you just need to have validate="captcha" $this->required = true; if (strpos($this->class, 'required') === false) { $this->class = $this->class . ' required'; } } $this->namespace = $this->element['namespace'] ? (string) $this->element['namespace'] : $this->form->getName(); return $result; } /** * Method to get the field input. * * @return string The field input. * * @since 2.5 */ protected function getInput() { if ($this->hidden) { return ''; } else { if (($captcha = JCaptcha::getInstance($this->plugin, array('namespace' => $this->namespace))) == null) { return ''; } } return $captcha->display($this->name, $this->id, $this->class); } } PK���\nc���&libraries/cms/form/field/userstate.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 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('predefinedlist'); /** * Field to load a list of available users statuses * * @since 3.2 */ class JFormFieldUserState extends JFormFieldPredefinedList { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'UserState'; /** * Available statuses * * @var array * @since 3.2 */ protected $predefinedOptions = array( '0' => 'JENABLED', '1' => 'JDISABLED' ); } PK���\��#libraries/cms/form/field/status.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('predefinedlist'); /** * Form Field to load a list of states * * @since 3.2 */ class JFormFieldStatus extends JFormFieldPredefinedList { /** * The form field type. * * @var string * @since 3.2 */ public $type = 'Status'; /** * Available statuses * * @var array * @since 3.2 */ protected $predefinedOptions = array( '-2' => 'JTRASHED', '0' => 'JUNPUBLISHED', '1' => 'JPUBLISHED', '2' => 'JARCHIVED', '*' => 'JALL' ); } PK���\����+libraries/cms/form/field/contenthistory.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Field to select a user id from a modal list. * * @since 3.2 */ class JFormFieldContenthistory extends JFormField { /** * The form field type. * * @var string * @since 3.2 */ public $type = 'ContentHistory'; /** * Method to get the content history field input markup. * * @return string The field input markup. * * @since 3.2 */ protected function getInput() { $typeId = JTable::getInstance('Contenttype')->getTypeId($this->element['data-typeAlias']); $itemId = $this->form->getValue('id'); $label = JText::_('JTOOLBAR_VERSIONS'); $html = array(); $link = 'index.php?option=com_contenthistory&view=history&layout=modal&tmpl=component&field=' . $this->id . '&item_id=' . $itemId . '&type_id=' . $typeId . '&type_alias=' . $this->element['data-typeAlias'] . '&' . JSession::getFormToken() . '=1'; // Load the modal behavior script. JHtml::_('behavior.modal', 'button.modal_' . $this->id); $html[] = ' <button class="btn modal_' . $this->id . '" title="' . $label . '" href="' . $link . '"' . ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}">'; $html[] = '<span class="icon-archive"></span>'; $html[] = $label; $html[] = '</button>'; return implode("\n", $html); } } PK���\80�-�-"libraries/cms/form/field/media.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla CMS. * Provides a modal media selector including upload mechanism * * @since 1.6 */ class JFormFieldMedia extends JFormField { /** * The form field type. * * @var string * @since 1.6 */ protected $type = 'Media'; /** * The initialised state of the document object. * * @var boolean * @since 1.6 */ protected static $initialised = false; /** * The authorField. * * @var string * @since 3.2 */ protected $authorField; /** * The asset. * * @var string * @since 3.2 */ protected $asset; /** * The link. * * @var string * @since 3.2 */ protected $link; /** * The authorField. * * @var string * @since 3.2 */ protected $preview; /** * The preview. * * @var string * @since 3.2 */ protected $directory; /** * The previewWidth. * * @var int * @since 3.2 */ protected $previewWidth; /** * The previewHeight. * * @var int * @since 3.2 */ protected $previewHeight; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'authorField': case 'asset': case 'link': case 'preview': case 'directory': case 'previewWidth': case 'previewHeight': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'authorField': case 'asset': case 'link': case 'preview': case 'directory': $this->$name = (string) $value; break; case 'previewWidth': case 'previewHeight': $this->$name = (int) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); if ($result == true) { $assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id'; $this->authorField = $this->element['created_by_field'] ? (string) $this->element['created_by_field'] : 'created_by'; $this->asset = $this->form->getValue($assetField) ? $this->form->getValue($assetField) : (string) $this->element['asset_id']; $this->link = (string) $this->element['link']; $this->preview = (string) $this->element['preview']; $this->directory = (string) $this->element['directory']; $this->previewWidth = isset($this->element['preview_width']) ? (int) $this->element['preview_width'] : 200; $this->previewHeight = isset($this->element['preview_height']) ? (int) $this->element['preview_height'] : 200; } return $result; } /** * Method to get the field input markup for a media selector. * Use attributes to identify specific created_by and asset_id fields * * @return string The field input markup. * * @since 1.6 */ protected function getInput() { $asset = $this->asset; if ($asset == '') { $asset = JFactory::getApplication()->input->get('option'); } if (!self::$initialised) { // Load the modal behavior script. JHtml::_('behavior.modal'); // Include jQuery JHtml::_('jquery.framework'); // Build the script. $script = array(); $script[] = ' function jInsertFieldValue(value, id) {'; $script[] = ' var $ = jQuery.noConflict();'; $script[] = ' var old_value = $("#" + id).val();'; $script[] = ' if (old_value != value) {'; $script[] = ' var $elem = $("#" + id);'; $script[] = ' $elem.val(value);'; $script[] = ' $elem.trigger("change");'; $script[] = ' if (typeof($elem.get(0).onchange) === "function") {'; $script[] = ' $elem.get(0).onchange();'; $script[] = ' }'; $script[] = ' jMediaRefreshPreview(id);'; $script[] = ' }'; $script[] = ' }'; $script[] = ' function jMediaRefreshPreview(id) {'; $script[] = ' var $ = jQuery.noConflict();'; $script[] = ' var value = $("#" + id).val();'; $script[] = ' var $img = $("#" + id + "_preview");'; $script[] = ' if ($img.length) {'; $script[] = ' if (value) {'; $script[] = ' $img.attr("src", "' . JUri::root() . '" + value);'; $script[] = ' $("#" + id + "_preview_empty").hide();'; $script[] = ' $("#" + id + "_preview_img").show()'; $script[] = ' } else { '; $script[] = ' $img.attr("src", "");'; $script[] = ' $("#" + id + "_preview_empty").show();'; $script[] = ' $("#" + id + "_preview_img").hide();'; $script[] = ' } '; $script[] = ' } '; $script[] = ' }'; $script[] = ' function jMediaRefreshPreviewTip(tip)'; $script[] = ' {'; $script[] = ' var $ = jQuery.noConflict();'; $script[] = ' var $tip = $(tip);'; $script[] = ' var $img = $tip.find("img.media-preview");'; $script[] = ' $tip.find("div.tip").css("max-width", "none");'; $script[] = ' var id = $img.attr("id");'; $script[] = ' id = id.substring(0, id.length - "_preview".length);'; $script[] = ' jMediaRefreshPreview(id);'; $script[] = ' $tip.show();'; $script[] = ' }'; // JQuery for tooltip for INPUT showing whole image path $script[] = ' function jMediaRefreshImgpathTip(tip)'; $script[] = ' {'; $script[] = ' var $ = jQuery.noConflict();'; $script[] = ' var $tip = $(tip);'; $script[] = ' $tip.css("max-width", "none");'; $script[] = ' var $imgpath = $("#" + "' . $this->id . '").val();'; $script[] = ' $("#TipImgpath").html($imgpath);'; $script[] = ' if ($imgpath.length) {'; $script[] = ' $tip.show();'; $script[] = ' } else {'; $script[] = ' $tip.hide();'; $script[] = ' }'; $script[] = ' }'; // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); self::$initialised = true; } $html = array(); $attr = ''; // Tooltip for INPUT showing whole image path $options = array( 'onShow' => 'jMediaRefreshImgpathTip', ); JHtml::_('behavior.tooltip', '.hasTipImgpath', $options); if (!empty($this->class)) { $this->class .= ' hasTipImgpath'; } else { $this->class = 'hasTipImgpath'; } $attr .= ' title="' . htmlspecialchars('<span id="TipImgpath"></span>', ENT_COMPAT, 'UTF-8') . '"'; // Initialize some field attributes. $attr .= !empty($this->class) ? ' class="input-small ' . $this->class . '"' : ' class="input-small"'; $attr .= !empty($this->size) ? ' size="' . $this->size . '"' : ''; // Initialize JavaScript field attributes. $attr .= !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; // The text field. $html[] = '<div class="input-prepend input-append">'; // The Preview. $showPreview = true; $showAsTooltip = false; switch ($this->preview) { case 'no': // Deprecated parameter value case 'false': case 'none': $showPreview = false; break; case 'yes': // Deprecated parameter value case 'true': case 'show': break; case 'tooltip': default: $showAsTooltip = true; $options = array( 'onShow' => 'jMediaRefreshPreviewTip', ); JHtml::_('behavior.tooltip', '.hasTipPreview', $options); break; } if ($showPreview) { if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) { $src = JUri::root() . $this->value; } else { $src = ''; } $width = $this->previewWidth; $height = $this->previewHeight; $style = ''; $style .= ($width > 0) ? 'max-width:' . $width . 'px;' : ''; $style .= ($height > 0) ? 'max-height:' . $height . 'px;' : ''; $imgattr = array( 'id' => $this->id . '_preview', 'class' => 'media-preview', 'style' => $style, ); $img = JHtml::image($src, JText::_('JLIB_FORM_MEDIA_PREVIEW_ALT'), $imgattr); $previewImg = '<div id="' . $this->id . '_preview_img"' . ($src ? '' : ' style="display:none"') . '>' . $img . '</div>'; $previewImgEmpty = '<div id="' . $this->id . '_preview_empty"' . ($src ? ' style="display:none"' : '') . '>' . JText::_('JLIB_FORM_MEDIA_PREVIEW_EMPTY') . '</div>'; if ($showAsTooltip) { $html[] = '<div class="media-preview add-on">'; $tooltip = $previewImgEmpty . $previewImg; $options = array( 'title' => JText::_('JLIB_FORM_MEDIA_PREVIEW_SELECTED_IMAGE'), 'text' => '<span class="icon-eye"></span>', 'class' => 'hasTipPreview' ); $html[] = JHtml::tooltip($tooltip, $options); $html[] = '</div>'; } else { $html[] = '<div class="media-preview add-on" style="height:auto">'; $html[] = ' ' . $previewImgEmpty; $html[] = ' ' . $previewImg; $html[] = '</div>'; } } $html[] = ' <input type="text" name="' . $this->name . '" id="' . $this->id . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" readonly="readonly"' . $attr . ' />'; if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) { $folder = explode('/', $this->value); $folder = array_diff_assoc($folder, explode('/', JComponentHelper::getParams('com_media')->get('image_path', 'images'))); array_pop($folder); $folder = implode('/', $folder); } elseif (file_exists(JPATH_ROOT . '/' . JComponentHelper::getParams('com_media')->get('image_path', 'images') . '/' . $this->directory)) { $folder = $this->directory; } else { $folder = ''; } // The button. if ($this->disabled != true) { JHtml::_('bootstrap.tooltip'); $html[] = '<a class="modal btn" title="' . JText::_('JLIB_FORM_BUTTON_SELECT') . '" href="' . ($this->readonly ? '' : ($this->link ? $this->link : 'index.php?option=com_media&view=images&tmpl=component&asset=' . $asset . '&author=' . $this->form->getValue($this->authorField)) . '&fieldid=' . $this->id . '&folder=' . $folder) . '"' . ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}">'; $html[] = JText::_('JLIB_FORM_BUTTON_SELECT') . '</a><a class="btn hasTooltip" title="' . JText::_('JLIB_FORM_BUTTON_CLEAR') . '" href="#" onclick="'; $html[] = 'jInsertFieldValue(\'\', \'' . $this->id . '\');'; $html[] = 'return false;'; $html[] = '">'; $html[] = '<span class="icon-remove"></span></a>'; } $html[] = '</div>'; return implode("\n", $html); } } PK���\Ggavv%libraries/cms/form/field/ordering.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * * @since 3.2 */ class JFormFieldOrdering extends JFormField { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'Ordering'; /** * The form field content type. * * @var string * @since 3.2 */ protected $contentType; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'contentType': return $this->contentType; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'contentType': $this->contentType = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); if ($result == true) { $this->contentType = (string) $this->element['content_type']; } return $result; } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 3.2 */ 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 . '"' : ''; $itemId = (int) $this->getItemId(); $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); } /** * Builds the query for the ordering list. * * @return JDatabaseQuery The query for the ordering form field * * @since 3.2 */ protected function getQuery() { $categoryId = (int) $this->form->getValue('catid'); $ucmType = new JUcmType; $ucmRow = $ucmType->getType($ucmType->getTypeId($this->contentType)); $ucmMapCommon = json_decode($ucmRow->field_mappings)->common; if (is_object($ucmMapCommon)) { $ordering = $ucmMapCommon->core_ordering; $title = $ucmMapCommon->core_title; } elseif (is_array($ucmMapCommon)) { $ordering = $ucmMapCommon[0]->core_ordering; $title = $ucmMapCommon[0]->core_title; } $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select(array($db->quoteName($ordering, 'value'), $db->quoteName($title, 'text'))) ->from($db->quoteName(json_decode($ucmRow->table)->special->dbtable)) ->where($db->quoteName('catid') . ' = ' . (int) $categoryId) ->order('ordering'); return $query; } /** * Retrieves the current Item's Id. * * @return integer The current item ID * * @since 3.2 */ protected function getItemId() { return (int) $this->form->getValue('id'); } } PK���\p�MMlibraries/cms/plugin/plugin.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Plugin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * JPlugin Class * * @since 1.5 */ abstract class JPlugin extends JEvent { /** * A Registry object holding the parameters for the plugin * * @var Registry * @since 1.5 */ public $params = null; /** * The name of the plugin * * @var string * @since 1.5 */ protected $_name = null; /** * The plugin type * * @var string * @since 1.5 */ protected $_type = null; /** * Affects constructor behavior. If true, language files will be loaded automatically. * * @var boolean * @since 3.1 */ protected $autoloadLanguage = false; /** * Constructor * * @param object &$subject The object to observe * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'group', 'params', 'language' * (this list is not meant to be comprehensive). * * @since 1.5 */ public function __construct(&$subject, $config = array()) { // Get the parameters. if (isset($config['params'])) { if ($config['params'] instanceof Registry) { $this->params = $config['params']; } else { $this->params = new Registry; $this->params->loadString($config['params']); } } // Get the plugin name. if (isset($config['name'])) { $this->_name = $config['name']; } // Get the plugin type. if (isset($config['type'])) { $this->_type = $config['type']; } // Load the language files if needed. if ($this->autoloadLanguage) { $this->loadLanguage(); } if (property_exists($this, 'app')) { $reflection = new ReflectionClass($this); $appProperty = $reflection->getProperty('app'); if ($appProperty->isPrivate() === false && is_null($this->app)) { $this->app = JFactory::getApplication(); } } if (property_exists($this, 'db')) { $reflection = new ReflectionClass($this); $dbProperty = $reflection->getProperty('db'); if ($dbProperty->isPrivate() === false && is_null($this->db)) { $this->db = JFactory::getDbo(); } } parent::__construct($subject); } /** * Loads the plugin language file * * @param string $extension The extension for which a language file should be loaded * @param string $basePath The basepath to use * * @return boolean True, if the file has successfully loaded. * * @since 1.5 */ public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR) { if (empty($extension)) { $extension = 'Plg_' . $this->_type . '_' . $this->_name; } $lang = JFactory::getLanguage(); return $lang->load(strtolower($extension), $basePath, null, false, true) || $lang->load(strtolower($extension), JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name, null, false, true); } } PK���\ Sך��libraries/cms/plugin/helper.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Plugin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Plugin helper class * * @since 1.5 */ abstract class JPluginHelper { /** * A persistent cache of the loaded plugins. * * @var array * @since 1.7 */ protected static $plugins = null; /** * Get the path to a layout from a Plugin * * @param string $type Plugin type * @param string $name Plugin name * @param string $layout Layout name * * @return string Layout path * * @since 3.0 */ public static function getLayoutPath($type, $name, $layout = 'default') { $template = JFactory::getApplication()->getTemplate(); $defaultLayout = $layout; if (strpos($layout, ':') !== false) { // Get the template and file name from the string $temp = explode(':', $layout); $template = ($temp[0] == '_') ? $template : $temp[0]; $layout = $temp[1]; $defaultLayout = ($temp[1]) ? $temp[1] : 'default'; } // Build the template and base path for the layout $tPath = JPATH_THEMES . '/' . $template . '/html/plg_' . $type . '_' . $name . '/' . $layout . '.php'; $bPath = JPATH_PLUGINS . '/' . $type . '/' . $name . '/tmpl/' . $defaultLayout . '.php'; $dPath = JPATH_PLUGINS . '/' . $type . '/' . $name . '/tmpl/default.php'; // If the template has a layout override use it if (file_exists($tPath)) { return $tPath; } elseif (file_exists($bPath)) { return $bPath; } else { return $dPath; } } /** * Get the plugin data of a specific type if no specific plugin is specified * otherwise only the specific plugin data is returned. * * @param string $type The plugin type, relates to the sub-directory in the plugins directory. * @param string $plugin The plugin name. * * @return mixed An array of plugin data objects, or a plugin data object. * * @since 1.5 */ public static function getPlugin($type, $plugin = null) { $result = array(); $plugins = static::load(); // Find the correct plugin(s) to return. if (!$plugin) { foreach ($plugins as $p) { // Is this the right plugin? if ($p->type == $type) { $result[] = $p; } } } else { foreach ($plugins as $p) { // Is this plugin in the right group? if ($p->type == $type && $p->name == $plugin) { $result = $p; break; } } } return $result; } /** * Checks if a plugin is enabled. * * @param string $type The plugin type, relates to the sub-directory in the plugins directory. * @param string $plugin The plugin name. * * @return boolean * * @since 1.5 */ public static function isEnabled($type, $plugin = null) { $result = static::getPlugin($type, $plugin); return (!empty($result)); } /** * Loads all the plugin files for a particular type if no specific plugin is specified * otherwise only the specific plugin is loaded. * * @param string $type The plugin type, relates to the sub-directory in the plugins directory. * @param string $plugin The plugin name. * @param boolean $autocreate Autocreate the plugin. * @param JEventDispatcher $dispatcher Optionally allows the plugin to use a different dispatcher. * * @return boolean True on success. * * @since 1.5 */ public static function importPlugin($type, $plugin = null, $autocreate = true, JEventDispatcher $dispatcher = null) { static $loaded = array(); // Check for the default args, if so we can optimise cheaply $defaults = false; if (is_null($plugin) && $autocreate == true && is_null($dispatcher)) { $defaults = true; } if (!isset($loaded[$type]) || !$defaults) { $results = null; // Load the plugins from the database. $plugins = static::load(); // Get the specified plugin(s). for ($i = 0, $t = count($plugins); $i < $t; $i++) { if ($plugins[$i]->type == $type && ($plugin === null || $plugins[$i]->name == $plugin)) { static::import($plugins[$i], $autocreate, $dispatcher); $results = true; } } // Bail out early if we're not using default args if (!$defaults) { return $results; } $loaded[$type] = $results; } return $loaded[$type]; } /** * Loads the plugin file. * * @param object $plugin The plugin. * @param boolean $autocreate True to autocreate. * @param JEventDispatcher $dispatcher Optionally allows the plugin to use a different dispatcher. * * @return void * * @since 1.5 * @deprecated 4.0 Use JPluginHelper::import() instead */ protected static function _import($plugin, $autocreate = true, JEventDispatcher $dispatcher = null) { static::import($plugin, $autocreate, $dispatcher); } /** * Loads the plugin file. * * @param object $plugin The plugin. * @param boolean $autocreate True to autocreate. * @param JEventDispatcher $dispatcher Optionally allows the plugin to use a different dispatcher. * * @return void * * @since 3.2 */ protected static function import($plugin, $autocreate = true, JEventDispatcher $dispatcher = null) { static $paths = array(); $plugin->type = preg_replace('/[^A-Z0-9_\.-]/i', '', $plugin->type); $plugin->name = preg_replace('/[^A-Z0-9_\.-]/i', '', $plugin->name); $path = JPATH_PLUGINS . '/' . $plugin->type . '/' . $plugin->name . '/' . $plugin->name . '.php'; if (!isset($paths[$path])) { if (file_exists($path)) { if (!isset($paths[$path])) { require_once $path; } $paths[$path] = true; if ($autocreate) { // Makes sure we have an event dispatcher if (!is_object($dispatcher)) { $dispatcher = JEventDispatcher::getInstance(); } $className = 'Plg' . $plugin->type . $plugin->name; if (class_exists($className)) { // Load the plugin from the database. if (!isset($plugin->params)) { // Seems like this could just go bye bye completely $plugin = static::getPlugin($plugin->type, $plugin->name); } // Instantiate and register the plugin. new $className($dispatcher, (array) ($plugin)); } } } else { $paths[$path] = false; } } } /** * Loads the published plugins. * * @return array An array of published plugins * * @since 1.5 * @deprecated 4.0 Use JPluginHelper::load() instead */ protected static function _load() { return static::load(); } /** * Loads the published plugins. * * @return array An array of published plugins * * @since 3.2 */ protected static function load() { if (static::$plugins !== null) { return static::$plugins; } $user = JFactory::getUser(); $cache = JFactory::getCache('com_plugins', ''); $levels = implode(',', $user->getAuthorisedViewLevels()); if (!(static::$plugins = $cache->get($levels))) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('folder AS type, element AS name, params') ->from('#__extensions') ->where('enabled = 1') ->where('type =' . $db->quote('plugin')) ->where('state IN (0,1)') ->where('access IN (' . $levels . ')') ->order('ordering'); static::$plugins = $db->setQuery($query)->loadObjectList(); $cache->store(static::$plugins, $levels); } return static::$plugins; } } PK���\SOg'``libraries/cms/pathway/site.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Pathway * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Class to manage the site application pathway. * * @since 1.5 */ class JPathwaySite extends JPathway { /** * Class constructor. * * @param array $options The class options. * * @since 1.5 */ public function __construct($options = array()) { $this->_pathway = array(); $app = JApplication::getInstance('site'); $menu = $app->getMenu(); $lang = JFactory::getLanguage(); if ($item = $menu->getActive()) { $menus = $menu->getMenu(); // Look for the home menu if (JLanguageMultilang::isEnabled()) { $home = $menu->getDefault($lang->getTag()); } else { $home = $menu->getDefault(); } if (is_object($home) && ($item->id != $home->id)) { foreach ($item->tree as $menupath) { $link = $menu->getItem($menupath); switch ($link->type) { case 'separator': case 'heading': $url = null; break; case 'url': if ((strpos($link->link, 'index.php?') === 0) && (strpos($link->link, 'Itemid=') === false)) { // If this is an internal Joomla link, ensure the Itemid is set. $url = $link->link . '&Itemid=' . $link->id; } else { $url = $link->link; } break; case 'alias': // If this is an alias use the item id stored in the parameters to make the link. $url = 'index.php?Itemid=' . $link->params->get('aliasoptions'); break; default: $url = $link->link . '&Itemid=' . $link->id; break; } $this->addItem($menus[$menupath]->title, $url); } } } } } PK���\��\G**!libraries/cms/pathway/pathway.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Pathway * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Class to maintain a pathway. * * The user's navigated path within the application. * * @since 1.5 */ class JPathway { /** * @var array Array to hold the pathway item objects * @since 1.5 * @deprecated 4.0 Will convert to $pathway */ protected $_pathway = array(); /** * @var integer Integer number of items in the pathway * @since 1.5 * @deprecated 4.0 Will convert to $count */ protected $_count = 0; /** * @var array JPathway instances container. * @since 1.7 */ protected static $instances = array(); /** * Class constructor * * @param array $options The class options. * * @since 1.5 */ public function __construct($options = array()) { } /** * Returns a JPathway object * * @param string $client The name of the client * @param array $options An associative array of options * * @return JPathway A JPathway object. * * @since 1.5 * @throws RuntimeException */ public static function getInstance($client, $options = array()) { if (empty(self::$instances[$client])) { // Create a JPathway object $classname = 'JPathway' . ucfirst($client); if (!class_exists($classname)) { // @deprecated 4.0 Everything in this block is deprecated but the warning is only logged after the file_exists // Load the pathway object $info = JApplicationHelper::getClientInfo($client, true); if (is_object($info)) { $path = $info->path . '/includes/pathway.php'; if (file_exists($path)) { JLog::add('Non-autoloadable JPathway subclasses are deprecated, support will be removed in 4.0.', JLog::WARNING, 'deprecated'); include_once $path; } } } if (class_exists($classname)) { self::$instances[$client] = new $classname($options); } else { throw new RuntimeException(JText::sprintf('JLIB_APPLICATION_ERROR_PATHWAY_LOAD', $client), 500); } } return self::$instances[$client]; } /** * Return the JPathway items array * * @return array Array of pathway items * * @since 1.5 */ public function getPathway() { $pw = $this->_pathway; // Use array_values to reset the array keys numerically return array_values($pw); } /** * Set the JPathway items array. * * @param array $pathway An array of pathway objects. * * @return array The previous pathway data. * * @since 1.5 */ public function setPathway($pathway) { $oldPathway = $this->_pathway; // Set the new pathway. $this->_pathway = array_values((array) $pathway); return array_values($oldPathway); } /** * Create and return an array of the pathway names. * * @return array Array of names of pathway items * * @since 1.5 */ public function getPathwayNames() { $names = array(); // Build the names array using just the names of each pathway item foreach ($this->_pathway as $item) { $names[] = $item->name; } // Use array_values to reset the array keys numerically return array_values($names); } /** * Create and add an item to the pathway. * * @param string $name The name of the item. * @param string $link The link to the item. * * @return boolean True on success * * @since 1.5 */ public function addItem($name, $link = '') { $ret = false; if ($this->_pathway[] = $this->makeItem($name, $link)) { $ret = true; $this->_count++; } return $ret; } /** * Set item name. * * @param integer $id The id of the item on which to set the name. * @param string $name The name to set. * * @return boolean True on success * * @since 1.5 */ public function setItemName($id, $name) { $ret = false; if (isset($this->_pathway[$id])) { $this->_pathway[$id]->name = $name; $ret = true; } return $ret; } /** * Create and return a new pathway object. * * @param string $name Name of the item * @param string $link Link to the item * * @return JPathway Pathway item object * * @since 1.5 * @deprecated 4.0 Use makeItem() instead * @codeCoverageIgnore */ protected function _makeItem($name, $link) { return $this->makeItem($name, $link); } /** * Create and return a new pathway object. * * @param string $name Name of the item * @param string $link Link to the item * * @return JPathway Pathway item object * * @since 3.1 */ protected function makeItem($name, $link) { $item = new stdClass; $item->name = html_entity_decode($name, ENT_COMPAT, 'UTF-8'); $item->link = $link; return $item; } } PK���\c�hLLlibraries/cms/ucm/content.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage UCM * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Base class for implementing UCM * * @since 3.1 */ class JUcmContent extends JUcmBase { /** * The related table object * * @var JTable * @since 3.1 */ protected $table; /** * The UCM data array * * @var array * @since 3.1 */ public $ucmData; /** * Instantiate JUcmContent. * * @param JTableInterface $table The table object * @param string $alias The type alias * @param JUcmType $type The type object * * @since 3.1 */ public function __construct(JTableInterface $table = null, $alias = null, JUcmType $type = null) { // Setup dependencies. $input = JFactory::getApplication()->input; $this->alias = isset($alias) ? $alias : $input->get('option') . '.' . $input->get('view'); $this->type = isset($type) ? $type : $this->getType(); if ($table) { $this->table = $table; } else { $tableObject = json_decode($this->type->type->table); $this->table = JTable::getInstance($tableObject->special->type, $tableObject->special->prefix, $tableObject->special->config); } } /** * Method to save the data * * @param array $original The original data to be saved * @param JUcmType $type The UCM Type object * * @return boolean true * * @since 3.1 */ public function save($original = null, JUcmType $type = null) { $type = $type ? $type : $this->type; $ucmData = $original ? $this->mapData($original, $type) : $this->ucmData; // Store the Common fields $this->store($ucmData['common']); // Store the special fields if (isset($ucmData['special'])) { $table = $this->table; $this->store($ucmData['special'], $table, ''); } return true; } /** * Delete content from the Core Content table * * @param mixed $pk The string/array of id's to delete * @param JUcmType $type The content type object * * @return boolean True if success * * @since 3.1 */ public function delete($pk, JUcmType $type = null) { $db = JFactory::getDbo(); $type = $type ? $type : $this->type; if (is_array($pk)) { $pk = implode(',', $pk); } $query = $db->getQuery(true) ->delete('#__ucm_content') ->where($db->quoteName('core_type_id') . ' = ' . (int) $type->type_id) ->where($db->quoteName('core_content_item_id') . ' IN (' . $pk . ')'); $db->setQuery($query); $db->execute(); return true; } /** * Map the original content to the Core Content fields * * @param array $original The original data array * @param JUcmType $type Type object for this data * * @return object $ucmData The mapped UCM data * * @since 3.1 */ public function mapData($original, JUcmType $type = null) { $contentType = isset($type) ? $type : $this->type; $fields = json_decode($contentType->type->field_mappings); $ucmData = array(); $common = (is_object($fields->common)) ? $fields->common : $fields->common[0]; foreach ($common as $i => $field) { if ($field && $field != 'null' && array_key_exists($field, $original)) { $ucmData['common'][$i] = $original[$field]; } } if (array_key_exists('special', $ucmData)) { $special = (is_object($fields->special)) ? $fields->special : $fields->special[0]; foreach ($special as $i => $field) { if ($field && $field != 'null' && array_key_exists($field, $original)) { $ucmData['special'][$i] = $original[$field]; } } } $ucmData['common']['core_type_alias'] = $contentType->type->type_alias; $ucmData['common']['core_type_id'] = $contentType->type->type_id; if (isset($ucmData['special'])) { $ucmData['special']['ucm_id'] = $ucmData['common']['ucm_id']; } $this->ucmData = $ucmData; return $this->ucmData; } /** * Store data to the appropriate table * * @param array $data Data to be stored * @param JTableInterface $table JTable Object * @param boolean $primaryKey Flag that is true for data that are using #__ucm_content as their primary table * * @return boolean true on success * * @since 3.1 */ protected function store($data, JTableInterface $table = null, $primaryKey = null) { $table = $table ? $table : JTable::getInstance('Corecontent'); $typeId = $this->getType()->type->type_id; $primaryKey = $primaryKey ? $primaryKey : $this->getPrimaryKey($typeId, $data['core_content_item_id']); if (!$primaryKey) { // Store the core UCM mappings $baseData = array(); $baseData['ucm_type_id'] = $typeId; $baseData['ucm_item_id'] = $data['core_content_item_id']; $baseData['ucm_language_id'] = JHelperContent::getLanguageId($data['core_language']); if (parent::store($baseData)) { $primaryKey = $this->getPrimaryKey($typeId, $data['core_content_item_id']); } } return parent::store($data, $table, $primaryKey); } /** * Get the value of the primary key from #__ucm_base * * @param string $typeId The ID for the type * @param integer $contentItemId Value of the primary key in the legacy or secondary table * * @return integer The integer of the primary key * * @since 3.1 */ public function getPrimaryKey($typeId, $contentItemId) { $db = JFactory::getDbo(); $queryccid = $db->getQuery(true); $queryccid->select($db->quoteName('ucm_id')) ->from($db->quoteName('#__ucm_base')) ->where( array( $db->quoteName('ucm_item_id') . ' = ' . $db->quote($contentItemId), $db->quoteName('ucm_type_id') . ' = ' . $db->quote($typeId) ) ); $db->setQuery($queryccid); $primaryKey = $db->loadResult(); return $primaryKey; } } PK���\^;YNNlibraries/cms/ucm/type.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage UCM * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * UCM Class for handling content types * * @property-read string $core_content_id * @property-read string $core_type_alias * @property-read string $core_title * @property-read string $core_alias * @property-read string $core_body * @property-read string $core_state * * @property-read string $core_checked_out_time * @property-read string $core_checked_out_user_id * @property-read string $core_access * @property-read string $core_params * @property-read string $core_featured * @property-read string $core_metadata * @property-read string $core_created_user_id * @property-read string $core_created_by_alias * @property-read string $core_created_time * @property-read string $core_modified_user_id * @property-read string $core_modified_time * @property-read string $core_language * @property-read string $core_publish_up * @property-read string $core_publish_down * @property-read string $core_content_item_id * @property-read string $asset_id * @property-read string $core_images * @property-read string $core_urls * @property-read string $core_hits * @property-read string $core_version * @property-read string $core_ordering * @property-read string $core_metakey * @property-read string $core_metadesc * @property-read string $core_catid * @property-read string $core_xreference * @property-read string $core_typeid * * @since 3.1 */ class JUcmType implements JUcm { /** * The UCM Type * * @var JUcmType * @since 3.1 */ public $type; /** * The Database object * * @var JDatabaseDriver * @since 3.1 */ protected $db; /** * The alias for the content type * * @var string * @since 3.1 */ protected $alias; /** * Class constructor * * @param string $alias The alias for the item * @param JDatabaseDriver $database The database object * @param JApplicationBase $application The application object * * @since 3.1 */ public function __construct($alias = null, JDatabaseDriver $database = null, JApplicationBase $application = null) { $this->db = $database ? $database : JFactory::getDbo(); $app = $application ? $application : JFactory::getApplication(); // Make the best guess we can in the absence of information. $this->alias = $alias ? $alias : $app->input->get('option') . '.' . $app->input->get('view'); $this->type = $this->getType(); } /** * Get the Content Type * * @param integer $pk The primary key of the alias type * * @return object The UCM Type data * * @since 3.1 */ public function getType($pk = null) { if (!$pk) { $pk = $this->getTypeId(); } $query = $this->db->getQuery(true); $query->select('ct.*'); $query->from($this->db->quoteName('#__content_types', 'ct')); $query->where($this->db->quoteName('ct.type_id') . ' = ' . (int) $pk); $this->db->setQuery($query); $type = $this->db->loadObject(); return $type; } /** * Get the Content Type from the alias * * @param string $typeAlias The alias for the type * * @return object The UCM Type data * * @since 3.2 */ public function getTypeByAlias($typeAlias = null) { $query = $this->db->getQuery(true); $query->select('ct.*'); $query->from($this->db->quoteName('#__content_types', 'ct')); $query->where($this->db->quoteName('ct.type_alias') . ' = ' . $this->db->quote($typeAlias)); $this->db->setQuery($query); $type = $this->db->loadObject(); return $type; } /** * Get the Content Type from the table class name * * @param string $tableName The table for the type * * @return mixed The UCM Type data if found, false if no match is found * * @since 3.2 */ public function getTypeByTable($tableName) { $query = $this->db->getQuery(true); $query->select('ct.*'); $query->from($this->db->quoteName('#__content_types', 'ct')); // $query->where($this->db->quoteName('ct.type_alias') . ' = ' . (int) $typeAlias); $this->db->setQuery($query); $types = $this->db->loadObjectList(); foreach ($types as $type) { $tableFromType = json_decode($type->table); $tableNameFromType = $tableFromType->special->prefix . $tableFromType->special->type; if ($tableNameFromType == $tableName) { return $type; } } return false; } /** * Retrieves the UCM type ID * * @param string $alias The string of the type alias * * @return mixed The ID of the requested type or false if type is not found * * @since 3.1 */ public function getTypeId($alias = null) { if (!$alias) { $alias = $this->alias; } $query = $this->db->getQuery(true); $query->select('ct.type_id'); $query->from($this->db->quoteName('#__content_types', 'ct')); $query->where($this->db->quoteName('ct.type_alias') . ' = ' . $this->db->q($alias)); $this->db->setQuery($query); $id = $this->db->loadResult(); if (!$id) { return false; } return $id; } /** * Method to expand the field mapping * * @param boolean $assoc True to return an associative array. * * @return mixed Array or object with field mappings. Defaults to object. * * @since 3.2 */ public function fieldmapExpand($assoc = false) { if (!empty($this->type->field_mappings)) { return $this->fieldmap = json_decode($this->type->field_mappings, $assoc); } else { return false; } } /** * Magic method to get the name of the field mapped to a ucm field (core_something). * * @param string $ucmField The name of the field in JTableCorecontent * * @return string The name mapped to the $ucmField for a given content type * * @since 3.2 */ public function __get($ucmField) { if (!isset($this->fieldmap)) { $this->fieldmapExpand(false); } return isset($this->fieldmap->common->$ucmField) ? $this->fieldmap->common->$ucmField : null; } } PK���\���ZZlibraries/cms/ucm/ucm.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage UCM * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Interface to handle UCM * * @since 3.1 */ interface JUcm { } PK���\���f f libraries/cms/ucm/base.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage UCM * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Base class for implementing UCM * * @since 3.1 */ class JUcmBase implements JUcm { /** * The UCM type object * * @var JUcmType * @since 3.1 */ protected $type; /** * The alias for the content table * * @var string * @since 3.1 */ protected $alias; /** * Instantiate the UcmBase. * * @param string $alias The alias string * @param JUcmType $type The type object * * @since 3.1 */ public function __construct($alias = null, JUcmType $type = null) { // Setup dependencies. $input = JFactory::getApplication()->input; $this->alias = isset($alias) ? $alias : $input->get('option') . '.' . $input->get('view'); $this->type = isset($type) ? $type : $this->getType(); } /** * Store data to the appropriate table * * @param array $data Data to be stored * @param JTableInterface $table JTable Object * @param string $primaryKey The primary key name * * @return boolean True on success * * @since 3.1 * @throws Exception */ protected function store($data, JTableInterface $table = null, $primaryKey = null) { if (!$table) { $table = JTable::getInstance('Ucm'); } $ucmId = isset($data['ucm_id']) ? $data['ucm_id'] : null; $primaryKey = $primaryKey ? $primaryKey : $ucmId; if (isset($primaryKey)) { $table->load($primaryKey); } try { $table->bind($data); } catch (RuntimeException $e) { throw new Exception($e->getMessage(), 500); } try { $table->store(); } catch (RuntimeException $e) { throw new Exception($e->getMessage(), 500); } return true; } /** * Get the UCM Content type. * * @return object The UCM content type * * @since 3.1 */ public function getType() { $type = new JUcmType($this->alias); return $type; } /** * Method to map the base ucm fields * * @param array $original Data array * @param JUcmType $type UCM Content Type * * @return array Data array of UCM mappings * * @since 3.1 */ public function mapBase($original, JUcmType $type = null) { $type = $type ? $type : $this->type; $data = array( 'ucm_type_id' => $type->id, 'ucm_item_id' => $original[$type->primary_key], 'ucm_language_id' => JHelperContent::getLanguageId($original['language']) ); return $data; } } PK���\�libraries/cms/error/page.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Error * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Displays the custom error page when an uncaught exception occurs. * * @since 3.0 */ class JErrorPage { /** * Render the error page based on an exception. * * @param Exception $error The exception for which to render the error page. * * @return void * * @since 3.0 */ public static function render(Exception $error) { try { $app = JFactory::getApplication(); $document = JDocument::getInstance('error'); if (!$document) { // We're probably in an CLI environment jexit($error->getMessage()); } // Get the current template from the application $template = $app->getTemplate(); // Push the error object into the document $document->setError($error); if (ob_get_contents()) { ob_end_clean(); } $document->setTitle(JText::_('Error') . ': ' . $error->getCode()); $data = $document->render( false, array( 'template' => $template, 'directory' => JPATH_THEMES, 'debug' => JDEBUG ) ); // Do not allow cache $app->allowCache(false); // If nothing was rendered, just use the message from the Exception if (empty($data)) { $data = $error->getMessage(); } $app->setBody($data); echo $app->toString(); } catch (Exception $e) { // Try to set a 500 header if they haven't already been sent if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } jexit('Error displaying the error page: ' . $e->getMessage() . ': ' . $error->getMessage()); } } } PK���\�3�!�Q�Q"libraries/cms/application/site.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 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\Registry\Registry; /** * Joomla! Site Application class * * @since 3.2 */ final class JApplicationSite extends JApplicationCms { /** * Option to filter by language * * @var boolean * @since 3.2 * @deprecated 4.0 Will be renamed $language_filter */ protected $_language_filter = false; /** * Option to detect language by the browser * * @var boolean * @since 3.2 * @deprecated 4.0 Will be renamed $detect_browser */ protected $_detect_browser = false; /** * Class constructor. * * @param JInput $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInput object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param JApplicationWebClient $client An optional argument to provide dependency injection for the application's * client object. If the argument is a JApplicationWebClient object that object will become * the application's client object, otherwise a default client object is created. * * @since 3.2 */ public function __construct(JInput $input = null, Registry $config = null, JApplicationWebClient $client = null) { // Register the application name $this->_name = 'site'; // Register the client ID $this->_clientId = 0; // Execute the parent constructor parent::__construct($input, $config, $client); } /** * Check if the user can access the application * * @param integer $itemid The item ID to check authorisation for * * @return void * * @since 3.2 * * @throws Exception When you are not authorised to view the home page menu item */ protected function authorise($itemid) { $menus = $this->getMenu(); $user = JFactory::getUser(); if (!$menus->authorise($itemid)) { if ($user->get('id') == 0) { // Set the data $this->setUserState('users.login.form.data', array('return' => JUri::getInstance()->toString())); $url = JRoute::_('index.php?option=com_users&view=login', false); $this->enqueueMessage(JText::_('JGLOBAL_YOU_MUST_LOGIN_FIRST')); $this->redirect($url); } else { // Get the home page menu item $home_item = $menus->getDefault($this->getLanguage()->getTag()); // If we are already in the homepage raise an exception if ($menus->getActive()->id == $home_item->id) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403); } // Otherwise redirect to the homepage and show an error $this->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); $this->redirect(JRoute::_('index.php?Itemid=' . $home_item->id, false)); } } } /** * Dispatch the application * * @param string $component The component which is being rendered. * * @return void * * @since 3.2 */ public function dispatch($component = null) { // Get the component if not set. if (!$component) { $component = $this->input->getCmd('option', null); } // Load the document to the API $this->loadDocument(); // Set up the params $document = $this->getDocument(); $router = static::getRouter(); $params = $this->getParams(); // Register the document object with JFactory JFactory::$document = $document; switch ($document->getType()) { case 'html': // Get language $lang_code = $this->getLanguage()->getTag(); $languages = JLanguageHelper::getLanguages('lang_code'); // Set metadata if (isset($languages[$lang_code]) && $languages[$lang_code]->metakey) { $document->setMetaData('keywords', $languages[$lang_code]->metakey); } else { $document->setMetaData('keywords', $this->get('MetaKeys')); } $document->setMetaData('rights', $this->get('MetaRights')); if ($router->getMode() == JROUTER_MODE_SEF) { $document->setBase(htmlspecialchars(JUri::current())); } // Get the template $template = $this->getTemplate(true); // Store the template and its params to the config $this->set('theme', $template->template); $this->set('themeParams', $template->params); break; case 'feed': $document->setBase(htmlspecialchars(JUri::current())); break; } $document->setTitle($params->get('page_title')); $document->setDescription($params->get('page_description')); // Add version number or not based on global configuration if ($this->get('MetaVersion', 0)) { $document->setGenerator('Joomla! - Open Source Content Management - Version ' . JVERSION); } else { $document->setGenerator('Joomla! - Open Source Content Management'); } $contents = JComponentHelper::renderComponent($component); $document->setBuffer($contents, 'component'); // Trigger the onAfterDispatch event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onAfterDispatch'); } /** * Method to run the Web application routines. * * @return void * * @since 3.2 */ protected function doExecute() { // Initialise the application $this->initialiseApp(); // Mark afterInitialise in the profiler. JDEBUG ? $this->profiler->mark('afterInitialise') : null; // Route the application $this->route(); // Mark afterRoute in the profiler. JDEBUG ? $this->profiler->mark('afterRoute') : null; /* * Check if the user is required to reset their password * * Before $this->route(); "option" and "view" can't be safely read using: * $this->input->getCmd('option'); or $this->input->getCmd('view'); * ex: due of the sef urls */ $this->checkUserRequireReset('com_users', 'profile', 'edit', 'com_users/profile.save,com_users/profile.apply,com_users/user.logout'); // Dispatch the application $this->dispatch(); // Mark afterDispatch in the profiler. JDEBUG ? $this->profiler->mark('afterDispatch') : null; } /** * Return the current state of the detect browser option. * * @return boolean * * @since 3.2 */ public function getDetectBrowser() { return $this->_detect_browser; } /** * Return the current state of the language filter. * * @return boolean * * @since 3.2 */ public function getLanguageFilter() { return $this->_language_filter; } /** * Return a reference to the JMenu object. * * @param string $name The name of the application/client. * @param array $options An optional associative array of configuration settings. * * @return JMenu JMenu object. * * @since 3.2 */ public function getMenu($name = 'site', $options = array()) { $menu = parent::getMenu($name, $options); return $menu; } /** * Get the application parameters * * @param string $option The component option * * @return object The parameters object * * @since 3.2 * @deprecated 4.0 Use getParams() instead */ public function getPageParameters($option = null) { return $this->getParams($option); } /** * Get the application parameters * * @param string $option The component option * * @return object The parameters object * * @since 3.2 */ public function getParams($option = null) { static $params = array(); $hash = '__default'; if (!empty($option)) { $hash = $option; } if (!isset($params[$hash])) { // Get component parameters if (!$option) { $option = $this->input->getCmd('option', null); } // Get new instance of component global parameters $params[$hash] = clone JComponentHelper::getParams($option); // Get menu parameters $menus = $this->getMenu(); $menu = $menus->getActive(); // Get language $lang_code = $this->getLanguage()->getTag(); $languages = JLanguageHelper::getLanguages('lang_code'); $title = $this->get('sitename'); if (isset($languages[$lang_code]) && $languages[$lang_code]->metadesc) { $description = $languages[$lang_code]->metadesc; } else { $description = $this->get('MetaDesc'); } $rights = $this->get('MetaRights'); $robots = $this->get('robots'); // Retrieve com_menu global settings $temp = clone JComponentHelper::getParams('com_menus'); // Lets cascade the parameters if we have menu item parameters if (is_object($menu)) { // Get show_page_heading from com_menu global settings $params[$hash]->def('show_page_heading', $temp->get('show_page_heading')); $temp = new Registry; $temp->loadString($menu->params); $params[$hash]->merge($temp); $title = $menu->title; } else { // Merge com_menu global settings $params[$hash]->merge($temp); // If supplied, use page title $title = $temp->get('page_title', $title); } $params[$hash]->def('page_title', $title); $params[$hash]->def('page_description', $description); $params[$hash]->def('page_rights', $rights); $params[$hash]->def('robots', $robots); } return $params[$hash]; } /** * Return a reference to the JPathway object. * * @param string $name The name of the application. * @param array $options An optional associative array of configuration settings. * * @return JPathway A JPathway object * * @since 3.2 */ public function getPathway($name = 'site', $options = array()) { return parent::getPathway($name, $options); } /** * Return a reference to the JRouter object. * * @param string $name The name of the application. * @param array $options An optional associative array of configuration settings. * * @return JRouter * * @since 3.2 */ public static function getRouter($name = 'site', array $options = array()) { $config = JFactory::getConfig(); $options['mode'] = $config->get('sef'); return parent::getRouter($name, $options); } /** * Gets the name of the current template. * * @param boolean $params True to return the template parameters * * @return string The name of the template. * * @since 3.2 * @throws InvalidArgumentException */ public function getTemplate($params = false) { if (is_object($this->template)) { if (!file_exists(JPATH_THEMES . '/' . $this->template->template . '/index.php')) { throw new InvalidArgumentException(JText::sprintf('JERROR_COULD_NOT_FIND_TEMPLATE', $this->template->template)); } if ($params) { return $this->template; } return $this->template->template; } // Get the id of the active menu item $menu = $this->getMenu(); $item = $menu->getActive(); if (!$item) { $item = $menu->getItem($this->input->getInt('Itemid', null)); } $id = 0; if (is_object($item)) { // Valid item retrieved $id = $item->template_style_id; } $tid = $this->input->getUint('templateStyle', 0); if (is_numeric($tid) && (int) $tid > 0) { $id = (int) $tid; } $cache = JFactory::getCache('com_templates', ''); if ($this->_language_filter) { $tag = $this->getLanguage()->getTag(); } else { $tag = ''; } if (!$templates = $cache->get('templates0' . $tag)) { // Load styles $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('id, home, template, s.params') ->from('#__template_styles as s') ->where('s.client_id = 0') ->where('e.enabled = 1') ->join('LEFT', '#__extensions as e ON e.element=s.template AND e.type=' . $db->quote('template') . ' AND e.client_id=s.client_id'); $db->setQuery($query); $templates = $db->loadObjectList('id'); foreach ($templates as &$template) { $registry = new Registry; $registry->loadString($template->params); $template->params = $registry; // Create home element if ($template->home == 1 && !isset($templates[0]) || $this->_language_filter && $template->home == $tag) { $templates[0] = clone $template; } } $cache->store($templates, 'templates0' . $tag); } if (isset($templates[$id])) { $template = $templates[$id]; } else { $template = $templates[0]; } // Allows for overriding the active template from the request $template_override = $this->input->getCmd('template', ''); // Only set template override if it is a valid template (= it exists and is enabled) if (!empty($template_override)) { if (file_exists(JPATH_THEMES . '/' . $template_override . '/index.php')) { foreach ($templates as $tmpl) { if ($tmpl->template == $template_override) { $template->template = $template_override; break; } } } } // Need to filter the default value as well $template->template = JFilterInput::getInstance()->clean($template->template, 'cmd'); // Fallback template if (!file_exists(JPATH_THEMES . '/' . $template->template . '/index.php')) { $this->enqueueMessage(JText::_('JERROR_ALERTNOTEMPLATE'), 'error'); // Try to find data for 'beez3' template $original_tmpl = $template->template; foreach ($templates as $tmpl) { if ($tmpl->template == 'beez3') { $template = $tmpl; break; } } // Check, the data were found and if template really exists if (!file_exists(JPATH_THEMES . '/' . $template->template . '/index.php')) { throw new InvalidArgumentException(JText::sprintf('JERROR_COULD_NOT_FIND_TEMPLATE', $original_tmpl)); } } // Cache the result $this->template = $template; if ($params) { return $template; } return $template->template; } /** * Initialise the application. * * @param array $options An optional associative array of configuration settings. * * @return void * * @since 3.2 */ protected function initialiseApp($options = array()) { $user = JFactory::getUser(); // If the user is a guest we populate it with the guest user group. if ($user->guest) { $guestUsergroup = JComponentHelper::getParams('com_users')->get('guest_usergroup', 1); $user->groups = array($guestUsergroup); } // If a language was specified it has priority, otherwise use user or default language settings JPluginHelper::importPlugin('system', 'languagefilter'); if (empty($options['language'])) { // Detect the specified language $lang = $this->input->getString('language', null); // Make sure that the user's language exists if ($lang && JLanguage::exists($lang)) { $options['language'] = $lang; } } if ($this->_language_filter && empty($options['language'])) { // Detect cookie language $lang = $this->input->cookie->get(md5($this->get('secret') . 'language'), null, 'string'); // Make sure that the user's language exists if ($lang && JLanguage::exists($lang)) { $options['language'] = $lang; } } if (empty($options['language'])) { // Detect user language $lang = $user->getParam('language'); // Make sure that the user's language exists if ($lang && JLanguage::exists($lang)) { $options['language'] = $lang; } } if ($this->_detect_browser && empty($options['language'])) { // Detect browser language $lang = JLanguageHelper::detectLanguage(); // Make sure that the user's language exists if ($lang && JLanguage::exists($lang)) { $options['language'] = $lang; } } if (empty($options['language'])) { // Detect default language $params = JComponentHelper::getParams('com_languages'); $options['language'] = $params->get('site', $this->get('language', 'en-GB')); } // One last check to make sure we have something if (!JLanguage::exists($options['language'])) { $lang = $this->config->get('language', 'en-GB'); if (JLanguage::exists($lang)) { $options['language'] = $lang; } else { // As a last ditch fail to english $options['language'] = 'en-GB'; } } // Finish initialisation parent::initialiseApp($options); /* * Try the lib_joomla file in the current language (without allowing the loading of the file in the default language) * Fallback to the default language if necessary */ $this->getLanguage()->load('lib_joomla', JPATH_SITE, null, false, true) || $this->getLanguage()->load('lib_joomla', JPATH_ADMINISTRATOR, null, false, true); } /** * Login authentication function * * @param array $credentials Array('username' => string, 'password' => string) * @param array $options Array('remember' => boolean) * * @return boolean True on success. * * @since 3.2 */ public function login($credentials, $options = array()) { // Set the application login entry point if (!array_key_exists('entry_url', $options)) { $options['entry_url'] = JUri::base() . 'index.php?option=com_users&task=user.login'; } // Set the access control action to check. $options['action'] = 'core.login.site'; return parent::login($credentials, $options); } /** * Rendering is the process of pushing the document buffers into the template * placeholders, retrieving data from the document and pushing it into * the application response buffer. * * @return void * * @since 3.2 */ protected function render() { switch ($this->document->getType()) { case 'feed': // No special processing for feeds break; case 'html': default: $template = $this->getTemplate(true); $file = $this->input->get('tmpl', 'index'); if (!$this->get('offline') && ($file == 'offline')) { $this->set('themeFile', 'index.php'); } if ($this->get('offline') && !JFactory::getUser()->authorise('core.login.offline')) { $this->setUserState('users.login.form.data', array('return' => JUri::getInstance()->toString())); $this->set('themeFile', 'offline.php'); $this->setHeader('Status', '503 Service Temporarily Unavailable', 'true'); } if (!is_dir(JPATH_THEMES . '/' . $template->template) && !$this->get('offline')) { $this->set('themeFile', 'component.php'); } // Ensure themeFile is set by now if ($this->get('themeFile') == '') { $this->set('themeFile', $file . '.php'); } break; } parent::render(); } /** * Route the application. * * Routing is the process of examining the request environment to determine which * component should receive the request. The component optional parameters * are then set in the request object to be processed when the application is being * dispatched. * * @return void * * @since 3.2 */ protected function route() { // Execute the parent method parent::route(); $Itemid = $this->input->getInt('Itemid', null); $this->authorise($Itemid); } /** * Set the current state of the detect browser option. * * @param boolean $state The new state of the detect browser option * * @return boolean The previous state * * @since 3.2 */ public function setDetectBrowser($state = false) { $old = $this->_detect_browser; $this->_detect_browser = $state; return $old; } /** * Set the current state of the language filter. * * @param boolean $state The new state of the language filter * * @return boolean The previous state * * @since 3.2 */ public function setLanguageFilter($state = false) { $old = $this->_language_filter; $this->_language_filter = $state; return $old; } /** * Overrides the default template that would be used * * @param string $template The template name * @param mixed $styleParams The template style parameters * * @return void * * @since 3.2 */ public function setTemplate($template, $styleParams = null) { if (is_dir(JPATH_THEMES . '/' . $template)) { $this->template = new stdClass; $this->template->template = $template; if ($styleParams instanceof Registry) { $this->template->params = $styleParams; } else { $this->template->params = new Registry($styleParams); } // Store the template and its params to the config $this->set('theme', $this->template->template); $this->set('themeParams', $this->template->params); } } } PK���\�X��0�0+libraries/cms/application/administrator.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 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\Registry\Registry; /** * Joomla! Administrator Application class * * @since 3.2 */ class JApplicationAdministrator extends JApplicationCms { /** * Class constructor. * * @param JInput $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInput object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param JApplicationWebClient $client An optional argument to provide dependency injection for the application's * client object. If the argument is a JApplicationWebClient object that object will become * the application's client object, otherwise a default client object is created. * * @since 3.2 */ public function __construct(JInput $input = null, Registry $config = null, JApplicationWebClient $client = null) { // Register the application name $this->_name = 'administrator'; // Register the client ID $this->_clientId = 1; // Execute the parent constructor parent::__construct($input, $config, $client); // Set the root in the URI based on the application name JUri::root(null, str_ireplace('/' . $this->getName(), '', JUri::base(true))); } /** * Dispatch the application * * @param string $component The component which is being rendered. * * @return void * * @since 3.2 */ public function dispatch($component = null) { if ($component === null) { $component = JAdministratorHelper::findOption(); } // Load the document to the API $this->loadDocument(); // Set up the params $document = JFactory::getDocument(); // Register the document object with JFactory JFactory::$document = $document; switch ($document->getType()) { case 'html': $document->setMetaData('keywords', $this->get('MetaKeys')); // Get the template $template = $this->getTemplate(true); // Store the template and its params to the config $this->set('theme', $template->template); $this->set('themeParams', $template->params); break; default: break; } $document->setTitle($this->get('sitename') . ' - ' . JText::_('JADMINISTRATION')); $document->setDescription($this->get('MetaDesc')); $document->setGenerator('Joomla! - Open Source Content Management'); $contents = JComponentHelper::renderComponent($component); $document->setBuffer($contents, 'component'); // Trigger the onAfterDispatch event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onAfterDispatch'); } /** * Method to run the Web application routines. * * @return void * * @since 3.2 */ protected function doExecute() { // Initialise the application $this->initialiseApp(array('language' => $this->getUserState('application.lang'))); // Test for magic quotes if (get_magic_quotes_gpc()) { $lang = $this->getLanguage(); if ($lang->hasKey('JERROR_MAGIC_QUOTES')) { $this->enqueueMessage(JText::_('JERROR_MAGIC_QUOTES'), 'error'); } else { $this->enqueueMessage('Your host needs to disable magic_quotes_gpc to run this version of Joomla!', 'error'); } } // Mark afterInitialise in the profiler. JDEBUG ? $this->profiler->mark('afterInitialise') : null; // Route the application $this->route(); // Mark afterRoute in the profiler. JDEBUG ? $this->profiler->mark('afterRoute') : null; /* * Check if the user is required to reset their password * * Before $this->route(); "option" and "view" can't be safely read using: * $this->input->getCmd('option'); or $this->input->getCmd('view'); * ex: due of the sef urls */ $this->checkUserRequireReset('com_admin', 'profile', 'edit', 'com_admin/profile.save,com_admin/profile.apply,com_login/logout'); // Dispatch the application $this->dispatch(); // Mark afterDispatch in the profiler. JDEBUG ? $this->profiler->mark('afterDispatch') : null; } /** * Return a reference to the JRouter object. * * @param string $name The name of the application. * @param array $options An optional associative array of configuration settings. * * @return JRouter * * @since 3.2 */ public static function getRouter($name = 'administrator', array $options = array()) { return parent::getRouter($name, $options); } /** * Gets the name of the current template. * * @param boolean $params True to return the template parameters * * @return string The name of the template. * * @since 3.2 * @throws InvalidArgumentException */ public function getTemplate($params = false) { if (is_object($this->template)) { if ($params) { return $this->template; } return $this->template->template; } $admin_style = JFactory::getUser()->getParam('admin_style'); // Load the template name from the database $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('template, s.params') ->from('#__template_styles as s') ->join('LEFT', '#__extensions as e ON e.type=' . $db->quote('template') . ' AND e.element=s.template AND e.client_id=s.client_id'); if ($admin_style) { $query->where('s.client_id = 1 AND id = ' . (int) $admin_style . ' AND e.enabled = 1', 'OR'); } $query->where('s.client_id = 1 AND home = ' . $db->quote('1'), 'OR') ->order('home'); $db->setQuery($query); $template = $db->loadObject(); $template->template = JFilterInput::getInstance()->clean($template->template, 'cmd'); $template->params = new Registry($template->params); if (!file_exists(JPATH_THEMES . '/' . $template->template . '/index.php')) { $this->enqueueMessage(JText::_('JERROR_ALERTNOTEMPLATE'), 'error'); $template->params = new Registry; $template->template = 'isis'; } // Cache the result $this->template = $template; if (!file_exists(JPATH_THEMES . '/' . $template->template . '/index.php')) { throw new InvalidArgumentException(JText::sprintf('JERROR_COULD_NOT_FIND_TEMPLATE', $template->template)); } if ($params) { return $template; } return $template->template; } /** * Initialise the application. * * @param array $options An optional associative array of configuration settings. * * @return void * * @since 3.2 */ protected function initialiseApp($options = array()) { $user = JFactory::getUser(); // If the user is a guest we populate it with the guest user group. if ($user->guest) { $guestUsergroup = JComponentHelper::getParams('com_users')->get('guest_usergroup', 1); $user->groups = array($guestUsergroup); } // If a language was specified it has priority, otherwise use user or default language settings if (empty($options['language'])) { $lang = $user->getParam('admin_language'); // Make sure that the user's language exists if ($lang && JLanguage::exists($lang)) { $options['language'] = $lang; } else { $params = JComponentHelper::getParams('com_languages'); $options['language'] = $params->get('administrator', $this->get('language', 'en-GB')); } } // One last check to make sure we have something if (!JLanguage::exists($options['language'])) { $lang = $this->get('language', 'en-GB'); if (JLanguage::exists($lang)) { $options['language'] = $lang; } else { // As a last ditch fail to english $options['language'] = 'en-GB'; } } // Finish initialisation parent::initialiseApp($options); // Load Library language $this->getLanguage()->load('lib_joomla', JPATH_ADMINISTRATOR); } /** * Login authentication function * * @param array $credentials Array('username' => string, 'password' => string) * @param array $options Array('remember' => boolean) * * @return boolean True on success. * * @since 3.2 */ public function login($credentials, $options = array()) { // The minimum group $options['group'] = 'Public Backend'; // Make sure users are not auto-registered $options['autoregister'] = false; // Set the application login entry point if (!array_key_exists('entry_url', $options)) { $options['entry_url'] = JUri::base() . 'index.php?option=com_users&task=login'; } // Set the access control action to check. $options['action'] = 'core.login.admin'; $result = parent::login($credentials, $options); if (!($result instanceof Exception)) { $lang = $this->input->getCmd('lang', 'en-GB'); $lang = preg_replace('/[^A-Z-]/i', '', $lang); $this->setUserState('application.lang', $lang); static::purgeMessages(); } return $result; } /** * Purge the jos_messages table of old messages * * @return void * * @since 3.2 */ public static function purgeMessages() { $user = JFactory::getUser(); $userid = $user->get('id'); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('*') ->from($db->quoteName('#__messages_cfg')) ->where($db->quoteName('user_id') . ' = ' . (int) $userid, 'AND') ->where($db->quoteName('cfg_name') . ' = ' . $db->quote('auto_purge'), 'AND'); $db->setQuery($query); $config = $db->loadObject(); // Check if auto_purge value set if (is_object($config) and $config->cfg_name == 'auto_purge') { $purge = $config->cfg_value; } else { // If no value set, default is 7 days $purge = 7; } // If purge value is not 0, then allow purging of old messages if ($purge > 0) { // Purge old messages at day set in message configuration $past = JFactory::getDate(time() - $purge * 86400); $pastStamp = $past->toSql(); $query->clear() ->delete($db->quoteName('#__messages')) ->where($db->quoteName('date_time') . ' < ' . $db->Quote($pastStamp), 'AND') ->where($db->quoteName('user_id_to') . ' = ' . (int) $userid, 'AND'); $db->setQuery($query); $db->execute(); } } /** * Rendering is the process of pushing the document buffers into the template * placeholders, retrieving data from the document and pushing it into * the application response buffer. * * @return void * * @since 3.2 */ protected function render() { // Get the JInput object $input = $this->input; $component = $input->getCmd('option', 'com_login'); $file = $input->getCmd('tmpl', 'index'); if ($component == 'com_login') { $file = 'login'; } $this->set('themeFile', $file . '.php'); // Safety check for when configuration.php root_user is in use. $config = JFactory::getConfig(); $rootUser = $config->get('root_user'); if (property_exists('JConfig', 'root_user') && (JFactory::getUser()->get('username') == $rootUser || JFactory::getUser()->id === (string) $rootUser)) { $this->enqueueMessage( JText::sprintf( 'JWARNING_REMOVE_ROOT_USER', 'index.php?option=com_config&task=config.removeroot&' . JSession::getFormToken() . '=1' ), 'notice' ); } parent::render(); } /** * Route the application. * * Routing is the process of examining the request environment to determine which * component should receive the request. The component optional parameters * are then set in the request object to be processed when the application is being * dispatched. * * @return void * * @since 3.2 */ protected function route() { $uri = JUri::getInstance(); if ($this->get('force_ssl') >= 1 && strtolower($uri->getScheme()) != 'https') { // Forward to https $uri->setScheme('https'); $this->redirect((string) $uri, 301); } // Trigger the onAfterRoute event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onAfterRoute'); } } PK���\U�r�t�t!libraries/cms/application/cms.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 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\Registry\Registry; /** * Joomla! CMS Application class * * @since 3.2 */ class JApplicationCms extends JApplicationWeb { /** * Array of options for the JDocument object * * @var array * @since 3.2 */ protected $docOptions = array(); /** * Application instances container. * * @var array * @since 3.2 */ protected static $instances = array(); /** * The scope of the application. * * @var string * @since 3.2 */ public $scope = null; /** * The client identifier. * * @var integer * @since 3.2 * @deprecated 4.0 Will be renamed $clientId */ protected $_clientId = null; /** * The application message queue. * * @var array * @since 3.2 * @deprecated 4.0 Will be renamed $messageQueue */ protected $_messageQueue = array(); /** * The name of the application. * * @var array * @since 3.2 * @deprecated 4.0 Will be renamed $name */ protected $_name = null; /** * The profiler instance * * @var JProfiler * @since 3.2 */ protected $profiler = null; /** * Currently active template * * @var object * @since 3.2 */ protected $template = null; /** * Class constructor. * * @param JInput $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInput object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param JApplicationWebClient $client An optional argument to provide dependency injection for the application's * client object. If the argument is a JApplicationWebClient object that object will become * the application's client object, otherwise a default client object is created. * * @since 3.2 */ public function __construct(JInput $input = null, Registry $config = null, JApplicationWebClient $client = null) { parent::__construct($input, $config, $client); // Load and set the dispatcher $this->loadDispatcher(); // If JDEBUG is defined, load the profiler instance if (defined('JDEBUG') && JDEBUG) { $this->profiler = JProfiler::getInstance('Application'); } // Enable sessions by default. if (is_null($this->config->get('session'))) { $this->config->set('session', true); } // Set the session default name. if (is_null($this->config->get('session_name'))) { $this->config->set('session_name', $this->getName()); } // Create the session if a session name is passed. if ($this->config->get('session') !== false) { $this->loadSession(); } } /** * After the session has been started we need to populate it with some default values. * * @return void * * @since 3.2 */ public function afterSessionStart() { $session = JFactory::getSession(); if ($session->isNew()) { $session->set('registry', new Registry('session')); $session->set('user', new JUser); } } /** * Checks the user session. * * If the session record doesn't exist, initialise it. * If session is new, create session variables * * @return void * * @since 3.2 * @throws RuntimeException */ public function checkSession() { $db = JFactory::getDbo(); $session = JFactory::getSession(); $user = JFactory::getUser(); $query = $db->getQuery(true) ->select($db->quoteName('session_id')) ->from($db->quoteName('#__session')) ->where($db->quoteName('session_id') . ' = ' . $db->quote($session->getId())); $db->setQuery($query, 0, 1); $exists = $db->loadResult(); // If the session record doesn't exist initialise it. if (!$exists) { $query->clear(); if ($session->isNew()) { $query->insert($db->quoteName('#__session')) ->columns($db->quoteName('session_id') . ', ' . $db->quoteName('client_id') . ', ' . $db->quoteName('time')) ->values($db->quote($session->getId()) . ', ' . (int) $this->getClientId() . ', ' . $db->quote((int) time())); $db->setQuery($query); } else { $query->insert($db->quoteName('#__session')) ->columns( $db->quoteName('session_id') . ', ' . $db->quoteName('client_id') . ', ' . $db->quoteName('guest') . ', ' . $db->quoteName('time') . ', ' . $db->quoteName('userid') . ', ' . $db->quoteName('username') ) ->values( $db->quote($session->getId()) . ', ' . (int) $this->getClientId() . ', ' . (int) $user->get('guest') . ', ' . $db->quote((int) $session->get('session.timer.start')) . ', ' . (int) $user->get('id') . ', ' . $db->quote($user->get('username')) ); $db->setQuery($query); } // If the insert failed, exit the application. try { $db->execute(); } catch (RuntimeException $e) { throw new RuntimeException(JText::_('JERROR_SESSION_STARTUP')); } } } /** * Enqueue a system message. * * @param string $msg The message to enqueue. * @param string $type The message type. Default is message. * * @return void * * @since 3.2 */ public function enqueueMessage($msg, $type = 'message') { // Don't add empty messages. if (!strlen($msg)) { return; } // For empty queue, if messages exists in the session, enqueue them first. $this->getMessageQueue(); // Enqueue the message. $this->_messageQueue[] = array('message' => $msg, 'type' => strtolower($type)); } /** * Execute the application. * * @return void * * @since 3.2 */ public function execute() { // Perform application routines. $this->doExecute(); // If we have an application document object, render it. if ($this->document instanceof JDocument) { // Render the application output. $this->render(); } // If gzip compression is enabled in configuration and the server is compliant, compress the output. if ($this->get('gzip') && !ini_get('zlib.output_compression') && (ini_get('output_handler') != 'ob_gzhandler')) { $this->compress(); // Trigger the onAfterCompress event. $this->triggerEvent('onAfterCompress'); } // Send the application response. $this->respond(); // Trigger the onAfterRespond event. $this->triggerEvent('onAfterRespond'); } /** * Check if the user is required to reset their password. * * If the user is required to reset their password will be redirected to the page that manage the password reset. * * @param string $option The option that manage the password reset * @param string $view The view that manage the password reset * @param string $layout The layout of the view that manage the password reset * @param string $tasks Permitted tasks * * @return void */ protected function checkUserRequireReset($option, $view, $layout, $tasks) { if (JFactory::getUser()->get('requireReset', 0)) { $redirect = false; /* * By default user profile edit page is used. * That page allows you to change more than just the password and might not be the desired behavior. * This allows a developer to override the page that manage the password reset. * (can be configured using the file: configuration.php, or if extended, through the global configuration form) */ $name = $this->getName(); if ($this->get($name . '_reset_password_override', 0)) { $option = $this->get($name . '_reset_password_option', ''); $view = $this->get($name . '_reset_password_view', ''); $layout = $this->get($name . '_reset_password_layout', ''); $tasks = $this->get($name . '_reset_password_tasks', ''); } $task = $this->input->getCmd('task', ''); // Check task or option/view/layout if (!empty($task)) { $tasks = explode(',', $tasks); // Check full task version "option/task" if (array_search($this->input->getCmd('option', '') . '/' . $task, $tasks) === false) { // Check short task version, must be on the same option of the view if ($this->input->getCmd('option', '') != $option || array_search($task, $tasks) === false) { // Not permitted task $redirect = true; } } } else { if ($this->input->getCmd('option', '') != $option || $this->input->getCmd('view', '') != $view || $this->input->getCmd('layout', '') != $layout) { // Requested a different option/view/layout $redirect = true; } } if ($redirect) { // Redirect to the profile edit page $this->enqueueMessage(JText::_('JGLOBAL_PASSWORD_RESET_REQUIRED'), 'notice'); $this->redirect(JRoute::_('index.php?option=' . $option . '&view=' . $view . '&layout=' . $layout, false)); } } } /** * Gets a configuration value. * * @param string $varname The name of the value to get. * @param string $default Default value to return * * @return mixed The user state. * * @since 3.2 * @deprecated 4.0 Use get() instead */ public function getCfg($varname, $default = null) { return $this->get($varname, $default); } /** * Gets the client id of the current running application. * * @return integer A client identifier. * * @since 3.2 */ public function getClientId() { return $this->_clientId; } /** * Returns a reference to the global JApplicationCms object, only creating it if it doesn't already exist. * * This method must be invoked as: $web = JApplicationCms::getInstance(); * * @param string $name The name (optional) of the JApplicationCms class to instantiate. * * @return JApplicationCms * * @since 3.2 * @throws RuntimeException */ public static function getInstance($name = null) { if (empty(static::$instances[$name])) { // Create a JApplicationCms object. $classname = 'JApplication' . ucfirst($name); if (!class_exists($classname)) { throw new RuntimeException(JText::sprintf('JLIB_APPLICATION_ERROR_APPLICATION_LOAD', $name), 500); } static::$instances[$name] = new $classname; } return static::$instances[$name]; } /** * Returns the application JMenu object. * * @param string $name The name of the application/client. * @param array $options An optional associative array of configuration settings. * * @return JMenu * * @since 3.2 */ public function getMenu($name = null, $options = array()) { if (!isset($name)) { $name = $this->getName(); } try { $menu = JMenu::getInstance($name, $options); } catch (Exception $e) { return null; } return $menu; } /** * Get the system message queue. * * @return array The system message queue. * * @since 3.2 */ public function getMessageQueue() { // For empty queue, if messages exists in the session, enqueue them. if (!count($this->_messageQueue)) { $session = JFactory::getSession(); $sessionQueue = $session->get('application.queue'); if (count($sessionQueue)) { $this->_messageQueue = $sessionQueue; $session->set('application.queue', null); } } return $this->_messageQueue; } /** * Gets the name of the current running application. * * @return string The name of the application. * * @since 3.2 */ public function getName() { return $this->_name; } /** * Returns the application JPathway object. * * @param string $name The name of the application. * @param array $options An optional associative array of configuration settings. * * @return JPathway * * @since 3.2 */ public function getPathway($name = null, $options = array()) { if (!isset($name)) { $name = $this->getName(); } try { $pathway = JPathway::getInstance($name, $options); } catch (Exception $e) { return null; } return $pathway; } /** * Returns the application JRouter object. * * @param string $name The name of the application. * @param array $options An optional associative array of configuration settings. * * @return JRouter * * @since 3.2 */ public static function getRouter($name = null, array $options = array()) { if (!isset($name)) { $app = JFactory::getApplication(); $name = $app->getName(); } try { $router = JRouter::getInstance($name, $options); } catch (Exception $e) { return null; } return $router; } /** * Gets the name of the current template. * * @param boolean $params An optional associative array of configuration settings * * @return mixed System is the fallback. * * @since 3.2 */ public function getTemplate($params = false) { $template = new stdClass; $template->template = 'system'; $template->params = new Registry; if ($params) { return $template; } return $template->template; } /** * Gets a user state. * * @param string $key The path of the state. * @param mixed $default Optional default value, returned if the internal value is null. * * @return mixed The user state or null. * * @since 3.2 */ public function getUserState($key, $default = null) { $session = JFactory::getSession(); $registry = $session->get('registry'); if (!is_null($registry)) { return $registry->get($key, $default); } return $default; } /** * Gets the value of a user state variable. * * @param string $key The key of the user state variable. * @param string $request The name of the variable passed in a request. * @param string $default The default value for the variable if not found. Optional. * @param string $type Filter for the variable, for valid values see {@link JFilterInput::clean()}. Optional. * * @return object The request user state. * * @since 3.2 */ public function getUserStateFromRequest($key, $request, $default = null, $type = 'none') { $cur_state = $this->getUserState($key, $default); $new_state = $this->input->get($request, null, $type); // Save the new value only if it was set in this request. if ($new_state !== null) { $this->setUserState($key, $new_state); } else { $new_state = $cur_state; } return $new_state; } /** * Initialise the application. * * @param array $options An optional associative array of configuration settings. * * @return void * * @since 3.2 */ protected function initialiseApp($options = array()) { // Set the configuration in the API. $this->config = JFactory::getConfig(); // Check that we were given a language in the array (since by default may be blank). if (isset($options['language'])) { $this->set('language', $options['language']); } // Build our language object $lang = JLanguage::getInstance($this->get('language'), $this->get('debug_lang')); // Load the language to the API $this->loadLanguage($lang); // Register the language object with JFactory JFactory::$language = $this->getLanguage(); // Set user specific editor. $user = JFactory::getUser(); $editor = $user->getParam('editor', $this->get('editor')); if (!JPluginHelper::isEnabled('editors', $editor)) { $editor = $this->get('editor'); if (!JPluginHelper::isEnabled('editors', $editor)) { $editor = 'none'; } } $this->set('editor', $editor); // Trigger the onAfterInitialise event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onAfterInitialise'); } /** * Is admin interface? * * @return boolean True if this application is administrator. * * @since 3.2 */ public function isAdmin() { return ($this->getClientId() === 1); } /** * Is site interface? * * @return boolean True if this application is site. * * @since 3.2 */ public function isSite() { return ($this->getClientId() === 0); } /** * Allows the application to load a custom or default session. * * The logic and options for creating this object are adequately generic for default cases * but for many applications it will make sense to override this method and create a session, * if required, based on more specific needs. * * @param JSession $session An optional session object. If omitted, the session is created. * * @return JApplicationCms This method is chainable. * * @since 3.2 */ public function loadSession(JSession $session = null) { if ($session !== null) { $this->session = $session; return $this; } // Generate a session name. $name = JApplicationHelper::getHash($this->get('session_name', get_class($this))); // Calculate the session lifetime. $lifetime = (($this->get('lifetime')) ? $this->get('lifetime') * 60 : 900); // Initialize the options for JSession. $options = array( 'name' => $name, 'expire' => $lifetime ); switch ($this->getClientId()) { case 0: if ($this->get('force_ssl') == 2) { $options['force_ssl'] = true; } break; case 1: if ($this->get('force_ssl') >= 1) { $options['force_ssl'] = true; } break; } $this->registerEvent('onAfterSessionStart', array($this, 'afterSessionStart')); // There's an internal coupling to the session object being present in JFactory, need to deal with this at some point $session = JFactory::getSession($options); $session->initialise($this->input, $this->dispatcher); $session->start(); // TODO: At some point we need to get away from having session data always in the db. $db = JFactory::getDbo(); // Remove expired sessions from the database. $time = time(); if ($time % 2) { // The modulus introduces a little entropy, making the flushing less accurate // but fires the query less than half the time. $query = $db->getQuery(true) ->delete($db->quoteName('#__session')) ->where($db->quoteName('time') . ' < ' . $db->quote((int) ($time - $session->getExpire()))); $db->setQuery($query); $db->execute(); } // Get the session handler from the configuration. $handler = $this->get('session_handler', 'none'); if (($handler != 'database' && ($time % 2 || $session->isNew())) || ($handler == 'database' && $session->isNew())) { $this->checkSession(); } // Set the session object. $this->session = $session; return $this; } /** * Login authentication function. * * Username and encoded password are passed the onUserLogin event which * is responsible for the user validation. A successful validation updates * the current session record with the user's details. * * Username and encoded password are sent as credentials (along with other * possibilities) to each observer (authentication plugin) for user * validation. Successful validation will update the current session with * the user details. * * @param array $credentials Array('username' => string, 'password' => string) * @param array $options Array('remember' => boolean) * * @return boolean True on success. * * @since 3.2 */ public function login($credentials, $options = array()) { // Get the global JAuthentication object. jimport('joomla.user.authentication'); $authenticate = JAuthentication::getInstance(); $response = $authenticate->authenticate($credentials, $options); // Import the user plugin group. JPluginHelper::importPlugin('user'); if ($response->status === JAuthentication::STATUS_SUCCESS) { /* * Validate that the user should be able to login (different to being authenticated). * This permits authentication plugins blocking the user. */ $authorisations = $authenticate->authorise($response, $options); foreach ($authorisations as $authorisation) { $denied_states = array(JAuthentication::STATUS_EXPIRED, JAuthentication::STATUS_DENIED); if (in_array($authorisation->status, $denied_states)) { // Trigger onUserAuthorisationFailure Event. $this->triggerEvent('onUserAuthorisationFailure', array((array) $authorisation)); // If silent is set, just return false. if (isset($options['silent']) && $options['silent']) { return false; } // Return the error. switch ($authorisation->status) { case JAuthentication::STATUS_EXPIRED: return JError::raiseWarning('102002', JText::_('JLIB_LOGIN_EXPIRED')); break; case JAuthentication::STATUS_DENIED: return JError::raiseWarning('102003', JText::_('JLIB_LOGIN_DENIED')); break; default: return JError::raiseWarning('102004', JText::_('JLIB_LOGIN_AUTHORISATION')); break; } } } // OK, the credentials are authenticated and user is authorised. Let's fire the onLogin event. $results = $this->triggerEvent('onUserLogin', array((array) $response, $options)); /* * If any of the user plugins did not successfully complete the login routine * then the whole method fails. * * Any errors raised should be done in the plugin as this provides the ability * to provide much more information about why the routine may have failed. */ $user = JFactory::getUser(); if ($response->type == 'Cookie') { $user->set('cookieLogin', true); } if (in_array(false, $results, true) == false) { $options['user'] = $user; $options['responseType'] = $response->type; // The user is successfully logged in. Run the after login events $this->triggerEvent('onUserAfterLogin', array($options)); } return true; } // Trigger onUserLoginFailure Event. $this->triggerEvent('onUserLoginFailure', array((array) $response)); // If silent is set, just return false. if (isset($options['silent']) && $options['silent']) { return false; } // If status is success, any error will have been raised by the user plugin if ($response->status !== JAuthentication::STATUS_SUCCESS) { JLog::add($response->error_message, JLog::WARNING, 'jerror'); } return false; } /** * Logout authentication function. * * Passed the current user information to the onUserLogout event and reverts the current * session record back to 'anonymous' parameters. * If any of the authentication plugins did not successfully complete * the logout routine then the whole method fails. Any errors raised * should be done in the plugin as this provides the ability to give * much more information about why the routine may have failed. * * @param integer $userid The user to load - Can be an integer or string - If string, it is converted to ID automatically * @param array $options Array('clientid' => array of client id's) * * @return boolean True on success * * @since 3.2 */ public function logout($userid = null, $options = array()) { // Get a user object from the JApplication. $user = JFactory::getUser($userid); // Build the credentials array. $parameters['username'] = $user->get('username'); $parameters['id'] = $user->get('id'); // Set clientid in the options array if it hasn't been set already. if (!isset($options['clientid'])) { $options['clientid'] = $this->getClientId(); } // Import the user plugin group. JPluginHelper::importPlugin('user'); // OK, the credentials are built. Lets fire the onLogout event. $results = $this->triggerEvent('onUserLogout', array($parameters, $options)); // Check if any of the plugins failed. If none did, success. if (!in_array(false, $results, true)) { $options['username'] = $user->get('username'); $this->triggerEvent('onUserAfterLogout', array($options)); return true; } // Trigger onUserLoginFailure Event. $this->triggerEvent('onUserLogoutFailure', array($parameters)); return false; } /** * Redirect to another URL. * * If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" * or "303 See Other" code in the header pointing to the new location. If the headers have already been * sent this will be accomplished using a JavaScript statement. * * @param string $url The URL to redirect to. Can only be http/https URL * @param integer $status The HTTP 1.1 status code to be provided. 303 is assumed by default. * * @return void * * @since 3.2 */ public function redirect($url, $status = 303) { // Handle B/C by checking if a message was passed to the method, will be removed at 4.0 if (func_num_args() > 1) { $args = func_get_args(); /* * Do some checks on the $args array, values below correspond to legacy redirect() method * * $args[0] = $url * $args[1] = Message to enqueue * $args[2] = Message type * $args[3] = $status (previously moved) */ if (isset($args[1]) && !empty($args[1]) && (!is_bool($args[1]) && !is_int($args[1]))) { // Log that passing the message to the function is deprecated JLog::add( 'Passing a message and message type to JFactory::getApplication()->redirect() is deprecated. ' . 'Please set your message via JFactory::getApplication()->enqueueMessage() prior to calling redirect().', JLog::WARNING, 'deprecated' ); $message = $args[1]; // Set the message type if present if (isset($args[2]) && !empty($args[2])) { $type = $args[2]; } else { $type = 'message'; } // Enqueue the message $this->enqueueMessage($message, $type); // Reset the $moved variable $status = isset($args[3]) ? (boolean) $args[3] : false; } } // Persist messages if they exist. if (count($this->_messageQueue)) { $session = JFactory::getSession(); $session->set('application.queue', $this->_messageQueue); } // Hand over processing to the parent now parent::redirect($url, $status); } /** * Rendering is the process of pushing the document buffers into the template * placeholders, retrieving data from the document and pushing it into * the application response buffer. * * @return void * * @since 3.2 */ protected function render() { // Setup the document options. $this->docOptions['template'] = $this->get('theme'); $this->docOptions['file'] = $this->get('themeFile', 'index.php'); $this->docOptions['params'] = $this->get('themeParams'); if ($this->get('themes.base')) { $this->docOptions['directory'] = $this->get('themes.base'); } // Fall back to constants. else { $this->docOptions['directory'] = defined('JPATH_THEMES') ? JPATH_THEMES : (defined('JPATH_BASE') ? JPATH_BASE : __DIR__) . '/themes'; } // Parse the document. $this->document->parse($this->docOptions); // Trigger the onBeforeRender event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onBeforeRender'); $caching = false; if ($this->isSite() && $this->get('caching') && $this->get('caching', 2) == 2 && !JFactory::getUser()->get('id')) { $caching = true; } // Render the document. $data = $this->document->render($caching, $this->docOptions); // Set the application output data. $this->setBody($data); // Trigger the onAfterRender event. $this->triggerEvent('onAfterRender'); // Mark afterRender in the profiler. JDEBUG ? $this->profiler->mark('afterRender') : null; } /** * Route the application. * * Routing is the process of examining the request environment to determine which * component should receive the request. The component optional parameters * are then set in the request object to be processed when the application is being * dispatched. * * @return void * * @since 3.2 */ protected function route() { // Get the full request URI. $uri = clone JUri::getInstance(); $router = static::getRouter(); $result = $router->parse($uri); foreach ($result as $key => $value) { $this->input->def($key, $value); } // Trigger the onAfterRoute event. JPluginHelper::importPlugin('system'); $this->triggerEvent('onAfterRoute'); } /** * Sets the value of a user state variable. * * @param string $key The path of the state. * @param string $value The value of the variable. * * @return mixed The previous state, if one existed. * * @since 3.2 */ public function setUserState($key, $value) { $session = JFactory::getSession(); $registry = $session->get('registry'); if (!is_null($registry)) { return $registry->set($key, $value); } return null; } /** * Sends all headers prior to returning the string * * @param boolean $compress If true, compress the data * * @return string * * @since 3.2 */ public function toString($compress = false) { // Don't compress something if the server is going to do it anyway. Waste of time. if ($compress && !ini_get('zlib.output_compression') && ini_get('output_handler') != 'ob_gzhandler') { $this->compress(); } if ($this->allowCache() === false) { $this->setHeader('Cache-Control', 'no-cache', false); // HTTP 1.0 $this->setHeader('Pragma', 'no-cache'); } $this->sendHeaders(); return $this->getBody(); } } PK���\��Lq$libraries/cms/application/helper.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Application helper functions * * @since 1.5 */ class JApplicationHelper { /** * Client information array * * @var array * @since 1.6 */ protected static $_clients = null; /** * Return the name of the request component [main component] * * @param string $default The default option * * @return string Option (e.g. com_something) * * @since 1.6 */ public static function getComponentName($default = null) { static $option; if ($option) { return $option; } $input = JFactory::getApplication()->input; $option = strtolower($input->get('option')); if (empty($option)) { $option = $default; } $input->set('option', $option); return $option; } /** * Provides a secure hash based on a seed * * @param string $seed Seed string. * * @return string A secure hash * * @since 3.2 */ public static function getHash($seed) { return md5(JFactory::getConfig()->get('secret') . $seed); } /** * This method transliterates a string into an URL * safe string or returns a URL safe UTF-8 string * based on the global configuration * * @param string $string String to process * * @return string Processed string * * @since 3.2 */ public static function stringURLSafe($string) { if (JFactory::getConfig()->get('unicodeslugs') == 1) { $output = JFilterOutput::stringURLUnicodeSlug($string); } else { $output = JFilterOutput::stringURLSafe($string); } return $output; } /** * Gets information on a specific client id. This method will be useful in * future versions when we start mapping applications in the database. * * This method will return a client information array if called * with no arguments which can be used to add custom application information. * * @param integer $id A client identifier * @param boolean $byName If True, find the client by its name * * @return mixed Object describing the client or false if not known * * @since 1.5 */ public static function getClientInfo($id = null, $byName = false) { // Only create the array if it does not exist if (self::$_clients === null) { $obj = new stdClass; // Site Client $obj->id = 0; $obj->name = 'site'; $obj->path = JPATH_SITE; self::$_clients[0] = clone $obj; // Administrator Client $obj->id = 1; $obj->name = 'administrator'; $obj->path = JPATH_ADMINISTRATOR; self::$_clients[1] = clone $obj; // Installation Client $obj->id = 2; $obj->name = 'installation'; $obj->path = JPATH_INSTALLATION; self::$_clients[2] = clone $obj; } // If no client id has been passed return the whole array if (is_null($id)) { return self::$_clients; } // Are we looking for client information by id or by name? if (!$byName) { if (isset(self::$_clients[$id])) { return self::$_clients[$id]; } } else { foreach (self::$_clients as $client) { if ($client->name == strtolower($id)) { return $client; } } } return null; } /** * Adds information for a client. * * @param mixed $client A client identifier either an array or object * * @return boolean True if the information is added. False on error * * @since 1.6 */ public static function addClientInfo($client) { if (is_array($client)) { $client = (object) $client; } if (!is_object($client)) { return false; } $info = self::getClientInfo(); if (!isset($client->id)) { $client->id = count($info); } self::$_clients[$client->id] = clone $client; return true; } /** * Parse a XML install manifest file. * * XML Root tag should be 'install' except for languages which use meta file. * * @param string $path Full path to XML file. * * @return array XML metadata. * * @since 1.5 * @deprecated 4.0 Use JInstaller::parseXMLInstallFile instead. */ public static function parseXMLInstallFile($path) { JLog::add('JApplicationHelper::parseXMLInstallFile is deprecated. Use JInstaller::parseXMLInstallFile instead.', JLog::WARNING, 'deprecated'); return JInstaller::parseXMLInstallFile($path); } /** * Parse a XML language meta file. * * XML Root tag for languages which is meta file. * * @param string $path Full path to XML file. * * @return array XML metadata. * * @since 1.5 * @deprecated 4.0 Use JInstaller::parseXMLInstallFile instead. */ public static function parseXMLLangMetaFile($path) { JLog::add('JApplicationHelper::parseXMLLangMetaFile is deprecated. Use JInstaller::parseXMLInstallFile instead.', JLog::WARNING, 'deprecated'); // Read the file to see if it's a valid component XML file $xml = simplexml_load_file($path); if (!$xml) { return false; } /* * Check for a valid XML root tag. * * Should be 'metafile'. */ if ($xml->getName() != 'metafile') { unset($xml); return false; } $data = array(); $data['name'] = (string) $xml->name; $data['type'] = $xml->attributes()->type; $data['creationDate'] = ((string) $xml->creationDate) ? (string) $xml->creationDate : JText::_('JLIB_UNKNOWN'); $data['author'] = ((string) $xml->author) ? (string) $xml->author : JText::_('JLIB_UNKNOWN'); $data['copyright'] = (string) $xml->copyright; $data['authorEmail'] = (string) $xml->authorEmail; $data['authorUrl'] = (string) $xml->authorUrl; $data['version'] = (string) $xml->version; $data['description'] = (string) $xml->description; $data['group'] = (string) $xml->group; return $data; } } PK���\��CZ��libraries/platform.phpnu�[���<?php /** * @package Joomla.Platform * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Version information class for the Joomla Platform. * * @package Joomla.Platform * @since 11.1 */ final class JPlatform { // Product name. const PRODUCT = 'Joomla Platform'; // Release version. const RELEASE = '13.1'; // Maintenance version. const MAINTENANCE = '0'; // Development STATUS. const STATUS = 'Stable'; // Build number. const BUILD = 0; // Code name. const CODE_NAME = 'Curiosity'; // Release date. const RELEASE_DATE = '24-Apr-2013'; // Release time. const RELEASE_TIME = '00:00'; // Release timezone. const RELEASE_TIME_ZONE = 'GMT'; // Copyright Notice. const COPYRIGHT = 'Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.'; // Link text. const LINK_TEXT = '<a href="http://www.joomla.org">Joomla!</a> is Free Software released under the GNU General Public License.'; /** * Compares two a "PHP standardized" version number against the current Joomla Platform version. * * @param string $minimum The minimum version of the Joomla Platform which is compatible. * * @return boolean True if the version is compatible. * * @see http://www.php.net/version_compare * @since 11.1 */ public static function isCompatible($minimum) { return (version_compare(self::getShortVersion(), $minimum, 'eq') == 1); } /** * Gets a "PHP standardized" version string for the current Joomla Platform. * * @return string Version string. * * @since 11.1 */ public static function getShortVersion() { return self::RELEASE . '.' . self::MAINTENANCE; } /** * Gets a version string for the current Joomla Platform with all release information. * * @return string Complete version string. * * @since 11.1 */ public static function getLongVersion() { return self::PRODUCT . ' ' . self::RELEASE . '.' . self::MAINTENANCE . ' ' . self::STATUS . ' [ ' . self::CODE_NAME . ' ] ' . self::RELEASE_DATE . ' ' . self::RELEASE_TIME . ' ' . self::RELEASE_TIME_ZONE; } } PK���\���#�#"libraries/joomla/oauth2/client.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage OAuth2 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform class for interacting with an OAuth 2.0 server. * * @since 12.3 */ class JOAuth2Client { /** * @var Registry Options for the JOAuth2Client object. * @since 12.3 */ protected $options; /** * @var JHttp The HTTP client object to use in sending HTTP requests. * @since 12.3 */ protected $http; /** * @var JInput The input object to use in retrieving GET/POST data. * @since 12.3 */ protected $input; /** * @var JApplicationWeb The application object to send HTTP headers for redirects. * @since 12.3 */ protected $application; /** * Constructor. * * @param Registry $options JOAuth2Client options object * @param JHttp $http The HTTP client object * @param JInput $input The input object * @param JApplicationWeb $application The application object * * @since 12.3 */ public function __construct(Registry $options = null, JHttp $http = null, JInput $input = null, JApplicationWeb $application = null) { $this->options = isset($options) ? $options : new Registry; $this->http = isset($http) ? $http : new JHttp($this->options); $this->input = isset($input) ? $input : JFactory::getApplication()->input; $this->application = isset($application) ? $application : new JApplicationWeb; } /** * Get the access token or redict to the authentication URL. * * @return string The access token * * @since 12.3 * @throws RuntimeException */ public function authenticate() { if ($data['code'] = $this->input->get('code', false, 'raw')) { $data['grant_type'] = 'authorization_code'; $data['redirect_uri'] = $this->getOption('redirecturi'); $data['client_id'] = $this->getOption('clientid'); $data['client_secret'] = $this->getOption('clientsecret'); $response = $this->http->post($this->getOption('tokenurl'), $data); if ($response->code >= 200 && $response->code < 400) { if ($response->headers['Content-Type'] == 'application/json') { $token = array_merge(json_decode($response->body, true), array('created' => time())); } else { parse_str($response->body, $token); $token = array_merge($token, array('created' => time())); } $this->setToken($token); return $token; } else { throw new RuntimeException('Error code ' . $response->code . ' received requesting access token: ' . $response->body . '.'); } } if ($this->getOption('sendheaders')) { $this->application->redirect($this->createUrl()); } return false; } /** * Verify if the client has been authenticated * * @return boolean Is authenticated * * @since 12.3 */ public function isAuthenticated() { $token = $this->getToken(); if (!$token || !array_key_exists('access_token', $token)) { return false; } elseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20) { return false; } else { return true; } } /** * Create the URL for authentication. * * @return JHttpResponse The HTTP response * * @since 12.3 * @throws InvalidArgumentException */ public function createUrl() { if (!$this->getOption('authurl') || !$this->getOption('clientid')) { throw new InvalidArgumentException('Authorization URL and client_id are required'); } $url = $this->getOption('authurl'); if (strpos($url, '?')) { $url .= '&'; } else { $url .= '?'; } $url .= 'response_type=code'; $url .= '&client_id=' . urlencode($this->getOption('clientid')); if ($this->getOption('redirecturi')) { $url .= '&redirect_uri=' . urlencode($this->getOption('redirecturi')); } if ($this->getOption('scope')) { $scope = is_array($this->getOption('scope')) ? implode(' ', $this->getOption('scope')) : $this->getOption('scope'); $url .= '&scope=' . urlencode($scope); } if ($this->getOption('state')) { $url .= '&state=' . urlencode($this->getOption('state')); } if (is_array($this->getOption('requestparams'))) { foreach ($this->getOption('requestparams') as $key => $value) { $url .= '&' . $key . '=' . urlencode($value); } } return $url; } /** * Send a signed Oauth request. * * @param string $url The URL forf the request. * @param mixed $data The data to include in the request * @param array $headers The headers to send with the request * @param string $method The method with which to send the request * @param int $timeout The timeout for the request * * @return string The URL. * * @since 12.3 * @throws InvalidArgumentException * @throws RuntimeException */ public function query($url, $data = null, $headers = array(), $method = 'get', $timeout = null) { $token = $this->getToken(); if (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20) { if (!$this->getOption('userefresh')) { return false; } $token = $this->refreshToken($token['refresh_token']); } if (!$this->getOption('authmethod') || $this->getOption('authmethod') == 'bearer') { $headers['Authorization'] = 'Bearer ' . $token['access_token']; } elseif ($this->getOption('authmethod') == 'get') { if (strpos($url, '?')) { $url .= '&'; } else { $url .= '?'; } $url .= $this->getOption('getparam') ? $this->getOption('getparam') : 'access_token'; $url .= '=' . $token['access_token']; } switch ($method) { case 'head': case 'get': case 'delete': case 'trace': $response = $this->http->$method($url, $headers, $timeout); break; case 'post': case 'put': case 'patch': $response = $this->http->$method($url, $data, $headers, $timeout); break; default: throw new InvalidArgumentException('Unknown HTTP request method: ' . $method . '.'); } if ($response->code < 200 || $response->code >= 400) { throw new RuntimeException('Error code ' . $response->code . ' received requesting data: ' . $response->body . '.'); } return $response; } /** * Get an option from the JOAuth2Client instance. * * @param string $key The name of the option to get * * @return mixed The option value * * @since 12.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JOAuth2Client instance. * * @param string $key The name of the option to set * @param mixed $value The option value to set * * @return JOAuth2Client This object for method chaining * * @since 12.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } /** * Get the access token from the JOAuth2Client instance. * * @return array The access token * * @since 12.3 */ public function getToken() { return $this->getOption('accesstoken'); } /** * Set an option for the JOAuth2Client instance. * * @param array $value The access token * * @return JOAuth2Client This object for method chaining * * @since 12.3 */ public function setToken($value) { if (is_array($value) && !array_key_exists('expires_in', $value) && array_key_exists('expires', $value)) { $value['expires_in'] = $value['expires']; unset($value['expires']); } $this->setOption('accesstoken', $value); return $this; } /** * Refresh the access token instance. * * @param string $token The refresh token * * @return array The new access token * * @since 12.3 * @throws Exception * @throws RuntimeException */ public function refreshToken($token = null) { if (!$this->getOption('userefresh')) { throw new RuntimeException('Refresh token is not supported for this OAuth instance.'); } if (!$token) { $token = $this->getToken(); if (!array_key_exists('refresh_token', $token)) { throw new RuntimeException('No refresh token is available.'); } $token = $token['refresh_token']; } $data['grant_type'] = 'refresh_token'; $data['refresh_token'] = $token; $data['client_id'] = $this->getOption('clientid'); $data['client_secret'] = $this->getOption('clientsecret'); $response = $this->http->post($this->getOption('tokenurl'), $data); if ($response->code >= 200 || $response->code < 400) { if ($response->headers['Content-Type'] == 'application/json') { $token = array_merge(json_decode($response->body, true), array('created' => time())); } else { parse_str($response->body, $token); $token = array_merge($token, array('created' => time())); } $this->setToken($token); return $token; } else { throw new Exception('Error code ' . $response->code . ' received refreshing token: ' . $response->body . '.'); } } } PK���\T� ���libraries/joomla/input/json.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Input * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Input JSON Class * * This class decodes a JSON string from the raw request data and makes it available via * the standard JInput interface. * * @since 12.2 */ class JInputJSON extends JInput { /** * @var string The raw JSON string from the request. * @since 12.2 */ private $_raw; /** * Constructor. * * @param array $source Source data (Optional, default is the raw HTTP input decoded from JSON) * @param array $options Array of configuration parameters (Optional) * * @since 12.2 */ public function __construct(array $source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = JFilterInput::getInstance(); } if (is_null($source)) { $this->_raw = file_get_contents('php://input'); $this->data = json_decode($this->_raw, true); } else { $this->data = & $source; } // Set the options for the class. $this->options = $options; } /** * Gets the raw JSON string from the request. * * @return string The raw JSON string from the request. * * @since 12.2 */ public function getRaw() { return $this->_raw; } } PK���\�V�''libraries/joomla/input/cli.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Input * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Input CLI Class * * @since 11.1 */ class JInputCli extends JInput { /** * The executable that was called to run the CLI script. * * @var string * @since 11.1 */ public $executable; /** * The additional arguments passed to the script that are not associated * with a specific argument name. * * @var array * @since 11.1 */ public $args = array(); /** * Constructor. * * @param array $source Source data (Optional, default is $_REQUEST) * @param array $options Array of configuration parameters (Optional) * * @since 11.1 */ public function __construct(array $source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = JFilterInput::getInstance(); } // Get the command line options $this->parseArguments(); // Set the options for the class. $this->options = $options; } /** * Method to serialize the input. * * @return string The serialized input. * * @since 12.1 */ public function serialize() { // Load all of the inputs. $this->loadAllInputs(); // Remove $_ENV and $_SERVER from the inputs. $inputs = $this->inputs; unset($inputs['env']); unset($inputs['server']); // Serialize the executable, args, options, data, and inputs. return serialize(array($this->executable, $this->args, $this->options, $this->data, $inputs)); } /** * Method to unserialize the input. * * @param string $input The serialized input. * * @return JInput The input object. * * @since 12.1 */ public function unserialize($input) { // Unserialize the executable, args, options, data, and inputs. list($this->executable, $this->args, $this->options, $this->data, $this->inputs) = unserialize($input); // Load the filter. if (isset($this->options['filter'])) { $this->filter = $this->options['filter']; } else { $this->filter = JFilterInput::getInstance(); } } /** * Initialise the options and arguments * * Not supported: -abc c-value * * @return void * * @since 11.1 */ protected function parseArguments() { $argv = $_SERVER['argv']; $this->executable = array_shift($argv); $out = array(); for ($i = 0, $j = count($argv); $i < $j; $i++) { $arg = $argv[$i]; // --foo --bar=baz if (substr($arg, 0, 2) === '--') { $eqPos = strpos($arg, '='); // --foo if ($eqPos === false) { $key = substr($arg, 2); // --foo value if ($i + 1 < $j && $argv[$i + 1][0] !== '-') { $value = $argv[$i + 1]; $i++; } else { $value = isset($out[$key]) ? $out[$key] : true; } $out[$key] = $value; } // --bar=baz else { $key = substr($arg, 2, $eqPos - 2); $value = substr($arg, $eqPos + 1); $out[$key] = $value; } } elseif (substr($arg, 0, 1) === '-') // -k=value -abc { // -k=value if (substr($arg, 2, 1) === '=') { $key = substr($arg, 1, 1); $value = substr($arg, 3); $out[$key] = $value; } else // -abc { $chars = str_split(substr($arg, 1)); foreach ($chars as $char) { $key = $char; $value = isset($out[$key]) ? $out[$key] : true; $out[$key] = $value; } // -a a-value if ((count($chars) === 1) && ($i + 1 < $j) && ($argv[$i + 1][0] !== '-')) { $out[$key] = $argv[$i + 1]; $i++; } } } else { // Plain-arg $this->args[] = $arg; } } $this->data = $out; } } PK���\o+��� libraries/joomla/input/files.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Input * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Input Files Class * * @since 11.1 */ class JInputFiles extends JInput { /** * The pivoted data from a $_FILES or compatible array. * * @var array * @since 11.1 */ protected $decodedData = array(); /** * The class constructor. * * @param array $source The source argument is ignored. $_FILES is always used. * @param array $options An optional array of configuration options: * filter : a custom JFilterInput object. * * @since 12.1 */ public function __construct(array $source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = JFilterInput::getInstance(); } // Set the data source. $this->data = & $_FILES; // Set the options for the class. $this->options = $options; } /** * Gets a value from the input data. * * @param string $name The name of the input property (usually the name of the files INPUT tag) to get. * @param mixed $default The default value to return if the named property does not exist. * @param string $filter The filter to apply to the value. * * @return mixed The filtered input value. * * @see JFilterInput::clean() * @since 11.1 */ public function get($name, $default = null, $filter = 'cmd') { if (isset($this->data[$name])) { $results = $this->decodeData( array( $this->data[$name]['name'], $this->data[$name]['type'], $this->data[$name]['tmp_name'], $this->data[$name]['error'], $this->data[$name]['size'] ) ); // Prevent returning an unsafe file unless speciffically requested if ($filter != 'raw') { $isSafe = JFilterInput::isSafeFile($results); if (!$isSafe) { return $default; } } return $results; } return $default; } /** * Method to decode a data array. * * @param array $data The data array to decode. * * @return array * * @since 11.1 */ protected function decodeData(array $data) { $result = array(); if (is_array($data[0])) { foreach ($data[0] as $k => $v) { $result[$k] = $this->decodeData(array($data[0][$k], $data[1][$k], $data[2][$k], $data[3][$k], $data[4][$k])); } return $result; } return array('name' => $data[0], 'type' => $data[1], 'tmp_name' => $data[2], 'error' => $data[3], 'size' => $data[4]); } /** * Sets a value. * * @param string $name The name of the input property to set. * @param mixed $value The value to assign to the input property. * * @return void * * @since 11.1 */ public function set($name, $value) { } } PK���\� /��!libraries/joomla/input/cookie.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Input * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Input Cookie Class * * @since 11.1 */ class JInputCookie extends JInput { /** * Constructor. * * @param array $source Ignored. * @param array $options Array of configuration parameters (Optional) * * @since 11.1 */ public function __construct(array $source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = JFilterInput::getInstance(); } // Set the data source. $this->data = & $_COOKIE; // Set the options for the class. $this->options = $options; } /** * Sets a value * * @param string $name Name of the value to set. * @param mixed $value Value to assign to the input. * @param integer $expire The time the cookie expires. This is a Unix timestamp so is in number * of seconds since the epoch. In other words, you'll most likely set this * with the time() function plus the number of seconds before you want it * to expire. Or you might use mktime(). time()+60*60*24*30 will set the * cookie to expire in 30 days. If set to 0, or omitted, the cookie will * expire at the end of the session (when the browser closes). * @param string $path The path on the server in which the cookie will be available on. If set * to '/', the cookie will be available within the entire domain. If set to * '/foo/', the cookie will only be available within the /foo/ directory and * all sub-directories such as /foo/bar/ of domain. The default value is the * current directory that the cookie is being set in. * @param string $domain The domain that the cookie is available to. To make the cookie available * on all subdomains of example.com (including example.com itself) then you'd * set it to '.example.com'. Although some browsers will accept cookies without * the initial ., RFC 2109 requires it to be included. Setting the domain to * 'www.example.com' or '.www.example.com' will make the cookie only available * in the www subdomain. * @param boolean $secure Indicates that the cookie should only be transmitted over a secure HTTPS * connection from the client. When set to TRUE, the cookie will only be set * if a secure connection exists. On the server-side, it's on the programmer * to send this kind of cookie only on secure connection (e.g. with respect * to $_SERVER["HTTPS"]). * @param boolean $httpOnly When TRUE the cookie will be made accessible only through the HTTP protocol. * This means that the cookie won't be accessible by scripting languages, such * as JavaScript. This setting can effectively help to reduce identity theft * through XSS attacks (although it is not supported by all browsers). * * @return void * * @link http://www.ietf.org/rfc/rfc2109.txt * @see setcookie() * @since 11.1 */ public function set($name, $value, $expire = 0, $path = '', $domain = '', $secure = false, $httpOnly = false) { setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly); $this->data[$name] = $value; } } PK���\$�l�'�' libraries/joomla/input/input.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Input * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Input Base Class * * This is an abstracted input class used to manage retrieving data from the application environment. * * @since 11.1 * * @property-read JInput $get * @property-read JInput $post * @property-read JInput $request * @property-read JInput $server * @property-read JInputFiles $files * @property-read JInputCookie $cookie * * @method integer getInt() getInt($name, $default = null) Get a signed integer. * @method integer getUint() getUint($name, $default = null) Get an unsigned integer. * @method float getFloat() getFloat($name, $default = null) Get a floating-point number. * @method boolean getBool() getBool($name, $default = null) Get a boolean. * @method string getWord() getWord($name, $default = null) * @method string getAlnum() getAlnum($name, $default = null) * @method string getCmd() getCmd($name, $default = null) * @method string getBase64() getBase64($name, $default = null) * @method string getString() getString($name, $default = null) * @method string getHtml() getHtml($name, $default = null) * @method string getPath() getPath($name, $default = null) * @method string getUsername() getUsername($name, $default = null) */ class JInput implements Serializable, Countable { /** * Options array for the JInput instance. * * @var array * @since 11.1 */ protected $options = array(); /** * Filter object to use. * * @var JFilterInput * @since 11.1 */ protected $filter = null; /** * Input data. * * @var array * @since 11.1 */ protected $data = array(); /** * Input objects * * @var array * @since 11.1 */ protected $inputs = array(); /** * Constructor. * * @param array $source Source data (Optional, default is $_REQUEST) * @param array $options Array of configuration parameters (Optional) * * @since 11.1 */ public function __construct($source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = JFilterInput::getInstance(); } if (is_null($source)) { $this->data = &$_REQUEST; } else { $this->data = $source; } // Set the options for the class. $this->options = $options; } /** * Magic method to get an input object * * @param mixed $name Name of the input object to retrieve. * * @return JInput The request input object * * @since 11.1 */ public function __get($name) { if (isset($this->inputs[$name])) { return $this->inputs[$name]; } $className = 'JInput' . ucfirst($name); if (class_exists($className)) { $this->inputs[$name] = new $className(null, $this->options); return $this->inputs[$name]; } $superGlobal = '_' . strtoupper($name); if (isset($GLOBALS[$superGlobal])) { $this->inputs[$name] = new JInput($GLOBALS[$superGlobal], $this->options); return $this->inputs[$name]; } // TODO throw an exception } /** * Get the number of variables. * * @return integer The number of variables in the input. * * @since 12.2 * @see Countable::count() */ public function count() { return count($this->data); } /** * Gets a value from the input data. * * @param string $name Name of the value to get. * @param mixed $default Default value to return if variable does not exist. * @param string $filter Filter to apply to the value. * * @return mixed The filtered input value. * * @since 11.1 */ public function get($name, $default = null, $filter = 'cmd') { if (isset($this->data[$name])) { return $this->filter->clean($this->data[$name], $filter); } return $default; } /** * Gets an array of values from the request. * * @param array $vars Associative array of keys and filter types to apply. * If empty and datasource is null, all the input data will be returned * but filtered using the filter given by the parameter defaultFilter in * JFilterInput::clean. * @param mixed $datasource Array to retrieve data from, or null. * @param string $defaultFilter Default filter used in JFilterInput::clean if vars is empty and * datasource is null. If 'unknown', the default case is used in * JFilterInput::clean. * * @return mixed The filtered input data. * * @since 11.1 */ public function getArray(array $vars = array(), $datasource = null, $defaultFilter = 'unknown') { return $this->getArrayRecursive($vars, $datasource, $defaultFilter, false); } /** * Gets an array of values from the request. * * @param array $vars Associative array of keys and filter types to apply. * If empty and datasource is null, all the input data will be returned * but filtered using the filter given by the parameter defaultFilter in * JFilterInput::clean. * @param mixed $datasource Array to retrieve data from, or null. * @param string $defaultFilter Default filter used in JFilterInput::clean if vars is empty and * datasource is null. If 'unknown', the default case is used in * JFilterInput::clean. * @param bool $recursion Flag to indicate a recursive function call. * * @return mixed The filtered input data. * * @since 3.4.2 */ protected function getArrayRecursive(array $vars = array(), $datasource = null, $defaultFilter = 'unknown', $recursion = false) { if (empty($vars) && is_null($datasource)) { $vars = $this->data; } else { if (!$recursion) { $defaultFilter = null; } } $results = array(); foreach ($vars as $k => $v) { if (is_array($v)) { if (is_null($datasource)) { $results[$k] = $this->getArrayRecursive($v, $this->get($k, null, 'array'), $defaultFilter, true); } else { $results[$k] = $this->getArrayRecursive($v, $datasource[$k], $defaultFilter, true); } } else { $filter = isset($defaultFilter) ? $defaultFilter : $v; if (is_null($datasource)) { $results[$k] = $this->get($k, null, $filter); } elseif (isset($datasource[$k])) { $results[$k] = $this->filter->clean($datasource[$k], $filter); } else { $results[$k] = $this->filter->clean(null, $filter); } } } return $results; } /** * Sets a value * * @param string $name Name of the value to set. * @param mixed $value Value to assign to the input. * * @return void * * @since 11.1 */ public function set($name, $value) { $this->data[$name] = $value; } /** * Define a value. The value will only be set if there's no value for the name or if it is null. * * @param string $name Name of the value to define. * @param mixed $value Value to assign to the input. * * @return void * * @since 12.1 */ public function def($name, $value) { if (isset($this->data[$name])) { return; } $this->data[$name] = $value; } /** * Magic method to get filtered input data. * * @param string $name Name of the filter type prefixed with 'get'. * @param array $arguments [0] The name of the variable [1] The default value. * * @return mixed The filtered input value. * * @since 11.1 */ public function __call($name, $arguments) { if (substr($name, 0, 3) == 'get') { $filter = substr($name, 3); $default = null; if (isset($arguments[1])) { $default = $arguments[1]; } return $this->get($arguments[0], $default, $filter); } } /** * Gets the request method. * * @return string The request method. * * @since 11.1 */ public function getMethod() { // Get method if exist $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ''; $method = strtoupper($method); return $method; } /** * Method to serialize the input. * * @return string The serialized input. * * @since 12.1 */ public function serialize() { // Load all of the inputs. $this->loadAllInputs(); // Remove $_ENV and $_SERVER from the inputs. $inputs = $this->inputs; unset($inputs['env']); unset($inputs['server']); // Serialize the options, data, and inputs. return serialize(array($this->options, $this->data, $inputs)); } /** * Method to unserialize the input. * * @param string $input The serialized input. * * @return JInput The input object. * * @since 12.1 */ public function unserialize($input) { // Unserialize the options, data, and inputs. list($this->options, $this->data, $this->inputs) = unserialize($input); // Load the filter. if (isset($this->options['filter'])) { $this->filter = $this->options['filter']; } else { $this->filter = JFilterInput::getInstance(); } } /** * Method to load all of the global inputs. * * @return void * * @since 12.1 */ protected function loadAllInputs() { static $loaded = false; if (!$loaded) { // Load up all the globals. foreach ($GLOBALS as $global => $data) { // Check if the global starts with an underscore. if (strpos($global, '_') === 0) { // Convert global name to input name. $global = strtolower($global); $global = substr($global, 1); // Get the input. $this->$global; } } $loaded = true; } } } PK���\��R1A0A0libraries/joomla/data/set.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Data * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDataSet is a collection class that allows the developer to operate on a set of JData objects as if they were in a * typical PHP array. * * @since 12.3 */ class JDataSet implements JDataDumpable, ArrayAccess, Countable, Iterator { /** * The current position of the iterator. * * @var integer * @since 12.3 */ private $_current = false; /** * The iterator objects. * * @var array * @since 12.3 */ private $_objects = array(); /** * The class constructor. * * @param array $objects An array of JData objects to bind to the data set. * * @since 12.3 * @throws InvalidArgumentException if an object is not an instance of JData. */ public function __construct(array $objects = array()) { // Set the objects. $this->_initialise($objects); } /** * The magic call method is used to call object methods using the iterator. * * Example: $array = $objectList->foo('bar'); * * The object list will iterate over its objects and see if each object has a callable 'foo' method. * If so, it will pass the argument list and assemble any return values. If an object does not have * a callable method no return value is recorded. * The keys of the objects and the result array are maintained. * * @param string $method The name of the method called. * @param array $arguments The arguments of the method called. * * @return array An array of values returned by the methods called on the objects in the data set. * * @since 12.3 */ public function __call($method, $arguments = array()) { $return = array(); // Iterate through the objects. foreach ($this->_objects as $key => $object) { // Create the object callback. $callback = array($object, $method); // Check if the callback is callable. if (is_callable($callback)) { // Call the method for the object. $return[$key] = call_user_func_array($callback, $arguments); } } return $return; } /** * The magic get method is used to get a list of properties from the objects in the data set. * * Example: $array = $dataSet->foo; * * This will return a column of the values of the 'foo' property in all the objects * (or values determined by custom property setters in the individual JData's). * The result array will contain an entry for each object in the list (compared to __call which may not). * The keys of the objects and the result array are maintained. * * @param string $property The name of the data property. * * @return array An associative array of the values. * * @since 12.3 */ public function __get($property) { $return = array(); // Iterate through the objects. foreach ($this->_objects as $key => $object) { // Get the property. $return[$key] = $object->$property; } return $return; } /** * The magic isset method is used to check the state of an object property using the iterator. * * Example: $array = isset($objectList->foo); * * @param string $property The name of the property. * * @return boolean True if the property is set in any of the objects in the data set. * * @since 12.3 */ public function __isset($property) { $return = array(); // Iterate through the objects. foreach ($this->_objects as $object) { // Check the property. $return[] = isset($object->$property); } return in_array(true, $return, true) ? true : false; } /** * The magic set method is used to set an object property using the iterator. * * Example: $objectList->foo = 'bar'; * * This will set the 'foo' property to 'bar' in all of the objects * (or a value determined by custom property setters in the JData). * * @param string $property The name of the property. * @param mixed $value The value to give the data property. * * @return void * * @since 12.3 */ public function __set($property, $value) { // Iterate through the objects. foreach ($this->_objects as $object) { // Set the property. $object->$property = $value; } } /** * The magic unset method is used to unset an object property using the iterator. * * Example: unset($objectList->foo); * * This will unset all of the 'foo' properties in the list of JData's. * * @param string $property The name of the property. * * @return void * * @since 12.3 */ public function __unset($property) { // Iterate through the objects. foreach ($this->_objects as $object) { unset($object->$property); } } /** * Gets the number of data objects in the set. * * @return integer The number of objects. * * @since 12.3 */ public function count() { return count($this->_objects); } /** * Clears the objects in the data set. * * @return JDataSet Returns itself to allow chaining. * * @since 12.3 */ public function clear() { $this->_objects = array(); $this->rewind(); return $this; } /** * Get the current data object in the set. * * @return JData The current object, or false if the array is empty or the pointer is beyond the end of the elements. * * @since 12.3 */ public function current() { return is_scalar($this->_current) ? $this->_objects[$this->_current] : false; } /** * Dumps the data object in the set, recursively if appropriate. * * @param integer $depth The maximum depth of recursion (default = 3). * For example, a depth of 0 will return a stdClass with all the properties in native * form. A depth of 1 will recurse into the first level of properties only. * @param SplObjectStorage $dumped An array of already serialized objects that is used to avoid infinite loops. * * @return array An associative array of the date objects in the set, dumped as a simple PHP stdClass object. * * @see JData::dump() * @since 12.3 */ public function dump($depth = 3, SplObjectStorage $dumped = null) { // Check if we should initialise the recursion tracker. if ($dumped === null) { $dumped = new SplObjectStorage; } // Add this object to the dumped stack. $dumped->attach($this); $objects = array(); // Make sure that we have not reached our maximum depth. if ($depth > 0) { // Handle JSON serialization recursively. foreach ($this->_objects as $key => $object) { $objects[$key] = $object->dump($depth, $dumped); } } return $objects; } /** * Gets the data set in a form that can be serialised to JSON format. * * Note that this method will not return an associative array, otherwise it would be encoded into an object. * JSON decoders do not consistently maintain the order of associative keys, whereas they do maintain the order of arrays. * * @param mixed $serialized An array of objects that have already been serialized that is used to infinite loops * (null on first call). * * @return array An array that can be serialised by json_encode(). * * @since 12.3 */ public function jsonSerialize($serialized = null) { // Check if we should initialise the recursion tracker. if ($serialized === null) { $serialized = array(); } // Add this object to the serialized stack. $serialized[] = spl_object_hash($this); $return = array(); // Iterate through the objects. foreach ($this->_objects as $object) { // Call the method for the object. $return[] = $object->jsonSerialize($serialized); } return $return; } /** * Gets the key of the current object in the iterator. * * @return scalar The object key on success; null on failure. * * @since 12.3 */ public function key() { return $this->_current; } /** * Gets the array of keys for all the objects in the iterator (emulates array_keys). * * @return array The array of keys * * @since 12.3 */ public function keys() { return array_keys($this->_objects); } /** * Advances the iterator to the next object in the iterator. * * @return void * * @since 12.3 */ public function next() { // Get the object offsets. $keys = $this->keys(); // Check if _current has been set to false but offsetUnset. if ($this->_current === false && isset($keys[0])) { // This is a special case where offsetUnset was used in a foreach loop and the first element was unset. $this->_current = $keys[0]; } else { // Get the current key. $position = array_search($this->_current, $keys); // Check if there is an object after the current object. if ($position !== false && isset($keys[$position + 1])) { // Get the next id. $this->_current = $keys[$position + 1]; } else { // That was the last object or the internal properties have become corrupted. $this->_current = null; } } } /** * Checks whether an offset exists in the iterator. * * @param mixed $offset The object offset. * * @return boolean True if the object exists, false otherwise. * * @since 12.3 */ public function offsetExists($offset) { return isset($this->_objects[$offset]); } /** * Gets an offset in the iterator. * * @param mixed $offset The object offset. * * @return JData The object if it exists, null otherwise. * * @since 12.3 */ public function offsetGet($offset) { return isset($this->_objects[$offset]) ? $this->_objects[$offset] : null; } /** * Sets an offset in the iterator. * * @param mixed $offset The object offset. * @param JData $object The object object. * * @return void * * @since 12.3 * @throws InvalidArgumentException if an object is not an instance of JData. */ public function offsetSet($offset, $object) { // Check if the object is a JData object. if (!($object instanceof JData)) { throw new InvalidArgumentException(sprintf('%s("%s", *%s*)', __METHOD__, $offset, gettype($object))); } // Set the offset. $this->_objects[$offset] = $object; } /** * Unsets an offset in the iterator. * * @param mixed $offset The object offset. * * @return void * * @since 12.3 */ public function offsetUnset($offset) { if (!$this->offsetExists($offset)) { // Do nothing if the offset does not exist. return; } // Check for special handling of unsetting the current position. if ($offset == $this->_current) { // Get the current position. $keys = $this->keys(); $position = array_search($this->_current, $keys); // Check if there is an object before the current object. if ($position > 0) { // Move the current position back one. $this->_current = $keys[$position - 1]; } else { // We are at the start of the keys AND let's assume we are in a foreach loop and `next` is going to be called. $this->_current = false; } } unset($this->_objects[$offset]); } /** * Rewinds the iterator to the first object. * * @return void * * @since 12.3 */ public function rewind() { // Set the current position to the first object. if (empty($this->_objects)) { $this->_current = false; } else { $keys = $this->keys(); $this->_current = array_shift($keys); } } /** * Validates the iterator. * * @return boolean True if valid, false otherwise. * * @since 12.3 */ public function valid() { // Check the current position. if (!is_scalar($this->_current) || !isset($this->_objects[$this->_current])) { return false; } return true; } /** * Initialises the list with an array of objects. * * @param array $input An array of objects. * * @return void * * @since 12.3 * @throws InvalidArgumentException if an object is not an instance of JData. */ private function _initialise(array $input = array()) { foreach ($input as $key => $object) { if (!is_null($object)) { $this->offsetSet($key, $object); } } $this->rewind(); } } PK���\t:̝1"1"libraries/joomla/data/data.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Data * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * JData is a class that is used to store data but allowing you to access the data * by mimicking the way PHP handles class properties. * * @since 12.3 */ class JData implements JDataDumpable, IteratorAggregate, JsonSerializable, Countable { /** * The data properties. * * @var array * @since 12.3 */ private $_properties = array(); /** * The class constructor. * * @param mixed $properties Either an associative array or another object * by which to set the initial properties of the new object. * * @since 12.3 * @throws InvalidArgumentException */ public function __construct($properties = array()) { // Check the properties input. if (!empty($properties)) { // Bind the properties. $this->bind($properties); } } /** * The magic get method is used to get a data property. * * This method is a public proxy for the protected getProperty method. * * Note: Magic __get does not allow recursive calls. This can be tricky because the error generated by recursing into * __get is "Undefined property: {CLASS}::{PROPERTY}" which is misleading. This is relevant for this class because * requesting a non-visible property can trigger a call to a sub-function. If that references the property directly in * the object, it will cause a recursion into __get. * * @param string $property The name of the data property. * * @return mixed The value of the data property, or null if the data property does not exist. * * @see JData::getProperty() * @since 12.3 */ public function __get($property) { return $this->getProperty($property); } /** * The magic isset method is used to check the state of an object property. * * @param string $property The name of the data property. * * @return boolean True if set, otherwise false is returned. * * @since 12.3 */ public function __isset($property) { return isset($this->_properties[$property]); } /** * The magic set method is used to set a data property. * * This is a public proxy for the protected setProperty method. * * @param string $property The name of the data property. * @param mixed $value The value to give the data property. * * @return void * * @see JData::setProperty() * @since 12.3 */ public function __set($property, $value) { $this->setProperty($property, $value); } /** * The magic unset method is used to unset a data property. * * @param string $property The name of the data property. * * @return void * * @since 12.3 */ public function __unset($property) { unset($this->_properties[$property]); } /** * Binds an array or object to this object. * * @param mixed $properties An associative array of properties or an object. * @param boolean $updateNulls True to bind null values, false to ignore null values. * * @return JData Returns itself to allow chaining. * * @since 12.3 * @throws InvalidArgumentException */ public function bind($properties, $updateNulls = true) { // Check the properties data type. if (!is_array($properties) && !is_object($properties)) { throw new InvalidArgumentException(sprintf('%s(%s)', __METHOD__, gettype($properties))); } // Check if the object is traversable. if ($properties instanceof Traversable) { // Convert iterator to array. $properties = iterator_to_array($properties); } // Check if the object needs to be converted to an array. elseif (is_object($properties)) { // Convert properties to an array. $properties = (array) $properties; } // Bind the properties. foreach ($properties as $property => $value) { // Check if the value is null and should be bound. if ($value === null && !$updateNulls) { continue; } // Set the property. $this->setProperty($property, $value); } return $this; } /** * Dumps the data properties into a stdClass object, recursively if appropriate. * * @param integer $depth The maximum depth of recursion (default = 3). * For example, a depth of 0 will return a stdClass with all the properties in native * form. A depth of 1 will recurse into the first level of properties only. * @param SplObjectStorage $dumped An array of already serialized objects that is used to avoid infinite loops. * * @return stdClass The data properties as a simple PHP stdClass object. * * @since 12.3 */ public function dump($depth = 3, SplObjectStorage $dumped = null) { // Check if we should initialise the recursion tracker. if ($dumped === null) { $dumped = new SplObjectStorage; } // Add this object to the dumped stack. $dumped->attach($this); // Setup a container. $dump = new stdClass; // Dump all object properties. foreach (array_keys($this->_properties) as $property) { // Get the property. $dump->$property = $this->dumpProperty($property, $depth, $dumped); } return $dump; } /** * Gets this object represented as an ArrayIterator. * * This allows the data properties to be access via a foreach statement. * * @return ArrayIterator This object represented as an ArrayIterator. * * @see IteratorAggregate::getIterator() * @since 12.3 */ public function getIterator() { return new ArrayIterator($this->dump(0)); } /** * Gets the data properties in a form that can be serialised to JSON format. * * @return string An object that can be serialised by json_encode(). * * @since 12.3 */ public function jsonSerialize() { return $this->dump(); } /** * Dumps a data property. * * If recursion is set, this method will dump any object implementing JDumpable (like JData and JDataSet); it will * convert a JDate object to a string; and it will convert a Registry to an object. * * @param string $property The name of the data property. * @param integer $depth The current depth of recursion (a value of 0 will ignore recursion). * @param SplObjectStorage $dumped An array of already serialized objects that is used to avoid infinite loops. * * @return mixed The value of the dumped property. * * @since 12.3 */ protected function dumpProperty($property, $depth, SplObjectStorage $dumped) { $value = $this->getProperty($property); if ($depth > 0) { // Check if the object is also an dumpable object. if ($value instanceof JDataDumpable) { // Do not dump the property if it has already been dumped. if (!$dumped->contains($value)) { $value = $value->dump($depth - 1, $dumped); } } // Check if the object is a date. if ($value instanceof JDate) { $value = (string) $value; } // Check if the object is a registry. elseif ($value instanceof Registry) { $value = $value->toObject(); } } return $value; } /** * Gets a data property. * * @param string $property The name of the data property. * * @return mixed The value of the data property. * * @see JData::__get() * @since 12.3 */ protected function getProperty($property) { // Get the raw value. $value = array_key_exists($property, $this->_properties) ? $this->_properties[$property] : null; return $value; } /** * Sets a data property. * * If the name of the property starts with a null byte, this method will return null. * * @param string $property The name of the data property. * @param mixed $value The value to give the data property. * * @return mixed The value of the data property. * * @see JData::__set() * @since 12.3 */ protected function setProperty($property, $value) { /* * Check if the property starts with a null byte. If so, discard it because a later attempt to try to access it * can cause a fatal error. See http://us3.php.net/manual/en/language.types.array.php#language.types.array.casting */ if (strpos($property, "\0") === 0) { return null; } // Set the value. $this->_properties[$property] = $value; return $value; } /** * Count the number of data properties. * * @return integer The number of data properties. * * @since 12.3 */ public function count() { return count($this->_properties); } } PK���\���.."libraries/joomla/data/dumpable.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Data * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * An interface to define if an object is dumpable. * * @since 12.3 */ interface JDataDumpable { /** * Dumps the object properties into a stdClass object, recursively if appropriate. * * @param integer $depth The maximum depth of recursion. * For example, a depth of 0 will return a stdClass with all the properties in native * form. A depth of 1 will recurse into the first level of properties only. * @param SplObjectStorage $dumped An array of already serialized objects that is used to avoid infinite loops. * * @return stdClass The data properties as a simple PHP stdClass object. * * @since 12.3 */ public function dump($depth = 3, SplObjectStorage $dumped = null); } PK���\����"�"libraries/joomla/uri/uri.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Uri * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Uri\Uri; /** * JUri Class * * This class serves two purposes. First it parses a URI and provides a common interface * for the Joomla Platform to access and manipulate a URI. Second it obtains the URI of * the current executing script from the server regardless of server. * * @since 11.1 */ class JUri extends Uri { /** * @var JUri[] An array of JUri instances. * @since 11.1 */ protected static $instances = array(); /** * @var array The current calculated base url segments. * @since 11.1 */ protected static $base = array(); /** * @var array The current calculated root url segments. * @since 11.1 */ protected static $root = array(); /** * @var string The current url. * @since 11.1 */ protected static $current; /** * Returns the global JUri object, only creating it if it doesn't already exist. * * @param string $uri The URI to parse. [optional: if null uses script URI] * * @return JUri The URI object. * * @since 11.1 */ public static function getInstance($uri = 'SERVER') { if (empty(static::$instances[$uri])) { // Are we obtaining the URI from the server? if ($uri == 'SERVER') { // Determine if the request was over SSL (HTTPS). if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) { $https = 's://'; } else { $https = '://'; } /* * Since we are assigning the URI from the server variables, we first need * to determine if we are running on apache or IIS. If PHP_SELF and REQUEST_URI * are present, we will assume we are running on apache. */ if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) { // To build the entire URI we need to prepend the protocol, and the http host // to the URI string. $theURI = 'http' . $https . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; } else { /* * Since we do not have REQUEST_URI to work with, we will assume we are * running on IIS and will therefore need to work some magic with the SCRIPT_NAME and * QUERY_STRING environment variables. * * IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS */ $theURI = 'http' . $https . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; // If the query string exists append it to the URI string if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { $theURI .= '?' . $_SERVER['QUERY_STRING']; } } // Extra cleanup to remove invalid chars in the URL to prevent injections through the Host header $theURI = str_replace(array("'", '"', '<', '>'), array("%27", "%22", "%3C", "%3E"), $theURI); } else { // We were given a URI $theURI = $uri; } static::$instances[$uri] = new static($theURI); } return static::$instances[$uri]; } /** * Returns the base URI for the request. * * @param boolean $pathonly If false, prepend the scheme, host and port information. Default is false. * * @return string The base URI string * * @since 11.1 */ public static function base($pathonly = false) { // Get the base request path. if (empty(static::$base)) { $config = JFactory::getConfig(); $uri = static::getInstance(); $live_site = ($uri->isSsl()) ? str_replace("http://", "https://", $config->get('live_site')) : $config->get('live_site'); if (trim($live_site) != '') { $uri = static::getInstance($live_site); static::$base['prefix'] = $uri->toString(array('scheme', 'host', 'port')); static::$base['path'] = rtrim($uri->toString(array('path')), '/\\'); if (defined('JPATH_BASE') && defined('JPATH_ADMINISTRATOR')) { if (JPATH_BASE == JPATH_ADMINISTRATOR) { static::$base['path'] .= '/administrator'; } } } else { static::$base['prefix'] = $uri->toString(array('scheme', 'host', 'port')); if (strpos(php_sapi_name(), 'cgi') !== false && !ini_get('cgi.fix_pathinfo') && !empty($_SERVER['REQUEST_URI'])) { // PHP-CGI on Apache with "cgi.fix_pathinfo = 0" // We shouldn't have user-supplied PATH_INFO in PHP_SELF in this case // because PHP will not work with PATH_INFO at all. $script_name = $_SERVER['PHP_SELF']; } else { // Others $script_name = $_SERVER['SCRIPT_NAME']; } static::$base['path'] = rtrim(dirname($script_name), '/\\'); } } return $pathonly === false ? static::$base['prefix'] . static::$base['path'] . '/' : static::$base['path']; } /** * Returns the root URI for the request. * * @param boolean $pathonly If false, prepend the scheme, host and port information. Default is false. * @param string $path The path * * @return string The root URI string. * * @since 11.1 */ public static function root($pathonly = false, $path = null) { // Get the scheme if (empty(static::$root)) { $uri = static::getInstance(static::base()); static::$root['prefix'] = $uri->toString(array('scheme', 'host', 'port')); static::$root['path'] = rtrim($uri->toString(array('path')), '/\\'); } // Get the scheme if (isset($path)) { static::$root['path'] = $path; } return $pathonly === false ? static::$root['prefix'] . static::$root['path'] . '/' : static::$root['path']; } /** * Returns the URL for the request, minus the query. * * @return string * * @since 11.1 */ public static function current() { // Get the current URL. if (empty(static::$current)) { $uri = static::getInstance(); static::$current = $uri->toString(array('scheme', 'host', 'port', 'path')); } return static::$current; } /** * Method to reset class static members for testing and other various issues. * * @return void * * @since 11.1 */ public static function reset() { static::$instances = array(); static::$base = array(); static::$root = array(); static::$current = ''; } /** * Set the URI path string. Note we keep this method here so it uses the old _cleanPath function * * @param string $path The URI path string. * * @return void * * @since 11.1 * @deprecated 4.0 Use {@link \Joomla\Uri\Uri::setPath()} * @note Present to proxy calls to the deprecated {@link JUri::_cleanPath()} method. */ public function setPath($path) { $this->path = $this->_cleanPath($path); } /** * Checks if the supplied URL is internal * * @param string $url The URL to check. * * @return boolean True if Internal. * * @since 11.1 */ public static function isInternal($url) { $uri = static::getInstance($url); $base = $uri->toString(array('scheme', 'host', 'port', 'path')); $host = $uri->toString(array('scheme', 'host', 'port')); // @see JURITest if (empty($host) && strpos($uri->path, 'index.php') === 0 || !empty($host) && preg_match('#' . preg_quote(static::base(), '#') . '#', $base) || !empty($host) && $host === static::getInstance(static::base())->host && strpos($uri->path, 'index.php') !== false || !empty($host) && $base === $host && preg_match('#' . preg_quote($base, '#') . '#', static::base())) { return true; } return false; } /** * Build a query from a array (reverse of the PHP parse_str()). * * @param array $params The array of key => value pairs to return as a query string. * * @return string The resulting query string. * * @see parse_str() * @since 11.1 * @note The parent method is protected, this exposes it as public for B/C */ public static function buildQuery(array $params) { return parent::buildQuery($params); } /** * Parse a given URI and populate the class fields. * * @param string $uri The URI string to parse. * * @return boolean True on success. * * @since 11.1 * @note The parent method is protected, this exposes it as public for B/C */ public function parse($uri) { return parent::parse($uri); } /** * Resolves //, ../ and ./ from a path and returns * the result. Eg: * * /foo/bar/../boo.php => /foo/boo.php * /foo/bar/../../boo.php => /boo.php * /foo/bar/.././/boo.php => /foo/boo.php * * @param string $path The URI path to clean. * * @return string Cleaned and resolved URI path. * * @since 11.1 * @deprecated 4.0 Use {@link \Joomla\Uri\Uri::cleanPath()} instead */ protected function _cleanPath($path) { return parent::cleanPath($path); } } PK���\gmt���"libraries/joomla/filter/output.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Filter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JFilterOutput * * @since 11.1 */ class JFilterOutput { /** * Makes an object safe to display in forms * * Object parameters that are non-string, array, object or start with underscore * will be converted * * @param object &$mixed An object to be parsed * @param integer $quote_style The optional quote style for the htmlspecialchars function * @param mixed $exclude_keys An optional string single field name or array of field names not * to be parsed (eg, for a textarea) * * @return void * * @since 11.1 */ public static function objectHTMLSafe(&$mixed, $quote_style = ENT_QUOTES, $exclude_keys = '') { if (is_object($mixed)) { foreach (get_object_vars($mixed) as $k => $v) { if (is_array($v) || is_object($v) || $v == null || substr($k, 1, 1) == '_') { continue; } if (is_string($exclude_keys) && $k == $exclude_keys) { continue; } elseif (is_array($exclude_keys) && in_array($k, $exclude_keys)) { continue; } $mixed->$k = htmlspecialchars($v, $quote_style, 'UTF-8'); } } } /** * This method processes a string and replaces all instances of & with & in links only. * * @param string $input String to process * * @return string Processed string * * @since 11.1 */ public static function linkXHTMLSafe($input) { $regex = 'href="([^"]*(&(amp;){0})[^"]*)*?"'; return preg_replace_callback("#$regex#i", array('JFilterOutput', '_ampReplaceCallback'), $input); } /** * This method processes a string and replaces all accented UTF-8 characters by unaccented * ASCII-7 "equivalents", whitespaces are replaced by hyphens and the string is lowercase. * * @param string $string String to process * * @return string Processed string * * @since 11.1 */ public static function stringURLSafe($string) { // Remove any '-' from the string since they will be used as concatenaters $str = str_replace('-', ' ', $string); $lang = JFactory::getLanguage(); $str = $lang->transliterate($str); // Trim white spaces at beginning and end of alias and make lowercase $str = trim(JString::strtolower($str)); // Remove any duplicate whitespace, and ensure all characters are alphanumeric $str = preg_replace('/(\s|[^A-Za-z0-9\-])+/', '-', $str); // Trim dashes at beginning and end of alias $str = trim($str, '-'); return $str; } /** * This method implements unicode slugs instead of transliteration. * * @param string $string String to process * * @return string Processed string * * @since 11.1 */ public static function stringURLUnicodeSlug($string) { // Replace double byte whitespaces by single byte (East Asian languages) $str = preg_replace('/\xE3\x80\x80/', ' ', $string); // Remove any '-' from the string as they will be used as concatenator. // Would be great to let the spaces in but only Firefox is friendly with this $str = str_replace('-', ' ', $str); // Replace forbidden characters by whitespaces $str = preg_replace('#[:\#\*"@+=;!><&\.%()\]\/\'\\\\|\[]#', "\x20", $str); // Delete all '?' $str = str_replace('?', '', $str); // Trim white spaces at beginning and end of alias and make lowercase $str = trim(JString::strtolower($str)); // Remove any duplicate whitespace and replace whitespaces by hyphens $str = preg_replace('#\x20+#', '-', $str); return $str; } /** * Replaces & with & for XHTML compliance * * @param string $text Text to process * * @return string Processed string. * * @since 11.1 * * @todo There must be a better way??? */ public static function ampReplace($text) { $text = str_replace('&&', '*--*', $text); $text = str_replace('&#', '*-*', $text); $text = str_replace('&', '&', $text); $text = preg_replace('|&(?![\w]+;)|', '&', $text); $text = str_replace('*-*', '&#', $text); $text = str_replace('*--*', '&&', $text); return $text; } /** * Callback method for replacing & with & in a string * * @param string $m String to process * * @return string Replaced string * * @since 11.1 */ public static function _ampReplaceCallback($m) { $rx = '&(?!amp;)'; return preg_replace('#' . $rx . '#', '&', $m[0]); } /** * Cleans text of all formatting and scripting code * * @param string &$text Text to clean * * @return string Cleaned text. * * @since 11.1 */ public static function cleanText(&$text) { $text = preg_replace("'<script[^>]*>.*?</script>'si", '', $text); $text = preg_replace('/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is', '\2 (\1)', $text); $text = preg_replace('/<!--.+?-->/', '', $text); $text = preg_replace('/{.+?}/', '', $text); $text = preg_replace('/ /', ' ', $text); $text = preg_replace('/&/', ' ', $text); $text = preg_replace('/"/', ' ', $text); $text = strip_tags($text); $text = htmlspecialchars($text, ENT_COMPAT, 'UTF-8'); return $text; } /** * Strip img-tags from string * * @param string $string Sting to be cleaned. * * @return string Cleaned string * * @since 11.1 */ public static function stripImages($string) { return preg_replace('#(<[/]?img.*>)#U', '', $string); } /** * Strip iframe-tags from string * * @param string $string Sting to be cleaned. * * @return string Cleaned string * * @since 12.2 */ public static function stripIframes($string) { return preg_replace('#(<[/]?iframe.*>)#U', '', $string); } } PK���\���Tn n *libraries/joomla/filter/wrapper/output.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Filter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JFilterOutput * * @package Joomla.Platform * @subpackage Filter * @since 3.4 */ class JFilterWrapperOutput { /** * Helper wrapper method for objectHTMLSafe * * @param object &$mixed An object to be parsed. * @param integer $quote_style The optional quote style for the htmlspecialchars function. * @param mixed $exclude_keys An optional string single field name or array of field names not. * * @return void * * @see JFilterOutput::objectHTMLSafe() * @since 3.4 */ public function objectHTMLSafe(&$mixed, $quote_style = 3, $exclude_keys = '') { return JFilterOutput::objectHTMLSafe($mixed, $quote_style, $exclude_keys); } /** * Helper wrapper method for linkXHTMLSafe * * @param string $input String to process. * * @return string Processed string. * * @see JFilterOutput::linkXHTMLSafe() * @since 3.4 */ public function linkXHTMLSafe($input) { return JFilterOutput::linkXHTMLSafe($input); } /** * Helper wrapper method for stringURLSafe * * @param string $string String to process. * * @return string Processed string. * * @see JFilterOutput::stringURLSafe() * @since 3.4 */ public function stringURLSafe($string) { return JFilterOutput::stringURLSafe($string); } /** * Helper wrapper method for stringURLUnicodeSlug * * @param string $string String to process. * * @return string Processed string. * * @see JFilterOutput::stringURLUnicodeSlug() * @since 3.4 */ public function stringURLUnicodeSlug($string) { return JFilterOutput::stringURLUnicodeSlug($string); } /** * Helper wrapper method for ampReplace * * @param string $text Text to process. * * @return string Processed string. * * @see JFilterOutput::ampReplace() * @since 3.4 */ public function ampReplace($text) { return JFilterOutput::ampReplace($text); } /** * Helper wrapper method for _ampReplaceCallback * * @param string $m String to process. * * @return string Replaced string. * * @see JFilterOutput::_ampReplaceCallback() * @since 3.4 */ public function _ampReplaceCallback($m) { return JFilterOutput::_ampReplaceCallback($m); } /** * Helper wrapper method for cleanText * * @param string &$text Text to clean. * * @return string Cleaned text. * * @see JFilterOutput::cleanText() * @since 3.4 */ public function cleanText(&$text) { return JFilterOutput::cleanText($text); } /** * Helper wrapper method for stripImages * * @param string $string Sting to be cleaned. * * @return string Cleaned string. * * @see JFilterOutput::stripImages() * @since 3.4 */ public function stripImages($string) { return JFilterOutput::stripImages($string); } /** * Helper wrapper method for stripIframes * * @param string $string Sting to be cleaned. * * @return string Cleaned string. * * @see JFilterOutput::stripIframes() * @since 3.4 */ public function stripIframes($string) { return JFilterOutput::stripIframes($string); } } PK���\��ygUuUu!libraries/joomla/filter/input.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Filter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JFilterInput is a class for filtering input from any data source * * Forked from the php input filter library by: Daniel Morris <dan@rootcube.com> * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie. * * @since 11.1 */ class JFilterInput { /** * A container for JFilterInput instances. * * @var array * @since 11.3 */ protected static $instances = array(); /** * The array of permitted tags (white list). * * @var array * @since 11.1 */ public $tagsArray; /** * The array of permitted tag attributes (white list). * * @var array * @since 11.1 */ public $attrArray; /** * The method for sanitising tags: WhiteList method = 0 (default), BlackList method = 1 * * @var integer * @since 11.1 */ public $tagsMethod; /** * The method for sanitising attributes: WhiteList method = 0 (default), BlackList method = 1 * * @var integer * @since 11.1 */ public $attrMethod; /** * A flag for XSS checks. Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 * * @var integer * @since 11.1 */ public $xssAuto; /** * The list of the default blacklisted tags. * * @var array * @since 11.1 */ public $tagBlacklist = array( 'applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml' ); /** * The list of the default blacklisted tag attributes. All event handlers implicit. * * @var array * @since 11.1 */ public $attrBlacklist = array( 'action', 'background', 'codebase', 'dynsrc', 'lowsrc' ); /** * Constructor for inputFilter class. Only first parameter is required. * * @param array $tagsArray List of user-defined tags * @param array $attrArray List of user-defined attributes * @param integer $tagsMethod WhiteList method = 0, BlackList method = 1 * @param integer $attrMethod WhiteList method = 0, BlackList method = 1 * @param integer $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 * * @since 11.1 */ public function __construct($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) { // Make sure user defined arrays are in lowercase $tagsArray = array_map('strtolower', (array) $tagsArray); $attrArray = array_map('strtolower', (array) $attrArray); // Assign member variables $this->tagsArray = $tagsArray; $this->attrArray = $attrArray; $this->tagsMethod = $tagsMethod; $this->attrMethod = $attrMethod; $this->xssAuto = $xssAuto; } /** * Returns an input filter object, only creating it if it doesn't already exist. * * @param array $tagsArray List of user-defined tags * @param array $attrArray List of user-defined attributes * @param integer $tagsMethod WhiteList method = 0, BlackList method = 1 * @param integer $attrMethod WhiteList method = 0, BlackList method = 1 * @param integer $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 * * @return JFilterInput The JFilterInput object. * * @since 11.1 */ public static function &getInstance($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) { $sig = md5(serialize(array($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto))); if (empty(self::$instances[$sig])) { self::$instances[$sig] = new JFilterInput($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto); } return self::$instances[$sig]; } /** * Method to be called by another php script. Processes for XSS and * specified bad code. * * @param mixed $source Input string/array-of-string to be 'cleaned' * @param string $type The return type for the variable: * INT: An integer, * UINT: An unsigned integer, * FLOAT: A floating point number, * BOOLEAN: A boolean value, * WORD: A string containing A-Z or underscores only (not case sensitive), * ALNUM: A string containing A-Z or 0-9 only (not case sensitive), * CMD: A string containing A-Z, 0-9, underscores, periods or hyphens (not case sensitive), * BASE64: A string containing A-Z, 0-9, forward slashes, plus or equals (not case sensitive), * STRING: A fully decoded and sanitised string (default), * HTML: A sanitised string, * ARRAY: An array, * PATH: A sanitised file path, * TRIM: A string trimmed from normal, non-breaking and multibyte spaces * USERNAME: Do not use (use an application specific filter), * RAW: The raw string is returned with no filtering, * unknown: An unknown filter will act like STRING. If the input is an array it will return an * array of fully decoded and sanitised strings. * * @return mixed 'Cleaned' version of input parameter * * @since 11.1 */ public function clean($source, $type = 'string') { // Handle the type constraint switch (strtoupper($type)) { case 'INT': case 'INTEGER': // Only use the first integer value preg_match('/-?[0-9]+/', (string) $source, $matches); $result = @ (int) $matches[0]; break; case 'UINT': // Only use the first integer value preg_match('/-?[0-9]+/', (string) $source, $matches); $result = @ abs((int) $matches[0]); break; case 'FLOAT': case 'DOUBLE': // Only use the first floating point value preg_match('/-?[0-9]+(\.[0-9]+)?/', (string) $source, $matches); $result = @ (float) $matches[0]; break; case 'BOOL': case 'BOOLEAN': $result = (bool) $source; break; case 'WORD': $result = (string) preg_replace('/[^A-Z_]/i', '', $source); break; case 'ALNUM': $result = (string) preg_replace('/[^A-Z0-9]/i', '', $source); break; case 'CMD': $result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source); $result = ltrim($result, '.'); break; case 'BASE64': $result = (string) preg_replace('/[^A-Z0-9\/+=]/i', '', $source); break; case 'STRING': $result = (string) $this->_remove($this->_decode((string) $source)); break; case 'HTML': $result = (string) $this->_remove((string) $source); break; case 'ARRAY': $result = (array) $source; break; case 'PATH': $pattern = '/^[A-Za-z0-9_\/-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/'; preg_match($pattern, (string) $source, $matches); $result = @ (string) $matches[0]; break; case 'TRIM': $result = (string) trim($source); $result = JString::trim($result, chr(0xE3) . chr(0x80) . chr(0x80)); $result = JString::trim($result, chr(0xC2) . chr(0xA0)); break; case 'USERNAME': $result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); break; case 'RAW': $result = $source; break; default: // Are we dealing with an array? if (is_array($source)) { foreach ($source as $key => $value) { // Filter element for XSS and other 'bad' code etc. if (is_string($value)) { $source[$key] = $this->_remove($this->_decode($value)); } } $result = $source; } else { // Or a string? if (is_string($source) && !empty($source)) { // Filter source for XSS and other 'bad' code etc. $result = $this->_remove($this->_decode($source)); } else { // Not an array or string.. return the passed parameter $result = $source; } } break; } return $result; } /** * Function to determine if contents of an attribute are safe * * @param array $attrSubSet A 2 element array for attribute's name, value * * @return boolean True if bad code is detected * * @since 11.1 */ public static function checkAttribute($attrSubSet) { $attrSubSet[0] = strtolower($attrSubSet[0]); $attrSubSet[1] = strtolower($attrSubSet[1]); return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || (strpos($attrSubSet[1], 'javascript:') !== false) || (strpos($attrSubSet[1], 'behaviour:') !== false) || (strpos($attrSubSet[1], 'vbscript:') !== false) || (strpos($attrSubSet[1], 'mocha:') !== false) || (strpos($attrSubSet[1], 'livescript:') !== false)); } /** * Checks an uploaded for suspicious naming and potential PHP contents which could indicate a hacking attempt. * * The options you can define are: * null_byte Prevent files with a null byte in their name (buffer overflow attack) * forbidden_extensions Do not allow these strings anywhere in the file's extension * php_tag_in_content Do not allow <?php tag in content * shorttag_in_content Do not allow short tag <? in content * shorttag_extensions Which file extensions to scan for short tags in content * fobidden_ext_in_content Do not allow forbidden_extensions anywhere in content * php_ext_content_extensions Which file extensions to scan for .php in content * * This code is an adaptation and improvement of Admin Tools' UploadShield feature, * relicensed and contributed by its author. * * @param array $file An uploaded file descriptor * @param array $options The scanner options (see the code for details) * * @return boolean True of the file is safe * * @since 3.4 */ public static function isSafeFile($file, $options = array()) { $defaultOptions = array( // Null byte in file name 'null_byte' => true, // Forbidden string in extension (e.g. php matched .php, .xxx.php, .php.xxx and so on) 'forbidden_extensions' => array( 'php', 'phps', 'php5', 'php3', 'php4', 'inc', 'pl', 'cgi', 'fcgi', 'java', 'jar', 'py' ), // <?php tag in file contents 'php_tag_in_content' => true, // <? tag in file contents 'shorttag_in_content' => true, // Which file extensions to scan for short tags 'shorttag_extensions' => array( 'inc', 'phps', 'class', 'php3', 'php4', 'php5', 'txt', 'dat', 'tpl', 'tmpl' ), // Forbidden extensions anywhere in the content 'fobidden_ext_in_content' => true, // Which file extensions to scan for .php in the content 'php_ext_content_extensions' => array('zip', 'rar', 'tar', 'gz', 'tgz', 'bz2', 'tbz', 'jpa'), ); $options = array_merge($defaultOptions, $options); // Make sure we can scan nested file descriptors $descriptors = $file; if (isset($file['name']) && isset($file['tmp_name'])) { $descriptors = self::decodeFileData( array( $file['name'], $file['type'], $file['tmp_name'], $file['error'], $file['size'] ) ); } // Handle non-nested descriptors (single files) if (isset($descriptors['name'])) { $descriptors = array($descriptors); } // Scan all descriptors detected foreach ($descriptors as $fileDescriptor) { if (!isset($fileDescriptor['name'])) { // This is a nested descriptor. We have to recurse. if (!self::isSafeFile($fileDescriptor, $options)) { return false; } continue; } $tempNames = $fileDescriptor['tmp_name']; $intendedNames = $fileDescriptor['name']; if (!is_array($tempNames)) { $tempNames = array($tempNames); } if (!is_array($intendedNames)) { $intendedNames = array($intendedNames); } $len = count($tempNames); for ($i = 0; $i < $len; $i++) { $tempName = array_shift($tempNames); $intendedName = array_shift($intendedNames); // 1. Null byte check if ($options['null_byte']) { if (strstr($intendedName, "\x00")) { return false; } } // 2. PHP-in-extension check (.php, .php.xxx[.yyy[.zzz[...]]], .xxx[.yyy[.zzz[...]]].php) if (!empty($options['forbidden_extensions'])) { $explodedName = explode('.', $intendedName); $explodedName = array_reverse($explodedName); array_pop($explodedName); $explodedName = array_map('strtolower', $explodedName); /* * DO NOT USE array_intersect HERE! array_intersect expects the two arrays to * be set, i.e. they should have unique values. */ foreach ($options['forbidden_extensions'] as $ext) { if (in_array($ext, $explodedName)) { return false; } } } // 3. File contents scanner (PHP tag in file contents) if ($options['php_tag_in_content'] || $options['shorttag_in_content'] || ($options['fobidden_ext_in_content'] && !empty($options['forbidden_extensions']))) { $fp = @fopen($tempName, 'r'); if ($fp !== false) { $data = ''; while (!feof($fp)) { $data .= @fread($fp, 131072); if ($options['php_tag_in_content'] && stristr($data, '<?php')) { return false; } if ($options['shorttag_in_content']) { $suspiciousExtensions = $options['shorttag_extensions']; if (empty($suspiciousExtensions)) { $suspiciousExtensions = array( 'inc', 'phps', 'class', 'php3', 'php4', 'txt', 'dat', 'tpl', 'tmpl' ); } /* * DO NOT USE array_intersect HERE! array_intersect expects the two arrays to * be set, i.e. they should have unique values. */ $collide = false; foreach ($suspiciousExtensions as $ext) { if (in_array($ext, $explodedName)) { $collide = true; break; } } if ($collide) { // These are suspicious text files which may have the short tag (<?) in them if (strstr($data, '<?')) { return false; } } } if ($options['fobidden_ext_in_content'] && !empty($options['forbidden_extensions'])) { $suspiciousExtensions = $options['php_ext_content_extensions']; if (empty($suspiciousExtensions)) { $suspiciousExtensions = array( 'zip', 'rar', 'tar', 'gz', 'tgz', 'bz2', 'tbz', 'jpa' ); } /* * DO NOT USE array_intersect HERE! array_intersect expects the two arrays to * be set, i.e. they should have unique values. */ $collide = false; foreach ($suspiciousExtensions as $ext) { if (in_array($ext, $explodedName)) { $collide = true; break; } } if ($collide) { /* * These are suspicious text files which may have an executable * file extension in them */ foreach ($options['forbidden_extensions'] as $ext) { if (strstr($data, '.' . $ext)) { return false; } } } } /* * This makes sure that we don't accidentally skip a <?php tag if it's across * a read boundary, even on multibyte strings */ $data = substr($data, -10); } fclose($fp); } } } } return true; } /** * Method to decode a file data array. * * @param array $data The data array to decode. * * @return array * * @since 3.4 */ protected static function decodeFileData(array $data) { $result = array(); if (is_array($data[0])) { foreach ($data[0] as $k => $v) { $result[$k] = self::decodeFileData(array($data[0][$k], $data[1][$k], $data[2][$k], $data[3][$k], $data[4][$k])); } return $result; } return array('name' => $data[0], 'type' => $data[1], 'tmp_name' => $data[2], 'error' => $data[3], 'size' => $data[4]); } /** * Internal method to iteratively remove all unwanted tags and attributes * * @param string $source Input string to be 'cleaned' * * @return string 'Cleaned' version of input parameter * * @since 11.1 */ protected function _remove($source) { $loopCounter = 0; // Iteration provides nested tag protection while ($source != $this->_cleanTags($source)) { $source = $this->_cleanTags($source); $loopCounter++; } return $source; } /** * Internal method to strip a string of certain tags * * @param string $source Input string to be 'cleaned' * * @return string 'Cleaned' version of input parameter * * @since 11.1 */ protected function _cleanTags($source) { // First, pre-process this for illegal characters inside attribute values $source = $this->_escapeAttributeValues($source); // In the beginning we don't really have a tag, so everything is postTag $preTag = null; $postTag = $source; $currentSpace = false; // Setting to null to deal with undefined variables $attr = ''; // Is there a tag? If so it will certainly start with a '<'. $tagOpen_start = strpos($source, '<'); while ($tagOpen_start !== false) { // Get some information about the tag we are processing $preTag .= substr($postTag, 0, $tagOpen_start); $postTag = substr($postTag, $tagOpen_start); $fromTagOpen = substr($postTag, 1); $tagOpen_end = strpos($fromTagOpen, '>'); // Check for mal-formed tag where we have a second '<' before the first '>' $nextOpenTag = (strlen($postTag) > $tagOpen_start) ? strpos($postTag, '<', $tagOpen_start + 1) : false; if (($nextOpenTag !== false) && ($nextOpenTag < $tagOpen_end)) { // At this point we have a mal-formed tag -- remove the offending open $postTag = substr($postTag, 0, $tagOpen_start) . substr($postTag, $tagOpen_start + 1); $tagOpen_start = strpos($postTag, '<'); continue; } // Let's catch any non-terminated tags and skip over them if ($tagOpen_end === false) { $postTag = substr($postTag, $tagOpen_start + 1); $tagOpen_start = strpos($postTag, '<'); continue; } // Do we have a nested tag? $tagOpen_nested = strpos($fromTagOpen, '<'); if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) { $preTag .= substr($postTag, 0, ($tagOpen_nested + 1)); $postTag = substr($postTag, ($tagOpen_nested + 1)); $tagOpen_start = strpos($postTag, '<'); continue; } // Let's get some information about our tag and setup attribute pairs $tagOpen_nested = (strpos($fromTagOpen, '<') + $tagOpen_start + 1); $currentTag = substr($fromTagOpen, 0, $tagOpen_end); $tagLength = strlen($currentTag); $tagLeft = $currentTag; $attrSet = array(); $currentSpace = strpos($tagLeft, ' '); // Are we an open tag or a close tag? if (substr($currentTag, 0, 1) == '/') { // Close Tag $isCloseTag = true; list ($tagName) = explode(' ', $currentTag); $tagName = substr($tagName, 1); } else { // Open Tag $isCloseTag = false; list ($tagName) = explode(' ', $currentTag); } /* * Exclude all "non-regular" tagnames * OR no tagname * OR remove if xssauto is on and tag is blacklisted */ if ((!preg_match("/^[a-z][a-z0-9]*$/i", $tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) { $postTag = substr($postTag, ($tagLength + 2)); $tagOpen_start = strpos($postTag, '<'); // Strip tag continue; } /* * Time to grab any attributes from the tag... need this section in * case attributes have spaces in the values. */ while ($currentSpace !== false) { $attr = ''; $fromSpace = substr($tagLeft, ($currentSpace + 1)); $nextEqual = strpos($fromSpace, '='); $nextSpace = strpos($fromSpace, ' '); $openQuotes = strpos($fromSpace, '"'); $closeQuotes = strpos(substr($fromSpace, ($openQuotes + 1)), '"') + $openQuotes + 1; $startAtt = ''; $startAttPosition = 0; // Find position of equal and open quotes ignoring if (preg_match('#\s*=\s*\"#', $fromSpace, $matches, PREG_OFFSET_CAPTURE)) { $startAtt = $matches[0][0]; $startAttPosition = $matches[0][1]; $closeQuotes = strpos(substr($fromSpace, ($startAttPosition + strlen($startAtt))), '"') + $startAttPosition + strlen($startAtt); $nextEqual = $startAttPosition + strpos($startAtt, '='); $openQuotes = $startAttPosition + strpos($startAtt, '"'); $nextSpace = strpos(substr($fromSpace, $closeQuotes), ' ') + $closeQuotes; } // Do we have an attribute to process? [check for equal sign] if ($fromSpace != '/' && (($nextEqual && $nextSpace && $nextSpace < $nextEqual) || !$nextEqual)) { if (!$nextEqual) { $attribEnd = strpos($fromSpace, '/') - 1; } else { $attribEnd = $nextSpace - 1; } // If there is an ending, use this, if not, do not worry. if ($attribEnd > 0) { $fromSpace = substr($fromSpace, $attribEnd + 1); } } if (strpos($fromSpace, '=') !== false) { // If the attribute value is wrapped in quotes we need to grab the substring from // the closing quote, otherwise grab until the next space. if (($openQuotes !== false) && (strpos(substr($fromSpace, ($openQuotes + 1)), '"') !== false)) { $attr = substr($fromSpace, 0, ($closeQuotes + 1)); } else { $attr = substr($fromSpace, 0, $nextSpace); } } // No more equal signs so add any extra text in the tag into the attribute array [eg. checked] else { if ($fromSpace != '/') { $attr = substr($fromSpace, 0, $nextSpace); } } // Last Attribute Pair if (!$attr && $fromSpace != '/') { $attr = $fromSpace; } // Add attribute pair to the attribute array $attrSet[] = $attr; // Move search point and continue iteration $tagLeft = substr($fromSpace, strlen($attr)); $currentSpace = strpos($tagLeft, ' '); } // Is our tag in the user input array? $tagFound = in_array(strtolower($tagName), $this->tagsArray); // If the tag is allowed let's append it to the output string. if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) { // Reconstruct tag with allowed attributes if (!$isCloseTag) { // Open or single tag $attrSet = $this->_cleanAttributes($attrSet); $preTag .= '<' . $tagName; for ($i = 0, $count = count($attrSet); $i < $count; $i++) { $preTag .= ' ' . $attrSet[$i]; } // Reformat single tags to XHTML if (strpos($fromTagOpen, '</' . $tagName)) { $preTag .= '>'; } else { $preTag .= ' />'; } } // Closing tag else { $preTag .= '</' . $tagName . '>'; } } // Find next tag's start and continue iteration $postTag = substr($postTag, ($tagLength + 2)); $tagOpen_start = strpos($postTag, '<'); } // Append any code after the end of tags and return if ($postTag != '<') { $preTag .= $postTag; } return $preTag; } /** * Internal method to strip a tag of certain attributes * * @param array $attrSet Array of attribute pairs to filter * * @return array Filtered array of attribute pairs * * @since 11.1 */ protected function _cleanAttributes($attrSet) { $newSet = array(); $count = count($attrSet); // Iterate through attribute pairs for ($i = 0; $i < $count; $i++) { // Skip blank spaces if (!$attrSet[$i]) { continue; } // Split into name/value pairs $attrSubSet = explode('=', trim($attrSet[$i]), 2); // Take the last attribute in case there is an attribute with no value $attrSubSet_0 = explode(' ', trim($attrSubSet[0])); $attrSubSet[0] = array_pop($attrSubSet_0); // Remove all "non-regular" attribute names // AND blacklisted attributes if ((!preg_match('/[a-z]*$/i', $attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on')))) { continue; } // XSS attribute value filtering if (isset($attrSubSet[1])) { // Trim leading and trailing spaces $attrSubSet[1] = trim($attrSubSet[1]); // Strips unicode, hex, etc $attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]); // Strip normal newline within attr value $attrSubSet[1] = preg_replace('/[\n\r]/', '', $attrSubSet[1]); // Strip double quotes $attrSubSet[1] = str_replace('"', '', $attrSubSet[1]); // Convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr values) if ((substr($attrSubSet[1], 0, 1) == "'") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'")) { $attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2)); } // Strip slashes $attrSubSet[1] = stripslashes($attrSubSet[1]); } else { continue; } // Autostrip script tags if (self::checkAttribute($attrSubSet)) { continue; } // Is our attribute in the user input array? $attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray); // If the tag is allowed lets keep it if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) { // Does the attribute have a value? if (empty($attrSubSet[1]) === false) { $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"'; } elseif ($attrSubSet[1] === "0") { // Special Case // Is the value 0? $newSet[] = $attrSubSet[0] . '="0"'; } else { // Leave empty attributes alone $newSet[] = $attrSubSet[0] . '=""'; } } } return $newSet; } /** * Try to convert to plaintext * * @param string $source The source string. * * @return string Plaintext string * * @since 11.1 */ protected function _decode($source) { static $ttr; if (!is_array($ttr)) { // Entity decode $trans_tbl = get_html_translation_table(HTML_ENTITIES, ENT_COMPAT, 'ISO-8859-1'); foreach ($trans_tbl as $k => $v) { $ttr[$v] = utf8_encode($k); } } $source = strtr($source, $ttr); // Convert decimal $source = preg_replace_callback('/&#(\d+);/m', function($m) { return utf8_encode(chr($m[1])); }, $source ); // Convert hex $source = preg_replace_callback('/&#x([a-f0-9]+);/mi', function($m) { return utf8_encode(chr('0x' . $m[1])); }, $source ); return $source; } /** * Escape < > and " inside attribute values * * @param string $source The source string. * * @return string Filtered string * * @since 11.1 */ protected function _escapeAttributeValues($source) { $alreadyFiltered = ''; $remainder = $source; $badChars = array('<', '"', '>'); $escapedChars = array('<', '"', '>'); // Process each portion based on presence of =" and "<space>, "/>, or "> // See if there are any more attributes to process while (preg_match('#<[^>]*?=\s*?(\"|\')#s', $remainder, $matches, PREG_OFFSET_CAPTURE)) { // Get the portion before the attribute value $quotePosition = $matches[0][1]; $nextBefore = $quotePosition + strlen($matches[0][0]); // Figure out if we have a single or double quote and look for the matching closing quote // Closing quote should be "/>, ">, "<space>, or " at the end of the string $quote = substr($matches[0][0], -1); $pregMatch = ($quote == '"') ? '#(\"\s*/\s*>|\"\s*>|\"\s+|\"$)#' : "#(\'\s*/\s*>|\'\s*>|\'\s+|\'$)#"; // Get the portion after attribute value if (preg_match($pregMatch, substr($remainder, $nextBefore), $matches, PREG_OFFSET_CAPTURE)) { // We have a closing quote $nextAfter = $nextBefore + $matches[0][1]; } else { // No closing quote $nextAfter = strlen($remainder); } // Get the actual attribute value $attributeValue = substr($remainder, $nextBefore, $nextAfter - $nextBefore); // Escape bad chars $attributeValue = str_replace($badChars, $escapedChars, $attributeValue); $attributeValue = $this->_stripCSSExpressions($attributeValue); $alreadyFiltered .= substr($remainder, 0, $nextBefore) . $attributeValue . $quote; $remainder = substr($remainder, $nextAfter + 1); } // At this point, we just have to return the $alreadyFiltered and the $remainder return $alreadyFiltered . $remainder; } /** * Remove CSS Expressions in the form of <property>:expression(...) * * @param string $source The source string. * * @return string Filtered string * * @since 11.1 */ protected function _stripCSSExpressions($source) { // Strip any comments out (in the form of /*...*/) $test = preg_replace('#\/\*.*\*\/#U', '', $source); // Test for :expression if (!stripos($test, ':expression')) { // Not found, so we are done $return = $source; } else { // At this point, we have stripped out the comments and have found :expression // Test stripped string for :expression followed by a '(' if (preg_match_all('#:expression\s*\(#', $test, $matches)) { // If found, remove :expression $test = str_ireplace(':expression', '', $test); $return = $test; } } return $return; } } PK���\�>�nKK&libraries/joomla/keychain/keychain.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Keychain * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Keychain Class * * @since 12.3 */ class JKeychain extends \Joomla\Registry\Registry { /** * @var string Method to use for encryption. * @since 12.3 */ public $method = 'aes-128-cbc'; /** * @var string Initialisation vector for encryption method. * @since 12.3 */ public $iv = "1234567890123456"; /** * Create a passphrase file * * @param string $passphrase The passphrase to store in the passphrase file. * @param string $passphraseFile Path to the passphrase file to create. * @param string $privateKeyFile Path to the private key file to encrypt the passphrase file. * @param string $privateKeyPassphrase The passphrase for the private key. * * @return boolean Result of writing the passphrase file to disk. * * @since 12.3 * @throws RuntimeException */ public function createPassphraseFile($passphrase, $passphraseFile, $privateKeyFile, $privateKeyPassphrase) { $privateKey = openssl_get_privatekey(file_get_contents($privateKeyFile), $privateKeyPassphrase); if (!$privateKey) { throw new RuntimeException("Failed to load private key."); } $crypted = ''; if (!openssl_private_encrypt($passphrase, $crypted, $privateKey)) { throw new RuntimeException("Failed to encrypt data using private key."); } return file_put_contents($passphraseFile, $crypted); } /** * Delete a registry value (very simple method) * * @param string $path Registry Path (e.g. joomla.content.showauthor) * * @return mixed Value of old value or boolean false if operation failed * * @since 12.3 */ public function deleteValue($path) { $result = null; // Explode the registry path into an array $nodes = explode('.', $path); if ($nodes) { // Initialize the current node to be the registry root. $node = $this->data; // Traverse the registry to find the correct node for the result. for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++) { if (!isset($node->{$nodes[$i]}) && ($i != $n)) { $node->{$nodes[$i]} = new stdClass; } $node = $node->{$nodes[$i]}; } // Get the old value if exists so we can return it $result = $node->{$nodes[$i]}; unset($node->{$nodes[$i]}); } return $result; } /** * Load a keychain file into this object. * * @param string $keychainFile Path to the keychain file. * @param string $passphraseFile The path to the passphrase file to decript the keychain. * @param string $publicKeyFile The file containing the public key to decrypt the passphrase file. * * @return boolean Result of loading the object. * * @since 12.3 * @throws RuntimeException */ public function loadKeychain($keychainFile, $passphraseFile, $publicKeyFile) { if (!file_exists($keychainFile)) { throw new RuntimeException('Attempting to load non-existent keychain file'); } $passphrase = $this->getPassphraseFromFile($passphraseFile, $publicKeyFile); $cleartext = openssl_decrypt(file_get_contents($keychainFile), $this->method, $passphrase, true, $this->iv); if ($cleartext === false) { throw new RuntimeException("Failed to decrypt keychain file"); } return $this->loadObject(json_decode($cleartext)); } /** * Save this keychain to a file. * * @param string $keychainFile The path to the keychain file. * @param string $passphraseFile The path to the passphrase file to encrypt the keychain. * @param string $publicKeyFile The file containing the public key to decrypt the passphrase file. * * @return boolean Result of storing the file. * * @since 12.3 * @throws RuntimeException */ public function saveKeychain($keychainFile, $passphraseFile, $publicKeyFile) { $passphrase = $this->getPassphraseFromFile($passphraseFile, $publicKeyFile); $data = $this->toString('JSON'); $encrypted = @openssl_encrypt($data, $this->method, $passphrase, true, $this->iv); if ($encrypted === false) { throw new RuntimeException('Unable to encrypt keychain'); } return file_put_contents($keychainFile, $encrypted); } /** * Get the passphrase for this keychain * * @param string $passphraseFile The file containing the passphrase to encrypt and decrypt. * @param string $publicKeyFile The file containing the public key to decrypt the passphrase file. * * @return string The passphrase in from passphraseFile * * @since 12.3 * @throws RuntimeException */ protected function getPassphraseFromFile($passphraseFile, $publicKeyFile) { if (!file_exists($publicKeyFile)) { throw new RuntimeException('Missing public key file'); } $publicKey = openssl_get_publickey(file_get_contents($publicKeyFile)); if (!$publicKey) { throw new RuntimeException("Failed to load public key."); } if (!file_exists($passphraseFile)) { throw new RuntimeException('Missing passphrase file'); } $passphrase = ''; if (!openssl_public_decrypt(file_get_contents($passphraseFile), $passphrase, $publicKey)) { throw new RuntimeException('Failed to decrypt passphrase file'); } return $passphrase; } } PK���\@T�_��$libraries/joomla/log/logger/echo.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Echo logger class. * * @since 11.1 */ class JLogLoggerEcho extends JLogLogger { /** * @var string Value to use at the end of an echoed log entry to separate lines. * @since 11.1 */ protected $line_separator = "\n"; /** * Constructor. * * @param array &$options Log object options. * * @since 12.1 */ public function __construct(array &$options) { parent::__construct($options); if (!empty($this->options['line_separator'])) { $this->line_separator = $this->options['line_separator']; } } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return void * * @since 11.1 */ public function addEntry(JLogEntry $entry) { echo $this->priorities[$entry->priority] . ': ' . $entry->message . (empty($entry->category) ? '' : ' [' . $entry->category . ']') . $this->line_separator; } } PK���\�v���-libraries/joomla/log/logger/formattedtext.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); /** * Joomla! Formatted Text File Log class * * This class is designed to use as a base for building formatted text files for output. By * default it emulates the Syslog style format output. This is a disk based output format. * * @since 11.1 */ class JLogLoggerFormattedtext extends JLogLogger { /** * @var resource The file pointer for the log file. * @since 11.1 */ protected $file; /** * @var string The format for which each entry follows in the log file. All fields must be named * in all caps and be within curly brackets eg. {FOOBAR}. * @since 11.1 */ protected $format = '{DATETIME} {PRIORITY} {CLIENTIP} {CATEGORY} {MESSAGE}'; /** * @var array The parsed fields from the format string. * @since 11.1 */ protected $fields = array(); /** * @var string The full filesystem path for the log file. * @since 11.1 */ protected $path; /** * Constructor. * * @param array &$options Log object options. * * @since 11.1 */ public function __construct(array &$options) { // Call the parent constructor. parent::__construct($options); // The name of the text file defaults to 'error.php' if not explicitly given. if (empty($this->options['text_file'])) { $this->options['text_file'] = 'error.php'; } // The name of the text file path defaults to that which is set in configuration if not explicitly given. if (empty($this->options['text_file_path'])) { $this->options['text_file_path'] = JFactory::getConfig()->get('log_path'); } // False to treat the log file as a php file. if (empty($this->options['text_file_no_php'])) { $this->options['text_file_no_php'] = false; } // Build the full path to the log file. $this->path = $this->options['text_file_path'] . '/' . $this->options['text_file']; // Use the default entry format unless explicitly set otherwise. if (!empty($this->options['text_entry_format'])) { $this->format = (string) $this->options['text_entry_format']; } // Build the fields array based on the format string. $this->parseFields(); } /** * Destructor. * * @since 11.1 */ public function __destruct() { if (is_resource($this->file)) { fclose($this->file); } } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return boolean True on success. * * @since 11.1 * @throws RuntimeException */ public function addEntry(JLogEntry $entry) { // Initialise the file if not already done. if (!is_resource($this->file)) { $this->initFile(); } // Set some default field values if not already set. if (!isset($entry->clientIP)) { // Check for proxies as well. if (isset($_SERVER['REMOTE_ADDR'])) { $entry->clientIP = $_SERVER['REMOTE_ADDR']; } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $entry->clientIP = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) { $entry->clientIP = $_SERVER['HTTP_CLIENT_IP']; } } // If the time field is missing or the date field isn't only the date we need to rework it. if ((strlen($entry->date) != 10) || !isset($entry->time)) { // Get the date and time strings in GMT. $entry->datetime = $entry->date->toISO8601(); $entry->time = $entry->date->format('H:i:s', false); $entry->date = $entry->date->format('Y-m-d', false); } // Get a list of all the entry keys and make sure they are upper case. $tmp = array_change_key_case(get_object_vars($entry), CASE_UPPER); // Decode the entry priority into an English string. $tmp['PRIORITY'] = $this->priorities[$entry->priority]; // Fill in field data for the line. $line = $this->format; foreach ($this->fields as $field) { $line = str_replace('{' . $field . '}', (isset($tmp[$field])) ? $tmp[$field] : '-', $line); } // Write the new entry to the file. if (!fwrite($this->file, $line . "\n")) { throw new RuntimeException('Cannot write to log file.'); } } /** * Method to generate the log file header. * * @return string The log file header * * @since 11.1 */ protected function generateFileHeader() { $head = array(); // Build the log file header. // If the no php flag is not set add the php die statement. if (empty($this->options['text_file_no_php'])) { // Blank line to prevent information disclose: https://bugs.php.net/bug.php?id=60677 $head[] = '#'; $head[] = '#<?php die(\'Forbidden.\'); ?>'; } $head[] = '#Date: ' . gmdate('Y-m-d H:i:s') . ' UTC'; $head[] = '#Software: ' . JPlatform::getLongVersion(); $head[] = ''; // Prepare the fields string $head[] = '#Fields: ' . strtolower(str_replace('}', '', str_replace('{', '', $this->format))); $head[] = ''; return implode("\n", $head); } /** * Method to initialise the log file. This will create the folder path to the file if it doesn't already * exist and also get a new file header if the file doesn't already exist. If the file already exists it * will simply open it for writing. * * @return void * * @since 11.1 * @throws RuntimeException */ protected function initFile() { // If the file doesn't already exist we need to create it and generate the file header. if (!is_file($this->path)) { // Make sure the folder exists in which to create the log file. JFolder::create(dirname($this->path)); // Build the log file header. $head = $this->generateFileHeader(); } else { $head = false; } // Open the file for writing (append mode). if (!$this->file = fopen($this->path, 'a')) { throw new RuntimeException('Cannot open file for writing log'); } if ($head) { if (!fwrite($this->file, $head)) { throw new RuntimeException('Cannot fput file for log'); } } } /** * Method to parse the format string into an array of fields. * * @return void * * @since 11.1 */ protected function parseFields() { $this->fields = array(); $matches = array(); // Get all of the available fields in the format string. preg_match_all("/{(.*?)}/i", $this->format, $matches); // Build the parsed fields list based on the found fields. foreach ($matches[1] as $match) { $this->fields[] = strtoupper($match); } } } PK���\�0���#libraries/joomla/log/logger/w3c.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! W3c Logging class * * This class is designed to build log files based on the W3c specification * at: http://www.w3.org/TR/WD-logfile.html * * @since 11.1 */ class JLogLoggerW3c extends JLogLoggerFormattedtext { /** * @var string The format which each entry follows in the log file. All fields must be * named in all caps and be within curly brackets eg. {FOOBAR}. * @since 11.1 */ protected $format = '{DATE} {TIME} {PRIORITY} {CLIENTIP} {CATEGORY} {MESSAGE}'; /** * Constructor. * * @param array &$options Log object options. * * @since 11.1 */ public function __construct(array &$options) { // The name of the text file defaults to 'error.w3c.php' if not explicitly given. if (empty($options['text_file'])) { $options['text_file'] = 'error.w3c.php'; } // Call the parent constructor. parent::__construct($options); } } PK���\5�xx,libraries/joomla/log/logger/messagequeue.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla MessageQueue logger class. * * This class is designed to output logs to a specific MySQL database table. Fields in this * table are based on the Syslog style of log output. This is designed to allow quick and * easy searching. * * @since 11.1 */ class JLogLoggerMessagequeue extends JLogLogger { /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return void * * @since 11.1 */ public function addEntry(JLogEntry $entry) { switch ($entry->priority) { case JLog::EMERGENCY: case JLog::ALERT: case JLog::CRITICAL: case JLog::ERROR: JFactory::getApplication()->enqueueMessage($entry->message, 'error'); break; case JLog::WARNING: JFactory::getApplication()->enqueueMessage($entry->message, 'warning'); break; case JLog::NOTICE: JFactory::getApplication()->enqueueMessage($entry->message, 'notice'); break; case JLog::INFO: JFactory::getApplication()->enqueueMessage($entry->message, 'message'); break; default: // Ignore other priorities. break; } } } PK���\l���''(libraries/joomla/log/logger/callback.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Callback Log class * * This class allows logging to be handled by a callback function. * This allows unprecedented flexibility in the way logging can be handled. * * @since 12.2 */ class JLogLoggerCallback extends JLogLogger { /** * @var callable The function to call when an entry is added - should return True on success * @since 12.2 */ protected $callback; /** * Constructor. * * @param array &$options Log object options. * * @since 12.2 * @throws RuntimeException */ public function __construct(array &$options) { // Call the parent constructor. parent::__construct($options); // Throw an exception if there is not a valid callback if (!isset($this->options['callback']) || !is_callable($this->options['callback'])) { throw new RuntimeException('JLogLoggerCallback created without valid callback function.'); } $this->callback = $this->options['callback']; } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return boolean True on success. * * @since 12.2 * @throws LogException */ public function addEntry(JLogEntry $entry) { // Pass the log entry to the callback function call_user_func($this->callback, $entry); } } PK���\ P��JJ(libraries/joomla/log/logger/database.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! MySQL Database Log class * * This class is designed to output logs to a specific MySQL database table. Fields in this * table are based on the Syslog style of log output. This is designed to allow quick and * easy searching. * * @since 11.1 */ class JLogLoggerDatabase extends JLogLogger { /** * @var string The name of the database driver to use for connecting to the database. * @since 11.1 */ protected $driver = 'mysqli'; /** * @var string The host name (or IP) of the server with which to connect for the logger. * @since 11.1 */ protected $host = '127.0.0.1'; /** * @var string The database server user to connect as for the logger. * @since 11.1 */ protected $user = 'root'; /** * @var string The password to use for connecting to the database server. * @since 11.1 */ protected $password = ''; /** * @var string The name of the database table to use for the logger. * @since 11.1 */ protected $database = 'logging'; /** * @var string The database table to use for logging entries. * @since 11.1 */ protected $table = 'jos_'; /** * @var JDatabaseDriver The database driver object for the logger. * @since 11.1 */ protected $db; /** * Constructor. * * @param array &$options Log object options. * * @since 11.1 */ public function __construct(array &$options) { // Call the parent constructor. parent::__construct($options); // If both the database object and driver options are empty we want to use the system database connection. if (empty($this->options['db_driver'])) { $this->db = JFactory::getDbo(); $this->driver = null; $this->host = null; $this->user = null; $this->password = null; $this->database = null; $this->prefix = null; } else { $this->db = null; $this->driver = (empty($this->options['db_driver'])) ? 'mysqli' : $this->options['db_driver']; $this->host = (empty($this->options['db_host'])) ? '127.0.0.1' : $this->options['db_host']; $this->user = (empty($this->options['db_user'])) ? 'root' : $this->options['db_user']; $this->password = (empty($this->options['db_pass'])) ? '' : $this->options['db_pass']; $this->database = (empty($this->options['db_database'])) ? 'logging' : $this->options['db_database']; $this->prefix = (empty($this->options['db_prefix'])) ? 'jos_' : $this->options['db_prefix']; } // The table name is independent of how we arrived at the connection object. $this->table = (empty($this->options['db_table'])) ? '#__log_entries' : $this->options['db_table']; } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return void * * @since 11.1 */ public function addEntry(JLogEntry $entry) { // Connect to the database if not connected. if (empty($this->db)) { $this->connect(); } // Convert the date. $entry->date = $entry->date->toSql(false, $this->db); $this->db->insertObject($this->table, $entry); } /** * Method to connect to the database server based on object properties. * * @return void * * @since 11.1 * @throws RuntimeException */ protected function connect() { // Build the configuration object to use for JDatabaseDriver. $options = array( 'driver' => $this->driver, 'host' => $this->host, 'user' => $this->user, 'password' => $this->password, 'database' => $this->database, 'prefix' => $this->prefix); $db = JDatabaseDriver::getInstance($options); // Assign the database connector to the class. $this->db = $db; } } PK���\X� ���&libraries/joomla/log/logger/syslog.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Syslog Log class * * This class is designed to call the PHP Syslog function call which is then sent to the * system wide log system. For Linux/Unix based systems this is the syslog subsystem, for * the Windows based implementations this can be found in the Event Log. For Windows, * permissions may prevent PHP from properly outputting messages. * * @since 11.1 */ class JLogLoggerSyslog extends JLogLogger { /** * @var array Translation array for JLogEntry priorities to SysLog priority names. * @since 11.1 */ protected $priorities = array( JLog::EMERGENCY => 'EMERG', JLog::ALERT => 'ALERT', JLog::CRITICAL => 'CRIT', JLog::ERROR => 'ERR', JLog::WARNING => 'WARNING', JLog::NOTICE => 'NOTICE', JLog::INFO => 'INFO', JLog::DEBUG => 'DEBUG'); /** * Constructor. * * @param array &$options Log object options. * * @since 11.1 */ public function __construct(array &$options) { // Call the parent constructor. parent::__construct($options); // Ensure that we have an identity string for the Syslog entries. if (empty($this->options['sys_ident'])) { $this->options['sys_ident'] = 'Joomla Platform'; } // If the option to add the process id to Syslog entries is set use it, otherwise default to true. if (isset($this->options['sys_add_pid'])) { $this->options['sys_add_pid'] = (bool) $this->options['sys_add_pid']; } else { $this->options['sys_add_pid'] = true; } // If the option to also send Syslog entries to STDERR is set use it, otherwise default to false. if (isset($this->options['sys_use_stderr'])) { $this->options['sys_use_stderr'] = (bool) $this->options['sys_use_stderr']; } else { $this->options['sys_use_stderr'] = false; } // Build the Syslog options from our log object options. $sysOptions = 0; if ($this->options['sys_add_pid']) { $sysOptions = $sysOptions | LOG_PID; } if ($this->options['sys_use_stderr']) { $sysOptions = $sysOptions | LOG_PERROR; } // Default logging facility is LOG_USER for Windows compatibility. $sysFacility = LOG_USER; // If we have a facility passed in and we're not on Windows, reset it. if (isset($this->options['sys_facility']) && !IS_WIN) { $sysFacility = $this->options['sys_facility']; } // Open the Syslog connection. openlog((string) $this->options['sys_ident'], $sysOptions, $sysFacility); } /** * Destructor. * * @since 11.1 */ public function __destruct() { closelog(); } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return void * * @since 11.1 */ public function addEntry(JLogEntry $entry) { // Generate the value for the priority based on predefined constants. $priority = constant(strtoupper('LOG_' . $this->priorities[$entry->priority])); // Send the entry to Syslog. syslog($priority, '[' . $entry->category . '] ' . $entry->message); } } PK���\<!#�PPlibraries/joomla/log/entry.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Log Entry class * * This class is designed to hold log entries for either writing to an engine, or for * supported engines, retrieving lists and building in memory (PHP based) search operations. * * @since 11.1 */ class JLogEntry { /** * Application responsible for log entry. * @var string * @since 11.1 */ public $category; /** * The date the message was logged. * @var JDate * @since 11.1 */ public $date; /** * Message to be logged. * @var string * @since 11.1 */ public $message; /** * The priority of the message to be logged. * @var string * @since 11.1 * @see JLogEntry::$priorities */ public $priority = JLog::INFO; /** * List of available log priority levels [Based on the Syslog default levels]. * @var array * @since 11.1 */ protected $priorities = array( JLog::EMERGENCY, JLog::ALERT, JLog::CRITICAL, JLog::ERROR, JLog::WARNING, JLog::NOTICE, JLog::INFO, JLog::DEBUG ); /** * Constructor * * @param string $message The message to log. * @param string $priority Message priority based on {$this->priorities}. * @param string $category Type of entry * @param string $date Date of entry (defaults to now if not specified or blank) * * @since 11.1 */ public function __construct($message, $priority = JLog::INFO, $category = '', $date = null) { $this->message = (string) $message; // Sanitize the priority. if (!in_array($priority, $this->priorities, true)) { $priority = JLog::INFO; } $this->priority = $priority; // Sanitize category if it exists. if (!empty($category)) { $this->category = (string) strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', $category)); } // Get the date as a JDate object. $this->date = new JDate($date ? $date : 'now'); } } PK���\ɏ8L��libraries/joomla/log/logger.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Logger Base Class * * This class is used to be the basis of logger classes to allow for defined functions * to exist regardless of the child class. * * @since 12.2 */ abstract class JLogLogger { /** * Options array for the JLog instance. * @var array * @since 12.2 */ protected $options = array(); /** * @var array Translation array for JLogEntry priorities to text strings. * @since 12.2 */ protected $priorities = array( JLog::EMERGENCY => 'EMERGENCY', JLog::ALERT => 'ALERT', JLog::CRITICAL => 'CRITICAL', JLog::ERROR => 'ERROR', JLog::WARNING => 'WARNING', JLog::NOTICE => 'NOTICE', JLog::INFO => 'INFO', JLog::DEBUG => 'DEBUG'); /** * Constructor. * * @param array &$options Log object options. * * @since 12.2 */ public function __construct(array &$options) { // Set the options for the class. $this->options = & $options; } /** * Method to add an entry to the log. * * @param JLogEntry $entry The log entry object to add to the log. * * @return void * * @since 12.2 */ abstract public function addEntry(JLogEntry $entry); } /** * Deprecated class placeholder. You should use JLogLogger instead. * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) * @codeCoverageIgnore */ abstract class JLogger extends JLogLogger { /** * Constructor. * * @param array &$options Log object options. * * @since 11.1 * @deprecated 13.3 */ public function __construct(array &$options) { JLog::add('JLogger is deprecated. Use JLogLogger instead.', JLog::WARNING, 'deprecated'); parent::__construct($options); } } PK���\�Ji!!libraries/joomla/log/log.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Log * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Log Class * * This class hooks into the global log configuration settings to allow for user configured * logging events to be sent to where the user wishes them to be sent. On high load sites * Syslog is probably the best (pure PHP function), then the text file based loggers (CSV, W3c * or plain Formattedtext) and finally MySQL offers the most features (e.g. rapid searching) * but will incur a performance hit due to INSERT being issued. * * @since 11.1 */ class JLog { /** * All log priorities. * @var integer * @since 11.1 */ const ALL = 30719; /** * The system is unusable. * @var integer * @since 11.1 */ const EMERGENCY = 1; /** * Action must be taken immediately. * @var integer * @since 11.1 */ const ALERT = 2; /** * Critical conditions. * @var integer * @since 11.1 */ const CRITICAL = 4; /** * Error conditions. * @var integer * @since 11.1 */ const ERROR = 8; /** * Warning conditions. * @var integer * @since 11.1 */ const WARNING = 16; /** * Normal, but significant condition. * @var integer * @since 11.1 */ const NOTICE = 32; /** * Informational message. * @var integer * @since 11.1 */ const INFO = 64; /** * Debugging message. * @var integer * @since 11.1 */ const DEBUG = 128; /** * The global JLog instance. * @var JLog * @since 11.1 */ protected static $instance; /** * Container for JLogLogger configurations. * @var array * @since 11.1 */ protected $configurations = array(); /** * Container for JLogLogger objects. * @var array * @since 11.1 */ protected $loggers = array(); /** * Lookup array for loggers. * @var array * @since 11.1 */ protected $lookup = array(); /** * Constructor. * * @since 11.1 */ protected function __construct() { } /** * Method to add an entry to the log. * * @param mixed $entry The JLogEntry object to add to the log or the message for a new JLogEntry object. * @param integer $priority Message priority. * @param string $category Type of entry * @param string $date Date of entry (defaults to now if not specified or blank) * * @return void * * @since 11.1 */ public static function add($entry, $priority = self::INFO, $category = '', $date = null) { // Automatically instantiate the singleton object if not already done. if (empty(self::$instance)) { self::setInstance(new JLog); } // If the entry object isn't a JLogEntry object let's make one. if (!($entry instanceof JLogEntry)) { $entry = new JLogEntry((string) $entry, $priority, $category, $date); } self::$instance->addLogEntry($entry); } /** * Add a logger to the JLog instance. Loggers route log entries to the correct files/systems to be logged. * * @param array $options The object configuration array. * @param integer $priorities Message priority * @param array $categories Types of entry * @param boolean $exclude If true, all categories will be logged except those in the $categories array * * @return void * * @since 11.1 */ public static function addLogger(array $options, $priorities = self::ALL, $categories = array(), $exclude = false) { // Automatically instantiate the singleton object if not already done. if (empty(self::$instance)) { self::setInstance(new JLog); } self::$instance->addLoggerInternal($options, $priorities, $categories, $exclude); } /** * Add a logger to the JLog instance. Loggers route log entries to the correct files/systems to be logged. * This method allows you to extend JLog completely. * * @param array $options The object configuration array. * @param integer $priorities Message priority * @param array $categories Types of entry * @param boolean $exclude If true, all categories will be logged except those in the $categories array * * @return void * * @since 11.1 */ protected function addLoggerInternal(array $options, $priorities = self::ALL, $categories = array(), $exclude = false) { // The default logger is the formatted text log file. if (empty($options['logger'])) { $options['logger'] = 'formattedtext'; } $options['logger'] = strtolower($options['logger']); // Special case - if a Closure object is sent as the callback (in case of JLogLoggerCallback) // Closure objects are not serializable so swap it out for a unique id first then back again later if (isset($options['callback']) && is_a($options['callback'], 'closure')) { $callback = $options['callback']; $options['callback'] = spl_object_hash($options['callback']); } // Generate a unique signature for the JLog instance based on its options. $signature = md5(serialize($options)); // Now that the options array has been serialized, swap the callback back in if (isset($callback)) { $options['callback'] = $callback; } // Register the configuration if it doesn't exist. if (empty($this->configurations[$signature])) { $this->configurations[$signature] = $options; } $this->lookup[$signature] = (object) array( 'priorities' => $priorities, 'categories' => array_map('strtolower', (array) $categories), 'exclude' => (bool) $exclude); } /** * Returns a reference to the a JLog object, only creating it if it doesn't already exist. * Note: This is principally made available for testing and internal purposes. * * @param JLog $instance The logging object instance to be used by the static methods. * * @return void * * @since 11.1 */ public static function setInstance($instance) { if (($instance instanceof JLog) || $instance === null) { self::$instance = & $instance; } } /** * Method to add an entry to the appropriate loggers. * * @param JLogEntry $entry The JLogEntry object to send to the loggers. * * @return void * * @since 11.1 * @throws RuntimeException */ protected function addLogEntry(JLogEntry $entry) { // Find all the appropriate loggers based on priority and category for the entry. $loggers = $this->findLoggers($entry->priority, $entry->category); foreach ((array) $loggers as $signature) { // Attempt to instantiate the logger object if it doesn't already exist. if (empty($this->loggers[$signature])) { $class = 'JLogLogger' . ucfirst($this->configurations[$signature]['logger']); if (class_exists($class)) { $this->loggers[$signature] = new $class($this->configurations[$signature]); } else { throw new RuntimeException('Unable to create a JLogLogger instance: ' . $class); } } // Add the entry to the logger. $this->loggers[$signature]->addEntry(clone $entry); } } /** * Method to find the loggers to use based on priority and category values. * * @param integer $priority Message priority. * @param string $category Type of entry * * @return array The array of loggers to use for the given priority and category values. * * @since 11.1 */ protected function findLoggers($priority, $category) { $loggers = array(); // Sanitize inputs. $priority = (int) $priority; $category = strtolower($category); // Let's go iterate over the loggers and get all the ones we need. foreach ((array) $this->lookup as $signature => $rules) { // Check to make sure the priority matches the logger. if ($priority & $rules->priorities) { if ($rules->exclude) { // If either there are no set categories or the category (including the empty case) is not in the list of excluded categories, add this logger. if (empty($rules->categories) || !in_array($category, $rules->categories)) { $loggers[] = $signature; } } else { // If either there are no set categories (meaning all) or the specific category is set, add this logger. if (empty($category) || empty($rules->categories) || in_array($category, $rules->categories)) { $loggers[] = $signature; } } } } return $loggers; } } PK���\�,��x�x&libraries/joomla/filesystem/stream.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage FileSystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Stream Interface * * The Joomla! stream interface is designed to handle files as streams * where as the legacy JFile static class treated files in a rather * atomic manner. * * @note This class adheres to the stream wrapper operations: * @see http://php.net/manual/en/function.stream-get-wrappers.php * @see http://php.net/manual/en/intro.stream.php PHP Stream Manual * @see http://php.net/manual/en/wrappers.php Stream Wrappers * @see http://php.net/manual/en/filters.php Stream Filters * @see http://php.net/manual/en/transports.php Socket Transports (used by some options, particularly HTTP proxy) * @since 11.1 */ class JStream extends JObject { /** * File Mode * * @var integer * @since 11.1 */ protected $filemode = 0644; /** * Directory Mode * * @var integer * @since 11.1 */ protected $dirmode = 0755; /** * Default Chunk Size * * @var integer * @since 11.1 */ protected $chunksize = 8192; /** * Filename * * @var string * @since 11.1 */ protected $filename; /** * Prefix of the connection for writing * * @var string * @since 11.1 */ protected $writeprefix; /** * Prefix of the connection for reading * * @var string * @since 11.1 */ protected $readprefix; /** * Read Processing method * @var string gz, bz, f * If a scheme is detected, fopen will be defaulted * To use compression with a network stream use a filter * @since 11.1 */ protected $processingmethod = 'f'; /** * Filters applied to the current stream * * @var array * @since 11.1 */ protected $filters = array(); /** * File Handle * * @var array * @since 12.1 */ protected $fh; /** * File size * * @var integer * @since 12.1 */ protected $filesize; /** * Context to use when opening the connection * * @var resource * @since 12.1 */ protected $context = null; /** * Context options; used to rebuild the context * * @var array * @since 12.1 */ protected $contextOptions; /** * The mode under which the file was opened * * @var string * @since 12.1 */ protected $openmode; /** * Constructor * * @param string $writeprefix Prefix of the stream (optional). Unlike the JPATH_*, this has a final path separator! * @param string $readprefix The read prefix (optional). * @param array $context The context options (optional). * * @since 11.1 */ public function __construct($writeprefix = '', $readprefix = '', $context = array()) { $this->writeprefix = $writeprefix; $this->readprefix = $readprefix; $this->contextOptions = $context; $this->_buildContext(); } /** * Destructor * * @since 11.1 */ public function __destruct() { // Attempt to close on destruction if there is a file handle if ($this->fh) { @$this->close(); } } /** * Generic File Operations * * Open a stream with some lazy loading smarts * * @param string $filename Filename * @param string $mode Mode string to use * @param boolean $use_include_path Use the PHP include path * @param resource $context Context to use when opening * @param boolean $use_prefix Use a prefix to open the file * @param boolean $relative Filename is a relative path (if false, strips JPATH_ROOT to make it relative) * @param boolean $detectprocessingmode Detect the processing method for the file and use the appropriate function * to handle output automatically * * @return boolean * * @since 11.1 */ public function open($filename, $mode = 'r', $use_include_path = false, $context = null, $use_prefix = false, $relative = false, $detectprocessingmode = false) { $filename = $this->_getFilename($filename, $mode, $use_prefix, $relative); if (!$filename) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILENAME')); return false; } $this->filename = $filename; $this->openmode = $mode; $url = parse_url($filename); $retval = false; if (isset($url['scheme'])) { // If we're dealing with a Joomla! stream, load it if (JFilesystemHelper::isJoomlaStream($url['scheme'])) { require_once __DIR__ . '/streams/' . $url['scheme'] . '.php'; } // We have a scheme! force the method to be f $this->processingmethod = 'f'; } elseif ($detectprocessingmode) { $ext = strtolower(JFile::getExt($this->filename)); switch ($ext) { case 'tgz': case 'gz': case 'gzip': $this->processingmethod = 'gz'; break; case 'tbz2': case 'bz2': case 'bzip2': $this->processingmethod = 'bz'; break; default: $this->processingmethod = 'f'; break; } } // Capture PHP errors $php_errormsg = 'Error Unknown whilst opening a file'; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); // Decide which context to use: switch ($this->processingmethod) { // Gzip doesn't support contexts or streams case 'gz': $this->fh = gzopen($filename, $mode, $use_include_path); break; // Bzip2 is much like gzip except it doesn't use the include path case 'bz': $this->fh = bzopen($filename, $mode); break; // Fopen can handle streams case 'f': default: // One supplied at open; overrides everything if ($context) { $this->fh = fopen($filename, $mode, $use_include_path, $context); } // One provided at initialisation elseif ($this->context) { $this->fh = fopen($filename, $mode, $use_include_path, $this->context); } // No context; all defaults else { $this->fh = fopen($filename, $mode, $use_include_path); } break; } if (!$this->fh) { $this->setError($php_errormsg); } else { $retval = true; } // Restore error tracking to what it was before ini_set('track_errors', $track_errors); // Return the result return $retval; } /** * Attempt to close a file handle * * Will return false if it failed and true on success * If the file is not open the system will return true, this function destroys the file handle as well * * @return boolean * * @since 11.1 */ public function close() { if (!$this->fh) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN')); return true; } $retval = false; // Capture PHP errors $php_errormsg = 'Error Unknown'; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); switch ($this->processingmethod) { case 'gz': $res = gzclose($this->fh); break; case 'bz': $res = bzclose($this->fh); break; case 'f': default: $res = fclose($this->fh); break; } if (!$res) { $this->setError($php_errormsg); } else { // Reset this $this->fh = null; $retval = true; } // If we wrote, chmod the file after it's closed if ($this->openmode[0] == 'w') { $this->chmod(); } // Restore error tracking to what it was before ini_set('track_errors', $track_errors); // Return the result return $retval; } /** * Work out if we're at the end of the file for a stream * * @return boolean * * @since 11.1 */ public function eof() { if (!$this->fh) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN')); return false; } // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); switch ($this->processingmethod) { case 'gz': $res = gzeof($this->fh); break; case 'bz': case 'f': default: $res = feof($this->fh); break; } if ($php_errormsg) { $this->setError($php_errormsg); } // Restore error tracking to what it was before ini_set('track_errors', $track_errors); // Return the result return $res; } /** * Retrieve the file size of the path * * @return mixed * * @since 11.1 */ public function filesize() { if (!$this->filename) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN')); return false; } $retval = false; // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $res = @filesize($this->filename); if (!$res) { $tmp_error = ''; if ($php_errormsg) { // Something went wrong. // Store the error in case we need it. $tmp_error = $php_errormsg; } $res = JFilesystemHelper::remotefsize($this->filename); if (!$res) { if ($tmp_error) { // Use the php_errormsg from before $this->setError($tmp_error); } else { // Error but nothing from php? How strange! Create our own $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_SIZE')); } } else { $this->filesize = $res; $retval = $res; } } else { $this->filesize = $res; $retval = $res; } // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); // Return the result return $retval; } /** * Get a line from the stream source. * * @param integer $length The number of bytes (optional) to read. * * @return mixed * * @since 11.1 */ public function gets($length = 0) { if (!$this->fh) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN')); return false; } $retval = false; // Capture PHP errors $php_errormsg = 'Error Unknown'; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); switch ($this->processingmethod) { case 'gz': $res = $length ? gzgets($this->fh, $length) : gzgets($this->fh); break; case 'bz': case 'f': default: $res = $length ? fgets($this->fh, $length) : fgets($this->fh); break; } if (!$res) { $this->setError($php_errormsg); } else { $retval = $res; } // Restore error tracking to what it was before ini_set('track_errors', $track_errors); // Return the result return $retval; } /** * Read a file * * Handles user space streams appropriately otherwise any read will return 8192 * * @param integer $length Length of data to read * * @return mixed * * @see http://php.net/manual/en/function.fread.php * @since 11.1 */ public function read($length = 0) { if (!$this->filesize && !$length) { // Get the filesize $this->filesize(); if (!$this->filesize) { // Set it to the biggest and then wait until eof $length = -1; } else { $length = $this->filesize; } } if (!$this->fh) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN')); return false; } $retval = false; // Capture PHP errors $php_errormsg = 'Error Unknown'; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $remaining = $length; do { // Do chunked reads where relevant switch ($this->processingmethod) { case 'bz': $res = ($remaining > 0) ? bzread($this->fh, $remaining) : bzread($this->fh, $this->chunksize); break; case 'gz': $res = ($remaining > 0) ? gzread($this->fh, $remaining) : gzread($this->fh, $this->chunksize); break; case 'f': default: $res = ($remaining > 0) ? fread($this->fh, $remaining) : fread($this->fh, $this->chunksize); break; } if (!$res) { $this->setError($php_errormsg); // Jump from the loop $remaining = 0; } else { if (!$retval) { $retval = ''; } $retval .= $res; if (!$this->eof()) { $len = strlen($res); $remaining -= $len; } else { // If it's the end of the file then we've nothing left to read; reset remaining and len $remaining = 0; $length = strlen($retval); } } } while ($remaining || !$length); // Restore error tracking to what it was before ini_set('track_errors', $track_errors); // Return the result return $retval; } /** * Seek the file * * Note: the return value is different to that of fseek * * @param integer $offset Offset to use when seeking. * @param integer $whence Seek mode to use. * * @return boolean True on success, false on failure * * @see http://php.net/manual/en/function.fseek.php * @since 11.1 */ public function seek($offset, $whence = SEEK_SET) { if (!$this->fh) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN')); return false; } $retval = false; // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); switch ($this->processingmethod) { case 'gz': $res = gzseek($this->fh, $offset, $whence); break; case 'bz': case 'f': default: $res = fseek($this->fh, $offset, $whence); break; } // Seek, interestingly, returns 0 on success or -1 on failure. if ($res == -1) { $this->setError($php_errormsg); } else { $retval = true; } // Restore error tracking to what it was before ini_set('track_errors', $track_errors); // Return the result return $retval; } /** * Returns the current position of the file read/write pointer. * * @return mixed * * @since 11.1 */ public function tell() { if (!$this->fh) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN')); return false; } // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); switch ($this->processingmethod) { case 'gz': $res = gztell($this->fh); break; case 'bz': case 'f': default: $res = ftell($this->fh); break; } // May return 0 so check if it's really false if ($res === false) { $this->setError($php_errormsg); } // Restore error tracking to what it was before ini_set('track_errors', $track_errors); // Return the result return $res; } /** * File write * * Whilst this function accepts a reference, the underlying fwrite * will do a copy! This will roughly double the memory allocation for * any write you do. Specifying chunked will get around this by only * writing in specific chunk sizes. This defaults to 8192 which is a * sane number to use most of the time (change the default with * JStream::set('chunksize', newsize);) * Note: This doesn't support gzip/bzip2 writing like reading does * * @param string &$string Reference to the string to write. * @param integer $length Length of the string to write. * @param integer $chunk Size of chunks to write in. * * @return boolean * * @see http://php.net/manual/en/function.fwrite.php * @since 11.1 */ public function write(&$string, $length = 0, $chunk = 0) { if (!$this->fh) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN')); return false; } // If the length isn't set, set it to the length of the string. if (!$length) { $length = strlen($string); } // If the chunk isn't set, set it to the default. if (!$chunk) { $chunk = $this->chunksize; } $retval = true; // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $remaining = $length; $start = 0; do { // If the amount remaining is greater than the chunk size, then use the chunk $amount = ($remaining > $chunk) ? $chunk : $remaining; $res = fwrite($this->fh, substr($string, $start), $amount); // Returns false on error or the number of bytes written if ($res === false) { // Returned error $this->setError($php_errormsg); $retval = false; $remaining = 0; } elseif ($res === 0) { // Wrote nothing? $remaining = 0; $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_NO_DATA_WRITTEN')); } else { // Wrote something $start += $amount; $remaining -= $res; } } while ($remaining); // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); // Return the result return $retval; } /** * Chmod wrapper * * @param string $filename File name. * @param mixed $mode Mode to use. * * @return boolean * * @since 11.1 */ public function chmod($filename = '', $mode = 0) { if (!$filename) { if (!isset($this->filename) || !$this->filename) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILENAME')); return false; } $filename = $this->filename; } // If no mode is set use the default if (!$mode) { $mode = $this->filemode; } $retval = false; // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $sch = parse_url($filename, PHP_URL_SCHEME); // Scheme specific options; ftp's chmod support is fun. switch ($sch) { case 'ftp': case 'ftps': $res = JFilesystemHelper::ftpChmod($filename, $mode); break; default: $res = chmod($filename, $mode); break; } // Seek, interestingly, returns 0 on success or -1 on failure if (!$res) { $this->setError($php_errormsg); } else { $retval = true; } // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); // Return the result return $retval; } /** * Get the stream metadata * * @return array header/metadata * * @see http://php.net/manual/en/function.stream-get-meta-data.php * @since 11.1 */ public function get_meta_data() { if (!$this->fh) { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN')); return false; } return stream_get_meta_data($this->fh); } /** * Stream contexts * Builds the context from the array * * @return mixed * * @since 11.1 */ public function _buildContext() { // According to the manual this always works! if (count($this->contextOptions)) { $this->context = @stream_context_create($this->contextOptions); } else { $this->context = null; } } /** * Updates the context to the array * * Format is the same as the options for stream_context_create * * @param array $context Options to create the context with * * @return void * * @see http://php.net/stream_context_create * @since 11.1 */ public function setContextOptions($context) { $this->contextOptions = $context; $this->_buildContext(); } /** * Adds a particular options to the context * * @param string $wrapper The wrapper to use * @param string $name The option to set * @param string $value The value of the option * * @return void * * @see http://php.net/stream_context_create Stream Context Creation * @see http://php.net/manual/en/context.php Context Options for various streams * @since 11.1 */ public function addContextEntry($wrapper, $name, $value) { $this->contextOptions[$wrapper][$name] = $value; $this->_buildContext(); } /** * Deletes a particular setting from a context * * @param string $wrapper The wrapper to use * @param string $name The option to unset * * @return void * * @see http://php.net/stream_context_create * @since 11.1 */ public function deleteContextEntry($wrapper, $name) { // Check whether the wrapper is set if (isset($this->contextOptions[$wrapper])) { // Check that entry is set for that wrapper if (isset($this->contextOptions[$wrapper][$name])) { // Unset the item unset($this->contextOptions[$wrapper][$name]); // Check that there are still items there if (!count($this->contextOptions[$wrapper])) { // Clean up an empty wrapper context option unset($this->contextOptions[$wrapper]); } } } // Rebuild the context and apply it to the stream $this->_buildContext(); } /** * Applies the current context to the stream * * Use this to change the values of the context after you've opened a stream * * @return mixed * * @since 11.1 */ public function applyContextToStream() { $retval = false; if ($this->fh) { // Capture PHP errors $php_errormsg = 'Unknown error setting context option'; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $retval = @stream_context_set_option($this->fh, $this->contextOptions); if (!$retval) { $this->setError($php_errormsg); } // Restore error tracking to what it was before ini_set('track_errors', $track_errors); } return $retval; } /** * Stream filters * Append a filter to the chain * * @param string $filtername The key name of the filter. * @param integer $read_write Optional. Defaults to STREAM_FILTER_READ. * @param array $params An array of params for the stream_filter_append call. * * @return mixed * * @see http://php.net/manual/en/function.stream-filter-append.php * @since 11.1 */ public function appendFilter($filtername, $read_write = STREAM_FILTER_READ, $params = array()) { $res = false; if ($this->fh) { // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $res = @stream_filter_append($this->fh, $filtername, $read_write, $params); if (!$res && $php_errormsg) { $this->setError($php_errormsg); } else { $this->filters[] = &$res; } // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); } return $res; } /** * Prepend a filter to the chain * * @param string $filtername The key name of the filter. * @param integer $read_write Optional. Defaults to STREAM_FILTER_READ. * @param array $params An array of params for the stream_filter_prepend call. * * @return mixed * * @see http://php.net/manual/en/function.stream-filter-prepend.php * @since 11.1 */ public function prependFilter($filtername, $read_write = STREAM_FILTER_READ, $params = array()) { $res = false; if ($this->fh) { // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $res = @stream_filter_prepend($this->fh, $filtername, $read_write, $params); if (!$res && $php_errormsg) { // Set the error msg $this->setError($php_errormsg); } else { array_unshift($res, ''); $res[0] = &$this->filters; } // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); } return $res; } /** * Remove a filter, either by resource (handed out from the append or prepend function) * or via getting the filter list) * * @param resource &$resource The resource. * @param boolean $byindex The index of the filter. * * @return boolean Result of operation * * @since 11.1 */ public function removeFilter(&$resource, $byindex = false) { // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); if ($byindex) { $res = stream_filter_remove($this->filters[$resource]); } else { $res = stream_filter_remove($resource); } if ($res && $php_errormsg) { $this->setError($php_errormsg); } // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); return $res; } /** * Copy a file from src to dest * * @param string $src The file path to copy from. * @param string $dest The file path to copy to. * @param resource $context A valid context resource (optional) created with stream_context_create. * @param boolean $use_prefix Controls the use of a prefix (optional). * @param boolean $relative Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. * * @return mixed * * @since 11.1 */ public function copy($src, $dest, $context = null, $use_prefix = true, $relative = false) { // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $chmodDest = $this->_getFilename($dest, 'w', $use_prefix, $relative); // Since we're going to open the file directly we need to get the filename. // We need to use the same prefix so force everything to write. $src = $this->_getFilename($src, 'w', $use_prefix, $relative); $dest = $this->_getFilename($dest, 'w', $use_prefix, $relative); if ($context) { // Use the provided context $res = @copy($src, $dest, $context); } elseif ($this->context) { // Use the objects context $res = @copy($src, $dest, $this->context); } else { // Don't use any context $res = @copy($src, $dest); } if (!$res && $php_errormsg) { $this->setError($php_errormsg); } else { $this->chmod($chmodDest); } // Restore error tracking to what it was before ini_set('track_errors', $track_errors); return $res; } /** * Moves a file * * @param string $src The file path to move from. * @param string $dest The file path to move to. * @param resource $context A valid context resource (optional) created with stream_context_create. * @param boolean $use_prefix Controls the use of a prefix (optional). * @param boolean $relative Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. * * @return mixed * * @since 11.1 */ public function move($src, $dest, $context = null, $use_prefix = true, $relative = false) { // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $src = $this->_getFilename($src, 'w', $use_prefix, $relative); $dest = $this->_getFilename($dest, 'w', $use_prefix, $relative); if ($context) { // Use the provided context $res = @rename($src, $dest, $context); } elseif ($this->context) { // Use the object's context $res = @rename($src, $dest, $this->context); } else { // Don't use any context $res = @rename($src, $dest); } if (!$res && $php_errormsg) { $this->setError($php_errormsg()); } $this->chmod($dest); // Restore error tracking to what it was before ini_set('track_errors', $track_errors); return $res; } /** * Delete a file * * @param string $filename The file path to delete. * @param resource $context A valid context resource (optional) created with stream_context_create. * @param boolean $use_prefix Controls the use of a prefix (optional). * @param boolean $relative Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. * * @return mixed * * @since 11.1 */ public function delete($filename, $context = null, $use_prefix = true, $relative = false) { // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); $filename = $this->_getFilename($filename, 'w', $use_prefix, $relative); if ($context) { // Use the provided context $res = @unlink($filename, $context); } elseif ($this->context) { // Use the object's context $res = @unlink($filename, $this->context); } else { // Don't use any context $res = @unlink($filename); } if (!$res && $php_errormsg) { $this->setError($php_errormsg()); } // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); return $res; } /** * Upload a file * * @param string $src The file path to copy from (usually a temp folder). * @param string $dest The file path to copy to. * @param resource $context A valid context resource (optional) created with stream_context_create. * @param boolean $use_prefix Controls the use of a prefix (optional). * @param boolean $relative Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. * * @return mixed * * @since 11.1 */ public function upload($src, $dest, $context = null, $use_prefix = true, $relative = false) { if (is_uploaded_file($src)) { // Make sure it's an uploaded file return $this->copy($src, $dest, $context, $use_prefix, $relative); } else { $this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_NOT_UPLOADED_FILE')); return false; } } /** * Writes a chunk of data to a file. * * @param string $filename The file name. * @param string &$buffer The data to write to the file. * * @return boolean * * @since 11.1 */ public function writeFile($filename, &$buffer) { if ($this->open($filename, 'w')) { $result = $this->write($buffer); $this->chmod(); $this->close(); return $result; } return false; } /** * Determine the appropriate 'filename' of a file * * @param string $filename Original filename of the file * @param string $mode Mode string to retrieve the filename * @param boolean $use_prefix Controls the use of a prefix * @param boolean $relative Determines if the filename given is relative. Relative paths do not have JPATH_ROOT stripped. * * @return string * * @since 11.1 */ public function _getFilename($filename, $mode, $use_prefix, $relative) { if ($use_prefix) { // Get rid of binary or t, should be at the end of the string $tmode = trim($mode, 'btf123456789'); // Check if it's a write mode then add the appropriate prefix // Get rid of JPATH_ROOT (legacy compat) along the way if (in_array($tmode, JFilesystemHelper::getWriteModes())) { if (!$relative && $this->writeprefix) { $filename = str_replace(JPATH_ROOT, '', $filename); } $filename = $this->writeprefix . $filename; } else { if (!$relative && $this->readprefix) { $filename = str_replace(JPATH_ROOT, '', $filename); } $filename = $this->readprefix . $filename; } } return $filename; } /** * Return the internal file handle * * @return File handler * * @since 11.1 */ public function getFileHandle() { return $this->fh; } } PK���\X�I���8libraries/joomla/filesystem/support/stringcontroller.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage FileSystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * String Controller * * @since 11.1 */ class JStringController { /** * Defines a variable as an array * * @return array * * @since 11.1 */ public function _getArray() { static $strings = array(); return $strings; } /** * Create a reference * * @param string $reference The key * @param string &$string The value * * @return void * * @since 11.1 */ public function createRef($reference, &$string) { $ref = &self::_getArray(); $ref[$reference] = & $string; } /** * Get reference * * @param string $reference The key for the reference. * * @return mixed False if not set, reference if it it exists * * @since 11.1 */ public function getRef($reference) { $ref = &self::_getArray(); if (isset($ref[$reference])) { return $ref[$reference]; } else { return false; } } } PK���\0��J))$libraries/joomla/filesystem/path.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage FileSystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; if (!defined('JPATH_ROOT')) { // Define a string constant for the root directory of the file system in native format $pathHelper = new JFilesystemWrapperPath; define('JPATH_ROOT', $pathHelper->clean(JPATH_SITE)); } /** * A Path handling class * * @since 11.1 */ class JPath { /** * Checks if a path's permissions can be changed. * * @param string $path Path to check. * * @return boolean True if path can have mode changed. * * @since 11.1 */ public static function canChmod($path) { $perms = fileperms($path); if ($perms !== false) { if (@chmod($path, $perms ^ 0001)) { @chmod($path, $perms); return true; } } return false; } /** * Chmods files and directories recursively to given permissions. * * @param string $path Root path to begin changing mode [without trailing slash]. * @param string $filemode Octal representation of the value to change file mode to [null = no change]. * @param string $foldermode Octal representation of the value to change folder mode to [null = no change]. * * @return boolean True if successful [one fail means the whole operation failed]. * * @since 11.1 */ public static function setPermissions($path, $filemode = '0644', $foldermode = '0755') { // Initialise return value $ret = true; if (is_dir($path)) { $dh = opendir($path); while ($file = readdir($dh)) { if ($file != '.' && $file != '..') { $fullpath = $path . '/' . $file; if (is_dir($fullpath)) { if (!self::setPermissions($fullpath, $filemode, $foldermode)) { $ret = false; } } else { if (isset($filemode)) { if (!@ chmod($fullpath, octdec($filemode))) { $ret = false; } } } } } closedir($dh); if (isset($foldermode)) { if (!@ chmod($path, octdec($foldermode))) { $ret = false; } } } else { if (isset($filemode)) { $ret = @ chmod($path, octdec($filemode)); } } return $ret; } /** * Get the permissions of the file/folder at a given path. * * @param string $path The path of a file/folder. * * @return string Filesystem permissions. * * @since 11.1 */ public static function getPermissions($path) { $path = self::clean($path); $mode = @ decoct(@ fileperms($path) & 0777); if (strlen($mode) < 3) { return '---------'; } $parsed_mode = ''; for ($i = 0; $i < 3; $i++) { // Read $parsed_mode .= ($mode{$i} & 04) ? "r" : "-"; // Write $parsed_mode .= ($mode{$i} & 02) ? "w" : "-"; // Execute $parsed_mode .= ($mode{$i} & 01) ? "x" : "-"; } return $parsed_mode; } /** * Checks for snooping outside of the file system root. * * @param string $path A file system path to check. * * @return string A cleaned version of the path or exit on error. * * @since 11.1 * @throws Exception */ public static function check($path) { if (strpos($path, '..') !== false) { // Don't translate throw new Exception('JPath::check Use of relative paths not permitted', 20); } $path = self::clean($path); if ((JPATH_ROOT != '') && strpos($path, self::clean(JPATH_ROOT)) !== 0) { throw new Exception('JPath::check Snooping out of bounds @ ' . $path, 20); } return $path; } /** * Function to strip additional / or \ in a path name. * * @param string $path The path to clean. * @param string $ds Directory separator (optional). * * @return string The cleaned path. * * @since 11.1 * @throws UnexpectedValueException */ public static function clean($path, $ds = DIRECTORY_SEPARATOR) { if (!is_string($path) && !empty($path)) { throw new UnexpectedValueException('JPath::clean: $path is not a string.'); } $path = trim($path); if (empty($path)) { $path = JPATH_ROOT; } // Remove double slashes and backslashes and convert all slashes and backslashes to DIRECTORY_SEPARATOR // If dealing with a UNC path don't forget to prepend the path with a backslash. elseif (($ds == '\\') && ($path[0] == '\\' ) && ( $path[1] == '\\' )) { $path = "\\" . preg_replace('#[/\\\\]+#', $ds, $path); } else { $path = preg_replace('#[/\\\\]+#', $ds, $path); } return $path; } /** * Method to determine if script owns the path. * * @param string $path Path to check ownership. * * @return boolean True if the php script owns the path passed. * * @since 11.1 */ public static function isOwner($path) { jimport('joomla.filesystem.file'); $tmp = md5(JCrypt::genRandomBytes()); $ssp = ini_get('session.save_path'); $jtp = JPATH_SITE . '/tmp'; // Try to find a writable directory $dir = is_writable('/tmp') ? '/tmp' : false; $dir = (!$dir && is_writable($ssp)) ? $ssp : false; $dir = (!$dir && is_writable($jtp)) ? $jtp : false; if ($dir) { $fileObject = new JFilesystemWrapperFile; $test = $dir . '/' . $tmp; // Create the test file $blank = ''; $fileObject->write($test, $blank, false); // Test ownership $return = (fileowner($test) == fileowner($path)); // Delete the test file $fileObject->delete($test); return $return; } return false; } /** * Searches the directory paths for a given file. * * @param mixed $paths An path string or array of path strings to search in * @param string $file The file name to look for. * * @return mixed The full path and file name for the target file, or boolean false if the file is not found in any of the paths. * * @since 11.1 */ public static function find($paths, $file) { // Force to array if (!is_array($paths) && !($paths instanceof Iterator)) { settype($paths, 'array'); } // Start looping through the path set foreach ($paths as $path) { // Get the path to the file $fullname = $path . '/' . $file; // Is the path based on a stream? if (strpos($path, '://') === false) { // Not a stream, so do a realpath() to avoid directory // traversal attempts on the local file system. // Needed for substr() later $path = realpath($path); $fullname = realpath($fullname); } /* * The substr() check added to make sure that the realpath() * results in a directory registered so that * non-registered directories are not accessible via directory * traversal attempts. */ if (file_exists($fullname) && substr($fullname, 0, strlen($path)) == $path) { return $fullname; } } // Could not find the file in the set of paths return false; } } PK���\��V��&libraries/joomla/filesystem/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage FileSystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * File system helper * * Holds support functions for the filesystem, particularly the stream * * @since 11.1 */ class JFilesystemHelper { /** * Remote file size function for streams that don't support it * * @param string $url TODO Add text * * @return mixed * * @see http://www.php.net/manual/en/function.filesize.php#71098 * @since 11.1 */ public static function remotefsize($url) { $sch = parse_url($url, PHP_URL_SCHEME); if (($sch != 'http') && ($sch != 'https') && ($sch != 'ftp') && ($sch != 'ftps')) { return false; } if (($sch == 'http') || ($sch == 'https')) { $headers = get_headers($url, 1); if ((!array_key_exists('Content-Length', $headers))) { return false; } return $headers['Content-Length']; } if (($sch == 'ftp') || ($sch == 'ftps')) { $server = parse_url($url, PHP_URL_HOST); $port = parse_url($url, PHP_URL_PORT); $path = parse_url($url, PHP_URL_PATH); $user = parse_url($url, PHP_URL_USER); $pass = parse_url($url, PHP_URL_PASS); if ((!$server) || (!$path)) { return false; } if (!$port) { $port = 21; } if (!$user) { $user = 'anonymous'; } if (!$pass) { $pass = ''; } switch ($sch) { case 'ftp': $ftpid = ftp_connect($server, $port); break; case 'ftps': $ftpid = ftp_ssl_connect($server, $port); break; } if (!$ftpid) { return false; } $login = ftp_login($ftpid, $user, $pass); if (!$login) { return false; } $ftpsize = ftp_size($ftpid, $path); ftp_close($ftpid); if ($ftpsize == -1) { return false; } return $ftpsize; } } /** * Quick FTP chmod * * @param string $url Link identifier * @param integer $mode The new permissions, given as an octal value. * * @return mixed * * @see http://www.php.net/manual/en/function.ftp-chmod.php * @since 11.1 */ public static function ftpChmod($url, $mode) { $sch = parse_url($url, PHP_URL_SCHEME); if (($sch != 'ftp') && ($sch != 'ftps')) { return false; } $server = parse_url($url, PHP_URL_HOST); $port = parse_url($url, PHP_URL_PORT); $path = parse_url($url, PHP_URL_PATH); $user = parse_url($url, PHP_URL_USER); $pass = parse_url($url, PHP_URL_PASS); if ((!$server) || (!$path)) { return false; } if (!$port) { $port = 21; } if (!$user) { $user = 'anonymous'; } if (!$pass) { $pass = ''; } switch ($sch) { case 'ftp': $ftpid = ftp_connect($server, $port); break; case 'ftps': $ftpid = ftp_ssl_connect($server, $port); break; } if (!$ftpid) { return false; } $login = ftp_login($ftpid, $user, $pass); if (!$login) { return false; } $res = ftp_chmod($ftpid, $mode, $path); ftp_close($ftpid); return $res; } /** * Modes that require a write operation * * @return array * * @since 11.1 */ public static function getWriteModes() { return array('w', 'w+', 'a', 'a+', 'r+', 'x', 'x+'); } /** * Stream and Filter Support Operations * * Returns the supported streams, in addition to direct file access * Also includes Joomla! streams as well as PHP streams * * @return array Streams * * @since 11.1 */ public static function getSupported() { // Really quite cool what php can do with arrays when you let it... static $streams; if (!$streams) { $streams = array_merge(stream_get_wrappers(), self::getJStreams()); } return $streams; } /** * Returns a list of transports * * @return array * * @since 11.1 */ public static function getTransports() { // Is this overkill? return stream_get_transports(); } /** * Returns a list of filters * * @return array * * @since 11.1 */ public static function getFilters() { // Note: This will look like the getSupported() function with J! filters. // TODO: add user space filter loading like user space stream loading return stream_get_filters(); } /** * Returns a list of J! streams * * @return array * * @since 11.1 */ public static function getJStreams() { static $streams = array(); if (!$streams) { $files = new DirectoryIterator(__DIR__ . '/streams'); /* @type $file DirectoryIterator */ foreach ($files as $file) { // Only load for php files. if (!$file->isFile() || $file->getExtension() !== 'php') { continue; } $streams[] = $file->getBasename('.php'); } } return $streams; } /** * Determine if a stream is a Joomla stream. * * @param string $streamname The name of a stream * * @return boolean True for a Joomla Stream * * @since 11.1 */ public static function isJoomlaStream($streamname) { return in_array($streamname, self::getJStreams()); } /** * Calculates the maximum upload file size and returns string with unit or the size in bytes * * Call it with JFilesystemHelper::fileUploadMaxSize(); * * @param bool $unit_output This parameter determines whether the return value should be a string with a unit * * @return float|string The maximum upload size of files with the appropriate unit or in bytes * * @since 3.4 */ public static function fileUploadMaxSize($unit_output = true) { static $max_size = false; static $output_type = true; if ($max_size === false || $output_type != $unit_output) { $max_size = self::parseSize(ini_get('post_max_size')); $upload_max = self::parseSize(ini_get('upload_max_filesize')); if ($upload_max > 0 && ($upload_max < $max_size || $max_size == 0)) { $max_size = $upload_max; } if ($unit_output == true) { $max_size = self::parseSizeUnit($max_size); } $output_type = $unit_output; } return $max_size; } /** * Returns the size in bytes without the unit for the comparison * * @param string $size The size which is received from the PHP settings * * @return float The size in bytes without the unit * * @since 3.4 */ private static function parseSize($size) { $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); $size = preg_replace('/[^0-9\.]/', '', $size); $return = round($size); if ($unit) { $return = round($size * pow(1024, stripos('bkmgtpezy', $unit[0]))); } return $return; } /** * Creates the rounded size of the size with the appropriate unit * * @param float $max_size The maximum size which is allowed for the uploads * * @return string String with the size and the appropriate unit * * @since 3.4 */ private static function parseSizeUnit($max_size) { $base = log($max_size) / log(1024); $suffixes = array('', 'k', 'M', 'G', 'T'); return round(pow(1024, $base - floor($base)), 0) . $suffixes[floor($base)]; } } PK���\�w��<6<6$libraries/joomla/filesystem/file.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage FileSystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * A File handling class * * @since 11.1 */ class JFile { /** * Gets the extension of a file name * * @param string $file The file name * * @return string The file extension * * @since 11.1 */ public static function getExt($file) { $dot = strrpos($file, '.') + 1; return substr($file, $dot); } /** * Strips the last extension off of a file name * * @param string $file The file name * * @return string The file name without the extension * * @since 11.1 */ public static function stripExt($file) { return preg_replace('#\.[^.]*$#', '', $file); } /** * Makes file name safe to use * * @param string $file The name of the file [not full path] * * @return string The sanitised string * * @since 11.1 */ public static function makeSafe($file) { // Remove any trailing dots, as those aren't ever valid file names. $file = rtrim($file, '.'); $regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#'); return trim(preg_replace($regex, '', $file)); } /** * Copies a file * * @param string $src The path to the source file * @param string $dest The path to the destination file * @param string $path An optional base path to prefix to the file names * @param boolean $use_streams True to use streams * * @return boolean True on success * * @since 11.1 */ public static function copy($src, $dest, $path = null, $use_streams = false) { $pathObject = new JFilesystemWrapperPath; // Prepend a base path if it exists if ($path) { $src = $pathObject->clean($path . '/' . $src); $dest = $pathObject->clean($path . '/' . $dest); } // Check src path if (!is_readable($src)) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_FIND_COPY', $src), JLog::WARNING, 'jerror'); return false; } if ($use_streams) { $stream = JFactory::getStream(); if (!$stream->copy($src, $dest)) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_STREAMS', $src, $dest, $stream->getError()), JLog::WARNING, 'jerror'); return false; } return true; } else { $FTPOptions = JClientHelper::getCredentials('ftp'); if ($FTPOptions['enabled'] == 1) { // Connect the FTP client $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); // If the parent folder doesn't exist we must create it if (!file_exists(dirname($dest))) { $folderObject = new JFilesystemWrapperFolder; $folderObject->create(dirname($dest)); } // Translate the destination path for the FTP account $dest = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $dest), '/'); if (!$ftp->store($src, $dest)) { // FTP connector throws an error return false; } $ret = true; } else { if (!@ copy($src, $dest)) { JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_COPY_FAILED'), JLog::WARNING, 'jerror'); return false; } $ret = true; } return $ret; } } /** * Delete a file or array of files * * @param mixed $file The file name or an array of file names * * @return boolean True on success * * @since 11.1 */ public static function delete($file) { $FTPOptions = JClientHelper::getCredentials('ftp'); $pathObject = new JFilesystemWrapperPath; if (is_array($file)) { $files = $file; } else { $files[] = $file; } // Do NOT use ftp if it is not enabled if ($FTPOptions['enabled'] == 1) { // Connect the FTP client $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); } foreach ($files as $file) { $file = $pathObject->clean($file); if (!is_file($file)) { continue; } // Try making the file writable first. If it's read-only, it can't be deleted // on Windows, even if the parent folder is writable @chmod($file, 0777); // In case of restricted permissions we zap it one way or the other // as long as the owner is either the webserver or the ftp if (@unlink($file)) { // Do nothing } elseif ($FTPOptions['enabled'] == 1) { $file = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $file), '/'); if (!$ftp->delete($file)) { // FTP connector throws an error return false; } } else { $filename = basename($file); JLog::add(JText::sprintf('JLIB_FILESYSTEM_DELETE_FAILED', $filename), JLog::WARNING, 'jerror'); return false; } } return true; } /** * Moves a file * * @param string $src The path to the source file * @param string $dest The path to the destination file * @param string $path An optional base path to prefix to the file names * @param boolean $use_streams True to use streams * * @return boolean True on success * * @since 11.1 */ public static function move($src, $dest, $path = '', $use_streams = false) { $pathObject = new JFilesystemWrapperPath; if ($path) { $src = $pathObject->clean($path . '/' . $src); $dest = $pathObject->clean($path . '/' . $dest); } // Check src path if (!is_readable($src)) { JLog::add(JText::_('JLIB_FILESYSTEM_CANNOT_FIND_SOURCE_FILE'), JLog::WARNING, 'jerror'); return false; } if ($use_streams) { $stream = JFactory::getStream(); if (!$stream->move($src, $dest)) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_JFILE_MOVE_STREAMS', $stream->getError()), JLog::WARNING, 'jerror'); return false; } return true; } else { $FTPOptions = JClientHelper::getCredentials('ftp'); if ($FTPOptions['enabled'] == 1) { // Connect the FTP client $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); // Translate path for the FTP account $src = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $src), '/'); $dest = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $dest), '/'); // Use FTP rename to simulate move if (!$ftp->rename($src, $dest)) { JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'), JLog::WARNING, 'jerror'); return false; } } else { if (!@ rename($src, $dest)) { JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'), JLog::WARNING, 'jerror'); return false; } } return true; } } /** * Read the contents of a file * * @param string $filename The full file path * @param boolean $incpath Use include path * @param integer $amount Amount of file to read * @param integer $chunksize Size of chunks to read * @param integer $offset Offset of the file * * @return mixed Returns file contents or boolean False if failed * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) - Use the native file_get_contents() instead. */ public static function read($filename, $incpath = false, $amount = 0, $chunksize = 8192, $offset = 0) { JLog::add(__METHOD__ . ' is deprecated. Use native file_get_contents() syntax.', JLog::WARNING, 'deprecated'); $data = null; if ($amount && $chunksize > $amount) { $chunksize = $amount; } if (false === $fh = fopen($filename, 'rb', $incpath)) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_READ_UNABLE_TO_OPEN_FILE', $filename), JLog::WARNING, 'jerror'); return false; } clearstatcache(); if ($offset) { fseek($fh, $offset); } if ($fsize = @ filesize($filename)) { if ($amount && $fsize > $amount) { $data = fread($fh, $amount); } else { $data = fread($fh, $fsize); } } else { $data = ''; /* * While it's: * 1: Not the end of the file AND * 2a: No Max Amount set OR * 2b: The length of the data is less than the max amount we want */ while (!feof($fh) && (!$amount || strlen($data) < $amount)) { $data .= fread($fh, $chunksize); } } fclose($fh); return $data; } /** * Write contents to a file * * @param string $file The full file path * @param string &$buffer The buffer to write * @param boolean $use_streams Use streams * * @return boolean True on success * * @since 11.1 */ public static function write($file, &$buffer, $use_streams = false) { @set_time_limit(ini_get('max_execution_time')); // If the destination directory doesn't exist we need to create it if (!file_exists(dirname($file))) { $folderObject = new JFilesystemWrapperFolder; if ($folderObject->create(dirname($file)) == false) { return false; } } if ($use_streams) { $stream = JFactory::getStream(); // Beef up the chunk size to a meg $stream->set('chunksize', (1024 * 1024)); if (!$stream->writeFile($file, $buffer)) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WRITE_STREAMS', $file, $stream->getError()), JLog::WARNING, 'jerror'); return false; } return true; } else { $FTPOptions = JClientHelper::getCredentials('ftp'); $pathObject = new JFilesystemWrapperPath; if ($FTPOptions['enabled'] == 1) { // Connect the FTP client $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); // Translate path for the FTP account and use FTP write buffer to file $file = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $file), '/'); $ret = $ftp->write($file, $buffer); } else { $file = $pathObject->clean($file); $ret = is_int(file_put_contents($file, $buffer)) ? true : false; } return $ret; } } /** * Moves an uploaded file to a destination folder * * @param string $src The name of the php (temporary) uploaded file * @param string $dest The path (including filename) to move the uploaded file to * @param boolean $use_streams True to use streams * @param boolean $allow_unsafe Allow the upload of unsafe files * @param boolean $safeFileOptions Options to JFilterInput::isSafeFile * * @return boolean True on success * * @since 11.1 */ public static function upload($src, $dest, $use_streams = false, $allow_unsafe = false, $safeFileOptions = array()) { if (!$allow_unsafe) { $descriptor = array( 'tmp_name' => $src, 'name' => basename($dest), 'type' => '', 'error' => '', 'size' => '', ); $isSafe = JFilterInput::isSafeFile($descriptor, $safeFileOptions); if (!$isSafe) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_WARNFS_ERR03', $dest), JLog::WARNING, 'jerror'); return false; } } // Ensure that the path is valid and clean $pathObject = new JFilesystemWrapperPath; $dest = $pathObject->clean($dest); // Create the destination directory if it does not exist $baseDir = dirname($dest); if (!file_exists($baseDir)) { $folderObject = new JFilesystemWrapperFolder; $folderObject->create($baseDir); } if ($use_streams) { $stream = JFactory::getStream(); if (!$stream->upload($src, $dest)) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_UPLOAD', $stream->getError()), JLog::WARNING, 'jerror'); return false; } return true; } else { $FTPOptions = JClientHelper::getCredentials('ftp'); $ret = false; if ($FTPOptions['enabled'] == 1) { // Connect the FTP client $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); // Translate path for the FTP account $dest = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $dest), '/'); // Copy the file to the destination directory if (is_uploaded_file($src) && $ftp->store($src, $dest)) { unlink($src); $ret = true; } else { JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_WARNFS_ERR02'), JLog::WARNING, 'jerror'); } } else { if (is_writeable($baseDir) && move_uploaded_file($src, $dest)) { // Short circuit to prevent file permission errors if ($pathObject->setPermissions($dest)) { $ret = true; } else { JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_WARNFS_ERR01'), JLog::WARNING, 'jerror'); } } else { JLog::add(JText::_('JLIB_FILESYSTEM_ERROR_WARNFS_ERR02'), JLog::WARNING, 'jerror'); } } return $ret; } } /** * Wrapper for the standard file_exists function * * @param string $file File path * * @return boolean True if path is a file * * @since 11.1 */ public static function exists($file) { $pathObject = new JFilesystemWrapperPath; return is_file($pathObject->clean($file)); } /** * Returns the name, without any path. * * @param string $file File path * * @return string filename * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) - Use basename() instead. */ public static function getName($file) { JLog::add(__METHOD__ . ' is deprecated. Use native basename() syntax.', JLog::WARNING, 'deprecated'); // Convert back slashes to forward slashes $file = str_replace('\\', '/', $file); $slash = strrpos($file, '/'); if ($slash !== false) { return substr($file, $slash + 1); } else { return $file; } } } PK���\.04�ll,libraries/joomla/filesystem/wrapper/path.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Filesystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.path'); /** * Wrapper class for JPath * * @package Joomla.Platform * @subpackage Filesystem * @since 3.4 */ class JFilesystemWrapperPath { /** * Helper wrapper method for canChmod * * @param string $path Path to check. * * @return boolean True if path can have mode changed. * * @see JPath::canChmod() * @since 3.4 */ public function canChmod($path) { return JPath::canChmod($path); } /** * Helper wrapper method for setPermissions * * @param string $path Root path to begin changing mode [without trailing slash]. * @param string $filemode Octal representation of the value to change file mode to [null = no change]. * @param string $foldermode Octal representation of the value to change folder mode to [null = no change]. * * @return boolean True if successful [one fail means the whole operation failed]. * * @see JPath::setPermissions() * @since 3.4 */ public function setPermissions($path, $filemode = '0644', $foldermode = '0755') { return JPath::setPermissions($path, $filemode, $foldermode); } /** * Helper wrapper method for getPermissions * * @param string $path The path of a file/folder. * * @return string Filesystem permissions. * * @see JPath::getPermissions() * @since 3.4 */ public function getPermissions($path) { return JPath::getPermissions($path); } /** * Helper wrapper method for check * * @param string $path A file system path to check. * * @return string A cleaned version of the path or exit on error. * * @see JPath::check() * @since 3.4 * @throws Exception */ public function check($path) { return JPath::check($path); } /** * Helper wrapper method for clean * * @param string $path The path to clean. * @param string $ds Directory separator (optional). * * @return string The cleaned path. * * @see JPath::clean() * @since 3.4 * @throws UnexpectedValueException */ public function clean($path, $ds = DIRECTORY_SEPARATOR) { return JPath::clean($path, $ds); } /** * Helper wrapper method for isOwner * * @param string $path Path to check ownership. * * @return boolean True if the php script owns the path passed. * * @see JPath::isOwner() * @since 3.4 */ public function isOwner($path) { return JPath::isOwner($path); } /** * Helper wrapper method for find * * @param mixed $paths An path string or array of path strings to search in * @param string $file The file name to look for. * * @return mixed The full path and file name for the target file, or boolean false if the file is not found in any of the paths. * * @see JPath::find() * @since 3.4 */ public function find($paths, $file) { return JPath::find($paths, $file); } } PK���\�bLuu,libraries/joomla/filesystem/wrapper/file.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Filesystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); /** * Wrapper class for JFile * * @package Joomla.Platform * @subpackage Filesystem * @since 3.4 */ class JFilesystemWrapperFile { /** * Helper wrapper method for getExt * * @param string $file The file name. * * @return string The file extension. * * @see JFile::getExt() * @since 3.4 */ public function getExt($file) { return JFile::getExt($file); } /** * Helper wrapper method for stripExt * * @param string $file The file name. * * @return string The file name without the extension. * * @see JFile::stripExt() * @since 3.4 */ public function stripExt($file) { return JFile::stripExt($file); } /** * Helper wrapper method for makeSafe * * @param string $file The name of the file [not full path]. * * @return string The sanitised string. * * @see JFile::makeSafe() * @since 3.4 */ public function makeSafe($file) { return JFile::makeSafe($file); } /** * Helper wrapper method for copy * * @param string $src The path to the source file. * @param string $dest The path to the destination file. * @param string $path An optional base path to prefix to the file names. * @param boolean $use_streams True to use streams. * * @return boolean True on success. * * @see JFile::copy() * @since 3.4 */ public function copy($src, $dest, $path = null, $use_streams = false) { return JFile::copy($src, $dest, $path, $use_streams); } /** * Helper wrapper method for delete * * @param mixed $file The file name or an array of file names * * @return boolean True on success. * * @see JFile::delete() * @since 3.4 */ public function delete($file) { return JFile::delete($file); } /** * Helper wrapper method for move * * @param string $src The path to the source file. * @param string $dest The path to the destination file. * @param string $path An optional base path to prefix to the file names. * @param boolean $use_streams True to use streams. * * @return boolean True on success. * * @see JFile::move() * @since 3.4 */ public function move($src, $dest, $path = '', $use_streams = false) { return JFile::move($src, $dest, $path, $use_streams); } /** * Helper wrapper method for read * * @param string $filename The full file path. * @param boolean $incpath Use include path. * @param integer $amount Amount of file to read. * @param integer $chunksize Size of chunks to read. * @param integer $offset Offset of the file. * * @return mixed Returns file contents or boolean False if failed. * * @see JFile::read() * @since 3.4 */ public function read($filename, $incpath = false, $amount = 0, $chunksize = 8192, $offset = 0) { return JFile::read($filename, $incpath, $amount, $chunksize, $offset); } /** * Helper wrapper method for write * * @param string $file The full file path. * @param string &$buffer The buffer to write. * @param boolean $use_streams Use streams. * * @return boolean True on success. * * @see JFile::write() * @since 3.4 */ public function write($file, &$buffer, $use_streams = false) { return JFile::write($file, $buffer, $use_streams); } /** * Helper wrapper method for upload * * @param string $src The name of the php (temporary) uploaded file. * @param string $dest The path (including filename) to move the uploaded file to. * @param boolean $use_streams True to use streams. * * @return boolean True on success. * * @see JFile::upload() * @since 3.4 */ public function upload($src, $dest, $use_streams = false) { return JFile::upload($src, $dest, $use_streams); } /** * Helper wrapper method for exists * * @param string $file File path. * * @return boolean True if path is a file. * * @see JFile::exists() * @since 3.4 */ public function exists($file) { return JFile::exists($file); } /** * Helper wrapper method for getName * * @param string $file File path. * * @return string filename. * * @see JFile::getName() * @since 3.4 */ public function getName($file) { return JFile::getName($file); } } PK���\:�����.libraries/joomla/filesystem/wrapper/folder.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Filesystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); /** * Wrapper class for JFilesystemFolder * * @package Joomla.Platform * @subpackage Filesystem * @since 3.4 */ class JFilesystemWrapperFolder { /** * Helper wrapper method for copy * * @param string $src The path to the source folder. * @param string $dest The path to the destination folder. * @param string $path An optional base path to prefix to the file names. * @param boolean $force Force copy. * @param boolean $use_streams Optionally force folder/file overwrites. * * @return boolean True on success. * * @see JFolder::copy() * @since 3.4 * @throws RuntimeException */ public function copy($src, $dest, $path = '', $force = false, $use_streams = false) { return JFolder::copy($src, $dest, $path, $force, $use_streams); } /** * Helper wrapper method for create * * @param string $path A path to create from the base path. * @param integer $mode Directory permissions to set for folders created. 0755 by default. * * @return boolean True if successful. * * @see JFolder::create() * @since 3.4 */ public function create($path = '', $mode = 493) { return JFolder::create($path, $mode); } /** * Helper wrapper method for delete * * @param string $path The path to the folder to delete. * * @return boolean True on success. * * @see JFolder::delete() * @since 3.4 * @throws UnexpectedValueException */ public function delete($path) { return JFolder::delete($path); } /** * Helper wrapper method for move * * @param string $src The path to the source folder. * @param string $dest The path to the destination folder. * @param string $path An optional base path to prefix to the file names. * @param boolean $use_streams Optionally use streams. * * @return mixed Error message on false or boolean true on success. * * @see JFolder::move() * @since 3.4 */ public function move($src, $dest, $path = '', $use_streams = false) { return JFolder::move($src, $dest, $path, $use_streams); } /** * Helper wrapper method for exists * * @param string $path Folder name relative to installation dir. * * @return boolean True if path is a folder. * * @see JFolder::exists() * @since 3.4 */ public function exists($path) { return JFolder::exists($path); } /** * Helper wrapper method for files * * @param string $path The path of the folder to read. * @param string $filter A filter for file names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $full True to return the full path to the file. * @param array $exclude Array with names of files which should not be shown in the result. * @param array $excludefilter Array of filter to exclude. * @param boolean $naturalSort False for asort, true for natsort. * * @return array Files in the given folder. * * @see JFolder::files() * @since 3.4 */ public function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*', '.*~'), $naturalSort = false) { return JFolder::files($path, $filter, $recurse, $full, $exclude, $excludefilter, $naturalSort); } /** * Helper wrapper method for folders * * @param string $path The path of the folder to read. * @param string $filter A filter for folder names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $full True to return the full path to the folders. * @param array $exclude Array with names of folders which should not be shown in the result. * @param array $excludefilter Array with regular expressions matching folders which should not be shown in the result. * * @return array Folders in the given folder. * * @see JFolder::folders() * @since 3.4 */ public function folders($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*')) { return JFolder::folders($path, $filter, $recurse, $full, $exclude, $excludefilter); } /** * Helper wrapper method for listFolderTree * * @param string $path The path of the folder to read. * @param string $filter A filter for folder names. * @param integer $maxLevel The maximum number of levels to recursively read, defaults to three. * @param integer $level The current level, optional. * @param integer $parent Unique identifier of the parent folder, if any. * * @return array Folders in the given folder. * * @see JFolder::listFolderTree() * @since 3.4 */ public function listFolderTree($path, $filter, $maxLevel = 3, $level = 0, $parent = 0) { return JFolder::listFolderTree($path, $filter, $maxLevel, $level, $parent); } /** * Helper wrapper method for makeSafe * * @param string $path The full path to sanitise. * * @return string The sanitised string * * @see JFolder::makeSafe() * @since 3.4 */ public function makeSafe($path) { return JFolder::makeSafe($path); } } PK���\��&/I/I&libraries/joomla/filesystem/folder.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage FileSystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * A Folder handling class * * @since 11.1 */ abstract class JFolder { /** * Copy a folder. * * @param string $src The path to the source folder. * @param string $dest The path to the destination folder. * @param string $path An optional base path to prefix to the file names. * @param boolean $force Force copy. * @param boolean $use_streams Optionally force folder/file overwrites. * * @return boolean True on success. * * @since 11.1 * @throws RuntimeException */ public static function copy($src, $dest, $path = '', $force = false, $use_streams = false) { @set_time_limit(ini_get('max_execution_time')); $FTPOptions = JClientHelper::getCredentials('ftp'); $pathObject = new JFilesystemWrapperPath; if ($path) { $src = $pathObject->clean($path . '/' . $src); $dest = $pathObject->clean($path . '/' . $dest); } // Eliminate trailing directory separators, if any $src = rtrim($src, DIRECTORY_SEPARATOR); $dest = rtrim($dest, DIRECTORY_SEPARATOR); if (!self::exists($src)) { throw new RuntimeException('Source folder not found', -1); } if (self::exists($dest) && !$force) { throw new RuntimeException('Destination folder already exists', -1); } // Make sure the destination exists if (!self::create($dest)) { throw new RuntimeException('Cannot create destination folder', -1); } // If we're using ftp and don't have streams enabled if ($FTPOptions['enabled'] == 1 && !$use_streams) { // Connect the FTP client $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); if (!($dh = @opendir($src))) { throw new RuntimeException('Cannot open source folder', -1); } // Walk through the directory copying files and recursing into folders. while (($file = readdir($dh)) !== false) { $sfid = $src . '/' . $file; $dfid = $dest . '/' . $file; switch (filetype($sfid)) { case 'dir': if ($file != '.' && $file != '..') { $ret = self::copy($sfid, $dfid, null, $force); if ($ret !== true) { return $ret; } } break; case 'file': // Translate path for the FTP account $dfid = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $dfid), '/'); if (!$ftp->store($sfid, $dfid)) { throw new RuntimeException('Copy file failed', -1); } break; } } } else { if (!($dh = @opendir($src))) { throw new RuntimeException('Cannot open source folder', -1); } // Walk through the directory copying files and recursing into folders. while (($file = readdir($dh)) !== false) { $sfid = $src . '/' . $file; $dfid = $dest . '/' . $file; switch (filetype($sfid)) { case 'dir': if ($file != '.' && $file != '..') { $ret = self::copy($sfid, $dfid, null, $force, $use_streams); if ($ret !== true) { return $ret; } } break; case 'file': if ($use_streams) { $stream = JFactory::getStream(); if (!$stream->copy($sfid, $dfid)) { throw new RuntimeException('Cannot copy file: ' . $stream->getError(), -1); } } else { if (!@copy($sfid, $dfid)) { throw new RuntimeException('Copy file failed', -1); } } break; } } } return true; } /** * Create a folder -- and all necessary parent folders. * * @param string $path A path to create from the base path. * @param integer $mode Directory permissions to set for folders created. 0755 by default. * * @return boolean True if successful. * * @since 11.1 */ public static function create($path = '', $mode = 0755) { $FTPOptions = JClientHelper::getCredentials('ftp'); static $nested = 0; // Check to make sure the path valid and clean $pathObject = new JFilesystemWrapperPath; $path = $pathObject->clean($path); // Check if parent dir exists $parent = dirname($path); if (!self::exists($parent)) { // Prevent infinite loops! $nested++; if (($nested > 20) || ($parent == $path)) { JLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_LOOP'), JLog::WARNING, 'jerror'); $nested--; return false; } // Create the parent directory if (self::create($parent, $mode) !== true) { // JFolder::create throws an error $nested--; return false; } // OK, parent directory has been created $nested--; } // Check if dir already exists if (self::exists($path)) { return true; } // Check for safe mode if ($FTPOptions['enabled'] == 1) { // Connect the FTP client $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); // Translate path to FTP path $path = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $path), '/'); $ret = $ftp->mkdir($path); $ftp->chmod($path, $mode); } else { // We need to get and explode the open_basedir paths $obd = ini_get('open_basedir'); // If open_basedir is set we need to get the open_basedir that the path is in if ($obd != null) { if (IS_WIN) { $obdSeparator = ";"; } else { $obdSeparator = ":"; } // Create the array of open_basedir paths $obdArray = explode($obdSeparator, $obd); $inBaseDir = false; // Iterate through open_basedir paths looking for a match foreach ($obdArray as $test) { $test = $pathObject->clean($test); if (strpos($path, $test) === 0) { $inBaseDir = true; break; } } if ($inBaseDir == false) { // Return false for JFolder::create because the path to be created is not in open_basedir JLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_PATH'), JLog::WARNING, 'jerror'); return false; } } // First set umask $origmask = @umask(0); // Create the path if (!$ret = @mkdir($path, $mode)) { @umask($origmask); JLog::add( __METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY') . 'Path: ' . $path, JLog::WARNING, 'jerror' ); return false; } // Reset umask @umask($origmask); } return $ret; } /** * Delete a folder. * * @param string $path The path to the folder to delete. * * @return boolean True on success. * * @since 11.1 * @throws UnexpectedValueException */ public static function delete($path) { @set_time_limit(ini_get('max_execution_time')); $pathObject = new JFilesystemWrapperPath; // Sanity check if (!$path) { // Bad programmer! Bad Bad programmer! JLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_DELETE_BASE_DIRECTORY'), JLog::WARNING, 'jerror'); return false; } $FTPOptions = JClientHelper::getCredentials('ftp'); try { // Check to make sure the path valid and clean $path = $pathObject->clean($path); } catch (UnexpectedValueException $e) { throw $e; } // Is this really a folder? if (!is_dir($path)) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER', $path), JLog::WARNING, 'jerror'); return false; } // Remove all the files in folder if they exist; disable all filtering $files = self::files($path, '.', false, true, array(), array()); if (!empty($files)) { $file = new JFilesystemWrapperFile; if ($file->delete($files) !== true) { // JFile::delete throws an error return false; } } // Remove sub-folders of folder; disable all filtering $folders = self::folders($path, '.', false, true, array(), array()); foreach ($folders as $folder) { if (is_link($folder)) { // Don't descend into linked directories, just delete the link. $file = new JFilesystemWrapperFile; if ($file->delete($folder) !== true) { // JFile::delete throws an error return false; } } elseif (self::delete($folder) !== true) { // JFolder::delete throws an error return false; } } if ($FTPOptions['enabled'] == 1) { // Connect the FTP client $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); } // In case of restricted permissions we zap it one way or the other // as long as the owner is either the webserver or the ftp. if (@rmdir($path)) { $ret = true; } elseif ($FTPOptions['enabled'] == 1) { // Translate path and delete $path = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $path), '/'); // FTP connector throws an error $ret = $ftp->delete($path); } else { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_FOLDER_DELETE', $path), JLog::WARNING, 'jerror'); $ret = false; } return $ret; } /** * Moves a folder. * * @param string $src The path to the source folder. * @param string $dest The path to the destination folder. * @param string $path An optional base path to prefix to the file names. * @param boolean $use_streams Optionally use streams. * * @return mixed Error message on false or boolean true on success. * * @since 11.1 */ public static function move($src, $dest, $path = '', $use_streams = false) { $FTPOptions = JClientHelper::getCredentials('ftp'); $pathObject = new JFilesystemWrapperPath; if ($path) { $src = $pathObject->clean($path . '/' . $src); $dest = $pathObject->clean($path . '/' . $dest); } if (!self::exists($src)) { return JText::_('JLIB_FILESYSTEM_ERROR_FIND_SOURCE_FOLDER'); } if (self::exists($dest)) { return JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_EXISTS'); } if ($use_streams) { $stream = JFactory::getStream(); if (!$stream->move($src, $dest)) { return JText::sprintf('JLIB_FILESYSTEM_ERROR_FOLDER_RENAME', $stream->getError()); } $ret = true; } else { if ($FTPOptions['enabled'] == 1) { // Connect the FTP client $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); // Translate path for the FTP account $src = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $src), '/'); $dest = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $dest), '/'); // Use FTP rename to simulate move if (!$ftp->rename($src, $dest)) { return JText::_('Rename failed'); } $ret = true; } else { if (!@rename($src, $dest)) { return JText::_('Rename failed'); } $ret = true; } } return $ret; } /** * Wrapper for the standard file_exists function * * @param string $path Folder name relative to installation dir * * @return boolean True if path is a folder * * @since 11.1 */ public static function exists($path) { $pathObject = new JFilesystemWrapperPath; return is_dir($pathObject->clean($path)); } /** * Utility function to read the files in a folder. * * @param string $path The path of the folder to read. * @param string $filter A filter for file names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $full True to return the full path to the file. * @param array $exclude Array with names of files which should not be shown in the result. * @param array $excludefilter Array of filter to exclude * @param boolean $naturalSort False for asort, true for natsort * * @return array Files in the given folder. * * @since 11.1 */ public static function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*', '.*~'), $naturalSort = false) { // Check to make sure the path valid and clean $pathObject = new JFilesystemWrapperPath; $path = $pathObject->clean($path); // Is the path a folder? if (!is_dir($path)) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FILES', $path), JLog::WARNING, 'jerror'); return false; } // Compute the excludefilter string if (count($excludefilter)) { $excludefilter_string = '/(' . implode('|', $excludefilter) . ')/'; } else { $excludefilter_string = ''; } // Get the files $arr = self::_items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, true); // Sort the files based on either natural or alpha method if ($naturalSort) { natsort($arr); } else { asort($arr); } return array_values($arr); } /** * Utility function to read the folders in a folder. * * @param string $path The path of the folder to read. * @param string $filter A filter for folder names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $full True to return the full path to the folders. * @param array $exclude Array with names of folders which should not be shown in the result. * @param array $excludefilter Array with regular expressions matching folders which should not be shown in the result. * * @return array Folders in the given folder. * * @since 11.1 */ public static function folders($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*')) { // Check to make sure the path valid and clean $pathObject = new JFilesystemWrapperPath; $path = $pathObject->clean($path); // Is the path a folder? if (!is_dir($path)) { JLog::add(JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FOLDER', $path), JLog::WARNING, 'jerror'); return false; } // Compute the excludefilter string if (count($excludefilter)) { $excludefilter_string = '/(' . implode('|', $excludefilter) . ')/'; } else { $excludefilter_string = ''; } // Get the folders $arr = self::_items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, false); // Sort the folders asort($arr); return array_values($arr); } /** * Function to read the files/folders in a folder. * * @param string $path The path of the folder to read. * @param string $filter A filter for file names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $full True to return the full path to the file. * @param array $exclude Array with names of files which should not be shown in the result. * @param string $excludefilter_string Regexp of files to exclude * @param boolean $findfiles True to read the files, false to read the folders * * @return array Files. * * @since 11.1 */ protected static function _items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, $findfiles) { @set_time_limit(ini_get('max_execution_time')); $arr = array(); // Read the source directory if (!($handle = @opendir($path))) { return $arr; } while (($file = readdir($handle)) !== false) { if ($file != '.' && $file != '..' && !in_array($file, $exclude) && (empty($excludefilter_string) || !preg_match($excludefilter_string, $file))) { // Compute the fullpath $fullpath = $path . '/' . $file; // Compute the isDir flag $isDir = is_dir($fullpath); if (($isDir xor $findfiles) && preg_match("/$filter/", $file)) { // (fullpath is dir and folders are searched or fullpath is not dir and files are searched) and file matches the filter if ($full) { // Full path is requested $arr[] = $fullpath; } else { // Filename is requested $arr[] = $file; } } if ($isDir && $recurse) { // Search recursively if (is_int($recurse)) { // Until depth 0 is reached $arr = array_merge($arr, self::_items($fullpath, $filter, $recurse - 1, $full, $exclude, $excludefilter_string, $findfiles)); } else { $arr = array_merge($arr, self::_items($fullpath, $filter, $recurse, $full, $exclude, $excludefilter_string, $findfiles)); } } } } closedir($handle); return $arr; } /** * Lists folder in format suitable for tree display. * * @param string $path The path of the folder to read. * @param string $filter A filter for folder names. * @param integer $maxLevel The maximum number of levels to recursively read, defaults to three. * @param integer $level The current level, optional. * @param integer $parent Unique identifier of the parent folder, if any. * * @return array Folders in the given folder. * * @since 11.1 */ public static function listFolderTree($path, $filter, $maxLevel = 3, $level = 0, $parent = 0) { $dirs = array(); if ($level == 0) { $GLOBALS['_JFolder_folder_tree_index'] = 0; } if ($level < $maxLevel) { $folders = self::folders($path, $filter); $pathObject = new JFilesystemWrapperPath; // First path, index foldernames foreach ($folders as $name) { $id = ++$GLOBALS['_JFolder_folder_tree_index']; $fullName = $pathObject->clean($path . '/' . $name); $dirs[] = array('id' => $id, 'parent' => $parent, 'name' => $name, 'fullname' => $fullName, 'relname' => str_replace(JPATH_ROOT, '', $fullName)); $dirs2 = self::listFolderTree($fullName, $filter, $maxLevel, $level + 1, $id); $dirs = array_merge($dirs, $dirs2); } } return $dirs; } /** * Makes path name safe to use. * * @param string $path The full path to sanitise. * * @return string The sanitised string. * * @since 11.1 */ public static function makeSafe($path) { $regex = array('#[^A-Za-z0-9_\\\/\(\)\[\]\{\}\#\$\^\+\.\'~`!@&=;,-]#'); return preg_replace($regex, '', $path); } } PK���\7��X-X-'libraries/joomla/filesystem/patcher.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage FileSystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); /** * A Unified Diff Format Patcher class * * @link http://sourceforge.net/projects/phppatcher/ This has been derived from the PhpPatcher version 0.1.1 written by Giuseppe Mazzotta * @since 12.1 */ class JFilesystemPatcher { /** * Regular expression for searching source files */ const SRC_FILE = '/^---\\s+(\\S+)\s+\\d{1,4}-\\d{1,2}-\\d{1,2}\\s+\\d{1,2}:\\d{1,2}:\\d{1,2}(\\.\\d+)?\\s+(\+|-)\\d{4}/A'; /** * Regular expression for searching destination files */ const DST_FILE = '/^\\+\\+\\+\\s+(\\S+)\s+\\d{1,4}-\\d{1,2}-\\d{1,2}\\s+\\d{1,2}:\\d{1,2}:\\d{1,2}(\\.\\d+)?\\s+(\+|-)\\d{4}/A'; /** * Regular expression for searching hunks of differences */ const HUNK = '/@@ -(\\d+)(,(\\d+))?\\s+\\+(\\d+)(,(\\d+))?\\s+@@($)/A'; /** * Regular expression for splitting lines */ const SPLIT = '/(\r\n)|(\r)|(\n)/'; /** * @var array sources files * @since 12.1 */ protected $sources = array(); /** * @var array destination files * @since 12.1 */ protected $destinations = array(); /** * @var array removal files * @since 12.1 */ protected $removals = array(); /** * @var array patches * @since 12.1 */ protected $patches = array(); /** * @var array instance of this class * @since 12.1 */ protected static $instance; /** * Constructor * * The constructor is protected to force the use of JFilesystemPatcher::getInstance() * * @since 12.1 */ protected function __construct() { } /** * Method to get a patcher * * @return JFilesystemPatcher an instance of the patcher * * @since 12.1 */ public static function getInstance() { if (!isset(static::$instance)) { static::$instance = new static; } return static::$instance; } /** * Reset the pacher * * @return JFilesystemPatcher This object for chaining * * @since 12.1 */ public function reset() { $this->sources = array(); $this->destinations = array(); $this->removals = array(); $this->patches = array(); return $this; } /** * Apply the patches * * @return integer The number of files patched * * @since 12.1 * @throws RuntimeException */ public function apply() { foreach ($this->patches as $patch) { // Separate the input into lines $lines = self::splitLines($patch['udiff']); // Loop for each header while (self::findHeader($lines, $src, $dst)) { $done = false; if ($patch['strip'] === null) { $src = $patch['root'] . preg_replace('#^([^/]*/)*#', '', $src); $dst = $patch['root'] . preg_replace('#^([^/]*/)*#', '', $dst); } else { $src = $patch['root'] . preg_replace('#^([^/]*/){' . (int) $patch['strip'] . '}#', '', $src); $dst = $patch['root'] . preg_replace('#^([^/]*/){' . (int) $patch['strip'] . '}#', '', $dst); } // Loop for each hunk of differences while (self::findHunk($lines, $src_line, $src_size, $dst_line, $dst_size)) { $done = true; // Apply the hunk of differences $this->applyHunk($lines, $src, $dst, $src_line, $src_size, $dst_line, $dst_size); } // If no modifications were found, throw an exception if (!$done) { throw new RuntimeException('Invalid Diff'); } } } // Initialize the counter $done = 0; // Patch each destination file foreach ($this->destinations as $file => $content) { if (JFile::write($file, implode("\n", $content))) { if (isset($this->sources[$file])) { $this->sources[$file] = $content; } $done++; } } // Remove each removed file foreach ($this->removals as $file) { if (JFile::delete($file)) { if (isset($this->sources[$file])) { unset($this->sources[$file]); } $done++; } } // Clear the destinations cache $this->destinations = array(); // Clear the removals $this->removals = array(); // Clear the patches $this->patches = array(); return $done; } /** * Add a unified diff file to the patcher * * @param string $filename Path to the unified diff file * @param string $root The files root path * @param string $strip The number of '/' to strip * * @return JFilesystemPatch $this for chaining * * @since 12.1 */ public function addFile($filename, $root = JPATH_BASE, $strip = 0) { return $this->add(file_get_contents($filename), $root, $strip); } /** * Add a unified diff string to the patcher * * @param string $udiff Unified diff input string * @param string $root The files root path * @param string $strip The number of '/' to strip * * @return JFilesystemPatch $this for chaining * * @since 12.1 */ public function add($udiff, $root = JPATH_BASE, $strip = 0) { $this->patches[] = array( 'udiff' => $udiff, 'root' => isset($root) ? rtrim($root, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : '', 'strip' => $strip ); return $this; } /** * Separate CR or CRLF lines * * @param string $data Input string * * @return array The lines of the inputdestination file * * @since 12.1 */ protected static function splitLines($data) { return preg_split(self::SPLIT, $data); } /** * Find the diff header * * The internal array pointer of $lines is on the next line after the finding * * @param array &$lines The udiff array of lines * @param string &$src The source file * @param string &$dst The destination file * * @return boolean TRUE in case of success, FALSE in case of failure * * @since 12.1 * @throws RuntimeException */ protected static function findHeader(&$lines, &$src, &$dst) { // Get the current line $line = current($lines); // Search for the header while ($line !== false && !preg_match(self::SRC_FILE, $line, $m)) { $line = next($lines); } if ($line === false) { // No header found, return false return false; } else { // Set the source file $src = $m[1]; // Advance to the next line $line = next($lines); if ($line === false) { throw new RuntimeException('Unexpected EOF'); } // Search the destination file if (!preg_match(self::DST_FILE, $line, $m)) { throw new RuntimeException('Invalid Diff file'); } // Set the destination file $dst = $m[1]; // Advance to the next line if (next($lines) === false) { throw new RuntimeException('Unexpected EOF'); } return true; } } /** * Find the next hunk of difference * * The internal array pointer of $lines is on the next line after the finding * * @param array &$lines The udiff array of lines * @param string &$src_line The beginning of the patch for the source file * @param string &$src_size The size of the patch for the source file * @param string &$dst_line The beginning of the patch for the destination file * @param string &$dst_size The size of the patch for the destination file * * @return boolean TRUE in case of success, false in case of failure * * @since 12.1 * @throws RuntimeException */ protected static function findHunk(&$lines, &$src_line, &$src_size, &$dst_line, &$dst_size) { $line = current($lines); if (preg_match(self::HUNK, $line, $m)) { $src_line = (int) $m[1]; if ($m[3] === '') { $src_size = 1; } else { $src_size = (int) $m[3]; } $dst_line = (int) $m[4]; if ($m[6] === '') { $dst_size = 1; } else { $dst_size = (int) $m[6]; } if (next($lines) === false) { throw new RuntimeException('Unexpected EOF'); } return true; } else { return false; } } /** * Apply the patch * * @param array &$lines The udiff array of lines * @param string $src The source file * @param string $dst The destination file * @param string $src_line The beginning of the patch for the source file * @param string $src_size The size of the patch for the source file * @param string $dst_line The beginning of the patch for the destination file * @param string $dst_size The size of the patch for the destination file * * @return void * * @since 12.1 * @throws RuntimeException */ protected function applyHunk(&$lines, $src, $dst, $src_line, $src_size, $dst_line, $dst_size) { $src_line--; $dst_line--; $line = current($lines); // Source lines (old file) $source = array(); // New lines (new file) $destin = array(); $src_left = $src_size; $dst_left = $dst_size; do { if (!isset($line[0])) { $source[] = ''; $destin[] = ''; $src_left--; $dst_left--; } elseif ($line[0] == '-') { if ($src_left == 0) { throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_REMOVE_LINE', key($lines))); } $source[] = substr($line, 1); $src_left--; } elseif ($line[0] == '+') { if ($dst_left == 0) { throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_ADD_LINE', key($lines))); } $destin[] = substr($line, 1); $dst_left--; } elseif ($line != '\\ No newline at end of file') { $line = substr($line, 1); $source[] = $line; $destin[] = $line; $src_left--; $dst_left--; } if ($src_left == 0 && $dst_left == 0) { // Now apply the patch, finally! if ($src_size > 0) { $src_lines = & $this->getSource($src); if (!isset($src_lines)) { throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_UNEXISING_SOURCE', $src)); } } if ($dst_size > 0) { if ($src_size > 0) { $dst_lines = & $this->getDestination($dst, $src); $src_bottom = $src_line + count($source); for ($l = $src_line;$l < $src_bottom;$l++) { if ($src_lines[$l] != $source[$l - $src_line]) { throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_FAILED_VERIFY', $src, $l)); } } array_splice($dst_lines, $dst_line, count($source), $destin); } else { $this->destinations[$dst] = $destin; } } else { $this->removals[] = $src; } next($lines); return; } $line = next($lines); } while ($line !== false); throw new RuntimeException('Unexpected EOF'); } /** * Get the lines of a source file * * @param string $src The path of a file * * @return array The lines of the source file * * @since 12.1 */ protected function &getSource($src) { if (!isset($this->sources[$src])) { if (is_readable($src)) { $this->sources[$src] = self::splitLines(file_get_contents($src)); } else { $this->sources[$src] = null; } } return $this->sources[$src]; } /** * Get the lines of a destination file * * @param string $dst The path of a destination file * @param string $src The path of a source file * * @return array The lines of the destination file * * @since 12.1 */ protected function &getDestination($dst, $src) { if (!isset($this->destinations[$dst])) { $this->destinations[$dst] = $this->getSource($src); } return $this->destinations[$dst]; } } PK���\�a)��.libraries/joomla/filesystem/streams/string.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage FileSystem * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.support.stringcontroller'); /** * String Stream Wrapper * * This class allows you to use a PHP string in the same way that * you would normally use a regular stream wrapper * * @since 11.1 */ class JStreamString { /** * The current string * * @var string * @since 12.1 */ protected $currentString; /** * * The path * * @var string * @since 12.1 */ protected $path; /** * * The mode * * @var string * @since 12.1 */ protected $mode; /** * * Enter description here ... * @var string * * @since 12.1 */ protected $options; /** * * Enter description here ... * @var string * * @since 12.1 */ protected $openedPath; /** * Current position * * @var integer * @since 12.1 */ protected $pos; /** * Length of the string * * @var string * * @since 12.1 */ protected $len; /** * Statistics for a file * * @var array * @since 12.1 * * @see http://us.php.net/manual/en/function.stat.php */ protected $stat; /** * Method to open a file or URL. * * @param string $path The stream path. * @param string $mode Not used. * @param integer $options Not used. * @param string &$opened_path Not used. * * @return boolean * * @since 11.1 */ public function stream_open($path, $mode, $options, &$opened_path) { $this->currentString = &JStringController::getRef(str_replace('string://', '', $path)); if ($this->currentString) { $this->len = strlen($this->currentString); $this->pos = 0; $this->stat = $this->url_stat($path, 0); return true; } else { return false; } } /** * Method to retrieve information from a file resource * * @return array * * @see http://www.php.net/manual/en/streamwrapper.stream-stat.php * @since 11.1 */ public function stream_stat() { return $this->stat; } /** * Method to retrieve information about a file. * * @param string $path File path or URL to stat * @param integer $flags Additional flags set by the streams API * * @return array * * @see http://php.net/manual/en/streamwrapper.url-stat.php * @since 11.1 */ public function url_stat($path, $flags = 0) { $now = time(); $string = &JStringController::getRef(str_replace('string://', '', $path)); $stat = array( 'dev' => 0, 'ino' => 0, 'mode' => 0, 'nlink' => 1, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'size' => strlen($string), 'atime' => $now, 'mtime' => $now, 'ctime' => $now, 'blksize' => '512', 'blocks' => ceil(strlen($string) / 512)); return $stat; } /** * Method to read a given number of bytes starting at the current position * and moving to the end of the string defined by the current position plus the * given number. * * @param integer $count Bytes of data from the current position should be returned. * * @return void * * @since 11.1 * * @see http://www.php.net/manual/en/streamwrapper.stream-read.php */ public function stream_read($count) { $result = substr($this->currentString, $this->pos, $count); $this->pos += $count; return $result; } /** * Stream write, always returning false. * * @param string $data The data to write. * * @return boolean * * @since 11.1 * @note Updating the string is not supported. */ public function stream_write($data) { // We don't support updating the string. return false; } /** * Method to get the current position * * @return integer The position * * @since 11.1 */ public function stream_tell() { return $this->pos; } /** * End of field check * * @return boolean True if at end of field. * * @since 11.1 */ public function stream_eof() { if ($this->pos > $this->len) { return true; } return false; } /** * Stream offset * * @param integer $offset The starting offset. * @param integer $whence SEEK_SET, SEEK_CUR, SEEK_END * * @return boolean True on success. * * @since 11.1 */ public function stream_seek($offset, $whence) { // $whence: SEEK_SET, SEEK_CUR, SEEK_END if ($offset > $this->len) { // We can't seek beyond our len. return false; } switch ($whence) { case SEEK_SET: $this->pos = $offset; break; case SEEK_CUR: if (($this->pos + $offset) < $this->len) { $this->pos += $offset; } else { return false; } break; case SEEK_END: $this->pos = $this->len - $offset; break; } return true; } /** * Stream flush, always returns true. * * @return boolean * * @since 11.1 * @note Data storage is not supported */ public function stream_flush() { // We don't store data. return true; } } stream_wrapper_register('string', 'JStreamString') or die('JStreamString Wrapper Registration Failed'); PK���\Q*�1��Wlibraries/joomla/filesystem/meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 JLIB_FILESYSTEM_PATCHER_FAILED_VERIFY="Failed source verification of file %s at line %d" JLIB_FILESYSTEM_PATCHER_INVALID_DIFF="Invalid unified diff block" JLIB_FILESYSTEM_PATCHER_INVALID_INPUT="Invalid input" JLIB_FILESYSTEM_PATCHER_UNEXISING_SOURCE="Unexisting source file" JLIB_FILESYSTEM_PATCHER_UNEXPECTED_ADD_LINE="Unexpected add line at line %d'" JLIB_FILESYSTEM_PATCHER_UNEXPECTED_EOF="Unexpected end of file" JLIB_FILESYSTEM_PATCHER_UNEXPECTED_REMOVE_LINE="Unexpected remove line at line %d" PK���\�ە|vv libraries/joomla/github/meta.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Meta class. * * @since 13.1 */ class JGithubMeta extends JGithubObject { /** * Method to get the authorized IP addresses for services * * @return array Authorized IP addresses * * @since 13.1 * @throws DomainException */ public function getMeta() { // Build the request path. $path = '/meta'; $githubIps = $this->processResponse($this->client->get($this->fetchUrl($path)), 200); /* * The response body returns the IP addresses in CIDR format * Decode the response body and strip the subnet mask information prior to * returning the data to the user. We're assuming quite a bit here that all * masks will be /32 as they are as of the time of development. */ $authorizedIps = array(); foreach ($githubIps as $key => $serviceIps) { // The first level contains an array of IPs based on the service $authorizedIps[$key] = array(); foreach ($serviceIps as $serviceIp) { // The second level is each individual IP address, strip the mask here $authorizedIps[$key][] = substr($serviceIp, 0, -3); } } return $authorizedIps; } } PK���\���3��"libraries/joomla/github/github.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform class for interacting with a GitHub server instance. * * @property-read JGithubPackageActivity $activity GitHub API object for activity. * @property-read JGithubPackageAuthorization $authorization GitHub API object for authorizations. * @property-read JGithubPackageData $data GitHub API object for data. * @property-read JGithubPackageGists $gists GitHub API object for gists. * @property-read JGithubPackageGitignore $gitignore GitHub API object for gitignore. * @property-read JGithubPackageIssues $issues GitHub API object for issues. * @property-read JGithubPackageMarkdown $markdown GitHub API object for markdown. * @property-read JGithubPackageOrgs $orgs GitHub API object for orgs. * @property-read JGithubPackagePulls $pulls GitHub API object for pulls. * @property-read JGithubPackageRepositories $repositories GitHub API object for repositories. * @property-read JGithubPackageSearch $search GitHub API object for search. * @property-read JGithubPackageUsers $users GitHub API object for users. * * @property-read JGithubRefs $refs Deprecated GitHub API object for referencess. * @property-read JGithubForks $forks Deprecated GitHub API object for forks. * @property-read JGithubCommits $commits Deprecated GitHub API object for commits. * @property-read JGithubMilestones $milestones Deprecated GitHub API object for commits. * @property-read JGithubStatuses $statuses Deprecated GitHub API object for commits. * @property-read JGithubAccount $account Deprecated GitHub API object for account references. * @property-read JGithubHooks $hooks Deprecated GitHub API object for hooks. * @property-read JGithubMeta $meta Deprecated GitHub API object for meta. * * @since 11.3 */ class JGithub { /** * @var Registry Options for the GitHub object. * @since 11.3 */ protected $options; /** * @var JGithubHttp The HTTP client object to use in sending HTTP requests. * @since 11.3 */ protected $client; /** * @var array List of known packages. * @since 3.3 (CMS) */ protected $packages = array('activity', 'authorization', 'data', 'gists', 'gitignore', 'issues', 'markdown', 'orgs', 'pulls', 'repositories', 'users'); /** * @var array List of known legacy packages. * @since 3.3 (CMS) */ protected $legacyPackages = array('refs', 'forks', 'commits', 'milestones', 'statuses', 'account', 'hooks', 'meta'); /** * Constructor. * * @param Registry $options GitHub options object. * @param JGithubHttp $client The HTTP client object. * * @since 11.3 */ public function __construct(Registry $options = null, JGithubHttp $client = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JGithubHttp($this->options); // Setup the default API url if not already set. $this->options->def('api.url', 'https://api.github.com'); } /** * Magic method to lazily create API objects * * @param string $name Name of property to retrieve * * @throws RuntimeException * * @since 11.3 * @return JGithubObject GitHub API object (gists, issues, pulls, etc). */ public function __get($name) { if (false == in_array($name, $this->packages)) { // Check for a legacy class if (in_array($name, $this->legacyPackages)) { if (false == isset($this->$name)) { $className = 'JGithub' . ucfirst($name); $this->$name = new $className($this->options, $this->client); } return $this->$name; } throw new RuntimeException(sprintf('%1$s - Unknown package %2$s', __METHOD__, $name)); } if (false == isset($this->$name)) { $className = 'JGithubPackage' . ucfirst($name); $this->$name = new $className($this->options, $this->client); } return $this->$name; } /** * Get an option from the JGitHub instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 11.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JGitHub instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JGitHub This object for method chaining. * * @since 11.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\��r[[ libraries/joomla/github/http.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * HTTP client class for connecting to a GitHub instance. * * @since 11.3 */ class JGithubHttp extends JHttp { /** * @const integer Use no authentication for HTTP connections. * @since 11.3 */ const AUTHENTICATION_NONE = 0; /** * @const integer Use basic authentication for HTTP connections. * @since 11.3 */ const AUTHENTICATION_BASIC = 1; /** * @const integer Use OAuth authentication for HTTP connections. * @since 11.3 */ const AUTHENTICATION_OAUTH = 2; /** * Constructor. * * @param Registry $options Client options object. * @param JHttpTransport $transport The HTTP transport object. * * @since 11.3 */ public function __construct(Registry $options = null, JHttpTransport $transport = null) { // Call the JHttp constructor to setup the object. parent::__construct($options, $transport); // Make sure the user agent string is defined. $this->options->def('userAgent', 'JGitHub/2.0'); // Set the default timeout to 120 seconds. $this->options->def('timeout', 120); } } PK���\p��d,+,+#libraries/joomla/github/commits.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Commits class for the Joomla Platform. * * @since 12.1 */ class JGithubCommits extends JGithubObject { /** * Method to create a commit. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $message The commit message. * @param string $tree SHA of the tree object this commit points to. * @param array $parents Array of the SHAs of the commits that were the parents of this commit. * If omitted or empty, the commit will be written as a root commit. * For a single parent, an array of one SHA should be provided. * For a merge commit, an array of more than one should be provided. * * @deprecated use data->commits->create() * * @return object * * @since 12.1 */ public function create($user, $repo, $message, $tree, array $parents = array()) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/git/commits'; $data = json_encode( array('message' => $message, 'tree' => $tree, 'parents' => $parents) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to create a comment on a commit. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA of the commit to comment on. * @param string $comment The text of the comment. * @param integer $line The line number of the commit to comment on. * @param string $filepath A relative path to the file to comment on within the commit. * @param integer $position Line index in the diff to comment on. * * @deprecated use repositories->comments->create() * * @return object * * @since 12.1 */ public function createCommitComment($user, $repo, $sha, $comment, $line, $filepath, $position) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/commits/' . $sha . '/comments'; $data = json_encode( array( 'body' => $comment, 'commit_id' => $sha, 'line' => (int) $line, 'path' => $filepath, 'position' => (int) $position ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to delete a comment on a commit. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $id The ID of the comment to edit. * * @deprecated use repositories->comments->delete() * * @return object * * @since 12.1 */ public function deleteCommitComment($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/comments/' . $id; // Send the request. $response = $this->client->delete($this->fetchUrl($path)); // Validate the response code. if ($response->code != 204) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to edit a comment on a commit. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $id The ID of the comment to edit. * @param string $comment The text of the comment. * * @deprecated use repositories->comments->edit() * * @return object * * @since 12.1 */ public function editCommitComment($user, $repo, $id, $comment) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/comments/' . $id; $data = json_encode( array( 'body' => $comment ) ); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a single commit for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA of the commit to retrieve. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @deprecated use repositories->commits->get() * * @return array * * @since 12.1 */ public function getCommit($user, $repo, $sha, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/commits/' . $sha; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a single comment on a commit. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the comment to retrieve * * @deprecated use repositories->comments->get() * * @return array * * @since 12.1 */ public function getCommitComment($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/comments/' . $id; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a list of comments for a single commit for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA of the commit to retrieve. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @deprecated use repositories->comments->getList() * * @return array * * @since 12.1 */ public function getCommitComments($user, $repo, $sha, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/commits/' . $sha . '/comments'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a diff for two commits. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $base The base of the diff, either a commit SHA or branch. * @param string $head The head of the diff, either a commit SHA or branch. * * @deprecated use repositories->commits->compare() * * @return array * * @since 12.1 */ public function getDiff($user, $repo, $base, $head) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/compare/' . $base . '...' . $head; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list commits for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @deprecated use repositories->commits->getList() * * @return array * * @since 12.1 */ public function getList($user, $repo, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/commits'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a list of commit comments for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @deprecated use repositories->comments->getListRepository() * * @return array * * @since 12.1 */ public function getListComments($user, $repo, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/comments'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } } PK���\О�[j j "libraries/joomla/github/object.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * GitHub API object class for the Joomla Platform. * * @since 11.3 */ abstract class JGithubObject { /** * @var Registry Options for the GitHub object. * @since 11.3 */ protected $options; /** * @var JGithubHttp The HTTP client object to use in sending HTTP requests. * @since 11.3 */ protected $client; /** * Constructor. * * @param Registry $options GitHub options object. * @param JGithubHttp $client The HTTP client object. * * @since 11.3 */ public function __construct(Registry $options = null, JGithubHttp $client = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JGithubHttp($this->options); } /** * Method to build and return a full request URL for the request. This method will * add appropriate pagination details if necessary and also prepend the API url * to have a complete URL for the request. * * @param string $path URL to inflect * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @return string The request URL. * * @since 11.3 */ protected function fetchUrl($path, $page = 0, $limit = 0) { // Get a new JUri object fousing the api url and given path. $uri = new JUri($this->options->get('api.url') . $path); if ($this->options->get('gh.token', false)) { // Use oAuth authentication - @todo set in request header ? $uri->setVar('access_token', $this->options->get('gh.token')); } else { // Use basic authentication if ($this->options->get('api.username', false)) { $username = $this->options->get('api.username'); $username = str_replace('@', '%40', $username); $uri->setUser($username); } if ($this->options->get('api.password', false)) { $password = $this->options->get('api.password'); $password = str_replace('@', '%40', $password); $uri->setPass($password); } } // If we have a defined page number add it to the JUri object. if ($page > 0) { $uri->setVar('page', (int) $page); } // If we have a defined items per page add it to the JUri object. if ($limit > 0) { $uri->setVar('per_page', (int) $limit); } return (string) $uri; } /** * Process the response and decode it. * * @param JHttpResponse $response The response. * @param integer $expectedCode The expected "good" code. * @param boolean $decode If the should be response be JSON decoded. * * @throws DomainException * @since 12.4 * * @return mixed */ protected function processResponse(JHttpResponse $response, $expectedCode = 200, $decode = true) { // Validate the response code. if ($response->code == $expectedCode) { return ($decode) ? json_decode($response->body) : $response->body; } // Decode the error response and throw an exception. $error = json_decode($response->body); $message = (isset($error->message)) ? $error->message : 'Error: ' . $response->code; throw new DomainException($message, $response->code); } } PK���\މ��#libraries/joomla/github/account.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Account class for the Joomla Platform. * * @since 12.3 */ class JGithubAccount extends JGithubObject { /** * Method to create an authorisation. * * @param array $scopes A list of scopes that this authorisation is in. * @param string $note A note to remind you what the OAuth token is for. * @param string $url A URL to remind you what app the OAuth token is for. * * @deprecated use authorization->create() * * @return object * * @since 12.3 * @throws DomainException */ public function createAuthorisation(array $scopes = array(), $note = '', $url = '') { // Build the request path. $path = '/authorizations'; $data = json_encode( array('scopes' => $scopes, 'note' => $note, 'note_url' => $url) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to delete an authorisation * * @param integer $id ID of the authorisation to delete * * @deprecated use authorization->delete() * * @return object * * @since 12.3 * @throws DomainException */ public function deleteAuthorisation($id) { // Build the request path. $path = '/authorizations/' . $id; // Send the request. $response = $this->client->delete($this->fetchUrl($path)); // Validate the response code. if ($response->code != 204) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to edit an authorisation. * * @param integer $id ID of the authorisation to edit * @param array $scopes Replaces the authorisation scopes with these. * @param array $addScopes A list of scopes to add to this authorisation. * @param array $removeScopes A list of scopes to remove from this authorisation. * @param string $note A note to remind you what the OAuth token is for. * @param string $url A URL to remind you what app the OAuth token is for. * * @deprecated use authorization->edit() * * @return object * * @since 12.3 * @throws DomainException * @throws RuntimeException */ public function editAuthorisation($id, array $scopes = array(), array $addScopes = array(), array $removeScopes = array(), $note = '', $url = '') { // Check if more than one scopes array contains data $scopesCount = 0; if (!empty($scopes)) { $scope = 'scopes'; $scopeData = $scopes; $scopesCount++; } if (!empty($addScopes)) { $scope = 'add_scopes'; $scopeData = $addScopes; $scopesCount++; } if (!empty($removeScopes)) { $scope = 'remove_scopes'; $scopeData = $removeScopes; $scopesCount++; } // Only allowed to send data for one scope parameter if ($scopesCount >= 2) { throw new RuntimeException('You can only send one scope key in this request.'); } // Build the request path. $path = '/authorizations/' . $id; $data = json_encode( array( $scope => $scopeData, 'note' => $note, 'note_url' => $url ) ); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get details about an authorised application for the authenticated user. * * @param integer $id ID of the authorisation to retrieve * * @deprecated use authorization->get() * * @return object * * @since 12.3 * @note This method will only accept Basic Authentication * @throws DomainException */ public function getAuthorisation($id) { // Build the request path. $path = '/authorizations/' . $id; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get the authorised applications for the authenticated user. * * @deprecated use authorization->getList() * * @return object * * @since 12.3 * @throws DomainException * @note This method will only accept Basic Authentication */ public function getAuthorisations() { // Build the request path. $path = '/authorizations'; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get the rate limit for the authenticated user. * * @deprecated use authorization->getRateLimit() * * @return object * * @since 12.3 * @throws DomainException */ public function getRateLimit() { // Build the request path. $path = '/rate_limit'; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } } PK���\����#libraries/joomla/github/package.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API package class for the Joomla Platform. * * @since 3.3 (CMS) */ abstract class JGithubPackage extends JGithubObject { /** * @var string * @since 3.3 (CMS) */ protected $name = ''; /** * @var array * @since 3.3 (CMS) */ protected $packages = array(); /** * Magic method to lazily create API objects * * @param string $name Name of property to retrieve * * @return JGithubPackage GitHub API package object. * * @since 3.3 (CMS) * @throws RuntimeException */ public function __get($name) { if (false == in_array($name, $this->packages)) { throw new RuntimeException(sprintf('%1$s - Unknown package %2$s', __METHOD__, $name)); } if (false == isset($this->$name)) { $className = 'JGithubPackage' . ucfirst($this->name) . ucfirst($name); $this->$name = new $className($this->options, $this->client); } return $this->$name; } } PK���\��L$libraries/joomla/github/statuses.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API References class for the Joomla Platform. * * @since 12.3 */ class JGithubStatuses extends JGithubObject { /** * Method to create a status. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA1 value for which to set the status. * @param string $state The state (pending, success, error or failure). * @param string $targetUrl Optional target URL. * @param string $description Optional description for the status. * * @deprecated use repositories->statuses->create() * * @return object * * @since 12.3 */ public function create($user, $repo, $sha, $state, $targetUrl = null, $description = null) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/statuses/' . $sha; if (!in_array($state, array('pending', 'success', 'error', 'failure'))) { throw new InvalidArgumentException('State must be one of pending, success, error or failure.'); } // Build the request data. $data = array( 'state' => $state ); if (!is_null($targetUrl)) { $data['target_url'] = $targetUrl; } if (!is_null($description)) { $data['description'] = $description; } // Send the request. $response = $this->client->post($this->fetchUrl($path), json_encode($data)); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list statuses for an SHA. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha SHA1 for which to get the statuses. * * @deprecated use repositories->statuses->getList() * * @return array * * @since 12.3 */ public function getList($user, $repo, $sha) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/statuses/' . $sha; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } } PK���\}���)libraries/joomla/github/package/users.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API References class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/users * * @since 12.3 */ class JGithubPackageUsers extends JGithubPackage { protected $name = 'Users'; protected $packages = array( 'emails', 'followers', 'keys' ); /** * Get a single user. * * @param string $user The users login name. * * @throws DomainException * * @return object */ public function get($user) { // Build the request path. $path = '/users/' . $user; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get the current authenticated user. * * @throws DomainException * * @return mixed */ public function getAuthenticatedUser() { // Build the request path. $path = '/user'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Update a user. * * @param string $name The full name * @param string $email The email * @param string $blog The blog * @param string $company The company * @param string $location The location * @param string $hireable If he is unemplayed :P * @param string $bio The biometrical DNA fingerprint (or smthng...) * * @throws DomainException * * @return mixed */ public function edit($name = '', $email = '', $blog = '', $company = '', $location = '', $hireable = '', $bio = '') { $data = array( 'name' => $name, 'email' => $email, 'blog' => $blog, 'company' => $company, 'location' => $location, 'hireable' => $hireable, 'bio' => $bio ); // Build the request path. $path = '/user'; // Send the request. return $this->processResponse( $this->client->patch($this->fetchUrl($path), json_encode($data)) ); } /** * Get all users. * * This provides a dump of every user, in the order that they signed up for GitHub. * * @param integer $since The integer ID of the last User that you’ve seen. * * @throws DomainException * @return mixed */ public function getList($since = 0) { // Build the request path. $path = '/users'; $path .= ($since) ? '?since=' . $since : ''; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /* * Legacy methods */ /** * Get a single user. * * @param string $user The users login name. * * @deprecated use users->get() * * @throws DomainException * * @return mixed */ public function getUser($user) { return $this->get($user); } /** * Update a user. * * @param string $name The full name * @param string $email The email * @param string $blog The blog * @param string $company The company * @param string $location The location * @param string $hireable If he is unemplayed :P * @param string $bio The biometrical DNA fingerprint (or smthng...) * * @deprecated use users->edit() * * @throws DomainException * * @return mixed */ public function updateUser($name = '', $email = '', $blog = '', $company = '', $location = '', $hireable = '', $bio = '') { return $this->edit($name = '', $email = '', $blog = '', $company = '', $location = '', $hireable = '', $bio = ''); } /** * Get all users. * * This provides a dump of every user, in the order that they signed up for GitHub. * * @param integer $since The integer ID of the last User that you’ve seen. * * @deprecated use users->getList() * * @throws DomainException * @return mixed */ public function getUsers($since = 0) { return $this->getList($since); } } PK���\��) *libraries/joomla/github/package/search.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Search class for the Joomla Platform. * * @documentation http://developer.github.com/v3/search * * @since 12.3 */ class JGithubPackageSearch extends JGithubPackage { /** * Search issues. * * @param string $owner The name of the owner of the repository. * @param string $repo The name of the repository. * @param string $state The state - open or closed. * @param string $keyword The search term. * * @throws UnexpectedValueException * * @since 3.3 (CMS) * * @return object */ public function issues($owner, $repo, $state, $keyword) { if (false == in_array($state, array('open', 'close'))) { throw new UnexpectedValueException('State must be either "open" or "closed"'); } // Build the request path. $path = '/legacy/issues/search/' . $owner . '/' . $repo . '/' . $state . '/' . $keyword; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Search repositories. * * Find repositories by keyword. Note, this legacy method does not follow * the v3 pagination pattern. * This method returns up to 100 results per page and pages can be fetched * using the start_page parameter. * * @param string $keyword The search term. * @param string $language Filter results by language https://github.com/languages * @param integer $start_page Page number to fetch * * @since 3.3 (CMS) * * @return object */ public function repositories($keyword, $language = '', $start_page = 0) { // Build the request path. $path = '/legacy/repos/search/' . $keyword . '?'; $path .= ($language) ? '&language=' . $language : ''; $path .= ($start_page) ? '&start_page=' . $start_page : ''; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Search users. * * Find users by keyword. * * @param string $keyword The search term. * @param integer $start_page Page number to fetch * * @since 3.3 (CMS) * * @return object */ public function users($keyword, $start_page = 0) { // Build the request path. $path = '/legacy/user/search/' . $keyword . '?'; $path .= ($start_page) ? '&start_page=' . $start_page : ''; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Email search. * * This API call is added for compatibility reasons only. There’s no guarantee * that full email searches will always be available. The @ character in the * address must be left unencoded. Searches only against public email addresses * (as configured on the user’s GitHub profile). * * @param string $email The email address(es). * * @since 3.3 (CMS) * * @return object */ public function email($email) { // Build the request path. $path = '/legacy/user/email/' . $email; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } } PK���\#����.libraries/joomla/github/package/data/blobs.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Data Blobs class for the Joomla Platform. * * Since blobs can be any arbitrary binary data, the input and responses for the blob API * takes an encoding parameter that can be either utf-8 or base64. If your data cannot be * losslessly sent as a UTF-8 string, you can base64 encode it. * * @documentation http://developer.github.com/v3/git/blobs/ * * @since 11.3 */ class JGithubPackageDataBlobs extends JGithubPackage { /** * Get a Blob. * * @param string $owner Repository owner. * @param string $repo Repository name. * @param string $sha The commit SHA. * * @return object */ public function get($owner, $repo, $sha) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/blobs/' . $sha; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Create a Blob. * * @param string $owner Repository owner. * @param string $repo Repository name. * @param string $content The content of the blob. * @param string $encoding The encoding to use. * * @return object */ public function create($owner, $repo, $content, $encoding = 'utf-8') { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/blobs'; $data = array( 'content' => $content, 'encoding' => $encoding ); return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode($data)), 201 ); } } PK���\�S�Pll0libraries/joomla/github/package/data/commits.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Data Commits class for the Joomla Platform. * * @documentation http://developer.github.com/v3/git/commits/ * * @since 11.3 */ class JGithubPackageDataCommits extends JGithubPackage { /** * Get a single commit. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The commit SHA. * * @return object */ public function get($owner, $repo, $sha) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/commits/' . $sha; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Method to create a commit. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $message The commit message. * @param string $tree SHA of the tree object this commit points to. * @param array $parents Array of the SHAs of the commits that were the parents of this commit. * If omitted or empty, the commit will be written as a root commit. * For a single parent, an array of one SHA should be provided. * For a merge commit, an array of more than one should be provided. * * @throws DomainException * @since 12.1 * * @return object */ public function create($owner, $repo, $message, $tree, array $parents = array()) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/commits'; $data = json_encode( array('message' => $message, 'tree' => $tree, 'parents' => $parents) ); // Send the request. return $this->processResponse( $response = $this->client->post($this->fetchUrl($path), $data), 201 ); } } PK���\���-libraries/joomla/github/package/data/tags.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Data Tags class for the Joomla Platform. * * This tags API only deals with tag objects - so only annotated tags, not lightweight tags. * * @documentation http://developer.github.com/v3/git/tags/ * * @since 11.3 */ class JGithubPackageDataTags extends JGithubPackage { /** * Get a Tag. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA1 value to set the reference to. * * @since 3.3 (CMS) * * @return object */ public function get($owner, $repo, $sha) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/tags/' . $sha; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Create a Tag Object * * Note that creating a tag object does not create the reference that makes a tag in Git. * If you want to create an annotated tag in Git, you have to do this call to create the tag object, * and then create the refs/tags/[tag] reference. If you want to create a lightweight tag, * you simply have to create the reference - this call would be unnecessary. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $tag The tag string. * @param string $message The tag message. * @param string $object The SHA of the git object this is tagging. * @param string $type The type of the object we’re tagging. Normally this is a commit * but it can also be a tree or a blob. * @param string $tagger_name The name of the author of the tag. * @param string $tagger_email The email of the author of the tag. * @param string $tagger_date Timestamp of when this object was tagged. * * @since 3.3 (CMS) * * @return object */ public function create($owner, $repo, $tag, $message, $object, $type, $tagger_name, $tagger_email, $tagger_date) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/tags'; $data = array( 'tag' => $tag, 'message' => $message, 'object' => $object, 'type' => $type, 'tagger_name' => $tagger_name, 'tagger_email' => $tagger_email, 'tagger_date' => $tagger_date ); return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode($data)), 201 ); } } PK���\A5���.libraries/joomla/github/package/data/trees.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Data Trees class for the Joomla Platform. * * @documentation http://developer.github.com/v3/git/trees/ * * @since 11.3 */ class JGithubPackageDataTrees extends JGithubPackage { /** * Get a Tree * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA1 value to set the reference to. * * @since 3.3 (CMS) * * @return object */ public function get($owner, $repo, $sha) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/trees/' . $sha; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get a Tree Recursively * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA1 value to set the reference to. * * @since 3.3 (CMS) * * @return object */ public function getRecursively($owner, $repo, $sha) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/trees/' . $sha . '?recursive=1'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Create a Tree. * * The tree creation API will take nested entries as well. If both a tree and a nested path * modifying that tree are specified, it will overwrite the contents of that tree with the * new path contents and write a new tree out. * * Parameters fir the tree: * * tree.path * String of the file referenced in the tree * tree.mode * String of the file mode - one of 100644 for file (blob), 100755 for executable (blob), * 040000 for subdirectory (tree), 160000 for submodule (commit) or 120000 for a blob * that specifies the path of a symlink * tree.type * String of blob, tree, commit * tree.sha * String of SHA1 checksum ID of the object in the tree * tree.content * String of content you want this file to have - GitHub will write this blob out and use * that SHA for this entry. Use either this or tree.sha * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param array $tree Array of Hash objects (of path, mode, type and sha) specifying * a tree structure * @param string $base_tree The SHA1 of the tree you want to update with new data. * * @since 3.3 (CMS) * * @return object */ public function create($owner, $repo, $tree, $base_tree = '') { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/trees'; $data = array(); $data['tree'] = $tree; if ($base_tree) { $data['base_tree'] = $base_tree; } return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode($data)), 201 ); } } PK���\5�5��-libraries/joomla/github/package/data/refs.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API References class for the Joomla Platform. * * @documentation http://developer.github.com/v3/git/refs/ * * @since 11.3 */ class JGithubPackageDataRefs extends JGithubPackage { /** * Method to get a reference. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $ref The reference to get. * * @return object * * @since 11.3 */ public function get($user, $repo, $ref) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list references for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $namespace Optional sub-namespace to limit the returned references. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @return array * * @since 11.3 */ public function getList($user, $repo, $namespace = '', $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/git/refs' . $namespace; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to create a ref. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $ref The name of the fully qualified reference. * @param string $sha The SHA1 value to set this reference to. * * @throws DomainException * @since 11.3 * * @return object */ public function create($user, $repo, $ref, $sha) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/git/refs'; // Build the request data. $data = json_encode( array( 'ref' => $ref, 'sha' => $sha ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to update a reference. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $ref The reference to update. * @param string $sha The SHA1 value to set the reference to. * @param boolean $force Whether the update should be forced. Default to false. * * @throws DomainException * @since 11.3 * * @return object */ public function edit($user, $repo, $ref, $sha, $force = false) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref; // Craete the data object. $data = new stdClass; // If a title is set add it to the data object. if ($force) { $data->force = true; } $data->sha = $sha; // Encode the request data. $data = json_encode($data); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Delete a Reference * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $ref The reference to update. * * @since 3.3 (CMS) * @return object */ public function delete($owner, $repo, $ref) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/git/refs/' . $ref; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\\�Eܾ2�2)libraries/joomla/github/package/gists.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Gists class for the Joomla Platform. * * @documentation http://developer.github.com/v3/gists * * @since 11.3 * * @property-read JGithubPackageGistsComments $comments GitHub API object for gist comments. */ class JGithubPackageGists extends JGithubPackage { protected $name = 'Gists'; protected $packages = array( 'comments' ); /** * Method to create a gist. * * @param mixed $files Either an array of file paths or a single file path as a string. * @param boolean $public True if the gist should be public. * @param string $description The optional description of the gist. * * @throws DomainException * @since 11.3 * * @return object */ public function create($files, $public = false, $description = null) { // Build the request path. $path = '/gists'; // Build the request data. $data = json_encode( array( 'files' => $this->buildFileData((array) $files), 'public' => (bool) $public, 'description' => $description ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to delete a gist. * * @param integer $gistId The gist number. * * @throws DomainException * @since 11.3 * * @return void */ public function delete($gistId) { // Build the request path. $path = '/gists/' . (int) $gistId; // Send the request. $response = $this->client->delete($this->fetchUrl($path)); // Validate the response code. if ($response->code != 204) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } } /** * Method to update a gist. * * @param integer $gistId The gist number. * @param mixed $files Either an array of file paths or a single file path as a string. * @param boolean $public True if the gist should be public. * @param string $description The description of the gist. * * @throws DomainException * @since 11.3 * * @return object */ public function edit($gistId, $files = null, $public = null, $description = null) { // Build the request path. $path = '/gists/' . (int) $gistId; // Craete the data object. $data = new stdClass; // If a description is set add it to the data object. if (isset($description)) { $data->description = $description; } // If the public flag is set add it to the data object. if (isset($public)) { $data->public = $public; } // If a state is set add it to the data object. if (isset($files)) { $data->files = $this->buildFileData((array) $files); } // Encode the request data. $data = json_encode($data); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to fork a gist. * * @param integer $gistId The gist number. * * @throws DomainException * @since 11.3 * * @return object */ public function fork($gistId) { // Build the request path. $path = '/gists/' . (int) $gistId . '/fork'; // Send the request. // TODO: Verify change $response = $this->client->post($this->fetchUrl($path), ''); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a single gist. * * @param integer $gistId The gist number. * * @throws DomainException * @since 11.3 * * @return object */ public function get($gistId) { // Build the request path. $path = '/gists/' . (int) $gistId; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list gists. If a user is authenticated it will return the user's gists, otherwise * it will return all public gists. * * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getList($page = 0, $limit = 0) { // Build the request path. $path = '/gists'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a list of gists belonging to a given user. * * @param string $user The name of the GitHub user from which to list gists. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getListByUser($user, $page = 0, $limit = 0) { // Build the request path. $path = '/users/' . $user . '/gists'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a list of all public gists. * * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getListPublic($page = 0, $limit = 0) { // Build the request path. $path = '/gists/public'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a list of the authenticated users' starred gists. * * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getListStarred($page = 0, $limit = 0) { // Build the request path. $path = '/gists/starred'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to check if a gist has been starred. * * @param integer $gistId The gist number. * * @throws DomainException * @since 11.3 * * @return boolean True if the gist is starred. */ public function isStarred($gistId) { // Build the request path. $path = '/gists/' . (int) $gistId . '/star'; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code == 204) { return true; } elseif ($response->code == 404) { return false; } else { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } } /** * Method to star a gist. * * @param integer $gistId The gist number. * * @throws DomainException * @since 11.3 * * @return void */ public function star($gistId) { // Build the request path. $path = '/gists/' . (int) $gistId . '/star'; // Send the request. $response = $this->client->put($this->fetchUrl($path), ''); // Validate the response code. if ($response->code != 204) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } } /** * Method to star a gist. * * @param integer $gistId The gist number. * * @throws DomainException * @since 11.3 * * @return void */ public function unstar($gistId) { // Build the request path. $path = '/gists/' . (int) $gistId . '/star'; // Send the request. $response = $this->client->delete($this->fetchUrl($path)); // Validate the response code. if ($response->code != 204) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } } /** * Method to fetch a data array for transmitting to the GitHub API for a list of files based on * an input array of file paths or filename and content pairs. * * @param array $files The list of file paths or filenames and content. * * @throws InvalidArgumentException * @since 11.3 * * @return array */ protected function buildFileData(array $files) { $data = array(); foreach ($files as $key => $file) { // If the key isn't numeric, then we are dealing with a file whose content has been supplied if (!is_numeric($key)) { $data[$key] = array('content' => $file); } // Otherwise, we have been given a path and we have to load the content // Verify that the each file exists. elseif (!file_exists($file)) { throw new InvalidArgumentException('The file ' . $file . ' does not exist.'); } else { $data[basename($file)] = array('content' => file_get_contents($file)); } } return $data; } /* * Deprecated methods */ /** * Method to create a comment on a gist. * * @param integer $gistId The gist number. * @param string $body The comment body text. * * @deprecated use gists->comments->create() * * @return object * * @since 11.3 */ public function createComment($gistId, $body) { return $this->comments->create($gistId, $body); } /** * Method to delete a comment on a gist. * * @param integer $commentId The id of the comment to delete. * * @deprecated use gists->comments->delete() * * @return void * * @since 11.3 */ public function deleteComment($commentId) { $this->comments->delete($commentId); } /** * Method to update a comment on a gist. * * @param integer $commentId The id of the comment to update. * @param string $body The new body text for the comment. * * @deprecated use gists->comments->edit() * * @return object * * @since 11.3 */ public function editComment($commentId, $body) { return $this->comments->edit($commentId, $body); } /** * Method to get a specific comment on a gist. * * @param integer $commentId The comment id to get. * * @deprecated use gists->comments->get() * * @return object * * @since 11.3 */ public function getComment($commentId) { return $this->comments->get($commentId); } /** * Method to get the list of comments on a gist. * * @param integer $gistId The gist number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @deprecated use gists->comments->getList() * * @return array * * @since 11.3 */ public function getComments($gistId, $page = 0, $limit = 0) { return $this->comments->getList($gistId, $page, $limit); } } PK���\`���4�40libraries/joomla/github/package/repositories.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Activity class for the Joomla Platform. * * @since 3.3 (CMS) * * @documentation http://developer.github.com/v3/repos * * @property-read JGithubPackageRepositoriesCollaborators $collaborators GitHub API object for collaborators. * @property-read JGithubPackageRepositoriesComments $comments GitHub API object for comments. * @property-read JGithubPackageRepositoriesCommits $commits GitHub API object for commits. * @property-read JGithubPackageRepositoriesContents $contents GitHub API object for contents. * @property-read JGithubPackageRepositoriesDownloads $downloads GitHub API object for downloads. * @property-read JGithubPackageRepositoriesForks $forks GitHub API object for forks. * @property-read JGithubPackageRepositoriesHooks $hooks GitHub API object for hooks. * @property-read JGithubPackageRepositoriesKeys $keys GitHub API object for keys. * @property-read JGithubPackageRepositoriesMerging $merging GitHub API object for merging. * @property-read JGithubPackageRepositoriesStatuses $statuses GitHub API object for statuses. */ class JGithubPackageRepositories extends JGithubPackage { protected $name = 'Repositories'; protected $packages = array( 'collaborators', 'comments', 'commits', 'contents', 'downloads', 'forks', 'hooks', 'keys', 'merging', 'statuses' ); /** * List your repositories. * * List repositories for the authenticated user. * * @param string $type Sort type. all, owner, public, private, member. Default: all. * @param string $sort Sort field. created, updated, pushed, full_name, default: full_name. * @param string $direction Sort direction. asc or desc, default: when using full_name: asc, otherwise desc. * * @throws RuntimeException * * @return object */ public function getListOwn($type = 'all', $sort = 'full_name', $direction = '') { if (false == in_array($type, array('all', 'owner', 'public', 'private', 'member'))) { throw new RuntimeException('Invalid type'); } if (false == in_array($sort, array('created', 'updated', 'pushed', 'full_name'))) { throw new RuntimeException('Invalid sort field'); } // Sort direction default: when using full_name: asc, otherwise desc. $direction = ($direction) ? : (('full_name' == $sort) ? 'asc' : 'desc'); if (false == in_array($direction, array('asc', 'desc'))) { throw new RuntimeException('Invalid sort order'); } // Build the request path. $path = '/user/repos' . '?type=' . $type . '&sort=' . $sort . '&direction=' . $direction; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List user repositories. * * List public repositories for the specified user. * * @param string $user The user name. * @param string $type Sort type. all, owner, member. Default: all. * @param string $sort Sort field. created, updated, pushed, full_name, default: full_name. * @param string $direction Sort direction. asc or desc, default: when using full_name: asc, otherwise desc. * * @throws RuntimeException * * @return object */ public function getListUser($user, $type = 'all', $sort = 'full_name', $direction = '') { if (false == in_array($type, array('all', 'owner', 'member'))) { throw new RuntimeException('Invalid type'); } if (false == in_array($sort, array('created', 'updated', 'pushed', 'full_name'))) { throw new RuntimeException('Invalid sort field'); } // Sort direction default: when using full_name: asc, otherwise desc. $direction = ($direction) ? : (('full_name' == $sort) ? 'asc' : 'desc'); if (false == in_array($direction, array('asc', 'desc'))) { throw new RuntimeException('Invalid sort order'); } // Build the request path. $path = '/users/' . $user . '/repos' . '?type=' . $type . '&sort=' . $sort . '&direction=' . $direction; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List organization repositories. * * List repositories for the specified org. * * @param string $org The name of the organization. * @param string $type Sort type. all, public, private, forks, sources, member. Default: all. * * @throws RuntimeException * * @return object */ public function getListOrg($org, $type = 'all') { if (false == in_array($type, array('all', 'public', 'private', 'forks', 'sources', 'member'))) { throw new RuntimeException('Invalid type'); } // Build the request path. $path = '/orgs/' . $org . '/repos' . '?type=' . $type; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List all repositories. * * This provides a dump of every repository, in the order that they were created. * * @param integer $id The integer ID of the last Repository that you’ve seen. * * @throws RuntimeException * * @return object */ public function getList($id = 0) { // Build the request path. $path = '/repositories'; $path .= ($id) ? '?since=' . (int) $id : ''; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Create a new repository for the authenticated user or an organization. * OAuth users must supply repo scope. * * @param string $name The repository name. * @param string $org The organization name (if needed). * @param string $description The repository description. * @param string $homepage The repository homepage. * @param boolean $private Set true to create a private repository, false to create a public one. * Creating private repositories requires a paid GitHub account. * @param boolean $has_issues Set true to enable issues for this repository, false to disable them. * @param boolean $has_wiki Set true to enable the wiki for this repository, false to disable it. * @param boolean $has_downloads Set true to enable downloads for this repository, false to disable them. * @param integer $team_id The id of the team that will be granted access to this repository. * This is only valid when creating a repo in an organization. * @param boolean $auto_init true to create an initial commit with empty README. * @param string $gitignore_template Desired language or platform .gitignore template to apply. * Use the name of the template without the extension. For example, * “Haskell” Ignored if auto_init parameter is not provided. * * @return object */ public function create($name, $org = '', $description = '', $homepage = '', $private = false, $has_issues = false, $has_wiki = false, $has_downloads = false, $team_id = 0, $auto_init = false, $gitignore_template = '') { $path = ($org) // Create a repository for an organization ? '/orgs/' . $org . '/repos' // Create a repository for a user : '/user/repos'; $data = array( 'name' => $name, 'description' => $description, 'homepage' => $homepage, 'private' => $private, 'has_issues' => $has_issues, 'has_wiki' => $has_wiki, 'has_downloads' => $has_downloads, 'team_id' => $team_id, 'auto_init' => $auto_init, 'gitignore_template' => $gitignore_template ); // Send the request. return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode($data)), 201 ); } /** * Get a repository. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @return object */ public function get($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Edit a repository. * * @param string $owner Repository owner. * @param string $repo Repository name. * @param string $name The repository name. * @param string $description The repository description. * @param string $homepage The repository homepage. * @param boolean $private Set true to create a private repository, false to create a public one. * Creating private repositories requires a paid GitHub account. * @param boolean $has_issues Set true to enable issues for this repository, false to disable them. * @param boolean $has_wiki Set true to enable the wiki for this repository, false to disable it. * @param boolean $has_downloads Set true to enable downloads for this repository, false to disable them. * @param string $default_branch Update the default branch for this repository * * @return object */ public function edit($owner, $repo, $name, $description = '', $homepage = '', $private = false, $has_issues = false, $has_wiki = false, $has_downloads = false, $default_branch = '') { $path = '/repos/' . $owner . '/' . $repo; $data = array( 'name' => $name, 'description' => $description, 'homepage' => $homepage, 'private' => $private, 'has_issues' => $has_issues, 'has_wiki' => $has_wiki, 'has_downloads' => $has_downloads, 'default_branch' => $default_branch ); // Send the request. return $this->processResponse( $this->client->patch($this->fetchUrl($path), json_encode($data)) ); } /** * List contributors. * * @param string $owner Repository owner. * @param string $repo Repository name. * @param boolean $anon Set to 1 or true to include anonymous contributors in results. * * @return object */ public function getListContributors($owner, $repo, $anon = false) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/contributors'; $path .= ($anon) ? '?anon=true' : ''; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List languages. * * List languages for the specified repository. The value on the right of a language is the number of bytes of code * written in that language. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @return object */ public function getListLanguages($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/languages'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List Teams * * @param string $owner Repository owner. * @param string $repo Repository name. * * @return object */ public function getListTeams($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/teams'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List Tags. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @return object */ public function getListTags($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/tags'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List Branches. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @return object */ public function getListBranches($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/branches'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get a Branch. * * @param string $owner Repository owner. * @param string $repo Repository name. * @param string $branch Branch name. * * @return object */ public function getBranch($owner, $repo, $branch) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/branches/' . $branch; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Delete a Repository. * * Deleting a repository requires admin access. If OAuth is used, the delete_repo scope is required. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @return object */ public function delete($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo; // Send the request. return $this->processResponse( $this->client->delete($this->fetchUrl($path)) ); } } PK���\�cEI��,libraries/joomla/github/package/activity.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Activity class for the Joomla Platform. * * @since 3.3 (CMS) * * @documentation http://developer.github.com/v3/activity/ * * @property-read JGithubPackageActivityEvents $events GitHub API object for markdown. */ class JGithubPackageActivity extends JGithubPackage { protected $name = 'Activity'; protected $packages = array( 'events', 'notifications', 'starring', 'watching' ); } PK���\L9+9+9*libraries/joomla/github/package/issues.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Issues class for the Joomla Platform. * * @documentation http://developer.github.com/v3/issues * * @since 11.3 * * @property-read JGithubPackageIssuesAssignees $assignees GitHub API object for assignees. * @property-read JGithubPackageIssuesComments $comments GitHub API object for comments. * @property-read JGithubPackageIssuesEvents $events GitHub API object for events. * @property-read JGithubPackageIssuesLabels $labels GitHub API object for labels. * @property-read JGithubPackageIssuesMilestones $milestones GitHub API object for milestones. */ class JGithubPackageIssues extends JGithubPackage { protected $name = 'Issues'; protected $packages = array( 'assignees', 'comments', 'events', 'labels', 'milestones' ); /** * Method to create an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $title The title of the new issue. * @param string $body The body text for the new issue. * @param string $assignee The login for the GitHub user that this issue should be assigned to. * @param integer $milestone The milestone to associate this issue with. * @param array $labels The labels to associate with this issue. * * @throws DomainException * @since 11.3 * * @return object */ public function create($user, $repo, $title, $body = null, $assignee = null, $milestone = null, array $labels = null) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/issues'; // Ensure that we have a non-associative array. if (isset($labels)) { $labels = array_values($labels); } // Build the request data. $data = json_encode( array( 'title' => $title, 'assignee' => $assignee, 'milestone' => $milestone, 'labels' => $labels, 'body' => $body ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to update an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $issueId The issue number. * @param string $state The optional new state for the issue. [open, closed] * @param string $title The title of the new issue. * @param string $body The body text for the new issue. * @param string $assignee The login for the GitHub user that this issue should be assigned to. * @param integer $milestone The milestone to associate this issue with. * @param array $labels The labels to associate with this issue. * * @throws DomainException * @since 11.3 * * @return object */ public function edit($user, $repo, $issueId, $state = null, $title = null, $body = null, $assignee = null, $milestone = null, array $labels = null) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/issues/' . (int) $issueId; // Craete the data object. $data = new stdClass; // If a title is set add it to the data object. if (isset($title)) { $data->title = $title; } // If a body is set add it to the data object. if (isset($body)) { $data->body = $body; } // If a state is set add it to the data object. if (isset($state)) { $data->state = $state; } // If an assignee is set add it to the data object. if (isset($assignee)) { $data->assignee = $assignee; } // If a milestone is set add it to the data object. if (isset($milestone)) { $data->milestone = $milestone; } // If labels are set add them to the data object. if (isset($labels)) { // Ensure that we have a non-associative array. if (isset($labels)) { $labels = array_values($labels); } $data->labels = $labels; } // Encode the request data. $data = json_encode($data); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a single issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $issueId The issue number. * * @throws DomainException * @since 11.3 * * @return object */ public function get($user, $repo, $issueId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/issues/' . (int) $issueId; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list an authenticated user's issues. * * @param string $filter The filter type: assigned, created, mentioned, subscribed. * @param string $state The optional state to filter requests by. [open, closed] * @param string $labels The list of comma separated Label names. Example: bug,ui,@high. * @param string $sort The sort order: created, updated, comments, default: created. * @param string $direction The list direction: asc or desc, default: desc. * @param JDate $since The date/time since when issues should be returned. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getList($filter = null, $state = null, $labels = null, $sort = null, $direction = null, JDate $since = null, $page = 0, $limit = 0) { // Build the request path. $path = '/issues'; // TODO Implement the filtering options. // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list issues. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $milestone The milestone number, 'none', or *. * @param string $state The optional state to filter requests by. [open, closed] * @param string $assignee The assignee name, 'none', or *. * @param string $mentioned The GitHub user name. * @param string $labels The list of comma separated Label names. Example: bug,ui,@high. * @param string $sort The sort order: created, updated, comments, default: created. * @param string $direction The list direction: asc or desc, default: desc. * @param JDate $since The date/time since when issues should be returned. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getListByRepository($user, $repo, $milestone = null, $state = null, $assignee = null, $mentioned = null, $labels = null, $sort = null, $direction = null, JDate $since = null, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/issues'; $uri = new JUri($this->fetchUrl($path, $page, $limit)); if ($milestone) { $uri->setVar('milestone', $milestone); } if ($state) { $uri->setVar('state', $state); } if ($assignee) { $uri->setVar('assignee', $assignee); } if ($mentioned) { $uri->setVar('mentioned', $mentioned); } if ($labels) { $uri->setVar('labels', $labels); } if ($sort) { $uri->setVar('sort', $sort); } if ($direction) { $uri->setVar('direction', $direction); } if ($since) { $uri->setVar('since', $since->toISO8601()); } // Send the request. $response = $this->client->get((string) $uri); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /* * Deprecated methods */ /** * Method to create a comment on an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $issueId The issue number. * @param string $body The comment body text. * * @deprecated use issues->comments->create() * * @return object * * @since 11.3 */ public function createComment($user, $repo, $issueId, $body) { return $this->comments->create($user, $repo, $issueId, $body); } /** * Method to create a label on a repo. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $name The label name. * @param string $color The label color. * * @deprecated use issues->labels->create() * * @return object * * @since 12.3 */ public function createLabel($user, $repo, $name, $color) { return $this->labels->create($user, $repo, $name, $color); } /** * Method to delete a comment on an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The id of the comment to delete. * * @deprecated use issues->comments->delete() * * @return void * * @since 11.3 */ public function deleteComment($user, $repo, $commentId) { $this->comments->delete($user, $repo, $commentId); } /** * Method to delete a label on a repo. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $label The label name. * * @deprecated use issues->labels->delete() * * @return object * * @since 12.3 */ public function deleteLabel($user, $repo, $label) { return $this->labels->delete($user, $repo, $label); } /** * Method to update a comment on an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The id of the comment to update. * @param string $body The new body text for the comment. * * @deprecated use issues->comments->edit() * * @return object * * @since 11.3 */ public function editComment($user, $repo, $commentId, $body) { return $this->comments->edit($user, $repo, $commentId, $body); } /** * Method to update a label on a repo. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $label The label name. * @param string $name The label name. * @param string $color The label color. * * @deprecated use issues->labels->update() * * @return object * * @since 12.3 */ public function editLabel($user, $repo, $label, $name, $color) { return $this->labels->update($user, $repo, $label, $name, $color); } /** * Method to get a specific comment on an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The comment id to get. * * @deprecated use issues->comments->get() * * @return object * * @since 11.3 */ public function getComment($user, $repo, $commentId) { return $this->comments->get($user, $repo, $commentId); } /** * Method to get the list of comments on an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $issueId The issue number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @deprecated use issues->comments->getList() * * @return array * * @since 11.3 */ public function getComments($user, $repo, $issueId, $page = 0, $limit = 0) { return $this->comments->getList($user, $repo, $issueId, $page, $limit); } /** * Method to get a specific label on a repo. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $name The label name to get. * * @deprecated use issues->labels->get() * * @return object * * @since 12.3 */ public function getLabel($user, $repo, $name) { return $this->labels->get($user, $repo, $name); } /** * Method to get the list of labels on a repo. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * * @deprecated use issues->labels->getList() * * @return array * * @since 12.3 */ public function getLabels($user, $repo) { return $this->labels->getList($user, $repo); } } PK���\,���2libraries/joomla/github/package/gists/comments.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Gists Comments class for the Joomla Platform. * * @documentation http://developer.github.com/v3/gists/comments/ * * @since 3.3 (CMS) */ class JGithubPackageGistsComments extends JGithubPackage { /** * Method to create a comment on a gist. * * @param integer $gistId The gist number. * @param string $body The comment body text. * * @throws DomainException * @since 11.3 * * @return object */ public function create($gistId, $body) { // Build the request path. $path = '/gists/' . (int) $gistId . '/comments'; // Build the request data. $data = json_encode( array( 'body' => $body, ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to delete a comment on a gist. * * @param integer $commentId The id of the comment to delete. * * @throws DomainException * @since 11.3 * * @return void */ public function delete($commentId) { // Build the request path. $path = '/gists/comments/' . (int) $commentId; // Send the request. $response = $this->client->delete($this->fetchUrl($path)); // Validate the response code. if ($response->code != 204) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } } /** * Method to update a comment on a gist. * * @param integer $commentId The id of the comment to update. * @param string $body The new body text for the comment. * * @throws DomainException * @since 11.3 * * @return object */ public function edit($commentId, $body) { // Build the request path. $path = '/gists/comments/' . (int) $commentId; // Build the request data. $data = json_encode( array( 'body' => $body ) ); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a specific comment on a gist. * * @param integer $commentId The comment id to get. * * @throws DomainException * @since 11.3 * * @return object */ public function get($commentId) { // Build the request path. $path = '/gists/comments/' . (int) $commentId; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get the list of comments on a gist. * * @param integer $gistId The gist number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getList($gistId, $page = 0, $limit = 0) { // Build the request path. $path = '/gists/' . (int) $gistId . '/comments'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } } PK���\�ob���(libraries/joomla/github/package/data.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API DB class for the Joomla Platform. * * @documentation http://developer.github.com/v3/git/ * * @since 12.3 * * http://developer.github.com/v3/git/ * Git DB API * * The Git Database API gives you access to read and write raw Git objects to your Git database on GitHub and to list * * and update your references (branch heads and tags). * * This basically allows you to reimplement a lot of Git functionality over our API - by creating raw objects * * directly into the database and updating branch references you could technically do just about anything that * * Git can do without having Git installed. * * Git DB API functions will return a 409 if the git repo for a Repository is empty or unavailable. * * This typically means it is being created still. Contact Support if this response status persists. * * git db * * For more information on the Git object database, please read the Git Internals chapter of the Pro Git book. * * As an example, if you wanted to commit a change to a file in your repository, you would: * * get the current commit object * retrieve the tree it points to * retrieve the content of the blob object that tree has for that particular file path * change the content somehow and post a new blob object with that new content, getting a blob SHA back * post a new tree object with that file path pointer replaced with your new blob SHA getting a tree SHA back * create a new commit object with the current commit SHA as the parent and the new tree SHA, getting a commit SHA back * update the reference of your branch to point to the new commit SHA * * It might seem complex, but it’s actually pretty simple when you understand the model and it opens up a ton of * things you could potentially do with the API. */ class JGithubPackageData extends JGithubPackage { protected $name = 'Data'; protected $packages = array( 'blobs', 'commits', 'refs', 'tags', 'trees' ); } PK���\qW��YY,libraries/joomla/github/package/markdown.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2012 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * GitHub API Markdown class. * * @documentation http://developer.github.com/v3/markdown * * @since 3.3 (CMS) */ class JGithubPackageMarkdown extends JGithubPackage { /** * Method to render a markdown document. * * @param string $text The text object being parsed. * @param string $mode The parsing mode; valid options are 'markdown' or 'gfm'. * @param string $context An optional repository context, only used in 'gfm' mode. * * @since 3.3 (CMS) * @throws DomainException * @throws InvalidArgumentException * * @return string Formatted HTML */ public function render($text, $mode = 'gfm', $context = null) { // The valid modes $validModes = array('gfm', 'markdown'); // Make sure the scope is valid if (!in_array($mode, $validModes)) { throw new InvalidArgumentException(sprintf('The %s mode is not valid. Valid modes are "gfm" or "markdown".', $mode)); } // Build the request path. $path = '/markdown'; // Build the request data. $data = str_replace('\\/', '/', json_encode( array( 'text' => $text, 'mode' => $mode, 'context' => $context ) ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); $message = (isset($error->message)) ? $error->message : 'Error: ' . $response->code; throw new DomainException($message, $response->code); } return $response->body; } } PK���\f��KA%A%.libraries/joomla/github/package/orgs/teams.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Orgs Teams class for the Joomla Platform. * * All actions against teams require at a minimum an authenticated user who is a member * of the owner’s team in the :org being managed. Additionally, OAuth users require “user” scope. * * @documentation http://developer.github.com/v3/orgs/teams/ * * @since 12.3 */ class JGithubPackageOrgsTeams extends JGithubPackage { /** * List teams. * * @param string $org The name of the organization. * * @since 3.3 (CMS) * * @return object */ public function getList($org) { // Build the request path. $path = '/orgs/' . $org . '/teams'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get team. * * @param integer $id The team id. * * @since 3.3 (CMS) * * @return object */ public function get($id) { // Build the request path. $path = '/teams/' . (int) $id; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Create team. * * In order to create a team, the authenticated user must be an owner of the organization. * * @param string $org The name of the organization. * @param string $name The name of the team. * @param array $repoNames Repository names. * @param string $permission The permission. * pull - team members can pull, but not push to or administer these repositories. Default * push - team members can pull and push, but not administer these repositories. * admin - team members can pull, push and administer these repositories. * * @throws UnexpectedValueException * * @since 3.3 (CMS) * * @return object */ public function create($org, $name, array $repoNames = array(), $permission = '') { // Build the request path. $path = '/orgs/' . $org . '/teams'; $data = array( 'name' => $name ); if ($repoNames) { $data['repo_names'] = $repoNames; } if ($permission) { if (false == in_array($permission, array('pull', 'push', 'admin'))) { throw new UnexpectedValueException('Permissions must be either "pull", "push", or "admin".'); } $data['permission'] = $permission; } return $this->processResponse( $this->client->post($this->fetchUrl($path), $data), 201 ); } /** * Edit team. * * In order to edit a team, the authenticated user must be an owner of the org that the team is associated with. * * @param integer $id The team id. * @param string $name The name of the team. * @param string $permission The permission. * pull - team members can pull, but not push to or administer these repositories. Default * push - team members can pull and push, but not administer these repositories. * admin - team members can pull, push and administer these repositories. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return object */ public function edit($id, $name, $permission = '') { // Build the request path. $path = '/teams/' . (int) $id; $data = array( 'name' => $name ); if ($permission) { if (false == in_array($permission, array('pull', 'push', 'admin'))) { throw new UnexpectedValueException('Permissions must be either "pull", "push", or "admin".'); } $data['permission'] = $permission; } return $this->processResponse( $this->client->patch($this->fetchUrl($path), $data) ); } /** * Delete team. * * In order to delete a team, the authenticated user must be an owner of the org that the team is associated with. * * @param integer $id The team id. * * @since 3.3 (CMS) * * @return object */ public function delete($id) { // Build the request path. $path = '/teams/' . $id; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * List team members. * * In order to list members in a team, the authenticated user must be a member of the team. * * @param integer $id The team id. * * @since 3.3 (CMS) * * @return object */ public function getListMembers($id) { // Build the request path. $path = '/teams/' . $id . '/members'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get team member. * * In order to get if a user is a member of a team, the authenticated user must be a member of the team. * * @param integer $id The team id. * @param string $user The name of the user. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return object */ public function isMember($id, $user) { // Build the request path. $path = '/teams/' . $id . '/members/' . $user; $response = $this->client->get($this->fetchUrl($path)); switch ($response->code) { case 204 : // Response if user is a member return true; break; case 404 : // Response if user is not a member return false; break; default : throw new UnexpectedValueException('Unexpected response code: ' . $response->code); break; } } /** * Add team member. * * In order to add a user to a team, the authenticated user must have ‘admin’ permissions * to the team or be an owner of the org that the team is associated with. * * @param integer $id The team id. * @param string $user The name of the user. * * @since 3.3 (CMS) * * @return object */ public function addMember($id, $user) { // Build the request path. $path = '/teams/' . $id . '/members/' . $user; return $this->processResponse( $this->client->put($this->fetchUrl($path), ''), 204 ); } /** * Remove team member. * * In order to remove a user from a team, the authenticated user must have ‘admin’ permissions * to the team or be an owner of the org that the team is associated with. * NOTE: This does not delete the user, it just remove them from the team. * * @param integer $id The team id. * @param string $user The name of the user. * * @since 3.3 (CMS) * * @return object */ public function removeMember($id, $user) { // Build the request path. $path = '/teams/' . $id . '/members/' . $user; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * List team repos. * * @param integer $id The team id. * * @since 3.3 (CMS) * * @return object */ public function getListRepos($id) { // Build the request path. $path = '/teams/' . $id . '/repos'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Check if the repo is managed by this team. * * @param integer $id The team id. * @param string $repo The name of the GitHub repository. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return object */ public function checkRepo($id, $repo) { // Build the request path. $path = '/teams/' . $id . '/repos/' . $repo; $response = $this->client->get($this->fetchUrl($path)); switch ($response->code) { case 204 : // Response if repo is managed by this team. return true; break; case 404 : // Response if repo is not managed by this team. return false; break; default : throw new UnexpectedValueException('Unexpected response code: ' . $response->code); break; } } /** * Add team repo. * * In order to add a repo to a team, the authenticated user must be an owner of the * org that the team is associated with. Also, the repo must be owned by the organization, * or a direct form of a repo owned by the organization. * * If you attempt to add a repo to a team that is not owned by the organization, you get: * Status: 422 Unprocessable Entity * * @param integer $id The team id. * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * * @since 3.3 (CMS) * * @return object */ public function addRepo($id, $owner, $repo) { // Build the request path. $path = '/teams/' . $id . '/repos/' . $owner . '/' . $repo; return $this->processResponse( $this->client->put($this->fetchUrl($path), ''), 204 ); } /** * Remove team repo. * * In order to remove a repo from a team, the authenticated user must be an owner * of the org that the team is associated with. NOTE: This does not delete the * repo, it just removes it from the team. * * @param integer $id The team id. * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * * @since 3.3 (CMS) * * @return object */ public function removeRepo($id, $owner, $repo) { // Build the request path. $path = '/teams/' . (int) $id . '/repos/' . $owner . '/' . $repo; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\FUV���0libraries/joomla/github/package/orgs/members.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Orgs Members class for the Joomla Platform. * * @documentation http://developer.github.com/v3/orgs/members/ * * @since 12.3 */ class JGithubPackageOrgsMembers extends JGithubPackage { /** * Members list. * * List all users who are members of an organization. * A member is a user that belongs to at least 1 team in the organization. * If the authenticated user is also a member of this organization then * both concealed and public members will be returned. * If the requester is not a member of the organization the query will be * redirected to the public members list. * * @param string $org The name of the organization. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return boolean|mixed */ public function getList($org) { // Build the request path. $path = '/orgs/' . $org . '/members'; $response = $this->client->get($this->fetchUrl($path)); switch ($response->code) { case 302 : // Requester is not an organization member. return false; break; case 200 : return json_decode($response->body); break; default : throw new UnexpectedValueException('Unexpected response code: ' . $response->code); break; } } /** * Check membership. * * Check if a user is, publicly or privately, a member of the organization. * * @param string $org The name of the organization. * @param string $user The name of the user. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return boolean */ public function check($org, $user) { // Build the request path. $path = '/orgs/' . $org . '/members/' . $user; $response = $this->client->get($this->fetchUrl($path)); switch ($response->code) { case 204 : // Requester is an organization member and user is a member. return true; break; case 404 : // Requester is an organization member and user is not a member. // Requester is not an organization member and is inquiring about themselves. return false; break; case 302 : // Requester is not an organization member. return false; break; default : throw new UnexpectedValueException('Unexpected response code: ' . $response->code); break; } } /** * Add a member. * * To add someone as a member to an org, you must add them to a team. */ /** * Remove a member. * * Removing a user from this list will remove them from all teams and they will no longer have * any access to the organization’s repositories. * * @param string $org The name of the organization. * @param string $user The name of the user. * * @since 3.3 (CMS) * * @return object */ public function remove($org, $user) { // Build the request path. $path = '/orgs/' . $org . '/members/' . $user; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * Public members list. * * Members of an organization can choose to have their membership publicized or not. * * @param string $org The name of the organization. * * @since 3.3 (CMS) * * @return object */ public function getListPublic($org) { // Build the request path. $path = '/orgs/' . $org . '/public_members'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Check public membership. * * @param string $org The name of the organization. * @param string $user The name of the user. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return object */ public function checkPublic($org, $user) { // Build the request path. $path = '/orgs/' . $org . '/public_members/' . $user; $response = $this->client->get($this->fetchUrl($path)); switch ($response->code) { case 204 : // Response if user is a public member. return true; break; case 404 : // Response if user is not a public member. return false; break; default : throw new UnexpectedValueException('Unexpected response code: ' . $response->code); break; } } /** * Publicize a user’s membership. * * @param string $org The name of the organization. * @param string $user The name of the user. * * @since 3.3 (CMS) * * @return object */ public function publicize($org, $user) { // Build the request path. $path = '/orgs/' . $org . '/public_members/' . $user; return $this->processResponse( $this->client->put($this->fetchUrl($path), ''), 204 ); } /** * Conceal a user’s membership. * * @param string $org The name of the organization. * @param string $user The name of the user. * * @since 3.3 (CMS) * * @return object */ public function conceal($org, $user) { // Build the request path. $path = '/orgs/' . $org . '/public_members/' . $user; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\�_j��>libraries/joomla/github/package/repositories/collaborators.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Repositories Collaborators class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/collaborators * * @since 11.3 */ class JGithubPackageRepositoriesCollaborators extends JGithubPackage { /** * List. * * When authenticating as an organization owner of an organization-owned repository, all organization * owners are included in the list of collaborators. Otherwise, only users with access to the repository * are returned in the collaborators list. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * * @since 3.3 (CMS) * * @return object */ public function getList($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/collaborators'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Test if a user is a collaborator. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $user The name of the GitHub user. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return boolean */ public function get($owner, $repo, $user) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/collaborators/' . $user; $response = $this->client->get($this->fetchUrl($path)); switch ($response->code) { case '204'; return true; break; case '404'; return false; break; default; throw new UnexpectedValueException('Unexpected code: ' . $response->code); break; } } /** * Add collaborator. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $user The name of the GitHub user. * * @since 3.3 (CMS) * * @return object */ public function add($owner, $repo, $user) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/collaborators/' . $user; return $this->processResponse( $this->client->put($this->fetchUrl($path), ''), 204 ); } /** * Remove collaborator. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $user The name of the GitHub user. * * @since 3.3 (CMS) * * @return object */ public function remove($owner, $repo, $user) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/collaborators/' . $user; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\��5libraries/joomla/github/package/repositories/keys.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Forks class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/keys * * @since 11.3 */ class JGithubPackageRepositoriesKeys extends JGithubPackage { /** * List keys in a repository. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * * @since 12.4 * * @return object */ public function getList($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/keys'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get a key. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id The id of the key. * * @since 12.4 * * @return object */ public function get($owner, $repo, $id) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/keys/' . (int) $id; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Create a key. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $title The key title. * @param string $key The key. * * @since 12.4 * * @return object */ public function create($owner, $repo, $title, $key) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/keys'; $data = array( 'title' => $title, 'key' => $key ); return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode($data)), 201 ); } /** * Edit a key. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id The id of the key. * @param string $title The key title. * @param string $key The key. * * @since 12.4 * * @return object */ public function edit($owner, $repo, $id, $title, $key) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/keys/' . (int) $id; $data = array( 'title' => $title, 'key' => $key ); return $this->processResponse( $this->client->patch($this->fetchUrl($path), json_encode($data)) ); } /** * Delete a key. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id The id of the key. * * @since 12.4 * * @return boolean */ public function delete($owner, $repo, $id) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/keys/' . (int) $id; $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); return true; } } PK���\��/���8libraries/joomla/github/package/repositories/commits.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Repositories Commits class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/commits * * @since 11.3 */ class JGithubPackageRepositoriesCommits extends JGithubPackage { /** * Method to list commits for a repository. * * A special note on pagination: Due to the way Git works, commits are paginated based on SHA * instead of page number. * Please follow the link headers as outlined in the pagination overview instead of constructing * page links yourself. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha Sha or branch to start listing commits from. * @param string $path Only commits containing this file path will be returned. * @param string $author GitHub login, name, or email by which to filter by commit author. * @param JDate $since ISO 8601 Date - Only commits after this date will be returned. * @param JDate $until ISO 8601 Date - Only commits before this date will be returned. * * @throws DomainException * @since 12.1 * * @return array */ public function getList($user, $repo, $sha = '', $path = '', $author = '', JDate $since = null, JDate $until = null) { // Build the request path. $rPath = '/repos/' . $user . '/' . $repo . '/commits?'; $rPath .= ($sha) ? '&sha=' . $sha : ''; $rPath .= ($path) ? '&path=' . $path : ''; $rPath .= ($author) ? '&author=' . $author : ''; $rPath .= ($since) ? '&since=' . $since->toISO8601() : ''; $rPath .= ($until) ? '&until=' . $until->toISO8601() : ''; // Send the request. $response = $this->client->get($this->fetchUrl($rPath)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a single commit for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA of the commit to retrieve. * * @throws DomainException * @since 12.1 * * @return array */ public function get($user, $repo, $sha) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/commits/' . $sha; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a diff for two commits. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $base The base of the diff, either a commit SHA or branch. * @param string $head The head of the diff, either a commit SHA or branch. * * @return array * * @since 12.1 */ public function compare($user, $repo, $base, $head) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/compare/' . $base . '...' . $head; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } } PK���\<���;libraries/joomla/github/package/repositories/statistics.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API class for the Joomla Platform. * * The Repository Statistics API allows you to fetch the data that GitHub uses for * visualizing different types of repository activity. * * @documentation http://developer.github.com/v3/repos/statistics * * @since 3.3 (CMS) */ class JGithubPackageRepositoriesStatistics extends JGithubPackage { /** * Get contributors list with additions, deletions, and commit counts. * * Response include: * total - The Total number of commits authored by the contributor. * * Weekly Hash * * w - Start of the week * a - Number of additions * d - Number of deletions * c - Number of commits * * @param string $owner The owner of the repository. * @param string $repo The repository name. * * @since 1.0 * * @return object */ public function getListContributors($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/stats/contributors'; // Send the request. return $this->processResponse($this->client->get($this->fetchUrl($path))); } /** * Get the last year of commit activity data. * * Returns the last year of commit activity grouped by week. * The days array is a group of commits per day, starting on Sunday. * * @param string $owner The owner of the repository. * @param string $repo The repository name. * * @since 1.0 * * @return object */ public function getActivityData($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/stats/commit_activity'; // Send the request. return $this->processResponse($this->client->get($this->fetchUrl($path))); } /** * Get the number of additions and deletions per week. * * Response returns a weekly aggregate of the number of additions and deletions pushed to a repository. * * @param string $owner The owner of the repository. * @param string $repo The repository name. * * @since 1.0 * * @return object */ public function getCodeFrequency($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/stats/code_frequency'; // Send the request. return $this->processResponse($this->client->get($this->fetchUrl($path))); } /** * Get the weekly commit count for the repo owner and everyone else. * * Returns the total commit counts for the "owner" and total commit counts in "all". "all" is everyone combined, * including the owner in the last 52 weeks. * If you’d like to get the commit counts for non-owners, you can subtract all from owner. * * The array order is oldest week (index 0) to most recent week. * * @param string $owner The owner of the repository. * @param string $repo The repository name. * * @since 1.0 * * @return object */ public function getParticipation($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/stats/participation'; // Send the request. return $this->processResponse($this->client->get($this->fetchUrl($path))); } /** * Get the number of commits per hour in each day. * * Response * Each array contains the day number, hour number, and number of commits: * * 0-6: Sunday - Saturday * 0-23: Hour of day * Number of commits * * For example, [2, 14, 25] indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. * All times are based on the time zone of individual commits. * * @param string $owner The owner of the repository. * @param string $repo The repository name. * * @since 1.0 * * @return object */ public function getPunchCard($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/stats/punch_card'; // Send the request. return $this->processResponse($this->client->get($this->fetchUrl($path))); } /** * Process the response and decode it. * * @param JHttpResponse $response The response. * @param integer $expectedCode The expected "good" code. * * @return mixed * * @since 1.0 * @throws \DomainException */ protected function processResponse(JHttpResponse $response, $expectedCode = 200) { if (202 == $response->code) { throw new \DomainException( 'GitHub is building the statistics data. Please try again in a few moments.', $response->code ); } return parent::processResponse($response, $expectedCode); } } PK���\�s0�::9libraries/joomla/github/package/repositories/statuses.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API References class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/statuses * * @since 12.3 */ class JGithubPackageRepositoriesStatuses extends JGithubPackage { /** * Method to create a status. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA1 value for which to set the status. * @param string $state The state (pending, success, error or failure). * @param string $targetUrl Optional target URL. * @param string $description Optional description for the status. * * @throws InvalidArgumentException * @throws DomainException * * @since 12.3 * * @return object */ public function create($user, $repo, $sha, $state, $targetUrl = null, $description = null) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/statuses/' . $sha; if (!in_array($state, array('pending', 'success', 'error', 'failure'))) { throw new InvalidArgumentException('State must be one of pending, success, error or failure.'); } // Build the request data. $data = array( 'state' => $state ); if (!is_null($targetUrl)) { $data['target_url'] = $targetUrl; } if (!is_null($description)) { $data['description'] = $description; } // Send the request. $response = $this->client->post($this->fetchUrl($path), json_encode($data)); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list statuses for an SHA. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha SHA1 for which to get the statuses. * * @return array * * @since 12.3 */ public function getList($user, $repo, $sha) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/statuses/' . $sha; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } } PK���\ӕZ���9libraries/joomla/github/package/repositories/contents.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Repositories Contents class for the Joomla Platform. * * These API methods let you retrieve the contents of files within a repository as Base64 encoded content. * See media types for requesting raw or other formats. * * @documentation http://developer.github.com/v3/repos/contents * * @since 11.3 */ class JGithubPackageRepositoriesContents extends JGithubPackage { /** * Get the README * * This method returns the preferred README for a repository. * * GET /repos/:owner/:repo/readme * * Parameters * * ref * Optional string - The String name of the Commit/Branch/Tag. Defaults to master. * * Response * * Status: 200 OK * X-RateLimit-Limit: 5000 * X-RateLimit-Remaining: 4999 * * { * "type": "file", * "encoding": "base64", * "_links": { * "git": "https://api.github.com/repos/pengwynn/octokit/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", * "self": "https://api.github.com/repos/pengwynn/octokit/contents/README.md", * "html": "https://github.com/pengwynn/octokit/blob/master/README.md" * }, * "size": 5362, * "name": "README.md", * "path": "README.md", * "content": "encoded content ...", * "sha": "3d21ec53a331a6f037a91c368710b99387d012c1" * } * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $ref The String name of the Commit/Branch/Tag. Defaults to master. * * @since 3.3 (CMS) * * @return object */ public function getReadme($owner, $repo, $ref = '') { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/readme'; if ($ref) { $path .= '?ref=' . $ref; } // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get contents * * This method returns the contents of any file or directory in a repository. * * GET /repos/:owner/:repo/contents/:path * * Parameters * * path * Optional string - The content path. * ref * Optional string - The String name of the Commit/Branch/Tag. Defaults to master. * * Response * * Status: 200 OK * X-RateLimit-Limit: 5000 * X-RateLimit-Remaining: 4999 * * { * "type": "file", * "encoding": "base64", * "_links": { * "git": "https://api.github.com/repos/pengwynn/octokit/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", * "self": "https://api.github.com/repos/pengwynn/octokit/contents/README.md", * "html": "https://github.com/pengwynn/octokit/blob/master/README.md" * }, * "size": 5362, * "name": "README.md", * "path": "README.md", * "content": "encoded content ...", * "sha": "3d21ec53a331a6f037a91c368710b99387d012c1" * } * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $path The content path. * @param string $ref The String name of the Commit/Branch/Tag. Defaults to master. * * @since 3.3 (CMS) * * @return object */ public function get($owner, $repo, $path, $ref = '') { // Build the request path. $rPath = '/repos/' . $owner . '/' . $repo . '/contents/' . $path; if ($ref) { $rPath .= '?ref=' . $ref; } // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($rPath)) ); } /** * Get archive link * * This method will return a 302 to a URL to download a tarball or zipball archive for a repository. * Please make sure your HTTP framework is configured to follow redirects or you will need to use the Location header to make a second GET request. * * Note: For private repositories, these links are temporary and expire quickly. * * GET /repos/:owner/:repo/:archive_format/:ref * * Parameters * * archive_format * Either tarball or zipball * ref * Optional string - valid Git reference, defaults to master * * Response * * Status: 302 Found * Location: http://github.com/me/myprivate/tarball/master?SSO=thistokenexpires * X-RateLimit-Limit: 5000 * X-RateLimit-Remaining: 4999 * * To follow redirects with curl, use the -L switch: * * curl -L https://api.github.com/repos/pengwynn/octokit/tarball > octokit.tar.gz * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $archive_format Either tarball or zipball. * @param string $ref The String name of the Commit/Branch/Tag. Defaults to master. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return object */ public function getArchiveLink($owner, $repo, $archive_format = 'zipball', $ref = '') { if (false == in_array($archive_format, array('tarball', 'zipball'))) { throw new UnexpectedValueException('Archive format must be either "tarball" or "zipball".'); } // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/' . $archive_format; if ($ref) { $path .= '?ref=' . $ref; } // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)), 302 ); } } PK���\� ��a a 6libraries/joomla/github/package/repositories/forks.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Forks class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/forks * * @since 11.3 */ class JGithubPackageRepositoriesForks extends JGithubPackage { /** * Method to fork a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $org The organization to fork the repo into. By default it is forked to the current user. * * @return object * * @since 11.4 * @throws DomainException */ public function create($user, $repo, $org = '') { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/forks'; if (strlen($org) > 0) { $data = json_encode( array('org' => $org) ); } else { $data = json_encode(array()); } // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 202) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list forks for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @return array * * @since 11.4 * @throws DomainException */ public function getList($user, $repo, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/forks'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } } PK���\KH�̨ � 8libraries/joomla/github/package/repositories/merging.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Repositories Merging class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/merging * * @since 11.3 */ class JGithubPackageRepositoriesMerging extends JGithubPackage { /** * Perform a merge. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $base The name of the base branch that the head will be merged into. * @param string $head The head to merge. This can be a branch name or a commit SHA1. * @param string $commit_message Commit message to use for the merge commit. * If omitted, a default message will be used. * * @throws UnexpectedValueException * @since 12.4 * * @return boolean */ public function perform($owner, $repo, $base, $head, $commit_message = '') { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/merges'; $data = new stdClass; $data->base = $base; $data->head = $head; if ($commit_message) { $data->commit_message = $commit_message; } // Send the request. $response = $this->client->post($this->fetchUrl($path), json_encode($data)); switch ($response->code) { case '201': // Success return json_decode($response->body); break; case '204': // No-op response (base already contains the head, nothing to merge) throw new UnexpectedValueException('Nothing to merge'); break; case '404': // Missing base or Missing head response $error = json_decode($response->body); $message = (isset($error->message)) ? $error->message : 'Missing base or head: ' . $response->code; throw new UnexpectedValueException($message); break; case '409': // Merge conflict response $error = json_decode($response->body); $message = (isset($error->message)) ? $error->message : 'Merge conflict ' . $response->code; throw new UnexpectedValueException($message); break; default : throw new UnexpectedValueException('Unexpected response code: ' . $response->code); break; } } } PK���\��Jss6libraries/joomla/github/package/repositories/hooks.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Hooks class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/hooks * * @since 12.3 */ class JGithubPackageRepositoriesHooks extends JGithubPackage { /** * Array containing the allowed hook events * * @var array * @since 12.3 */ protected $events = array( 'push', 'issues', 'issue_comment', 'commit_comment', 'pull_request', 'gollum', 'watch', 'download', 'fork', 'fork_apply', 'member', 'public', 'status' ); /** * Method to create a hook on a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $name The name of the service being called. * @param array $config Array containing the config for the service. * @param array $events The events the hook will be triggered for. * @param boolean $active Flag to determine if the hook is active * * @return object * * @since 12.3 * @throws DomainException * @throws RuntimeException */ public function create($user, $repo, $name, $config, array $events = array('push'), $active = true) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks'; // Check to ensure all events are in the allowed list foreach ($events as $event) { if (!in_array($event, $this->events)) { throw new RuntimeException('Your events array contains an unauthorized event.'); } } $data = json_encode( array('name' => $name, 'config' => $config, 'events' => $events, 'active' => $active) ); return $this->processResponse( $this->client->post($this->fetchUrl($path), $data), 201 ); } /** * Method to delete a hook * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the hook to delete. * * @return object * * @since 12.3 * @throws DomainException */ public function delete($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * Method to edit a hook. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the hook to edit. * @param string $name The name of the service being called. * @param array $config Array containing the config for the service. * @param array $events The events the hook will be triggered for. This resets the currently set list * @param array $addEvents Events to add to the hook. * @param array $removeEvents Events to remove from the hook. * @param boolean $active Flag to determine if the hook is active * * @return object * * @since 12.3 * @throws DomainException * @throws RuntimeException */ public function edit($user, $repo, $id, $name, $config, array $events = array('push'), array $addEvents = array(), array $removeEvents = array(), $active = true) { // Check to ensure all events are in the allowed list foreach ($events as $event) { if (!in_array($event, $this->events)) { throw new RuntimeException('Your events array contains an unauthorized event.'); } } foreach ($addEvents as $event) { if (!in_array($event, $this->events)) { throw new RuntimeException('Your active_events array contains an unauthorized event.'); } } foreach ($removeEvents as $event) { if (!in_array($event, $this->events)) { throw new RuntimeException('Your remove_events array contains an unauthorized event.'); } } // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id; $data = json_encode( array( 'name' => $name, 'config' => $config, 'events' => $events, 'add_events' => $addEvents, 'remove_events' => $removeEvents, 'active' => $active) ); return $this->processResponse( $this->client->patch($this->fetchUrl($path), $data) ); } /** * Method to get details about a single hook for the repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the hook to retrieve * * @return object * * @since 12.3 * @throws DomainException */ public function get($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Method to list hooks for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * * @return object * * @since 12.3 * @throws DomainException */ public function getList($user, $repo) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Method to test a hook against the latest repository commit * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the hook to delete * * @return object * * @since 12.3 * @throws DomainException */ public function test($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id . '/test'; return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode('')), 204 ); } } PK���\�Zm��9libraries/joomla/github/package/repositories/comments.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Repositories Comments class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/comments * * @since 11.3 */ class JGithubPackageRepositoriesComments extends JGithubPackage { /** * Method to get a list of commit comments for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @return array * * @since 12.1 */ public function getListRepository($user, $repo, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/comments'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path, $page, $limit)) ); } /** * Method to get a list of comments for a single commit for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA of the commit to retrieve. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @return array * * @since 12.1 */ public function getList($user, $repo, $sha, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/commits/' . $sha . '/comments'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path, $page, $limit)) ); } /** * Method to get a single comment on a commit. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the comment to retrieve * * @return array * * @since 12.1 */ public function get($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/comments/' . (int) $id; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Method to edit a comment on a commit. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $id The ID of the comment to edit. * @param string $comment The text of the comment. * * @return object * * @since 12.1 */ public function edit($user, $repo, $id, $comment) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/comments/' . $id; $data = json_encode( array( 'body' => $comment ) ); // Send the request. return $this->processResponse( $this->client->patch($this->fetchUrl($path), $data) ); } /** * Method to delete a comment on a commit. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $id The ID of the comment to edit. * * @return object * * @since 12.1 */ public function delete($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/comments/' . $id; // Send the request. return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * Method to create a comment on a commit. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sha The SHA of the commit to comment on. * @param string $comment The text of the comment. * @param integer $line The line number of the commit to comment on. * @param string $filepath A relative path to the file to comment on within the commit. * @param integer $position Line index in the diff to comment on. * * @return object * * @since 12.1 */ public function create($user, $repo, $sha, $comment, $line, $filepath, $position) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/commits/' . $sha . '/comments'; $data = json_encode( array( 'body' => $comment, 'path' => $filepath, 'position' => (int) $position, 'line' => (int) $line ) ); // Send the request. return $this->processResponse( $this->client->post($this->fetchUrl($path), $data), 201 ); } } PK���\Ƨ��SS:libraries/joomla/github/package/repositories/downloads.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Repositories Downloads class for the Joomla Platform. * * The downloads API is for package downloads only. * If you want to get source tarballs you should use * http://developer.github.com/v3/repos/contents/#get-archive-link instead. * * @documentation http://developer.github.com/v3/repos/downloads * * @since 11.3 */ class JGithubPackageRepositoriesDownloads extends JGithubPackage { /** * List downloads for a repository. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * * @since 3.3 (CMS) * * @return object */ public function getList($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/downloads'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get a single download. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id The id of the download. * * @since 3.3 (CMS) * * @return object */ public function get($owner, $repo, $id) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/downloads/' . $id; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Create a new download (Part 1: Create the resource). * * Creating a new download is a two step process. You must first create a new download resource. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $name The name. * @param string $size Size of file in bytes. * @param string $description The description. * @param string $content_type The content type. * * @since 3.3 (CMS) * * @return object */ public function create($owner, $repo, $name, $size, $description = '', $content_type = '') { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/downloads'; $data = array( 'name' => $name, 'size' => $size ); if ($description) { $data['description'] = $description; } if ($content_type) { $data['content_type'] = $content_type; } // Send the request. return $this->processResponse( $this->client->post($this->fetchUrl($path), $data), 201 ); } /** * Create a new download (Part 2: Upload file to s3). * * Now that you have created the download resource, you can use the information * in the response to upload your file to s3. This can be done with a POST to * the s3_url you got in the create response. Here is a brief example using curl: * * curl \ * -F "key=downloads/octocat/Hello-World/new_file.jpg" \ * -F "acl=public-read" \ * -F "success_action_status=201" \ * -F "Filename=new_file.jpg" \ * -F "AWSAccessKeyId=1ABCDEF..." \ * -F "Policy=ewogIC..." \ * -F "Signature=mwnF..." \ * -F "Content-Type=image/jpeg" \ * -F "file=@new_file.jpg" \ * https://github.s3.amazonaws.com/ * * NOTES * The order in which you pass these fields matters! Follow the order shown above exactly. * All parameters shown are required and if you excluded or modify them your upload will * fail because the values are hashed and signed by the policy. * * More information about using the REST API to interact with s3 can be found here: * http://docs.amazonwebservices.com/AmazonS3/latest/API/ * * @param string $key Value of path field in the response. * @param string $acl Value of acl field in the response. * @param string $success_action_status 201, or whatever you want to get back. * @param string $filename Value of name field in the response. * @param string $awsAccessKeyId Value of accesskeyid field in the response. * @param string $policy Value of policy field in the response. * @param string $signature Value of signature field in the response. * @param string $content_type Value of mime_type field in the response. * @param string $file Local file. Example assumes the file existing in the directory * where you are running the curl command. Yes, the @ matters. * * @since 3.3 (CMS) * * @return boolean */ public function upload($key, $acl, $success_action_status, $filename, $awsAccessKeyId, $policy, $signature, $content_type, $file) { // Build the request path. $url = 'https://github.s3.amazonaws.com/'; $data = array( 'key' => $key, 'acl' => $acl, 'success_action_status' => (int) $success_action_status, 'Filename' => $filename, 'AWSAccessKeyId' => $awsAccessKeyId, 'Policy' => $policy, 'Signature' => $signature, 'Content-Type' => $content_type, 'file' => $file ); // Send the request. $response = $this->client->post($url, $data); // @todo Process the response.. return (201 == $response->code) ? true : false; } /** * Delete a download. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id The id of the download. * * @since 3.3 (CMS) * * @return object */ public function delete($owner, $repo, $id) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/downloads/' . (int) $id; // Send the request. return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\��� � � 1libraries/joomla/github/package/authorization.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Authorization class for the Joomla Platform. * * @documentation http://developer.github.com/v3/oauth/ * * @since 12.3 */ class JGithubPackageAuthorization extends JGithubPackage { /** * Method to create an authorization. * * @param array $scopes A list of scopes that this authorization is in. * @param string $note A note to remind you what the OAuth token is for. * @param string $url A URL to remind you what app the OAuth token is for. * * @throws DomainException * @since 12.3 * * @return object */ public function create(array $scopes = array(), $note = '', $url = '') { // Build the request path. $path = '/authorizations'; $data = json_encode( array('scopes' => $scopes, 'note' => $note, 'note_url' => $url) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to delete an authorization * * @param integer $id ID of the authorization to delete * * @throws DomainException * @since 12.3 * * @return object */ public function delete($id) { // Build the request path. $path = '/authorizations/' . $id; // Send the request. $response = $this->client->delete($this->fetchUrl($path)); // Validate the response code. if ($response->code != 204) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to edit an authorization. * * @param integer $id ID of the authorization to edit * @param array $scopes Replaces the authorization scopes with these. * @param array $addScopes A list of scopes to add to this authorization. * @param array $removeScopes A list of scopes to remove from this authorization. * @param string $note A note to remind you what the OAuth token is for. * @param string $url A URL to remind you what app the OAuth token is for. * * @throws RuntimeException * @throws DomainException * @since 12.3 * * @return object */ public function edit($id, array $scopes = array(), array $addScopes = array(), array $removeScopes = array(), $note = '', $url = '') { // Check if more than one scopes array contains data $scopesCount = 0; if (!empty($scopes)) { $scope = 'scopes'; $scopeData = $scopes; $scopesCount++; } if (!empty($addScopes)) { $scope = 'add_scopes'; $scopeData = $addScopes; $scopesCount++; } if (!empty($removeScopes)) { $scope = 'remove_scopes'; $scopeData = $removeScopes; $scopesCount++; } // Only allowed to send data for one scope parameter if ($scopesCount >= 2) { throw new RuntimeException('You can only send one scope key in this request.'); } // Build the request path. $path = '/authorizations/' . $id; $data = json_encode( array( $scope => $scopeData, 'note' => $note, 'note_url' => $url ) ); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get details about an authorised application for the authenticated user. * * @param integer $id ID of the authorization to retrieve * * @throws DomainException * @since 12.3 * @note This method will only accept Basic Authentication * * @return object */ public function get($id) { // Build the request path. $path = '/authorizations/' . $id; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get the authorised applications for the authenticated user. * * @throws DomainException * @since 12.3 * @note This method will only accept Basic Authentication * * @return object */ public function getList() { // Build the request path. $path = '/authorizations'; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get the rate limit for the authenticated user. * * @throws DomainException * @since 12.3 * * @return object */ public function getRateLimit() { // Build the request path. $path = '/rate_limit'; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * 1. Request authorization on GitHub. * * @param string $client_id The client ID you received from GitHub when you registered. * @param string $redirect_uri URL in your app where users will be sent after authorization. * @param string $scope Comma separated list of scopes. * @param string $state An unguessable random string. It is used to protect against * cross-site request forgery attacks. * * @since 3.3 (CMS) * * @return JUri */ public function getAuthorizationLink($client_id, $redirect_uri = '', $scope = '', $state = '') { $uri = new JUri('https://github.com/login/oauth/authorize'); $uri->setVar('client_id', $client_id); if ($redirect_uri) { $uri->setVar('redirect_uri', urlencode($redirect_uri)); } if ($scope) { $uri->setVar('scope', $scope); } if ($state) { $uri->setVar('state', $state); } return (string) $uri; } /** * 2. Request the access token. * * @param string $client_id The client ID you received from GitHub when you registered. * @param string $client_secret The client secret you received from GitHub when you registered. * @param string $code The code you received as a response to Step 1. * @param string $redirect_uri URL in your app where users will be sent after authorization. * @param string $format The response format (json, xml, ). * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return string */ public function requestToken($client_id, $client_secret, $code, $redirect_uri = '', $format = '') { $uri = 'https://github.com/login/oauth/access_token'; $data = array( 'client_id' => $client_id, 'client_secret' => $client_secret, 'code' => $code ); if ($redirect_uri) { $data['redirect_uri'] = $redirect_uri; } $headers = array(); switch ($format) { case 'json' : $headers['Accept'] = 'application/json'; break; case 'xml' : $headers['Accept'] = 'application/xml'; break; default : if ($format) { throw new UnexpectedValueException('Invalid format'); } break; } // Send the request. return $this->processResponse( $this->client->post($uri, $data, $headers), 200, false ); } } PK���\}&Y� � 1libraries/joomla/github/package/issues/events.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Issues Events class for the Joomla Platform. * * Records various events that occur around an Issue or Pull Request. * This is useful both for display on issue/pull request information pages and also * to determine who should be notified of comments. * * @documentation http://developer.github.com/v3/issues/events/ * * @since 12.3 */ class JGithubPackageIssuesEvents extends JGithubPackage { /** * List events for an issue. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $issue_number The issue number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @return object */ public function getList($owner, $repo, $issue_number, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/' . (int) $issue_number . '/events'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path, $page, $limit)) ); } /** * List events for a repository. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $issueId The issue number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @return object */ public function getListRepository($owner, $repo, $issueId, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/' . (int) $issueId . '/comments'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path, $page, $limit)) ); } /** * Get a single event. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id The event number. * * @return object */ public function get($owner, $repo, $id) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/events/' . (int) $id; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } } PK���\�Р%4libraries/joomla/github/package/issues/assignees.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Assignees class for the Joomla Platform. * * @documentation http://developer.github.com/v3/issues/assignees/ * * @since 12.3 */ class JGithubPackageIssuesAssignees extends JGithubPackage { /** * List assignees. * * This call lists all the available assignees (owner + collaborators) to which issues may be assigned. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * * @return object */ public function getList($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/assignees'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Check assignee. * * You may check to see if a particular user is an assignee for a repository. * If the given assignee login belongs to an assignee for the repository, a 204 header * with no content is returned. * Otherwise a 404 status code is returned. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $assignee The assinees login name. * * @throws DomainException|Exception * @return boolean */ public function check($owner, $repo, $assignee) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/assignees/' . $assignee; try { $response = $this->client->get($this->fetchUrl($path)); if (204 == $response->code) { return true; } throw new DomainException('Invalid response: ' . $response->code); } catch (DomainException $e) { if (isset($response->code) && 404 == $response->code) { return false; } throw $e; } } } PK���\V�P001libraries/joomla/github/package/issues/labels.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Milestones class for the Joomla Platform. * * @documentation http://developer.github.com/v3/issues/labels/ * * @since 12.3 */ class JGithubPackageIssuesLabels extends JGithubPackage { /** * Method to get the list of labels on a repo. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * * @throws DomainException * @since 12.3 * * @return array */ public function getList($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/labels'; // Send the request. return $this->processResponse( $response = $this->client->get($this->fetchUrl($path)) ); } /** * Method to get a specific label on a repo. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $name The label name to get. * * @throws DomainException * @since 12.3 * * @return object */ public function get($user, $repo, $name) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/labels/' . $name; // Send the request. return $this->processResponse( $response = $this->client->get($this->fetchUrl($path)) ); } /** * Method to create a label on a repo. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $name The label name. * @param string $color The label color. * * @throws DomainException * @since 12.3 * * @return object */ public function create($owner, $repo, $name, $color) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/labels'; // Build the request data. $data = json_encode( array( 'name' => $name, 'color' => $color ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to update a label on a repo. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $label The label name. * @param string $name The new label name. * @param string $color The new label color. * * @throws DomainException * @since 12.3 * * @return object */ public function update($user, $repo, $label, $name, $color) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/labels/' . $label; // Build the request data. $data = json_encode( array( 'name' => $name, 'color' => $color ) ); // Send the request. return $this->processResponse( $this->client->patch($this->fetchUrl($path), $data) ); } /** * Method to delete a label on a repo. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $name The label name. * * @throws DomainException * @return object * * @since 12.3 */ public function delete($owner, $repo, $name) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/labels/' . $name; // Send the request. return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * List labels on an issue. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $number The issue number. * * @since 3.3 (CMS) * * @return object */ public function getListByIssue($owner, $repo, $number) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/' . $number . '/labels'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Add labels to an issue. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $number The issue number. * @param array $labels An array of labels to add. * * @since 3.3 (CMS) * * @return object */ public function add($owner, $repo, $number, array $labels) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/' . $number . '/labels'; // Send the request. return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode($labels)) ); } /** * Remove a label from an issue. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $number The issue number. * @param string $name The name of the label to remove. * * @since 3.3 (CMS) * * @return object */ public function removeFromIssue($owner, $repo, $number, $name) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/' . $number . '/labels/' . $name; // Send the request. return $this->processResponse( $this->client->delete($this->fetchUrl($path)) ); } /** Replace all labels for an issue. * * Sending an empty array ([]) will remove all Labels from the Issue. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $number The issue number. * @param array $labels New labels * * @since 3.3 (CMS) * * @return object */ public function replace($owner, $repo, $number, array $labels) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/' . $number . '/labels'; // Send the request. return $this->processResponse( $this->client->put($this->fetchUrl($path), json_encode($labels)) ); } /** .* Remove all labels from an issue. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $number The issue number. * * @since 3.3 (CMS) * * @return object */ public function removeAllFromIssue($owner, $repo, $number) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/' . $number . '/labels'; // Send the request. return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * Get labels for every issue in a milestone. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $number The issue number. * * @since 3.3 (CMS) * * @return object */ public function getListByMilestone($owner, $repo, $number) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/milestones/' . $number . '/labels'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } } PK���\R�C���3libraries/joomla/github/package/issues/comments.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Comments class for the Joomla Platform. * * The Issue Comments API supports listing, viewing, editing, and creating comments * on issues and pull requests. * * @documentation http://developer.github.com/v3/issues/comments/ * * @since 12.3 */ class JGithubPackageIssuesComments extends JGithubPackage { /** * Method to get the list of comments on an issue. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $issueId The issue number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getList($owner, $repo, $issueId, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/' . (int) $issueId . '/comments'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path, $page, $limit)) ); } /** * Method to get the list of comments in a repository. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $sort The sort field - created or updated. * @param string $direction The sort order- asc or desc. Ignored without sort parameter. * @param JDate $since A timestamp in ISO 8601 format. * * @throws UnexpectedValueException * @throws DomainException * @since 11.3 * * @return array */ public function getRepositoryList($owner, $repo, $sort = 'created', $direction = 'asc', JDate $since = null) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/comments'; if (false == in_array($sort, array('created', 'updated'))) { throw new UnexpectedValueException( sprintf( '%1$s - sort field must be "created" or "updated"', __METHOD__ ) ); } if (false == in_array($direction, array('asc', 'desc'))) { throw new UnexpectedValueException( sprintf( '%1$s - direction field must be "asc" or "desc"', __METHOD__ ) ); } $path .= '?sort=' . $sort; $path .= '&direction=' . $direction; if ($since) { $path .= '&since=' . $since->toISO8601(); } // Send the request. return $this->processResponse($this->client->get($this->fetchUrl($path))); } /** * Method to get a single comment. * * @param string $owner The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id The comment id. * * @return mixed */ public function get($owner, $repo, $id) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/comments/' . (int) $id; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Method to update a comment on an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The id of the comment to update. * @param string $body The new body text for the comment. * * @since 11.3 * @throws DomainException * * @return object */ public function edit($user, $repo, $commentId, $body) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/issues/comments/' . (int) $commentId; // Build the request data. $data = json_encode( array( 'body' => $body ) ); // Send the request. return $this->processResponse( $this->client->patch($this->fetchUrl($path), $data) ); } /** * Method to create a comment on an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $issueId The issue number. * @param string $body The comment body text. * * @throws DomainException * @since 11.3 * * @return object */ public function create($user, $repo, $issueId, $body) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/issues/' . (int) $issueId . '/comments'; // Build the request data. $data = json_encode( array( 'body' => $body, ) ); // Send the request. return $this->processResponse( $this->client->post($this->fetchUrl($path), $data), 201 ); } /** * Method to delete a comment on an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The id of the comment to delete. * * @throws DomainException * @since 11.3 * * @return boolean */ public function delete($user, $repo, $commentId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/issues/comments/' . (int) $commentId; // Send the request. $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); return true; } } PK���\�F��5libraries/joomla/github/package/issues/milestones.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Milestones class for the Joomla Platform. * * @documentation http://developer.github.com/v3/issues/milestones/ * * @since 12.3 */ class JGithubPackageIssuesMilestones extends JGithubPackage { /** * Method to get the list of milestones for a repo. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $state The milestone state to retrieved. Open (default) or closed. * @param string $sort Sort can be due_date (default) or completeness. * @param string $direction Direction is asc or desc (default). * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 12.3 * * @return array */ public function getList($user, $repo, $state = 'open', $sort = 'due_date', $direction = 'desc', $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones?'; $path .= 'state=' . $state; $path .= '&sort=' . $sort; $path .= '&direction=' . $direction; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a specific milestone. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $milestoneId The milestone id to get. * * @throws DomainException * @return object * * @since 12.3 */ public function get($user, $repo, $milestoneId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to create a milestone for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $title The title of the milestone. * @param string $state Can be open (default) or closed. * @param string $description Optional description for milestone. * @param string $due_on Optional ISO 8601 time. * * @throws DomainException * @return object * * @since 12.3 */ public function create($user, $repo, $title, $state = null, $description = null, $due_on = null) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones'; // Build the request data. $data = array( 'title' => $title ); if (!is_null($state)) { $data['state'] = $state; } if (!is_null($description)) { $data['description'] = $description; } if (!is_null($due_on)) { $data['due_on'] = $due_on; } $data = json_encode($data); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to update a milestone. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $milestoneId The id of the comment to update. * @param integer $title Optional title of the milestone. * @param string $state Can be open (default) or closed. * @param string $description Optional description for milestone. * @param string $due_on Optional ISO 8601 time. * * @throws DomainException * @return object * * @since 12.3 */ public function edit($user, $repo, $milestoneId, $title = null, $state = null, $description = null, $due_on = null) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId; // Build the request data. $data = array(); if (!is_null($title)) { $data['title'] = $title; } if (!is_null($state)) { $data['state'] = $state; } if (!is_null($description)) { $data['description'] = $description; } if (!is_null($due_on)) { $data['due_on'] = $due_on; } $data = json_encode($data); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to delete a milestone. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $milestoneId The id of the milestone to delete. * * @throws DomainException * @return void * * @since 12.3 */ public function delete($user, $repo, $milestoneId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId; // Send the request. $response = $this->client->delete($this->fetchUrl($path)); // Validate the response code. if ($response->code != 204) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } } } PK���\��=QQ-libraries/joomla/github/package/gitignore.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Gitignore class for the Joomla Platform. * * The .gitignore Templates API lists and fetches templates from the GitHub .gitignore repository. * * @documentation http://developer.github.com/v3/gitignore/ * @documentation https://github.com/github/gitignore * * @since 12.4 */ class JGithubPackageGitignore extends JGithubPackage { /** * Listing available templates * * List all templates available to pass as an option when creating a repository. * * @since 3.3 (CMS) * * @return object */ public function getList() { // Build the request path. $path = '/gitignore/templates'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get a single template * * @param string $name The name of the template * @param boolean $raw Raw output * * @throws DomainException * @since 3.3 (CMS) * * @return mixed|string */ public function get($name, $raw = false) { // Build the request path. $path = '/gitignore/templates/' . $name; $headers = array(); if ($raw) { $headers['Accept'] = 'application/vnd.github.raw+json'; } $response = $this->client->get($this->fetchUrl($path), $headers); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); $message = (isset($error->message)) ? $error->message : 'Invalid response'; throw new DomainException($message, $response->code); } return ($raw) ? $response->body : json_decode($response->body); } } PK���\/���:�:)libraries/joomla/github/package/pulls.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Pull Requests class for the Joomla Platform. * * @documentation http://developer.github.com/v3/pulls * * @since 11.3 * * @property-read JGithubPackagePullsComments $comments GitHub API object for comments. */ class JGithubPackagePulls extends JGithubPackage { protected $name = 'Pulls'; protected $packages = array( 'comments' ); /** * Method to create a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $title The title of the new pull request. * @param string $base The branch (or git ref) you want your changes pulled into. This * should be an existing branch on the current repository. You cannot * submit a pull request to one repo that requests a merge to a base * of another repo. * @param string $head The branch (or git ref) where your changes are implemented. * @param string $body The body text for the new pull request. * * @throws DomainException * @since 11.3 * * @return object */ public function create($user, $repo, $title, $base, $head, $body = '') { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls'; // Build the request data. $data = json_encode( array( 'title' => $title, 'base' => $base, 'head' => $head, 'body' => $body ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to create a pull request from an existing issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $issueId The issue number for which to attach the new pull request. * @param string $base The branch (or git ref) you want your changes pulled into. This * should be an existing branch on the current repository. You cannot * submit a pull request to one repo that requests a merge to a base * of another repo. * @param string $head The branch (or git ref) where your changes are implemented. * * @throws DomainException * @since 11.3 * * @return object */ public function createFromIssue($user, $repo, $issueId, $base, $head) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls'; // Build the request data. $data = json_encode( array( 'issue' => (int) $issueId, 'base' => $base, 'head' => $head ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to update a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param string $title The optional new title for the pull request. * @param string $body The optional new body text for the pull request. * @param string $state The optional new state for the pull request. [open, closed] * * @throws DomainException * @since 11.3 * * @return object */ public function edit($user, $repo, $pullId, $title = null, $body = null, $state = null) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId; // Craete the data object. $data = new stdClass; // If a title is set add it to the data object. if (isset($title)) { $data->title = $title; } // If a body is set add it to the data object. if (isset($body)) { $data->body = $body; } // If a state is set add it to the data object. if (isset($state)) { $data->state = $state; } // Encode the request data. $data = json_encode($data); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a single pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * * @throws DomainException * @since 11.3 * * @return object */ public function get($user, $repo, $pullId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a list of commits for a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getCommits($user, $repo, $pullId, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId . '/commits'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a list of files for a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getFiles($user, $repo, $pullId, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId . '/files'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list pull requests. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $state The optional state to filter requests by. [open, closed] * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getList($user, $repo, $state = 'open', $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls'; // If a state exists append it as an option. if ($state != 'open') { $path .= '?state=' . $state; } // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to check if a pull request has been merged. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. The pull request number. * * @throws DomainException * @since 11.3 * * @return boolean True if the pull request has been merged. */ public function isMerged($user, $repo, $pullId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId . '/merge'; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code == 204) { return true; } elseif ($response->code == 404) { return false; } else { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } } /** * Method to merge a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param string $message The message that will be used for the merge commit. * * @throws DomainException * @since 11.3 * * @return object */ public function merge($user, $repo, $pullId, $message = '') { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId . '/merge'; // Build the request data. $data = json_encode( array( 'commit_message' => $message ) ); // Send the request. $response = $this->client->put($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /* * Legacy methods */ /** * Method to create a comment on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param string $body The comment body text. * @param string $commitId The SHA1 hash of the commit to comment on. * @param string $filePath The Relative path of the file to comment on. * @param string $position The line index in the diff to comment on. * * @deprecated use pulls->comments->create() * * @return object * * @since 11.3 */ public function createComment($user, $repo, $pullId, $body, $commitId, $filePath, $position) { return $this->comments->create($user, $repo, $pullId, $body, $commitId, $filePath, $position); } /** * Method to create a comment in reply to another comment. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param string $body The comment body text. * @param integer $inReplyTo The id of the comment to reply to. * * @deprecated use pulls->comments->createReply() * * @return object * * @since 11.3 */ public function createCommentReply($user, $repo, $pullId, $body, $inReplyTo) { return $this->comments->createReply($user, $repo, $pullId, $body, $inReplyTo); } /** * Method to delete a comment on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The id of the comment to delete. * * @deprecated use pulls->comments->delete() * * @return void * * @since 11.3 */ public function deleteComment($user, $repo, $commentId) { $this->comments->delete($user, $repo, $commentId); } /** * Method to update a comment on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The id of the comment to update. * @param string $body The new body text for the comment. * * @deprecated use pulls->comments->edit() * * @return object * * @since 11.3 */ public function editComment($user, $repo, $commentId, $body) { return $this->comments->edit($user, $repo, $commentId, $body); } /** * Method to get a specific comment on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The comment id to get. * * @deprecated use pulls->comments->get() * * @return object * * @since 11.3 */ public function getComment($user, $repo, $commentId) { return $this->comments->get($user, $repo, $commentId); } /** * Method to get the list of comments on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @deprecated use pulls->comments->getList() * * @return array * * @since 11.3 */ public function getComments($user, $repo, $pullId, $page = 0, $limit = 0) { return $this->comments->getList($user, $repo, $pullId, $page, $limit); } } PK���\J�h��.libraries/joomla/github/package/users/keys.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API References class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/users/keys * * @since 12.3 */ class JGithubPackageUsersKeys extends JGithubPackage { /** * List public keys for a user. * * Lists the verified public keys for a user. This is accessible by anyone. * * @param string $user The name of the user. * * @since 3.3 (CMS) * * @return object */ public function getListUser($user) { // Build the request path. $path = '/users/' . $user . '/keys'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List your public keys. * * Lists the current user’s keys. * Management of public keys via the API requires that you are authenticated * through basic auth, or OAuth with the ‘user’ scope. * * @since 3.3 (CMS) * * @return object */ public function getList() { // Build the request path. $path = '/users/keys'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get a single public key. * * @param integer $id The id of the key. * * @since 3.3 (CMS) * * @return object */ public function get($id) { // Build the request path. $path = '/users/keys/' . $id; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Create a public key * * @param string $title The title of the key. * @param string $key The key. * * @since 3.3 (CMS) * * @return object */ public function create($title, $key) { // Build the request path. $path = '/users/keys'; $data = array( 'title' => $title, 'key' => $key ); return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode($data)), 201 ); } /** * Update a public key. * * @param integer $id The id of the key. * @param string $title The title of the key. * @param string $key The key. * * @since 3.3 (CMS) * * @return object */ public function edit($id, $title, $key) { // Build the request path. $path = '/users/keys/' . $id; $data = array( 'title' => $title, 'key' => $key ); return $this->processResponse( $this->client->patch($this->fetchUrl($path), json_encode($data)) ); } /** * Delete a public key. * * @param integer $id The id of the key. * * @since 3.3 (CMS) * * @return object */ public function delete($id) { // Build the request path. $path = '/users/keys/' . (int) $id; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\�Q{��0libraries/joomla/github/package/users/emails.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API References class for the Joomla Platform. * * Management of email addresses via the API requires that you are authenticated * through basic auth or OAuth with the user scope. * * @documentation http://developer.github.com/v3/repos/users/emails * * @since 12.3 */ class JGithubPackageUsersEmails extends JGithubPackage { /** * List email addresses for a user. * * Future response: * In the final version of the API, this method will return an array of hashes * with extended information for each email address indicating if the address * has been verified and if it’s the user’s primary email address for GitHub. * * Until API v3 is finalized, use the application/vnd.github.v3 media type * to get this response format. * * @since 3.3 (CMS) * * @return object */ public function getList() { // Build the request path. $path = '/user/emails'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Add email address(es). * * @param string|array $email The email address(es). * * @since 3.3 (CMS) * * @return object */ public function add($email) { // Build the request path. $path = '/user/emails'; return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode($email)), 201 ); } /** * Delete email address(es). * * @param string|array $email The email address(es). * * @since 3.3 (CMS) * * @return object */ public function delete($email) { // Build the request path. $path = '/user/emails'; $this->client->setOption('body', json_encode($email)); return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\Vї��3libraries/joomla/github/package/users/followers.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API References class for the Joomla Platform. * * @documentation http://developer.github.com/v3/repos/users/followers * * @since 12.3 */ class JGithubPackageUsersFollowers extends JGithubPackage { /** * List followers of a user. * * @param string $user The name of the user. If not set the current authenticated user will be used. * * @since 3.3 (CMS) * * @return object */ public function getList($user = '') { // Build the request path. $path = ($user) ? '/users/' . $user . '/followers' : '/user/followers'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List users followed by another user. * * @param string $user The name of the user. If not set the current authenticated user will be used. * * @since 3.3 (CMS) * * @return object */ public function getListFollowedBy($user = '') { // Build the request path. $path = ($user) ? '/users/' . $user . '/following' : '/user/following'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Check if you are following a user. * * @param string $user The name of the user. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return boolean */ public function check($user) { // Build the request path. $path = '/user/following/' . $user; $response = $this->client->get($this->fetchUrl($path)); switch ($response->code) { case '204' : // You are following this user return true; break; case '404' : // You are not following this user return false; break; default : throw new UnexpectedValueException('Unexpected response code: ' . $response->code); break; } } /** * Follow a user. * * Following a user requires the user to be logged in and authenticated with * basic auth or OAuth with the user:follow scope. * * @param string $user The name of the user. * * @since 3.3 (CMS) * * @return object */ public function follow($user) { // Build the request path. $path = '/user/following/' . $user; return $this->processResponse( $this->client->put($this->fetchUrl($path), ''), 204 ); } /** * Unfollow a user. * * Unfollowing a user requires the user to be logged in and authenticated with * basic auth or OAuth with the user:follow scope. * * @param string $user The name of the user. * * @since 3.3 (CMS) * * @return object */ public function unfollow($user) { // Build the request path. $path = '/user/following/' . $user; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\��!442libraries/joomla/github/package/pulls/comments.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Pulls Comments class for the Joomla Platform. * * @documentation http://developer.github.com/v3/pulls/comments/ * * @since 3.3 (CMS) */ class JGithubPackagePullsComments extends JGithubPackage { /** * Method to create a comment on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param string $body The comment body text. * @param string $commitId The SHA1 hash of the commit to comment on. * @param string $filePath The Relative path of the file to comment on. * @param string $position The line index in the diff to comment on. * * @throws DomainException * @since 11.3 * * @return object */ public function create($user, $repo, $pullId, $body, $commitId, $filePath, $position) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId . '/comments'; // Build the request data. $data = json_encode( array( 'body' => $body, 'commit_id' => $commitId, 'path' => $filePath, 'position' => $position ) ); // Send the request. return $this->processResponse( $this->client->post($this->fetchUrl($path), $data), 201 ); } /** * Method to create a comment in reply to another comment. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param string $body The comment body text. * @param integer $inReplyTo The id of the comment to reply to. * * @throws DomainException * @since 11.3 * * @return object */ public function createReply($user, $repo, $pullId, $body, $inReplyTo) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId . '/comments'; // Build the request data. $data = json_encode( array( 'body' => $body, 'in_reply_to' => (int) $inReplyTo ) ); // Send the request. return $this->processResponse( $this->client->post($this->fetchUrl($path), $data), 201 ); } /** * Method to delete a comment on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The id of the comment to delete. * * @throws DomainException * @since 11.3 * * @return void */ public function delete($user, $repo, $commentId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/comments/' . (int) $commentId; // Send the request. $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * Method to update a comment on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The id of the comment to update. * @param string $body The new body text for the comment. * * @throws DomainException * @since 11.3 * * @return object */ public function edit($user, $repo, $commentId, $body) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/comments/' . (int) $commentId; // Build the request data. $data = json_encode( array( 'body' => $body ) ); // Send the request. return $this->processResponse( $this->client->patch($this->fetchUrl($path), $data) ); } /** * Method to get a specific comment on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $commentId The comment id to get. * * @throws DomainException * @since 11.3 * * @return object */ public function get($user, $repo, $commentId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/comments/' . (int) $commentId; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Method to get the list of comments on a pull request. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $pullId The pull request number. * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @throws DomainException * @since 11.3 * * @return array */ public function getList($user, $repo, $pullId, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId . '/comments'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path, $page, $limit)) ); } } PK���\��Y (libraries/joomla/github/package/orgs.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Activity class for the Joomla Platform. * * @since 3.3 (CMS) * * @documentation http://developer.github.com/v3/orgs/ * * @property-read JGithubPackageOrgsMembers $members GitHub API object for members. * @property-read JGithubPackageOrgsTeams $teams GitHub API object for teams. */ class JGithubPackageOrgs extends JGithubPackage { protected $name = 'Orgs'; protected $packages = array( 'members', 'teams' ); /** * List User Organizations. * * If a user name is given, public and private organizations for the authenticated user will be listed. * * @param string $user The user name. * * @since 3.3 (CMS) * * @return object */ public function getList($user = '') { // Build the request path. $path = ($user) ? '/users/' . $user . '/orgs' : '/user/orgs'; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get an Organization. * * @param string $org The organization name. * * @since 3.3 (CMS) * * @return object */ public function get($org) { // Build the request path. $path = '/orgs/' . $org; // Send the request. return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Edit an Organization. * * @param string $org The organization name. * @param string $billingEmail Billing email address. This address is not publicized. * @param string $company The company name. * @param string $email The email address. * @param string $location The location name. * @param string $name The name. * * @since 3.3 (CMS) * * @return object */ public function edit($org, $billingEmail = '', $company = '', $email = '', $location = '', $name = '') { // Build the request path. $path = '/orgs/' . $org; $args = array('billing_email', 'company', 'email', 'location', 'name'); $data = array(); $fArgs = func_get_args(); foreach ($args as $i => $arg) { if (array_key_exists($i + 1, $fArgs) && $fArgs[$i + 1]) { $data[$arg] = $fArgs[$i + 1]; } } // Send the request. return $this->processResponse( $this->client->patch($this->fetchUrl($path), $data) ); } } PK���\}[���3libraries/joomla/github/package/activity/events.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Activity Events class for the Joomla Platform. * * @documentation http://developer.github.com/v3/activity/events/ * * @since 3.3 (CMS) */ class JGithubPackageActivityEvents extends JGithubPackage { /** * List public events. * * @since 12.3 * @return object */ public function getPublic() { // Build the request path. $path = '/events'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List repository events. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 12.3 * * @return object */ public function getRepository($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/events'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List issue events for a repository. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 12.3 * @return object */ public function getIssue($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/events'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List public events for a network of repositories. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 12.3 * @return object */ public function getNetwork($owner, $repo) { // Build the request path. $path = '/networks/' . $owner . '/' . $repo . '/events'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List public events for an organization. * * @param string $org Organisation. * * @since 12.3 * @return object */ public function getOrg($org) { // Build the request path. $path = '/orgs/' . $org . '/events'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List events that a user has received. * * These are events that you’ve received by watching repos and following users. * If you are authenticated as the given user, you will see private events. * Otherwise, you’ll only see public events. * * @param string $user User name. * * @since 12.3 * @return object */ public function getUser($user) { // Build the request path. $path = '/users/' . $user . '/received_events'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List public events that a user has received. * * @param string $user User name. * * @since 12.3 * @return object */ public function getUserPublic($user) { // Build the request path. $path = '/users/' . $user . '/received_events/public'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List events performed by a user. * * If you are authenticated as the given user, you will see your private events. * Otherwise, you’ll only see public events. * * @param string $user User name. * * @since 12.3 * @return object */ public function getByUser($user) { // Build the request path. $path = '/users/' . $user . '/events'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List public events performed by a user. * * @param string $user User name. * * @since 12.3 * @return object */ public function getByUserPublic($user) { // Build the request path. $path = '/users/' . $user . '/events/public'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List events for an organization. * * This is the user’s organization dashboard. * You must be authenticated as the user to view this. * * @param string $user User name. * @param string $org Organisation. * * @since 12.3 * @return object */ public function getUserOrg($user, $org) { // Build the request path. $path = '/users/' . $user . '/events/orgs/' . $org; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } } PK���\���7WW:libraries/joomla/github/package/activity/notifications.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Activity Events class for the Joomla Platform. * * @documentation http://developer.github.com/v3/activity/notifications/ * * @since 3.3 (CMS) */ class JGithubPackageActivityNotifications extends JGithubPackage { /** * List your notifications. * * List all notifications for the current user, grouped by repository. * * @param boolean $all True to show notifications marked as read. * @param boolean $participating True to show only notifications in which the user is directly participating or * mentioned. * @param JDate $since filters out any notifications updated before the given time. The time should be passed in * as UTC in the ISO 8601 format. * * @since 3.3 (CMS) * * @return object */ public function getList($all = true, $participating = true, JDate $since = null) { // Build the request path. $path = '/notifications?'; $path .= ($all) ? '&all=1' : ''; $path .= ($participating) ? '&participating=1' : ''; $path .= ($since) ? '&since=' . $since->toISO8601() : ''; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List your notifications in a repository. * * List all notifications for the current user. * * @param string $owner Repository owner. * @param string $repo Repository name. * @param boolean $all True to show notifications marked as read. * @param boolean $participating True to show only notifications in which the user is directly participating or * mentioned. * @param JDate $since filters out any notifications updated before the given time. The time should be passed in * as UTC in the ISO 8601 format. * * @since 3.3 (CMS) * * @return object */ public function getListRepository($owner, $repo, $all = true, $participating = true, JDate $since = null) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/notifications?'; $path .= ($all) ? '&all=1' : ''; $path .= ($participating) ? '&participating=1' : ''; $path .= ($since) ? '&since=' . $since->toISO8601() : ''; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Mark as read. * * Marking a notification as “read” removes it from the default view on GitHub.com. * * @param boolean $unread Changes the unread status of the threads. * @param boolean $read Inverse of “unread”. * @param JDate $last_read_at Describes the last point that notifications were checked. * Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format. * * @since 3.3 (CMS) * * @return object */ public function markRead($unread = true, $read = true, JDate $last_read_at = null) { // Build the request path. $path = '/notifications'; $data = array( 'unread' => $unread, 'read' => $read ); if ($last_read_at) { $data['last_read_at'] = $last_read_at->toISO8601(); } return $this->processResponse( $this->client->put($this->fetchUrl($path), json_encode($data)), 205 ); } /** * Mark notifications as read in a repository. * * Marking all notifications in a repository as “read” removes them from the default view on GitHub.com. * * @param string $owner Repository owner. * @param string $repo Repository name. * @param boolean $unread Changes the unread status of the threads. * @param boolean $read Inverse of “unread”. * @param JDate $last_read_at Describes the last point that notifications were checked. * Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format. * * @since 3.3 (CMS) * * @return object */ public function markReadRepository($owner, $repo, $unread, $read, JDate $last_read_at = null) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/notifications'; $data = array( 'unread' => $unread, 'read' => $read ); if ($last_read_at) { $data['last_read_at'] = $last_read_at->toISO8601(); } return $this->processResponse( $this->client->put($this->fetchUrl($path), json_encode($data)), 205 ); } /** * View a single thread. * * @param integer $id The thread id. * * @since 3.3 (CMS) * * @return object */ public function viewThread($id) { // Build the request path. $path = '/notifications/threads/' . $id; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Mark a thread as read. * * @param integer $id The thread id. * @param boolean $unread Changes the unread status of the threads. * @param boolean $read Inverse of “unread”. * * @since 3.3 (CMS) * * @return object */ public function markReadThread($id, $unread = true, $read = true) { // Build the request path. $path = '/notifications/threads/' . $id; $data = array( 'unread' => $unread, 'read' => $read ); return $this->processResponse( $this->client->patch($this->fetchUrl($path), json_encode($data)), 205 ); } /** * Get a Thread Subscription. * * This checks to see if the current user is subscribed to a thread. * You can also get a Repository subscription. * * @param integer $id The thread id. * * @since 3.3 (CMS) * * @return object */ public function getThreadSubscription($id) { // Build the request path. $path = '/notifications/threads/' . $id . '/subscription'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Set a Thread Subscription. * * This lets you subscribe to a thread, or ignore it. Subscribing to a thread is unnecessary * if the user is already subscribed to the repository. Ignoring a thread will mute all * future notifications (until you comment or get @mentioned). * * @param integer $id The thread id. * @param boolean $subscribed Determines if notifications should be received from this thread. * @param boolean $ignored Determines if all notifications should be blocked from this thread. * * @since 3.3 (CMS) * * @return object */ public function setThreadSubscription($id, $subscribed, $ignored) { // Build the request path. $path = '/notifications/threads/' . $id . '/subscription'; $data = array( 'subscribed' => $subscribed, 'ignored' => $ignored ); return $this->processResponse( $this->client->put($this->fetchUrl($path), json_encode($data)) ); } /** * Delete a Thread Subscription. * * @param integer $id The thread id. * * @since 3.3 (CMS) * * @return object */ public function deleteThreadSubscription($id) { // Build the request path. $path = '/notifications/threads/' . $id . '/subscription'; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\,o�jVV5libraries/joomla/github/package/activity/watching.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Activity Watching Events class for the Joomla Platform. * * @documentation http://developer.github.com/v3/activity/watching/ * * @since 3.3 (CMS) */ class JGithubPackageActivityWatching extends JGithubPackage { /** * List watchers * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 3.3 (CMS) * * @return mixed */ public function getList($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/subscribers'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List repositories being watched. * * List repositories being watched by a user. * * @param string $user User name. * * @since 3.3 (CMS) * * @return mixed */ public function getRepositories($user = '') { // Build the request path. $path = ($user) ? '/users/' . $user . '/subscriptions' : '/user/subscriptions'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Get a Repository Subscription. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 3.3 (CMS) * * @return mixed */ public function getSubscription($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/subscription'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Set a Repository Subscription. * * @param string $owner Repository owner. * @param string $repo Repository name. * @param boolean $subscribed Determines if notifications should be received from this thread. * @param boolean $ignored Determines if all notifications should be blocked from this thread. * * @since 3.3 (CMS) * * @return object */ public function setSubscription($owner, $repo, $subscribed, $ignored) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/subscription'; $data = array( 'subscribed' => $subscribed, 'ignored' => $ignored ); return $this->processResponse( $this->client->put($this->fetchUrl($path), json_encode($data)) ); } /** * Delete a Repository Subscription. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 3.3 (CMS) * * @return object */ public function deleteSubscription($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/subscription'; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * Check if you are watching a repository (LEGACY). * * Requires for the user to be authenticated. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return object */ public function check($owner, $repo) { // Build the request path. $path = '/user/subscriptions/' . $owner . '/' . $repo; $response = $this->client->get($this->fetchUrl($path)); switch ($response->code) { case '204' : // This repository is watched by you. return true; break; case '404' : // This repository is not watched by you. return false; break; } throw new UnexpectedValueException('Unexpected response code: ' . $response->code); } /** * Watch a repository (LEGACY). * * Requires for the user to be authenticated. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 3.3 (CMS) * * @return object */ public function watch($owner, $repo) { // Build the request path. $path = '/user/subscriptions/' . $owner . '/' . $repo; return $this->processResponse( $this->client->put($this->fetchUrl($path), ''), 204 ); } /** * Stop watching a repository (LEGACY). * * Requires for the user to be authenticated. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 3.3 (CMS) * * @return object */ public function unwatch($owner, $repo) { // Build the request path. $path = '/user/subscriptions/' . $owner . '/' . $repo; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\3Y��5libraries/joomla/github/package/activity/starring.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Activity Events class for the Joomla Platform. * * @documentation http://developer.github.com/v3/activity/starring/ * * @since 3.3 (CMS) */ class JGithubPackageActivityStarring extends JGithubPackage { /** * List Stargazers. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 3.3 (CMS) * * @return mixed */ public function getList($owner, $repo) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/stargazers'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * List repositories being starred. * * List repositories being starred by a user. * * @param string $user User name. * * @since 3.3 (CMS) * * @return object */ public function getRepositories($user = '') { // Build the request path. $path = ($user) ? '/users' . $user . '/starred' : '/user/starred'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Check if you are starring a repository. * * Requires for the user to be authenticated. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @throws UnexpectedValueException * @since 3.3 (CMS) * * @return object */ public function check($owner, $repo) { // Build the request path. $path = '/user/starred/' . $owner . '/' . $repo; $response = $this->client->get($this->fetchUrl($path)); switch ($response->code) { case '204' : // This repository is watched by you. return true; break; case '404' : // This repository is not watched by you. return false; break; } throw new UnexpectedValueException('Unexpected response code: ' . $response->code); } /** * Star a repository. * * Requires for the user to be authenticated. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 3.3 (CMS) * * @return object */ public function star($owner, $repo) { // Build the request path. $path = '/user/starred/' . $owner . '/' . $repo; return $this->processResponse( $this->client->put($this->fetchUrl($path), ''), 204 ); } /** * Unstar a repository. * * Requires for the user to be authenticated. * * @param string $owner Repository owner. * @param string $repo Repository name. * * @since 3.3 (CMS) * * @return object */ public function unstar($owner, $repo) { // Build the request path. $path = '/user/starred/' . $owner . '/' . $repo; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } } PK���\d�k| | !libraries/joomla/github/forks.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Forks class for the Joomla Platform. * * @since 11.3 */ class JGithubForks extends JGithubObject { /** * Method to fork a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $org The organization to fork the repo into. By default it is forked to the current user. * * @deprecated use repositories->forks->create() * * @return object * * @since 11.4 * @throws DomainException */ public function create($user, $repo, $org = '') { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/forks'; if (strlen($org) > 0) { $data = json_encode( array('org' => $org) ); } else { $data = json_encode(array()); } // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 202) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list forks for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @deprecated use repositories->forks->getList() * * @return array * * @since 11.4 * @throws DomainException */ public function getList($user, $repo, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/forks'; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } } PK���\І�H��!libraries/joomla/github/hooks.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Hooks class for the Joomla Platform. * * @since 12.3 */ class JGithubHooks extends JGithubObject { /** * Array containing the allowed hook events * * @var array * @since 12.3 */ protected $events = array( 'push', 'issues', 'issue_comment', 'commit_comment', 'pull_request', 'gollum', 'watch', 'download', 'fork', 'fork_apply', 'member', 'public', 'status' ); /** * Method to create a hook on a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $name The name of the service being called. * @param array $config Array containing the config for the service. * @param array $events The events the hook will be triggered for. * @param boolean $active Flag to determine if the hook is active * * @deprecated use repositories->hooks->create() * * @return object * * @since 12.3 * @throws DomainException * @throws RuntimeException */ public function create($user, $repo, $name, array $config, array $events = array('push'), $active = true) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks'; // Check to ensure all events are in the allowed list foreach ($events as $event) { if (!in_array($event, $this->events)) { throw new RuntimeException('Your events array contains an unauthorized event.'); } } $data = json_encode( array('name' => $name, 'config' => $config, 'events' => $events, 'active' => $active) ); return $this->processResponse( $this->client->post($this->fetchUrl($path), $data), 201 ); } /** * Method to delete a hook * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the hook to delete. * * @deprecated use repositories->hooks->delete() * * @return object * * @since 12.3 * @throws DomainException */ public function delete($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id; return $this->processResponse( $this->client->delete($this->fetchUrl($path)), 204 ); } /** * Method to edit a hook. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the hook to edit. * @param string $name The name of the service being called. * @param array $config Array containing the config for the service. * @param array $events The events the hook will be triggered for. This resets the currently set list * @param array $addEvents Events to add to the hook. * @param array $removeEvents Events to remove from the hook. * @param boolean $active Flag to determine if the hook is active * * @deprecated use repositories->hooks->edit() * * @return object * * @since 12.3 * @throws DomainException * @throws RuntimeException */ public function edit($user, $repo, $id, $name, array $config, array $events = array('push'), array $addEvents = array(), array $removeEvents = array(), $active = true) { // Check to ensure all events are in the allowed list foreach ($events as $event) { if (!in_array($event, $this->events)) { throw new RuntimeException('Your events array contains an unauthorized event.'); } } foreach ($addEvents as $event) { if (!in_array($event, $this->events)) { throw new RuntimeException('Your active_events array contains an unauthorized event.'); } } foreach ($removeEvents as $event) { if (!in_array($event, $this->events)) { throw new RuntimeException('Your remove_events array contains an unauthorized event.'); } } // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id; $data = json_encode( array( 'name' => $name, 'config' => $config, 'events' => $events, 'add_events' => $addEvents, 'remove_events' => $removeEvents, 'active' => $active) ); return $this->processResponse( $this->client->patch($this->fetchUrl($path), $data) ); } /** * Method to get details about a single hook for the repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the hook to retrieve * * @deprecated use repositories->hooks->get() * * @return object * * @since 12.3 * @throws DomainException */ public function get($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Method to list hooks for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @deprecated use repositories->hooks->getList() * * @return object * * @since 12.3 * @throws DomainException */ public function getList($user, $repo, $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks'; return $this->processResponse( $this->client->get($this->fetchUrl($path)) ); } /** * Method to test a hook against the latest repository commit * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $id ID of the hook to delete * * @deprecated use repositories->hooks->test() * * @return object * * @since 12.3 * @throws DomainException */ public function test($user, $repo, $id) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id . '/test'; return $this->processResponse( $this->client->post($this->fetchUrl($path), json_encode('')), 204 ); } } PK���\srΞ�� libraries/joomla/github/refs.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API References class for the Joomla Platform. * * @since 11.3 */ class JGithubRefs extends JGithubObject { /** * Method to create an issue. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $ref The name of the fully qualified reference. * @param string $sha The SHA1 value to set this reference to. * * @deprecated use data->refs->create() * * @return object * * @since 11.3 */ public function create($user, $repo, $ref, $sha) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/git/refs'; // Build the request data. $data = json_encode( array( 'ref' => $ref, 'sha' => $sha ) ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to update a reference. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $ref The reference to update. * @param string $sha The SHA1 value to set the reference to. * @param string $force Whether the update should be forced. Default to false. * * @deprecated use data->refs->edit() * * @return object * * @since 11.3 */ public function edit($user, $repo, $ref, $sha, $force = false) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref; // Craete the data object. $data = new stdClass; // If a title is set add it to the data object. if ($force) { $data->force = true; } $data->sha = $sha; // Encode the request data. $data = json_encode($data); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a reference. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $ref The reference to get. * * @deprecated use data->refs->get() * * @return object * * @since 11.3 */ public function get($user, $repo, $ref) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/git/refs/' . $ref; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to list references for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $namespace Optional sub-namespace to limit the returned references. * @param integer $page Page to request * @param integer $limit Number of results to return per page * * @deprecated use data->refs->getList() * * @return array * * @since 11.3 */ public function getList($user, $repo, $namespace = '', $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/git/refs' . $namespace; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } } PK���\�i�7��&libraries/joomla/github/milestones.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage GitHub * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * GitHub API Milestones class for the Joomla Platform. * * @since 12.3 */ class JGithubMilestones extends JGithubObject { /** * Method to get the list of milestones for a repo. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param string $state The milestone state to retrieved. Open (default) or closed. * @param string $sort Sort can be due_date (default) or completeness. * @param string $direction Direction is asc or desc (default). * @param integer $page The page number from which to get items. * @param integer $limit The number of items on a page. * * @deprecated use issues->milestones->getList() * * @return array * * @since 12.3 */ public function getList($user, $repo, $state = 'open', $sort = 'due_date', $direction = 'desc', $page = 0, $limit = 0) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones?'; $path .= 'state=' . $state; $path .= '&sort=' . $sort; $path .= '&direction=' . $direction; // Send the request. $response = $this->client->get($this->fetchUrl($path, $page, $limit)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to get a specific milestone. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $milestoneId The milestone id to get. * * @deprecated use issues->milestones->get() * * @return object * * @since 12.3 */ public function get($user, $repo, $milestoneId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId; // Send the request. $response = $this->client->get($this->fetchUrl($path)); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to create a milestone for a repository. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $title The title of the milestone. * @param string $state Can be open (default) or closed. * @param string $description Optional description for milestone. * @param string $due_on Optional ISO 8601 time. * * @deprecated use issues->milestones->create() * * @return object * * @since 12.3 */ public function create($user, $repo, $title, $state = null, $description = null, $due_on = null) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones'; // Build the request data. $data = array( 'title' => $title ); if (!is_null($state)) { $data['state'] = $state; } if (!is_null($description)) { $data['description'] = $description; } if (!is_null($due_on)) { $data['due_on'] = $due_on; } $data = json_encode($data); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 201) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to update a milestone. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $milestoneId The id of the comment to update. * @param integer $title Optional title of the milestone. * @param string $state Can be open (default) or closed. * @param string $description Optional description for milestone. * @param string $due_on Optional ISO 8601 time. * * @deprecated use issues->milestones->edit() * * @return object * * @since 12.3 */ public function edit($user, $repo, $milestoneId, $title = null, $state = null, $description = null, $due_on = null) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId; // Build the request data. $data = array(); if (!is_null($title)) { $data['title'] = $title; } if (!is_null($state)) { $data['state'] = $state; } if (!is_null($description)) { $data['description'] = $description; } if (!is_null($due_on)) { $data['due_on'] = $due_on; } $data = json_encode($data); // Send the request. $response = $this->client->patch($this->fetchUrl($path), $data); // Validate the response code. if ($response->code != 200) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } return json_decode($response->body); } /** * Method to delete a milestone. * * @param string $user The name of the owner of the GitHub repository. * @param string $repo The name of the GitHub repository. * @param integer $milestoneId The id of the milestone to delete. * * @deprecated use issues->milestones->delete() * * @return void * * @since 12.3 */ public function delete($user, $repo, $milestoneId) { // Build the request path. $path = '/repos/' . $user . '/' . $repo . '/milestones/' . (int) $milestoneId; // Send the request. $response = $this->client->delete($this->fetchUrl($path)); // Validate the response code. if ($response->code != 204) { // Decode the error response and throw an exception. $error = json_decode($response->body); throw new DomainException($error->message, $response->code); } } } PK���\�h�zz libraries/joomla/feed/parser.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Feed Parser class. * * @since 12.3 */ abstract class JFeedParser { /** * The feed element name for the entry elements. * * @var string * @since 12.3 */ protected $entryElementName = 'entry'; /** * Array of JFeedParserNamespace objects * * @var array * @since 12.3 */ protected $namespaces = array(); /** * The XMLReader stream object for the feed. * * @var XMLReader * @since 12.3 */ protected $stream; /** * Constructor. * * @param XMLReader $stream The XMLReader stream object for the feed. * * @since 12.3 */ public function __construct(XMLReader $stream) { $this->stream = $stream; } /** * Method to parse the feed into a JFeed object. * * @return JFeed * * @since 12.3 */ public function parse() { $feed = new JFeed; // Detect the feed version. $this->initialise(); // Let's get this party started... do { // Expand the element for processing. $el = new SimpleXMLElement($this->stream->readOuterXml()); // Get the list of namespaces used within this element. $ns = $el->getNamespaces(true); // Get an array of available namespace objects for the element. $namespaces = array(); foreach ($ns as $prefix => $uri) { // Ignore the empty namespace prefix. if (empty($prefix)) { continue; } // Get the necessary namespace objects for the element. $namespace = $this->fetchNamespace($prefix); if ($namespace) { $namespaces[] = $namespace; } } // Process the element. $this->processElement($feed, $el, $namespaces); // Skip over this element's children since it has been processed. $this->moveToClosingElement(); } while ($this->moveToNextElement()); return $feed; } /** * Method to register a namespace handler object. * * @param string $prefix The XML namespace prefix for which to register the namespace object. * @param JFeedParserNamespace $namespace The namespace object to register. * * @return JFeed * * @since 12.3 */ public function registerNamespace($prefix, JFeedParserNamespace $namespace) { $this->namespaces[$prefix] = $namespace; return $this; } /** * Method to initialise the feed for parsing. If child parsers need to detect versions or other * such things this is where you'll want to implement that logic. * * @return void * * @since 12.3 */ abstract protected function initialise(); /** * Method to parse a specific feed element. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * @param array $namespaces The array of relevant namespace objects to process for the element. * * @return void * * @since 12.3 */ protected function processElement(JFeed $feed, SimpleXMLElement $el, array $namespaces) { // Build the internal method name. $method = 'handle' . ucfirst($el->getName()); // If we are dealing with an item then it is feed entry time. if ($el->getName() == $this->entryElementName) { // Create a new feed entry for the item. $entry = new JFeedEntry; // First call the internal method. $this->processFeedEntry($entry, $el); foreach ($namespaces as $namespace) { if ($namespace instanceof JFeedParserNamespace) { $namespace->processElementForFeedEntry($entry, $el); } } // Add the new entry to the feed. $feed->addEntry($entry); } // Otherwise we treat it like any other element. else { // First call the internal method. if (is_callable(array($this, $method))) { $this->$method($feed, $el); } foreach ($namespaces as $namespace) { if ($namespace instanceof JFeedParserNamespace) { $namespace->processElementForFeed($feed, $el); } } } } /** * Method to get a namespace object for a given namespace prefix. * * @param string $prefix The XML prefix for which to fetch the namespace object. * * @return mixed JFeedParserNamespace or false if none exists. * * @since 12.3 */ protected function fetchNamespace($prefix) { if (isset($this->namespaces[$prefix])) { return $this->namespaces[$prefix]; } $className = get_class($this) . ucfirst($prefix); if (class_exists($className)) { $this->namespaces[$prefix] = new $className; return $this->namespaces[$prefix]; } return false; } /** * Method to move the stream parser to the next XML element node. * * @param string $name The name of the element for which to move the stream forward until is found. * * @return boolean True if the stream parser is on an XML element node. * * @since 12.3 */ protected function moveToNextElement($name = null) { // Only keep looking until the end of the stream. while ($this->stream->read()) { // As soon as we get to the next ELEMENT node we are done. if ($this->stream->nodeType == XMLReader::ELEMENT) { // If we are looking for a specific name make sure we have it. if (isset($name) && ($this->stream->name != $name)) { continue; } return true; } } return false; } /** * Method to move the stream parser to the closing XML node of the current element. * * @return void * * @since 12.3 * @throws RuntimeException If the closing tag cannot be found. */ protected function moveToClosingElement() { // If we are on a self-closing tag then there is nothing to do. if ($this->stream->isEmptyElement) { return; } // Get the name and depth for the current node so that we can match the closing node. $name = $this->stream->name; $depth = $this->stream->depth; // Only keep looking until the end of the stream. while ($this->stream->read()) { // If we have an END_ELEMENT node with the same name and depth as the node we started with we have a bingo. :-) if (($this->stream->name == $name) && ($this->stream->depth == $depth) && ($this->stream->nodeType == XMLReader::END_ELEMENT)) { return; } } throw new RuntimeException('Unable to find the closing XML node.'); } } PK���\�啎libraries/joomla/feed/entry.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Class to encapsulate a feed entry for the Joomla Platform. * * @property JFeedPerson $author Person responsible for feed entry content. * @property array $categories Categories to which the feed entry belongs. * @property string $content The content of the feed entry. * @property array $contributors People who contributed to the feed entry content. * @property string $copyright Information about rights, e.g. copyrights, held in and over the feed entry. * @property array $links Links associated with the feed entry. * @property JDate $publishedDate The publication date for the feed entry. * @property JFeed $source The feed from which the entry is sourced. * @property string $title A human readable title for the feed entry. * @property JDate $updatedDate The last time the content of the feed entry changed. * @property string $uri Universal, permanent identifier for the feed entry. * * @since 12.3 */ class JFeedEntry { /** * @var array The entry properties. * @since 12.3 */ protected $properties = array( 'uri' => '', 'title' => '', 'updatedDate' => '', 'content' => '', 'categories' => array(), 'contributors' => array(), 'links' => array() ); /** * Magic method to return values for feed entry properties. * * @param string $name The name of the property. * * @return mixed * * @since 12.3 */ public function __get($name) { return (isset($this->properties[$name])) ? $this->properties[$name] : null; } /** * Magic method to set values for feed properties. * * @param string $name The name of the property. * @param mixed $value The value to set for the property. * * @return void * * @since 12.3 */ public function __set($name, $value) { // Ensure that setting a date always sets a JDate instance. if ((($name == 'updatedDate') || ($name == 'publishedDate')) && !($value instanceof JDate)) { $value = new JDate($value); } // Validate that any authors that are set are instances of JFeedPerson or null. if (($name == 'author') && (!($value instanceof JFeedPerson) || ($value === null))) { throw new InvalidArgumentException('JFeedEntry "author" must be of type JFeedPerson. ' . gettype($value) . 'given.'); } // Validate that any sources that are set are instances of JFeed or null. if (($name == 'source') && (!($value instanceof JFeed) || ($value === null))) { throw new InvalidArgumentException('JFeedEntry "source" must be of type JFeed. ' . gettype($value) . 'given.'); } // Disallow setting categories, contributors, or links directly. if (($name == 'categories') || ($name == 'contributors') || ($name == 'links')) { throw new InvalidArgumentException('Cannot directly set JFeedEntry property "' . $name . '".'); } $this->properties[$name] = $value; } /** * Method to add a category to the feed entry object. * * @param string $name The name of the category to add. * @param string $uri The optional URI for the category to add. * * @return JFeedEntry * * @since 12.3 */ public function addCategory($name, $uri = '') { $this->properties['categories'][$name] = $uri; return $this; } /** * Method to add a contributor to the feed entry object. * * @param string $name The full name of the person to add. * @param string $email The email address of the person to add. * @param string $uri The optional URI for the person to add. * @param string $type The optional type of person to add. * * @return JFeedEntry * * @since 12.3 */ public function addContributor($name, $email, $uri = null, $type = null) { $contributor = new JFeedPerson($name, $email, $uri, $type); // If the new contributor already exists then there is nothing to do, so just return. foreach ($this->properties['contributors'] as $c) { if ($c == $contributor) { return $this; } } // Add the new contributor. $this->properties['contributors'][] = $contributor; return $this; } /** * Method to add a link to the feed entry object. * * @param JFeedLink $link The link object to add. * * @return JFeedEntry * * @since 12.3 */ public function addLink(JFeedLink $link) { // If the new link already exists then there is nothing to do, so just return. foreach ($this->properties['links'] as $l) { if ($l == $link) { return $this; } } // Add the new link. $this->properties['links'][] = $link; return $this; } /** * Method to remove a category from the feed entry object. * * @param string $name The name of the category to remove. * * @return JFeedEntry * * @since 12.3 */ public function removeCategory($name) { unset($this->properties['categories'][$name]); return $this; } /** * Method to remove a contributor from the feed entry object. * * @param JFeedPerson $contributor The person object to remove. * * @return JFeedEntry * * @since 12.3 */ public function removeContributor(JFeedPerson $contributor) { // If the contributor exists remove it. foreach ($this->properties['contributors'] as $k => $c) { if ($c == $contributor) { unset($this->properties['contributors'][$k]); $this->properties['contributors'] = array_values($this->properties['contributors']); return $this; } } return $this; } /** * Method to remove a link from the feed entry object. * * @param JFeedLink $link The link object to remove. * * @return JFeedEntry * * @since 12.3 */ public function removeLink(JFeedLink $link) { // If the link exists remove it. foreach ($this->properties['links'] as $k => $l) { if ($l == $link) { unset($this->properties['links'][$k]); $this->properties['links'] = array_values($this->properties['links']); return $this; } } return $this; } /** * Shortcut method to set the author for the feed entry object. * * @param string $name The full name of the person to set. * @param string $email The email address of the person to set. * @param string $uri The optional URI for the person to set. * @param string $type The optional type of person to set. * * @return JFeedEntry * * @since 12.3 */ public function setAuthor($name, $email, $uri = null, $type = null) { $author = new JFeedPerson($name, $email, $uri, $type); $this->properties['author'] = $author; return $this; } } PK���\]��6��libraries/joomla/feed/feed.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Class to encapsulate a feed for the Joomla Platform. * * @property JFeedPerson $author Person responsible for feed content. * @property array $categories Categories to which the feed belongs. * @property array $contributors People who contributed to the feed content. * @property string $copyright Information about rights, e.g. copyrights, held in and over the feed. * @property string $description A phrase or sentence describing the feed. * @property string $generator A string indicating the program used to generate the feed. * @property string $image Specifies a GIF, JPEG or PNG image that should be displayed with the feed. * @property JDate $publishedDate The publication date for the feed content. * @property string $title A human readable title for the feed. * @property JDate $updatedDate The last time the content of the feed changed. * @property string $uri Universal, permanent identifier for the feed. * * @since 12.3 */ class JFeed implements ArrayAccess { /** * @var array The entry properties. * @since 12.3 */ protected $properties = array( 'uri' => '', 'title' => '', 'updatedDate' => '', 'description' => '', 'categories' => array(), 'contributors' => array() ); /** * @var array The list of feed entry objects. * @since 12.3 */ protected $entries = array(); /** * Magic method to return values for feed properties. * * @param string $name The name of the property. * * @return mixed * * @since 12.3 */ public function __get($name) { return isset($this->properties[$name]) ? $this->properties[$name] : null; } /** * Magic method to set values for feed properties. * * @param string $name The name of the property. * @param mixed $value The value to set for the property. * * @return void * * @since 12.3 */ public function __set($name, $value) { // Ensure that setting a date always sets a JDate instance. if ((($name == 'updatedDate') || ($name == 'publishedDate')) && !($value instanceof JDate)) { $value = new JDate($value); } // Validate that any authors that are set are instances of JFeedPerson or null. if (($name == 'author') && (!($value instanceof JFeedPerson) || ($value === null))) { throw new InvalidArgumentException('JFeed "author" must be of type JFeedPerson. ' . gettype($value) . 'given.'); } // Disallow setting categories or contributors directly. if (($name == 'categories') || ($name == 'contributors')) { throw new InvalidArgumentException('Cannot directly set JFeed property "' . $name . '".'); } $this->properties[$name] = $value; } /** * Method to add a category to the feed object. * * @param string $name The name of the category to add. * @param string $uri The optional URI for the category to add. * * @return JFeed * * @since 12.3 */ public function addCategory($name, $uri = '') { $this->properties['categories'][$name] = $uri; return $this; } /** * Method to add a contributor to the feed object. * * @param string $name The full name of the person to add. * @param string $email The email address of the person to add. * @param string $uri The optional URI for the person to add. * @param string $type The optional type of person to add. * * @return JFeed * * @since 12.3 */ public function addContributor($name, $email, $uri = null, $type = null) { $contributor = new JFeedPerson($name, $email, $uri, $type); // If the new contributor already exists then there is nothing to do, so just return. foreach ($this->properties['contributors'] as $c) { if ($c == $contributor) { return $this; } } // Add the new contributor. $this->properties['contributors'][] = $contributor; return $this; } /** * Method to add an entry to the feed object. * * @param JFeedEntry $entry The entry object to add. * * @return JFeed * * @since 12.3 */ public function addEntry(JFeedEntry $entry) { // If the new entry already exists then there is nothing to do, so just return. foreach ($this->entries as $e) { if ($e == $entry) { return $this; } } // Add the new entry. $this->entries[] = $entry; return $this; } /** * Whether or not an offset exists. This method is executed when using isset() or empty() on * objects implementing ArrayAccess. * * @param mixed $offset An offset to check for. * * @return boolean * * @see ArrayAccess::offsetExists() * @since 12.3 */ public function offsetExists($offset) { return isset($this->entries[$offset]); } /** * Returns the value at specified offset. * * @param mixed $offset The offset to retrieve. * * @return mixed The value at the offset. * * @see ArrayAccess::offsetGet() * @since 12.3 */ public function offsetGet($offset) { return $this->entries[$offset]; } /** * Assigns a value to the specified offset. * * @param mixed $offset The offset to assign the value to. * @param JFeedEntry $value The JFeedEntry to set. * * @return boolean * * @see ArrayAccess::offsetSet() * @since 12.3 * @throws InvalidArgumentException */ public function offsetSet($offset, $value) { if (!($value instanceof JFeedEntry)) { throw new InvalidArgumentException('Cannot set value of type "' . gettype($value) . '".'); } $this->entries[$offset] = $value; return true; } /** * Unsets an offset. * * @param mixed $offset The offset to unset. * * @return void * * @see ArrayAccess::offsetUnset() * @since 12.3 */ public function offsetUnset($offset) { unset($this->entries[$offset]); } /** * Method to remove a category from the feed object. * * @param string $name The name of the category to remove. * * @return JFeed * * @since 12.3 */ public function removeCategory($name) { unset($this->properties['categories'][$name]); return $this; } /** * Method to remove a contributor from the feed object. * * @param JFeedPerson $contributor The person object to remove. * * @return JFeed * * @since 12.3 */ public function removeContributor(JFeedPerson $contributor) { // If the contributor exists remove it. foreach ($this->properties['contributors'] as $k => $c) { if ($c == $contributor) { unset($this->properties['contributors'][$k]); $this->properties['contributors'] = array_values($this->properties['contributors']); return $this; } } return $this; } /** * Method to remove an entry from the feed object. * * @param JFeedEntry $entry The entry object to remove. * * @return JFeed * * @since 12.3 */ public function removeEntry(JFeedEntry $entry) { // If the entry exists remove it. foreach ($this->entries as $k => $e) { if ($e == $entry) { unset($this->entries[$k]); $this->entries = array_values($this->entries); return $this; } } return $this; } /** * Shortcut method to set the author for the feed object. * * @param string $name The full name of the person to set. * @param string $email The email address of the person to set. * @param string $uri The optional URI for the person to set. * @param string $type The optional type of person to set. * * @return JFeed * * @since 12.3 */ public function setAuthor($name, $email, $uri = null, $type = null) { $author = new JFeedPerson($name, $email, $uri, $type); $this->properties['author'] = $author; return $this; } } PK���\�O��*�*$libraries/joomla/feed/parser/rss.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * RSS Feed Parser class. * * @link http://cyber.law.harvard.edu/rss/rss.html * @since 12.3 */ class JFeedParserRss extends JFeedParser { /** * @var string The feed element name for the entry elements. * @since 12.3 */ protected $entryElementName = 'item'; /** * @var string The feed format version. * @since 12.3 */ protected $version; /** * Method to handle the <category> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleCategory(JFeed $feed, SimpleXMLElement $el) { // Get the data from the element. $domain = (string) $el['domain']; $category = (string) $el; $feed->addCategory($category, $domain); } /** * Method to handle the <cloud> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleCloud(JFeed $feed, SimpleXMLElement $el) { $cloud = new stdClass; $cloud->domain = (string) $el['domain']; $cloud->port = (string) $el['port']; $cloud->path = (string) $el['path']; $cloud->protocol = (string) $el['protocol']; $cloud->registerProcedure = (string) $el['registerProcedure']; $feed->cloud = $cloud; } /** * Method to handle the <copyright> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleCopyright(JFeed $feed, SimpleXMLElement $el) { $feed->copyright = (string) $el; } /** * Method to handle the <description> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleDescription(JFeed $feed, SimpleXMLElement $el) { $feed->description = (string) $el; } /** * Method to handle the <generator> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleGenerator(JFeed $feed, SimpleXMLElement $el) { $feed->generator = (string) $el; } /** * Method to handle the <image> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleImage(JFeed $feed, SimpleXMLElement $el) { // Create a feed link object for the image. $image = new JFeedLink( (string) $el->url, null, 'logo', null, (string) $el->title ); // Populate extra fields if they exist. $image->link = (string) $el->link; $image->description = (string) $el->description; $image->height = (string) $el->height; $image->width = (string) $el->width; $feed->image = $image; } /** * Method to handle the <language> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleLanguage(JFeed $feed, SimpleXMLElement $el) { $feed->language = (string) $el; } /** * Method to handle the <lastBuildDate> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleLastBuildDate(JFeed $feed, SimpleXMLElement $el) { $feed->updatedDate = (string) $el; } /** * Method to handle the <link> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleLink(JFeed $feed, SimpleXMLElement $el) { $link = new JFeedLink; $link->uri = (string) $el['href']; $feed->link = $link; } /** * Method to handle the <managingEditor> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleManagingEditor(JFeed $feed, SimpleXMLElement $el) { $feed->author = $this->processPerson((string) $el); } /** * Method to handle the <skipDays> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleSkipDays(JFeed $feed, SimpleXMLElement $el) { // Initialise the array. $days = array(); // Add all of the day values from the feed to the array. foreach ($el->day as $day) { $days[] = (string) $day; } $feed->skipDays = $days; } /** * Method to handle the <skipHours> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleSkipHours(JFeed $feed, SimpleXMLElement $el) { // Initialise the array. $hours = array(); // Add all of the day values from the feed to the array. foreach ($el->hour as $hour) { $hours[] = (int) $hour; } $feed->skipHours = $hours; } /** * Method to handle the <pubDate> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handlePubDate(JFeed $feed, SimpleXMLElement $el) { $feed->publishedDate = (string) $el; } /** * Method to handle the <title> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleTitle(JFeed $feed, SimpleXMLElement $el) { $feed->title = (string) $el; } /** * Method to handle the <ttl> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleTtl(JFeed $feed, SimpleXMLElement $el) { $feed->ttl = (integer) $el; } /** * Method to handle the <webmaster> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleWebmaster(JFeed $feed, SimpleXMLElement $el) { // Get the tag contents and split it over the first space. $tmp = (string) $el; $tmp = explode(' ', $tmp, 2); // This is really cheap parsing. Probably need to create a method to do this more robustly. $name = null; if (isset($tmp[1])) { $name = trim($tmp[1], ' ()'); } $email = trim($tmp[0]); $feed->addContributor($name, $email, null, 'webmaster'); } /** * Method to initialise the feed for parsing. Here we detect the version and advance the stream * reader so that it is ready to parse feed elements. * * @return void * * @since 12.3 */ protected function initialise() { // Read the version attribute. $this->version = $this->stream->getAttribute('version'); // We want to move forward to the first element after the <channel> element. $this->moveToNextElement('channel'); $this->moveToNextElement(); } /** * Method to handle the feed entry element for the feed: <item>. * * @param JFeedEntry $entry The JFeedEntry object being built from the parsed feed entry. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function processFeedEntry(JFeedEntry $entry, SimpleXMLElement $el) { $entry->uri = (string) $el->link; $entry->title = (string) $el->title; $entry->publishedDate = (string) $el->pubDate; $entry->updatedDate = (string) $el->pubDate; $entry->content = (string) $el->description; $entry->guid = (string) $el->guid; $entry->comments = (string) $el->comments; // Add the feed entry author if available. $author = (string) $el->author; if (!empty($author)) { $entry->author = $this->processPerson($author); } // Add any categories to the entry. foreach ($el->category as $category) { $entry->addCategory((string) $category, (string) $category['domain']); } // Add any enclosures to the entry. foreach ($el->enclosure as $enclosure) { $link = new JFeedLink( (string) $enclosure['url'], null, (string) $enclosure['type'], null, null, (int) $enclosure['length'] ); $entry->addLink($link); } } /** * Method to parse a string with person data and return a JFeedPerson object. * * @param string $data The string to parse for a person. * * @return JFeedPerson * * @since 12.3 */ protected function processPerson($data) { // Create a new person object. $person = new JFeedPerson; // This is really cheap parsing, but so far good enough. :) $data = explode(' ', $data, 2); if (isset($data[1])) { $person->name = trim($data[1], ' ()'); } // Set the email for the person. $person->email = trim($data[0]); return $person; } } PK���\*e]�*libraries/joomla/feed/parser/rss/media.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * RSS Feed Parser Namespace handler for MediaRSS. * * @see http://video.search.yahoo.com/mrss * @since 12.3 */ class JFeedParserRssMedia implements JFeedParserNamespace { /** * Method to handle an element for the feed given that the media namespace is present. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ public function processElementForFeed(JFeed $feed, SimpleXMLElement $el) { return; } /** * Method to handle the feed entry element for the feed given that the media namespace is present. * * @param JFeedEntry $entry The JFeedEntry object being built from the parsed feed entry. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ public function processElementForFeedEntry(JFeedEntry $entry, SimpleXMLElement $el) { return; } } PK���\�2��%%+libraries/joomla/feed/parser/rss/itunes.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * RSS Feed Parser Namespace handler for iTunes. * * @see http://www.apple.com/itunes/podcasts/specs.html * @since 12.3 */ class JFeedParserRssItunes implements JFeedParserNamespace { /** * Method to handle an element for the feed given that the itunes namespace is present. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ public function processElementForFeed(JFeed $feed, SimpleXMLElement $el) { return; } /** * Method to handle the feed entry element for the feed given that the itunes namespace is present. * * @param JFeedEntry $entry The JFeedEntry object being built from the parsed feed entry. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ public function processElementForFeedEntry(JFeedEntry $entry, SimpleXMLElement $el) { return; } } PK���\Z��8��%libraries/joomla/feed/parser/atom.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * ATOM Feed Parser class. * * @link http://www.atomenabled.org/developers/syndication/ * @since 12.3 */ class JFeedParserAtom extends JFeedParser { /** * @var string The feed format version. * @since 12.3 */ protected $version; /** * Method to handle the <author> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleAuthor(JFeed $feed, SimpleXMLElement $el) { // Set the author information from the XML element. $feed->setAuthor((string) $el->name, (string) $el->email, (string) $el->uri); } /** * Method to handle the <contributor> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleContributor(JFeed $feed, SimpleXMLElement $el) { $feed->addContributor((string) $el->name, (string) $el->email, (string) $el->uri); } /** * Method to handle the <generator> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleGenerator(JFeed $feed, SimpleXMLElement $el) { $feed->generator = (string) $el; } /** * Method to handle the <id> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleId(JFeed $feed, SimpleXMLElement $el) { $feed->uri = (string) $el; } /** * Method to handle the <link> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleLink(JFeed $feed, SimpleXMLElement $el) { $link = new JFeedLink; $link->uri = (string) $el['href']; $link->language = (string) $el['hreflang']; $link->length = (int) $el['length']; $link->relation = (string) $el['rel']; $link->title = (string) $el['title']; $link->type = (string) $el['type']; $feed->link = $link; } /** * Method to handle the <rights> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleRights(JFeed $feed, SimpleXMLElement $el) { $feed->copyright = (string) $el; } /** * Method to handle the <subtitle> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleSubtitle(JFeed $feed, SimpleXMLElement $el) { $feed->description = (string) $el; } /** * Method to handle the <title> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleTitle(JFeed $feed, SimpleXMLElement $el) { $feed->title = (string) $el; } /** * Method to handle the <updated> element for the feed. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function handleUpdated(JFeed $feed, SimpleXMLElement $el) { $feed->updatedDate = (string) $el; } /** * Method to initialise the feed for parsing. Here we detect the version and advance the stream * reader so that it is ready to parse feed elements. * * @return void * * @since 12.3 */ protected function initialise() { // Read the version attribute. $this->version = ($this->stream->getAttribute('version') == '0.3') ? '0.3' : '1.0'; // We want to move forward to the first element after the root element. $this->moveToNextElement(); } /** * Method to handle the feed entry element for the feed: <entry>. * * @param JFeedEntry $entry The JFeedEntry object being built from the parsed feed entry. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ protected function processFeedEntry(JFeedEntry $entry, SimpleXMLElement $el) { $entry->uri = (string) $el->id; $entry->title = (string) $el->title; $entry->updatedDate = (string) $el->updated; $entry->content = (string) $el->summary; } } PK���\ ���*libraries/joomla/feed/parser/namespace.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Feed Namespace interface. * * @since 12.3 */ interface JFeedParserNamespace { /** * Method to handle an element for the feed given that a certain namespace is present. * * @param JFeed $feed The JFeed object being built from the parsed feed. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ public function processElementForFeed(JFeed $feed, SimpleXMLElement $el); /** * Method to handle the feed entry element for the feed given that a certain namespace is present. * * @param JFeedEntry $entry The JFeedEntry object being built from the parsed feed entry. * @param SimpleXMLElement $el The current XML element object to handle. * * @return void * * @since 12.3 */ public function processElementForFeedEntry(JFeedEntry $entry, SimpleXMLElement $el); } PK���\� I���!libraries/joomla/feed/factory.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Feed factory class. * * @since 12.3 */ class JFeedFactory { /** * @var array The list of registered parser classes for feeds. * @since 12.3 */ protected $parsers = array('rss' => 'JFeedParserRss', 'feed' => 'JFeedParserAtom'); /** * Method to load a URI into the feed reader for parsing. * * @param string $uri The URI of the feed to load. Idn uris must be passed already converted to punycode. * * @return JFeedReader * * @since 12.3 * @throws InvalidArgumentException * @throws RuntimeException */ public function getFeed($uri) { // Create the XMLReader object. $reader = new XMLReader; // Open the URI within the stream reader. if (!@$reader->open($uri, null, LIBXML_NOERROR | LIBXML_ERR_NONE | LIBXML_NOWARNING)) { // If allow_url_fopen is enabled if (ini_get('allow_url_fopen')) { // This is an error throw new RuntimeException('Unable to open the feed.'); } else { // Retry with JHttpFactory that allow using CURL and Sockets as alternative method when available $connector = JHttpFactory::getHttp(); $feed = $connector->get($uri); // Set the value to the XMLReader parser if (!$reader->xml($feed->body, null, LIBXML_NOERROR | LIBXML_ERR_NONE | LIBXML_NOWARNING)) { throw new RuntimeException('Unable to parse the feed.'); } } } try { // Skip ahead to the root node. while ($reader->read()) { if ($reader->nodeType == XMLReader::ELEMENT) { break; } } } catch (Exception $e) { throw new RuntimeException('Error reading feed.'); } // Setup the appopriate feed parser for the feed. $parser = $this->_fetchFeedParser($reader->name, $reader); return $parser->parse(); } /** * Method to register a JFeedParser class for a given root tag name. * * @param string $tagName The root tag name for which to register the parser class. * @param string $className The JFeedParser class name to register for a root tag name. * @param boolean $overwrite True to overwrite the parser class if one is already registered. * * @return JFeedFactory * * @since 12.3 * @throws InvalidArgumentException */ public function registerParser($tagName, $className, $overwrite = false) { // Verify that the class exists. if (!class_exists($className)) { throw new InvalidArgumentException('The feed parser class ' . $className . ' does not exist.'); } // Validate that the tag name is valid. if (!preg_match('/\A(?!XML)[a-z][\w0-9-]*/i', $tagName)) { throw new InvalidArgumentException('The tag name ' . $tagName . ' is not valid.'); } // Register the given parser class for the tag name if nothing registered or the overwrite flag set. if (empty($this->parsers[$tagName]) || (bool) $overwrite) { $this->parsers[(string) $tagName] = (string) $className; } return $this; } /** * Method to return a new JFeedParser object based on the registered parsers and a given type. * * @param string $type The name of parser to return. * @param XMLReader $reader The XMLReader instance for the feed. * * @return JFeedParser * * @since 12.3 * @throws LogicException */ private function _fetchFeedParser($type, XMLReader $reader) { // Look for a registered parser for the feed type. if (empty($this->parsers[$type])) { throw new LogicException('No registered feed parser for type ' . $type . '.'); } return new $this->parsers[$type]($reader); } } PK���\��Eh�� libraries/joomla/feed/person.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Feed Person class. * * @since 12.3 */ class JFeedPerson { /** * The email address of the person. * * @var string * @since 12.3 */ public $email; /** * The full name of the person. * * @var string * @since 12.3 */ public $name; /** * The type of person. * * @var string * @since 12.3 */ public $type; /** * The URI for the person. * * @var string * @since 12.3 */ public $uri; /** * Constructor. * * @param string $name The full name of the person. * @param string $email The email address of the person. * @param string $uri The URI for the person. * @param string $type The type of person. * * @since 12.3 */ public function __construct($name = null, $email = null, $uri = null, $type = null) { $this->name = $name; $this->email = $email; $this->uri = $uri; $this->type = $type; } } PK���\��d���libraries/joomla/feed/link.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Feed Link class. * * @since 12.3 */ class JFeedLink { /** * The URI to the linked resource. * * @var string * @since 12.3 */ public $uri; /** * The relationship between the feed and the linked resource. * * @var string * @since 12.3 */ public $relation; /** * The resource type. * * @var string * @since 12.3 */ public $type; /** * The language of the resource found at the given URI. * * @var string * @since 12.3 */ public $language; /** * The title of the resource. * * @var string * @since 12.3 */ public $title; /** * The length of the resource in bytes. * * @var integer * @since 12.3 */ public $length; /** * Constructor. * * @param string $uri The URI to the linked resource. * @param string $relation The relationship between the feed and the linked resource. * @param string $type The resource type. * @param string $language The language of the resource found at the given URI. * @param string $title The title of the resource. * @param integer $length The length of the resource in bytes. * * @since 12.3 * @throws InvalidArgumentException */ public function __construct($uri = null, $relation = null, $type = null, $language = null, $title = null, $length = null) { $this->uri = $uri; $this->relation = $relation; $this->type = $type; $this->language = $language; $this->title = $title; // Validate the length input. if (isset($length) && !is_numeric($length)) { throw new InvalidArgumentException('Length must be numeric.'); } $this->length = (int) $length; } } PK���\x/�?"libraries/joomla/cache/storage.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Abstract cache storage handler * * @since 11.1 */ class JCacheStorage { /** * @var string Rawname * @since 11.1 */ protected $rawname; /** * @var datetime Now * @since 11.1 */ public $_now; /** * @var integer Cache lifetime * @since 11.1 */ public $_lifetime; /** * @var boolean Locking * @since 11.1 */ public $_locking; /** * @var string Language * @since 11.1 */ public $_language; /** * @var string Application name. * @since 11.1 */ public $_application; /** * @var string Hash * @since 11.1 */ public $_hash; /** * Constructor * * @param array $options Optional parameters * * @since 11.1 */ public function __construct($options = array()) { $config = JFactory::getConfig(); $this->_hash = md5($config->get('secret')); $this->_application = (isset($options['application'])) ? $options['application'] : null; $this->_language = (isset($options['language'])) ? $options['language'] : 'en-GB'; $this->_locking = (isset($options['locking'])) ? $options['locking'] : true; $this->_lifetime = (isset($options['lifetime'])) ? $options['lifetime'] * 60 : $config->get('cachetime') * 60; $this->_now = (isset($options['now'])) ? $options['now'] : time(); // Set time threshold value. If the lifetime is not set, default to 60 (0 is BAD) // _threshold is now available ONLY as a legacy (it's deprecated). It's no longer used in the core. if (empty($this->_lifetime)) { $this->_threshold = $this->_now - 60; $this->_lifetime = 60; } else { $this->_threshold = $this->_now - $this->_lifetime; } } /** * Returns a cache storage handler object, only creating it * if it doesn't already exist. * * @param string $handler The cache storage handler to instantiate * @param array $options Array of handler options * * @return JCacheStorage A JCacheStorage instance * * @since 11.1 * @throws UnexpectedValueException * @throws RuntimeException */ public static function getInstance($handler = null, $options = array()) { static $now = null; self::addIncludePath(JPATH_PLATFORM . '/joomla/cache/storage'); if (!isset($handler)) { $conf = JFactory::getConfig(); $handler = $conf->get('cache_handler'); if (empty($handler)) { throw new UnexpectedValueException('Cache Storage Handler not set.'); } } if (is_null($now)) { $now = time(); } $options['now'] = $now; // We can't cache this since options may change... $handler = strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', $handler)); $class = 'JCacheStorage' . ucfirst($handler); if (!class_exists($class)) { // Search for the class file in the JCacheStorage include paths. jimport('joomla.filesystem.path'); if ($path = JPath::find(self::addIncludePath(), strtolower($handler) . '.php')) { include_once $path; } else { throw new RuntimeException(sprintf('Unable to load Cache Storage: %s', $handler)); } } return new $class($options); } /** * Get cached data by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param boolean $checkTime True to verify cache time expiration threshold * * @return mixed Boolean false on failure or a cached data object * * @since 11.1 */ public function get($id, $group, $checkTime = true) { return false; } /** * Get all cached data * * @return mixed Boolean false on failure or a cached data object * * @since 11.1 * @todo Review this method. The docblock doesn't fit what it actually does. */ public function getAll() { if (!class_exists('JCacheStorageHelper', false)) { include_once JPATH_PLATFORM . '/joomla/cache/storage/helper.php'; } return; } /** * Store the data to cache by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param string $data The data to store in cache * * @return boolean True on success, false otherwise * * @since 11.1 */ public function store($id, $group, $data) { return true; } /** * Remove a cached data entry by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function remove($id, $group) { return true; } /** * Clean cache for a group given a mode. * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function clean($group, $mode = null) { return true; } /** * Garbage collect expired cache data * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc() { return true; } /** * Test to see if the storage handler is available. * * @return boolean True on success, false otherwise * * @since 12.1. */ public static function isSupported() { return true; } /** * Test to see if the storage handler is available. * * @return boolean True on success, false otherwise. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) */ public static function test() { JLog::add('JCacheStorage::test() is deprecated. Use JCacheStorage::isSupported() instead.', JLog::WARNING, 'deprecated'); return static::isSupported(); } /** * Lock cached item * * @param string $id The cache data id * @param string $group The cache data group * @param integer $locktime Cached item max lock time * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function lock($id, $group, $locktime) { return false; } /** * Unlock cached item * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function unlock($id, $group = null) { return false; } /** * Get a cache_id string from an id/group pair * * @param string $id The cache data id * @param string $group The cache data group * * @return string The cache_id string * * @since 11.1 */ protected function _getCacheId($id, $group) { $name = md5($this->_application . '-' . $id . '-' . $this->_language); $this->rawname = $this->_hash . '-' . $name; return $this->_hash . '-cache-' . $group . '-' . $name; } /** * Add a directory where JCacheStorage should search for handlers. You may * either pass a string or an array of directories. * * @param string $path A path to search. * * @return array An array with directory elements * * @since 11.1 */ public static function addIncludePath($path = '') { static $paths; if (!isset($paths)) { $paths = array(); } if (!empty($path) && !in_array($path, $paths)) { jimport('joomla.filesystem.path'); array_unshift($paths, JPath::clean($path)); } return $paths; } } PK���\�8kk*libraries/joomla/cache/controller/page.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Cache page type object * * @since 11.1 */ class JCacheControllerPage extends JCacheController { /** * @var integer ID property for the cache page object. * @since 11.1 */ protected $_id; /** * @var string Cache group * @since 11.1 */ protected $_group; /** * @var object Cache lock test * @since 11.1 */ protected $_locktest = null; /** * Get the cached page data * * @param boolean $id The cache data id * @param string $group The cache data group * * @return boolean True if the cache is hit (false else) * * @since 11.1 */ public function get($id = false, $group = 'page') { // If an id is not given, generate it from the request if ($id == false) { $id = $this->_makeId(); } // If the etag matches the page id ... set a no change header and exit : utilize browser cache if (!headers_sent() && isset($_SERVER['HTTP_IF_NONE_MATCH'])) { $etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); if ($etag == $id) { $browserCache = isset($this->options['browsercache']) ? $this->options['browsercache'] : false; if ($browserCache) { $this->_noChange(); } } } // We got a cache hit... set the etag header and echo the page data $data = $this->cache->get($id, $group); $this->_locktest = new stdClass; $this->_locktest->locked = null; $this->_locktest->locklooped = null; if ($data === false) { $this->_locktest = $this->cache->lock($id, $group); if ($this->_locktest->locked == true && $this->_locktest->locklooped == true) { $data = $this->cache->get($id, $group); } } if ($data !== false) { $data = unserialize(trim($data)); $data = JCache::getWorkarounds($data); $this->_setEtag($id); if ($this->_locktest->locked == true) { $this->cache->unlock($id, $group); } return $data; } // Set id and group placeholders $this->_id = $id; $this->_group = $group; return false; } /** * Stop the cache buffer and store the cached data * * @param mixed $data The data to store * @param string $id The cache data id * @param string $group The cache data group * @param boolean $wrkarounds True to use wrkarounds * * @return boolean True if cache stored * * @since 11.1 */ public function store($data, $id, $group = null, $wrkarounds = true) { // Get page data from the application object if (empty($data)) { $data = JFactory::getApplication()->getBody(); } // Get id and group and reset the placeholders if (empty($id)) { $id = $this->_id; } if (empty($group)) { $group = $this->_group; } // Only attempt to store if page data exists if ($data) { if ($wrkarounds) { $data = JCache::setWorkarounds( $data, array( 'nopathway' => 1, 'nohead' => 1, 'nomodules' => 1, 'headers' => true ) ); } if ($this->_locktest->locked == false) { $this->_locktest = $this->cache->lock($id, $group); } $sucess = $this->cache->store(serialize($data), $id, $group); if ($this->_locktest->locked == true) { $this->cache->unlock($id, $group); } return $sucess; } return false; } /** * Generate a page cache id * * @return string MD5 Hash : page cache id * * @since 11.1 * @todo Discuss whether this should be coupled to a data hash or a request * hash ... perhaps hashed with a serialized request */ protected function _makeId() { return JCache::makeId(); } /** * There is no change in page data so send an * unmodified header and die gracefully * * @return void * * @since 11.1 */ protected function _noChange() { $app = JFactory::getApplication(); // Send not modified header and exit gracefully header('HTTP/1.x 304 Not Modified', true); $app->close(); } /** * Set the ETag header in the response * * @param string $etag The entity tag (etag) to set * * @return void * * @since 11.1 */ protected function _setEtag($etag) { JFactory::getApplication()->setHeader('ETag', $etag, true); } } PK���\��P�22.libraries/joomla/cache/controller/callback.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Cache callback type object * * @since 11.1 */ class JCacheControllerCallback extends JCacheController { /** * Executes a cacheable callback if not found in cache else returns cached output and result * * Since arguments to this function are read with func_get_args you can pass any number of * arguments to this method * as long as the first argument passed is the callback definition. * * The callback definition can be in several forms: * - Standard PHP Callback array see <http://php.net/callback> [recommended] * - Function name as a string eg. 'foo' for function foo() * - Static method name as a string eg. 'MyClass::myMethod' for method myMethod() of class MyClass * * @return mixed Result of the callback * * @since 11.1 */ public function call() { // Get callback and arguments $args = func_get_args(); $callback = array_shift($args); return $this->get($callback, $args); } /** * Executes a cacheable callback if not found in cache else returns cached output and result * * @param mixed $callback Callback or string shorthand for a callback * @param array $args Callback arguments * @param mixed $id Cache id * @param boolean $wrkarounds True to use wrkarounds * @param array $woptions Workaround options * * @return mixed Result of the callback * * @since 11.1 */ public function get($callback, $args = array(), $id = false, $wrkarounds = false, $woptions = array()) { // Normalize callback if (is_array($callback)) { // We have a standard php callback array -- do nothing } elseif (strstr($callback, '::')) { // This is shorthand for a static method callback classname::methodname list ($class, $method) = explode('::', $callback); $callback = array(trim($class), trim($method)); } elseif (strstr($callback, '->')) { /* * This is a really not so smart way of doing this... we provide this for backward compatability but this * WILL! disappear in a future version. If you are using this syntax change your code to use the standard * PHP callback array syntax: <http://php.net/callback> * * We have to use some silly global notation to pull it off and this is very unreliable */ list ($object_123456789, $method) = explode('->', $callback); global $$object_123456789; $callback = array($$object_123456789, $method); } else { // We have just a standard function -- do nothing } if (!$id) { // Generate an ID $id = $this->_makeId($callback, $args); } $data = $this->cache->get($id); $locktest = new stdClass; $locktest->locked = null; $locktest->locklooped = null; if ($data === false) { $locktest = $this->cache->lock($id); if ($locktest->locked == true && $locktest->locklooped == true) { $data = $this->cache->get($id); } } $coptions = array(); if ($data !== false) { $cached = unserialize(trim($data)); $coptions['mergehead'] = isset($woptions['mergehead']) ? $woptions['mergehead'] : 0; $output = ($wrkarounds == false) ? $cached['output'] : JCache::getWorkarounds($cached['output'], $coptions); $result = $cached['result']; if ($locktest->locked == true) { $this->cache->unlock($id); } } else { if (!is_array($args)) { $Args = !empty($args) ? array(&$args) : array(); } else { $Args = &$args; } if ($locktest->locked == false) { $locktest = $this->cache->lock($id); } if (isset($woptions['modulemode']) && $woptions['modulemode'] == 1) { $document = JFactory::getDocument(); $coptions['modulemode'] = 1; if (method_exists($document, 'getHeadData')) { $coptions['headerbefore'] = $document->getHeadData(); } } else { $coptions['modulemode'] = 0; } ob_start(); ob_implicit_flush(false); $result = call_user_func_array($callback, $Args); $output = ob_get_contents(); ob_end_clean(); $cached = array(); $coptions['nopathway'] = isset($woptions['nopathway']) ? $woptions['nopathway'] : 1; $coptions['nohead'] = isset($woptions['nohead']) ? $woptions['nohead'] : 1; $coptions['nomodules'] = isset($woptions['nomodules']) ? $woptions['nomodules'] : 1; $cached['output'] = ($wrkarounds == false) ? $output : JCache::setWorkarounds($output, $coptions); $cached['result'] = $result; // Store the cache data $this->cache->store(serialize($cached), $id); if ($locktest->locked == true) { $this->cache->unlock($id); } } echo $output; return $result; } /** * Generate a callback cache id * * @param callback $callback Callback to cache * @param array $args Arguments to the callback method to cache * * @return string MD5 Hash : function cache id * * @since 11.1 */ protected function _makeId($callback, $args) { if (is_array($callback) && is_object($callback[0])) { $vars = get_object_vars($callback[0]); $vars[] = strtolower(get_class($callback[0])); $callback[0] = $vars; } return md5(serialize(array($callback, $args))); } } PK���\��E���*libraries/joomla/cache/controller/view.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Cache view type object * * @since 11.1 */ class JCacheControllerView extends JCacheController { /** * Get the cached view data * * @param object $view The view object to cache output for * @param string $method The method name of the view method to cache output for * @param mixed $id The cache data id * @param boolean $wrkarounds True to enable workarounds. * * @return boolean True if the cache is hit (false else) * * @since 11.1 */ public function get($view, $method = 'display', $id = false, $wrkarounds = true) { // If an id is not given generate it from the request if ($id == false) { $id = $this->_makeId($view, $method); } $data = $this->cache->get($id); $locktest = new stdClass; $locktest->locked = null; $locktest->locklooped = null; if ($data === false) { $locktest = $this->cache->lock($id, null); // If the loop is completed and returned true it means the lock has been set. // If looped is true try to get the cached data again; it could exist now. if ($locktest->locked == true && $locktest->locklooped == true) { $data = $this->cache->get($id); } // False means that locking is either turned off or maxtime has been exceeded. // Execute the view. } if ($data !== false) { $data = unserialize(trim($data)); if ($wrkarounds === true) { echo JCache::getWorkarounds($data); } else { // No workarounds, so all data is stored in one piece echo isset($data) ? $data : null; } if ($locktest->locked == true) { $this->cache->unlock($id); } return true; } /* * No hit so we have to execute the view */ if (method_exists($view, $method)) { // If previous lock failed try again if ($locktest->locked == false) { $locktest = $this->cache->lock($id); } // Capture and echo output ob_start(); ob_implicit_flush(false); $view->$method(); $data = ob_get_contents(); ob_end_clean(); echo $data; /* * For a view we have a special case. We need to cache not only the output from the view, but the state * of the document head after the view has been rendered. This will allow us to properly cache any attached * scripts or stylesheets or links or any other modifications that the view has made to the document object */ $cached = $wrkarounds == true ? JCache::setWorkarounds($data) : $data; // Store the cache data $this->cache->store(serialize($cached), $id); if ($locktest->locked == true) { $this->cache->unlock($id); } } return false; } /** * Generate a view cache id. * * @param object &$view The view object to cache output for * @param string $method The method name to cache for the view object * * @return string MD5 Hash : view cache id * * @since 11.1 */ protected function _makeId(&$view, $method) { return md5(serialize(array(JCache::makeId(), get_class($view), $method))); } } PK���\z��� � ,libraries/joomla/cache/controller/output.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Cache output type object * * @since 11.1 */ class JCacheControllerOutput extends JCacheController { /** * Cache data ID * * @var string * @since 11.1 */ protected $_id; /** * Cache data group * * @var string * @since 11.1 */ protected $_group; /** * Object to test locked state * * @var object * @since 11.1 */ protected $_locktest = null; /** * Start the cache * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True if the cache is hit (false else) * * @since 11.1 */ public function start($id, $group = null) { // If we have data in cache use that. $data = $this->cache->get($id, $group); $this->_locktest = new stdClass; $this->_locktest->locked = null; $this->_locktest->locklooped = null; if ($data === false) { $this->_locktest = $this->cache->lock($id, $group); if ($this->_locktest->locked == true && $this->_locktest->locklooped == true) { $data = $this->cache->get($id, $group); } } if ($data !== false) { $data = unserialize(trim($data)); echo $data; if ($this->_locktest->locked == true) { $this->cache->unlock($id, $group); } return true; } // Nothing in cache... let's start the output buffer and start collecting data for next time. if ($this->_locktest->locked == false) { $this->_locktest = $this->cache->lock($id, $group); } ob_start(); ob_implicit_flush(false); // Set id and group placeholders $this->_id = $id; $this->_group = $group; return false; } /** * Stop the cache buffer and store the cached data * * @return boolean True if cache stored * * @since 11.1 */ public function end() { // Get data from output buffer and echo it $data = ob_get_contents(); ob_end_clean(); echo $data; // Get id and group and reset them placeholders $id = $this->_id; $group = $this->_group; $this->_id = null; $this->_group = null; // Get the storage handler and store the cached data $ret = $this->cache->store(serialize($data), $id, $group); if ($this->_locktest->locked == true) { $this->cache->unlock($id, $group); } return $ret; } } PK���\�&����,libraries/joomla/cache/storage/cachelite.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Cache lite storage handler * * @see http://pear.php.net/package/Cache_Lite/ * @since 11.1 */ class JCacheStorageCachelite extends JCacheStorage { /** * Static cache of the Cache_Lite instance * * @var object * @since 11.1 */ protected static $CacheLiteInstance = null; /** * Root path * * @var string * @since 11.1 */ protected $_root; /** * Constructor * * @param array $options Optional parameters. * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); $this->_root = $options['cachebase']; $cloptions = array( 'cacheDir' => $this->_root . '/', 'lifeTime' => $this->_lifetime, 'fileLocking' => $this->_locking, 'automaticCleaningFactor' => isset($options['autoclean']) ? $options['autoclean'] : 200, 'fileNameProtection' => false, 'hashedDirectoryLevel' => 0, 'caching' => $options['caching']); if (self::$CacheLiteInstance === null) { $this->initCache($cloptions); } } /** * Instantiates the appropriate CacheLite object. * Only initializes the engine if it does not already exist. * Note this is a protected method * * @param array $cloptions optional parameters * * @return object * * @since 11.1 */ protected function initCache($cloptions) { if (!class_exists('Cache_Lite')) { require_once 'Cache/Lite.php'; } self::$CacheLiteInstance = new Cache_Lite($cloptions); return self::$CacheLiteInstance; } /** * Get cached data from a file by id and group * * @param string $id The cache data id. * @param string $group The cache data group. * @param boolean $checkTime True to verify cache time expiration threshold. * * @return mixed Boolean false on failure or a cached data string. * * @since 11.1 */ public function get($id, $group, $checkTime = true) { self::$CacheLiteInstance->setOption('cacheDir', $this->_root . '/' . $group . '/'); $this->_getCacheId($id, $group); $data = self::$CacheLiteInstance->get($this->rawname, $group); return $data; } /** * Get all cached data * * @return array * * @since 11.1 */ public function getAll() { parent::getAll(); $path = $this->_root; $folders = new DirectoryIterator($path); $data = array(); foreach ($folders as $folder) { if (!$folder->isDir() || $folder->isDot()) { continue; } $foldername = $folder->getFilename(); $files = new DirectoryIterator($path . '/' . $foldername); $item = new JCacheStorageHelper($foldername); foreach ($files as $file) { if (!$file->isFile()) { continue; } $filename = $file->getFilename(); $item->updateSize(filesize($path . '/' . $foldername . '/' . $filename) / 1024); } $data[$foldername] = $item; } return $data; } /** * Store the data to a file by id and group * * @param string $id The cache data id. * @param string $group The cache data group. * @param string $data The data to store in cache. * * @return boolean True on success, false otherwise * * @since 11.1 */ public function store($id, $group, $data) { $dir = $this->_root . '/' . $group; // If the folder doesn't exist try to create it if (!is_dir($dir)) { // Make sure the index file is there $indexFile = $dir . '/index.html'; @mkdir($dir) && file_put_contents($indexFile, '<!DOCTYPE html><title></title>'); } // Make sure the folder exists if (!is_dir($dir)) { return false; } self::$CacheLiteInstance->setOption('cacheDir', $this->_root . '/' . $group . '/'); $this->_getCacheId($id, $group); $success = self::$CacheLiteInstance->save($data, $this->rawname, $group); if ($success == true) { return $success; } else { return false; } } /** * Remove a cached data file by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function remove($id, $group) { self::$CacheLiteInstance->setOption('cacheDir', $this->_root . '/' . $group . '/'); $this->_getCacheId($id, $group); $success = self::$CacheLiteInstance->remove($this->rawname, $group); if ($success == true) { return $success; } else { return false; } } /** * Clean cache for a group given a mode. * * @param string $group The cache data group. * @param string $mode The mode for cleaning cache [group|notgroup]. * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function clean($group, $mode = null) { jimport('joomla.filesystem.folder'); switch ($mode) { case 'notgroup': $clmode = 'notingroup'; $success = self::$CacheLiteInstance->clean($group, $clmode); break; case 'group': if (is_dir($this->_root . '/' . $group)) { $clmode = $group; self::$CacheLiteInstance->setOption('cacheDir', $this->_root . '/' . $group . '/'); $success = self::$CacheLiteInstance->clean($group, $clmode); JFolder::delete($this->_root . '/' . $group); } else { $success = true; } break; default: if (is_dir($this->_root . '/' . $group)) { $clmode = $group; self::$CacheLiteInstance->setOption('cacheDir', $this->_root . '/' . $group . '/'); $success = self::$CacheLiteInstance->clean($group, $clmode); } else { $success = true; } break; } if ($success == true) { return $success; } else { return false; } } /** * Garbage collect expired cache data * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc() { $result = true; self::$CacheLiteInstance->setOption('automaticCleaningFactor', 1); self::$CacheLiteInstance->setOption('hashedDirectoryLevel', 1); $success1 = self::$CacheLiteInstance->_cleanDir($this->_root . '/', false, 'old'); if (!($dh = opendir($this->_root . '/'))) { return false; } while ($file = readdir($dh)) { if (($file != '.') && ($file != '..') && ($file != '.svn')) { $file2 = $this->_root . '/' . $file; if (is_dir($file2)) { $result = ($result && (self::$CacheLiteInstance->_cleanDir($file2 . '/', false, 'old'))); } } } $success = ($success1 && $result); return $success; } /** * Test to see if the cache storage is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { @include_once 'Cache/Lite.php'; return class_exists('Cache_Lite'); } } PK���\sH&�bb(libraries/joomla/cache/storage/redis.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Redis cache storage handler for PECL * * @package Joomla.Platform * @subpackage Cache * @since 3.4 */ class JCacheStorageRedis extends JCacheStorage { /** * Redis connection object * * @var Redis * @since 3.4 */ protected static $_redis = null; /** * Persistent session flag * * @var boolean * @since 3.4 */ protected $_persistent = false; /** * Constructor * * @param array $options Optional parameters. * * @since 3.4 */ public function __construct($options = array()) { parent::__construct($options); if (static::$_redis === null) { $this->getConnection(); } } /** * Return redis connection object * * @return mixed Redis connection object on success, void or boolean on failure * * @since 3.4 * * @throws RuntimeException */ protected function getConnection() { if (static::isSupported() == false) { return false; } $config = JFactory::getConfig(); $app = JFactory::getApplication(); $caching = (bool) $config->get('caching'); if ($caching == false) { return false; } $this->_persistent = $config->get('redis_persist', true); $server = array( 'host' => $config->get('redis_server_host', 'localhost'), 'port' => $config->get('redis_server_port', 6379), 'auth' => $config->get('redis_server_auth', null), 'db' => (int) $config->get('redis_server_db', null) ); static::$_redis = new Redis; if ($this->_persistent) { try { $connection = static::$_redis->pconnect($server['host'], $server['port']); $auth = (!empty($server['auth'])) ? static::$_redis->auth($server['auth']) : true; } catch (Exception $e) { } } else { try { $connection = static::$_redis->connect($server['host'], $server['port']); $auth = (!empty($server['auth'])) ? static::$_redis->auth($server['auth']) : true; } catch (Exception $e) { } } if ($connection == false) { static::$_redis = null; if ($app->isAdmin()) { JError::raiseWarning(500, 'Redis connection failed'); } return; } if ($auth == false) { if ($app->isAdmin()) { JError::raiseWarning(500, 'Redis authentication failed'); } return; } $select = static::$_redis->select($server['db']); if ($select == false) { static::$_redis = null; if ($app->isAdmin()) { JError::raiseWarning(500, 'Redis failed to select database'); } return; } try { static::$_redis->ping(); } catch (RedisException $e) { static::$_redis = null; if ($app->isAdmin()) { JError::raiseWarning(500, 'Redis ping failed'); } return; } return static::$_redis; } /** * Get cached data from redis by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param boolean $checkTime True to verify cache time expiration threshold * * @return mixed Boolean false on failure or a cached data string * * @since 3.4 */ public function get($id, $group, $checkTime = true) { if (static::isConnected() == false) { return false; } $cache_id = $this->_getCacheId($id, $group); $back = static::$_redis->get($cache_id); return $back; } /** * Get all cached data * * @return array Array of cached data * * @since 3.4 */ public function getAll() { if (static::isConnected() == false) { return false; } parent::getAll(); $allKeys = static::$_redis->keys('*'); $data = array(); $secret = $this->_hash; if (!empty($allKeys)) { foreach ($allKeys as $key) { $namearr = explode('-', $key); if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') { $group = $namearr[2]; if (!isset($data[$group])) { $item = new JCacheStorageHelper($group); } else { $item = $data[$group]; } $item->updateSize(strlen($key)*8/1024); $data[$group] = $item; } } } return $data; } /** * Store the data to Redis by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param string $data The data to store in cache * * @return boolean True on success, false otherwise * * @since 3.4 */ public function store($id, $group, $data) { if (static::isConnected() == false) { return false; } $cache_id = $this->_getCacheId($id, $group); $tmparr = new stdClass; $tmparr->name = $cache_id; $tmparr->size = strlen($data); $config = JFactory::getConfig(); $lifetime = (int) $config->get('cachetime', 15); if ($this->_lifetime == $lifetime) { $this->_lifetime = $lifetime * 60; } $index[] = $tmparr; static::$_redis->setex($cache_id, 3600, $data); return true; } /** * Remove a cached data entry by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 3.4 */ public function remove($id, $group) { if (static::isConnected() == false) { return false; } $cache_id = $this->_getCacheId($id, $group); return static::$_redis->delete($cache_id); } /** * Clean cache for a group given a mode. * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @return boolean True on success, false otherwise * * @since 3.4 */ public function clean($group, $mode = null) { if (static::isConnected() == false) { return false; } $allKeys = static::$_redis->keys('*'); if ($allKeys === false) { $allKeys = array(); } $secret = $this->_hash; foreach ($allKeys as $key) { if (strpos($key, $secret . '-cache-' . $group . '-') === 0 && $mode == 'group') { static::$_redis->delete($key); } if (strpos($key, $secret . '-cache-' . $group . '-') !== 0 && $mode != 'group') { static::$_redis->delete($key); } } return true; } /** * Test to see if the cache storage is available. * * @return boolean True on success, false otherwise. * * @since 3.4 */ public static function isSupported() { return class_exists('Redis'); } /** * Test to see if the Redis connection is up * * @return boolean True on success, false otherwise. * * @since 3.4 */ public static function isConnected() { return (bool) static::$_redis; } } PK���\S����)libraries/joomla/cache/storage/xcache.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * XCache cache storage handler * * @link http://xcache.lighttpd.net/ * @since 11.1 */ class JCacheStorageXcache extends JCacheStorage { /** * Get cached data by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param boolean $checkTime True to verify cache time expiration threshold * * @return mixed Boolean false on failure or a cached data string * * @since 11.1 */ public function get($id, $group, $checkTime = true) { // Make sure XCache is configured properly if (self::isSupported() == false) { return false; } $cache_id = $this->_getCacheId($id, $group); $cache_content = xcache_get($cache_id); if ($cache_content === null) { return false; } return $cache_content; } /** * Get all cached data * * This requires the php.ini setting xcache.admin.enable_auth = Off. * * @return array data * * @since 11.1 */ public function getAll() { parent::getAll(); // Make sure XCache is configured properly if (self::isSupported() == false) { return array(); } $allinfo = xcache_list(XC_TYPE_VAR, 0); $keys = $allinfo['cache_list']; $secret = $this->_hash; $data = array(); foreach ($keys as $key) { $namearr = explode('-', $key['name']); if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') { $group = $namearr[2]; if (!isset($data[$group])) { $item = new JCacheStorageHelper($group); } else { $item = $data[$group]; } $item->updateSize($key['size'] / 1024); $data[$group] = $item; } } return $data; } /** * Store the data by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param string $data The data to store in cache * * @return boolean True on success, false otherwise * * @since 11.1 */ public function store($id, $group, $data) { // Make sure XCache is configured properly if (self::isSupported() == false) { return false; } $cache_id = $this->_getCacheId($id, $group); $store = xcache_set($cache_id, $data, $this->_lifetime); return $store; } /** * Remove a cached data entry by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function remove($id, $group) { // Make sure XCache is configured properly if (self::isSupported() == false) { return false; } $cache_id = $this->_getCacheId($id, $group); if (!xcache_isset($cache_id)) { return true; } return xcache_unset($cache_id); } /** * Clean cache for a group given a mode. * * This requires the php.ini setting xcache.admin.enable_auth = Off. * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function clean($group, $mode = null) { // Make sure XCache is configured properly if (self::isSupported() == false) { return true; } $allinfo = xcache_list(XC_TYPE_VAR, 0); $keys = $allinfo['cache_list']; $secret = $this->_hash; foreach ($keys as $key) { if (strpos($key['name'], $secret . '-cache-' . $group . '-') === 0 xor $mode != 'group') { xcache_unset($key['name']); } } return true; } /** * Garbage collect expired cache data * * This is a dummy, since xcache has built in garbage collector, turn it * on in php.ini by changing default xcache.gc_interval setting from * 0 to 3600 (=1 hour) * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc() { /* $now = time(); $cachecount = xcache_count(XC_TYPE_VAR); for ($i = 0; $i < $cachecount; $i ++) { $allinfo = xcache_list(XC_TYPE_VAR, $i); $keys = $allinfo ['cache_list']; foreach($keys as $key) { if (strstr($key['name'], $this->_hash)) { if (($key['ctime'] + $this->_lifetime ) < $this->_now) xcache_unset($key['name']); } } } */ return true; } /** * Test to see if the cache storage is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { if (extension_loaded('xcache')) { // XCache Admin must be disabled for Joomla to use XCache $xcache_admin_enable_auth = ini_get('xcache.admin.enable_auth'); // Some extensions ini variables are reported as strings if ($xcache_admin_enable_auth == 'Off') { return true; } // We require a string with contents 0, not a null value because it is not set since that then defaults to On/True if ($xcache_admin_enable_auth === '0') { return true; } // In some enviorments empty is equivalent to Off; See JC: #34044 && Github: #4083 if ($xcache_admin_enable_auth === '') { return true; } } // If the settings are not correct, give up return false; } } PK���\���bb+libraries/joomla/cache/storage/wincache.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * WINCACHE cache storage handler * * @see http://php.net/manual/en/book.wincache.php * @since 11.1 */ class JCacheStorageWincache extends JCacheStorage { /** * Get cached data from WINCACHE by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param boolean $checkTime True to verify cache time expiration threshold * * @return mixed Boolean false on failure or a cached data string * * @since 11.1 */ public function get($id, $group, $checkTime = true) { $cache_id = $this->_getCacheId($id, $group); $cache_content = wincache_ucache_get($cache_id); return $cache_content; } /** * Get all cached data * * @return array data * * @since 11.1 */ public function getAll() { parent::getAll(); $allinfo = wincache_ucache_info(); $keys = $allinfo['ucache_entries']; $secret = $this->_hash; $data = array(); foreach ($keys as $key) { $name = $key['key_name']; $namearr = explode('-', $name); if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') { $group = $namearr[2]; if (!isset($data[$group])) { $item = new JCacheStorageHelper($group); } else { $item = $data[$group]; } if (isset($key['value_size'])) { $item->updateSize($key['value_size'] / 1024); } else { // Dummy, WINCACHE version is too low. $item->updateSize(1); } $data[$group] = $item; } } return $data; } /** * Store the data to WINCACHE by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param string $data The data to store in cache * * @return boolean True on success, false otherwise * * @since 11.1 */ public function store($id, $group, $data) { $cache_id = $this->_getCacheId($id, $group); return wincache_ucache_set($cache_id, $data, $this->_lifetime); } /** * Remove a cached data entry by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function remove($id, $group) { $cache_id = $this->_getCacheId($id, $group); return wincache_ucache_delete($cache_id); } /** * Clean cache for a group given a mode. * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function clean($group, $mode = null) { $allinfo = wincache_ucache_info(); $keys = $allinfo['ucache_entries']; $secret = $this->_hash; foreach ($keys as $key) { if (strpos($key['key_name'], $secret . '-cache-' . $group . '-') === 0 xor $mode != 'group') { wincache_ucache_delete($key['key_name']); } } return true; } /** * Force garbage collect expired cache data as items are removed only on get/add/delete/info etc * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc() { $allinfo = wincache_ucache_info(); $keys = $allinfo['ucache_entries']; $secret = $this->_hash; foreach ($keys as $key) { if (strpos($key['key_name'], $secret . '-cache-')) { wincache_ucache_get($key['key_name']); } } } /** * Test to see if the cache storage is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { $test = extension_loaded('wincache') && function_exists('wincache_ucache_get') && !strcmp(ini_get('wincache.ucenabled'), '1'); return $test; } } PK���\ij�\\)libraries/joomla/cache/storage/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Cache storage helper functions. * * @since 11.1 */ class JCacheStorageHelper { /** * Cache data group * * @var string * @since 11.1 */ public $group = ''; /** * Cached item size * * @var string * @since 11.1 */ public $size = 0; /** * Counter * * @var integer * @since 11.1 */ public $count = 0; /** * Constructor * * @param string $group The cache data group * * @since 11.1 */ public function __construct($group) { $this->group = $group; } /** * Increase cache items count. * * @param string $size Cached item size * * @return void * * @since 11.1 */ public function updateSize($size) { $this->size = number_format($this->size + $size, 2, JText::_('DECIMALS_SEPARATOR'), JText::_('THOUSANDS_SEPARATOR')); $this->count++; } } PK���\=7�!;>;>'libraries/joomla/cache/storage/file.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * File cache storage handler * * @since 11.1 */ class JCacheStorageFile extends JCacheStorage { /** * Root path * * @var string * @since 11.1 */ protected $_root; /** * Constructor * * @param array $options Optional parameters * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); $this->_root = $options['cachebase']; } // NOTE: raw php calls are up to 100 times faster than JFile or JFolder /** * Get cached data from a file by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param boolean $checkTime True to verify cache time expiration threshold * * @return mixed Boolean false on failure or a cached data string * * @since 11.1 */ public function get($id, $group, $checkTime = true) { $data = false; $path = $this->_getFilePath($id, $group); if ($checkTime == false || ($checkTime == true && $this->_checkExpire($id, $group) === true)) { if (file_exists($path)) { $data = file_get_contents($path); if ($data) { // Remove the initial die() statement $data = str_replace('<?php die("Access Denied"); ?>#x#', '', $data); } } return $data; } else { return false; } } /** * Get all cached data * * @return array The cached data * * @since 11.1 */ public function getAll() { parent::getAll(); $path = $this->_root; $folders = $this->_folders($path); $data = array(); foreach ($folders as $folder) { $files = $this->_filesInFolder($path . '/' . $folder); $item = new JCacheStorageHelper($folder); foreach ($files as $file) { $item->updateSize(filesize($path . '/' . $folder . '/' . $file) / 1024); } $data[$folder] = $item; } return $data; } /** * Store the data to a file by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param string $data The data to store in cache * * @return boolean True on success, false otherwise * * @since 11.1 */ public function store($id, $group, $data) { $written = false; $path = $this->_getFilePath($id, $group); $die = '<?php die("Access Denied"); ?>#x#'; // Prepend a die string $data = $die . $data; $_fileopen = @fopen($path, "wb"); if ($_fileopen) { $len = strlen($data); @fwrite($_fileopen, $data, $len); $written = true; } // Data integrity check if ($written && ($data == file_get_contents($path))) { return true; } else { return false; } } /** * Remove a cached data file by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function remove($id, $group) { $path = $this->_getFilePath($id, $group); if (!@unlink($path)) { return false; } return true; } /** * Clean cache for a group given a mode. * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function clean($group, $mode = null) { $return = true; $folder = $group; if (trim($folder) == '') { $mode = 'notgroup'; } switch ($mode) { case 'notgroup' : $folders = $this->_folders($this->_root); for ($i = 0, $n = count($folders); $i < $n; $i++) { if ($folders[$i] != $folder) { $return |= $this->_deleteFolder($this->_root . '/' . $folders[$i]); } } break; case 'group' : default : if (is_dir($this->_root . '/' . $folder)) { $return = $this->_deleteFolder($this->_root . '/' . $folder); } break; } return $return; } /** * Garbage collect expired cache data * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc() { $result = true; // Files older than lifeTime get deleted from cache $files = $this->_filesInFolder($this->_root, '', true, true, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'index.html')); foreach ($files as $file) { $time = @filemtime($file); if (($time + $this->_lifetime) < $this->_now || empty($time)) { $result |= @unlink($file); } } return $result; } /** * Test to see if the cache storage is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { $conf = JFactory::getConfig(); return is_writable($conf->get('cache_path', JPATH_CACHE)); } /** * Lock cached item * * @param string $id The cache data id * @param string $group The cache data group * @param integer $locktime Cached item max lock time * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function lock($id, $group, $locktime) { $returning = new stdClass; $returning->locklooped = false; $looptime = $locktime * 10; $path = $this->_getFilePath($id, $group); $_fileopen = @fopen($path, "r+b"); if ($_fileopen) { $data_lock = @flock($_fileopen, LOCK_EX); } else { $data_lock = false; } if ($data_lock === false) { $lock_counter = 0; // Loop until you find that the lock has been released. // That implies that data get from other thread has finished while ($data_lock === false) { if ($lock_counter > $looptime) { $returning->locked = false; $returning->locklooped = true; break; } usleep(100); $data_lock = @flock($_fileopen, LOCK_EX); $lock_counter++; } } $returning->locked = $data_lock; return $returning; } /** * Unlock cached item * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function unlock($id, $group = null) { $path = $this->_getFilePath($id, $group); $_fileopen = @fopen($path, "r+b"); if ($_fileopen) { $ret = @flock($_fileopen, LOCK_UN); @fclose($_fileopen); } else { // Expect true if $_fileopen is false. Ref: http://issues.joomla.org/tracker/joomla-cms/2535 $ret = true; } return $ret; } /** * Check to make sure cache is still valid, if not, delete it. * * @param string $id Cache key to expire. * @param string $group The cache data group. * * @return boolean False if not valid * * @since 11.1 */ protected function _checkExpire($id, $group) { $path = $this->_getFilePath($id, $group); // Check prune period if (file_exists($path)) { $time = @filemtime($path); if (($time + $this->_lifetime) < $this->_now || empty($time)) { @unlink($path); return false; } return true; } return false; } /** * Get a cache file path from an id/group pair * * @param string $id The cache data id * @param string $group The cache data group * * @return string The cache file path * * @since 11.1 */ protected function _getFilePath($id, $group) { $name = $this->_getCacheId($id, $group); $dir = $this->_root . '/' . $group; // If the folder doesn't exist try to create it if (!is_dir($dir)) { // Make sure the index file is there $indexFile = $dir . '/index.html'; @mkdir($dir) && file_put_contents($indexFile, '<!DOCTYPE html><title></title>'); } // Make sure the folder exists if (!is_dir($dir)) { return false; } return $dir . '/' . $name . '.php'; } /** * Quickly delete a folder of files * * @param string $path The path to the folder to delete. * * @return boolean True on success. * * @since 11.1 */ protected function _deleteFolder($path) { // Sanity check if (!$path || !is_dir($path) || empty($this->_root)) { // Bad programmer! Bad, bad programmer! JLog::add('JCacheStorageFile::_deleteFolder ' . JText::_('JLIB_FILESYSTEM_ERROR_DELETE_BASE_DIRECTORY'), JLog::WARNING, 'jerror'); return false; } $path = $this->_cleanPath($path); // Check to make sure path is inside cache folder, we do not want to delete Joomla root! $pos = strpos($path, $this->_cleanPath($this->_root)); if ($pos === false || $pos > 0) { JLog::add('JCacheStorageFile::_deleteFolder' . JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER', $path), JLog::WARNING, 'jerror'); return false; } // Remove all the files in folder if they exist; disable all filtering $files = $this->_filesInFolder($path, '.', false, true, array(), array()); if (!empty($files) && !is_array($files)) { if (@unlink($files) !== true) { return false; } } elseif (!empty($files) && is_array($files)) { foreach ($files as $file) { $file = $this->_cleanPath($file); // In case of restricted permissions we zap it one way or the other // as long as the owner is either the webserver or the ftp if (@unlink($file)) { // Do nothing } else { $filename = basename($file); JLog::add('JCacheStorageFile::_deleteFolder' . JText::sprintf('JLIB_FILESYSTEM_DELETE_FAILED', $filename), JLog::WARNING, 'jerror'); return false; } } } // Remove sub-folders of folder; disable all filtering $folders = $this->_folders($path, '.', false, true, array(), array()); foreach ($folders as $folder) { if (is_link($folder)) { // Don't descend into linked directories, just delete the link. if (@unlink($folder) !== true) { return false; } } elseif ($this->_deleteFolder($folder) !== true) { return false; } } // In case of restricted permissions we zap it one way or the other // as long as the owner is either the webserver or the ftp if (@rmdir($path)) { $ret = true; } else { JLog::add('JCacheStorageFile::_deleteFolder' . JText::sprintf('JLIB_FILESYSTEM_ERROR_FOLDER_DELETE', $path), JLog::WARNING, 'jerror'); $ret = false; } return $ret; } /** * Function to strip additional / or \ in a path name * * @param string $path The path to clean * @param string $ds Directory separator (optional) * * @return string The cleaned path * * @since 11.1 */ protected function _cleanPath($path, $ds = DIRECTORY_SEPARATOR) { $path = trim($path); if (empty($path)) { $path = $this->_root; } else { // Remove double slashes and backslahses and convert all slashes and backslashes to DIRECTORY_SEPARATOR $path = preg_replace('#[/\\\\]+#', $ds, $path); } return $path; } /** * Utility function to quickly read the files in a folder. * * @param string $path The path of the folder to read. * @param string $filter A filter for file names. * @param mixed $recurse True to recursively search into sub-folders, or an * integer to specify the maximum depth. * @param boolean $fullpath True to return the full path to the file. * @param array $exclude Array with names of files which should not be shown in * the result. * @param array $excludefilter Array of folder names to exclude * * @return array Files in the given folder. * * @since 11.1 */ protected function _filesInFolder($path, $filter = '.', $recurse = false, $fullpath = false , $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*', '.*~')) { $arr = array(); // Check to make sure the path valid and clean $path = $this->_cleanPath($path); // Is the path a folder? if (!is_dir($path)) { JLog::add('JCacheStorageFile::_filesInFolder' . JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER', $path), JLog::WARNING, 'jerror'); return false; } // Read the source directory. if (!($handle = @opendir($path))) { return $arr; } if (count($excludefilter)) { $excludefilter = '/(' . implode('|', $excludefilter) . ')/'; } else { $excludefilter = ''; } while (($file = readdir($handle)) !== false) { if (($file != '.') && ($file != '..') && (!in_array($file, $exclude)) && (!$excludefilter || !preg_match($excludefilter, $file))) { $dir = $path . '/' . $file; $isDir = is_dir($dir); if ($isDir) { if ($recurse) { if (is_int($recurse)) { $arr2 = $this->_filesInFolder($dir, $filter, $recurse - 1, $fullpath); } else { $arr2 = $this->_filesInFolder($dir, $filter, $recurse, $fullpath); } $arr = array_merge($arr, $arr2); } } else { if (preg_match("/$filter/", $file)) { if ($fullpath) { $arr[] = $path . '/' . $file; } else { $arr[] = $file; } } } } } closedir($handle); return $arr; } /** * Utility function to read the folders in a folder. * * @param string $path The path of the folder to read. * @param string $filter A filter for folder names. * @param mixed $recurse True to recursively search into sub-folders, or an integer to specify the maximum depth. * @param boolean $fullpath True to return the full path to the folders. * @param array $exclude Array with names of folders which should not be shown in the result. * @param array $excludefilter Array with regular expressions matching folders which should not be shown in the result. * * @return array Folders in the given folder. * * @since 11.1 */ protected function _folders($path, $filter = '.', $recurse = false, $fullpath = false , $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*')) { $arr = array(); // Check to make sure the path valid and clean $path = $this->_cleanPath($path); // Is the path a folder? if (!is_dir($path)) { JLog::add('JCacheStorageFile::_folders' . JText::sprintf('JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER', $path), JLog::WARNING, 'jerror'); return false; } // Read the source directory if (!($handle = @opendir($path))) { return $arr; } if (count($excludefilter)) { $excludefilter_string = '/(' . implode('|', $excludefilter) . ')/'; } else { $excludefilter_string = ''; } while (($file = readdir($handle)) !== false) { if (($file != '.') && ($file != '..') && (!in_array($file, $exclude)) && (empty($excludefilter_string) || !preg_match($excludefilter_string, $file))) { $dir = $path . '/' . $file; $isDir = is_dir($dir); if ($isDir) { // Removes filtered directories if (preg_match("/$filter/", $file)) { if ($fullpath) { $arr[] = $dir; } else { $arr[] = $file; } } if ($recurse) { if (is_int($recurse)) { $arr2 = $this->_folders($dir, $filter, $recurse - 1, $fullpath, $exclude, $excludefilter); } else { $arr2 = $this->_folders($dir, $filter, $recurse, $fullpath, $exclude, $excludefilter); } $arr = array_merge($arr, $arr2); } } } } closedir($handle); return $arr; } } PK���\1���'�',libraries/joomla/cache/storage/memcached.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Memcached cache storage handler * * @see http://php.net/manual/en/book.memcached.php * @since 12.1 */ class JCacheStorageMemcached extends JCacheStorage { /** * Memcached connection object * * @var Memcached * @since 12.1 */ protected static $_db = null; /** * Persistent session flag * * @var boolean * @since 12.1 */ protected $_persistent = false; /** * Payload compression level * * @var integer * @since 12.1 */ protected $_compress = 0; /** * Constructor * * @param array $options Optional parameters. * * @since 12.1 */ public function __construct($options = array()) { parent::__construct($options); if (self::$_db === null) { $this->getConnection(); } } /** * Return memcached connection object * * @return object memcached connection object * * @since 12.1 * @throws RuntimeException */ protected function getConnection() { if ((extension_loaded('memcached') && class_exists('Memcached')) != true) { return false; } $config = JFactory::getConfig(); $this->_persistent = $config->get('memcached_persist', true); $this->_compress = $config->get('memcached_compress', false) == false ? 0 : Memcached::OPT_COMPRESSION; /* * This will be an array of loveliness * @todo: multiple servers * $servers = (isset($params['servers'])) ? $params['servers'] : array(); */ $server = array(); $server['host'] = $config->get('memcached_server_host', 'localhost'); $server['port'] = $config->get('memcached_server_port', 11211); // Create the memcache connection if ($this->_persistent) { $session = JFactory::getSession(); self::$_db = new Memcached($session->getId()); } else { self::$_db = new Memcached; } $memcachedtest = self::$_db->addServer($server['host'], $server['port']); if ($memcachedtest == false) { throw new RuntimeException('Could not connect to memcached server', 404); } self::$_db->setOption(Memcached::OPT_COMPRESSION, $this->_compress); // Memcached has no list keys, we do our own accounting, initialise key index if (self::$_db->get($this->_hash . '-index') === false) { $empty = array(); self::$_db->set($this->_hash . '-index', $empty, 0); } return; } /** * Get cached data from memcached by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param boolean $checkTime True to verify cache time expiration threshold * * @return mixed Boolean false on failure or a cached data string * * @since 12.1 */ public function get($id, $group, $checkTime = true) { $cache_id = $this->_getCacheId($id, $group); $back = self::$_db->get($cache_id); return $back; } /** * Get all cached data * * @return array data * * @since 12.1 */ public function getAll() { parent::getAll(); $keys = self::$_db->get($this->_hash . '-index'); $secret = $this->_hash; $data = array(); if (!empty($keys) && is_array($keys)) { foreach ($keys as $key) { if (empty($key)) { continue; } $namearr = explode('-', $key->name); if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') { $group = $namearr[2]; if (!isset($data[$group])) { $item = new JCacheStorageHelper($group); } else { $item = $data[$group]; } $item->updateSize($key->size / 1024); $data[$group] = $item; } } } return $data; } /** * Store the data to memcached by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param string $data The data to store in cache * * @return boolean True on success, false otherwise * * @since 12.1 */ public function store($id, $group, $data) { $cache_id = $this->_getCacheId($id, $group); if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } $tmparr = new stdClass; $tmparr->name = $cache_id; $tmparr->size = strlen($data); $index[] = $tmparr; self::$_db->replace($this->_hash . '-index', $index, 0); $this->unlockindex(); // Prevent double writes, write only if it doesn't exist else replace if (!self::$_db->replace($cache_id, $data, $this->_lifetime)) { self::$_db->set($cache_id, $data, $this->_lifetime); } return true; } /** * Remove a cached data entry by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 12.1 */ public function remove($id, $group) { $cache_id = $this->_getCacheId($id, $group); if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } foreach ($index as $key => $value) { if ($value->name == $cache_id) { unset($index[$key]); } break; } self::$_db->replace($this->_hash . '-index', $index, 0); $this->unlockindex(); return self::$_db->delete($cache_id); } /** * Clean cache for a group given a mode. * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @return boolean True on success, false otherwise * * @since 12.1 */ public function clean($group, $mode = null) { if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } $secret = $this->_hash; foreach ($index as $key => $value) { if (strpos($value->name, $secret . '-cache-' . $group . '-') === 0 xor $mode != 'group') { self::$_db->delete($value->name, 0); unset($index[$key]); } } self::$_db->replace($this->_hash . '-index', $index, 0); $this->unlockindex(); return true; } /** * Test to see if the cache storage is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { if ((extension_loaded('memcached') && class_exists('Memcached')) != true) { return false; } $config = JFactory::getConfig(); $host = $config->get('memcached_server_host', 'localhost'); $port = $config->get('memcached_server_port', 11211); $memcached = new Memcached; $memcachedtest = @$memcached->addServer($host, $port); if (!$memcachedtest) { return false; } else { return true; } } /** * Lock cached item - override parent as this is more efficient * * @param string $id The cache data id * @param string $group The cache data group * @param integer $locktime Cached item max lock time * * @return boolean True on success, false otherwise. * * @since 12.1 */ public function lock($id, $group, $locktime) { $returning = new stdClass; $returning->locklooped = false; $looptime = $locktime * 10; $cache_id = $this->_getCacheId($id, $group); if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } $tmparr = new stdClass; $tmparr->name = $cache_id; $tmparr->size = 1; $index[] = $tmparr; self::$_db->replace($this->_hash . '-index', $index, 0); $this->unlockindex(); $data_lock = self::$_db->add($cache_id . '_lock', 1, $locktime); if ($data_lock === false) { $lock_counter = 0; // Loop until you find that the lock has been released. // That implies that data get from other thread has finished while ($data_lock === false) { if ($lock_counter > $looptime) { $returning->locked = false; $returning->locklooped = true; break; } usleep(100); $data_lock = self::$_db->add($cache_id . '_lock', 1, $locktime); $lock_counter++; } } $returning->locked = $data_lock; return $returning; } /** * Unlock cached item - override parent for cacheid compatibility with lock * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise. * * @since 12.1 */ public function unlock($id, $group = null) { $cache_id = $this->_getCacheId($id, $group) . '_lock'; if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } foreach ($index as $key => $value) { if ($value->name == $cache_id) { unset($index[$key]); } break; } self::$_db->replace($this->_hash . '-index', $index, 0); $this->unlockindex(); return self::$_db->delete($cache_id); } /** * Lock cache index * * @return boolean True on success, false otherwise. * * @since 12.1 */ protected function lockindex() { $looptime = 300; $data_lock = self::$_db->add($this->_hash . '-index_lock', 1, 30); if ($data_lock === false) { $lock_counter = 0; // Loop until you find that the lock has been released. that implies that data get from other thread has finished while ($data_lock === false) { if ($lock_counter > $looptime) { return false; break; } usleep(100); $data_lock = self::$_db->add($this->_hash . '-index_lock', 1, 30); $lock_counter++; } } return true; } /** * Unlock cache index * * @return boolean True on success, false otherwise. * * @since 12.1 */ protected function unlockindex() { return self::$_db->delete($this->_hash . '-index_lock'); } } PK���\j��3(3(+libraries/joomla/cache/storage/memcache.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Memcache cache storage handler * * @see http://php.net/manual/en/book.memcache.php * @since 11.1 */ class JCacheStorageMemcache extends JCacheStorage { /** * Memcache connection object * * @var Memcache * @since 11.1 */ protected static $_db = null; /** * Persistent session flag * * @var boolean * @since 11.1 */ protected $_persistent = false; /** * Payload compression level * * @var integer * @since 11.1 */ protected $_compress = 0; /** * Constructor * * @param array $options Optional parameters. * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); if (self::$_db === null) { $this->getConnection(); } } /** * Return memcache connection object * * @return mixed Memcache connection object if present * * @since 11.1 * @throws RuntimeException */ protected function getConnection() { if ((extension_loaded('memcache') && class_exists('Memcache')) != true) { return false; } $config = JFactory::getConfig(); $this->_persistent = $config->get('memcache_persist', true); $this->_compress = $config->get('memcache_compress', false) == false ? 0 : MEMCACHE_COMPRESSED; /* * This will be an array of loveliness * @todo: multiple servers * $servers = (isset($params['servers'])) ? $params['servers'] : array(); */ $server = array(); $server['host'] = $config->get('memcache_server_host', 'localhost'); $server['port'] = $config->get('memcache_server_port', 11211); // Create the memcache connection self::$_db = new Memcache; self::$_db->addServer($server['host'], $server['port'], $this->_persistent); $memcachetest = @self::$_db->connect($server['host'], $server['port']); if ($memcachetest == false) { throw new RuntimeException('Could not connect to memcache server', 404); } // Memcahed has no list keys, we do our own accounting, initialise key index if (self::$_db->get($this->_hash . '-index') === false) { $empty = array(); self::$_db->set($this->_hash . '-index', $empty, $this->_compress, 0); } return; } /** * Get cached data from memcache by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param boolean $checkTime True to verify cache time expiration threshold * * @return mixed Boolean false on failure or a cached data string * * @since 11.1 */ public function get($id, $group, $checkTime = true) { $cache_id = $this->_getCacheId($id, $group); $back = self::$_db->get($cache_id); return $back; } /** * Get all cached data * * @return array data * * @since 11.1 */ public function getAll() { parent::getAll(); $keys = self::$_db->get($this->_hash . '-index'); $secret = $this->_hash; $data = array(); if (!empty($keys)) { foreach ($keys as $key) { if (empty($key)) { continue; } $namearr = explode('-', $key->name); if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') { $group = $namearr[2]; if (!isset($data[$group])) { $item = new JCacheStorageHelper($group); } else { $item = $data[$group]; } $item->updateSize($key->size / 1024); $data[$group] = $item; } } } return $data; } /** * Store the data to memcache by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param string $data The data to store in cache * * @return boolean True on success, false otherwise * * @since 11.1 */ public function store($id, $group, $data) { $cache_id = $this->_getCacheId($id, $group); if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } $tmparr = new stdClass; $tmparr->name = $cache_id; $tmparr->size = strlen($data); $config = JFactory::getConfig(); $lifetime = (int) $config->get('cachetime', 15); if ($this->_lifetime == $lifetime) { $this->_lifetime = $lifetime * 60; } $index[] = $tmparr; self::$_db->replace($this->_hash . '-index', $index, 0, 0); $this->unlockindex(); // Prevent double writes, write only if it doesn't exist else replace if (!self::$_db->replace($cache_id, $data, $this->_compress, $this->_lifetime)) { self::$_db->set($cache_id, $data, $this->_compress, $this->_lifetime); } return true; } /** * Remove a cached data entry by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function remove($id, $group) { $cache_id = $this->_getCacheId($id, $group); if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } foreach ($index as $key => $value) { if ($value->name == $cache_id) { unset($index[$key]); } break; } self::$_db->replace($this->_hash . '-index', $index, 0, 0); $this->unlockindex(); return self::$_db->delete($cache_id); } /** * Clean cache for a group given a mode. * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function clean($group, $mode = null) { if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } $secret = $this->_hash; foreach ($index as $key => $value) { if (strpos($value->name, $secret . '-cache-' . $group . '-') === 0 xor $mode != 'group') { self::$_db->delete($value->name, 0); unset($index[$key]); } } self::$_db->replace($this->_hash . '-index', $index, 0, 0); $this->unlockindex(); return true; } /** * Test to see if the cache storage is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { if ((extension_loaded('memcache') && class_exists('Memcache')) != true) { return false; } $config = JFactory::getConfig(); $host = $config->get('memcache_server_host', 'localhost'); $port = $config->get('memcache_server_port', 11211); $memcache = new Memcache; $memcachetest = @$memcache->connect($host, $port); if (!$memcachetest) { return false; } else { return true; } } /** * Lock cached item - override parent as this is more efficient * * @param string $id The cache data id * @param string $group The cache data group * @param integer $locktime Cached item max lock time * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function lock($id, $group, $locktime) { $returning = new stdClass; $returning->locklooped = false; $looptime = $locktime * 10; $cache_id = $this->_getCacheId($id, $group); if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } $tmparr = new stdClass; $tmparr->name = $cache_id; $tmparr->size = 1; $index[] = $tmparr; self::$_db->replace($this->_hash . '-index', $index, 0, 0); $this->unlockindex(); $data_lock = self::$_db->add($cache_id . '_lock', 1, false, $locktime); if ($data_lock === false) { $lock_counter = 0; // Loop until you find that the lock has been released. // That implies that data get from other thread has finished while ($data_lock === false) { if ($lock_counter > $looptime) { $returning->locked = false; $returning->locklooped = true; break; } usleep(100); $data_lock = self::$_db->add($cache_id . '_lock', 1, false, $locktime); $lock_counter++; } } $returning->locked = $data_lock; return $returning; } /** * Unlock cached item - override parent for cacheid compatibility with lock * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function unlock($id, $group = null) { $cache_id = $this->_getCacheId($id, $group) . '_lock'; if (!$this->lockindex()) { return false; } $index = self::$_db->get($this->_hash . '-index'); if ($index === false) { $index = array(); } foreach ($index as $key => $value) { if ($value->name == $cache_id) { unset($index[$key]); } break; } self::$_db->replace($this->_hash . '-index', $index, 0, 0); $this->unlockindex(); return self::$_db->delete($cache_id); } /** * Lock cache index * * @return boolean True on success, false otherwise. * * @since 11.1 */ protected function lockindex() { $looptime = 300; $data_lock = self::$_db->add($this->_hash . '-index_lock', 1, false, 30); if ($data_lock === false) { $lock_counter = 0; // Loop until you find that the lock has been released. that implies that data get from other thread has finished while ($data_lock === false) { if ($lock_counter > $looptime) { return false; break; } usleep(100); $data_lock = self::$_db->add($this->_hash . '-index_lock', 1, false, 30); $lock_counter++; } } return true; } /** * Unlock cache index * * @return boolean True on success, false otherwise. * * @since 11.1 */ protected function unlockindex() { return self::$_db->delete($this->_hash . '-index_lock'); } } PK���\/�L*��&libraries/joomla/cache/storage/apc.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * APC cache storage handler * * @see http://php.net/manual/en/book.apc.php * @since 11.1 */ class JCacheStorageApc extends JCacheStorage { /** * Get cached data from APC by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param boolean $checkTime True to verify cache time expiration threshold * * @return mixed Boolean False on failure or a cached data string * * @since 11.1 */ public function get($id, $group, $checkTime = true) { $cache_id = $this->_getCacheId($id, $group); return apc_fetch($cache_id); } /** * Get all cached data * * @return array data * * @since 11.1 */ public function getAll() { parent::getAll(); $allinfo = apc_cache_info('user'); $keys = $allinfo['cache_list']; $secret = $this->_hash; $data = array(); foreach ($keys as $key) { $name = $key['info']; $namearr = explode('-', $name); if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') { $group = $namearr[2]; if (!isset($data[$group])) { $item = new JCacheStorageHelper($group); } else { $item = $data[$group]; } $item->updateSize($key['mem_size'] / 1024); $data[$group] = $item; } } return $data; } /** * Store the data to APC by id and group * * @param string $id The cache data id * @param string $group The cache data group * @param string $data The data to store in cache * * @return boolean True on success, false otherwise * * @since 11.1 */ public function store($id, $group, $data) { $cache_id = $this->_getCacheId($id, $group); return apc_store($cache_id, $data, $this->_lifetime); } /** * Remove a cached data entry by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function remove($id, $group) { $cache_id = $this->_getCacheId($id, $group); return apc_delete($cache_id); } /** * Clean cache for a group given a mode. * * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * * @return boolean True on success, false otherwise * * @since 11.1 */ public function clean($group, $mode = null) { $allinfo = apc_cache_info('user'); $keys = $allinfo['cache_list']; $secret = $this->_hash; foreach ($keys as $key) { if (strpos($key['info'], $secret . '-cache-' . $group . '-') === 0 xor $mode != 'group') { apc_delete($key['info']); } } return true; } /** * Force garbage collect expired cache data as items are removed only on fetch! * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc() { $allinfo = apc_cache_info('user'); $keys = $allinfo['cache_list']; $secret = $this->_hash; foreach ($keys as $key) { if (strpos($key['info'], $secret . '-cache-')) { apc_fetch($key['info']); } } } /** * Test to see if the cache storage is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return extension_loaded('apc'); } /** * Lock cached item - override parent as this is more efficient * * @param string $id The cache data id * @param string $group The cache data group * @param integer $locktime Cached item max lock time * * @return object Properties are lock and locklooped * * @since 11.1 */ public function lock($id, $group, $locktime) { $returning = new stdClass; $returning->locklooped = false; $looptime = $locktime * 10; $cache_id = $this->_getCacheId($id, $group) . '_lock'; $data_lock = apc_add($cache_id, 1, $locktime); if ($data_lock === false) { $lock_counter = 0; // Loop until you find that the lock has been released. // That implies that data get from other thread has finished while ($data_lock === false) { if ($lock_counter > $looptime) { $returning->locked = false; $returning->locklooped = true; break; } usleep(100); $data_lock = apc_add($cache_id, 1, $locktime); $lock_counter++; } } $returning->locked = $data_lock; return $returning; } /** * Unlock cached item - override parent for cacheid compatibility with lock * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function unlock($id, $group = null) { $cache_id = $this->_getCacheId($id, $group) . '_lock'; $unlock = apc_delete($cache_id); return $unlock; } } PK���\��2��F�F libraries/joomla/cache/cache.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla! Cache base object * * @since 11.1 */ class JCache { /** * @var object Storage handler * @since 11.1 */ public static $_handler = array(); /** * @var array Options * @since 11.1 */ public $_options; /** * Constructor * * @param array $options options * * @since 11.1 */ public function __construct($options) { $conf = JFactory::getConfig(); $this->_options = array( 'cachebase' => $conf->get('cache_path', JPATH_CACHE), 'lifetime' => (int) $conf->get('cachetime'), 'language' => $conf->get('language', 'en-GB'), 'storage' => $conf->get('cache_handler', ''), 'defaultgroup' => 'default', 'locking' => true, 'locktime' => 15, 'checkTime' => true, 'caching' => ($conf->get('caching') >= 1) ? true : false); // Overwrite default options with given options foreach ($options as $option => $value) { if (isset($options[$option]) && $options[$option] !== '') { $this->_options[$option] = $options[$option]; } } if (empty($this->_options['storage'])) { $this->_options['caching'] = false; } } /** * Returns a reference to a cache adapter object, always creating it * * @param string $type The cache object type to instantiate * @param array $options The array of options * * @return JCache A JCache object * * @since 11.1 */ public static function getInstance($type = 'output', $options = array()) { return JCacheController::getInstance($type, $options); } /** * Get the storage handlers * * @return array An array of available storage handlers * * @since 11.1 */ public static function getStores() { $handlers = array(); // Get an iterator and loop trough the driver classes. $iterator = new DirectoryIterator(__DIR__ . '/storage'); /* @type $file DirectoryIterator */ foreach ($iterator as $file) { $fileName = $file->getFilename(); // Only load for php files. if (!$file->isFile() || $file->getExtension() != 'php' || $fileName == 'helper.php') { continue; } // Derive the class name from the type. $class = str_ireplace('.php', '', 'JCacheStorage' . ucfirst(trim($fileName))); // If the class doesn't exist we have nothing left to do but look at the next type. We did our best. if (!class_exists($class)) { continue; } // Sweet! Our class exists, so now we just need to know if it passes its test method. if ($class::isSupported()) { // Connector names should not have file extensions. $handlers[] = str_ireplace('.php', '', $fileName); } } return $handlers; } /** * Set caching enabled state * * @param boolean $enabled True to enable caching * * @return void * * @since 11.1 */ public function setCaching($enabled) { $this->_options['caching'] = $enabled; } /** * Get caching state * * @return boolean Caching state * * @since 11.1 */ public function getCaching() { return $this->_options['caching']; } /** * Set cache lifetime * * @param integer $lt Cache lifetime * * @return void * * @since 11.1 */ public function setLifeTime($lt) { $this->_options['lifetime'] = $lt; } /** * Get cached data by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return mixed boolean False on failure or a cached data string * * @since 11.1 */ public function get($id, $group = null) { // Get the default group $group = ($group) ? $group : $this->_options['defaultgroup']; // Get the storage $handler = $this->_getStorage(); if (!($handler instanceof Exception) && $this->_options['caching']) { return $handler->get($id, $group, $this->_options['checkTime']); } return false; } /** * Get a list of all cached data * * @return mixed Boolean false on failure or an object with a list of cache groups and data * * @since 11.1 */ public function getAll() { // Get the storage $handler = $this->_getStorage(); if (!($handler instanceof Exception) && $this->_options['caching']) { return $handler->getAll(); } return false; } /** * Store the cached data by id and group * * @param mixed $data The data to store * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True if cache stored * * @since 11.1 */ public function store($data, $id, $group = null) { // Get the default group $group = ($group) ? $group : $this->_options['defaultgroup']; // Get the storage and store the cached data $handler = $this->_getStorage(); if (!($handler instanceof Exception) && $this->_options['caching']) { $handler->_lifetime = $this->_options['lifetime']; return $handler->store($id, $group, $data); } return false; } /** * Remove a cached data entry by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise * * @since 11.1 */ public function remove($id, $group = null) { // Get the default group $group = ($group) ? $group : $this->_options['defaultgroup']; // Get the storage $handler = $this->_getStorage(); if (!($handler instanceof Exception)) { return $handler->remove($id, $group); } return false; } /** * Clean cache for a group given a mode. * * group mode : cleans all cache in the group * notgroup mode : cleans all cache not in the group * * @param string $group The cache data group * @param string $mode The mode for cleaning cache [group|notgroup] * * @return boolean True on success, false otherwise * * @since 11.1 */ public function clean($group = null, $mode = 'group') { // Get the default group $group = ($group) ? $group : $this->_options['defaultgroup']; // Get the storage handler $handler = $this->_getStorage(); if (!($handler instanceof Exception)) { return $handler->clean($group, $mode); } return false; } /** * Garbage collect expired cache data * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc() { // Get the storage handler $handler = $this->_getStorage(); if (!($handler instanceof Exception)) { return $handler->gc(); } return false; } /** * Set lock flag on cached item * * @param string $id The cache data id * @param string $group The cache data group * @param string $locktime The default locktime for locking the cache. * * @return object Properties are lock and locklooped * * @since 11.1 */ public function lock($id, $group = null, $locktime = null) { $returning = new stdClass; $returning->locklooped = false; // Get the default group $group = ($group) ? $group : $this->_options['defaultgroup']; // Get the default locktime $locktime = ($locktime) ? $locktime : $this->_options['locktime']; // Allow storage handlers to perform locking on their own // NOTE drivers with lock need also unlock or unlocking will fail because of false $id $handler = $this->_getStorage(); if (!($handler instanceof Exception) && $this->_options['locking'] == true && $this->_options['caching'] == true) { $locked = $handler->lock($id, $group, $locktime); if ($locked !== false) { return $locked; } } // Fallback $curentlifetime = $this->_options['lifetime']; // Set lifetime to locktime for storing in children $this->_options['lifetime'] = $locktime; $looptime = $locktime * 10; $id2 = $id . '_lock'; if ($this->_options['locking'] == true && $this->_options['caching'] == true) { $data_lock = $this->get($id2, $group); } else { $data_lock = false; $returning->locked = false; } if ($data_lock !== false) { $lock_counter = 0; // Loop until you find that the lock has been released. // That implies that data get from other thread has finished while ($data_lock !== false) { if ($lock_counter > $looptime) { $returning->locked = false; $returning->locklooped = true; break; } usleep(100); $data_lock = $this->get($id2, $group); $lock_counter++; } } if ($this->_options['locking'] == true && $this->_options['caching'] == true) { $returning->locked = $this->store(1, $id2, $group); } // Revert lifetime to previous one $this->_options['lifetime'] = $curentlifetime; return $returning; } /** * Unset lock flag on cached item * * @param string $id The cache data id * @param string $group The cache data group * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function unlock($id, $group = null) { $unlock = false; // Get the default group $group = ($group) ? $group : $this->_options['defaultgroup']; // Allow handlers to perform unlocking on their own $handler = $this->_getStorage(); if (!($handler instanceof Exception) && $this->_options['caching']) { $unlocked = $handler->unlock($id, $group); if ($unlocked !== false) { return $unlocked; } } // Fallback if ($this->_options['caching']) { $unlock = $this->remove($id . '_lock', $group); } return $unlock; } /** * Get the cache storage handler * * @return JCacheStorage A JCacheStorage object * * @since 11.1 */ public function &_getStorage() { $hash = md5(serialize($this->_options)); if (isset(self::$_handler[$hash])) { return self::$_handler[$hash]; } self::$_handler[$hash] = JCacheStorage::getInstance($this->_options['storage'], $this->_options); return self::$_handler[$hash]; } /** * Perform workarounds on retrieved cached data * * @param string $data Cached data * @param array $options Array of options * * @return string Body of cached data * * @since 11.1 */ public static function getWorkarounds($data, $options = array()) { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $body = null; // Get the document head out of the cache. if (isset($options['mergehead']) && $options['mergehead'] == 1 && isset($data['head']) && !empty($data['head'])) { $document->mergeHeadData($data['head']); } elseif (isset($data['head']) && method_exists($document, 'setHeadData')) { $document->setHeadData($data['head']); } // Get the document MIME encoding out of the cache if (isset($data['mime_encoding'])) { $document->setMimeEncoding($data['mime_encoding'], true); } // If the pathway buffer is set in the cache data, get it. if (isset($data['pathway']) && is_array($data['pathway'])) { // Push the pathway data into the pathway object. $pathway = $app->getPathWay(); $pathway->setPathway($data['pathway']); } // @todo check if the following is needed, seems like it should be in page cache // If a module buffer is set in the cache data, get it. if (isset($data['module']) && is_array($data['module'])) { // Iterate through the module positions and push them into the document buffer. foreach ($data['module'] as $name => $contents) { $document->setBuffer($contents, 'module', $name); } } // Set cached headers. if (isset($data['headers']) && $data['headers']) { foreach ($data['headers'] as $header) { $app->setHeader($header['name'], $header['value']); } } // The following code searches for a token in the cached page and replaces it with the // proper token. if (isset($data['body'])) { $token = JSession::getFormToken(); $search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#'; $replacement = '<input type="hidden" name="' . $token . '" value="1" />'; $data['body'] = preg_replace($search, $replacement, $data['body']); $body = $data['body']; } // Get the document body out of the cache. return $body; } /** * Create workarounded data to be cached * * @param string $data Cached data * @param array $options Array of options * * @return string Data to be cached * * @since 11.1 */ public static function setWorkarounds($data, $options = array()) { $loptions = array( 'nopathway' => 0, 'nohead' => 0, 'nomodules' => 0, 'modulemode' => 0, ); if (isset($options['nopathway'])) { $loptions['nopathway'] = $options['nopathway']; } if (isset($options['nohead'])) { $loptions['nohead'] = $options['nohead']; } if (isset($options['nomodules'])) { $loptions['nomodules'] = $options['nomodules']; } if (isset($options['modulemode'])) { $loptions['modulemode'] = $options['modulemode']; } $app = JFactory::getApplication(); $document = JFactory::getDocument(); if ($loptions['nomodules'] != 1) { // Get the modules buffer before component execution. $buffer1 = $document->getBuffer(); if (!is_array($buffer1)) { $buffer1 = array(); } // Make sure the module buffer is an array. if (!isset($buffer1['module']) || !is_array($buffer1['module'])) { $buffer1['module'] = array(); } } // View body data $cached['body'] = $data; // Document head data if ($loptions['nohead'] != 1 && method_exists($document, 'getHeadData')) { if ($loptions['modulemode'] == 1) { $headnow = $document->getHeadData(); $unset = array('title', 'description', 'link', 'links', 'metaTags'); foreach ($unset as $un) { unset($headnow[$un]); unset($options['headerbefore'][$un]); } $cached['head'] = array(); // Only store what this module has added foreach ($headnow as $now => $value) { if (isset($options['headerbefore'][$now])) { // We have to serialize the content of the arrays because the may contain other arrays which is a notice in PHP 5.4 and newer $nowvalue = array_map('serialize', $headnow[$now]); $beforevalue = array_map('serialize', $options['headerbefore'][$now]); $newvalue = array_diff_assoc($nowvalue, $beforevalue); $newvalue = array_map('unserialize', $newvalue); // Special treatment for script and style declarations. if (($now == 'script' || $now == 'style') && is_array($newvalue) && is_array($options['headerbefore'][$now])) { foreach ($newvalue as $type => $currentScriptStr) { if (isset($options['headerbefore'][$now][strtolower($type)])) { $oldScriptStr = $options['headerbefore'][$now][strtolower($type)]; if ($oldScriptStr != $currentScriptStr) { // Save only the appended declaration. $newvalue[strtolower($type)] = JString::substr($currentScriptStr, JString::strlen($oldScriptStr)); } } } } } else { $newvalue = $headnow[$now]; } if (!empty($newvalue)) { $cached['head'][$now] = $newvalue; } } } else { $cached['head'] = $document->getHeadData(); } } // Document MIME encoding $cached['mime_encoding'] = $document->getMimeEncoding(); // Pathway data if ($app->isSite() && $loptions['nopathway'] != 1) { $pathway = $app->getPathWay(); $cached['pathway'] = is_array($data) && isset($data['pathway']) ? $data['pathway'] : $pathway->getPathway(); } if ($loptions['nomodules'] != 1) { // @todo Check if the following is needed, seems like it should be in page cache // Get the module buffer after component execution. $buffer2 = $document->getBuffer(); if (!is_array($buffer2)) { $buffer2 = array(); } // Make sure the module buffer is an array. if (!isset($buffer2['module']) || !is_array($buffer2['module'])) { $buffer2['module'] = array(); } // Compare the second module buffer against the first buffer. $cached['module'] = array_diff_assoc($buffer2['module'], $buffer1['module']); } // Headers data if (isset($options['headers']) && $options['headers']) { $cached['headers'] = $app->getHeaders(); } return $cached; } /** * Create safe id for cached data from url parameters set by plugins and framework * * @return string md5 encoded cacheid * * @since 11.1 */ public static function makeId() { $app = JFactory::getApplication(); $registeredurlparams = new stdClass; // Get url parameters set by plugins if (!empty($app->registeredurlparams)) { $registeredurlparams = $app->registeredurlparams; } // Platform defaults $defaulturlparams = array( 'format' => 'WORD', 'option' => 'WORD', 'view' => 'WORD', 'layout' => 'WORD', 'tpl' => 'CMD', 'id' => 'INT' ); // Use platform defaults if parameter doesn't already exist. foreach ($defaulturlparams as $param => $type) { if (!property_exists($registeredurlparams, $param)) { $registeredurlparams->$param = $type; } } $safeuriaddon = new stdClass; foreach ($registeredurlparams as $key => $value) { $safeuriaddon->$key = $app->input->get($key, null, $value); } return md5(serialize($safeuriaddon)); } /** * Add a directory where JCache should search for handlers. You may * either pass a string or an array of directories. * * @param string $path A path to search. * * @return array An array with directory elements * * @since 11.1 */ public static function addIncludePath($path = '') { static $paths; if (!isset($paths)) { $paths = array(); } if (!empty($path) && !in_array($path, $paths)) { jimport('joomla.filesystem.path'); array_unshift($paths, JPath::clean($path)); } return $paths; } } PK���\�:Ь��%libraries/joomla/cache/controller.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Public cache handler * * @since 11.1 */ class JCacheController { /** * JCache object * * @var JCache * @since 11.1 */ public $cache; /** * Array of options * * @var array * @since 11.1 */ public $options; /** * Constructor * * @param array $options Array of options * * @since 11.1 */ public function __construct($options) { $this->cache = new JCache($options); $this->options = & $this->cache->_options; // Overwrite default options with given options foreach ($options as $option => $value) { if (isset($options[$option])) { $this->options[$option] = $options[$option]; } } } /** * Magic method to proxy JCacheControllerMethods * * @param string $name Name of the function * @param array $arguments Array of arguments for the function * * @return mixed * * @since 11.1 */ public function __call($name, $arguments) { $nazaj = call_user_func_array(array($this->cache, $name), $arguments); return $nazaj; } /** * Returns a reference to a cache adapter object, always creating it * * @param string $type The cache object type to instantiate; default is output. * @param array $options Array of options * * @return JCache A JCache object * * @since 11.1 * @throws RuntimeException */ public static function getInstance($type = 'output', $options = array()) { self::addIncludePath(JPATH_PLATFORM . '/joomla/cache/controller'); $type = strtolower(preg_replace('/[^A-Z0-9_\.-]/i', '', $type)); $class = 'JCacheController' . ucfirst($type); if (!class_exists($class)) { // Search for the class file in the JCache include paths. jimport('joomla.filesystem.path'); if ($path = JPath::find(self::addIncludePath(), strtolower($type) . '.php')) { include_once $path; } else { throw new RuntimeException('Unable to load Cache Controller: ' . $type, 500); } } return new $class($options); } /** * Set caching enabled state * * @param boolean $enabled True to enable caching * * @return void * * @since 11.1 */ public function setCaching($enabled) { $this->cache->setCaching($enabled); } /** * Set cache lifetime * * @param integer $lt Cache lifetime * * @return void * * @since 11.1 */ public function setLifeTime($lt) { $this->cache->setLifeTime($lt); } /** * Add a directory where JCache should search for controllers. You may * either pass a string or an array of directories. * * @param string $path A path to search. * * @return array An array with directory elements * * @since 11.1 */ public static function addIncludePath($path = '') { static $paths; if (!isset($paths)) { $paths = array(); } if (!empty($path) && !in_array($path, $paths)) { jimport('joomla.filesystem.path'); array_unshift($paths, JPath::clean($path)); } return $paths; } /** * Get stored cached data by id and group * * @param string $id The cache data id * @param string $group The cache data group * * @return mixed False on no result, cached object otherwise * * @since 11.1 */ public function get($id, $group = null) { $data = $this->cache->get($id, $group); if ($data === false) { $locktest = new stdClass; $locktest->locked = null; $locktest->locklooped = null; $locktest = $this->cache->lock($id, $group); if ($locktest->locked == true && $locktest->locklooped == true) { $data = $this->cache->get($id, $group); } if ($locktest->locked == true) { $this->cache->unlock($id, $group); } } // Check again because we might get it from second attempt if ($data !== false) { // Trim to fix unserialize errors $data = unserialize(trim($data)); } return $data; } /** * Store data to cache by id and group * * @param mixed $data The data to store * @param string $id The cache data id * @param string $group The cache data group * @param boolean $wrkarounds True to use wrkarounds * * @return boolean True if cache stored * * @since 11.1 */ public function store($data, $id, $group = null, $wrkarounds = true) { $locktest = new stdClass; $locktest->locked = null; $locktest->locklooped = null; $locktest = $this->cache->lock($id, $group); if ($locktest->locked == false && $locktest->locklooped == true) { $locktest = $this->cache->lock($id, $group); } $sucess = $this->cache->store(serialize($data), $id, $group); if ($locktest->locked == true) { $this->cache->unlock($id, $group); } return $sucess; } } PK���\D;)_�"�""libraries/joomla/linkedin/jobs.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Linkedin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Linkedin API Jobs class for the Joomla Platform. * * @since 13.1 */ class JLinkedinJobs extends JLinkedinObject { /** * Method to retrieve detailed information about a job. * * @param integer $id The unique identifier for a job. * @param string $fields Request fields beyond the default ones. * * @return array The decoded JSON response * * @since 13.1 */ public function getJob($id, $fields = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/jobs/' . $id; // Set request parameters. $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to get a list of bookmarked jobs for the current member. * * @param string $fields Request fields beyond the default ones. * * @return array The decoded JSON response * * @since 13.1 */ public function getBookmarked($fields = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/~/job-bookmarks'; // Set request parameters. $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to bookmark a job to the current user's account. * * @param integer $id The unique identifier for a job. * * @return array The decoded JSON response * * @since 13.1 */ public function bookmark($id) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base $base = '/v1/people/~/job-bookmarks'; // Build xml. $xml = '<job-bookmark><job><id>' . $id . '</id></job></job-bookmark>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } /** * Method to delete a bookmark. * * @param integer $id The unique identifier for a job. * * @return array The decoded JSON response * * @since 13.1 */ public function deleteBookmark($id) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/people/~/job-bookmarks/' . $id; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'DELETE', $parameters); return $response; } /** * Method to retrieve job suggestions for the current user. * * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * * @return array The decoded JSON response * * @since 13.1 */ public function getSuggested($fields = null, $start = 0, $count = 0) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/~/suggestions/job-suggestions'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to search across LinkedIn's job postings. * * @param string $fields Request fields beyond the default ones. * @param string $keywords Members who have all the keywords anywhere in their profile. * @param string $company_name Jobs with a matching company name. * @param string $job_title Matches jobs with the same job title. * @param string $country_code Matches members with a location in a specific country. Values are defined in by ISO 3166 standard. * Country codes must be in all lower case. * @param integer $postal_code Matches members centered around a Postal Code. Must be combined with the country-code parameter. * Not supported for all countries. * @param integer $distance Matches members within a distance from a central point. This is measured in miles. * @param string $facets Facet buckets to return, e.g. location. * @param array $facet Array of facet values to search over. Contains values for company, date-posted, location, job-function, * industry, and salary, in exactly this order, null must be specified for an element if no value. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * @param string $sort Controls the search result order. There are four options: R (relationship), DA (date-posted-asc), * DD (date-posted-desc). * * @return array The decoded JSON response * * @since 13.1 */ public function search($fields = null, $keywords = null, $company_name = null, $job_title = null, $country_code = null, $postal_code = null, $distance = null, $facets = null, $facet = null, $start = 0, $count = 0, $sort = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/job-search'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if keywords is specified. if ($keywords) { $data['keywords'] = $keywords; } // Check if company-name is specified. if ($company_name) { $data['company-name'] = $company_name; } // Check if job-title is specified. if ($job_title) { $data['job-title'] = $job_title; } // Check if country_code is specified. if ($country_code) { $data['country-code'] = $country_code; } // Check if postal_code is specified. if ($postal_code) { $data['postal-code'] = $postal_code; } // Check if distance is specified. if ($distance) { $data['distance'] = $distance; } // Check if facets is specified. if ($facets) { $data['facets'] = $facets; } // Check if facet is specified. if ($facet) { $data['facet'] = array(); for ($i = 0; $i < count($facet); $i++) { if ($facet[$i]) { if ($i == 0) { $data['facet'][] = 'company,' . $this->oauth->safeEncode($facet[$i]); } if ($i == 1) { $data['facet'][] = 'date-posted,' . $facet[$i]; } if ($i == 2) { $data['facet'][] = 'location,' . $facet[$i]; } if ($i == 3) { $data['facet'][] = 'job-function,' . $this->oauth->safeEncode($facet[$i]); } if ($i == 4) { $data['facet'][] = 'industry,' . $facet[$i]; } if ($i == 5) { $data['facet'][] = 'salary,' . $facet[$i]; } } } } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Check if sort is specified. if ($sort) { $data['sort'] = $sort; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } } PK���\�Ej+j+'libraries/joomla/linkedin/companies.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Linkedin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Linkedin API Companies class for the Joomla Platform. * * @since 13.1 */ class JLinkedinCompanies extends JLinkedinObject { /** * Method to retrieve companies using a company ID, a universal name, or an email domain. * * @param integer $id The unique internal numeric company identifier. * @param string $name The unique string identifier for a company. * @param string $domain Company email domains. * @param string $fields Request fields beyond the default ones. * * @return array The decoded JSON response * * @since 13.1 * @throws RuntimeException */ public function getCompanies($id = null, $name = null, $domain = null, $fields = null) { // At least one value is needed to retrieve data. if ($id == null && $name == null && $domain == null) { // We don't have a valid entry throw new RuntimeException('You must specify a company ID, a universal name, or an email domain.'); } $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/companies'; if ($id && $name) { $base .= '::(' . $id . ',universal-name=' . $name . ')'; } elseif ($id) { $base .= '/' . $id; } elseif ($name) { $base .= '/universal-name=' . $name; } // Set request parameters. $data['format'] = 'json'; if ($domain) { $data['email-domain'] = $domain; } // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to read shares for a particular company . * * @param string $id The unique company identifier. * @param string $type Any valid Company Update Type from the table: https://developer.linkedin.com/reading-company-updates. * @param integer $count Maximum number of updates to return. * @param integer $start The offset by which to start Network Update pagination. * * @return array The decoded JSON response * * @since 13.1 */ public function getUpdates($id, $type = null, $count = 0, $start = 0) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/companies/' . $id . '/updates'; // Set request parameters. $data['format'] = 'json'; // Check if type is specified. if ($type) { $data['event-type'] = $type; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to search across company pages. * * @param string $fields Request fields beyond the default ones. * @param string $keywords Members who have all the keywords anywhere in their profile. * @param boolean $hq Matching companies by the headquarters location. When this is set to "true" and a location facet is used, * this restricts returned companies to only those whose headquarters resides in the specified location. * @param string $facets Facet buckets to return, e.g. location. * @param array $facet Array of facet values to search over. Contains values for location, industry, network, company-size, * num-followers-range and fortune, in exactly this order, null must be specified for an element if no value. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * @param string $sort Controls the search result order. There are four options: relevance, relationship, * followers and company-size. * * @return array The decoded JSON response * * @since 13.1 */ public function search($fields = null, $keywords = null, $hq = false, $facets = null, $facet = null, $start = 0, $count = 0, $sort = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/company-search'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if keywords is specified. if ($keywords) { $data['keywords'] = $keywords; } // Check if hq is true. if ($hq) { $data['hq-only'] = $hq; } // Check if facets is specified. if ($facets) { $data['facets'] = $facets; } // Check if facet is specified. if ($facet) { $data['facet'] = array(); for ($i = 0; $i < count($facet); $i++) { if ($facet[$i]) { if ($i == 0) { $data['facet'][] = 'location,' . $facet[$i]; } if ($i == 1) { $data['facet'][] = 'industry,' . $facet[$i]; } if ($i == 2) { $data['facet'][] = 'network,' . $facet[$i]; } if ($i == 3) { $data['facet'][] = 'company-size,' . $facet[$i]; } if ($i == 4) { $data['facet'][] = 'num-followers-range,' . $facet[$i]; } if ($i == 5) { $data['facet'][] = 'fortune,' . $facet[$i]; } } } } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Check if sort is specified. if ($sort) { $data['sort'] = $sort; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to get a list of companies the current member is following. * * @param string $fields Request fields beyond the default ones. * * @return array The decoded JSON response * * @since 13.1 */ public function getFollowed($fields = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/~/following/companies'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to follow a company. * * @param string $id The unique identifier for a company. * * @return array The decoded JSON response * * @since 13.1 */ public function follow($id) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base $base = '/v1/people/~/following/companies'; // Build xml. $xml = '<company><id>' . $id . '</id></company>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } /** * Method to unfollow a company. * * @param string $id The unique identifier for a company. * * @return array The decoded JSON response * * @since 13.1 */ public function unfollow($id) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/people/~/following/companies/id=' . $id; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'DELETE', $parameters); return $response; } /** * Method to get a collection of suggested companies for the current user. * * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * * @return array The decoded JSON response * * @since 13.1 */ public function getSuggested($fields = null, $start = 0, $count = 0) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/~/suggestions/to-follow/companies'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to get a collection of suggested companies for the current user. * * @param string $id The unique identifier for a company. * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * * @return array The decoded JSON response * * @since 13.1 */ public function getProducts($id, $fields = null, $start = 0, $count = 0) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/companies/' . $id . '/products'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } } PK���\� igig$libraries/joomla/linkedin/groups.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Linkedin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Linkedin API Groups class for the Joomla Platform. * * @since 13.1 */ class JLinkedinGroups extends JLinkedinObject { /** * Method to get a group. * * @param string $id The unique identifier for a group. * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * * @return array The decoded JSON response * * @since 13.1 */ public function getGroup($id, $fields = null, $start = 0, $count = 5) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/groups/' . $id; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count != 5) { $data['count'] = $count; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to find the groups a member belongs to. * * @param string $id The unique identifier for a user. * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * @param string $membership_state The state of the caller’s membership to the specified group. * Values are: non-member, awaiting-confirmation, awaiting-parent-group-confirmation, member, moderator, manager, owner. * * @return array The decoded JSON response * * @since 13.1 */ public function getMemberships($id = null, $fields = null, $start = 0, $count = 5, $membership_state = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/'; // Check if id is specified. if ($id) { $base .= $id . '/group-memberships'; } else { $base .= '~/group-memberships'; } $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count != 5) { $data['count'] = $count; } // Check if membership_state is specified. if ($membership_state) { $data['membership-state'] = $membership_state; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to find the groups a member belongs to. * * @param string $person_id The unique identifier for a user. * @param string $group_id The unique identifier for a group. * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * * @return array The decoded JSON response * * @since 13.1 */ public function getSettings($person_id = null, $group_id = null, $fields = null, $start = 0, $count = 5) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/'; // Check if person_id is specified. if ($person_id) { $base .= $person_id . '/group-memberships'; } else { $base .= '~/group-memberships'; } // Check if group_id is specified. if ($group_id) { $base .= '/' . $group_id; } $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count != 5) { $data['count'] = $count; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to change a groups settings. * * @param string $group_id The unique identifier for a group. * @param boolean $show_logo Show group logo in profile. * @param string $digest_frequency E-mail digest frequency. * @param boolean $announcements E-mail announcements from managers. * @param boolean $allow_messages Allow messages from members. * @param boolean $new_post E-mail for every new post. * * @return array The decoded JSON response * * @since 13.1 */ public function changeSettings($group_id, $show_logo = null, $digest_frequency = null, $announcements = null, $allow_messages = null, $new_post = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/~/group-memberships/' . $group_id; // Build xml. $xml = '<group-membership>'; if (!is_null($show_logo)) { $xml .= '<show-group-logo-in-profile>' . $this->booleanToString($show_logo) . '</show-group-logo-in-profile>'; } if ($digest_frequency) { $xml .= '<email-digest-frequency><code>' . $digest_frequency . '</code></email-digest-frequency>'; } if (!is_null($announcements)) { $xml .= '<email-announcements-from-managers>' . $this->booleanToString($announcements) . '</email-announcements-from-managers>'; } if (!is_null($allow_messages)) { $xml .= '<allow-messages-from-members>' . $this->booleanToString($allow_messages) . '</allow-messages-from-members>'; } if (!is_null($new_post)) { $xml .= '<email-for-every-new-post>' . $this->booleanToString($new_post) . '</email-for-every-new-post>'; } $xml .= '</group-membership>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response; } /** * Method to join a group. * * @param string $group_id The unique identifier for a group. * @param boolean $show_logo Show group logo in profile. * @param string $digest_frequency E-mail digest frequency. * @param boolean $announcements E-mail announcements from managers. * @param boolean $allow_messages Allow messages from members. * @param boolean $new_post E-mail for every new post. * * @return array The decoded JSON response * * @since 13.1 */ public function joinGroup($group_id, $show_logo = null, $digest_frequency = null, $announcements = null, $allow_messages = null, $new_post = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base $base = '/v1/people/~/group-memberships'; // Build xml. $xml = '<group-membership><group><id>' . $group_id . '</id></group>'; if (!is_null($show_logo)) { $xml .= '<show-group-logo-in-profile>' . $this->booleanToString($show_logo) . '</show-group-logo-in-profile>'; } if ($digest_frequency) { $xml .= '<email-digest-frequency><code>' . $digest_frequency . '</code></email-digest-frequency>'; } if (!is_null($announcements)) { $xml .= '<email-announcements-from-managers>' . $this->booleanToString($announcements) . '</email-announcements-from-managers>'; } if (!is_null($allow_messages)) { $xml .= '<allow-messages-from-members>' . $this->booleanToString($allow_messages) . '</allow-messages-from-members>'; } if (!is_null($new_post)) { $xml .= '<email-for-every-new-post>' . $this->booleanToString($new_post) . '</email-for-every-new-post>'; } $xml .= '<membership-state><code>member</code></membership-state></group-membership>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } /** * Method to leave a group. * * @param string $group_id The unique identifier for a group. * * @return array The decoded JSON response * * @since 13.1 */ public function leaveGroup($group_id) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/people/~/group-memberships/' . $group_id; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'DELETE', $parameters); return $response; } /** * Method to get dicussions for a group. * * @param string $id The unique identifier for a group. * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * @param string $order Sort order for posts. Valid for: recency, popularity. * @param string $category Category of posts. Valid for: discussion * @param string $modified_since Timestamp filter for posts created after the specified value. * * @return array The decoded JSON response * * @since 13.1 */ public function getDiscussions($id, $fields = null, $start = 0, $count = 0, $order = null, $category = 'discussion', $modified_since = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/groups/' . $id . '/posts'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Check if order is specified. if ($order) { $data['order'] = $order; } // Check if category is specified. if ($category) { $data['category'] = $category; } // Check if modified_since is specified. if ($modified_since) { $data['modified-since'] = $modified_since; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to get posts a user started / participated in / follows for a group. * * @param string $group_id The unique identifier for a group. * @param string $role Filter for posts related to the caller. Valid for: creator, commenter, follower. * @param string $person_id The unique identifier for a user. * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * @param string $order Sort order for posts. Valid for: recency, popularity. * @param string $category Category of posts. Valid for: discussion * @param string $modified_since Timestamp filter for posts created after the specified value. * * @return array The decoded JSON response * * @since 13.1 */ public function getUserPosts($group_id, $role, $person_id = null, $fields = null, $start = 0, $count = 0, $order = null, $category = 'discussion', $modified_since = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/'; // Check if person_id is specified. if ($person_id) { $base .= $person_id; } else { $base .= '~'; } $base .= '/group-memberships/' . $group_id . '/posts'; $data['format'] = 'json'; $data['role'] = $role; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Check if order is specified. if ($order) { $data['order'] = $order; } // Check if category is specified. if ($category) { $data['category'] = $category; } // Check if modified_since is specified. if ($modified_since) { $data['modified-since'] = $modified_since; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to retrieve details about a post. * * @param string $post_id The unique identifier for a post. * @param string $fields Request fields beyond the default ones. * * @return array The decoded JSON response * * @since 13.1 */ public function getPost($post_id, $fields = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/posts/' . $post_id; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to retrieve all comments of a post. * * @param string $post_id The unique identifier for a post. * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * * @return array The decoded JSON response * * @since 13.1 */ public function getPostComments($post_id, $fields = null, $start = 0, $count = 0) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/posts/' . $post_id . '/comments'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to retrieve all comments of a post. * * @param string $group_id The unique identifier for a group. * @param string $title Post title. * @param string $summary Post summary. * * @return string The created post's id. * * @since 13.1 */ public function createPost($group_id, $title, $summary) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base $base = '/v1/groups/' . $group_id . '/posts'; // Build xml. $xml = '<post><title>' . $title . '</title><summary>' . $summary . '</summary></post>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); // Return the post id. $response = explode('posts/', $response->headers['Location']); return $response[1]; } /** * Method to like or unlike a post. * * @param string $post_id The unique identifier for a group. * @param boolean $like True to like post, false otherwise. * * @return array The decoded JSON response * * @since 13.1 */ private function _likeUnlike($post_id, $like) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/posts/' . $post_id . '/relation-to-viewer/is-liked'; // Build xml. $xml = '<is-liked>' . $this->booleanToString($like) . '</is-liked>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response; } /** * Method used to like a post. * * @param string $post_id The unique identifier for a group. * * @return array The decoded JSON response * * @since 13.1 */ public function likePost($post_id) { return $this->_likeUnlike($post_id, true); } /** * Method used to unlike a post. * * @param string $post_id The unique identifier for a group. * * @return array The decoded JSON response * * @since 13.1 */ public function unlikePost($post_id) { return $this->_likeUnlike($post_id, false); } /** * Method to follow or unfollow a post. * * @param string $post_id The unique identifier for a group. * @param boolean $follow True to like post, false otherwise. * * @return array The decoded JSON response * * @since 13.1 */ private function _followUnfollow($post_id, $follow) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/posts/' . $post_id . '/relation-to-viewer/is-following'; // Build xml. $xml = '<is-following>' . $this->booleanToString($follow) . '</is-following>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response; } /** * Method used to follow a post. * * @param string $post_id The unique identifier for a group. * * @return array The decoded JSON response * * @since 13.1 */ public function followPost($post_id) { return $this->_followUnfollow($post_id, true); } /** * Method used to unfollow a post. * * @param string $post_id The unique identifier for a group. * * @return array The decoded JSON response * * @since 13.1 */ public function unfollowPost($post_id) { return $this->_followUnfollow($post_id, false); } /** * Method to flag a post as a Promotion or Job. * * @param string $post_id The unique identifier for a group. * @param string $flag Flag as a 'promotion' or 'job'. * * @return array The decoded JSON response * * @since 13.1 */ public function flagPost($post_id, $flag) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/posts/' . $post_id . '/category/code'; // Build xml. $xml = '<code>' . $flag . '</code>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response; } /** * Method to delete a post if the current user is the creator or flag it as inappropriate otherwise. * * @param string $post_id The unique identifier for a group. * * @return array The decoded JSON response * * @since 13.1 */ public function deletePost($post_id) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/posts/' . $post_id; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'DELETE', $parameters); return $response; } /** * Method to access the comments resource. * * @param string $comment_id The unique identifier for a comment. * @param string $fields Request fields beyond the default ones. * * @return array The decoded JSON response * * @since 13.1 */ public function getComment($comment_id, $fields = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/comments/' . $comment_id; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to add a comment to a post * * @param string $post_id The unique identifier for a group. * @param string $comment The post comment's text. * * @return string The created comment's id. * * @since 13.1 */ public function addComment($post_id, $comment) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base $base = '/v1/posts/' . $post_id . '/comments'; // Build xml. $xml = '<comment><text>' . $comment . '</text></comment>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); // Return the comment id. $response = explode('comments/', $response->headers['Location']); return $response[1]; } /** * Method to delete a comment if the current user is the creator or flag it as inappropriate otherwise. * * @param string $comment_id The unique identifier for a group. * * @return array The decoded JSON response * * @since 13.1 */ public function deleteComment($comment_id) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/comments/' . $comment_id; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'DELETE', $parameters); return $response; } /** * Method to get suggested groups for a user. * * @param string $person_id The unique identifier for a user. * @param string $fields Request fields beyond the default ones. * * @return array The decoded JSON response * * @since 13.1 */ public function getSuggested($person_id = null, $fields = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/'; // Check if person_id is specified. if ($person_id) { $base .= $person_id . '/suggestions/groups'; } else { $base .= '~/suggestions/groups'; } $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to delete a group suggestion for a user. * * @param string $suggestion_id The unique identifier for a suggestion. * @param string $person_id The unique identifier for a user. * * @return array The decoded JSON response * * @since 13.1 */ public function deleteSuggestion($suggestion_id, $person_id = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/people/'; // Check if person_id is specified. if ($person_id) { $base .= $person_id . '/suggestions/groups/' . $suggestion_id; } else { $base .= '~/suggestions/groups/' . $suggestion_id; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'DELETE', $parameters); return $response; } } PK���\aeٛ99$libraries/joomla/linkedin/stream.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Linkedin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Linkedin API Social Stream class for the Joomla Platform. * * @since 13.1 */ class JLinkedinStream extends JLinkedinObject { /** * Method to add a new share. Note: post must contain comment and/or (title and url). * * @param string $visibility One of anyone: all members or connections-only: connections only. * @param string $comment Text of member's comment. * @param string $title Title of shared document. * @param string $url URL for shared content. * @param string $image URL for image of shared content. * @param string $description Description of shared content. * @param boolean $twitter True to have LinkedIn pass the status message along to a member's tethered Twitter account. * * @return array The decoded JSON response * * @since 13.1 * @throws RuntimeException */ public function share($visibility, $comment = null, $title = null, $url = null, $image = null, $description = null, $twitter = false) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base $base = '/v1/people/~/shares'; // Check if twitter is true. if ($twitter) { $base .= '?twitter-post=true'; } // Build xml. $xml = '<share> <visibility> <code>' . $visibility . '</code> </visibility>'; // Check if comment specified. if ($comment) { $xml .= '<comment>' . $comment . '</comment>'; } // Check if title and url are specified. if ($title && $url) { $xml .= '<content> <title>' . $title . '</title> <submitted-url>' . $url . '</submitted-url>'; // Check if image is specified. if ($image) { $xml .= '<submitted-image-url>' . $image . '</submitted-image-url>'; } // Check if descrption id specified. if ($description) { $xml .= '<description>' . $description . '</description>'; } $xml .= '</content>'; } elseif (!$comment) { throw new RuntimeException('Post must contain comment and/or (title and url).'); } $xml .= '</share>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } /** * Method to reshare an existing share. * * @param string $visibility One of anyone: all members or connections-only: connections only. * @param string $id The unique identifier for a share. * @param string $comment Text of member's comment. * @param boolean $twitter True to have LinkedIn pass the status message along to a member's tethered Twitter account. * * @return array The decoded JSON response * * @since 13.1 * @throws RuntimeException */ public function reshare($visibility, $id, $comment = null, $twitter = false) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base $base = '/v1/people/~/shares'; // Check if twitter is true. if ($twitter) { $base .= '?twitter-post=true'; } // Build xml. $xml = '<share> <visibility> <code>' . $visibility . '</code> </visibility>'; // Check if comment specified. if ($comment) { $xml .= '<comment>' . $comment . '</comment>'; } $xml .= ' <attribution> <share> <id>' . $id . '</id> </share> </attribution> </share>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } /** * Method to get a particular member's current share. * * @param string $id Member id of the profile you want. * @param string $url The public profile URL. * * @return array The decoded JSON response * * @since 13.1 */ public function getCurrentShare($id = null, $url = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/'; // Check if a member id is specified. if ($id) { $base .= 'id=' . $id; } elseif (!$url) { $base .= '~'; } // Check if profile url is specified. if ($url) { $base .= 'url=' . $this->oauth->safeEncode($url); } $base .= ':(current-share)'; // Set request parameters. $data['format'] = 'json'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to get a particular member's current share. * * @param string $id Member id of the profile you want. * @param string $url The public profile URL. * @param boolean $self Used to return member's feed. Omitted to return aggregated network feed. * * @return array The decoded JSON response * * @since 13.1 */ public function getShareStream($id = null, $url = null, $self = true) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/'; // Check if a member id is specified. if ($id) { $base .= $id; } elseif (!$url) { $base .= '~'; } // Check if profile url is specified. if ($url) { $base .= 'url=' . $this->oauth->safeEncode($url); } $base .= '/network'; // Set request parameters. $data['format'] = 'json'; $data['type'] = 'SHAR'; // Check if self is true if ($self) { $data['scope'] = 'self'; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to get the users network updates. * * @param string $id Member id. * @param boolean $self Used to return member's feed. Omitted to return aggregated network feed. * @param mixed $type String containing any valid Network Update Type from the table or an array of strings * to specify more than one Network Update type. * @param integer $count Number of updates to return, with a maximum of 250. * @param integer $start The offset by which to start Network Update pagination. * @param string $after Timestamp after which to retrieve updates. * @param string $before Timestamp before which to retrieve updates. * @param boolean $hidden Whether to display updates from people the member has chosen to "hide" from their update stream. * * @return array The decoded JSON response * * @since 13.1 */ public function getNetworkUpdates($id = null, $self = true, $type = null, $count = 0, $start = 0, $after = null, $before = null, $hidden = false) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/'; // Check if a member id is specified. if ($id) { $base .= $id; } else { $base .= '~'; } $base .= '/network/updates'; // Set request parameters. $data['format'] = 'json'; // Check if self is true. if ($self) { $data['scope'] = 'self'; } // Check if type is specified. if ($type) { $data['type'] = $type; } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if after is specified. if ($after) { $data['after'] = $after; } // Check if before is specified. if ($before > 0) { $data['before'] = $before; } // Check if hidden is true. if ($hidden) { $data['hidden'] = $hidden; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to get information about the current member's network. * * @return array The decoded JSON response * * @since 13.1 */ public function getNetworkStats() { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/~/network/network-stats'; // Set request parameters. $data['format'] = 'json'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to get the users network updates. * * @param string $body The actual content of the update. You can use HTML to include links to the user name and the content the user * created. Other HTML tags are not supported. All body text should be HTML entity escaped and UTF-8 compliant. * * @return array The decoded JSON response * * @since 13.1 */ public function postNetworkUpdate($body) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base $base = '/v1/people/~/person-activities'; // Build the xml. $xml = '<activity locale="en_US"> <content-type>linkedin-html</content-type> <body>' . $body . '</body> </activity>'; $header['Content-Type'] = 'text/xml'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } /** * Method to retrieve all comments for a given network update. * * @param string $key update/update-key representing an update. * * @return array The decoded JSON response * * @since 13.1 */ public function getComments($key) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/~/network/updates/key=' . $key . '/update-comments'; // Set request parameters. $data['format'] = 'json'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to post a new comment to an existing update. * * @param string $key update/update-key representing an update. * @param string $comment Maximum length of 700 characters * * @return array The decoded JSON response * * @since 13.1 */ public function postComment($key, $comment) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base $base = '/v1/people/~/network/updates/key=' . $key . '/update-comments'; // Build the xml. $xml = '<update-comment> <comment>' . $comment . '</comment> </update-comment>'; $header['Content-Type'] = 'text/xml'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } /** * Method to retrieve the complete list of people who liked an update. * * @param string $key update/update-key representing an update. * * @return array The decoded JSON response * * @since 13.1 */ public function getLikes($key) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/~/network/updates/key=' . $key . '/likes'; // Set request parameters. $data['format'] = 'json'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to like or unlike an update. * * @param string $key Update/update-key representing an update. * @param boolean $like True to like update, false otherwise. * * @return array The decoded JSON response * * @since 13.1 */ private function _likeUnlike($key, $like) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 204); // Set the API base $base = '/v1/people/~/network/updates/key=' . $key . '/is-liked'; // Build xml. $xml = '<is-liked>' . $this->booleanToString($like) . '</is-liked>'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response; } /** * Method used to like an update. * * @param string $key Update/update-key representing an update. * * @return array The decoded JSON response * * @since 13.1 */ public function like($key) { return $this->_likeUnlike($key, true); } /** * Method used to unlike an update. * * @param string $key Update/update-key representing an update. * * @return array The decoded JSON response * * @since 13.1 */ public function unlike($key) { return $this->_likeUnlike($key, false); } } PK���\ *����$libraries/joomla/linkedin/object.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Linkedin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Linkedin API object class for the Joomla Platform. * * @since 13.1 */ abstract class JLinkedinObject { /** * @var Registry Options for the Linkedin object. * @since 13.1 */ protected $options; /** * @var JHttp The HTTP client object to use in sending HTTP requests. * @since 13.1 */ protected $client; /** * @var JLinkedinOAuth The OAuth client. * @since 13.1 */ protected $oauth; /** * Constructor. * * @param Registry $options Linkedin options object. * @param JHttp $client The HTTP client object. * @param JLinkedinOAuth $oauth The OAuth client. * * @since 13.1 */ public function __construct(Registry $options = null, JHttp $client = null, JLinkedinOAuth $oauth = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JHttp($this->options); $this->oauth = $oauth; } /** * Method to convert boolean to string. * * @param boolean $bool The boolean value to convert. * * @return string String with the converted boolean. * * @since 13.1 */ public function booleanToString($bool) { if ($bool) { return 'true'; } else { return 'false'; } } /** * Get an option from the JLinkedinObject instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 13.1 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JLinkedinObject instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JLinkedinObject This object for method chaining. * * @since 13.1 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\gK����,libraries/joomla/linkedin/communications.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Linkedin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Linkedin API Social Communications class for the Joomla Platform. * * @since 13.1 */ class JLinkedinCommunications extends JLinkedinObject { /** * Method used to invite people. * * @param string $email A string containing email of the recipient. * @param string $first_name A string containing frist name of the recipient. * @param string $last_name A string containing last name of the recipient. * @param string $subject The subject of the message that will be sent to the recipient * @param string $body A text of the message. * @param string $connection Only connecting as a 'friend' is supported presently. * * @return array The decoded JSON response * * @since 13.1 */ public function inviteByEmail($email, $first_name, $last_name, $subject, $body, $connection = 'friend') { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base. $base = '/v1/people/~/mailbox'; // Build the xml. $xml = '<mailbox-item> <recipients> <recipient> <person path="/people/email=' . $email . '"> <first-name>' . $first_name . '</first-name> <last-name>' . $last_name . '</last-name> </person> </recipient> </recipients> <subject>' . $subject . '</subject> <body>' . $body . '</body> <item-content> <invitation-request> <connect-type>' . $connection . '</connect-type> </invitation-request> </item-content> </mailbox-item>'; $header['Content-Type'] = 'text/xml'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } /** * Method used to invite people. * * @param string $id Member id. * @param string $first_name A string containing frist name of the recipient. * @param string $last_name A string containing last name of the recipient. * @param string $subject The subject of the message that will be sent to the recipient * @param string $body A text of the message. * @param string $connection Only connecting as a 'friend' is supported presently. * * @return array The decoded JSON response * * @since 13.1 */ public function inviteById($id, $first_name, $last_name, $subject, $body, $connection = 'friend') { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base for people search. $base = '/v1/people-search:(people:(api-standard-profile-request))'; $data['format'] = 'json'; $data['first-name'] = $first_name; $data['last-name'] = $last_name; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); if (strpos($response->body, 'apiStandardProfileRequest') === false) { throw new RuntimeException($response->body); } // Get header value. $value = explode('"value": "', $response->body); $value = explode('"', $value[1]); $value = $value[0]; // Split on the colon character. $value = explode(':', $value); $name = $value[0]; $value = $value[1]; // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base. $base = '/v1/people/~/mailbox'; // Build the xml. $xml = '<mailbox-item> <recipients> <recipient> <person path="/people/id=' . $id . '"> </person> </recipient> </recipients> <subject>' . $subject . '</subject> <body>' . $body . '</body> <item-content> <invitation-request> <connect-type>' . $connection . '</connect-type> <authorization> <name>' . $name . '</name> <value>' . $value . '</value> </authorization> </invitation-request> </item-content> </mailbox-item>'; $header['Content-Type'] = 'text/xml'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } /** * Method used to send messages via LinkedIn between two or more individuals connected to the member sending the message.. * * @param mixed $recipient A string containing the member id or an array of ids. * @param string $subject The subject of the message that will be sent to the recipient * @param string $body A text of the message. * * @return array The decoded JSON response * * @since 13.1 */ public function sendMessage($recipient, $subject, $body) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the success response code. $this->oauth->setOption('success_code', 201); // Set the API base. $base = '/v1/people/~/mailbox'; // Build the xml. $xml = '<mailbox-item> <recipients>'; if (is_array($recipient)) { foreach ($recipient as $r) { $xml .= '<recipient> <person path="/people/' . $r . '"/> </recipient>'; } } $xml .= '</recipients> <subject>' . $subject . '</subject> <body>' . $body . '</body> </mailbox-item>'; $header['Content-Type'] = 'text/xml'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); return $response; } } PK���\�qF��&libraries/joomla/linkedin/linkedin.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Linkedin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Joomla Platform class for interacting with a Linkedin API instance. * * @since 13.1 */ class JLinkedin { /** * @var Registry Options for the Linkedin object. * @since 13.1 */ protected $options; /** * @var JHttp The HTTP client object to use in sending HTTP requests. * @since 13.1 */ protected $client; /** * @var JLinkedinOAuth The OAuth client. * @since 13.1 */ protected $oauth; /** * @var JLinkedinPeople Linkedin API object for people. * @since 13.1 */ protected $people; /** * @var JLinkedinGroups Linkedin API object for groups. * @since 13.1 */ protected $groups; /** * @var JLinkedinCompanies Linkedin API object for companies. * @since 13.1 */ protected $companies; /** * @var JLinkedinJobs Linkedin API object for jobs. * @since 13.1 */ protected $jobs; /** * @var JLinkedinStream Linkedin API object for social stream. * @since 13.1 */ protected $stream; /** * @var JLinkedinCommunications Linkedin API object for communications. * @since 13.1 */ protected $communications; /** * Constructor. * * @param JLinkedinOauth $oauth OAuth object * @param Registry $options Linkedin options object. * @param JHttp $client The HTTP client object. * * @since 13.1 */ public function __construct(JLinkedinOauth $oauth = null, Registry $options = null, JHttp $client = null) { $this->oauth = $oauth; $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JHttp($this->options); // Setup the default API url if not already set. $this->options->def('api.url', 'https://api.linkedin.com'); } /** * Magic method to lazily create API objects * * @param string $name Name of property to retrieve * * @return JLinkedinObject Linkedin API object (statuses, users, favorites, etc.). * * @since 13.1 * @throws InvalidArgumentException */ public function __get($name) { $class = 'JLinkedin' . ucfirst($name); if (class_exists($class)) { if (false == isset($this->$name)) { $this->$name = new $class($this->options, $this->client, $this->oauth); } return $this->$name; } throw new InvalidArgumentException(sprintf('Argument %s produced an invalid class name: %s', $name, $class)); } /** * Get an option from the JLinkedin instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 13.1 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the Linkedin instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JLinkedin This object for method chaining. * * @since 13.1 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\��OA A #libraries/joomla/linkedin/oauth.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Linkedin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Joomla Platform class for generating Linkedin API access token. * * @since 13.1 */ class JLinkedinOauth extends JOAuth1Client { /** * @var Registry Options for the JLinkedinOauth object. * @since 13.1 */ protected $options; /** * Constructor. * * @param Registry $options JLinkedinOauth options object. * @param JHttp $client The HTTP client object. * @param JInput $input The input object * * @since 13.1 */ public function __construct(Registry $options = null, JHttp $client = null, JInput $input = null) { $this->options = isset($options) ? $options : new Registry; $this->options->def('accessTokenURL', 'https://www.linkedin.com/uas/oauth/accessToken'); $this->options->def('authenticateURL', 'https://www.linkedin.com/uas/oauth/authenticate'); $this->options->def('authoriseURL', 'https://www.linkedin.com/uas/oauth/authorize'); $this->options->def('requestTokenURL', 'https://www.linkedin.com/uas/oauth/requestToken'); // Call the JOauthV1aclient constructor to setup the object. parent::__construct($this->options, $client, $input); } /** * Method to verify if the access token is valid by making a request to an API endpoint. * * @return boolean Returns true if the access token is valid and false otherwise. * * @since 13.1 */ public function verifyCredentials() { $token = $this->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); $data['format'] = 'json'; // Set the API url. $path = 'https://api.linkedin.com/v1/people::(~)'; // Send the request. $response = $this->oauthRequest($path, 'GET', $parameters, $data); // Verify response if ($response->code == 200) { return true; } else { return false; } } /** * Method to validate a response. * * @param string $url The request URL. * @param JHttpResponse $response The response to validate. * * @return void * * @since 13.1 * @throws DomainException */ public function validateResponse($url, $response) { if (!$code = $this->getOption('success_code')) { $code = 200; } if (strpos($url, '::(~)') === false && $response->code != $code) { if ($error = json_decode($response->body)) { throw new DomainException('Error code ' . $error->errorCode . ' received with message: ' . $error->message . '.'); } else { throw new DomainException($response->body); } } } /** * Method used to set permissions. * * @param mixed $scope String or an array of string containing permissions. * * @return JLinkedinOauth This object for method chaining * * @see https://developer.linkedin.com/documents/authentication * @since 13.1 */ public function setScope($scope) { $this->setOption('scope', $scope); return $this; } /** * Method to get the current scope * * @return string String or an array of string containing permissions. * * @since 13.1 */ public function getScope() { return $this->getOption('scope'); } } PK���\�ӊA�'�'$libraries/joomla/linkedin/people.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Linkedin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Linkedin API People class for the Joomla Platform. * * @since 13.1 */ class JLinkedinPeople extends JLinkedinObject { /** * Method to get a member's profile. * * @param string $id Member id of the profile you want. * @param string $url The public profile URL. * @param string $fields Request fields beyond the default ones. * @param string $type Choosing public or standard profile. * @param string $language A comma separated list of locales ordered from highest to lowest preference. * * @return array The decoded JSON response * * @since 13.1 */ public function getProfile($id = null, $url = null, $fields = null, $type = 'standard', $language = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/'; $data['format'] = 'json'; // Check if a member id is specified. if ($id) { $base .= 'id=' . $id; } elseif (!$url) { $base .= '~'; } // Check if profile url is specified. if ($url) { $base .= 'url=' . $this->oauth->safeEncode($url); // Choose public profile if (!strcmp($type, 'public')) { $base .= ':public'; } } // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if language is specified. $header = array(); if ($language) { $header = array('Accept-Language' => $language); } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data, $header); return json_decode($response->body); } /** * Method to get a list of connections for a user who has granted access to his/her account. * * @param string $fields Request fields beyond the default ones. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * @param string $modified Values are updated or new. * @param string $modified_since Value as a Unix time stamp of milliseconds since epoch. * * @return array The decoded JSON response * * @since 13.1 */ public function getConnections($fields = null, $start = 0, $count = 500, $modified = null, $modified_since = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people/~/connections'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count != 500) { $data['count'] = $count; } // Check if modified is specified. if ($modified) { $data['modified'] = $modified; } // Check if modified_since is specified. if ($modified_since) { $data['modified-since'] = $modified_since; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); return json_decode($response->body); } /** * Method to get information about people. * * @param string $fields Request fields beyond the default ones. provide 'api-standard-profile-request' * field for out of network profiles. * @param string $keywords Members who have all the keywords anywhere in their profile. * @param string $first_name Members with a matching first name. Matches must be exact. * @param string $last_name Members with a matching last name. Matches must be exactly. * @param string $company_name Members who have a matching company name on their profile. * @param boolean $current_company A value of true matches members who currently work at the company specified in the company-name * parameter. * @param string $title Matches members with that title on their profile. * @param boolean $current_title A value of true matches members whose title is currently the one specified in the title-name parameter. * @param string $school_name Members who have a matching school name on their profile. * @param string $current_school A value of true matches members who currently attend the school specified in the school-name parameter. * @param string $country_code Matches members with a location in a specific country. Values are defined in by ISO 3166 standard. * Country codes must be in all lower case. * @param integer $postal_code Matches members centered around a Postal Code. Must be combined with the country-code parameter. * Not supported for all countries. * @param integer $distance Matches members within a distance from a central point. This is measured in miles. * @param string $facets Facet buckets to return, e.g. location. * @param array $facet Array of facet values to search over. Contains values for location, industry, network, language, * current-company, past-company and school, in exactly this order, null must be specified for an element if no value. * @param integer $start Starting location within the result set for paginated returns. * @param integer $count The number of results returned. * @param string $sort Controls the search result order. There are four options: connections, recommenders, * distance and relevance. * * @return array The decoded JSON response * * @since 13.1 */ public function search($fields = null, $keywords = null, $first_name = null, $last_name = null, $company_name = null, $current_company = null, $title = null, $current_title = null, $school_name = null, $current_school = null, $country_code = null, $postal_code = null, $distance = null, $facets = null, $facet = null, $start = 0, $count = 10, $sort = null) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = '/v1/people-search'; $data['format'] = 'json'; // Check if fields is specified. if ($fields) { $base .= ':' . $fields; } // Check if keywords is specified. if ($keywords) { $data['keywords'] = $keywords; } // Check if first_name is specified. if ($first_name) { $data['first-name'] = $first_name; } // Check if last_name is specified. if ($last_name) { $data['last-name'] = $last_name; } // Check if company-name is specified. if ($company_name) { $data['company-name'] = $company_name; } // Check if current_company is specified. if ($current_company) { $data['current-company'] = $current_company; } // Check if title is specified. if ($title) { $data['title'] = $title; } // Check if current_title is specified. if ($current_title) { $data['current-title'] = $current_title; } // Check if school_name is specified. if ($school_name) { $data['school-name'] = $school_name; } // Check if current_school is specified. if ($current_school) { $data['current-school'] = $current_school; } // Check if country_code is specified. if ($country_code) { $data['country-code'] = $country_code; } // Check if postal_code is specified. if ($postal_code) { $data['postal-code'] = $postal_code; } // Check if distance is specified. if ($distance) { $data['distance'] = $distance; } // Check if facets is specified. if ($facets) { $data['facets'] = $facets; } // Check if facet is specified. if ($facet) { $data['facet'] = array(); for ($i = 0; $i < count($facet); $i++) { if ($facet[$i]) { if ($i == 0) { $data['facet'][] = 'location,' . $facet[$i]; } if ($i == 1) { $data['facet'][] = 'industry,' . $facet[$i]; } if ($i == 2) { $data['facet'][] = 'network,' . $facet[$i]; } if ($i == 3) { $data['facet'][] = 'language,' . $facet[$i]; } if ($i == 4) { $data['facet'][] = 'current-company,' . $facet[$i]; } if ($i == 5) { $data['facet'][] = 'past-company,' . $facet[$i]; } if ($i == 6) { $data['facet'][] = 'school,' . $facet[$i]; } } } } // Check if start is specified. if ($start > 0) { $data['start'] = $start; } // Check if count is specified. if ($count != 10) { $data['count'] = $count; } // Check if sort is specified. if ($sort) { $data['sort'] = $sort; } // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data); if (strpos($fields, 'api-standard-profile-request') === false) { return json_decode($response->body); } // Get header name. $name = explode('"name": "', $response->body); $name = explode('"', $name[1]); $name = $name[0]; // Get header value. $value = explode('"value": "', $response->body); $value = explode('"', $value[1]); $value = $value[0]; // Get request url. $url = explode('"url": "', $response->body); $url = explode('"', $url[1]); $url = $url[0]; // Build header for out of network profile. $header[$name] = $value; // Send the request. $response = $this->oauth->oauthRequest($url, 'GET', $parameters, $data, $header); return json_decode($response->body); } } PK���\ �-libraries/joomla/google/data/picasa/photo.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google Picasa data class for the Joomla Platform. * * @since 12.3 */ class JGoogleDataPicasaPhoto extends JGoogleData { /** * @var SimpleXMLElement The photo's XML * @since 12.3 */ protected $xml; /** * Constructor. * * @param SimpleXMLElement $xml XML from Google * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(SimpleXMLElement $xml, Registry $options = null, JGoogleAuth $auth = null) { $this->xml = $xml; parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://picasaweb.google.com/data/'); } } /** * Method to delete a Picasa photo * * @param mixed $match Check for most up to date photo * * @return boolean Success or failure. * * @since 12.3 * @throws Exception * @throws RuntimeException * @throws UnexpectedValueException */ public function delete($match = '*') { if ($this->isAuthenticated()) { $url = $this->getLink(); if ($match === true) { $match = $this->xml->xpath('./@gd:etag'); $match = $match[0]; } try { $jdata = $this->query($url, null, array('GData-Version' => 2, 'If-Match' => $match), 'delete'); } catch (Exception $e) { if (strpos($e->getMessage(), 'Error code 412 received requesting data: Mismatch: etags') === 0) { throw new RuntimeException("Etag match failed: `$match`."); } throw $e; } if ($jdata->body != '') { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } $this->xml = null; return true; } else { return false; } } /** * Method to get the photo link * * @param string $type Type of link to return * * @return string Link or false on failure * * @since 12.3 */ public function getLink($type = 'edit') { $links = $this->xml->link; foreach ($links as $link) { if ($link->attributes()->rel == $type) { return (string) $link->attributes()->href; } } return false; } /** * Method to get the photo's URL * * @return string Link * * @since 12.3 */ public function getUrl() { return (string) $this->xml->children()->content->attributes()->src; } /** * Method to get the photo's thumbnails * * @return array An array of thumbnails * * @since 12.3 */ public function getThumbnails() { $thumbs = array(); foreach ($this->xml->children('media', true)->group->thumbnail as $item) { $url = (string) $item->attributes()->url; $width = (int) $item->attributes()->width; $height = (int) $item->attributes()->height; $thumbs[$width] = array('url' => $url, 'w' => $width, 'h' => $height); } return $thumbs; } /** * Method to get the title of the photo * * @return string Photo title * * @since 12.3 */ public function getTitle() { return (string) $this->xml->children()->title; } /** * Method to get the summary of the photo * * @return string Photo description * * @since 12.3 */ public function getSummary() { return (string) $this->xml->children()->summary; } /** * Method to get the access level of the photo * * @return string Photo access level * * @since 12.3 */ public function getAccess() { return (string) $this->xml->children('gphoto', true)->access; } /** * Method to get the time of the photo * * @return double Photo time * * @since 12.3 */ public function getTime() { return (double) $this->xml->children('gphoto', true)->timestamp / 1000; } /** * Method to get the size of the photo * * @return int Photo size * * @since 12.3 */ public function getSize() { return (int) $this->xml->children('gphoto', true)->size; } /** * Method to get the height of the photo * * @return int Photo height * * @since 12.3 */ public function getHeight() { return (int) $this->xml->children('gphoto', true)->height; } /** * Method to get the width of the photo * * @return int Photo width * * @since 12.3 */ public function getWidth() { return (int) $this->xml->children('gphoto', true)->width; } /** * Method to set the title of the photo * * @param string $title New photo title * * @return JGoogleDataPicasaPhoto The object for method chaining * * @since 12.3 */ public function setTitle($title) { $this->xml->children()->title = $title; return $this; } /** * Method to set the summary of the photo * * @param string $summary New photo description * * @return JGoogleDataPicasaPhoto The object for method chaining * * @since 12.3 */ public function setSummary($summary) { $this->xml->children()->summary = $summary; return $this; } /** * Method to set the access level of the photo * * @param string $access New photo access level * * @return JGoogleDataPicasaPhoto The object for method chaining * * @since 12.3 */ public function setAccess($access) { $this->xml->children('gphoto', true)->access = $access; return $this; } /** * Method to set the time of the photo * * @param int $time New photo time * * @return JGoogleDataPicasaPhoto The object for method chaining * * @since 12.3 */ public function setTime($time) { $this->xml->children('gphoto', true)->timestamp = $time * 1000; return $this; } /** * Method to modify a Picasa Photo * * @param string $match Optional eTag matching parameter * * @return mixed Data from Google. * * @since 12.3 */ public function save($match = '*') { if ($this->isAuthenticated()) { $url = $this->getLink(); if ($match === true) { $match = $this->xml->xpath('./@gd:etag'); $match = $match[0]; } try { $headers = array('GData-Version' => 2, 'Content-type' => 'application/atom+xml', 'If-Match' => $match); $jdata = $this->query($url, $this->xml->asXml(), $headers, 'put'); } catch (Exception $e) { if (strpos($e->getMessage(), 'Error code 412 received requesting data: Mismatch: etags') === 0) { throw new RuntimeException("Etag match failed: `$match`."); } throw $e; } $this->xml = $this->safeXml($jdata->body); return $this; } else { return false; } } /** * Refresh photo data * * @return mixed Data from Google * * @since 12.3 */ public function refresh() { if ($this->isAuthenticated()) { $url = $this->getLink(); $jdata = $this->query($url, null, array('GData-Version' => 2)); $this->xml = $this->safeXml($jdata->body); return $this; } else { return false; } } } PK���\Y<��&�&-libraries/joomla/google/data/picasa/album.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google Picasa data class for the Joomla Platform. * * @since 12.3 */ class JGoogleDataPicasaAlbum extends JGoogleData { /** * @var SimpleXMLElement The album's XML * @since 12.3 */ protected $xml; /** * Constructor. * * @param SimpleXMLElement $xml XML from Google * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(SimpleXMLElement $xml, Registry $options = null, JGoogleAuth $auth = null) { $this->xml = $xml; parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://picasaweb.google.com/data/'); } } /** * Method to delete a Picasa album * * @param mixed $match Check for most up to date album * * @return boolean Success or failure. * * @since 12.3 * @throws Exception * @throws RuntimeException * @throws UnexpectedValueException */ public function delete($match = '*') { if ($this->isAuthenticated()) { $url = $this->getLink(); if ($match === true) { $match = $this->xml->xpath('./@gd:etag'); $match = $match[0]; } try { $jdata = $this->query($url, null, array('GData-Version' => 2, 'If-Match' => $match), 'delete'); } catch (Exception $e) { if (strpos($e->getMessage(), 'Error code 412 received requesting data: Mismatch: etags') === 0) { throw new RuntimeException("Etag match failed: `$match`."); } throw $e; } if ($jdata->body != '') { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } $this->xml = null; return true; } else { return false; } } /** * Method to get the album link * * @param string $type Type of link to return * * @return string Link or false on failure * * @since 12.3 */ public function getLink($type = 'edit') { $links = $this->xml->link; foreach ($links as $link) { if ($link->attributes()->rel == $type) { return (string) $link->attributes()->href; } } return false; } /** * Method to get the title of the album * * @return string Album title * * @since 12.3 */ public function getTitle() { return (string) $this->xml->children()->title; } /** * Method to get the summary of the album * * @return string Album summary * * @since 12.3 */ public function getSummary() { return (string) $this->xml->children()->summary; } /** * Method to get the location of the album * * @return string Album location * * @since 12.3 */ public function getLocation() { return (string) $this->xml->children('gphoto', true)->location; } /** * Method to get the access level of the album * * @return string Album access level * * @since 12.3 */ public function getAccess() { return (string) $this->xml->children('gphoto', true)->access; } /** * Method to get the time of the album * * @return double Album time * * @since 12.3 */ public function getTime() { return (double) $this->xml->children('gphoto', true)->timestamp / 1000; } /** * Method to set the title of the album * * @param string $title New album title * * @return JGoogleDataPicasaAlbum The object for method chaining * * @since 12.3 */ public function setTitle($title) { $this->xml->children()->title = $title; return $this; } /** * Method to set the summary of the album * * @param string $summary New album summary * * @return JGoogleDataPicasaAlbum The object for method chaining * * @since 12.3 */ public function setSummary($summary) { $this->xml->children()->summary = $summary; return $this; } /** * Method to set the location of the album * * @param string $location New album location * * @return JGoogleDataPicasaAlbum The object for method chaining * * @since 12.3 */ public function setLocation($location) { $this->xml->children('gphoto', true)->location = $location; return $this; } /** * Method to set the access level of the album * * @param string $access New album access * * @return JGoogleDataPicasaAlbum The object for method chaining * * @since 12.3 */ public function setAccess($access) { $this->xml->children('gphoto', true)->access = $access; return $this; } /** * Method to set the time of the album * * @param int $time New album time * * @return JGoogleDataPicasaAlbum The object for method chaining * * @since 12.3 */ public function setTime($time) { $this->xml->children('gphoto', true)->timestamp = $time * 1000; return $this; } /** * Method to modify a Picasa Album * * @param string $match Optional eTag matching parameter * * @return mixed Data from Google. * * @since 12.3 */ public function save($match = '*') { if ($this->isAuthenticated()) { $url = $this->getLink(); if ($match === true) { $match = $this->xml->xpath('./@gd:etag'); $match = $match[0]; } try { $headers = array('GData-Version' => 2, 'Content-type' => 'application/atom+xml', 'If-Match' => $match); $jdata = $this->query($url, $this->xml->asXml(), $headers, 'put'); } catch (Exception $e) { if (strpos($e->getMessage(), 'Error code 412 received requesting data: Mismatch: etags') === 0) { throw new RuntimeException("Etag match failed: `$match`."); } throw $e; } $this->xml = $this->safeXml($jdata->body); return $this; } else { return false; } } /** * Refresh Picasa Album * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function refresh() { if ($this->isAuthenticated()) { $url = $this->getLink(); $jdata = $this->query($url, null, array('GData-Version' => 2)); $this->xml = $this->safeXml($jdata->body); return $this; } else { return false; } } /** * Method to retrieve a list of Picasa Photos * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function listPhotos() { if ($this->isAuthenticated()) { $url = $this->getLink('http://schemas.google.com/g/2005#feed'); $jdata = $this->query($url, null, array('GData-Version' => 2)); $xml = $this->safeXml($jdata->body); if (isset($xml->children()->entry)) { $items = array(); foreach ($xml->children()->entry as $item) { $items[] = new JGoogleDataPicasaPhoto($item, $this->options, $this->auth); } return $items; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Add photo * * @param string $file Path of file to upload * @param string $title Title to give to file (defaults to filename) * @param string $summary Description of the file * * @return mixed Data from Google * * @since 12.3 * @throws RuntimeException */ public function upload($file, $title = '', $summary = '') { if ($this->isAuthenticated()) { jimport('joomla.filesystem.file'); $title = $title != '' ? $title : JFile::getName($file); if (!($type = $this->getMime($file))) { throw new RuntimeException("Inappropriate file type."); } if (!($data = JFile::read($file))) { throw new RuntimeException("Cannot access file: `$file`"); } $xml = new SimpleXMLElement('<entry></entry>'); $xml->addAttribute('xmlns', 'http://www.w3.org/2005/Atom'); $xml->addChild('title', $title); $xml->addChild('summary', $summary); $cat = $xml->addChild('category', ''); $cat->addAttribute('scheme', 'http://schemas.google.com/g/2005#kind'); $cat->addAttribute('term', 'http://schemas.google.com/photos/2007#photo'); $post = "Media multipart posting\n"; $post .= "--END_OF_PART\n"; $post .= "Content-Type: application/atom+xml\n\n"; $post .= $xml->asXml() . "\n"; $post .= "--END_OF_PART\n"; $post .= "Content-Type: {$type}\n\n"; $post .= $data; $jdata = $this->query($this->getLink(), $post, array('GData-Version' => 2, 'Content-Type: multipart/related'), 'post'); return new JGoogleDataPicasaPhoto($this->safeXml($jdata->body), $this->options, $this->auth); } else { return false; } } /** * Add photo * * @param string $file Filename * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ protected function getMime($file) { switch (strtolower(JFile::getExt($file))) { case 'bmp': case 'bm': return 'image/bmp'; case 'gif': return 'image/gif'; case 'jpg': case 'jpeg': case 'jpe': case 'jif': case 'jfif': case 'jfi': return 'image/jpeg'; case 'png': return 'image/png'; case '3gp': return 'video/3gpp'; case 'avi': return 'video/avi'; case 'mov': case 'moov': case 'qt': return 'video/quicktime'; case 'mp4': case 'm4a': case 'm4p': case 'm4b': case 'm4r': case 'm4v': return 'video/mp4'; case 'mpg': case 'mpeg': case 'mp1': case 'mp2': case 'mp3': case 'm1v': case 'm1a': case 'm2a': case 'mpa': case 'mpv': return 'video/mpeg'; case 'asf': return 'video/x-ms-asf'; case 'wmv': return 'video/x-ms-wmv'; default: return false; } } } PK���\���=�=)libraries/joomla/google/data/calendar.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google Calendar data class for the Joomla Platform. * * @since 12.3 */ class JGoogleDataCalendar extends JGoogleData { /** * Constructor. * * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://www.googleapis.com/auth/calendar'); } } /** * Method to remove a calendar from a user's calendar list * * @param string $calendarID ID of calendar to delete * * @return boolean Success or failure * * @since 12.3 * @throws UnexpectedValueException */ public function removeCalendar($calendarID) { if ($this->isAuthenticated()) { $jdata = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendarList/' . urlencode($calendarID), null, null, 'delete'); if ($jdata->body != '') { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } return true; } else { return false; } } /** * Method to get a calendar's settings from Google * * @param string $calendarID ID of calendar to get. * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function getCalendar($calendarID) { if ($this->isAuthenticated()) { $jdata = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendarList/' . urlencode($calendarID)); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to add a calendar to a user's Google Calendar list * * @param string $calendarID New calendar ID * @param array $options New calendar settings * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function addCalendar($calendarID, $options = array()) { if ($this->isAuthenticated()) { $options['id'] = $calendarID; $url = 'https://www.googleapis.com/calendar/v3/users/me/calendarList'; $jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'post'); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to retrieve calendar list from Google * * @param array $options Search settings * @param int $maxpages Maximum number of pages of calendars to return * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function listCalendars($options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { $next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null; unset($options['nextPageToken']); $url = 'https://www.googleapis.com/calendar/v3/users/me/calendarList?' . http_build_query($options); return $this->listGetData($url, $maxpages, $next); } else { return false; } } /** * Method to edit a Google Calendar's settings * * @param string $calendarID Calendar ID * @param array $options Calendar settings * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function editCalendarSettings($calendarID, $options) { if ($this->isAuthenticated()) { $url = 'https://www.googleapis.com/calendar/v3/users/me/calendarList/' . urlencode($calendarID); $jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'put'); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to clear a Google Calendar * * @param string $calendarID ID of calendar to clear * * @return boolean Success or failure * * @since 12.3 * @throws UnexpectedValueException */ public function clearCalendar($calendarID) { if ($this->isAuthenticated()) { $data = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID) . '/clear', null, null, 'post'); if ($data->body != '') { throw new UnexpectedValueException("Unexpected data received from Google: `{$data->body}`."); } return true; } else { return false; } } /** * Method to delete a calendar from Google * * @param string $calendarID ID of calendar to delete. * * @return boolean Success or failure * * @since 12.3 * @throws UnexpectedValueException */ public function deleteCalendar($calendarID) { if ($this->isAuthenticated()) { $data = $this->query('https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID), null, null, 'delete'); if ($data->body != '') { throw new UnexpectedValueException("Unexpected data received from Google: `{$data->body}`."); } return true; } else { return false; } } /** * Method to create a Google Calendar * * @param string $title New calendar title * @param array $options New calendar settings * * @return mixed Data from Google. * * @since 12.3 * @throws UnexpectedValueException */ public function createCalendar($title, $options = array()) { if ($this->isAuthenticated()) { $options['summary'] = $title; $url = 'https://www.googleapis.com/calendar/v3/calendars'; $jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'post'); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to edit a Google Calendar * * @param string $calendarID Calendar ID. * @param array $options Calendar settings. * * @return mixed Data from Google. * * @since 12.3 * @throws UnexpectedValueException */ public function editCalendar($calendarID, $options) { if ($this->isAuthenticated()) { $url = 'https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID); $jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'put'); $data = json_decode($jdata->body, true); if ($data && array_key_exists('items', $data)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to delete an event from a Google Calendar * * @param string $calendarID ID of calendar to delete from * @param string $eventID ID of event to delete. * * @return boolean Success or failure. * * @since 12.3 * @throws UnexpectedValueException */ public function deleteEvent($calendarID, $eventID) { if ($this->isAuthenticated()) { $url = 'https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID) . '/events/' . urlencode($eventID); $data = $this->query($url, null, null, 'delete'); if ($data->body != '') { throw new UnexpectedValueException("Unexpected data received from Google: `{$data->body}`."); } return true; } else { return false; } } /** * Method to get an event from a Google Calendar * * @param string $calendarID ID of calendar * @param string $eventID ID of event to get * @param array $options Options to send to Google * * @return mixed Data from Google. * * @since 12.3 * @throws UnexpectedValueException */ public function getEvent($calendarID, $eventID, $options = array()) { if ($this->isAuthenticated()) { $url = 'https://www.googleapis.com/calendar/v3/users/me/calendarList/'; $url .= urlencode($calendarID) . '/events/' . urlencode($eventID) . '?' . http_build_query($options); $jdata = $this->query($url); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to create a Google Calendar event * * @param string $calendarID ID of calendar * @param mixed $start Event start time * @param mixed $end Event end time * @param array $options New event settings * @param mixed $timezone Timezone for event * @param boolean $allday Treat event as an all-day event * @param boolean $notify Notify participants * * @return mixed Data from Google. * * @since 12.3 * @throws InvalidArgumentException * @throws UnexpectedValueException */ public function createEvent($calendarID, $start, $end = false, $options = array(), $timezone = false, $allday = false, $notify = false) { if ($this->isAuthenticated()) { if (!$start) { $startobj = new DateTime; } elseif (is_int($start)) { $startobj = new DateTime; $startobj->setTimestamp($start); } elseif (is_string($start)) { $startobj = new DateTime($start); } elseif (is_a($start, 'DateTime')) { $startobj = $start; } else { throw new InvalidArgumentException('Invalid event start time.'); } if (!$end) { $endobj = $startobj; } elseif (is_int($end)) { $endobj = new DateTime; $endobj->setTimestamp($end); } elseif (is_string($end)) { $endobj = new DateTime($end); } elseif (is_a($end, 'DateTime')) { $endobj = $end; } else { throw new InvalidArgumentException('Invalid event end time.'); } if ($allday) { $options['start'] = array('date' => $startobj->format('Y-m-d')); $options['end'] = array('date' => $endobj->format('Y-m-d')); } else { $options['start'] = array('dateTime' => $startobj->format(DateTime::RFC3339)); $options['end'] = array('dateTime' => $endobj->format(DateTime::RFC3339)); } if ($timezone === true) { $options['start']['timeZone'] = $startobj->getTimezone()->getName(); $options['end']['timeZone'] = $endobj->getTimezone()->getName(); } elseif (is_a($timezone, 'DateTimeZone')) { $options['start']['timeZone'] = $timezone->getName(); $options['end']['timeZone'] = $timezone->getName(); } elseif (is_string($timezone)) { $options['start']['timeZone'] = $timezone; $options['end']['timeZone'] = $timezone; } $url = 'https://www.googleapis.com/calendar/v3/calendars/' . urlencode($calendarID) . '/events' . ($notify ? '?sendNotifications=true' : ''); $jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'post'); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to retrieve a list of events on a Google calendar * * @param string $calendarID Calendar ID * @param string $eventID ID of the event to change * @param array $options Search settings * @param int $maxpages Minimum number of events to retrieve (more may be retrieved depending on page size) * * @return mixed Data from Google. * * @since 12.3 * @throws UnexpectedValueException */ public function listRecurrences($calendarID, $eventID, $options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { $next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null; unset($options['nextPageToken']); $url = 'https://www.googleapis.com/calendar/v3/users/me/calendars/' . urlencode($calendarID) . '/events/' . urlencode($eventID) . '/instances'; $url .= '?' . http_build_query($options); return $this->listGetData($url, $maxpages, $next); } else { return false; } } /** * Method to retrieve a list of events on a Google calendar * * @param string $calendarID Calendar ID * @param array $options Calendar settings * @param int $maxpages Cycle through pages of data to generate a complete list * * @return mixed Data from Google. * * @since 12.3 * @throws UnexpectedValueException */ public function listEvents($calendarID, $options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { $next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null; unset($options['nextPageToken']); $url = 'https://www.googleapis.com/calendar/v3/calendars/' . urlencode($calendarID) . '/events?' . http_build_query($options); return $this->listGetData($url, $maxpages, $next); } else { return false; } } /** * Method to move an event from one calendar to another * * @param string $calendarID Calendar ID * @param string $eventID ID of the event to change * @param string $destID Calendar ID * @param boolean $notify Notify participants of changes * * @return mixed Data from Google. * * @since 12.3 * @throws UnexpectedValueException */ public function moveEvent($calendarID, $eventID, $destID, $notify = false) { if ($this->isAuthenticated()) { $url = 'https://www.googleapis.com/calendar/v3/calendars/' . urlencode($calendarID) . '/events/' . urlencode($eventID) . '/move'; $url .= '?destination=' . $destID . ($notify ? '&sendNotifications=true' : ''); $jdata = $this->query($url, null, null, 'post'); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to edit a Google Calendar event * * @param string $calendarID Calendar ID * @param string $eventID ID of the event to change * @param array $options Event settings * @param boolean $notify Notify participants of changes * * @return mixed Data from Google. * * @since 12.3 * @throws UnexpectedValueException */ public function editEvent($calendarID, $eventID, $options, $notify = false) { if ($this->isAuthenticated()) { $url = 'https://www.googleapis.com/calendar/v3/calendars/'; $url .= urlencode($calendarID) . '/events/' . urlencode($eventID) . ($notify ? '?sendNotifications=true' : ''); $jdata = $this->query($url, json_encode($options), array('Content-type' => 'application/json'), 'put'); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } } PK���\KY���+�+(libraries/joomla/google/data/adsense.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google Adsense data class for the Joomla Platform. * * @since 12.3 */ class JGoogleDataAdsense extends JGoogleData { /** * Constructor. * * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://www.googleapis.com/auth/adsense'); } } /** * Method to get an Adsense account's settings from Google * * @param string $accountID ID of account to get * @param boolean $subaccounts Include list of subaccounts * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function getAccount($accountID, $subaccounts = true) { if ($this->isAuthenticated()) { $url = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID) . ($subaccounts ? '?tree=true' : ''); $jdata = $this->query($url); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to retrieve a list of AdSense accounts from Google * * @param array $options Search settings * @param int $maxpages Maximum number of pages of accounts to return * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function listAccounts($options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { $next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null; unset($options['nextPageToken']); $url = 'https://www.googleapis.com/adsense/v1.1/accounts?' . http_build_query($options); return $this->listGetData($url, $maxpages, $next); } else { return false; } } /** * Method to retrieve a list of AdSense clients from Google * * @param string $accountID ID of account to list the clients from * @param array $options Search settings * @param int $maxpages Maximum number of pages of accounts to return * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function listClients($accountID, $options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { $next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null; unset($options['nextPageToken']); $url = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID) . '/adclients?' . http_build_query($options); return $this->listGetData($url, $maxpages, $next); } else { return false; } } /** * Method to get an AdSense AdUnit * * @param string $accountID ID of account to get * @param string $adclientID ID of client to get * @param string $adunitID ID of adunit to get * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function getUnit($accountID, $adclientID, $adunitID) { if ($this->isAuthenticated()) { $url = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID); $url .= '/adclients/' . urlencode($adclientID) . '/adunits/' . urlencode($adunitID); $jdata = $this->query($url); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to retrieve a list of AdSense Custom Channels for a specific Adunit * * @param string $accountID ID of account * @param string $adclientID ID of client * @param string $adunitID ID of adunit to list channels from * @param array $options Search settings * @param int $maxpages Maximum number of pages of accounts to return * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function listUnitChannels($accountID, $adclientID, $adunitID, $options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { $next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null; unset($options['nextPageToken']); $url = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID); $url .= '/adclients/' . urlencode($adclientID) . '/adunits/' . urlencode($adunitID) . '/customchannels?' . http_build_query($options); return $this->listGetData($url, $maxpages, $next); } else { return false; } } /** * Method to get an Adsense Channel * * @param string $accountID ID of account to get * @param string $adclientID ID of client to get * @param string $channelID ID of channel to get * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function getChannel($accountID, $adclientID, $channelID) { if ($this->isAuthenticated()) { $url = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID) . '/adclients/'; $url .= urlencode($adclientID) . '/customchannels/' . urlencode($channelID); $jdata = $this->query($url); if ($data = json_decode($jdata->body, true)) { return $data; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to retrieve a list of AdSense Custom Channels * * @param string $accountID ID of account * @param string $adclientID ID of client to list channels from * @param array $options Search settings * @param int $maxpages Maximum number of pages of accounts to return * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function listChannels($accountID, $adclientID, $options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { $next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null; unset($options['nextPageToken']); $url = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID) . '/adclients/' . urlencode($adclientID); $url .= '/customchannels?' . http_build_query($options); return $this->listGetData($url, $maxpages, $next); } else { return false; } } /** * Method to retrieve a list of AdSense Adunits for a specific Custom Channel * * @param string $accountID ID of account * @param string $adclientID ID of client * @param string $channelID ID of channel to list units from * @param array $options Search settings * @param int $maxpages Maximum number of pages of accounts to return * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function listChannelUnits($accountID, $adclientID, $channelID, $options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { $next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null; unset($options['nextPageToken']); $url = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID) . '/adclients/' . urlencode($adclientID); $url .= '/customchannels/' . urlencode($channelID) . '/adunits?' . http_build_query($options); return $this->listGetData($url, $maxpages, $next); } else { return false; } } /** * Method to generate a report from Google AdSense * * @param string $accountID ID of account * @param string $adclientID ID of client * @param array $options Search settings * @param int $maxpages Maximum number of pages of accounts to return * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function listUrlChannels($accountID, $adclientID, $options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { $next = array_key_exists('nextPageToken', $options) ? $options['nextPage'] : null; unset($options['nextPageToken']); $url = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID); $url .= '/adclients/' . urlencode($adclientID) . '/urlchannels?' . http_build_query($options); return $this->listGetData($url, $maxpages, $next); } else { return false; } } /** * Method to retrieve a list of AdSense Channel URLs * * @param string $accountID ID of account * @param mixed $start Start day * @param mixed $end End day * @param array $options Search settings * @param int $maxpages Maximum number of pages of accounts to return * * @return mixed Data from Google * * @since 12.3 * @throws InvalidArgumentException * @throws UnexpectedValueException */ public function generateReport($accountID, $start, $end = false, $options = array(), $maxpages = 1) { if ($this->isAuthenticated()) { if (is_int($start)) { $startobj = new DateTime; $startobj->setTimestamp($start); } elseif (is_string($start)) { $startobj = new DateTime($start); } elseif (is_a($start, 'DateTime')) { $startobj = $start; } else { throw new InvalidArgumentException('Invalid start time.'); } if (!$end) { $endobj = new DateTime; } elseif (is_int($end)) { $endobj = new DateTime; $endobj->setTimestamp($end); } elseif (is_string($end)) { $endobj = new DateTime($end); } elseif (is_a($end, 'DateTime')) { $endobj = $end; } else { throw new InvalidArgumentException('Invalid end time.'); } $options['startDate'] = $startobj->format('Y-m-d'); $options['endDate'] = $endobj->format('Y-m-d'); unset($options['startIndex']); $url = 'https://www.googleapis.com/adsense/v1.1/accounts/' . urlencode($accountID) . '/reports?' . http_build_query($options); if (strpos($url, '&')) { $url .= '&'; } $i = 0; $data['rows'] = array(); do { $jdata = $this->query($url . 'startIndex=' . count($data['rows'])); $newdata = json_decode($jdata->body, true); if ($newdata && array_key_exists('rows', $newdata)) { $newdata['rows'] = array_merge($data['rows'], $newdata['rows']); $data = $newdata; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } $i++; } while (count($data['rows']) < $data['totalMatchedRows'] && $i < $maxpages); return $data; } else { return false; } } } PK���\87x}ss%libraries/joomla/google/data/plus.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google+ data class for the Joomla Platform. * * @since 12.3 */ class JGoogleDataPlus extends JGoogleData { /** * @var JGoogleDataPlusPeople Google+ API object for people. * @since 12.3 */ protected $people; /** * @var JGoogleDataPlusActivities Google+ API object for people. * @since 12.3 */ protected $activities; /** * @var JGoogleDataPlusComments Google+ API object for people. * @since 12.3 */ protected $comments; /** * Constructor. * * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { // Setup the default API url if not already set. $options->def('api.url', 'https://www.googleapis.com/plus/v1/'); parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://www.googleapis.com/auth/plus.me'); } } /** * Magic method to lazily create API objects * * @param string $name Name of property to retrieve * * @return JGoogleDataPlus Google+ API object (people, activities, comments). * * @since 12.3 */ public function __get($name) { switch ($name) { case 'people': if ($this->people == null) { $this->people = new JGoogleDataPlusPeople($this->options, $this->auth); } return $this->people; case 'activities': if ($this->activities == null) { $this->activities = new JGoogleDataPlusActivities($this->options, $this->auth); } return $this->activities; case 'comments': if ($this->comments == null) { $this->comments = new JGoogleDataPlusComments($this->options, $this->auth); } return $this->comments; } } } PK���\�K#s��'libraries/joomla/google/data/picasa.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google Picasa data class for the Joomla Platform. * * @since 12.3 */ class JGoogleDataPicasa extends JGoogleData { /** * Constructor. * * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://picasaweb.google.com/data/'); } } /** * Method to retrieve a list of Picasa Albums * * @param string $userID ID of user * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function listAlbums($userID = 'default') { if ($this->isAuthenticated()) { $url = 'https://picasaweb.google.com/data/feed/api/user/' . urlencode($userID); $jdata = $this->query($url, null, array('GData-Version' => 2)); $xml = $this->safeXml($jdata->body); if (isset($xml->children()->entry)) { $items = array(); foreach ($xml->children()->entry as $item) { $items[] = new JGoogleDataPicasaAlbum($item, $this->options, $this->auth); } return $items; } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } else { return false; } } /** * Method to create a Picasa Album * * @param string $userID ID of user * @param string $title New album title * @param string $access New album access settings * @param string $summary New album summary * @param string $location New album location * @param int $time New album timestamp * @param array $keywords New album keywords * * @return mixed Data from Google. * * @since 12.3 */ public function createAlbum($userID = 'default', $title = '', $access = 'private', $summary = '', $location = '', $time = false, $keywords = array()) { if ($this->isAuthenticated()) { $time = $time ? $time : time(); $title = $title != '' ? $title : date('F j, Y'); $xml = new SimpleXMLElement('<entry></entry>'); $xml->addAttribute('xmlns', 'http://www.w3.org/2005/Atom'); $xml->addChild('title', $title); $xml->addChild('summary', $summary); $xml->addChild('gphoto:location', $location, 'http://schemas.google.com/photos/2007'); $xml->addChild('gphoto:access', $access); $xml->addChild('gphoto:timestamp', $time); $media = $xml->addChild('media:group', '', 'http://search.yahoo.com/mrss/'); $media->addChild('media:keywords', implode($keywords, ', ')); $cat = $xml->addChild('category', ''); $cat->addAttribute('scheme', 'http://schemas.google.com/g/2005#kind'); $cat->addAttribute('term', 'http://schemas.google.com/photos/2007#album'); $url = 'https://picasaweb.google.com/data/feed/api/user/' . urlencode($userID); $jdata = $this->query($url, $xml->asXml(), array('GData-Version' => 2, 'Content-type' => 'application/atom+xml'), 'post'); $xml = $this->safeXml($jdata->body); return new JGoogleDataPicasaAlbum($xml, $this->options, $this->auth); } else { return false; } } /** * Get Picasa Album * * @param string $url URL of album to get * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ public function getAlbum($url) { if ($this->isAuthenticated()) { $jdata = $this->query($url, null, array('GData-Version' => 2)); $xml = $this->safeXml($jdata->body); return new JGoogleDataPicasaAlbum($xml, $this->options, $this->auth); } else { return false; } } } PK���\�߸0libraries/joomla/google/data/plus/activities.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google+ data class for the Joomla Platform. * * @since 12.3 */ class JGoogleDataPlusActivities extends JGoogleData { /** * Constructor. * * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://www.googleapis.com/auth/plus.me'); } } /** * List all of the activities in the specified collection for a particular user. * * @param string $userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user. * @param string $collection The collection of activities to list. Acceptable values are: "public". * @param string $fields Used to specify the fields you want returned. * @param integer $max The maximum number of people to include in the response, used for paging. * @param string $token The continuation token, used to page through large result sets. To get the next page of results, set this * parameter to the value of "nextPageToken" from the previous response. This token may be of any length. * @param string $alt Specifies an alternative representation type. Acceptable values are: "json" - Use JSON format (default) * * @return mixed Data from Google * * @since 12.3 */ public function listActivities($userId, $collection, $fields = null, $max = 10, $token = null, $alt = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'people/' . $userId . '/activities/' . $collection; // Check if fields is specified. if ($fields) { $url .= '?fields=' . $fields; } // Check if max is specified. if ($max != 10) { $url .= (strpos($url, '?') === false) ? '?maxResults=' : '&maxResults='; $url .= $max; } // Check if token is specified. if ($token) { $url .= (strpos($url, '?') === false) ? '?pageToken=' : '&pageToken='; $url .= $token; } // Check if alt is specified. if ($alt) { $url .= (strpos($url, '?') === false) ? '?alt=' : '&alt='; $url .= $alt; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } /** * Get an activity. * * @param string $id The ID of the activity to get. * @param string $fields Used to specify the fields you want returned. * @param string $alt Specifies an alternative representation type. Acceptable values are: "json" - Use JSON format (default) * * @return mixed Data from Google * * @since 12.3 */ public function getActivity($id, $fields = null, $alt = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'activities/' . $id; // Check if fields is specified. if ($fields) { $url .= '?fields=' . $fields; } // Check if alt is specified. if ($alt) { $url .= (strpos($url, '?') === false) ? '?alt=' : '&alt='; $url .= $alt; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } /** * Search all public activities. * * @param string $query Full-text search query string. * @param string $fields Used to specify the fields you want returned. * @param string $language Specify the preferred language to search with. https://developers.google.com/+/api/search#available-languages * @param integer $max The maximum number of people to include in the response, used for paging. * @param string $order Specifies how to order search results. Acceptable values are "best" and "recent". * @param string $token The continuation token, used to page through large result sets. To get the next page of results, set this * parameter to the value of "nextPageToken" from the previous response. This token may be of any length. * * @return mixed Data from Google * * @since 12.3 */ public function search($query, $fields = null, $language = null, $max = 10, $order = null, $token = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'activities?query=' . urlencode($query); // Check if fields is specified. if ($fields) { $url .= '&fields=' . $fields; } // Check if language is specified. if ($language) { $url .= '&language=' . $language; } // Check if max is specified. if ($max != 10) { $url .= '&maxResults=' . $max; } // Check if order is specified. if ($order) { $url .= '&orderBy=' . $order; } // Check of token is specified. if ($token) { $url .= '&pageToken=' . $token; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } } PK���\g�}�� � .libraries/joomla/google/data/plus/comments.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google+ data class for the Joomla Platform. * * @since 12.3 */ class JGoogleDataPlusComments extends JGoogleData { /** * Constructor. * * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://www.googleapis.com/auth/plus.me'); } } /** * List all of the comments for an activity. * * @param string $activityId The ID of the activity to get comments for. * @param string $fields Used to specify the fields you want returned. * @param integer $max The maximum number of people to include in the response, used for paging. * @param string $order The order in which to sort the list of comments. Acceptable values are "ascending" and "descending". * @param string $token The continuation token, used to page through large result sets. To get the next page of results, set this * parameter to the value of "nextPageToken" from the previous response. This token may be of any length. * @param string $alt Specifies an alternative representation type. Acceptable values are: "json" - Use JSON format (default) * * @return mixed Data from Google * * @since 12.3 */ public function listComments($activityId, $fields = null, $max = 20, $order = null, $token = null, $alt = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'activities/' . $activityId . '/comments'; // Check if fields is specified. if ($fields) { $url .= '?fields=' . $fields; } // Check if max is specified. if ($max != 20) { $url .= (strpos($url, '?') === false) ? '?maxResults=' : '&maxResults='; $url .= $max; } // Check if order is specified. if ($order) { $url .= (strpos($url, '?') === false) ? '?orderBy=' : '&orderBy='; $url .= $order; } // Check of token is specified. if ($token) { $url .= (strpos($url, '?') === false) ? '?pageToken=' : '&pageToken='; $url .= $token; } // Check if alt is specified. if ($alt) { $url .= (strpos($url, '?') === false) ? '?alt=' : '&alt='; $url .= $alt; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } /** * Get a comment. * * @param string $id The ID of the comment to get. * @param string $fields Used to specify the fields you want returned. * * @return mixed Data from Google * * @since 12.3 */ public function getComment($id, $fields = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'comments/' . $id; // Check if fields is specified. if ($fields) { $url .= '?fields=' . $fields; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } } PK���\��;�PP,libraries/joomla/google/data/plus/people.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google+ data class for the Joomla Platform. * * @since 12.3 */ class JGoogleDataPlusPeople extends JGoogleData { /** * Constructor. * * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://www.googleapis.com/auth/plus.me'); } } /** * Get a person's profile. * * @param string $id The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user. * @param string $fields Used to specify the fields you want returned. * * @return mixed Data from Google * * @since 12.3 */ public function getPeople($id, $fields = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'people/' . $id; // Check if fields is specified. if ($fields) { $url .= '?fields=' . $fields; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } /** * Search all public profiles. * * @param string $query Specify a query string for full text search of public text in all profiles. * @param string $fields Used to specify the fields you want returned. * @param string $language Specify the preferred language to search with. https://developers.google.com/+/api/search#available-languages * @param integer $max The maximum number of people to include in the response, used for paging. * @param string $token The continuation token, used to page through large result sets. To get the next page of results, set this * parameter to the value of "nextPageToken" from the previous response. This token may be of any length. * * @return mixed Data from Google * * @since 12.3 */ public function search($query, $fields = null, $language = null, $max = 10, $token = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'people?query=' . urlencode($query); // Check if fields is specified. if ($fields) { $url .= '&fields=' . $fields; } // Check if language is specified. if ($language) { $url .= '&language=' . $language; } // Check if max is specified. if ($max != 10) { $url .= '&maxResults=' . $max; } // Check of token is specified. if ($token) { $url .= '&pageToken=' . $token; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } /** * List all of the people in the specified collection for a particular activity. * * @param string $activityId The ID of the activity to get the list of people for. * @param string $collection The collection of people to list. Acceptable values are "plusoners" and "resharers". * @param string $fields Used to specify the fields you want returned. * @param integer $max The maximum number of people to include in the response, used for paging. * @param string $token The continuation token, used to page through large result sets. To get the next page of results, set this * parameter to the value of "nextPageToken" from the previous response. This token may be of any length. * * @return mixed Data from Google * * @since 12.3 */ public function listByActivity($activityId, $collection, $fields = null, $max = 10, $token = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'activities/' . $activityId . '/people/' . $collection; // Check if fields is specified. if ($fields) { $url .= '?fields=' . $fields; } // Check if max is specified. if ($max != 10) { $url .= (strpos($url, '?') === false) ? '?maxResults=' : '&maxResults='; $url .= $max; } // Check of token is specified. if ($token) { $url .= (strpos($url, '?') === false) ? '?pageToken=' : '&pageToken='; $url .= $token; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } } PK���\`8�� "libraries/joomla/google/google.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform class for interacting with the Google APIs. * * @property-read JGoogleData $data Google API object for data. * @property-read JGoogleEmbed $embed Google API object for embed generation. * * @since 12.3 */ class JGoogle { /** * @var Registry Options for the Google object. * @since 12.3 */ protected $options; /** * @var JGoogleAuth The authentication client object to use in sending authenticated HTTP requests. * @since 12.3 */ protected $auth; /** * @var JGoogleData Google API object for data request. * @since 12.3 */ protected $data; /** * @var JGoogleEmbed Google API object for embed generation. * @since 12.3 */ protected $embed; /** * Constructor. * * @param Registry $options Google options object. * @param JGoogleAuth $auth The authentication client object. * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { $this->options = isset($options) ? $options : new Registry; $this->auth = isset($auth) ? $auth : new JGoogleAuthOauth2($this->options); } /** * Method to create JGoogleData objects * * @param string $name Name of property to retrieve * @param Registry $options Google options object. * @param JGoogleAuth $auth The authentication client object. * * @return JGoogleData Google data API object. * * @since 12.3 */ public function data($name, $options = null, $auth = null) { if ($this->options && !$options) { $options = $this->options; } if ($this->auth && !$auth) { $auth = $this->auth; } switch ($name) { case 'plus': case 'Plus': return new JGoogleDataPlus($options, $auth); case 'picasa': case 'Picasa': return new JGoogleDataPicasa($options, $auth); case 'adsense': case 'Adsense': return new JGoogleDataAdsense($options, $auth); case 'calendar': case 'Calendar': return new JGoogleDataCalendar($options, $auth); default: return null; } } /** * Method to create JGoogleEmbed objects * * @param string $name Name of property to retrieve * @param Registry $options Google options object. * * @return JGoogleEmbed Google embed API object. * * @since 12.3 */ public function embed($name, $options = null) { if ($this->options && !$options) { $options = $this->options; } switch ($name) { case 'maps': case 'Maps': return new JGoogleEmbedMaps($options); case 'analytics': case 'Analytics': return new JGoogleEmbedAnalytics($options); default: return null; } } /** * Get an option from the JGoogle instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 12.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JGoogle instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JGoogle This object for method chaining. * * @since 12.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\�{� libraries/joomla/google/data.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google API data class for the Joomla Platform. * * @since 12.3 */ abstract class JGoogleData { /** * @var Registry Options for the Google data object. * @since 12.3 */ protected $options; /** * @var JGoogleAuth Authentication client for the Google data object. * @since 12.3 */ protected $auth; /** * Constructor. * * @param Registry $options Google options object. * @param JGoogleAuth $auth Google data http client object. * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { $this->options = isset($options) ? $options : new Registry; $this->auth = isset($auth) ? $auth : new JGoogleAuthOauth2($this->options); } /** * Method to authenticate to Google * * @return boolean True on success. * * @since 12.3 */ public function authenticate() { return $this->auth->authenticate(); } /** * Check authentication * * @return boolean True if authenticated. * * @since 12.3 */ public function isAuthenticated() { return $this->auth->isAuthenticated(); } /** * Method to validate XML * * @param string $data XML data to be parsed * * @return SimpleXMLElement XMLElement of parsed data * * @since 12.3 * @throws UnexpectedValueException */ protected static function safeXml($data) { try { return new SimpleXMLElement($data, LIBXML_NOWARNING | LIBXML_NOERROR); } catch (Exception $e) { throw new UnexpectedValueException("Unexpected data received from Google: `$data`."); } } /** * Method to retrieve a list of data * * @param array $url URL to GET * @param int $maxpages Maximum number of pages to return * @param string $token Next page token * * @return mixed Data from Google * * @since 12.3 * @throws UnexpectedValueException */ protected function listGetData($url, $maxpages = 1, $token = null) { $qurl = $url; if (strpos($url, '&') && isset($token)) { $qurl .= '&pageToken=' . $token; } elseif (isset($token)) { $qurl .= 'pageToken=' . $token; } $jdata = $this->query($qurl); $data = json_decode($jdata->body, true); if ($data && array_key_exists('items', $data)) { if ($maxpages != 1 && array_key_exists('nextPageToken', $data)) { $data['items'] = array_merge($data['items'], $this->listGetData($url, $maxpages - 1, $data['nextPageToken'])); } return $data['items']; } elseif ($data) { return array(); } else { throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`."); } } /** * Method to retrieve data from Google * * @param string $url The URL for the request. * @param mixed $data The data to include in the request. * @param array $headers The headers to send with the request. * @param string $method The type of http request to send. * * @return mixed Data from Google. * * @since 12.3 */ protected function query($url, $data = null, $headers = null, $method = 'get') { return $this->auth->query($url, $data, $headers, $method); } /** * Get an option from the JGoogleData instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 12.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JGoogleData instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JGoogleData This object for method chaining. * * @since 12.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\����� � !libraries/joomla/google/embed.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; jimport('joomla.environment.uri'); /** * Google API object class for the Joomla Platform. * * @since 12.3 */ abstract class JGoogleEmbed { /** * @var Registry Options for the Google data object. * @since 12.3 */ protected $options; /** * @var JUri URI of the page being rendered. * @since 12.3 */ protected $uri; /** * Constructor. * * @param Registry $options Google options object * @param JUri $uri URL of the page being rendered * * @since 12.3 */ public function __construct(Registry $options = null, JUri $uri = null) { $this->options = $options ? $options : new Registry; $this->uri = $uri ? $uri : new JUri; } /** * Method to retrieve the javascript header for the embed API * * @return string The header * * @since 12.3 */ public function isSecure() { return $this->uri->getScheme() == 'https'; } /** * Method to retrieve the header for the API * * @return string The header * * @since 12.3 */ abstract public function getHeader(); /** * Method to retrieve the body for the API * * @return string The body * * @since 12.3 */ abstract public function getBody(); /** * Method to output the javascript header for the embed API * * @return null * * @since 12.3 */ public function echoHeader() { echo $this->getHeader(); } /** * Method to output the body for the API * * @return null * * @since 12.3 */ public function echoBody() { echo $this->getBody(); } /** * Get an option from the JGoogleEmbed instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 12.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JGoogleEmbed instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JGoogleEmbed This object for method chaining. * * @since 12.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\E�:2��'libraries/joomla/google/auth/oauth2.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; jimport('joomla.oauth.v2client'); /** * Google OAuth authentication class * * @since 12.3 */ class JGoogleAuthOauth2 extends JGoogleAuth { /** * @var JOAuth2Client OAuth client for the Google authentication object. * @since 12.3 */ protected $client; /** * Constructor. * * @param Registry $options JGoogleAuth options object. * @param JOAuth2Client $client OAuth client for Google authentication. * * @since 12.3 */ public function __construct(Registry $options = null, JOAuth2Client $client = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JOAuth2Client($this->options); } /** * Method to authenticate to Google * * @return boolean True on success. * * @since 12.3 */ public function authenticate() { $this->googlize(); return $this->client->authenticate(); } /** * Verify if the client has been authenticated * * @return boolean Is authenticated * * @since 12.3 */ public function isAuthenticated() { return $this->client->isAuthenticated(); } /** * Method to retrieve data from Google * * @param string $url The URL for the request. * @param mixed $data The data to include in the request. * @param array $headers The headers to send with the request. * @param string $method The type of http request to send. * * @return mixed Data from Google. * * @since 12.3 */ public function query($url, $data = null, $headers = null, $method = 'get') { $this->googlize(); return $this->client->query($url, $data, $headers, $method); } /** * Method to fill in Google-specific OAuth settings * * @return JOAuth2Client Google-configured Oauth2 client. * * @since 12.3 */ protected function googlize() { if (!$this->client->getOption('authurl')) { $this->client->setOption('authurl', 'https://accounts.google.com/o/oauth2/auth'); } if (!$this->client->getOption('tokenurl')) { $this->client->setOption('tokenurl', 'https://accounts.google.com/o/oauth2/token'); } if (!$this->client->getOption('requestparams')) { $this->client->setOption('requestparams', Array()); } $params = $this->client->getOption('requestparams'); if (!array_key_exists('access_type', $params)) { $params['access_type'] = 'offline'; } if ($params['access_type'] == 'offline' && $this->client->getOption('userefresh') === null) { $this->client->setOption('userefresh', true); } if (!array_key_exists('approval_prompt', $params)) { $params['approval_prompt'] = 'auto'; } $this->client->setOption('requestparams', $params); return $this->client; } } PK���\:��?�� libraries/joomla/google/auth.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Google authentication class abstract * * @since 12.3 */ abstract class JGoogleAuth { /** * @var \Joomla\Registry\Registry Options for the Google authentication object. * @since 12.3 */ protected $options; /** * Abstract method to authenticate to Google * * @return boolean True on success. * * @since 12.3 */ abstract public function authenticate(); /** * Verify if the client has been authenticated * * @return boolean Is authenticated * * @since 12.3 */ abstract public function isAuthenticated(); /** * Abstract method to retrieve data from Google * * @param string $url The URL for the request. * @param mixed $data The data to include in the request. * @param array $headers The headers to send with the request. * @param string $method The type of http request to send. * * @return mixed Data from Google. * * @since 12.3 */ abstract public function query($url, $data = null, $headers = null, $method = 'get'); /** * Get an option from the JGoogleAuth object. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 12.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JGoogleAuth object. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JGoogleAuth This object for method chaining. * * @since 12.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\�f-S�8�8&libraries/joomla/google/embed/maps.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google Maps embed class for the Joomla Platform. * * @since 12.3 */ class JGoogleEmbedMaps extends JGoogleEmbed { /** * @var JHttp The HTTP client object to use in sending HTTP requests. * @since 12.3 */ protected $http; /** * Constructor. * * @param Registry $options Google options object * @param JUri $uri URL of the page being rendered * @param JHttp $http Http client for geocoding requests * * @since 12.3 */ public function __construct(Registry $options = null, JUri $uri = null, JHttp $http = null) { parent::__construct($options, $uri); $this->http = $http ? $http : new JHttp($this->options); } /** * Method to get the API key * * @return string The Google Maps API key * * @since 12.3 */ public function getKey() { return $this->getOption('key'); } /** * Method to set the API key * * @param string $key The Google Maps API key * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function setKey($key) { $this->setOption('key', $key); return $this; } /** * Method to get the id of the map div * * @return string The ID * * @since 12.3 */ public function getMapId() { return $this->getOption('mapid') ? $this->getOption('mapid') : 'map_canvas'; } /** * Method to set the map div id * * @param string $id The ID * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function setMapId($id) { $this->setOption('mapid', $id); return $this; } /** * Method to get the class of the map div * * @return string The class * * @since 12.3 */ public function getMapClass() { return $this->getOption('mapclass') ? $this->getOption('mapclass') : ''; } /** * Method to set the map div class * * @param string $class The class * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function setMapClass($class) { $this->setOption('mapclass', $class); return $this; } /** * Method to get the style of the map div * * @return string The style * * @since 12.3 */ public function getMapStyle() { return $this->getOption('mapstyle') ? $this->getOption('mapstyle') : ''; } /** * Method to set the map div style * * @param string $style The style * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function setMapStyle($style) { $this->setOption('mapstyle', $style); return $this; } /** * Method to get the map type setting * * @return string The class * * @since 12.3 */ public function getMapType() { return $this->getOption('maptype') ? $this->getOption('maptype') : 'ROADMAP'; } /** * Method to set the map type () * * @param string $type Valid types are ROADMAP, SATELLITE, HYBRID, and TERRAIN * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function setMapType($type) { $this->setOption('maptype', strtoupper($type)); return $this; } /** * Method to get additional map options * * @return string The options * * @since 12.3 */ public function getAdditionalMapOptions() { return $this->getOption('mapoptions') ? $this->getOption('mapoptions') : array(); } /** * Method to add additional map options * * @param array $options Additional map options * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function setAdditionalMapOptions($options) { $this->setOption('mapoptions', $options); return $this; } /** * Method to get additional map options * * @return string The options * * @since 12.3 */ public function getAdditionalJavascript() { return $this->getOption('extrascript') ? $this->getOption('extrascript') : ''; } /** * Method to add additional javascript * * @param array $script Additional javascript * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function setAdditionalJavascript($script) { $this->setOption('extrascript', $script); return $this; } /** * Method to get the zoom * * @return int The zoom level * * @since 12.3 */ public function getZoom() { return $this->getOption('zoom') ? $this->getOption('zoom') : 0; } /** * Method to set the map zoom * * @param int $zoom Zoom level (0 is whole world) * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function setZoom($zoom) { $this->setOption('zoom', $zoom); return $this; } /** * Method to set the center of the map * * @return mixed A latitude longitude array or an address string * * @since 12.3 */ public function getCenter() { return $this->getOption('mapcenter') ? $this->getOption('mapcenter') : array(0, 0); } /** * Method to set the center of the map * * @param mixed $location A latitude/longitude array or an address string * @param mixed $title Title of marker or false for no marker * @param array $markeroptions Options for marker * * @return JGoogleEmbedMaps The latitude/longitude of the center or false on failure * * @since 12.3 */ public function setCenter($location, $title = true, $markeroptions = array()) { if ($title) { $title = is_string($title) ? $title : null; if (!$marker = $this->addMarker($location, $title, $markeroptions)) { return false; } $location = $marker['loc']; } elseif (is_string($location)) { $geocode = $this->geocodeAddress($location); if (!$geocode) { return false; } $location = $geocode['geometry']['location']; $location = array_values($location); } $this->setOption('mapcenter', $location); return $this; } /** * Add a marker to the map * * @param mixed $location A latitude longitude array or an address string * @param mixed $title The hover-text for the marker * @param array $options Options for marker * * @return mixed The marker or false on failure * * @since 12.3 */ public function addMarker($location, $title = null, $options = array()) { if (is_string($location)) { if (!$title) { $title = $location; } $geocode = $this->geocodeAddress($location); if (!$geocode) { return false; } $location = $geocode['geometry']['location']; } elseif (!$title) { $title = implode(', ', $location); } $location = array_values($location); $marker = array('loc' => $location, 'title' => $title, 'options' => $options); $markers = $this->listMarkers(); $markers[] = $marker; $this->setOption('markers', $markers); return $marker; } /** * List the markers added to the map * * @return array A list of markers * * @since 12.3 */ public function listMarkers() { return $this->getOption('markers') ? $this->getOption('markers') : array(); } /** * Delete a marker from the map * * @param int $index Index of marker to delete (defaults to last added marker) * * @return array The latitude/longitude of the deleted marker * * @since 12.3 */ public function deleteMarker($index = null) { $markers = $this->listMarkers(); if ($index === null) { $index = count($markers) - 1; } if ($index >= count($markers) || $index < 0) { throw new OutOfBoundsException('Marker index out of bounds.'); } $marker = $markers[$index]; unset($markers[$index]); $markers = array_values($markers); $this->setOption('markers', $markers); return $marker; } /** * Checks if the javascript is set to be asynchronous * * @return boolean True if asynchronous * * @since 12.3 */ public function isAsync() { return $this->getOption('async') === null ? true : $this->getOption('async'); } /** * Load javascript asynchronously * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function useAsync() { $this->setOption('async', true); return $this; } /** * Load javascript synchronously * * @return JGoogleEmbedAMaps The object for method chaining * * @since 12.3 */ public function useSync() { $this->setOption('async', false); return $this; } /** * Method to get callback function for async javascript loading * * @return string The ID * * @since 12.3 */ public function getAsyncCallback() { return $this->getOption('callback') ? $this->getOption('callback') : 'initialize'; } /** * Method to set the callback function for async javascript loading * * @param string $callback The callback function name * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function setAsyncCallback($callback) { $this->setOption('callback', $callback); return $this; } /** * Checks if a sensor is set to be required * * @return boolean True if asynchronous * * @since 12.3 */ public function hasSensor() { return $this->getOption('sensor') === null ? false : $this->getOption('sensor'); } /** * Require access to sensor data * * @return JGoogleEmbedMaps The object for method chaining * * @since 12.3 */ public function useSensor() { $this->setOption('sensor', true); return $this; } /** * Don't require access to sensor data * * @return JGoogleEmbedAMaps The object for method chaining * * @since 12.3 */ public function noSensor() { $this->setOption('sensor', false); return $this; } /** * Checks how the script should be loaded * * @return string Autoload type (onload, jquery, mootools, or false) * * @since 12.3 */ public function getAutoload() { return $this->getOption('autoload') ? $this->getOption('autoload') : 'false'; } /** * Automatically add the callback to the window * * @param string $type The method to add the callback (options are onload, jquery, mootools, and false) * * @return JGoogleEmbedAMaps The object for method chaining * * @since 12.3 */ public function setAutoload($type = 'onload') { $this->setOption('autoload', $type); return $this; } /** * Get code to load Google Maps javascript * * @return string Javascript code * * @since 12.3 */ public function getHeader() { $zoom = $this->getZoom(); $center = $this->getCenter(); $maptype = $this->getMapType(); $id = $this->getMapId(); $scheme = $this->isSecure() ? 'https' : 'http'; $key = $this->getKey(); $sensor = $this->hasSensor() ? 'true' : 'false'; $setup = 'var mapOptions = {'; $setup .= "zoom: {$zoom},"; $setup .= "center: new google.maps.LatLng({$center[0]},{$center[1]}),"; $setup .= "mapTypeId: google.maps.MapTypeId.{$maptype},"; $setup .= substr(json_encode($this->getAdditionalMapOptions()), 1, -1); $setup .= '};'; $setup .= "var map = new google.maps.Map(document.getElementById('{$id}'), mapOptions);"; foreach ($this->listMarkers() as $marker) { $loc = $marker['loc']; $title = $marker['title']; $options = $marker['options']; $setup .= 'new google.maps.Marker({'; $setup .= "position: new google.maps.LatLng({$loc[0]},{$loc[1]}),"; $setup .= 'map: map,'; $setup .= "title:'{$title}',"; $setup .= substr(json_encode($options), 1, -1); $setup .= '});'; } $setup .= $this->getAdditionalJavascript(); if ($this->isAsync()) { $asynccallback = $this->getAsyncCallback(); $output = '<script type="text/javascript">'; $output .= "function {$asynccallback}() {"; $output .= $setup; $output .= '}'; $onload = "function() {"; $onload .= 'var script = document.createElement("script");'; $onload .= 'script.type = "text/javascript";'; $onload .= "script.src = '{$scheme}://maps.googleapis.com/maps/api/js?" . ($key ? "key={$key}&" : "") . "sensor={$sensor}&callback={$asynccallback}';"; $onload .= 'document.body.appendChild(script);'; $onload .= '}'; } else { $output = "<script type='text/javascript' src='{$scheme}://maps.googleapis.com/maps/api/js?" . ($key ? "key={$key}&" : "") . "sensor={$sensor}'>"; $output .= '</script>'; $output .= '<script type="text/javascript">'; $onload = "function() {"; $onload .= $setup; $onload .= '}'; } switch ($this->getAutoload()) { case 'onload': $output .= "window.onload={$onload};"; break; case 'jquery': $output .= "jQuery(document).ready({$onload});"; break; case 'mootools': $output .= "window.addEvent('domready',{$onload});"; break; } $output .= '</script>'; return $output; } /** * Method to retrieve the div that the map is loaded into * * @return string The body * * @since 12.3 */ public function getBody() { $id = $this->getMapId(); $class = $this->getMapClass(); $style = $this->getMapStyle(); $output = "<div id='{$id}'"; if (!empty($class)) { $output .= " class='{$class}'"; } if (!empty($style)) { $output .= " style='{$style}'"; } $output .= '></div>'; return $output; } /** * Method to get the location information back from an address * * @param string $address The address to geocode * * @return array An array containing Google's geocode data * * @since 12.3 */ public function geocodeAddress($address) { $url = 'http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=' . urlencode($address); $response = $this->http->get($url); if ($response->code < 200 || $response->code >= 300) { throw new RuntimeException('Error code ' . $response->code . ' received geocoding address: ' . $response->body . '.'); } $data = json_decode($response->body, true); if (!$data) { throw new RuntimeException('Invalid json received geocoding address: ' . $response->body . '.'); } if ($data['status'] != 'OK') { if (!empty($data['error_message'])) { throw new RuntimeException($data['error_message']); } return null; } return $data['results'][0]; } } PK���\"4�{��+libraries/joomla/google/embed/analytics.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Google Analytics embed class for the Joomla Platform. * * @since 12.3 */ class JGoogleEmbedAnalytics extends JGoogleEmbed { /** * Method to get the tracking code * * @return string The Google Analytics tracking code * * @since 12.3 */ public function getCode() { return $this->getOption('code'); } /** * Method to set the tracking code * * @param string $code The Google Analytics tracking code * * @return JGoogleEmbedAnalytics The object for method chaining * * @since 12.3 */ public function setCode($code) { $this->setOption('code', $code); return $this; } /** * Checks if the javascript is set to be asynchronous * * @return boolean True if asynchronous * * @since 12.3 */ public function isAsync() { return $this->getOption('async') === null ? true : $this->getOption('async'); } /** * Load javascript asynchronously * * @return JGoogleEmbedAnalytics The object for method chaining * * @since 12.3 */ public function useAsync() { $this->setOption('async', true); return $this; } /** * Load javascript synchronously * * @return JGoogleEmbedAnalytics The object for method chaining * * @since 12.3 */ public function useSync() { $this->setOption('async', false); return $this; } /** * Add an analytics call * * @param string $method The name of the function * @param array $params The parameters for the call * * @return array The added call * * @since 12.3 */ public function addCall($method, $params = array()) { $call = array('name' => $method, 'params' => $params); $calls = $this->listCalls(); $calls[] = $call; $this->setOption('calls', $calls); return $call; } /** * List the analytics calls to be executed * * @return array A list of calls * * @since 12.3 */ public function listCalls() { return $this->getOption('calls') ? $this->getOption('calls') : array(); } /** * Delete a call from the stack * * @param int $index Index of call to delete (defaults to last added call) * * @return array The deleted call * * @since 12.3 */ public function deleteCall($index = null) { $calls = $this->listCalls(); if ($index === null) { $index = count($calls) - 1; } $call = $calls[$index]; unset($calls[$index]); $calls = array_values($calls); $this->setOption('calls', $calls); return $call; } /** * Create a javascript function from the call parameters * * @param string $method The name of the function * @param array $params The parameters for the call * * @return string The created call * * @since 12.3 */ public function createCall($method, $params = array()) { $params = array_values($params); if ($this->isAsync()) { $output = "_gaq.push(['{$method}',"; $output .= substr(json_encode($params), 1, -1); $output .= ']);'; } else { $output = "pageTracker.{$method}("; $output .= substr(json_encode($params), 1, -1); $output .= ');'; } return $output; } /** * Add a custom variable to the analytics * * @param int $slot The slot to store the variable in (1-5) * @param string $name The variable name * @param string $value The variable value * @param int $scope The scope of the variable (1: visitor level, 2: session level, 3: page level) * * @return array The added call * * @since 12.3 */ public function addCustomVar($slot, $name, $value, $scope = 3) { return $this->addCall('_setCustomVar', array($slot, $name, $value, $scope)); } /** * Get the code to create a custom analytics variable * * @param int $slot The slot to store the variable in (1-5) * @param string $name The variable name * @param string $value The variable value * @param int $scope The scope of the variable (1: visitor level, 2: session level, 3: page level) * * @return string The created call * * @since 12.3 */ public function createCustomVar($slot, $name, $value, $scope = 3) { return $this->createCall('_setCustomVar', array($slot, $name, $value, $scope)); } /** * Track an analytics event * * @param string $category The general event category * @param string $action The event action * @param string $label The event description * @param string $value The value of the event * @param boolean $noninteract Don't allow this event to impact bounce statistics * * @return array The added call * * @since 12.3 */ public function addEvent($category, $action, $label = null, $value = null, $noninteract = false) { return $this->addCall('_trackEvent', array($category, $action, $label, $value, $noninteract)); } /** * Get the code to track an analytics event * * @param string $category The general event category * @param string $action The event action * @param string $label The event description * @param string $value The value of the event * @param boolean $noninteract Don't allow this event to impact bounce statistics * * @return string The created call * * @since 12.3 */ public function createEvent($category, $action, $label = null, $value = null, $noninteract = false) { return $this->createCall('_trackEvent', array($category, $action, $label, $value, $noninteract)); } /** * Get code to load Google Analytics javascript * * @return string Javascript code * * @since 12.3 */ public function getHeader() { if (!$this->isAsync()) { // Synchronous code is included only in the body return ''; } if (!$this->getOption('code')) { throw new UnexpectedValueException('A Google Analytics tracking code is required.'); } $code = $this->getOption('code'); $output = '<script type="text/javascript">'; $output .= 'var _gaq = _gaq || [];'; $output .= "_gaq.push(['_setAccount', '{$code}']);"; foreach ($this->listCalls() as $call) { $output .= $this->createCall($call['name'], $call['params']); } $output .= '_gaq.push(["_trackPageview"]);'; $output .= '</script>'; return $output; } /** * Google Analytics only needs to be included in the header * * @return null * * @since 12.3 */ public function getBody() { if (!$this->getOption('code')) { throw new UnexpectedValueException('A Google Analytics tracking code is required.'); } $prefix = $this->isSecure() ? 'https://ssl' : 'http://www'; $code = $this->getOption('code'); if ($this->isAsync()) { $output = '<script type="text/javascript">'; $output .= '(function() {'; $output .= 'var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;'; $output .= "ga.src = '{$prefix}.google-analytics.com/ga.js';"; $output .= 'var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);'; $output .= '})();'; $output .= '</script>'; } else { $output = '<script type="text/javascript">'; $output .= "document.write(unescape(\"%3Cscript src='{$prefix}.google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));"; $output .= '</script>'; $output .= '<script type="text/javascript">'; $output .= 'try{'; $output .= "var pageTracker = _gat._getTracker('{$code}');"; foreach ($this->listCalls() as $call) { $output .= $this->createCall($call['name'], $call['params']); } $output .= 'pageTracker._trackPageview();'; $output .= '} catch(err) {}</script>'; } return $output; } } PK���\��$7$7"libraries/joomla/oauth1/client.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage OAuth1 * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Joomla Platform class for interacting with an OAuth 1.0 and 1.0a server. * * @since 13.1 */ abstract class JOAuth1Client { /** * @var Registry Options for the JOAuth1Client object. * @since 13.1 */ protected $options; /** * @var array Contains access token key, secret and verifier. * @since 13.1 */ protected $token = array(); /** * @var JHttp The HTTP client object to use in sending HTTP requests. * @since 13.1 */ protected $client; /** * @var JInput The input object to use in retrieving GET/POST data. * @since 13.1 */ protected $input; /** * @var JApplicationWeb The application object to send HTTP headers for redirects. * @since 13.1 */ protected $application; /** * @var string Selects which version of OAuth to use: 1.0 or 1.0a. * @since 13.1 */ protected $version; /** * Constructor. * * @param Registry $options OAuth1Client options object. * @param JHttp $client The HTTP client object. * @param JInput $input The input object * @param JApplicationWeb $application The application object * @param string $version Specify the OAuth version. By default we are using 1.0a. * * @since 13.1 */ public function __construct(Registry $options = null, JHttp $client = null, JInput $input = null, JApplicationWeb $application = null, $version = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : JHttpFactory::getHttp($this->options); $this->input = isset($input) ? $input : JFactory::getApplication()->input; $this->application = isset($application) ? $application : new JApplicationWeb; $this->version = isset($version) ? $version : '1.0a'; } /** * Method to for the oauth flow. * * @return array Contains access token key, secret and verifier. * * @since 13.1 * @throws DomainException */ public function authenticate() { // Already got some credentials stored? if ($this->token) { $response = $this->verifyCredentials(); if ($response) { return $this->token; } else { $this->token = null; } } // Check for callback. if (strcmp($this->version, '1.0a') === 0) { $verifier = $this->input->get('oauth_verifier'); } else { $verifier = $this->input->get('oauth_token'); } if (empty($verifier)) { // Generate a request token. $this->_generateRequestToken(); // Authenticate the user and authorise the app. $this->_authorise(); } // Callback else { $session = JFactory::getSession(); // Get token form session. $this->token = array('key' => $session->get('key', null, 'oauth_token'), 'secret' => $session->get('secret', null, 'oauth_token')); // Verify the returned request token. if (strcmp($this->token['key'], $this->input->get('oauth_token')) !== 0) { throw new DomainException('Bad session!'); } // Set token verifier for 1.0a. if (strcmp($this->version, '1.0a') === 0) { $this->token['verifier'] = $this->input->get('oauth_verifier'); } // Generate access token. $this->_generateAccessToken(); // Return the access token. return $this->token; } } /** * Method used to get a request token. * * @return void * * @since 13.1 * @throws DomainException */ private function _generateRequestToken() { // Set the callback URL. if ($this->getOption('callback')) { $parameters = array( 'oauth_callback' => $this->getOption('callback') ); } else { $parameters = array(); } // Make an OAuth request for the Request Token. $response = $this->oauthRequest($this->getOption('requestTokenURL'), 'POST', $parameters); parse_str($response->body, $params); if (strcmp($this->version, '1.0a') === 0 && strcmp($params['oauth_callback_confirmed'], 'true') !== 0) { throw new DomainException('Bad request token!'); } // Save the request token. $this->token = array('key' => $params['oauth_token'], 'secret' => $params['oauth_token_secret']); // Save the request token in session $session = JFactory::getSession(); $session->set('key', $this->token['key'], 'oauth_token'); $session->set('secret', $this->token['secret'], 'oauth_token'); } /** * Method used to authorise the application. * * @return void * * @since 13.1 */ private function _authorise() { $url = $this->getOption('authoriseURL') . '?oauth_token=' . $this->token['key']; if ($this->getOption('scope')) { $scope = is_array($this->getOption('scope')) ? implode(' ', $this->getOption('scope')) : $this->getOption('scope'); $url .= '&scope=' . urlencode($scope); } if ($this->getOption('sendheaders')) { $this->application->redirect($url); } } /** * Method used to get an access token. * * @return void * * @since 13.1 */ private function _generateAccessToken() { // Set the parameters. $parameters = array( 'oauth_token' => $this->token['key'] ); if (strcmp($this->version, '1.0a') === 0) { $parameters = array_merge($parameters, array('oauth_verifier' => $this->token['verifier'])); } // Make an OAuth request for the Access Token. $response = $this->oauthRequest($this->getOption('accessTokenURL'), 'POST', $parameters); parse_str($response->body, $params); // Save the access token. $this->token = array('key' => $params['oauth_token'], 'secret' => $params['oauth_token_secret']); } /** * Method used to make an OAuth request. * * @param string $url The request URL. * @param string $method The request method. * @param array $parameters Array containing request parameters. * @param mixed $data The POST request data. * @param array $headers An array of name-value pairs to include in the header of the request * * @return JHttpResponse * * @since 13.1 * @throws DomainException */ public function oauthRequest($url, $method, $parameters, $data = array(), $headers = array()) { // Set the parameters. $defaults = array( 'oauth_consumer_key' => $this->getOption('consumer_key'), 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_version' => '1.0', 'oauth_nonce' => $this->generateNonce(), 'oauth_timestamp' => time() ); $parameters = array_merge($parameters, $defaults); // Do not encode multipart parameters. Do not include $data in the signature if $data is not array. if (isset($headers['Content-Type']) && strpos($headers['Content-Type'], 'multipart/form-data') !== false || !is_array($data)) { $oauth_headers = $parameters; } else { // Use all parameters for the signature. $oauth_headers = array_merge($parameters, $data); } // Sign the request. $oauth_headers = $this->_signRequest($url, $method, $oauth_headers); // Get parameters for the Authorisation header. if (is_array($data)) { $oauth_headers = array_diff_key($oauth_headers, $data); } // Send the request. switch ($method) { case 'GET': $url = $this->toUrl($url, $data); $response = $this->client->get($url, array('Authorization' => $this->_createHeader($oauth_headers))); break; case 'POST': $headers = array_merge($headers, array('Authorization' => $this->_createHeader($oauth_headers))); $response = $this->client->post($url, $data, $headers); break; case 'PUT': $headers = array_merge($headers, array('Authorization' => $this->_createHeader($oauth_headers))); $response = $this->client->put($url, $data, $headers); break; case 'DELETE': $headers = array_merge($headers, array('Authorization' => $this->_createHeader($oauth_headers))); $response = $this->client->delete($url, $headers); break; } // Validate the response code. $this->validateResponse($url, $response); return $response; } /** * Method to validate a response. * * @param string $url The request URL. * @param JHttpResponse $response The response to validate. * * @return void * * @since 13.1 * @throws DomainException */ abstract public function validateResponse($url, $response); /** * Method used to create the header for the POST request. * * @param array $parameters Array containing request parameters. * * @return string The header. * * @since 13.1 */ private function _createHeader($parameters) { $header = 'OAuth '; foreach ($parameters as $key => $value) { if (!strcmp($header, 'OAuth ')) { $header .= $key . '="' . $this->safeEncode($value) . '"'; } else { $header .= ', ' . $key . '="' . $value . '"'; } } return $header; } /** * Method to create the URL formed string with the parameters. * * @param string $url The request URL. * @param array $parameters Array containing request parameters. * * @return string The formed URL. * * @since 13.1 */ public function toUrl($url, $parameters) { foreach ($parameters as $key => $value) { if (is_array($value)) { foreach ($value as $v) { if (strpos($url, '?') === false) { $url .= '?' . $key . '=' . $v; } else { $url .= '&' . $key . '=' . $v; } } } else { if (strpos($value, ' ') !== false) { $value = $this->safeEncode($value); } if (strpos($url, '?') === false) { $url .= '?' . $key . '=' . $value; } else { $url .= '&' . $key . '=' . $value; } } } return $url; } /** * Method used to sign requests. * * @param string $url The URL to sign. * @param string $method The request method. * @param array $parameters Array containing request parameters. * * @return array * * @since 13.1 */ private function _signRequest($url, $method, $parameters) { // Create the signature base string. $base = $this->_baseString($url, $method, $parameters); $parameters['oauth_signature'] = $this->safeEncode( base64_encode( hash_hmac('sha1', $base, $this->_prepareSigningKey(), true) ) ); return $parameters; } /** * Prepare the signature base string. * * @param string $url The URL to sign. * @param string $method The request method. * @param array $parameters Array containing request parameters. * * @return string The base string. * * @since 13.1 */ private function _baseString($url, $method, $parameters) { // Sort the parameters alphabetically uksort($parameters, 'strcmp'); // Encode parameters. foreach ($parameters as $key => $value) { $key = $this->safeEncode($key); if (is_array($value)) { foreach ($value as $v) { $v = $this->safeEncode($v); $kv[] = "{$key}={$v}"; } } else { $value = $this->safeEncode($value); $kv[] = "{$key}={$value}"; } } // Form the parameter string. $params = implode('&', $kv); // Signature base string elements. $base = array( $method, $url, $params ); // Return the base string. return implode('&', $this->safeEncode($base)); } /** * Encodes the string or array passed in a way compatible with OAuth. * If an array is passed each array value will will be encoded. * * @param mixed $data The scalar or array to encode. * * @return string $data encoded in a way compatible with OAuth. * * @since 13.1 */ public function safeEncode($data) { if (is_array($data)) { return array_map(array($this, 'safeEncode'), $data); } elseif (is_scalar($data)) { return str_ireplace( array('+', '%7E'), array(' ', '~'), rawurlencode($data) ); } else { return ''; } } /** * Method used to generate the current nonce. * * @return string The current nonce. * * @since 13.1 */ public static function generateNonce() { $mt = microtime(); $rand = JCrypt::genRandomBytes(); // The md5s look nicer than numbers. return md5($mt . $rand); } /** * Prepares the OAuth signing key. * * @return string The prepared signing key. * * @since 13.1 */ private function _prepareSigningKey() { return $this->safeEncode($this->getOption('consumer_secret')) . '&' . $this->safeEncode(($this->token) ? $this->token['secret'] : ''); } /** * Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; * returns a 401 status code and an error message if not. * * @return array The decoded JSON response * * @since 13.1 */ abstract public function verifyCredentials(); /** * Get an option from the JOauth1aClient instance. * * @param string $key The name of the option to get * * @return mixed The option value * * @since 13.1 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JOauth1aClient instance. * * @param string $key The name of the option to set * @param mixed $value The option value to set * * @return JOAuth1Client This object for method chaining * * @since 13.1 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } /** * Get the oauth token key or secret. * * @return array The oauth token key and secret. * * @since 13.1 */ public function getToken() { return $this->token; } /** * Set the oauth token. * * @param array $token The access token key and secret. * * @return JOAuth1Client This object for method chaining. * * @since 13.1 */ public function setToken($token) { $this->token = $token; return $this; } } PK���\�u��� � $libraries/joomla/controller/base.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Controller * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Base Controller Class * * @since 12.1 */ abstract class JControllerBase implements JController { /** * The application object. * * @var JApplicationBase * @since 12.1 */ protected $app; /** * The input object. * * @var JInput * @since 12.1 */ protected $input; /** * Instantiate the controller. * * @param JInput $input The input object. * @param JApplicationBase $app The application object. * * @since 12.1 */ public function __construct(JInput $input = null, JApplicationBase $app = null) { // Setup dependencies. $this->app = isset($app) ? $app : $this->loadApplication(); $this->input = isset($input) ? $input : $this->loadInput(); } /** * Get the application object. * * @return JApplicationBase The application object. * * @since 12.1 */ public function getApplication() { return $this->app; } /** * Get the input object. * * @return JInput The input object. * * @since 12.1 */ public function getInput() { return $this->input; } /** * Serialize the controller. * * @return string The serialized controller. * * @since 12.1 */ public function serialize() { return serialize($this->input); } /** * Unserialize the controller. * * @param string $input The serialized controller. * * @return JController Supports chaining. * * @since 12.1 * @throws UnexpectedValueException if input is not the right class. */ public function unserialize($input) { // Setup dependencies. $this->app = $this->loadApplication(); // Unserialize the input. $this->input = unserialize($input); if (!($this->input instanceof JInput)) { throw new UnexpectedValueException(sprintf('%s::unserialize would not accept a `%s`.', get_class($this), gettype($this->input))); } return $this; } /** * Load the application object. * * @return JApplicationBase The application object. * * @since 12.1 */ protected function loadApplication() { return JFactory::getApplication(); } /** * Load the input object. * * @return JInput The input object. * * @since 12.1 */ protected function loadInput() { return $this->app->input; } } PK���\����MM*libraries/joomla/controller/controller.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Controller * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Controller Interface * * @since 12.1 */ interface JController extends Serializable { /** * Execute the controller. * * @return boolean True if controller finished execution, false if the controller did not * finish execution. A controller might return false if some precondition for * the controller to run has not been satisfied. * * @since 12.1 * @throws LogicException * @throws RuntimeException */ public function execute(); /** * Get the application object. * * @return JApplicationBase The application object. * * @since 12.1 */ public function getApplication(); /** * Get the input object. * * @return \Joomla\Input\Input The input object. * * @since 12.1 */ public function getInput(); } PK���\�k����%libraries/joomla/utilities/buffer.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Utilities * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Generic Buffer stream handler * * This class provides a generic buffer stream. It can be used to store/retrieve/manipulate * string buffers with the standard PHP filesystem I/O methods. * * @since 11.1 */ class JBuffer { /** * Stream position * * @var integer * @since 11.1 */ public $position = 0; /** * Buffer name * * @var string * @since 11.1 */ public $name = null; /** * Buffer hash * * @var array * @since 12.1 */ public $buffers = array(); /** * Function to open file or url * * @param string $path The URL that was passed * @param string $mode Mode used to open the file @see fopen * @param integer $options Flags used by the API, may be STREAM_USE_PATH and * STREAM_REPORT_ERRORS * @param string &$opened_path Full path of the resource. Used with STREAN_USE_PATH option * * @return boolean * * @since 11.1 * @see streamWrapper::stream_open */ public function stream_open($path, $mode, $options, &$opened_path) { $url = parse_url($path); $this->name = $url['host']; $this->buffers[$this->name] = null; $this->position = 0; return true; } /** * Read stream * * @param integer $count How many bytes of data from the current position should be returned. * * @return mixed The data from the stream up to the specified number of bytes (all data if * the total number of bytes in the stream is less than $count. Null if * the stream is empty. * * @see streamWrapper::stream_read * @since 11.1 */ public function stream_read($count) { $ret = substr($this->buffers[$this->name], $this->position, $count); $this->position += strlen($ret); return $ret; } /** * Write stream * * @param string $data The data to write to the stream. * * @return integer * * @see streamWrapper::stream_write * @since 11.1 */ public function stream_write($data) { $left = substr($this->buffers[$this->name], 0, $this->position); $right = substr($this->buffers[$this->name], $this->position + strlen($data)); $this->buffers[$this->name] = $left . $data . $right; $this->position += strlen($data); return strlen($data); } /** * Function to get the current position of the stream * * @return integer * * @see streamWrapper::stream_tell * @since 11.1 */ public function stream_tell() { return $this->position; } /** * Function to test for end of file pointer * * @return boolean True if the pointer is at the end of the stream * * @see streamWrapper::stream_eof * @since 11.1 */ public function stream_eof() { return $this->position >= strlen($this->buffers[$this->name]); } /** * The read write position updates in response to $offset and $whence * * @param integer $offset The offset in bytes * @param integer $whence Position the offset is added to * Options are SEEK_SET, SEEK_CUR, and SEEK_END * * @return boolean True if updated * * @see streamWrapper::stream_seek * @since 11.1 */ public function stream_seek($offset, $whence) { switch ($whence) { case SEEK_SET: if ($offset < strlen($this->buffers[$this->name]) && $offset >= 0) { $this->position = $offset; return true; } else { return false; } break; case SEEK_CUR: if ($offset >= 0) { $this->position += $offset; return true; } else { return false; } break; case SEEK_END: if (strlen($this->buffers[$this->name]) + $offset >= 0) { $this->position = strlen($this->buffers[$this->name]) + $offset; return true; } else { return false; } break; default: return false; } } } // Register the stream stream_wrapper_register('buffer', 'JBuffer'); PK���\��,��&libraries/joomla/utilities/utility.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Utilities * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JUtility is a utility functions class * * @since 11.1 */ class JUtility { /** * Method to extract key/value pairs out of a string with XML style attributes * * @param string $string String containing XML style attributes * * @return array Key/Value pairs for the attributes * * @since 11.1 */ public static function parseAttributes($string) { $attr = array(); $retarray = array(); // Let's grab all the key/value pairs using a regular expression preg_match_all('/([\w:-]+)[\s]?=[\s]?"([^"]*)"/i', $string, $attr); if (is_array($attr)) { $numPairs = count($attr[1]); for ($i = 0; $i < $numPairs; $i++) { $retarray[$attr[1][$i]] = $attr[2][$i]; } } return $retarray; } } PK���\6A��1�1*libraries/joomla/utilities/arrayhelper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Utilities * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Utilities\ArrayHelper; /** * JArrayHelper is an array utility class for doing all sorts of odds and ends with arrays. * * @since 11.1 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper instead */ abstract class JArrayHelper { /** * Option to perform case-sensitive sorts. * * @var mixed Boolean or array of booleans. * @since 11.3 */ protected static $sortCase; /** * Option to set the sort direction. * * @var mixed Integer or array of integers. * @since 11.3 */ protected static $sortDirection; /** * Option to set the object key to sort on. * * @var string * @since 11.3 */ protected static $sortKey; /** * Option to perform a language aware sort. * * @var mixed Boolean or array of booleans. * @since 11.3 */ protected static $sortLocale; /** * Function to convert array to integer values * * @param array &$array The source array to convert * @param mixed $default A default value (int|array) to assign if $array is not an array * * @return void * * @since 11.1 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::toInteger instead */ public static function toInteger(&$array, $default = null) { if (is_array($array)) { foreach ($array as $i => $v) { $array[$i] = (int) $v; } } else { if ($default === null) { $array = array(); } elseif (is_array($default)) { self::toInteger($default, null); $array = $default; } else { $array = array((int) $default); } } } /** * Utility function to map an array to a stdClass object. * * @param array &$array The array to map. * @param string $class Name of the class to create * @param boolean $recursive Convert also any array inside the main array * * @return object The object mapped from the given array * * @since 11.1 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::toObject instead */ public static function toObject(&$array, $class = 'stdClass', $recursive = true) { $obj = null; if (is_array($array)) { $obj = ArrayHelper::toObject($array, $class, $recursive); } else { JLog::add('This method is typehinted to be an array in \Joomla\Utilities\ArrayHelper::toObject.', JLog::WARNING, 'deprecated'); } return $obj; } /** * Utility function to map an array to a string. * * @param array $array The array to map. * @param string $inner_glue The glue (optional, defaults to '=') between the key and the value. * @param string $outer_glue The glue (optional, defaults to ' ') between array elements. * @param boolean $keepOuterKey True if final key should be kept. * * @return string The string mapped from the given array * * @since 11.1 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::toString instead */ public static function toString($array = null, $inner_glue = '=', $outer_glue = ' ', $keepOuterKey = false) { $output = array(); if (is_array($array)) { $output[] = ArrayHelper::toString($array, $inner_glue, $outer_glue, $keepOuterKey); } else { JLog::add('This method is typehinted to be an array in \Joomla\Utilities\ArrayHelper::toString.', JLog::WARNING, 'deprecated'); } return implode($outer_glue, $output); } /** * Utility function to map an object to an array * * @param object $p_obj The source object * @param boolean $recurse True to recurse through multi-level objects * @param string $regex An optional regular expression to match on field names * * @return array The array mapped from the given object * * @since 11.1 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::fromObject instead */ public static function fromObject($p_obj, $recurse = true, $regex = null) { if (is_object($p_obj)) { return self::_fromObject($p_obj, $recurse, $regex); } else { return null; } } /** * Utility function to map an object or array to an array * * @param mixed $item The source object or array * @param boolean $recurse True to recurse through multi-level objects * @param string $regex An optional regular expression to match on field names * * @return array The array mapped from the given object * * @since 11.1 */ protected static function _fromObject($item, $recurse, $regex) { if (is_object($item)) { $result = array(); foreach (get_object_vars($item) as $k => $v) { if (!$regex || preg_match($regex, $k)) { if ($recurse) { $result[$k] = self::_fromObject($v, $recurse, $regex); } else { $result[$k] = $v; } } } } elseif (is_array($item)) { $result = array(); foreach ($item as $k => $v) { $result[$k] = self::_fromObject($v, $recurse, $regex); } } else { $result = $item; } return $result; } /** * Extracts a column from an array of arrays or objects * * @param array &$array The source array * @param string $index The index of the column or name of object property * * @return array Column of values from the source array * * @since 11.1 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::getColumn instead */ public static function getColumn(&$array, $index) { $result = array(); if (is_array($array)) { $result = ArrayHelper::getColumn($array, $index); } else { JLog::add('This method is typehinted to be an array in \Joomla\Utilities\ArrayHelper::getColumn.', JLog::WARNING, 'deprecated'); } return $result; } /** * Utility function to return a value from a named array or a specified default * * @param array &$array A named array * @param string $name The key to search for * @param mixed $default The default value to give if no key found * @param string $type Return type for the variable (INT, FLOAT, STRING, WORD, BOOLEAN, ARRAY) * * @return mixed The value from the source array * * @since 11.1 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::getValue instead */ public static function getValue(&$array, $name, $default = null, $type = '') { // Previously we didn't typehint an array. So force any object to be an array return ArrayHelper::getValue((array) $array, $name, $default, $type); } /** * Takes an associative array of arrays and inverts the array keys to values using the array values as keys. * * Example: * $input = array( * 'New' => array('1000', '1500', '1750'), * 'Used' => array('3000', '4000', '5000', '6000') * ); * $output = JArrayHelper::invert($input); * * Output would be equal to: * $output = array( * '1000' => 'New', * '1500' => 'New', * '1750' => 'New', * '3000' => 'Used', * '4000' => 'Used', * '5000' => 'Used', * '6000' => 'Used' * ); * * @param array $array The source array. * * @return array The inverted array. * * @since 12.3 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::invert instead */ public static function invert($array) { return ArrayHelper::invert($array); } /** * Method to determine if an array is an associative array. * * @param array $array An array to test. * * @return boolean True if the array is an associative array. * * @since 11.1 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::isAssociative instead */ public static function isAssociative($array) { return ArrayHelper::isAssociative($array); } /** * Pivots an array to create a reverse lookup of an array of scalars, arrays or objects. * * @param array $source The source array. * @param string $key Where the elements of the source array are objects or arrays, the key to pivot on. * * @return array An array of arrays pivoted either on the value of the keys, or an individual key of an object or array. * * @since 11.3 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::pivot instead */ public static function pivot($source, $key = null) { $result = array(); $counter = array(); foreach ($source as $index => $value) { // Determine the name of the pivot key, and its value. if (is_array($value)) { // If the key does not exist, ignore it. if (!isset($value[$key])) { continue; } $resultKey = $value[$key]; $resultValue = &$source[$index]; } elseif (is_object($value)) { // If the key does not exist, ignore it. if (!isset($value->$key)) { continue; } $resultKey = $value->$key; $resultValue = &$source[$index]; } else { // Just a scalar value. $resultKey = $value; $resultValue = $index; } // The counter tracks how many times a key has been used. if (empty($counter[$resultKey])) { // The first time around we just assign the value to the key. $result[$resultKey] = $resultValue; $counter[$resultKey] = 1; } elseif ($counter[$resultKey] == 1) { // If there is a second time, we convert the value into an array. $result[$resultKey] = array( $result[$resultKey], $resultValue, ); $counter[$resultKey]++; } else { // After the second time, no need to track any more. Just append to the existing array. $result[$resultKey][] = $resultValue; } } unset($counter); return $result; } /** * Utility function to sort an array of objects on a given field * * @param array &$a An array of objects * @param mixed $k The key (string) or a array of key to sort on * @param mixed $direction Direction (integer) or an array of direction to sort in [1 = Ascending] [-1 = Descending] * @param mixed $caseSensitive Boolean or array of booleans to let sort occur case sensitive or insensitive * @param mixed $locale Boolean or array of booleans to let sort occur using the locale language or not * * @return array The sorted array of objects * * @since 11.1 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::sortObjects instead */ public static function sortObjects(&$a, $k, $direction = 1, $caseSensitive = true, $locale = false) { if (!is_array($locale) || !is_array($locale[0])) { $locale = array($locale); } self::$sortCase = (array) $caseSensitive; self::$sortDirection = (array) $direction; self::$sortKey = (array) $k; self::$sortLocale = $locale; usort($a, array(__CLASS__, '_sortObjects')); self::$sortCase = null; self::$sortDirection = null; self::$sortKey = null; self::$sortLocale = null; return $a; } /** * Callback function for sorting an array of objects on a key * * @param array &$a An array of objects * @param array &$b An array of objects * * @return integer Comparison status * * @see JArrayHelper::sortObjects() * @since 11.1 */ protected static function _sortObjects(&$a, &$b) { $key = self::$sortKey; for ($i = 0, $count = count($key); $i < $count; $i++) { if (isset(self::$sortDirection[$i])) { $direction = self::$sortDirection[$i]; } if (isset(self::$sortCase[$i])) { $caseSensitive = self::$sortCase[$i]; } if (isset(self::$sortLocale[$i])) { $locale = self::$sortLocale[$i]; } $va = $a->{$key[$i]}; $vb = $b->{$key[$i]}; if ((is_bool($va) || is_numeric($va)) && (is_bool($vb) || is_numeric($vb))) { $cmp = $va - $vb; } elseif ($caseSensitive) { $cmp = JString::strcmp($va, $vb, $locale); } else { $cmp = JString::strcasecmp($va, $vb, $locale); } if ($cmp > 0) { return $direction; } if ($cmp < 0) { return -$direction; } } return 0; } /** * Multidimensional array safe unique test * * @param array $myArray The array to make unique. * * @return array * * @see http://php.net/manual/en/function.array-unique.php * @since 11.2 * @deprecated 4.0 Use Joomla\Utilities\ArrayHelper::arrayUnique instead */ public static function arrayUnique($myArray) { if (!is_array($myArray)) { return $myArray; } foreach ($myArray as &$myvalue) { $myvalue = serialize($myvalue); } $myArray = array_unique($myArray); foreach ($myArray as &$myvalue) { $myvalue = unserialize($myvalue); } return $myArray; } } PK���\�90�'�'"libraries/joomla/twitter/users.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Users class for the Joomla Platform. * * @since 12.3 */ class JTwitterUsers extends JTwitterObject { /** * Method to get up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. * * @param string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request. * @param string $id A comma separated list of user IDs, up to 100 are allowed in a single request. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a variety of * metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getUsersLookup($screen_name = null, $id = null, $entities = null) { // Check the rate limit for remaining hits $this->checkRateLimit('users', 'lookup'); // Set user IDs and screen names. if ($id) { $data['user_id'] = $id; } if ($screen_name) { $data['screen_name'] = $screen_name; } if ($id == null && $screen_name == null) { // We don't have a valid entry throw new RuntimeException('You must specify either a comma separated list of screen names, user IDs, or a combination of the two'); } // Set the API path $path = '/users/lookup.json'; // Check if string_ids is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to access the profile banner in various sizes for the user with the indicated screen_name. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * * @return array The decoded JSON response * * @since 12.3 */ public function getUserProfileBanner($user) { // Check the rate limit for remaining hits $this->checkRateLimit('users', 'profile_banner'); // Set the API path $path = '/users/profile_banner.json'; // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method used to search for users * * @param string $query The search query to run against people search. * @param integer $page Specifies the page of results to retrieve. * @param integer $count The number of people to retrieve. Maximum of 20 allowed per page. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a * variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function searchUsers($query, $page = 0, $count = 0, $entities = null) { // Check the rate limit for remaining hits $this->checkRateLimit('users', 'search'); $data['q'] = rawurlencode($query); // Check if page is specified. if ($page > 0 ) { $data['page'] = $page; } // Check if per_page is specified if ($count > 0) { $data['count'] = $count; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Set the API path $path = '/users/search.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get extended information of a given user, specified by ID or screen name as per the required id parameter. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param boolean $entities Set to true to return IDs as strings, false to return as integers. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getUser($user, $entities = null) { // Check the rate limit for remaining hits $this->checkRateLimit('users', 'show/:id'); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Set the API path $path = '/users/show.json'; // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get an array of users that the specified user can contribute to. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param boolean $entities Set to true to return IDs as strings, false to return as integers. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getContributees($user, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('users', 'contributees'); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Set the API path $path = '/users/contributees.json'; // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get an array of users who can contribute to the specified account. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param boolean $entities Set to true to return IDs as strings, false to return as integers. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getContributors($user, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('users', 'contributors'); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Set the API path $path = '/users/contributors.json'; // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method access to Twitter's suggested user list. * * @param boolean $lang Restricts the suggested categories to the requested language. * * @return array The decoded JSON response * * @since 12.3 */ public function getSuggestions($lang = null) { // Check the rate limit for remaining hits $this->checkRateLimit('users', 'suggestions'); // Set the API path $path = '/users/suggestions.json'; $data = array(); // Check if entities is true if ($lang) { $data['lang'] = $lang; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * method to access the users in a given category of the Twitter suggested user list. * * @param string $slug The short name of list or a category. * @param boolean $lang Restricts the suggested categories to the requested language. * * @return array The decoded JSON response * * @since 12.3 */ public function getSuggestionsSlug($slug, $lang = null) { // Check the rate limit for remaining hits $this->checkRateLimit('users', 'suggestions/:slug'); // Set the API path $path = '/users/suggestions/' . $slug . '.json'; $data = array(); // Check if entities is true if ($lang) { $data['lang'] = $lang; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to access the users in a given category of the Twitter suggested user list and return * their most recent status if they are not a protected user. * * @param string $slug The short name of list or a category. * * @return array The decoded JSON response * * @since 12.3 */ public function getSuggestionsSlugMembers($slug) { // Check the rate limit for remaining hits $this->checkRateLimit('users', 'suggestions/:slug/members'); // Set the API path $path = '/users/suggestions/' . $slug . '/members.json'; // Send the request. return $this->sendRequest($path); } } PK���\|�:��#libraries/joomla/twitter/search.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Search class for the Joomla Platform. * * @since 12.3 */ class JTwittersearch extends JTwitterObject { /** * Method to get tweets that match a specified query. * * @param string $query Search query. Should be URL encoded. Queries will be limited by complexity. * @param string $callback If supplied, the response will use the JSONP format with a callback of the given name * @param string $geocode Returns tweets by users located within a given radius of the given latitude/longitude. The parameter value is * specified by "latitude,longitude,radius", where radius units must be specified as either "mi" (miles) or "km" (kilometers). * @param string $lang Restricts tweets to the given language, given by an ISO 639-1 code. * @param string $locale Specify the language of the query you are sending (only ja is currently effective). This is intended for * language-specific clients and the default should work in the majority of cases. * @param string $result_type Specifies what type of search results you would prefer to receive. The current default is "mixed." * @param integer $count The number of tweets to return per page, up to a maximum of 100. Defaults to 15. * @param string $until Returns tweets generated before the given date. Date should be formatted as YYYY-MM-DD. * @param integer $since_id Returns results with an ID greater than (that is, more recent than) the specified ID. * @param integer $max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a * variety of metadata about the tweet in a discrete structure, including: urls, media and hashtags. * * @return array The decoded JSON response * * @since 12.3 */ public function search($query, $callback = null, $geocode = null, $lang = null, $locale = null, $result_type = null, $count = 15, $until = null, $since_id = 0, $max_id = 0, $entities = null) { // Check the rate limit for remaining hits $this->checkRateLimit('search', 'tweets'); // Set the API path $path = '/search/tweets.json'; // Set query parameter. $data['q'] = rawurlencode($query); // Check if callback is specified. if ($callback) { $data['callback'] = $callback; } // Check if geocode is specified. if ($geocode) { $data['geocode'] = $geocode; } // Check if lang is specified. if ($lang) { $data['lang'] = $lang; } // Check if locale is specified. if ($locale) { $data['locale'] = $locale; } // Check if result_type is specified. if ($result_type) { $data['result_type'] = $result_type; } // Check if count is specified. if ($count != 15) { $data['count'] = $count; } // Check if until is specified. if ($until) { $data['until'] = $until; } // Check if since_id is specified. if ($since_id > 0) { $data['since_id'] = $since_id; } // Check if max_id is specified. if ($max_id > 0) { $data['max_id'] = $max_id; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get the authenticated user's saved search queries. * * @return array The decoded JSON response * * @since 12.3 */ public function getSavedSearches() { // Check the rate limit for remaining hits $this->checkRateLimit('saved_searches', 'list'); // Set the API path $path = '/saved_searches/list.json'; // Send the request. return $this->sendRequest($path); } /** * Method to get the information for the saved search represented by the given id. * * @param integer $id The ID of the saved search. * * @return array The decoded JSON response * * @since 12.3 */ public function getSavedSearchesById($id) { // Check the rate limit for remaining hits $this->checkRateLimit('saved_searches', 'show/:id'); // Set the API path $path = '/saved_searches/show/' . $id . '.json'; // Send the request. return $this->sendRequest($path); } /** * Method to create a new saved search for the authenticated user. * * @param string $query The query of the search the user would like to save. * * @return array The decoded JSON response * * @since 12.3 */ public function createSavedSearch($query) { // Set the API path $path = '/saved_searches/create.json'; // Set POST request data $data['query'] = rawurlencode($query); // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to delete a saved search for the authenticating user. * * @param integer $id The ID of the saved search. * * @return array The decoded JSON response * * @since 12.3 */ public function deleteSavedSearch($id) { // Check the rate limit for remaining hits $this->checkRateLimit('saved_searches', 'destroy/:id'); // Set the API path $path = '/saved_searches/destroy/' . $id . '.json'; // Send the request. return $this->sendRequest($path, 'POST'); } } PK���\_�G�aa+libraries/joomla/twitter/directmessages.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Direct Messages class for the Joomla Platform. * * @since 12.3 */ class JTwitterDirectmessages extends JTwitterObject { /** * Method to get the most recent direct messages sent to the authenticating user. * * @param integer $since_id Returns results with an ID greater than (that is, more recent than) the specified ID. * @param integer $max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. * @param integer $count Specifies the number of direct messages to try and retrieve, up to a maximum of 200. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety of metadata * about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 */ public function getDirectMessages($since_id = 0, $max_id = 0, $count = 20, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('direct_messages'); // Set the API path $path = '/direct_messages.json'; // Check if since_id is specified. if ($since_id) { $data['since_id'] = $since_id; } // Check if max_id is specified. if ($max_id) { $data['max_id'] = $max_id; } // Check if count is specified. if ($count) { $data['count'] = $count; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified. if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get the most recent direct messages sent by the authenticating user. * * @param integer $since_id Returns results with an ID greater than (that is, more recent than) the specified ID. * @param integer $max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. * @param integer $count Specifies the number of direct messages to try and retrieve, up to a maximum of 200. * @param integer $page Specifies the page of results to retrieve. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety of metadata * about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * * @return array The decoded JSON response * * @since 12.3 */ public function getSentDirectMessages($since_id = 0, $max_id = 0, $count = 20, $page = 0, $entities = null) { // Check the rate limit for remaining hits $this->checkRateLimit('direct_messages', 'sent'); // Set the API path $path = '/direct_messages/sent.json'; // Check if since_id is specified. if ($since_id) { $data['since_id'] = $since_id; } // Check if max_id is specified. if ($max_id) { $data['max_id'] = $max_id; } // Check if count is specified. if ($count) { $data['count'] = $count; } // Check if page is specified. if ($page) { $data['page'] = $page; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to send a new direct message to the specified user from the authenticating user. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param string $text The text of your direct message. Be sure to keep the message under 140 characters. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function sendDirectMessages($user, $text) { // Set the API path $path = '/direct_messages/new.json'; // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } $data['text'] = $text; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to get a single direct message, specified by an id parameter. * * @param integer $id The ID of the direct message. * * @return array The decoded JSON response * * @since 12.3 */ public function getDirectMessagesById($id) { // Check the rate limit for remaining hits $this->checkRateLimit('direct_messages', 'show'); // Set the API path $path = '/direct_messages/show.json'; $data['id'] = $id; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to delete the direct message specified in the required ID parameter. * * @param integer $id The ID of the direct message. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety of metadata * about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * * @return array The decoded JSON response * * @since 12.3 */ public function deleteDirectMessages($id, $entities = null) { // Set the API path $path = '/direct_messages/destroy.json'; $data['id'] = $id; // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'POST', $data); } } PK���\�U�mm"libraries/joomla/twitter/lists.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Lists class for the Joomla Platform. * * @since 12.3 */ class JTwitterLists extends JTwitterObject { /** * Method to get all lists the authenticating or specified user subscribes to, including their own. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param boolean $reverse Set this to true if you would like owned lists to be returned first. See description * above for information on how this parameter works. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getLists($user, $reverse = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'list'); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Check if reverse is specified. if (!is_null($reverse)) { $data['reverse'] = $reverse; } // Set the API path $path = '/lists/list.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get tweet timeline for members of the specified list * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * @param integer $since_id Returns results with an ID greater than (that is, more recent than) the specified ID. * @param integer $max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. * @param integer $count Specifies the number of results to retrieve per "page." * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities". This node offers a variety * of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $include_rts When set to either true, t or 1, the list timeline will contain native retweets (if they exist) in addition * to the standard stream of tweets. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getStatuses($list, $owner = null, $since_id = 0, $max_id = 0, $count = 0, $entities = null, $include_rts = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'statuses'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } // Set the API path $path = '/lists/statuses.json'; // Check if since_id is specified if ($since_id > 0) { $data['since_id'] = $since_id; } // Check if max_id is specified if ($max_id > 0) { $data['max_id'] = $max_id; } // Check if count is specified if ($count > 0) { $data['count'] = $count; } // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if include_rts is specified if (!is_null($include_rts)) { $data['include_rts'] = $include_rts; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get the subscribers of the specified list. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * @param integer $cursor Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities". This node offers a variety * of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getSubscribers($list, $owner = null, $cursor = null, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'subscribers'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } // Set the API path $path = '/lists/subscribers.json'; // Check if cursor is specified if (!is_null($cursor)) { $data['cursor'] = $cursor; } // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to remove multiple members from a list, by specifying a comma-separated list of member ids or screen names. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param string $user_id A comma separated list of user IDs, up to 100 are allowed in a single request. * @param string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function deleteMembers($list, $user_id = null, $screen_name = null, $owner = null) { // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username for owner is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } if ($user_id) { $data['user_id'] = $user_id; } if ($screen_name) { $data['screen_name'] = $screen_name; } if ($user_id == null && $screen_name == null) { // We don't have a valid entry throw new RuntimeException('You must specify either a comma separated list of screen names, user IDs, or a combination of the two'); } // Set the API path $path = '/lists/members/destroy_all.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to subscribe the authenticated user to the specified list. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function subscribe($list, $owner = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'subscribers/create'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username for owner is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } // Set the API path $path = '/lists/subscribers/create.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to check if the specified user is a member of the specified list. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $user Either an integer containing the user ID or a string containing the screen name of the user to remove. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities". This node offers a * variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function isMember($list, $user, $owner = null, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'members/show'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Set the API path $path = '/lists/members/show.json'; // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to check if the specified user is a subscriber of the specified list. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $user Either an integer containing the user ID or a string containing the screen name of the user to remove. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities". This node offers a * variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function isSubscriber($list, $user, $owner = null, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'subscribers/show'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Set the API path $path = '/lists/subscribers/show.json'; // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to unsubscribe the authenticated user from the specified list. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function unsubscribe($list, $owner = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'subscribers/destroy'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } // Set the API path $path = '/lists/subscribers/destroy.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to add multiple members to a list, by specifying a comma-separated list of member ids or screen names. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param string $user_id A comma separated list of user IDs, up to 100 are allowed in a single request. * @param string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function addMembers($list, $user_id = null, $screen_name = null, $owner = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'members/create_all'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } if ($user_id) { $data['user_id'] = $user_id; } if ($screen_name) { $data['screen_name'] = $screen_name; } if ($user_id == null && $screen_name == null) { // We don't have a valid entry throw new RuntimeException('You must specify either a comma separated list of screen names, user IDs, or a combination of the two'); } // Set the API path $path = '/lists/members/create_all.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to get the members of the specified list. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities". This node offers a variety * of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getMembers($list, $owner = null, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'members'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } // Set the API path $path = '/lists/members.json'; // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get the specified list. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getListById($list, $owner = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'show'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } // Set the API path $path = '/lists/show.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get a collection of the lists the specified user is subscribed to, 20 lists per page by default. Does not include the user's own lists. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param integer $count The amount of results to return per page. Defaults to 20. Maximum of 1,000 when using cursors. * @param integer $cursor Breaks the results into pages. Provide a value of -1 to begin paging. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getSubscriptions($user, $count = 0, $cursor = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'subscriptions'); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Check if count is specified. if ($count > 0) { $data['count'] = $count; } // Check if cursor is specified. if (!is_null($cursor)) { $data['cursor'] = $cursor; } // Set the API path $path = '/lists/subscriptions.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to update the specified list * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * @param string $name The name of the list. * @param string $mode Whether your list is public or private. Values can be public or private. If no mode is * specified the list will be public. * @param string $description The description to give the list. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function update($list, $owner = null, $name = null, $mode = null, $description = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'update'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } // Check if name is specified. if ($name) { $data['name'] = $name; } // Check if mode is specified. if ($mode) { $data['mode'] = $mode; } // Check if description is specified. if ($description) { $data['description'] = $description; } // Set the API path $path = '/lists/update.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to create a new list for the authenticated user. * * @param string $name The name of the list. * @param string $mode Whether your list is public or private. Values can be public or private. If no mode is * specified the list will be public. * @param string $description The description to give the list. * * @return array The decoded JSON response * * @since 12.3 */ public function create($name, $mode = null, $description = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'create'); // Check if name is specified. if ($name) { $data['name'] = $name; } // Check if mode is specified. if ($mode) { $data['mode'] = $mode; } // Check if description is specified. if ($description) { $data['description'] = $description; } // Set the API path $path = '/lists/create.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to delete a specified list. * * @param mixed $list Either an integer containing the list ID or a string containing the list slug. * @param mixed $owner Either an integer containing the user ID or a string containing the screen name of the owner. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function delete($list, $owner = null) { // Check the rate limit for remaining hits $this->checkRateLimit('lists', 'destroy'); // Determine which type of data was passed for $list if (is_numeric($list)) { $data['list_id'] = $list; } elseif (is_string($list)) { $data['slug'] = $list; // In this case the owner is required. if (is_numeric($owner)) { $data['owner_id'] = $owner; } elseif (is_string($owner)) { $data['owner_screen_name'] = $owner; } else { // We don't have a valid entry throw new RuntimeException('The specified username for owner is not in the correct format; must use integer or string'); } } else { // We don't have a valid entry throw new RuntimeException('The specified list is not in the correct format; must use integer or string'); } // Set the API path $path = '/lists/destroy.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } } PK���\�,Qdbb$libraries/joomla/twitter/twitter.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Joomla Platform class for interacting with a Twitter API instance. * * @since 12.3 */ class JTwitter { /** * @var Registry Options for the JTwitter object. * @since 12.3 */ protected $options; /** * @var JHttp The HTTP client object to use in sending HTTP requests. * @since 12.3 */ protected $client; /** * @var JTwitterOAuth The OAuth client. * @since 12.3 */ protected $oauth; /** * @var JTwitterFriends Twitter API object for friends. * @since 12.3 */ protected $friends; /** * @var JTwitterUsers Twitter API object for users. * @since 12.3 */ protected $users; /** * @var JTwitterHelp Twitter API object for help. * @since 12.3 */ protected $help; /** * @var JTwitterStatuses Twitter API object for statuses. * @since 12.3 */ protected $statuses; /** * @var JTwitterSearch Twitter API object for search. * @since 12.3 */ protected $search; /** * @var JTwitterFavorites Twitter API object for favorites. * @since 12.3 */ protected $favorites; /** * @var JTwitterDirectMessages Twitter API object for direct messages. * @since 12.3 */ protected $directMessages; /** * @var JTwitterLists Twitter API object for lists. * @since 12.3 */ protected $lists; /** * @var JTwitterPlaces Twitter API object for places & geo. * @since 12.3 */ protected $places; /** * @var JTwitterTrends Twitter API object for trends. * @since 12.3 */ protected $trends; /** * @var JTwitterBlock Twitter API object for block. * @since 12.3 */ protected $block; /** * @var JTwitterProfile Twitter API object for profile. * @since 12.3 */ protected $profile; /** * Constructor. * * @param JTwitterOauth $oauth The oauth client. * @param Registry $options Twitter options object. * @param JHttp $client The HTTP client object. * * @since 12.3 */ public function __construct(JTwitterOAuth $oauth = null, Registry $options = null, JHttp $client = null) { $this->oauth = $oauth; $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JHttp($this->options); // Setup the default API url if not already set. $this->options->def('api.url', 'https://api.twitter.com/1.1'); } /** * Magic method to lazily create API objects * * @param string $name Name of property to retrieve * * @return JTwitterObject Twitter API object (statuses, users, favorites, etc.). * * @since 12.3 * @throws InvalidArgumentException */ public function __get($name) { $class = 'JTwitter' . ucfirst($name); if (class_exists($class)) { if (false == isset($this->$name)) { $this->$name = new $class($this->options, $this->client, $this->oauth); } return $this->$name; } throw new InvalidArgumentException(sprintf('Argument %s produced an invalid class name: %s', $name, $class)); } /** * Get an option from the JTwitter instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 12.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JTwitter instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JTwitter This object for method chaining. * * @since 12.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\�g(r� � #libraries/joomla/twitter/trends.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Trends class for the Joomla Platform. * * @since 12.3 */ class JTwitterTrends extends JTwitterObject { /** * Method to get the top 10 trending topics for a specific WOEID, if trending information is available for it. * * @param integer $id The Yahoo! Where On Earth ID of the location to return trending information for. * Global information is available by using 1 as the WOEID. * @param string $exclude Setting this equal to hashtags will remove all hashtags from the trends list. * * @return array The decoded JSON response * * @since 12.3 */ public function getTrends($id, $exclude = null) { // Check the rate limit for remaining hits $this->checkRateLimit('trends', 'place'); // Set the API path $path = '/trends/place.json'; $data['id'] = $id; // Check if exclude is specified if ($exclude) { $data['exclude'] = $exclude; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get the locations that Twitter has trending topic information for. * * @return array The decoded JSON response * * @since 12.3 */ public function getLocations() { // Check the rate limit for remaining hits $this->checkRateLimit('trends', 'available'); // Set the API path $path = '/trends/available.json'; // Send the request. return $this->sendRequest($path); } /** * Method to get the locations that Twitter has trending topic information for, closest to a specified location. * * @param float $lat The latitude to search around. * @param float $long The longitude to search around. * * @return array The decoded JSON response * * @since 12.3 */ public function getClosest($lat = null, $long = null) { // Check the rate limit for remaining hits $this->checkRateLimit('trends', 'closest'); // Set the API path $path = '/trends/closest.json'; $data = array(); // Check if lat is specified if ($lat) { $data['lat'] = $lat; } // Check if long is specified if ($long) { $data['long'] = $long; } // Send the request. return $this->sendRequest($path, 'GET', $data); } } PK���\mo�̾2�2$libraries/joomla/twitter/friends.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Friends class for the Joomla Platform. * * @since 12.3 */ class JTwitterFriends extends JTwitterObject { /** * Method to get an array of user IDs the specified user follows. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param integer $cursor Causes the list of connections to be broken into pages of no more than 5000 IDs at a time. * The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out * after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page." * @param boolean $string_ids Set to true to return IDs as strings, false to return as integers. * @param integer $count Specifies the number of IDs attempt retrieval of, up to a maximum of 5,000 per distinct request. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getFriendIds($user, $cursor = null, $string_ids = null, $count = 0) { // Check the rate limit for remaining hits $this->checkRateLimit('friends', 'ids'); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Check if cursor is specified if (!is_null($cursor)) { $data['cursor'] = $cursor; } // Check if string_ids is true if ($string_ids) { $data['stringify_ids'] = $string_ids; } // Check if count is specified if ($count > 0) { $data['count'] = $count; } // Set the API path $path = '/friends/ids.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to display detailed friend information between two users. * * @param mixed $user_a Either an integer containing the user ID or a string containing the screen name of the first user. * @param mixed $user_b Either an integer containing the user ID or a string containing the screen name of the second user. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getFriendshipDetails($user_a, $user_b) { // Check the rate limit for remaining hits $this->checkRateLimit('friendships', 'show'); // Determine which type of data was passed for $user_a if (is_numeric($user_a)) { $data['source_id'] = $user_a; } elseif (is_string($user_a)) { $data['source_screen_name'] = $user_a; } else { // We don't have a valid entry throw new RuntimeException('The first specified username is not in the correct format; must use integer or string'); } // Determine which type of data was passed for $user_b if (is_numeric($user_b)) { $data['target_id'] = $user_b; } elseif (is_string($user_b)) { $data['target_screen_name'] = $user_b; } else { // We don't have a valid entry throw new RuntimeException('The second specified username is not in the correct format; must use integer or string'); } // Set the API path $path = '/friendships/show.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get an array of user IDs the specified user is followed by. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param integer $cursor Causes the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned * is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor * is provided, a value of -1 will be assumed, which is the first "page." * @param boolean $string_ids Set to true to return IDs as strings, false to return as integers. * @param integer $count Specifies the number of IDs attempt retrieval of, up to a maximum of 5,000 per distinct request. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getFollowerIds($user, $cursor = null, $string_ids = null, $count = 0) { // Check the rate limit for remaining hits $this->checkRateLimit('followers', 'ids'); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Set the API path $path = '/followers/ids.json'; // Check if cursor is specified if (!is_null($cursor)) { $data['cursor'] = $cursor; } // Check if string_ids is specified if (!is_null($string_ids)) { $data['stringify_ids'] = $string_ids; } // Check if count is specified if (!is_null($count)) { $data['count'] = $count; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to determine pending requests to follow the authenticating user. * * @param integer $cursor Causes the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned * is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor * is provided, a value of -1 will be assumed, which is the first "page." * @param boolean $string_ids Set to true to return IDs as strings, false to return as integers. * * @return array The decoded JSON response * * @since 12.3 */ public function getFriendshipsIncoming($cursor = null, $string_ids = null) { // Check the rate limit for remaining hits $this->checkRateLimit('friendships', 'incoming'); $data = array(); // Check if cursor is specified if (!is_null($cursor)) { $data['cursor'] = $cursor; } // Check if string_ids is specified if (!is_null($string_ids)) { $data['stringify_ids'] = $string_ids; } // Set the API path $path = '/friendships/incoming.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to determine every protected user for whom the authenticating user has a pending follow request. * * @param integer $cursor Causes the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned * is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor * is provided, a value of -1 will be assumed, which is the first "page." * @param boolean $string_ids Set to true to return IDs as strings, false to return as integers. * * @return array The decoded JSON response * * @since 12.3 */ public function getFriendshipsOutgoing($cursor = null, $string_ids = null) { // Check the rate limit for remaining hits $this->checkRateLimit('friendships', 'outgoing'); $data = array(); // Check if cursor is specified if (!is_null($cursor)) { $data['cursor'] = $cursor; } // Check if string_ids is specified if (!is_null($string_ids)) { $data['stringify_ids'] = $string_ids; } // Set the API path $path = '/friendships/outgoing.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Allows the authenticating users to follow the user specified in the ID parameter. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param boolean $follow Enable notifications for the target user. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function follow($user, $follow = false) { // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Check if follow is true if ($follow) { $data['follow'] = $follow; } // Set the API path $path = '/friendships/create.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Allows the authenticating users to unfollow the user specified in the ID parameter. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function unfollow($user) { // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Set the API path $path = '/friendships/destroy.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to get the relationship of the authenticating user to the comma separated list of up to 100 screen_names or user_ids provided. * * @param string $screen_name A comma separated list of screen names, up to 100 are allowed in a single request. * @param string $id A comma separated list of user IDs, up to 100 are allowed in a single request. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getFriendshipsLookup($screen_name = null, $id = null) { // Check the rate limit for remaining hits $this->checkRateLimit('friendships', 'lookup'); // Set user IDs and screen names. if ($id) { $data['user_id'] = $id; } if ($screen_name) { $data['screen_name'] = $screen_name; } if ($id == null && $screen_name == null) { // We don't have a valid entry throw new RuntimeException('You must specify either a comma separated list of screen names, user IDs, or a combination of the two'); } // Set the API path $path = '/friendships/lookup.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Allows one to enable or disable retweets and device notifications from the specified user. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param boolean $device Enable/disable device notifications from the target user. * @param boolean $retweets Enable/disable retweets from the target user. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function updateFriendship($user, $device = null, $retweets = null) { // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Check if device is specified. if (!is_null($device)) { $data['device'] = $device; } // Check if retweets is specified. if (!is_null($retweets)) { $data['retweets'] = $retweets; } // Set the API path $path = '/friendships/update.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to get the user ids that currently authenticated user does not want to see retweets from. * * @param boolean $string_ids Set to true to return IDs as strings, false to return as integers. * * @return array The decoded JSON response * * @since 12.3 */ public function getFriendshipNoRetweetIds($string_ids = null) { // Check the rate limit for remaining hits $this->checkRateLimit('friendships', 'no_retweets/ids'); $data = array(); // Check if string_ids is specified if (!is_null($string_ids)) { $data['stringify_ids'] = $string_ids; } // Set the API path $path = '/friendships/no_retweets/ids.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } } PK���\pA�.��#libraries/joomla/twitter/object.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Twitter API object class for the Joomla Platform. * * @since 12.3 */ abstract class JTwitterObject { /** * @var Registry Options for the Twitter object. * @since 12.3 */ protected $options; /** * @var JHttp The HTTP client object to use in sending HTTP requests. * @since 12.3 */ protected $client; /** * @var JTwitterOAuth The OAuth client. * @since 12.3 */ protected $oauth; /** * Constructor. * * @param Registry &$options Twitter options object. * @param JHttp $client The HTTP client object. * @param JTwitterOAuth $oauth The OAuth client. * * @since 12.3 */ public function __construct(Registry &$options = null, JHttp $client = null, JTwitterOAuth $oauth = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JHttp($this->options); $this->oauth = $oauth; } /** * Method to check the rate limit for the requesting IP address * * @param string $resource A resource or a comma-separated list of resource families you want to know the current rate limit disposition for. * @param string $action An action for the specified resource, if only one resource is specified. * * @return void * * @since 12.3 * @throws RuntimeException */ public function checkRateLimit($resource = null, $action = null) { // Check the rate limit for remaining hits $rate_limit = $this->getRateLimit($resource); $property = '/' . $resource; if (!is_null($action)) { $property .= '/' . $action; } if ($rate_limit->resources->$resource->$property->remaining == 0) { // The IP has exceeded the Twitter API rate limit throw new RuntimeException('This server has exceed the Twitter API rate limit for the given period. The limit will reset at ' . $rate_limit->resources->$resource->$property->reset ); } } /** * Method to build and return a full request URL for the request. This method will * add appropriate pagination details if necessary and also prepend the API url * to have a complete URL for the request. * * @param string $path URL to inflect * @param array $parameters The parameters passed in the URL. * * @return string The request URL. * * @since 12.3 */ public function fetchUrl($path, $parameters = null) { if ($parameters) { foreach ($parameters as $key => $value) { if (strpos($path, '?') === false) { $path .= '?' . $key . '=' . $value; } else { $path .= '&' . $key . '=' . $value; } } } // Get a new JUri object fousing the api url and given path. if (strpos($path, 'http://search.twitter.com/search.json') === false) { $uri = new JUri($this->options->get('api.url') . $path); } else { $uri = new JUri($path); } return (string) $uri; } /** * Method to retrieve the rate limit for the requesting IP address * * @param string $resource A resource or a comma-separated list of resource families you want to know the current rate limit disposition for. * * @return array The JSON response decoded * * @since 12.3 */ public function getRateLimit($resource) { // Build the request path. $path = '/application/rate_limit_status.json'; if (!is_null($resource)) { return $this->sendRequest($path, 'GET', array('resources' => $resource)); } return $this->sendRequest($path); } /** * Method to send the request. * * @param string $path The path of the request to make * @param string $method The request method. * @param mixed $data Either an associative array or a string to be sent with the post request. * @param array $headers An array of name-value pairs to include in the header of the request * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function sendRequest($path, $method = 'GET', $data = array(), $headers = array()) { // Get the access token. $token = $this->oauth->getToken(); // Set parameters. $parameters['oauth_token'] = $token['key']; // Send the request. $response = $this->oauth->oauthRequest($this->fetchUrl($path), $method, $parameters, $data, $headers); if (strpos($path, 'update_with_media') !== false) { // Check Media Rate Limit. $response_headers = $response->headers; if ($response_headers['x-mediaratelimit-remaining'] == 0) { // The IP has exceeded the Twitter API media rate limit throw new RuntimeException('This server has exceed the Twitter API media rate limit for the given period. The limit will reset in ' . $response_headers['x-mediaratelimit-reset'] . 'seconds.' ); } } if (strpos($response->body, 'redirected') !== false) { return $response->headers['Location']; } return json_decode($response->body); } /** * Get an option from the JTwitterObject instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 12.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JTwitterObject instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JTwitterObject This object for method chaining. * * @since 12.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\L�h� !libraries/joomla/twitter/help.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Help class for the Joomla Platform. * * @since 12.3 */ class JTwitterHelp extends JTwitterObject { /** * Method to get the supported languages from the API. * * @return array The decoded JSON response * * @since 12.3 */ public function getLanguages() { // Check the rate limit for remaining hits $this->checkRateLimit('help', 'languages'); // Set the API path $path = '/help/languages.json'; // Send the request. return $this->sendRequest($path); } /** * Method to get the current configuration used by Twitter including twitter.com slugs which are not usernames, * maximum photo resolutions, and t.co URL lengths. * * @return array The decoded JSON response * * @since 12.3 */ public function getConfiguration() { // Check the rate limit for remaining hits $this->checkRateLimit('help', 'configuration'); // Set the API path $path = '/help/configuration.json'; // Send the request. return $this->sendRequest($path); } } PK���\�RBoo"libraries/joomla/twitter/block.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Block class for the Joomla Platform. * * @since 12.3 */ class JTwitterBlock extends JTwitterObject { /** * Method to get the user ids the authenticating user is blocking. * * @param boolean $stringify_ids Provide this option to have ids returned as strings instead. * @param integer $cursor Causes the list of IDs to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned * is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor * is provided, a value of -1 will be assumed, which is the first "page." * * @return array The decoded JSON response * * @since 12.3 */ public function getBlocking($stringify_ids = null, $cursor = null) { // Check the rate limit for remaining hits $this->checkRateLimit('blocks', 'ids'); $data = array(); // Check if stringify_ids is specified if (!is_null($stringify_ids)) { $data['stringify_ids'] = $stringify_ids; } // Check if cursor is specified if (!is_null($stringify_ids)) { $data['cursor'] = $cursor; } // Set the API path $path = '/blocks/ids.json'; // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to block the specified user from following the authenticating user. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a * variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function block($user, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('blocks', 'create'); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_statuses is specified if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Set the API path $path = '/blocks/create.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to unblock the specified user from following the authenticating user. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a * variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function unblock($user, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('blocks', 'destroy'); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_statuses is specified if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Set the API path $path = '/blocks/destroy.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } } PK���\���ޭS�S%libraries/joomla/twitter/statuses.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Statuses class for the Joomla Platform. * * @since 12.3 */ class JTwitterStatuses extends JTwitterObject { /** * Method to get a single tweet with the given ID. * * @param integer $id The ID of the tweet to retrieve. * @param boolean $trim_user When set to true, each tweet returned in a timeline will include a user object including only * the status author's numerical ID. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety of metadata * about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $my_retweet When set to either true, t or 1, any statuses returned that have been retweeted by the authenticating user will * include an additional current_user_retweet node, containing the ID of the source status for the retweet. * * @return array The decoded JSON response * * @since 12.3 */ public function getTweetById($id, $trim_user = null, $entities = null, $my_retweet = null) { // Check the rate limit for remaining hits $this->checkRateLimit("statuses", "show/:id"); // Set the API base $path = '/statuses/show/' . $id . '.json'; $data = array(); // Check if trim_user is specified if (!is_null($trim_user)) { $data['trim_user'] = $trim_user; } // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if my_retweet is specified if (!is_null($my_retweet)) { $data['include_my_retweet'] = $my_retweet; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to retrieve the latest statuses from the specified user timeline. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param integer $count Specifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included * in the count, so it is always suggested to set $include_rts to true * @param boolean $include_rts When set to true, the timeline will contain native retweets in addition to the standard stream of tweets. * @param boolean $no_replies This parameter will prevent replies from appearing in the returned timeline. This parameter is only supported * for JSON and XML responses. * @param integer $since_id Returns results with an ID greater than (that is, more recent than) the specified ID. * @param integer $max_id Returns results with an ID less than (that is, older than) the specified ID. * @param boolean $trim_user When set to true, each tweet returned in a timeline will include a user object including only * the status author's numerical ID. * @param boolean $contributor This parameter enhances the contributors element of the status response to include the screen_name of the * contributor. By default only the user_id of the contributor is included. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getUserTimeline($user, $count = 20, $include_rts = null, $no_replies = null, $since_id = 0, $max_id = 0, $trim_user = null, $contributor = null) { // Check the rate limit for remaining hits $this->checkRateLimit('statuses', 'user_timeline'); $data = array(); // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } else { // We don't have a valid entry throw new RuntimeException('The specified username is not in the correct format; must use integer or string'); } // Set the API base $path = '/statuses/user_timeline.json'; // Set the count string $data['count'] = $count; // Check if include_rts is specified if (!is_null($include_rts)) { $data['include_rts'] = $include_rts; } // Check if no_replies is specified if (!is_null($no_replies)) { $data['exclude_replies'] = $no_replies; } // Check if a since_id is specified if ($since_id > 0) { $data['since_id'] = (int) $since_id; } // Check if a max_id is specified if ($max_id > 0) { $data['max_id'] = (int) $max_id; } // Check if trim_user is specified if (!is_null($trim_user)) { $data['trim_user'] = $trim_user; } // Check if contributor details is specified if (!is_null($contributor)) { $data['contributor_details'] = $contributor; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to post a tweet. * * @param string $status The text of the tweet. * @param integer $in_reply_to_status_id The ID of an existing status that the update is in reply to. * @param float $lat The latitude of the location this tweet refers to. * @param float $long The longitude of the location this tweet refers to. * @param string $place_id A place in the world. * @param boolean $display_coordinates Whether or not to put a pin on the exact coordinates a tweet has been sent from. * @param boolean $trim_user When set to true, each tweet returned in a timeline will include a user object including only * the status author's numerical ID. * * @return array The decoded JSON response * * @since 12.3 */ public function tweet($status, $in_reply_to_status_id = null, $lat = null, $long = null, $place_id = null, $display_coordinates = null, $trim_user = null) { // Set the API base. $path = '/statuses/update.json'; // Set POST data. $data = array('status' => utf8_encode($status)); // Check if in_reply_to_status_id is specified. if ($in_reply_to_status_id) { $data['in_reply_to_status_id'] = $in_reply_to_status_id; } // Check if lat is specified. if ($lat) { $data['lat'] = $lat; } // Check if long is specified. if ($long) { $data['long'] = $long; } // Check if place_id is specified. if ($place_id) { $data['place_id'] = $place_id; } // Check if display_coordinates is specified. if (!is_null($display_coordinates)) { $data['display_coordinates'] = $display_coordinates; } // Check if trim_user is specified. if (!is_null($trim_user)) { $data['trim_user'] = $trim_user; } // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to retrieve the most recent mentions for the authenticating user. * * @param integer $count Specifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included * in the count, so it is always suggested to set $include_rts to true * @param boolean $include_rts When set to true, the timeline will contain native retweets in addition to the standard stream of tweets. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety of metadata * about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param integer $since_id Returns results with an ID greater than (that is, more recent than) the specified ID. * @param integer $max_id Returns results with an ID less than (that is, older than) the specified ID. * @param boolean $trim_user When set to true, each tweet returned in a timeline will include a user object including only * the status author's numerical ID. * @param string $contributor This parameter enhances the contributors element of the status response to include the screen_name * of the contributor. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getMentions($count = 20, $include_rts = null, $entities = null, $since_id = 0, $max_id = 0, $trim_user = null, $contributor = null) { // Check the rate limit for remaining hits $this->checkRateLimit('statuses', 'mentions_timeline'); // Set the API base $path = '/statuses/mentions_timeline.json'; // Set the count string $data['count'] = $count; // Check if include_rts is specified if (!is_null($include_rts)) { $data['include_rts'] = $include_rts; } // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if a since_id is specified if ($since_id > 0) { $data['since_id'] = (int) $since_id; } // Check if a max_id is specified if ($max_id > 0) { $data['max_id'] = (int) $max_id; } // Check if trim_user is specified if (!is_null($trim_user)) { $data['trim_user'] = $trim_user; } // Check if contributor is specified if (!is_null($contributor)) { $data['contributor_details'] = $contributor; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get the most recent tweets of the authenticated user that have been retweeted by others. * * @param integer $count Specifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included * in the count, so it is always suggested to set $include_rts to true * @param integer $since_id Returns results with an ID greater than (that is, more recent than) the specified ID. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety of metadata * about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $user_entities The user entities node will be disincluded when set to false. * @param integer $max_id Returns results with an ID less than (that is, older than) the specified ID. * @param boolean $trim_user When set to true, each tweet returned in a timeline will include a user object including only * the status author's numerical ID. * * @return array The decoded JSON response * * @since 12.3 */ public function getRetweetsOfMe($count = 20, $since_id = 0, $entities = null, $user_entities = null, $max_id = 0, $trim_user = null) { // Check the rate limit for remaining hits $this->checkRateLimit('statuses', 'retweets_of_me'); // Set the API path $path = '/statuses/retweets_of_me.json'; // Set the count string $data['count'] = $count; // Check if a since_id is specified if ($since_id > 0) { $data['since_id'] = (int) $since_id; } // Check if a max_id is specified if ($max_id > 0) { $data['max_id'] = (int) $max_id; } // Check if trim_user is specified if (!is_null($trim_user)) { $data['trim_user'] = $trim_user; } // Check if entities is specified if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if entities is specified if (!is_null($user_entities)) { $data['include_user_entities'] = $user_entities; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to show user objects of up to 100 members who retweeted the status. * * @param integer $id The numerical ID of the desired status. * @param integer $count Specifies the number of retweets to try and retrieve, up to a maximum of 100. * @param integer $cursor Causes the list of IDs to be broken into pages of no more than 100 IDs at a time. * The number of IDs returned is not guaranteed to be 100 as suspended users are * filtered out after connections are queried. If no cursor is provided, a value of * -1 will be assumed, which is the first "page." * @param boolean $stringify_ids Set to true to return IDs as strings, false to return as integers. * * @return array The decoded JSON response * * @since 12.3 */ public function getRetweeters($id, $count = 20, $cursor = null, $stringify_ids = null) { // Check the rate limit for remaining hits $this->checkRateLimit('statuses', 'retweeters/ids'); // Set the API path $path = '/statuses/retweeters/ids.json'; // Set the status id. $data['id'] = $id; // Set the count string $data['count'] = $count; // Check if cursor is specified if (!is_null($cursor)) { $data['cursor'] = $cursor; } // Check if entities is specified if (!is_null($stringify_ids)) { $data['stringify_ids'] = $stringify_ids; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to get up to 100 of the first retweets of a given tweet. * * @param integer $id The numerical ID of the desired status. * @param integer $count Specifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included * in the count, so it is always suggested to set $include_rts to true * @param boolean $trim_user When set to true, each tweet returned in a timeline will include a user object including only * the status author's numerical ID. * * @return array The decoded JSON response * * @since 12.3 */ public function getRetweetsById($id, $count = 20, $trim_user = null) { // Check the rate limit for remaining hits $this->checkRateLimit('statuses', 'retweets/:id'); // Set the API path $path = '/statuses/retweets/' . $id . '.json'; // Set the count string $data['count'] = $count; // Check if trim_user is specified if (!is_null($trim_user)) { $data['trim_user'] = $trim_user; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to delete the status specified by the required ID parameter. * * @param integer $id The numerical ID of the desired status. * @param boolean $trim_user When set to true, each tweet returned in a timeline will include a user object including only * the status author's numerical ID. * * @return array The decoded JSON response * * @since 12.3 */ public function deleteTweet($id, $trim_user = null) { // Set the API path $path = '/statuses/destroy/' . $id . '.json'; $data = array(); // Check if trim_user is specified if (!is_null($trim_user)) { $data['trim_user'] = $trim_user; } // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to retweet a tweet. * * @param integer $id The numerical ID of the desired status. * @param boolean $trim_user When set to true, each tweet returned in a timeline will include a user object including only * the status author's numerical ID. * * @return array The decoded JSON response * * @since 12.3 */ public function retweet($id, $trim_user = null) { // Set the API path $path = '/statuses/retweet/' . $id . '.json'; $data = array(); // Check if trim_user is specified if (!is_null($trim_user)) { $data['trim_user'] = $trim_user; } // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to post a tweet with media. * * @param string $status The text of the tweet. * @param string $media File to upload * @param integer $in_reply_to_status_id The ID of an existing status that the update is in reply to. * @param float $lat The latitude of the location this tweet refers to. * @param float $long The longitude of the location this tweet refers to. * @param string $place_id A place in the world. * @param boolean $display_coordinates Whether or not to put a pin on the exact coordinates a tweet has been sent from. * @param boolean $sensitive Set to true for content which may not be suitable for every audience. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function tweetWithMedia($status, $media, $in_reply_to_status_id = null, $lat = null, $long = null, $place_id = null, $display_coordinates = null, $sensitive = null) { // Set the API request path. $path = '/statuses/update_with_media.json'; // Set POST data. $data = array( 'status' => utf8_encode($status), 'media[]' => "@{$media}" ); $header = array('Content-Type' => 'multipart/form-data'); // Check if in_reply_to_status_id is specified. if (!is_null($in_reply_to_status_id)) { $data['in_reply_to_status_id'] = $in_reply_to_status_id; } // Check if lat is specified. if ($lat) { $data['lat'] = $lat; } // Check if long is specified. if ($long) { $data['long'] = $long; } // Check if place_id is specified. if ($place_id) { $data['place_id'] = $place_id; } // Check if display_coordinates is specified. if (!is_null($display_coordinates)) { $data['display_coordinates'] = $display_coordinates; } // Check if sensitive is specified. if (!is_null($sensitive)) { $data['possibly_sensitive'] = $sensitive; } // Send the request. return $this->sendRequest($path, 'POST', $data, $header); } /** * Method to get information allowing the creation of an embedded representation of a Tweet on third party sites. * Note: either the id or url parameters must be specified in a request. It is not necessary to include both. * * @param integer $id The Tweet/status ID to return embed code for. * @param string $url The URL of the Tweet/status to be embedded. * @param integer $maxwidth The maximum width in pixels that the embed should be rendered at. This value is constrained to be * between 250 and 550 pixels. * @param boolean $hide_media Specifies whether the embedded Tweet should automatically expand images which were uploaded via * POST statuses/update_with_media. * @param boolean $hide_thread Specifies whether the embedded Tweet should automatically show the original message in the case that * the embedded Tweet is a reply. * @param boolean $omit_script Specifies whether the embedded Tweet HTML should include a <script> element pointing to widgets.js. In cases where * a page already includes widgets.js, setting this value to true will prevent a redundant script element from being included. * @param string $align Specifies whether the embedded Tweet should be left aligned, right aligned, or centered in the page. * Valid values are left, right, center, and none. * @param string $related A value for the TWT related parameter, as described in Web Intents. This value will be forwarded to all * Web Intents calls. * @param string $lang Language code for the rendered embed. This will affect the text and localization of the rendered HTML. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function getOembed($id = null, $url = null, $maxwidth = null, $hide_media = null, $hide_thread = null, $omit_script = null, $align = null, $related = null, $lang = null) { // Check the rate limit for remaining hits. $this->checkRateLimit('statuses', 'oembed'); // Set the API request path. $path = '/statuses/oembed.json'; // Determine which of $id and $url is specified. if ($id) { $data['id'] = $id; } elseif ($url) { $data['url'] = rawurlencode($url); } else { // We don't have a valid entry. throw new RuntimeException('Either the id or url parameters must be specified in a request.'); } // Check if maxwidth is specified. if ($maxwidth) { $data['maxwidth'] = $maxwidth; } // Check if hide_media is specified. if (!is_null($hide_media)) { $data['hide_media'] = $hide_media; } // Check if hide_thread is specified. if (!is_null($hide_thread)) { $data['hide_thread'] = $hide_thread; } // Check if omit_script is specified. if (!is_null($omit_script)) { $data['omit_script'] = $omit_script; } // Check if align is specified. if ($align) { $data['align'] = $align; } // Check if related is specified. if ($related) { $data['related'] = $related; } // Check if lang is specified. if ($lang) { $data['lang'] = $lang; } // Send the request. return $this->sendRequest($path, 'GET', $data); } } PK���\�3boo&libraries/joomla/twitter/favorites.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Favorites class for the Joomla Platform. * * @since 12.3 */ class JTwitterFavorites extends JTwitterObject { /** * Method to get the most recent favorite statuses for the authenticating or specified user. * * @param mixed $user Either an integer containing the user ID or a string containing the screen name. * @param integer $count Specifies the number of tweets to try and retrieve, up to a maximum of 200. Retweets are always included * in the count, so it is always suggested to set $include_rts to true * @param integer $since_id Returns results with an ID greater than (that is, more recent than) the specified ID. * @param integer $max_id Returns results with an ID less than (that is, older than) the specified ID. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety * of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * * @return array The decoded JSON response * * @since 12.3 */ public function getFavorites($user = null, $count = 20, $since_id = 0, $max_id = 0, $entities = null) { // Check the rate limit for remaining hits $this->checkRateLimit('favorites', 'list'); // Set the API path. $path = '/favorites/list.json'; // Determine which type of data was passed for $user if (is_numeric($user)) { $data['user_id'] = $user; } elseif (is_string($user)) { $data['screen_name'] = $user; } // Set the count string $data['count'] = $count; // Check if since_id is specified. if ($since_id > 0) { $data['since_id'] = $since_id; } // Check if max_id is specified. if ($max_id > 0) { $data['max_id'] = $max_id; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to favorite the status specified in the ID parameter as the authenticating user * * @param integer $id The numerical ID of the desired status. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety * of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * * @return array The decoded JSON response * * @since 12.3 */ public function createFavorites($id, $entities = null) { // Set the API path. $path = '/favorites/create.json'; $data['id'] = $id; // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to un-favorites the status specified in the ID parameter as the authenticating user. * * @param integer $id The numerical ID of the desired status. * @param boolean $entities When set to true, each tweet will include a node called "entities,". This node offers a variety * of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * * @return array The decoded JSON response * * @since 12.3 */ public function deleteFavorites($id, $entities = null) { // Set the API path. $path = '/favorites/destroy.json'; $data['id'] = $id; // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Send the request. return $this->sendRequest($path, 'POST', $data); } } PK���\�0�'�'$libraries/joomla/twitter/profile.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Profile class for the Joomla Platform. * * @since 12.3 */ class JTwitterProfile extends JTwitterObject { /** * Method to et values that users are able to set under the "Account" tab of their settings page. * * @param string $name Full name associated with the profile. Maximum of 20 characters. * @param string $url URL associated with the profile. Will be prepended with "http://" if not present. Maximum of 100 characters. * @param string $location The city or country describing where the user of the account is located. The contents are not normalized * or geocoded in any way. Maximum of 30 characters. * @param string $description A description of the user owning the account. Maximum of 160 characters. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a * variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 */ public function updateProfile($name = null, $url = null, $location = null, $description = null, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('account', 'update_profile'); $data = array(); // Check if name is specified. if ($name) { $data['name'] = $name; } // Check if url is specified. if ($url) { $data['url'] = $url; } // Check if location is specified. if ($location) { $data['location'] = $location; } // Check if description is specified. if ($description) { $data['description'] = $description; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified. if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Set the API path $path = '/account/update_profile.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to update the authenticating user's profile background image. This method can also be used to enable or disable the profile * background image. * * @param string $image The background image for the profile. * @param boolean $tile Whether or not to tile the background image. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a * variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * @param boolean $use Determines whether to display the profile background image or not. * * @return array The decoded JSON response * * @since 12.3 */ public function updateProfileBackgroundImage($image = null, $tile = false, $entities = null, $skip_status = null, $use = false) { // Check the rate limit for remaining hits $this->checkRateLimit('account', 'update_profile_background_image'); $data = array(); // Check if image is specified. if ($image) { $data['image'] = "@{$image}"; } // Check if url is true. if ($tile) { $data['tile'] = $tile; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified. if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Check if use is true. if ($use) { $data['use'] = $use; } // Set the API path $path = '/account/update_profile_background_image.json'; $header = array('Content-Type' => 'multipart/form-data', 'Expect' => ''); // Send the request. return $this->sendRequest($path, 'POST', $data, $header); } /** * Method to update the authenticating user's profile image. * * @param string $image The background image for the profile. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a * variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 */ public function updateProfileImage($image = null, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('account', 'update_profile_image'); $data = array(); // Check if image is specified. if ($image) { $data['image'] = "@{$image}"; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is specified. if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Set the API path $path = '/account/update_profile_image.json'; $header = array('Content-Type' => 'multipart/form-data', 'Expect' => ''); // Send the request. return $this->sendRequest($path, 'POST', $data, $header); } /** * Method to set one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com. * * @param string $background Profile background color. * @param string $link Profile link color. * @param string $sidebar_border Profile sidebar's border color. * @param string $sidebar_fill Profile sidebar's fill color. * @param string $text Profile text color. * @param boolean $entities When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a * variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. * @param boolean $skip_status When set to either true, t or 1 statuses will not be included in the returned user objects. * * @return array The decoded JSON response * * @since 12.3 */ public function updateProfileColors($background = null, $link = null, $sidebar_border = null, $sidebar_fill = null, $text = null, $entities = null, $skip_status = null) { // Check the rate limit for remaining hits $this->checkRateLimit('account', 'update_profile_colors'); $data = array(); // Check if background is specified. if ($background) { $data['profile_background_color'] = $background; } // Check if link is specified. if ($link) { $data['profile_link_color'] = $link; } // Check if sidebar_border is specified. if ($sidebar_border) { $data['profile_sidebar_border_color'] = $sidebar_border; } // Check if sidebar_fill is specified. if ($sidebar_fill) { $data['profile_sidebar_fill_color'] = $sidebar_fill; } // Check if text is specified. if ($text) { $data['profile_text_color'] = $text; } // Check if entities is specified. if (!is_null($entities)) { $data['include_entities'] = $entities; } // Check if skip_status is true. if (!is_null($skip_status)) { $data['skip_status'] = $skip_status; } // Set the API path $path = '/account/update_profile_colors.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } /** * Method to get the settings (including current trend, geo and sleep time information) for the authenticating user. * * @return array The decoded JSON response * * @since 12.3 */ public function getSettings() { // Check the rate limit for remaining hits $this->checkRateLimit('account', 'settings'); // Set the API path $path = '/account/settings.json'; // Send the request. return $this->sendRequest($path); } /** * Method to update the authenticating user's settings. * * @param integer $location The Yahoo! Where On Earth ID to use as the user's default trend location. * @param boolean $sleep_time When set to true, t or 1, will enable sleep time for the user. * @param integer $start_sleep The hour that sleep time should begin if it is enabled. * @param integer $end_sleep The hour that sleep time should end if it is enabled. * @param string $time_zone The timezone dates and times should be displayed in for the user. The timezone must be one of the * Rails TimeZone names. * @param string $lang The language which Twitter should render in for this user. * * @return array The decoded JSON response * * @since 12.3 */ public function updateSettings($location = null, $sleep_time = false, $start_sleep = null, $end_sleep = null, $time_zone = null, $lang = null) { $data = array(); // Check if location is specified. if ($location) { $data['trend_location_woeid '] = $location; } // Check if sleep_time is true. if ($sleep_time) { $data['sleep_time_enabled'] = $sleep_time; } // Check if start_sleep is specified. if ($start_sleep) { $data['start_sleep_time'] = $start_sleep; } // Check if end_sleep is specified. if ($end_sleep) { $data['end_sleep_time'] = $end_sleep; } // Check if time_zone is specified. if ($time_zone) { $data['time_zone'] = $time_zone; } // Check if lang is specified. if ($lang) { $data['lang'] = $lang; } // Set the API path $path = '/account/settings.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } } PK���\}�� "libraries/joomla/twitter/oauth.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Joomla Platform class for generating Twitter API access token. * * @since 12.3 */ class JTwitterOAuth extends JOAuth1Client { /** * @var Registry Options for the JTwitterOauth object. * @since 12.3 */ protected $options; /** * Constructor. * * @param Registry $options JTwitterOauth options object. * @param JHttp $client The HTTP client object. * @param JInput $input The input object. * @param JApplicationWeb $application The application object. * * @since 12.3 */ public function __construct(Registry $options = null, JHttp $client = null, JInput $input = null, JApplicationWeb $application = null) { $this->options = isset($options) ? $options : new Registry; $this->options->def('accessTokenURL', 'https://api.twitter.com/oauth/access_token'); $this->options->def('authenticateURL', 'https://api.twitter.com/oauth/authenticate'); $this->options->def('authoriseURL', 'https://api.twitter.com/oauth/authorize'); $this->options->def('requestTokenURL', 'https://api.twitter.com/oauth/request_token'); // Call the JOAuth1Client constructor to setup the object. parent::__construct($this->options, $client, $input, $application); } /** * Method to verify if the access token is valid by making a request. * * @return boolean Returns true if the access token is valid and false otherwise. * * @since 12.3 */ public function verifyCredentials() { $token = $this->getToken(); // Set the parameters. $parameters = array('oauth_token' => $token['key']); // Set the API base $path = 'https://api.twitter.com/1.1/account/verify_credentials.json'; // Send the request. $response = $this->oauthRequest($path, 'GET', $parameters); // Verify response if ($response->code == 200) { return true; } else { return false; } } /** * Ends the session of the authenticating user, returning a null cookie. * * @return array The decoded JSON response * * @since 12.3 */ public function endSession() { $token = $this->getToken(); // Set parameters. $parameters = array('oauth_token' => $token['key']); // Set the API base $path = 'https://api.twitter.com/1.1/account/end_session.json'; // Send the request. $response = $this->oauthRequest($path, 'POST', $parameters); return json_decode($response->body); } /** * Method to validate a response. * * @param string $url The request URL. * @param JHttpResponse $response The response to validate. * * @return void * * @since 12.3 * @throws DomainException */ public function validateResponse($url, $response) { if (strpos($url, 'verify_credentials') === false && $response->code != 200) { $error = json_decode($response->body); if (property_exists($error, 'error')) { throw new DomainException($error->error); } else { $error = $error->errors; throw new DomainException($error[0]->message, $error[0]->code); } } } } PK���\�Ϩ�!�!#libraries/joomla/twitter/places.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Twitter * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Twitter API Places & Geo class for the Joomla Platform. * * @since 12.3 */ class JTwitterPlaces extends JTwitterObject { /** * Method to get all the information about a known place. * * @param string $id A place in the world. These IDs can be retrieved using getGeocode. * * @return array The decoded JSON response * * @since 12.3 */ public function getPlace($id) { // Check the rate limit for remaining hits $this->checkRateLimit('geo', 'id/:place_id'); // Set the API path $path = '/geo/id/' . $id . '.json'; // Send the request. return $this->sendRequest($path); } /** * Method to get up to 20 places that can be used as a place_id when updating a status. * * @param float $lat The latitude to search around. * @param float $long The longitude to search around. * @param string $accuracy A hint on the "region" in which to search. If a number, then this is a radius in meters, * but it can also take a string that is suffixed with ft to specify feet. * @param string $granularity This is the minimal granularity of place types to return and must be one of: poi, neighborhood, * city, admin or country. * @param integer $max_results A hint as to the number of results to return. * @param string $callback If supplied, the response will use the JSONP format with a callback of the given name. * * @return array The decoded JSON response * * @since 12.3 */ public function getGeocode($lat, $long, $accuracy = null, $granularity = null, $max_results = 0, $callback = null) { // Check the rate limit for remaining hits $this->checkRateLimit('geo', 'reverse_geocode'); // Set the API path $path = '/geo/reverse_geocode.json'; // Set the request parameters $data['lat'] = $lat; $data['long'] = $long; // Check if accuracy is specified if ($accuracy) { $data['accuracy'] = $accuracy; } // Check if granularity is specified if ($granularity) { $data['granularity'] = $granularity; } // Check if max_results is specified if ($max_results) { $data['max_results'] = $max_results; } // Check if callback is specified if ($callback) { $data['callback'] = $callback; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to search for places that can be attached to a statuses/update. * * @param float $lat The latitude to search around. * @param float $long The longitude to search around. * @param string $query Free-form text to match against while executing a geo-based query, best suited for finding nearby * locations by name. * @param string $ip An IP address. * @param string $granularity This is the minimal granularity of place types to return and must be one of: poi, neighborhood, city, * admin or country. * @param string $accuracy A hint on the "region" in which to search. If a number, then this is a radius in meters, but it can * also take a string that is suffixed with ft to specify feet. * @param integer $max_results A hint as to the number of results to return. * @param string $within This is the place_id which you would like to restrict the search results to. * @param string $attribute This parameter searches for places which have this given street address. * @param string $callback If supplied, the response will use the JSONP format with a callback of the given name. * * @return array The decoded JSON response * * @since 12.3 * @throws RuntimeException */ public function search($lat = null, $long = null, $query = null, $ip = null, $granularity = null, $accuracy = null, $max_results = 0, $within = null, $attribute = null, $callback = null) { // Check the rate limit for remaining hits $this->checkRateLimit('geo', 'search'); // Set the API path $path = '/geo/search.json'; // At least one of the following parameters must be provided: lat, long, ip, or query. if ($lat == null && $long == null && $ip == null && $query == null) { throw new RuntimeException('At least one of the following parameters must be provided: lat, long, ip, or query.'); } // Check if lat is specified. if ($lat) { $data['lat'] = $lat; } // Check if long is specified. if ($long) { $data['long'] = $long; } // Check if query is specified. if ($query) { $data['query'] = rawurlencode($query); } // Check if ip is specified. if ($ip) { $data['ip'] = $ip; } // Check if granularity is specified if ($granularity) { $data['granularity'] = $granularity; } // Check if accuracy is specified if ($accuracy) { $data['accuracy'] = $accuracy; } // Check if max_results is specified if ($max_results) { $data['max_results'] = $max_results; } // Check if within is specified if ($within) { $data['contained_within'] = $within; } // Check if attribute is specified if ($attribute) { $data['attribute:street_address'] = rawurlencode($attribute); } // Check if callback is specified if ($callback) { $data['callback'] = $callback; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to locate places near the given coordinates which are similar in name. * * @param float $lat The latitude to search around. * @param float $long The longitude to search around. * @param string $name The name a place is known as. * @param string $within This is the place_id which you would like to restrict the search results to. * @param string $attribute This parameter searches for places which have this given street address. * @param string $callback If supplied, the response will use the JSONP format with a callback of the given name. * * @return array The decoded JSON response * * @since 12.3 */ public function getSimilarPlaces($lat, $long, $name, $within = null, $attribute = null, $callback = null) { // Check the rate limit for remaining hits $this->checkRateLimit('geo', 'similar_places'); // Set the API path $path = '/geo/similar_places.json'; $data['lat'] = $lat; $data['long'] = $long; $data['name'] = rawurlencode($name); // Check if within is specified if ($within) { $data['contained_within'] = $within; } // Check if attribute is specified if ($attribute) { $data['attribute:street_address'] = rawurlencode($attribute); } // Check if callback is specified if ($callback) { $data['callback'] = $callback; } // Send the request. return $this->sendRequest($path, 'GET', $data); } /** * Method to create a new place object at the given latitude and longitude. * * @param float $lat The latitude to search around. * @param float $long The longitude to search around. * @param string $name The name a place is known as. * @param string $geo_token The token found in the response from geo/similar_places. * @param string $within This is the place_id which you would like to restrict the search results to. * @param string $attribute This parameter searches for places which have this given street address. * @param string $callback If supplied, the response will use the JSONP format with a callback of the given name. * * @return array The decoded JSON response * * @since 12.3 */ public function createPlace($lat, $long, $name, $geo_token, $within, $attribute = null, $callback = null) { // Check the rate limit for remaining hits $this->checkRateLimit('geo', 'place'); $data['lat'] = $lat; $data['long'] = $long; $data['name'] = rawurlencode($name); $data['token'] = $geo_token; $data['contained_within'] = $within; // Check if attribute is specified if ($attribute) { $data['attribute:street_address'] = rawurlencode($attribute); } // Check if callback is specified if ($callback) { $data['callback'] = $callback; } // Set the API path $path = '/geo/place.json'; // Send the request. return $this->sendRequest($path, 'POST', $data); } } PK���\���n6n6libraries/joomla/mail/mail.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Mail * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Email Class. Provides a common interface to send email from the Joomla! Platform * * @since 11.1 */ class JMail extends PHPMailer { /** * @var array JMail instances container. * @since 11.3 */ protected static $instances = array(); /** * @var string Charset of the message. * @since 11.1 */ public $CharSet = 'utf-8'; /** * Constructor * * @since 11.1 */ public function __construct() { // PHPMailer has an issue using the relative path for its language files $this->setLanguage('joomla', __DIR__ . '/language'); } /** * Returns the global email object, only creating it * if it doesn't already exist. * * NOTE: If you need an instance to use that does not have the global configuration * values, use an id string that is not 'Joomla'. * * @param string $id The id string for the JMail instance [optional] * * @return JMail The global JMail object * * @since 11.1 */ public static function getInstance($id = 'Joomla') { if (empty(self::$instances[$id])) { self::$instances[$id] = new JMail; } return self::$instances[$id]; } /** * Send the mail * * @return mixed True if successful; JError if using legacy tree (no exception thrown in that case). * * @since 11.1 * @throws RuntimeException */ public function Send() { if (JFactory::getConfig()->get('mailonline', 1)) { if (($this->Mailer == 'mail') && !function_exists('mail')) { if (class_exists('JError')) { return JError::raiseNotice(500, JText::_('JLIB_MAIL_FUNCTION_DISABLED')); } else { throw new RuntimeException(sprintf('%s::Send mail not enabled.', get_class($this))); } } $result = parent::send(); if ($result == false) { if (class_exists('JError')) { $result = JError::raiseNotice(500, JText::_($this->ErrorInfo)); } else { throw new RuntimeException(sprintf('%s::Send failed: "%s".', get_class($this), $this->ErrorInfo)); } } return $result; } else { JFactory::getApplication()->enqueueMessage(JText::_('JLIB_MAIL_FUNCTION_OFFLINE')); return false; } } /** * Set the email sender * * @param mixed $from email address and Name of sender * <code>array([0] => email Address, [1] => Name)</code> * or as a string * * @return JMail Returns this object for chaining. * * @since 11.1 * @throws UnexpectedValueException */ public function setSender($from) { if (is_array($from)) { // If $from is an array we assume it has an address and a name if (isset($from[2])) { // If it is an array with entries, use them $this->setFrom(JMailHelper::cleanLine($from[0]), JMailHelper::cleanLine($from[1]), (bool) $from[2]); } else { $this->setFrom(JMailHelper::cleanLine($from[0]), JMailHelper::cleanLine($from[1])); } } elseif (is_string($from)) { // If it is a string we assume it is just the address $this->setFrom(JMailHelper::cleanLine($from)); } else { // If it is neither, we log a message and throw an exception JLog::add(JText::sprintf('JLIB_MAIL_INVALID_EMAIL_SENDER', $from), JLog::WARNING, 'jerror'); throw new UnexpectedValueException(sprintf('Invalid email Sender: %s, JMail::setSender(%s)', $from)); } return $this; } /** * Set the email subject * * @param string $subject Subject of the email * * @return JMail Returns this object for chaining. * * @since 11.1 */ public function setSubject($subject) { $this->Subject = JMailHelper::cleanLine($subject); return $this; } /** * Set the email body * * @param string $content Body of the email * * @return JMail Returns this object for chaining. * * @since 11.1 */ public function setBody($content) { /* * Filter the Body * TODO: Check for XSS */ $this->Body = JMailHelper::cleanText($content); return $this; } /** * Add recipients to the email. * * @param mixed $recipient Either a string or array of strings [email address(es)] * @param mixed $name Either a string or array of strings [name(s)] * @param string $method The parent method's name. * * @return JMail Returns this object for chaining. * * @since 11.1 * @throws InvalidArgumentException */ protected function add($recipient, $name = '', $method = 'addAddress') { $method = lcfirst($method); // If the recipient is an array, add each recipient... otherwise just add the one if (is_array($recipient)) { if (is_array($name)) { $combined = array_combine($recipient, $name); if ($combined === false) { throw new InvalidArgumentException("The number of elements for each array isn't equal."); } foreach ($combined as $recipientEmail => $recipientName) { $recipientEmail = JMailHelper::cleanLine($recipientEmail); $recipientName = JMailHelper::cleanLine($recipientName); call_user_func('parent::' . $method, $recipientEmail, $recipientName); } } else { $name = JMailHelper::cleanLine($name); foreach ($recipient as $to) { $to = JMailHelper::cleanLine($to); call_user_func('parent::' . $method, $to, $name); } } } else { $recipient = JMailHelper::cleanLine($recipient); call_user_func('parent::' . $method, $recipient, $name); } return $this; } /** * Add recipients to the email * * @param mixed $recipient Either a string or array of strings [email address(es)] * @param mixed $name Either a string or array of strings [name(s)] * * @return JMail Returns this object for chaining. * * @since 11.1 */ public function addRecipient($recipient, $name = '') { $this->add($recipient, $name, 'addAddress'); return $this; } /** * Add carbon copy recipients to the email * * @param mixed $cc Either a string or array of strings [email address(es)] * @param mixed $name Either a string or array of strings [name(s)] * * @return JMail Returns this object for chaining. * * @since 11.1 */ public function addCc($cc, $name = '') { // If the carbon copy recipient is an array, add each recipient... otherwise just add the one if (isset($cc)) { $this->add($cc, $name, 'addCC'); } return $this; } /** * Add blind carbon copy recipients to the email * * @param mixed $bcc Either a string or array of strings [email address(es)] * @param mixed $name Either a string or array of strings [name(s)] * * @return JMail Returns this object for chaining. * * @since 11.1 */ public function addBcc($bcc, $name = '') { // If the blind carbon copy recipient is an array, add each recipient... otherwise just add the one if (isset($bcc)) { $this->add($bcc, $name, 'addBCC'); } return $this; } /** * Add file attachment to the email * * @param mixed $path Either a string or array of strings [filenames] * @param mixed $name Either a string or array of strings [names] * @param mixed $encoding The encoding of the attachment * @param mixed $type The mime type * @param string $disposition The disposition of the attachment * * @return JMail Returns this object for chaining. * * @since 12.2 * @throws InvalidArgumentException */ public function addAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream', $disposition = 'attachment') { // If the file attachments is an array, add each file... otherwise just add the one if (isset($path)) { if (is_array($path)) { if (!empty($name) && count($path) != count($name)) { throw new InvalidArgumentException("The number of attachments must be equal with the number of name"); } foreach ($path as $key => $file) { if (!empty($name)) { parent::addAttachment($file, $name[$key], $encoding, $type); } else { parent::addAttachment($file, $name, $encoding, $type); } } } else { parent::addAttachment($path, $name, $encoding, $type); } } return $this; } /** * Unset all file attachments from the email * * @return JMail Returns this object for chaining. * * @since 12.2 */ public function clearAttachments() { parent::clearAttachments(); return $this; } /** * Unset file attachments specified by array index. * * @param integer $index The numerical index of the attachment to remove * * @return JMail Returns this object for chaining. * * @since 12.2 */ public function removeAttachment($index = 0) { if (isset($this->attachment[$index])) { unset($this->attachment[$index]); } return $this; } /** * Add Reply to email address(es) to the email * * @param mixed $replyto Either a string or array of strings [email address(es)] * @param mixed $name Either a string or array of strings [name(s)] * * @return JMail Returns this object for chaining. * * @since 11.1 */ public function addReplyTo($replyto, $name = '') { $this->add($replyto, $name, 'addReplyTo'); return $this; } /** * Sets message type to HTML * * @param boolean $ishtml Boolean true or false. * * @return JMail Returns this object for chaining. * * @since 12.3 */ public function isHtml($ishtml = true) { parent::isHTML($ishtml); return $this; } /** * Use sendmail for sending the email * * @param string $sendmail Path to sendmail [optional] * * @return boolean True on success * * @since 11.1 */ public function useSendmail($sendmail = null) { $this->Sendmail = $sendmail; if (!empty($this->Sendmail)) { $this->isSendmail(); return true; } else { $this->isMail(); return false; } } /** * Use SMTP for sending the email * * @param string $auth SMTP Authentication [optional] * @param string $host SMTP Host [optional] * @param string $user SMTP Username [optional] * @param string $pass SMTP Password [optional] * @param string $secure Use secure methods * @param integer $port The SMTP port * * @return boolean True on success * * @since 11.1 */ public function useSmtp($auth = null, $host = null, $user = null, $pass = null, $secure = null, $port = 25) { $this->SMTPAuth = $auth; $this->Host = $host; $this->Username = $user; $this->Password = $pass; $this->Port = $port; if ($secure == 'ssl' || $secure == 'tls') { $this->SMTPSecure = $secure; } if (($this->SMTPAuth !== null && $this->Host !== null && $this->Username !== null && $this->Password !== null) || ($this->SMTPAuth === null && $this->Host !== null)) { $this->isSMTP(); return true; } else { $this->isMail(); return false; } } /** * Function to send an email * * @param string $from From email address * @param string $fromName From name * @param mixed $recipient Recipient email address(es) * @param string $subject email subject * @param string $body Message body * @param boolean $mode false = plain text, true = HTML * @param mixed $cc CC email address(es) * @param mixed $bcc BCC email address(es) * @param mixed $attachment Attachment file name(s) * @param mixed $replyTo Reply to email address(es) * @param mixed $replyToName Reply to name(s) * * @return boolean True on success * * @since 11.1 */ public function sendMail($from, $fromName, $recipient, $subject, $body, $mode = false, $cc = null, $bcc = null, $attachment = null, $replyTo = null, $replyToName = null) { $this->setSubject($subject); $this->setBody($body); // Are we sending the email as HTML? if ($mode) { $this->isHtml(true); } $this->addRecipient($recipient); $this->addCc($cc); $this->addBcc($bcc); $this->addAttachment($attachment); // Take care of reply email addresses if (is_array($replyTo)) { $numReplyTo = count($replyTo); for ($i = 0; $i < $numReplyTo; $i++) { $this->addReplyTo($replyTo[$i], $replyToName[$i]); } } elseif (isset($replyTo)) { $this->addReplyTo($replyTo, $replyToName); } // Add sender to replyTo only if no replyTo received $autoReplyTo = (empty($this->ReplyTo)) ? true : false; $this->setSender(array($from, $fromName, $autoReplyTo)); return $this->Send(); } /** * Sends mail to administrator for approval of a user submission * * @param string $adminName Name of administrator * @param string $adminEmail Email address of administrator * @param string $email [NOT USED TODO: Deprecate?] * @param string $type Type of item to approve * @param string $title Title of item to approve * @param string $author Author of item to approve * @param string $url A URL to included in the mail * * @return boolean True on success * * @since 11.1 */ public function sendAdminMail($adminName, $adminEmail, $email, $type, $title, $author, $url = null) { $subject = JText::sprintf('JLIB_MAIL_USER_SUBMITTED', $type); $message = sprintf(JText::_('JLIB_MAIL_MSG_ADMIN'), $adminName, $type, $title, $author, $url, $url, 'administrator', $type); $message .= JText::_('JLIB_MAIL_MSG') . "\n"; $this->addRecipient($adminEmail); $this->setSubject($subject); $this->setBody($message); return $this->Send(); } } PK���\HV�[(( libraries/joomla/mail/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Mail * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Email helper class, provides static methods to perform various tasks relevant * to the Joomla email routines. * * TODO: Test these methods as the regex work is first run and not tested thoroughly * * @since 11.1 */ abstract class JMailHelper { /** * Cleans single line inputs. * * @param string $value String to be cleaned. * * @return string Cleaned string. * * @since 11.1 */ public static function cleanLine($value) { $value = JStringPunycode::emailToPunycode($value); return trim(preg_replace('/(%0A|%0D|\n+|\r+)/i', '', $value)); } /** * Cleans multi-line inputs. * * @param string $value Multi-line string to be cleaned. * * @return string Cleaned multi-line string. * * @since 11.1 */ public static function cleanText($value) { return trim(preg_replace('/(%0A|%0D|\n+|\r+)(content-type:|to:|cc:|bcc:)/i', '', $value)); } /** * Cleans any injected headers from the email body. * * @param string $body email body string. * * @return string Cleaned email body string. * * @since 11.1 */ public static function cleanBody($body) { // Strip all email headers from a string return preg_replace("/((From:|To:|Cc:|Bcc:|Subject:|Content-type:) ([\S]+))/", "", $body); } /** * Cleans any injected headers from the subject string. * * @param string $subject email subject string. * * @return string Cleaned email subject string. * * @since 11.1 */ public static function cleanSubject($subject) { return preg_replace("/((From:|To:|Cc:|Bcc:|Content-type:) ([\S]+))/", "", $subject); } /** * Verifies that an email address does not have any extra headers injected into it. * * @param string $address email address. * * @return mixed email address string or boolean false if injected headers are present. * * @since 11.1 */ public static function cleanAddress($address) { if (preg_match("[\s;,]", $address)) { return false; } return $address; } /** * Verifies that the string is in a proper email address format. * * @param string $email String to be verified. * * @return boolean True if string has the correct format; false otherwise. * * @since 11.1 */ public static function isEmailAddress($email) { // Split the email into a local and domain $atIndex = strrpos($email, "@"); $domain = substr($email, $atIndex + 1); $local = substr($email, 0, $atIndex); // Check Length of domain $domainLen = strlen($domain); if ($domainLen < 1 || $domainLen > 255) { return false; } /* * Check the local address * We're a bit more conservative about what constitutes a "legal" address, that is, a-zA-Z0-9.!#$%&’*+/=?^_`{|}~- * The first and last character in local cannot be a period ('.') * Also, period should not appear 2 or more times consecutively */ $allowed = 'a-zA-Z0-9.!#$%&’*+\/=?^_`{|}~-'; $regex = "/^[$allowed][\.$allowed]{0,63}$/"; if (!preg_match($regex, $local) || substr($local, -1) == '.' || $local[0] == '.' || preg_match('/\.\./', $local)) { return false; } // No problem if the domain looks like an IP address, ish $regex = '/^[0-9\.]+$/'; if (preg_match($regex, $domain)) { return true; } // Check Lengths $localLen = strlen($local); if ($localLen < 1 || $localLen > 64) { return false; } // Check the domain $domain_array = explode(".", rtrim($domain, '.')); $regex = '/^[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/'; foreach ($domain_array as $domain) { // Convert domain to punycode $domain = JStringPunycode::toPunycode($domain); // Must be something if (!$domain) { return false; } // Check for invalid characters if (!preg_match($regex, $domain)) { return false; } // Check for a dash at the beginning of the domain if (strpos($domain, '-') === 0) { return false; } // Check for a dash at the end of the domain $length = strlen($domain) - 1; if (strpos($domain, '-', $length) === $length) { return false; } } return true; } } PK���\�*v�8libraries/joomla/mail/language/phpmailer.lang-joomla.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Mail * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; $PHPMAILER_LANG["authenticate"] = JText::_('PHPMAILER_AUTHENTICATE'); $PHPMAILER_LANG["connect_host"] = JText::_('PHPMAILER_CONNECT_HOST'); $PHPMAILER_LANG["data_not_accepted"] = JText::_('PHPMAILER_DATA_NOT_ACCEPTED'); $PHPMAILER_LANG['empty_message'] = JText::_('PHPMAILER_EMPTY_MESSAGE'); $PHPMAILER_LANG["encoding"] = JText::_('PHPMAILER_ENCODING'); $PHPMAILER_LANG["execute"] = JText::_('PHPMAILER_EXECUTE'); $PHPMAILER_LANG["file_access"] = JText::_('PHPMAILER_FILE_ACCESS'); $PHPMAILER_LANG["file_open"] = JText::_('PHPMAILER_FILE_OPEN'); $PHPMAILER_LANG["from_failed"] = JText::_('PHPMAILER_FROM_FAILED'); $PHPMAILER_LANG["instantiate"] = JText::_('PHPMAILER_INSTANTIATE'); $PHPMAILER_LANG['invalid_address'] = JText::_('PHPMAILER_INVALID_ADDRESS'); $PHPMAILER_LANG["mailer_not_supported"] = JText::_('PHPMAILER_MAILER_IS_NOT_SUPPORTED'); $PHPMAILER_LANG["provide_address"] = JText::_('PHPMAILER_PROVIDE_ADDRESS'); $PHPMAILER_LANG["recipients_failed"] = JText::_('PHPMAILER_RECIPIENTS_FAILED'); $PHPMAILER_LANG["signing"] = JText::_('PHPMAILER_SIGNING_ERROR'); $PHPMAILER_LANG['smtp_connect_failed'] = JText::_('PHPMAILER_SMTP_CONNECT_FAILED'); $PHPMAILER_LANG['smtp_error'] = JText::_('PHPMAILER_SMTP_ERROR'); $PHPMAILER_LANG['variable_set'] = JText::_('PHPMAILER_VARIABLE_SET'); PK���\��J (libraries/joomla/mail/wrapper/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Mail * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JMailHelper * * @package Joomla.Platform * @subpackage Mail * @since 3.4 */ class JMailWrapperHelper { /** * Helper wrapper method for cleanLine * * @param string $value String to be cleaned. * * @return string Cleaned string. * * @see JMailHelper::cleanLine() * @since 3.4 */ public function cleanLine($value) { return JMailHelper::cleanLine($value); } /** * Helper wrapper method for cleanText * * @param string $value Multi-line string to be cleaned. * * @return string Cleaned multi-line string. * * @see JMailHelper::cleanText() * @since 3.4 */ public function cleanText($value) { return JMailHelper::cleanText($value); } /** * Helper wrapper method for cleanBody * * @param string $body email body string. * * @return string Cleaned email body string. * * @see JMailHelper::cleanBody() * @since 3.4 */ public function cleanBody($body) { return JMailHelper::cleanBody($body); } /** * Helper wrapper method for cleanSubject * * @param string $subject email subject string. * * @return string Cleaned email subject string. * * @see JMailHelper::cleanSubject() * @since 3.4 */ public function cleanSubject($subject) { return JMailHelper::cleanSubject($subject); } /** * Helper wrapper method for cleanAddress * * @param string $address email address. * * @return mixed email address string or boolean false if injected headers are present * * @see JMailHelper::cleanAddress() * @since 3.4 */ public function cleanAddress($address) { return JMailHelper::cleanAddress($address); } /** * Helper wrapper method for isEmailAddress * * @param string $email String to be verified. * * @return boolean True if string has the correct format; false otherwise. * * @see JMailHelper::isEmailAddress() * @since 3.4 */ public function isEmailAddress($email) { return JMailHelper::isEmailAddress($email); } } PK���\>�]-� � libraries/joomla/view/html.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage View * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.path'); /** * Joomla Platform HTML View Class * * @since 12.1 */ abstract class JViewHtml extends JViewBase { /** * The view layout. * * @var string * @since 12.1 */ protected $layout = 'default'; /** * The paths queue. * * @var SplPriorityQueue * @since 12.1 */ protected $paths; /** * Method to instantiate the view. * * @param JModel $model The model object. * @param SplPriorityQueue $paths The paths queue. * * @since 12.1 */ public function __construct(JModel $model, SplPriorityQueue $paths = null) { parent::__construct($model); // Setup dependencies. $this->paths = isset($paths) ? $paths : $this->loadPaths(); } /** * Magic toString method that is a proxy for the render method. * * @return string * * @since 12.1 */ public function __toString() { return $this->render(); } /** * Method to escape output. * * @param string $output The output to escape. * * @return string The escaped output. * * @see JView::escape() * @since 12.1 */ public function escape($output) { // Escape the output. return htmlspecialchars($output, ENT_COMPAT, 'UTF-8'); } /** * Method to get the view layout. * * @return string The layout name. * * @since 12.1 */ public function getLayout() { return $this->layout; } /** * Method to get the layout path. * * @param string $layout The layout name. * * @return mixed The layout file name if found, false otherwise. * * @since 12.1 */ public function getPath($layout) { // Get the layout file name. $file = JPath::clean($layout . '.php'); // Find the layout file path. $path = JPath::find(clone $this->paths, $file); return $path; } /** * Method to get the view paths. * * @return SplPriorityQueue The paths queue. * * @since 12.1 */ public function getPaths() { return $this->paths; } /** * Method to render the view. * * @return string The rendered view. * * @since 12.1 * @throws RuntimeException */ public function render() { // Get the layout path. $path = $this->getPath($this->getLayout()); // Check if the layout path was found. if (!$path) { throw new RuntimeException('Layout Path Not Found'); } // Start an output buffer. ob_start(); // Load the layout. include $path; // Get the layout contents. $output = ob_get_clean(); return $output; } /** * Method to set the view layout. * * @param string $layout The layout name. * * @return JViewHtml Method supports chaining. * * @since 12.1 */ public function setLayout($layout) { $this->layout = $layout; return $this; } /** * Method to set the view paths. * * @param SplPriorityQueue $paths The paths queue. * * @return JViewHtml Method supports chaining. * * @since 12.1 */ public function setPaths(SplPriorityQueue $paths) { $this->paths = $paths; return $this; } /** * Method to load the paths queue. * * @return SplPriorityQueue The paths queue. * * @since 12.1 */ protected function loadPaths() { return new SplPriorityQueue; } } PK���\� =��libraries/joomla/view/view.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage View * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform View Interface * * @since 12.1 */ interface JView { /** * Method to escape output. * * @param string $output The output to escape. * * @return string The escaped output. * * @since 12.1 */ public function escape($output); /** * Method to render the view. * * @return string The rendered view. * * @since 12.1 * @throws RuntimeException */ public function render(); } PK���\�W��libraries/joomla/view/base.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage View * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Base View Class * * @since 12.1 */ abstract class JViewBase implements JView { /** * The model object. * * @var JModel * @since 12.1 */ protected $model; /** * Method to instantiate the view. * * @param JModel $model The model object. * * @since 12.1 */ public function __construct(JModel $model) { // Setup dependencies. $this->model = $model; } /** * Method to escape output. * * @param string $output The output to escape. * * @return string The escaped output. * * @see JView::escape() * @since 12.1 */ public function escape($output) { return $output; } } PK���\֬xw�w�"libraries/joomla/facebook/user.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API User class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/user/ * @since 13.1 */ class JFacebookUser extends JFacebookObject { /** * Method to get the specified user's details. Authentication is required only for some fields. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getUser($user) { return $this->get($user); } /** * Method to get the specified user's friends. Requires authentication. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getFriends($user, $limit = 0, $offset = 0) { return $this->getConnection($user, 'friends', '', $limit, $offset); } /** * Method to get the user's incoming friend requests. Requires authentication and read_requests permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getFriendRequests($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'friendrequests', '', $limit, $offset, $until, $since); } /** * Method to get the user's friend lists. Requires authentication and read_friendlists permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getFriendLists($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'friendlists', '', $limit, $offset, $until, $since); } /** * Method to get the user's wall. Requires authentication and read_stream permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getFeed($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'feed', '', $limit, $offset, $until, $since); } /** * Method to get the user's news feed. Requires authentication and read_stream permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $filter User's stream filter. * @param boolean $location Retreive only posts with a location attached. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getHome($user, $filter = null, $location = false, $limit = 0, $offset = 0, $until = null, $since = null) { $extra_fields = ''; if ($filter != null) { $extra_fields = '?filter=' . $filter; } if ($location == true) { $extra_fields .= (strpos($extra_fields, '?') === false) ? '?with=location' : '&with=location'; } return $this->getConnection($user, 'home', $extra_fields, $limit, $offset, $until, $since); } /** * Method to see if a user is a friend of the current user. Requires authentication. * * @param mixed $current_user Either an integer containing the user ID or a string containing the username for the current user. * @param mixed $user Either an integer containing the user ID or a string containing the username for the user. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function hasFriend($current_user, $user) { return $this->getConnection($current_user, 'friends/' . $user); } /** * Method to get mutual friends of one user and the current user. Requires authentication. * * @param mixed $current_user Either an integer containing the user ID or a string containing the username for the current user. * @param mixed $user Either an integer containing the user ID or a string containing the username for the user. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getMutualFriends($current_user, $user, $limit = 0, $offset = 0) { return $this->getConnection($current_user, 'mutualfriends/' . $user, '', $limit, $offset); } /** * Method to get the user's profile picture. Requires authentication. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param boolean $redirect If false this will return the URL of the profile picture without a 302 redirect. * @param string $type To request a different photo use square | small | normal | large. * * @return string The URL to the user's profile picture. * * @since 13.1 */ public function getPicture($user, $redirect = true, $type = null) { $extra_fields = ''; if ($redirect == false) { $extra_fields = '?redirect=false'; } if ($type != null) { $extra_fields .= (strpos($extra_fields, '?') === false) ? '?type=' . $type : '&type=' . $type; } return $this->getConnection($user, 'picture', $extra_fields); } /** * Method to get the user's family relationships. Requires authentication and user_relationships permission.. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getFamily($user, $limit = 0, $offset = 0) { return $this->getConnection($user, 'family', '', $limit, $offset); } /** * Method to get the user's notifications. Requires authentication and manage_notifications permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param boolean $read Enables you to see notifications that the user has already read. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getNotifications($user, $read = null, $limit = 0, $offset = 0, $until = null, $since = null) { if ($read == true) { $read = '?include_read=1'; } // Send the request. return $this->getConnection($user, 'notifications', $read, $limit, $offset, $until, $since); } /** * Method to mark a notification as read. Requires authentication and manage_notifications permission. * * @param string $notification The notification id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function updateNotification($notification) { $data['unread'] = 0; return $this->createConnection($notification, null, $data); } /** * Method to get the user's permissions. Requires authentication. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getPermissions($user, $limit = 0, $offset = 0) { return $this->getConnection($user, 'permissions', '', $limit, $offset); } /** * Method to revoke a specific permission on behalf of a user. Requires authentication. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $permission The permission to revoke. If none specified, then this will de-authorize the application completely. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function deletePermission($user, $permission = '') { return $this->deleteConnection($user, 'permissions', '?permission=' . $permission); } /** * Method to get the user's albums. Requires authentication and user_photos or friends_photos permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getAlbums($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'albums', '', $limit, $offset, $until, $since); } /** * Method to create an album for a user. Requires authentication and publish_stream permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $name Album name. * @param string $description Album description. * @param json $privacy A JSON-encoded object that defines the privacy setting for the album. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createAlbum($user, $name, $description = null, $privacy = null) { // Set POST request parameters. $data = array(); $data['name'] = $name; $data['description'] = $description; $data['privacy'] = $privacy; return $this->createConnection($user, 'albums', $data); } /** * Method to get the user's checkins. Requires authentication and user_checkins or friends_checkins permission * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getCheckins($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'checkins', '', $limit, $offset, $until, $since); } /** * Method to create a checkin for a user. Requires authentication and publish_checkins permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $place Id of the Place Page. * @param string $coordinates A JSON-encoded string containing latitute and longitude. * @param string $tags Comma separated list of USER_IDs. * @param string $message A message to add to the checkin. * @param string $link A link to add to the checkin. * @param string $picture A picture to add to the checkin. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createCheckin($user, $place, $coordinates, $tags = null, $message = null, $link = null, $picture = null) { // Set POST request parameters. $data = array(); $data['place'] = $place; $data['coordinates'] = $coordinates; $data['tags'] = $tags; $data['message'] = $message; $data['link'] = $link; $data['picture'] = $picture; return $this->createConnection($user, 'checkins', $data); } /** * Method to get the user's likes. Requires authentication and user_likes or friends_likes permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'likes', '', $limit, $offset, $until, $since); } /** * Method to see if a user likes a specific Page. Requires authentication. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $page Facebook ID of the Page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function likesPage($user, $page) { return $this->getConnection($user, 'likes/' . $page); } /** * Method to get the current user's events. Requires authentication and user_events or friends_events permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getEvents($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'events', '', $limit, $offset, $until, $since); } /** * Method to create an event for a user. Requires authentication create_event permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $name Event name. * @param string $start_time Event start time as UNIX timestamp. * @param string $end_time Event end time as UNIX timestamp. * @param string $description Event description. * @param string $location Event location. * @param string $location_id Facebook Place ID of the place the Event is taking place. * @param string $privacy_type Event privacy setting, a string containing 'OPEN' (default), 'CLOSED', or 'SECRET'. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createEvent($user, $name, $start_time, $end_time = null, $description = null, $location = null, $location_id = null, $privacy_type = null) { // Set POST request parameters. $data = array(); $data['start_time'] = $start_time; $data['name'] = $name; $data['end_time'] = $end_time; $data['description'] = $description; $data['location'] = $location; $data['location_id'] = $location_id; $data['privacy_type'] = $privacy_type; return $this->createConnection($user, 'events', $data); } /** * Method to edit an event. Requires authentication create_event permission. * * @param mixed $event Event ID. * @param string $name Event name. * @param string $start_time Event start time as UNIX timestamp. * @param string $end_time Event end time as UNIX timestamp. * @param string $description Event description. * @param string $location Event location. * @param string $location_id Facebook Place ID of the place the Event is taking place. * @param string $privacy_type Event privacy setting, a string containing 'OPEN' (default), 'CLOSED', or 'SECRET'. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function editEvent($event, $name = null, $start_time = null, $end_time = null, $description = null, $location = null, $location_id = null, $privacy_type = null) { // Set POST request parameters. $data = array(); $data['start_time'] = $start_time; $data['name'] = $name; $data['end_time'] = $end_time; $data['description'] = $description; $data['location'] = $location; $data['location_id'] = $location_id; $data['privacy_type'] = $privacy_type; return $this->createConnection($event, null, $data); } /** * Method to delete an event. Note: you can only delete the event if it was created by the same app. Requires authentication create_event permission. * * @param string $event Event ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteEvent($event) { return $this->deleteConnection($event); } /** * Method to get the groups that the user belongs to. Requires authentication and user_groups or friends_groups permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getGroups($user, $limit = 0, $offset = 0) { return $this->getConnection($user, 'groups', '', $limit, $offset); } /** * Method to get the user's posted links. Requires authentication and user_groups or friends_groups permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLinks($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'links', '', $limit, $offset, $until, $since); } /** * Method to post a link on user's feed. Requires authentication and publish_stream permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $link Link URL. * @param strin $message Link message. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createLink($user, $link, $message = null) { // Set POST request parameters. $data = array(); $data['link'] = $link; $data['message'] = $message; return $this->createConnection($user, 'feed', $data); } /** * Method to delete a link. Requires authentication and publish_stream permission. * * @param mixed $link The Link ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLink($link) { return $this->deleteConnection($link); } /** * Method to get the user's notes. Requires authentication and user_groups or friends_groups permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getNotes($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'notes', '', $limit, $offset, $until, $since); } /** * Method to create a note on the behalf of the user. * Requires authentication and publish_stream permission, user_groups or friends_groups permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $subject The subject of the note. * @param string $message Note content. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createNote($user, $subject, $message) { // Set POST request parameters. $data = array(); $data['subject'] = $subject; $data['message'] = $message; return $this->createConnection($user, 'notes', $data); } /** * Method to get the user's photos. Requires authentication and user_groups or friends_groups permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getPhotos($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'photos', '', $limit, $offset, $until, $since); } /** * Method to post a photo on user's wall. Requires authentication and publish_stream permission, user_groups or friends_groups permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $source Path to photo. * @param string $message Photo description. * @param string $place Facebook ID of the place associated with the photo. * @param boolean $no_story If set to 1, optionally suppresses the feed story that is automatically * generated on a user’s profile when they upload a photo using your application. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createPhoto($user, $source, $message = null, $place = null, $no_story = null) { // Set POST request parameters. $data = array(); $data[basename($source)] = '@' . realpath($source); $data['message'] = $message; $data['place'] = $place; $data['no_story'] = $no_story; return $this->createConnection($user, 'photos', $data, array('Content-Type' => 'multipart/form-data')); } /** * Method to get the user's posts. Requires authentication and read_stream permission for non-public posts. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param boolean $location Retreive only posts with a location attached. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getPosts($user, $location = false, $limit = 0, $offset = 0, $until = null, $since = null) { if ($location == true) { $location = '?with=location'; } // Send the request. return $this->getConnection($user, 'posts', $location, $limit, $offset, $until, $since); } /** * Method to post on a user's wall. Message or link parameter is required. Requires authentication and publish_stream permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $message Post message. * @param string $link Post URL. * @param string $picture Post thumbnail image (can only be used if link is specified) * @param string $name Post name (can only be used if link is specified). * @param string $caption Post caption (can only be used if link is specified). * @param string $description Post description (can only be used if link is specified). * @param array $actions Post actions array of objects containing name and link. * @param string $place Facebook Page ID of the location associated with this Post. * @param string $tags Comma-separated list of Facebook IDs of people tagged in this Post. * For example: 1207059,701732. You cannot specify this field without also specifying a place. * @param string $privacy Post privacy settings (can only be specified if the Timeline being posted * on belongs to the User creating the Post). * @param string $object_attachment Facebook ID for an existing picture in the User's photo albums to use as the thumbnail image. * The User must be the owner of the photo, and the photo cannot be part of a message attachment. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createPost($user, $message = null, $link = null, $picture = null, $name = null, $caption = null, $description = null, $actions = null, $place = null, $tags = null, $privacy = null, $object_attachment = null) { // Set POST request parameters. $data = array(); $data['message'] = $message; $data['link'] = $link; $data['name'] = $name; $data['caption'] = $caption; $data['description'] = $description; $data['actions'] = $actions; $data['place'] = $place; $data['tags'] = $tags; $data['privacy'] = $privacy; $data['object_attachment'] = $object_attachment; $data['picture'] = $picture; return $this->createConnection($user, 'feed', $data); } /** * Method to delete a post. Note: you can only delete the post if it was created by the current user. Requires authentication * * @param string $post The Post ID. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function deletePost($post) { return $this->deleteConnection($post); } /** * Method to get the user's statuses. Requires authentication read_stream permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getStatuses($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'statuses', '', $limit, $offset, $until, $since); } /** * Method to post a status message on behalf of the user. Requires authentication publish_stream permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $message Status message content. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createStatus($user, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($user, 'feed', $data); } /** * Method to delete a status. Note: you can only delete the post if it was created by the current user. * Requires authentication publish_stream permission. * * @param string $status The Status ID. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function deleteStatus($status) { return $this->deleteConnection($status); } /** * Method to get the videos the user has been tagged in. Requires authentication and user_videos or friends_videos permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getVideos($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'videos', '', $limit, $offset, $until, $since); } /** * Method to post a video on behalf of the user. Requires authentication and publish_stream permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param string $source Path to video. * @param string $title Video title. * @param string $description Video description. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createVideo($user, $source, $title = null, $description = null) { // Set POST request parameters. $data = array(); $data[basename($source)] = '@' . realpath($source); $data['title'] = $title; $data['description'] = $description; return $this->createConnection($user, 'videos', $data, array('Content-Type' => 'multipart/form-data')); } /** * Method to get the posts the user has been tagged in. Requires authentication and user_videos or friends_videos permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getTagged($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'tagged', '', $limit, $offset, $until, $since); } /** * Method to get the activities listed on the user's profile. Requires authentication and user_activities or friends_activities permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getActivities($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'activities', '', $limit, $offset, $until, $since); } /** * Method to get the books listed on the user's profile. Requires authentication and user_likes or friends_likes permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getBooks($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'books', '', $limit, $offset, $until, $since); } /** * Method to get the interests listed on the user's profile. Requires authentication. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getInterests($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'interests', '', $limit, $offset, $until, $since); } /** * Method to get the movies listed on the user's profile. Requires authentication and user_likes or friends_likes permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getMovies($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'movies', '', $limit, $offset, $until, $since); } /** * Method to get the television listed on the user's profile. Requires authentication and user_likes or friends_likes permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getTelevision($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'television', '', $limit, $offset, $until, $since); } /** * Method to get the music listed on the user's profile. Requires authentication user_likes or friends_likes permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getMusic($user, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($user, 'music', '', $limit, $offset, $until, $since); } /** * Method to get the user's subscribers. Requires authentication and user_subscriptions or friends_subscriptions permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getSubscribers($user, $limit = 0, $offset = 0) { return $this->getConnection($user, 'subscribers', '', $limit, $offset); } /** * Method to get the people the user is subscribed to. Requires authentication and user_subscriptions or friends_subscriptions permission. * * @param mixed $user Either an integer containing the user ID or a string containing the username. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getSubscribedTo($user, $limit = 0, $offset = 0) { return $this->getConnection($user, 'subscribedto', '', $limit, $offset); } } PK���\��WM��#libraries/joomla/facebook/photo.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Photo class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/photo/ * @since 13.1 */ class JFacebookPhoto extends JFacebookObject { /** * Method to get a photo. Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $photo The photo id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getPhoto($photo) { return $this->get($photo); } /** * Method to get a photo's comments. Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $photo The photo id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComments($photo, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($photo, 'comments', '', $limit, $offset, $until, $since); } /** * Method to comment on a photo. Requires authentication and publish_stream permission, user_photos or friends_photos permission for private photos. * * @param string $photo The photo id. * @param string $message The comment's text. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createComment($photo, $message) { // Set POST request parameters. $data['message'] = $message; return $this->createConnection($photo, 'comments', $data); } /** * Method to delete a comment. Requires authentication and publish_stream permission, user_photos or friends_photos permission for private photos. * * @param string $comment The comment's id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteComment($comment) { return $this->deleteConnection($comment); } /** * Method to get photo's likes. Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $photo The photo id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($photo, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($photo, 'likes', '', $limit, $offset, $until, $since); } /** * Method to like a photo. Requires authentication and publish_stream permission, user_photos or friends_photos permission for private photos. * * @param string $photo The photo id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createLike($photo) { return $this->createConnection($photo, 'likes'); } /** * Method to unlike a photo. Requires authentication and publish_stream permission, user_photos or friends_photos permission for private photos. * * @param string $photo The photo id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLike($photo) { return $this->deleteConnection($photo, 'likes'); } /** * Method to get the Users tagged in the photo. Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $photo The photo id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getTags($photo, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($photo, 'tags', '', $limit, $offset, $until, $since); } /** * Method to tag one or more Users in a photo. $to or $tag_text required. * Requires authentication and publish_stream permission, user_photos permission for private photos. * * @param string $photo The photo id. * @param mixed $to ID of the User or an array of Users to tag in the photo: [{"id":"1234"}, {"id":"12345"}]. * @param string $tag_text A text string to tag. * @param integer $x x coordinate of tag, as a percentage offset from the left edge of the picture. * @param integer $y y coordinate of tag, as a percentage offset from the top edge of the picture. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createTag($photo, $to = null, $tag_text = null, $x = null, $y = null) { // Set POST request parameters. if (is_array($to)) { $data['tags'] = $to; } else { $data['to'] = $to; } if ($tag_text) { $data['tag_text'] = $tag_text; } if ($x) { $data['x'] = $x; } if ($y) { $data['y'] = $y; } return $this->createConnection($photo, 'tags', $data); } /** * Method to update the position of the tag for a particular Users in a photo. * Requires authentication and publish_stream permission, user_photos permission for private photos. * * @param string $photo The photo id. * @param string $to ID of the User to update tag in the photo. * @param integer $x x coordinate of tag, as a percentage offset from the left edge of the picture. * @param integer $y y coordinate of tag, as a percentage offset from the top edge of the picture. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function updateTag($photo, $to, $x = null, $y = null) { // Set POST request parameters. $data['to'] = $to; if ($x) { $data['x'] = $x; } if ($y) { $data['y'] = $y; } return $this->createConnection($photo, 'tags', $data); } /** * Method to get the album-sized view of the photo. Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $photo The photo id. * @param boolean $redirect If false this will return the URL of the picture without a 302 redirect. * * @return string URL of the picture. * * @since 13.1 */ public function getPicture($photo, $redirect = true) { $extra_fields = ''; if ($redirect == false) { $extra_fields = '?redirect=false'; } return $this->getConnection($photo, 'picture', $extra_fields); } } PK���\74�$libraries/joomla/facebook/object.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Facebook API object class for the Joomla Platform. * * @since 13.1 */ abstract class JFacebookObject { /** * @var Registry Options for the Facebook object. * @since 13.1 */ protected $options; /** * @var JHttp The HTTP client object to use in sending HTTP requests. * @since 13.1 */ protected $client; /** * @var JFacebookOAuth The OAuth client. * @since 13.1 */ protected $oauth; /** * Constructor. * * @param Registry $options Facebook options object. * @param JHttp $client The HTTP client object. * @param JFacebookOAuth $oauth The OAuth client. * * @since 13.1 */ public function __construct(Registry $options = null, JHttp $client = null, JFacebookOAuth $oauth = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JHttp($this->options); $this->oauth = $oauth; } /** * Method to build and return a full request URL for the request. This method will * add appropriate pagination details if necessary and also prepend the API url * to have a complete URL for the request. * * @param string $path URL to inflect. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param timestamp $until A unix timestamp or any date accepted by strtotime. * @param timestamp $since A unix timestamp or any date accepted by strtotime. * * @return string The request URL. * * @since 13.1 */ protected function fetchUrl($path, $limit = 0, $offset = 0, $until = null, $since = null) { // Get a new JUri object fousing the api url and given path. $uri = new JUri($this->options->get('api.url') . $path); if ($limit > 0) { $uri->setVar('limit', (int) $limit); } if ($offset > 0) { $uri->setVar('offset', (int) $offset); } if ($until != null) { $uri->setVar('until', $until); } if ($since != null) { $uri->setVar('since', $since); } return (string) $uri; } /** * Method to send the request. * * @param string $path The path of the request to make. * @param mixed $data Either an associative array or a string to be sent with the post request. * @param array $headers An array of name-value pairs to include in the header of the request * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The request response. * * @since 13.1 * @throws DomainException */ public function sendRequest($path, $data = '', array $headers = null, $limit = 0, $offset = 0, $until = null, $since = null) { // Send the request. $response = $this->client->get($this->fetchUrl($path, $limit, $offset, $until, $since), $headers); $response = json_decode($response->body); // Validate the response. if (property_exists($response, 'error')) { throw new RuntimeException($response->error->message); } return $response; } /** * Method to get an object. * * @param string $object The object id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function get($object) { if ($this->oauth != null) { if ($this->oauth->isAuthenticated()) { $response = $this->oauth->query($this->fetchUrl($object)); return json_decode($response->body); } else { return false; } } // Send the request. return $this->sendRequest($object); } /** * Method to get object's connection. * * @param string $object The object id. * @param string $connection The object's connection name. * @param string $extra_fields URL fields. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getConnection($object, $connection = null, $extra_fields = '', $limit = 0, $offset = 0, $until = null, $since = null) { $path = $object . '/' . $connection . $extra_fields; if ($this->oauth != null) { if ($this->oauth->isAuthenticated()) { $response = $this->oauth->query($this->fetchUrl($path, $limit, $offset, $until, $since)); if (strcmp($response->body, '')) { return json_decode($response->body); } else { return $response->headers['Location']; } } else { return false; } } // Send the request. return $this->sendRequest($path, '', null, $limit, $offset, $until, $since); } /** * Method to create a connection. * * @param string $object The object id. * @param string $connection The object's connection name. * @param array $parameters The POST request parameters. * @param array $headers An array of name-value pairs to include in the header of the request * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createConnection($object, $connection = null, $parameters = null, array $headers = null) { if ($this->oauth->isAuthenticated()) { // Build the request path. if ($connection != null) { $path = $object . '/' . $connection; } else { $path = $object; } // Send the post request. $response = $this->oauth->query($this->fetchUrl($path), $parameters, $headers, 'post'); return json_decode($response->body); } else { return false; } } /** * Method to delete a connection. * * @param string $object The object id. * @param string $connection The object's connection name. * @param string $extra_fields URL fields. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function deleteConnection($object, $connection = null, $extra_fields = '') { if ($this->oauth->isAuthenticated()) { // Build the request path. if ($connection != null) { $path = $object . '/' . $connection . $extra_fields; } else { $path = $object . $extra_fields; } // Send the delete request. $response = $this->oauth->query($this->fetchUrl($path), null, array(), 'delete'); return json_decode($response->body); } else { return false; } } /** * Method used to set the OAuth client. * * @param JFacebookOAuth $oauth The OAuth client object. * * @return JFacebookObject This object for method chaining. * * @since 13.1 */ public function setOAuth($oauth) { $this->oauth = $oauth; return $this; } /** * Method used to get the OAuth client. * * @return JFacebookOAuth The OAuth client * * @since 13.1 */ public function getOAuth() { return $this->oauth; } } PK���\%�O���#libraries/joomla/facebook/album.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Album class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/album/ * @since 13.1 */ class JFacebookAlbum extends JFacebookObject { /** * Method to get an album. Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $album The album id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getAlbum($album) { return $this->get($album); } /** * Method to get the photos contained in this album. Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $album The album id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getPhotos($album, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($album, 'photos', '', $limit, $offset, $until, $since); } /** * Method to add photos to an album. Note: check can_upload flag first. Requires authentication and publish_stream permission. * * @param string $album The album id. * @param string $source Path to photo. * @param string $message Photo description. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createPhoto($album, $source, $message = null) { // Set POST request parameters. $data = array(); $data[basename($source)] = '@' . realpath($source); if ($message) { $data['message'] = $message; } return $this->createConnection($album, 'photos', $data, array('Content-Type' => 'multipart/form-data')); } /** * Method to get an album's comments. Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $album The album id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComments($album, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($album, 'comments', '', $limit, $offset, $until, $since); } /** * Method to comment on an album. Requires authentication and publish_stream permission. * * @param string $album The album id. * @param string $message The comment's text. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createComment($album, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($album, 'comments', $data); } /** * Method to delete a comment. Requires authentication and publish_stream permission. * * @param string $comment The comment's id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteComment($comment) { return $this->deleteConnection($comment); } /** * Method to get album's likes. Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $album The album id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($album, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($album, 'likes', '', $limit, $offset, $until, $since); } /** * Method to like an album. Requires authentication and publish_stream permission. * * @param string $album The album id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createLike($album) { return $this->createConnection($album, 'likes'); } /** * Method to unlike an album. Requires authentication and publish_stream permission. * * @param string $album The album id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLike($album) { return $this->deleteConnection($album, 'likes'); } /** * Method to get the album's cover photo, the first picture uploaded to an album becomes the cover photo for the album. * Requires authentication and user_photos or friends_photos permission for private photos. * * @param string $album The album id. * @param boolean $redirect If false this will return the URL of the picture without a 302 redirect. * * @return string URL of the picture. * * @since 13.1 */ public function getPicture($album, $redirect = true) { $extra_fields = ''; if ($redirect == false) { $extra_fields = '?redirect=false'; } return $this->getConnection($album, 'picture', $extra_fields); } } PK���\�Ů#libraries/joomla/facebook/group.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Group class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/group/ * @since 13.1 */ class JFacebookGroup extends JFacebookObject { /** * Method to read a group. Requires authentication and user_groups or friends_groups permission for non-public groups. * * @param string $group The group id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getGroup($group) { return $this->get($group); } /** * Method to get the group's wall. Requires authentication and user_groups or friends_groups permission for non-public groups. * * @param string $group The group id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getFeed($group, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($group, 'feed', '', $limit, $offset, $until, $since); } /** * Method to get the group's members. Requires authentication and user_groups or friends_groups permission for non-public groups. * * @param string $group The group id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getMembers($group, $limit = 0, $offset = 0) { return $this->getConnection($group, 'members', '', $limit, $offset); } /** * Method to get the group's docs. Requires authentication and user_groups or friends_groups permission for non-public groups. * * @param string $group The group id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getDocs($group, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($group, 'docs', '', $limit, $offset, $until, $since); } /** * Method to get the groups's picture. Requires authentication and user_groups or friends_groups permission. * * @param string $group The group id. * @param string $type To request a different photo use square | small | normal | large. * * @return string The URL to the group's picture. * * @since 13.1 */ public function getPicture($group, $type = null) { if ($type) { $type = '?type=' . $type; } return $this->getConnection($group, 'picture', $type); } /** * Method to post a link on group's wall. Requires authentication and publish_stream permission. * * @param string $group The group id. * @param string $link Link URL. * @param strin $message Link message. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createLink($group, $link, $message = null) { // Set POST request parameters. $data = array(); $data['link'] = $link; if ($message) { $data['message'] = $message; } return $this->createConnection($group, 'feed', $data); } /** * Method to delete a link. Requires authentication. * * @param mixed $link The Link ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLink($link) { return $this->deleteConnection($link); } /** * Method to post on group's wall. Message or link parameter is required. Requires authentication and publish_stream permission. * * @param string $group The group id. * @param string $message Post message. * @param string $link Post URL. * @param string $picture Post thumbnail image (can only be used if link is specified) * @param string $name Post name (can only be used if link is specified). * @param string $caption Post caption (can only be used if link is specified). * @param string $description Post description (can only be used if link is specified). * @param array $actions Post actions array of objects containing name and link. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createPost($group, $message = null, $link = null, $picture = null, $name = null, $caption = null, $description = null, $actions = null) { // Set POST request parameters. if ($message) { $data['message'] = $message; } if ($link) { $data['link'] = $link; } if ($name) { $data['name'] = $name; } if ($caption) { $data['caption'] = $caption; } if ($description) { $data['description'] = $description; } if ($actions) { $data['actions'] = $actions; } if ($picture) { $data['picture'] = $picture; } return $this->createConnection($group, 'feed', $data); } /** * Method to delete a post. Note: you can only delete the post if it was created by the current user. Requires authentication. * * @param string $post The Post ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deletePost($post) { return $this->deleteConnection($post); } /** * Method to post a status message on behalf of the user on the group's wall. Requires authentication and publish_stream permission. * * @param string $group The group id. * @param string $message Status message content. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createStatus($group, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($group, 'feed', $data); } /** * Method to delete a status. Note: you can only delete the status if it was created by the current user. Requires authentication. * * @param string $status The Status ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteStatus($status) { return $this->deleteConnection($status); } } PK���\�x���%libraries/joomla/facebook/comment.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Comment class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/Comment/ * @since 13.1 */ class JFacebookComment extends JFacebookObject { /** * Method to get a comment. Requires authentication. * * @param string $comment The comment id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComment($comment) { return $this->get($comment); } /** * Method to delete a comment. Requires authentication and publish_stream permission. * * @param string $comment The comment id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteComment($comment) { return $this->deleteConnection($comment); } /** * Method to get a comment's comments. Requires authentication. * * @param string $comment The comment id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComments($comment, $limit=0, $offset=0, $until=null, $since=null) { return $this->getConnection($comment, 'comments', '', $limit, $offset, $until, $since); } /** * Method to comment on a comment. Requires authentication with publish_stream permission. * * @param string $comment The comment id. * @param string $message The comment's text. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createComment($comment, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($comment, 'comments', $data); } /** * Method to get comment's likes. Requires authentication. * * @param string $comment The comment id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($comment, $limit=0, $offset=0, $until=null, $since=null) { return $this->getConnection($comment, 'likes', '', $limit, $offset, $until, $since); } /** * Method to like a comment. Requires authentication and publish_stram permission. * * @param string $comment The comment id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createLike($comment) { return $this->createConnection($comment, 'likes'); } /** * Method to unlike a comment. Requires authentication and publish_stram permission. * * @param string $comment The comment id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLike($comment) { return $this->deleteConnection($comment, 'likes'); } } PK���\s!���%libraries/joomla/facebook/checkin.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Checkin class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/checkin/ * @since 13.1 */ class JFacebookCheckin extends JFacebookObject { /** * Method to get a checkin. Requires authentication and user_checkins or friends_checkins permission. * * @param string $checkin The checkin id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getCheckin($checkin) { return $this->get($checkin); } /** * Method to get a checkin's comments. Requires authentication and user_checkins or friends_checkins permission. * * @param string $checkin The checkin id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComments($checkin, $limit=0, $offset=0, $until=null, $since=null) { return $this->getConnection($checkin, 'comments', '', $limit, $offset, $until, $since); } /** * Method to post a comment to the checkin. Requires authentication and publish_stream and user_checkins or friends_checkins permission. * * @param string $checkin The checkin id. * @param string $message The checkin's text. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createComment($checkin, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($checkin, 'comments', $data); } /** * Method to delete a comment. Requires authentication and publish_stream permission. * * @param string $comment The comment's id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function deleteComment($comment) { return $this->deleteConnection($comment); } /** * Method to get a checkin's likes. Requires authentication and user_checkins or friends_checkins permission. * * @param string $checkin The checkin id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($checkin, $limit=0, $offset=0, $until=null, $since=null) { return $this->getConnection($checkin, 'likes', '', $limit, $offset, $until, $since); } /** * Method to like a checkin. Requires authentication and publish_stream and user_checkins or friends_checkins permission. * * @param string $checkin The checkin id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createLike($checkin) { return $this->createConnection($checkin, 'likes'); } /** * Method to unlike a checkin. Requires authentication and publish_stream permission. * * @param string $checkin The checkin id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function deleteLike($checkin) { return $this->deleteConnection($checkin, 'likes'); } } PK���\�� "libraries/joomla/facebook/post.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Post class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/post/ * @since 13.1 */ class JFacebookPost extends JFacebookObject { /** * Method to get a post. Requires authentication and read_stream permission for all data. * * @param string $post The post id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getPost($post) { return $this->get($post); } /** * Method to delete a post if it was created by this application. Requires authentication and publish_stream permission * * @param string $post The post id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deletePost($post) { return $this->deleteConnection($post); } /** * Method to get a post's comments. Requires authentication and read_stream permission. * * @param string $post The post id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComments($post, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($post, 'comments', '', $limit, $offset, $until, $since); } /** * Method to comment on a post. Requires authentication and publish_stream permission * * @param string $post The post id. * @param string $message The comment's text. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createComment($post, $message) { // Set POST request parameters. $data['message'] = $message; return $this->createConnection($post, 'comments', $data); } /** * Method to delete a comment. Requires authentication and publish_stream permission * * @param string $comment The comment's id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteComment($comment) { return $this->deleteConnection($comment); } /** * Method to get post's likes. Requires authentication and read_stream permission. * * @param string $post The post id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($post, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($post, 'likes', '', $limit, $offset, $until, $since); } /** * Method to like a post. Requires authentication and publish_stream permission * * @param string $post The post id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createLike($post) { return $this->createConnection($post, 'likes'); } /** * Method to unlike a post. Requires authentication and publish_stream permission * * @param string $post The post id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLike($post) { return $this->deleteConnection($post, 'likes'); } } PK���\�����#libraries/joomla/facebook/video.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Video class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/video/ * @since 13.1 */ class JFacebookVideo extends JFacebookObject { /** * Method to get a video. Requires authentication and user_videos or friends_videos permission for private videos. * * @param string $video The video id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getVideo($video) { return $this->get($video); } /** * Method to get a video's comments. Requires authentication and user_videos or friends_videos permission for private videos. * * @param string $video The video id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComments($video, $limit=0, $offset=0, $until=null, $since=null) { return $this->getConnection($video, 'comments', '', $limit, $offset, $until, $since); } /** * Method to comment on a video. Requires authentication and publish_stream permission, user_videos or friends_videos permission for private videos. * * @param string $video The video id. * @param string $message The comment's text. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createComment($video, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($video, 'comments', $data); } /** * Method to delete a comment. Requires authentication and publish_stream permission, user_videos or friends_videos permission for private videos. * * @param string $comment The comment's id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteComment($comment) { return $this->deleteConnection($comment); } /** * Method to get video's likes. Requires authentication and user_videos or friends_videos permission for private videos. * * @param string $video The video id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($video, $limit=0, $offset=0, $until=null, $since=null) { return $this->getConnection($video, 'likes', '', $limit, $offset, $until, $since); } /** * Method to like a video. Requires authentication and publish_stream permission, user_videos or friends_videos permission for private videos. * * @param string $video The video id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createLike($video) { return $this->createConnection($video, 'likes'); } /** * Method to unlike a video. Requires authentication and publish_stream permission, user_videos or friends_videos permission for private videos. * * @param string $video The video id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLike($video) { return $this->deleteConnection($video, 'likes'); } /** * Method to get the album-sized view of the video. Requires authentication and user_videos or friends_videos permission for private photos. * * @param string $video The video id. * * @return string URL of the picture. * * @since 13.1 */ public function getPicture($video) { return $this->getConnection($video, 'picture'); } } PK���\L3��77&libraries/joomla/facebook/facebook.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform class for interacting with a Facebook API instance. * * @since 13.1 */ class JFacebook { /** * @var Registry Options for the Facebook object. * @since 13.1 */ protected $options; /** * @var JHttp The HTTP client object to use in sending HTTP requests. * @since 13.1 */ protected $client; /** * @var JFacebookOAuth The OAuth client. * @since 13.1 */ protected $oauth; /** * @var JFacebookUser Facebook API object for user. * @since 13.1 */ protected $user; /** * @var JFacebookStatus Facebook API object for status. * @since 13.1 */ protected $status; /** * @var JFacebookCheckin Facebook API object for checkin. * @since 13.1 */ protected $checkin; /** * @var JFacebookEvent Facebook API object for event. * @since 13.1 */ protected $event; /** * @var JFacebookGroup Facebook API object for group. * @since 13.1 */ protected $group; /** * @var JFacebookLink Facebook API object for link. * @since 13.1 */ protected $link; /** * @var JFacebookNote Facebook API object for note. * @since 13.1 */ protected $note; /** * @var JFacebookPost Facebook API object for post. * @since 13.1 */ protected $post; /** * @var JFacebookComment Facebook API object for comment. * @since 13.1 */ protected $comment; /** * @var JFacebookPhoto Facebook API object for photo. * @since 13.1 */ protected $photo; /** * @var JFacebookVideo Facebook API object for video. * @since 13.1 */ protected $video; /** * @var JFacebookAlbum Facebook API object for album. * @since 13.1 */ protected $album; /** * Constructor. * * @param JFacebookOAuth $oauth OAuth client. * @param Registry $options Facebook options object. * @param JHttp $client The HTTP client object. * * @since 13.1 */ public function __construct(JFacebookOAuth $oauth = null, Registry $options = null, JHttp $client = null) { $this->oauth = $oauth; $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JHttp($this->options); // Setup the default API url if not already set. $this->options->def('api.url', 'https://graph.facebook.com/'); } /** * Magic method to lazily create API objects * * @param string $name Name of property to retrieve * * @return JFacebookObject Facebook API object (status, user, friends etc). * * @since 13.1 * @throws InvalidArgumentException */ public function __get($name) { $class = 'JFacebook' . ucfirst($name); if (class_exists($class)) { if (false == isset($this->$name)) { $this->$name = new $class($this->options, $this->client, $this->oauth); } return $this->$name; } throw new InvalidArgumentException(sprintf('Argument %s produced an invalid class name: %s', $name, $class)); } /** * Get an option from the JFacebook instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 13.1 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JFacebook instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JFacebook This object for method chaining. * * @since 13.1 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\�x��"libraries/joomla/facebook/note.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Note class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/note/ * @since 13.1 */ class JFacebookNote extends JFacebookObject { /** * Method to get a note. Requires authentication and user_notes or friends_notes permission for non-public notes. * * @param string $note The note id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getNote($note) { return $this->get($note); } /** * Method to get a note's comments. Requires authentication and user_notes or friends_notes permission for non-public notes. * * @param string $note The note id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComments($note, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($note, 'comments', '', $limit, $offset, $until, $since); } /** * Method to comment on a note. Requires authentication and publish_stream and user_notes or friends_notes permissions. * * @param string $note The note id. * @param string $message The comment's text. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createComment($note, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($note, 'comments', $data); } /** * Method to delete a comment. Requires authentication and publish_stream and user_notes or friends_notes permissions. * * @param string $comment The comment's id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteComment($comment) { return $this->deleteConnection($comment); } /** * Method to get note's likes. Requires authentication and user_notes or friends_notes for non-public notes. * * @param string $note The note id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($note, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($note, 'likes', '', $limit, $offset, $until, $since); } /** * Method to like a note. Requires authentication and publish_stream and user_notes or friends_notes permissions. * * @param string $note The note id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createLike($note) { return $this->createConnection($note, 'likes'); } /** * Method to unlike a note. Requires authentication and publish_stream and user_notes or friends_notes permissions. * * @param string $note The note id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLike($note) { return $this->deleteConnection($note, 'likes'); } } PK���\�&�I#libraries/joomla/facebook/oauth.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform class for generating Facebook API access token. * * @since 13.1 */ class JFacebookOAuth extends JOAuth2Client { /** * @var Registry Options for the JFacebookOAuth object. * @since 13.1 */ protected $options; /** * Constructor. * * @param Registry $options JFacebookOauth options object. * @param JHttp $client The HTTP client object. * @param JInput $input The input object. * * @since 13.1 */ public function __construct(Registry $options = null, JHttp $client = null, JInput $input = null) { $this->options = isset($options) ? $options : new Registry; // Setup the authentication and token urls if not already set. $this->options->def('authurl', 'http://www.facebook.com/dialog/oauth'); $this->options->def('tokenurl', 'https://graph.facebook.com/oauth/access_token'); // Call the JOauthOauth2client constructor to setup the object. parent::__construct($this->options, $client, $input); } /** * Method used to set permissions. * * @param string $scope Comma separated list of permissions. * * @return JFacebookOauth This object for method chaining * * @since 13.1 */ public function setScope($scope) { $this->setOption('scope', $scope); return $this; } /** * Method to get the current scope * * @return string Comma separated list of permissions. * * @since 13.1 */ public function getScope() { return $this->getOption('scope'); } } PK���\��Q"libraries/joomla/facebook/link.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Link class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/link/ * @since 13.1 */ class JFacebookLink extends JFacebookObject { /** * Method to get a link. Requires authentication and read_stream permission for non-public links. * * @param string $link The link id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLink($link) { return $this->get($link); } /** * Method to get a link's comments. Requires authentication and read_stream permission for non-public links. * * @param string $link The link id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComments($link, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($link, 'comments', '', $limit, $offset, $until, $since); } /** * Method to comment on a link. Requires authentication and publish_stream permission. * * @param string $link The link id. * @param string $message The comment's text. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createComment($link, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($link, 'comments', $data); } /** * Method to delete a comment. Requires authentication and publish_stream permission. * * @param string $comment The comment's id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function deleteComment($comment) { return $this->deleteConnection($comment); } /** * Method to get link's likes. Requires authentication and read_stream permission for non-public links. * * @param string $link The link id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($link, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($link, 'likes', '', $limit, $offset, $until, $since); } /** * Method to like a link. Requires authentication and publish_stream permission. * * @param string $link The link id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createLike($link) { return $this->createConnection($link, 'likes'); } /** * Method to unlike a link. Requires authentication and publish_stream permission. * * @param string $link The link id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLike($link) { return $this->deleteConnection($link, 'likes'); } } PK���\�&���$libraries/joomla/facebook/status.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API Status class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/status/ * @since 13.1 */ class JFacebookStatus extends JFacebookObject { /** * Method to get a status message. Requires authentication. * * @param string $status The status message id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getStatus($status) { return $this->get($status); } /** * Method to get a status message's comments. Requires authentication. * * @param string $status The status message id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getComments($status, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($status, 'comments', '', $limit, $offset, $until, $since); } /** * Method to post a comment to the status message. Requires authentication and publish_stream and user_status or friends_status permission. * * @param string $status The status message id. * @param string $message The comment's text. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createComment($status, $message) { // Set POST request parameters. $data['message'] = $message; return $this->createConnection($status, 'comments', $data); } /** * Method to delete a comment. Requires authentication and publish_stream and user_status or friends_status permission. * * @param string $comment The comment's id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function deleteComment($comment) { return $this->deleteConnection($comment); } /** * Method to get a status message's likes. Requires authentication. * * @param string $status The status message id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getLikes($status, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($status, 'likes', '', $limit, $offset, $until, $since); } /** * Method to like status message. Requires authentication and publish_stream and user_status or friends_status permission. * * @param string $status The status message id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createLike($status) { return $this->createConnection($status, 'likes'); } /** * Method to unlike a status message. Requires authentication and publish_stream and user_status or friends_status permission. * * @param string $status The status message id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function deleteLike($status) { return $this->deleteConnection($status, 'likes'); } } PK���\�]4�@�@#libraries/joomla/facebook/event.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Facebook API User class for the Joomla Platform. * * @see http://developers.facebook.com/docs/reference/api/event/ * @since 13.1 */ class JFacebookEvent extends JFacebookObject { /** * Method to get information about an event visible to the current user. Requires authentication. * * @param string $event The event id. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getEvent($event) { return $this->get($event); } /** * Method to get the event's wall. Requires authentication. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getFeed($event, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($event, 'feed', '', $limit, $offset, $until, $since); } /** * Method to post a link on event's feed which the current_user is or maybe attending. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $link Link URL. * @param string $message Link message. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createLink($event, $link, $message = null) { // Set POST request parameters. $data = array(); $data['link'] = $link; $data['message'] = $message; return $this->createConnection($event, 'feed', $data); } /** * Method to delete a link. Requires authentication and publish_stream permission. * * @param mixed $link The Link ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteLink($link) { return $this->deleteConnection($link); } /** * Method to post on event's wall. Message or link parameter is required. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $message Post message. * @param string $link Post URL. * @param string $picture Post thumbnail image (can only be used if link is specified) * @param string $name Post name (can only be used if link is specified). * @param string $caption Post caption (can only be used if link is specified). * @param string $description Post description (can only be used if link is specified). * @param array $actions Post actions array of objects containing name and link. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createPost($event, $message = null, $link = null, $picture = null, $name = null, $caption = null, $description = null, $actions = null) { // Set POST request parameters. $data = array(); $data['message'] = $message; $data['link'] = $link; $data['name'] = $name; $data['caption'] = $caption; $data['description'] = $description; $data['actions'] = $actions; $data['picture'] = $picture; return $this->createConnection($event, 'feed', $data); } /** * Method to delete a post. Note: you can only delete the post if it was created by the current user. * Requires authentication and publish_stream permission. * * @param string $post The Post ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deletePost($post) { return $this->deleteConnection($post); } /** * Method to post a status message on behalf of the user on the event's wall. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $message Status message content. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createStatus($event, $message) { // Set POST request parameters. $data = array(); $data['message'] = $message; return $this->createConnection($event, 'feed', $data); } /** * Method to delete a status. Note: you can only delete the post if it was created by the current user. * Requires authentication and publish_stream permission. * * @param string $status The Status ID. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteStatus($status) { return $this->deleteConnection($status); } /** * Method to get the list of invitees for the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getInvited($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'invited', '', $limit, $offset); } /** * Method to check if a user is invited to the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 13.1 */ public function isInvited($event, $user) { return $this->getConnection($event, 'invited/' . $user); } /** * Method to invite users to the event. Requires authentication and create_event permission. * * @param string $event The event id. * @param string $users Comma separated list of user ids. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createInvite($event, $users) { // Set POST request parameters. $data = array(); $data['users'] = $users; return $this->createConnection($event, 'invited', $data); } /** * Method to delete a invitation. Note: you can only delete the invite if the current user is the event admin. * Requires authentication and rsvp_event permission. * * @param string $event The event id. * @param string $user The user id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function deleteInvite($event, $user) { return $this->deleteConnection($event, 'invited/' . $user); } /** * Method to get the list of attending users. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getAttending($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'attending', '', $limit, $offset); } /** * Method to check if a user is attending an event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 13.1 */ public function isAttending($event, $user) { return $this->getConnection($event, 'attending/' . $user); } /** * Method to set the current user as attending. Requires authentication and rsvp_event permission. * * @param string $event The event id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createAttending($event) { return $this->createConnection($event, 'attending'); } /** * Method to get the list of maybe attending users. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getMaybe($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'maybe', '', $limit, $offset); } /** * Method to check if a user is maybe attending an event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 13.1 */ public function isMaybe($event, $user) { return $this->getConnection($event, 'maybe/' . $user); } /** * Method to set the current user as maybe attending. Requires authentication and rscp_event permission. * * @param string $event The event id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createMaybe($event) { return $this->createConnection($event, 'maybe'); } /** * Method to get the list of users which declined the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getDeclined($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'declined', '', $limit, $offset); } /** * Method to check if a user responded 'no' to the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 13.1 */ public function isDeclined($event, $user) { return $this->getConnection($event, 'declined/' . $user); } /** * Method to set the current user as declined. Requires authentication and rscp_event permission. * * @param string $event The event id. * * @return boolean Returns true if successful, and false otherwise. * * @since 13.1 */ public function createDeclined($event) { return $this->createConnection($event, 'declined'); } /** * Method to get the list of users which have not replied to the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getNoreply($event, $limit = 0, $offset = 0) { return $this->getConnection($event, 'noreply', '', $limit, $offset); } /** * Method to check if a user has not replied to the event. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param mixed $user Either an integer containing the user ID or a string containing the username. * * @return array The decoded JSON response or an empty array if the user is not invited. * * @since 13.1 */ public function isNoreply($event, $user) { return $this->getConnection($event, 'noreply/' . $user); } /** * Method to get the event's profile picture. Requires authentication and user_events or friends_events permission. * * @param string $event The event id. * @param boolean $redirect If false this will return the URL of the picture without a 302 redirect. * @param string $type To request a different photo use square | small | normal | large. * * @return string The URL to the event's profile picture. * * @since 13.1 */ public function getPicture($event, $redirect = true, $type = null) { $extra_fields = ''; if ($redirect == false) { $extra_fields = '?redirect=false'; } if ($type) { $extra_fields .= (strpos($extra_fields, '?') === false) ? '?type=' . $type : '&type=' . $type; } return $this->getConnection($event, 'picture', $extra_fields); } /** * Method to get photos published on event's wall. Requires authentication. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getPhotos($event, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($event, 'photos', '', $limit, $offset, $until, $since); } /** * Method to post a photo on event's wall. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $source Path to photo. * @param string $message Photo description. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createPhoto($event, $source, $message = null) { // Set POST request parameters. $data = array(); $data[basename($source)] = '@' . realpath($source); if ($message) { $data['message'] = $message; } return $this->createConnection($event, 'photos', $data, array('Content-Type' => 'multipart/form-data')); } /** * Method to get videos published on event's wall. Requires authentication. * * @param string $event The event id. * @param integer $limit The number of objects per page. * @param integer $offset The object's number on the page. * @param string $until A unix timestamp or any date accepted by strtotime. * @param string $since A unix timestamp or any date accepted by strtotime. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function getVideos($event, $limit = 0, $offset = 0, $until = null, $since = null) { return $this->getConnection($event, 'videos', '', $limit, $offset, $until, $since); } /** * Method to post a video on event's wall. Requires authentication and publish_stream permission. * * @param string $event The event id. * @param string $source Path to photo. * @param string $title Video title. * @param string $description Video description. * * @return mixed The decoded JSON response or false if the client is not authenticated. * * @since 13.1 */ public function createVideo($event, $source, $title = null, $description = null) { // Set POST request parameters. $data = array(); $data[basename($source)] = '@' . realpath($source); if ($title) { $data['title'] = $title; } if ($description) { $data['description'] = $description; } return $this->createConnection($event, 'videos', $data, array('Content-Type' => 'multipart/form-data')); } } PK���\1c��� � 0libraries/joomla/image/filter/backgroundfill.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Image Filter class fill background with color; * * @package Joomla.Platform * @subpackage Image * @since 3.4 */ class JImageFilterBackgroundfill extends JImageFilter { /** * Method to apply a background color to an image resource. * * @param array $options An array of options for the filter. * color Background matte color * * @return void * * @since 3.4 * @throws InvalidArgumentException */ public function execute(array $options = array()) { // Validate that the color value exists and is an integer. if (!isset($options['color'])) { throw new InvalidArgumentException('No color value was given. Expected string or array.'); } $colorCode = (!empty($options['color'])) ? $options['color'] : null; // Get resource dimensions $width = imagesX($this->handle); $height = imagesY($this->handle); // Sanitize color $rgba = $this->sanitizeColor($colorCode); // Enforce alpha on source image if (imageIsTrueColor($this->handle)) { imageAlphaBlending($this->handle, false); imageSaveAlpha($this->handle, true); } // Create background $bg = imageCreateTruecolor($width, $height); imageSaveAlpha($bg, empty($rgba['alpha'])); // Allocate background color. $color = imageColorAllocateAlpha($bg, $rgba['red'], $rgba['green'], $rgba['blue'], $rgba['alpha']); // Fill background imageFill($bg, 0, 0, $color); // Apply image over background imageCopy($bg, $this->handle, 0, 0, 0, 0, $width, $height); // Move flattened result onto curent handle. // If handle was palette-based, it'll stay like that. imageCopy($this->handle, $bg, 0, 0, 0, 0, $width, $height); // Free up memory imageDestroy($bg); return; } /** * Method to sanitize color values * and/or convert to an array * * @param mixed $input Associative array of colors and alpha, * or hex RGBA string when alpha FF is opaque. * Defaults to black and opaque alpha * * @return array Associative array of red, green, blue and alpha * * @since 3.4 * * @note '#FF0000FF' returns an array with alpha of 0 (opaque) */ protected function sanitizeColor($input) { // Construct default values $colors = array('red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 0); // Make sure all values are in if (is_array($input)) { $colors = array_merge($colors, $input); } // Convert RGBA 6-9 char string elseif (is_string($input)) { $hex = ltrim($input, '#'); $hexValues = array( 'red' => substr($hex, 0, 2), 'green' => substr($hex, 2, 2), 'blue' => substr($hex, 4, 2), 'alpha' => substr($hex, 6, 2), ); $colors = array_map('hexdec', $hexValues); // Convert Alpha to 0..127 when provided if (strlen($hex) > 6) { $colors['alpha'] = floor((255 - $colors['alpha']) / 2); } } // Cannot sanitize such type else { return $colors; } // Make sure each value is within the allowed range foreach ($colors as &$value) { $value = max(0, min(255, (float) $value)); } $colors['alpha'] = min(127, $colors['alpha']); return $colors; } } PK���\,���+libraries/joomla/image/filter/grayscale.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Image Filter class to transform an image to grayscale. * * @since 11.3 */ class JImageFilterGrayscale extends JImageFilter { /** * Method to apply a filter to an image resource. * * @param array $options An array of options for the filter. * * @return void * * @since 11.3 */ public function execute(array $options = array()) { // Perform the grayscale filter. imagefilter($this->handle, IMG_FILTER_GRAYSCALE); } } PK���\ە���)libraries/joomla/image/filter/sketchy.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Image Filter class to make an image appear "sketchy". * * @since 11.3 */ class JImageFilterSketchy extends JImageFilter { /** * Method to apply a filter to an image resource. * * @param array $options An array of options for the filter. * * @return void * * @since 11.3 */ public function execute(array $options = array()) { // Perform the sketchy filter. imagefilter($this->handle, IMG_FILTER_MEAN_REMOVAL); } } PK���\WSp�(libraries/joomla/image/filter/smooth.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Image Filter class adjust the smoothness of an image. * * @since 11.3 */ class JImageFilterSmooth extends JImageFilter { /** * Method to apply a filter to an image resource. * * @param array $options An array of options for the filter. * * @return void * * @since 11.3 * @throws InvalidArgumentException */ public function execute(array $options = array()) { // Validate that the smoothing value exists and is an integer. if (!isset($options[IMG_FILTER_SMOOTH]) || !is_int($options[IMG_FILTER_SMOOTH])) { throw new InvalidArgumentException('No valid smoothing value was given. Expected integer.'); } // Perform the smoothing filter. imagefilter($this->handle, IMG_FILTER_SMOOTH, $options[IMG_FILTER_SMOOTH]); } } PK���\ܦ�\��(libraries/joomla/image/filter/emboss.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Image Filter class to emboss an image. * * @since 11.3 */ class JImageFilterEmboss extends JImageFilter { /** * Method to apply a filter to an image resource. * * @param array $options An array of options for the filter. * * @return void * * @since 11.3 */ public function execute(array $options = array()) { // Perform the emboss filter. imagefilter($this->handle, IMG_FILTER_EMBOSS); } } PK���\�i��)),libraries/joomla/image/filter/brightness.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Image Filter class adjust the brightness of an image. * * @since 11.3 */ class JImageFilterBrightness extends JImageFilter { /** * Method to apply a filter to an image resource. * * @param array $options An array of options for the filter. * * @return void * * @since 11.3 * @throws InvalidArgumentException */ public function execute(array $options = array()) { // Validate that the brightness value exists and is an integer. if (!isset($options[IMG_FILTER_BRIGHTNESS]) || !is_int($options[IMG_FILTER_BRIGHTNESS])) { throw new InvalidArgumentException('No valid brightness value was given. Expected integer.'); } // Perform the brightness filter. imagefilter($this->handle, IMG_FILTER_BRIGHTNESS, $options[IMG_FILTER_BRIGHTNESS]); } } PK���\� ���,libraries/joomla/image/filter/edgedetect.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Image Filter class to add an edge detect effect to an image. * * @since 11.3 */ class JImageFilterEdgedetect extends JImageFilter { /** * Method to apply a filter to an image resource. * * @param array $options An array of options for the filter. * * @return void * * @since 11.3 */ public function execute(array $options = array()) { // Perform the edge detection filter. imagefilter($this->handle, IMG_FILTER_EDGEDETECT); } } PK���\�L����(libraries/joomla/image/filter/negate.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Image Filter class to negate the colors of an image. * * @since 11.3 */ class JImageFilterNegate extends JImageFilter { /** * Method to apply a filter to an image resource. * * @param array $options An array of options for the filter. * * @return void * * @since 11.3 */ public function execute(array $options = array()) { // Perform the negative filter. imagefilter($this->handle, IMG_FILTER_NEGATE); } } PK���\{(��*libraries/joomla/image/filter/contrast.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Image Filter class adjust the contrast of an image. * * @since 11.3 */ class JImageFilterContrast extends JImageFilter { /** * Method to apply a filter to an image resource. * * @param array $options An array of options for the filter. * * @return void * * @since 11.3 * @throws InvalidArgumentException */ public function execute(array $options = array()) { // Validate that the contrast value exists and is an integer. if (!isset($options[IMG_FILTER_CONTRAST]) || !is_int($options[IMG_FILTER_CONTRAST])) { throw new InvalidArgumentException('No valid contrast value was given. Expected integer.'); } // Perform the contrast filter. imagefilter($this->handle, IMG_FILTER_CONTRAST, $options[IMG_FILTER_CONTRAST]); } } PK���\���BB!libraries/joomla/image/filter.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Class to manipulate an image. * * @since 11.3 */ abstract class JImageFilter { /** * @var resource The image resource handle. * @since 11.3 */ protected $handle; /** * Class constructor. * * @param resource $handle The image resource on which to apply the filter. * * @since 11.3 * @throws InvalidArgumentException * @throws RuntimeException */ public function __construct($handle) { // Verify that image filter support for PHP is available. if (!function_exists('imagefilter')) { // @codeCoverageIgnoreStart JLog::add('The imagefilter function for PHP is not available.', JLog::ERROR); throw new RuntimeException('The imagefilter function for PHP is not available.'); // @codeCoverageIgnoreEnd } // Make sure the file handle is valid. if (!is_resource($handle) || (get_resource_type($handle) != 'gd')) { JLog::add('The image handle is invalid for the image filter.', JLog::ERROR); throw new InvalidArgumentException('The image handle is invalid for the image filter.'); } $this->handle = $handle; } /** * Method to apply a filter to an image resource. * * @param array $options An array of options for the filter. * * @return void * * @since 11.3 */ abstract public function execute(array $options = array()); } PK���\I'��p�p libraries/joomla/image/image.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Image * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Class to manipulate an image. * * @since 11.3 */ class JImage { /** * @const integer * @since 11.3 */ const SCALE_FILL = 1; /** * @const integer * @since 11.3 */ const SCALE_INSIDE = 2; /** * @const integer * @since 11.3 */ const SCALE_OUTSIDE = 3; /** * @const integer * @since 12.2 */ const CROP = 4; /** * @const integer * @since 12.3 */ const CROP_RESIZE = 5; /** * @const integer * @since 3.2 */ const SCALE_FIT = 6; /** * @const string * @since 3.4.2 */ const ORIENTATION_LANDSCAPE = 'landscape'; /** * @const string * @since 3.4.2 */ const ORIENTATION_PORTRAIT = 'portrait'; /** * @const string * @since 3.4.2 */ const ORIENTATION_SQUARE = 'square'; /** * @var resource The image resource handle. * @since 11.3 */ protected $handle; /** * @var string The source image path. * @since 11.3 */ protected $path = null; /** * @var array Whether or not different image formats are supported. * @since 11.3 */ protected static $formats = array(); /** * Class constructor. * * @param mixed $source Either a file path for a source image or a GD resource handler for an image. * * @since 11.3 * @throws RuntimeException */ public function __construct($source = null) { // Verify that GD support for PHP is available. if (!extension_loaded('gd')) { // @codeCoverageIgnoreStart JLog::add('The GD extension for PHP is not available.', JLog::ERROR); throw new RuntimeException('The GD extension for PHP is not available.'); // @codeCoverageIgnoreEnd } // Determine which image types are supported by GD, but only once. if (!isset(self::$formats[IMAGETYPE_JPEG])) { $info = gd_info(); self::$formats[IMAGETYPE_JPEG] = ($info['JPEG Support']) ? true : false; self::$formats[IMAGETYPE_PNG] = ($info['PNG Support']) ? true : false; self::$formats[IMAGETYPE_GIF] = ($info['GIF Read Support']) ? true : false; } // If the source input is a resource, set it as the image handle. if (is_resource($source) && (get_resource_type($source) == 'gd')) { $this->handle = &$source; } elseif (!empty($source) && is_string($source)) { // If the source input is not empty, assume it is a path and populate the image handle. $this->loadFile($source); } } /** * Method to return a properties object for an image given a filesystem path. * The result object has values for image width, height, type, attributes, bits, channels, mime type, file size and orientation. * * @param string $path The filesystem path to the image for which to get properties. * * @return stdClass * * @since 11.3 * * @throws InvalidArgumentException * @throws RuntimeException */ public static function getImageFileProperties($path) { // Make sure the file exists. if (!file_exists($path)) { throw new InvalidArgumentException('The image file does not exist.'); } // Get the image file information. $info = getimagesize($path); if (!$info) { // @codeCoverageIgnoreStart throw new RuntimeException('Unable to get properties for the image.'); // @codeCoverageIgnoreEnd } // Build the response object. $properties = (object) array( 'width' => $info[0], 'height' => $info[1], 'type' => $info[2], 'attributes' => $info[3], 'bits' => isset($info['bits']) ? $info['bits'] : null, 'channels' => isset($info['channels']) ? $info['channels'] : null, 'mime' => $info['mime'], 'filesize' => filesize($path), 'orientation' => self::getOrientationString((int) $info[0], (int) $info[1]) ); return $properties; } /** * Method to detect whether an image's orientation is landscape, portrait or square. * The orientation will be returned as a string. * * @return mixed Orientation string or null. * * @since 3.4.2 */ public function getOrientation() { if ($this->isLoaded()) { return self::getOrientationString($this->getWidth(), $this->getHeight()); } return null; } /** * Compare width and height integers to determine image orientation. * * @param integer $width The width value to use for calculation * @param integer $height The height value to use for calculation * * @return string Orientation string * * @since 3.4.2 */ static private function getOrientationString($width, $height) { if ($width > $height) { return self::ORIENTATION_LANDSCAPE; } if ($width < $height) { return self::ORIENTATION_PORTRAIT; } return self::ORIENTATION_SQUARE; } /** * Method to generate thumbnails from the current image. It allows * creation by resizing or cropping the original image. * * @param mixed $thumbSizes String or array of strings. Example: $thumbSizes = array('150x75','250x150'); * @param integer $creationMethod 1-3 resize $scaleMethod | 4 create croppping | 5 resize then crop * * @return array * * @since 12.2 * @throws LogicException * @throws InvalidArgumentException */ public function generateThumbs($thumbSizes, $creationMethod = self::SCALE_INSIDE) { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } // Accept a single thumbsize string as parameter if (!is_array($thumbSizes)) { $thumbSizes = array($thumbSizes); } // Process thumbs $generated = array(); if (!empty($thumbSizes)) { foreach ($thumbSizes as $thumbSize) { // Desired thumbnail size $size = explode('x', strtolower($thumbSize)); if (count($size) != 2) { throw new InvalidArgumentException('Invalid thumb size received: ' . $thumbSize); } $thumbWidth = $size[0]; $thumbHeight = $size[1]; switch ($creationMethod) { // Case for self::CROP case 4: $thumb = $this->crop($thumbWidth, $thumbHeight, null, null, true); break; // Case for self::CROP_RESIZE case 5: $thumb = $this->cropResize($thumbWidth, $thumbHeight, true); break; default: $thumb = $this->resize($thumbWidth, $thumbHeight, true, $creationMethod); break; } // Store the thumb in the results array $generated[] = $thumb; } } return $generated; } /** * Method to create thumbnails from the current image and save them to disk. It allows creation by resizing * or croppping the original image. * * @param mixed $thumbSizes string or array of strings. Example: $thumbSizes = array('150x75','250x150'); * @param integer $creationMethod 1-3 resize $scaleMethod | 4 create croppping * @param string $thumbsFolder destination thumbs folder. null generates a thumbs folder in the image folder * * @return array * * @since 12.2 * @throws LogicException * @throws InvalidArgumentException */ public function createThumbs($thumbSizes, $creationMethod = self::SCALE_INSIDE, $thumbsFolder = null) { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } // No thumbFolder set -> we will create a thumbs folder in the current image folder if (is_null($thumbsFolder)) { $thumbsFolder = dirname($this->getPath()) . '/thumbs'; } // Check destination if (!is_dir($thumbsFolder) && (!is_dir(dirname($thumbsFolder)) || !@mkdir($thumbsFolder))) { throw new InvalidArgumentException('Folder does not exist and cannot be created: ' . $thumbsFolder); } // Process thumbs $thumbsCreated = array(); if ($thumbs = $this->generateThumbs($thumbSizes, $creationMethod)) { // Parent image properties $imgProperties = self::getImageFileProperties($this->getPath()); foreach ($thumbs as $thumb) { // Get thumb properties $thumbWidth = $thumb->getWidth(); $thumbHeight = $thumb->getHeight(); // Generate thumb name $filename = pathinfo($this->getPath(), PATHINFO_FILENAME); $fileExtension = pathinfo($this->getPath(), PATHINFO_EXTENSION); $thumbFileName = $filename . '_' . $thumbWidth . 'x' . $thumbHeight . '.' . $fileExtension; // Save thumb file to disk $thumbFileName = $thumbsFolder . '/' . $thumbFileName; if ($thumb->toFile($thumbFileName, $imgProperties->type)) { // Return JImage object with thumb path to ease further manipulation $thumb->path = $thumbFileName; $thumbsCreated[] = $thumb; } } } return $thumbsCreated; } /** * Method to crop the current image. * * @param mixed $width The width of the image section to crop in pixels or a percentage. * @param mixed $height The height of the image section to crop in pixels or a percentage. * @param integer $left The number of pixels from the left to start cropping. * @param integer $top The number of pixels from the top to start cropping. * @param boolean $createNew If true the current image will be cloned, cropped and returned; else * the current image will be cropped and returned. * * @return JImage * * @since 11.3 * @throws LogicException */ public function crop($width, $height, $left = null, $top = null, $createNew = true) { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } // Sanitize width. $width = $this->sanitizeWidth($width, $height); // Sanitize height. $height = $this->sanitizeHeight($height, $width); // Autocrop offsets if (is_null($left)) { $left = round(($this->getWidth() - $width) / 2); } if (is_null($top)) { $top = round(($this->getHeight() - $height) / 2); } // Sanitize left. $left = $this->sanitizeOffset($left); // Sanitize top. $top = $this->sanitizeOffset($top); // Create the new truecolor image handle. $handle = imagecreatetruecolor($width, $height); // Allow transparency for the new image handle. imagealphablending($handle, false); imagesavealpha($handle, true); if ($this->isTransparent()) { // Get the transparent color values for the current image. $rgba = imageColorsForIndex($this->handle, imagecolortransparent($this->handle)); $color = imageColorAllocateAlpha($handle, $rgba['red'], $rgba['green'], $rgba['blue'], $rgba['alpha']); // Set the transparent color values for the new image. imagecolortransparent($handle, $color); imagefill($handle, 0, 0, $color); imagecopyresized($handle, $this->handle, 0, 0, $left, $top, $width, $height, $width, $height); } else { imagecopyresampled($handle, $this->handle, 0, 0, $left, $top, $width, $height, $width, $height); } // If we are cropping to a new image, create a new JImage object. if ($createNew) { // @codeCoverageIgnoreStart $new = new JImage($handle); return $new; // @codeCoverageIgnoreEnd } // Swap out the current handle for the new image handle. else { // Free the memory from the current handle $this->destroy(); $this->handle = $handle; return $this; } } /** * Method to apply a filter to the image by type. Two examples are: grayscale and sketchy. * * @param string $type The name of the image filter to apply. * @param array $options An array of options for the filter. * * @return JImage * * @since 11.3 * @see JImageFilter * @throws LogicException */ public function filter($type, array $options = array()) { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } // Get the image filter instance. $filter = $this->getFilterInstance($type); // Execute the image filter. $filter->execute($options); return $this; } /** * Method to get the height of the image in pixels. * * @return integer * * @since 11.3 * @throws LogicException */ public function getHeight() { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } return imagesy($this->handle); } /** * Method to get the width of the image in pixels. * * @return integer * * @since 11.3 * @throws LogicException */ public function getWidth() { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } return imagesx($this->handle); } /** * Method to return the path * * @return string * * @since 11.3 */ public function getPath() { return $this->path; } /** * Method to determine whether or not an image has been loaded into the object. * * @return boolean * * @since 11.3 */ public function isLoaded() { // Make sure the resource handle is valid. if (!is_resource($this->handle) || (get_resource_type($this->handle) != 'gd')) { return false; } return true; } /** * Method to determine whether or not the image has transparency. * * @return bool * * @since 11.3 * @throws LogicException */ public function isTransparent() { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } return (imagecolortransparent($this->handle) >= 0); } /** * Method to load a file into the JImage object as the resource. * * @param string $path The filesystem path to load as an image. * * @return void * * @since 11.3 * @throws InvalidArgumentException * @throws RuntimeException */ public function loadFile($path) { // Destroy the current image handle if it exists $this->destroy(); // Make sure the file exists. if (!file_exists($path)) { throw new InvalidArgumentException('The image file does not exist.'); } // Get the image properties. $properties = self::getImageFileProperties($path); // Attempt to load the image based on the MIME-Type switch ($properties->mime) { case 'image/gif': // Make sure the image type is supported. if (empty(self::$formats[IMAGETYPE_GIF])) { // @codeCoverageIgnoreStart JLog::add('Attempting to load an image of unsupported type GIF.', JLog::ERROR); throw new RuntimeException('Attempting to load an image of unsupported type GIF.'); // @codeCoverageIgnoreEnd } // Attempt to create the image handle. $handle = imagecreatefromgif($path); if (!is_resource($handle)) { // @codeCoverageIgnoreStart throw new RuntimeException('Unable to process GIF image.'); // @codeCoverageIgnoreEnd } $this->handle = $handle; break; case 'image/jpeg': // Make sure the image type is supported. if (empty(self::$formats[IMAGETYPE_JPEG])) { // @codeCoverageIgnoreStart JLog::add('Attempting to load an image of unsupported type JPG.', JLog::ERROR); throw new RuntimeException('Attempting to load an image of unsupported type JPG.'); // @codeCoverageIgnoreEnd } // Attempt to create the image handle. $handle = imagecreatefromjpeg($path); if (!is_resource($handle)) { // @codeCoverageIgnoreStart throw new RuntimeException('Unable to process JPG image.'); // @codeCoverageIgnoreEnd } $this->handle = $handle; break; case 'image/png': // Make sure the image type is supported. if (empty(self::$formats[IMAGETYPE_PNG])) { // @codeCoverageIgnoreStart JLog::add('Attempting to load an image of unsupported type PNG.', JLog::ERROR); throw new RuntimeException('Attempting to load an image of unsupported type PNG.'); // @codeCoverageIgnoreEnd } // Attempt to create the image handle. $handle = imagecreatefrompng($path); if (!is_resource($handle)) { // @codeCoverageIgnoreStart throw new RuntimeException('Unable to process PNG image.'); // @codeCoverageIgnoreEnd } $this->handle = $handle; // Set transparency for non-transparent PNGs. if (!$this->isTransparent()) { // Assign to black which is default for transparent PNGs $transparency = imagecolorallocatealpha($handle, 0, 0, 0, 127); imagecolortransparent($handle, $transparency); } break; default: JLog::add('Attempting to load an image of unsupported type: ' . $properties->mime, JLog::ERROR); throw new InvalidArgumentException('Attempting to load an image of unsupported type: ' . $properties->mime); break; } // Set the filesystem path to the source image. $this->path = $path; } /** * Method to resize the current image. * * @param mixed $width The width of the resized image in pixels or a percentage. * @param mixed $height The height of the resized image in pixels or a percentage. * @param boolean $createNew If true the current image will be cloned, resized and returned; else * the current image will be resized and returned. * @param integer $scaleMethod Which method to use for scaling * * @return JImage * * @since 11.3 * @throws LogicException */ public function resize($width, $height, $createNew = true, $scaleMethod = self::SCALE_INSIDE) { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } // Sanitize width. $width = $this->sanitizeWidth($width, $height); // Sanitize height. $height = $this->sanitizeHeight($height, $width); // Prepare the dimensions for the resize operation. $dimensions = $this->prepareDimensions($width, $height, $scaleMethod); // Instantiate offset. $offset = new stdClass; $offset->x = $offset->y = 0; // Center image if needed and create the new truecolor image handle. if ($scaleMethod == self::SCALE_FIT) { // Get the offsets $offset->x = round(($width - $dimensions->width) / 2); $offset->y = round(($height - $dimensions->height) / 2); $handle = imagecreatetruecolor($width, $height); // Make image transparent, otherwise cavas outside initial image would default to black if (!$this->isTransparent()) { $transparency = imagecolorAllocateAlpha($this->handle, 0, 0, 0, 127); imagecolorTransparent($this->handle, $transparency); } } else { $handle = imagecreatetruecolor($dimensions->width, $dimensions->height); } // Allow transparency for the new image handle. imagealphablending($handle, false); imagesavealpha($handle, true); if ($this->isTransparent()) { // Get the transparent color values for the current image. $rgba = imageColorsForIndex($this->handle, imagecolortransparent($this->handle)); $color = imageColorAllocateAlpha($handle, $rgba['red'], $rgba['green'], $rgba['blue'], $rgba['alpha']); // Set the transparent color values for the new image. imagecolortransparent($handle, $color); imagefill($handle, 0, 0, $color); imagecopyresized( $handle, $this->handle, $offset->x, $offset->y, 0, 0, $dimensions->width, $dimensions->height, $this->getWidth(), $this->getHeight() ); } else { imagecopyresampled( $handle, $this->handle, $offset->x, $offset->y, 0, 0, $dimensions->width, $dimensions->height, $this->getWidth(), $this->getHeight() ); } // If we are resizing to a new image, create a new JImage object. if ($createNew) { // @codeCoverageIgnoreStart $new = new JImage($handle); return $new; // @codeCoverageIgnoreEnd } // Swap out the current handle for the new image handle. else { // Free the memory from the current handle $this->destroy(); $this->handle = $handle; return $this; } } /** * Method to crop an image after resizing it to maintain * proportions without having to do all the set up work. * * @param integer $width The desired width of the image in pixels or a percentage. * @param integer $height The desired height of the image in pixels or a percentage. * @param boolean $createNew If true the current image will be cloned, resized, cropped and returned. * * @return object JImage Object for chaining. * * @since 12.3 */ public function cropResize($width, $height, $createNew = true) { $width = $this->sanitizeWidth($width, $height); $height = $this->sanitizeHeight($height, $width); $resizewidth = $width; $resizeheight = $height; if (($this->getWidth() / $width) < ($this->getHeight() / $height)) { $resizeheight = 0; } else { $resizewidth = 0; } return $this->resize($resizewidth, $resizeheight, $createNew)->crop($width, $height, null, null, false); } /** * Method to rotate the current image. * * @param mixed $angle The angle of rotation for the image * @param integer $background The background color to use when areas are added due to rotation * @param boolean $createNew If true the current image will be cloned, rotated and returned; else * the current image will be rotated and returned. * * @return JImage * * @since 11.3 * @throws LogicException */ public function rotate($angle, $background = -1, $createNew = true) { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } // Sanitize input $angle = (float) $angle; // Create the new truecolor image handle. $handle = imagecreatetruecolor($this->getWidth(), $this->getHeight()); // Make background transparent if no external background color is provided. if ($background == -1) { // Allow transparency for the new image handle. imagealphablending($handle, false); imagesavealpha($handle, true); $background = imagecolorallocatealpha($handle, 0, 0, 0, 127); } // Copy the image imagecopy($handle, $this->handle, 0, 0, 0, 0, $this->getWidth(), $this->getHeight()); // Rotate the image $handle = imagerotate($handle, $angle, $background); // If we are resizing to a new image, create a new JImage object. if ($createNew) { // @codeCoverageIgnoreStart $new = new JImage($handle); return $new; // @codeCoverageIgnoreEnd } // Swap out the current handle for the new image handle. else { // Free the memory from the current handle $this->destroy(); $this->handle = $handle; return $this; } } /** * Method to write the current image out to a file. * * @param string $path The filesystem path to save the image. * @param integer $type The image type to save the file as. * @param array $options The image type options to use in saving the file. * * @return boolean * * @see http://www.php.net/manual/image.constants.php * @since 11.3 * @throws LogicException */ public function toFile($path, $type = IMAGETYPE_JPEG, array $options = array()) { // Make sure the resource handle is valid. if (!$this->isLoaded()) { throw new LogicException('No valid image was loaded.'); } switch ($type) { case IMAGETYPE_GIF: return imagegif($this->handle, $path); break; case IMAGETYPE_PNG: return imagepng($this->handle, $path, (array_key_exists('quality', $options)) ? $options['quality'] : 0); break; case IMAGETYPE_JPEG: default: return imagejpeg($this->handle, $path, (array_key_exists('quality', $options)) ? $options['quality'] : 100); } } /** * Method to get an image filter instance of a specified type. * * @param string $type The image filter type to get. * * @return JImageFilter * * @since 11.3 * @throws RuntimeException */ protected function getFilterInstance($type) { // Sanitize the filter type. $type = strtolower(preg_replace('#[^A-Z0-9_]#i', '', $type)); // Verify that the filter type exists. $className = 'JImageFilter' . ucfirst($type); if (!class_exists($className)) { JLog::add('The ' . ucfirst($type) . ' image filter is not available.', JLog::ERROR); throw new RuntimeException('The ' . ucfirst($type) . ' image filter is not available.'); } // Instantiate the filter object. $instance = new $className($this->handle); // Verify that the filter type is valid. if (!($instance instanceof JImageFilter)) { // @codeCoverageIgnoreStart JLog::add('The ' . ucfirst($type) . ' image filter is not valid.', JLog::ERROR); throw new RuntimeException('The ' . ucfirst($type) . ' image filter is not valid.'); // @codeCoverageIgnoreEnd } return $instance; } /** * Method to get the new dimensions for a resized image. * * @param integer $width The width of the resized image in pixels. * @param integer $height The height of the resized image in pixels. * @param integer $scaleMethod The method to use for scaling * * @return stdClass * * @since 11.3 * @throws InvalidArgumentException If width, height or both given as zero */ protected function prepareDimensions($width, $height, $scaleMethod) { // Instantiate variables. $dimensions = new stdClass; switch ($scaleMethod) { case self::SCALE_FILL: $dimensions->width = (int) round($width); $dimensions->height = (int) round($height); break; case self::SCALE_INSIDE: case self::SCALE_OUTSIDE: case self::SCALE_FIT: $rx = ($width > 0) ? ($this->getWidth() / $width) : 0; $ry = ($height > 0) ? ($this->getHeight() / $height) : 0; if ($scaleMethod != self::SCALE_OUTSIDE) { $ratio = max($rx, $ry); } else { $ratio = min($rx, $ry); } $dimensions->width = (int) round($this->getWidth() / $ratio); $dimensions->height = (int) round($this->getHeight() / $ratio); break; default: throw new InvalidArgumentException('Invalid scale method.'); break; } return $dimensions; } /** * Method to sanitize a height value. * * @param mixed $height The input height value to sanitize. * @param mixed $width The input width value for reference. * * @return integer * * @since 11.3 */ protected function sanitizeHeight($height, $width) { // If no height was given we will assume it is a square and use the width. $height = ($height === null) ? $width : $height; // If we were given a percentage, calculate the integer value. if (preg_match('/^[0-9]+(\.[0-9]+)?\%$/', $height)) { $height = (int) round($this->getHeight() * (float) str_replace('%', '', $height) / 100); } // Else do some rounding so we come out with a sane integer value. else { $height = (int) round((float) $height); } return $height; } /** * Method to sanitize an offset value like left or top. * * @param mixed $offset An offset value. * * @return integer * * @since 11.3 */ protected function sanitizeOffset($offset) { return (int) round((float) $offset); } /** * Method to sanitize a width value. * * @param mixed $width The input width value to sanitize. * @param mixed $height The input height value for reference. * * @return integer * * @since 11.3 */ protected function sanitizeWidth($width, $height) { // If no width was given we will assume it is a square and use the height. $width = ($width === null) ? $height : $width; // If we were given a percentage, calculate the integer value. if (preg_match('/^[0-9]+(\.[0-9]+)?\%$/', $width)) { $width = (int) round($this->getWidth() * (float) str_replace('%', '', $width) / 100); } // Else do some rounding so we come out with a sane integer value. else { $width = (int) round((float) $width); } return $width; } /** * Method to destroy an image handle and * free the memory associated with the handle * * @return boolean True on success, false on failure or if no image is loaded * * @since 12.3 */ public function destroy() { if ($this->isLoaded()) { return imagedestroy($this->handle); } return false; } /** * Method to call the destroy() method one last time * to free any memory when the object is unset * * @see JImage::destroy() * @since 12.3 */ public function __destruct() { $this->destroy(); } } PK���\H#��$libraries/joomla/session/storage.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Session * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Custom session storage handler for PHP * * @see http://www.php.net/manual/en/function.session-set-save-handler.php * @todo When dropping compatibility with PHP 5.3 use the SessionHandlerInterface and the SessionHandler class * @since 11.1 */ abstract class JSessionStorage { /** * @var array JSessionStorage instances container. * @since 11.3 */ protected static $instances = array(); /** * Constructor * * @param array $options Optional parameters. * * @since 11.1 */ public function __construct($options = array()) { $this->register($options); } /** * Returns a session storage handler object, only creating it if it doesn't already exist. * * @param string $name The session store to instantiate * @param array $options Array of options * * @return JSessionStorage * * @since 11.1 */ public static function getInstance($name = 'none', $options = array()) { $name = strtolower(JFilterInput::getInstance()->clean($name, 'word')); if (empty(self::$instances[$name])) { $class = 'JSessionStorage' . ucfirst($name); if (!class_exists($class)) { $path = __DIR__ . '/storage/' . $name . '.php'; if (file_exists($path)) { require_once $path; } else { // No attempt to die gracefully here, as it tries to close the non-existing session jexit('Unable to load session storage class: ' . $name); } } self::$instances[$name] = new $class($options); } return self::$instances[$name]; } /** * Register the functions of this class with PHP's session handler * * @return void * * @since 11.1 */ public function register() { // Use this object as the session handler session_set_save_handler( array($this, 'open'), array($this, 'close'), array($this, 'read'), array($this, 'write'), array($this, 'destroy'), array($this, 'gc') ); } /** * Open the SessionHandler backend. * * @param string $save_path The path to the session object. * @param string $session_name The name of the session. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function open($save_path, $session_name) { return true; } /** * Close the SessionHandler backend. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function close() { return true; } /** * Read the data for a particular session identifier from the * SessionHandler backend. * * @param string $id The session identifier. * * @return string The session data. * * @since 11.1 */ public function read($id) { return; } /** * Write session data to the SessionHandler backend. * * @param string $id The session identifier. * @param string $session_data The session data. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function write($id, $session_data) { return true; } /** * Destroy the data for a particular session identifier in the * SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function destroy($id) { return true; } /** * Garbage collect stale sessions from the SessionHandler backend. * * @param integer $maxlifetime The maximum age of a session. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc($maxlifetime = null) { return true; } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return true; } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JSessionStorage::isSupported() instead. */ public static function test() { JLog::add('JSessionStorage::test() is deprecated. Use JSessionStorage::isSupported() instead.', JLog::WARNING, 'deprecated'); return static::isSupported(); } } PK���\�S*�kk+libraries/joomla/session/storage/xcache.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Session * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * XCache session storage handler * * @since 11.1 */ class JSessionStorageXcache extends JSessionStorage { /** * Constructor * * @param array $options Optional parameters. * * @since 11.1 * @throws RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new RuntimeException('XCache Extension is not available', 404); } parent::__construct($options); } /** * Read the data for a particular session identifier from the SessionHandler backend. * * @param string $id The session identifier. * * @return string The session data. * * @since 11.1 */ public function read($id) { $sess_id = 'sess_' . $id; // Check if id exists if (!xcache_isset($sess_id)) { return; } return (string) xcache_get($sess_id); } /** * Write session data to the SessionHandler backend. * * @param string $id The session identifier. * @param string $session_data The session data. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function write($id, $session_data) { $sess_id = 'sess_' . $id; return xcache_set($sess_id, $session_data, ini_get("session.gc_maxlifetime")); } /** * Destroy the data for a particular session identifier in the SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function destroy($id) { $sess_id = 'sess_' . $id; if (!xcache_isset($sess_id)) { return true; } return xcache_unset($sess_id); } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return (extension_loaded('xcache')); } } PK���\���{��-libraries/joomla/session/storage/wincache.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Session * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * WINCACHE session storage handler for PHP * * @since 11.1 */ class JSessionStorageWincache extends JSessionStorage { /** * Constructor * * @param array $options Optional parameters. * * @since 11.1 * @throws RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new RuntimeException('Wincache Extension is not available', 404); } parent::__construct($options); } /** * Register the functions of this class with PHP's session handler * * @return void * * @since 12.2 */ public function register() { ini_set('session.save_handler', 'wincache'); } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return (extension_loaded('wincache') && function_exists('wincache_ucache_get') && !strcmp(ini_get('wincache.ucenabled'), "1")); } } PK���\%�ܐ��)libraries/joomla/session/storage/none.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Session * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * File session handler for PHP * * @see http://www.php.net/manual/en/function.session-set-save-handler.php * @since 11.1 */ class JSessionStorageNone extends JSessionStorage { /** * Register the functions of this class with PHP's session handler * * @return void * * @since 11.1 */ public function register() { // Default session handler is `files` } } PK���\�!+��.libraries/joomla/session/storage/memcached.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Session * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Memcached session storage handler for PHP * * @since 11.1 */ class JSessionStorageMemcached extends JSessionStorage { /** * @var array Container for memcache server conf arrays */ private $_servers = array(); /** * Constructor * * @param array $options Optional parameters. * * @since 11.1 * @throws RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new RuntimeException('Memcached Extension is not available', 404); } $config = JFactory::getConfig(); // This will be an array of loveliness // @todo: multiple servers $this->_servers = array( array( 'host' => $config->get('session_memcached_server_host', 'localhost'), 'port' => $config->get('session_memcached_server_port', 11211) ) ); parent::__construct($options); } /** * Register the functions of this class with PHP's session handler * * @return void * * @since 12.2 */ public function register() { if (!empty($this->_servers) && isset($this->_servers[0])) { $serverConf = current($this->_servers); ini_set('session.save_path', "{$serverConf['host']}:{$serverConf['port']}"); ini_set('session.save_handler', 'memcached'); } } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return (extension_loaded('memcached') && class_exists('Memcached')); } } PK���\�@&-libraries/joomla/session/storage/database.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Session * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Database session storage handler for PHP * * @see http://www.php.net/manual/en/function.session-set-save-handler.php * @since 11.1 */ class JSessionStorageDatabase extends JSessionStorage { /** * Read the data for a particular session identifier from the SessionHandler backend. * * @param string $id The session identifier. * * @return string The session data. * * @since 11.1 */ public function read($id) { // Get the database connection object and verify its connected. $db = JFactory::getDbo(); try { // Get the session data from the database table. $query = $db->getQuery(true) ->select($db->quoteName('data')) ->from($db->quoteName('#__session')) ->where($db->quoteName('session_id') . ' = ' . $db->quote($id)); $db->setQuery($query); $result = (string) $db->loadResult(); $result = str_replace('\0\0\0', chr(0) . '*' . chr(0), $result); return $result; } catch (Exception $e) { return false; } } /** * Write session data to the SessionHandler backend. * * @param string $id The session identifier. * @param string $data The session data. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function write($id, $data) { // Get the database connection object and verify its connected. $db = JFactory::getDbo(); $data = str_replace(chr(0) . '*' . chr(0), '\0\0\0', $data); try { $query = $db->getQuery(true) ->update($db->quoteName('#__session')) ->set($db->quoteName('data') . ' = ' . $db->quote($data)) ->set($db->quoteName('time') . ' = ' . $db->quote((int) time())) ->where($db->quoteName('session_id') . ' = ' . $db->quote($id)); // Try to update the session data in the database table. $db->setQuery($query); if (!$db->execute()) { return false; } /* Since $db->execute did not throw an exception, so the query was successful. Either the data changed, or the data was identical. In either case we are done. */ return true; } catch (Exception $e) { return false; } } /** * Destroy the data for a particular session identifier in the SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function destroy($id) { // Get the database connection object and verify its connected. $db = JFactory::getDbo(); try { $query = $db->getQuery(true) ->delete($db->quoteName('#__session')) ->where($db->quoteName('session_id') . ' = ' . $db->quote($id)); // Remove a session from the database. $db->setQuery($query); return (boolean) $db->execute(); } catch (Exception $e) { return false; } } /** * Garbage collect stale sessions from the SessionHandler backend. * * @param integer $lifetime The maximum age of a session. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function gc($lifetime = 1440) { // Get the database connection object and verify its connected. $db = JFactory::getDbo(); // Determine the timestamp threshold with which to purge old sessions. $past = time() - $lifetime; try { $query = $db->getQuery(true) ->delete($db->quoteName('#__session')) ->where($db->quoteName('time') . ' < ' . $db->quote((int) $past)); // Remove expired sessions from the database. $db->setQuery($query); return (boolean) $db->execute(); } catch (Exception $e) { return false; } } } PK���\�o�x��-libraries/joomla/session/storage/memcache.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Session * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Memcache session storage handler for PHP * * @since 11.1 */ class JSessionStorageMemcache extends JSessionStorage { /** * @var array Container for memcache server conf arrays */ private $_servers = array(); /** * Constructor * * @param array $options Optional parameters. * * @since 11.1 * @throws RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new RuntimeException('Memcache Extension is not available', 404); } $config = JFactory::getConfig(); // This will be an array of loveliness // @todo: multiple servers $this->_servers = array( array( 'host' => $config->get('session_memcache_server_host', 'localhost'), 'port' => $config->get('session_memcache_server_port', 11211) ) ); parent::__construct($options); } /** * Register the functions of this class with PHP's session handler * * @return void * * @since 12.2 */ public function register() { if (!empty($this->_servers) && isset($this->_servers[0])) { $serverConf = current($this->_servers); ini_set('session.save_path', "{$serverConf['host']}:{$serverConf['port']}"); ini_set('session.save_handler', 'memcache'); } } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return (extension_loaded('memcache') && class_exists('Memcache')); } } PK���\�T�-//(libraries/joomla/session/storage/apc.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Session * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * APC session storage handler for PHP * * @see http://www.php.net/manual/en/function.session-set-save-handler.php * @since 11.1 */ class JSessionStorageApc extends JSessionStorage { /** * Constructor * * @param array $options Optional parameters * * @since 11.1 * @throws RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new RuntimeException('APC Extension is not available', 404); } parent::__construct($options); } /** * Read the data for a particular session identifier from the * SessionHandler backend. * * @param string $id The session identifier. * * @return string The session data. * * @since 11.1 */ public function read($id) { $sess_id = 'sess_' . $id; return (string) apc_fetch($sess_id); } /** * Write session data to the SessionHandler backend. * * @param string $id The session identifier. * @param string $session_data The session data. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function write($id, $session_data) { $sess_id = 'sess_' . $id; return apc_store($sess_id, $session_data, ini_get("session.gc_maxlifetime")); } /** * Destroy the data for a particular session identifier in the SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function destroy($id) { $sess_id = 'sess_' . $id; return apc_delete($sess_id); } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return extension_loaded('apc'); } } PK���\ ��8�Y�Y$libraries/joomla/session/session.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Session * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Class for managing HTTP sessions * * Provides access to session-state values as well as session-level * settings and lifetime management methods. * Based on the standard PHP session handling mechanism it provides * more advanced features such as expire timeouts. * * @since 11.1 */ class JSession implements IteratorAggregate { /** * Internal state. * One of 'inactive'|'active'|'expired'|'destroyed'|'error' * * @var string * @see JSession::getState() * @since 11.1 */ protected $_state = 'inactive'; /** * Maximum age of unused session in minutes * * @var string * @since 11.1 */ protected $_expire = 15; /** * The session store object. * * @var JSessionStorage * @since 11.1 */ protected $_store = null; /** * Security policy. * List of checks that will be done. * * Default values: * - fix_browser * - fix_adress * * @var array * @since 11.1 */ protected $_security = array('fix_browser'); /** * Force cookies to be SSL only * Default false * * @var boolean * @since 11.1 */ protected $_force_ssl = false; /** * JSession instances container. * * @var JSession * @since 11.3 */ protected static $instance; /** * The type of storage for the session. * * @var string * @since 12.2 */ protected $storeName; /** * Holds the JInput object * * @var JInput * @since 12.2 */ private $_input = null; /** * Holds the event dispatcher object * * @var JEventDispatcher * @since 12.2 */ private $_dispatcher = null; /** * Internal data store for the session data * * @var \Joomla\Registry\Registry */ protected $data; /** * Constructor * * @param string $store The type of storage for the session. * @param array $options Optional parameters * * @since 11.1 */ public function __construct($store = 'none', array $options = array()) { // Initialize the data variable, let's avoid fatal error if the session is not corretly started (ie in CLI). $this->data = new \Joomla\Registry\Registry; // Need to destroy any existing sessions started with session.auto_start if (session_id()) { session_unset(); session_destroy(); } // Disable transparent sid support ini_set('session.use_trans_sid', '0'); // Only allow the session ID to come from cookies and nothing else. ini_set('session.use_only_cookies', '1'); // Create handler $this->_store = JSessionStorage::getInstance($store, $options); $this->storeName = $store; // Set options $this->_setOptions($options); $this->_setCookieParams(); $this->_state = 'inactive'; } /** * Magic method to get read-only access to properties. * * @param string $name Name of property to retrieve * * @return mixed The value of the property * * @since 12.2 */ public function __get($name) { if ($name === 'storeName') { return $this->$name; } if ($name === 'state' || $name === 'expire') { $property = '_' . $name; return $this->$property; } } /** * Returns the global Session object, only creating it * if it doesn't already exist. * * @param string $handler The type of session handler. * @param array $options An array of configuration options. * * @return JSession The Session object. * * @since 11.1 */ public static function getInstance($handler, $options) { if (!is_object(self::$instance)) { self::$instance = new JSession($handler, $options); } return self::$instance; } /** * Get current state of session * * @return string The session state * * @since 11.1 */ public function getState() { return $this->_state; } /** * Get expiration time in minutes * * @return integer The session expiration time in minutes * * @since 11.1 */ public function getExpire() { return $this->_expire; } /** * Get a session token, if a token isn't set yet one will be generated. * * Tokens are used to secure forms from spamming attacks. Once a token * has been generated the system will check the post request to see if * it is present, if not it will invalidate the session. * * @param boolean $forceNew If true, force a new token to be created * * @return string The session token * * @since 11.1 */ public function getToken($forceNew = false) { $token = $this->get('session.token'); // Create a token if ($token === null || $forceNew) { $token = $this->_createToken(12); $this->set('session.token', $token); } return $token; } /** * Method to determine if a token exists in the session. If not the * session will be set to expired * * @param string $tCheck Hashed token to be verified * @param boolean $forceExpire If true, expires the session * * @return boolean * * @since 11.1 */ public function hasToken($tCheck, $forceExpire = true) { // Check if a token exists in the session $tStored = $this->get('session.token'); // Check token if (($tStored !== $tCheck)) { if ($forceExpire) { $this->_state = 'expired'; } return false; } return true; } /** * Method to determine a hash for anti-spoofing variable names * * @param boolean $forceNew If true, force a new token to be created * * @return string Hashed var name * * @since 11.1 */ public static function getFormToken($forceNew = false) { $user = JFactory::getUser(); $session = JFactory::getSession(); // TODO: Decouple from legacy JApplication class. if (is_callable(array('JApplication', 'getHash'))) { $hash = JApplication::getHash($user->get('id', 0) . $session->getToken($forceNew)); } else { $hash = md5(JFactory::getApplication()->get('secret') . $user->get('id', 0) . $session->getToken($forceNew)); } return $hash; } /** * Retrieve an external iterator. * * @return ArrayIterator Return an ArrayIterator of $_SESSION. * * @since 12.2 */ public function getIterator() { return new ArrayIterator($this->getData()); } /** * Checks for a form token in the request. * * Use in conjunction with JHtml::_('form.token') or JSession::getFormToken. * * @param string $method The request method in which to look for the token key. * * @return boolean True if found and valid, false otherwise. * * @since 12.1 */ public static function checkToken($method = 'post') { $token = self::getFormToken(); $app = JFactory::getApplication(); if (!$app->input->$method->get($token, '', 'alnum')) { $session = JFactory::getSession(); if ($session->isNew()) { // Redirect to login screen. $app->enqueueMessage(JText::_('JLIB_ENVIRONMENT_SESSION_EXPIRED'), 'warning'); $app->redirect(JRoute::_('index.php')); } else { return false; } } else { return true; } } /** * Get session name * * @return string The session name * * @since 11.1 */ public function getName() { if ($this->_state === 'destroyed') { // @TODO : raise error return null; } return session_name(); } /** * Get session id * * @return string The session name * * @since 11.1 */ public function getId() { if ($this->_state === 'destroyed') { // @TODO : raise error return null; } return session_id(); } /** * Returns a clone of the internal data pointer * * @return \Joomla\Registry\Registry */ public function getData() { return clone $this->data; } /** * Get the session handlers * * @return array An array of available session handlers * * @since 11.1 */ public static function getStores() { $connectors = array(); // Get an iterator and loop trough the driver classes. $iterator = new DirectoryIterator(__DIR__ . '/storage'); /* @type $file DirectoryIterator */ foreach ($iterator as $file) { $fileName = $file->getFilename(); // Only load for php files. if (!$file->isFile() || $file->getExtension() != 'php') { continue; } // Derive the class name from the type. $class = str_ireplace('.php', '', 'JSessionStorage' . ucfirst(trim($fileName))); // If the class doesn't exist we have nothing left to do but look at the next type. We did our best. if (!class_exists($class)) { continue; } // Sweet! Our class exists, so now we just need to know if it passes its test method. if ($class::isSupported()) { // Connector names should not have file extensions. $connectors[] = str_ireplace('.php', '', $fileName); } } return $connectors; } /** * Shorthand to check if the session is active * * @return boolean * * @since 12.2 */ public function isActive() { return (bool) ($this->_state == 'active'); } /** * Check whether this session is currently created * * @return boolean True on success. * * @since 11.1 */ public function isNew() { $counter = $this->get('session.counter'); return (bool) ($counter === 1); } /** * Check whether this session is currently created * * @param JInput $input JInput object for the session to use. * @param JEventDispatcher $dispatcher Dispatcher object for the session to use. * * @return void. * * @since 12.2 */ public function initialise(JInput $input, JEventDispatcher $dispatcher = null) { $this->_input = $input; $this->_dispatcher = $dispatcher; } /** * Get data from the session store * * @param string $name Name of a variable * @param mixed $default Default value of a variable if not set * @param string $namespace Namespace to use, default to 'default' * * @return mixed Value of a variable * * @since 11.1 */ public function get($name, $default = null, $namespace = 'default') { // Add prefix to namespace to avoid collisions $namespace = '__' . $namespace; if ($this->_state === 'destroyed') { // @TODO :: generated error here $error = null; return $error; } return $this->data->get($namespace . '.' . $name, $default); } /** * Set data into the session store. * * @param string $name Name of a variable. * @param mixed $value Value of a variable. * @param string $namespace Namespace to use, default to 'default'. * * @return mixed Old value of a variable. * * @since 11.1 */ public function set($name, $value = null, $namespace = 'default') { // Add prefix to namespace to avoid collisions $namespace = '__' . $namespace; if ($this->_state !== 'active') { // @TODO :: generated error here return null; } return $this->data->set($namespace . '.' . $name, $value); } /** * Check whether data exists in the session store * * @param string $name Name of variable * @param string $namespace Namespace to use, default to 'default' * * @return boolean True if the variable exists * * @since 11.1 */ public function has($name, $namespace = 'default') { // Add prefix to namespace to avoid collisions. $namespace = '__' . $namespace; if ($this->_state !== 'active') { // @TODO :: generated error here return null; } return !is_null($this->data->get($namespace . '.' . $name, null)); } /** * Unset data from the session store * * @param string $name Name of variable * @param string $namespace Namespace to use, default to 'default' * * @return mixed The value from session or NULL if not set * * @since 11.1 */ public function clear($name, $namespace = 'default') { // Add prefix to namespace to avoid collisions $namespace = '__' . $namespace; if ($this->_state !== 'active') { // @TODO :: generated error here return null; } return $this->data->set($namespace . '.' . $name, null); } /** * Start a session. * * @return void * * @since 12.2 */ public function start() { if ($this->_state === 'active') { return; } $this->_start(); $this->_state = 'active'; // Initialise the session $this->_setCounter(); $this->_setTimers(); // Perform security checks if (!$this->_validate()) { // Destroy the session if it's not valid $this->destroy(); } if ($this->_dispatcher instanceof JEventDispatcher) { $this->_dispatcher->trigger('onAfterSessionStart'); } } /** * Start a session. * * Creates a session (or resumes the current one based on the state of the session) * * @return boolean true on success * * @since 11.1 */ protected function _start() { // Start session if not started if ($this->_state === 'restart') { session_regenerate_id(true); } else { $session_name = session_name(); // Get the JInputCookie object $cookie = $this->_input->cookie; if (is_null($cookie->get($session_name))) { $session_clean = $this->_input->get($session_name, false, 'string'); if ($session_clean) { session_id($session_clean); $cookie->set($session_name, '', time() - 3600); } } } /** * Write and Close handlers are called after destructing objects since PHP 5.0.5. * Thus destructors can use sessions but session handler can't use objects. * So we are moving session closure before destructing objects. */ register_shutdown_function(array($this, 'close')); session_cache_limiter('none'); session_start(); // Ok let's unserialize the whole thing // Try loading data from the session if (isset($_SESSION['joomla']) && !empty($_SESSION['joomla'])) { $data = $_SESSION['joomla']; $data = base64_decode($data); $this->data = unserialize($data); } // Temporary, PARTIAL, data migration of existing session data to avoid logout on update from J < 3.4.7 if (isset($_SESSION['__default']) && !empty($_SESSION['__default'])) { $migratableKeys = array("user", "session.token", "session.counter", "session.timer.start", "session.timer.last", "session.timer.now"); foreach ($migratableKeys as $migratableKey) { if (!empty($_SESSION['__default'][$migratableKey])) { // Don't overwrite existing session data if (!is_null($this->data->get('__default.' . $migratableKey, null))) { continue; } $this->data->set('__default.' . $migratableKey, $_SESSION['__default'][$migratableKey]); unset($_SESSION['__default'][$migratableKey]); } } /** * Finally, empty the __default key since we no longer need it. Don't unset it completely, we need this * for the administrator/components/com_admin/script.php to detect upgraded sessions and perform a full * session cleanup. */ $_SESSION['__default'] = array(); } return true; } /** * Frees all session variables and destroys all data registered to a session * * This method resets the data pointer and destroys all of the data associated * with the current session in its storage (file or DB). It forces a new session to be * started after this method is called. It does not unset the session cookie. * * @return boolean True on success * * @see session_destroy() * @see session_unset() * @since 11.1 */ public function destroy() { // Session was already destroyed if ($this->_state === 'destroyed') { return true; } /* * In order to kill the session altogether, such as to log the user out, the session id * must also be unset. If a cookie is used to propagate the session id (default behavior), * then the session cookie must be deleted. */ if (isset($_COOKIE[session_name()])) { $config = JFactory::getConfig(); $cookie_domain = $config->get('cookie_domain', ''); $cookie_path = $config->get('cookie_path', '/'); setcookie(session_name(), '', time() - 42000, $cookie_path, $cookie_domain); } $this->data = new \Joomla\Registry\Registry; session_unset(); session_destroy(); $this->_state = 'destroyed'; return true; } /** * Restart an expired or locked session. * * @return boolean True on success * * @see JSession::destroy() * @since 11.1 */ public function restart() { $this->destroy(); if ($this->_state !== 'destroyed') { // @TODO :: generated error here return false; } // Re-register the session handler after a session has been destroyed, to avoid PHP bug $this->_store->register(); $this->_state = 'restart'; // Regenerate session id session_regenerate_id(true); $this->_start(); $this->_state = 'active'; if (!$this->_validate()) { // Destroy the session if it's not valid $this->destroy(); } $this->_setCounter(); return true; } /** * Create a new session and copy variables from the old one * * @return boolean $result true on success * * @since 11.1 */ public function fork() { if ($this->_state !== 'active') { // @TODO :: generated error here return false; } // Keep session config $cookie = session_get_cookie_params(); // Kill session session_destroy(); // Re-register the session store after a session has been destroyed, to avoid PHP bug $this->_store->register(); // Restore config session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'], true); // Restart session with new id session_regenerate_id(true); session_start(); return true; } /** * Writes session data and ends session * * Session data is usually stored after your script terminated without the need * to call JSession::close(), but as session data is locked to prevent concurrent * writes only one script may operate on a session at any time. When using * framesets together with sessions you will experience the frames loading one * by one due to this locking. You can reduce the time needed to load all the * frames by ending the session as soon as all changes to session variables are * done. * * @return boolean * * @see session_write_close() * @since 11.1 */ public function close() { $session = JFactory::getSession(); $data = $session->getData(); // Before storing it, let's serialize and encode the JRegistry object $_SESSION['joomla'] = base64_encode(serialize($data)); session_write_close(); return true; } /** * Set session cookie parameters * * @return void * * @since 11.1 */ protected function _setCookieParams() { $cookie = session_get_cookie_params(); if ($this->_force_ssl) { $cookie['secure'] = true; } $config = JFactory::getConfig(); if ($config->get('cookie_domain', '') != '') { $cookie['domain'] = $config->get('cookie_domain'); } if ($config->get('cookie_path', '') != '') { $cookie['path'] = $config->get('cookie_path'); } session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'], true); } /** * Create a token-string * * @param integer $length Length of string * * @return string Generated token * * @since 11.1 */ protected function _createToken($length = 32) { static $chars = '0123456789abcdef'; $max = strlen($chars) - 1; $token = ''; $name = session_name(); for ($i = 0; $i < $length; ++$i) { $token .= $chars[(rand(0, $max))]; } return md5($token . $name); } /** * Set counter of session usage * * @return boolean True on success * * @since 11.1 */ protected function _setCounter() { $counter = $this->get('session.counter', 0); ++$counter; $this->set('session.counter', $counter); return true; } /** * Set the session timers * * @return boolean True on success * * @since 11.1 */ protected function _setTimers() { if (!$this->has('session.timer.start')) { $start = time(); $this->set('session.timer.start', $start); $this->set('session.timer.last', $start); $this->set('session.timer.now', $start); } $this->set('session.timer.last', $this->get('session.timer.now')); $this->set('session.timer.now', time()); return true; } /** * Set additional session options * * @param array $options List of parameter * * @return boolean True on success * * @since 11.1 */ protected function _setOptions(array $options) { // Set name if (isset($options['name'])) { session_name(md5($options['name'])); } // Set id if (isset($options['id'])) { session_id($options['id']); } // Set expire time if (isset($options['expire'])) { $this->_expire = $options['expire']; } // Get security options if (isset($options['security'])) { $this->_security = explode(',', $options['security']); } if (isset($options['force_ssl'])) { $this->_force_ssl = (bool) $options['force_ssl']; } // Sync the session maxlifetime ini_set('session.gc_maxlifetime', $this->_expire); return true; } /** * Do some checks for security reason * * - timeout check (expire) * - ip-fixiation * - browser-fixiation * * If one check failed, session data has to be cleaned. * * @param boolean $restart Reactivate session * * @return boolean True on success * * @see http://shiflett.org/articles/the-truth-about-sessions * @since 11.1 */ protected function _validate($restart = false) { // Allow to restart a session if ($restart) { $this->_state = 'active'; $this->set('session.client.address', null); $this->set('session.client.forwarded', null); $this->set('session.client.browser', null); $this->set('session.token', null); } // Check if session has expired if ($this->_expire) { $curTime = $this->get('session.timer.now', 0); $maxTime = $this->get('session.timer.last', 0) + $this->_expire; // Empty session variables if ($maxTime < $curTime) { $this->_state = 'expired'; return false; } } // Check for client address if (in_array('fix_adress', $this->_security) && isset($_SERVER['REMOTE_ADDR']) && filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP) !== false) { $ip = $this->get('session.client.address'); if ($ip === null) { $this->set('session.client.address', $_SERVER['REMOTE_ADDR']); } elseif ($_SERVER['REMOTE_ADDR'] !== $ip) { $this->_state = 'error'; return false; } } // Record proxy forwarded for in the session in case we need it later if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && filter_var($_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP) !== false) { $this->set('session.client.forwarded', $_SERVER['HTTP_X_FORWARDED_FOR']); } return true; } } PK���\@�2G$G$libraries/joomla/http/http.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage HTTP * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * HTTP client class. * * @since 11.3 */ class JHttp { /** * @var Registry Options for the HTTP client. * @since 11.3 */ protected $options; /** * @var JHttpTransport The HTTP transport object to use in sending HTTP requests. * @since 11.3 */ protected $transport; /** * Constructor. * * @param Registry $options Client options object. If the registry contains any headers.* elements, * these will be added to the request headers. * @param JHttpTransport $transport The HTTP transport object. * * @since 11.3 */ public function __construct(Registry $options = null, JHttpTransport $transport = null) { $this->options = isset($options) ? $options : new Registry; $this->transport = isset($transport) ? $transport : JHttpFactory::getAvailableDriver($this->options); } /** * Get an option from the HTTP client. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 11.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the HTTP client. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JHttp This object for method chaining. * * @since 11.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } /** * Method to send the OPTIONS command to the server. * * @param string $url Path to the resource. * @param array $headers An array of name-value pairs to include in the header of the request. * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 11.3 */ public function options($url, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('timeout')) { $timeout = $this->options->get('timeout'); } return $this->transport->request('OPTIONS', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null)); } /** * Method to send the HEAD command to the server. * * @param string $url Path to the resource. * @param array $headers An array of name-value pairs to include in the header of the request. * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 11.3 */ public function head($url, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('timeout')) { $timeout = $this->options->get('timeout'); } return $this->transport->request('HEAD', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null)); } /** * Method to send the GET command to the server. * * @param string $url Path to the resource. * @param array $headers An array of name-value pairs to include in the header of the request. * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 11.3 */ public function get($url, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('timeout')) { $timeout = $this->options->get('timeout'); } return $this->transport->request('GET', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null)); } /** * Method to send the POST command to the server. * * @param string $url Path to the resource. * @param mixed $data Either an associative array or a string to be sent with the request. * @param array $headers An array of name-value pairs to include in the header of the request * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 11.3 */ public function post($url, $data, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('timeout')) { $timeout = $this->options->get('timeout'); } return $this->transport->request('POST', new JUri($url), $data, $headers, $timeout, $this->options->get('userAgent', null)); } /** * Method to send the PUT command to the server. * * @param string $url Path to the resource. * @param mixed $data Either an associative array or a string to be sent with the request. * @param array $headers An array of name-value pairs to include in the header of the request. * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 11.3 */ public function put($url, $data, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('timeout')) { $timeout = $this->options->get('timeout'); } return $this->transport->request('PUT', new JUri($url), $data, $headers, $timeout, $this->options->get('userAgent', null)); } /** * Method to send the DELETE command to the server. * * @param string $url Path to the resource. * @param array $headers An array of name-value pairs to include in the header of the request. * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 11.3 */ public function delete($url, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('timeout')) { $timeout = $this->options->get('timeout'); } return $this->transport->request('DELETE', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null)); } /** * Method to send the TRACE command to the server. * * @param string $url Path to the resource. * @param array $headers An array of name-value pairs to include in the header of the request. * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 11.3 */ public function trace($url, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('timeout')) { $timeout = $this->options->get('timeout'); } return $this->transport->request('TRACE', new JUri($url), null, $headers, $timeout, $this->options->get('userAgent', null)); } /** * Method to send the PATCH command to the server. * * @param string $url Path to the resource. * @param mixed $data Either an associative array or a string to be sent with the request. * @param array $headers An array of name-value pairs to include in the header of the request. * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 12.2 */ public function patch($url, $data, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('timeout')) { $timeout = $this->options->get('timeout'); } return $this->transport->request('PATCH', new JUri($url), $data, $headers, $timeout, $this->options->get('userAgent', null)); } } PK���\-0T����*libraries/joomla/http/transport/cacert.pemnu�[���## ## Bundle of CA Root Certificates ## ## Certificate data from Mozilla as of: Wed Apr 22 03:12:04 2015 ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates ## file (certdata.txt). This file can be found in the mozilla source tree: ## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt ## ## It contains the certificates in PEM format and therefore ## can be directly used with curl / libcurl / php_curl, or with ## an Apache+mod_ssl webserver for SSL client authentication. ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.25. ## SHA1: ed3c0bbfb7912bcc00cd2033b0cb85c98d10559c ## Equifax Secure CA ================= -----BEGIN CERTIFICATE----- MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW 8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961 zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 70+sB3c4 -----END CERTIFICATE----- GlobalSign Root CA ================== -----BEGIN CERTIFICATE----- MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== -----END CERTIFICATE----- GlobalSign Root CA - R2 ======================= -----BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp 9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu 01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== -----END CERTIFICATE----- Verisign Class 3 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj 055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC /Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== -----END CERTIFICATE----- Verisign Class 4 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM 8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== -----END CERTIFICATE----- Entrust.net Premium 2048 Secure Server CA ========================================= -----BEGIN CERTIFICATE----- MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= -----END CERTIFICATE----- Baltimore CyberTrust Root ========================= -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp -----END CERTIFICATE----- AddTrust Low-Value Services Root ================================ -----BEGIN CERTIFICATE----- MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6 54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1 Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= -----END CERTIFICATE----- AddTrust External Root ====================== -----BEGIN CERTIFICATE----- MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 +iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy 2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= -----END CERTIFICATE----- AddTrust Public Services Root ============================= -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB /zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL +YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= -----END CERTIFICATE----- AddTrust Qualified Certificates Root ==================================== -----BEGIN CERTIFICATE----- MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx 64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3 KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/ BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= -----END CERTIFICATE----- Entrust Root Certification Authority ==================================== -----BEGIN CERTIFICATE----- MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 -----END CERTIFICATE----- RSA Security 2048 v3 ==================== -----BEGIN CERTIFICATE----- MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7 Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP +Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/ MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj 0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395 nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA pKnXwiJPZ9d37CAFYd4= -----END CERTIFICATE----- GeoTrust Global CA ================== -----BEGIN CERTIFICATE----- MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet 8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm Mw== -----END CERTIFICATE----- GeoTrust Global CA 2 ==================== -----BEGIN CERTIFICATE----- MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF H4z1Ir+rzoPz4iIprn2DQKi6bA== -----END CERTIFICATE----- GeoTrust Universal CA ===================== -----BEGIN CERTIFICATE----- MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs 7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d 8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI P/rmMuGNG2+k5o7Y+SlIis5z/iw= -----END CERTIFICATE----- GeoTrust Universal CA 2 ======================= -----BEGIN CERTIFICATE----- MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP 20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG 8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 +/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ 4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS -----END CERTIFICATE----- Visa eCommerce Root =================== -----BEGIN CERTIFICATE----- MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2 WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0 TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI /k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt 398znM/jra6O1I7mT1GvFpLgXPYHDw== -----END CERTIFICATE----- Certum Root CA ============== -----BEGIN CERTIFICATE----- MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ 89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ 0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== -----END CERTIFICATE----- Comodo AAA Services root ======================== -----BEGIN CERTIFICATE----- MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm 7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z 8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C 12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== -----END CERTIFICATE----- Comodo Secure Services root =========================== -----BEGIN CERTIFICATE----- MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP 9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm 4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H RR3B7Hzs/Sk= -----END CERTIFICATE----- Comodo Trusted Services root ============================ -----BEGIN CERTIFICATE----- MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7 3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y /9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6 juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB /zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O 9y5Xt5hwXsjEeLBi -----END CERTIFICATE----- QuoVadis Root CA ================ -----BEGIN CERTIFICATE----- MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi 5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi 5nrQNiOKSnQ2+Q== -----END CERTIFICATE----- QuoVadis Root CA 2 ================== -----BEGIN CERTIFICATE----- MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt 66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK +JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II 4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u -----END CERTIFICATE----- QuoVadis Root CA 3 ================== -----BEGIN CERTIFICATE----- MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp 8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= -----END CERTIFICATE----- Security Communication Root CA ============================== -----BEGIN CERTIFICATE----- MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw 8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX 5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g 0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ 6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi FL39vmwLAw== -----END CERTIFICATE----- Sonera Class 2 Root CA ====================== -----BEGIN CERTIFICATE----- MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 /Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt 0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH llpwrN9M -----END CERTIFICATE----- Staat der Nederlanden Root CA ============================= -----BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6 22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== -----END CERTIFICATE----- UTN DATACorp SGC Root CA ======================== -----BEGIN CERTIFICATE----- MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA 9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv 33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9 BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3 DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0 I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI -----END CERTIFICATE----- UTN USERFirst Hardware Root CA ============================== -----BEGIN CERTIFICATE----- MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0 eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8 i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM //bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 nfhmqA== -----END CERTIFICATE----- Camerfirma Chambers of Commerce Root ==================================== -----BEGIN CERTIFICATE----- MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 erfutGWaIZDgqtCYvDi1czyL+Nw= -----END CERTIFICATE----- Camerfirma Global Chambersign Root ================================== -----BEGIN CERTIFICATE----- MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J 1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl 6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c 8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== -----END CERTIFICATE----- NetLock Notary (Class A) Root ============================= -----BEGIN CERTIFICATE----- MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC /tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7 tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6 4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0 ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5 ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM 8CgHrTwXZoi1/baI -----END CERTIFICATE----- XRamp Global CA Root ==================== -----BEGIN CERTIFICATE----- MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc /Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz 8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= -----END CERTIFICATE----- Go Daddy Class 2 CA =================== -----BEGIN CERTIFICATE----- MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv 2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b vZ8= -----END CERTIFICATE----- Starfield Class 2 CA ==================== -----BEGIN CERTIFICATE----- MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 QBFGmh95DmK/D5fs4C8fF5Q= -----END CERTIFICATE----- StartCom Certification Authority ================================ -----BEGIN CERTIFICATE----- MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt 2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z 6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT 37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0 Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5 LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh 3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl 1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro g14= -----END CERTIFICATE----- Taiwan GRCA =========== -----BEGIN CERTIFICATE----- MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O 1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk 7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy +fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS -----END CERTIFICATE----- Swisscom Root CA 1 ================== -----BEGIN CERTIFICATE----- MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4 MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn 7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5 haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9 MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW NY6E0F/6MBr1mmz0DlP5OlvRHA== -----END CERTIFICATE----- DigiCert Assured ID Root CA =========================== -----BEGIN CERTIFICATE----- MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO 9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW /lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF 66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i 8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe +o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== -----END CERTIFICATE----- DigiCert Global Root CA ======================= -----BEGIN CERTIFICATE----- MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H 4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y 7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm 8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= -----END CERTIFICATE----- DigiCert High Assurance EV Root CA ================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K -----END CERTIFICATE----- Certplus Class 2 Primary CA =========================== -----BEGIN CERTIFICATE----- MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR 5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ 7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW //1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 l7+ijrRU -----END CERTIFICATE----- DST Root CA X3 ============== -----BEGIN CERTIFICATE----- MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ -----END CERTIFICATE----- DST ACES CA X6 ============== -----BEGIN CERTIFICATE----- MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 oKfN5XozNmr6mis= -----END CERTIFICATE----- TURKTRUST Certificate Services Provider Root 1 ============================================== -----BEGIN CERTIFICATE----- MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0 acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ 8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4 W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46 sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H -----END CERTIFICATE----- TURKTRUST Certificate Services Provider Root 2 ============================================== -----BEGIN CERTIFICATE----- MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr 5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+ hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P 9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 UrbnBEI= -----END CERTIFICATE----- SwissSign Gold CA - G2 ====================== -----BEGIN CERTIFICATE----- MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR 7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm 5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr 44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ -----END CERTIFICATE----- SwissSign Silver CA - G2 ======================== -----BEGIN CERTIFICATE----- MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG 9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm +/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH 6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P 4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L 3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx /uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u -----END CERTIFICATE----- GeoTrust Primary Certification Authority ======================================== -----BEGIN CERTIFICATE----- MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG 1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= -----END CERTIFICATE----- thawte Primary Root CA ====================== -----BEGIN CERTIFICATE----- MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ 1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== -----END CERTIFICATE----- VeriSign Class 3 Public Primary Certification Authority - G5 ============================================================ -----BEGIN CERTIFICATE----- MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq -----END CERTIFICATE----- SecureTrust CA ============== -----BEGIN CERTIFICATE----- MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b 01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR 3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= -----END CERTIFICATE----- Secure Global CA ================ -----BEGIN CERTIFICATE----- MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g 8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi 0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW -----END CERTIFICATE----- COMODO Certification Authority ============================== -----BEGIN CERTIFICATE----- MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH +7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV 4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA 1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN +8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== -----END CERTIFICATE----- Network Solutions Certificate Authority ======================================= -----BEGIN CERTIFICATE----- MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc /Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q 4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey -----END CERTIFICATE----- WellsSecure Public Root Certificate Authority ============================================= -----BEGIN CERTIFICATE----- MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1 iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13 i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8 bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ tylv2G0xffX8oRAHh84vWdw+WNs= -----END CERTIFICATE----- COMODO ECC Certification Authority ================================== -----BEGIN CERTIFICATE----- MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X 4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= -----END CERTIFICATE----- IGC/A ===== -----BEGIN CERTIFICATE----- MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2 TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF 0mBWWg== -----END CERTIFICATE----- Security Communication EV RootCA1 ================================= -----BEGIN CERTIFICATE----- MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO /VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK 9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 -----END CERTIFICATE----- OISTE WISeKey Global Root GA CA =============================== -----BEGIN CERTIFICATE----- MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ /yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 +vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= -----END CERTIFICATE----- Microsec e-Szigno Root CA ========================= -----BEGIN CERTIFICATE----- MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0 MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3 LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA 4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6 Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a 86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= -----END CERTIFICATE----- Certigna ======== -----BEGIN CERTIFICATE----- MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY 1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== -----END CERTIFICATE----- TC TrustCenter Class 2 CA II ============================ -----BEGIN CERTIFICATE----- MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2 xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB /wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB 7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk vQ== -----END CERTIFICATE----- TC TrustCenter Universal CA I ============================= -----BEGIN CERTIFICATE----- MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG 1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3 ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a 7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY -----END CERTIFICATE----- Deutsche Telekom Root CA 2 ========================== -----BEGIN CERTIFICATE----- MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU Cm26OWMohpLzGITY+9HPBVZkVw== -----END CERTIFICATE----- ComSign Secured CA ================== -----BEGIN CERTIFICATE----- MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs 49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH 7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1 9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP 51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== -----END CERTIFICATE----- Cybertrust Global Root ====================== -----BEGIN CERTIFICATE----- MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW 0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin 89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT 8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi 5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW WL1WMRJOEcgh4LMRkWXbtKaIOM5V -----END CERTIFICATE----- ePKI Root Certification Authority ================================= -----BEGIN CERTIFICATE----- MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX 12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= -----END CERTIFICATE----- T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 ============================================================================================================================= -----BEGIN CERTIFICATE----- MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1 xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR 6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= -----END CERTIFICATE----- Buypass Class 2 CA 1 ==================== -----BEGIN CERTIFICATE----- MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2 MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83 0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4 0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV 1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt 7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2 fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho -----END CERTIFICATE----- Buypass Class 3 CA 1 ==================== -----BEGIN CERTIFICATE----- MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1 MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0 n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c 1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7 pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5 htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 -----END CERTIFICATE----- EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 ========================================================================== -----BEGIN CERTIFICATE----- MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0 Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB /wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK 1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt 2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9 AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT -----END CERTIFICATE----- certSIGN ROOT CA ================ -----BEGIN CERTIFICATE----- MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD 0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD -----END CERTIFICATE----- CNNIC ROOT ========== -----BEGIN CERTIFICATE----- MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5 Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8 BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2 G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m mxE= -----END CERTIFICATE----- ApplicationCA - Japanese Government =================================== -----BEGIN CERTIFICATE----- MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g /DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL rosot4LKGAfmt1t06SAZf7IbiVQ= -----END CERTIFICATE----- GeoTrust Primary Certification Authority - G3 ============================================= -----BEGIN CERTIFICATE----- MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr 2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt -----END CERTIFICATE----- thawte Primary Root CA - G2 =========================== -----BEGIN CERTIFICATE----- MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== -----END CERTIFICATE----- thawte Primary Root CA - G3 =========================== -----BEGIN CERTIFICATE----- MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC +BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY 7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC 8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= -----END CERTIFICATE----- GeoTrust Primary Certification Authority - G2 ============================================= -----BEGIN CERTIFICATE----- MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 npaqBA+K -----END CERTIFICATE----- VeriSign Universal Root Certification Authority =============================================== -----BEGIN CERTIFICATE----- MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj 1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 mJO37M2CYfE45k+XmCpajQ== -----END CERTIFICATE----- VeriSign Class 3 Public Primary Certification Authority - G4 ============================================================ -----BEGIN CERTIFICATE----- MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB /zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== -----END CERTIFICATE----- NetLock Arany (Class Gold) FÅ‘tanúsÃtvány ============================================ -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu 0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw /HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= -----END CERTIFICATE----- Staat der Nederlanden Root CA - G2 ================================== -----BEGIN CERTIFICATE----- MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ 5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz +51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm 66+KAQ== -----END CERTIFICATE----- CA Disig ======== -----BEGIN CERTIFICATE----- MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3 mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA 4Z7CRneC9VkGjCFMhwnN5ag= -----END CERTIFICATE----- Juur-SK ======= -----BEGIN CERTIFICATE----- MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC +Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 yyqcjg== -----END CERTIFICATE----- Hongkong Post Root CA 1 ======================= -----BEGIN CERTIFICATE----- MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== -----END CERTIFICATE----- SecureSign RootCA11 =================== -----BEGIN CERTIFICATE----- MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= -----END CERTIFICATE----- ACEDICOM Root ============= -----BEGIN CERTIFICATE----- MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4 MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2 3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9 2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz 4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU 9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== -----END CERTIFICATE----- Microsec e-Szigno Root CA 2009 ============================== -----BEGIN CERTIFICATE----- MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG 0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm 1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi LXpUq3DDfSJlgnCW -----END CERTIFICATE----- GlobalSign Root CA - R3 ======================= -----BEGIN CERTIFICATE----- MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ 0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r kpeDMdmztcpHWD9f -----END CERTIFICATE----- Autoridad de Certificacion Firmaprofesional CIF A62634068 ========================================================= -----BEGIN CERTIFICATE----- MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY 7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx 51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi 6Et8Vcad+qMUu2WFbm5PEn4KPJ2V -----END CERTIFICATE----- Izenpe.com ========== -----BEGIN CERTIFICATE----- MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ 03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU +zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK 0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ 0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== -----END CERTIFICATE----- Chambers of Commerce Root - 2008 ================================ -----BEGIN CERTIFICATE----- MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ 0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH 3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF 9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ -----END CERTIFICATE----- Global Chambersign Root - 2008 ============================== -----BEGIN CERTIFICATE----- MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB /gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp 1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG /5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg 9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z 09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B -----END CERTIFICATE----- Go Daddy Root Certificate Authority - G2 ======================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq 9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD +qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r 5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 -----END CERTIFICATE----- Starfield Root Certificate Authority - G2 ========================================= -----BEGIN CERTIFICATE----- MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx 4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 -----END CERTIFICATE----- Starfield Services Root Certificate Authority - G2 ================================================== -----BEGIN CERTIFICATE----- MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 -----END CERTIFICATE----- AffirmTrust Commercial ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv 0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= -----END CERTIFICATE----- AffirmTrust Networking ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 /PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 /ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= -----END CERTIFICATE----- AffirmTrust Premium =================== -----BEGIN CERTIFICATE----- MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV 5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs +7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 /bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo +Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB /wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC 6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK +4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== -----END CERTIFICATE----- AffirmTrust Premium ECC ======================= -----BEGIN CERTIFICATE----- MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X 57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM eQ== -----END CERTIFICATE----- Certum Trusted Network CA ========================= -----BEGIN CERTIFICATE----- MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI 03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= -----END CERTIFICATE----- Certinomis - Autorité Racine ============================= -----BEGIN CERTIFICATE----- MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw 2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g 530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna 4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ vgt2Fl43N+bYdJeimUV5 -----END CERTIFICATE----- Root CA Generalitat Valenciana ============================== -----BEGIN CERTIFICATE----- MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3 WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+WmmmO3I2 F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKjSgbwJ/BXufjpTjJ3Cj9B ZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGlu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQ D0EbtFpKd71ng+CT516nDOeB0/RSrFOyA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXte JajCq+TA81yc477OMUxkHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMB AAGjggM7MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBraS5n dmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIICIwYKKwYBBAG/VQIB ADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBl AHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIAYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIA YQBsAGkAdABhAHQAIABWAGEAbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQBy AGEAYwBpAPMAbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt +GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= -----END CERTIFICATE----- A-Trust-nQual-03 ================ -----BEGIN CERTIFICATE----- MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy a2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5RdWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5R dWFsLTAzMB4XDTA1MDgxNzIyMDAwMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgw RgYDVQQKDD9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0 ZW52ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMMEEEtVHJ1 c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtPWFuA/OQO8BBC4SA zewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUjlUC5B3ilJfYKvUWG6Nm9wASOhURh73+n yfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPE SU7l0+m0iKsMrmKS1GWH2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4 iHQF63n1k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs2e3V cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40 ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 ahq97BvIxYSazQ== -----END CERTIFICATE----- TWCA Root Certification Authority ================================= -----BEGIN CERTIFICATE----- MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP 4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG 9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== -----END CERTIFICATE----- Security Communication RootCA2 ============================== -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ +T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R 3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk 3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 -----END CERTIFICATE----- EC-ACC ====== -----BEGIN CERTIFICATE----- MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7 MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4 HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw 0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D 5EI= -----END CERTIFICATE----- Hellenic Academic and Research Institutions RootCA 2011 ======================================================= -----BEGIN CERTIFICATE----- MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI 1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa 71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u 8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH 3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD /md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N 7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 -----END CERTIFICATE----- Actalis Authentication Root CA ============================== -----BEGIN CERTIFICATE----- MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8 EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5 jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0 JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC 4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo 2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== -----END CERTIFICATE----- Trustis FPS Root CA =================== -----BEGIN CERTIFICATE----- MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P 8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl iB6XzCGcKQENZetX2fNXlrtIzYE= -----END CERTIFICATE----- StartCom Certification Authority ================================ -----BEGIN CERTIFICATE----- MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 NjM3WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt 2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z 6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT 37uMdBNSSwIDAQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFulF2mHMMo0aEPQ Qa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCCATgwLgYIKwYBBQUHAgEWImh0 dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cu c3RhcnRzc2wuY29tL2ludGVybWVkaWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENv bW1lcmNpYWwgKFN0YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0 aGUgc2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0aWZpY2F0 aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93d3cuc3RhcnRzc2wuY29t L3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBG cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5 fPGFf59Jb2vKXfuM/gTFwWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWm N3PH/UvSTa0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst0OcN Org+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNcpRJvkrKTlMeIFw6T tn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKlCcWw0bdT82AUuoVpaiF8H3VhFyAX e2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVFP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA 2MFrLH9ZXF2RsXAiV+uKa0hK1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBs HvUwyKMQ5bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8= -----END CERTIFICATE----- StartCom Certification Authority G2 =================================== -----BEGIN CERTIFICATE----- MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp dHkgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8O o1XJJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsDvfOpL9HG 4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnooD/Uefyf3lLE3PbfHkffi Aez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/Q0kGi4xDuFby2X8hQxfqp0iVAXV16iul Q5XqFYSdCI0mblWbq9zSOdIxHWDirMxWRST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbs O+wmETRIjfaAKxojAuuKHDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8H vKTlXcxNnw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM0D4L nMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/iUUjXuG+v+E5+M5iS FGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9Ha90OrInwMEePnWjFqmveiJdnxMa z6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHgTuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJ KoZIhvcNAQELBQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K 2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfXUfEpY9Z1zRbk J4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl6/2o1PXWT6RbdejF0mCy2wl+ JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG /+gyRr61M3Z3qAFdlsHB1b6uJcDJHgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTc nIhT76IxW1hPkWLIwpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/Xld blhYXzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5lIxKVCCIc l85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoohdVddLHRDiBYmxOlsGOm 7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulrso8uBtjRkcfGEvRM/TAXw8HaOFvjqerm obp573PYtlNXLfbQ4ddI -----END CERTIFICATE----- Buypass Class 2 Root CA ======================= -----BEGIN CERTIFICATE----- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1 g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn 9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b /+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN rJgWVqA= -----END CERTIFICATE----- Buypass Class 3 Root CA ======================= -----BEGIN CERTIFICATE----- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR 5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh 7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH 2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV /afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz 6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi Cp/HuZc= -----END CERTIFICATE----- T-TeleSec GlobalRoot Class 3 ============================ -----BEGIN CERTIFICATE----- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK 9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W 0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== -----END CERTIFICATE----- EE Certification Centre Root CA =============================== -----BEGIN CERTIFICATE----- MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2 rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw 93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU 3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM dcGWxZ0= -----END CERTIFICATE----- TURKTRUST Certificate Services Provider Root 2007 ================================================= -----BEGIN CERTIFICATE----- MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMCVFIxDzAN BgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4gKGMpIEFyYWzEsWsgMjAwNzCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9N YvDdE3ePYakqtdTyuTFYKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQv KUmi8wUG+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveGHtya KhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6PIzdezKKqdfcYbwnT rqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M733WB2+Y8a+xwXrXgTW4qhe04MsC AwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHkYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/s Px+EnWVUXKgWAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5mxRZNTZPz/OO Xl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsaXRik7r4EW5nVcV9VZWRi1aKb BFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK poRq0Tl9 -----END CERTIFICATE----- D-TRUST Root Class 3 CA 2 2009 ============================== -----BEGIN CERTIFICATE----- MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ 4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm 2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= -----END CERTIFICATE----- D-TRUST Root Class 3 CA 2 EV 2009 ================================= -----BEGIN CERTIFICATE----- MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T 7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v ZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xhc3MlMjAzJTIwQ0El MjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1ERT9jZXJ0aWZpY2F0ZXJldm9jYXRp b25saXN0MEagRKBChkBodHRwOi8vd3d3LmQtdHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xh c3NfM19jYV8yX2V2XzIwMDkuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+ PPoeUSbrh/Yp3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNFCSuGdXzfX2lX ANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7naxpeG0ILD5EJt/rDiZE4OJudA NCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqXKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVv w9y4AyHqnxbxLFS1 -----END CERTIFICATE----- PSCProcert ========== -----BEGIN CERTIFICATE----- MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1dG9yaWRhZCBk ZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9sYW5vMQswCQYDVQQGEwJWRTEQ MA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlzdHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lz dGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBl cmludGVuZGVuY2lhIGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUw IwYJKoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEwMFoXDTIw MTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHByb2NlcnQubmV0LnZlMQ8w DQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGExKjAoBgNVBAsTIVByb3ZlZWRvciBkZSBD ZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZp Y2FjaW9uIEVsZWN0cm9uaWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo97BVC wfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74BCXfgI8Qhd19L3uA 3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38GieU89RLAu9MLmV+QfI4tL3czkkoh RqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9JcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmO EO8GqQKJ/+MMbpfg353bIdD0PghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG2 0qCZyFSTXai20b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH 0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/6mnbVSKVUyqU td+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1mv6JpIzi4mWCZDlZTOpx+FIyw Bm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7K2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvp r2uKGcfLFFb14dq12fy/czja+eevbqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/ AgEBMDcGA1UdEgQwMC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAz Ni0wMB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFDgBStuyId xuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0b3JpZGFkIGRlIENlcnRp ZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xhbm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQH EwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0cml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5h Y2lvbmFsIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5k ZW5jaWEgZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkqhkiG 9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQDAgEGME0GA1UdEQRG MESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0wMDAwMDKgGwYFYIZeAgKgEgwQUklG LUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEagRKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52 ZS9sY3IvQ0VSVElGSUNBRE8tUkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNy YWl6LnN1c2NlcnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsGAQUFBwIBFh5o dHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcNAQELBQADggIBACtZ6yKZu4Sq T96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmN g7+mvTV+LFwxNG9s2/NkAZiqlCxB3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4q uxtxj7mkoP3YldmvWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1 n8GhHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHmpHmJWhSn FFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXzsOfIt+FTvZLm8wyWuevo 5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bEqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq 3TNWOByyrYDT13K9mmyZY+gAu0F2BbdbmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5 poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km -----END CERTIFICATE----- China Internet Network Information Center EV Certificates Root ============================================================== -----BEGIN CERTIFICATE----- MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV BAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyMUcwRQYDVQQDDD5D aGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMg Um9vdDAeFw0xMDA4MzEwNzExMjVaFw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAG A1UECgwpQ2hpbmEgSW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMM PkNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRpZmljYXRl cyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z7r07eKpkQ0H1UN+U8i6y jUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA//DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV 98YPjUesWgbdYavi7NifFy2cyjw1l1VxzUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2H klY0bBoQCxfVWhyXWIQ8hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23 KzhmBsUs4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54ugQEC 7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oYNJKiyoOCWTAPBgNV HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUfHJLOcfA22KlT5uqGDSSosqD glkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3j92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd5 0XPFtQO3WKwMVC/GVhMPMdoG52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM 7+czV0I664zBechNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws ZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrIzo9uoV1/A3U0 5K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATywy39FCqQmbkHzJ8= -----END CERTIFICATE----- Swisscom Root CA 2 ================== -----BEGIN CERTIFICATE----- MIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQG EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2 MjUwNzM4MTRaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIIC IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvErjw0DzpPM LgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r0rk0X2s682Q2zsKwzxNo ysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJ wDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVPACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpH Wrumnf2U5NGKpV+GY3aFy6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1a SgJA/MTAtukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL6yxS NLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0uPoTXGiTOmekl9Ab mbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrALacywlKinh/LTSlDcX3KwFnUey7QY Ypqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velhk6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3 qPyZ7iVNTA6z00yPhOgpD/0QVAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw HQYDVR0hBBYwFDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O BBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqhb97iEoHF8Twu MA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4RfbgZPnm3qKhyN2abGu2sEzsO v2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ 82YqZh6NM4OKb3xuqFp1mrjX2lhIREeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLz o9v/tdhZsnPdTSpxsrpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcs a0vvaGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciATwoCqISxx OQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99nBjx8Oto0QuFmtEYE3saW mA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5Wt6NlUe07qxS/TFED6F+KBZvuim6c779o +sjaC+NCydAXFJy3SuCvkychVSa1ZC+N8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TC rvJcwhbtkj6EPnNgiLx29CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX 5OfNeOI5wSsSnqaeG8XmDtkx2Q== -----END CERTIFICATE----- Swisscom Root EV CA 2 ===================== -----BEGIN CERTIFICATE----- MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy Xhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPHoCE2G3pXKSinLr9xJZDzRINpUKTk4Rti GZQJo/PDvO/0vezbE53PnUgJUmfANykRHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8Li qG12W0OfvrSdsyaGOx9/5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaH Za0zKcQvidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHLOdAG alNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaCNYGu+HuB5ur+rPQa m3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f46Fq9mDU5zXNysRojddxyNMkM3Ox bPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCBUWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDi xzgHcgplwLa7JSnaFp6LNYth7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/ BAQDAgGGMB0GA1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWBbj2ITY1x0kbB bkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6xXCX5145v9Ydkn+0UjrgEjihL j6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98TPLr+flaYC/NUn81ETm484T4VvwYmneTwkLbU wp4wLh/vx3rEUMfqe9pQy3omywC0Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7 XwgiG/W9mR4U9s70WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH 59yLGn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm7JFe3VE/ 23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4Snr8PyQUQ3nqjsTzyP6Wq J3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VNvBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyA HmBR3NdUIR7KYndP+tiPsys6DXhyyWhBWkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/gi uMod89a2GQ+fYWVq6nTIfI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuW l8PVP3wbI+2ksx0WckNLIOFZfsLorSa/ovc= -----END CERTIFICATE----- CA Disig Root R1 ================ -----BEGIN CERTIFICATE----- MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNVBAYTAlNLMRMw EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp ZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQyMDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sx EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp c2lnIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy 3QRkD2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/oOI7bm+V8 u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3AfQ+lekLZWnDZv6fXARz2 m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJeIgpFy4QxTaz+29FHuvlglzmxZcfe+5nk CiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8noc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTa YVKvJrT1cU/J19IG32PK/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6 vpmumwKjrckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD3AjL LhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE7cderVC6xkGbrPAX ZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkCyC2fg69naQanMVXVz0tv/wQFx1is XxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLdqvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNV HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ 04IwDQYJKoZIhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaASfX8MPWbTx9B LxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXoHqJPYNcHKfyyo6SdbhWSVhlM CrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpBemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5Gfb VSUZP/3oNn6z4eGBrxEWi1CXYBmCAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85 YmLLW1AL14FABZyb7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKS ds+xDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ a7+h89n07eLw4+1knj0vllJPgFOL -----END CERTIFICATE----- CA Disig Root R2 ================ -----BEGIN CERTIFICATE----- MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7 A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa 5Beny912H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJQfYE koopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUDi/ZnWejBBhG93c+A Ak9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORsnLMOPReisjQS1n6yqEm70XooQL6i Fh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNV HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5u Qu0wDQYJKoZIhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVV sRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W8 1k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjx mHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01 utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18DrG5gPcFw0 sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3OszMOl6W8KjptlwlCFtaOg UxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3vQCj8KWefshNPZiTEUxnpHikV 7+ZtsH8tZ/3zbBt1RqPlShfppNcL -----END CERTIFICATE----- ACCVRAIZ1 ========= -----BEGIN CERTIFICATE----- MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUNDVlJB SVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAeFw0xMTA1 MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQBgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwH UEtJQUNDVjENMAsGA1UECgwEQUNDVjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQCbqau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gM jmoYHtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWoG2ioPej0 RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpAlHPrzg5XPAOBOp0KoVdD aaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhrIA8wKFSVf+DuzgpmndFALW4ir50awQUZ 0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDG WuzndN9wrqODJerWx5eHk6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs7 8yM2x/474KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMOm3WR 5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpacXpkatcnYGMN285J 9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPluUsXQA+xtrn13k/c4LOsOxFwYIRK Q26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYIKwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRw Oi8vd3d3LmFjY3YuZXMvZmlsZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEu Y3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeTVfZW6oHlNsyM Hj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIGCCsGAQUFBwICMIIBFB6CARAA QQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUAcgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBh AO0AegAgAGQAZQAgAGwAYQAgAEEAQwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUA YwBuAG8AbABvAGcA7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBj AHQAcgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAAQwBQAFMA IABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUAczAwBggrBgEFBQcCARYk aHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2MuaHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0 dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRtaW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2 MV9kZXIuY3JsMA4GA1UdDwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZI hvcNAQEFBQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdpD70E R9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gUJyCpZET/LtZ1qmxN YEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+mAM/EKXMRNt6GGT6d7hmKG9Ww7Y49 nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepDvV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJ TS+xJlsndQAJxGJ3KQhfnlmstn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3 sCPdK6jT2iWH7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szAh1xA2syVP1Xg Nce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xFd3+YJ5oyXSrjhO7FmGYvliAd 3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2HpPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3p EfbRD0tVNEYqi4Y7 -----END CERTIFICATE----- TWCA Global Root CA =================== -----BEGIN CERTIFICATE----- MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcxEjAQBgNVBAoT CVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMTVFdDQSBHbG9iYWwgUm9vdCBD QTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQK EwlUQUlXQU4tQ0ExEDAOBgNVBAsTB1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3Qg Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2C nJfF10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz0ALfUPZV r2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfChMBwqoJimFb3u/Rk28OKR Q4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbHzIh1HrtsBv+baz4X7GGqcXzGHaL3SekV tTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1W KKD+u4ZqyPpcC1jcxkt2yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99 sy2sbZCilaLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYPoA/p yJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M 8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg /eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= -----END CERTIFICATE----- TeliaSonera Root CA v1 ====================== -----BEGIN CERTIFICATE----- MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4 MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwW VGVsaWFTb25lcmEgUm9vdCBDQSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+ 6yfwIaPzaSZVfp3FVRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA 3GV17CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+XZ75Ljo1k B1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+/jXh7VB7qTCNGdMJjmhn Xb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxH oLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkmdtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3 F0fUTPHSiXk+TT2YqGHeOh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJ oWjiUIMusDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4pgd7 gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fsslESl1MpWtTwEhDc TwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQarMCpgKIv7NHfirZ1fpoeDVNAgMB AAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qW DNXr+nuqF+gTEjANBgkqhkiG9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx 0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= -----END CERTIFICATE----- E-Tugra Certification Authority =============================== -----BEGIN CERTIFICATE----- MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e0ypQ BaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcHfC425lAcP9tDJMW/hkd5s3kc91r0 E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsutdEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gz rt48Ue7LE3wBf4QOXVGUnhMMti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAq jqFGOjGY5RH8zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUXU8u3Zg5mTPj5 dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB /wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G C7TbO6Orb1wdtn7os4I07QZcJA== -----END CERTIFICATE----- T-TeleSec GlobalRoot Class 2 ============================ -----BEGIN CERTIFICATE----- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR 3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN 9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== -----END CERTIFICATE----- Atos TrustedRoot 2011 ===================== -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr 54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9 61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G 3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed -----END CERTIFICATE----- QuoVadis Root CA 1 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv b3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJN MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEg RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakE PBtVwedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWerNrwU8lm PNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF34168Xfuw6cwI2H44g4hWf6 Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh4Pw5qlPafX7PGglTvF0FBM+hSo+LdoIN ofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXpUhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/l g6AnhF4EwfWQvTA9xO+oabw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV 7qJZjqlc3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/GKubX 9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSthfbZxbGL0eUQMk1f iyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KOTk0k+17kBL5yG6YnLUlamXrXXAkg t3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOtzCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZI hvcNAQELBQADggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2cDMT/uFPpiN3 GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUNqXsCHKnQO18LwIE6PWThv6ct Tr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP +V04ikkwj+3x6xn0dxoxGE1nVGwvb2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh 3jRJjehZrJ3ydlo28hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fa wx/kNSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNjZgKAvQU6 O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhpq1467HxpvMc7hU6eFbm0 FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV hMJKzRwuJIczYOXD -----END CERTIFICATE----- QuoVadis Root CA 2 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv b3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJN MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIg RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFh ZiFfqq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMWn4rjyduY NM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ymc5GQYaYDFCDy54ejiK2t oIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+O7q414AB+6XrW7PFXmAqMaCvN+ggOp+o MiwMzAkd056OXbxMmO7FGmh77FOm6RQ1o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+l V0POKa2Mq1W/xPtbAd0jIaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZo L1NesNKqIcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz8eQQ sSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43ehvNURG3YBZwjgQQvD 6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l7ZizlWNof/k19N+IxWA1ksB8aRxh lRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALGcC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZI hvcNAQELBQADggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66 AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RCroijQ1h5fq7K pVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0GaW/ZZGYjeVYg3UQt4XAoeo0L9 x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4nlv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgz dWqTHBLmYF5vHX/JHyPLhGGfHoJE+V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6X U/IyAgkwo1jwDQHVcsaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+Nw mNtddbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNgKCLjsZWD zYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeMHVOyToV7BjjHLPj4sHKN JeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4WSr2Rz0ZiC3oheGe7IUIarFsNMkd7Egr O3jtZsSOeWmD3n+M -----END CERTIFICATE----- QuoVadis Root CA 3 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv b3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJN MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMg RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286 IxSR/xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNuFoM7pmRL Mon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXRU7Ox7sWTaYI+FrUoRqHe 6okJ7UO4BUaKhvVZR74bbwEhELn9qdIoyhA5CcoTNs+cra1AdHkrAj80//ogaX3T7mH1urPnMNA3 I4ZyYUUpSFlob3emLoG+B01vr87ERRORFHAGjx+f+IdpsQ7vw4kZ6+ocYfx6bIrc1gMLnia6Et3U VDmrJqMz6nWB2i3ND0/kA9HvFZcba5DFApCTZgIhsUfei5pKgLlVj7WiL8DWM2fafsSntARE60f7 5li59wzweyuxwHApw0BiLTtIadwjPEjrewl5qW3aqDCYz4ByA4imW0aucnl8CAMhZa634RylsSqi Md5mBPfAdOhx3v89WcyWJhKLhZVXGqtrdQtEPREoPHtht+KPZ0/l7DxMYIBpVzgeAVuNVejH38DM dyM0SXV89pgR6y3e7UEuFAUCf+D+IOs15xGsIs5XPd7JMG0QA4XN8f+MFrXBsj6IbGB/kE+V9/Yt rQE5BwT6dYB9v0lQ7e/JxHwc64B+27bQ3RP+ydOc17KXqQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZI hvcNAQELBQADggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnIFUBhynLWcKzS t/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5WvvoxXqA/4Ti2Tk08HS6IT7SdEQ TXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFgu/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9Du DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX 0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 PpxxVJkES/1Y+Zj0 -----END CERTIFICATE----- DigiCert Assured ID Root G2 =========================== -----BEGIN CERTIFICATE----- MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH 35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv 0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo IhNzbM8m9Yop5w== -----END CERTIFICATE----- DigiCert Assured ID Root G3 =========================== -----BEGIN CERTIFICATE----- MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy 1vUhZscv6pZjamVFkpUBtA== -----END CERTIFICATE----- DigiCert Global Root G2 ======================= -----BEGIN CERTIFICATE----- MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO 3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu 5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl MrY= -----END CERTIFICATE----- DigiCert Global Root G3 ======================= -----BEGIN CERTIFICATE----- MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYD VQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAw MDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5k aWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0C AQYFK4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FGfp4tn+6O YwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPOZ9wj/wMco+I+o0IwQDAP BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNp Yim8S8YwCgYIKoZIzj0EAwMDaAAwZQIxAK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y 3maTD/HMsQmP3Wyr+mt/oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34 VOKa5Vt8sycX -----END CERTIFICATE----- DigiCert Trusted Root G4 ======================== -----BEGIN CERTIFICATE----- MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBiMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEw HwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 MTIwMDAwWjBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0G CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3yithZwuEp pz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1Ifxp4VpX6+n6lXFllVcq9o k3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDVySAdYyktzuxeTsiT+CFhmzTrBcZe7Fsa vOvJz82sNEBfsXpm7nfISKhmV1efVFiODCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGY QJB5w3jHtrHEtWoYOAMQjdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6 MUSaM0C/CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCiEhtm mnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADMfRyVw4/3IbKyEbe7 f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QYuKZ3AeEPlAwhHbJUKSWJbOUOUlFH dL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXKchYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8 oR7FwI+isX4KJpn15GkvmB0t9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud DwEB/wQEAwIBhjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2SV1EY+CtnJYY ZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd+SeuMIW59mdNOj6PWTkiU0Tr yF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWcfFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy 7zBZLq7gcfJW5GqXb5JQbZaNaHqasjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iah ixTXTBmyUEFxPT9NcCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN 5r5N0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie4u1Ki7wb /UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mIr/OSmbaz5mEP0oUA51Aa 5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tK G48BtieVU+i2iW1bvGjUI+iLUaJW+fCmgKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP 82Z+ -----END CERTIFICATE----- WoSign ====== -----BEGIN CERTIFICATE----- MIIFdjCCA16gAwIBAgIQXmjWEXGUY1BWAGjzPsnFkTANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQG EwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxKjAoBgNVBAMTIUNlcnRpZmljYXRpb24g QXV0aG9yaXR5IG9mIFdvU2lnbjAeFw0wOTA4MDgwMTAwMDFaFw0zOTA4MDgwMTAwMDFaMFUxCzAJ BgNVBAYTAkNOMRowGAYDVQQKExFXb1NpZ24gQ0EgTGltaXRlZDEqMCgGA1UEAxMhQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkgb2YgV29TaWduMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA vcqNrLiRFVaXe2tcesLea9mhsMMQI/qnobLMMfo+2aYpbxY94Gv4uEBf2zmoAHqLoE1UfcIiePyO CbiohdfMlZdLdNiefvAA5A6JrkkoRBoQmTIPJYhTpA2zDxIIFgsDcSccf+Hb0v1naMQFXQoOXXDX 2JegvFNBmpGN9J42Znp+VsGQX+axaCA2pIwkLCxHC1l2ZjC1vt7tj/id07sBMOby8w7gLJKA84X5 KIq0VC6a7fd2/BVoFutKbOsuEo/Uz/4Mx1wdC34FMr5esAkqQtXJTpCzWQ27en7N1QhatH/YHGkR +ScPewavVIMYe+HdVHpRaG53/Ma/UkpmRqGyZxq7o093oL5d//xWC0Nyd5DKnvnyOfUNqfTq1+ez EC8wQjchzDBwyYaYD8xYTYO7feUapTeNtqwylwA6Y3EkHp43xP901DfA4v6IRmAR3Qg/UDaruHqk lWJqbrDKaiFaafPz+x1wOZXzp26mgYmhiMU7ccqjUu6Du/2gd/Tkb+dC221KmYo0SLwX3OSACCK2 8jHAPwQ+658geda4BmRkAjHXqc1S+4RFaQkAKtxVi8QGRkvASh0JWzko/amrzgD5LkhLJuYwTKVY yrREgk/nkR4zw7CT/xH8gdLKH3Ep3XZPkiWvHYG3Dy+MwwbMLyejSuQOmbp8HkUff6oZRZb9/D0C AwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFOFmzw7R 8bNLtwYgFP6HEtX2/vs+MA0GCSqGSIb3DQEBBQUAA4ICAQCoy3JAsnbBfnv8rWTjMnvMPLZdRtP1 LOJwXcgu2AZ9mNELIaCJWSQBnfmvCX0KI4I01fx8cpm5o9dU9OpScA7F9dY74ToJMuYhOZO9sxXq T2r09Ys/L3yNWC7F4TmgPsc9SnOeQHrAK2GpZ8nzJLmzbVUsWh2eJXLOC62qx1ViC777Y7NhRCOj y+EaDveaBk3e1CNOIZZbOVtXHS9dCF4Jef98l7VNg64N1uajeeAz0JmWAjCnPv/So0M/BVoG6kQC 2nz4SNAzqfkHx5Xh9T71XXG68pWpdIhhWeO/yloTunK0jF02h+mmxTwTv97QRCbut+wucPrXnbes 5cVAWubXbHssw1abR80LzvobtCHXt2a49CUwi1wNuepnsvRtrtWhnk/Yn+knArAdBtaP4/tIEp9/ EaEQPkxROpaw0RPxx9gmrjrKkcRpnd8BKWRRb2jaFOwIQZeQjdCygPLPwj2/kWjFgGcexGATVdVh mVd8upUPYUk6ynW8yQqTP2cOEvIo4jEbwFcW3wh8GcF+Dx+FHgo2fFt+J7x6v+Db9NpSvd4MVHAx kUOVyLzwPt0JfjBkUO1/AaQzZ01oT74V77D2AhGiGxMlOtzCWfHjXEa7ZywCRuoeSKbmW9m1vFGi kpbbqsY3Iqb+zCB0oy2pLmvLwIIRIbWTee5Ehr7XHuQe+w== -----END CERTIFICATE----- WoSign China ============ -----BEGIN CERTIFICATE----- MIIFWDCCA0CgAwIBAgIQUHBrzdgT/BtOOzNy0hFIjTANBgkqhkiG9w0BAQsFADBGMQswCQYDVQQG EwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxGzAZBgNVBAMMEkNBIOayg+mAmuagueiv geS5pjAeFw0wOTA4MDgwMTAwMDFaFw0zOTA4MDgwMTAwMDFaMEYxCzAJBgNVBAYTAkNOMRowGAYD VQQKExFXb1NpZ24gQ0EgTGltaXRlZDEbMBkGA1UEAwwSQ0Eg5rKD6YCa5qC56K+B5LmmMIICIjAN BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0EkhHiX8h8EqwqzbdoYGTufQdDTc7WU1/FDWiD+k 8H/rD195L4mx/bxjWDeTmzj4t1up+thxx7S8gJeNbEvxUNUqKaqoGXqW5pWOdO2XCld19AXbbQs5 uQF/qvbW2mzmBeCkTVL829B0txGMe41P/4eDrv8FAxNXUDf+jJZSEExfv5RxadmWPgxDT74wwJ85 dE8GRV2j1lY5aAfMh09Qd5Nx2UQIsYo06Yms25tO4dnkUkWMLhQfkWsZHWgpLFbE4h4TV2TwYeO5 Ed+w4VegG63XX9Gv2ystP9Bojg/qnw+LNVgbExz03jWhCl3W6t8Sb8D7aQdGctyB9gQjF+BNdeFy b7Ao65vh4YOhn0pdr8yb+gIgthhid5E7o9Vlrdx8kHccREGkSovrlXLp9glk3Kgtn3R46MGiCWOc 76DbT52VqyBPt7D3h1ymoOQ3OMdc4zUPLK2jgKLsLl3Az+2LBcLmc272idX10kaO6m1jGx6KyX2m +Jzr5dVjhU1zZmkR/sgO9MHHZklTfuQZa/HpelmjbX7FF+Ynxu8b22/8DU0GAbQOXDBGVWCvOGU6 yke6rCzMRh+yRpY/8+0mBe53oWprfi1tWFxK1I5nuPHa1UaKJ/kR8slC/k7e3x9cxKSGhxYzoacX GKUN5AXlK8IrC6KVkLn9YDxOiT7nnO4fuwECAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFOBNv9ybQV0T6GTwp+kVpOGBwboxMA0GCSqGSIb3DQEBCwUA A4ICAQBqinA4WbbaixjIvirTthnVZil6Xc1bL3McJk6jfW+rtylNpumlEYOnOXOvEESS5iVdT2H6 yAa+Tkvv/vMx/sZ8cApBWNromUuWyXi8mHwCKe0JgOYKOoICKuLJL8hWGSbueBwj/feTZU7n85iY r83d2Z5AiDEoOqsuC7CsDCT6eiaY8xJhEPRdF/d+4niXVOKM6Cm6jBAyvd0zaziGfjk9DgNyp115 j0WKWa5bIW4xRtVZjc8VX90xJc/bYNaBRHIpAlf2ltTW/+op2znFuCyKGo3Oy+dCMYYFaA6eFN0A kLppRQjbbpCBhqcqBT/mhDn4t/lXX0ykeVoQDF7Va/81XwVRHmyjdanPUIPTfPRm94KNPQx96N97 qA4bLJyuQHCH2u2nFoJavjVsIE4iYdm8UXrNemHcSxH5/mc0zy4EZmFcV5cjjPOGG0jfKq+nwf/Y jj4Du9gqsPoUJbJRa4ZDhS4HIxaAjUz7tGM7zMN07RujHv41D198HRaG9Q7DlfEvr10lO1Hm13ZB ONFLAzkopR6RctR9q5czxNM+4Gm2KHmgCY0c0f9BckgG/Jou5yD5m6Leie2uPAmvylezkolwQOQv T8Jwg0DXJCxr5wkf09XHwQj02w47HAcLQxGEIYbpgNR12KvxAmLBsX5VYc8T1yaw15zLKYs4SgsO kI26oQ== -----END CERTIFICATE----- COMODO RSA Certification Authority ================================== -----BEGIN CERTIFICATE----- MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwHhcNMTAwMTE5MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMC R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR6FSS0gpWsawNJN3Fz0Rn dJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8Xpz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZ FGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+ 5eNu/Nio5JIk2kNrYrhV/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pG x8cgoLEfZd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z+pUX 2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7wqP/0uK3pN/u6uPQL OvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZahSL0896+1DSJMwBGB7FY79tOi4lu3 sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVICu9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+C GCe01a60y1Dma/RMhnEw6abfFobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5 WdYgGq/yapiqcrxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w DQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvlwFTPoCWOAvn9sKIN9SCYPBMt rFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+ nq6PK7o9mfjYcwlYRm6mnPTXJ9OV2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSg tZx8jb8uk2IntznaFxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwW sRqZCuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52 7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I LaZRfyHBNVOFBkpdn627G190 -----END CERTIFICATE----- USERTrust RSA Certification Authority ===================================== -----BEGIN CERTIFICATE----- MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UE BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCAEmUXNg7D2wiz 0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2j Y0K2dvKpOyuR+OJv0OwWIJAJPuLodMkYtJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFn RghRy4YUVD+8M/5+bJz/Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O +T23LLb2VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT79uq /nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6c0Plfg6lZrEpfDKE Y1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmTYo61Zs8liM2EuLE/pDkP2QKe6xJM lXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97lc6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8 yexDJtC/QV9AqURE9JnnV4eeUB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+ eLf8ZxXhyVeEHg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF MAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPFUp/L+M+ZBn8b2kMVn54CVVeW FPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KOVWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ 7l8wXEskEVX/JJpuXior7gtNn3/3ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQ Eg9zKC7F4iRO/Fjs8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM 8WcRiQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYzeSf7dNXGi FSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 -----END CERTIFICATE----- USERTrust ECC Certification Authority ===================================== -----BEGIN CERTIFICATE----- MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqfloI+d61SRvU8Za2EurxtW2 0eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinngo4N+LZfQYcTxmdwlkWOrfzCjtHDix6Ez nPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0GA1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNV HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBB HU6+4WMBzzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbWRNZu 9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= -----END CERTIFICATE----- GlobalSign ECC Root CA - R4 =========================== -----BEGIN CERTIFICATE----- MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprl OQcJFspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAwDgYDVR0P AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61FuOJAf/sKbvu+M8k8o4TV MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q= -----END CERTIFICATE----- GlobalSign ECC Root CA - R5 =========================== -----BEGIN CERTIFICATE----- MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 -----END CERTIFICATE----- Staat der Nederlanden Root CA - G3 ================================== -----BEGIN CERTIFICATE----- MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g Um9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMC TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4y olQPcPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WWIkYFsO2t x1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqXxz8ecAgwoNzFs21v0IJy EavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFyKJLZWyNtZrVtB0LrpjPOktvA9mxjeM3K Tj215VKb8b475lRgsGYeCasH/lSJEULR9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk7O53vDxk5hUUur mkVLoR9BvUhTFXFkC4az5S6+zqQbwSmEorXLCCN2QyIkHxcE1G6cxvx/K2Ya7Irl1s9N9WMJtxU5 1nus6+N86U78dULI7ViVDAZCopz35HCz33JvWjdAidiFpNfxC95DGdRKWCyMijmev4SH8RY7Ngzp 07TKbBlBUgmhHbBqv4LvcFEhMtwFdozL92TkA1CvjJFnq8Xy7ljY3r735zHPbMk7ccHViLVlvMDo FxcHErVc0qsgk7TmgoNwNsXNo42ti+yjwUOH5kPiNL6VizXtBznaqB16nzaeErAMZRKQFWDZJkBE 41ZgpRDUajz9QdwOWke275dhdU/Z/seyHdTtXUmzqWrLZoQT1Vyg3N9udwbRcXXIV2+vD3dbAgMB AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRUrfrHkleu yjWcLhL75LpdINyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwpLiniyMMB8jPq KqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8Ipf3YF3qKS9Ysr1YvY2WTxB1 v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixpgZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA 8KCWAg8zxXHzniN9lLf9OtMJgwYh/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b 8KKaa8MFSu1BYBQw0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0r mj1AfsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq4BZ+Extq 1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk= -----END CERTIFICATE----- Staat der Nederlanden EV Root CA ================================ -----BEGIN CERTIFICATE----- MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3dZ//BYY1jTw+bbRcwJu+r 0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46prfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8 Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13lpJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gV XJrm0w912fxBmJc+qiXbj5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr 08C+eKxCKFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS/ZbV 0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0XcgOPvZuM5l5Tnrmd 74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH1vI4gnPah1vlPNOePqc7nvQDs/nx fRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrPpx9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwa ivsnuL8wbqg7MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u2dfOWBfoqSmu c0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHSv4ilf0X8rLiltTMMgsT7B/Zq 5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLldRqAN b/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tN f1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi 5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== -----END CERTIFICATE----- IdenTrust Commercial Root CA 1 ============================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/ mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gpS0l4PJNgiCL8mdo2yMKi 1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1bVoE/c40yiTcdCMbXTMTEl3EASX2MN0C XZ/g1Ue9tOsbobtJSdifWwLziuQkkORiT0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl 3ZBWzvurpWCdxJ35UrCLvYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzy NeVJSQjKVsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZKdHzV WYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHTc+XvvqDtMwt0viAg xGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hvl7yTmvmcEpB4eoCHFddydJxVdHix uuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5NiGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZI hvcNAQELBQADggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH 6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwtLRvM7Kqas6pg ghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93nAbowacYXVKV7cndJZ5t+qnt ozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmV YjzlVYA211QC//G5Xc7UI2/YRYRKW2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUX feu+h1sXIFRRk0pTAwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe 2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R cGzM7vRX+Bi6hG6H -----END CERTIFICATE----- IdenTrust Public Sector Root CA 1 ================================= -----BEGIN CERTIFICATE----- MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3Rv ciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJV UzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBS b290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTy P4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGyRBb06tD6 Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlSbdsHyo+1W/CD80/HLaXI rcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF/YTLNiCBWS2ab21ISGHKTN9T0a9SvESf qy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoS mJxZZoY+rfGwyj4GD3vwEUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFn ol57plzy9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9VGxyh LrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ2fjXctscvG29ZV/v iDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsVWaFHVCkugyhfHMKiq3IXAAaOReyL 4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gDW/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8B Af8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMw DQYJKoZIhvcNAQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHVDRDtfULAj+7A mgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9TaDKQGXSc3z1i9kKlT/YPyNt GtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8GlwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFt m6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMx NRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4 Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJtshquDDI ajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhAGaQdp/lLQzfcaFpPz+vC ZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ 3Wl9af0AVqW3rLatt8o+Ae+c -----END CERTIFICATE----- Entrust Root Certification Authority - G2 ========================================= -----BEGIN CERTIFICATE----- MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIw HhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoT DUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMx OTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25s eTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwggEi MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP /vaCeb9zYQYKpSfYs1/TRU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXz HHfV1IWNcCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hWwcKU s/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1U1+cPvQXLOZprE4y TGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0jaWvYkxN4FisZDQSA/i2jZRjJKRx AgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ6 0B7vfec7aVHUbI2fkBJmqzANBgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5Z iXMRrEPR9RP/jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDgi nWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+ vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO e4pIb4tF9g== -----END CERTIFICATE----- Entrust Root Certification Authority - EC1 ========================================== -----BEGIN CERTIFICATE----- MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs LXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQg dXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt IEVDMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHy AsWfoPZb1YsGGYZPUxBtByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef 9eNi1KlHBz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE FLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVCR98crlOZF7ZvHH3h vxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nXhTcGtXsI/esni0qU+eH6p44mCOh8 kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G -----END CERTIFICATE----- CFCA EV ROOT ============ -----BEGIN CERTIFICATE----- MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJDTjEwMC4GA1UE CgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNB IEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkxMjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEw MC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQD DAxDRkNBIEVWIFJPT1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnV BU03sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpLTIpTUnrD 7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5/ZOkVIBMUtRSqy5J35DN uF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp7hZZLDRJGqgG16iI0gNyejLi6mhNbiyW ZXvKWfry4t3uMCz7zEasxGPrb382KzRzEpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7 xzbh72fROdOXW3NiGUgthxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9f py25IGvPa931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqotaK8K gWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNgTnYGmE69g60dWIol hdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfVPKPtl8MeNPo4+QgO48BdK4PRVmrJ tqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hvcWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAf BgNVHSMEGDAWgBTj/i39KNALtbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB /wQEAwIBBjAdBgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObTej/tUxPQ4i9q ecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdLjOztUmCypAbqTuv0axn96/Ua 4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBSESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sG E5uPhnEFtC+NiWYzKXZUmhH4J/qyP5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfX BDrDMlI1Dlb4pd19xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjn aH9dCi77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN5mydLIhy PDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su -----END CERTIFICATE----- PK���\}��eVV*libraries/joomla/http/transport/socket.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage HTTP * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * HTTP transport class for using sockets directly. * * @since 11.3 */ class JHttpTransportSocket implements JHttpTransport { /** * @var array Reusable socket connections. * @since 11.3 */ protected $connections; /** * @var Registry The client options. * @since 11.3 */ protected $options; /** * Constructor. * * @param Registry $options Client options object. * * @since 11.3 * @throws RuntimeException */ public function __construct(Registry $options) { if (!self::isSupported()) { throw new RuntimeException('Cannot use a socket transport when fsockopen() is not available.'); } $this->options = $options; } /** * Send a request to the server and return a JHttpResponse object with the response. * * @param string $method The HTTP method for sending the request. * @param JUri $uri The URI to the resource to request. * @param mixed $data Either an associative array or a string to be sent with the request. * @param array $headers An array of request headers to send with the request. * @param integer $timeout Read timeout in seconds. * @param string $userAgent The optional user agent string to send with the request. * * @return JHttpResponse * * @since 11.3 * @throws RuntimeException */ public function request($method, JUri $uri, $data = null, array $headers = null, $timeout = null, $userAgent = null) { $connection = $this->connect($uri, $timeout); // Make sure the connection is alive and valid. if (is_resource($connection)) { // Make sure the connection has not timed out. $meta = stream_get_meta_data($connection); if ($meta['timed_out']) { throw new RuntimeException('Server connection timed out.'); } } else { throw new RuntimeException('Not connected to server.'); } // Get the request path from the URI object. $path = $uri->toString(array('path', 'query')); // If we have data to send make sure our request is setup for it. if (!empty($data)) { // If the data is not a scalar value encode it to be sent with the request. if (!is_scalar($data)) { $data = http_build_query($data); } if (!isset($headers['Content-Type'])) { $headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'; } // Add the relevant headers. $headers['Content-Length'] = strlen($data); } // Build the request payload. $request = array(); $request[] = strtoupper($method) . ' ' . ((empty($path)) ? '/' : $path) . ' HTTP/1.0'; $request[] = 'Host: ' . $uri->getHost(); // If an explicit user agent is given use it. if (isset($userAgent)) { $headers['User-Agent'] = $userAgent; } // If there are custom headers to send add them to the request payload. if (is_array($headers)) { foreach ($headers as $k => $v) { $request[] = $k . ': ' . $v; } } // If we have data to send add it to the request payload. if (!empty($data)) { $request[] = null; $request[] = $data; } // Send the request to the server. fwrite($connection, implode("\r\n", $request) . "\r\n\r\n"); // Get the response data from the server. $content = ''; while (!feof($connection)) { $content .= fgets($connection, 4096); } $content = $this->getResponse($content); // Follow Http redirects if ($content->code >= 301 && $content->code < 400 && isset($content->headers['Location'])) { return $this->request($method, new JUri($content->headers['Location']), $data, $headers, $timeout, $userAgent); } return $content; } /** * Method to get a response object from a server response. * * @param string $content The complete server response, including headers. * * @return JHttpResponse * * @since 11.3 * @throws UnexpectedValueException */ protected function getResponse($content) { // Create the response object. $return = new JHttpResponse; if (empty($content)) { throw new UnexpectedValueException('No content in response.'); } // Split the response into headers and body. $response = explode("\r\n\r\n", $content, 2); // Get the response headers as an array. $headers = explode("\r\n", $response[0]); // Set the body for the response. $return->body = empty($response[1]) ? '' : $response[1]; // Get the response code from the first offset of the response headers. preg_match('/[0-9]{3}/', array_shift($headers), $matches); $code = $matches[0]; if (is_numeric($code)) { $return->code = (int) $code; } // No valid response code was detected. else { throw new UnexpectedValueException('No HTTP response code found.'); } // Add the response headers to the response object. foreach ($headers as $header) { $pos = strpos($header, ':'); $return->headers[trim(substr($header, 0, $pos))] = trim(substr($header, ($pos + 1))); } return $return; } /** * Method to connect to a server and get the resource. * * @param JUri $uri The URI to connect with. * @param integer $timeout Read timeout in seconds. * * @return resource Socket connection resource. * * @since 11.3 * @throws RuntimeException */ protected function connect(JUri $uri, $timeout = null) { $errno = null; $err = null; // Get the host from the uri. $host = ($uri->isSsl()) ? 'ssl://' . $uri->getHost() : $uri->getHost(); // If the port is not explicitly set in the URI detect it. if (!$uri->getPort()) { $port = ($uri->getScheme() == 'https') ? 443 : 80; } // Use the set port. else { $port = $uri->getPort(); } // Build the connection key for resource memory caching. $key = md5($host . $port); // If the connection already exists, use it. if (!empty($this->connections[$key]) && is_resource($this->connections[$key])) { // Connection reached EOF, cannot be used anymore $meta = stream_get_meta_data($this->connections[$key]); if ($meta['eof']) { if (!fclose($this->connections[$key])) { throw new RuntimeException('Cannot close connection'); } } // Make sure the connection has not timed out. elseif (!$meta['timed_out']) { return $this->connections[$key]; } } if (!is_numeric($timeout)) { $timeout = ini_get('default_socket_timeout'); } // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); // PHP sends a warning if the uri does not exists; we silence it and throw an exception instead. // Attempt to connect to the server $connection = @fsockopen($host, $port, $errno, $err, $timeout); if (!$connection) { if (!$php_errormsg) { // Error but nothing from php? Create our own $php_errormsg = sprintf('Could not connect to resource: %s', $uri, $err, $errno); } // Restore error tracking to give control to the exception handler ini_set('track_errors', $track_errors); throw new RuntimeException($php_errormsg); } // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); // Since the connection was successful let's store it in case we need to use it later. $this->connections[$key] = $connection; // If an explicit timeout is set, set it. if (isset($timeout)) { stream_set_timeout($this->connections[$key], (int) $timeout); } return $this->connections[$key]; } /** * Method to check if http transport socket available for use * * @return boolean True if available else false * * @since 12.1 */ public static function isSupported() { return function_exists('fsockopen') && is_callable('fsockopen'); } } PK���\�ԓ``*libraries/joomla/http/transport/stream.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage HTTP * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * HTTP transport class for using PHP streams. * * @since 11.3 */ class JHttpTransportStream implements JHttpTransport { /** * @var Registry The client options. * @since 11.3 */ protected $options; /** * Constructor. * * @param Registry $options Client options object. * * @since 11.3 * @throws RuntimeException */ public function __construct(Registry $options) { // Verify that URLs can be used with fopen(); if (!ini_get('allow_url_fopen')) { throw new RuntimeException('Cannot use a stream transport when "allow_url_fopen" is disabled.'); } // Verify that fopen() is available. if (!self::isSupported()) { throw new RuntimeException('Cannot use a stream transport when fopen() is not available or "allow_url_fopen" is disabled.'); } $this->options = $options; } /** * Send a request to the server and return a JHttpResponse object with the response. * * @param string $method The HTTP method for sending the request. * @param JUri $uri The URI to the resource to request. * @param mixed $data Either an associative array or a string to be sent with the request. * @param array $headers An array of request headers to send with the request. * @param integer $timeout Read timeout in seconds. * @param string $userAgent The optional user agent string to send with the request. * * @return JHttpResponse * * @since 11.3 * @throws RuntimeException */ public function request($method, JUri $uri, $data = null, array $headers = null, $timeout = null, $userAgent = null) { // Create the stream context options array with the required method offset. $options = array('method' => strtoupper($method)); // If data exists let's encode it and make sure our Content-Type header is set. if (isset($data)) { // If the data is a scalar value simply add it to the stream context options. if (is_scalar($data)) { $options['content'] = $data; } // Otherwise we need to encode the value first. else { $options['content'] = http_build_query($data); } if (!isset($headers['Content-Type'])) { $headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'; } // Add the relevant headers. $headers['Content-Length'] = strlen($options['content']); } // Build the headers string for the request. $headerString = null; if (isset($headers)) { foreach ($headers as $key => $value) { $headerString .= $key . ': ' . $value . "\r\n"; } // Add the headers string into the stream context options array. $options['header'] = trim($headerString, "\r\n"); } // If an explicit timeout is given user it. if (isset($timeout)) { $options['timeout'] = (int) $timeout; } // If an explicit user agent is given use it. if (isset($userAgent)) { $options['user_agent'] = $userAgent; } // Ignore HTTP errors so that we can capture them. $options['ignore_errors'] = 1; // Follow redirects. $options['follow_location'] = (int) $this->options->get('follow_location', 1); // Create the stream context for the request. $context = stream_context_create( array( 'http' => $options, 'ssl' => array( 'verify_peer' => true, 'cafile' => __DIR__ . '/cacert.pem', 'verify_depth' => 5, ) ) ); // Capture PHP errors $php_errormsg = ''; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); // Open the stream for reading. $stream = @fopen((string) $uri, 'r', false, $context); if (!$stream) { if (!$php_errormsg) { // Error but nothing from php? Create our own $php_errormsg = sprintf('Could not connect to resource: %s', $uri, $err, $errno); } // Restore error tracking to give control to the exception handler ini_set('track_errors', $track_errors); throw new RuntimeException($php_errormsg); } // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); // Get the metadata for the stream, including response headers. $metadata = stream_get_meta_data($stream); // Get the contents from the stream. $content = stream_get_contents($stream); // Close the stream. fclose($stream); if (isset($metadata['wrapper_data']['headers'])) { $headers = $metadata['wrapper_data']['headers']; } elseif (isset($metadata['wrapper_data'])) { $headers = $metadata['wrapper_data']; } else { $headers = array(); } return $this->getResponse($headers, $content); } /** * Method to get a response object from a server response. * * @param array $headers The response headers as an array. * @param string $body The response body as a string. * * @return JHttpResponse * * @since 11.3 * @throws UnexpectedValueException */ protected function getResponse(array $headers, $body) { // Create the response object. $return = new JHttpResponse; // Set the body for the response. $return->body = $body; // Get the response code from the first offset of the response headers. preg_match('/[0-9]{3}/', array_shift($headers), $matches); $code = $matches[0]; if (is_numeric($code)) { $return->code = (int) $code; } // No valid response code was detected. else { throw new UnexpectedValueException('No HTTP response code found.'); } // Add the response headers to the response object. foreach ($headers as $header) { $pos = strpos($header, ':'); $return->headers[trim(substr($header, 0, $pos))] = trim(substr($header, ($pos + 1))); } return $return; } /** * Method to check if http transport stream available for use * * @return bool true if available else false * * @since 12.1 */ public static function isSupported() { return function_exists('fopen') && is_callable('fopen') && ini_get('allow_url_fopen'); } } PK���\�Ҽ��(libraries/joomla/http/transport/curl.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage HTTP * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * HTTP transport class for using cURL. * * @since 11.3 */ class JHttpTransportCurl implements JHttpTransport { /** * @var Registry The client options. * @since 11.3 */ protected $options; /** * Constructor. CURLOPT_FOLLOWLOCATION must be disabled when open_basedir or safe_mode are enabled. * * @param Registry $options Client options object. * * @see http://www.php.net/manual/en/function.curl-setopt.php * @since 11.3 * @throws RuntimeException */ public function __construct(Registry $options) { if (!function_exists('curl_init') || !is_callable('curl_init')) { throw new RuntimeException('Cannot use a cURL transport when curl_init() is not available.'); } $this->options = $options; } /** * Send a request to the server and return a JHttpResponse object with the response. * * @param string $method The HTTP method for sending the request. * @param JUri $uri The URI to the resource to request. * @param mixed $data Either an associative array or a string to be sent with the request. * @param array $headers An array of request headers to send with the request. * @param integer $timeout Read timeout in seconds. * @param string $userAgent The optional user agent string to send with the request. * * @return JHttpResponse * * @since 11.3 * @throws RuntimeException */ public function request($method, JUri $uri, $data = null, array $headers = null, $timeout = null, $userAgent = null) { // Setup the cURL handle. $ch = curl_init(); // Set the request method. switch (strtoupper($method)) { case 'GET': $options[CURLOPT_HTTPGET] = true; break; case 'POST': $options[CURLOPT_POST] = true; break; case 'PUT': default: $options[CURLOPT_CUSTOMREQUEST] = strtoupper($method); break; } // Don't wait for body when $method is HEAD $options[CURLOPT_NOBODY] = ($method === 'HEAD'); // Initialize the certificate store $options[CURLOPT_CAINFO] = $this->options->get('curl.certpath', __DIR__ . '/cacert.pem'); // If data exists let's encode it and make sure our Content-type header is set. if (isset($data)) { // If the data is a scalar value simply add it to the cURL post fields. if (is_scalar($data) || (isset($headers['Content-Type']) && strpos($headers['Content-Type'], 'multipart/form-data') === 0)) { $options[CURLOPT_POSTFIELDS] = $data; } // Otherwise we need to encode the value first. else { $options[CURLOPT_POSTFIELDS] = http_build_query($data); } if (!isset($headers['Content-Type'])) { $headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'; } // Add the relevant headers. if (is_scalar($options[CURLOPT_POSTFIELDS])) { $headers['Content-Length'] = strlen($options[CURLOPT_POSTFIELDS]); } } // Build the headers string for the request. $headerArray = array(); if (isset($headers)) { foreach ($headers as $key => $value) { $headerArray[] = $key . ': ' . $value; } // Add the headers string into the stream context options array. $options[CURLOPT_HTTPHEADER] = $headerArray; } // If an explicit timeout is given user it. if (isset($timeout)) { $options[CURLOPT_TIMEOUT] = (int) $timeout; $options[CURLOPT_CONNECTTIMEOUT] = (int) $timeout; } // If an explicit user agent is given use it. if (isset($userAgent)) { $options[CURLOPT_USERAGENT] = $userAgent; } // Set the request URL. $options[CURLOPT_URL] = (string) $uri; // We want our headers. :-) $options[CURLOPT_HEADER] = true; // Return it... echoing it would be tacky. $options[CURLOPT_RETURNTRANSFER] = true; // Override the Expect header to prevent cURL from confusing itself in its own stupidity. // Link: http://the-stickman.com/web-development/php-and-curl-disabling-100-continue-header/ $options[CURLOPT_HTTPHEADER][] = 'Expect:'; /* * Follow redirects if server config allows * @deprecated safe_mode is removed in PHP 5.4, check will be dropped when PHP 5.3 support is dropped */ if (!ini_get('safe_mode') && !ini_get('open_basedir')) { $options[CURLOPT_FOLLOWLOCATION] = (bool) $this->options->get('follow_location', true); } // Proxy configuration $config = JFactory::getConfig(); if ($config->get('proxy_enable')) { $options[CURLOPT_PROXY] = $config->get('proxy_host') . ':' . $config->get('proxy_port'); if ($user = $config->get('proxy_user')) { $options[CURLOPT_PROXYUSERPWD] = $user . ':' . $config->get('proxy_pass'); } } // Set the cURL options. curl_setopt_array($ch, $options); // Execute the request and close the connection. $content = curl_exec($ch); // Check if the content is a string. If it is not, it must be an error. if (!is_string($content)) { $message = curl_error($ch); if (empty($message)) { // Error but nothing from cURL? Create our own $message = 'No HTTP response received'; } throw new RuntimeException($message); } // Get the request information. $info = curl_getinfo($ch); // Close the connection. curl_close($ch); return $this->getResponse($content, $info); } /** * Method to get a response object from a server response. * * @param string $content The complete server response, including headers * as a string if the response has no errors. * @param array $info The cURL request information. * * @return JHttpResponse * * @since 11.3 * @throws UnexpectedValueException */ protected function getResponse($content, $info) { // Create the response object. $return = new JHttpResponse; // Get the number of redirects that occurred. $redirects = isset($info['redirect_count']) ? $info['redirect_count'] : 0; /* * Split the response into headers and body. If cURL encountered redirects, the headers for the redirected requests will * also be included. So we split the response into header + body + the number of redirects and only use the last two * sections which should be the last set of headers and the actual body. */ $response = explode("\r\n\r\n", $content, 2 + $redirects); // Set the body for the response. $return->body = array_pop($response); // Get the last set of response headers as an array. $headers = explode("\r\n", array_pop($response)); // Get the response code from the first offset of the response headers. preg_match('/[0-9]{3}/', array_shift($headers), $matches); $code = count($matches) ? $matches[0] : null; if (is_numeric($code)) { $return->code = (int) $code; } // No valid response code was detected. else { throw new UnexpectedValueException('No HTTP response code found.'); } // Add the response headers to the response object. foreach ($headers as $header) { $pos = strpos($header, ':'); $return->headers[trim(substr($header, 0, $pos))] = trim(substr($header, ($pos + 1))); } return $return; } /** * Method to check if HTTP transport cURL is available for use * * @return boolean true if available, else false * * @since 12.1 */ public static function isSupported() { return function_exists('curl_version') && curl_version(); } } PK���\/�l���#libraries/joomla/http/transport.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage HTTP * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * HTTP transport class interface. * * @since 11.3 */ interface JHttpTransport { /** * Constructor. * * @param Registry $options Client options object. * * @since 11.3 */ public function __construct(Registry $options); /** * Send a request to the server and return a JHttpResponse object with the response. * * @param string $method The HTTP method for sending the request. * @param JUri $uri The URI to the resource to request. * @param mixed $data Either an associative array or a string to be sent with the request. * @param array $headers An array of request headers to send with the request. * @param integer $timeout Read timeout in seconds. * @param string $userAgent The optional user agent string to send with the request. * * @return JHttpResponse * * @since 11.3 */ public function request($method, JUri $uri, $data = null, array $headers = null, $timeout = null, $userAgent = null); /** * Method to check if HTTP transport is available for use * * @return boolean True if available else false * * @since 12.1 */ public static function isSupported(); } PK���\N=&�''!libraries/joomla/http/factory.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage HTTP * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * HTTP factory class. * * @since 12.1 */ class JHttpFactory { /** * method to receive Http instance. * * @param Registry $options Client options object. * @param mixed $adapters Adapter (string) or queue of adapters (array) to use for communication. * * @return JHttp Joomla Http class * * @throws RuntimeException * * @since 12.1 */ public static function getHttp(Registry $options = null, $adapters = null) { if (empty($options)) { $options = new Registry; } if (empty($adapters)) { $config = JFactory::getConfig(); if ($config->get('proxy_enable')) { $adapters = 'curl'; } } if (!$driver = self::getAvailableDriver($options, $adapters)) { throw new RuntimeException('No transport driver available.'); } return new JHttp($options, $driver); } /** * Finds an available http transport object for communication * * @param Registry $options Option for creating http transport object * @param mixed $default Adapter (string) or queue of adapters (array) to use * * @return JHttpTransport Interface sub-class * * @since 12.1 */ public static function getAvailableDriver(Registry $options, $default = null) { if (is_null($default)) { $availableAdapters = self::getHttpTransports(); } else { settype($default, 'array'); $availableAdapters = $default; } // Check if there is at least one available http transport adapter if (!count($availableAdapters)) { return false; } foreach ($availableAdapters as $adapter) { $class = 'JHttpTransport' . ucfirst($adapter); if (class_exists($class) && $class::isSupported()) { return new $class($options); } } return false; } /** * Get the http transport handlers * * @return array An array of available transport handlers * * @since 12.1 */ public static function getHttpTransports() { $names = array(); $iterator = new DirectoryIterator(__DIR__ . '/transport'); /* @type $file DirectoryIterator */ foreach ($iterator as $file) { $fileName = $file->getFilename(); // Only load for php files. if ($file->isFile() && $file->getExtension() == 'php') { $names[] = substr($fileName, 0, strrpos($fileName, '.')); } } // Keep alphabetical order across all environments sort($names); // If curl is available set it to the first position if ($key = array_search('curl', $names)) { unset($names[$key]); array_unshift($names, 'curl'); } return $names; } } PK���\%��Ǜ�)libraries/joomla/http/wrapper/factory.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Http * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Wrapper class for JHttpFactory * * @package Joomla.Platform * @subpackage Http * @since 3.4 */ class JHttpWrapperFactory { /** * Helper wrapper method for getHttp * * @param Registry $options Client options object. * @param mixed $adapters Adapter (string) or queue of adapters (array) to use for communication. * * @return JHttp Joomla Http class * * @see JHttpFactory::getHttp() * @since 3.4 * @throws RuntimeException */ public function getHttp(Registry $options = null, $adapters = null) { return JHttpFactory::getHttp($options, $adapters); } /** * Helper wrapper method for getAvailableDriver * * @param Registry $options Option for creating http transport object. * @param mixed $default Adapter (string) or queue of adapters (array) to use. * * @return JHttpTransport Interface sub-class * * @see JHttpFactory::getAvailableDriver() * @since 3.4 */ public function getAvailableDriver(Registry $options, $default = null) { return JHttpFactory::getAvailableDriver($options, $default); } /** * Helper wrapper method for getHttpTransports * * @return array An array of available transport handlers * * @see JHttpFactory::getHttpTransports() * @since 3.4 */ public function getHttpTransports() { return JHttpFactory::getHttpTransports(); } } PK���\�ӏ�pp"libraries/joomla/http/response.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage HTTP * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * HTTP response data object class. * * @since 11.3 */ class JHttpResponse { /** * @var integer The server response code. * @since 11.3 */ public $code; /** * @var array Response headers. * @since 11.3 */ public $headers = array(); /** * @var string Server response body. * @since 11.3 */ public $body; } PK���\>K��uu'libraries/joomla/openstreetmap/user.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Openstreetmap * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Openstreetmap API User class for the Joomla Platform * * @since 13.1 */ class JOpenstreetmapUser extends JOpenstreetmapObject { /** * Method to get user details * * @return array The XML response * * @since 13.1 */ public function getDetails() { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'user/details'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters); return $response->body; } /** * Method to get preferences * * @return array The XML response * * @since 13.1 */ public function getPreferences() { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'user/preferences'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', $parameters); return $response->body; } /** * Method to replace user preferences * * @param array $preferences Array of new preferences * * @return array The XML response * * @since 13.1 */ public function replacePreferences($preferences) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'user/preferences'; // Build the request path. $path = $this->getOption('api.url') . $base; // Create a list of preferences $preference_list = ''; if (!empty($preferences)) { foreach ($preferences as $key => $value) { $preference_list .= '<preference k="' . $key . '" v="' . $value . '"/>'; } } $xml = '<?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="JOpenstreetmap"> <preferences>' . $preference_list . '</preferences> </osm>'; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response->body; } /** * Method to change user preferences * * @param string $key Key of the preference * @param string $preference New value for preference * * @return array The XML response * * @since 13.1 */ public function changePreference($key, $preference) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'user/preferences/' . $key; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $preference); return $response->body; } } PK���\1���rr-libraries/joomla/openstreetmap/changesets.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Openstreetmap * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Openstreetmap API Changesets class for the Joomla Platform * * @since 13.1 */ class JOpenstreetmapChangesets extends JOpenstreetmapObject { /** * Method to create a changeset * * @param array $changesets Array which contains changeset data * * @return array The XML response * * @since 13.1 */ public function createChangeset($changesets=array()) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'], 'oauth_token_secret' => $token['secret'] ); // Set the API base $base = 'changeset/create'; // Build the request path. $path = $this->getOption('api.url') . $base; $xml = '<?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="JOpenstreetmap">'; if (!empty($changesets)) { // Create Changeset element for every changeset foreach ($changesets as $tags) { $xml .= '<changeset>'; if (!empty($tags)) { // Create a list of tags for each changeset foreach ($tags as $key => $value) { $xml .= '<tag k="' . $key . '" v="' . $value . '"/>'; } } $xml .= '</changeset>'; } } $xml .= '</osm>'; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response->body; } /** * Method to read a changeset * * @param integer $id identifier of the changeset * * @return array The XML response about a changeset * * @since 13.1 */ public function readChangeset($id) { // Set the API base $base = 'changeset/' . $id; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->changeset; } /** * Method to update a changeset * * @param integer $id Identifier of the changeset * @param array $tags Array of tags to update * * @return array The XML response of updated changeset * * @since 13.1 */ public function updateChangeset($id, $tags = array()) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'changeset/' . $id; // Build the request path. $path = $this->getOption('api.url') . $base; // Create a list of tags to update changeset $tag_list = ''; if (!empty($tags)) { foreach ($tags as $key => $value) { $tag_list .= '<tag k="' . $key . '" v="' . $value . '"/>'; } } $xml = '<?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="JOpenstreetmap"> <changeset>' . $tag_list . '</changeset> </osm>'; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); $xml_string = simplexml_load_string($response->body); return $xml_string->changeset; } /** * Method to close a changeset * * @param integer $id identifier of the changeset * * @return void * * @since 13.1 */ public function closeChangeset($id) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'changeset/' . $id . '/close'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['format'] = 'text/xml'; // Send the request. $this->oauth->oauthRequest($path, 'PUT', $parameters, $header); } /** * Method to download a changeset * * @param integer $id Identifier of the changeset * * @return array The XML response of requested changeset * * @since 13.1 */ public function downloadChangeset($id) { // Set the API base $base = 'changeset/' . $id . '/download'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->create; } /** * Method to expand the bounding box of a changeset * * @param integer $id Identifier of the changeset * @param array $nodes List of lat lon about nodes * * @return array The XML response of changed changeset * * @since 13.1 */ public function expandBBoxChangeset($id, $nodes) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'changeset/' . $id . '/expand_bbox'; // Build the request path. $path = $this->getOption('api.url') . $base; // Create a list of tags to update changeset $node_list = ''; if (!empty($nodes)) { foreach ($nodes as $node) { $node_list .= '<node lat="' . $node[0] . '" lon="' . $node[1] . '"/>'; } } $xml = '<?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="JOpenstreetmap"> <changeset>' . $node_list . '</changeset> </osm>'; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); $xml_string = simplexml_load_string($response->body); return $xml_string->changeset; } /** * Method to query on changesets * * @param string $param Parameters for query * * @return array The XML response * * @since 13.1 */ public function queryChangeset($param) { // Set the API base $base = 'changesets/' . $param; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->osm; } /** * Method to upload a diff to a changeset * * @param string $xml Diff data to upload * @param integer $id Identifier of the changeset * * @return array The XML response of result * * @since 13.1 */ public function diffUploadChangeset($xml, $id) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'changeset/' . $id . '/upload'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header); $xml_string = simplexml_load_string($response->body); return $xml_string->diffResult; } } PK���\�$���)libraries/joomla/openstreetmap/object.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Openstreetmap * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Openstreetmap API object class for the Joomla Platform * * @since 13.1 */ abstract class JOpenstreetmapObject { /** * Options for the Openstreetmap object. * * @var Registry * @since 13.1 */ protected $options; /** * The HTTP client object to use in sending HTTP requests. * * @var JHttp * @since 13.1 */ protected $client; /** * The OAuth client. * * @var JOpenstreetmapOauth * @since 13.1 */ protected $oauth; /** * Constructor * * @param Registry &$options Openstreetmap options object. * @param JHttp $client The HTTP client object. * @param JOpenstreetmapOauth $oauth Openstreetmap oauth client * * @since 13.1 */ public function __construct(Registry &$options = null, JHttp $client = null, JOpenstreetmapOauth $oauth = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JHttp($this->options); $this->oauth = $oauth; } /** * Get an option from the JOpenstreetmapObject instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 13.1 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JOpenstreetmapObject instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JOpenstreetmapObject This object for method chaining. * * @since 13.1 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } /** * Method to send the request which does not require authentication. * * @param string $path The path of the request to make * @param string $method The request method. * @param array $headers The headers passed in the request. * @param mixed $data Either an associative array or a string to be sent with the post request. * * @return SimpleXMLElement The XML response * * @since 13.1 * @throws DomainException */ public function sendRequest($path, $method = 'GET', $headers = array(), $data = '') { // Send the request. switch ($method) { case 'GET': $response = $this->client->get($path, $headers); break; case 'POST': $response = $this->client->post($path, $data, $headers); break; } // Validate the response code. if ($response->code != 200) { $error = htmlspecialchars($response->body); throw new DomainException($error, $response->code); } $xml_string = simplexml_load_string($response->body); return $xml_string; } } PK���\��X��'libraries/joomla/openstreetmap/info.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Openstreetmap * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Openstreetmap API Info class for the Joomla Platform * * @since 13.1 */ class JOpenstreetmapInfo extends JOpenstreetmapObject { /** * Method to get capabilities of the API * * @return array The XML response * * @since 13.1 */ public function getCapabilities() { // Set the API base $base = 'capabilities'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', array()); $xml_string = simplexml_load_string($response->body); return $xml_string; } /** * Method to retrieve map data of a bounding box * * @param float $left Left boundary * @param float $bottom Bottom boundary * @param float $right Right boundary * @param float $top Top boundary * * @return array The XML response * * @since 13.1 */ public function retrieveMapData($left, $bottom, $right, $top) { // Set the API base $base = 'map?bbox=' . $left . ',' . $bottom . ',' . $right . ',' . $top; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', array()); $xml_string = simplexml_load_string($response->body); return $xml_string; } /** * Method to retrieve permissions for current user * * @return array The XML response * * @since 13.1 */ public function retrievePermissions() { // Set the API base $base = 'permissions'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', array()); $xml_string = simplexml_load_string($response->body); return $xml_string; } } PK���\�}���&libraries/joomla/openstreetmap/gps.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Openstreetmap * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Openstreetmap API GPS class for the Joomla Platform * * @since 13.1 */ class JOpenstreetmapGps extends JOpenstreetmapObject { /** * Method to retrieve GPS points * * @param float $left Left boundary * @param float $bottom Bottom boundary * @param float $right Right boundary * @param float $top Top boundary * @param integer $page Page number * * @return array The XML response containing GPS points * * @since 13.1 */ public function retrieveGps($left, $bottom, $right, $top, $page = 0) { // Set the API base $base = 'trackpoints?bbox=' . $left . ',' . $bottom . ',' . $right . ',' . $top . '&page=' . $page; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'GET', array()); $xml_string = simplexml_load_string($response->body); return $xml_string; } /** * Method to upload GPS Traces * * @param string $file File name that contains trace points * @param string $description Description on trace points * @param string $tags Tags for trace * @param integer $public 1 for public, 0 for private * @param string $visibility One of the following: private, public, trackable, identifiable * @param string $username Username * @param string $password Password * * @return JHttpResponse The response * * @since 13.1 */ public function uploadTrace($file, $description, $tags, $public, $visibility, $username, $password) { // Set parameters. $parameters = array( 'file' => $file, 'description' => $description, 'tags' => $tags, 'public' => $public, 'visibility' => $visibility ); // Set the API base $base = 'gpx/create'; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'multipart/form-data'; $header = array_merge($header, $parameters); $header = array_merge($header, array('Authorization' => 'Basic ' . base64_encode($username . ':' . $password))); // Send the request. $response = $this->sendRequest($path, 'POST', $header, array()); return $response; } /** * Method to download Trace details * * @param integer $id Trace identifier * @param string $username Username * @param string $password Password * * @return array The XML response * * @since 13.1 */ public function downloadTraceMetadetails($id, $username, $password) { // Set the API base $base = 'gpx/' . $id . '/details'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path, 'GET', array('Authorization' => 'Basic ' . base64_encode($username . ':' . $password))); return $xml_string; } /** * Method to download Trace data * * @param integer $id Trace identifier * @param string $username Username * @param string $password Password * * @return array The XML response * * @since 13.1 */ public function downloadTraceMetadata($id, $username, $password) { // Set the API base $base = 'gpx/' . $id . '/data'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path, 'GET', array('Authorization' => 'Basic ' . base64_encode($username . ':' . $password))); return $xml_string; } } PK���\�m��` ` (libraries/joomla/openstreetmap/oauth.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Openstreetmap * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Joomla Platform class for generating Openstreetmap API access token. * * @since 13.1 */ class JOpenstreetmapOauth extends JOAuth1Client { /** * Options for the JOpenstreetmapOauth object. * * @var Registry * @since 13.1 */ protected $options; /** * Constructor. * * @param Registry $options JOpenstreetmapOauth options object. * @param JHttp $client The HTTP client object. * @param JInput $input The input object * * @since 13.1 */ public function __construct(Registry $options = null, JHttp $client = null, JInput $input = null) { $this->options = isset($options) ? $options : new Registry; $this->options->def('accessTokenURL', 'http://www.openstreetmap.org/oauth/access_token'); $this->options->def('authoriseURL', 'http://www.openstreetmap.org/oauth/authorize'); $this->options->def('requestTokenURL', 'http://www.openstreetmap.org/oauth/request_token'); /* $this->options->def('accessTokenURL', 'http://api06.dev.openstreetmap.org/oauth/access_token'); $this->options->def('authoriseURL', 'http://api06.dev.openstreetmap.org/oauth/authorize'); $this->options->def('requestTokenURL', 'http://api06.dev.openstreetmap.org/oauth/request_token'); */ // Call the JOauth1Client constructor to setup the object. parent::__construct($this->options, $client, $input, null, '1.0'); } /** * Method to verify if the access token is valid by making a request to an API endpoint. * * @return boolean Returns true if the access token is valid and false otherwise. * * @since 13.1 */ public function verifyCredentials() { return true; } /** * Method to validate a response. * * @param string $url The request URL. * @param JHttpResponse $response The response to validate. * * @return void * * @since 13.1 * @throws DomainException */ public function validateResponse($url, $response) { if ($response->code != 200) { $error = htmlspecialchars($response->body); throw new DomainException($error, $response->code); } } } PK���\L�S�q4q4+libraries/joomla/openstreetmap/elements.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Openstreetmap * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); /** * Openstreetmap API Elements class for the Joomla Platform * * @since 13.1 */ class JOpenstreetmapElements extends JOpenstreetmapObject { /** * Method to create a node * * @param integer $changeset Changeset id * @param float $latitude Latitude of the node * @param float $longitude Longitude of the node * @param arary $tags Array of tags for a node * * @return array The XML response * * @since 13.1 */ public function createNode($changeset, $latitude, $longitude, $tags) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'node/create'; // Build the request path. $path = $this->getOption('api.url') . $base; $tag_list = ''; // Create XML node if (!empty($tags)) { foreach ($tags as $key => $value) { $tag_list .= '<tag k="' . $key . '" v="' . $value . '"/>'; } } $xml = '<?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="JOpenstreetmap"> <node changeset="' . $changeset . '" lat="' . $latitude . '" lon="' . $longitude . '">' . $tag_list . '</node> </osm>'; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response->body; } /** * Method to create a way * * @param integer $changeset Changeset id * @param array $tags Array of tags for a way * @param array $nds Node ids to refer * * @return array The XML response * * @since 13.1 */ public function createWay($changeset, $tags, $nds) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'way/create'; // Build the request path. $path = $this->getOption('api.url') . $base; $tag_list = ''; // Create XML node if (!empty($tags)) { foreach ($tags as $key => $value) { $tag_list .= '<tag k="' . $key . '" v="' . $value . '"/>'; } } $nd_list = ''; if (!empty($nds)) { foreach ($nds as $value) { $nd_list .= '<nd ref="' . $value . '"/>'; } } $xml = '<?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="JOpenstreetmap"> <way changeset="' . $changeset . '">' . $tag_list . $nd_list . '</way> </osm>'; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response->body; } /** * Method to create a relation * * @param integer $changeset Changeset id * @param array $tags Array of tags for a relation * @param array $members Array of members for a relation * eg: $members = array(array("type"=>"node", "role"=>"stop", "ref"=>"123"), array("type"=>"way", "ref"=>"123")) * * @return array The XML response * * @since 13.1 */ public function createRelation($changeset, $tags, $members) { $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = 'relation/create'; // Build the request path. $path = $this->getOption('api.url') . $base; $tag_list = ''; // Create XML node if (!empty($tags)) { foreach ($tags as $key => $value) { $tag_list .= '<tag k="' . $key . '" v="' . $value . '"/>'; } } // Members $member_list = ''; if (!empty($members)) { foreach ($members as $member) { if ($member['type'] == "node") { $member_list .= '<member type="' . $member['type'] . '" role="' . $member['role'] . '" ref="' . $member['ref'] . '"/>'; } elseif ($member['type'] == "way") { $member_list .= '<member type="' . $member['type'] . '" ref="' . $member['ref'] . '"/>'; } } } $xml = '<?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="JOpenstreetmap"> <relation relation="' . $changeset . '" >' . $tag_list . $member_list . '</relation> </osm>'; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response->body; } /** * Method to read an element [node|way|relation] * * @param string $element [node|way|relation] * @param integer $id Element identifier * * @return array The XML response * * @since 13.1 * @throws DomainException */ public function readElement($element, $id) { if ($element != 'node' && $element != 'way' && $element != 'relation') { throw new DomainException("Element should be a node, a way or a relation"); } // Set the API base $base = $element . '/' . $id; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->$element; } /** * Method to update an Element [node|way|relation] * * @param string $element [node|way|relation] * @param string $xml Full reperentation of the element with a version number * @param integer $id Element identifier * * @return array The xml response * * @since 13.1 * @throws DomainException */ public function updateElement($element, $xml, $id) { if ($element != 'node' && $element != 'way' && $element != 'relation') { throw new DomainException("Element should be a node, a way or a relation"); } $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = $element . '/' . $id; // Build the request path. $path = $this->getOption('api.url') . $base; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header); return $response->body; } /** * Method to delete an element [node|way|relation] * * @param string $element [node|way|relation] * @param integer $id Element identifier * @param integer $version Element version * @param integer $changeset Changeset identifier * @param float $latitude Latitude of the element * @param float $longitude Longitude of the element * * @return array The XML response * * @since 13.1 * @throws DomainException */ public function deleteElement($element, $id, $version, $changeset, $latitude = null, $longitude = null) { if ($element != 'node' && $element != 'way' && $element != 'relation') { throw new DomainException("Element should be a node, a way or a relation"); } $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = $element . '/' . $id; // Build the request path. $path = $this->getOption('api.url') . $base; // Create xml $xml = '<?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="JOpenstreetmap"> <' . $element . ' id="' . $id . '" version="' . $version . '" changeset="' . $changeset . '"'; if (!empty($latitude) && !empty($longitude)) { $xml .= ' lat="' . $latitude . '" lon="' . $longitude . '"'; } $xml .= '/></osm>'; $header['Content-Type'] = 'text/xml'; // Send the request. $response = $this->oauth->oauthRequest($path, 'DELETE', $parameters, $xml, $header); return $response->body; } /** * Method to get history of an element [node|way|relation] * * @param string $element [node|way|relation] * @param integer $id Element identifier * * @return array The XML response * * @since 13.1 * @throws DomainException */ public function historyOfElement($element, $id) { if ($element != 'node' && $element != 'way' && $element != 'relation') { throw new DomainException("Element should be a node, a way or a relation"); } // Set the API base $base = $element . '/' . $id . '/history'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->$element; } /** * Method to get details about a version of an element [node|way|relation] * * @param string $element [node|way|relation] * @param integer $id Element identifier * @param integer $version Element version * * @return array The XML response * * @since 13.1 * @throws DomainException */ public function versionOfElement($element, $id ,$version) { if ($element != 'node' && $element != 'way' && $element != 'relation') { throw new DomainException("Element should be a node, a way or a relation"); } // Set the API base $base = $element . '/' . $id . '/' . $version; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->$element; } /** * Method to get data about multiple ids of an element [node|way|relation] * * @param string $element [nodes|ways|relations] - use plural word * @param string $params Comma separated list of ids belonging to type $element * * @return array The XML response * * @since 13.1 * @throws DomainException */ public function multiFetchElements($element, $params) { if ($element != 'nodes' && $element != 'ways' && $element != 'relations') { throw new DomainException("Element should be nodes, ways or relations"); } // Get singular word $single_element = substr($element, 0, strlen($element) - 1); // Set the API base, $params is a string with comma seperated values $base = $element . '?' . $element . "=" . $params; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->$single_element; } /** * Method to get relations for an Element [node|way|relation] * * @param string $element [node|way|relation] * @param integer $id Element identifier * * @return array The XML response * * @since 13.1 * @throws DomainException */ public function relationsForElement($element, $id) { if ($element != 'node' && $element != 'way' && $element != 'relation') { throw new DomainException("Element should be a node, a way or a relation"); } // Set the API base $base = $element . '/' . $id . '/relations'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->$element; } /** * Method to get ways for a Node element * * @param integer $id Node identifier * * @return array The XML response * * @since 13.1 */ public function waysForNode($id) { // Set the API base $base = 'node/' . $id . '/ways'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->way; } /** * Method to get full information about an element [way|relation] * * @param string $element [way|relation] * @param integer $id Identifier * * @return array The XML response * * @since 13.1 * @throws DomainException */ public function fullElement($element, $id) { if ($element != 'way' && $element != 'relation') { throw new DomainException("Element should be a way or a relation"); } // Set the API base $base = $element . '/' . $id . '/full'; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $xml_string = $this->sendRequest($path); return $xml_string->node; } /** * Method used by the DWG to hide old versions of elements containing data privacy or copyright infringements * * @param string $element [node|way|relation] * @param integer $id Element identifier * @param integer $version Element version * @param integer $redaction_id Redaction id * * @return array The xml response * * @since 13.1 * @throws DomainException */ public function redaction($element, $id, $version, $redaction_id) { if ($element != 'node' && $element != 'way' && $element != 'relation') { throw new DomainException("Element should be a node, a way or a relation"); } $token = $this->oauth->getToken(); // Set parameters. $parameters = array( 'oauth_token' => $token['key'] ); // Set the API base $base = $element . '/' . $id . '/' . $version . '/redact?redaction=' . $redaction_id; // Build the request path. $path = $this->getOption('api.url') . $base; // Send the request. $response = $this->oauth->oauthRequest($path, 'PUT', $parameters); $xml_string = simplexml_load_string($response->body); return $xml_string; } } PK���\ᬧG G 0libraries/joomla/openstreetmap/openstreetmap.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Openstreetmap * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die(); use Joomla\Registry\Registry; /** * Joomla Platform class for interact with Openstreetmap API. * * @since 13.1 */ class JOpenstreetmap { /** * Options for the Openstreetmap object. * * @var Registry * @since 13.1 */ protected $options; /** * The HTTP client object to use in sending HTTP requests. * * @var JHttp * @since 13.1 */ protected $client; /** * The OAuth client. * * @var JOpenstreetmapOauth * @since 13.1 */ protected $oauth; /** * Openstreetmap API object for changesets. * * @var JOpenstreetmapChangesets * @since 13.1 */ protected $changesets; /** * Openstreetmap API object for elements. * * @var JOpenstreetmapElements * @since 13.1 */ protected $elements; /** * Openstreetmap API object for GPS. * * @var JOpenstreetmapGps * @since 13.1 */ protected $gps; /** * Openstreetmap API object for info. * * @var JOpenstreetmapInfo * @since 13.1 */ protected $info; /** * Openstreetmap API object for user. * * @var JOpenstreetmapUser * @since 13.1 */ protected $user; /** * Constructor. * * @param JOpenstreetmapOauth $oauth Openstreetmap oauth client * @param Registry $options Openstreetmap options object * @param JHttp $client The HTTP client object * * @since 13.1 */ public function __construct(JOpenstreetmapOauth $oauth = null, Registry $options = null, JHttp $client = null) { $this->oauth = $oauth; $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JHttp($this->options); // Setup the default API url if not already set. $this->options->def('api.url', 'http://api.openstreetmap.org/api/0.6/'); // $this->options->def('api.url', 'http://api06.dev.openstreetmap.org/api/0.6/'); } /** * Method to get object instances * * @param string $name Name of property to retrieve * * @return JOpenstreetmapObject Openstreetmap API object * * @since 13.1 * @throws InvalidArgumentException */ public function __get($name) { $class = 'JOpenstreetmap' . ucfirst($name); if (class_exists($class)) { if (false == isset($this->$name)) { $this->$name = new $class($this->options, $this->client, $this->oauth); } return $this->$name; } throw new InvalidArgumentException(sprintf('Argument %s produced an invalid class name: %s', $name, $class)); } /** * Get an option from the JOpenstreetmap instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 13.1 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the Openstreetmap instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JOpenstreetmap This object for method chaining. * * @since 13.1 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\_l_i||&libraries/joomla/profiler/profiler.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Profiler * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Utility class to assist in the process of benchmarking the execution * of sections of code to understand where time is being spent. * * @since 11.1 */ class JProfiler { /** * @var integer The start time. * @since 12.1 */ protected $start = 0; /** * @var string The prefix to use in the output * @since 12.1 */ protected $prefix = ''; /** * @var array The buffer of profiling messages. * @since 12.1 */ protected $buffer = null; /** * @var array The profiling messages. * @since 12.1 */ protected $marks = null; /** * @var float The previous time marker * @since 12.1 */ protected $previousTime = 0.0; /** * @var float The previous memory marker * @since 12.1 */ protected $previousMem = 0.0; /** * @var array JProfiler instances container. * @since 11.3 */ protected static $instances = array(); /** * Constructor * * @param string $prefix Prefix for mark messages * * @since 11.1 */ public function __construct($prefix = '') { $this->start = microtime(1); $this->prefix = $prefix; $this->marks = array(); $this->buffer = array(); } /** * Returns the global Profiler object, only creating it * if it doesn't already exist. * * @param string $prefix Prefix used to distinguish profiler objects. * * @return JProfiler The Profiler object. * * @since 11.1 */ public static function getInstance($prefix = '') { if (empty(self::$instances[$prefix])) { self::$instances[$prefix] = new JProfiler($prefix); } return self::$instances[$prefix]; } /** * Output a time mark * * The mark is returned as text enclosed in <div> tags * with a CSS class of 'profiler'. * * @param string $label A label for the time mark * * @return string Mark enclosed in <div> tags * * @since 11.1 */ public function mark($label) { $current = microtime(1) - $this->start; $currentMem = memory_get_usage() / 1048576; $m = (object) array( 'prefix' => $this->prefix, 'time' => ($current > $this->previousTime ? '+' : '-') . (($current - $this->previousTime) * 1000), 'totalTime' => ($current * 1000), 'memory' => ($currentMem > $this->previousMem ? '+' : '-') . ($currentMem - $this->previousMem), 'totalMemory' => $currentMem, 'label' => $label ); $this->marks[] = $m; $mark = sprintf( '%s %.3f seconds (%.3f); %0.2f MB (%0.3f) - %s', $m->prefix, $m->totalTime / 1000, $m->time / 1000, $m->totalMemory, $m->memory, $m->label ); $this->buffer[] = $mark; $this->previousTime = $current; $this->previousMem = $currentMem; return $mark; } /** * Get the current time. * * @return float The current time * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use PHP's microtime(1) */ public static function getmicrotime() { list ($usec, $sec) = explode(' ', microtime()); return ((float) $usec + (float) $sec); } /** * Get information about current memory usage. * * @return integer The memory usage * * @link PHP_MANUAL#memory_get_usage * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use PHP's native memory_get_usage() */ public function getMemory() { return memory_get_usage(); } /** * Get all profiler marks. * * Returns an array of all marks created since the Profiler object * was instantiated. Marks are objects as per {@link JProfiler::mark()}. * * @return array Array of profiler marks * * @since 11.1 */ public function getMarks() { return $this->marks; } /** * Get all profiler mark buffers. * * Returns an array of all mark buffers created since the Profiler object * was instantiated. Marks are strings as per {@link JProfiler::mark()}. * * @return array Array of profiler marks * * @since 11.1 */ public function getBuffer() { return $this->buffer; } } PK���\A!@3;;)libraries/joomla/base/adapterinstance.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Base * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Adapter Instance Class * * @since 11.1 */ class JAdapterInstance extends JObject { /** * Parent * * @var JAdapter * @since 11.1 */ protected $parent = null; /** * Database * * @var JDatabaseDriver * @since 11.1 */ protected $db = null; /** * Constructor * * @param JAdapter $parent Parent object * @param JDatabaseDriver $db Database object * @param array $options Configuration Options * * @since 11.1 */ public function __construct(JAdapter $parent, JDatabaseDriver $db, array $options = array()) { // Set the properties from the options array that is passed in $this->setProperties($options); // Set the parent and db in case $options for some reason overrides it. $this->parent = $parent; // Pull in the global dbo in case something happened to it. $this->db = $db ?: JFactory::getDbo(); } /** * Retrieves the parent object * * @return JAdapter parent * * @since 11.1 */ public function getParent() { return $this->parent; } } PK���\�Ňww!libraries/joomla/base/adapter.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Base * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Adapter Class * Retains common adapter pattern functions * Class harvested from joomla.installer.installer * * @since 11.1 */ class JAdapter extends JObject { /** * Associative array of adapters * * @var array * @since 11.1 */ protected $_adapters = array(); /** * Adapter Folder * @var string * @since 11.1 */ protected $_adapterfolder = 'adapters'; /** * @var string Adapter Class Prefix * @since 11.1 */ protected $_classprefix = 'J'; /** * Base Path for the adapter instance * * @var string * @since 11.1 */ protected $_basepath = null; /** * Database Connector Object * * @var JDatabaseDriver * @since 11.1 */ protected $_db; /** * Constructor * * @param string $basepath Base Path of the adapters * @param string $classprefix Class prefix of adapters * @param string $adapterfolder Name of folder to append to base path * * @since 11.1 */ public function __construct($basepath, $classprefix = null, $adapterfolder = null) { $this->_basepath = $basepath; $this->_classprefix = $classprefix ? $classprefix : 'J'; $this->_adapterfolder = $adapterfolder ? $adapterfolder : 'adapters'; $this->_db = JFactory::getDbo(); } /** * Get the database connector object * * @return JDatabaseDriver Database connector object * * @since 11.1 */ public function getDbo() { return $this->_db; } /** * Set an adapter by name * * @param string $name Adapter name * @param object &$adapter Adapter object * @param array $options Adapter options * * @return boolean True if successful * * @since 11.1 */ public function setAdapter($name, &$adapter = null, $options = array()) { if (!is_object($adapter)) { $fullpath = $this->_basepath . '/' . $this->_adapterfolder . '/' . strtolower($name) . '.php'; if (!file_exists($fullpath)) { return false; } // Try to load the adapter object require_once $fullpath; $class = $this->_classprefix . ucfirst($name); if (!class_exists($class)) { return false; } $adapter = new $class($this, $this->_db, $options); } $this->_adapters[$name] = &$adapter; return true; } /** * Return an adapter. * * @param string $name Name of adapter to return * @param array $options Adapter options * * @return object Adapter of type 'name' or false * * @since 11.1 */ public function getAdapter($name, $options = array()) { if (!array_key_exists($name, $this->_adapters)) { if (!$this->setAdapter($name, $options)) { $false = false; return $false; } } return $this->_adapters[$name]; } /** * Loads all adapters. * * @param array $options Adapter options * * @return void * * @since 11.1 */ public function loadAllAdapters($options = array()) { $files = new DirectoryIterator($this->_basepath . '/' . $this->_adapterfolder); /* @type $file DirectoryIterator */ foreach ($files as $file) { $fileName = $file->getFilename(); // Only load for php files. if (!$file->isFile() || $file->getExtension() != 'php') { continue; } // Try to load the adapter object require_once $this->_basepath . '/' . $this->_adapterfolder . '/' . $fileName; // Derive the class name from the filename. $name = str_ireplace('.php', '', ucfirst(trim($fileName))); $class = $this->_classprefix . ucfirst($name); if (!class_exists($class)) { // Skip to next one continue; } $adapter = new $class($this, $this->_db, $options); $this->_adapters[$name] = clone $adapter; } } } PK���\kA7&t t !libraries/joomla/table/update.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Update table * Stores updates temporarily * * @since 11.1 */ class JTableUpdate extends JTable { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct($db) { parent::__construct('#__updates', 'update_id', $db); } /** * Overloaded check function * * @return boolean True if the object is ok * * @see JTable::check() * @since 11.1 */ public function check() { // Check for valid name if (trim($this->name) == '' || trim($this->element) == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_EXTENSION')); return false; } return true; } /** * Overloaded bind function * * @param array $array Named array * @param mixed $ignore An optional array or space separated list of properties * to ignore while binding. * * @return mixed Null if operation was satisfactory, otherwise returns an error * * @see JTable::bind() * @since 11.1 */ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { $registry = new Registry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } if (isset($array['control']) && is_array($array['control'])) { $registry = new Registry; $registry->loadArray($array['control']); $array['control'] = (string) $registry; } return parent::bind($array, $ignore); } /** * Method to create and execute a SELECT WHERE query. * * @param array $options Array of options * * @return string Results of query * * @since 11.1 */ public function find($options = array()) { $where = array(); foreach ($options as $col => $val) { $where[] = $col . ' = ' . $this->_db->quote($val); } $query = $this->_db->getQuery(true) ->select($this->_db->quoteName($this->_tbl_key)) ->from($this->_db->quoteName($this->_tbl)) ->where(implode(' AND ', $where)); $this->_db->setQuery($query); return $this->_db->loadResult(); } } PK���\��R�.�.libraries/joomla/table/user.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Users table * * @since 11.1 */ class JTableUser extends JTable { /** * Associative array of group ids => group ids for the user * * @var array * @since 11.1 */ public $groups; /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct($db) { parent::__construct('#__users', 'id', $db); // Initialise. $this->id = 0; $this->sendEmail = 0; } /** * Method to load a user, user groups, and any other necessary data * from the database so that it can be bound to the user object. * * @param integer $userId An optional user id. * @param boolean $reset False if row not found or on error * (internal error state set in that case). * * @return boolean True on success, false on failure. * * @since 11.1 */ public function load($userId = null, $reset = true) { // Get the id to load. if ($userId !== null) { $this->id = $userId; } else { $userId = $this->id; } // Check for a valid id to load. if ($userId === null) { return false; } // Reset the table. $this->reset(); // Load the user data. $query = $this->_db->getQuery(true) ->select('*') ->from($this->_db->quoteName('#__users')) ->where($this->_db->quoteName('id') . ' = ' . (int) $userId); $this->_db->setQuery($query); $data = (array) $this->_db->loadAssoc(); if (!count($data)) { return false; } // Convert e-mail from punycode $data['email'] = JStringPunycode::emailToUTF8($data['email']); // Bind the data to the table. $return = $this->bind($data); if ($return !== false) { // Load the user groups. $query->clear() ->select($this->_db->quoteName('g.id')) ->select($this->_db->quoteName('g.title')) ->from($this->_db->quoteName('#__usergroups') . ' AS g') ->join('INNER', $this->_db->quoteName('#__user_usergroup_map') . ' AS m ON m.group_id = g.id') ->where($this->_db->quoteName('m.user_id') . ' = ' . (int) $userId); $this->_db->setQuery($query); // Add the groups to the user data. $this->groups = $this->_db->loadAssocList('id', 'id'); } return $return; } /** * Method to bind the user, user groups, and any other necessary data. * * @param array $array The data to bind. * @param mixed $ignore An array or space separated list of fields to ignore. * * @return boolean True on success, false on failure. * * @since 11.1 */ public function bind($array, $ignore = '') { if (array_key_exists('params', $array) && is_array($array['params'])) { $registry = new Registry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } // Attempt to bind the data. $return = parent::bind($array, $ignore); // Load the real group data based on the bound ids. if ($return && !empty($this->groups)) { // Set the group ids. JArrayHelper::toInteger($this->groups); // Get the titles for the user groups. $query = $this->_db->getQuery(true) ->select($this->_db->quoteName('id')) ->select($this->_db->quoteName('title')) ->from($this->_db->quoteName('#__usergroups')) ->where($this->_db->quoteName('id') . ' = ' . implode(' OR ' . $this->_db->quoteName('id') . ' = ', $this->groups)); $this->_db->setQuery($query); // Set the titles for the user groups. $this->groups = $this->_db->loadAssocList('id', 'id'); } return $return; } /** * Validation and filtering * * @return boolean True if satisfactory * * @since 11.1 */ public function check() { // Set user id to null istead of 0, if needed if ($this->id === 0) { $this->id = null; } $filterInput = JFilterInput::getInstance(); // Validate user information if ($filterInput->clean($this->name, 'TRIM') == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_PLEASE_ENTER_YOUR_NAME')); return false; } if ($filterInput->clean($this->username, 'TRIM') == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_PLEASE_ENTER_A_USER_NAME')); return false; } if (preg_match('#[<>"\'%;()&\\\\]|\\.\\./#', $this->username) || strlen(utf8_decode($this->username)) < 2 || $filterInput->clean($this->username, 'TRIM') !== $this->username) { $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_VALID_AZ09', 2)); return false; } if (($filterInput->clean($this->email, 'TRIM') == "") || !JMailHelper::isEmailAddress($this->email)) { $this->setError(JText::_('JLIB_DATABASE_ERROR_VALID_MAIL')); return false; } // Convert e-mail to punycode for storage $this->email = JStringPunycode::emailToPunycode($this->email); // Set the registration timestamp if (empty($this->registerDate) || $this->registerDate == $this->_db->getNullDate()) { $this->registerDate = JFactory::getDate()->toSql(); } // Set the lastvisitDate timestamp if (empty($this->lastvisitDate)) { $this->lastvisitDate = $this->_db->getNullDate(); } // Check for existing username $query = $this->_db->getQuery(true) ->select($this->_db->quoteName('id')) ->from($this->_db->quoteName('#__users')) ->where($this->_db->quoteName('username') . ' = ' . $this->_db->quote($this->username)) ->where($this->_db->quoteName('id') . ' != ' . (int) $this->id); $this->_db->setQuery($query); $xid = (int) $this->_db->loadResult(); if ($xid && $xid != (int) $this->id) { $this->setError(JText::_('JLIB_DATABASE_ERROR_USERNAME_INUSE')); return false; } // Check for existing email $query->clear() ->select($this->_db->quoteName('id')) ->from($this->_db->quoteName('#__users')) ->where($this->_db->quoteName('email') . ' = ' . $this->_db->quote($this->email)) ->where($this->_db->quoteName('id') . ' != ' . (int) $this->id); $this->_db->setQuery($query); $xid = (int) $this->_db->loadResult(); if ($xid && $xid != (int) $this->id) { $this->setError(JText::_('JLIB_DATABASE_ERROR_EMAIL_INUSE')); return false; } // Check for root_user != username $config = JFactory::getConfig(); $rootUser = $config->get('root_user'); if (!is_numeric($rootUser)) { $query->clear() ->select($this->_db->quoteName('id')) ->from($this->_db->quoteName('#__users')) ->where($this->_db->quoteName('username') . ' = ' . $this->_db->quote($rootUser)); $this->_db->setQuery($query); $xid = (int) $this->_db->loadResult(); if ($rootUser == $this->username && (!$xid || $xid && $xid != (int) $this->id) || $xid && $xid == (int) $this->id && $rootUser != $this->username) { $this->setError(JText::_('JLIB_DATABASE_ERROR_USERNAME_CANNOT_CHANGE')); return false; } } return true; } /** * Method to store a row in the database from the JTable instance properties. * If a primary key value is set the row with that primary key value will be * updated with the instance property values. If no primary key value is set * a new row will be inserted into the database with the properties from the * JTable instance. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/store * @since 11.1 */ public function store($updateNulls = false) { // Get the table key and key value. $k = $this->_tbl_key; $key = $this->$k; // TODO: This is a dumb way to handle the groups. // Store groups locally so as to not update directly. $groups = $this->groups; unset($this->groups); // Insert or update the object based on presence of a key value. if ($key) { // Already have a table key, update the row. $this->_db->updateObject($this->_tbl, $this, $this->_tbl_key, $updateNulls); } else { // Don't have a table key, insert the row. $this->_db->insertObject($this->_tbl, $this, $this->_tbl_key); } // Reset groups to the local object. $this->groups = $groups; unset($groups); $query = $this->_db->getQuery(true); // Store the group data if the user data was saved. if (is_array($this->groups) && count($this->groups)) { // Delete the old user group maps. $query->delete($this->_db->quoteName('#__user_usergroup_map')) ->where($this->_db->quoteName('user_id') . ' = ' . (int) $this->id); $this->_db->setQuery($query); $this->_db->execute(); // Set the new user group maps. $query->clear() ->insert($this->_db->quoteName('#__user_usergroup_map')) ->columns(array($this->_db->quoteName('user_id'), $this->_db->quoteName('group_id'))); // Have to break this up into individual queries for cross-database support. foreach ($this->groups as $group) { $query->clear('values') ->values($this->id . ', ' . $group); $this->_db->setQuery($query); $this->_db->execute(); } } // If a user is blocked, delete the cookie login rows if ($this->block == (int) 1) { $query->clear() ->delete($this->_db->quoteName('#__user_keys')) ->where($this->_db->quoteName('user_id') . ' = ' . $this->_db->quote($this->username)); $this->_db->setQuery($query); $this->_db->execute(); } return true; } /** * Method to delete a user, user groups, and any other necessary data from the database. * * @param integer $userId An optional user id. * * @return boolean True on success, false on failure. * * @since 11.1 */ public function delete($userId = null) { // Set the primary key to delete. $k = $this->_tbl_key; if ($userId) { $this->$k = (int) $userId; } // Delete the user. $query = $this->_db->getQuery(true) ->delete($this->_db->quoteName($this->_tbl)) ->where($this->_db->quoteName($this->_tbl_key) . ' = ' . (int) $this->$k); $this->_db->setQuery($query); $this->_db->execute(); // Delete the user group maps. $query->clear() ->delete($this->_db->quoteName('#__user_usergroup_map')) ->where($this->_db->quoteName('user_id') . ' = ' . (int) $this->$k); $this->_db->setQuery($query); $this->_db->execute(); /* * Clean Up Related Data. */ $query->clear() ->delete($this->_db->quoteName('#__messages_cfg')) ->where($this->_db->quoteName('user_id') . ' = ' . (int) $this->$k); $this->_db->setQuery($query); $this->_db->execute(); $query->clear() ->delete($this->_db->quoteName('#__messages')) ->where($this->_db->quoteName('user_id_to') . ' = ' . (int) $this->$k); $this->_db->setQuery($query); $this->_db->execute(); $query->clear() ->delete($this->_db->quoteName('#__user_keys')) ->where($this->_db->quoteName('user_id') . ' = ' . $this->_db->quote($this->username)); $this->_db->setQuery($query); $this->_db->execute(); return true; } /** * Updates last visit time of user * * @param integer $timeStamp The timestamp, defaults to 'now'. * @param integer $userId The user id (optional). * * @return boolean False if an error occurs * * @since 11.1 */ public function setLastVisit($timeStamp = null, $userId = null) { // Check for User ID if (is_null($userId)) { if (isset($this)) { $userId = $this->id; } else { jexit('No userid in setLastVisit'); } } // If no timestamp value is passed to function, than current time is used. $date = JFactory::getDate($timeStamp); // Update the database row for the user. $db = $this->_db; $query = $db->getQuery(true) ->update($db->quoteName($this->_tbl)) ->set($db->quoteName('lastvisitDate') . '=' . $db->quote($date->toSql())) ->where($db->quoteName('id') . '=' . (int) $userId); $db->setQuery($query); $db->execute(); return true; } } PK���\���$libraries/joomla/table/interface.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * table class interface. * * @since 3.2 */ interface JTableInterface { /** * Method to bind an associative array or object to the JTable instance.This * method only binds properties that are publicly accessible and optionally * takes an array of properties to ignore when binding. * * @param mixed $src An associative array or object to bind to the JTable instance. * @param mixed $ignore An optional array or space separated list of properties to ignore while binding. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/bind * @since 3.2 * @throws UnexpectedValueException */ public function bind($src, $ignore = array()); /** * Method to perform sanity checks on the JTable instance properties to ensure * they are safe to store in the database. Child classes should override this * method to make sure the data they are storing in the database is safe and * as expected before storage. * * @return boolean True if the instance is sane and able to be stored in the database. * * @link https://docs.joomla.org/JTable/check * @since 3.2 */ public function check(); /** * Override parent delete method to delete tags information. * * @param mixed $pk An optional primary key value to delete. If not set the instance property value is used. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/delete * @since 3.2 * @throws UnexpectedValueException */ public function delete($pk = null); /** * Method to get the JDatabaseDriver object. * * @return JDatabaseDriver The internal database driver object. * * @link https://docs.joomla.org/JTable/getDBO * @since 3.2 */ public function getDbo(); /** * Method to get the primary key field name for the table. * * @return string The name of the primary key for the table. * * @link https://docs.joomla.org/JTable/getKeyName * @since 3.2 */ public function getKeyName(); /** * Method to load a row from the database by primary key and bind the fields * to the JTable instance properties. * * @param mixed $keys An optional primary key value to load the row by, or an array of fields to match. If not * set the instance property value is used. * @param boolean $reset True to reset the default values before loading the new row. * * @return boolean True if successful. False if row not found. * * @link https://docs.joomla.org/JTable/load * @since 3.2 * @throws RuntimeException * @throws UnexpectedValueException */ public function load($keys = null, $reset = true); /** * Method to reset class properties to the defaults set in the class * definition. It will ignore the primary key as well as any private class * properties. * * @return void * * @link https://docs.joomla.org/JTable/reset * @since 3.2 */ public function reset(); /** * Method to store a row in the database from the JTable instance properties. * If a primary key value is set the row with that primary key value will be * updated with the instance property values. If no primary key value is set * a new row will be inserted into the database with the properties from the * JTable instance. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/store * @since 3.2 */ public function store($updateNulls = false); } PK���\5|��� � libraries/joomla/table/asset.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Table class supporting modified pre-order tree traversal behavior. * * @link https://docs.joomla.org/JTableAsset * @since 11.1 */ class JTableAsset extends JTableNested { /** * The primary key of the asset. * * @var integer * @since 11.1 */ public $id = null; /** * The unique name of the asset. * * @var string * @since 11.1 */ public $name = null; /** * The human readable title of the asset. * * @var string * @since 11.1 */ public $title = null; /** * The rules for the asset stored in a JSON string * * @var string * @since 11.1 */ public $rules = null; /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct($db) { parent::__construct('#__assets', 'id', $db); } /** * Method to load an asset by its name. * * @param string $name The name of the asset. * * @return integer * * @since 11.1 */ public function loadByName($name) { $query = $this->_db->getQuery(true) ->select($this->_db->quoteName('id')) ->from($this->_db->quoteName('#__assets')) ->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote($name)); $this->_db->setQuery($query); $assetId = (int) $this->_db->loadResult(); if (empty($assetId)) { return false; } return $this->load($assetId); } /** * Assert that the nested set data is valid. * * @return boolean True if the instance is sane and able to be stored in the database. * * @link https://docs.joomla.org/JTable/check * @since 11.1 */ public function check() { $this->parent_id = (int) $this->parent_id; if (empty($this->rules)) { $this->rules = '{}'; } // JTableNested does not allow parent_id = 0, override this. if ($this->parent_id > 0) { // Get the JDatabaseQuery object $query = $this->_db->getQuery(true) ->select('COUNT(id)') ->from($this->_db->quoteName($this->_tbl)) ->where($this->_db->quoteName('id') . ' = ' . $this->parent_id); $this->_db->setQuery($query); if ($this->_db->loadResult()) { return true; } else { $this->setError('Invalid Parent ID'); return false; } } return true; } } PK���\J�Z%%%libraries/joomla/table/updatesite.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Update site table * Stores the update sites for extensions * * @package Joomla.Platform * @subpackage Table * @since 3.4 */ class JTableUpdatesite extends JTable { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 3.4 */ public function __construct($db) { parent::__construct('#__update_sites', 'update_site_id', $db); } /** * Overloaded check function * * @return boolean True if the object is ok * * @see JTable::check() * @since 3.4 */ public function check() { // Check for valid name if (trim($this->name) == '' || trim($this->location) == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_EXTENSION')); return false; } return true; } } PK���\���h��$libraries/joomla/table/usergroup.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Usergroup table class. * * @since 11.1 */ class JTableUsergroup extends JTable { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct($db) { parent::__construct('#__usergroups', 'id', $db); } /** * Method to check the current record to save * * @return boolean True on success * * @since 11.1 */ public function check() { // Validate the title. if ((trim($this->title)) == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_USERGROUP_TITLE')); return false; } // Check for a duplicate parent_id, title. // There is a unique index on the (parent_id, title) field in the table. $db = $this->_db; $query = $db->getQuery(true) ->select('COUNT(title)') ->from($this->_tbl) ->where('title = ' . $db->quote(trim($this->title))) ->where('parent_id = ' . (int) $this->parent_id) ->where('id <> ' . (int) $this->id); $db->setQuery($query); if ($db->loadResult() > 0) { $this->setError(JText::_('JLIB_DATABASE_ERROR_USERGROUP_TITLE_EXISTS')); return false; } return true; } /** * Method to recursively rebuild the nested set tree. * * @param integer $parent_id The root of the tree to rebuild. * @param integer $left The left id to start with in building the tree. * * @return boolean True on success * * @since 11.1 */ public function rebuild($parent_id = 0, $left = 0) { // Get the database object $db = $this->_db; // Get all children of this node $db->setQuery('SELECT id FROM ' . $this->_tbl . ' WHERE parent_id=' . (int) $parent_id . ' ORDER BY parent_id, title'); $children = $db->loadColumn(); // The right value of this node is the left value + 1 $right = $left + 1; // Execute this function recursively over all children for ($i = 0, $n = count($children); $i < $n; $i++) { // $right is the current right value, which is incremented on recursion return $right = $this->rebuild($children[$i], $right); // If there is an update failure, return false to break out of the recursion if ($right === false) { return false; } } // We've got the left value, and now that we've processed // the children of this node we also know the right value $db->setQuery('UPDATE ' . $this->_tbl . ' SET lft=' . (int) $left . ', rgt=' . (int) $right . ' WHERE id=' . (int) $parent_id); // If there is an update failure, return false to break out of the recursion if (!$db->execute()) { return false; } // Return the right value of this node + 1 return $right + 1; } /** * Inserts a new row if id is zero or updates an existing row in the database table * * @param boolean $updateNulls If false, null object variables are not updated * * @return boolean True if successful, false otherwise and an internal error message is set * * @since 11.1 */ public function store($updateNulls = false) { if ($result = parent::store($updateNulls)) { // Rebuild the nested set tree. $this->rebuild(); } return $result; } /** * Delete this object and its dependencies * * @param integer $oid The primary key of the user group to delete. * * @return mixed Boolean or Exception. * * @since 11.1 * @throws RuntimeException on database error. * @throws UnexpectedValueException on data error. */ public function delete($oid = null) { if ($oid) { $this->load($oid); } if ($this->id == 0) { throw new UnexpectedValueException('Global Category not found'); } if ($this->parent_id == 0) { throw new UnexpectedValueException('Root categories cannot be deleted.'); } if ($this->lft == 0 || $this->rgt == 0) { throw new UnexpectedValueException('Left-Right data inconsistency. Cannot delete usergroup.'); } $db = $this->_db; // Select the usergroup ID and its children $query = $db->getQuery(true) ->select($db->quoteName('c.id')) ->from($db->quoteName($this->_tbl) . 'AS c') ->where($db->quoteName('c.lft') . ' >= ' . (int) $this->lft) ->where($db->quoteName('c.rgt') . ' <= ' . (int) $this->rgt); $db->setQuery($query); $ids = $db->loadColumn(); if (empty($ids)) { throw new UnexpectedValueException('Left-Right data inconsistency. Cannot delete usergroup.'); } // Delete the category dependencies // @todo Remove all related threads, posts and subscriptions // Delete the usergroup and its children $query->clear() ->delete($db->quoteName($this->_tbl)) ->where($db->quoteName('id') . ' IN (' . implode(',', $ids) . ')'); $db->setQuery($query); $db->execute(); // Delete the usergroup in view levels $replace = array(); foreach ($ids as $id) { $replace[] = ',' . $db->quote("[$id,") . ',' . $db->quote("[") . ')'; $replace[] = ',' . $db->quote(",$id,") . ',' . $db->quote(",") . ')'; $replace[] = ',' . $db->quote(",$id]") . ',' . $db->quote("]") . ')'; $replace[] = ',' . $db->quote("[$id]") . ',' . $db->quote("[]") . ')'; } $query->clear() ->select('id, rules') ->from('#__viewlevels'); $db->setQuery($query); $rules = $db->loadObjectList(); $match_ids = array(); foreach ($rules as $rule) { foreach ($ids as $id) { if (strstr($rule->rules, '[' . $id) || strstr($rule->rules, ',' . $id) || strstr($rule->rules, $id . ']')) { $match_ids[] = $rule->id; } } } if (!empty($match_ids)) { $query->clear() ->set('rules=' . str_repeat('replace(', 4 * count($ids)) . 'rules' . implode('', $replace)) ->update('#__viewlevels') ->where('id IN (' . implode(',', $match_ids) . ')'); $db->setQuery($query); $db->execute(); } // Delete the user to usergroup mappings for the group(s) from the database. $query->clear() ->delete($db->quoteName('#__user_usergroup_map')) ->where($db->quoteName('group_id') . ' IN (' . implode(',', $ids) . ')'); $db->setQuery($query); $db->execute(); return true; } } PK���\���#libraries/joomla/table/language.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Languages table. * * @since 11.1 */ class JTableLanguage extends JTable { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct($db) { parent::__construct('#__languages', 'lang_id', $db); } /** * Overloaded check method to ensure data integrity * * @return boolean True on success * * @since 11.1 */ public function check() { if (trim($this->title) == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_LANGUAGE_NO_TITLE')); return false; } return true; } /** * Overrides JTable::store to check unique fields. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @since 11.4 */ public function store($updateNulls = false) { // Verify that the sef field is unique $table = JTable::getInstance('Language', 'JTable', array('dbo', $this->getDbo())); if ($table->load(array('sef' => $this->sef)) && ($table->lang_id != $this->lang_id || $this->lang_id == 0)) { $this->setError(JText::_('JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_SEF')); return false; } // Verify that the image field is unique if ($table->load(array('image' => $this->image)) && ($table->lang_id != $this->lang_id || $this->lang_id == 0)) { $this->setError(JText::_('JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_IMAGE')); return false; } // Verify that the language code is unique if ($table->load(array('lang_code' => $this->lang_code)) && ($table->lang_id != $this->lang_id || $this->lang_id == 0)) { $this->setError(JText::_('JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_LANG_CODE')); return false; } return parent::store($updateNulls); } } PK���\>1 1 #libraries/joomla/table/observer.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Table class supporting modified pre-order tree traversal behavior. * * @link https://docs.joomla.org/JTableObserver * @since 3.1.2 */ abstract class JTableObserver implements JObserverInterface { /** * The observed table * * @var JTable * @since 3.1.2 */ protected $table; /** * Constructor: Associates to $table $this observer * * @param JTableInterface $table Table to be observed * * @since 3.1.2 */ public function __construct(JTableInterface $table) { $table->attachObserver($this); $this->table = $table; } /** * Pre-processor for $table->load($keys, $reset) * * @param mixed $keys An optional primary key value to load the row by, or an array of fields to match. If not * set the instance property value is used. * @param boolean $reset True to reset the default values before loading the new row. * * @return void * * @since 3.1.2 */ public function onBeforeLoad($keys, $reset) { } /** * Post-processor for $table->load($keys, $reset) * * @param boolean &$result The result of the load * @param array $row The loaded (and already binded to $this->table) row of the database table * * @return void * * @since 3.1.2 */ public function onAfterLoad(&$result, $row) { } /** * Pre-processor for $table->store($updateNulls) * * @param boolean $updateNulls The result of the load * @param string $tableKey The key of the table * * @return void * * @since 3.1.2 */ public function onBeforeStore($updateNulls, $tableKey) { } /** * Post-processor for $table->store($updateNulls) * * @param boolean &$result The result of the store * * @return void * * @since 3.1.2 */ public function onAfterStore(&$result) { } /** * Pre-processor for $table->delete($pk) * * @param mixed $pk An optional primary key value to delete. If not set the instance property value is used. * * @return void * * @since 3.1.2 * @throws UnexpectedValueException */ public function onBeforeDelete($pk) { } /** * Post-processor for $table->delete($pk) * * @param mixed $pk The deleted primary key value. * * @return void * * @since 3.1.2 */ public function onAfterDelete($pk) { } } PK���\�`�xe�e� libraries/joomla/table/table.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.path'); /** * Abstract Table class * * Parent class to all tables. * * @since 11.1 * @tutorial Joomla.Platform/jtable.cls */ abstract class JTable extends JObject implements JObservableInterface, JTableInterface { /** * Include paths for searching for JTable classes. * * @var array * @since 12.1 */ private static $_includePaths = array(); /** * Name of the database table to model. * * @var string * @since 11.1 */ protected $_tbl = ''; /** * Name of the primary key field in the table. * * @var string * @since 11.1 */ protected $_tbl_key = ''; /** * Name of the primary key fields in the table. * * @var array * @since 12.2 */ protected $_tbl_keys = array(); /** * JDatabaseDriver object. * * @var JDatabaseDriver * @since 11.1 */ protected $_db; /** * Should rows be tracked as ACL assets? * * @var boolean * @since 11.1 */ protected $_trackAssets = false; /** * The rules associated with this record. * * @var JAccessRules A JAccessRules object. * @since 11.1 */ protected $_rules; /** * Indicator that the tables have been locked. * * @var boolean * @since 11.1 */ protected $_locked = false; /** * Indicates that the primary keys autoincrement. * * @var boolean * @since 12.3 */ protected $_autoincrement = true; /** * Generic observers for this JTable (Used e.g. for tags Processing) * * @var JObserverUpdater * @since 3.1.2 */ protected $_observers; /** * Array with alias for "special" columns such as ordering, hits etc etc * * @var array */ protected $_columnAlias = array(); /** * An array of key names to be json encoded in the bind function * * @var array * @since 3.3 */ protected $_jsonEncode = array(); /** * Object constructor to set table and key fields. In most cases this will * be overridden by child classes to explicitly set the table and key fields * for a particular database table. * * @param string $table Name of the table to model. * @param mixed $key Name of the primary key field in the table or array of field names that compose the primary key. * @param JDatabaseDriver $db JDatabaseDriver object. * * @since 11.1 */ public function __construct($table, $key, $db) { // Set internal variables. $this->_tbl = $table; // Set the key to be an array. if (is_string($key)) { $key = array($key); } elseif (is_object($key)) { $key = (array) $key; } $this->_tbl_keys = $key; if (count($key) == 1) { $this->_autoincrement = true; } else { $this->_autoincrement = false; } // Set the singular table key for backwards compatibility. $this->_tbl_key = $this->getKeyName(); $this->_db = $db; // Initialise the table properties. $fields = $this->getFields(); if ($fields) { foreach ($fields as $name => $v) { // Add the field if it is not already present. if (!property_exists($this, $name)) { $this->$name = null; } } } // If we are tracking assets, make sure an access field exists and initially set the default. if (property_exists($this, 'asset_id')) { $this->_trackAssets = true; } // If the access property exists, set the default. if (property_exists($this, 'access')) { $this->access = (int) JFactory::getConfig()->get('access'); } // Implement JObservableInterface: // Create observer updater and attaches all observers interested by $this class: $this->_observers = new JObserverUpdater($this); JObserverMapper::attachAllObservers($this); } /** * Implement JObservableInterface: * Adds an observer to this instance. * This method will be called fron the constructor of classes implementing JObserverInterface * which is instanciated by the constructor of $this with JObserverMapper::attachAllObservers($this) * * @param JObserverInterface|JTableObserver $observer The observer object * * @return void * * @since 3.1.2 */ public function attachObserver(JObserverInterface $observer) { $this->_observers->attachObserver($observer); } /** * Gets the instance of the observer of class $observerClass * * @param string $observerClass The observer class-name to return the object of * * @return JTableObserver|null * * @since 3.1.2 */ public function getObserverOfClass($observerClass) { return $this->_observers->getObserverOfClass($observerClass); } /** * Get the columns from database table. * * @return mixed An array of the field names, or false if an error occurs. * * @since 11.1 * @throws UnexpectedValueException */ public function getFields() { static $cache = null; if ($cache === null) { // Lookup the fields for this table only once. $name = $this->_tbl; $fields = $this->_db->getTableColumns($name, false); if (empty($fields)) { throw new UnexpectedValueException(sprintf('No columns found for %s table', $name)); } $cache = $fields; } return $cache; } /** * Static method to get an instance of a JTable class if it can be found in * the table include paths. To add include paths for searching for JTable * classes see JTable::addIncludePath(). * * @param string $type The type (name) of the JTable class to get an instance of. * @param string $prefix An optional prefix for the table class name. * @param array $config An optional array of configuration values for the JTable object. * * @return JTable|boolean A JTable object if found or boolean false on failure. * * @link https://docs.joomla.org/JTable/getInstance * @since 11.1 */ public static function getInstance($type, $prefix = 'JTable', $config = array()) { // Sanitize and prepare the table class name. $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix . ucfirst($type); // Only try to load the class if it doesn't already exist. if (!class_exists($tableClass)) { // Search for the class file in the JTable include paths. jimport('joomla.filesystem.path'); $paths = self::addIncludePath(); $pathIndex = 0; while (!class_exists($tableClass) && $pathIndex < count($paths)) { if ($tryThis = JPath::find($paths[$pathIndex++], strtolower($type) . '.php')) { // Import the class file. include_once $tryThis; } } if (!class_exists($tableClass)) { // If we were unable to find the class file in the JTable include paths, raise a warning and return false. JLog::add(JText::sprintf('JLIB_DATABASE_ERROR_NOT_SUPPORTED_FILE_NOT_FOUND', $type), JLog::WARNING, 'jerror'); return false; } } // If a database object was passed in the configuration array use it, otherwise get the global one from JFactory. $db = isset($config['dbo']) ? $config['dbo'] : JFactory::getDbo(); // Instantiate a new table class and return it. return new $tableClass($db); } /** * Add a filesystem path where JTable should search for table class files. * You may either pass a string or an array of paths. * * @param mixed $path A filesystem path or array of filesystem paths to add. * * @return array An array of filesystem paths to find JTable classes in. * * @link https://docs.joomla.org/JTable/addIncludePath * @since 11.1 */ public static function addIncludePath($path = null) { // If the internal paths have not been initialised, do so with the base table path. if (empty(self::$_includePaths)) { self::$_includePaths = array(__DIR__); } // Convert the passed path(s) to add to an array. settype($path, 'array'); // If we have new paths to add, do so. if (!empty($path)) { // Check and add each individual new path. foreach ($path as $dir) { // Sanitize path. $dir = trim($dir); // Add to the front of the list so that custom paths are searched first. if (!in_array($dir, self::$_includePaths)) { array_unshift(self::$_includePaths, $dir); } } } return self::$_includePaths; } /** * Method to compute the default name of the asset. * The default name is in the form table_name.id * where id is the value of the primary key of the table. * * @return string * * @since 11.1 */ protected function _getAssetName() { $keys = array(); foreach ($this->_tbl_keys as $k) { $keys[] = (int) $this->$k; } return $this->_tbl . '.' . implode('.', $keys); } /** * Method to return the title to use for the asset table. In * tracking the assets a title is kept for each asset so that there is some * context available in a unified access manager. Usually this would just * return $this->title or $this->name or whatever is being used for the * primary name of the row. If this method is not overridden, the asset name is used. * * @return string The string to use as the title in the asset table. * * @link https://docs.joomla.org/JTable/getAssetTitle * @since 11.1 */ protected function _getAssetTitle() { return $this->_getAssetName(); } /** * Method to get the parent asset under which to register this one. * By default, all assets are registered to the ROOT node with ID, * which will default to 1 if none exists. * The extended class can define a table and id to lookup. If the * asset does not exist it will be created. * * @param JTable $table A JTable object for the asset parent. * @param integer $id Id to look up * * @return integer * * @since 11.1 */ protected function _getAssetParentId(JTable $table = null, $id = null) { // For simple cases, parent to the asset root. $assets = self::getInstance('Asset', 'JTable', array('dbo' => $this->getDbo())); $rootId = $assets->getRootId(); if (!empty($rootId)) { return $rootId; } return 1; } /** * Method to append the primary keys for this table to a query. * * @param JDatabaseQuery $query A query object to append. * @param mixed $pk Optional primary key parameter. * * @return void * * @since 12.3 */ public function appendPrimaryKeys($query, $pk = null) { if (is_null($pk)) { foreach ($this->_tbl_keys as $k) { $query->where($this->_db->quoteName($k) . ' = ' . $this->_db->quote($this->$k)); } } else { if (is_string($pk)) { $pk = array($this->_tbl_key => $pk); } $pk = (object) $pk; foreach ($this->_tbl_keys as $k) { $query->where($this->_db->quoteName($k) . ' = ' . $this->_db->quote($pk->$k)); } } } /** * Method to get the database table name for the class. * * @return string The name of the database table being modeled. * * @since 11.1 * * @link https://docs.joomla.org/JTable/getTableName */ public function getTableName() { return $this->_tbl; } /** * Method to get the primary key field name for the table. * * @param boolean $multiple True to return all primary keys (as an array) or false to return just the first one (as a string). * * @return mixed Array of primary key field names or string containing the first primary key field. * * @link https://docs.joomla.org/JTable/getKeyName * @since 11.1 */ public function getKeyName($multiple = false) { // Count the number of keys if (count($this->_tbl_keys)) { if ($multiple) { // If we want multiple keys, return the raw array. return $this->_tbl_keys; } else { // If we want the standard method, just return the first key. return $this->_tbl_keys[0]; } } return ''; } /** * Method to get the JDatabaseDriver object. * * @return JDatabaseDriver The internal database driver object. * * @link https://docs.joomla.org/JTable/getDBO * @since 11.1 */ public function getDbo() { return $this->_db; } /** * Method to set the JDatabaseDriver object. * * @param JDatabaseDriver $db A JDatabaseDriver object to be used by the table object. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/setDBO * @since 11.1 */ public function setDbo($db) { $this->_db = $db; return true; } /** * Method to set rules for the record. * * @param mixed $input A JAccessRules object, JSON string, or array. * * @return void * * @since 11.1 */ public function setRules($input) { if ($input instanceof JAccessRules) { $this->_rules = $input; } else { $this->_rules = new JAccessRules($input); } } /** * Method to get the rules for the record. * * @return JAccessRules object * * @since 11.1 */ public function getRules() { return $this->_rules; } /** * Method to reset class properties to the defaults set in the class * definition. It will ignore the primary key as well as any private class * properties (except $_errors). * * @return void * * @link https://docs.joomla.org/JTable/reset * @since 11.1 */ public function reset() { // Get the default values for the class from the table. foreach ($this->getFields() as $k => $v) { // If the property is not the primary key or private, reset it. if (!in_array($k, $this->_tbl_keys) && (strpos($k, '_') !== 0)) { $this->$k = $v->Default; } } // Reset table errors $this->_errors = array(); } /** * Method to bind an associative array or object to the JTable instance.This * method only binds properties that are publicly accessible and optionally * takes an array of properties to ignore when binding. * * @param mixed $src An associative array or object to bind to the JTable instance. * @param mixed $ignore An optional array or space separated list of properties to ignore while binding. * * @return boolean True on success. * * @since 11.1 * @throws InvalidArgumentException */ public function bind($src, $ignore = array()) { // JSON encode any fields required if (!empty($this->_jsonEncode)) { foreach ($this->_jsonEncode as $field) { if (isset($src[$field]) && is_array($src[$field])) { $src[$field] = json_encode($src[$field]); } } } // If the source value is not an array or object return false. if (!is_object($src) && !is_array($src)) { throw new InvalidArgumentException(sprintf('%s::bind(*%s*)', get_class($this), gettype($src))); } // If the source value is an object, get its accessible properties. if (is_object($src)) { $src = get_object_vars($src); } // If the ignore value is a string, explode it over spaces. if (!is_array($ignore)) { $ignore = explode(' ', $ignore); } // Bind the source value, excluding the ignored fields. foreach ($this->getProperties() as $k => $v) { // Only process fields not in the ignore array. if (!in_array($k, $ignore)) { if (isset($src[$k])) { $this->$k = $src[$k]; } } } return true; } /** * Method to load a row from the database by primary key and bind the fields * to the JTable instance properties. * * @param mixed $keys An optional primary key value to load the row by, or an array of fields to match. If not * set the instance property value is used. * @param boolean $reset True to reset the default values before loading the new row. * * @return boolean True if successful. False if row not found. * * @link https://docs.joomla.org/JTable/load * @since 11.1 * @throws InvalidArgumentException * @throws RuntimeException * @throws UnexpectedValueException */ public function load($keys = null, $reset = true) { // Implement JObservableInterface: Pre-processing by observers $this->_observers->update('onBeforeLoad', array($keys, $reset)); if (empty($keys)) { $empty = true; $keys = array(); // If empty, use the value of the current key foreach ($this->_tbl_keys as $key) { $empty = $empty && empty($this->$key); $keys[$key] = $this->$key; } // If empty primary key there's is no need to load anything if ($empty) { return true; } } elseif (!is_array($keys)) { // Load by primary key. $keyCount = count($this->_tbl_keys); if ($keyCount) { if ($keyCount > 1) { throw new InvalidArgumentException('Table has multiple primary keys specified, only one primary key value provided.'); } $keys = array($this->getKeyName() => $keys); } else { throw new RuntimeException('No table keys defined.'); } } if ($reset) { $this->reset(); } // Initialise the query. $query = $this->_db->getQuery(true) ->select('*') ->from($this->_tbl); $fields = array_keys($this->getProperties()); foreach ($keys as $field => $value) { // Check that $field is in the table. if (!in_array($field, $fields)) { throw new UnexpectedValueException(sprintf('Missing field in database: %s   %s.', get_class($this), $field)); } // Add the search tuple to the query. $query->where($this->_db->quoteName($field) . ' = ' . $this->_db->quote($value)); } $this->_db->setQuery($query); $row = $this->_db->loadAssoc(); // Check that we have a result. if (empty($row)) { $result = false; } else { // Bind the object with the row and return. $result = $this->bind($row); } // Implement JObservableInterface: Post-processing by observers $this->_observers->update('onAfterLoad', array(&$result, $row)); return $result; } /** * Method to perform sanity checks on the JTable instance properties to ensure * they are safe to store in the database. Child classes should override this * method to make sure the data they are storing in the database is safe and * as expected before storage. * * @return boolean True if the instance is sane and able to be stored in the database. * * @link https://docs.joomla.org/JTable/check * @since 11.1 */ public function check() { return true; } /** * Method to store a row in the database from the JTable instance properties. * If a primary key value is set the row with that primary key value will be * updated with the instance property values. If no primary key value is set * a new row will be inserted into the database with the properties from the * JTable instance. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/store * @since 11.1 */ public function store($updateNulls = false) { $k = $this->_tbl_keys; // Implement JObservableInterface: Pre-processing by observers $this->_observers->update('onBeforeStore', array($updateNulls, $k)); $currentAssetId = 0; if (!empty($this->asset_id)) { $currentAssetId = $this->asset_id; } // The asset id field is managed privately by this class. if ($this->_trackAssets) { unset($this->asset_id); } // If a primary key exists update the object, otherwise insert it. if ($this->hasPrimaryKey()) { $result = $this->_db->updateObject($this->_tbl, $this, $this->_tbl_keys, $updateNulls); } else { $result = $this->_db->insertObject($this->_tbl, $this, $this->_tbl_keys[0]); } // If the table is not set to track assets return true. if ($this->_trackAssets) { if ($this->_locked) { $this->_unlock(); } /* * Asset Tracking */ $parentId = $this->_getAssetParentId(); $name = $this->_getAssetName(); $title = $this->_getAssetTitle(); $asset = self::getInstance('Asset', 'JTable', array('dbo' => $this->getDbo())); $asset->loadByName($name); // Re-inject the asset id. $this->asset_id = $asset->id; // Check for an error. $error = $asset->getError(); if ($error) { $this->setError($error); return false; } else { // Specify how a new or moved node asset is inserted into the tree. if (empty($this->asset_id) || $asset->parent_id != $parentId) { $asset->setLocation($parentId, 'last-child'); } // Prepare the asset to be stored. $asset->parent_id = $parentId; $asset->name = $name; $asset->title = $title; if ($this->_rules instanceof JAccessRules) { $asset->rules = (string) $this->_rules; } if (!$asset->check() || !$asset->store($updateNulls)) { $this->setError($asset->getError()); return false; } else { // Create an asset_id or heal one that is corrupted. if (empty($this->asset_id) || ($currentAssetId != $this->asset_id && !empty($this->asset_id))) { // Update the asset_id field in this table. $this->asset_id = (int) $asset->id; $query = $this->_db->getQuery(true) ->update($this->_db->quoteName($this->_tbl)) ->set('asset_id = ' . (int) $this->asset_id); $this->appendPrimaryKeys($query); $this->_db->setQuery($query)->execute(); } } } } // Implement JObservableInterface: Post-processing by observers $this->_observers->update('onAfterStore', array(&$result)); return $result; } /** * Method to provide a shortcut to binding, checking and storing a JTable * instance to the database table. The method will check a row in once the * data has been stored and if an ordering filter is present will attempt to * reorder the table rows based on the filter. The ordering filter is an instance * property name. The rows that will be reordered are those whose value matches * the JTable instance for the property specified. * * @param mixed $src An associative array or object to bind to the JTable instance. * @param string $orderingFilter Filter for the order updating * @param mixed $ignore An optional array or space separated list of properties * to ignore while binding. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/save * @since 11.1 */ public function save($src, $orderingFilter = '', $ignore = '') { // Attempt to bind the source to the instance. if (!$this->bind($src, $ignore)) { return false; } // Run any sanity checks on the instance and verify that it is ready for storage. if (!$this->check()) { return false; } // Attempt to store the properties to the database table. if (!$this->store()) { return false; } // Attempt to check the row in, just in case it was checked out. if (!$this->checkin()) { return false; } // If an ordering filter is set, attempt reorder the rows in the table based on the filter and value. if ($orderingFilter) { $filterValue = $this->$orderingFilter; $this->reorder($orderingFilter ? $this->_db->quoteName($orderingFilter) . ' = ' . $this->_db->quote($filterValue) : ''); } // Set the error to empty and return true. $this->setError(''); return true; } /** * Method to delete a row from the database table by primary key value. * * @param mixed $pk An optional primary key value to delete. If not set the instance property value is used. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/delete * @since 11.1 * @throws UnexpectedValueException */ public function delete($pk = null) { if (is_null($pk)) { $pk = array(); foreach ($this->_tbl_keys AS $key) { $pk[$key] = $this->$key; } } elseif (!is_array($pk)) { $pk = array($this->_tbl_key => $pk); } foreach ($this->_tbl_keys AS $key) { $pk[$key] = is_null($pk[$key]) ? $this->$key : $pk[$key]; if ($pk[$key] === null) { throw new UnexpectedValueException('Null primary key not allowed.'); } $this->$key = $pk[$key]; } // Implement JObservableInterface: Pre-processing by observers $this->_observers->update('onBeforeDelete', array($pk)); // If tracking assets, remove the asset first. if ($this->_trackAssets) { // Get the asset name $name = $this->_getAssetName(); $asset = self::getInstance('Asset'); if ($asset->loadByName($name)) { if (!$asset->delete()) { $this->setError($asset->getError()); return false; } } } // Delete the row by primary key. $query = $this->_db->getQuery(true) ->delete($this->_tbl); $this->appendPrimaryKeys($query, $pk); $this->_db->setQuery($query); // Check for a database error. $this->_db->execute(); // Implement JObservableInterface: Post-processing by observers $this->_observers->update('onAfterDelete', array($pk)); return true; } /** * Method to check a row out if the necessary properties/fields exist. To * prevent race conditions while editing rows in a database, a row can be * checked out if the fields 'checked_out' and 'checked_out_time' are available. * While a row is checked out, any attempt to store the row by a user other * than the one who checked the row out should be held until the row is checked * in again. * * @param integer $userId The Id of the user checking out the row. * @param mixed $pk An optional primary key value to check out. If not set * the instance property value is used. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/checkOut * @since 11.1 * @throws UnexpectedValueException */ public function checkOut($userId, $pk = null) { // If there is no checked_out or checked_out_time field, just return true. if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) { return true; } if (is_null($pk)) { $pk = array(); foreach ($this->_tbl_keys AS $key) { $pk[$key] = $this->$key; } } elseif (!is_array($pk)) { $pk = array($this->_tbl_key => $pk); } foreach ($this->_tbl_keys AS $key) { $pk[$key] = is_null($pk[$key]) ? $this->$key : $pk[$key]; if ($pk[$key] === null) { throw new UnexpectedValueException('Null primary key not allowed.'); } } // Get the current time in the database format. $time = JFactory::getDate()->toSql(); // Check the row out by primary key. $query = $this->_db->getQuery(true) ->update($this->_tbl) ->set($this->_db->quoteName($this->getColumnAlias('checked_out')) . ' = ' . (int) $userId) ->set($this->_db->quoteName($this->getColumnAlias('checked_out_time')) . ' = ' . $this->_db->quote($time)); $this->appendPrimaryKeys($query, $pk); $this->_db->setQuery($query); $this->_db->execute(); // Set table values in the object. $this->checked_out = (int) $userId; $this->checked_out_time = $time; return true; } /** * Method to check a row in if the necessary properties/fields exist. Checking * a row in will allow other users the ability to edit the row. * * @param mixed $pk An optional primary key value to check out. If not set the instance property value is used. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/checkIn * @since 11.1 * @throws UnexpectedValueException */ public function checkIn($pk = null) { // If there is no checked_out or checked_out_time field, just return true. if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) { return true; } if (is_null($pk)) { $pk = array(); foreach ($this->_tbl_keys AS $key) { $pk[$this->$key] = $this->$key; } } elseif (!is_array($pk)) { $pk = array($this->_tbl_key => $pk); } foreach ($this->_tbl_keys AS $key) { $pk[$key] = empty($pk[$key]) ? $this->$key : $pk[$key]; if ($pk[$key] === null) { throw new UnexpectedValueException('Null primary key not allowed.'); } } // Check the row in by primary key. $query = $this->_db->getQuery(true) ->update($this->_tbl) ->set($this->_db->quoteName($this->getColumnAlias('checked_out')) . ' = 0') ->set($this->_db->quoteName($this->getColumnAlias('checked_out_time')) . ' = ' . $this->_db->quote($this->_db->getNullDate())); $this->appendPrimaryKeys($query, $pk); $this->_db->setQuery($query); // Check for a database error. $this->_db->execute(); // Set table values in the object. $this->checked_out = 0; $this->checked_out_time = ''; return true; } /** * Validate that the primary key has been set. * * @return boolean True if the primary key(s) have been set. * * @since 12.3 */ public function hasPrimaryKey() { if ($this->_autoincrement) { $empty = true; foreach ($this->_tbl_keys as $key) { $empty = $empty && empty($this->$key); } } else { $query = $this->_db->getQuery(true) ->select('COUNT(*)') ->from($this->_tbl); $this->appendPrimaryKeys($query); $this->_db->setQuery($query); $count = $this->_db->loadResult(); if ($count == 1) { $empty = false; } else { $empty = true; } } return !$empty; } /** * Method to increment the hits for a row if the necessary property/field exists. * * @param mixed $pk An optional primary key value to increment. If not set the instance property value is used. * * @return boolean True on success. * * @link https://docs.joomla.org/JTable/hit * @since 11.1 * @throws UnexpectedValueException */ public function hit($pk = null) { // If there is no hits field, just return true. if (!property_exists($this, 'hits')) { return true; } if (is_null($pk)) { $pk = array(); foreach ($this->_tbl_keys AS $key) { $pk[$key] = $this->$key; } } elseif (!is_array($pk)) { $pk = array($this->_tbl_key => $pk); } foreach ($this->_tbl_keys AS $key) { $pk[$key] = is_null($pk[$key]) ? $this->$key : $pk[$key]; if ($pk[$key] === null) { throw new UnexpectedValueException('Null primary key not allowed.'); } } // Check the row in by primary key. $query = $this->_db->getQuery(true) ->update($this->_tbl) ->set($this->_db->quoteName($this->getColumnAlias('hits')) . ' = (' . $this->_db->quoteName($this->getColumnAlias('hits')) . ' + 1)'); $this->appendPrimaryKeys($query, $pk); $this->_db->setQuery($query); $this->_db->execute(); // Set table values in the object. $this->hits++; return true; } /** * Method to determine if a row is checked out and therefore uneditable by * a user. If the row is checked out by the same user, then it is considered * not checked out -- as the user can still edit it. * * @param integer $with The userid to preform the match with, if an item is checked * out by this user the function will return false. * @param integer $against The userid to perform the match against when the function * is used as a static function. * * @return boolean True if checked out. * * @link https://docs.joomla.org/JTable/isCheckedOut * @since 11.1 */ public function isCheckedOut($with = 0, $against = null) { // Handle the non-static case. if (isset($this) && ($this instanceof JTable) && is_null($against)) { $against = $this->get('checked_out'); } // The item is not checked out or is checked out by the same user. if (!$against || ($against == $with)) { return false; } $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('COUNT(userid)') ->from($db->quoteName('#__session')) ->where($db->quoteName('userid') . ' = ' . (int) $against); $db->setQuery($query); $checkedOut = (boolean) $db->loadResult(); // If a session exists for the user then it is checked out. return $checkedOut; } /** * Method to get the next ordering value for a group of rows defined by an SQL WHERE clause. * This is useful for placing a new item last in a group of items in the table. * * @param string $where WHERE clause to use for selecting the MAX(ordering) for the table. * * @return mixed Boolean false an failure or the next ordering value as an integer. * * @link https://docs.joomla.org/JTable/getNextOrder * @since 11.1 * @throws UnexpectedValueException */ public function getNextOrder($where = '') { // If there is no ordering field set an error and return false. if (!property_exists($this, 'ordering')) { throw new UnexpectedValueException(sprintf('%s does not support ordering.', get_class($this))); } // Get the largest ordering value for a given where clause. $query = $this->_db->getQuery(true) ->select('MAX(ordering)') ->from($this->_tbl); if ($where) { $query->where($where); } $this->_db->setQuery($query); $max = (int) $this->_db->loadResult(); // Return the largest ordering value + 1. return ($max + 1); } /** * Get the primary key values for this table using passed in values as a default. * * @param array $keys Optional primary key values to use. * * @return array An array of primary key names and values. * * @since 12.3 */ public function getPrimaryKey(array $keys = array()) { foreach ($this->_tbl_keys as $key) { if (!isset($keys[$key])) { if (!empty($this->$key)) { $keys[$key] = $this->$key; } } } return $keys; } /** * Method to compact the ordering values of rows in a group of rows * defined by an SQL WHERE clause. * * @param string $where WHERE clause to use for limiting the selection of rows to compact the ordering values. * * @return mixed Boolean True on success. * * @link https://docs.joomla.org/JTable/reorder * @since 11.1 * @throws UnexpectedValueException */ public function reorder($where = '') { // If there is no ordering field set an error and return false. if (!property_exists($this, 'ordering')) { throw new UnexpectedValueException(sprintf('%s does not support ordering.', get_class($this))); } $k = $this->_tbl_key; // Get the primary keys and ordering values for the selection. $query = $this->_db->getQuery(true) ->select(implode(',', $this->_tbl_keys) . ', ordering') ->from($this->_tbl) ->where('ordering >= 0') ->order('ordering'); // Setup the extra where and ordering clause data. if ($where) { $query->where($where); } $this->_db->setQuery($query); $rows = $this->_db->loadObjectList(); // Compact the ordering values. foreach ($rows as $i => $row) { // Make sure the ordering is a positive integer. if ($row->ordering >= 0) { // Only update rows that are necessary. if ($row->ordering != $i + 1) { // Update the row ordering field. $query->clear() ->update($this->_tbl) ->set('ordering = ' . ($i + 1)); $this->appendPrimaryKeys($query, $row); $this->_db->setQuery($query); $this->_db->execute(); } } } return true; } /** * Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause. * Negative numbers move the row up in the sequence and positive numbers move it down. * * @param integer $delta The direction and magnitude to move the row in the ordering sequence. * @param string $where WHERE clause to use for limiting the selection of rows to compact the * ordering values. * * @return mixed Boolean True on success. * * @link https://docs.joomla.org/JTable/move * @since 11.1 * @throws UnexpectedValueException */ public function move($delta, $where = '') { // If there is no ordering field set an error and return false. if (!property_exists($this, 'ordering')) { throw new UnexpectedValueException(sprintf('%s does not support ordering.', get_class($this))); } // If the change is none, do nothing. if (empty($delta)) { return true; } $k = $this->_tbl_key; $row = null; $query = $this->_db->getQuery(true); // Select the primary key and ordering values from the table. $query->select(implode(',', $this->_tbl_keys) . ', ordering') ->from($this->_tbl); // If the movement delta is negative move the row up. if ($delta < 0) { $query->where('ordering < ' . (int) $this->ordering) ->order('ordering DESC'); } // If the movement delta is positive move the row down. elseif ($delta > 0) { $query->where('ordering > ' . (int) $this->ordering) ->order('ordering ASC'); } // Add the custom WHERE clause if set. if ($where) { $query->where($where); } // Select the first row with the criteria. $this->_db->setQuery($query, 0, 1); $row = $this->_db->loadObject(); // If a row is found, move the item. if (!empty($row)) { // Update the ordering field for this instance to the row's ordering value. $query->clear() ->update($this->_tbl) ->set('ordering = ' . (int) $row->ordering); $this->appendPrimaryKeys($query); $this->_db->setQuery($query); $this->_db->execute(); // Update the ordering field for the row to this instance's ordering value. $query->clear() ->update($this->_tbl) ->set('ordering = ' . (int) $this->ordering); $this->appendPrimaryKeys($query, $row); $this->_db->setQuery($query); $this->_db->execute(); // Update the instance value. $this->ordering = $row->ordering; } else { // Update the ordering field for this instance. $query->clear() ->update($this->_tbl) ->set('ordering = ' . (int) $this->ordering); $this->appendPrimaryKeys($query); $this->_db->setQuery($query); $this->_db->execute(); } return true; } /** * Method to set the publishing state for a row or list of rows in the database * table. The method respects checked out rows by other users and will attempt * to checkin rows that it can after adjustments are made. * * @param mixed $pks An optional array of primary key values to update. * If not set the instance property value is used. * @param integer $state The publishing state. eg. [0 = unpublished, 1 = published] * @param integer $userId The user id of the user performing the operation. * * @return boolean True on success; false if $pks is empty. * * @link https://docs.joomla.org/JTable/publish * @since 11.1 */ public function publish($pks = null, $state = 1, $userId = 0) { // Sanitize input $userId = (int) $userId; $state = (int) $state; if (!is_null($pks)) { if (!is_array($pks)) { $pks = array($pks); } foreach ($pks as $key => $pk) { if (!is_array($pk)) { $pks[$key] = array($this->_tbl_key => $pk); } } } // If there are no primary keys set check to see if the instance key is set. if (empty($pks)) { $pk = array(); foreach ($this->_tbl_keys AS $key) { if ($this->$key) { $pk[$key] = $this->$key; } // We don't have a full primary key - return false else { $this->setError(JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED')); return false; } } $pks = array($pk); } foreach ($pks as $pk) { // Update the publishing state for rows with the given primary keys. $query = $this->_db->getQuery(true) ->update($this->_tbl) ->set($this->_db->quoteName($this->getColumnAlias('published')) . ' = ' . (int) $state); // Determine if there is checkin support for the table. if (property_exists($this, 'checked_out') || property_exists($this, 'checked_out_time')) { $query->where('(' . $this->getColumnAlias('checked_out') . ' = 0 OR ' . $this->getColumnAlias('checked_out') . ' = ' . (int) $userId . ')'); $checkin = true; } else { $checkin = false; } // Build the WHERE clause for the primary keys. $this->appendPrimaryKeys($query, $pk); $this->_db->setQuery($query); try { $this->_db->execute(); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } // If checkin is supported and all rows were adjusted, check them in. if ($checkin && (count($pks) == $this->_db->getAffectedRows())) { $this->checkin($pk); } // If the JTable instance value is in the list of primary keys that were set, set the instance. $ours = true; foreach ($this->_tbl_keys AS $key) { if ($this->$key != $pk[$key]) { $ours = false; } } if ($ours) { $publishedField = $this->getColumnAlias('published'); $this->$publishedField = $state; } } $this->setError(''); return true; } /** * Method to lock the database table for writing. * * @return boolean True on success. * * @since 11.1 * @throws RuntimeException */ protected function _lock() { $this->_db->lockTable($this->_tbl); $this->_locked = true; return true; } /** * Method to return the real name of a "special" column such as ordering, hits, published * etc etc. In this way you are free to follow your db naming convention and use the * built in Joomla functions. * * @param string $column Name of the "special" column (ie ordering, hits) * * @return string The string that identify the special * * @since 3.4 */ public function getColumnAlias($column) { // Get the column data if set if (isset($this->_columnAlias[$column])) { $return = $this->_columnAlias[$column]; } else { $return = $column; } // Sanitize the name $return = preg_replace('#[^A-Z0-9_]#i', '', $return); return $return; } /** * Method to register a column alias for a "special" column. * * @param string $column The "special" column (ie ordering) * @param string $columnAlias The real column name (ie foo_ordering) * * @return void * * @since 3.4 */ public function setColumnAlias($column, $columnAlias) { // Santize the column name alias $column = strtolower($column); $column = preg_replace('#[^A-Z0-9_]#i', '', $column); // Set the column alias internally $this->_columnAlias[$column] = $columnAlias; } /** * Method to unlock the database table for writing. * * @return boolean True on success. * * @since 11.1 */ protected function _unlock() { $this->_db->unlockTables(); $this->_locked = false; return true; } } PK���\H� �JJ$libraries/joomla/table/extension.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Extension table * * @since 11.1 */ class JTableExtension extends JTable { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct($db) { parent::__construct('#__extensions', 'extension_id', $db); } /** * Overloaded check function * * @return boolean True if the object is ok * * @see JTable::check() * @since 11.1 */ public function check() { // Check for valid name if (trim($this->name) == '' || trim($this->element) == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_EXTENSION')); return false; } return true; } /** * Overloaded bind function * * @param array $array Named array * @param mixed $ignore An optional array or space separated list of properties * to ignore while binding. * * @return mixed Null if operation was satisfactory, otherwise returns an error * * @see JTable::bind() * @since 11.1 */ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { $registry = new Registry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } if (isset($array['control']) && is_array($array['control'])) { $registry = new Registry; $registry->loadArray($array['control']); $array['control'] = (string) $registry; } return parent::bind($array, $ignore); } /** * Method to create and execute a SELECT WHERE query. * * @param array $options Array of options * * @return string The database query result * * @since 11.1 */ public function find($options = array()) { // Get the JDatabaseQuery object $query = $this->_db->getQuery(true); foreach ($options as $col => $val) { $query->where($col . ' = ' . $this->_db->quote($val)); } $query->select($this->_db->quoteName('extension_id')) ->from($this->_db->quoteName('#__extensions')); $this->_db->setQuery($query); return $this->_db->loadResult(); } /** * Method to set the publishing state for a row or list of rows in the database * table. The method respects checked out rows by other users and will attempt * to checkin rows that it can after adjustments are made. * * @param mixed $pks An optional array of primary key values to update. If not * set the instance property value is used. * @param integer $state The publishing state. eg. [0 = unpublished, 1 = published] * @param integer $userId The user id of the user performing the operation. * * @return boolean True on success. * * @since 11.1 */ public function publish($pks = null, $state = 1, $userId = 0) { $k = $this->_tbl_key; // Sanitize input. JArrayHelper::toInteger($pks); $userId = (int) $userId; $state = (int) $state; // If there are no primary keys set check to see if the instance key is set. if (empty($pks)) { if ($this->$k) { $pks = array($this->$k); } // Nothing to set publishing state on, return false. else { $this->setError(JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED')); return false; } } // Build the WHERE clause for the primary keys. $where = $k . '=' . implode(' OR ' . $k . '=', $pks); // Determine if there is checkin support for the table. if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) { $checkin = ''; } else { $checkin = ' AND (checked_out = 0 OR checked_out = ' . (int) $userId . ')'; } // Update the publishing state for rows with the given primary keys. $query = $this->_db->getQuery(true) ->update($this->_db->quoteName($this->_tbl)) ->set($this->_db->quoteName('enabled') . ' = ' . (int) $state) ->where('(' . $where . ')' . $checkin); $this->_db->setQuery($query); $this->_db->execute(); // If checkin is supported and all rows were adjusted, check them in. if ($checkin && (count($pks) == $this->_db->getAffectedRows())) { // Checkin the rows. foreach ($pks as $pk) { $this->checkin($pk); } } // If the JTable instance value is in the list of primary keys that were set, set the instance. if (in_array($this->$k, $pks)) { $this->enabled = $state; } $this->setError(''); return true; } } PK���\E���!libraries/joomla/table/nested.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Table class supporting modified pre-order tree traversal behavior. * * @link https://docs.joomla.org/JTableNested * @since 11.1 */ class JTableNested extends JTable { /** * Object property holding the primary key of the parent node. Provides * adjacency list data for nodes. * * @var integer * @since 11.1 */ public $parent_id; /** * Object property holding the depth level of the node in the tree. * * @var integer * @since 11.1 */ public $level; /** * Object property holding the left value of the node for managing its * placement in the nested sets tree. * * @var integer * @since 11.1 */ public $lft; /** * Object property holding the right value of the node for managing its * placement in the nested sets tree. * * @var integer * @since 11.1 */ public $rgt; /** * Object property holding the alias of this node used to constuct the * full text path, forward-slash delimited. * * @var string * @since 11.1 */ public $alias; /** * Object property to hold the location type to use when storing the row. * Possible values are: ['before', 'after', 'first-child', 'last-child']. * * @var string * @since 11.1 */ protected $_location; /** * Object property to hold the primary key of the location reference node to * use when storing the row. A combination of location type and reference * node describes where to store the current node in the tree. * * @var integer * @since 11.1 */ protected $_location_id; /** * An array to cache values in recursive processes. * * @var array * @since 11.1 */ protected $_cache = array(); /** * Debug level * * @var integer * @since 11.1 */ protected $_debug = 0; /** * Cache for the root ID * * @var integer * @since 3.3 */ protected static $root_id = 0; /** * Sets the debug level on or off * * @param integer $level 0 = off, 1 = on * * @return void * * @since 11.1 */ public function debug($level) { $this->_debug = (int) $level; } /** * Method to get an array of nodes from a given node to its root. * * @param integer $pk Primary key of the node for which to get the path. * @param boolean $diagnostic Only select diagnostic data for the nested sets. * * @return mixed An array of node objects including the start node. * * @since 11.1 * @throws RuntimeException on database error */ public function getPath($pk = null, $diagnostic = false) { $k = $this->_tbl_key; $pk = (is_null($pk)) ? $this->$k : $pk; // Get the path from the node to the root. $select = ($diagnostic) ? 'p.' . $k . ', p.parent_id, p.level, p.lft, p.rgt' : 'p.*'; $query = $this->_db->getQuery(true) ->select($select) ->from($this->_tbl . ' AS n, ' . $this->_tbl . ' AS p') ->where('n.lft BETWEEN p.lft AND p.rgt') ->where('n.' . $k . ' = ' . (int) $pk) ->order('p.lft'); $this->_db->setQuery($query); return $this->_db->loadObjectList(); } /** * Method to get a node and all its child nodes. * * @param integer $pk Primary key of the node for which to get the tree. * @param boolean $diagnostic Only select diagnostic data for the nested sets. * * @return mixed Boolean false on failure or array of node objects on success. * * @since 11.1 * @throws RuntimeException on database error. */ public function getTree($pk = null, $diagnostic = false) { $k = $this->_tbl_key; $pk = (is_null($pk)) ? $this->$k : $pk; // Get the node and children as a tree. $select = ($diagnostic) ? 'n.' . $k . ', n.parent_id, n.level, n.lft, n.rgt' : 'n.*'; $query = $this->_db->getQuery(true) ->select($select) ->from($this->_tbl . ' AS n, ' . $this->_tbl . ' AS p') ->where('n.lft BETWEEN p.lft AND p.rgt') ->where('p.' . $k . ' = ' . (int) $pk) ->order('n.lft'); return $this->_db->setQuery($query)->loadObjectList(); } /** * Method to determine if a node is a leaf node in the tree (has no children). * * @param integer $pk Primary key of the node to check. * * @return boolean True if a leaf node, false if not or null if the node does not exist. * * @note Since 12.1 this method returns null if the node does not exist. * @since 11.1 * @throws RuntimeException on database error. */ public function isLeaf($pk = null) { $k = $this->_tbl_key; $pk = (is_null($pk)) ? $this->$k : $pk; $node = $this->_getNode($pk); // Get the node by primary key. if (empty($node)) { // Error message set in getNode method. return null; } // The node is a leaf node. return (($node->rgt - $node->lft) == 1); } /** * Method to set the location of a node in the tree object. This method does not * save the new location to the database, but will set it in the object so * that when the node is stored it will be stored in the new location. * * @param integer $referenceId The primary key of the node to reference new location by. * @param string $position Location type string. ['before', 'after', 'first-child', 'last-child'] * * @return void * * @note Since 12.1 this method returns void and throws an InvalidArgumentException when an invalid position is passed. * @since 11.1 * @throws InvalidArgumentException */ public function setLocation($referenceId, $position = 'after') { // Make sure the location is valid. if (($position != 'before') && ($position != 'after') && ($position != 'first-child') && ($position != 'last-child')) { throw new InvalidArgumentException(sprintf('%s::setLocation(%d, *%s*)', get_class($this), $referenceId, $position)); } // Set the location properties. $this->_location = $position; $this->_location_id = $referenceId; } /** * Method to move a row in the ordering sequence of a group of rows defined by an SQL WHERE clause. * Negative numbers move the row up in the sequence and positive numbers move it down. * * @param integer $delta The direction and magnitude to move the row in the ordering sequence. * @param string $where WHERE clause to use for limiting the selection of rows to compact the * ordering values. * * @return mixed Boolean true on success. * * @link https://docs.joomla.org/JTable/move * @since 11.1 */ public function move($delta, $where = '') { $k = $this->_tbl_key; $pk = $this->$k; $query = $this->_db->getQuery(true) ->select($k) ->from($this->_tbl) ->where('parent_id = ' . $this->parent_id); if ($where) { $query->where($where); } if ($delta > 0) { $query->where('rgt > ' . $this->rgt) ->order('rgt ASC'); $position = 'after'; } else { $query->where('lft < ' . $this->lft) ->order('lft DESC'); $position = 'before'; } $this->_db->setQuery($query); $referenceId = $this->_db->loadResult(); if ($referenceId) { return $this->moveByReference($referenceId, $position, $pk); } else { return false; } } /** * Method to move a node and its children to a new location in the tree. * * @param integer $referenceId The primary key of the node to reference new location by. * @param string $position Location type string. ['before', 'after', 'first-child', 'last-child'] * @param integer $pk The primary key of the node to move. * * @return boolean True on success. * * @link https://docs.joomla.org/JTableNested/moveByReference * @since 11.1 * @throws RuntimeException on database error. */ public function moveByReference($referenceId, $position = 'after', $pk = null) { // @codeCoverageIgnoreStart if ($this->_debug) { echo "\nMoving ReferenceId:$referenceId, Position:$position, PK:$pk"; } // @codeCoverageIgnoreEnd $k = $this->_tbl_key; $pk = (is_null($pk)) ? $this->$k : $pk; // Get the node by id. if (!$node = $this->_getNode($pk)) { // Error message set in getNode method. return false; } // Get the ids of child nodes. $query = $this->_db->getQuery(true) ->select($k) ->from($this->_tbl) ->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt); $children = $this->_db->setQuery($query)->loadColumn(); // @codeCoverageIgnoreStart if ($this->_debug) { $this->_logtable(false); } // @codeCoverageIgnoreEnd // Cannot move the node to be a child of itself. if (in_array($referenceId, $children)) { $e = new UnexpectedValueException( sprintf('%s::moveByReference(%d, %s, %d) parenting to child.', get_class($this), $referenceId, $position, $pk) ); $this->setError($e); return false; } // Lock the table for writing. if (!$this->_lock()) { return false; } /* * Move the sub-tree out of the nested sets by negating its left and right values. */ $query->clear() ->update($this->_tbl) ->set('lft = lft * (-1), rgt = rgt * (-1)') ->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt); $this->_db->setQuery($query); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_MOVE_FAILED'); /* * Close the hole in the tree that was opened by removing the sub-tree from the nested sets. */ // Compress the left values. $query->clear() ->update($this->_tbl) ->set('lft = lft - ' . (int) $node->width) ->where('lft > ' . (int) $node->rgt); $this->_db->setQuery($query); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_MOVE_FAILED'); // Compress the right values. $query->clear() ->update($this->_tbl) ->set('rgt = rgt - ' . (int) $node->width) ->where('rgt > ' . (int) $node->rgt); $this->_db->setQuery($query); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_MOVE_FAILED'); // We are moving the tree relative to a reference node. if ($referenceId) { // Get the reference node by primary key. if (!$reference = $this->_getNode($referenceId)) { // Error message set in getNode method. $this->_unlock(); return false; } // Get the reposition data for shifting the tree and re-inserting the node. if (!$repositionData = $this->_getTreeRepositionData($reference, $node->width, $position)) { // Error message set in getNode method. $this->_unlock(); return false; } } // We are moving the tree to be the last child of the root node else { // Get the last root node as the reference node. $query->clear() ->select($this->_tbl_key . ', parent_id, level, lft, rgt') ->from($this->_tbl) ->where('parent_id = 0') ->order('lft DESC'); $this->_db->setQuery($query, 0, 1); $reference = $this->_db->loadObject(); // @codeCoverageIgnoreStart if ($this->_debug) { $this->_logtable(false); } // @codeCoverageIgnoreEnd // Get the reposition data for re-inserting the node after the found root. if (!$repositionData = $this->_getTreeRepositionData($reference, $node->width, 'last-child')) { // Error message set in getNode method. $this->_unlock(); return false; } } /* * Create space in the nested sets at the new location for the moved sub-tree. */ // Shift left values. $query->clear() ->update($this->_tbl) ->set('lft = lft + ' . (int) $node->width) ->where($repositionData->left_where); $this->_db->setQuery($query); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_MOVE_FAILED'); // Shift right values. $query->clear() ->update($this->_tbl) ->set('rgt = rgt + ' . (int) $node->width) ->where($repositionData->right_where); $this->_db->setQuery($query); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_MOVE_FAILED'); /* * Calculate the offset between where the node used to be in the tree and * where it needs to be in the tree for left ids (also works for right ids). */ $offset = $repositionData->new_lft - $node->lft; $levelOffset = $repositionData->new_level - $node->level; // Move the nodes back into position in the tree using the calculated offsets. $query->clear() ->update($this->_tbl) ->set('rgt = ' . (int) $offset . ' - rgt') ->set('lft = ' . (int) $offset . ' - lft') ->set('level = level + ' . (int) $levelOffset) ->where('lft < 0'); $this->_db->setQuery($query); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_MOVE_FAILED'); // Set the correct parent id for the moved node if required. if ($node->parent_id != $repositionData->new_parent_id) { $query = $this->_db->getQuery(true) ->update($this->_tbl); // Update the title and alias fields if they exist for the table. $fields = $this->getFields(); if (property_exists($this, 'title') && $this->title !== null) { $query->set('title = ' . $this->_db->quote($this->title)); } if (array_key_exists('alias', $fields) && $this->alias !== null) { $query->set('alias = ' . $this->_db->quote($this->alias)); } $query->set('parent_id = ' . (int) $repositionData->new_parent_id) ->where($this->_tbl_key . ' = ' . (int) $node->$k); $this->_db->setQuery($query); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_MOVE_FAILED'); } // Unlock the table for writing. $this->_unlock(); // Set the object values. $this->parent_id = $repositionData->new_parent_id; $this->level = $repositionData->new_level; $this->lft = $repositionData->new_lft; $this->rgt = $repositionData->new_rgt; return true; } /** * Method to delete a node and, optionally, its child nodes from the table. * * @param integer $pk The primary key of the node to delete. * @param boolean $children True to delete child nodes, false to move them up a level. * * @return boolean True on success. * * @since 11.1 */ public function delete($pk = null, $children = true) { $k = $this->_tbl_key; $pk = (is_null($pk)) ? $this->$k : $pk; // Implement JObservableInterface: Pre-processing by observers $this->_observers->update('onBeforeDelete', array($pk)); // Lock the table for writing. if (!$this->_lock()) { // Error message set in lock method. return false; } // If tracking assets, remove the asset first. if ($this->_trackAssets) { $name = $this->_getAssetName(); $asset = JTable::getInstance('Asset', 'JTable', array('dbo', $this->getDbo())); // Lock the table for writing. if (!$asset->_lock()) { // Error message set in lock method. return false; } if ($asset->loadByName($name)) { // Delete the node in assets table. if (!$asset->delete(null, $children)) { $this->setError($asset->getError()); $asset->_unlock(); return false; } $asset->_unlock(); } else { $this->setError($asset->getError()); $asset->_unlock(); return false; } } // Get the node by id. $node = $this->_getNode($pk); if (empty($node)) { // Error message set in getNode method. $this->_unlock(); return false; } $query = $this->_db->getQuery(true); // Should we delete all children along with the node? if ($children) { // Delete the node and all of its children. $query->clear() ->delete($this->_tbl) ->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_DELETE_FAILED'); // Compress the left values. $query->clear() ->update($this->_tbl) ->set('lft = lft - ' . (int) $node->width) ->where('lft > ' . (int) $node->rgt); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_DELETE_FAILED'); // Compress the right values. $query->clear() ->update($this->_tbl) ->set('rgt = rgt - ' . (int) $node->width) ->where('rgt > ' . (int) $node->rgt); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_DELETE_FAILED'); } // Leave the children and move them up a level. else { // Delete the node. $query->clear() ->delete($this->_tbl) ->where('lft = ' . (int) $node->lft); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_DELETE_FAILED'); // Shift all node's children up a level. $query->clear() ->update($this->_tbl) ->set('lft = lft - 1') ->set('rgt = rgt - 1') ->set('level = level - 1') ->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_DELETE_FAILED'); // Adjust all the parent values for direct children of the deleted node. $query->clear() ->update($this->_tbl) ->set('parent_id = ' . (int) $node->parent_id) ->where('parent_id = ' . (int) $node->$k); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_DELETE_FAILED'); // Shift all of the left values that are right of the node. $query->clear() ->update($this->_tbl) ->set('lft = lft - 2') ->where('lft > ' . (int) $node->rgt); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_DELETE_FAILED'); // Shift all of the right values that are right of the node. $query->clear() ->update($this->_tbl) ->set('rgt = rgt - 2') ->where('rgt > ' . (int) $node->rgt); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_DELETE_FAILED'); } // Unlock the table for writing. $this->_unlock(); // Implement JObservableInterface: Post-processing by observers $this->_observers->update('onAfterDelete', array($pk)); return true; } /** * Checks that the object is valid and able to be stored. * * This method checks that the parent_id is non-zero and exists in the database. * Note that the root node (parent_id = 0) cannot be manipulated with this class. * * @return boolean True if all checks pass. * * @since 11.1 * @throws Exception * @throws RuntimeException on database error. * @throws UnexpectedValueException */ public function check() { $this->parent_id = (int) $this->parent_id; // Set up a mini exception handler. try { // Check that the parent_id field is valid. if ($this->parent_id == 0) { throw new UnexpectedValueException(sprintf('Invalid `parent_id` [%d] in %s', $this->parent_id, get_class($this))); } $query = $this->_db->getQuery(true) ->select('COUNT(' . $this->_tbl_key . ')') ->from($this->_tbl) ->where($this->_tbl_key . ' = ' . $this->parent_id); if (!$this->_db->setQuery($query)->loadResult()) { throw new UnexpectedValueException(sprintf('Invalid `parent_id` [%d] in %s', $this->parent_id, get_class($this))); } } catch (UnexpectedValueException $e) { // Validation error - record it and return false. $this->setError($e); return false; } // @codeCoverageIgnoreStart catch (Exception $e) { // Database error - rethrow. throw $e; } // @codeCoverageIgnoreEnd return true; } /** * Method to store a node in the database table. * * @param boolean $updateNulls True to update null values as well. * * @return boolean True on success. * * @link https://docs.joomla.org/JTableNested/store * @since 11.1 */ public function store($updateNulls = false) { $k = $this->_tbl_key; // Implement JObservableInterface: Pre-processing by observers // 2.5 upgrade issue - check if property_exists before executing if (property_exists($this, '_observers')) { $this->_observers->update('onBeforeStore', array($updateNulls, $k)); } // @codeCoverageIgnoreStart if ($this->_debug) { echo "\n" . get_class($this) . "::store\n"; $this->_logtable(true, false); } // @codeCoverageIgnoreEnd /* * If the primary key is empty, then we assume we are inserting a new node into the * tree. From this point we would need to determine where in the tree to insert it. */ if (empty($this->$k)) { /* * We are inserting a node somewhere in the tree with a known reference * node. We have to make room for the new node and set the left and right * values before we insert the row. */ if ($this->_location_id >= 0) { // Lock the table for writing. if (!$this->_lock()) { // Error message set in lock method. return false; } // We are inserting a node relative to the last root node. if ($this->_location_id == 0) { // Get the last root node as the reference node. $query = $this->_db->getQuery(true) ->select($this->_tbl_key . ', parent_id, level, lft, rgt') ->from($this->_tbl) ->where('parent_id = 0') ->order('lft DESC'); $this->_db->setQuery($query, 0, 1); $reference = $this->_db->loadObject(); // @codeCoverageIgnoreStart if ($this->_debug) { $this->_logtable(false); } // @codeCoverageIgnoreEnd } // We have a real node set as a location reference. else { // Get the reference node by primary key. if (!$reference = $this->_getNode($this->_location_id)) { // Error message set in getNode method. $this->_unlock(); return false; } } // Get the reposition data for shifting the tree and re-inserting the node. if (!($repositionData = $this->_getTreeRepositionData($reference, 2, $this->_location))) { // Error message set in getNode method. $this->_unlock(); return false; } // Create space in the tree at the new location for the new node in left ids. $query = $this->_db->getQuery(true) ->update($this->_tbl) ->set('lft = lft + 2') ->where($repositionData->left_where); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_STORE_FAILED'); // Create space in the tree at the new location for the new node in right ids. $query->clear() ->update($this->_tbl) ->set('rgt = rgt + 2') ->where($repositionData->right_where); $this->_runQuery($query, 'JLIB_DATABASE_ERROR_STORE_FAILED'); // Set the object values. $this->parent_id = $repositionData->new_parent_id; $this->level = $repositionData->new_level; $this->lft = $repositionData->new_lft; $this->rgt = $repositionData->new_rgt; } else { // Negative parent ids are invalid $e = new UnexpectedValueException(sprintf('%s::store() used a negative _location_id', get_class($this))); $this->setError($e); return false; } } /* * If we have a given primary key then we assume we are simply updating this * node in the tree. We should assess whether or not we are moving the node * or just updating its data fields. */ else { // If the location has been set, move the node to its new location. if ($this->_location_id > 0) { if (!$this->moveByReference($this->_location_id, $this->_location, $this->$k)) { // Error message set in move method. return false; } } // Lock the table for writing. if (!$this->_lock()) { // Error message set in lock method. return false; } } // Implement JObservableInterface: We do not want parent::store to update observers, // since tables are locked and we are updating it from this level of store(): // 2.5 upgrade issue - check if property_exists before executing if (property_exists($this, '_observers')) { $oldCallObservers = $this->_observers->doCallObservers(false); } $result = parent::store($updateNulls); // Implement JObservableInterface: Restore previous callable observers state: // 2.5 upgrade issue - check if property_exists before executing if (property_exists($this, '_observers')) { $this->_observers->doCallObservers($oldCallObservers); } if ($result) { // @codeCoverageIgnoreStart if ($this->_debug) { $this->_logtable(); } // @codeCoverageIgnoreEnd } // Unlock the table for writing. $this->_unlock(); // Implement JObservableInterface: Post-processing by observers // 2.5 upgrade issue - check if property_exists before executing if (property_exists($this, '_observers')) { $this->_observers->update('onAfterStore', array(&$result)); } return $result; } /** * Method to set the publishing state for a node or list of nodes in the database * table. The method respects rows checked out by other users and will attempt * to checkin rows that it can after adjustments are made. The method will not * allow you to set a publishing state higher than any ancestor node and will * not allow you to set a publishing state on a node with a checked out child. * * @param mixed $pks An optional array of primary key values to update. If not * set the instance property value is used. * @param integer $state The publishing state. eg. [0 = unpublished, 1 = published] * @param integer $userId The user id of the user performing the operation. * * @return boolean True on success. * * @link https://docs.joomla.org/JTableNested/publish * @since 11.1 * @throws UnexpectedValueException */ public function publish($pks = null, $state = 1, $userId = 0) { $k = $this->_tbl_key; $query = $this->_db->getQuery(true); // Sanitize input. JArrayHelper::toInteger($pks); $userId = (int) $userId; $state = (int) $state; // If $state > 1, then we allow state changes even if an ancestor has lower state // (for example, can change a child state to Archived (2) if an ancestor is Published (1) $compareState = ($state > 1) ? 1 : $state; // If there are no primary keys set check to see if the instance key is set. if (empty($pks)) { if ($this->$k) { $pks = explode(',', $this->$k); } // Nothing to set publishing state on, return false. else { $e = new UnexpectedValueException(sprintf('%s::publish(%s, %d, %d) empty.', get_class($this), $pks, $state, $userId)); $this->setError($e); return false; } } // Determine if there is checkout support for the table. $checkoutSupport = (property_exists($this, 'checked_out') || property_exists($this, 'checked_out_time')); // Iterate over the primary keys to execute the publish action if possible. foreach ($pks as $pk) { // Get the node by primary key. if (!$node = $this->_getNode($pk)) { // Error message set in getNode method. return false; } // If the table has checkout support, verify no children are checked out. if ($checkoutSupport) { // Ensure that children are not checked out. $query->clear() ->select('COUNT(' . $k . ')') ->from($this->_tbl) ->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt) ->where('(checked_out <> 0 AND checked_out <> ' . (int) $userId . ')'); $this->_db->setQuery($query); // Check for checked out children. if ($this->_db->loadResult()) { // TODO Convert to a conflict exception when available. $e = new RuntimeException(sprintf('%s::publish(%s, %d, %d) checked-out conflict.', get_class($this), $pks, $state, $userId)); $this->setError($e); return false; } } // If any parent nodes have lower published state values, we cannot continue. if ($node->parent_id) { // Get any ancestor nodes that have a lower publishing state. $query->clear() ->select('n.' . $k) ->from($this->_db->quoteName($this->_tbl) . ' AS n') ->where('n.lft < ' . (int) $node->lft) ->where('n.rgt > ' . (int) $node->rgt) ->where('n.parent_id > 0') ->where('n.published < ' . (int) $compareState); // Just fetch one row (one is one too many). $this->_db->setQuery($query, 0, 1); $rows = $this->_db->loadColumn(); if (!empty($rows)) { $e = new UnexpectedValueException( sprintf('%s::publish(%s, %d, %d) ancestors have lower state.', get_class($this), $pks, $state, $userId) ); $this->setError($e); return false; } } // Update and cascade the publishing state. $query->clear() ->update($this->_db->quoteName($this->_tbl)) ->set('published = ' . (int) $state) ->where('(lft > ' . (int) $node->lft . ' AND rgt < ' . (int) $node->rgt . ') OR ' . $k . ' = ' . (int) $pk); $this->_db->setQuery($query)->execute(); // If checkout support exists for the object, check the row in. if ($checkoutSupport) { $this->checkin($pk); } } // If the JTable instance value is in the list of primary keys that were set, set the instance. if (in_array($this->$k, $pks)) { $this->published = $state; } $this->setError(''); return true; } /** * Method to move a node one position to the left in the same level. * * @param integer $pk Primary key of the node to move. * * @return boolean True on success. * * @since 11.1 * @throws RuntimeException on database error. */ public function orderUp($pk) { $k = $this->_tbl_key; $pk = (is_null($pk)) ? $this->$k : $pk; // Lock the table for writing. if (!$this->_lock()) { // Error message set in lock method. return false; } // Get the node by primary key. $node = $this->_getNode($pk); if (empty($node)) { // Error message set in getNode method. $this->_unlock(); return false; } // Get the left sibling node. $sibling = $this->_getNode($node->lft - 1, 'right'); if (empty($sibling)) { // Error message set in getNode method. $this->_unlock(); return false; } try { // Get the primary keys of child nodes. $query = $this->_db->getQuery(true) ->select($this->_tbl_key) ->from($this->_tbl) ->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt); $children = $this->_db->setQuery($query)->loadColumn(); // Shift left and right values for the node and its children. $query->clear() ->update($this->_tbl) ->set('lft = lft - ' . (int) $sibling->width) ->set('rgt = rgt - ' . (int) $sibling->width) ->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt); $this->_db->setQuery($query)->execute(); // Shift left and right values for the sibling and its children. $query->clear() ->update($this->_tbl) ->set('lft = lft + ' . (int) $node->width) ->set('rgt = rgt + ' . (int) $node->width) ->where('lft BETWEEN ' . (int) $sibling->lft . ' AND ' . (int) $sibling->rgt) ->where($this->_tbl_key . ' NOT IN (' . implode(',', $children) . ')'); $this->_db->setQuery($query)->execute(); } catch (RuntimeException $e) { $this->_unlock(); throw $e; } // Unlock the table for writing. $this->_unlock(); return true; } /** * Method to move a node one position to the right in the same level. * * @param integer $pk Primary key of the node to move. * * @return boolean True on success. * * @since 11.1 * @throws RuntimeException on database error. */ public function orderDown($pk) { $k = $this->_tbl_key; $pk = (is_null($pk)) ? $this->$k : $pk; // Lock the table for writing. if (!$this->_lock()) { // Error message set in lock method. return false; } // Get the node by primary key. $node = $this->_getNode($pk); if (empty($node)) { // Error message set in getNode method. $this->_unlock(); return false; } $query = $this->_db->getQuery(true); // Get the right sibling node. $sibling = $this->_getNode($node->rgt + 1, 'left'); if (empty($sibling)) { // Error message set in getNode method. $query->_unlock($this->_db); $this->_locked = false; return false; } try { // Get the primary keys of child nodes. $query->clear() ->select($this->_tbl_key) ->from($this->_tbl) ->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt); $this->_db->setQuery($query); $children = $this->_db->loadColumn(); // Shift left and right values for the node and its children. $query->clear() ->update($this->_tbl) ->set('lft = lft + ' . (int) $sibling->width) ->set('rgt = rgt + ' . (int) $sibling->width) ->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt); $this->_db->setQuery($query)->execute(); // Shift left and right values for the sibling and its children. $query->clear() ->update($this->_tbl) ->set('lft = lft - ' . (int) $node->width) ->set('rgt = rgt - ' . (int) $node->width) ->where('lft BETWEEN ' . (int) $sibling->lft . ' AND ' . (int) $sibling->rgt) ->where($this->_tbl_key . ' NOT IN (' . implode(',', $children) . ')'); $this->_db->setQuery($query)->execute(); } catch (RuntimeException $e) { $this->_unlock(); throw $e; } // Unlock the table for writing. $this->_unlock(); return true; } /** * Gets the ID of the root item in the tree * * @return mixed The primary id of the root row, or false if not found and the internal error is set. * * @since 11.1 */ public function getRootId() { if ((int) self::$root_id > 0) { return self::$root_id; } // Get the root item. $k = $this->_tbl_key; // Test for a unique record with parent_id = 0 $query = $this->_db->getQuery(true) ->select($k) ->from($this->_tbl) ->where('parent_id = 0'); $result = $this->_db->setQuery($query)->loadColumn(); if (count($result) == 1) { self::$root_id = $result[0]; return self::$root_id; } // Test for a unique record with lft = 0 $query->clear() ->select($k) ->from($this->_tbl) ->where('lft = 0'); $result = $this->_db->setQuery($query)->loadColumn(); if (count($result) == 1) { self::$root_id = $result[0]; return self::$root_id; } $fields = $this->getFields(); if (array_key_exists('alias', $fields)) { // Test for a unique record alias = root $query->clear() ->select($k) ->from($this->_tbl) ->where('alias = ' . $this->_db->quote('root')); $result = $this->_db->setQuery($query)->loadColumn(); if (count($result) == 1) { self::$root_id = $result[0]; return self::$root_id; } } $e = new UnexpectedValueException(sprintf('%s::getRootId', get_class($this))); $this->setError($e); self::$root_id = false; return false; } /** * Method to recursively rebuild the whole nested set tree. * * @param integer $parentId The root of the tree to rebuild. * @param integer $leftId The left id to start with in building the tree. * @param integer $level The level to assign to the current nodes. * @param string $path The path to the current nodes. * * @return integer 1 + value of root rgt on success, false on failure * * @link https://docs.joomla.org/JTableNested/rebuild * @since 11.1 * @throws RuntimeException on database error. */ public function rebuild($parentId = null, $leftId = 0, $level = 0, $path = '') { // If no parent is provided, try to find it. if ($parentId === null) { // Get the root item. $parentId = $this->getRootId(); if ($parentId === false) { return false; } } $query = $this->_db->getQuery(true); // Build the structure of the recursive query. if (!isset($this->_cache['rebuild.sql'])) { $query->clear() ->select($this->_tbl_key . ', alias') ->from($this->_tbl) ->where('parent_id = %d'); // If the table has an ordering field, use that for ordering. if (property_exists($this, 'ordering')) { $query->order('parent_id, ordering, lft'); } else { $query->order('parent_id, lft'); } $this->_cache['rebuild.sql'] = (string) $query; } // Make a shortcut to database object. // Assemble the query to find all children of this node. $this->_db->setQuery(sprintf($this->_cache['rebuild.sql'], (int) $parentId)); $children = $this->_db->loadObjectList(); // The right value of this node is the left value + 1 $rightId = $leftId + 1; // Execute this function recursively over all children foreach ($children as $node) { /* * $rightId is the current right value, which is incremented on recursion return. * Increment the level for the children. * Add this item's alias to the path (but avoid a leading /) */ $rightId = $this->rebuild($node->{$this->_tbl_key}, $rightId, $level + 1, $path . (empty($path) ? '' : '/') . $node->alias); // If there is an update failure, return false to break out of the recursion. if ($rightId === false) { return false; } } // We've got the left value, and now that we've processed // the children of this node we also know the right value. $query->clear() ->update($this->_tbl) ->set('lft = ' . (int) $leftId) ->set('rgt = ' . (int) $rightId) ->set('level = ' . (int) $level) ->set('path = ' . $this->_db->quote($path)) ->where($this->_tbl_key . ' = ' . (int) $parentId); $this->_db->setQuery($query)->execute(); // Return the right value of this node + 1. return $rightId + 1; } /** * Method to rebuild the node's path field from the alias values of the * nodes from the current node to the root node of the tree. * * @param integer $pk Primary key of the node for which to get the path. * * @return boolean True on success. * * @link https://docs.joomla.org/JTableNested/rebuildPath * @since 11.1 */ public function rebuildPath($pk = null) { $fields = $this->getFields(); // If there is no alias or path field, just return true. if (!array_key_exists('alias', $fields) || !array_key_exists('path', $fields)) { return true; } $k = $this->_tbl_key; $pk = (is_null($pk)) ? $this->$k : $pk; // Get the aliases for the path from the node to the root node. $query = $this->_db->getQuery(true) ->select('p.alias') ->from($this->_tbl . ' AS n, ' . $this->_tbl . ' AS p') ->where('n.lft BETWEEN p.lft AND p.rgt') ->where('n.' . $this->_tbl_key . ' = ' . (int) $pk) ->order('p.lft'); $this->_db->setQuery($query); $segments = $this->_db->loadColumn(); // Make sure to remove the root path if it exists in the list. if ($segments[0] == 'root') { array_shift($segments); } // Build the path. $path = trim(implode('/', $segments), ' /\\'); // Update the path field for the node. $query->clear() ->update($this->_tbl) ->set('path = ' . $this->_db->quote($path)) ->where($this->_tbl_key . ' = ' . (int) $pk); $this->_db->setQuery($query)->execute(); // Update the current record's path to the new one: $this->path = $path; return true; } /** * Method to reset class properties to the defaults set in the class * definition. It will ignore the primary key as well as any private class * properties (except $_errors). * * @return void * * @since 3.2.1 */ public function reset() { parent::reset(); // Reset the location properties. $this->setLocation(0); } /** * Method to update order of table rows * * @param array $idArray id numbers of rows to be reordered. * @param array $lft_array lft values of rows to be reordered. * * @return integer 1 + value of root rgt on success, false on failure. * * @since 11.1 * @throws Exception on database error. */ public function saveorder($idArray = null, $lft_array = null) { try { $query = $this->_db->getQuery(true); // Validate arguments if (is_array($idArray) && is_array($lft_array) && count($idArray) == count($lft_array)) { for ($i = 0, $count = count($idArray); $i < $count; $i++) { // Do an update to change the lft values in the table for each id $query->clear() ->update($this->_tbl) ->where($this->_tbl_key . ' = ' . (int) $idArray[$i]) ->set('lft = ' . (int) $lft_array[$i]); $this->_db->setQuery($query)->execute(); // @codeCoverageIgnoreStart if ($this->_debug) { $this->_logtable(); } // @codeCoverageIgnoreEnd } return $this->rebuild(); } else { return false; } } catch (Exception $e) { $this->_unlock(); throw $e; } } /** * Method to get nested set properties for a node in the tree. * * @param integer $id Value to look up the node by. * @param string $key An optional key to look up the node by (parent | left | right). * If omitted, the primary key of the table is used. * * @return mixed Boolean false on failure or node object on success. * * @since 11.1 * @throws RuntimeException on database error. */ protected function _getNode($id, $key = null) { // Determine which key to get the node base on. switch ($key) { case 'parent': $k = 'parent_id'; break; case 'left': $k = 'lft'; break; case 'right': $k = 'rgt'; break; default: $k = $this->_tbl_key; break; } // Get the node data. $query = $this->_db->getQuery(true) ->select($this->_tbl_key . ', parent_id, level, lft, rgt') ->from($this->_tbl) ->where($k . ' = ' . (int) $id); $row = $this->_db->setQuery($query, 0, 1)->loadObject(); // Check for no $row returned if (empty($row)) { $e = new UnexpectedValueException(sprintf('%s::_getNode(%d, %s) failed.', get_class($this), $id, $key)); $this->setError($e); return false; } // Do some simple calculations. $row->numChildren = (int) ($row->rgt - $row->lft - 1) / 2; $row->width = (int) $row->rgt - $row->lft + 1; return $row; } /** * Method to get various data necessary to make room in the tree at a location * for a node and its children. The returned data object includes conditions * for SQL WHERE clauses for updating left and right id values to make room for * the node as well as the new left and right ids for the node. * * @param object $referenceNode A node object with at least a 'lft' and 'rgt' with * which to make room in the tree around for a new node. * @param integer $nodeWidth The width of the node for which to make room in the tree. * @param string $position The position relative to the reference node where the room * should be made. * * @return mixed Boolean false on failure or data object on success. * * @since 11.1 */ protected function _getTreeRepositionData($referenceNode, $nodeWidth, $position = 'before') { // Make sure the reference an object with a left and right id. if (!is_object($referenceNode) || !(isset($referenceNode->lft) && isset($referenceNode->rgt))) { return false; } // A valid node cannot have a width less than 2. if ($nodeWidth < 2) { return false; } $k = $this->_tbl_key; $data = new stdClass; // Run the calculations and build the data object by reference position. switch ($position) { case 'first-child': $data->left_where = 'lft > ' . $referenceNode->lft; $data->right_where = 'rgt >= ' . $referenceNode->lft; $data->new_lft = $referenceNode->lft + 1; $data->new_rgt = $referenceNode->lft + $nodeWidth; $data->new_parent_id = $referenceNode->$k; $data->new_level = $referenceNode->level + 1; break; case 'last-child': $data->left_where = 'lft > ' . ($referenceNode->rgt); $data->right_where = 'rgt >= ' . ($referenceNode->rgt); $data->new_lft = $referenceNode->rgt; $data->new_rgt = $referenceNode->rgt + $nodeWidth - 1; $data->new_parent_id = $referenceNode->$k; $data->new_level = $referenceNode->level + 1; break; case 'before': $data->left_where = 'lft >= ' . $referenceNode->lft; $data->right_where = 'rgt >= ' . $referenceNode->lft; $data->new_lft = $referenceNode->lft; $data->new_rgt = $referenceNode->lft + $nodeWidth - 1; $data->new_parent_id = $referenceNode->parent_id; $data->new_level = $referenceNode->level; break; default: case 'after': $data->left_where = 'lft > ' . $referenceNode->rgt; $data->right_where = 'rgt > ' . $referenceNode->rgt; $data->new_lft = $referenceNode->rgt + 1; $data->new_rgt = $referenceNode->rgt + $nodeWidth; $data->new_parent_id = $referenceNode->parent_id; $data->new_level = $referenceNode->level; break; } // @codeCoverageIgnoreStart if ($this->_debug) { echo "\nRepositioning Data for $position" . "\n-----------------------------------" . "\nLeft Where: $data->left_where" . "\nRight Where: $data->right_where" . "\nNew Lft: $data->new_lft" . "\nNew Rgt: $data->new_rgt" . "\nNew Parent ID: $data->new_parent_id" . "\nNew Level: $data->new_level" . "\n"; } // @codeCoverageIgnoreEnd return $data; } /** * Method to create a log table in the buffer optionally showing the query and/or data. * * @param boolean $showData True to show data * @param boolean $showQuery True to show query * * @return void * * @codeCoverageIgnore * @since 11.1 */ protected function _logtable($showData = true, $showQuery = true) { $sep = "\n" . str_pad('', 40, '-'); $buffer = ''; if ($showQuery) { $buffer .= "\n" . $this->_db->getQuery() . $sep; } if ($showData) { $query = $this->_db->getQuery(true) ->select($this->_tbl_key . ', parent_id, lft, rgt, level') ->from($this->_tbl) ->order($this->_tbl_key); $this->_db->setQuery($query); $rows = $this->_db->loadRowList(); $buffer .= sprintf("\n| %4s | %4s | %4s | %4s |", $this->_tbl_key, 'par', 'lft', 'rgt'); $buffer .= $sep; foreach ($rows as $row) { $buffer .= sprintf("\n| %4s | %4s | %4s | %4s |", $row[0], $row[1], $row[2], $row[3]); } $buffer .= $sep; } echo $buffer; } /** * Runs a query and unlocks the database on an error. * * @param mixed $query A string or JDatabaseQuery object. * @param string $errorMessage Unused. * * @return boolean void * * @note Since 12.1 this method returns void and will rethrow the database exception. * @since 11.1 * @throws Exception on database error. */ protected function _runQuery($query, $errorMessage) { // Prepare to catch an exception. try { $this->_db->setQuery($query)->execute(); // @codeCoverageIgnoreStart if ($this->_debug) { $this->_logtable(); } // @codeCoverageIgnoreEnd } catch (Exception $e) { // Unlock the tables and rethrow. $this->_unlock(); throw $e; } } } PK���\��~LL(libraries/joomla/table/observer/tags.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Abstract class defining methods that can be * implemented by an Observer class of a JTable class (which is an Observable). * Attaches $this Observer to the $table in the constructor. * The classes extending this class should not be instanciated directly, as they * are automatically instanciated by the JObserverMapper * * @link https://docs.joomla.org/JTableObserver * @since 3.1.2 */ class JTableObserverTags extends JTableObserver { /** * Helper object for managing tags * * @var JHelperTags * @since 3.1.2 */ protected $tagsHelper; /** * The pattern for this table's TypeAlias * * @var string * @since 3.1.2 */ protected $typeAliasPattern = null; /** * Override for postStoreProcess param newTags, Set by setNewTags, used by onAfterStore and onBeforeStore * * @var array * @since 3.1.2 */ protected $newTags = false; /** * Override for postStoreProcess param replaceTags. Set by setNewTags, used by onAfterStore * * @var boolean * @since 3.1.2 */ protected $replaceTags = true; /** * Not public, so marking private and deprecated, but needed internally in parseTypeAlias for * PHP < 5.4.0 as it's not passing context $this to closure function. * * @var JTableObserverTags * @since 3.1.2 * @deprecated Never use this * @private */ public static $_myTableForPregreplaceOnly; /** * Creates the associated observer instance and attaches it to the $observableObject * Creates the associated tags helper class instance * $typeAlias can be of the form "{variableName}.type", automatically replacing {variableName} with table-instance variables variableName * * @param JObservableInterface $observableObject The subject object to be observed * @param array $params ( 'typeAlias' => $typeAlias ) * * @return JTableObserverTags * * @since 3.1.2 */ public static function createObserver(JObservableInterface $observableObject, $params = array()) { $typeAlias = $params['typeAlias']; $observer = new self($observableObject); $observer->tagsHelper = new JHelperTags; $observer->typeAliasPattern = $typeAlias; return $observer; } /** * Pre-processor for $table->store($updateNulls) * * @param boolean $updateNulls The result of the load * @param string $tableKey The key of the table * * @return void * * @since 3.1.2 */ public function onBeforeStore($updateNulls, $tableKey) { $this->parseTypeAlias(); if (empty($this->table->tagsHelper->tags)) { $this->tagsHelper->preStoreProcess($this->table); } else { $this->tagsHelper->preStoreProcess($this->table, (array) $this->table->tagsHelper->tags); } } /** * Post-processor for $table->store($updateNulls) * You can change optional params newTags and replaceTags of tagsHelper with method setNewTagsToAdd * * @param boolean &$result The result of the load * * @return void * * @since 3.1.2 */ public function onAfterStore(&$result) { if ($result) { if (empty($this->table->tagsHelper->tags)) { $result = $this->tagsHelper->postStoreProcess($this->table); } else { $result = $this->tagsHelper->postStoreProcess($this->table, $this->table->tagsHelper->tags); } // Restore default values for the optional params: $this->newTags = array(); $this->replaceTags = true; } } /** * Pre-processor for $table->delete($pk) * * @param mixed $pk An optional primary key value to delete. If not set the instance property value is used. * * @return void * * @since 3.1.2 * @throws UnexpectedValueException */ public function onBeforeDelete($pk) { $this->parseTypeAlias(); $this->tagsHelper->deleteTagData($this->table, $pk); } /** * Sets the new tags to be added or to replace existing tags * * @param array $newTags New tags to be added to or replace current tags for an item * @param boolean $replaceTags Replace tags (true) or add them (false) * * @return boolean * * @since 3.1.2 */ public function setNewTags($newTags, $replaceTags) { $this->parseTypeAlias(); return $this->tagsHelper->postStoreProcess($this->table, $newTags, $replaceTags); } /** * Internal method * Parses a TypeAlias of the form "{variableName}.type", replacing {variableName} with table-instance variables variableName * Storing result into $this->tagsHelper->typeAlias * * @return void * * @since 3.1.2 */ protected function parseTypeAlias() { // Needed for PHP < 5.4.0 as it's not passing context $this to closure function static::$_myTableForPregreplaceOnly = $this->table; $this->tagsHelper->typeAlias = preg_replace_callback('/{([^}]+)}/', function($matches) { return JTableObserverTags::$_myTableForPregreplaceOnly->{$matches[1]}; }, $this->typeAliasPattern ); } } PK���\\I���2libraries/joomla/table/observer/contenthistory.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Table class supporting modified pre-order tree traversal behavior. * * @link https://docs.joomla.org/JTableObserver * @since 3.2 */ class JTableObserverContenthistory extends JTableObserver { /** * Helper object for storing and deleting version history information associated with this table observer * * @var JHelperContenthistory * @since 3.2 */ protected $contenthistoryHelper; /** * The pattern for this table's TypeAlias * * @var string * @since 3.2 */ protected $typeAliasPattern = null; /** * Not public, so marking private and deprecated, but needed internally in parseTypeAlias for * PHP < 5.4.0 as it's not passing context $this to closure function. * * @var JTableObserverContenthistory * @since 3.2 * @deprecated Never use this * @private */ public static $_myTableForPregreplaceOnly; /** * Creates the associated observer instance and attaches it to the $observableObject * Creates the associated content history helper class instance * $typeAlias can be of the form "{variableName}.type", automatically replacing {variableName} with table-instance variables variableName * * @param JObservableInterface $observableObject The subject object to be observed * @param array $params ( 'typeAlias' => $typeAlias ) * * @return JTableObserverContenthistory * * @since 3.2 */ public static function createObserver(JObservableInterface $observableObject, $params = array()) { $typeAlias = $params['typeAlias']; $observer = new self($observableObject); $observer->contenthistoryHelper = new JHelperContenthistory($typeAlias); $observer->typeAliasPattern = $typeAlias; return $observer; } /** * Post-processor for $table->store($updateNulls) * * @param boolean &$result The result of the load * * @return void * * @since 3.2 */ public function onAfterStore(&$result) { if ($result) { $this->parseTypeAlias(); $aliasParts = explode('.', $this->contenthistoryHelper->typeAlias); if (JComponentHelper::getParams($aliasParts[0])->get('save_history', 0)) { $this->contenthistoryHelper->store($this->table); } } } /** * Pre-processor for $table->delete($pk) * * @param mixed $pk An optional primary key value to delete. If not set the instance property value is used. * * @return void * * @since 3.2 * @throws UnexpectedValueException */ public function onBeforeDelete($pk) { $this->parseTypeAlias(); $aliasParts = explode('.', $this->contenthistoryHelper->typeAlias); if (JComponentHelper::getParams($aliasParts[0])->get('save_history', 0)) { $this->parseTypeAlias(); $this->contenthistoryHelper->deleteHistory($this->table); } } /** * Internal method * Parses a TypeAlias of the form "{variableName}.type", replacing {variableName} with table-instance variables variableName * Storing result into $this->contenthistoryHelper->typeAlias * * @return void * * @since 3.2 */ protected function parseTypeAlias() { // Needed for PHP < 5.4.0 as it's not passing context $this to closure function static::$_myTableForPregreplaceOnly = $this->table; $this->contenthistoryHelper->typeAlias = preg_replace_callback('/{([^}]+)}/', function($matches) { return JTableObserverContenthistory::$_myTableForPregreplaceOnly->{$matches[1]}; }, $this->typeAliasPattern ); } } PK���\�,�WLL$libraries/joomla/table/viewlevel.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Table * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Viewlevels table class. * * @since 11.1 */ class JTableViewlevel extends JTable { /** * Constructor * * @param JDatabaseDriver $db Database driver object. * * @since 11.1 */ public function __construct($db) { parent::__construct('#__viewlevels', 'id', $db); } /** * Method to bind the data. * * @param array $array The data to bind. * @param mixed $ignore An array or space separated list of fields to ignore. * * @return boolean True on success, false on failure. * * @since 11.1 */ public function bind($array, $ignore = '') { // Bind the rules as appropriate. if (isset($array['rules'])) { if (is_array($array['rules'])) { $array['rules'] = json_encode($array['rules']); } } return parent::bind($array, $ignore); } /** * Method to check the current record to save * * @return boolean True on success * * @since 11.1 */ public function check() { // Validate the title. if ((trim($this->title)) == '') { $this->setError(JText::_('JLIB_DATABASE_ERROR_VIEWLEVEL')); return false; } // Check for a duplicate title. $db = $this->_db; $query = $db->getQuery(true) ->select('COUNT(title)') ->from($db->quoteName('#__viewlevels')) ->where($db->quoteName('title') . ' = ' . $db->quote($this->title)) ->where($db->quoteName('id') . ' != ' . (int) $this->id); $db->setQuery($query); if ($db->loadResult() > 0) { $this->setError(JText::sprintf('JLIB_DATABASE_ERROR_USERLEVEL_NAME_EXISTS', $this->title)); return false; } return true; } } PK���\{�gBVV,libraries/joomla/database/exporter/mysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQL export driver. * * @since 11.1 * @deprecated Will be removed when the minimum supported PHP version no longer includes the deprecated PHP `mysql` extension */ class JDatabaseExporterMysql extends JDatabaseExporterMysqli { /** * Checks if all data and options are in order prior to exporting. * * @return JDatabaseExporterMysql Method supports chaining. * * @since 11.1 * @throws Exception if an error is encountered. */ public function check() { // Check if the db connector has been set. if (!($this->db instanceof JDatabaseDriverMysql)) { throw new Exception('JPLATFORM_ERROR_DATABASE_CONNECTOR_WRONG_TYPE'); } // Check if the tables have been specified. if (empty($this->from)) { throw new Exception('JPLATFORM_ERROR_NO_TABLES_SPECIFIED'); } return $this; } } PK���\?H�frr-libraries/joomla/database/exporter/mysqli.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQLi export driver. * * @since 11.1 */ class JDatabaseExporterMysqli extends JDatabaseExporter { /** * Builds the XML data for the tables to export. * * @return string An XML string * * @since 11.1 * @throws Exception if an error occurs. */ protected function buildXml() { $buffer = array(); $buffer[] = '<?xml version="1.0"?>'; $buffer[] = '<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'; $buffer[] = ' <database name="">'; $buffer = array_merge($buffer, $this->buildXmlStructure()); $buffer[] = ' </database>'; $buffer[] = '</mysqldump>'; return implode("\n", $buffer); } /** * Builds the XML structure to export. * * @return array An array of XML lines (strings). * * @since 11.1 * @throws Exception if an error occurs. */ protected function buildXmlStructure() { $buffer = array(); foreach ($this->from as $table) { // Replace the magic prefix if found. $table = $this->getGenericTableName($table); // Get the details columns information. $fields = $this->db->getTableColumns($table, false); $keys = $this->db->getTableKeys($table); $buffer[] = ' <table_structure name="' . $table . '">'; foreach ($fields as $field) { $buffer[] = ' <field Field="' . $field->Field . '"' . ' Type="' . $field->Type . '"' . ' Null="' . $field->Null . '"' . ' Key="' . $field->Key . '"' . (isset($field->Default) ? ' Default="' . $field->Default . '"' : '') . ' Extra="' . $field->Extra . '"' . ' />'; } foreach ($keys as $key) { $buffer[] = ' <key Table="' . $table . '"' . ' Non_unique="' . $key->Non_unique . '"' . ' Key_name="' . $key->Key_name . '"' . ' Seq_in_index="' . $key->Seq_in_index . '"' . ' Column_name="' . $key->Column_name . '"' . ' Collation="' . $key->Collation . '"' . ' Null="' . $key->Null . '"' . ' Index_type="' . $key->Index_type . '"' . ' Comment="' . htmlspecialchars($key->Comment) . '"' . ' />'; } $buffer[] = ' </table_structure>'; } return $buffer; } /** * Checks if all data and options are in order prior to exporting. * * @return JDatabaseExporterMysqli Method supports chaining. * * @since 11.1 * @throws Exception if an error is encountered. */ public function check() { // Check if the db connector has been set. if (!($this->db instanceof JDatabaseDriverMysqli)) { throw new Exception('JPLATFORM_ERROR_DATABASE_CONNECTOR_WRONG_TYPE'); } // Check if the tables have been specified. if (empty($this->from)) { throw new Exception('JPLATFORM_ERROR_NO_TABLES_SPECIFIED'); } return $this; } } PK���\[�:���/libraries/joomla/database/exporter/pdomysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQL export driver for the PDO based MySQL database driver. * * @package Joomla.Platform * @subpackage Database * @since 3.4 */ class JDatabaseExporterPdomysql extends JDatabaseExporter { /** * Builds the XML data for the tables to export. * * @return string An XML string * * @since 3.4 * @throws Exception if an error occurs. */ protected function buildXml() { $buffer = array(); $buffer[] = '<?xml version="1.0"?>'; $buffer[] = '<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'; $buffer[] = ' <database name="">'; $buffer = array_merge($buffer, $this->buildXmlStructure()); $buffer[] = ' </database>'; $buffer[] = '</mysqldump>'; return implode("\n", $buffer); } /** * Builds the XML structure to export. * * @return array An array of XML lines (strings). * * @since 3.4 * @throws Exception if an error occurs. */ protected function buildXmlStructure() { $buffer = array(); foreach ($this->from as $table) { // Replace the magic prefix if found. $table = $this->getGenericTableName($table); // Get the details columns information. $fields = $this->db->getTableColumns($table, false); $keys = $this->db->getTableKeys($table); $buffer[] = ' <table_structure name="' . $table . '">'; foreach ($fields as $field) { $buffer[] = ' <field Field="' . $field->Field . '"' . ' Type="' . $field->Type . '"' . ' Null="' . $field->Null . '"' . ' Key="' . $field->Key . '"' . (isset($field->Default) ? ' Default="' . $field->Default . '"' : '') . ' Extra="' . $field->Extra . '"' . ' />'; } foreach ($keys as $key) { $buffer[] = ' <key Table="' . $table . '"' . ' Non_unique="' . $key->Non_unique . '"' . ' Key_name="' . $key->Key_name . '"' . ' Seq_in_index="' . $key->Seq_in_index . '"' . ' Column_name="' . $key->Column_name . '"' . ' Collation="' . $key->Collation . '"' . ' Null="' . $key->Null . '"' . ' Index_type="' . $key->Index_type . '"' . ' Comment="' . htmlspecialchars($key->Comment) . '"' . ' />'; } $buffer[] = ' </table_structure>'; } return $buffer; } /** * Checks if all data and options are in order prior to exporting. * * @return JDatabaseExporterPdomysql Method supports chaining. * * @since 3.4 * @throws Exception if an error is encountered. */ public function check() { // Check if the db connector has been set. if (!($this->db instanceof JDatabaseDriverPdomysql)) { throw new Exception('JPLATFORM_ERROR_DATABASE_CONNECTOR_WRONG_TYPE'); } // Check if the tables have been specified. if (empty($this->from)) { throw new Exception('JPLATFORM_ERROR_NO_TABLES_SPECIFIED'); } return $this; } } PK���\i���� � 1libraries/joomla/database/exporter/postgresql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * PostgreSQL export driver. * * @since 12.1 * * @property-read JDatabaseDriverPostgresql $db The database connector to use for exporting structure and/or data. */ class JDatabaseExporterPostgresql extends JDatabaseExporter { /** * Builds the XML data for the tables to export. * * @return string An XML string * * @since 12.1 * @throws Exception if an error occurs. */ protected function buildXml() { $buffer = array(); $buffer[] = '<?xml version="1.0"?>'; $buffer[] = '<postgresqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'; $buffer[] = ' <database name="">'; $buffer = array_merge($buffer, $this->buildXmlStructure()); $buffer[] = ' </database>'; $buffer[] = '</postgresqldump>'; return implode("\n", $buffer); } /** * Builds the XML structure to export. * * @return array An array of XML lines (strings). * * @since 12.1 * @throws Exception if an error occurs. */ protected function buildXmlStructure() { $buffer = array(); foreach ($this->from as $table) { // Replace the magic prefix if found. $table = $this->getGenericTableName($table); // Get the details columns information. $fields = $this->db->getTableColumns($table, false); $keys = $this->db->getTableKeys($table); $sequences = $this->db->getTableSequences($table); $buffer[] = ' <table_structure name="' . $table . '">'; foreach ($sequences as $sequence) { if (version_compare($this->db->getVersion(), '9.1.0') < 0) { $sequence->start_value = null; } $buffer[] = ' <sequence Name="' . $sequence->sequence . '"' . ' Schema="' . $sequence->schema . '"' . ' Table="' . $sequence->table . '"' . ' Column="' . $sequence->column . '"' . ' Type="' . $sequence->data_type . '"' . ' Start_Value="' . $sequence->start_value . '"' . ' Min_Value="' . $sequence->minimum_value . '"' . ' Max_Value="' . $sequence->maximum_value . '"' . ' Increment="' . $sequence->increment . '"' . ' Cycle_option="' . $sequence->cycle_option . '"' . ' />'; } foreach ($fields as $field) { $buffer[] = ' <field Field="' . $field->column_name . '"' . ' Type="' . $field->type . '"' . ' Null="' . $field->null . '"' . (isset($field->default) ? ' Default="' . $field->default . '"' : '') . ' Comments="' . $field->comments . '"' . ' />'; } foreach ($keys as $key) { $buffer[] = ' <key Index="' . $key->idxName . '"' . ' is_primary="' . $key->isPrimary . '"' . ' is_unique="' . $key->isUnique . '"' . ' Query="' . $key->Query . '" />'; } $buffer[] = ' </table_structure>'; } return $buffer; } /** * Checks if all data and options are in order prior to exporting. * * @return JDatabaseExporterPostgresql Method supports chaining. * * @since 12.1 * @throws Exception if an error is encountered. */ public function check() { // Check if the db connector has been set. if (!($this->db instanceof JDatabaseDriverPostgresql)) { throw new Exception('JPLATFORM_ERROR_DATABASE_CONNECTOR_WRONG_TYPE'); } // Check if the tables have been specified. if (empty($this->from)) { throw new Exception('JPLATFORM_ERROR_NO_TABLES_SPECIFIED'); } return $this; } } PK���\Z�S���&libraries/joomla/database/exporter.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Database Exporter Class * * @since 12.1 */ abstract class JDatabaseExporter { /** * The type of output format (xml). * * @var string * @since 13.1 */ protected $asFormat = 'xml'; /** * An array of cached data. * * @var array * @since 13.1 */ protected $cache = array(); /** * The database connector to use for exporting structure and/or data. * * @var JDatabaseDriver * @since 13.1 */ protected $db = null; /** * An array input sources (table names). * * @var array * @since 13.1 */ protected $from = array(); /** * An array of options for the exporter. * * @var object * @since 13.1 */ protected $options = null; /** * Constructor. * * Sets up the default options for the exporter. * * @since 13.1 */ public function __construct() { $this->options = new stdClass; $this->cache = array('columns' => array(), 'keys' => array()); // Set up the class defaults: // Export with only structure $this->withStructure(); // Export as xml. $this->asXml(); // Default destination is a string using $output = (string) $exporter; } /** * Magic function to exports the data to a string. * * @return string * * @since 13.1 * @throws Exception if an error is encountered. */ public function __toString() { // Check everything is ok to run first. $this->check(); // Get the format. switch ($this->asFormat) { case 'xml': default: $buffer = $this->buildXml(); break; } return $buffer; } /** * Set the output option for the exporter to XML format. * * @return DatabaseExporter Method supports chaining. * * @since 13.1 */ public function asXml() { $this->asFormat = 'xml'; return $this; } /** * Builds the XML data for the tables to export. * * @return string An XML string * * @since 13.1 * @throws Exception if an error occurs. */ abstract protected function buildXml(); /** * Builds the XML structure to export. * * @return array An array of XML lines (strings). * * @since 13.1 * @throws Exception if an error occurs. */ abstract protected function buildXmlStructure(); /** * Checks if all data and options are in order prior to exporting. * * @return DatabaseDriver Method supports chaining. * * @since 13.1 * @throws Exception if an error is encountered. */ abstract public function check(); /** * Specifies a list of table names to export. * * @param mixed $from The name of a single table, or an array of the table names to export. * * @return JDatabaseExporter Method supports chaining. * * @since 13.1 * @throws Exception if input is not a string or array. */ public function from($from) { if (is_string($from)) { $this->from = array($from); } elseif (is_array($from)) { $this->from = $from; } else { throw new Exception('JPLATFORM_ERROR_INPUT_REQUIRES_STRING_OR_ARRAY'); } return $this; } /** * Get the generic name of the table, converting the database prefix to the wildcard string. * * @param string $table The name of the table. * * @return string The name of the table with the database prefix replaced with #__. * * @since 13.1 */ protected function getGenericTableName($table) { $prefix = $this->db->getPrefix(); // Replace the magic prefix if found. $table = preg_replace("|^$prefix|", '#__', $table); return $table; } /** * Sets the database connector to use for exporting structure and/or data from MySQL. * * @param JDatabaseDriver $db The database connector. * * @return JDatabaseExporter Method supports chaining. * * @since 13.1 */ public function setDbo(JDatabaseDriver $db) { $this->db = $db; return $this; } /** * Sets an internal option to export the structure of the input table(s). * * @param boolean $setting True to export the structure, false to not. * * @return JDatabaseExporter Method supports chaining. * * @since 13.1 */ public function withStructure($setting = true) { $this->options->withStructure = (boolean) $setting; return $this; } } PK���\��0VV,libraries/joomla/database/importer/mysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQL import driver. * * @since 11.1 * @deprecated Will be removed when the minimum supported PHP version no longer includes the deprecated PHP `mysql` extension */ class JDatabaseImporterMysql extends JDatabaseImporterMysqli { /** * Checks if all data and options are in order prior to exporting. * * @return JDatabaseImporterMysql Method supports chaining. * * @since 11.1 * @throws Exception if an error is encountered. */ public function check() { // Check if the db connector has been set. if (!($this->db instanceof JDatabaseDriverMysql)) { throw new Exception('JPLATFORM_ERROR_DATABASE_CONNECTOR_WRONG_TYPE'); } // Check if the tables have been specified. if (empty($this->from)) { throw new Exception('JPLATFORM_ERROR_NO_TABLES_SPECIFIED'); } return $this; } } PK���\1d�a�)�)-libraries/joomla/database/importer/mysqli.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQLi import driver. * * @since 11.1 */ class JDatabaseImporterMysqli extends JDatabaseImporter { /** * Checks if all data and options are in order prior to exporting. * * @return JDatabaseImporterMysqli Method supports chaining. * * @since 11.1 * @throws Exception if an error is encountered. */ public function check() { // Check if the db connector has been set. if (!($this->db instanceof JDatabaseDriverMysqli)) { throw new Exception('JPLATFORM_ERROR_DATABASE_CONNECTOR_WRONG_TYPE'); } // Check if the tables have been specified. if (empty($this->from)) { throw new Exception('JPLATFORM_ERROR_NO_TABLES_SPECIFIED'); } return $this; } /** * Get the SQL syntax to add a column. * * @param string $table The table name. * @param SimpleXMLElement $field The XML field definition. * * @return string * * @since 11.1 */ protected function getAddColumnSql($table, SimpleXMLElement $field) { return 'ALTER TABLE ' . $this->db->quoteName($table) . ' ADD COLUMN ' . $this->getColumnSql($field); } /** * Get the SQL syntax to add a key. * * @param string $table The table name. * @param array $keys An array of the fields pertaining to this key. * * @return string * * @since 11.1 */ protected function getAddKeySql($table, $keys) { return 'ALTER TABLE ' . $this->db->quoteName($table) . ' ADD ' . $this->getKeySql($keys); } /** * Get alters for table if there is a difference. * * @param SimpleXMLElement $structure The XML structure pf the table. * * @return array * * @since 11.1 */ protected function getAlterTableSql(SimpleXMLElement $structure) { $table = $this->getRealTableName($structure['name']); $oldFields = $this->db->getTableColumns($table); $oldKeys = $this->db->getTableKeys($table); $alters = array(); // Get the fields and keys from the XML that we are aiming for. $newFields = $structure->xpath('field'); $newKeys = $structure->xpath('key'); // Loop through each field in the new structure. foreach ($newFields as $field) { $fName = (string) $field['Field']; if (isset($oldFields[$fName])) { // The field exists, check it's the same. $column = $oldFields[$fName]; // Test whether there is a change. $change = ((string) $field['Type'] != $column->Type) || ((string) $field['Null'] != $column->Null) || ((string) $field['Default'] != $column->Default) || ((string) $field['Extra'] != $column->Extra); if ($change) { $alters[] = $this->getChangeColumnSql($table, $field); } // Unset this field so that what we have left are fields that need to be removed. unset($oldFields[$fName]); } else { // The field is new. $alters[] = $this->getAddColumnSql($table, $field); } } // Any columns left are orphans foreach ($oldFields as $name => $column) { // Delete the column. $alters[] = $this->getDropColumnSql($table, $name); } // Get the lookups for the old and new keys. $oldLookup = $this->getKeyLookup($oldKeys); $newLookup = $this->getKeyLookup($newKeys); // Loop through each key in the new structure. foreach ($newLookup as $name => $keys) { // Check if there are keys on this field in the existing table. if (isset($oldLookup[$name])) { $same = true; $newCount = count($newLookup[$name]); $oldCount = count($oldLookup[$name]); // There is a key on this field in the old and new tables. Are they the same? if ($newCount == $oldCount) { // Need to loop through each key and do a fine grained check. for ($i = 0; $i < $newCount; $i++) { $same = (((string) $newLookup[$name][$i]['Non_unique'] == $oldLookup[$name][$i]->Non_unique) && ((string) $newLookup[$name][$i]['Column_name'] == $oldLookup[$name][$i]->Column_name) && ((string) $newLookup[$name][$i]['Seq_in_index'] == $oldLookup[$name][$i]->Seq_in_index) && ((string) $newLookup[$name][$i]['Collation'] == $oldLookup[$name][$i]->Collation) && ((string) $newLookup[$name][$i]['Index_type'] == $oldLookup[$name][$i]->Index_type)); /* Debug. echo '<pre>'; echo '<br />Non_unique: '. ((string) $newLookup[$name][$i]['Non_unique'] == $oldLookup[$name][$i]->Non_unique ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Non_unique'].' vs '.$oldLookup[$name][$i]->Non_unique; echo '<br />Column_name: '. ((string) $newLookup[$name][$i]['Column_name'] == $oldLookup[$name][$i]->Column_name ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Column_name'].' vs '.$oldLookup[$name][$i]->Column_name; echo '<br />Seq_in_index: '. ((string) $newLookup[$name][$i]['Seq_in_index'] == $oldLookup[$name][$i]->Seq_in_index ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Seq_in_index'].' vs '.$oldLookup[$name][$i]->Seq_in_index; echo '<br />Collation: '. ((string) $newLookup[$name][$i]['Collation'] == $oldLookup[$name][$i]->Collation ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Collation'].' vs '.$oldLookup[$name][$i]->Collation; echo '<br />Index_type: '. ((string) $newLookup[$name][$i]['Index_type'] == $oldLookup[$name][$i]->Index_type ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Index_type'].' vs '.$oldLookup[$name][$i]->Index_type; echo '<br />Same = '.($same ? 'true' : 'false'); echo '</pre>'; */ if (!$same) { // Break out of the loop. No need to check further. break; } } } else { // Count is different, just drop and add. $same = false; } if (!$same) { $alters[] = $this->getDropKeySql($table, $name); $alters[] = $this->getAddKeySql($table, $keys); } // Unset this field so that what we have left are fields that need to be removed. unset($oldLookup[$name]); } else { // This is a new key. $alters[] = $this->getAddKeySql($table, $keys); } } // Any keys left are orphans. foreach ($oldLookup as $name => $keys) { if (strtoupper($name) == 'PRIMARY') { $alters[] = $this->getDropPrimaryKeySql($table); } else { $alters[] = $this->getDropKeySql($table, $name); } } return $alters; } /** * Get the syntax to alter a column. * * @param string $table The name of the database table to alter. * @param SimpleXMLElement $field The XML definition for the field. * * @return string * * @since 11.1 */ protected function getChangeColumnSql($table, SimpleXMLElement $field) { return 'ALTER TABLE ' . $this->db->quoteName($table) . ' CHANGE COLUMN ' . $this->db->quoteName((string) $field['Field']) . ' ' . $this->getColumnSql($field); } /** * Get the SQL syntax for a single column that would be included in a table create or alter statement. * * @param SimpleXMLElement $field The XML field definition. * * @return string * * @since 11.1 */ protected function getColumnSql(SimpleXMLElement $field) { // TODO Incorporate into parent class and use $this. $blobs = array('text', 'smalltext', 'mediumtext', 'largetext'); $fName = (string) $field['Field']; $fType = (string) $field['Type']; $fNull = (string) $field['Null']; $fDefault = isset($field['Default']) ? (string) $field['Default'] : null; $fExtra = (string) $field['Extra']; $query = $this->db->quoteName($fName) . ' ' . $fType; if ($fNull == 'NO') { if (in_array($fType, $blobs) || $fDefault === null) { $query .= ' NOT NULL'; } else { // TODO Don't quote numeric values. $query .= ' NOT NULL DEFAULT ' . $this->db->quote($fDefault); } } else { if ($fDefault === null) { $query .= ' DEFAULT NULL'; } else { // TODO Don't quote numeric values. $query .= ' DEFAULT ' . $this->db->quote($fDefault); } } if ($fExtra) { $query .= ' ' . strtoupper($fExtra); } return $query; } /** * Get the SQL syntax to drop a key. * * @param string $table The table name. * @param string $name The name of the key to drop. * * @return string * * @since 11.1 */ protected function getDropKeySql($table, $name) { return 'ALTER TABLE ' . $this->db->quoteName($table) . ' DROP KEY ' . $this->db->quoteName($name); } /** * Get the SQL syntax to drop a key. * * @param string $table The table name. * * @return string * * @since 11.1 */ protected function getDropPrimaryKeySql($table) { return 'ALTER TABLE ' . $this->db->quoteName($table) . ' DROP PRIMARY KEY'; } /** * Get the details list of keys for a table. * * @param array $keys An array of objects that comprise the keys for the table. * * @return array The lookup array. array({key name} => array(object, ...)) * * @since 11.1 * @throws Exception */ protected function getKeyLookup($keys) { // First pass, create a lookup of the keys. $lookup = array(); foreach ($keys as $key) { if ($key instanceof SimpleXMLElement) { $kName = (string) $key['Key_name']; } else { $kName = $key->Key_name; } if (empty($lookup[$kName])) { $lookup[$kName] = array(); } $lookup[$kName][] = $key; } return $lookup; } /** * Get the SQL syntax for a key. * * @param array $columns An array of SimpleXMLElement objects comprising the key. * * @return string * * @since 11.1 */ protected function getKeySql($columns) { // TODO Error checking on array and element types. $kNonUnique = (string) $columns[0]['Non_unique']; $kName = (string) $columns[0]['Key_name']; $kColumn = (string) $columns[0]['Column_name']; $prefix = ''; if ($kName == 'PRIMARY') { $prefix = 'PRIMARY '; } elseif ($kNonUnique == 0) { $prefix = 'UNIQUE '; } $nColumns = count($columns); $kColumns = array(); if ($nColumns == 1) { $kColumns[] = $this->db->quoteName($kColumn); } else { foreach ($columns as $column) { $kColumns[] = (string) $column['Column_name']; } } $query = $prefix . 'KEY ' . ($kName != 'PRIMARY' ? $this->db->quoteName($kName) : '') . ' (' . implode(',', $kColumns) . ')'; return $query; } } PK���\c�p4 , ,/libraries/joomla/database/importer/pdomysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQL import driver for the PDO based MySQL database driver. * * @package Joomla.Platform * @subpackage Database * @since 3.4 */ class JDatabaseImporterPdomysql extends JDatabaseImporter { /** * Get the SQL syntax to add a column. * * @param string $table The table name. * @param SimpleXMLElement $field The XML field definition. * * @return string * * @since 3.4 */ protected function getAddColumnSql($table, SimpleXMLElement $field) { $sql = 'ALTER TABLE ' . $this->db->quoteName($table) . ' ADD COLUMN ' . $this->getColumnSql($field); return $sql; } /** * Get the SQL syntax to add a key. * * @param string $table The table name. * @param array $keys An array of the fields pertaining to this key. * * @return string * * @since 3.4 */ protected function getAddKeySql($table, $keys) { $sql = 'ALTER TABLE ' . $this->db->quoteName($table) . ' ADD ' . $this->getKeySql($keys); return $sql; } /** * Get alters for table if there is a difference. * * @param SimpleXMLElement $structure The XML structure pf the table. * * @return array * * @since 3.4 */ protected function getAlterTableSql(SimpleXMLElement $structure) { // Initialise variables. $table = $this->getRealTableName($structure['name']); $oldFields = $this->db->getTableColumns($table); $oldKeys = $this->db->getTableKeys($table); $alters = array(); // Get the fields and keys from the XML that we are aiming for. $newFields = $structure->xpath('field'); $newKeys = $structure->xpath('key'); // Loop through each field in the new structure. foreach ($newFields as $field) { $fName = (string) $field['Field']; if (isset($oldFields[$fName])) { // The field exists, check it's the same. $column = $oldFields[$fName]; // Test whether there is a change. $change = ((string) $field['Type'] != $column->Type) || ((string) $field['Null'] != $column->Null) || ((string) $field['Default'] != $column->Default) || ((string) $field['Extra'] != $column->Extra); if ($change) { $alters[] = $this->getChangeColumnSql($table, $field); } // Unset this field so that what we have left are fields that need to be removed. unset($oldFields[$fName]); } else { // The field is new. $alters[] = $this->getAddColumnSql($table, $field); } } // Any columns left are orphans foreach ($oldFields as $name => $column) { // Delete the column. $alters[] = $this->getDropColumnSql($table, $name); } // Get the lookups for the old and new keys. $oldLookup = $this->getKeyLookup($oldKeys); $newLookup = $this->getKeyLookup($newKeys); // Loop through each key in the new structure. foreach ($newLookup as $name => $keys) { // Check if there are keys on this field in the existing table. if (isset($oldLookup[$name])) { $same = true; $newCount = count($newLookup[$name]); $oldCount = count($oldLookup[$name]); // There is a key on this field in the old and new tables. Are they the same? if ($newCount == $oldCount) { // Need to loop through each key and do a fine grained check. for ($i = 0; $i < $newCount; $i++) { $same = (((string) $newLookup[$name][$i]['Non_unique'] == $oldLookup[$name][$i]->Non_unique) && ((string) $newLookup[$name][$i]['Column_name'] == $oldLookup[$name][$i]->Column_name) && ((string) $newLookup[$name][$i]['Seq_in_index'] == $oldLookup[$name][$i]->Seq_in_index) && ((string) $newLookup[$name][$i]['Collation'] == $oldLookup[$name][$i]->Collation) && ((string) $newLookup[$name][$i]['Index_type'] == $oldLookup[$name][$i]->Index_type)); /* Debug. echo '<pre>'; echo '<br />Non_unique: '. ((string) $newLookup[$name][$i]['Non_unique'] == $oldLookup[$name][$i]->Non_unique ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Non_unique'].' vs '.$oldLookup[$name][$i]->Non_unique; echo '<br />Column_name: '. ((string) $newLookup[$name][$i]['Column_name'] == $oldLookup[$name][$i]->Column_name ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Column_name'].' vs '.$oldLookup[$name][$i]->Column_name; echo '<br />Seq_in_index: '. ((string) $newLookup[$name][$i]['Seq_in_index'] == $oldLookup[$name][$i]->Seq_in_index ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Seq_in_index'].' vs '.$oldLookup[$name][$i]->Seq_in_index; echo '<br />Collation: '. ((string) $newLookup[$name][$i]['Collation'] == $oldLookup[$name][$i]->Collation ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Collation'].' vs '.$oldLookup[$name][$i]->Collation; echo '<br />Index_type: '. ((string) $newLookup[$name][$i]['Index_type'] == $oldLookup[$name][$i]->Index_type ? 'Pass' : 'Fail').' '. (string) $newLookup[$name][$i]['Index_type'].' vs '.$oldLookup[$name][$i]->Index_type; echo '<br />Same = '.($same ? 'true' : 'false'); echo '</pre>'; */ if (!$same) { // Break out of the loop. No need to check further. break; } } } else { // Count is different, just drop and add. $same = false; } if (!$same) { $alters[] = $this->getDropKeySql($table, $name); $alters[] = $this->getAddKeySql($table, $keys); } // Unset this field so that what we have left are fields that need to be removed. unset($oldLookup[$name]); } else { // This is a new key. $alters[] = $this->getAddKeySql($table, $keys); } } // Any keys left are orphans. foreach ($oldLookup as $name => $keys) { if (strtoupper($name) == 'PRIMARY') { $alters[] = $this->getDropPrimaryKeySql($table); } else { $alters[] = $this->getDropKeySql($table, $name); } } return $alters; } /** * Get the syntax to alter a column. * * @param string $table The name of the database table to alter. * @param SimpleXMLElement $field The XML definition for the field. * * @return string * * @since 3.4 */ protected function getChangeColumnSql($table, SimpleXMLElement $field) { $sql = 'ALTER TABLE ' . $this->db->quoteName($table) . ' CHANGE COLUMN ' . $this->db->quoteName((string) $field['Field']) . ' ' . $this->getColumnSql($field); return $sql; } /** * Get the SQL syntax for a single column that would be included in a table create or alter statement. * * @param SimpleXMLElement $field The XML field definition. * * @return string * * @since 3.4 */ protected function getColumnSql(SimpleXMLElement $field) { // Initialise variables. // TODO Incorporate into parent class and use $this. $blobs = array('text', 'smalltext', 'mediumtext', 'largetext'); $fName = (string) $field['Field']; $fType = (string) $field['Type']; $fNull = (string) $field['Null']; $fDefault = isset($field['Default']) ? (string) $field['Default'] : null; $fExtra = (string) $field['Extra']; $sql = $this->db->quoteName($fName) . ' ' . $fType; if ($fNull == 'NO') { if (in_array($fType, $blobs) || $fDefault === null) { $sql .= ' NOT NULL'; } else { // TODO Don't quote numeric values. $sql .= ' NOT NULL DEFAULT ' . $this->db->quote($fDefault); } } else { if ($fDefault === null) { $sql .= ' DEFAULT NULL'; } else { // TODO Don't quote numeric values. $sql .= ' DEFAULT ' . $this->db->quote($fDefault); } } if ($fExtra) { $sql .= ' ' . strtoupper($fExtra); } return $sql; } /** * Get the SQL syntax to drop a column. * * @param string $table The table name. * @param string $name The name of the field to drop. * * @return string * * @since 3.4 */ protected function getDropColumnSql($table, $name) { $sql = 'ALTER TABLE ' . $this->db->quoteName($table) . ' DROP COLUMN ' . $this->db->quoteName($name); return $sql; } /** * Get the SQL syntax to drop a key. * * @param string $table The table name. * @param string $name The name of the key to drop. * * @return string * * @since 3.4 */ protected function getDropKeySql($table, $name) { $sql = 'ALTER TABLE ' . $this->db->quoteName($table) . ' DROP KEY ' . $this->db->quoteName($name); return $sql; } /** * Get the SQL syntax to drop a key. * * @param string $table The table name. * * @return string * * @since 3.4 */ protected function getDropPrimaryKeySql($table) { $sql = 'ALTER TABLE ' . $this->db->quoteName($table) . ' DROP PRIMARY KEY'; return $sql; } /** * Get the details list of keys for a table. * * @param array $keys An array of objects that comprise the keys for the table. * * @return array The lookup array. array({key name} => array(object, ...)) * * @since 3.4 * @throws Exception */ protected function getKeyLookup($keys) { // First pass, create a lookup of the keys. $lookup = array(); foreach ($keys as $key) { if ($key instanceof SimpleXMLElement) { $kName = (string) $key['Key_name']; } else { $kName = $key->Key_name; } if (empty($lookup[$kName])) { $lookup[$kName] = array(); } $lookup[$kName][] = $key; } return $lookup; } /** * Get the SQL syntax for a key. * * @param array $columns An array of SimpleXMLElement objects comprising the key. * * @return string * * @since 3.4 */ protected function getKeySql($columns) { // TODO Error checking on array and element types. $kNonUnique = (string) $columns[0]['Non_unique']; $kName = (string) $columns[0]['Key_name']; $kColumn = (string) $columns[0]['Column_name']; $prefix = ''; if ($kName == 'PRIMARY') { $prefix = 'PRIMARY '; } elseif ($kNonUnique == 0) { $prefix = 'UNIQUE '; } $nColumns = count($columns); $kColumns = array(); if ($nColumns == 1) { $kColumns[] = $this->db->quoteName($kColumn); } else { foreach ($columns as $column) { $kColumns[] = (string) $column['Column_name']; } } $sql = $prefix . 'KEY ' . ($kName != 'PRIMARY' ? $this->db->quoteName($kName) : '') . ' (' . implode(',', $kColumns) . ')'; return $sql; } /** * Checks if all data and options are in order prior to exporting. * * @return JDatabaseImporterPdomysql Method supports chaining. * * @since 3.4 * @throws Exception if an error is encountered. */ public function check() { // Check if the db connector has been set. if (!($this->db instanceof JDatabaseDriverPdomysql)) { throw new Exception('JPLATFORM_ERROR_DATABASE_CONNECTOR_WRONG_TYPE'); } // Check if the tables have been specified. if (empty($this->from)) { throw new Exception('JPLATFORM_ERROR_NO_TABLES_SPECIFIED'); } return $this; } } PK���\z�r'�8�81libraries/joomla/database/importer/postgresql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * PostgreSQL import driver. * * @since 12.1 */ class JDatabaseImporterPostgresql extends JDatabaseImporter { /** * Checks if all data and options are in order prior to exporting. * * @return JDatabaseImporterPostgresql Method supports chaining. * * @since 12.1 * @throws Exception if an error is encountered. */ public function check() { // Check if the db connector has been set. if (!($this->db instanceof JDatabaseDriverPostgresql)) { throw new Exception('JPLATFORM_ERROR_DATABASE_CONNECTOR_WRONG_TYPE'); } // Check if the tables have been specified. if (empty($this->from)) { throw new Exception('JPLATFORM_ERROR_NO_TABLES_SPECIFIED'); } return $this; } /** * Get the SQL syntax to add a column. * * @param string $table The table name. * @param SimpleXMLElement $field The XML field definition. * * @return string * * @since 12.1 */ protected function getAddColumnSql($table, SimpleXMLElement $field) { return 'ALTER TABLE ' . $this->db->quoteName($table) . ' ADD COLUMN ' . $this->getColumnSql($field); } /** * Get the SQL syntax to add an index. * * @param SimpleXMLElement $field The XML index definition. * * @return string * * @since 12.1 */ protected function getAddIndexSql(SimpleXMLElement $field) { return (string) $field['Query']; } /** * Get alters for table if there is a difference. * * @param SimpleXMLElement $structure The XML structure of the table. * * @return array * * @since 12.1 */ protected function getAlterTableSql(SimpleXMLElement $structure) { $table = $this->getRealTableName($structure['name']); $oldFields = $this->db->getTableColumns($table); $oldKeys = $this->db->getTableKeys($table); $oldSequence = $this->db->getTableSequences($table); $alters = array(); // Get the fields and keys from the XML that we are aiming for. $newFields = $structure->xpath('field'); $newKeys = $structure->xpath('key'); $newSequence = $structure->xpath('sequence'); /* Sequence section */ $oldSeq = $this->getSeqLookup($oldSequence); $newSequenceLook = $this->getSeqLookup($newSequence); foreach ($newSequenceLook as $kSeqName => $vSeq) { if (isset($oldSeq[$kSeqName])) { // The field exists, check it's the same. $column = $oldSeq[$kSeqName][0]; /* For older database version that doesn't support these fields use default values */ if (version_compare($this->db->getVersion(), '9.1.0') < 0) { $column->Min_Value = '1'; $column->Max_Value = '9223372036854775807'; $column->Increment = '1'; $column->Cycle_option = 'NO'; $column->Start_Value = '1'; } // Test whether there is a change. $change = ((string) $vSeq[0]['Type'] != $column->Type) || ((string) $vSeq[0]['Start_Value'] != $column->Start_Value) || ((string) $vSeq[0]['Min_Value'] != $column->Min_Value) || ((string) $vSeq[0]['Max_Value'] != $column->Max_Value) || ((string) $vSeq[0]['Increment'] != $column->Increment) || ((string) $vSeq[0]['Cycle_option'] != $column->Cycle_option) || ((string) $vSeq[0]['Table'] != $column->Table) || ((string) $vSeq[0]['Column'] != $column->Column) || ((string) $vSeq[0]['Schema'] != $column->Schema) || ((string) $vSeq[0]['Name'] != $column->Name); if ($change) { $alters[] = $this->getChangeSequenceSql($kSeqName, $vSeq); } // Unset this field so that what we have left are fields that need to be removed. unset($oldSeq[$kSeqName]); } else { // The sequence is new $alters[] = $this->getAddSequenceSql($newSequenceLook[$kSeqName][0]); } } // Any sequences left are orphans foreach ($oldSeq as $name => $column) { // Delete the sequence. $alters[] = $this->getDropSequenceSql($name); } /* Field section */ // Loop through each field in the new structure. foreach ($newFields as $field) { $fName = (string) $field['Field']; if (isset($oldFields[$fName])) { // The field exists, check it's the same. $column = $oldFields[$fName]; // Test whether there is a change. $change = ((string) $field['Type'] != $column->Type) || ((string) $field['Null'] != $column->Null) || ((string) $field['Default'] != $column->Default); if ($change) { $alters[] = $this->getChangeColumnSql($table, $field); } // Unset this field so that what we have left are fields that need to be removed. unset($oldFields[$fName]); } else { // The field is new. $alters[] = $this->getAddColumnSql($table, $field); } } // Any columns left are orphans foreach ($oldFields as $name => $column) { // Delete the column. $alters[] = $this->getDropColumnSql($table, $name); } /* Index section */ // Get the lookups for the old and new keys $oldLookup = $this->getIdxLookup($oldKeys); $newLookup = $this->getIdxLookup($newKeys); // Loop through each key in the new structure. foreach ($newLookup as $name => $keys) { // Check if there are keys on this field in the existing table. if (isset($oldLookup[$name])) { $same = true; $newCount = count($newLookup[$name]); $oldCount = count($oldLookup[$name]); // There is a key on this field in the old and new tables. Are they the same? if ($newCount == $oldCount) { for ($i = 0; $i < $newCount; $i++) { // Check only query field -> different query means different index $same = ((string) $newLookup[$name][$i]['Query'] == $oldLookup[$name][$i]->Query); if (!$same) { // Break out of the loop. No need to check further. break; } } } else { // Count is different, just drop and add. $same = false; } if (!$same) { $alters[] = $this->getDropIndexSql($name); $alters[] = (string) $newLookup[$name][0]['Query']; } // Unset this field so that what we have left are fields that need to be removed. unset($oldLookup[$name]); } else { // This is a new key. $alters[] = (string) $newLookup[$name][0]['Query']; } } // Any keys left are orphans. foreach ($oldLookup as $name => $keys) { if ($oldLookup[$name][0]->is_primary == 'TRUE') { $alters[] = $this->getDropPrimaryKeySql($table, $oldLookup[$name][0]->Index); } else { $alters[] = $this->getDropIndexSql($name); } } return $alters; } /** * Get the SQL syntax to drop a sequence. * * @param string $name The name of the sequence to drop. * * @return string * * @since 12.1 */ protected function getDropSequenceSql($name) { return 'DROP SEQUENCE ' . $this->db->quoteName($name); } /** * Get the syntax to add a sequence. * * @param SimpleXMLElement $field The XML definition for the sequence. * * @return string * * @since 12.1 */ protected function getAddSequenceSql($field) { /* For older database version that doesn't support these fields use default values */ if (version_compare($this->db->getVersion(), '9.1.0') < 0) { $field['Min_Value'] = '1'; $field['Max_Value'] = '9223372036854775807'; $field['Increment'] = '1'; $field['Cycle_option'] = 'NO'; $field['Start_Value'] = '1'; } return 'CREATE SEQUENCE ' . (string) $field['Name'] . ' INCREMENT BY ' . (string) $field['Increment'] . ' MINVALUE ' . $field['Min_Value'] . ' MAXVALUE ' . (string) $field['Max_Value'] . ' START ' . (string) $field['Start_Value'] . (((string) $field['Cycle_option'] == 'NO') ? ' NO' : '') . ' CYCLE' . ' OWNED BY ' . $this->db->quoteName((string) $field['Schema'] . '.' . (string) $field['Table'] . '.' . (string) $field['Column']); } /** * Get the syntax to alter a sequence. * * @param SimpleXMLElement $field The XML definition for the sequence. * * @return string * * @since 12.1 */ protected function getChangeSequenceSql($field) { /* For older database version that doesn't support these fields use default values */ if (version_compare($this->db->getVersion(), '9.1.0') < 0) { $field['Min_Value'] = '1'; $field['Max_Value'] = '9223372036854775807'; $field['Increment'] = '1'; $field['Cycle_option'] = 'NO'; $field['Start_Value'] = '1'; } return 'ALTER SEQUENCE ' . (string) $field['Name'] . ' INCREMENT BY ' . (string) $field['Increment'] . ' MINVALUE ' . (string) $field['Min_Value'] . ' MAXVALUE ' . (string) $field['Max_Value'] . ' START ' . (string) $field['Start_Value'] . ' OWNED BY ' . $this->db->quoteName((string) $field['Schema'] . '.' . (string) $field['Table'] . '.' . (string) $field['Column']); } /** * Get the syntax to alter a column. * * @param string $table The name of the database table to alter. * @param SimpleXMLElement $field The XML definition for the field. * * @return string * * @since 12.1 */ protected function getChangeColumnSql($table, SimpleXMLElement $field) { return 'ALTER TABLE ' . $this->db->quoteName($table) . ' ALTER COLUMN ' . $this->db->quoteName((string) $field['Field']) . ' ' . $this->getAlterColumnSql($table, $field); } /** * Get the SQL syntax for a single column that would be included in a table create statement. * * @param string $table The name of the database table to alter. * @param SimpleXMLElement $field The XML field definition. * * @return string * * @since 12.1 */ protected function getAlterColumnSql($table, $field) { // TODO Incorporate into parent class and use $this. $blobs = array('text', 'smalltext', 'mediumtext', 'largetext'); $fName = (string) $field['Field']; $fType = (string) $field['Type']; $fNull = (string) $field['Null']; $fDefault = (isset($field['Default']) && $field['Default'] != 'NULL' ) ? preg_match('/^[0-9]$/', $field['Default']) ? $field['Default'] : $this->db->quote((string) $field['Default']) : null; $query = ' TYPE ' . $fType; if ($fNull == 'NO') { if (in_array($fType, $blobs) || $fDefault === null) { $query .= ",\nALTER COLUMN " . $this->db->quoteName($fName) . ' SET NOT NULL' . ",\nALTER COLUMN " . $this->db->quoteName($fName) . ' DROP DEFAULT'; } else { $query .= ",\nALTER COLUMN " . $this->db->quoteName($fName) . ' SET NOT NULL' . ",\nALTER COLUMN " . $this->db->quoteName($fName) . ' SET DEFAULT ' . $fDefault; } } else { if ($fDefault !== null) { $query .= ",\nALTER COLUMN " . $this->db->quoteName($fName) . ' DROP NOT NULL' . ",\nALTER COLUMN " . $this->db->quoteName($fName) . ' SET DEFAULT ' . $fDefault; } } /* sequence was created in other function, here is associated a default value but not yet owner */ if (strpos($fDefault, 'nextval') !== false) { $query .= ";\nALTER SEQUENCE " . $this->db->quoteName($table . '_' . $fName . '_seq') . ' OWNED BY ' . $this->db->quoteName($table . '.' . $fName); } return $query; } /** * Get the SQL syntax for a single column that would be included in a table create statement. * * @param SimpleXMLElement $field The XML field definition. * * @return string * * @since 12.1 */ protected function getColumnSql(SimpleXMLElement $field) { // TODO Incorporate into parent class and use $this. $blobs = array('text', 'smalltext', 'mediumtext', 'largetext'); $fName = (string) $field['Field']; $fType = (string) $field['Type']; $fNull = (string) $field['Null']; $fDefault = (isset($field['Default']) && $field['Default'] != 'NULL' ) ? preg_match('/^[0-9]$/', $field['Default']) ? $field['Default'] : $this->db->quote((string) $field['Default']) : null; /* nextval() as default value means that type field is serial */ if (strpos($fDefault, 'nextval') !== false) { $query = $this->db->quoteName($fName) . ' SERIAL'; } else { $query = $this->db->quoteName($fName) . ' ' . $fType; if ($fNull == 'NO') { if (in_array($fType, $blobs) || $fDefault === null) { $query .= ' NOT NULL'; } else { $query .= ' NOT NULL DEFAULT ' . $fDefault; } } else { if ($fDefault !== null) { $query .= ' DEFAULT ' . $fDefault; } } } return $query; } /** * Get the SQL syntax to drop an index. * * @param string $name The name of the key to drop. * * @return string * * @since 12.1 */ protected function getDropIndexSql($name) { return 'DROP INDEX ' . $this->db->quoteName($name); } /** * Get the SQL syntax to drop a key. * * @param string $table The table name. * @param string $name The constraint name. * * @return string * * @since 12.1 */ protected function getDropPrimaryKeySql($table, $name) { return 'ALTER TABLE ONLY ' . $this->db->quoteName($table) . ' DROP CONSTRAINT ' . $this->db->quoteName($name); } /** * Get the details list of keys for a table. * * @param array $keys An array of objects that comprise the keys for the table. * * @return array The lookup array. array({key name} => array(object, ...)) * * @since 12.1 * @throws Exception */ protected function getIdxLookup($keys) { // First pass, create a lookup of the keys. $lookup = array(); foreach ($keys as $key) { if ($key instanceof SimpleXMLElement) { $kName = (string) $key['Index']; } else { $kName = $key->Index; } if (empty($lookup[$kName])) { $lookup[$kName] = array(); } $lookup[$kName][] = $key; } return $lookup; } /** * Get the details list of sequences for a table. * * @param array $sequences An array of objects that comprise the sequences for the table. * * @return array The lookup array. array({key name} => array(object, ...)) * * @since 12.1 * @throws Exception */ protected function getSeqLookup($sequences) { // First pass, create a lookup of the keys. $lookup = array(); foreach ($sequences as $seq) { if ($seq instanceof SimpleXMLElement) { $sName = (string) $seq['Name']; } else { $sName = $seq->Name; } if (empty($lookup[$sName])) { $lookup[$sName] = array(); } $lookup[$sName][] = $seq; } return $lookup; } } PK���\cy 3�3�#libraries/joomla/database/query.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Query Element Class. * * @property-read string $name The name of the element. * @property-read array $elements An array of elements. * @property-read string $glue Glue piece. * * @since 11.1 */ class JDatabaseQueryElement { /** * @var string The name of the element. * @since 11.1 */ protected $name = null; /** * @var array An array of elements. * @since 11.1 */ protected $elements = null; /** * @var string Glue piece. * @since 11.1 */ protected $glue = null; /** * Constructor. * * @param string $name The name of the element. * @param mixed $elements String or array. * @param string $glue The glue for elements. * * @since 11.1 */ public function __construct($name, $elements, $glue = ',') { $this->elements = array(); $this->name = $name; $this->glue = $glue; $this->append($elements); } /** * Magic function to convert the query element to a string. * * @return string * * @since 11.1 */ public function __toString() { if (substr($this->name, -2) == '()') { return PHP_EOL . substr($this->name, 0, -2) . '(' . implode($this->glue, $this->elements) . ')'; } else { return PHP_EOL . $this->name . ' ' . implode($this->glue, $this->elements); } } /** * Appends element parts to the internal list. * * @param mixed $elements String or array. * * @return void * * @since 11.1 */ public function append($elements) { if (is_array($elements)) { $this->elements = array_merge($this->elements, $elements); } else { $this->elements = array_merge($this->elements, array($elements)); } } /** * Gets the elements of this element. * * @return array * * @since 11.1 */ public function getElements() { return $this->elements; } /** * Method to provide deep copy support to nested objects and arrays * when cloning. * * @return void * * @since 11.3 */ public function __clone() { foreach ($this as $k => $v) { if (is_object($v) || is_array($v)) { $this->{$k} = unserialize(serialize($v)); } } } } /** * Query Building Class. * * @since 11.1 * * @method string q() q($text, $escape = true) Alias for quote method * @method string qn() qn($name, $as = null) Alias for quoteName method * @method string e() e($text, $extra = false) Alias for escape method * @property-read JDatabaseQueryElement $type * @property-read JDatabaseQueryElement $select * @property-read JDatabaseQueryElement $group * @property-read JDatabaseQueryElement $having */ abstract class JDatabaseQuery { /** * @var JDatabaseDriver The database driver. * @since 11.1 */ protected $db = null; /** * @var string The SQL query (if a direct query string was provided). * @since 12.1 */ protected $sql = null; /** * @var string The query type. * @since 11.1 */ protected $type = ''; /** * @var JDatabaseQueryElement The query element for a generic query (type = null). * @since 11.1 */ protected $element = null; /** * @var JDatabaseQueryElement The select element. * @since 11.1 */ protected $select = null; /** * @var JDatabaseQueryElement The delete element. * @since 11.1 */ protected $delete = null; /** * @var JDatabaseQueryElement The update element. * @since 11.1 */ protected $update = null; /** * @var JDatabaseQueryElement The insert element. * @since 11.1 */ protected $insert = null; /** * @var JDatabaseQueryElement The from element. * @since 11.1 */ protected $from = null; /** * @var JDatabaseQueryElement The join element. * @since 11.1 */ protected $join = null; /** * @var JDatabaseQueryElement The set element. * @since 11.1 */ protected $set = null; /** * @var JDatabaseQueryElement The where element. * @since 11.1 */ protected $where = null; /** * @var JDatabaseQueryElement The group by element. * @since 11.1 */ protected $group = null; /** * @var JDatabaseQueryElement The having element. * @since 11.1 */ protected $having = null; /** * @var JDatabaseQueryElement The column list for an INSERT statement. * @since 11.1 */ protected $columns = null; /** * @var JDatabaseQueryElement The values list for an INSERT statement. * @since 11.1 */ protected $values = null; /** * @var JDatabaseQueryElement The order element. * @since 11.1 */ protected $order = null; /** * @var object The auto increment insert field element. * @since 11.1 */ protected $autoIncrementField = null; /** * @var JDatabaseQueryElement The call element. * @since 12.1 */ protected $call = null; /** * @var JDatabaseQueryElement The exec element. * @since 12.1 */ protected $exec = null; /** * @var JDatabaseQueryElement The union element. * @since 12.1 */ protected $union = null; /** * @var JDatabaseQueryElement The unionAll element. * @since 13.1 */ protected $unionAll = null; /** * Magic method to provide method alias support for quote() and quoteName(). * * @param string $method The called method. * @param array $args The array of arguments passed to the method. * * @return string The aliased method's return value or null. * * @since 11.1 */ public function __call($method, $args) { if (empty($args)) { return; } switch ($method) { case 'q': return $this->quote($args[0], isset($args[1]) ? $args[1] : true); break; case 'qn': return $this->quoteName($args[0], isset($args[1]) ? $args[1] : null); break; case 'e': return $this->escape($args[0], isset($args[1]) ? $args[1] : false); break; } } /** * Class constructor. * * @param JDatabaseDriver $db The database driver. * * @since 11.1 */ public function __construct(JDatabaseDriver $db = null) { $this->db = $db; } /** * Magic function to convert the query to a string. * * @return string The completed query. * * @since 11.1 */ public function __toString() { $query = ''; if ($this->sql) { return $this->sql; } switch ($this->type) { case 'element': $query .= (string) $this->element; break; case 'select': $query .= (string) $this->select; $query .= (string) $this->from; if ($this->join) { // Special case for joins foreach ($this->join as $join) { $query .= (string) $join; } } if ($this->where) { $query .= (string) $this->where; } if ($this->group) { $query .= (string) $this->group; } if ($this->having) { $query .= (string) $this->having; } if ($this->order) { $query .= (string) $this->order; } if ($this->union) { $query .= (string) $this->union; } break; case 'delete': $query .= (string) $this->delete; $query .= (string) $this->from; if ($this->join) { // Special case for joins foreach ($this->join as $join) { $query .= (string) $join; } } if ($this->where) { $query .= (string) $this->where; } if ($this->order) { $query .= (string) $this->order; } break; case 'update': $query .= (string) $this->update; if ($this->join) { // Special case for joins foreach ($this->join as $join) { $query .= (string) $join; } } $query .= (string) $this->set; if ($this->where) { $query .= (string) $this->where; } if ($this->order) { $query .= (string) $this->order; } break; case 'insert': $query .= (string) $this->insert; // Set method if ($this->set) { $query .= (string) $this->set; } // Columns-Values method elseif ($this->values) { if ($this->columns) { $query .= (string) $this->columns; } $elements = $this->values->getElements(); if (!($elements[0] instanceof $this)) { $query .= ' VALUES '; } $query .= (string) $this->values; } break; case 'call': $query .= (string) $this->call; break; case 'exec': $query .= (string) $this->exec; break; } if ($this instanceof JDatabaseQueryLimitable) { $query = $this->processLimit($query, $this->limit, $this->offset); } return $query; } /** * Magic function to get protected variable value * * @param string $name The name of the variable. * * @return mixed * * @since 11.1 */ public function __get($name) { return isset($this->$name) ? $this->$name : null; } /** * Add a single column, or array of columns to the CALL clause of the query. * * Note that you must not mix insert, update, delete and select method calls when building a query. * The call method can, however, be called multiple times in the same query. * * Usage: * $query->call('a.*')->call('b.id'); * $query->call(array('a.*', 'b.id')); * * @param mixed $columns A string or an array of field names. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 12.1 */ public function call($columns) { $this->type = 'call'; if (is_null($this->call)) { $this->call = new JDatabaseQueryElement('CALL', $columns); } else { $this->call->append($columns); } return $this; } /** * Casts a value to a char. * * Ensure that the value is properly quoted before passing to the method. * * Usage: * $query->select($query->castAsChar('a')); * * @param string $value The value to cast as a char. * * @return string Returns the cast value. * * @since 11.1 */ public function castAsChar($value) { return $value; } /** * Gets the number of characters in a string. * * Note, use 'length' to find the number of bytes in a string. * * Usage: * $query->select($query->charLength('a')); * * @param string $field A value. * @param string $operator Comparison operator between charLength integer value and $condition * @param string $condition Integer value to compare charLength with. * * @return string The required char length call. * * @since 11.1 */ public function charLength($field, $operator = null, $condition = null) { return 'CHAR_LENGTH(' . $field . ')' . (isset($operator) && isset($condition) ? ' ' . $operator . ' ' . $condition : ''); } /** * Clear data from the query or a specific clause of the query. * * @param string $clause Optionally, the name of the clause to clear, or nothing to clear the whole query. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function clear($clause = null) { $this->sql = null; switch ($clause) { case 'select': $this->select = null; $this->type = null; break; case 'delete': $this->delete = null; $this->type = null; break; case 'update': $this->update = null; $this->type = null; break; case 'insert': $this->insert = null; $this->type = null; $this->autoIncrementField = null; break; case 'from': $this->from = null; break; case 'join': $this->join = null; break; case 'set': $this->set = null; break; case 'where': $this->where = null; break; case 'group': $this->group = null; break; case 'having': $this->having = null; break; case 'order': $this->order = null; break; case 'columns': $this->columns = null; break; case 'values': $this->values = null; break; case 'exec': $this->exec = null; $this->type = null; break; case 'call': $this->call = null; $this->type = null; break; case 'limit': $this->offset = 0; $this->limit = 0; break; case 'offset': $this->offset = 0; break; case 'union': $this->union = null; break; case 'unionAll': $this->unionAll = null; break; default: $this->type = null; $this->select = null; $this->delete = null; $this->update = null; $this->insert = null; $this->from = null; $this->join = null; $this->set = null; $this->where = null; $this->group = null; $this->having = null; $this->order = null; $this->columns = null; $this->values = null; $this->autoIncrementField = null; $this->exec = null; $this->call = null; $this->union = null; $this->unionAll = null; $this->offset = 0; $this->limit = 0; break; } return $this; } /** * Adds a column, or array of column names that would be used for an INSERT INTO statement. * * @param mixed $columns A column name, or array of column names. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function columns($columns) { if (is_null($this->columns)) { $this->columns = new JDatabaseQueryElement('()', $columns); } else { $this->columns->append($columns); } return $this; } /** * Concatenates an array of column names or values. * * Usage: * $query->select($query->concatenate(array('a', 'b'))); * * @param array $values An array of values to concatenate. * @param string $separator As separator to place between each value. * * @return string The concatenated values. * * @since 11.1 */ public function concatenate($values, $separator = null) { if ($separator) { return 'CONCATENATE(' . implode(' || ' . $this->quote($separator) . ' || ', $values) . ')'; } else { return 'CONCATENATE(' . implode(' || ', $values) . ')'; } } /** * Gets the current date and time. * * Usage: * $query->where('published_up < '.$query->currentTimestamp()); * * @return string * * @since 11.1 */ public function currentTimestamp() { return 'CURRENT_TIMESTAMP()'; } /** * Returns a PHP date() function compliant date format for the database driver. * * This method is provided for use where the query object is passed to a function for modification. * If you have direct access to the database object, it is recommended you use the getDateFormat method directly. * * @return string The format string. * * @since 11.1 */ public function dateFormat() { if (!($this->db instanceof JDatabaseDriver)) { throw new RuntimeException('JLIB_DATABASE_ERROR_INVALID_DB_OBJECT'); } return $this->db->getDateFormat(); } /** * Creates a formatted dump of the query for debugging purposes. * * Usage: * echo $query->dump(); * * @return string * * @since 11.3 */ public function dump() { return '<pre class="jdatabasequery">' . str_replace('#__', $this->db->getPrefix(), $this) . '</pre>'; } /** * Add a table name to the DELETE clause of the query. * * Note that you must not mix insert, update, delete and select method calls when building a query. * * Usage: * $query->delete('#__a')->where('id = 1'); * * @param string $table The name of the table to delete from. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function delete($table = null) { $this->type = 'delete'; $this->delete = new JDatabaseQueryElement('DELETE', null); if (!empty($table)) { $this->from($table); } return $this; } /** * Method to escape a string for usage in an SQL statement. * * This method is provided for use where the query object is passed to a function for modification. * If you have direct access to the database object, it is recommended you use the escape method directly. * * Note that 'e' is an alias for this method as it is in JDatabaseDriver. * * @param string $text The string to be escaped. * @param boolean $extra Optional parameter to provide extra escaping. * * @return string The escaped string. * * @since 11.1 * @throws RuntimeException if the internal db property is not a valid object. */ public function escape($text, $extra = false) { if (!($this->db instanceof JDatabaseDriver)) { throw new RuntimeException('JLIB_DATABASE_ERROR_INVALID_DB_OBJECT'); } return $this->db->escape($text, $extra); } /** * Add a single column, or array of columns to the EXEC clause of the query. * * Note that you must not mix insert, update, delete and select method calls when building a query. * The exec method can, however, be called multiple times in the same query. * * Usage: * $query->exec('a.*')->exec('b.id'); * $query->exec(array('a.*', 'b.id')); * * @param mixed $columns A string or an array of field names. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 12.1 */ public function exec($columns) { $this->type = 'exec'; if (is_null($this->exec)) { $this->exec = new JDatabaseQueryElement('EXEC', $columns); } else { $this->exec->append($columns); } return $this; } /** * Add a table to the FROM clause of the query. * * Note that while an array of tables can be provided, it is recommended you use explicit joins. * * Usage: * $query->select('*')->from('#__a'); * * @param mixed $tables A string or array of table names. * This can be a JDatabaseQuery object (or a child of it) when used * as a subquery in FROM clause along with a value for $subQueryAlias. * @param string $subQueryAlias Alias used when $tables is a JDatabaseQuery. * * @return JDatabaseQuery Returns this object to allow chaining. * * @throws RuntimeException * * @since 11.1 */ public function from($tables, $subQueryAlias = null) { if (is_null($this->from)) { if ($tables instanceof $this) { if (is_null($subQueryAlias)) { throw new RuntimeException('JLIB_DATABASE_ERROR_NULL_SUBQUERY_ALIAS'); } $tables = '( ' . (string) $tables . ' ) AS ' . $this->quoteName($subQueryAlias); } $this->from = new JDatabaseQueryElement('FROM', $tables); } else { $this->from->append($tables); } return $this; } /** * Used to get a string to extract year from date column. * * Usage: * $query->select($query->year($query->quoteName('dateColumn'))); * * @param string $date Date column containing year to be extracted. * * @return string Returns string to extract year from a date. * * @since 12.1 */ public function year($date) { return 'YEAR(' . $date . ')'; } /** * Used to get a string to extract month from date column. * * Usage: * $query->select($query->month($query->quoteName('dateColumn'))); * * @param string $date Date column containing month to be extracted. * * @return string Returns string to extract month from a date. * * @since 12.1 */ public function month($date) { return 'MONTH(' . $date . ')'; } /** * Used to get a string to extract day from date column. * * Usage: * $query->select($query->day($query->quoteName('dateColumn'))); * * @param string $date Date column containing day to be extracted. * * @return string Returns string to extract day from a date. * * @since 12.1 */ public function day($date) { return 'DAY(' . $date . ')'; } /** * Used to get a string to extract hour from date column. * * Usage: * $query->select($query->hour($query->quoteName('dateColumn'))); * * @param string $date Date column containing hour to be extracted. * * @return string Returns string to extract hour from a date. * * @since 12.1 */ public function hour($date) { return 'HOUR(' . $date . ')'; } /** * Used to get a string to extract minute from date column. * * Usage: * $query->select($query->minute($query->quoteName('dateColumn'))); * * @param string $date Date column containing minute to be extracted. * * @return string Returns string to extract minute from a date. * * @since 12.1 */ public function minute($date) { return 'MINUTE(' . $date . ')'; } /** * Used to get a string to extract seconds from date column. * * Usage: * $query->select($query->second($query->quoteName('dateColumn'))); * * @param string $date Date column containing second to be extracted. * * @return string Returns string to extract second from a date. * * @since 12.1 */ public function second($date) { return 'SECOND(' . $date . ')'; } /** * Add a grouping column to the GROUP clause of the query. * * Usage: * $query->group('id'); * * @param mixed $columns A string or array of ordering columns. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function group($columns) { if (is_null($this->group)) { $this->group = new JDatabaseQueryElement('GROUP BY', $columns); } else { $this->group->append($columns); } return $this; } /** * A conditions to the HAVING clause of the query. * * Usage: * $query->group('id')->having('COUNT(id) > 5'); * * @param mixed $conditions A string or array of columns. * @param string $glue The glue by which to join the conditions. Defaults to AND. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function having($conditions, $glue = 'AND') { if (is_null($this->having)) { $glue = strtoupper($glue); $this->having = new JDatabaseQueryElement('HAVING', $conditions, " $glue "); } else { $this->having->append($conditions); } return $this; } /** * Add an INNER JOIN clause to the query. * * Usage: * $query->innerJoin('b ON b.id = a.id')->innerJoin('c ON c.id = b.id'); * * @param string $condition The join condition. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function innerJoin($condition) { $this->join('INNER', $condition); return $this; } /** * Add a table name to the INSERT clause of the query. * * Note that you must not mix insert, update, delete and select method calls when building a query. * * Usage: * $query->insert('#__a')->set('id = 1'); * $query->insert('#__a')->columns('id, title')->values('1,2')->values('3,4'); * $query->insert('#__a')->columns('id, title')->values(array('1,2', '3,4')); * * @param mixed $table The name of the table to insert data into. * @param boolean $incrementField The name of the field to auto increment. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function insert($table, $incrementField=false) { $this->type = 'insert'; $this->insert = new JDatabaseQueryElement('INSERT INTO', $table); $this->autoIncrementField = $incrementField; return $this; } /** * Add a JOIN clause to the query. * * Usage: * $query->join('INNER', 'b ON b.id = a.id); * * @param string $type The type of join. This string is prepended to the JOIN keyword. * @param string $conditions A string or array of conditions. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function join($type, $conditions) { if (is_null($this->join)) { $this->join = array(); } $this->join[] = new JDatabaseQueryElement(strtoupper($type) . ' JOIN', $conditions); return $this; } /** * Add a LEFT JOIN clause to the query. * * Usage: * $query->leftJoin('b ON b.id = a.id')->leftJoin('c ON c.id = b.id'); * * @param string $condition The join condition. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function leftJoin($condition) { $this->join('LEFT', $condition); return $this; } /** * Get the length of a string in bytes. * * Note, use 'charLength' to find the number of characters in a string. * * Usage: * query->where($query->length('a').' > 3'); * * @param string $value The string to measure. * * @return int * * @since 11.1 */ public function length($value) { return 'LENGTH(' . $value . ')'; } /** * Get the null or zero representation of a timestamp for the database driver. * * This method is provided for use where the query object is passed to a function for modification. * If you have direct access to the database object, it is recommended you use the nullDate method directly. * * Usage: * $query->where('modified_date <> '.$query->nullDate()); * * @param boolean $quoted Optionally wraps the null date in database quotes (true by default). * * @return string Null or zero representation of a timestamp. * * @since 11.1 */ public function nullDate($quoted = true) { if (!($this->db instanceof JDatabaseDriver)) { throw new RuntimeException('JLIB_DATABASE_ERROR_INVALID_DB_OBJECT'); } $result = $this->db->getNullDate($quoted); if ($quoted) { return $this->db->quote($result); } return $result; } /** * Add a ordering column to the ORDER clause of the query. * * Usage: * $query->order('foo')->order('bar'); * $query->order(array('foo','bar')); * * @param mixed $columns A string or array of ordering columns. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function order($columns) { if (is_null($this->order)) { $this->order = new JDatabaseQueryElement('ORDER BY', $columns); } else { $this->order->append($columns); } return $this; } /** * Add an OUTER JOIN clause to the query. * * Usage: * $query->outerJoin('b ON b.id = a.id')->outerJoin('c ON c.id = b.id'); * * @param string $condition The join condition. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function outerJoin($condition) { $this->join('OUTER', $condition); return $this; } /** * Method to quote and optionally escape a string to database requirements for insertion into the database. * * This method is provided for use where the query object is passed to a function for modification. * If you have direct access to the database object, it is recommended you use the quote method directly. * * Note that 'q' is an alias for this method as it is in JDatabaseDriver. * * Usage: * $query->quote('fulltext'); * $query->q('fulltext'); * $query->q(array('option', 'fulltext')); * * @param mixed $text A string or an array of strings to quote. * @param boolean $escape True to escape the string, false to leave it unchanged. * * @return string The quoted input string. * * @since 11.1 * @throws RuntimeException if the internal db property is not a valid object. */ public function quote($text, $escape = true) { if (!($this->db instanceof JDatabaseDriver)) { throw new RuntimeException('JLIB_DATABASE_ERROR_INVALID_DB_OBJECT'); } return $this->db->quote($text, $escape); } /** * Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection * risks and reserved word conflicts. * * This method is provided for use where the query object is passed to a function for modification. * If you have direct access to the database object, it is recommended you use the quoteName method directly. * * Note that 'qn' is an alias for this method as it is in JDatabaseDriver. * * Usage: * $query->quoteName('#__a'); * $query->qn('#__a'); * * @param mixed $name The identifier name to wrap in quotes, or an array of identifier names to wrap in quotes. * Each type supports dot-notation name. * @param mixed $as The AS query part associated to $name. It can be string or array, in latter case it has to be * same length of $name; if is null there will not be any AS part for string or array element. * * @return mixed The quote wrapped name, same type of $name. * * @since 11.1 * @throws RuntimeException if the internal db property is not a valid object. */ public function quoteName($name, $as = null) { if (!($this->db instanceof JDatabaseDriver)) { throw new RuntimeException('JLIB_DATABASE_ERROR_INVALID_DB_OBJECT'); } return $this->db->quoteName($name, $as); } /** * Add a RIGHT JOIN clause to the query. * * Usage: * $query->rightJoin('b ON b.id = a.id')->rightJoin('c ON c.id = b.id'); * * @param string $condition The join condition. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function rightJoin($condition) { $this->join('RIGHT', $condition); return $this; } /** * Add a single column, or array of columns to the SELECT clause of the query. * * Note that you must not mix insert, update, delete and select method calls when building a query. * The select method can, however, be called multiple times in the same query. * * Usage: * $query->select('a.*')->select('b.id'); * $query->select(array('a.*', 'b.id')); * * @param mixed $columns A string or an array of field names. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function select($columns) { $this->type = 'select'; if (is_null($this->select)) { $this->select = new JDatabaseQueryElement('SELECT', $columns); } else { $this->select->append($columns); } return $this; } /** * Add a single condition string, or an array of strings to the SET clause of the query. * * Usage: * $query->set('a = 1')->set('b = 2'); * $query->set(array('a = 1', 'b = 2'); * * @param mixed $conditions A string or array of string conditions. * @param string $glue The glue by which to join the condition strings. Defaults to ,. * Note that the glue is set on first use and cannot be changed. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function set($conditions, $glue = ',') { if (is_null($this->set)) { $glue = strtoupper($glue); $this->set = new JDatabaseQueryElement('SET', $conditions, "\n\t$glue "); } else { $this->set->append($conditions); } return $this; } /** * Allows a direct query to be provided to the database * driver's setQuery() method, but still allow queries * to have bounded variables. * * Usage: * $query->setQuery('select * from #__users'); * * @param mixed $sql An SQL Query * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 12.1 */ public function setQuery($sql) { $this->sql = $sql; return $this; } /** * Add a table name to the UPDATE clause of the query. * * Note that you must not mix insert, update, delete and select method calls when building a query. * * Usage: * $query->update('#__foo')->set(...); * * @param string $table A table to update. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function update($table) { $this->type = 'update'; $this->update = new JDatabaseQueryElement('UPDATE', $table); return $this; } /** * Adds a tuple, or array of tuples that would be used as values for an INSERT INTO statement. * * Usage: * $query->values('1,2,3')->values('4,5,6'); * $query->values(array('1,2,3', '4,5,6')); * * @param string $values A single tuple, or array of tuples. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function values($values) { if (is_null($this->values)) { $this->values = new JDatabaseQueryElement('()', $values, '),('); } else { $this->values->append($values); } return $this; } /** * Add a single condition, or an array of conditions to the WHERE clause of the query. * * Usage: * $query->where('a = 1')->where('b = 2'); * $query->where(array('a = 1', 'b = 2')); * * @param mixed $conditions A string or array of where conditions. * @param string $glue The glue by which to join the conditions. Defaults to AND. * Note that the glue is set on first use and cannot be changed. * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 11.1 */ public function where($conditions, $glue = 'AND') { if (is_null($this->where)) { $glue = strtoupper($glue); $this->where = new JDatabaseQueryElement('WHERE', $conditions, " $glue "); } else { $this->where->append($conditions); } return $this; } /** * Method to provide deep copy support to nested objects and * arrays when cloning. * * @return void * * @since 11.3 */ public function __clone() { foreach ($this as $k => $v) { if ($k === 'db') { continue; } if (is_object($v) || is_array($v)) { $this->{$k} = unserialize(serialize($v)); } } } /** * Add a query to UNION with the current query. * Multiple unions each require separate statements and create an array of unions. * * Usage (the $query base query MUST be a select query): * $query->union('SELECT name FROM #__foo') * $query->union('SELECT name FROM #__foo', true) * $query->union(array('SELECT name FROM #__foo','SELECT name FROM #__bar')) * $query->union($query2)->union($query3) * $query->union(array($query2, $query3)) * * @param mixed $query The JDatabaseQuery object or string to union. * @param boolean $distinct True to only return distinct rows from the union. * @param string $glue The glue by which to join the conditions. * * @return mixed The JDatabaseQuery object on success or boolean false on failure. * * @link http://dev.mysql.com/doc/refman/5.0/en/union.html * * @since 12.1 */ public function union($query, $distinct = false, $glue = '') { // Set up the DISTINCT flag, the name with parentheses, and the glue. if ($distinct) { $name = 'UNION DISTINCT ()'; $glue = ')' . PHP_EOL . 'UNION DISTINCT ('; } else { $glue = ')' . PHP_EOL . 'UNION ('; $name = 'UNION ()'; } // Get the JDatabaseQueryElement if it does not exist if (is_null($this->union)) { $this->union = new JDatabaseQueryElement($name, $query, "$glue"); } // Otherwise append the second UNION. else { $this->union->append($query); } return $this; } /** * Add a query to UNION DISTINCT with the current query. Simply a proxy to union with the DISTINCT keyword. * * Usage: * $query->unionDistinct('SELECT name FROM #__foo') * * @param mixed $query The JDatabaseQuery object or string to union. * @param string $glue The glue by which to join the conditions. * * @return mixed The JDatabaseQuery object on success or boolean false on failure. * * @see union * * @since 12.1 */ public function unionDistinct($query, $glue = '') { $distinct = true; // Apply the distinct flag to the union. return $this->union($query, $distinct, $glue); } /** * Find and replace sprintf-like tokens in a format string. * Each token takes one of the following forms: * %% - A literal percent character. * %[t] - Where [t] is a type specifier. * %[n]$[x] - Where [n] is an argument specifier and [t] is a type specifier. * * Types: * a - Numeric: Replacement text is coerced to a numeric type but not quoted or escaped. * e - Escape: Replacement text is passed to $this->escape(). * E - Escape (extra): Replacement text is passed to $this->escape() with true as the second argument. * n - Name Quote: Replacement text is passed to $this->quoteName(). * q - Quote: Replacement text is passed to $this->quote(). * Q - Quote (no escape): Replacement text is passed to $this->quote() with false as the second argument. * r - Raw: Replacement text is used as-is. (Be careful) * * Date Types: * - Replacement text automatically quoted (use uppercase for Name Quote). * - Replacement text should be a string in date format or name of a date column. * y/Y - Year * m/M - Month * d/D - Day * h/H - Hour * i/I - Minute * s/S - Second * * Invariable Types: * - Takes no argument. * - Argument index not incremented. * t - Replacement text is the result of $this->currentTimestamp(). * z - Replacement text is the result of $this->nullDate(false). * Z - Replacement text is the result of $this->nullDate(true). * * Usage: * $query->format('SELECT %1$n FROM %2$n WHERE %3$n = %4$a', 'foo', '#__foo', 'bar', 1); * Returns: SELECT `foo` FROM `#__foo` WHERE `bar` = 1 * * Notes: * The argument specifier is optional but recommended for clarity. * The argument index used for unspecified tokens is incremented only when used. * * @param string $format The formatting string. * * @return string Returns a string produced according to the formatting string. * * @since 12.3 */ public function format($format) { $query = $this; $args = array_slice(func_get_args(), 1); array_unshift($args, null); $i = 1; $func = function ($match) use ($query, $args, &$i) { if (isset($match[6]) && $match[6] == '%') { return '%'; } // No argument required, do not increment the argument index. switch ($match[5]) { case 't': return $query->currentTimestamp(); break; case 'z': return $query->nullDate(false); break; case 'Z': return $query->nullDate(true); break; } // Increment the argument index only if argument specifier not provided. $index = is_numeric($match[4]) ? (int) $match[4] : $i++; if (!$index || !isset($args[$index])) { // TODO - What to do? sprintf() throws a Warning in these cases. $replacement = ''; } else { $replacement = $args[$index]; } switch ($match[5]) { case 'a': return 0 + $replacement; break; case 'e': return $query->escape($replacement); break; case 'E': return $query->escape($replacement, true); break; case 'n': return $query->quoteName($replacement); break; case 'q': return $query->quote($replacement); break; case 'Q': return $query->quote($replacement, false); break; case 'r': return $replacement; break; // Dates case 'y': return $query->year($query->quote($replacement)); break; case 'Y': return $query->year($query->quoteName($replacement)); break; case 'm': return $query->month($query->quote($replacement)); break; case 'M': return $query->month($query->quoteName($replacement)); break; case 'd': return $query->day($query->quote($replacement)); break; case 'D': return $query->day($query->quoteName($replacement)); break; case 'h': return $query->hour($query->quote($replacement)); break; case 'H': return $query->hour($query->quoteName($replacement)); break; case 'i': return $query->minute($query->quote($replacement)); break; case 'I': return $query->minute($query->quoteName($replacement)); break; case 's': return $query->second($query->quote($replacement)); break; case 'S': return $query->second($query->quoteName($replacement)); break; } return ''; }; /** * Regexp to find an replace all tokens. * Matched fields: * 0: Full token * 1: Everything following '%' * 2: Everything following '%' unless '%' * 3: Argument specifier and '$' * 4: Argument specifier * 5: Type specifier * 6: '%' if full token is '%%' */ return preg_replace_callback('#%(((([\d]+)\$)?([aeEnqQryYmMdDhHiIsStzZ]))|(%))#', $func, $format); } /** * Add to the current date and time. * Usage: * $query->select($query->dateAdd()); * Prefixing the interval with a - (negative sign) will cause subtraction to be used. * Note: Not all drivers support all units. * * @param datetime $date The date to add to. May be date or datetime * @param string $interval The string representation of the appropriate number of units * @param string $datePart The part of the date to perform the addition on * * @return string The string with the appropriate sql for addition of dates * * @see http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add * @since 13.1 */ public function dateAdd($date, $interval, $datePart) { return trim("DATE_ADD('" . $date . "', INTERVAL " . $interval . ' ' . $datePart . ')'); } /** * Add a query to UNION ALL with the current query. * Multiple unions each require separate statements and create an array of unions. * * Usage: * $query->union('SELECT name FROM #__foo') * $query->union(array('SELECT name FROM #__foo','SELECT name FROM #__bar')) * * @param mixed $query The JDatabaseQuery object or string to union. * @param boolean $distinct Not used - ignored. * @param string $glue Not used - ignored. * * @return mixed The JDatabaseQuery object on success or boolean false on failure. * * @see union * * @since 13.1 */ public function unionAll($query, $distinct = false, $glue = '') { $glue = ')' . PHP_EOL . 'UNION ALL ('; $name = 'UNION ALL ()'; // Get the JDatabaseQueryElement if it does not exist if (is_null($this->unionAll)) { $this->unionAll = new JDatabaseQueryElement($name, $query, "$glue"); } // Otherwise append the second UNION. else { $this->unionAll->append($query); } return $this; } } PK���\�F�]77,libraries/joomla/database/iterator/mysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQL database iterator. * * @see http://dev.mysql.com/doc/ * @since 12.1 * @deprecated Will be removed when the minimum supported PHP version no longer includes the deprecated PHP `mysql` extension */ class JDatabaseIteratorMysql extends JDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @since 12.1 * @see Countable::count() */ public function count() { return mysql_num_rows($this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchObject() { return mysql_fetch_object($this->cursor, $this->class); } /** * Method to free up the memory used for the result set. * * @return void * * @since 12.1 */ protected function freeResult() { mysql_free_result($this->cursor); } } PK���\�pK��-libraries/joomla/database/iterator/sqlsrv.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * SQL server database iterator. * * @since 12.1 */ class JDatabaseIteratorSqlsrv extends JDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @since 12.1 * @see Countable::count() */ public function count() { return sqlsrv_num_rows($this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchObject() { return sqlsrv_fetch_object($this->cursor, $this->class); } /** * Method to free up the memory used for the result set. * * @return void * * @since 12.1 */ protected function freeResult() { sqlsrv_free_stmt($this->cursor); } } PK���\S~���-libraries/joomla/database/iterator/oracle.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Oracle database iterator. * * @since 12.1 */ class JDatabaseIteratorOracle extends JDatabaseIteratorPdo { } PK���\"�(���-libraries/joomla/database/iterator/mysqli.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQLi database iterator. * * @since 12.1 */ class JDatabaseIteratorMysqli extends JDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @since 12.1 * @see Countable::count() */ public function count() { return mysqli_num_rows($this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchObject() { return mysqli_fetch_object($this->cursor, $this->class); } /** * Method to free up the memory used for the result set. * * @return void * * @since 12.1 */ protected function freeResult() { mysqli_free_result($this->cursor); } } PK���\G��/libraries/joomla/database/iterator/pdomysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQL database iterator for the PDO based MySQL database driver. * * @package Joomla.Platform * @subpackage Database * @see http://dev.mysql.com/doc/ * @since 3.4 */ class JDatabaseIteratorPdomysql extends JDatabaseIteratorPdo { } PK���\H����-libraries/joomla/database/iterator/sqlite.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * SQLite database iterator. * * @since 12.1 */ class JDatabaseIteratorSqlite extends JDatabaseIteratorPdo { } PK���\e�-l��1libraries/joomla/database/iterator/postgresql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * PostgreSQL database iterator. * * @since 13.1 */ class JDatabaseIteratorPostgresql extends JDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @since 13.1 * @see Countable::count() */ public function count() { return pg_num_rows($this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 13.1 */ protected function fetchObject() { return pg_fetch_object($this->cursor, null, $this->class); } /** * Method to free up the memory used for the result set. * * @return void * * @since 13.1 */ protected function freeResult() { pg_free_result($this->cursor); } } PK���\��n���*libraries/joomla/database/iterator/pdo.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * PDO database iterator. * * @since 12.1 */ class JDatabaseIteratorPdo extends JDatabaseIterator { /** * Get the number of rows in the result set for the executed SQL given by the cursor. * * @return integer The number of rows in the result set. * * @since 12.1 * @see Countable::count() */ public function count() { if (!empty($this->cursor) && $this->cursor instanceof PDOStatement) { return $this->cursor->rowCount(); } else { return 0; } } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchObject() { if (!empty($this->cursor) && $this->cursor instanceof PDOStatement) { return $this->cursor->fetchObject($this->class); } else { return false; } } /** * Method to free up the memory used for the result set. * * @return void * * @since 12.1 */ protected function freeResult() { if (!empty($this->cursor) && $this->cursor instanceof PDOStatement) { $this->cursor->closeCursor(); } } } PK���\ӑص��,libraries/joomla/database/iterator/azure.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * SQL azure database iterator. * * @since 12.1 */ class JDatabaseIteratorAzure extends JDatabaseIteratorSqlsrv { } PK���\�'�)libraries/joomla/database/query/mysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Query Building Class. * * @since 11.1 * @deprecated Will be removed when the minimum supported PHP version no longer includes the deprecated PHP `mysql` extension */ class JDatabaseQueryMysql extends JDatabaseQueryMysqli { } PK���\��I���-libraries/joomla/database/query/limitable.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Database Query Limitable Interface. * Adds bind/unbind methods as well as a getBounded() method * to retrieve the stored bounded variables on demand prior to * query execution. * * @since 12.1 */ interface JDatabaseQueryLimitable { /** * Method to modify a query already in string format with the needed * additions to make the query limited to a particular number of * results, or start at a particular offset. This method is used * automatically by the __toString() method if it detects that the * query implements the JDatabaseQueryLimitable interface. * * @param string $query The query in string format * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return string * * @since 12.1 */ public function processLimit($query, $limit, $offset = 0); /** * Sets the offset and limit for the result set, if the database driver supports it. * * Usage: * $query->setLimit(100, 0); (retrieve 100 rows, starting at first record) * $query->setLimit(50, 50); (retrieve 50 rows, starting at 50th record) * * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 12.1 */ public function setLimit($limit = 0, $offset = 0); } PK���\�sL� *libraries/joomla/database/query/sqlsrv.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Query Building Class. * * @since 11.1 */ class JDatabaseQuerySqlsrv extends JDatabaseQuery implements JDatabaseQueryLimitable { /** * The character(s) used to quote SQL statement names such as table names or field names, * etc. The child classes should define this as necessary. If a single character string the * same character is used for both sides of the quoted name, else the first character will be * used for the opening quote and the second for the closing quote. * * @var string * @since 11.1 */ protected $name_quotes = '`'; /** * The null or zero representation of a timestamp for the database driver. This should be * defined in child classes to hold the appropriate value for the engine. * * @var string * @since 11.1 */ protected $null_date = '1900-01-01 00:00:00'; /** * @var integer The affected row limit for the current SQL statement. * @since 3.2 CMS */ protected $limit = 0; /** * @var integer The affected row offset to apply for the current SQL statement. * @since 3.2 CMS */ protected $offset = 0; /** * Magic function to convert the query to a string. * * @return string The completed query. * * @since 11.1 */ public function __toString() { $query = ''; switch ($this->type) { case 'select': $query .= (string) $this->select; $query .= (string) $this->from; if ($this->join) { // Special case for joins foreach ($this->join as $join) { $query .= (string) $join; } } if ($this->where) { $query .= (string) $this->where; } if ($this->group) { $query .= (string) $this->group; } if ($this->order) { $query .= (string) $this->order; } if ($this->having) { $query .= (string) $this->having; } if ($this instanceof JDatabaseQueryLimitable && ($this->limit > 0 || $this->offset > 0)) { $query = $this->processLimit($query, $this->limit, $this->offset); } break; case 'insert': $query .= (string) $this->insert; // Set method if ($this->set) { $query .= (string) $this->set; } // Columns-Values method elseif ($this->values) { if ($this->columns) { $query .= (string) $this->columns; } $elements = $this->insert->getElements(); $tableName = array_shift($elements); $query .= 'VALUES '; $query .= (string) $this->values; if ($this->autoIncrementField) { $query = 'SET IDENTITY_INSERT ' . $tableName . ' ON;' . $query . 'SET IDENTITY_INSERT ' . $tableName . ' OFF;'; } if ($this->where) { $query .= (string) $this->where; } } break; case 'delete': $query .= (string) $this->delete; $query .= (string) $this->from; if ($this->join) { // Special case for joins foreach ($this->join as $join) { $query .= (string) $join; } } if ($this->where) { $query .= (string) $this->where; } if ($this->order) { $query .= (string) $this->order; } break; case 'update': $query .= (string) $this->update; if ($this->join) { // Special case for joins foreach ($this->join as $join) { $query .= (string) $join; } } $query .= (string) $this->set; if ($this->where) { $query .= (string) $this->where; } if ($this->order) { $query .= (string) $this->order; } break; default: $query = parent::__toString(); break; } return $query; } /** * Casts a value to a char. * * Ensure that the value is properly quoted before passing to the method. * * @param string $value The value to cast as a char. * * @return string Returns the cast value. * * @since 11.1 */ public function castAsChar($value) { return 'CAST(' . $value . ' as NVARCHAR(10))'; } /** * Gets the function to determine the length of a character string. * * @param string $field A value. * @param string $operator Comparison operator between charLength integer value and $condition * @param string $condition Integer value to compare charLength with. * * @return string The required char length call. * * @since 11.1 */ public function charLength($field, $operator = null, $condition = null) { return 'DATALENGTH(' . $field . ')' . (isset($operator) && isset($condition) ? ' ' . $operator . ' ' . $condition : ''); } /** * Concatenates an array of column names or values. * * @param array $values An array of values to concatenate. * @param string $separator As separator to place between each value. * * @return string The concatenated values. * * @since 11.1 */ public function concatenate($values, $separator = null) { if ($separator) { return '(' . implode('+' . $this->quote($separator) . '+', $values) . ')'; } else { return '(' . implode('+', $values) . ')'; } } /** * Gets the current date and time. * * @return string * * @since 11.1 */ public function currentTimestamp() { return 'GETDATE()'; } /** * Get the length of a string in bytes. * * @param string $value The string to measure. * * @return integer * * @since 11.1 */ public function length($value) { return 'LEN(' . $value . ')'; } /** * Add to the current date and time. * Usage: * $query->select($query->dateAdd()); * Prefixing the interval with a - (negative sign) will cause subtraction to be used. * * @param datetime $date The date to add to; type may be time or datetime. * @param string $interval The string representation of the appropriate number of units * @param string $datePart The part of the date to perform the addition on * * @return string The string with the appropriate sql for addition of dates * * @since 13.1 * @note Not all drivers support all units. * @link http://msdn.microsoft.com/en-us/library/ms186819.aspx for more information */ public function dateAdd($date, $interval, $datePart) { return "DATEADD('" . $datePart . "', '" . $interval . "', '" . $date . "'" . ')'; } /** * Method to modify a query already in string format with the needed * additions to make the query limited to a particular number of * results, or start at a particular offset. * * @param string $query The query in string format * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return string * * @since 12.1 */ public function processLimit($query, $limit, $offset = 0) { if ($limit == 0 && $offset == 0) { return $query; } $start = $offset + 1; $end = $offset + $limit; $orderBy = stristr($query, 'ORDER BY'); if (is_null($orderBy) || empty($orderBy)) { $orderBy = 'ORDER BY (select 0)'; } $query = str_ireplace($orderBy, '', $query); $rowNumberText = ', ROW_NUMBER() OVER (' . $orderBy . ') AS RowNumber FROM '; $query = preg_replace('/\sFROM\s/i', $rowNumberText, $query, 1); $query = 'SELECT * FROM (' . $query . ') A WHERE A.RowNumber BETWEEN ' . $start . ' AND ' . $end; return $query; } /** * Sets the offset and limit for the result set, if the database driver supports it. * * Usage: * $query->setLimit(100, 0); (retrieve 100 rows, starting at first record) * $query->setLimit(50, 50); (retrieve 50 rows, starting at 50th record) * * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 12.1 */ public function setLimit($limit = 0, $offset = 0) { $this->limit = (int) $limit; $this->offset = (int) $offset; return $this; } } PK���\�g����*libraries/joomla/database/query/oracle.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Oracle Query Building Class. * * @since 12.1 */ class JDatabaseQueryOracle extends JDatabaseQueryPdo implements JDatabaseQueryPreparable, JDatabaseQueryLimitable { /** * @var integer The offset for the result set. * @since 12.1 */ protected $offset; /** * @var integer The limit for the result set. * @since 12.1 */ protected $limit; /** * @var array Bounded object array * @since 12.1 */ protected $bounded = array(); /** * Method to add a variable to an internal array that will be bound to a prepared SQL statement before query execution. Also * removes a variable that has been bounded from the internal bounded array when the passed in value is null. * * @param string|integer $key The key that will be used in your SQL query to reference the value. Usually of * the form ':key', but can also be an integer. * @param mixed &$value The value that will be bound. The value is passed by reference to support output * parameters such as those possible with stored procedures. * @param integer $dataType Constant corresponding to a SQL datatype. * @param integer $length The length of the variable. Usually required for OUTPUT parameters. * @param array $driverOptions Optional driver options to be used. * * @return JDatabaseQueryOracle * * @since 12.1 */ public function bind($key = null, &$value = null, $dataType = PDO::PARAM_STR, $length = 0, $driverOptions = array()) { // Case 1: Empty Key (reset $bounded array) if (empty($key)) { $this->bounded = array(); return $this; } // Case 2: Key Provided, null value (unset key from $bounded array) if (is_null($value)) { if (isset($this->bounded[$key])) { unset($this->bounded[$key]); } return $this; } $obj = new stdClass; $obj->value = &$value; $obj->dataType = $dataType; $obj->length = $length; $obj->driverOptions = $driverOptions; // Case 3: Simply add the Key/Value into the bounded array $this->bounded[$key] = $obj; return $this; } /** * Retrieves the bound parameters array when key is null and returns it by reference. If a key is provided then that item is * returned. * * @param mixed $key The bounded variable key to retrieve. * * @return mixed * * @since 12.1 */ public function &getBounded($key = null) { if (empty($key)) { return $this->bounded; } else { if (isset($this->bounded[$key])) { return $this->bounded[$key]; } } } /** * Clear data from the query or a specific clause of the query. * * @param string $clause Optionally, the name of the clause to clear, or nothing to clear the whole query. * * @return JDatabaseQueryOracle Returns this object to allow chaining. * * @since 12.1 */ public function clear($clause = null) { switch ($clause) { case null: $this->bounded = array(); break; } parent::clear($clause); return $this; } /** * Method to modify a query already in string format with the needed * additions to make the query limited to a particular number of * results, or start at a particular offset. This method is used * automatically by the __toString() method if it detects that the * query implements the JDatabaseQueryLimitable interface. * * @param string $query The query in string format * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return string * * @since 12.1 */ public function processLimit($query, $limit, $offset = 0) { // Check if we need to mangle the query. if ($limit || $offset) { $query = "SELECT joomla2.* FROM ( SELECT joomla1.*, ROWNUM AS joomla_db_rownum FROM ( " . $query . " ) joomla1 ) joomla2"; // Check if the limit value is greater than zero. if ($limit > 0) { $query .= ' WHERE joomla2.joomla_db_rownum BETWEEN ' . ($offset + 1) . ' AND ' . ($offset + $limit); } else { // Check if there is an offset and then use this. if ($offset) { $query .= ' WHERE joomla2.joomla_db_rownum > ' . ($offset + 1); } } } return $query; } /** * Sets the offset and limit for the result set, if the database driver supports it. * * Usage: * $query->setLimit(100, 0); (retrieve 100 rows, starting at first record) * $query->setLimit(50, 50); (retrieve 50 rows, starting at 50th record) * * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return JDatabaseQueryOracle Returns this object to allow chaining. * * @since 12.1 */ public function setLimit($limit = 0, $offset = 0) { $this->limit = (int) $limit; $this->offset = (int) $offset; return $this; } } PK���\\��b66,libraries/joomla/database/query/sqlazure.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Query Building Class. * * @since 11.1 */ class JDatabaseQuerySqlazure extends JDatabaseQuerySqlsrv { /** * The character(s) used to quote SQL statement names such as table names or field names, * etc. The child classes should define this as necessary. If a single character string the * same character is used for both sides of the quoted name, else the first character will be * used for the opening quote and the second for the closing quote. * * @var string * * @since 11.1 */ protected $name_quotes = ''; } PK���\B�=*libraries/joomla/database/query/mysqli.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Query Building Class. * * @since 11.1 */ class JDatabaseQueryMysqli extends JDatabaseQuery implements JDatabaseQueryLimitable { /** * @var integer The offset for the result set. * @since 12.1 */ protected $offset; /** * @var integer The limit for the result set. * @since 12.1 */ protected $limit; /** * Method to modify a query already in string format with the needed * additions to make the query limited to a particular number of * results, or start at a particular offset. * * @param string $query The query in string format * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return string * * @since 12.1 */ public function processLimit($query, $limit, $offset = 0) { if ($limit > 0 || $offset > 0) { $query .= ' LIMIT ' . $offset . ', ' . $limit; } return $query; } /** * Concatenates an array of column names or values. * * @param array $values An array of values to concatenate. * @param string $separator As separator to place between each value. * * @return string The concatenated values. * * @since 11.1 */ public function concatenate($values, $separator = null) { if ($separator) { $concat_string = 'CONCAT_WS(' . $this->quote($separator); foreach ($values as $value) { $concat_string .= ', ' . $value; } return $concat_string . ')'; } else { return 'CONCAT(' . implode(',', $values) . ')'; } } /** * Sets the offset and limit for the result set, if the database driver supports it. * * Usage: * $query->setLimit(100, 0); (retrieve 100 rows, starting at first record) * $query->setLimit(50, 50); (retrieve 50 rows, starting at 50th record) * * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return JDatabaseQuery Returns this object to allow chaining. * * @since 12.1 */ public function setLimit($limit = 0, $offset = 0) { $this->limit = (int) $limit; $this->offset = (int) $offset; return $this; } /** * Return correct regexp operator for mysqli. * * Ensure that the regexp operator is mysqli compatible. * * Usage: * $query->where('field ' . $query->regexp($search)); * * @param string $value The regex pattern. * * @return string Returns the regex operator. * * @since 11.3 */ public function regexp($value) { return ' REGEXP ' . $value; } } PK���\�S���,libraries/joomla/database/query/pdomysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Query Building Class. * * @package Joomla.Platform * @subpackage Database * @since 3.4 */ class JDatabaseQueryPdomysql extends JDatabaseQueryMysqli { } PK���\9F���.libraries/joomla/database/query/preparable.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Database Query Preparable Interface. * Adds bind/unbind methods as well as a getBounded() method * to retrieve the stored bounded variables on demand prior to * query execution. * * @since 12.1 */ interface JDatabaseQueryPreparable { /** * Method to add a variable to an internal array that will be bound to a prepared SQL statement before query execution. Also * removes a variable that has been bounded from the internal bounded array when the passed in value is null. * * @param string|integer $key The key that will be used in your SQL query to reference the value. Usually of * the form ':key', but can also be an integer. * @param mixed &$value The value that will be bound. The value is passed by reference to support output * parameters such as those possible with stored procedures. * @param integer $dataType Constant corresponding to a SQL datatype. * @param integer $length The length of the variable. Usually required for OUTPUT parameters. * @param array $driverOptions Optional driver options to be used. * * @return JDatabaseQuery * * @since 12.1 */ public function bind($key = null, &$value = null, $dataType = PDO::PARAM_STR, $length = 0, $driverOptions = array()); /** * Retrieves the bound parameters array when key is null and returns it by reference. If a key is provided then that item is * returned. * * @param mixed $key The bounded variable key to retrieve. * * @return mixed * * @since 12.1 */ public function &getBounded($key = null); } PK���\C<���*libraries/joomla/database/query/sqlite.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * SQLite Query Building Class. * * @since 12.1 */ class JDatabaseQuerySqlite extends JDatabaseQueryPdo implements JDatabaseQueryPreparable, JDatabaseQueryLimitable { /** * @var integer The offset for the result set. * @since 12.1 */ protected $offset; /** * @var integer The limit for the result set. * @since 12.1 */ protected $limit; /** * @var array Bounded object array * @since 12.1 */ protected $bounded = array(); /** * Method to add a variable to an internal array that will be bound to a prepared SQL statement before query execution. Also * removes a variable that has been bounded from the internal bounded array when the passed in value is null. * * @param string|integer $key The key that will be used in your SQL query to reference the value. Usually of * the form ':key', but can also be an integer. * @param mixed &$value The value that will be bound. The value is passed by reference to support output * parameters such as those possible with stored procedures. * @param integer $dataType Constant corresponding to a SQL datatype. * @param integer $length The length of the variable. Usually required for OUTPUT parameters. * @param array $driverOptions Optional driver options to be used. * * @return JDatabaseQuerySqlite * * @since 12.1 */ public function bind($key = null, &$value = null, $dataType = PDO::PARAM_STR, $length = 0, $driverOptions = array()) { // Case 1: Empty Key (reset $bounded array) if (empty($key)) { $this->bounded = array(); return $this; } // Case 2: Key Provided, null value (unset key from $bounded array) if (is_null($value)) { if (isset($this->bounded[$key])) { unset($this->bounded[$key]); } return $this; } $obj = new stdClass; $obj->value = &$value; $obj->dataType = $dataType; $obj->length = $length; $obj->driverOptions = $driverOptions; // Case 3: Simply add the Key/Value into the bounded array $this->bounded[$key] = $obj; return $this; } /** * Retrieves the bound parameters array when key is null and returns it by reference. If a key is provided then that item is * returned. * * @param mixed $key The bounded variable key to retrieve. * * @return mixed * * @since 12.1 */ public function &getBounded($key = null) { if (empty($key)) { return $this->bounded; } else { if (isset($this->bounded[$key])) { return $this->bounded[$key]; } } } /** * Gets the number of characters in a string. * * Note, use 'length' to find the number of bytes in a string. * * Usage: * $query->select($query->charLength('a')); * * @param string $field A value. * @param string $operator Comparison operator between charLength integer value and $condition * @param string $condition Integer value to compare charLength with. * * @return string The required char length call. * * @since 13.1 */ public function charLength($field, $operator = null, $condition = null) { return 'length(' . $field . ')' . (isset($operator) && isset($condition) ? ' ' . $operator . ' ' . $condition : ''); } /** * Clear data from the query or a specific clause of the query. * * @param string $clause Optionally, the name of the clause to clear, or nothing to clear the whole query. * * @return JDatabaseQuerySqlite Returns this object to allow chaining. * * @since 12.1 */ public function clear($clause = null) { switch ($clause) { case null: $this->bounded = array(); break; } parent::clear($clause); return $this; } /** * Concatenates an array of column names or values. * * Usage: * $query->select($query->concatenate(array('a', 'b'))); * * @param array $values An array of values to concatenate. * @param string $separator As separator to place between each value. * * @return string The concatenated values. * * @since 11.1 */ public function concatenate($values, $separator = null) { if ($separator) { return implode(' || ' . $this->quote($separator) . ' || ', $values); } else { return implode(' || ', $values); } } /** * Method to modify a query already in string format with the needed * additions to make the query limited to a particular number of * results, or start at a particular offset. This method is used * automatically by the __toString() method if it detects that the * query implements the JDatabaseQueryLimitable interface. * * @param string $query The query in string format * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return string * * @since 12.1 */ public function processLimit($query, $limit, $offset = 0) { if ($limit > 0 || $offset > 0) { $query .= ' LIMIT ' . $offset . ', ' . $limit; } return $query; } /** * Sets the offset and limit for the result set, if the database driver supports it. * * Usage: * $query->setLimit(100, 0); (retrieve 100 rows, starting at first record) * $query->setLimit(50, 50); (retrieve 50 rows, starting at 50th record) * * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return JDatabaseQuerySqlite Returns this object to allow chaining. * * @since 12.1 */ public function setLimit($limit = 0, $offset = 0) { $this->limit = (int) $limit; $this->offset = (int) $offset; return $this; } /** * Add to the current date and time. * Usage: * $query->select($query->dateAdd()); * Prefixing the interval with a - (negative sign) will cause subtraction to be used. * * @param datetime $date The date or datetime to add to * @param string $interval The string representation of the appropriate number of units * @param string $datePart The part of the date to perform the addition on * * @return string The string with the appropriate sql for addition of dates * * @since 13.1 * @link http://www.sqlite.org/lang_datefunc.html */ public function dateAdd($date, $interval, $datePart) { // SQLite does not support microseconds as a separate unit. Convert the interval to seconds if (strcasecmp($datePart, 'microseconds') == 0) { $interval = .001 * $interval; $datePart = 'seconds'; } if (substr($interval, 0, 1) != '-') { return "datetime('" . $date . "', '+" . $interval . " " . $datePart . "')"; } else { return "datetime('" . $date . "', '" . $interval . " " . $datePart . "')"; } } /** * Gets the current date and time. * * Usage: * $query->where('published_up < '.$query->currentTimestamp()); * * @return string * * @since 3.4 */ public function currentTimestamp() { return 'CURRENT_TIMESTAMP'; } } PK���\~��%55.libraries/joomla/database/query/postgresql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Query Building Class. * * @since 11.3 */ class JDatabaseQueryPostgresql extends JDatabaseQuery implements JDatabaseQueryLimitable { /** * @var object The FOR UPDATE element used in "FOR UPDATE" lock * @since 11.3 */ protected $forUpdate = null; /** * @var object The FOR SHARE element used in "FOR SHARE" lock * @since 11.3 */ protected $forShare = null; /** * @var object The NOWAIT element used in "FOR SHARE" and "FOR UPDATE" lock * @since 11.3 */ protected $noWait = null; /** * @var object The LIMIT element * @since 11.3 */ protected $limit = null; /** * @var object The OFFSET element * @since 11.3 */ protected $offset = null; /** * @var object The RETURNING element of INSERT INTO * @since 11.3 */ protected $returning = null; /** * Magic function to convert the query to a string, only for postgresql specific query * * @return string The completed query. * * @since 11.3 */ public function __toString() { $query = ''; switch ($this->type) { case 'select': $query .= (string) $this->select; $query .= (string) $this->from; if ($this->join) { // Special case for joins foreach ($this->join as $join) { $query .= (string) $join; } } if ($this->where) { $query .= (string) $this->where; } if ($this->group) { $query .= (string) $this->group; } if ($this->having) { $query .= (string) $this->having; } if ($this->order) { $query .= (string) $this->order; } if ($this->forUpdate) { $query .= (string) $this->forUpdate; } else { if ($this->forShare) { $query .= (string) $this->forShare; } } if ($this->noWait) { $query .= (string) $this->noWait; } break; case 'update': $query .= (string) $this->update; $query .= (string) $this->set; if ($this->join) { $onWord = ' ON '; // Workaround for special case of JOIN with UPDATE foreach ($this->join as $join) { $joinElem = $join->getElements(); $joinArray = explode($onWord, $joinElem[0]); $this->from($joinArray[0]); $this->where($joinArray[1]); } $query .= (string) $this->from; } if ($this->where) { $query .= (string) $this->where; } break; case 'insert': $query .= (string) $this->insert; if ($this->values) { if ($this->columns) { $query .= (string) $this->columns; } $elements = $this->values->getElements(); if (!($elements[0] instanceof $this)) { $query .= ' VALUES '; } $query .= (string) $this->values; if ($this->returning) { $query .= (string) $this->returning; } } break; default: $query = parent::__toString(); break; } if ($this instanceof JDatabaseQueryLimitable) { $query = $this->processLimit($query, $this->limit, $this->offset); } return $query; } /** * Clear data from the query or a specific clause of the query. * * @param string $clause Optionally, the name of the clause to clear, or nothing to clear the whole query. * * @return JDatabaseQueryPostgresql Returns this object to allow chaining. * * @since 11.3 */ public function clear($clause = null) { switch ($clause) { case 'limit': $this->limit = null; break; case 'offset': $this->offset = null; break; case 'forUpdate': $this->forUpdate = null; break; case 'forShare': $this->forShare = null; break; case 'noWait': $this->noWait = null; break; case 'returning': $this->returning = null; break; case 'select': case 'update': case 'delete': case 'insert': case 'from': case 'join': case 'set': case 'where': case 'group': case 'having': case 'order': case 'columns': case 'values': parent::clear($clause); break; default: $this->type = null; $this->limit = null; $this->offset = null; $this->forUpdate = null; $this->forShare = null; $this->noWait = null; $this->returning = null; parent::clear($clause); break; } return $this; } /** * Casts a value to a char. * * Ensure that the value is properly quoted before passing to the method. * * Usage: * $query->select($query->castAsChar('a')); * * @param string $value The value to cast as a char. * * @return string Returns the cast value. * * @since 11.3 */ public function castAsChar($value) { return $value . '::text'; } /** * Concatenates an array of column names or values. * * Usage: * $query->select($query->concatenate(array('a', 'b'))); * * @param array $values An array of values to concatenate. * @param string $separator As separator to place between each value. * * @return string The concatenated values. * * @since 11.3 */ public function concatenate($values, $separator = null) { if ($separator) { return implode(' || ' . $this->quote($separator) . ' || ', $values); } else { return implode(' || ', $values); } } /** * Gets the current date and time. * * @return string Return string used in query to obtain * * @since 11.3 */ public function currentTimestamp() { return 'NOW()'; } /** * Sets the FOR UPDATE lock on select's output row * * @param string $table_name The table to lock * @param string $glue The glue by which to join the conditions. Defaults to ',' . * * @return JDatabaseQueryPostgresql FOR UPDATE query element * * @since 11.3 */ public function forUpdate($table_name, $glue = ',') { $this->type = 'forUpdate'; if (is_null($this->forUpdate)) { $glue = strtoupper($glue); $this->forUpdate = new JDatabaseQueryElement('FOR UPDATE', 'OF ' . $table_name, "$glue "); } else { $this->forUpdate->append($table_name); } return $this; } /** * Sets the FOR SHARE lock on select's output row * * @param string $table_name The table to lock * @param string $glue The glue by which to join the conditions. Defaults to ',' . * * @return JDatabaseQueryPostgresql FOR SHARE query element * * @since 11.3 */ public function forShare($table_name, $glue = ',') { $this->type = 'forShare'; if (is_null($this->forShare)) { $glue = strtoupper($glue); $this->forShare = new JDatabaseQueryElement('FOR SHARE', 'OF ' . $table_name, "$glue "); } else { $this->forShare->append($table_name); } return $this; } /** * Used to get a string to extract year from date column. * * Usage: * $query->select($query->year($query->quoteName('dateColumn'))); * * @param string $date Date column containing year to be extracted. * * @return string Returns string to extract year from a date. * * @since 12.1 */ public function year($date) { return 'EXTRACT (YEAR FROM ' . $date . ')'; } /** * Used to get a string to extract month from date column. * * Usage: * $query->select($query->month($query->quoteName('dateColumn'))); * * @param string $date Date column containing month to be extracted. * * @return string Returns string to extract month from a date. * * @since 12.1 */ public function month($date) { return 'EXTRACT (MONTH FROM ' . $date . ')'; } /** * Used to get a string to extract day from date column. * * Usage: * $query->select($query->day($query->quoteName('dateColumn'))); * * @param string $date Date column containing day to be extracted. * * @return string Returns string to extract day from a date. * * @since 12.1 */ public function day($date) { return 'EXTRACT (DAY FROM ' . $date . ')'; } /** * Used to get a string to extract hour from date column. * * Usage: * $query->select($query->hour($query->quoteName('dateColumn'))); * * @param string $date Date column containing hour to be extracted. * * @return string Returns string to extract hour from a date. * * @since 12.1 */ public function hour($date) { return 'EXTRACT (HOUR FROM ' . $date . ')'; } /** * Used to get a string to extract minute from date column. * * Usage: * $query->select($query->minute($query->quoteName('dateColumn'))); * * @param string $date Date column containing minute to be extracted. * * @return string Returns string to extract minute from a date. * * @since 12.1 */ public function minute($date) { return 'EXTRACT (MINUTE FROM ' . $date . ')'; } /** * Used to get a string to extract seconds from date column. * * Usage: * $query->select($query->second($query->quoteName('dateColumn'))); * * @param string $date Date column containing second to be extracted. * * @return string Returns string to extract second from a date. * * @since 12.1 */ public function second($date) { return 'EXTRACT (SECOND FROM ' . $date . ')'; } /** * Sets the NOWAIT lock on select's output row * * @return JDatabaseQueryPostgresql NO WAIT query element * * @since 11.3 */ public function noWait () { $this->type = 'noWait'; if (is_null($this->noWait)) { $this->noWait = new JDatabaseQueryElement('NOWAIT', null); } return $this; } /** * Set the LIMIT clause to the query * * @param integer $limit An int of how many row will be returned * * @return JDatabaseQueryPostgresql Returns this object to allow chaining. * * @since 11.3 */ public function limit($limit = 0) { if (is_null($this->limit)) { $this->limit = new JDatabaseQueryElement('LIMIT', (int) $limit); } return $this; } /** * Set the OFFSET clause to the query * * @param integer $offset An int for skipping row * * @return JDatabaseQueryPostgresql Returns this object to allow chaining. * * @since 11.3 */ public function offset($offset = 0) { if (is_null($this->offset)) { $this->offset = new JDatabaseQueryElement('OFFSET', (int) $offset); } return $this; } /** * Add the RETURNING element to INSERT INTO statement. * * @param mixed $pkCol The name of the primary key column. * * @return JDatabaseQueryPostgresql Returns this object to allow chaining. * * @since 11.3 */ public function returning($pkCol) { if (is_null($this->returning)) { $this->returning = new JDatabaseQueryElement('RETURNING', $pkCol); } return $this; } /** * Sets the offset and limit for the result set, if the database driver supports it. * * Usage: * $query->setLimit(100, 0); (retrieve 100 rows, starting at first record) * $query->setLimit(50, 50); (retrieve 50 rows, starting at 50th record) * * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return JDatabaseQueryPostgresql Returns this object to allow chaining. * * @since 12.1 */ public function setLimit($limit = 0, $offset = 0) { $this->limit = (int) $limit; $this->offset = (int) $offset; return $this; } /** * Method to modify a query already in string format with the needed * additions to make the query limited to a particular number of * results, or start at a particular offset. * * @param string $query The query in string format * @param integer $limit The limit for the result set * @param integer $offset The offset for the result set * * @return string * * @since 12.1 */ public function processLimit($query, $limit, $offset = 0) { if ($limit > 0) { $query .= ' LIMIT ' . $limit; } if ($offset > 0) { $query .= ' OFFSET ' . $offset; } return $query; } /** * Add to the current date and time in Postgresql. * Usage: * $query->select($query->dateAdd()); * Prefixing the interval with a - (negative sign) will cause subtraction to be used. * * @param datetime $date The date to add to * @param string $interval The string representation of the appropriate number of units * @param string $datePart The part of the date to perform the addition on * * @return string The string with the appropriate sql for addition of dates * * @since 13.1 * @note Not all drivers support all units. Check appropriate references * @link http://www.postgresql.org/docs/9.0/static/functions-datetime.html. */ public function dateAdd($date, $interval, $datePart) { if (substr($interval, 0, 1) != '-') { return "timestamp '" . $date . "' + interval '" . $interval . " " . $datePart . "'"; } else { return "timestamp '" . $date . "' - interval '" . ltrim($interval, '-') . " " . $datePart . "'"; } } /** * Return correct regexp operator for Postgresql. * * Ensure that the regexp operator is Postgresql compatible. * * Usage: * $query->where('field ' . $query->regexp($search)); * * @param string $value The regex pattern. * * @return string Returns the regex operator. * * @since 11.3 */ public function regexp($value) { return ' ~* ' . $value; } } PK���\����}}'libraries/joomla/database/query/pdo.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * PDO Query Building Class. * * @since 12.1 */ class JDatabaseQueryPdo extends JDatabaseQuery { } PK���\�9m�c+c+*libraries/joomla/database/driver/mysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQL database driver * * @see http://dev.mysql.com/doc/ * @since 12.1 * @deprecated Will be removed when the minimum supported PHP version no longer includes the deprecated PHP `mysql` extension */ class JDatabaseDriverMysql extends JDatabaseDriverMysqli { /** * The name of the database driver. * * @var string * @since 12.1 */ public $name = 'mysql'; /** * Constructor. * * @param array $options Array of database options with keys: host, user, password, database, select. * * @since 12.1 */ public function __construct($options) { // PHP's `mysql` extension is not present in PHP 7, block instantiation in this environment if (PHP_MAJOR_VERSION >= 7) { throw new RuntimeException( 'This driver is unsupported in PHP 7, please use the MySQLi or PDO MySQL driver instead.' ); } // Get some basic values from the options. $options['host'] = (isset($options['host'])) ? $options['host'] : 'localhost'; $options['user'] = (isset($options['user'])) ? $options['user'] : 'root'; $options['password'] = (isset($options['password'])) ? $options['password'] : ''; $options['database'] = (isset($options['database'])) ? $options['database'] : ''; $options['select'] = (isset($options['select'])) ? (bool) $options['select'] : true; // Finalize initialisation. parent::__construct($options); } /** * Destructor. * * @since 12.1 */ public function __destruct() { $this->disconnect(); } /** * Connects to the database if needed. * * @return void Returns void if the database connected successfully. * * @since 12.1 * @throws RuntimeException */ public function connect() { if ($this->connection) { return; } // Make sure the MySQL extension for PHP is installed and enabled. if (!self::isSupported()) { throw new RuntimeException('Could not connect to MySQL.'); } // Attempt to connect to the server. if (!($this->connection = @ mysql_connect($this->options['host'], $this->options['user'], $this->options['password'], true))) { throw new RuntimeException('Could not connect to MySQL.'); } // Set sql_mode to non_strict mode mysql_query("SET @@SESSION.sql_mode = '';", $this->connection); // If auto-select is enabled select the given database. if ($this->options['select'] && !empty($this->options['database'])) { $this->select($this->options['database']); } // Set charactersets (needed for MySQL 4.1.2+). $this->setUtf(); // Turn MySQL profiling ON in debug mode: if ($this->debug && $this->hasProfiling()) { mysql_query("SET profiling = 1;", $this->connection); } } /** * Disconnects the database. * * @return void * * @since 12.1 */ public function disconnect() { // Close the connection. if (is_resource($this->connection)) { foreach ($this->disconnectHandlers as $h) { call_user_func_array($h, array( &$this)); } mysql_close($this->connection); } $this->connection = null; } /** * Method to escape a string for usage in an SQL statement. * * @param string $text The string to be escaped. * @param boolean $extra Optional parameter to provide extra escaping. * * @return string The escaped string. * * @since 12.1 */ public function escape($text, $extra = false) { $this->connect(); $result = mysql_real_escape_string($text, $this->getConnection()); if ($extra) { $result = addcslashes($result, '%_'); } return $result; } /** * Test to see if the MySQL connector is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return (function_exists('mysql_connect')); } /** * Determines if the connection to the server is active. * * @return boolean True if connected to the database engine. * * @since 12.1 */ public function connected() { if (is_resource($this->connection)) { return @mysql_ping($this->connection); } return false; } /** * Get the number of affected rows for the previous executed SQL statement. * * @return integer The number of affected rows. * * @since 12.1 */ public function getAffectedRows() { $this->connect(); return mysql_affected_rows($this->connection); } /** * Get the number of returned rows for the previous executed SQL statement. * * @param resource $cursor An optional database cursor resource to extract the row count from. * * @return integer The number of returned rows. * * @since 12.1 */ public function getNumRows($cursor = null) { $this->connect(); return mysql_num_rows($cursor ? $cursor : $this->cursor); } /** * Get the version of the database connector. * * @return string The database connector version. * * @since 12.1 */ public function getVersion() { $this->connect(); return mysql_get_server_info($this->connection); } /** * Method to get the auto-incremented value from the last INSERT statement. * * @return integer The value of the auto-increment field from the last inserted row. * * @since 12.1 */ public function insertid() { $this->connect(); return mysql_insert_id($this->connection); } /** * Execute the SQL statement. * * @return mixed A database cursor resource on success, boolean false on failure. * * @since 12.1 * @throws RuntimeException */ public function execute() { $this->connect(); if (!is_resource($this->connection)) { JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database'); throw new RuntimeException($this->errorMsg, $this->errorNum); } // Take a local copy so that we don't modify the original query and cause issues later $query = $this->replacePrefix((string) $this->sql); if (!($this->sql instanceof JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) { $query .= ' LIMIT ' . $this->offset . ', ' . $this->limit; } // Increment the query counter. $this->count++; // Reset the error values. $this->errorNum = 0; $this->errorMsg = ''; // If debugging is enabled then let's log the query. if ($this->debug) { // Add the query to the object queue. $this->log[] = $query; JLog::add($query, JLog::DEBUG, 'databasequery'); $this->timings[] = microtime(true); } // Execute the query. Error suppression is used here to prevent warnings/notices that the connection has been lost. $this->cursor = @mysql_query($query, $this->connection); if ($this->debug) { $this->timings[] = microtime(true); if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) { $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); } else { $this->callStacks[] = debug_backtrace(); } } // If an error occurred handle it. if (!$this->cursor) { // Get the error number and message. $this->errorNum = (int) mysql_errno($this->connection); $this->errorMsg = (string) mysql_error($this->connection) . ' SQL=' . $query; // Check if the server was disconnected. if (!$this->connected()) { try { // Attempt to reconnect. $this->connection = null; $this->connect(); } // If connect fails, ignore that exception and throw the normal exception. catch (RuntimeException $e) { // Throw the normal query exception. JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg, $this->errorNum); } // Since we were able to reconnect, run the query again. return $this->execute(); } // The server was not disconnected. else { // Throw the normal query exception. JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg, $this->errorNum); } } return $this->cursor; } /** * Select a database for use. * * @param string $database The name of the database to select for use. * * @return boolean True if the database was successfully selected. * * @since 12.1 * @throws RuntimeException */ public function select($database) { $this->connect(); if (!$database) { return false; } if (!mysql_select_db($database, $this->connection)) { throw new RuntimeException('Could not connect to database'); } return true; } /** * Set the connection to use UTF-8 character encoding. * * @return boolean True on success. * * @since 12.1 */ public function setUtf() { $this->connect(); return mysql_set_charset('utf8', $this->connection); } /** * Method to fetch a row from the result set cursor as an array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchArray($cursor = null) { return mysql_fetch_row($cursor ? $cursor : $this->cursor); } /** * Method to fetch a row from the result set cursor as an associative array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchAssoc($cursor = null) { return mysql_fetch_assoc($cursor ? $cursor : $this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * @param string $class The class name to use for the returned row object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchObject($cursor = null, $class = 'stdClass') { return mysql_fetch_object($cursor ? $cursor : $this->cursor, $class); } /** * Method to free up the memory used for the result set. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return void * * @since 12.1 */ protected function freeResult($cursor = null) { mysql_free_result($cursor ? $cursor : $this->cursor); } /** * Internal function to check if profiling is available * * @return boolean * * @since 3.1.3 */ private function hasProfiling() { try { $res = mysql_query("SHOW VARIABLES LIKE 'have_profiling'", $this->connection); $row = mysql_fetch_assoc($res); return isset($row); } catch (Exception $e) { return false; } } } PK���\�����b�b+libraries/joomla/database/driver/sqlsrv.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * SQL Server database driver * * @see http://msdn.microsoft.com/en-us/library/cc296152(SQL.90).aspx * @since 12.1 */ class JDatabaseDriverSqlsrv extends JDatabaseDriver { /** * The name of the database driver. * * @var string * @since 12.1 */ public $name = 'sqlsrv'; /** * The character(s) used to quote SQL statement names such as table names or field names, * etc. The child classes should define this as necessary. If a single character string the * same character is used for both sides of the quoted name, else the first character will be * used for the opening quote and the second for the closing quote. * * @var string * @since 12.1 */ protected $nameQuote = '[]'; /** * The null or zero representation of a timestamp for the database driver. This should be * defined in child classes to hold the appropriate value for the engine. * * @var string * @since 12.1 */ protected $nullDate = '1900-01-01 00:00:00'; /** * @var string The minimum supported database version. * @since 12.1 */ protected static $dbMinimum = '10.50.1600.1'; /** * Test to see if the SQLSRV connector is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return (function_exists('sqlsrv_connect')); } /** * Constructor. * * @param array $options List of options used to configure the connection * * @since 12.1 */ public function __construct($options) { // Get some basic values from the options. $options['host'] = (isset($options['host'])) ? $options['host'] : 'localhost'; $options['user'] = (isset($options['user'])) ? $options['user'] : ''; $options['password'] = (isset($options['password'])) ? $options['password'] : ''; $options['database'] = (isset($options['database'])) ? $options['database'] : ''; $options['select'] = (isset($options['select'])) ? (bool) $options['select'] : true; // Finalize initialisation parent::__construct($options); } /** * Destructor. * * @since 12.1 */ public function __destruct() { $this->disconnect(); } /** * Connects to the database if needed. * * @return void Returns void if the database connected successfully. * * @since 12.1 * @throws RuntimeException */ public function connect() { if ($this->connection) { return; } // Build the connection configuration array. $config = array( 'Database' => $this->options['database'], 'uid' => $this->options['user'], 'pwd' => $this->options['password'], 'CharacterSet' => 'UTF-8', 'ReturnDatesAsStrings' => true); // Make sure the SQLSRV extension for PHP is installed and enabled. if (!function_exists('sqlsrv_connect')) { throw new RuntimeException('PHP extension sqlsrv_connect is not available.'); } // Attempt to connect to the server. if (!($this->connection = @ sqlsrv_connect($this->options['host'], $config))) { throw new RuntimeException('Database sqlsrv_connect failed'); } // Make sure that DB warnings are not returned as errors. sqlsrv_configure('WarningsReturnAsErrors', 0); // If auto-select is enabled select the given database. if ($this->options['select'] && !empty($this->options['database'])) { $this->select($this->options['database']); } // Set charactersets. $this->utf = $this->setUtf(); } /** * Disconnects the database. * * @return void * * @since 12.1 */ public function disconnect() { // Close the connection. if (is_resource($this->connection)) { foreach ($this->disconnectHandlers as $h) { call_user_func_array($h, array( &$this)); } sqlsrv_close($this->connection); } $this->connection = null; } /** * Get table constraints * * @param string $tableName The name of the database table. * * @return array Any constraints available for the table. * * @since 12.1 */ protected function getTableConstraints($tableName) { $this->connect(); $query = $this->getQuery(true); $this->setQuery( 'SELECT CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_NAME = ' . $query->quote($tableName) ); return $this->loadColumn(); } /** * Rename constraints. * * @param array $constraints Array(strings) of table constraints * @param string $prefix A string * @param string $backup A string * * @return void * * @since 12.1 */ protected function renameConstraints($constraints = array(), $prefix = null, $backup = null) { $this->connect(); foreach ($constraints as $constraint) { $this->setQuery('sp_rename ' . $constraint . ',' . str_replace($prefix, $backup, $constraint)); $this->execute(); } } /** * Method to escape a string for usage in an SQL statement. * * The escaping for MSSQL isn't handled in the driver though that would be nice. Because of this we need * to handle the escaping ourselves. * * @param string $text The string to be escaped. * @param boolean $extra Optional parameter to provide extra escaping. * * @return string The escaped string. * * @since 12.1 */ public function escape($text, $extra = false) { $result = addslashes($text); $result = str_replace("\'", "''", $result); $result = str_replace('\"', '"', $result); $result = str_replace('\/', '/', $result); if ($extra) { // We need the below str_replace since the search in sql server doesn't recognize _ character. $result = str_replace('_', '[_]', $result); } return $result; } /** * Determines if the connection to the server is active. * * @return boolean True if connected to the database engine. * * @since 12.1 */ public function connected() { // TODO: Run a blank query here return true; } /** * Drops a table from the database. * * @param string $tableName The name of the database table to drop. * @param boolean $ifExists Optionally specify that the table must exist before it is dropped. * * @return JDatabaseDriverSqlsrv Returns this object to support chaining. * * @since 12.1 */ public function dropTable($tableName, $ifExists = true) { $this->connect(); $query = $this->getQuery(true); if ($ifExists) { $this->setQuery( 'IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = ' . $query->quote($tableName) . ') DROP TABLE ' . $tableName ); } else { $this->setQuery('DROP TABLE ' . $tableName); } $this->execute(); return $this; } /** * Get the number of affected rows for the previous executed SQL statement. * * @return integer The number of affected rows. * * @since 12.1 */ public function getAffectedRows() { $this->connect(); return sqlsrv_rows_affected($this->cursor); } /** * Method to get the database collation in use by sampling a text field of a table in the database. * * @return mixed The collation in use by the database or boolean false if not supported. * * @since 12.1 */ public function getCollation() { // TODO: Not fake this return 'MSSQL UTF-8 (UCS2)'; } /** * Get the number of returned rows for the previous executed SQL statement. * * @param resource $cursor An optional database cursor resource to extract the row count from. * * @return integer The number of returned rows. * * @since 12.1 */ public function getNumRows($cursor = null) { $this->connect(); return sqlsrv_num_rows($cursor ? $cursor : $this->cursor); } /** * Retrieves field information about the given tables. * * @param mixed $table A table name * @param boolean $typeOnly True to only return field types. * * @return array An array of fields. * * @since 12.1 * @throws RuntimeException */ public function getTableColumns($table, $typeOnly = true) { $result = array(); $table_temp = $this->replacePrefix((string) $table); // Set the query to get the table fields statement. $this->setQuery( 'SELECT column_name as Field, data_type as Type, is_nullable as \'Null\', column_default as \'Default\'' . ' FROM information_schema.columns WHERE table_name = ' . $this->quote($table_temp) ); $fields = $this->loadObjectList(); // If we only want the type as the value add just that to the list. if ($typeOnly) { foreach ($fields as $field) { $result[$field->Field] = preg_replace("/[(0-9)]/", '', $field->Type); } } // If we want the whole field data object add that to the list. else { foreach ($fields as $field) { if (stristr(strtolower($field->Type), "nvarchar")) { $field->Default = ""; } $result[$field->Field] = $field; } } return $result; } /** * Shows the table CREATE statement that creates the given tables. * * This is unsupported by MSSQL. * * @param mixed $tables A table name or a list of table names. * * @return array A list of the create SQL for the tables. * * @since 12.1 * @throws RuntimeException */ public function getTableCreate($tables) { $this->connect(); return ''; } /** * Get the details list of keys for a table. * * @param string $table The name of the table. * * @return array An array of the column specification for the table. * * @since 12.1 * @throws RuntimeException */ public function getTableKeys($table) { $this->connect(); // TODO To implement. return array(); } /** * Method to get an array of all tables in the database. * * @return array An array of all the tables in the database. * * @since 12.1 * @throws RuntimeException */ public function getTableList() { $this->connect(); // Set the query to get the tables statement. $this->setQuery('SELECT name FROM ' . $this->getDatabase() . '.sys.Tables WHERE type = \'U\';'); $tables = $this->loadColumn(); return $tables; } /** * Get the version of the database connector. * * @return string The database connector version. * * @since 12.1 */ public function getVersion() { $this->connect(); $version = sqlsrv_server_info($this->connection); return $version['SQLServerVersion']; } /** * Inserts a row into a table based on an object's properties. * * @param string $table The name of the database table to insert into. * @param object &$object A reference to an object whose public properties match the table fields. * @param string $key The name of the primary key. If provided the object property is updated. * * @return boolean True on success. * * @since 12.1 * @throws RuntimeException */ public function insertObject($table, &$object, $key = null) { $fields = array(); $values = array(); $statement = 'INSERT INTO ' . $this->quoteName($table) . ' (%s) VALUES (%s)'; foreach (get_object_vars($object) as $k => $v) { // Only process non-null scalars. if (is_array($v) or is_object($v) or $v === null) { continue; } if (!$this->checkFieldExists($table, $k)) { continue; } if ($k[0] == '_') { // Internal field continue; } if ($k == $key && $key == 0) { continue; } $fields[] = $this->quoteName($k); $values[] = $this->Quote($v); } // Set the query and execute the insert. $this->setQuery(sprintf($statement, implode(',', $fields), implode(',', $values))); if (!$this->execute()) { return false; } $id = $this->insertid(); if ($key && $id) { $object->$key = $id; } return true; } /** * Method to get the auto-incremented value from the last INSERT statement. * * @return integer The value of the auto-increment field from the last inserted row. * * @since 12.1 */ public function insertid() { $this->connect(); // TODO: SELECT IDENTITY $this->setQuery('SELECT @@IDENTITY'); return (int) $this->loadResult(); } /** * Method to get the first field of the first row of the result set from the database query. * * @return mixed The return value or null if the query failed. * * @since 12.1 * @throws RuntimeException */ public function loadResult() { $ret = null; // Execute the query and get the result set cursor. if (!($cursor = $this->execute())) { return null; } // Get the first row from the result set as an array. if ($row = sqlsrv_fetch_array($cursor, SQLSRV_FETCH_NUMERIC)) { $ret = $row[0]; } // Free up system resources and return. $this->freeResult($cursor); // For SQLServer - we need to strip slashes $ret = stripslashes($ret); return $ret; } /** * Execute the SQL statement. * * @return mixed A database cursor resource on success, boolean false on failure. * * @since 12.1 * @throws RuntimeException * @throws Exception */ public function execute() { $this->connect(); if (!is_resource($this->connection)) { JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database'); throw new RuntimeException($this->errorMsg, $this->errorNum); } // Take a local copy so that we don't modify the original query and cause issues later $query = $this->replacePrefix((string) $this->sql); if (!($this->sql instanceof JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) { $query = $this->limit($query, $this->limit, $this->offset); } // Increment the query counter. $this->count++; // Reset the error values. $this->errorNum = 0; $this->errorMsg = ''; // If debugging is enabled then let's log the query. if ($this->debug) { // Add the query to the object queue. $this->log[] = $query; JLog::add($query, JLog::DEBUG, 'databasequery'); $this->timings[] = microtime(true); } // SQLSrv_num_rows requires a static or keyset cursor. if (strncmp(ltrim(strtoupper($query)), 'SELECT', strlen('SELECT')) == 0) { $array = array('Scrollable' => SQLSRV_CURSOR_KEYSET); } else { $array = array(); } // Execute the query. Error suppression is used here to prevent warnings/notices that the connection has been lost. $this->cursor = @sqlsrv_query($this->connection, $query, array(), $array); if ($this->debug) { $this->timings[] = microtime(true); if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) { $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); } else { $this->callStacks[] = debug_backtrace(); } } // If an error occurred handle it. if (!$this->cursor) { // Check if the server was disconnected. if (!$this->connected()) { try { // Attempt to reconnect. $this->connection = null; $this->connect(); } // If connect fails, ignore that exception and throw the normal exception. catch (RuntimeException $e) { // Get the error number and message. $errors = sqlsrv_errors(); $this->errorNum = $errors[0]['SQLSTATE']; $this->errorMsg = $errors[0]['message'] . 'SQL=' . $query; // Throw the normal query exception. JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg, $this->errorNum); } // Since we were able to reconnect, run the query again. return $this->execute(); } // The server was not disconnected. else { // Get the error number and message. $errors = sqlsrv_errors(); $this->errorNum = $errors[0]['SQLSTATE']; $this->errorMsg = $errors[0]['message'] . 'SQL=' . $query; // Throw the normal query exception. JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg, $this->errorNum); } } return $this->cursor; } /** * This function replaces a string identifier <var>$prefix</var> with the string held is the * <var>tablePrefix</var> class variable. * * @param string $query The SQL statement to prepare. * @param string $prefix The common table prefix. * * @return string The processed SQL statement. * * @since 12.1 */ public function replacePrefix($query, $prefix = '#__') { $startPos = 0; $literal = ''; $query = trim($query); $n = strlen($query); while ($startPos < $n) { $ip = strpos($query, $prefix, $startPos); if ($ip === false) { break; } $j = strpos($query, "N'", $startPos); $k = strpos($query, '"', $startPos); if (($k !== false) && (($k < $j) || ($j === false))) { $quoteChar = '"'; $j = $k; } else { $quoteChar = "'"; } if ($j === false) { $j = $n; } $literal .= str_replace($prefix, $this->tablePrefix, substr($query, $startPos, $j - $startPos)); $startPos = $j; $j = $startPos + 1; if ($j >= $n) { break; } // Quote comes first, find end of quote while (true) { $k = strpos($query, $quoteChar, $j); $escaped = false; if ($k === false) { break; } $l = $k - 1; while ($l >= 0 && $query{$l} == '\\') { $l--; $escaped = !$escaped; } if ($escaped) { $j = $k + 1; continue; } break; } if ($k === false) { // Error in the query - no end quote; ignore it break; } $literal .= substr($query, $startPos, $k - $startPos + 1); $startPos = $k + 1; } if ($startPos < $n) { $literal .= substr($query, $startPos, $n - $startPos); } return $literal; } /** * Select a database for use. * * @param string $database The name of the database to select for use. * * @return boolean True if the database was successfully selected. * * @since 12.1 * @throws RuntimeException */ public function select($database) { $this->connect(); if (!$database) { return false; } if (!sqlsrv_query($this->connection, 'USE ' . $database, null, array('scrollable' => SQLSRV_CURSOR_STATIC))) { throw new RuntimeException('Could not connect to database'); } return true; } /** * Set the connection to use UTF-8 character encoding. * * @return boolean True on success. * * @since 12.1 */ public function setUtf() { return false; } /** * Method to commit a transaction. * * @param boolean $toSavepoint If true, commit to the last savepoint. * * @return void * * @since 12.1 * @throws RuntimeException */ public function transactionCommit($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { if ($this->setQuery('COMMIT TRANSACTION')->execute()) { $this->transactionDepth = 0; } return; } $this->transactionDepth--; } /** * Method to roll back a transaction. * * @param boolean $toSavepoint If true, rollback to the last savepoint. * * @return void * * @since 12.1 * @throws RuntimeException */ public function transactionRollback($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { if ($this->setQuery('ROLLBACK TRANSACTION')->execute()) { $this->transactionDepth = 0; } return; } $savepoint = 'SP_' . ($this->transactionDepth - 1); $this->setQuery('ROLLBACK TRANSACTION ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth--; } } /** * Method to initialize a transaction. * * @param boolean $asSavepoint If true and a transaction is already active, a savepoint will be created. * * @return void * * @since 12.1 * @throws RuntimeException */ public function transactionStart($asSavepoint = false) { $this->connect(); if (!$asSavepoint || !$this->transactionDepth) { if ($this->setQuery('BEGIN TRANSACTION')->execute()) { $this->transactionDepth = 1; } return; } $savepoint = 'SP_' . $this->transactionDepth; $this->setQuery('BEGIN TRANSACTION ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth++; } } /** * Method to fetch a row from the result set cursor as an array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchArray($cursor = null) { return sqlsrv_fetch_array($cursor ? $cursor : $this->cursor, SQLSRV_FETCH_NUMERIC); } /** * Method to fetch a row from the result set cursor as an associative array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchAssoc($cursor = null) { return sqlsrv_fetch_array($cursor ? $cursor : $this->cursor, SQLSRV_FETCH_ASSOC); } /** * Method to fetch a row from the result set cursor as an object. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * @param string $class The class name to use for the returned row object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchObject($cursor = null, $class = 'stdClass') { return sqlsrv_fetch_object($cursor ? $cursor : $this->cursor, $class); } /** * Method to free up the memory used for the result set. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return void * * @since 12.1 */ protected function freeResult($cursor = null) { sqlsrv_free_stmt($cursor ? $cursor : $this->cursor); } /** * Method to check and see if a field exists in a table. * * @param string $table The table in which to verify the field. * @param string $field The field to verify. * * @return boolean True if the field exists in the table. * * @since 12.1 */ protected function checkFieldExists($table, $field) { $this->connect(); $table = $this->replacePrefix((string) $table); $query = "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '$table' AND COLUMN_NAME = '$field'" . " ORDER BY ORDINAL_POSITION"; $this->setQuery($query); if ($this->loadResult()) { return true; } else { return false; } } /** * Method to wrap an SQL statement to provide a LIMIT and OFFSET behavior for scrolling through a result set. * * @param string $query The SQL statement to process. * @param integer $limit The maximum affected rows to set. * @param integer $offset The affected row offset to set. * * @return string The processed SQL statement. * * @since 12.1 */ protected function limit($query, $limit, $offset) { if ($limit == 0 && $offset == 0) { return $query; } $start = $offset + 1; $end = $offset + $limit; $orderBy = stristr($query, 'ORDER BY'); if (is_null($orderBy) || empty($orderBy)) { $orderBy = 'ORDER BY (select 0)'; } $query = str_ireplace($orderBy, '', $query); $rowNumberText = ', ROW_NUMBER() OVER (' . $orderBy . ') AS RowNumber FROM '; $query = preg_replace('/\sFROM\s/i', $rowNumberText, $query, 1); return $query; } /** * Renames a table in the database. * * @param string $oldTable The name of the table to be renamed * @param string $newTable The new name for the table. * @param string $backup Table prefix * @param string $prefix For the table - used to rename constraints in non-mysql databases * * @return JDatabaseDriverSqlsrv Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function renameTable($oldTable, $newTable, $backup = null, $prefix = null) { $constraints = array(); if (!is_null($prefix) && !is_null($backup)) { $constraints = $this->getTableConstraints($oldTable); } if (!empty($constraints)) { $this->renameConstraints($constraints, $prefix, $backup); } $this->setQuery("sp_rename '" . $oldTable . "', '" . $newTable . "'"); return $this->execute(); } /** * Locks a table in the database. * * @param string $tableName The name of the table to lock. * * @return JDatabaseDriverSqlsrv Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function lockTable($tableName) { return $this; } /** * Unlocks tables in the database. * * @return JDatabaseDriverSqlsrv Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function unlockTables() { return $this; } } PK���\�gQn8n8+libraries/joomla/database/driver/oracle.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Oracle database driver * * @see http://php.net/pdo * @since 12.1 */ class JDatabaseDriverOracle extends JDatabaseDriverPdo { /** * The name of the database driver. * * @var string * @since 12.1 */ public $name = 'oracle'; /** * The character(s) used to quote SQL statement names such as table names or field names, * etc. The child classes should define this as necessary. If a single character string the * same character is used for both sides of the quoted name, else the first character will be * used for the opening quote and the second for the closing quote. * * @var string * @since 12.1 */ protected $nameQuote = '"'; /** * Returns the current dateformat * * @var string * @since 12.1 */ protected $dateformat; /** * Returns the current character set * * @var string * @since 12.1 */ protected $charset; /** * Constructor. * * @param array $options List of options used to configure the connection * * @since 12.1 */ public function __construct($options) { $options['driver'] = 'oci'; $options['charset'] = (isset($options['charset'])) ? $options['charset'] : 'AL32UTF8'; $options['dateformat'] = (isset($options['dateformat'])) ? $options['dateformat'] : 'RRRR-MM-DD HH24:MI:SS'; $this->charset = $options['charset']; $this->dateformat = $options['dateformat']; // Finalize initialisation parent::__construct($options); } /** * Destructor. * * @since 12.1 */ public function __destruct() { $this->freeResult(); unset($this->connection); } /** * Connects to the database if needed. * * @return void Returns void if the database connected successfully. * * @since 12.1 * @throws RuntimeException */ public function connect() { if ($this->connection) { return; } parent::connect(); if (isset($this->options['schema'])) { $this->setQuery('ALTER SESSION SET CURRENT_SCHEMA = ' . $this->quoteName($this->options['schema']))->execute(); } $this->setDateFormat($this->dateformat); } /** * Disconnects the database. * * @return void * * @since 12.1 */ public function disconnect() { // Close the connection. $this->freeResult(); unset($this->connection); } /** * Drops a table from the database. * * Note: The IF EXISTS flag is unused in the Oracle driver. * * @param string $tableName The name of the database table to drop. * @param boolean $ifExists Optionally specify that the table must exist before it is dropped. * * @return JDatabaseDriverOracle Returns this object to support chaining. * * @since 12.1 */ public function dropTable($tableName, $ifExists = true) { $this->connect(); $query = $this->getQuery(true) ->setQuery('DROP TABLE :tableName'); $query->bind(':tableName', $tableName); $this->setQuery($query); $this->execute(); return $this; } /** * Method to get the database collation in use by sampling a text field of a table in the database. * * @return mixed The collation in use by the database or boolean false if not supported. * * @since 12.1 */ public function getCollation() { return $this->charset; } /** * Get a query to run and verify the database is operational. * * @return string The query to check the health of the DB. * * @since 12.2 */ public function getConnectedQuery() { return 'SELECT 1 FROM dual'; } /** * Returns the current date format * This method should be useful in the case that * somebody actually wants to use a different * date format and needs to check what the current * one is to see if it needs to be changed. * * @return string The current date format * * @since 12.1 */ public function getDateFormat() { return $this->dateformat; } /** * Shows the table CREATE statement that creates the given tables. * * Note: You must have the correct privileges before this method * will return usable results! * * @param mixed $tables A table name or a list of table names. * * @return array A list of the create SQL for the tables. * * @since 12.1 * @throws RuntimeException */ public function getTableCreate($tables) { $this->connect(); $result = array(); $query = $this->getQuery(true) ->select('dbms_metadata.get_ddl(:type, :tableName)') ->from('dual') ->bind(':type', 'TABLE'); // Sanitize input to an array and iterate over the list. settype($tables, 'array'); foreach ($tables as $table) { $query->bind(':tableName', $table); $this->setQuery($query); $statement = (string) $this->loadResult(); $result[$table] = $statement; } return $result; } /** * Retrieves field information about a given table. * * @param string $table The name of the database table. * @param boolean $typeOnly True to only return field types. * * @return array An array of fields for the database table. * * @since 12.1 * @throws RuntimeException */ public function getTableColumns($table, $typeOnly = true) { $this->connect(); $columns = array(); $query = $this->getQuery(true); $fieldCasing = $this->getOption(PDO::ATTR_CASE); $this->setOption(PDO::ATTR_CASE, PDO::CASE_UPPER); $table = strtoupper($table); $query->select('*'); $query->from('ALL_TAB_COLUMNS'); $query->where('table_name = :tableName'); $prefixedTable = str_replace('#__', strtoupper($this->tablePrefix), $table); $query->bind(':tableName', $prefixedTable); $this->setQuery($query); $fields = $this->loadObjectList(); if ($typeOnly) { foreach ($fields as $field) { $columns[$field->COLUMN_NAME] = $field->DATA_TYPE; } } else { foreach ($fields as $field) { $columns[$field->COLUMN_NAME] = $field; $columns[$field->COLUMN_NAME]->Default = null; } } $this->setOption(PDO::ATTR_CASE, $fieldCasing); return $columns; } /** * Get the details list of keys for a table. * * @param string $table The name of the table. * * @return array An array of the column specification for the table. * * @since 12.1 * @throws RuntimeException */ public function getTableKeys($table) { $this->connect(); $query = $this->getQuery(true); $fieldCasing = $this->getOption(PDO::ATTR_CASE); $this->setOption(PDO::ATTR_CASE, PDO::CASE_UPPER); $table = strtoupper($table); $query->select('*') ->from('ALL_CONSTRAINTS') ->where('table_name = :tableName') ->bind(':tableName', $table); $this->setQuery($query); $keys = $this->loadObjectList(); $this->setOption(PDO::ATTR_CASE, $fieldCasing); return $keys; } /** * Method to get an array of all tables in the database (schema). * * @param string $databaseName The database (schema) name * @param boolean $includeDatabaseName Whether to include the schema name in the results * * @return array An array of all the tables in the database. * * @since 12.1 * @throws RuntimeException */ public function getTableList($databaseName = null, $includeDatabaseName = false) { $this->connect(); $query = $this->getQuery(true); if ($includeDatabaseName) { $query->select('owner, table_name'); } else { $query->select('table_name'); } $query->from('all_tables'); if ($databaseName) { $query->where('owner = :database') ->bind(':database', $databaseName); } $query->order('table_name'); $this->setQuery($query); if ($includeDatabaseName) { $tables = $this->loadAssocList(); } else { $tables = $this->loadColumn(); } return $tables; } /** * Get the version of the database connector. * * @return string The database connector version. * * @since 12.1 */ public function getVersion() { $this->connect(); $this->setQuery("select value from nls_database_parameters where parameter = 'NLS_RDBMS_VERSION'"); return $this->loadResult(); } /** * Select a database for use. * * @param string $database The name of the database to select for use. * * @return boolean True if the database was successfully selected. * * @since 12.1 * @throws RuntimeException */ public function select($database) { $this->connect(); return true; } /** * Sets the Oracle Date Format for the session * Default date format for Oracle is = DD-MON-RR * The default date format for this driver is: * 'RRRR-MM-DD HH24:MI:SS' since it is the format * that matches the MySQL one used within most Joomla * tables. * * @param string $dateFormat Oracle Date Format String * * @return boolean * * @since 12.1 */ public function setDateFormat($dateFormat = 'DD-MON-RR') { $this->connect(); $this->setQuery("ALTER SESSION SET NLS_DATE_FORMAT = '$dateFormat'"); if (!$this->execute()) { return false; } $this->setQuery("ALTER SESSION SET NLS_TIMESTAMP_FORMAT = '$dateFormat'"); if (!$this->execute()) { return false; } $this->dateformat = $dateFormat; return true; } /** * Set the connection to use UTF-8 character encoding. * * Returns false automatically for the Oracle driver since * you can only set the character set when the connection * is created. * * @return boolean True on success. * * @since 12.1 */ public function setUtf() { return false; } /** * Locks a table in the database. * * @param string $table The name of the table to unlock. * * @return JDatabaseDriverOracle Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function lockTable($table) { $this->setQuery('LOCK TABLE ' . $this->quoteName($table) . ' IN EXCLUSIVE MODE')->execute(); return $this; } /** * Renames a table in the database. * * @param string $oldTable The name of the table to be renamed * @param string $newTable The new name for the table. * @param string $backup Not used by Oracle. * @param string $prefix Not used by Oracle. * * @return JDatabaseDriverOracle Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function renameTable($oldTable, $newTable, $backup = null, $prefix = null) { $this->setQuery('RENAME ' . $oldTable . ' TO ' . $newTable)->execute(); return $this; } /** * Unlocks tables in the database. * * @return JDatabaseDriverOracle Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function unlockTables() { $this->setQuery('COMMIT')->execute(); return $this; } /** * Test to see if the PDO ODBC connector is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return class_exists('PDO') && in_array('oci', PDO::getAvailableDrivers()); } /** * This function replaces a string identifier <var>$prefix</var> with the string held is the * <var>tablePrefix</var> class variable. * * @param string $query The SQL statement to prepare. * @param string $prefix The common table prefix. * * @return string The processed SQL statement. * * @since 11.1 */ public function replacePrefix($query, $prefix = '#__') { $startPos = 0; $quoteChar = "'"; $literal = ''; $query = trim($query); $n = strlen($query); while ($startPos < $n) { $ip = strpos($query, $prefix, $startPos); if ($ip === false) { break; } $j = strpos($query, "'", $startPos); if ($j === false) { $j = $n; } $literal .= str_replace($prefix, $this->tablePrefix, substr($query, $startPos, $j - $startPos)); $startPos = $j; $j = $startPos + 1; if ($j >= $n) { break; } // Quote comes first, find end of quote while (true) { $k = strpos($query, $quoteChar, $j); $escaped = false; if ($k === false) { break; } $l = $k - 1; while ($l >= 0 && $query{$l} == '\\') { $l--; $escaped = !$escaped; } if ($escaped) { $j = $k + 1; continue; } break; } if ($k === false) { // Error in the query - no end quote; ignore it break; } $literal .= substr($query, $startPos, $k - $startPos + 1); $startPos = $k + 1; } if ($startPos < $n) { $literal .= substr($query, $startPos, $n - $startPos); } return $literal; } /** * Method to commit a transaction. * * @param boolean $toSavepoint If true, commit to the last savepoint. * * @return void * * @since 12.3 * @throws RuntimeException */ public function transactionCommit($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { parent::transactionCommit($toSavepoint); } else { $this->transactionDepth--; } } /** * Method to roll back a transaction. * * @param boolean $toSavepoint If true, rollback to the last savepoint. * * @return void * * @since 12.3 * @throws RuntimeException */ public function transactionRollback($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { parent::transactionRollback($toSavepoint); } else { $savepoint = 'SP_' . ($this->transactionDepth - 1); $this->setQuery('ROLLBACK TO SAVEPOINT ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth--; } } } /** * Method to initialize a transaction. * * @param boolean $asSavepoint If true and a transaction is already active, a savepoint will be created. * * @return void * * @since 12.3 * @throws RuntimeException */ public function transactionStart($asSavepoint = false) { $this->connect(); if (!$asSavepoint || !$this->transactionDepth) { return parent::transactionStart($asSavepoint); } $savepoint = 'SP_' . $this->transactionDepth; $this->setQuery('SAVEPOINT ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth++; } } } PK���\i�??-libraries/joomla/database/driver/sqlazure.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * SQL Server database driver * * @see http://msdn.microsoft.com/en-us/library/ee336279.aspx * @since 12.1 */ class JDatabaseDriverSqlazure extends JDatabaseDriverSqlsrv { /** * The name of the database driver. * * @var string * @since 12.1 */ public $name = 'sqlazure'; } PK���\�x;{.Q.Q+libraries/joomla/database/driver/mysqli.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQLi database driver * * @see http://php.net/manual/en/book.mysqli.php * @since 12.1 */ class JDatabaseDriverMysqli extends JDatabaseDriver { /** * The name of the database driver. * * @var string * @since 12.1 */ public $name = 'mysqli'; /** * The character(s) used to quote SQL statement names such as table names or field names, * etc. The child classes should define this as necessary. If a single character string the * same character is used for both sides of the quoted name, else the first character will be * used for the opening quote and the second for the closing quote. * * @var string * @since 12.2 */ protected $nameQuote = '`'; /** * The null or zero representation of a timestamp for the database driver. This should be * defined in child classes to hold the appropriate value for the engine. * * @var string * @since 12.2 */ protected $nullDate = '0000-00-00 00:00:00'; /** * @var string The minimum supported database version. * @since 12.2 */ protected static $dbMinimum = '5.0.4'; /** * Constructor. * * @param array $options List of options used to configure the connection * * @since 12.1 */ public function __construct($options) { // Get some basic values from the options. $options['host'] = (isset($options['host'])) ? $options['host'] : 'localhost'; $options['user'] = (isset($options['user'])) ? $options['user'] : 'root'; $options['password'] = (isset($options['password'])) ? $options['password'] : ''; $options['database'] = (isset($options['database'])) ? $options['database'] : ''; $options['select'] = (isset($options['select'])) ? (bool) $options['select'] : true; $options['port'] = null; $options['socket'] = null; // Finalize initialisation. parent::__construct($options); } /** * Destructor. * * @since 12.1 */ public function __destruct() { $this->disconnect(); } /** * Connects to the database if needed. * * @return void Returns void if the database connected successfully. * * @since 12.1 * @throws RuntimeException */ public function connect() { if ($this->connection) { return; } /* * Unlike mysql_connect(), mysqli_connect() takes the port and socket as separate arguments. Therefore, we * have to extract them from the host string. */ $port = isset($this->options['port']) ? $this->options['port'] : 3306; $regex = '/^(?P<host>((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:(?P<port>.+))?$/'; if (preg_match($regex, $this->options['host'], $matches)) { // It's an IPv4 address with ot without port $this->options['host'] = $matches['host']; if (!empty($matches['port'])) { $port = $matches['port']; } } elseif (preg_match('/^(?P<host>\[.*\])(:(?P<port>.+))?$/', $this->options['host'], $matches)) { // We assume square-bracketed IPv6 address with or without port, e.g. [fe80:102::2%eth1]:3306 $this->options['host'] = $matches['host']; if (!empty($matches['port'])) { $port = $matches['port']; } } elseif (preg_match('/^(?P<host>(\w+:\/{2,3})?[a-z0-9\.\-]+)(:(?P<port>[^:]+))?$/i', $this->options['host'], $matches)) { // Named host (e.g domain.com or localhost) with ot without port $this->options['host'] = $matches['host']; if (!empty($matches['port'])) { $port = $matches['port']; } } elseif (preg_match('/^:(?P<port>[^:]+)$/', $this->options['host'], $matches)) { // Empty host, just port, e.g. ':3306' $this->options['host'] = 'localhost'; $port = $matches['port']; } // ... else we assume normal (naked) IPv6 address, so host and port stay as they are or default // Get the port number or socket name if (is_numeric($port)) { $this->options['port'] = (int) $port; } else { $this->options['socket'] = $port; } // Make sure the MySQLi extension for PHP is installed and enabled. if (!function_exists('mysqli_connect')) { throw new RuntimeException('The MySQL adapter mysqli is not available'); } $this->connection = @mysqli_connect( $this->options['host'], $this->options['user'], $this->options['password'], null, $this->options['port'], $this->options['socket'] ); // Attempt to connect to the server. if (!$this->connection) { throw new RuntimeException('Could not connect to MySQL.'); } // Set sql_mode to non_strict mode mysqli_query($this->connection, "SET @@SESSION.sql_mode = '';"); // If auto-select is enabled select the given database. if ($this->options['select'] && !empty($this->options['database'])) { $this->select($this->options['database']); } // Set charactersets (needed for MySQL 4.1.2+). $this->setUtf(); // Turn MySQL profiling ON in debug mode: if ($this->debug && $this->hasProfiling()) { mysqli_query($this->connection, "SET profiling_history_size = 100;"); mysqli_query($this->connection, "SET profiling = 1;"); } } /** * Disconnects the database. * * @return void * * @since 12.1 */ public function disconnect() { // Close the connection. if ($this->connection instanceof mysqli && $this->connection->stat() !== false) { foreach ($this->disconnectHandlers as $h) { call_user_func_array($h, array( &$this)); } mysqli_close($this->connection); } $this->connection = null; } /** * Method to escape a string for usage in an SQL statement. * * @param string $text The string to be escaped. * @param boolean $extra Optional parameter to provide extra escaping. * * @return string The escaped string. * * @since 12.1 */ public function escape($text, $extra = false) { $this->connect(); $result = mysqli_real_escape_string($this->getConnection(), $text); if ($extra) { $result = addcslashes($result, '%_'); } return $result; } /** * Test to see if the MySQL connector is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return (function_exists('mysqli_connect')); } /** * Determines if the connection to the server is active. * * @return boolean True if connected to the database engine. * * @since 12.1 */ public function connected() { if (is_object($this->connection)) { return mysqli_ping($this->connection); } return false; } /** * Drops a table from the database. * * @param string $tableName The name of the database table to drop. * @param boolean $ifExists Optionally specify that the table must exist before it is dropped. * * @return JDatabaseDriverMysqli Returns this object to support chaining. * * @since 12.2 * @throws RuntimeException */ public function dropTable($tableName, $ifExists = true) { $this->connect(); $query = $this->getQuery(true); $this->setQuery('DROP TABLE ' . ($ifExists ? 'IF EXISTS ' : '') . $query->quoteName($tableName)); $this->execute(); return $this; } /** * Get the number of affected rows for the previous executed SQL statement. * * @return integer The number of affected rows. * * @since 12.1 */ public function getAffectedRows() { $this->connect(); return mysqli_affected_rows($this->connection); } /** * Method to get the database collation. * * @return mixed The collation in use by the database (string) or boolean false if not supported. * * @since 12.2 * @throws RuntimeException */ public function getCollation() { $this->connect(); // Attempt to get the database collation by accessing the server system variable. $this->setQuery('SHOW VARIABLES LIKE "collation_database"'); $result = $this->loadObject(); if (property_exists($result, 'Value')) { return $result->Value; } else { return false; } } /** * Get the number of returned rows for the previous executed SQL statement. * * @param resource $cursor An optional database cursor resource to extract the row count from. * * @return integer The number of returned rows. * * @since 12.1 */ public function getNumRows($cursor = null) { return mysqli_num_rows($cursor ? $cursor : $this->cursor); } /** * Shows the table CREATE statement that creates the given tables. * * @param mixed $tables A table name or a list of table names. * * @return array A list of the create SQL for the tables. * * @since 12.1 * @throws RuntimeException */ public function getTableCreate($tables) { $this->connect(); $result = array(); // Sanitize input to an array and iterate over the list. settype($tables, 'array'); foreach ($tables as $table) { // Set the query to get the table CREATE statement. $this->setQuery('SHOW CREATE table ' . $this->quoteName($this->escape($table))); $row = $this->loadRow(); // Populate the result array based on the create statements. $result[$table] = $row[1]; } return $result; } /** * Retrieves field information about a given table. * * @param string $table The name of the database table. * @param boolean $typeOnly True to only return field types. * * @return array An array of fields for the database table. * * @since 12.2 * @throws RuntimeException */ public function getTableColumns($table, $typeOnly = true) { $this->connect(); $result = array(); // Set the query to get the table fields statement. $this->setQuery('SHOW FULL COLUMNS FROM ' . $this->quoteName($this->escape($table))); $fields = $this->loadObjectList(); // If we only want the type as the value add just that to the list. if ($typeOnly) { foreach ($fields as $field) { $result[$field->Field] = preg_replace("/[(0-9)]/", '', $field->Type); } } // If we want the whole field data object add that to the list. else { foreach ($fields as $field) { $result[$field->Field] = $field; } } return $result; } /** * Get the details list of keys for a table. * * @param string $table The name of the table. * * @return array An array of the column specification for the table. * * @since 12.2 * @throws RuntimeException */ public function getTableKeys($table) { $this->connect(); // Get the details columns information. $this->setQuery('SHOW KEYS FROM ' . $this->quoteName($table)); $keys = $this->loadObjectList(); return $keys; } /** * Method to get an array of all tables in the database. * * @return array An array of all the tables in the database. * * @since 12.2 * @throws RuntimeException */ public function getTableList() { $this->connect(); // Set the query to get the tables statement. $this->setQuery('SHOW TABLES'); $tables = $this->loadColumn(); return $tables; } /** * Get the version of the database connector. * * @return string The database connector version. * * @since 12.1 */ public function getVersion() { $this->connect(); return mysqli_get_server_info($this->connection); } /** * Method to get the auto-incremented value from the last INSERT statement. * * @return mixed The value of the auto-increment field from the last inserted row. * If the value is greater than maximal int value, it will return a string. * * @since 12.1 */ public function insertid() { $this->connect(); return mysqli_insert_id($this->connection); } /** * Locks a table in the database. * * @param string $table The name of the table to unlock. * * @return JDatabaseDriverMysqli Returns this object to support chaining. * * @since 12.2 * @throws RuntimeException */ public function lockTable($table) { $this->setQuery('LOCK TABLES ' . $this->quoteName($table) . ' WRITE')->execute(); return $this; } /** * Execute the SQL statement. * * @return mixed A database cursor resource on success, boolean false on failure. * * @since 12.1 * @throws RuntimeException */ public function execute() { $this->connect(); if (!is_object($this->connection)) { JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database'); throw new RuntimeException($this->errorMsg, $this->errorNum); } // Take a local copy so that we don't modify the original query and cause issues later $query = $this->replacePrefix((string) $this->sql); if (!($this->sql instanceof JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) { $query .= ' LIMIT ' . $this->offset . ', ' . $this->limit; } // Increment the query counter. $this->count++; // Reset the error values. $this->errorNum = 0; $this->errorMsg = ''; $memoryBefore = null; // If debugging is enabled then let's log the query. if ($this->debug) { // Add the query to the object queue. $this->log[] = $query; JLog::add($query, JLog::DEBUG, 'databasequery'); $this->timings[] = microtime(true); if (is_object($this->cursor)) { // Avoid warning if result already freed by third-party library @$this->freeResult(); } $memoryBefore = memory_get_usage(); } // Execute the query. Error suppression is used here to prevent warnings/notices that the connection has been lost. $this->cursor = @mysqli_query($this->connection, $query); if ($this->debug) { $this->timings[] = microtime(true); if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) { $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); } else { $this->callStacks[] = debug_backtrace(); } $this->callStacks[count($this->callStacks) - 1][0]['memory'] = array( $memoryBefore, memory_get_usage(), is_object($this->cursor) ? $this->getNumRows() : null ); } // If an error occurred handle it. if (!$this->cursor) { $this->errorNum = (int) mysqli_errno($this->connection); $this->errorMsg = (string) mysqli_error($this->connection) . ' SQL=' . $query; // Check if the server was disconnected. if (!$this->connected()) { try { // Attempt to reconnect. $this->connection = null; $this->connect(); } // If connect fails, ignore that exception and throw the normal exception. catch (RuntimeException $e) { JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg, $this->errorNum); } // Since we were able to reconnect, run the query again. return $this->execute(); } // The server was not disconnected. else { JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg, $this->errorNum); } } return $this->cursor; } /** * Renames a table in the database. * * @param string $oldTable The name of the table to be renamed * @param string $newTable The new name for the table. * @param string $backup Not used by MySQL. * @param string $prefix Not used by MySQL. * * @return JDatabaseDriverMysqli Returns this object to support chaining. * * @since 12.2 * @throws RuntimeException */ public function renameTable($oldTable, $newTable, $backup = null, $prefix = null) { $this->setQuery('RENAME TABLE ' . $oldTable . ' TO ' . $newTable)->execute(); return $this; } /** * Select a database for use. * * @param string $database The name of the database to select for use. * * @return boolean True if the database was successfully selected. * * @since 12.1 * @throws RuntimeException */ public function select($database) { $this->connect(); if (!$database) { return false; } if (!mysqli_select_db($this->connection, $database)) { throw new RuntimeException('Could not connect to database.'); } return true; } /** * Set the connection to use UTF-8 character encoding. * * @return boolean True on success. * * @since 12.1 */ public function setUtf() { $this->connect(); return $this->connection->set_charset('utf8'); } /** * Method to commit a transaction. * * @param boolean $toSavepoint If true, commit to the last savepoint. * * @return void * * @since 12.2 * @throws RuntimeException */ public function transactionCommit($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { if ($this->setQuery('COMMIT')->execute()) { $this->transactionDepth = 0; } return; } $this->transactionDepth--; } /** * Method to roll back a transaction. * * @param boolean $toSavepoint If true, rollback to the last savepoint. * * @return void * * @since 12.2 * @throws RuntimeException */ public function transactionRollback($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { if ($this->setQuery('ROLLBACK')->execute()) { $this->transactionDepth = 0; } return; } $savepoint = 'SP_' . ($this->transactionDepth - 1); $this->setQuery('ROLLBACK TO SAVEPOINT ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth--; } } /** * Method to initialize a transaction. * * @param boolean $asSavepoint If true and a transaction is already active, a savepoint will be created. * * @return void * * @since 12.2 * @throws RuntimeException */ public function transactionStart($asSavepoint = false) { $this->connect(); if (!$asSavepoint || !$this->transactionDepth) { if ($this->setQuery('START TRANSACTION')->execute()) { $this->transactionDepth = 1; } return; } $savepoint = 'SP_' . $this->transactionDepth; $this->setQuery('SAVEPOINT ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth++; } } /** * Method to fetch a row from the result set cursor as an array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchArray($cursor = null) { return mysqli_fetch_row($cursor ? $cursor : $this->cursor); } /** * Method to fetch a row from the result set cursor as an associative array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchAssoc($cursor = null) { return mysqli_fetch_assoc($cursor ? $cursor : $this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * @param string $class The class name to use for the returned row object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchObject($cursor = null, $class = 'stdClass') { return mysqli_fetch_object($cursor ? $cursor : $this->cursor, $class); } /** * Method to free up the memory used for the result set. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return void * * @since 12.1 */ protected function freeResult($cursor = null) { mysqli_free_result($cursor ? $cursor : $this->cursor); if ((! $cursor) || ($cursor === $this->cursor)) { $this->cursor = null; } } /** * Unlocks tables in the database. * * @return JDatabaseDriverMysqli Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function unlockTables() { $this->setQuery('UNLOCK TABLES')->execute(); return $this; } /** * Internal function to check if profiling is available * * @return boolean * * @since 3.1.3 */ private function hasProfiling() { try { $res = mysqli_query($this->connection, "SHOW VARIABLES LIKE 'have_profiling'"); $row = mysqli_fetch_assoc($res); return isset($row); } catch (Exception $e) { return false; } } } PK���\�u��*�*-libraries/joomla/database/driver/pdomysql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MySQL database driver supporting PDO based connections * * @package Joomla.Platform * @subpackage Database * @see http://php.net/manual/en/ref.pdo-mysql.php * @since 3.4 */ class JDatabaseDriverPdomysql extends JDatabaseDriverPdo { /** * The name of the database driver. * * @var string * @since 3.4 */ public $name = 'pdomysql'; /** * The character(s) used to quote SQL statement names such as table names or field names, * etc. The child classes should define this as necessary. If a single character string the * same character is used for both sides of the quoted name, else the first character will be * used for the opening quote and the second for the closing quote. * * @var string * @since 3.4 */ protected $nameQuote = '`'; /** * The null or zero representation of a timestamp for the database driver. This should be * defined in child classes to hold the appropriate value for the engine. * * @var string * @since 3.4 */ protected $nullDate = '0000-00-00 00:00:00'; /** * The minimum supported database version. * * @var string * @since 3.4 */ protected static $dbMinimum = '5.0.4'; /** * Constructor. * * @param array $options Array of database options with keys: host, user, password, database, select. * * @since 3.4 */ public function __construct($options) { // Get some basic values from the options. $options['driver'] = 'mysql'; $options['charset'] = (isset($options['charset'])) ? $options['charset'] : 'utf8'; $this->charset = $options['charset']; // Finalize initialisation. parent::__construct($options); } /** * Connects to the database if needed. * * @return void Returns void if the database connected successfully. * * @since 3.4 * @throws RuntimeException */ public function connect() { parent::connect(); $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); } /** * Test to see if the MySQL connector is available. * * @return boolean True on success, false otherwise. * * @since 3.4 */ public static function isSupported() { return class_exists('PDO') && in_array('mysql', PDO::getAvailableDrivers()); } /** * Drops a table from the database. * * @param string $tableName The name of the database table to drop. * @param boolean $ifExists Optionally specify that the table must exist before it is dropped. * * @return JDatabaseDriverPdomysql Returns this object to support chaining. * * @since 3.4 * @throws RuntimeException */ public function dropTable($tableName, $ifExists = true) { $this->connect(); $query = $this->getQuery(true); $query->setQuery('DROP TABLE ' . ($ifExists ? 'IF EXISTS ' : '') . $this->quoteName($tableName)); $this->setQuery($query); $this->execute(); return $this; } /** * Select a database for use. * * @param string $database The name of the database to select for use. * * @return boolean True if the database was successfully selected. * * @since 3.4 * @throws RuntimeException */ public function select($database) { $this->connect(); $this->setQuery('USE ' . $this->quoteName($database)); $this->execute(); return $this; } /** * Method to get the database collation in use by sampling a text field of a table in the database. * * @return mixed The collation in use by the database (string) or boolean false if not supported. * * @since 3.4 * @throws RuntimeException */ public function getCollation() { $this->connect(); // Attempt to get the database collation by accessing the server system variable. $this->setQuery('SHOW VARIABLES LIKE "collation_database"'); $result = $this->loadObject(); if (property_exists($result, 'Value')) { return $result->Value; } else { return false; } } /** * Shows the table CREATE statement that creates the given tables. * * @param mixed $tables A table name or a list of table names. * * @return array A list of the create SQL for the tables. * * @since 3.4 * @throws RuntimeException */ public function getTableCreate($tables) { $this->connect(); // Initialise variables. $result = array(); // Sanitize input to an array and iterate over the list. settype($tables, 'array'); foreach ($tables as $table) { $this->setQuery('SHOW CREATE TABLE ' . $this->quoteName($table)); $row = $this->loadRow(); // Populate the result array based on the create statements. $result[$table] = $row[1]; } return $result; } /** * Retrieves field information about a given table. * * @param string $table The name of the database table. * @param boolean $typeOnly True to only return field types. * * @return array An array of fields for the database table. * * @since 3.4 * @throws RuntimeException */ public function getTableColumns($table, $typeOnly = true) { $this->connect(); $result = array(); // Set the query to get the table fields statement. $this->setQuery('SHOW FULL COLUMNS FROM ' . $this->quoteName($table)); $fields = $this->loadObjectList(); // If we only want the type as the value add just that to the list. if ($typeOnly) { foreach ($fields as $field) { $result[$field->Field] = preg_replace("/[(0-9)]/", '', $field->Type); } } // If we want the whole field data object add that to the list. else { foreach ($fields as $field) { $result[$field->Field] = $field; } } return $result; } /** * Get the details list of keys for a table. * * @param string $table The name of the table. * * @return array An array of the column specification for the table. * * @since 3.4 * @throws RuntimeException */ public function getTableKeys($table) { $this->connect(); // Get the details columns information. $this->setQuery('SHOW KEYS FROM ' . $this->quoteName($table)); $keys = $this->loadObjectList(); return $keys; } /** * Method to get an array of all tables in the database. * * @return array An array of all the tables in the database. * * @since 3.4 * @throws RuntimeException */ public function getTableList() { $this->connect(); // Set the query to get the tables statement. $this->setQuery('SHOW TABLES'); $tables = $this->loadColumn(); return $tables; } /** * Get the version of the database connector. * * @return string The database connector version. * * @since 3.4 */ public function getVersion() { $this->connect(); return $this->getOption(PDO::ATTR_SERVER_VERSION); } /** * Locks a table in the database. * * @param string $table The name of the table to unlock. * * @return JDatabaseDriverPdomysql Returns this object to support chaining. * * @since 3.4 * @throws RuntimeException */ public function lockTable($table) { $this->setQuery('LOCK TABLES ' . $this->quoteName($table) . ' WRITE')->execute(); return $this; } /** * Renames a table in the database. * * @param string $oldTable The name of the table to be renamed * @param string $newTable The new name for the table. * @param string $backup Not used by MySQL. * @param string $prefix Not used by MySQL. * * @return JDatabaseDriverPdomysql Returns this object to support chaining. * * @since 3.4 * @throws RuntimeException */ public function renameTable($oldTable, $newTable, $backup = null, $prefix = null) { $this->setQuery('RENAME TABLE ' . $this->quoteName($oldTable) . ' TO ' . $this->quoteName($newTable)); $this->execute(); return $this; } /** * Method to escape a string for usage in an SQL statement. * * Oracle escaping reference: * http://www.orafaq.com/wiki/SQL_FAQ#How_does_one_escape_special_characters_when_writing_SQL_queries.3F * * SQLite escaping notes: * http://www.sqlite.org/faq.html#q14 * * Method body is as implemented by the Zend Framework * * Note: Using query objects with bound variables is * preferable to the below. * * @param string $text The string to be escaped. * @param boolean $extra Unused optional parameter to provide extra escaping. * * @return string The escaped string. * * @since 3.4 */ public function escape($text, $extra = false) { $this->connect(); if (is_int($text) || is_float($text)) { return $text; } $result = substr($this->connection->quote($text), 1, -1); if ($extra) { $result = addcslashes($result, '%_'); } return $result; } /** * Unlocks tables in the database. * * @return JDatabaseDriverPdomysql Returns this object to support chaining. * * @since 3.4 * @throws RuntimeException */ public function unlockTables() { $this->setQuery('UNLOCK TABLES')->execute(); return $this; } /** * Method to commit a transaction. * * @param boolean $toSavepoint If true, commit to the last savepoint. * * @return void * * @since 3.4 * @throws RuntimeException */ public function transactionCommit($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { parent::transactionCommit($toSavepoint); } else { $this->transactionDepth--; } } /** * Method to roll back a transaction. * * @param boolean $toSavepoint If true, rollback to the last savepoint. * * @return void * * @since 3.4 * @throws RuntimeException */ public function transactionRollback($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { parent::transactionRollback($toSavepoint); } else { $savepoint = 'SP_' . ($this->transactionDepth - 1); $this->setQuery('ROLLBACK TO SAVEPOINT ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth--; } } } /** * Method to initialize a transaction. * * @param boolean $asSavepoint If true and a transaction is already active, a savepoint will be created. * * @return void * * @since 3.4 * @throws RuntimeException */ public function transactionStart($asSavepoint = false) { $this->connect(); if (!$asSavepoint || !$this->transactionDepth) { parent::transactionStart($asSavepoint); } else { $savepoint = 'SP_' . $this->transactionDepth; $this->setQuery('SAVEPOINT ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth++; } } } } PK���\N��jp&p&+libraries/joomla/database/driver/sqlite.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * SQLite database driver * * @see http://php.net/pdo * @since 12.1 */ class JDatabaseDriverSqlite extends JDatabaseDriverPdo { /** * The name of the database driver. * * @var string * @since 12.1 */ public $name = 'sqlite'; /** * The character(s) used to quote SQL statement names such as table names or field names, * etc. The child classes should define this as necessary. If a single character string the * same character is used for both sides of the quoted name, else the first character will be * used for the opening quote and the second for the closing quote. * * @var string * @since 12.1 */ protected $nameQuote = '`'; /** * Destructor. * * @since 12.1 */ public function __destruct() { $this->freeResult(); unset($this->connection); } /** * Disconnects the database. * * @return void * * @since 12.1 */ public function disconnect() { $this->freeResult(); unset($this->connection); } /** * Drops a table from the database. * * @param string $tableName The name of the database table to drop. * @param boolean $ifExists Optionally specify that the table must exist before it is dropped. * * @return JDatabaseDriverSqlite Returns this object to support chaining. * * @since 12.1 */ public function dropTable($tableName, $ifExists = true) { $this->connect(); $query = $this->getQuery(true); $this->setQuery('DROP TABLE ' . ($ifExists ? 'IF EXISTS ' : '') . $query->quoteName($tableName)); $this->execute(); return $this; } /** * Method to escape a string for usage in an SQLite statement. * * Note: Using query objects with bound variables is * preferable to the below. * * @param string $text The string to be escaped. * @param boolean $extra Unused optional parameter to provide extra escaping. * * @return string The escaped string. * * @since 12.1 */ public function escape($text, $extra = false) { if (is_int($text) || is_float($text)) { return $text; } return SQLite3::escapeString($text); } /** * Method to get the database collation in use by sampling a text field of a table in the database. * * @return mixed The collation in use by the database or boolean false if not supported. * * @since 12.1 */ public function getCollation() { return $this->charset; } /** * Shows the table CREATE statement that creates the given tables. * * Note: Doesn't appear to have support in SQLite * * @param mixed $tables A table name or a list of table names. * * @return array A list of the create SQL for the tables. * * @since 12.1 * @throws RuntimeException */ public function getTableCreate($tables) { $this->connect(); // Sanitize input to an array and iterate over the list. settype($tables, 'array'); return $tables; } /** * Retrieves field information about a given table. * * @param string $table The name of the database table. * @param boolean $typeOnly True to only return field types. * * @return array An array of fields for the database table. * * @since 12.1 * @throws RuntimeException */ public function getTableColumns($table, $typeOnly = true) { $this->connect(); $columns = array(); $query = $this->getQuery(true); $fieldCasing = $this->getOption(PDO::ATTR_CASE); $this->setOption(PDO::ATTR_CASE, PDO::CASE_UPPER); $table = strtoupper($table); $query->setQuery('pragma table_info(' . $table . ')'); $this->setQuery($query); $fields = $this->loadObjectList(); if ($typeOnly) { foreach ($fields as $field) { $columns[$field->NAME] = $field->TYPE; } } else { foreach ($fields as $field) { // Do some dirty translation to MySQL output. // TODO: Come up with and implement a standard across databases. $columns[$field->NAME] = (object) array( 'Field' => $field->NAME, 'Type' => $field->TYPE, 'Null' => ($field->NOTNULL == '1' ? 'NO' : 'YES'), 'Default' => $field->DFLT_VALUE, 'Key' => ($field->PK != '0' ? 'PRI' : '') ); } } $this->setOption(PDO::ATTR_CASE, $fieldCasing); return $columns; } /** * Get the details list of keys for a table. * * @param string $table The name of the table. * * @return array An array of the column specification for the table. * * @since 12.1 * @throws RuntimeException */ public function getTableKeys($table) { $this->connect(); $keys = array(); $query = $this->getQuery(true); $fieldCasing = $this->getOption(PDO::ATTR_CASE); $this->setOption(PDO::ATTR_CASE, PDO::CASE_UPPER); $table = strtoupper($table); $query->setQuery('pragma table_info( ' . $table . ')'); // $query->bind(':tableName', $table); $this->setQuery($query); $rows = $this->loadObjectList(); foreach ($rows as $column) { if ($column->PK == 1) { $keys[$column->NAME] = $column; } } $this->setOption(PDO::ATTR_CASE, $fieldCasing); return $keys; } /** * Method to get an array of all tables in the database (schema). * * @return array An array of all the tables in the database. * * @since 12.1 * @throws RuntimeException */ public function getTableList() { $this->connect(); $type = 'table'; $query = $this->getQuery(true) ->select('name') ->from('sqlite_master') ->where('type = :type') ->bind(':type', $type) ->order('name'); $this->setQuery($query); $tables = $this->loadColumn(); return $tables; } /** * Get the version of the database connector. * * @return string The database connector version. * * @since 12.1 */ public function getVersion() { $this->connect(); $this->setQuery("SELECT sqlite_version()"); return $this->loadResult(); } /** * Select a database for use. * * @param string $database The name of the database to select for use. * * @return boolean True if the database was successfully selected. * * @since 12.1 * @throws RuntimeException */ public function select($database) { $this->connect(); return true; } /** * Set the connection to use UTF-8 character encoding. * * Returns false automatically for the Oracle driver since * you can only set the character set when the connection * is created. * * @return boolean True on success. * * @since 12.1 */ public function setUtf() { $this->connect(); return false; } /** * Locks a table in the database. * * @param string $table The name of the table to unlock. * * @return JDatabaseDriverSqlite Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function lockTable($table) { return $this; } /** * Renames a table in the database. * * @param string $oldTable The name of the table to be renamed * @param string $newTable The new name for the table. * @param string $backup Not used by Sqlite. * @param string $prefix Not used by Sqlite. * * @return JDatabaseDriverSqlite Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function renameTable($oldTable, $newTable, $backup = null, $prefix = null) { $this->setQuery('ALTER TABLE ' . $oldTable . ' RENAME TO ' . $newTable)->execute(); return $this; } /** * Unlocks tables in the database. * * @return JDatabaseDriverSqlite Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function unlockTables() { return $this; } /** * Test to see if the PDO ODBC connector is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return class_exists('PDO') && in_array('sqlite', PDO::getAvailableDrivers()); } /** * Method to commit a transaction. * * @param boolean $toSavepoint If true, commit to the last savepoint. * * @return void * * @since 12.3 * @throws RuntimeException */ public function transactionCommit($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { parent::transactionCommit($toSavepoint); } else { $this->transactionDepth--; } } /** * Method to roll back a transaction. * * @param boolean $toSavepoint If true, rollback to the last savepoint. * * @return void * * @since 12.3 * @throws RuntimeException */ public function transactionRollback($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { parent::transactionRollback($toSavepoint); } else { $savepoint = 'SP_' . ($this->transactionDepth - 1); $this->setQuery('ROLLBACK TO ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth--; } } } /** * Method to initialize a transaction. * * @param boolean $asSavepoint If true and a transaction is already active, a savepoint will be created. * * @return void * * @since 12.3 * @throws RuntimeException */ public function transactionStart($asSavepoint = false) { $this->connect(); if (!$asSavepoint || !$this->transactionDepth) { parent::transactionStart($asSavepoint); } $savepoint = 'SP_' . $this->transactionDepth; $this->setQuery('SAVEPOINT ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth++; } } } PK���\{�5���/libraries/joomla/database/driver/postgresql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * PostgreSQL database driver * * @since 12.1 */ class JDatabaseDriverPostgresql extends JDatabaseDriver { /** * The database driver name * * @var string * @since 12.1 */ public $name = 'postgresql'; /** * Quote for named objects * * @var string * @since 12.1 */ protected $nameQuote = '"'; /** * The null/zero date string * * @var string * @since 12.1 */ protected $nullDate = '1970-01-01 00:00:00'; /** * The minimum supported database version. * * @var string * @since 12.1 */ protected static $dbMinimum = '8.3.18'; /** * Operator used for concatenation * * @var string * @since 12.1 */ protected $concat_operator = '||'; /** * JDatabaseDriverPostgresqlQuery object returned by getQuery * * @var JDatabaseDriverPostgresqlQuery * @since 12.1 */ protected $queryObject = null; /** * Database object constructor * * @param array $options List of options used to configure the connection * * @since 12.1 */ public function __construct( $options ) { $options['host'] = (isset($options['host'])) ? $options['host'] : 'localhost'; $options['user'] = (isset($options['user'])) ? $options['user'] : ''; $options['password'] = (isset($options['password'])) ? $options['password'] : ''; $options['database'] = (isset($options['database'])) ? $options['database'] : ''; // Finalize initialization parent::__construct($options); } /** * Database object destructor * * @since 12.1 */ public function __destruct() { $this->disconnect(); } /** * Connects to the database if needed. * * @return void Returns void if the database connected successfully. * * @since 12.1 * @throws RuntimeException */ public function connect() { if ($this->connection) { return; } // Make sure the postgresql extension for PHP is installed and enabled. if (!function_exists('pg_connect')) { throw new RuntimeException('PHP extension pg_connect is not available.'); } // Build the DSN for the connection. $dsn = ''; if (!empty($this->options['host'])) { $dsn .= "host={$this->options['host']} "; } $dsn .= "dbname={$this->options['database']} user={$this->options['user']} password={$this->options['password']}"; // Attempt to connect to the server. if (!($this->connection = @pg_connect($dsn))) { throw new RuntimeException('Error connecting to PGSQL database.'); } pg_set_error_verbosity($this->connection, PGSQL_ERRORS_DEFAULT); pg_query('SET standard_conforming_strings=off'); pg_query('SET escape_string_warning=off'); } /** * Disconnects the database. * * @return void * * @since 12.1 */ public function disconnect() { // Close the connection. if (is_resource($this->connection)) { foreach ($this->disconnectHandlers as $h) { call_user_func_array($h, array( &$this)); } pg_close($this->connection); } $this->connection = null; } /** * Method to escape a string for usage in an SQL statement. * * @param string $text The string to be escaped. * @param boolean $extra Optional parameter to provide extra escaping. * * @return string The escaped string. * * @since 12.1 */ public function escape($text, $extra = false) { $this->connect(); $result = pg_escape_string($this->connection, $text); if ($extra) { $result = addcslashes($result, '%_'); } return $result; } /** * Test to see if the PostgreSQL connector is available * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function test() { return (function_exists('pg_connect')); } /** * Determines if the connection to the server is active. * * @return boolean * * @since 12.1 */ public function connected() { $this->connect(); if (is_resource($this->connection)) { return pg_ping($this->connection); } return false; } /** * Drops a table from the database. * * @param string $tableName The name of the database table to drop. * @param boolean $ifExists Optionally specify that the table must exist before it is dropped. * * @return boolean * * @since 12.1 * @throws RuntimeException */ public function dropTable($tableName, $ifExists = true) { $this->connect(); $this->setQuery('DROP TABLE ' . ($ifExists ? 'IF EXISTS ' : '') . $this->quoteName($tableName)); $this->execute(); return true; } /** * Get the number of affected rows for the previous executed SQL statement. * * @return integer The number of affected rows in the previous operation * * @since 12.1 */ public function getAffectedRows() { $this->connect(); return pg_affected_rows($this->cursor); } /** * Method to get the database collation in use by sampling a text field of a table in the database. * * @return mixed The collation in use by the database or boolean false if not supported. * * @since 12.1 * @throws RuntimeException */ public function getCollation() { $this->connect(); $this->setQuery('SHOW LC_COLLATE'); $array = $this->loadAssocList(); return $array[0]['lc_collate']; } /** * Get the number of returned rows for the previous executed SQL statement. * * @param resource $cur An optional database cursor resource to extract the row count from. * * @return integer The number of returned rows. * * @since 12.1 */ public function getNumRows($cur = null) { $this->connect(); return pg_num_rows((int) $cur ? $cur : $this->cursor); } /** * Get the current or query, or new JDatabaseQuery object. * * @param boolean $new False to return the last query set, True to return a new JDatabaseQuery object. * @param boolean $asObj False to return last query as string, true to get JDatabaseQueryPostgresql object. * * @return JDatabaseQuery The current query object or a new object extending the JDatabaseQuery class. * * @since 12.1 * @throws RuntimeException */ public function getQuery($new = false, $asObj = false) { if ($new) { // Make sure we have a query class for this driver. if (!class_exists('JDatabaseQueryPostgresql')) { throw new RuntimeException('JDatabaseQueryPostgresql Class not found.'); } $this->queryObject = new JDatabaseQueryPostgresql($this); return $this->queryObject; } else { if ($asObj) { return $this->queryObject; } else { return $this->sql; } } } /** * Shows the table CREATE statement that creates the given tables. * * This is unsuported by PostgreSQL. * * @param mixed $tables A table name or a list of table names. * * @return string An empty char because this function is not supported by PostgreSQL. * * @since 12.1 */ public function getTableCreate($tables) { return ''; } /** * Retrieves field information about a given table. * * @param string $table The name of the database table. * @param boolean $typeOnly True to only return field types. * * @return array An array of fields for the database table. * * @since 12.1 * @throws RuntimeException */ public function getTableColumns($table, $typeOnly = true) { $this->connect(); $result = array(); $tableSub = $this->replacePrefix($table); $this->setQuery(' SELECT a.attname AS "column_name", pg_catalog.format_type(a.atttypid, a.atttypmod) as "type", CASE WHEN a.attnotnull IS TRUE THEN \'NO\' ELSE \'YES\' END AS "null", CASE WHEN pg_catalog.pg_get_expr(adef.adbin, adef.adrelid, true) IS NOT NULL THEN pg_catalog.pg_get_expr(adef.adbin, adef.adrelid, true) END as "Default", CASE WHEN pg_catalog.col_description(a.attrelid, a.attnum) IS NULL THEN \'\' ELSE pg_catalog.col_description(a.attrelid, a.attnum) END AS "comments" FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_attrdef adef ON a.attrelid=adef.adrelid AND a.attnum=adef.adnum LEFT JOIN pg_catalog.pg_type t ON a.atttypid=t.oid WHERE a.attrelid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=' . $this->quote($tableSub) . ' AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = \'public\') ) AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum' ); $fields = $this->loadObjectList(); if ($typeOnly) { foreach ($fields as $field) { $result[$field->column_name] = preg_replace("/[(0-9)]/", '', $field->type); } } else { foreach ($fields as $field) { if (stristr(strtolower($field->type), "character varying")) { $field->Default = ""; } if (stristr(strtolower($field->type), "text")) { $field->Default = ""; } // Do some dirty translation to MySQL output. // TODO: Come up with and implement a standard across databases. $result[$field->column_name] = (object) array( 'column_name' => $field->column_name, 'type' => $field->type, 'null' => $field->null, 'Default' => $field->Default, 'comments' => '', 'Field' => $field->column_name, 'Type' => $field->type, 'Null' => $field->null, // TODO: Improve query above to return primary key info as well // 'Key' => ($field->PK == '1' ? 'PRI' : '') ); } } /* Change Postgresql's NULL::* type with PHP's null one */ foreach ($fields as $field) { if (preg_match("/^NULL::*/", $field->Default)) { $field->Default = null; } } return $result; } /** * Get the details list of keys for a table. * * @param string $table The name of the table. * * @return array An array of the column specification for the table. * * @since 12.1 * @throws RuntimeException */ public function getTableKeys($table) { $this->connect(); // To check if table exists and prevent SQL injection $tableList = $this->getTableList(); if (in_array($table, $tableList)) { // Get the details columns information. $this->setQuery(' SELECT indexname AS "idxName", indisprimary AS "isPrimary", indisunique AS "isUnique", CASE WHEN indisprimary = true THEN ( SELECT \'ALTER TABLE \' || tablename || \' ADD \' || pg_catalog.pg_get_constraintdef(const.oid, true) FROM pg_constraint AS const WHERE const.conname= pgClassFirst.relname ) ELSE pg_catalog.pg_get_indexdef(indexrelid, 0, true) END AS "Query" FROM pg_indexes LEFT JOIN pg_class AS pgClassFirst ON indexname=pgClassFirst.relname LEFT JOIN pg_index AS pgIndex ON pgClassFirst.oid=pgIndex.indexrelid WHERE tablename=' . $this->quote($table) . ' ORDER BY indkey' ); $keys = $this->loadObjectList(); return $keys; } return false; } /** * Method to get an array of all tables in the database. * * @return array An array of all the tables in the database. * * @since 12.1 * @throws RuntimeException */ public function getTableList() { $this->connect(); $query = $this->getQuery(true) ->select('table_name') ->from('information_schema.tables') ->where('table_type=' . $this->quote('BASE TABLE')) ->where('table_schema NOT IN (' . $this->quote('pg_catalog') . ', ' . $this->quote('information_schema') . ')') ->order('table_name ASC'); $this->setQuery($query); $tables = $this->loadColumn(); return $tables; } /** * Get the details list of sequences for a table. * * @param string $table The name of the table. * * @return array An array of sequences specification for the table. * * @since 12.1 * @throws RuntimeException */ public function getTableSequences($table) { $this->connect(); // To check if table exists and prevent SQL injection $tableList = $this->getTableList(); if (in_array($table, $tableList)) { $name = array( 's.relname', 'n.nspname', 't.relname', 'a.attname', 'info.data_type', 'info.minimum_value', 'info.maximum_value', 'info.increment', 'info.cycle_option' ); $as = array('sequence', 'schema', 'table', 'column', 'data_type', 'minimum_value', 'maximum_value', 'increment', 'cycle_option'); if (version_compare($this->getVersion(), '9.1.0') >= 0) { $name[] .= 'info.start_value'; $as[] .= 'start_value'; } // Get the details columns information. $query = $this->getQuery(true) ->select($this->quoteName($name, $as)) ->from('pg_class AS s') ->join('LEFT', "pg_depend d ON d.objid=s.oid AND d.classid='pg_class'::regclass AND d.refclassid='pg_class'::regclass") ->join('LEFT', 'pg_class t ON t.oid=d.refobjid') ->join('LEFT', 'pg_namespace n ON n.oid=t.relnamespace') ->join('LEFT', 'pg_attribute a ON a.attrelid=t.oid AND a.attnum=d.refobjsubid') ->join('LEFT', 'information_schema.sequences AS info ON info.sequence_name=s.relname') ->where("s.relkind='S' AND d.deptype='a' AND t.relname=" . $this->quote($table)); $this->setQuery($query); $seq = $this->loadObjectList(); return $seq; } return false; } /** * Get the version of the database connector. * * @return string The database connector version. * * @since 12.1 */ public function getVersion() { $this->connect(); $version = pg_version($this->connection); return $version['server']; } /** * Method to get the auto-incremented value from the last INSERT statement. * To be called after the INSERT statement, it's MANDATORY to have a sequence on * every primary key table. * * To get the auto incremented value it's possible to call this function after * INSERT INTO query, or use INSERT INTO with RETURNING clause. * * @example with insertid() call: * $query = $this->getQuery(true) * ->insert('jos_dbtest') * ->columns('title,start_date,description') * ->values("'testTitle2nd','1971-01-01','testDescription2nd'"); * $this->setQuery($query); * $this->execute(); * $id = $this->insertid(); * * @example with RETURNING clause: * $query = $this->getQuery(true) * ->insert('jos_dbtest') * ->columns('title,start_date,description') * ->values("'testTitle2nd','1971-01-01','testDescription2nd'") * ->returning('id'); * $this->setQuery($query); * $id = $this->loadResult(); * * @return integer The value of the auto-increment field from the last inserted row. * * @since 12.1 */ public function insertid() { $this->connect(); $insertQuery = $this->getQuery(false, true); $table = $insertQuery->__get('insert')->getElements(); /* find sequence column name */ $colNameQuery = $this->getQuery(true); $colNameQuery->select('column_default') ->from('information_schema.columns') ->where("table_name=" . $this->quote($this->replacePrefix(str_replace('"', '', $table[0]))), 'AND') ->where("column_default LIKE '%nextval%'"); $this->setQuery($colNameQuery); $colName = $this->loadRow(); $changedColName = str_replace('nextval', 'currval', $colName); $insertidQuery = $this->getQuery(true); $insertidQuery->select($changedColName); $this->setQuery($insertidQuery); $insertVal = $this->loadRow(); return $insertVal[0]; } /** * Locks a table in the database. * * @param string $tableName The name of the table to unlock. * * @return JDatabaseDriverPostgresql Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function lockTable($tableName) { $this->transactionStart(); $this->setQuery('LOCK TABLE ' . $this->quoteName($tableName) . ' IN ACCESS EXCLUSIVE MODE')->execute(); return $this; } /** * Execute the SQL statement. * * @return mixed A database cursor resource on success, boolean false on failure. * * @since 12.1 * @throws RuntimeException */ public function execute() { $this->connect(); if (!is_resource($this->connection)) { JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database'); throw new RuntimeException($this->errorMsg, $this->errorNum); } // Take a local copy so that we don't modify the original query and cause issues later $query = $this->replacePrefix((string) $this->sql); if (!($this->sql instanceof JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) { $query .= ' LIMIT ' . $this->limit . ' OFFSET ' . $this->offset; } // Increment the query counter. $this->count++; // Reset the error values. $this->errorNum = 0; $this->errorMsg = ''; // If debugging is enabled then let's log the query. if ($this->debug) { // Add the query to the object queue. $this->log[] = $query; JLog::add($query, JLog::DEBUG, 'databasequery'); $this->timings[] = microtime(true); } // Execute the query. Error suppression is used here to prevent warnings/notices that the connection has been lost. $this->cursor = @pg_query($this->connection, $query); if ($this->debug) { $this->timings[] = microtime(true); if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) { $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); } else { $this->callStacks[] = debug_backtrace(); } } // If an error occurred handle it. if (!$this->cursor) { // Check if the server was disconnected. if (!$this->connected()) { try { // Attempt to reconnect. $this->connection = null; $this->connect(); } // If connect fails, ignore that exception and throw the normal exception. catch (RuntimeException $e) { // Get the error number and message. $this->errorNum = (int) pg_result_error_field($this->cursor, PGSQL_DIAG_SQLSTATE) . ' '; $this->errorMsg = pg_last_error($this->connection) . "SQL=" . $query; // Throw the normal query exception. JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg); } // Since we were able to reconnect, run the query again. return $this->execute(); } // The server was not disconnected. else { // Get the error number and message. $this->errorNum = (int) pg_result_error_field($this->cursor, PGSQL_DIAG_SQLSTATE) . ' '; $this->errorMsg = pg_last_error($this->connection) . "SQL=" . $query; // Throw the normal query exception. JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg); } } return $this->cursor; } /** * Renames a table in the database. * * @param string $oldTable The name of the table to be renamed * @param string $newTable The new name for the table. * @param string $backup Not used by PostgreSQL. * @param string $prefix Not used by PostgreSQL. * * @return JDatabaseDriverPostgresql Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function renameTable($oldTable, $newTable, $backup = null, $prefix = null) { $this->connect(); // To check if table exists and prevent SQL injection $tableList = $this->getTableList(); // Origin Table does not exist if (!in_array($oldTable, $tableList)) { // Origin Table not found throw new RuntimeException('Table not found in Postgresql database.'); } else { /* Rename indexes */ $this->setQuery( 'SELECT relname FROM pg_class WHERE oid IN ( SELECT indexrelid FROM pg_index, pg_class WHERE pg_class.relname=' . $this->quote($oldTable, true) . ' AND pg_class.oid=pg_index.indrelid );' ); $oldIndexes = $this->loadColumn(); foreach ($oldIndexes as $oldIndex) { $changedIdxName = str_replace($oldTable, $newTable, $oldIndex); $this->setQuery('ALTER INDEX ' . $this->escape($oldIndex) . ' RENAME TO ' . $this->escape($changedIdxName)); $this->execute(); } /* Rename sequence */ $this->setQuery( 'SELECT relname FROM pg_class WHERE relkind = \'S\' AND relnamespace IN ( SELECT oid FROM pg_namespace WHERE nspname NOT LIKE \'pg_%\' AND nspname != \'information_schema\' ) AND relname LIKE \'%' . $oldTable . '%\' ;' ); $oldSequences = $this->loadColumn(); foreach ($oldSequences as $oldSequence) { $changedSequenceName = str_replace($oldTable, $newTable, $oldSequence); $this->setQuery('ALTER SEQUENCE ' . $this->escape($oldSequence) . ' RENAME TO ' . $this->escape($changedSequenceName)); $this->execute(); } /* Rename table */ $this->setQuery('ALTER TABLE ' . $this->escape($oldTable) . ' RENAME TO ' . $this->escape($newTable)); $this->execute(); } return true; } /** * Selects the database, but redundant for PostgreSQL * * @param string $database Database name to select. * * @return boolean Always true * * @since 12.1 */ public function select($database) { return true; } /** * Custom settings for UTF support * * @return integer Zero on success, -1 on failure * * @since 12.1 */ public function setUtf() { $this->connect(); return pg_set_client_encoding($this->connection, 'UTF8'); } /** * This function return a field value as a prepared string to be used in a SQL statement. * * @param array $columns Array of table's column returned by ::getTableColumns. * @param string $field_name The table field's name. * @param string $field_value The variable value to quote and return. * * @return string The quoted string. * * @since 12.1 */ public function sqlValue($columns, $field_name, $field_value) { switch ($columns[$field_name]) { case 'boolean': $val = 'NULL'; if ($field_value == 't') { $val = 'TRUE'; } elseif ($field_value == 'f') { $val = 'FALSE'; } break; case 'bigint': case 'bigserial': case 'integer': case 'money': case 'numeric': case 'real': case 'smallint': case 'serial': case 'numeric,': $val = strlen($field_value) == 0 ? 'NULL' : $field_value; break; case 'date': case 'timestamp without time zone': if (empty($field_value)) { $field_value = $this->getNullDate(); } $val = $this->quote($field_value); break; default: $val = $this->quote($field_value); break; } return $val; } /** * Method to commit a transaction. * * @param boolean $toSavepoint If true, commit to the last savepoint. * * @return void * * @since 12.1 * @throws RuntimeException */ public function transactionCommit($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { if ($this->setQuery('COMMIT')->execute()) { $this->transactionDepth = 0; } return; } $this->transactionDepth--; } /** * Method to roll back a transaction. * * @param boolean $toSavepoint If true, rollback to the last savepoint. * * @return void * * @since 12.1 * @throws RuntimeException */ public function transactionRollback($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth <= 1) { if ($this->setQuery('ROLLBACK')->execute()) { $this->transactionDepth = 0; } return; } $savepoint = 'SP_' . ($this->transactionDepth - 1); $this->setQuery('ROLLBACK TO SAVEPOINT ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth--; $this->setQuery('RELEASE SAVEPOINT ' . $this->quoteName($savepoint))->execute(); } } /** * Method to initialize a transaction. * * @param boolean $asSavepoint If true and a transaction is already active, a savepoint will be created. * * @return void * * @since 12.1 * @throws RuntimeException */ public function transactionStart($asSavepoint = false) { $this->connect(); if (!$asSavepoint || !$this->transactionDepth) { if ($this->setQuery('START TRANSACTION')->execute()) { $this->transactionDepth = 1; } return; } $savepoint = 'SP_' . $this->transactionDepth; $this->setQuery('SAVEPOINT ' . $this->quoteName($savepoint)); if ($this->execute()) { $this->transactionDepth++; } } /** * Method to fetch a row from the result set cursor as an array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchArray($cursor = null) { return pg_fetch_row($cursor ? $cursor : $this->cursor); } /** * Method to fetch a row from the result set cursor as an associative array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchAssoc($cursor = null) { return pg_fetch_assoc($cursor ? $cursor : $this->cursor); } /** * Method to fetch a row from the result set cursor as an object. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * @param string $class The class name to use for the returned row object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchObject($cursor = null, $class = 'stdClass') { return pg_fetch_object(is_null($cursor) ? $this->cursor : $cursor, null, $class); } /** * Method to free up the memory used for the result set. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return void * * @since 12.1 */ protected function freeResult($cursor = null) { pg_free_result($cursor ? $cursor : $this->cursor); } /** * Inserts a row into a table based on an object's properties. * * @param string $table The name of the database table to insert into. * @param object &$object A reference to an object whose public properties match the table fields. * @param string $key The name of the primary key. If provided the object property is updated. * * @return boolean True on success. * * @since 12.1 * @throws RuntimeException */ public function insertObject($table, &$object, $key = null) { $columns = $this->getTableColumns($table); $fields = array(); $values = array(); // Iterate over the object variables to build the query fields and values. foreach (get_object_vars($object) as $k => $v) { // Only process non-null scalars. if (is_array($v) or is_object($v) or $v === null) { continue; } // Ignore any internal fields or primary keys with value 0. if (($k[0] == "_") || ($k == $key && $v === 0)) { continue; } // Prepare and sanitize the fields and values for the database query. $fields[] = $this->quoteName($k); $values[] = $this->sqlValue($columns, $k, $v); } // Create the base insert statement. $query = $this->getQuery(true) ->insert($this->quoteName($table)) ->columns($fields) ->values(implode(',', $values)); $retVal = false; if ($key) { $query->returning($key); // Set the query and execute the insert. $this->setQuery($query); $id = $this->loadResult(); if ($id) { $object->$key = $id; $retVal = true; } } else { // Set the query and execute the insert. $this->setQuery($query); if ($this->execute()) { $retVal = true; } } return $retVal; } /** * Test to see if the PostgreSQL connector is available. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return (function_exists('pg_connect')); } /** * Returns an array containing database's table list. * * @return array The database's table list. * * @since 12.1 */ public function showTables() { $this->connect(); $query = $this->getQuery(true) ->select('table_name') ->from('information_schema.tables') ->where('table_type = ' . $this->quote('BASE TABLE')) ->where('table_schema NOT IN (' . $this->quote('pg_catalog') . ', ' . $this->quote('information_schema') . ' )'); $this->setQuery($query); $tableList = $this->loadColumn(); return $tableList; } /** * Get the substring position inside a string * * @param string $substring The string being sought * @param string $string The string/column being searched * * @return integer The position of $substring in $string * * @since 12.1 */ public function getStringPositionSql( $substring, $string ) { $this->connect(); $query = "SELECT POSITION( $substring IN $string )"; $this->setQuery($query); $position = $this->loadRow(); return $position['position']; } /** * Generate a random value * * @return float The random generated number * * @since 12.1 */ public function getRandom() { $this->connect(); $this->setQuery('SELECT RANDOM()'); $random = $this->loadAssoc(); return $random['random']; } /** * Get the query string to alter the database character set. * * @param string $dbName The database name * * @return string The query that alter the database query string * * @since 12.1 */ public function getAlterDbCharacterSet( $dbName ) { $query = 'ALTER DATABASE ' . $this->quoteName($dbName) . ' SET CLIENT_ENCODING TO ' . $this->quote('UTF8'); return $query; } /** * Get the query string to create new Database in correct PostgreSQL syntax. * * @param object $options object coming from "initialise" function to pass user and database name to database driver. * @param boolean $utf True if the database supports the UTF-8 character set, not used in PostgreSQL "CREATE DATABASE" query. * * @return string The query that creates database, owned by $options['user'] * * @since 12.1 */ public function getCreateDbQuery($options, $utf) { $query = 'CREATE DATABASE ' . $this->quoteName($options->db_name) . ' OWNER ' . $this->quoteName($options->db_user); if ($utf) { $query .= ' ENCODING ' . $this->quote('UTF-8'); } return $query; } /** * This function replaces a string identifier <var>$prefix</var> with the string held is the * <var>tablePrefix</var> class variable. * * @param string $query The SQL statement to prepare. * @param string $prefix The common table prefix. * * @return string The processed SQL statement. * * @since 12.1 */ public function replacePrefix($query, $prefix = '#__') { $query = trim($query); if (strpos($query, '\'')) { // Sequence name quoted with ' ' but need to be replaced if (strpos($query, 'currval')) { $query = explode('currval', $query); for ($nIndex = 1; $nIndex < count($query); $nIndex = $nIndex + 2) { $query[$nIndex] = str_replace($prefix, $this->tablePrefix, $query[$nIndex]); } $query = implode('currval', $query); } // Sequence name quoted with ' ' but need to be replaced if (strpos($query, 'nextval')) { $query = explode('nextval', $query); for ($nIndex = 1; $nIndex < count($query); $nIndex = $nIndex + 2) { $query[$nIndex] = str_replace($prefix, $this->tablePrefix, $query[$nIndex]); } $query = implode('nextval', $query); } // Sequence name quoted with ' ' but need to be replaced if (strpos($query, 'setval')) { $query = explode('setval', $query); for ($nIndex = 1; $nIndex < count($query); $nIndex = $nIndex + 2) { $query[$nIndex] = str_replace($prefix, $this->tablePrefix, $query[$nIndex]); } $query = implode('setval', $query); } $explodedQuery = explode('\'', $query); for ($nIndex = 0; $nIndex < count($explodedQuery); $nIndex = $nIndex + 2) { if (strpos($explodedQuery[$nIndex], $prefix)) { $explodedQuery[$nIndex] = str_replace($prefix, $this->tablePrefix, $explodedQuery[$nIndex]); } } $replacedQuery = implode('\'', $explodedQuery); } else { $replacedQuery = str_replace($prefix, $this->tablePrefix, $query); } return $replacedQuery; } /** * Method to release a savepoint. * * @param string $savepointName Savepoint's name to release * * @return void * * @since 12.1 */ public function releaseTransactionSavepoint( $savepointName ) { $this->connect(); $this->setQuery('RELEASE SAVEPOINT ' . $this->quoteName($this->escape($savepointName))); $this->execute(); } /** * Method to create a savepoint. * * @param string $savepointName Savepoint's name to create * * @return void * * @since 12.1 */ public function transactionSavepoint( $savepointName ) { $this->connect(); $this->setQuery('SAVEPOINT ' . $this->quoteName($this->escape($savepointName))); $this->execute(); } /** * Unlocks tables in the database, this command does not exist in PostgreSQL, * it is automatically done on commit or rollback. * * @return JDatabaseDriverPostgresql Returns this object to support chaining. * * @since 12.1 * @throws RuntimeException */ public function unlockTables() { $this->transactionCommit(); return $this; } /** * Updates a row in a table based on an object's properties. * * @param string $table The name of the database table to update. * @param object &$object A reference to an object whose public properties match the table fields. * @param array $key The name of the primary key. * @param boolean $nulls True to update null fields or false to ignore them. * * @return boolean True on success. * * @since 12.1 * @throws RuntimeException */ public function updateObject($table, &$object, $key, $nulls = false) { $columns = $this->getTableColumns($table); $fields = array(); $where = array(); if (is_string($key)) { $key = array($key); } if (is_object($key)) { $key = (array) $key; } // Create the base update statement. $statement = 'UPDATE ' . $this->quoteName($table) . ' SET %s WHERE %s'; // Iterate over the object variables to build the query fields/value pairs. foreach (get_object_vars($object) as $k => $v) { // Only process scalars that are not internal fields. if (is_array($v) or is_object($v) or $k[0] == '_') { continue; } // Set the primary key to the WHERE clause instead of a field to update. if (in_array($k, $key)) { $key_val = $this->sqlValue($columns, $k, $v); $where[] = $this->quoteName($k) . '=' . $key_val; continue; } // Prepare and sanitize the fields and values for the database query. if ($v === null) { // If the value is null and we want to update nulls then set it. if ($nulls) { $val = 'NULL'; } // If the value is null and we do not want to update nulls then ignore this field. else { continue; } } // The field is not null so we prep it for update. else { $val = $this->sqlValue($columns, $k, $v); } // Add the field to be updated. $fields[] = $this->quoteName($k) . '=' . $val; } // We don't have any fields to update. if (empty($fields)) { return true; } // Set the query and execute the update. $this->setQuery(sprintf($statement, implode(",", $fields), implode(' AND ', $where))); return $this->execute(); } } PK���\g�C��c�c(libraries/joomla/database/driver/pdo.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform PDO Database Driver Class * * @see http://php.net/pdo * @since 12.1 */ abstract class JDatabaseDriverPdo extends JDatabaseDriver { /** * The name of the database driver. * * @var string * @since 12.1 */ public $name = 'pdo'; /** * The character(s) used to quote SQL statement names such as table names or field names, * etc. The child classes should define this as necessary. If a single character string the * same character is used for both sides of the quoted name, else the first character will be * used for the opening quote and the second for the closing quote. * * @var string * @since 12.1 */ protected $nameQuote = "'"; /** * The null or zero representation of a timestamp for the database driver. This should be * defined in child classes to hold the appropriate value for the engine. * * @var string * @since 12.1 */ protected $nullDate = '0000-00-00 00:00:00'; /** * @var resource The prepared statement. * @since 12.1 */ protected $prepared; /** * Contains the current query execution status * * @var array * @since 12.1 */ protected $executed = false; /** * Constructor. * * @param array $options List of options used to configure the connection * * @since 12.1 */ public function __construct($options) { // Get some basic values from the options. $options['driver'] = (isset($options['driver'])) ? $options['driver'] : 'odbc'; $options['dsn'] = (isset($options['dsn'])) ? $options['dsn'] : ''; $options['host'] = (isset($options['host'])) ? $options['host'] : 'localhost'; $options['database'] = (isset($options['database'])) ? $options['database'] : ''; $options['user'] = (isset($options['user'])) ? $options['user'] : ''; $options['password'] = (isset($options['password'])) ? $options['password'] : ''; $options['driverOptions'] = (isset($options['driverOptions'])) ? $options['driverOptions'] : array(); // Finalize initialisation parent::__construct($options); } /** * Destructor. * * @since 12.1 */ public function __destruct() { $this->disconnect(); } /** * Connects to the database if needed. * * @return void Returns void if the database connected successfully. * * @since 12.1 * @throws RuntimeException */ public function connect() { if ($this->connection) { return; } // Make sure the PDO extension for PHP is installed and enabled. if (!self::isSupported()) { throw new RuntimeException('PDO Extension is not available.', 1); } $replace = array(); $with = array(); // Find the correct PDO DSN Format to use: switch ($this->options['driver']) { case 'cubrid': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 33000; $format = 'cubrid:host=#HOST#;port=#PORT#;dbname=#DBNAME#'; $replace = array('#HOST#', '#PORT#', '#DBNAME#'); $with = array($this->options['host'], $this->options['port'], $this->options['database']); break; case 'dblib': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 1433; $format = 'dblib:host=#HOST#;port=#PORT#;dbname=#DBNAME#'; $replace = array('#HOST#', '#PORT#', '#DBNAME#'); $with = array($this->options['host'], $this->options['port'], $this->options['database']); break; case 'firebird': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 3050; $format = 'firebird:dbname=#DBNAME#'; $replace = array('#DBNAME#'); $with = array($this->options['database']); break; case 'ibm': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 56789; if (!empty($this->options['dsn'])) { $format = 'ibm:DSN=#DSN#'; $replace = array('#DSN#'); $with = array($this->options['dsn']); } else { $format = 'ibm:hostname=#HOST#;port=#PORT#;database=#DBNAME#'; $replace = array('#HOST#', '#PORT#', '#DBNAME#'); $with = array($this->options['host'], $this->options['port'], $this->options['database']); } break; case 'informix': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 1526; $this->options['protocol'] = (isset($this->options['protocol'])) ? $this->options['protocol'] : 'onsoctcp'; if (!empty($this->options['dsn'])) { $format = 'informix:DSN=#DSN#'; $replace = array('#DSN#'); $with = array($this->options['dsn']); } else { $format = 'informix:host=#HOST#;service=#PORT#;database=#DBNAME#;server=#SERVER#;protocol=#PROTOCOL#'; $replace = array('#HOST#', '#PORT#', '#DBNAME#', '#SERVER#', '#PROTOCOL#'); $with = array($this->options['host'], $this->options['port'], $this->options['database'], $this->options['server'], $this->options['protocol']); } break; case 'mssql': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 1433; $format = 'mssql:host=#HOST#;port=#PORT#;dbname=#DBNAME#'; $replace = array('#HOST#', '#PORT#', '#DBNAME#'); $with = array($this->options['host'], $this->options['port'], $this->options['database']); break; // The pdomysql case is a special case within the CMS environment case 'pdomysql': case 'mysql': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 3306; $format = 'mysql:host=#HOST#;port=#PORT#;dbname=#DBNAME#;charset=#CHARSET#'; $replace = array('#HOST#', '#PORT#', '#DBNAME#', '#CHARSET#'); $with = array($this->options['host'], $this->options['port'], $this->options['database'], $this->options['charset']); break; case 'oci': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 1521; $this->options['charset'] = (isset($this->options['charset'])) ? $this->options['charset'] : 'AL32UTF8'; if (!empty($this->options['dsn'])) { $format = 'oci:dbname=#DSN#'; $replace = array('#DSN#'); $with = array($this->options['dsn']); } else { $format = 'oci:dbname=//#HOST#:#PORT#/#DBNAME#'; $replace = array('#HOST#', '#PORT#', '#DBNAME#'); $with = array($this->options['host'], $this->options['port'], $this->options['database']); } $format .= ';charset=' . $this->options['charset']; break; case 'odbc': $format = 'odbc:DSN=#DSN#;UID:#USER#;PWD=#PASSWORD#'; $replace = array('#DSN#', '#USER#', '#PASSWORD#'); $with = array($this->options['dsn'], $this->options['user'], $this->options['password']); break; case 'pgsql': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 5432; $format = 'pgsql:host=#HOST#;port=#PORT#;dbname=#DBNAME#'; $replace = array('#HOST#', '#PORT#', '#DBNAME#'); $with = array($this->options['host'], $this->options['port'], $this->options['database']); break; case 'sqlite': if (isset($this->options['version']) && $this->options['version'] == 2) { $format = 'sqlite2:#DBNAME#'; } else { $format = 'sqlite:#DBNAME#'; } $replace = array('#DBNAME#'); $with = array($this->options['database']); break; case 'sybase': $this->options['port'] = (isset($this->options['port'])) ? $this->options['port'] : 1433; $format = 'mssql:host=#HOST#;port=#PORT#;dbname=#DBNAME#'; $replace = array('#HOST#', '#PORT#', '#DBNAME#'); $with = array($this->options['host'], $this->options['port'], $this->options['database']); break; } // Create the connection string: $connectionString = str_replace($replace, $with, $format); try { $this->connection = new PDO( $connectionString, $this->options['user'], $this->options['password'], $this->options['driverOptions'] ); } catch (PDOException $e) { throw new RuntimeException('Could not connect to PDO: ' . $e->getMessage(), 2, $e); } } /** * Disconnects the database. * * @return void * * @since 12.1 */ public function disconnect() { foreach ($this->disconnectHandlers as $h) { call_user_func_array($h, array( &$this)); } $this->freeResult(); unset($this->connection); } /** * Method to escape a string for usage in an SQL statement. * * Oracle escaping reference: * http://www.orafaq.com/wiki/SQL_FAQ#How_does_one_escape_special_characters_when_writing_SQL_queries.3F * * SQLite escaping notes: * http://www.sqlite.org/faq.html#q14 * * Method body is as implemented by the Zend Framework * * Note: Using query objects with bound variables is * preferable to the below. * * @param string $text The string to be escaped. * @param boolean $extra Unused optional parameter to provide extra escaping. * * @return string The escaped string. * * @since 12.1 */ public function escape($text, $extra = false) { if (is_int($text) || is_float($text)) { return $text; } $text = str_replace("'", "''", $text); return addcslashes($text, "\000\n\r\\\032"); } /** * Execute the SQL statement. * * @return mixed A database cursor resource on success, boolean false on failure. * * @since 12.1 * @throws RuntimeException * @throws Exception */ public function execute() { $this->connect(); if (!is_object($this->connection)) { JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database'); throw new RuntimeException($this->errorMsg, $this->errorNum); } // Take a local copy so that we don't modify the original query and cause issues later $query = $this->replacePrefix((string) $this->sql); if (!($this->sql instanceof JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) { // @TODO $query .= ' LIMIT ' . $this->offset . ', ' . $this->limit; } // Increment the query counter. $this->count++; // Reset the error values. $this->errorNum = 0; $this->errorMsg = ''; // If debugging is enabled then let's log the query. if ($this->debug) { // Add the query to the object queue. $this->log[] = $query; JLog::add($query, JLog::DEBUG, 'databasequery'); $this->timings[] = microtime(true); } // Execute the query. $this->executed = false; if ($this->prepared instanceof PDOStatement) { // Bind the variables: if ($this->sql instanceof JDatabaseQueryPreparable) { $bounded = $this->sql->getBounded(); foreach ($bounded as $key => $obj) { $this->prepared->bindParam($key, $obj->value, $obj->dataType, $obj->length, $obj->driverOptions); } } $this->executed = $this->prepared->execute(); } if ($this->debug) { $this->timings[] = microtime(true); if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) { $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); } else { $this->callStacks[] = debug_backtrace(); } } // If an error occurred handle it. if (!$this->executed) { // Get the error number and message before we execute any more queries. $errorNum = (int) $this->connection->errorCode(); $errorMsg = (string) 'SQL: ' . implode(", ", $this->connection->errorInfo()); // Check if the server was disconnected. if (!$this->connected()) { try { // Attempt to reconnect. $this->connection = null; $this->connect(); } // If connect fails, ignore that exception and throw the normal exception. catch (RuntimeException $e) { // Get the error number and message. $this->errorNum = (int) $this->connection->errorCode(); $this->errorMsg = (string) 'SQL: ' . implode(", ", $this->connection->errorInfo()); // Throw the normal query exception. JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg, $this->errorNum); } // Since we were able to reconnect, run the query again. return $this->execute(); } // The server was not disconnected. else { // Get the error number and message from before we tried to reconnect. $this->errorNum = $errorNum; $this->errorMsg = $errorMsg; // Throw the normal query exception. JLog::add(JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg), JLog::ERROR, 'database-error'); throw new RuntimeException($this->errorMsg, $this->errorNum); } } return $this->prepared; } /** * Retrieve a PDO database connection attribute * http://www.php.net/manual/en/pdo.getattribute.php * * Usage: $db->getOption(PDO::ATTR_CASE); * * @param mixed $key One of the PDO::ATTR_* Constants * * @return mixed * * @since 12.1 */ public function getOption($key) { $this->connect(); return $this->connection->getAttribute($key); } /** * Get a query to run and verify the database is operational. * * @return string The query to check the health of the DB. * * @since 12.2 */ public function getConnectedQuery() { return 'SELECT 1'; } /** * Sets an attribute on the PDO database handle. * http://www.php.net/manual/en/pdo.setattribute.php * * Usage: $db->setOption(PDO::ATTR_CASE, PDO::CASE_UPPER); * * @param integer $key One of the PDO::ATTR_* Constants * @param mixed $value One of the associated PDO Constants * related to the particular attribute * key. * * @return boolean * * @since 12.1 */ public function setOption($key, $value) { $this->connect(); return $this->connection->setAttribute($key, $value); } /** * Test to see if the PDO extension is available. * Override as needed to check for specific PDO Drivers. * * @return boolean True on success, false otherwise. * * @since 12.1 */ public static function isSupported() { return defined('PDO::ATTR_DRIVER_NAME'); } /** * Determines if the connection to the server is active. * * @return boolean True if connected to the database engine. * * @since 12.1 */ public function connected() { // Flag to prevent recursion into this function. static $checkingConnected = false; if ($checkingConnected) { // Reset this flag and throw an exception. $checkingConnected = true; die('Recursion trying to check if connected.'); } // Backup the query state. $query = $this->sql; $limit = $this->limit; $offset = $this->offset; $prepared = $this->prepared; try { // Set the checking connection flag. $checkingConnected = true; // Run a simple query to check the connection. $this->setQuery($this->getConnectedQuery()); $status = (bool) $this->loadResult(); } // If we catch an exception here, we must not be connected. catch (Exception $e) { $status = false; } // Restore the query state. $this->sql = $query; $this->limit = $limit; $this->offset = $offset; $this->prepared = $prepared; $checkingConnected = false; return $status; } /** * Get the number of affected rows for the previous executed SQL statement. * Only applicable for DELETE, INSERT, or UPDATE statements. * * @return integer The number of affected rows. * * @since 12.1 */ public function getAffectedRows() { $this->connect(); if ($this->prepared instanceof PDOStatement) { return $this->prepared->rowCount(); } else { return 0; } } /** * Get the number of returned rows for the previous executed SQL statement. * * @param resource $cursor An optional database cursor resource to extract the row count from. * * @return integer The number of returned rows. * * @since 12.1 */ public function getNumRows($cursor = null) { $this->connect(); if ($cursor instanceof PDOStatement) { return $cursor->rowCount(); } elseif ($this->prepared instanceof PDOStatement) { return $this->prepared->rowCount(); } else { return 0; } } /** * Method to get the auto-incremented value from the last INSERT statement. * * @return string The value of the auto-increment field from the last inserted row. * * @since 12.1 */ public function insertid() { $this->connect(); // Error suppress this to prevent PDO warning us that the driver doesn't support this operation. return @$this->connection->lastInsertId(); } /** * Select a database for use. * * @param string $database The name of the database to select for use. * * @return boolean True if the database was successfully selected. * * @since 12.1 * @throws RuntimeException */ public function select($database) { $this->connect(); return true; } /** * Sets the SQL statement string for later execution. * * @param mixed $query The SQL statement to set either as a JDatabaseQuery object or a string. * @param integer $offset The affected row offset to set. * @param integer $limit The maximum affected rows to set. * @param array $driverOptions The optional PDO driver options. * * @return JDatabaseDriver This object to support method chaining. * * @since 12.1 */ public function setQuery($query, $offset = null, $limit = null, $driverOptions = array()) { $this->connect(); $this->freeResult(); if (is_string($query)) { // Allows taking advantage of bound variables in a direct query: $query = $this->getQuery(true)->setQuery($query); } if ($query instanceof JDatabaseQueryLimitable && !is_null($offset) && !is_null($limit)) { $query = $query->processLimit($query, $limit, $offset); } // Create a stringified version of the query (with prefixes replaced): $sql = $this->replacePrefix((string) $query); // Use the stringified version in the prepare call: $this->prepared = $this->connection->prepare($sql, $driverOptions); // Store reference to the original JDatabaseQuery instance within the class. // This is important since binding variables depends on it within execute(): parent::setQuery($query, $offset, $limit); return $this; } /** * Set the connection to use UTF-8 character encoding. * * @return boolean True on success. * * @since 12.1 */ public function setUtf() { return false; } /** * Method to commit a transaction. * * @param boolean $toSavepoint If true, commit to the last savepoint. * * @return void * * @since 12.1 * @throws RuntimeException */ public function transactionCommit($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth == 1) { $this->connection->commit(); } $this->transactionDepth--; } /** * Method to roll back a transaction. * * @param boolean $toSavepoint If true, rollback to the last savepoint. * * @return void * * @since 12.1 * @throws RuntimeException */ public function transactionRollback($toSavepoint = false) { $this->connect(); if (!$toSavepoint || $this->transactionDepth == 1) { $this->connection->rollBack(); } $this->transactionDepth--; } /** * Method to initialize a transaction. * * @param boolean $asSavepoint If true and a transaction is already active, a savepoint will be created. * * @return void * * @since 12.1 * @throws RuntimeException */ public function transactionStart($asSavepoint = false) { $this->connect(); if (!$asSavepoint || !$this->transactionDepth) { $this->connection->beginTransaction(); } $this->transactionDepth++; } /** * Method to fetch a row from the result set cursor as an array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchArray($cursor = null) { if (!empty($cursor) && $cursor instanceof PDOStatement) { return $cursor->fetch(PDO::FETCH_NUM); } if ($this->prepared instanceof PDOStatement) { return $this->prepared->fetch(PDO::FETCH_NUM); } } /** * Method to fetch a row from the result set cursor as an associative array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchAssoc($cursor = null) { if (!empty($cursor) && $cursor instanceof PDOStatement) { return $cursor->fetch(PDO::FETCH_ASSOC); } if ($this->prepared instanceof PDOStatement) { return $this->prepared->fetch(PDO::FETCH_ASSOC); } } /** * Method to fetch a row from the result set cursor as an object. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * @param string $class Unused, only necessary so method signature will be the same as parent. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ protected function fetchObject($cursor = null, $class = 'stdClass') { if (!empty($cursor) && $cursor instanceof PDOStatement) { return $cursor->fetchObject($class); } if ($this->prepared instanceof PDOStatement) { return $this->prepared->fetchObject($class); } } /** * Method to free up the memory used for the result set. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return void * * @since 12.1 */ protected function freeResult($cursor = null) { $this->executed = false; if ($cursor instanceof PDOStatement) { $cursor->closeCursor(); $cursor = null; } if ($this->prepared instanceof PDOStatement) { $this->prepared->closeCursor(); $this->prepared = null; } } /** * Method to get the next row in the result set from the database query as an object. * * @param string $class The class name to use for the returned row object. * * @return mixed The result of the query as an array, false if there are no more rows. * * @since 12.1 * @throws RuntimeException * @deprecated 4.0 (CMS) Use getIterator() instead */ public function loadNextObject($class = 'stdClass') { JLog::add(__METHOD__ . '() is deprecated. Use JDatabaseDriver::getIterator() instead.', JLog::WARNING, 'deprecated'); $this->connect(); // Execute the query and get the result set cursor. if (!$this->executed) { if (!($this->execute())) { return $this->errorNum ? null : false; } } // Get the next row from the result set as an object of type $class. if ($row = $this->fetchObject(null, $class)) { return $row; } // Free up system resources and return. $this->freeResult(); return false; } /** * Method to get the next row in the result set from the database query as an array. * * @return mixed The result of the query as an array, false if there are no more rows. * * @since 12.1 * @throws RuntimeException */ public function loadNextAssoc() { $this->connect(); // Execute the query and get the result set cursor. if (!$this->executed) { if (!($this->execute())) { return $this->errorNum ? null : false; } } // Get the next row from the result set as an object of type $class. if ($row = $this->fetchAssoc()) { return $row; } // Free up system resources and return. $this->freeResult(); return false; } /** * Method to get the next row in the result set from the database query as an array. * * @return mixed The result of the query as an array, false if there are no more rows. * * @since 12.1 * @throws RuntimeException * @deprecated 4.0 (CMS) Use getIterator() instead */ public function loadNextRow() { JLog::add(__METHOD__ . '() is deprecated. Use JDatabaseDriver::getIterator() instead.', JLog::WARNING, 'deprecated'); $this->connect(); // Execute the query and get the result set cursor. if (!$this->executed) { if (!($this->execute())) { return $this->errorNum ? null : false; } } // Get the next row from the result set as an object of type $class. if ($row = $this->fetchArray()) { return $row; } // Free up system resources and return. $this->freeResult(); return false; } /** * PDO does not support serialize * * @return array * * @since 12.3 */ public function __sleep() { $serializedProperties = array(); $reflect = new ReflectionClass($this); // Get properties of the current class $properties = $reflect->getProperties(); foreach ($properties as $property) { // Do not serialize properties that are PDO if ($property->isStatic() == false && !($this->{$property->name} instanceof PDO)) { array_push($serializedProperties, $property->name); } } return $serializedProperties; } /** * Wake up after serialization * * @return array * * @since 12.3 */ public function __wakeup() { // Get connection back $this->__construct($this->options); } } PK���\֚��&libraries/joomla/database/iterator.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Database Driver Class * * @since 12.1 */ abstract class JDatabaseIterator implements Countable, Iterator { /** * The database cursor. * * @var mixed * @since 12.1 */ protected $cursor; /** * The class of object to create. * * @var string * @since 12.1 */ protected $class; /** * The name of the column to use for the key of the database record. * * @var mixed * @since 12.1 */ private $_column; /** * The current database record. * * @var mixed * @since 12.1 */ private $_current; /** * A numeric or string key for the current database record. * * @var scalar * @since 12.1 */ private $_key; /** * The number of fetched records. * * @var integer * @since 12.1 */ private $_fetched = 0; /** * Database iterator constructor. * * @param mixed $cursor The database cursor. * @param string $column An option column to use as the iterator key. * @param string $class The class of object that is returned. * * @throws InvalidArgumentException */ public function __construct($cursor, $column = null, $class = 'stdClass') { if (!class_exists($class)) { throw new InvalidArgumentException(sprintf('new %s(*%s*, cursor)', get_class($this), gettype($class))); } $this->cursor = $cursor; $this->class = $class; $this->_column = $column; $this->_fetched = 0; $this->next(); } /** * Database iterator destructor. * * @since 12.1 */ public function __destruct() { if ($this->cursor) { $this->freeResult($this->cursor); } } /** * The current element in the iterator. * * @return object * * @see Iterator::current() * @since 12.1 */ public function current() { return $this->_current; } /** * The key of the current element in the iterator. * * @return scalar * * @see Iterator::key() * @since 12.1 */ public function key() { return $this->_key; } /** * Moves forward to the next result from the SQL query. * * @return void * * @see Iterator::next() * @since 12.1 */ public function next() { // Set the default key as being the number of fetched object $this->_key = $this->_fetched; // Try to get an object $this->_current = $this->fetchObject(); // If an object has been found if ($this->_current) { // Set the key as being the indexed column (if it exists) if (isset($this->_current->{$this->_column})) { $this->_key = $this->_current->{$this->_column}; } // Update the number of fetched object $this->_fetched++; } } /** * Rewinds the iterator. * * This iterator cannot be rewound. * * @return void * * @see Iterator::rewind() * @since 12.1 */ public function rewind() { } /** * Checks if the current position of the iterator is valid. * * @return boolean * * @see Iterator::valid() * @since 12.1 */ public function valid() { return (boolean) $this->_current; } /** * Method to fetch a row from the result set cursor as an object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 12.1 */ abstract protected function fetchObject(); /** * Method to free up the memory used for the result set. * * @return void * * @since 12.1 */ abstract protected function freeResult(); } PK���\ۣ�� &libraries/joomla/database/importer.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Database Importer Class * * @since 12.1 */ abstract class JDatabaseImporter { /** * @var array An array of cached data. * @since 13.1 */ protected $cache = array(); /** * The database connector to use for exporting structure and/or data. * * @var JDatabaseDriver * @since 13.1 */ protected $db = null; /** * The input source. * * @var mixed * @since 13.1 */ protected $from = array(); /** * The type of input format (XML). * * @var string * @since 13.1 */ protected $asFormat = 'xml'; /** * An array of options for the exporter. * * @var object * @since 13.1 */ protected $options = null; /** * Constructor. * * Sets up the default options for the exporter. * * @since 13.1 */ public function __construct() { $this->options = new stdClass; $this->cache = array('columns' => array(), 'keys' => array()); // Set up the class defaults: // Import with only structure $this->withStructure(); // Export as XML. $this->asXml(); // Default destination is a string using $output = (string) $exporter; } /** * Set the output option for the exporter to XML format. * * @return JDatabaseImporter Method supports chaining. * * @since 13.1 */ public function asXml() { $this->asFormat = 'xml'; return $this; } /** * Checks if all data and options are in order prior to exporting. * * @return JDatabaseImporter Method supports chaining. * * @since 13.1 * @throws Exception if an error is encountered. */ abstract public function check(); /** * Specifies the data source to import. * * @param mixed $from The data source to import. * * @return JDatabaseImporter Method supports chaining. * * @since 13.1 */ public function from($from) { $this->from = $from; return $this; } /** * Get the SQL syntax to drop a column. * * @param string $table The table name. * @param string $name The name of the field to drop. * * @return string * * @since 13.1 */ protected function getDropColumnSql($table, $name) { return 'ALTER TABLE ' . $this->db->quoteName($table) . ' DROP COLUMN ' . $this->db->quoteName($name); } /** * Get the real name of the table, converting the prefix wildcard string if present. * * @param string $table The name of the table. * * @return string The real name of the table. * * @since 13.1 */ protected function getRealTableName($table) { $prefix = $this->db->getPrefix(); // Replace the magic prefix if found. $table = preg_replace('|^#__|', $prefix, $table); return $table; } /** * Merges the incoming structure definition with the existing structure. * * @return void * * @note Currently only supports XML format. * @since 13.1 * @throws RuntimeException on error. */ public function mergeStructure() { $prefix = $this->db->getPrefix(); $tables = $this->db->getTableList(); if ($this->from instanceof SimpleXMLElement) { $xml = $this->from; } else { $xml = new SimpleXMLElement($this->from); } // Get all the table definitions. $xmlTables = $xml->xpath('database/table_structure'); foreach ($xmlTables as $table) { // Convert the magic prefix into the real table name. $tableName = (string) $table['name']; $tableName = preg_replace('|^#__|', $prefix, $tableName); if (in_array($tableName, $tables)) { // The table already exists. Now check if there is any difference. if ($queries = $this->getAlterTableSql($xml->database->table_structure)) { // Run the queries to upgrade the data structure. foreach ($queries as $query) { $this->db->setQuery((string) $query); try { $this->db->execute(); } catch (RuntimeException $e) { throw $e; } } } } else { // This is a new table. $sql = $this->xmlToCreate($table); $this->db->setQuery((string) $sql); try { $this->db->execute(); } catch (RuntimeException $e) { throw $e; } } } } /** * Sets the database connector to use for exporting structure and/or data. * * @param JDatabaseDriver $db The database connector. * * @return JDatabaseImporter Method supports chaining. * * @since 13.1 */ public function setDbo(JDatabaseDriver $db) { $this->db = $db; return $this; } /** * Sets an internal option to merge the structure based on the input data. * * @param boolean $setting True to export the structure, false to not. * * @return JDatabaseImporter Method supports chaining. * * @since 13.1 */ public function withStructure($setting = true) { $this->options->withStructure = (boolean) $setting; return $this; } } PK���\��^�%libraries/joomla/database/factory.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Database Factory class * * @since 12.1 */ class JDatabaseFactory { /** * Contains the current JDatabaseFactory instance * * @var JDatabaseFactory * @since 12.1 */ private static $_instance = null; /** * Method to return a JDatabaseDriver instance based on the given options. There are three global options and then * the rest are specific to the database driver. The 'database' option determines which database is to * be used for the connection. The 'select' option determines whether the connector should automatically select * the chosen database. * * Instances are unique to the given options and new objects are only created when a unique options array is * passed into the method. This ensures that we don't end up with unnecessary database connection resources. * * @param string $name Name of the database driver you'd like to instantiate * @param array $options Parameters to be passed to the database driver. * * @return JDatabaseDriver A database driver object. * * @since 12.1 * @throws RuntimeException */ public function getDriver($name = 'mysqli', $options = array()) { // Sanitize the database connector options. $options['driver'] = preg_replace('/[^A-Z0-9_\.-]/i', '', $name); $options['database'] = (isset($options['database'])) ? $options['database'] : null; $options['select'] = (isset($options['select'])) ? $options['select'] : true; // Derive the class name from the driver. $class = 'JDatabaseDriver' . ucfirst(strtolower($options['driver'])); // If the class still doesn't exist we have nothing left to do but throw an exception. We did our best. if (!class_exists($class)) { throw new RuntimeException(sprintf('Unable to load Database Driver: %s', $options['driver'])); } // Create our new JDatabaseDriver connector based on the options given. try { $instance = new $class($options); } catch (RuntimeException $e) { throw new RuntimeException(sprintf('Unable to connect to the Database: %s', $e->getMessage())); } return $instance; } /** * Gets an exporter class object. * * @param string $name Name of the driver you want an exporter for. * @param JDatabaseDriver $db Optional JDatabaseDriver instance * * @return JDatabaseExporter An exporter object. * * @since 12.1 * @throws RuntimeException */ public function getExporter($name, JDatabaseDriver $db = null) { // Derive the class name from the driver. $class = 'JDatabaseExporter' . ucfirst(strtolower($name)); // Make sure we have an exporter class for this driver. if (!class_exists($class)) { // If it doesn't exist we are at an impasse so throw an exception. throw new RuntimeException('Database Exporter not found.'); } $o = new $class; if ($db instanceof JDatabaseDriver) { $o->setDbo($db); } return $o; } /** * Gets an importer class object. * * @param string $name Name of the driver you want an importer for. * @param JDatabaseDriver $db Optional JDatabaseDriver instance * * @return JDatabaseImporter An importer object. * * @since 12.1 * @throws RuntimeException */ public function getImporter($name, JDatabaseDriver $db = null) { // Derive the class name from the driver. $class = 'JDatabaseImporter' . ucfirst(strtolower($name)); // Make sure we have an importer class for this driver. if (!class_exists($class)) { // If it doesn't exist we are at an impasse so throw an exception. throw new RuntimeException('Database importer not found.'); } $o = new $class; if ($db instanceof JDatabaseDriver) { $o->setDbo($db); } return $o; } /** * Gets an instance of the factory object. * * @return JDatabaseFactory * * @since 12.1 */ public static function getInstance() { return self::$_instance ? self::$_instance : new JDatabaseFactory; } /** * Get the current query object or a new JDatabaseQuery object. * * @param string $name Name of the driver you want an query object for. * @param JDatabaseDriver $db Optional JDatabaseDriver instance * * @return JDatabaseQuery The current query object or a new object extending the JDatabaseQuery class. * * @since 12.1 * @throws RuntimeException */ public function getQuery($name, JDatabaseDriver $db = null) { // Derive the class name from the driver. $class = 'JDatabaseQuery' . ucfirst(strtolower($name)); // Make sure we have a query class for this driver. if (!class_exists($class)) { // If it doesn't exist we are at an impasse so throw an exception. throw new RuntimeException('Database Query class not found'); } return new $class($db); } /** * Gets an instance of a factory object to return on subsequent calls of getInstance. * * @param JDatabaseFactory $instance A JDatabaseFactory object. * * @return void * * @since 12.1 */ public static function setInstance(JDatabaseFactory $instance = null) { self::$_instance = $instance; } } PK���\z�*���&libraries/joomla/database/database.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Database connector class. * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) */ abstract class JDatabase { /** * Execute the SQL statement. * * @return mixed A database cursor resource on success, boolean false on failure. * * @since 11.1 * @throws RuntimeException * @deprecated 13.1 (Platform) & 4.0 (CMS) */ public function query() { JLog::add('JDatabase::query() is deprecated, use JDatabaseDriver::execute() instead.', JLog::WARNING, 'deprecated'); return $this->execute(); } /** * Get a list of available database connectors. The list will only be populated with connectors that both * the class exists and the static test method returns true. This gives us the ability to have a multitude * of connector classes that are self-aware as to whether or not they are able to be used on a given system. * * @return array An array of available database connectors. * * @since 11.1 * @deprecated 13.1 (Platform) & 4.0 (CMS) */ public static function getConnectors() { JLog::add('JDatabase::getConnectors() is deprecated, use JDatabaseDriver::getConnectors() instead.', JLog::WARNING, 'deprecated'); return JDatabaseDriver::getConnectors(); } /** * Gets the error message from the database connection. * * @param boolean $escaped True to escape the message string for use in JavaScript. * * @return string The error message for the most recent query. * * @deprecated 13.3 (Platform) & 4.0 (CMS) * @since 11.1 */ public function getErrorMsg($escaped = false) { JLog::add('JDatabase::getErrorMsg() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated'); if ($escaped) { return addslashes($this->errorMsg); } else { return $this->errorMsg; } } /** * Gets the error number from the database connection. * * @return integer The error number for the most recent query. * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) */ public function getErrorNum() { JLog::add('JDatabase::getErrorNum() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated'); return $this->errorNum; } /** * Method to return a JDatabaseDriver instance based on the given options. There are three global options and then * the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is * used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to * be used for the connection. The 'select' option determines whether the connector should automatically select * the chosen database. * * Instances are unique to the given options and new objects are only created when a unique options array is * passed into the method. This ensures that we don't end up with unnecessary database connection resources. * * @param array $options Parameters to be passed to the database driver. * * @return JDatabaseDriver A database object. * * @since 11.1 * @deprecated 13.1 (Platform) & 4.0 (CMS) */ public static function getInstance($options = array()) { JLog::add('JDatabase::getInstance() is deprecated, use JDatabaseDriver::getInstance() instead.', JLog::WARNING, 'deprecated'); return JDatabaseDriver::getInstance($options); } /** * Splits a string of multiple queries into an array of individual queries. * * @param string $query Input SQL string with which to split into individual queries. * * @return array The queries from the input string separated into an array. * * @since 11.1 * @deprecated 13.1 (Platform) & 4.0 (CMS) */ public static function splitSql($query) { JLog::add('JDatabase::splitSql() is deprecated, use JDatabaseDriver::splitSql() instead.', JLog::WARNING, 'deprecated'); return JDatabaseDriver::splitSql($query); } /** * Return the most recent error message for the database connector. * * @param boolean $showSQL True to display the SQL statement sent to the database as well as the error. * * @return string The error message for the most recent query. * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) */ public function stderr($showSQL = false) { JLog::add('JDatabase::stderr() is deprecated.', JLog::WARNING, 'deprecated'); if ($this->errorNum != 0) { return JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $this->errorNum, $this->errorMsg) . ($showSQL ? "<br />SQL = <pre>$this->sql</pre>" : ''); } else { return JText::_('JLIB_DATABASE_FUNCTION_NOERROR'); } } /** * Test to see if the connector is available. * * @return boolean True on success, false otherwise. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JDatabaseDriver::isSupported() instead. */ public static function test() { JLog::add('JDatabase::test() is deprecated. Use JDatabaseDriver::isSupported() instead.', JLog::WARNING, 'deprecated'); return static::isSupported(); } } PK���\��*��$libraries/joomla/database/driver.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Database * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Database Interface * * @since 11.2 */ interface JDatabaseInterface { /** * Test to see if the connector is available. * * @return boolean True on success, false otherwise. * * @since 11.2 */ public static function isSupported(); } /** * Joomla Platform Database Driver Class * * @since 12.1 * * @method string q() q($text, $escape = true) Alias for quote method * @method string qn() qn($name, $as = null) Alias for quoteName method */ abstract class JDatabaseDriver extends JDatabase implements JDatabaseInterface { /** * The name of the database. * * @var string * @since 11.4 */ private $_database; /** * The name of the database driver. * * @var string * @since 11.1 */ public $name; /** * @var resource The database connection resource. * @since 11.1 */ protected $connection; /** * @var integer The number of SQL statements executed by the database driver. * @since 11.1 */ protected $count = 0; /** * @var resource The database connection cursor from the last query. * @since 11.1 */ protected $cursor; /** * @var boolean The database driver debugging state. * @since 11.1 */ protected $debug = false; /** * @var integer The affected row limit for the current SQL statement. * @since 11.1 */ protected $limit = 0; /** * @var array The log of executed SQL statements by the database driver. * @since 11.1 */ protected $log = array(); /** * @var array The log of executed SQL statements timings (start and stop microtimes) by the database driver. * @since CMS 3.1.2 */ protected $timings = array(); /** * @var array The log of executed SQL statements timings (start and stop microtimes) by the database driver. * @since CMS 3.1.2 */ protected $callStacks = array(); /** * @var string The character(s) used to quote SQL statement names such as table names or field names, * etc. The child classes should define this as necessary. If a single character string the * same character is used for both sides of the quoted name, else the first character will be * used for the opening quote and the second for the closing quote. * @since 11.1 */ protected $nameQuote; /** * @var string The null or zero representation of a timestamp for the database driver. This should be * defined in child classes to hold the appropriate value for the engine. * @since 11.1 */ protected $nullDate; /** * @var integer The affected row offset to apply for the current SQL statement. * @since 11.1 */ protected $offset = 0; /** * @var array Passed in upon instantiation and saved. * @since 11.1 */ protected $options; /** * @var mixed The current SQL statement to execute. * @since 11.1 */ protected $sql; /** * @var string The common database table prefix. * @since 11.1 */ protected $tablePrefix; /** * @var boolean True if the database engine supports UTF-8 character encoding. * @since 11.1 */ protected $utf = true; /** * @var integer The database error number * @since 11.1 * @deprecated 12.1 */ protected $errorNum = 0; /** * @var string The database error message * @since 11.1 * @deprecated 12.1 */ protected $errorMsg; /** * @var array JDatabaseDriver instances container. * @since 11.1 */ protected static $instances = array(); /** * @var string The minimum supported database version. * @since 12.1 */ protected static $dbMinimum; /** * @var integer The depth of the current transaction. * @since 12.3 */ protected $transactionDepth = 0; /** * @var callable[] List of callables to call just before disconnecting database * @since CMS 3.1.2 */ protected $disconnectHandlers = array(); /** * Get a list of available database connectors. The list will only be populated with connectors that both * the class exists and the static test method returns true. This gives us the ability to have a multitude * of connector classes that are self-aware as to whether or not they are able to be used on a given system. * * @return array An array of available database connectors. * * @since 11.1 */ public static function getConnectors() { $connectors = array(); // Get an iterator and loop trough the driver classes. $iterator = new DirectoryIterator(__DIR__ . '/driver'); /* @type $file DirectoryIterator */ foreach ($iterator as $file) { $fileName = $file->getFilename(); // Only load for php files. if (!$file->isFile() || $file->getExtension() != 'php') { continue; } // Derive the class name from the type. $class = str_ireplace('.php', '', 'JDatabaseDriver' . ucfirst(trim($fileName))); // If the class doesn't exist we have nothing left to do but look at the next type. We did our best. if (!class_exists($class)) { continue; } // Sweet! Our class exists, so now we just need to know if it passes its test method. if ($class::isSupported()) { // Connector names should not have file extensions. $connectors[] = str_ireplace('.php', '', $fileName); } } return $connectors; } /** * Method to return a JDatabaseDriver instance based on the given options. There are three global options and then * the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is * used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to * be used for the connection. The 'select' option determines whether the connector should automatically select * the chosen database. * * Instances are unique to the given options and new objects are only created when a unique options array is * passed into the method. This ensures that we don't end up with unnecessary database connection resources. * * @param array $options Parameters to be passed to the database driver. * * @return JDatabaseDriver A database object. * * @since 11.1 * @throws RuntimeException */ public static function getInstance($options = array()) { // Sanitize the database connector options. $options['driver'] = (isset($options['driver'])) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $options['driver']) : 'mysqli'; $options['database'] = (isset($options['database'])) ? $options['database'] : null; $options['select'] = (isset($options['select'])) ? $options['select'] : true; // If the selected driver is `mysql` and we are on PHP 7 or greater, switch to the `mysqli` driver. if ($options['driver'] == 'mysql' && PHP_MAJOR_VERSION >= 7) { // Check if we have support for the other MySQL drivers $mysqliSupported = JDatabaseDriverMysqli::isSupported(); $pdoMysqlSupported = JDatabaseDriverPdomysql::isSupported(); // If neither is supported, then the user cannot use MySQL; throw an exception if (!$mysqliSupported && !$pdoMysqlSupported) { throw new RuntimeException( 'The PHP `ext/mysql` extension is removed in PHP 7, cannot use the `mysql` driver.' . ' Also, this system does not support MySQLi or PDO MySQL. Cannot instantiate database driver.' ); } // Prefer MySQLi as it is a closer replacement for the removed MySQL driver, otherwise use the PDO driver if ($mysqliSupported) { JLog::add( 'The PHP `ext/mysql` extension is removed in PHP 7, cannot use the `mysql` driver. Trying `mysqli` instead.', JLog::WARNING, 'deprecated' ); $options['driver'] = 'mysqli'; } else { JLog::add( 'The PHP `ext/mysql` extension is removed in PHP 7, cannot use the `mysql` driver. Trying `pdomysql` instead.', JLog::WARNING, 'deprecated' ); $options['driver'] = 'pdomysql'; } } // Get the options signature for the database connector. $signature = md5(serialize($options)); // If we already have a database connector instance for these options then just use that. if (empty(self::$instances[$signature])) { // Derive the class name from the driver. $class = 'JDatabaseDriver' . ucfirst(strtolower($options['driver'])); // If the class still doesn't exist we have nothing left to do but throw an exception. We did our best. if (!class_exists($class)) { throw new RuntimeException(sprintf('Unable to load Database Driver: %s', $options['driver'])); } // Create our new JDatabaseDriver connector based on the options given. try { $instance = new $class($options); } catch (RuntimeException $e) { throw new RuntimeException(sprintf('Unable to connect to the Database: %s', $e->getMessage())); } // Set the new connector to the global instances based on signature. self::$instances[$signature] = $instance; } return self::$instances[$signature]; } /** * Splits a string of multiple queries into an array of individual queries. * * @param string $sql Input SQL string with which to split into individual queries. * * @return array The queries from the input string separated into an array. * * @since 11.1 */ public static function splitSql($sql) { $start = 0; $open = false; $char = ''; $end = strlen($sql); $queries = array(); for ($i = 0; $i < $end; $i++) { $current = substr($sql, $i, 1); if (($current == '"' || $current == '\'')) { $n = 2; while (substr($sql, $i - $n + 1, 1) == '\\' && $n < $i) { $n++; } if ($n % 2 == 0) { if ($open) { if ($current == $char) { $open = false; $char = ''; } } else { $open = true; $char = $current; } } } if (($current == ';' && !$open) || $i == $end - 1) { $queries[] = substr($sql, $start, ($i - $start + 1)); $start = $i + 1; } } return $queries; } /** * Magic method to provide method alias support for quote() and quoteName(). * * @param string $method The called method. * @param array $args The array of arguments passed to the method. * * @return mixed The aliased method's return value or null. * * @since 11.1 */ public function __call($method, $args) { if (empty($args)) { return; } switch ($method) { case 'q': return $this->quote($args[0], isset($args[1]) ? $args[1] : true); break; case 'qn': return $this->quoteName($args[0], isset($args[1]) ? $args[1] : null); break; } } /** * Constructor. * * @param array $options List of options used to configure the connection * * @since 11.1 */ public function __construct($options) { // Initialise object variables. $this->_database = (isset($options['database'])) ? $options['database'] : ''; $this->tablePrefix = (isset($options['prefix'])) ? $options['prefix'] : 'jos_'; $this->count = 0; $this->errorNum = 0; $this->log = array(); // Set class options. $this->options = $options; } /** * Alter database's character set, obtaining query string from protected member. * * @param string $dbName The database name that will be altered * * @return string The query that alter the database query string * * @since 12.2 * @throws RuntimeException */ public function alterDbCharacterSet($dbName) { if (is_null($dbName)) { throw new RuntimeException('Database name must not be null.'); } $this->setQuery($this->getAlterDbCharacterSet($dbName)); return $this->execute(); } /** * Connects to the database if needed. * * @return void Returns void if the database connected successfully. * * @since 12.1 * @throws RuntimeException */ abstract public function connect(); /** * Determines if the connection to the server is active. * * @return boolean True if connected to the database engine. * * @since 11.1 */ abstract public function connected(); /** * Create a new database using information from $options object, obtaining query string * from protected member. * * @param stdClass $options Object used to pass user and database name to database driver. * This object must have "db_name" and "db_user" set. * @param boolean $utf True if the database supports the UTF-8 character set. * * @return string The query that creates database * * @since 12.2 * @throws RuntimeException */ public function createDatabase($options, $utf = true) { if (is_null($options)) { throw new RuntimeException('$options object must not be null.'); } elseif (empty($options->db_name)) { throw new RuntimeException('$options object must have db_name set.'); } elseif (empty($options->db_user)) { throw new RuntimeException('$options object must have db_user set.'); } $this->setQuery($this->getCreateDatabaseQuery($options, $utf)); return $this->execute(); } /** * Disconnects the database. * * @return void * * @since 12.1 */ abstract public function disconnect(); /** * Adds a function callable just before disconnecting the database. Parameter of the callable is $this JDatabaseDriver * * @param callable $callable Function to call in disconnect() method just before disconnecting from database * * @return void * * @since CMS 3.1.2 */ public function addDisconnectHandler($callable) { $this->disconnectHandlers[] = $callable; } /** * Drops a table from the database. * * @param string $table The name of the database table to drop. * @param boolean $ifExists Optionally specify that the table must exist before it is dropped. * * @return JDatabaseDriver Returns this object to support chaining. * * @since 11.4 * @throws RuntimeException */ public abstract function dropTable($table, $ifExists = true); /** * Escapes a string for usage in an SQL statement. * * @param string $text The string to be escaped. * @param boolean $extra Optional parameter to provide extra escaping. * * @return string The escaped string. * * @since 11.1 */ abstract public function escape($text, $extra = false); /** * Method to fetch a row from the result set cursor as an array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 11.1 */ abstract protected function fetchArray($cursor = null); /** * Method to fetch a row from the result set cursor as an associative array. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 11.1 */ abstract protected function fetchAssoc($cursor = null); /** * Method to fetch a row from the result set cursor as an object. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * @param string $class The class name to use for the returned row object. * * @return mixed Either the next row from the result set or false if there are no more rows. * * @since 11.1 */ abstract protected function fetchObject($cursor = null, $class = 'stdClass'); /** * Method to free up the memory used for the result set. * * @param mixed $cursor The optional result set cursor from which to fetch the row. * * @return void * * @since 11.1 */ abstract protected function freeResult($cursor = null); /** * Get the number of affected rows for the previous executed SQL statement. * * @return integer The number of affected rows. * * @since 11.1 */ abstract public function getAffectedRows(); /** * Return the query string to alter the database character set. * * @param string $dbName The database name * * @return string The query that alter the database query string * * @since 12.2 */ protected function getAlterDbCharacterSet($dbName) { return 'ALTER DATABASE ' . $this->quoteName($dbName) . ' CHARACTER SET `utf8`'; } /** * Return the query string to create new Database. * Each database driver, other than MySQL, need to override this member to return correct string. * * @param stdClass $options Object used to pass user and database name to database driver. * This object must have "db_name" and "db_user" set. * @param boolean $utf True if the database supports the UTF-8 character set. * * @return string The query that creates database * * @since 12.2 */ protected function getCreateDatabaseQuery($options, $utf) { if ($utf) { return 'CREATE DATABASE ' . $this->quoteName($options->db_name) . ' CHARACTER SET `utf8`'; } return 'CREATE DATABASE ' . $this->quoteName($options->db_name); } /** * Method to get the database collation in use by sampling a text field of a table in the database. * * @return mixed The collation in use by the database or boolean false if not supported. * * @since 11.1 */ abstract public function getCollation(); /** * Method that provides access to the underlying database connection. Useful for when you need to call a * proprietary method such as postgresql's lo_* methods. * * @return resource The underlying database connection resource. * * @since 11.1 */ public function getConnection() { return $this->connection; } /** * Get the total number of SQL statements executed by the database driver. * * @return integer * * @since 11.1 */ public function getCount() { return $this->count; } /** * Gets the name of the database used by this conneciton. * * @return string * * @since 11.4 */ protected function getDatabase() { return $this->_database; } /** * Returns a PHP date() function compliant date format for the database driver. * * @return string The format string. * * @since 11.1 */ public function getDateFormat() { return 'Y-m-d H:i:s'; } /** * Get the database driver SQL statement log. * * @return array SQL statements executed by the database driver. * * @since 11.1 */ public function getLog() { return $this->log; } /** * Get the database driver SQL statement log. * * @return array SQL statements executed by the database driver. * * @since CMS 3.1.2 */ public function getTimings() { return $this->timings; } /** * Get the database driver SQL statement log. * * @return array SQL statements executed by the database driver. * * @since CMS 3.1.2 */ public function getCallStacks() { return $this->callStacks; } /** * Get the minimum supported database version. * * @return string The minimum version number for the database driver. * * @since 12.1 */ public function getMinimum() { return static::$dbMinimum; } /** * Get the null or zero representation of a timestamp for the database driver. * * @return string Null or zero representation of a timestamp. * * @since 11.1 */ public function getNullDate() { return $this->nullDate; } /** * Get the number of returned rows for the previous executed SQL statement. * * @param resource $cursor An optional database cursor resource to extract the row count from. * * @return integer The number of returned rows. * * @since 11.1 */ abstract public function getNumRows($cursor = null); /** * Get the common table prefix for the database driver. * * @return string The common database table prefix. * * @since 11.1 */ public function getPrefix() { return $this->tablePrefix; } /** * Gets an exporter class object. * * @return JDatabaseExporter An exporter object. * * @since 12.1 * @throws RuntimeException */ public function getExporter() { // Derive the class name from the driver. $class = 'JDatabaseExporter' . ucfirst($this->name); // Make sure we have an exporter class for this driver. if (!class_exists($class)) { // If it doesn't exist we are at an impasse so throw an exception. throw new RuntimeException('Database Exporter not found.'); } $o = new $class; $o->setDbo($this); return $o; } /** * Gets an importer class object. * * @return JDatabaseImporter An importer object. * * @since 12.1 * @throws RuntimeException */ public function getImporter() { // Derive the class name from the driver. $class = 'JDatabaseImporter' . ucfirst($this->name); // Make sure we have an importer class for this driver. if (!class_exists($class)) { // If it doesn't exist we are at an impasse so throw an exception. throw new RuntimeException('Database Importer not found'); } $o = new $class; $o->setDbo($this); return $o; } /** * Get the current query object or a new JDatabaseQuery object. * * @param boolean $new False to return the current query object, True to return a new JDatabaseQuery object. * * @return JDatabaseQuery The current query object or a new object extending the JDatabaseQuery class. * * @since 11.1 * @throws RuntimeException */ public function getQuery($new = false) { if ($new) { // Derive the class name from the driver. $class = 'JDatabaseQuery' . ucfirst($this->name); // Make sure we have a query class for this driver. if (!class_exists($class)) { // If it doesn't exist we are at an impasse so throw an exception. throw new RuntimeException('Database Query Class not found.'); } return new $class($this); } else { return $this->sql; } } /** * Get a new iterator on the current query. * * @param string $column An option column to use as the iterator key. * @param string $class The class of object that is returned. * * @return JDatabaseIterator A new database iterator. * * @since 12.1 * @throws RuntimeException */ public function getIterator($column = null, $class = 'stdClass') { // Derive the class name from the driver. $iteratorClass = 'JDatabaseIterator' . ucfirst($this->name); // Make sure we have an iterator class for this driver. if (!class_exists($iteratorClass)) { // If it doesn't exist we are at an impasse so throw an exception. throw new RuntimeException(sprintf('class *%s* is not defined', $iteratorClass)); } // Return a new iterator return new $iteratorClass($this->execute(), $column, $class); } /** * Retrieves field information about the given tables. * * @param string $table The name of the database table. * @param boolean $typeOnly True (default) to only return field types. * * @return array An array of fields by table. * * @since 11.1 * @throws RuntimeException */ abstract public function getTableColumns($table, $typeOnly = true); /** * Shows the table CREATE statement that creates the given tables. * * @param mixed $tables A table name or a list of table names. * * @return array A list of the create SQL for the tables. * * @since 11.1 * @throws RuntimeException */ abstract public function getTableCreate($tables); /** * Retrieves field information about the given tables. * * @param mixed $tables A table name or a list of table names. * * @return array An array of keys for the table(s). * * @since 11.1 * @throws RuntimeException */ abstract public function getTableKeys($tables); /** * Method to get an array of all tables in the database. * * @return array An array of all the tables in the database. * * @since 11.1 * @throws RuntimeException */ abstract public function getTableList(); /** * Determine whether or not the database engine supports UTF-8 character encoding. * * @return boolean True if the database engine supports UTF-8 character encoding. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use hasUTFSupport() instead */ public function getUTFSupport() { JLog::add('JDatabaseDriver::getUTFSupport() is deprecated. Use JDatabaseDriver::hasUTFSupport() instead.', JLog::WARNING, 'deprecated'); return $this->hasUTFSupport(); } /** * Determine whether or not the database engine supports UTF-8 character encoding. * * @return boolean True if the database engine supports UTF-8 character encoding. * * @since 12.1 */ public function hasUTFSupport() { return $this->utf; } /** * Get the version of the database connector * * @return string The database connector version. * * @since 11.1 */ abstract public function getVersion(); /** * Method to get the auto-incremented value from the last INSERT statement. * * @return mixed The value of the auto-increment field from the last inserted row. * * @since 11.1 */ abstract public function insertid(); /** * Inserts a row into a table based on an object's properties. * * @param string $table The name of the database table to insert into. * @param object &$object A reference to an object whose public properties match the table fields. * @param string $key The name of the primary key. If provided the object property is updated. * * @return boolean True on success. * * @since 11.1 * @throws RuntimeException */ public function insertObject($table, &$object, $key = null) { $fields = array(); $values = array(); // Iterate over the object variables to build the query fields and values. foreach (get_object_vars($object) as $k => $v) { // Only process non-null scalars. if (is_array($v) or is_object($v) or $v === null) { continue; } // Ignore any internal fields. if ($k[0] == '_') { continue; } // Prepare and sanitize the fields and values for the database query. $fields[] = $this->quoteName($k); $values[] = $this->quote($v); } // Create the base insert statement. $query = $this->getQuery(true) ->insert($this->quoteName($table)) ->columns($fields) ->values(implode(',', $values)); // Set the query and execute the insert. $this->setQuery($query); if (!$this->execute()) { return false; } // Update the primary key if it exists. $id = $this->insertid(); if ($key && $id && is_string($key)) { $object->$key = $id; } return true; } /** * Method to check whether the installed database version is supported by the database driver * * @return boolean True if the database version is supported * * @since 12.1 */ public function isMinimumVersion() { return version_compare($this->getVersion(), static::$dbMinimum) >= 0; } /** * Method to get the first row of the result set from the database query as an associative array * of ['field_name' => 'row_value']. * * @return mixed The return value or null if the query failed. * * @since 11.1 * @throws RuntimeException */ public function loadAssoc() { $this->connect(); $ret = null; // Execute the query and get the result set cursor. if (!($cursor = $this->execute())) { return null; } // Get the first row from the result set as an associative array. if ($array = $this->fetchAssoc($cursor)) { $ret = $array; } // Free up system resources and return. $this->freeResult($cursor); return $ret; } /** * Method to get an array of the result set rows from the database query where each row is an associative array * of ['field_name' => 'row_value']. The array of rows can optionally be keyed by a field name, but defaults to * a sequential numeric array. * * NOTE: Chosing to key the result array by a non-unique field name can result in unwanted * behavior and should be avoided. * * @param string $key The name of a field on which to key the result array. * @param string $column An optional column name. Instead of the whole row, only this column value will be in * the result array. * * @return mixed The return value or null if the query failed. * * @since 11.1 * @throws RuntimeException */ public function loadAssocList($key = null, $column = null) { $this->connect(); $array = array(); // Execute the query and get the result set cursor. if (!($cursor = $this->execute())) { return null; } // Get all of the rows from the result set. while ($row = $this->fetchAssoc($cursor)) { $value = ($column) ? (isset($row[$column]) ? $row[$column] : $row) : $row; if ($key) { $array[$row[$key]] = $value; } else { $array[] = $value; } } // Free up system resources and return. $this->freeResult($cursor); return $array; } /** * Method to get an array of values from the <var>$offset</var> field in each row of the result set from * the database query. * * @param integer $offset The row offset to use to build the result array. * * @return mixed The return value or null if the query failed. * * @since 11.1 * @throws RuntimeException */ public function loadColumn($offset = 0) { $this->connect(); $array = array(); // Execute the query and get the result set cursor. if (!($cursor = $this->execute())) { return null; } // Get all of the rows from the result set as arrays. while ($row = $this->fetchArray($cursor)) { $array[] = $row[$offset]; } // Free up system resources and return. $this->freeResult($cursor); return $array; } /** * Method to get the next row in the result set from the database query as an object. * * @param string $class The class name to use for the returned row object. * * @return mixed The result of the query as an array, false if there are no more rows. * * @since 11.1 * @throws RuntimeException * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use getIterator() instead */ public function loadNextObject($class = 'stdClass') { JLog::add(__METHOD__ . '() is deprecated. Use JDatabaseDriver::getIterator() instead.', JLog::WARNING, 'deprecated'); $this->connect(); static $cursor = null; // Execute the query and get the result set cursor. if ( is_null($cursor) ) { if (!($cursor = $this->execute())) { return $this->errorNum ? null : false; } } // Get the next row from the result set as an object of type $class. if ($row = $this->fetchObject($cursor, $class)) { return $row; } // Free up system resources and return. $this->freeResult($cursor); $cursor = null; return false; } /** * Method to get the next row in the result set from the database query as an array. * * @return mixed The result of the query as an array, false if there are no more rows. * * @since 11.1 * @throws RuntimeException * @deprecated 4.0 (CMS) Use JDatabaseDriver::getIterator() instead */ public function loadNextRow() { JLog::add(__METHOD__ . '() is deprecated. Use JDatabaseDriver::getIterator() instead.', JLog::WARNING, 'deprecated'); $this->connect(); static $cursor = null; // Execute the query and get the result set cursor. if ( is_null($cursor) ) { if (!($cursor = $this->execute())) { return $this->errorNum ? null : false; } } // Get the next row from the result set as an object of type $class. if ($row = $this->fetchArray($cursor)) { return $row; } // Free up system resources and return. $this->freeResult($cursor); $cursor = null; return false; } /** * Method to get the first row of the result set from the database query as an object. * * @param string $class The class name to use for the returned row object. * * @return mixed The return value or null if the query failed. * * @since 11.1 * @throws RuntimeException */ public function loadObject($class = 'stdClass') { $this->connect(); $ret = null; // Execute the query and get the result set cursor. if (!($cursor = $this->execute())) { return null; } // Get the first row from the result set as an object of type $class. if ($object = $this->fetchObject($cursor, $class)) { $ret = $object; } // Free up system resources and return. $this->freeResult($cursor); return $ret; } /** * Method to get an array of the result set rows from the database query where each row is an object. The array * of objects can optionally be keyed by a field name, but defaults to a sequential numeric array. * * NOTE: Choosing to key the result array by a non-unique field name can result in unwanted * behavior and should be avoided. * * @param string $key The name of a field on which to key the result array. * @param string $class The class name to use for the returned row objects. * * @return mixed The return value or null if the query failed. * * @since 11.1 * @throws RuntimeException */ public function loadObjectList($key = '', $class = 'stdClass') { $this->connect(); $array = array(); // Execute the query and get the result set cursor. if (!($cursor = $this->execute())) { return null; } // Get all of the rows from the result set as objects of type $class. while ($row = $this->fetchObject($cursor, $class)) { if ($key) { $array[$row->$key] = $row; } else { $array[] = $row; } } // Free up system resources and return. $this->freeResult($cursor); return $array; } /** * Method to get the first field of the first row of the result set from the database query. * * @return mixed The return value or null if the query failed. * * @since 11.1 * @throws RuntimeException */ public function loadResult() { $this->connect(); $ret = null; // Execute the query and get the result set cursor. if (!($cursor = $this->execute())) { return null; } // Get the first row from the result set as an array. if ($row = $this->fetchArray($cursor)) { $ret = $row[0]; } // Free up system resources and return. $this->freeResult($cursor); return $ret; } /** * Method to get the first row of the result set from the database query as an array. Columns are indexed * numerically so the first column in the result set would be accessible via <var>$row[0]</var>, etc. * * @return mixed The return value or null if the query failed. * * @since 11.1 * @throws RuntimeException */ public function loadRow() { $this->connect(); $ret = null; // Execute the query and get the result set cursor. if (!($cursor = $this->execute())) { return null; } // Get the first row from the result set as an array. if ($row = $this->fetchArray($cursor)) { $ret = $row; } // Free up system resources and return. $this->freeResult($cursor); return $ret; } /** * Method to get an array of the result set rows from the database query where each row is an array. The array * of objects can optionally be keyed by a field offset, but defaults to a sequential numeric array. * * NOTE: Choosing to key the result array by a non-unique field can result in unwanted * behavior and should be avoided. * * @param string $key The name of a field on which to key the result array. * * @return mixed The return value or null if the query failed. * * @since 11.1 * @throws RuntimeException */ public function loadRowList($key = null) { $this->connect(); $array = array(); // Execute the query and get the result set cursor. if (!($cursor = $this->execute())) { return null; } // Get all of the rows from the result set as arrays. while ($row = $this->fetchArray($cursor)) { if ($key !== null) { $array[$row[$key]] = $row; } else { $array[] = $row; } } // Free up system resources and return. $this->freeResult($cursor); return $array; } /** * Locks a table in the database. * * @param string $tableName The name of the table to unlock. * * @return JDatabaseDriver Returns this object to support chaining. * * @since 11.4 * @throws RuntimeException */ public abstract function lockTable($tableName); /** * Quotes and optionally escapes a string to database requirements for use in database queries. * * @param mixed $text A string or an array of strings to quote. * @param boolean $escape True (default) to escape the string, false to leave it unchanged. * * @return string The quoted input string. * * @note Accepting an array of strings was added in 12.3. * @since 11.1 */ public function quote($text, $escape = true) { if (is_array($text)) { foreach ($text as $k => $v) { $text[$k] = $this->quote($v, $escape); } return $text; } else { return '\'' . ($escape ? $this->escape($text) : $text) . '\''; } } /** * Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection * risks and reserved word conflicts. * * @param mixed $name The identifier name to wrap in quotes, or an array of identifier names to wrap in quotes. * Each type supports dot-notation name. * @param mixed $as The AS query part associated to $name. It can be string or array, in latter case it has to be * same length of $name; if is null there will not be any AS part for string or array element. * * @return mixed The quote wrapped name, same type of $name. * * @since 11.1 */ public function quoteName($name, $as = null) { if (is_string($name)) { $quotedName = $this->quoteNameStr(explode('.', $name)); $quotedAs = ''; if (!is_null($as)) { settype($as, 'array'); $quotedAs .= ' AS ' . $this->quoteNameStr($as); } return $quotedName . $quotedAs; } else { $fin = array(); if (is_null($as)) { foreach ($name as $str) { $fin[] = $this->quoteName($str); } } elseif (is_array($name) && (count($name) == count($as))) { $count = count($name); for ($i = 0; $i < $count; $i++) { $fin[] = $this->quoteName($name[$i], $as[$i]); } } return $fin; } } /** * Quote strings coming from quoteName call. * * @param array $strArr Array of strings coming from quoteName dot-explosion. * * @return string Dot-imploded string of quoted parts. * * @since 11.3 */ protected function quoteNameStr($strArr) { $parts = array(); $q = $this->nameQuote; foreach ($strArr as $part) { if (is_null($part)) { continue; } if (strlen($q) == 1) { $parts[] = $q . $part . $q; } else { $parts[] = $q{0} . $part . $q{1}; } } return implode('.', $parts); } /** * This function replaces a string identifier <var>$prefix</var> with the string held is the * <var>tablePrefix</var> class variable. * * @param string $sql The SQL statement to prepare. * @param string $prefix The common table prefix. * * @return string The processed SQL statement. * * @since 11.1 */ public function replacePrefix($sql, $prefix = '#__') { $startPos = 0; $literal = ''; $sql = trim($sql); $n = strlen($sql); while ($startPos < $n) { $ip = strpos($sql, $prefix, $startPos); if ($ip === false) { break; } $j = strpos($sql, "'", $startPos); $k = strpos($sql, '"', $startPos); if (($k !== false) && (($k < $j) || ($j === false))) { $quoteChar = '"'; $j = $k; } else { $quoteChar = "'"; } if ($j === false) { $j = $n; } $literal .= str_replace($prefix, $this->tablePrefix, substr($sql, $startPos, $j - $startPos)); $startPos = $j; $j = $startPos + 1; if ($j >= $n) { break; } // Quote comes first, find end of quote while (true) { $k = strpos($sql, $quoteChar, $j); $escaped = false; if ($k === false) { break; } $l = $k - 1; while ($l >= 0 && $sql{$l} == '\\') { $l--; $escaped = !$escaped; } if ($escaped) { $j = $k + 1; continue; } break; } if ($k === false) { // Error in the query - no end quote; ignore it break; } $literal .= substr($sql, $startPos, $k - $startPos + 1); $startPos = $k + 1; } if ($startPos < $n) { $literal .= substr($sql, $startPos, $n - $startPos); } return $literal; } /** * Renames a table in the database. * * @param string $oldTable The name of the table to be renamed * @param string $newTable The new name for the table. * @param string $backup Table prefix * @param string $prefix For the table - used to rename constraints in non-mysql databases * * @return JDatabaseDriver Returns this object to support chaining. * * @since 11.4 * @throws RuntimeException */ public abstract function renameTable($oldTable, $newTable, $backup = null, $prefix = null); /** * Select a database for use. * * @param string $database The name of the database to select for use. * * @return boolean True if the database was successfully selected. * * @since 11.1 * @throws RuntimeException */ abstract public function select($database); /** * Sets the database debugging state for the driver. * * @param boolean $level True to enable debugging. * * @return boolean The old debugging level. * * @since 11.1 */ public function setDebug($level) { $previous = $this->debug; $this->debug = (bool) $level; return $previous; } /** * Sets the SQL statement string for later execution. * * @param mixed $query The SQL statement to set either as a JDatabaseQuery object or a string. * @param integer $offset The affected row offset to set. * @param integer $limit The maximum affected rows to set. * * @return JDatabaseDriver This object to support method chaining. * * @since 11.1 */ public function setQuery($query, $offset = 0, $limit = 0) { $this->sql = $query; if ($query instanceof JDatabaseQueryLimitable) { if (!$limit && $query->limit) { $limit = $query->limit; } if (!$offset && $query->offset) { $offset = $query->offset; } $query->setLimit($limit, $offset); } else { $this->limit = (int) max(0, $limit); $this->offset = (int) max(0, $offset); } return $this; } /** * Set the connection to use UTF-8 character encoding. * * @return boolean True on success. * * @since 11.1 */ abstract public function setUtf(); /** * Method to commit a transaction. * * @param boolean $toSavepoint If true, commit to the last savepoint. * * @return void * * @since 11.1 * @throws RuntimeException */ abstract public function transactionCommit($toSavepoint = false); /** * Method to roll back a transaction. * * @param boolean $toSavepoint If true, rollback to the last savepoint. * * @return void * * @since 11.1 * @throws RuntimeException */ abstract public function transactionRollback($toSavepoint = false); /** * Method to initialize a transaction. * * @param boolean $asSavepoint If true and a transaction is already active, a savepoint will be created. * * @return void * * @since 11.1 * @throws RuntimeException */ abstract public function transactionStart($asSavepoint = false); /** * Method to truncate a table. * * @param string $table The table to truncate * * @return void * * @since 11.3 * @throws RuntimeException */ public function truncateTable($table) { $this->setQuery('TRUNCATE TABLE ' . $this->quoteName($table)); $this->execute(); } /** * Updates a row in a table based on an object's properties. * * @param string $table The name of the database table to update. * @param object &$object A reference to an object whose public properties match the table fields. * @param array $key The name of the primary key. * @param boolean $nulls True to update null fields or false to ignore them. * * @return boolean True on success. * * @since 11.1 * @throws RuntimeException */ public function updateObject($table, &$object, $key, $nulls = false) { $fields = array(); $where = array(); if (is_string($key)) { $key = array($key); } if (is_object($key)) { $key = (array) $key; } // Create the base update statement. $statement = 'UPDATE ' . $this->quoteName($table) . ' SET %s WHERE %s'; // Iterate over the object variables to build the query fields/value pairs. foreach (get_object_vars($object) as $k => $v) { // Only process scalars that are not internal fields. if (is_array($v) or is_object($v) or $k[0] == '_') { continue; } // Set the primary key to the WHERE clause instead of a field to update. if (in_array($k, $key)) { $where[] = $this->quoteName($k) . '=' . $this->quote($v); continue; } // Prepare and sanitize the fields and values for the database query. if ($v === null) { // If the value is null and we want to update nulls then set it. if ($nulls) { $val = 'NULL'; } // If the value is null and we do not want to update nulls then ignore this field. else { continue; } } // The field is not null so we prep it for update. else { $val = $this->quote($v); } // Add the field to be updated. $fields[] = $this->quoteName($k) . '=' . $val; } // We don't have any fields to update. if (empty($fields)) { return true; } // Set the query and execute the update. $this->setQuery(sprintf($statement, implode(",", $fields), implode(' AND ', $where))); return $this->execute(); } /** * Execute the SQL statement. * * @return mixed A database cursor resource on success, boolean false on failure. * * @since 12.1 * @throws RuntimeException */ abstract public function execute(); /** * Unlocks tables in the database. * * @return JDatabaseDriver Returns this object to support chaining. * * @since 11.4 * @throws RuntimeException */ public abstract function unlockTables(); } PK���\�<ßA'A'.libraries/joomla/language/stemmer/porteren.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @copyright Copyright (C) 2005 Richard Heyes (http://www.phpguru.org/). All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Porter English stemmer class. * * This class was adapted from one written by Richard Heyes. * See copyright and link information above. * * @since 12.1 */ class JLanguageStemmerPorteren extends JLanguageStemmer { /** * Regex for matching a consonant. * * @var string * @since 12.1 */ private static $_regex_consonant = '(?:[bcdfghjklmnpqrstvwxz]|(?<=[aeiou])y|^y)'; /** * Regex for matching a vowel * @var string * @since 12.1 */ private static $_regex_vowel = '(?:[aeiou]|(?<![aeiou])y)'; /** * Method to stem a token and return the root. * * @param string $token The token to stem. * @param string $lang The language of the token. * * @return string The root token. * * @since 12.1 */ public function stem($token, $lang) { // Check if the token is long enough to merit stemming. if (strlen($token) <= 2) { return $token; } // Check if the language is English or All. if ($lang !== 'en') { return $token; } // Stem the token if it is not in the cache. if (!isset($this->cache[$lang][$token])) { // Stem the token. $result = $token; $result = self::_step1ab($result); $result = self::_step1c($result); $result = self::_step2($result); $result = self::_step3($result); $result = self::_step4($result); $result = self::_step5($result); // Add the token to the cache. $this->cache[$lang][$token] = $result; } return $this->cache[$lang][$token]; } /** * Step 1 * * @param string $word The token to stem. * * @return string * * @since 12.1 */ private static function _step1ab($word) { // Part a if (substr($word, -1) == 's') { self::_replace($word, 'sses', 'ss') or self::_replace($word, 'ies', 'i') or self::_replace($word, 'ss', 'ss') or self::_replace($word, 's', ''); } // Part b if (substr($word, -2, 1) != 'e' or !self::_replace($word, 'eed', 'ee', 0)) { // First rule $v = self::$_regex_vowel; // Check ing and ed // Note use of && and OR, for precedence reasons if (preg_match("#$v+#", substr($word, 0, -3)) && self::_replace($word, 'ing', '') or preg_match("#$v+#", substr($word, 0, -2)) && self::_replace($word, 'ed', '')) { // If one of above two test successful if (!self::_replace($word, 'at', 'ate') and !self::_replace($word, 'bl', 'ble') and !self::_replace($word, 'iz', 'ize')) { // Double consonant ending if (self::_doubleConsonant($word) and substr($word, -2) != 'll' and substr($word, -2) != 'ss' and substr($word, -2) != 'zz') { $word = substr($word, 0, -1); } elseif (self::_m($word) == 1 and self::_cvc($word)) { $word .= 'e'; } } } } return $word; } /** * Step 1c * * @param string $word The token to stem. * * @return string * * @since 12.1 */ private static function _step1c($word) { $v = self::$_regex_vowel; if (substr($word, -1) == 'y' && preg_match("#$v+#", substr($word, 0, -1))) { self::_replace($word, 'y', 'i'); } return $word; } /** * Step 2 * * @param string $word The token to stem. * * @return string * * @since 12.1 */ private static function _step2($word) { switch (substr($word, -2, 1)) { case 'a': self::_replace($word, 'ational', 'ate', 0) or self::_replace($word, 'tional', 'tion', 0); break; case 'c': self::_replace($word, 'enci', 'ence', 0) or self::_replace($word, 'anci', 'ance', 0); break; case 'e': self::_replace($word, 'izer', 'ize', 0); break; case 'g': self::_replace($word, 'logi', 'log', 0); break; case 'l': self::_replace($word, 'entli', 'ent', 0) or self::_replace($word, 'ousli', 'ous', 0) or self::_replace($word, 'alli', 'al', 0) or self::_replace($word, 'bli', 'ble', 0) or self::_replace($word, 'eli', 'e', 0); break; case 'o': self::_replace($word, 'ization', 'ize', 0) or self::_replace($word, 'ation', 'ate', 0) or self::_replace($word, 'ator', 'ate', 0); break; case 's': self::_replace($word, 'iveness', 'ive', 0) or self::_replace($word, 'fulness', 'ful', 0) or self::_replace($word, 'ousness', 'ous', 0) or self::_replace($word, 'alism', 'al', 0); break; case 't': self::_replace($word, 'biliti', 'ble', 0) or self::_replace($word, 'aliti', 'al', 0) or self::_replace($word, 'iviti', 'ive', 0); break; } return $word; } /** * Step 3 * * @param string $word The token to stem. * * @return string * * @since 12.1 */ private static function _step3($word) { switch (substr($word, -2, 1)) { case 'a': self::_replace($word, 'ical', 'ic', 0); break; case 's': self::_replace($word, 'ness', '', 0); break; case 't': self::_replace($word, 'icate', 'ic', 0) or self::_replace($word, 'iciti', 'ic', 0); break; case 'u': self::_replace($word, 'ful', '', 0); break; case 'v': self::_replace($word, 'ative', '', 0); break; case 'z': self::_replace($word, 'alize', 'al', 0); break; } return $word; } /** * Step 4 * * @param string $word The token to stem. * * @return string * * @since 12.1 */ private static function _step4($word) { switch (substr($word, -2, 1)) { case 'a': self::_replace($word, 'al', '', 1); break; case 'c': self::_replace($word, 'ance', '', 1) or self::_replace($word, 'ence', '', 1); break; case 'e': self::_replace($word, 'er', '', 1); break; case 'i': self::_replace($word, 'ic', '', 1); break; case 'l': self::_replace($word, 'able', '', 1) or self::_replace($word, 'ible', '', 1); break; case 'n': self::_replace($word, 'ant', '', 1) or self::_replace($word, 'ement', '', 1) or self::_replace($word, 'ment', '', 1) or self::_replace($word, 'ent', '', 1); break; case 'o': if (substr($word, -4) == 'tion' or substr($word, -4) == 'sion') { self::_replace($word, 'ion', '', 1); } else { self::_replace($word, 'ou', '', 1); } break; case 's': self::_replace($word, 'ism', '', 1); break; case 't': self::_replace($word, 'ate', '', 1) or self::_replace($word, 'iti', '', 1); break; case 'u': self::_replace($word, 'ous', '', 1); break; case 'v': self::_replace($word, 'ive', '', 1); break; case 'z': self::_replace($word, 'ize', '', 1); break; } return $word; } /** * Step 5 * * @param string $word The token to stem. * * @return string * * @since 12.1 */ private static function _step5($word) { // Part a if (substr($word, -1) == 'e') { if (self::_m(substr($word, 0, -1)) > 1) { self::_replace($word, 'e', ''); } elseif (self::_m(substr($word, 0, -1)) == 1) { if (!self::_cvc(substr($word, 0, -1))) { self::_replace($word, 'e', ''); } } } // Part b if (self::_m($word) > 1 and self::_doubleConsonant($word) and substr($word, -1) == 'l') { $word = substr($word, 0, -1); } return $word; } /** * Replaces the first string with the second, at the end of the string. If third * arg is given, then the preceding string must match that m count at least. * * @param string &$str String to check * @param string $check Ending to check for * @param string $repl Replacement string * @param integer $m Optional minimum number of m() to meet * * @return boolean Whether the $check string was at the end * of the $str string. True does not necessarily mean * that it was replaced. * * @since 12.1 */ private static function _replace(&$str, $check, $repl, $m = null) { $len = 0 - strlen($check); if (substr($str, $len) == $check) { $substr = substr($str, 0, $len); if (is_null($m) or self::_m($substr) > $m) { $str = $substr . $repl; } return true; } return false; } /** * m() measures the number of consonant sequences in $str. if c is * a consonant sequence and v a vowel sequence, and <..> indicates arbitrary * presence, * * <c><v> gives 0 * <c>vc<v> gives 1 * <c>vcvc<v> gives 2 * <c>vcvcvc<v> gives 3 * * @param string $str The string to return the m count for * * @return integer The m count * * @since 12.1 */ private static function _m($str) { $c = self::$_regex_consonant; $v = self::$_regex_vowel; $str = preg_replace("#^$c+#", '', $str); $str = preg_replace("#$v+$#", '', $str); preg_match_all("#($v+$c+)#", $str, $matches); return count($matches[1]); } /** * Returns true/false as to whether the given string contains two * of the same consonant next to each other at the end of the string. * * @param string $str String to check * * @return boolean Result * * @since 12.1 */ private static function _doubleConsonant($str) { $c = self::$_regex_consonant; return preg_match("#$c{2}$#", $str, $matches) and $matches[0]{0} == $matches[0]{1}; } /** * Checks for ending CVC sequence where second C is not W, X or Y * * @param string $str String to check * * @return boolean Result * * @since 12.1 */ private static function _cvc($str) { $c = self::$_regex_consonant; $v = self::$_regex_vowel; $result = preg_match("#($c$v$c)$#", $str, $matches) and strlen($matches[1]) == 3 and $matches[1]{2} != 'w' and $matches[1]{2} != 'x' and $matches[1]{2} != 'y'; return $result; } } PK���\$�wڵ�%libraries/joomla/language/stemmer.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Stemmer base class. * * @since 12.1 */ abstract class JLanguageStemmer { /** * An internal cache of stemmed tokens. * * @var array * @since 12.1 */ protected $cache = array(); /** * @var array JLanguageStemmer instances. * @since 12.1 */ protected static $instances = array(); /** * Method to get a stemmer, creating it if necessary. * * @param string $adapter The type of stemmer to load. * * @return JLanguageStemmer A JLanguageStemmer instance. * * @since 12.1 * @throws RuntimeException on invalid stemmer. */ public static function getInstance($adapter) { // Only create one stemmer for each adapter. if (isset(self::$instances[$adapter])) { return self::$instances[$adapter]; } // Setup the adapter for the stemmer. $class = 'JLanguageStemmer' . ucfirst(trim($adapter)); // Check if a stemmer exists for the adapter. if (!class_exists($class)) { // Throw invalid adapter exception. throw new RuntimeException(JText::sprintf('JLIB_STEMMER_INVALID_STEMMER', $adapter)); } self::$instances[$adapter] = new $class; return self::$instances[$adapter]; } /** * Method to stem a token and return the root. * * @param string $token The token to stem. * @param string $lang The language of the token. * * @return string The root token. * * @since 12.1 */ abstract public function stem($token, $lang); } PK���\�z`��+libraries/joomla/language/transliterate.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Class to transliterate strings * * @since 11.1 * @note Port of phputf8's utf8_accents_to_ascii() */ class JLanguageTransliterate { /** * Returns strings transliterated from UTF-8 to Latin * * @param string $string String to transliterate * @param integer $case Optionally specify upper or lower case. Default to null. * * @return string Transliterated string * * @since 11.1 */ public static function utf8_latin_to_ascii($string, $case = 0) { static $UTF8_LOWER_ACCENTS = null; static $UTF8_UPPER_ACCENTS = null; if ($case <= 0) { if (is_null($UTF8_LOWER_ACCENTS)) { $UTF8_LOWER_ACCENTS = array( 'à' => 'a', 'ô' => 'o', 'ď' => 'd', 'ḟ' => 'f', 'ë' => 'e', 'š' => 's', 'ơ' => 'o', 'ß' => 'ss', 'ă' => 'a', 'ř' => 'r', 'ț' => 't', 'ň' => 'n', 'ā' => 'a', 'ķ' => 'k', 'ŝ' => 's', 'ỳ' => 'y', 'ņ' => 'n', 'ĺ' => 'l', 'ħ' => 'h', 'ṗ' => 'p', 'ó' => 'o', 'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', 'ẁ' => 'w', 'ċ' => 'c', 'õ' => 'o', 'ṡ' => 's', 'ø' => 'o', 'ģ' => 'g', 'ŧ' => 't', 'ș' => 's', 'ė' => 'e', 'ĉ' => 'c', 'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'ŵ' => 'w', 'ṫ' => 't', 'ū' => 'u', 'č' => 'c', 'ö' => 'oe', 'è' => 'e', 'ŷ' => 'y', 'ą' => 'a', 'ł' => 'l', 'ų' => 'u', 'ů' => 'u', 'ş' => 's', 'ğ' => 'g', 'ļ' => 'l', 'ƒ' => 'f', 'ž' => 'z', 'ẃ' => 'w', 'ḃ' => 'b', 'å' => 'a', 'ì' => 'i', 'ï' => 'i', 'ḋ' => 'd', 'ť' => 't', 'ŗ' => 'r', 'ä' => 'ae', 'í' => 'i', 'ŕ' => 'r', 'ê' => 'e', 'ü' => 'ue', 'ò' => 'o', 'ē' => 'e', 'ñ' => 'n', 'ń' => 'n', 'ĥ' => 'h', 'ĝ' => 'g', 'đ' => 'd', 'ĵ' => 'j', 'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o', 'â' => 'a', 'ľ' => 'l', 'ẅ' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g', 'ṁ' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a', 'û' => 'u', 'þ' => 'th', 'ð' => 'dh', 'æ' => 'ae', 'µ' => 'u', 'ĕ' => 'e', 'œ' => 'oe'); } $string = str_replace(array_keys($UTF8_LOWER_ACCENTS), array_values($UTF8_LOWER_ACCENTS), $string); } if ($case >= 0) { if (is_null($UTF8_UPPER_ACCENTS)) { $UTF8_UPPER_ACCENTS = array( 'À' => 'A', 'Ô' => 'O', 'Ď' => 'D', 'Ḟ' => 'F', 'Ë' => 'E', 'Š' => 'S', 'Ơ' => 'O', 'Ă' => 'A', 'Ř' => 'R', 'Ț' => 'T', 'Ň' => 'N', 'Ā' => 'A', 'Ķ' => 'K', 'Ŝ' => 'S', 'Ỳ' => 'Y', 'Ņ' => 'N', 'Ĺ' => 'L', 'Ħ' => 'H', 'Ṗ' => 'P', 'Ó' => 'O', 'Ú' => 'U', 'Ě' => 'E', 'É' => 'E', 'Ç' => 'C', 'Ẁ' => 'W', 'Ċ' => 'C', 'Õ' => 'O', 'Ṡ' => 'S', 'Ø' => 'O', 'Ģ' => 'G', 'Ŧ' => 'T', 'Ș' => 'S', 'Ė' => 'E', 'Ĉ' => 'C', 'Ś' => 'S', 'Î' => 'I', 'Ű' => 'U', 'Ć' => 'C', 'Ę' => 'E', 'Ŵ' => 'W', 'Ṫ' => 'T', 'Ū' => 'U', 'Č' => 'C', 'Ö' => 'Oe', 'È' => 'E', 'Ŷ' => 'Y', 'Ą' => 'A', 'Ł' => 'L', 'Ų' => 'U', 'Ů' => 'U', 'Ş' => 'S', 'Ğ' => 'G', 'Ļ' => 'L', 'Ƒ' => 'F', 'Ž' => 'Z', 'Ẃ' => 'W', 'Ḃ' => 'B', 'Å' => 'A', 'Ì' => 'I', 'Ï' => 'I', 'Ḋ' => 'D', 'Ť' => 'T', 'Ŗ' => 'R', 'Ä' => 'Ae', 'Í' => 'I', 'Ŕ' => 'R', 'Ê' => 'E', 'Ü' => 'Ue', 'Ò' => 'O', 'Ē' => 'E', 'Ñ' => 'N', 'Ń' => 'N', 'Ĥ' => 'H', 'Ĝ' => 'G', 'Đ' => 'D', 'Ĵ' => 'J', 'Ÿ' => 'Y', 'Ũ' => 'U', 'Ŭ' => 'U', 'Ư' => 'U', 'Ţ' => 'T', 'Ý' => 'Y', 'Ő' => 'O', 'Â' => 'A', 'Ľ' => 'L', 'Ẅ' => 'W', 'Ż' => 'Z', 'Ī' => 'I', 'Ã' => 'A', 'Ġ' => 'G', 'Ṁ' => 'M', 'Ō' => 'O', 'Ĩ' => 'I', 'Ù' => 'U', 'Į' => 'I', 'Ź' => 'Z', 'Á' => 'A', 'Û' => 'U', 'Þ' => 'Th', 'Ð' => 'Dh', 'Æ' => 'Ae', 'Ĕ' => 'E', 'Œ' => 'Oe'); } $string = str_replace(array_keys($UTF8_UPPER_ACCENTS), array_values($UTF8_UPPER_ACCENTS), $string); } return $string; } } PK���\�@7.v.v&libraries/joomla/language/language.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Allows for quoting in language .ini files. */ define('_QQ_', '"'); /** * Languages/translation handler class * * @since 11.1 */ class JLanguage { /** * Array of JLanguage objects * * @var JLanguage[] * @since 11.1 */ protected static $languages = array(); /** * Debug language, If true, highlights if string isn't found. * * @var boolean * @since 11.1 */ protected $debug = false; /** * The default language, used when a language file in the requested language does not exist. * * @var string * @since 11.1 */ protected $default = 'en-GB'; /** * An array of orphaned text. * * @var array * @since 11.1 */ protected $orphans = array(); /** * Array holding the language metadata. * * @var array * @since 11.1 */ protected $metadata = null; /** * Array holding the language locale or boolean null if none. * * @var array|boolean * @since 11.1 */ protected $locale = null; /** * The language to load. * * @var string * @since 11.1 */ protected $lang = null; /** * A nested array of language files that have been loaded * * @var array * @since 11.1 */ protected $paths = array(); /** * List of language files that are in error state * * @var array * @since 11.1 */ protected $errorfiles = array(); /** * Translations * * @var array * @since 11.1 */ protected $strings = array(); /** * An array of used text, used during debugging. * * @var array * @since 11.1 */ protected $used = array(); /** * Counter for number of loads. * * @var integer * @since 11.1 */ protected $counter = 0; /** * An array used to store overrides. * * @var array * @since 11.1 */ protected $override = array(); /** * Name of the transliterator function for this language. * * @var string * @since 11.1 */ protected $transliterator = null; /** * Name of the pluralSuffixesCallback function for this language. * * @var callable * @since 11.1 */ protected $pluralSuffixesCallback = null; /** * Name of the ignoredSearchWordsCallback function for this language. * * @var callable * @since 11.1 */ protected $ignoredSearchWordsCallback = null; /** * Name of the lowerLimitSearchWordCallback function for this language. * * @var callable * @since 11.1 */ protected $lowerLimitSearchWordCallback = null; /** * Name of the uppperLimitSearchWordCallback function for this language. * * @var callable * @since 11.1 */ protected $upperLimitSearchWordCallback = null; /** * Name of the searchDisplayedCharactersNumberCallback function for this language. * * @var callable * @since 11.1 */ protected $searchDisplayedCharactersNumberCallback = null; /** * Constructor activating the default information of the language. * * @param string $lang The language * @param boolean $debug Indicates if language debugging is enabled. * * @since 11.1 */ public function __construct($lang = null, $debug = false) { $this->strings = array(); if ($lang == null) { $lang = $this->default; } $this->lang = $lang; $this->metadata = $this->getMetadata($this->lang); $this->setDebug($debug); $filename = JPATH_BASE . "/language/overrides/$lang.override.ini"; if (file_exists($filename) && $contents = $this->parse($filename)) { if (is_array($contents)) { // Sort the underlying heap by key values to optimize merging ksort($contents, SORT_STRING); $this->override = $contents; } unset($contents); } // Look for a language specific localise class $class = str_replace('-', '_', $lang . 'Localise'); $paths = array(); if (defined('JPATH_SITE')) { // Note: Manual indexing to enforce load order. $paths[0] = JPATH_SITE . "/language/overrides/$lang.localise.php"; $paths[2] = JPATH_SITE . "/language/$lang/$lang.localise.php"; } if (defined('JPATH_ADMINISTRATOR')) { // Note: Manual indexing to enforce load order. $paths[1] = JPATH_ADMINISTRATOR . "/language/overrides/$lang.localise.php"; $paths[3] = JPATH_ADMINISTRATOR . "/language/$lang/$lang.localise.php"; } ksort($paths); $path = reset($paths); while (!class_exists($class) && $path) { if (file_exists($path)) { require_once $path; } $path = next($paths); } if (class_exists($class)) { /* Class exists. Try to find * -a transliterate method, * -a getPluralSuffixes method, * -a getIgnoredSearchWords method * -a getLowerLimitSearchWord method * -a getUpperLimitSearchWord method * -a getSearchDisplayCharactersNumber method */ if (method_exists($class, 'transliterate')) { $this->transliterator = array($class, 'transliterate'); } if (method_exists($class, 'getPluralSuffixes')) { $this->pluralSuffixesCallback = array($class, 'getPluralSuffixes'); } if (method_exists($class, 'getIgnoredSearchWords')) { $this->ignoredSearchWordsCallback = array($class, 'getIgnoredSearchWords'); } if (method_exists($class, 'getLowerLimitSearchWord')) { $this->lowerLimitSearchWordCallback = array($class, 'getLowerLimitSearchWord'); } if (method_exists($class, 'getUpperLimitSearchWord')) { $this->upperLimitSearchWordCallback = array($class, 'getUpperLimitSearchWord'); } if (method_exists($class, 'getSearchDisplayedCharactersNumber')) { $this->searchDisplayedCharactersNumberCallback = array($class, 'getSearchDisplayedCharactersNumber'); } } $this->load(); } /** * Returns a language object. * * @param string $lang The language to use. * @param boolean $debug The debug mode. * * @return JLanguage The Language object. * * @since 11.1 */ public static function getInstance($lang, $debug = false) { if (!isset(self::$languages[$lang . $debug])) { self::$languages[$lang . $debug] = new JLanguage($lang, $debug); } return self::$languages[$lang . $debug]; } /** * Translate function, mimics the php gettext (alias _) function. * * The function checks if $jsSafe is true, then if $interpretBackslashes is true. * * @param string $string The string to translate * @param boolean $jsSafe Make the result javascript safe * @param boolean $interpretBackSlashes Interpret \t and \n * * @return string The translation of the string * * @since 11.1 */ public function _($string, $jsSafe = false, $interpretBackSlashes = true) { // Detect empty string if ($string == '') { return ''; } $key = strtoupper($string); if (isset($this->strings[$key])) { $string = $this->debug ? '**' . $this->strings[$key] . '**' : $this->strings[$key]; // Store debug information if ($this->debug) { $caller = $this->getCallerInfo(); if (!array_key_exists($key, $this->used)) { $this->used[$key] = array(); } $this->used[$key][] = $caller; } } else { if ($this->debug) { $caller = $this->getCallerInfo(); $caller['string'] = $string; if (!array_key_exists($key, $this->orphans)) { $this->orphans[$key] = array(); } $this->orphans[$key][] = $caller; $string = '??' . $string . '??'; } } if ($jsSafe) { // Javascript filter $string = addslashes($string); } elseif ($interpretBackSlashes) { // Interpret \n and \t characters $string = str_replace(array('\\\\', '\t', '\n'), array("\\", "\t", "\n"), $string); } return $string; } /** * Transliterate function * * This method processes a string and replaces all accented UTF-8 characters by unaccented * ASCII-7 "equivalents". * * @param string $string The string to transliterate. * * @return string The transliteration of the string. * * @since 11.1 */ public function transliterate($string) { if ($this->transliterator !== null) { return call_user_func($this->transliterator, $string); } $string = JLanguageTransliterate::utf8_latin_to_ascii($string); $string = JString::strtolower($string); return $string; } /** * Getter for transliteration function * * @return callable The transliterator function * * @since 11.1 */ public function getTransliterator() { return $this->transliterator; } /** * Set the transliteration function. * * @param callable $function Function name or the actual function. * * @return callable The previous function. * * @since 11.1 */ public function setTransliterator($function) { $previous = $this->transliterator; $this->transliterator = $function; return $previous; } /** * Returns an array of suffixes for plural rules. * * @param integer $count The count number the rule is for. * * @return array The array of suffixes. * * @since 11.1 */ public function getPluralSuffixes($count) { if ($this->pluralSuffixesCallback !== null) { return call_user_func($this->pluralSuffixesCallback, $count); } else { return array((string) $count); } } /** * Getter for pluralSuffixesCallback function. * * @return callable Function name or the actual function. * * @since 11.1 */ public function getPluralSuffixesCallback() { return $this->pluralSuffixesCallback; } /** * Set the pluralSuffixes function. * * @param callable $function Function name or actual function. * * @return callable The previous function. * * @since 11.1 */ public function setPluralSuffixesCallback($function) { $previous = $this->pluralSuffixesCallback; $this->pluralSuffixesCallback = $function; return $previous; } /** * Returns an array of ignored search words * * @return array The array of ignored search words. * * @since 11.1 */ public function getIgnoredSearchWords() { if ($this->ignoredSearchWordsCallback !== null) { return call_user_func($this->ignoredSearchWordsCallback); } else { return array(); } } /** * Getter for ignoredSearchWordsCallback function. * * @return callable Function name or the actual function. * * @since 11.1 */ public function getIgnoredSearchWordsCallback() { return $this->ignoredSearchWordsCallback; } /** * Setter for the ignoredSearchWordsCallback function * * @param callable $function Function name or actual function. * * @return callable The previous function. * * @since 11.1 */ public function setIgnoredSearchWordsCallback($function) { $previous = $this->ignoredSearchWordsCallback; $this->ignoredSearchWordsCallback = $function; return $previous; } /** * Returns a lower limit integer for length of search words * * @return integer The lower limit integer for length of search words (3 if no value was set for a specific language). * * @since 11.1 */ public function getLowerLimitSearchWord() { if ($this->lowerLimitSearchWordCallback !== null) { return call_user_func($this->lowerLimitSearchWordCallback); } else { return 3; } } /** * Getter for lowerLimitSearchWordCallback function * * @return callable Function name or the actual function. * * @since 11.1 */ public function getLowerLimitSearchWordCallback() { return $this->lowerLimitSearchWordCallback; } /** * Setter for the lowerLimitSearchWordCallback function. * * @param callable $function Function name or actual function. * * @return callable The previous function. * * @since 11.1 */ public function setLowerLimitSearchWordCallback($function) { $previous = $this->lowerLimitSearchWordCallback; $this->lowerLimitSearchWordCallback = $function; return $previous; } /** * Returns an upper limit integer for length of search words * * @return integer The upper limit integer for length of search words (200 if no value was set or if default value is < 200). * * @since 11.1 */ public function getUpperLimitSearchWord() { if ($this->upperLimitSearchWordCallback !== null && call_user_func($this->upperLimitSearchWordCallback) > 200) { return call_user_func($this->upperLimitSearchWordCallback); } return 200; } /** * Getter for upperLimitSearchWordCallback function * * @return callable Function name or the actual function. * * @since 11.1 */ public function getUpperLimitSearchWordCallback() { return $this->upperLimitSearchWordCallback; } /** * Setter for the upperLimitSearchWordCallback function * * @param callable $function Function name or the actual function. * * @return callable The previous function. * * @since 11.1 */ public function setUpperLimitSearchWordCallback($function) { $previous = $this->upperLimitSearchWordCallback; $this->upperLimitSearchWordCallback = $function; return $previous; } /** * Returns the number of characters displayed in search results. * * @return integer The number of characters displayed (200 if no value was set for a specific language). * * @since 11.1 */ public function getSearchDisplayedCharactersNumber() { if ($this->searchDisplayedCharactersNumberCallback !== null) { return call_user_func($this->searchDisplayedCharactersNumberCallback); } else { return 200; } } /** * Getter for searchDisplayedCharactersNumberCallback function * * @return callable Function name or the actual function. * * @since 11.1 */ public function getSearchDisplayedCharactersNumberCallback() { return $this->searchDisplayedCharactersNumberCallback; } /** * Setter for the searchDisplayedCharactersNumberCallback function. * * @param callable $function Function name or the actual function. * * @return callable The previous function. * * @since 11.1 */ public function setSearchDisplayedCharactersNumberCallback($function) { $previous = $this->searchDisplayedCharactersNumberCallback; $this->searchDisplayedCharactersNumberCallback = $function; return $previous; } /** * Checks if a language exists. * * This is a simple, quick check for the directory that should contain language files for the given user. * * @param string $lang Language to check. * @param string $basePath Optional path to check. * * @return boolean True if the language exists. * * @since 11.1 */ public static function exists($lang, $basePath = JPATH_BASE) { static $paths = array(); // Return false if no language was specified if (!$lang) { return false; } $path = $basePath . '/language/' . $lang; // Return previous check results if it exists if (isset($paths[$path])) { return $paths[$path]; } // Check if the language exists $paths[$path] = is_dir($path); return $paths[$path]; } /** * Loads a single language file and appends the results to the existing strings * * @param string $extension The extension for which a language file should be loaded. * @param string $basePath The basepath to use. * @param string $lang The language to load, default null for the current language. * @param boolean $reload Flag that will force a language to be reloaded if set to true. * @param boolean $default Flag that force the default language to be loaded if the current does not exist. * * @return boolean True if the file has successfully loaded. * * @since 11.1 */ public function load($extension = 'joomla', $basePath = JPATH_BASE, $lang = null, $reload = false, $default = true) { // Load the default language first if we're not debugging and a non-default language is requested to be loaded // with $default set to true if (!$this->debug && ($lang != $this->default) && $default) { $this->load($extension, $basePath, $this->default, false, true); } if (!$lang) { $lang = $this->lang; } $path = self::getLanguagePath($basePath, $lang); $internal = $extension == 'joomla' || $extension == ''; $filename = $internal ? $lang : $lang . '.' . $extension; $filename = "$path/$filename.ini"; if (isset($this->paths[$extension][$filename]) && !$reload) { // This file has already been tested for loading. $result = $this->paths[$extension][$filename]; } else { // Load the language file $result = $this->loadLanguage($filename, $extension); // Check whether there was a problem with loading the file if ($result === false && $default) { // No strings, so either file doesn't exist or the file is invalid $oldFilename = $filename; // Check the standard file name $path = self::getLanguagePath($basePath, $this->default); $filename = $internal ? $this->default : $this->default . '.' . $extension; $filename = "$path/$filename.ini"; // If the one we tried is different than the new name, try again if ($oldFilename != $filename) { $result = $this->loadLanguage($filename, $extension, false); } } } return $result; } /** * Loads a language file. * * This method will not note the successful loading of a file - use load() instead. * * @param string $filename The name of the file. * @param string $extension The name of the extension. * * @return boolean True if new strings have been added to the language * * @see JLanguage::load() * @since 11.1 */ protected function loadLanguage($filename, $extension = 'unknown') { $this->counter++; $result = false; $strings = false; if (file_exists($filename)) { $strings = $this->parse($filename); } if ($strings) { if (is_array($strings)) { // Sort the underlying heap by key values to optimize merging ksort($strings, SORT_STRING); $this->strings = array_merge($this->strings, $strings); } if (is_array($strings) && count($strings)) { // Do not bother with ksort here. Since the originals were sorted, PHP will already have chosen the best heap. $this->strings = array_merge($this->strings, $this->override); $result = true; } } // Record the result of loading the extension's file. if (!isset($this->paths[$extension])) { $this->paths[$extension] = array(); } $this->paths[$extension][$filename] = $result; return $result; } /** * Parses a language file. * * @param string $filename The name of the file. * * @return array The array of parsed strings. * * @since 11.1 */ protected function parse($filename) { if ($this->debug) { // Capture hidden PHP errors from the parsing. $php_errormsg = null; $track_errors = ini_get('track_errors'); ini_set('track_errors', true); } $contents = file_get_contents($filename); $contents = str_replace('_QQ_', '"\""', $contents); $strings = @parse_ini_string($contents); if (!is_array($strings)) { $strings = array(); } if ($this->debug) { // Restore error tracking to what it was before. ini_set('track_errors', $track_errors); // Initialise variables for manually parsing the file for common errors. $blacklist = array('YES', 'NO', 'NULL', 'FALSE', 'ON', 'OFF', 'NONE', 'TRUE'); $this->debug = false; $errors = array(); // Open the file as a stream. $file = new SplFileObject($filename); foreach ($file as $lineNumber => $line) { // Avoid BOM error as BOM is OK when using parse_ini. if ($lineNumber == 0) { $line = str_replace("\xEF\xBB\xBF", '', $line); } $line = trim($line); // Ignore comment lines. if (!strlen($line) || $line['0'] == ';') { continue; } // Ignore grouping tag lines, like: [group] if (preg_match('#^\[[^\]]*\](\s*;.*)?$#', $line)) { continue; } // Remove the "_QQ_" from the equation $line = str_replace('"_QQ_"', '', $line); $realNumber = $lineNumber + 1; // Check for any incorrect uses of _QQ_. if (strpos($line, '_QQ_') !== false) { $errors[] = $realNumber; continue; } // Check for odd number of double quotes. if (substr_count($line, '"') % 2 != 0) { $errors[] = $realNumber; continue; } // Check that the line passes the necessary format. if (!preg_match('#^[A-Z][A-Z0-9_\-\.]*\s*=\s*".*"(\s*;.*)?$#', $line)) { $errors[] = $realNumber; continue; } // Check that the key is not in the blacklist. $key = strtoupper(trim(substr($line, 0, strpos($line, '=')))); if (in_array($key, $blacklist)) { $errors[] = $realNumber; } } // Check if we encountered any errors. if (count($errors)) { $this->errorfiles[$filename] = $filename . ' : error(s) in line(s) ' . implode(', ', $errors); } elseif ($php_errormsg) { // We didn't find any errors but there's probably a parse notice. $this->errorfiles['PHP' . $filename] = 'PHP parser errors :' . $php_errormsg; } $this->debug = true; } return $strings; } /** * Get a metadata language property. * * @param string $property The name of the property. * @param mixed $default The default value. * * @return mixed The value of the property. * * @since 11.1 */ public function get($property, $default = null) { if (isset($this->metadata[$property])) { return $this->metadata[$property]; } return $default; } /** * Determine who called JLanguage or JText. * * @return array Caller information. * * @since 11.1 */ protected function getCallerInfo() { // Try to determine the source if none was provided if (!function_exists('debug_backtrace')) { return null; } $backtrace = debug_backtrace(); $info = array(); // Search through the backtrace to our caller $continue = true; while ($continue && next($backtrace)) { $step = current($backtrace); $class = @ $step['class']; // We're looking for something outside of language.php if ($class != 'JLanguage' && $class != 'JText') { $info['function'] = @ $step['function']; $info['class'] = $class; $info['step'] = prev($backtrace); // Determine the file and name of the file $info['file'] = @ $step['file']; $info['line'] = @ $step['line']; $continue = false; } } return $info; } /** * Getter for Name. * * @return string Official name element of the language. * * @since 11.1 */ public function getName() { return $this->metadata['name']; } /** * Get a list of language files that have been loaded. * * @param string $extension An optional extension name. * * @return array * * @since 11.1 */ public function getPaths($extension = null) { if (isset($extension)) { if (isset($this->paths[$extension])) { return $this->paths[$extension]; } return null; } else { return $this->paths; } } /** * Get a list of language files that are in error state. * * @return array * * @since 11.1 */ public function getErrorFiles() { return $this->errorfiles; } /** * Getter for the language tag (as defined in RFC 3066) * * @return string The language tag. * * @since 11.1 */ public function getTag() { return $this->metadata['tag']; } /** * Get the RTL property. * * @return boolean True is it an RTL language. * * @since 11.1 */ public function isRtl() { return (bool) $this->metadata['rtl']; } /** * Set the Debug property. * * @param boolean $debug The debug setting. * * @return boolean Previous value. * * @since 11.1 */ public function setDebug($debug) { $previous = $this->debug; $this->debug = (boolean) $debug; return $previous; } /** * Get the Debug property. * * @return boolean True is in debug mode. * * @since 11.1 */ public function getDebug() { return $this->debug; } /** * Get the default language code. * * @return string Language code. * * @since 11.1 */ public function getDefault() { return $this->default; } /** * Set the default language code. * * @param string $lang The language code. * * @return string Previous value. * * @since 11.1 */ public function setDefault($lang) { $previous = $this->default; $this->default = $lang; return $previous; } /** * Get the list of orphaned strings if being tracked. * * @return array Orphaned text. * * @since 11.1 */ public function getOrphans() { return $this->orphans; } /** * Get the list of used strings. * * Used strings are those strings requested and found either as a string or a constant. * * @return array Used strings. * * @since 11.1 */ public function getUsed() { return $this->used; } /** * Determines is a key exists. * * @param string $string The key to check. * * @return boolean True, if the key exists. * * @since 11.1 */ public function hasKey($string) { $key = strtoupper($string); return isset($this->strings[$key]); } /** * Returns a associative array holding the metadata. * * @param string $lang The name of the language. * * @return mixed If $lang exists return key/value pair with the language metadata, otherwise return NULL. * * @since 11.1 */ public static function getMetadata($lang) { $path = self::getLanguagePath(JPATH_BASE, $lang); $file = $lang . '.xml'; $result = null; if (is_file("$path/$file")) { $result = self::parseXMLLanguageFile("$path/$file"); } if (empty($result)) { return null; } return $result; } /** * Returns a list of known languages for an area * * @param string $basePath The basepath to use * * @return array key/value pair with the language file and real name. * * @since 11.1 */ public static function getKnownLanguages($basePath = JPATH_BASE) { $dir = self::getLanguagePath($basePath); $knownLanguages = self::parseLanguageFiles($dir); return $knownLanguages; } /** * Get the path to a language * * @param string $basePath The basepath to use. * @param string $language The language tag. * * @return string language related path or null. * * @since 11.1 */ public static function getLanguagePath($basePath = JPATH_BASE, $language = null) { $dir = $basePath . '/language'; if (!empty($language)) { $dir .= '/' . $language; } return $dir; } /** * Set the language attributes to the given language. * * Once called, the language still needs to be loaded using JLanguage::load(). * * @param string $lang Language code. * * @return string Previous value. * * @since 11.1 * @deprecated 4.0 (CMS) - Instantiate a new JLanguage object instead */ public function setLanguage($lang) { JLog::add(__METHOD__ . ' is deprecated. Instantiate a new JLanguage object instead.', JLog::WARNING, 'deprecated'); $previous = $this->lang; $this->lang = $lang; $this->metadata = $this->getMetadata($this->lang); return $previous; } /** * Get the language locale based on current language. * * @return array The locale according to the language. * * @since 11.1 */ public function getLocale() { if (!isset($this->locale)) { $locale = str_replace(' ', '', isset($this->metadata['locale']) ? $this->metadata['locale'] : ''); if ($locale) { $this->locale = explode(',', $locale); } else { $this->locale = false; } } return $this->locale; } /** * Get the first day of the week for this language. * * @return integer The first day of the week according to the language * * @since 11.1 */ public function getFirstDay() { return (int) (isset($this->metadata['firstDay']) ? $this->metadata['firstDay'] : 0); } /** * Get the weekends days for this language. * * @return string The weekend days of the week separated by a comma according to the language * * @since 3.2 */ public function getWeekEnd() { return (isset($this->metadata['weekEnd']) && $this->metadata['weekEnd']) ? $this->metadata['weekEnd'] : '0,6'; } /** * Searches for language directories within a certain base dir. * * @param string $dir directory of files. * * @return array Array holding the found languages as filename => real name pairs. * * @since 11.1 */ public static function parseLanguageFiles($dir = null) { $languages = array(); $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)); foreach ($iterator as $file) { $langs = array(); $fileName = $file->getFilename(); if (!$file->isFile() || !preg_match("/^([-_A-Za-z]*)\.xml$/", $fileName)) { continue; } try { $metadata = self::parseXMLLanguageFile($file->getRealPath()); if ($metadata) { $lang = str_replace('.xml', '', $fileName); $langs[$lang] = $metadata; } $languages = array_merge($languages, $langs); } catch (RuntimeException $e) { } } return $languages; } /** * Parse XML file for language information. * * @param string $path Path to the XML files. * * @return array Array holding the found metadata as a key => value pair. * * @since 11.1 * @throws RuntimeException */ public static function parseXMLLanguageFile($path) { if (!is_readable($path)) { throw new RuntimeException('File not found or not readable'); } // Try to load the file $xml = simplexml_load_file($path); if (!$xml) { return null; } // Check that it's a metadata file if ((string) $xml->getName() != 'metafile') { return null; } $metadata = array(); foreach ($xml->metadata->children() as $child) { $metadata[$child->getName()] = (string) $child; } return $metadata; } } PK���\j����$libraries/joomla/language/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Language helper class * * @since 11.1 */ class JLanguageHelper { /** * Builds a list of the system languages which can be used in a select option * * @param string $actualLanguage Client key for the area * @param string $basePath Base path to use * @param boolean $caching True if caching is used * @param boolean $installed Get only installed languages * * @return array List of system languages * * @since 11.1 */ public static function createLanguageList($actualLanguage, $basePath = JPATH_BASE, $caching = false, $installed = false) { $list = array(); // Cache activation $langs = JLanguage::getKnownLanguages($basePath); if ($installed) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('element') ->from('#__extensions') ->where('type=' . $db->quote('language')) ->where('state=0') ->where('enabled=1') ->where('client_id=' . ($basePath == JPATH_ADMINISTRATOR ? 1 : 0)); $db->setQuery($query); $installed_languages = $db->loadObjectList('element'); } foreach ($langs as $lang => $metadata) { if (!$installed || array_key_exists($lang, $installed_languages)) { $option = array(); $option['text'] = $metadata['name']; $option['value'] = $lang; if ($lang == $actualLanguage) { $option['selected'] = 'selected="selected"'; } $list[] = $option; } } return $list; } /** * Tries to detect the language. * * @return string locale or null if not found * * @since 11.1 */ public static function detectLanguage() { if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $browserLangs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); $systemLangs = self::getLanguages(); foreach ($browserLangs as $browserLang) { // Slice out the part before ; on first step, the part before - on second, place into array $browserLang = substr($browserLang, 0, strcspn($browserLang, ';')); $primary_browserLang = substr($browserLang, 0, 2); foreach ($systemLangs as $systemLang) { // Take off 3 letters iso code languages as they can't match browsers' languages and default them to en $Jinstall_lang = $systemLang->lang_code; if (strlen($Jinstall_lang) < 6) { if (strtolower($browserLang) == strtolower(substr($systemLang->lang_code, 0, strlen($browserLang)))) { return $systemLang->lang_code; } elseif ($primary_browserLang == substr($systemLang->lang_code, 0, 2)) { $primaryDetectedLang = $systemLang->lang_code; } } } if (isset($primaryDetectedLang)) { return $primaryDetectedLang; } } } return null; } /** * Get available languages * * @param string $key Array key * * @return array An array of published languages * * @since 11.1 */ public static function getLanguages($key = 'default') { static $languages; if (empty($languages)) { // Installation uses available languages if (JFactory::getApplication()->getClientId() == 2) { $languages[$key] = array(); $knownLangs = JLanguage::getKnownLanguages(JPATH_BASE); foreach ($knownLangs as $metadata) { // Take off 3 letters iso code languages as they can't match browsers' languages and default them to en $obj = new stdClass; $obj->lang_code = $metadata['tag']; $languages[$key][] = $obj; } } else { $cache = JFactory::getCache('com_languages', ''); if (!$languages = $cache->get('languages')) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('*') ->from('#__languages') ->where('published=1') ->order('ordering ASC'); $db->setQuery($query); $languages['default'] = $db->loadObjectList(); $languages['sef'] = array(); $languages['lang_code'] = array(); if (isset($languages['default'][0])) { foreach ($languages['default'] as $lang) { $languages['sef'][$lang->sef] = $lang; $languages['lang_code'][$lang->lang_code] = $lang; } } $cache->store($languages, 'languages'); } } } return $languages[$key]; } } PK���\��?��3libraries/joomla/language/wrapper/transliterate.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JLanguageTransliterate * * @package Joomla.Platform * @subpackage Language * @since 3.4 */ class JLanguageWrapperTransliterate { /** * Helper wrapper method for utf8_latin_to_ascii * * @param string $string String to transliterate. * @param integer $case Optionally specify upper or lower case. Default to null. * * @return string Transliterated string. * * @see JLanguageTransliterate::utf8_latin_to_ascii() * @since 3.4 */ public function utf8_latin_to_ascii($string, $case = 0) { return JLanguageTransliterate::utf8_latin_to_ascii($string, $case); } } PK���\j��l~~,libraries/joomla/language/wrapper/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JLanguageHelper * * @package Joomla.Platform * @subpackage Language * @since 3.4 */ class JLanguageWrapperHelper { /** * Helper wrapper method for createLanguageList * * @param string $actualLanguage Client key for the area. * @param string $basePath Base path to use. * @param boolean $caching True if caching is used. * @param boolean $installed Get only installed languages. * * @return array List of system languages. * * @see JLanguageHelper::createLanguageList * @since 3.4 */ public function createLanguageList($actualLanguage, $basePath = JPATH_BASE, $caching = false, $installed = false) { return JLanguageHelper::createLanguageList($actualLanguage, $basePath, $caching, $installed); } /** * Helper wrapper method for detectLanguage * * @return string locale or null if not found. * * @see JLanguageHelper::detectLanguage * @since 3.4 */ public function detectLanguage() { return JLanguageHelper::detectLanguage(); } /** * Helper wrapper method for getLanguages * * @param string $key Array key * * @return array An array of published languages. * * @see JLanguageHelper::getLanguages * @since 3.4 */ public function getLanguages($key = 'default') { return JLanguageHelper::getLanguages($key); } } PK���\�0 �b b *libraries/joomla/language/wrapper/text.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JText * * @package Joomla.Platform * @subpackage Language * @since 3.4 */ class JLanguageWrapperText { /** * Helper wrapper method for _ * * @param string $string The string to translate. * @param mixed $jsSafe Boolean: Make the result javascript safe. * @param boolean $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation). * @param boolean $script To indicate that the string will be push in the javascript language store. * * @return string The translated string or the key is $script is true. * * @see JText::_ * @since 3.4 */ public function _($string, $jsSafe = false, $interpretBackSlashes = true, $script = false) { return JText::_($string, $jsSafe, $interpretBackSlashes, $script); } /** * Helper wrapper method for alt * * @param string $string The string to translate. * @param string $alt The alternate option for global string. * @param mixed $jsSafe Boolean: Make the result javascript safe. * @param boolean $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation). * @param boolean $script To indicate that the string will be pushed in the javascript language store. * * @return string The translated string or the key if $script is true. * * @see JText::alt * @since 3.4 */ public function alt($string, $alt, $jsSafe = false, $interpretBackSlashes = true, $script = false) { return JText::alt($string, $alt, $jsSafe, $interpretBackSlashes, $script); } /** * Helper wrapper method for plural * * @param string $string The format string. * @param integer $n The number of items. * * @return string The translated strings or the key if 'script' is true in the array of options. * * @see JText::plural * @since 3.4 */ public function plural($string, $n) { return JText::plural($string, $n); } /** * Helper wrapper method for sprintf * * @param string $string The format string. * * @return string The translated strings or the key if 'script' is true in the array of options. * * @see JText::sprintf * @since 3.4 */ public function sprintf($string) { return JText::sprintf($string); } /** * Helper wrapper method for printf * * @param format $string The format string. * * @return mixed * * @see JText::printf * @since 3.4 */ public function printf($string) { return JText::printf($string); } /** * Helper wrapper method for script * * @param string $string The JText key. * @param boolean $jsSafe Ensure the output is JavaScript safe. * @param boolean $interpretBackSlashes Interpret \t and \n. * * @return string * * @see JText::script * @since 3.4 */ public function script($string = null, $jsSafe = false, $interpretBackSlashes = true) { return JText::script($string, $jsSafe, $interpretBackSlashes); } } PK���\m���*�*"libraries/joomla/language/text.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Text handling class. * * @since 11.1 */ class JText { /** * JavaScript strings * * @var array * @since 11.1 */ protected static $strings = array(); /** * Translates a string into the current language. * * Examples: * <script>alert(Joomla.JText._('<?php echo JText::_("JDEFAULT", array("script"=>true));?>'));</script> * will generate an alert message containing 'Default' * <?php echo JText::_("JDEFAULT");?> it will generate a 'Default' string * * @param string $string The string to translate. * @param mixed $jsSafe Boolean: Make the result javascript safe. * @param boolean $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation) * @param boolean $script To indicate that the string will be push in the javascript language store * * @return string The translated string or the key is $script is true * * @since 11.1 */ public static function _($string, $jsSafe = false, $interpretBackSlashes = true, $script = false) { if (is_array($jsSafe)) { if (array_key_exists('interpretBackSlashes', $jsSafe)) { $interpretBackSlashes = (boolean) $jsSafe['interpretBackSlashes']; } if (array_key_exists('script', $jsSafe)) { $script = (boolean) $jsSafe['script']; } $jsSafe = array_key_exists('jsSafe', $jsSafe) ? (boolean) $jsSafe['jsSafe'] : false; } if (self::passSprintf($string, $jsSafe, $interpretBackSlashes, $script)) { return $string; } $lang = JFactory::getLanguage(); if ($script) { self::$strings[$string] = $lang->_($string, $jsSafe, $interpretBackSlashes); return $string; } return $lang->_($string, $jsSafe, $interpretBackSlashes); } /** * Checks the string if it should be interpreted as sprintf and runs sprintf over it. * * @param string &$string The string to translate. * @param mixed $jsSafe Boolean: Make the result javascript safe. * @param boolean $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation) * @param boolean $script To indicate that the string will be push in the javascript language store * * @return boolean Whether the string be interpreted as sprintf * * @since 3.4.4 */ private static function passSprintf(&$string, $jsSafe = false, $interpretBackSlashes = true, $script = false) { // Check if string contains a comma if (strpos($string, ',') === false) { return false; } $lang = JFactory::getLanguage(); $string_parts = explode(',', $string); // Pass all parts through the JText translator foreach ($string_parts as $i => $str) { $string_parts[$i] = $lang->_($str, $jsSafe, $interpretBackSlashes); } $first_part = array_shift($string_parts); // Replace custom named placeholders with sprinftf style placeholders $first_part = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $first_part); // Check if string contains sprintf placeholders if (!preg_match('/%([0-9]+\$)?s/', $first_part)) { return false; } $final_string = vsprintf($first_part, $string_parts); // Return false if string hasn't changed if ($first_part === $final_string) { return false; } $string = $final_string; if ($script) { foreach ($string_parts as $i => $str) { self::$strings[$str] = $string_parts[$i]; } } return true; } /** * Translates a string into the current language. * * Examples: * <?php echo JText::alt("JALL","language");?> it will generate a 'All' string in English but a "Toutes" string in French * <?php echo JText::alt("JALL","module");?> it will generate a 'All' string in English but a "Tous" string in French * * @param string $string The string to translate. * @param string $alt The alternate option for global string * @param mixed $jsSafe Boolean: Make the result javascript safe. * @param boolean $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation) * @param boolean $script To indicate that the string will be pushed in the javascript language store * * @return string The translated string or the key if $script is true * * @since 11.1 */ public static function alt($string, $alt, $jsSafe = false, $interpretBackSlashes = true, $script = false) { $lang = JFactory::getLanguage(); if ($lang->hasKey($string . '_' . $alt)) { $string .= '_' . $alt; } return self::_($string, $jsSafe, $interpretBackSlashes, $script); } /** * Like JText::sprintf but tries to pluralise the string. * * Note that this method can take a mixed number of arguments as for the sprintf function. * * The last argument can take an array of options: * * array('jsSafe'=>boolean, 'interpretBackSlashes'=>boolean, 'script'=>boolean) * * where: * * jsSafe is a boolean to generate a javascript safe strings. * interpretBackSlashes is a boolean to interpret backslashes \\->\, \n->new line, \t->tabulation. * script is a boolean to indicate that the string will be push in the javascript language store. * * Examples: * <script>alert(Joomla.JText._('<?php echo JText::plural("COM_PLUGINS_N_ITEMS_UNPUBLISHED", 1, array("script"=>true));?>'));</script> * will generate an alert message containing '1 plugin successfully disabled' * <?php echo JText::plural("COM_PLUGINS_N_ITEMS_UNPUBLISHED", 1);?> it will generate a '1 plugin successfully disabled' string * * @param string $string The format string. * @param integer $n The number of items * * @return string The translated strings or the key if 'script' is true in the array of options * * @since 11.1 */ public static function plural($string, $n) { $lang = JFactory::getLanguage(); $args = func_get_args(); $count = count($args); if ($count < 1) { return ''; } if ($count == 1) { // Default to the normal sprintf handling. $args[0] = $lang->_($string); return call_user_func_array('sprintf', $args); } // Try the key from the language plural potential suffixes $found = false; $suffixes = $lang->getPluralSuffixes((int) $n); array_unshift($suffixes, (int) $n); foreach ($suffixes as $suffix) { $key = $string . '_' . $suffix; if ($lang->hasKey($key)) { $found = true; break; } } if (!$found) { // Not found so revert to the original. $key = $string; } if (is_array($args[$count - 1])) { $args[0] = $lang->_( $key, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false, array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true ); if (array_key_exists('script', $args[$count - 1]) && $args[$count - 1]['script']) { self::$strings[$key] = call_user_func_array('sprintf', $args); return $key; } } else { $args[0] = $lang->_($key); } return call_user_func_array('sprintf', $args); } /** * Passes a string thru a sprintf. * * Note that this method can take a mixed number of arguments as for the sprintf function. * * The last argument can take an array of options: * * array('jsSafe'=>boolean, 'interpretBackSlashes'=>boolean, 'script'=>boolean) * * where: * * jsSafe is a boolean to generate a javascript safe strings. * interpretBackSlashes is a boolean to interpret backslashes \\->\, \n->new line, \t->tabulation. * script is a boolean to indicate that the string will be push in the javascript language store. * * @param string $string The format string. * * @return string The translated strings or the key if 'script' is true in the array of options. * * @since 11.1 */ public static function sprintf($string) { $lang = JFactory::getLanguage(); $args = func_get_args(); $count = count($args); if ($count < 1) { return ''; } if (is_array($args[$count - 1])) { $args[0] = $lang->_( $string, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false, array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true ); if (array_key_exists('script', $args[$count - 1]) && $args[$count - 1]['script']) { self::$strings[$string] = call_user_func_array('sprintf', $args); return $string; } } else { $args[0] = $lang->_($string); } // Replace custom named placeholders with sprintf style placeholders $args[0] = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $args[0]); return call_user_func_array('sprintf', $args); } /** * Passes a string thru an printf. * * Note that this method can take a mixed number of arguments as for the sprintf function. * * @param format $string The format string. * * @return mixed * * @since 11.1 */ public static function printf($string) { $lang = JFactory::getLanguage(); $args = func_get_args(); $count = count($args); if ($count < 1) { return ''; } if (is_array($args[$count - 1])) { $args[0] = $lang->_( $string, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false, array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true ); } else { $args[0] = $lang->_($string); } return call_user_func_array('printf', $args); } /** * Translate a string into the current language and stores it in the JavaScript language store. * * @param string $string The JText key. * @param boolean $jsSafe Ensure the output is JavaScript safe. * @param boolean $interpretBackSlashes Interpret \t and \n. * * @return string * * @since 11.1 */ public static function script($string = null, $jsSafe = false, $interpretBackSlashes = true) { if (is_array($jsSafe)) { if (array_key_exists('interpretBackSlashes', $jsSafe)) { $interpretBackSlashes = (boolean) $jsSafe['interpretBackSlashes']; } if (array_key_exists('jsSafe', $jsSafe)) { $jsSafe = (boolean) $jsSafe['jsSafe']; } else { $jsSafe = false; } } // Add the string to the array if not null. if ($string !== null) { // Normalize the key and translate the string. self::$strings[strtoupper($string)] = JFactory::getLanguage()->_($string, $jsSafe, $interpretBackSlashes); // Load core.js dependency JHtml::_('behavior.core'); } return self::$strings; } } PK���\�(�1�1libraries/joomla/date/date.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Date * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDate is a class that stores a date and provides logic to manipulate * and render that date in a variety of formats. * * @property-read string $daysinmonth t - Number of days in the given month. * @property-read string $dayofweek N - ISO-8601 numeric representation of the day of the week. * @property-read string $dayofyear z - The day of the year (starting from 0). * @property-read boolean $isleapyear L - Whether it's a leap year. * @property-read string $day d - Day of the month, 2 digits with leading zeros. * @property-read string $hour H - 24-hour format of an hour with leading zeros. * @property-read string $minute i - Minutes with leading zeros. * @property-read string $second s - Seconds with leading zeros. * @property-read string $month m - Numeric representation of a month, with leading zeros. * @property-read string $ordinal S - English ordinal suffix for the day of the month, 2 characters. * @property-read string $week W - Numeric representation of the day of the week. * @property-read string $year Y - A full numeric representation of a year, 4 digits. * * @since 11.1 */ class JDate extends DateTime { const DAY_ABBR = "\x021\x03"; const DAY_NAME = "\x022\x03"; const MONTH_ABBR = "\x023\x03"; const MONTH_NAME = "\x024\x03"; /** * The format string to be applied when using the __toString() magic method. * * @var string * @since 11.1 */ public static $format = 'Y-m-d H:i:s'; /** * Placeholder for a DateTimeZone object with GMT as the time zone. * * @var object * @since 11.1 */ protected static $gmt; /** * Placeholder for a DateTimeZone object with the default server * time zone as the time zone. * * @var object * @since 11.1 */ protected static $stz; /** * The DateTimeZone object for usage in rending dates as strings. * * @var DateTimeZone * @since 12.1 */ protected $tz; /** * Constructor. * * @param string $date String in a format accepted by strtotime(), defaults to "now". * @param mixed $tz Time zone to be used for the date. Might be a string or a DateTimeZone object. * * @since 11.1 */ public function __construct($date = 'now', $tz = null) { // Create the base GMT and server time zone objects. if (empty(self::$gmt) || empty(self::$stz)) { self::$gmt = new DateTimeZone('GMT'); self::$stz = new DateTimeZone(@date_default_timezone_get()); } // If the time zone object is not set, attempt to build it. if (!($tz instanceof DateTimeZone)) { if ($tz === null) { $tz = self::$gmt; } elseif (is_string($tz)) { $tz = new DateTimeZone($tz); } } // If the date is numeric assume a unix timestamp and convert it. date_default_timezone_set('UTC'); $date = is_numeric($date) ? date('c', $date) : $date; // Call the DateTime constructor. parent::__construct($date, $tz); // Reset the timezone for 3rd party libraries/extension that does not use JDate date_default_timezone_set(self::$stz->getName()); // Set the timezone object for access later. $this->tz = $tz; } /** * Magic method to access properties of the date given by class to the format method. * * @param string $name The name of the property. * * @return mixed A value if the property name is valid, null otherwise. * * @since 11.1 */ public function __get($name) { $value = null; switch ($name) { case 'daysinmonth': $value = $this->format('t', true); break; case 'dayofweek': $value = $this->format('N', true); break; case 'dayofyear': $value = $this->format('z', true); break; case 'isleapyear': $value = (boolean) $this->format('L', true); break; case 'day': $value = $this->format('d', true); break; case 'hour': $value = $this->format('H', true); break; case 'minute': $value = $this->format('i', true); break; case 'second': $value = $this->format('s', true); break; case 'month': $value = $this->format('m', true); break; case 'ordinal': $value = $this->format('S', true); break; case 'week': $value = $this->format('W', true); break; case 'year': $value = $this->format('Y', true); break; default: $trace = debug_backtrace(); trigger_error( 'Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_NOTICE ); } return $value; } /** * Magic method to render the date object in the format specified in the public * static member JDate::$format. * * @return string The date as a formatted string. * * @since 11.1 */ public function __toString() { return (string) parent::format(self::$format); } /** * Proxy for new JDate(). * * @param string $date String in a format accepted by strtotime(), defaults to "now". * @param mixed $tz Time zone to be used for the date. * * @return JDate * * @since 11.3 */ public static function getInstance($date = 'now', $tz = null) { return new JDate($date, $tz); } /** * Translates day of week number to a string. * * @param integer $day The numeric day of the week. * @param boolean $abbr Return the abbreviated day string? * * @return string The day of the week. * * @since 11.1 */ public function dayToString($day, $abbr = false) { switch ($day) { case 0: return $abbr ? JText::_('SUN') : JText::_('SUNDAY'); case 1: return $abbr ? JText::_('MON') : JText::_('MONDAY'); case 2: return $abbr ? JText::_('TUE') : JText::_('TUESDAY'); case 3: return $abbr ? JText::_('WED') : JText::_('WEDNESDAY'); case 4: return $abbr ? JText::_('THU') : JText::_('THURSDAY'); case 5: return $abbr ? JText::_('FRI') : JText::_('FRIDAY'); case 6: return $abbr ? JText::_('SAT') : JText::_('SATURDAY'); } } /** * Gets the date as a formatted string in a local calendar. * * @param string $format The date format specification string (see {@link PHP_MANUAL#date}) * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. * @param boolean $translate True to translate localised strings * * @return string The date string in the specified format format. * * @since 11.1 */ public function calendar($format, $local = false, $translate = true) { return $this->format($format, $local, $translate); } /** * Gets the date as a formatted string. * * @param string $format The date format specification string (see {@link PHP_MANUAL#date}) * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. * @param boolean $translate True to translate localised strings * * @return string The date string in the specified format format. * * @since 11.1 */ public function format($format, $local = false, $translate = true) { if ($translate) { // Do string replacements for date format options that can be translated. $format = preg_replace('/(^|[^\\\])D/', "\\1" . self::DAY_ABBR, $format); $format = preg_replace('/(^|[^\\\])l/', "\\1" . self::DAY_NAME, $format); $format = preg_replace('/(^|[^\\\])M/', "\\1" . self::MONTH_ABBR, $format); $format = preg_replace('/(^|[^\\\])F/', "\\1" . self::MONTH_NAME, $format); } // If the returned time should not be local use GMT. if ($local == false) { parent::setTimezone(self::$gmt); } // Format the date. $return = parent::format($format); if ($translate) { // Manually modify the month and day strings in the formatted time. if (strpos($return, self::DAY_ABBR) !== false) { $return = str_replace(self::DAY_ABBR, $this->dayToString(parent::format('w'), true), $return); } if (strpos($return, self::DAY_NAME) !== false) { $return = str_replace(self::DAY_NAME, $this->dayToString(parent::format('w')), $return); } if (strpos($return, self::MONTH_ABBR) !== false) { $return = str_replace(self::MONTH_ABBR, $this->monthToString(parent::format('n'), true), $return); } if (strpos($return, self::MONTH_NAME) !== false) { $return = str_replace(self::MONTH_NAME, $this->monthToString(parent::format('n')), $return); } } if ($local == false) { parent::setTimezone($this->tz); } return $return; } /** * Get the time offset from GMT in hours or seconds. * * @param boolean $hours True to return the value in hours. * * @return float The time offset from GMT either in hours or in seconds. * * @since 11.1 */ public function getOffsetFromGmt($hours = false) { return (float) $hours ? ($this->tz->getOffset($this) / 3600) : $this->tz->getOffset($this); } /** * Translates month number to a string. * * @param integer $month The numeric month of the year. * @param boolean $abbr If true, return the abbreviated month string * * @return string The month of the year. * * @since 11.1 */ public function monthToString($month, $abbr = false) { switch ($month) { case 1: return $abbr ? JText::_('JANUARY_SHORT') : JText::_('JANUARY'); case 2: return $abbr ? JText::_('FEBRUARY_SHORT') : JText::_('FEBRUARY'); case 3: return $abbr ? JText::_('MARCH_SHORT') : JText::_('MARCH'); case 4: return $abbr ? JText::_('APRIL_SHORT') : JText::_('APRIL'); case 5: return $abbr ? JText::_('MAY_SHORT') : JText::_('MAY'); case 6: return $abbr ? JText::_('JUNE_SHORT') : JText::_('JUNE'); case 7: return $abbr ? JText::_('JULY_SHORT') : JText::_('JULY'); case 8: return $abbr ? JText::_('AUGUST_SHORT') : JText::_('AUGUST'); case 9: return $abbr ? JText::_('SEPTEMBER_SHORT') : JText::_('SEPTEMBER'); case 10: return $abbr ? JText::_('OCTOBER_SHORT') : JText::_('OCTOBER'); case 11: return $abbr ? JText::_('NOVEMBER_SHORT') : JText::_('NOVEMBER'); case 12: return $abbr ? JText::_('DECEMBER_SHORT') : JText::_('DECEMBER'); } } /** * Method to wrap the setTimezone() function and set the internal time zone object. * * @param DateTimeZone $tz The new DateTimeZone object. * * @return JDate * * @since 11.1 * @note This method can't be type hinted due to a PHP bug: https://bugs.php.net/bug.php?id=61483 */ public function setTimezone($tz) { $this->tz = $tz; return parent::setTimezone($tz); } /** * Gets the date as an ISO 8601 string. IETF RFC 3339 defines the ISO 8601 format * and it can be found at the IETF Web site. * * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. * * @return string The date string in ISO 8601 format. * * @link http://www.ietf.org/rfc/rfc3339.txt * @since 11.1 */ public function toISO8601($local = false) { return $this->format(DateTime::RFC3339, $local, false); } /** * Gets the date as an SQL datetime string. * * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. * @param JDatabaseDriver $db The database driver or null to use JFactory::getDbo() * * @return string The date string in SQL datetime format. * * @link http://dev.mysql.com/doc/refman/5.0/en/datetime.html * @since 11.4 */ public function toSql($local = false, JDatabaseDriver $db = null) { if ($db === null) { $db = JFactory::getDbo(); } return $this->format($db->getDateFormat(), $local, false); } /** * Gets the date as an RFC 822 string. IETF RFC 2822 supercedes RFC 822 and its definition * can be found at the IETF Web site. * * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. * * @return string The date string in RFC 822 format. * * @link http://www.ietf.org/rfc/rfc2822.txt * @since 11.1 */ public function toRFC822($local = false) { return $this->format(DateTime::RFC2822, $local, false); } /** * Gets the date as UNIX time stamp. * * @return integer The date as a UNIX timestamp. * * @since 11.1 */ public function toUnix() { return (int) parent::format('U'); } } PK���\�}���)libraries/joomla/observable/interface.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Observer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Observable Subject pattern interface for Joomla * * To make a class and its inheriting classes observable: * 1) add: implements JObservableInterface * to its class * * 2) at the end of the constructor, add: * // Create observer updater and attaches all observers interested by $this class: * $this->_observers = new JObserverUpdater($this); * JObserverMapper::attachAllObservers($this); * * 3) add the function attachObserver below to your class to add observers using the JObserverUpdater class: * public function attachObserver(JObserverInterface $observer) * { * $this->_observers->attachObserver($observer); * } * * 4) in the methods that need to be observed, add, e.g. (name of event, params of event): * $this->_observers->update('onBeforeLoad', array($keys, $reset)); * * @link https://docs.joomla.org/JObservableInterface * @since 3.1.2 */ interface JObservableInterface { /** * Adds an observer to this JObservableInterface instance. * Ideally, this method should be called fron the constructor of JObserverInterface * which should be instanciated by JObserverMapper. * The implementation of this function can use JObserverUpdater * * @param JObserverInterface $observer The observer to attach to $this observable subject * * @return void * * @since 3.1.2 */ public function attachObserver(JObserverInterface $observer); } PK���\�/;��'libraries/joomla/document/feed/feed.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * DocumentFeed class, provides an easy interface to parse and display any feed document * * @since 11.1 */ class JDocumentFeed extends JDocument { /** * Syndication URL feed element * * optional * * @var string * @since 11.1 */ public $syndicationURL = ""; /** * Image feed element * * optional * * @var object * @since 11.1 */ public $image = null; /** * Copyright feed element * * optional * * @var string * @since 11.1 */ public $copyright = ""; /** * Published date feed element * * optional * * @var string * @since 11.1 */ public $pubDate = ""; /** * Lastbuild date feed element * * optional * * @var string * @since 11.1 */ public $lastBuildDate = ""; /** * Editor feed element * * optional * * @var string * @since 11.1 */ public $editor = ""; /** * Docs feed element * * @var string * @since 11.1 */ public $docs = ""; /** * Editor email feed element * * optional * * @var string * @since 11.1 */ public $editorEmail = ""; /** * Webmaster email feed element * * optional * * @var string * @since 11.1 */ public $webmaster = ""; /** * Category feed element * * optional * * @var string * @since 11.1 */ public $category = ""; /** * TTL feed attribute * * optional * * @var string * @since 11.1 */ public $ttl = ""; /** * Rating feed element * * optional * * @var string * @since 11.1 */ public $rating = ""; /** * Skiphours feed element * * optional * * @var string * @since 11.1 */ public $skipHours = ""; /** * Skipdays feed element * * optional * * @var string * @since 11.1 */ public $skipDays = ""; /** * The feed items collection * * @var array * @since 11.1 */ public $items = array(); /** * Class constructor * * @param array $options Associative array of options * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); // Set document type $this->_type = 'feed'; } /** * Render the document * * @param boolean $cache If true, cache the output * @param array $params Associative array of attributes * * @return The rendered data * * @since 11.1 * @throws Exception * @todo Make this cacheable */ public function render($cache = false, $params = array()) { // Get the feed type $type = JFactory::getApplication()->input->get('type', 'rss'); // Instantiate feed renderer and set the mime encoding $renderer = $this->loadRenderer(($type) ? $type : 'rss'); if (!is_a($renderer, 'JDocumentRenderer')) { throw new Exception(JText::_('JGLOBAL_RESOURCE_NOT_FOUND'), 404); } $this->setMimeEncoding($renderer->getContentType()); // Output // Generate prolog $data = "<?xml version=\"1.0\" encoding=\"" . $this->_charset . "\"?>\n"; $data .= "<!-- generator=\"" . $this->getGenerator() . "\" -->\n"; // Generate stylesheet links foreach ($this->_styleSheets as $src => $attr) { $data .= "<?xml-stylesheet href=\"$src\" type=\"" . $attr['mime'] . "\"?>\n"; } // Render the feed $data .= $renderer->render(); parent::render(); return $data; } /** * Adds an JFeedItem to the feed. * * @param JFeedItem $item The feeditem to add to the feed. * * @return JDocumentFeed instance of $this to allow chaining * * @since 11.1 */ public function addItem(JFeedItem $item) { $item->source = $this->link; $this->items[] = $item; return $this; } } /** * JFeedItem is an internal class that stores feed item information * * @since 11.1 */ class JFeedItem { /** * Title item element * * required * * @var string * @since 11.1 */ public $title; /** * Link item element * * required * * @var string * @since 11.1 */ public $link; /** * Description item element * * required * * @var string * @since 11.1 */ public $description; /** * Author item element * * optional * * @var string * @since 11.1 */ public $author; /** * Author email element * * optional * * @var string * @since 11.1 */ public $authorEmail; /** * Category element * * optional * * @var array or string * @since 11.1 */ public $category; /** * Comments element * * optional * * @var string * @since 11.1 */ public $comments; /** * Enclosure element * * @var object * @since 11.1 */ public $enclosure = null; /** * Guid element * * optional * * @var string * @since 11.1 */ public $guid; /** * Published date * * optional * * May be in one of the following formats: * * RFC 822: * "Mon, 20 Jan 03 18:05:41 +0400" * "20 Jan 03 18:05:41 +0000" * * ISO 8601: * "2003-01-20T18:05:41+04:00" * * Unix: * 1043082341 * * @var string * @since 11.1 */ public $date; /** * Source element * * optional * * @var string * @since 11.1 */ public $source; /** * Set the JFeedEnclosure for this item * * @param JFeedEnclosure $enclosure The JFeedEnclosure to add to the feed. * * @return JFeedItem instance of $this to allow chaining * * @since 11.1 */ public function setEnclosure(JFeedEnclosure $enclosure) { $this->enclosure = $enclosure; return $this; } } /** * JFeedEnclosure is an internal class that stores feed enclosure information * * @since 11.1 */ class JFeedEnclosure { /** * URL enclosure element * * required * * @var string * @since 11.1 */ public $url = ""; /** * Length enclosure element * * required * * @var string * @since 11.1 */ public $length = ""; /** * Type enclosure element * * required * * @var string * @since 11.1 */ public $type = ""; } /** * JFeedImage is an internal class that stores feed image information * * @since 11.1 */ class JFeedImage { /** * Title image attribute * * required * * @var string * @since 11.1 */ public $title = ""; /** * URL image attribute * * required * * @var string * @since 11.1 */ public $url = ""; /** * Link image attribute * * required * * @var string * @since 11.1 */ public $link = ""; /** * Width image attribute * * optional * * @var string * @since 11.1 */ public $width; /** * Title feed attribute * * optional * * @var string * @since 11.1 */ public $height; /** * Title feed attribute * * optional * * @var string * @since 11.1 */ public $description; } PK���\l�|���/libraries/joomla/document/feed/renderer/rss.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDocumentRenderer_RSS is a feed that implements RSS 2.0 Specification * * @see http://www.rssboard.org/rss-specification * @since 11.1 */ class JDocumentRendererRSS extends JDocumentRenderer { /** * Renderer mime type * * @var string * @since 11.1 */ protected $_mime = "application/rss+xml"; /** * Render the feed. * * @param string $name The name of the element to render * @param array $params Array of values * @param string $content Override the output of the renderer * * @return string The output of the script * * @see JDocumentRenderer::render() * @since 11.1 */ public function render($name = '', $params = null, $content = null) { $app = JFactory::getApplication(); // Gets and sets timezone offset from site configuration $tz = new DateTimeZone($app->get('offset')); $now = JFactory::getDate(); $now->setTimeZone($tz); $data = $this->_doc; $uri = JUri::getInstance(); $url = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); $syndicationURL = JRoute::_('&format=feed&type=rss'); if ($app->get('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $data->title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $data->title, $app->get('sitename')); } else { $title = $data->title; } $feed_title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); if (!preg_match('/[\x80-\xFF]/', $data->link)) { $datalink = $data->link; } else { $datalink = implode("/", array_map("rawurlencode", explode("/", $data->link))); } $feed = "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n"; $feed .= " <channel>\n"; $feed .= " <title>" . $feed_title . "</title>\n"; $feed .= " <description><![CDATA[" . $data->description . "]]></description>\n"; $feed .= " <link>" . str_replace(' ', '%20', $url . $datalink) . "</link>\n"; $feed .= " <lastBuildDate>" . htmlspecialchars($now->toRFC822(true), ENT_COMPAT, 'UTF-8') . "</lastBuildDate>\n"; $feed .= " <generator>" . $data->getGenerator() . "</generator>\n"; $feed .= ' <atom:link rel="self" type="application/rss+xml" href="' . str_replace(' ', '%20', $url . $syndicationURL) . "\"/>\n"; if ($data->image != null) { $feed .= " <image>\n"; $feed .= " <url>" . $data->image->url . "</url>\n"; $feed .= " <title>" . htmlspecialchars($data->image->title, ENT_COMPAT, 'UTF-8') . "</title>\n"; $feed .= " <link>" . str_replace(' ', '%20', $data->image->link) . "</link>\n"; if ($data->image->width != "") { $feed .= " <width>" . $data->image->width . "</width>\n"; } if ($data->image->height != "") { $feed .= " <height>" . $data->image->height . "</height>\n"; } if ($data->image->description != "") { $feed .= " <description><![CDATA[" . $data->image->description . "]]></description>\n"; } $feed .= " </image>\n"; } if ($data->language != "") { $feed .= " <language>" . $data->language . "</language>\n"; } if ($data->copyright != "") { $feed .= " <copyright>" . htmlspecialchars($data->copyright, ENT_COMPAT, 'UTF-8') . "</copyright>\n"; } if ($data->editorEmail != "") { $feed .= " <managingEditor>" . htmlspecialchars($data->editorEmail, ENT_COMPAT, 'UTF-8') . ' (' . htmlspecialchars($data->editor, ENT_COMPAT, 'UTF-8') . ")</managingEditor>\n"; } if ($data->webmaster != "") { $feed .= " <webMaster>" . htmlspecialchars($data->webmaster, ENT_COMPAT, 'UTF-8') . "</webMaster>\n"; } if ($data->pubDate != "") { $pubDate = JFactory::getDate($data->pubDate); $pubDate->setTimeZone($tz); $feed .= " <pubDate>" . htmlspecialchars($pubDate->toRFC822(true), ENT_COMPAT, 'UTF-8') . "</pubDate>\n"; } if (empty($data->category) === false) { if (is_array($data->category)) { foreach ($data->category as $cat) { $feed .= " <category>" . htmlspecialchars($cat, ENT_COMPAT, 'UTF-8') . "</category>\n"; } } else { $feed .= " <category>" . htmlspecialchars($data->category, ENT_COMPAT, 'UTF-8') . "</category>\n"; } } if ($data->docs != "") { $feed .= " <docs>" . htmlspecialchars($data->docs, ENT_COMPAT, 'UTF-8') . "</docs>\n"; } if ($data->ttl != "") { $feed .= " <ttl>" . htmlspecialchars($data->ttl, ENT_COMPAT, 'UTF-8') . "</ttl>\n"; } if ($data->rating != "") { $feed .= " <rating>" . htmlspecialchars($data->rating, ENT_COMPAT, 'UTF-8') . "</rating>\n"; } if ($data->skipHours != "") { $feed .= " <skipHours>" . htmlspecialchars($data->skipHours, ENT_COMPAT, 'UTF-8') . "</skipHours>\n"; } if ($data->skipDays != "") { $feed .= " <skipDays>" . htmlspecialchars($data->skipDays, ENT_COMPAT, 'UTF-8') . "</skipDays>\n"; } for ($i = 0, $count = count($data->items); $i < $count; $i++) { if (!preg_match('/[\x80-\xFF]/', $data->items[$i]->link)) { $itemlink = $data->items[$i]->link; } else { $itemlink = implode("/", array_map("rawurlencode", explode("/", $data->items[$i]->link))); } if ((strpos($itemlink, 'http://') === false) && (strpos($itemlink, 'https://') === false)) { $itemlink = str_replace(' ', '%20', $url . $itemlink); } $feed .= " <item>\n"; $feed .= " <title>" . htmlspecialchars(strip_tags($data->items[$i]->title), ENT_COMPAT, 'UTF-8') . "</title>\n"; $feed .= " <link>" . str_replace(' ', '%20', $itemlink) . "</link>\n"; if (empty($data->items[$i]->guid) === true) { $feed .= " <guid isPermaLink=\"true\">" . str_replace(' ', '%20', $itemlink) . "</guid>\n"; } else { $feed .= " <guid isPermaLink=\"false\">" . htmlspecialchars($data->items[$i]->guid, ENT_COMPAT, 'UTF-8') . "</guid>\n"; } $feed .= " <description><![CDATA[" . $this->_relToAbs($data->items[$i]->description) . "]]></description>\n"; if ($data->items[$i]->authorEmail != "") { $feed .= " <author>" . htmlspecialchars($data->items[$i]->authorEmail . ' (' . $data->items[$i]->author . ')', ENT_COMPAT, 'UTF-8') . "</author>\n"; } /* * @todo: On hold * if ($data->items[$i]->source!="") { * $data.= " <source>".htmlspecialchars($data->items[$i]->source, ENT_COMPAT, 'UTF-8')."</source>\n"; * } */ if (empty($data->items[$i]->category) === false) { if (is_array($data->items[$i]->category)) { foreach ($data->items[$i]->category as $cat) { $feed .= " <category>" . htmlspecialchars($cat, ENT_COMPAT, 'UTF-8') . "</category>\n"; } } else { $feed .= " <category>" . htmlspecialchars($data->items[$i]->category, ENT_COMPAT, 'UTF-8') . "</category>\n"; } } if ($data->items[$i]->comments != "") { $feed .= " <comments>" . htmlspecialchars($data->items[$i]->comments, ENT_COMPAT, 'UTF-8') . "</comments>\n"; } if ($data->items[$i]->date != "") { $itemDate = JFactory::getDate($data->items[$i]->date); $itemDate->setTimeZone($tz); $feed .= " <pubDate>" . htmlspecialchars($itemDate->toRFC822(true), ENT_COMPAT, 'UTF-8') . "</pubDate>\n"; } if ($data->items[$i]->enclosure != null) { $feed .= " <enclosure url=\""; $feed .= $data->items[$i]->enclosure->url; $feed .= "\" length=\""; $feed .= $data->items[$i]->enclosure->length; $feed .= "\" type=\""; $feed .= $data->items[$i]->enclosure->type; $feed .= "\"/>\n"; } $feed .= " </item>\n"; } $feed .= " </channel>\n"; $feed .= "</rss>\n"; return $feed; } } PK���\��q�%%0libraries/joomla/document/feed/renderer/atom.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDocumentRenderer_Atom is a feed that implements the atom specification * * Please note that just by using this class you won't automatically * produce valid atom files. For example, you have to specify either an editor * for the feed or an author for every single feed item. * * @see http://www.atomenabled.org/developers/syndication/atom-format-spec.php * @since 11.1 */ class JDocumentRendererAtom extends JDocumentRenderer { /** * Document mime type * * @var string * @since 11.1 */ protected $_mime = "application/atom+xml"; /** * Render the feed. * * @param string $name The name of the element to render * @param array $params Array of values * @param string $content Override the output of the renderer * * @return string The output of the script * * @see JDocumentRenderer::render() * @since 11.1 */ public function render($name = '', $params = null, $content = null) { $app = JFactory::getApplication(); // Gets and sets timezone offset from site configuration $tz = new DateTimeZone($app->getCfg('offset')); $now = JFactory::getDate(); $now->setTimeZone($tz); $data = $this->_doc; $uri = JUri::getInstance(); $url = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); $syndicationURL = JRoute::_('&format=feed&type=atom'); if ($app->getCfg('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $data->title); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $data->title, $app->getCfg('sitename')); } else { $title = $data->title; } $feed_title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); $feed = "<feed xmlns=\"http://www.w3.org/2005/Atom\" "; if ($data->language != "") { $feed .= " xml:lang=\"" . $data->language . "\""; } $feed .= ">\n"; $feed .= " <title type=\"text\">" . $feed_title . "</title>\n"; $feed .= " <subtitle type=\"text\">" . htmlspecialchars($data->description, ENT_COMPAT, 'UTF-8') . "</subtitle>\n"; if (empty($data->category) === false) { if (is_array($data->category)) { foreach ($data->category as $cat) { $feed .= " <category term=\"" . htmlspecialchars($cat, ENT_COMPAT, 'UTF-8') . "\" />\n"; } } else { $feed .= " <category term=\"" . htmlspecialchars($data->category, ENT_COMPAT, 'UTF-8') . "\" />\n"; } } $feed .= " <link rel=\"alternate\" type=\"text/html\" href=\"" . $url . "\"/>\n"; $feed .= " <id>" . str_replace(' ', '%20', $data->getBase()) . "</id>\n"; $feed .= " <updated>" . htmlspecialchars($now->toISO8601(true), ENT_COMPAT, 'UTF-8') . "</updated>\n"; if ($data->editor != "") { $feed .= " <author>\n"; $feed .= " <name>" . $data->editor . "</name>\n"; if ($data->editorEmail != "") { $feed .= " <email>" . htmlspecialchars($data->editorEmail, ENT_COMPAT, 'UTF-8') . "</email>\n"; } $feed .= " </author>\n"; } if ($app->get('MetaVersion', 0)) { $version = new JVersion; $versionHtmlEscaped = ' version="' . htmlspecialchars($version->RELEASE, ENT_COMPAT, 'UTF-8') . '"'; } else { $versionHtmlEscaped = ''; } $feed .= " <generator uri=\"http://joomla.org\"" . $versionHtmlEscaped . ">" . $data->getGenerator() . "</generator>\n"; $feed .= ' <link rel="self" type="application/atom+xml" href="' . str_replace(' ', '%20', $url . $syndicationURL) . "\"/>\n"; for ($i = 0, $count = count($data->items); $i < $count; $i++) { if (!preg_match('/[\x80-\xFF]/', $data->items[$i]->link)) { $itemlink = $data->items[$i]->link; } else { $itemlink = implode("/", array_map("rawurlencode", explode("/", $data->items[$i]->link))); } $feed .= " <entry>\n"; $feed .= " <title>" . htmlspecialchars(strip_tags($data->items[$i]->title), ENT_COMPAT, 'UTF-8') . "</title>\n"; $feed .= ' <link rel="alternate" type="text/html" href="' . $url . $itemlink . "\"/>\n"; if ($data->items[$i]->date == "") { $data->items[$i]->date = $now->toUnix(); } $itemDate = JFactory::getDate($data->items[$i]->date); $itemDate->setTimeZone($tz); $feed .= " <published>" . htmlspecialchars($itemDate->toISO8601(true), ENT_COMPAT, 'UTF-8') . "</published>\n"; $feed .= " <updated>" . htmlspecialchars($itemDate->toISO8601(true), ENT_COMPAT, 'UTF-8') . "</updated>\n"; if (empty($data->items[$i]->guid) === true) { $feed .= " <id>" . str_replace(' ', '%20', $url . $itemlink) . "</id>\n"; } else { $feed .= " <id>" . htmlspecialchars($data->items[$i]->guid, ENT_COMPAT, 'UTF-8') . "</id>\n"; } if ($data->items[$i]->author != "") { $feed .= " <author>\n"; $feed .= " <name>" . htmlspecialchars($data->items[$i]->author, ENT_COMPAT, 'UTF-8') . "</name>\n"; if ($data->items[$i]->authorEmail != "") { $feed .= " <email>" . htmlspecialchars($data->items[$i]->authorEmail, ENT_COMPAT, 'UTF-8') . "</email>\n"; } $feed .= " </author>\n"; } if ($data->items[$i]->description != "") { $feed .= " <summary type=\"html\">" . htmlspecialchars($this->_relToAbs($data->items[$i]->description), ENT_COMPAT, 'UTF-8') . "</summary>\n"; $feed .= " <content type=\"html\">" . htmlspecialchars($data->items[$i]->description, ENT_COMPAT, 'UTF-8') . "</content>\n"; } if (empty($data->items[$i]->category) === false) { if (is_array($data->items[$i]->category)) { foreach ($data->items[$i]->category as $cat) { $feed .= " <category term=\"" . htmlspecialchars($cat, ENT_COMPAT, 'UTF-8') . "\" />\n"; } } else { $feed .= " <category term=\"" . htmlspecialchars($data->items[$i]->category, ENT_COMPAT, 'UTF-8') . "\" />\n"; } } if ($data->items[$i]->enclosure != null) { $feed .= " <link rel=\"enclosure\" href=\"" . $data->items[$i]->enclosure->url . "\" type=\"" . $data->items[$i]->enclosure->type . "\" length=\"" . $data->items[$i]->enclosure->length . "\" />\n"; } $feed .= " </entry>\n"; } $feed .= "</feed>\n"; return $feed; } } PK���\%� ��%libraries/joomla/document/xml/xml.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * DocumentXML class, provides an easy interface to parse and display XML output * * @since 11.1 */ class JDocumentXml extends JDocument { /** * Document name * * @var string * @since 12.1 */ protected $name = 'joomla'; /** * Class constructor * * @param array $options Associative array of options * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); // Set mime type $this->_mime = 'application/xml'; // Set document type $this->_type = 'xml'; } /** * Render the document. * * @param boolean $cache If true, cache the output * @param array $params Associative array of attributes * * @return The rendered data * * @since 11.1 */ public function render($cache = false, $params = array()) { parent::render(); JFactory::getApplication()->setHeader('Content-disposition', 'inline; filename="' . $this->getName() . '.xml"', true); return $this->getBuffer(); } /** * Returns the document name * * @return string * * @since 11.1 */ public function getName() { return $this->name; } /** * Sets the document name * * @param string $name Document name * * @return JDocumentXml instance of $this to allow chaining * * @since 11.1 */ public function setName($name = 'joomla') { $this->name = $name; return $this; } } PK���\ �'D� � 2libraries/joomla/document/html/renderer/module.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * JDocument Module renderer * * @since 11.1 */ class JDocumentRendererModule extends JDocumentRenderer { /** * Renders a module script and returns the results as a string * * @param string $module The name of the module to render * @param array $attribs Associative array of values * @param string $content If present, module information from the buffer will be used * * @return string The output of the script * * @since 11.1 */ public function render($module, $attribs = array(), $content = null) { if (!is_object($module)) { $title = isset($attribs['title']) ? $attribs['title'] : null; $module = JModuleHelper::getModule($module, $title); if (!is_object($module)) { if (is_null($content)) { return ''; } else { /** * If module isn't found in the database but data has been pushed in the buffer * we want to render it */ $tmp = $module; $module = new stdClass; $module->params = null; $module->module = $tmp; $module->id = 0; $module->user = 0; } } } // Get the user and configuration object // $user = JFactory::getUser(); $conf = JFactory::getConfig(); // Set the module content if (!is_null($content)) { $module->content = $content; } // Get module parameters $params = new Registry; $params->loadString($module->params); // Use parameters from template if (isset($attribs['params'])) { $template_params = new Registry; $template_params->loadString(html_entity_decode($attribs['params'], ENT_COMPAT, 'UTF-8')); $params->merge($template_params); $module = clone $module; $module->params = (string) $params; } // Default for compatibility purposes. Set cachemode parameter or use JModuleHelper::moduleCache from within the // module instead $cachemode = $params->get('cachemode', 'oldstatic'); if ($params->get('cache', 0) == 1 && $conf->get('caching') >= 1 && $cachemode != 'id' && $cachemode != 'safeuri') { // Default to itemid creating method and workarounds on $cacheparams = new stdClass; $cacheparams->cachemode = $cachemode; $cacheparams->class = 'JModuleHelper'; $cacheparams->method = 'renderModule'; $cacheparams->methodparams = array($module, $attribs); $contents = JModuleHelper::ModuleCache($module, $params, $cacheparams); } else { $contents = JModuleHelper::renderModule($module, $attribs); } return $contents; } } PK���\D�Ȍdd0libraries/joomla/document/html/renderer/head.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDocument head renderer * * @since 11.1 */ class JDocumentRendererHead extends JDocumentRenderer { /** * Renders the document head and returns the results as a string * * @param string $head (unused) * @param array $params Associative array of values * @param string $content The script * * @return string The output of the script * * @since 11.1 * * @note Unused arguments are retained to preserve backward compatibility. */ public function render($head, $params = array(), $content = null) { return $this->fetchHead($this->_doc); } /** * Generates the head HTML and return the results as a string * * @param JDocument $document The document for which the head will be created * * @return string The head hTML * * @since 11.1 */ public function fetchHead($document) { // Convert the tagids to titles if (isset($document->_metaTags['standard']['tags'])) { $tagsHelper = new JHelperTags; $document->_metaTags['standard']['tags'] = implode(', ', $tagsHelper->getTagNames($document->_metaTags['standard']['tags'])); } // Trigger the onBeforeCompileHead event $app = JFactory::getApplication(); $app->triggerEvent('onBeforeCompileHead'); // Get line endings $lnEnd = $document->_getLineEnd(); $tab = $document->_getTab(); $tagEnd = ' />'; $buffer = ''; // Generate charset when using HTML5 (should happen first) if ($document->isHtml5()) { $buffer .= $tab . '<meta charset="' . $document->getCharset() . '" />' . $lnEnd; } // Generate base tag (need to happen early) $base = $document->getBase(); if (!empty($base)) { $buffer .= $tab . '<base href="' . $document->getBase() . '" />' . $lnEnd; } // Generate META tags (needs to happen as early as possible in the head) foreach ($document->_metaTags as $type => $tag) { foreach ($tag as $name => $content) { if ($type == 'http-equiv' && !($document->isHtml5() && $name == 'content-type')) { $buffer .= $tab . '<meta http-equiv="' . $name . '" content="' . htmlspecialchars($content) . '" />' . $lnEnd; } elseif ($type == 'standard' && !empty($content)) { $buffer .= $tab . '<meta name="' . $name . '" content="' . htmlspecialchars($content) . '" />' . $lnEnd; } } } // Don't add empty descriptions $documentDescription = $document->getDescription(); if ($documentDescription) { $buffer .= $tab . '<meta name="description" content="' . htmlspecialchars($documentDescription) . '" />' . $lnEnd; } // Don't add empty generators $generator = $document->getGenerator(); if ($generator) { $buffer .= $tab . '<meta name="generator" content="' . htmlspecialchars($generator) . '" />' . $lnEnd; } $buffer .= $tab . '<title>' . htmlspecialchars($document->getTitle(), ENT_COMPAT, 'UTF-8') . '</title>' . $lnEnd; // Generate link declarations foreach ($document->_links as $link => $linkAtrr) { $buffer .= $tab . '<link href="' . $link . '" ' . $linkAtrr['relType'] . '="' . $linkAtrr['relation'] . '"'; if ($temp = JArrayHelper::toString($linkAtrr['attribs'])) { $buffer .= ' ' . $temp; } $buffer .= ' />' . $lnEnd; } // Generate stylesheet links foreach ($document->_styleSheets as $strSrc => $strAttr) { $buffer .= $tab . '<link rel="stylesheet" href="' . $strSrc . '"'; if (!is_null($strAttr['mime']) && (!$document->isHtml5() || $strAttr['mime'] != 'text/css')) { $buffer .= ' type="' . $strAttr['mime'] . '"'; } if (!is_null($strAttr['media'])) { $buffer .= ' media="' . $strAttr['media'] . '"'; } if ($temp = JArrayHelper::toString($strAttr['attribs'])) { $buffer .= ' ' . $temp; } $buffer .= $tagEnd . $lnEnd; } // Generate stylesheet declarations foreach ($document->_style as $type => $content) { $buffer .= $tab . '<style type="' . $type . '">' . $lnEnd; // This is for full XHTML support. if ($document->_mime != 'text/html') { $buffer .= $tab . $tab . '/*<![CDATA[*/' . $lnEnd; } $buffer .= $content . $lnEnd; // See above note if ($document->_mime != 'text/html') { $buffer .= $tab . $tab . '/*]]>*/' . $lnEnd; } $buffer .= $tab . '</style>' . $lnEnd; } // Generate script file links foreach ($document->_scripts as $strSrc => $strAttr) { $buffer .= $tab . '<script src="' . $strSrc . '"'; $defaultMimes = array( 'text/javascript', 'application/javascript', 'text/x-javascript', 'application/x-javascript' ); if (!is_null($strAttr['mime']) && (!$document->isHtml5() || !in_array($strAttr['mime'], $defaultMimes))) { $buffer .= ' type="' . $strAttr['mime'] . '"'; } if ($strAttr['defer']) { $buffer .= ' defer="defer"'; } if ($strAttr['async']) { $buffer .= ' async="async"'; } $buffer .= '></script>' . $lnEnd; } // Generate script declarations foreach ($document->_script as $type => $content) { $buffer .= $tab . '<script type="' . $type . '">' . $lnEnd; // This is for full XHTML support. if ($document->_mime != 'text/html') { $buffer .= $tab . $tab . '//<![CDATA[' . $lnEnd; } $buffer .= $content . $lnEnd; // See above note if ($document->_mime != 'text/html') { $buffer .= $tab . $tab . '//]]>' . $lnEnd; } $buffer .= $tab . '</script>' . $lnEnd; } // Generate script language declarations. if (count(JText::script())) { $buffer .= $tab . '<script type="text/javascript">' . $lnEnd; if ($document->_mime != 'text/html') { $buffer .= $tab . $tab . '//<![CDATA[' . $lnEnd; } $buffer .= $tab . $tab . '(function() {' . $lnEnd; $buffer .= $tab . $tab . $tab . 'Joomla.JText.load(' . json_encode(JText::script()) . ');' . $lnEnd; $buffer .= $tab . $tab . '})();' . $lnEnd; if ($document->_mime != 'text/html') { $buffer .= $tab . $tab . '//]]>' . $lnEnd; } $buffer .= $tab . '</script>' . $lnEnd; } // Output the custom tags - array_unique makes sure that we don't output the same tags twice foreach (array_unique($document->_custom) as $custom) { $buffer .= $tab . $custom . $lnEnd; } return $buffer; } } PK���\A�mb555libraries/joomla/document/html/renderer/component.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Component renderer * * @since 11.1 */ class JDocumentRendererComponent extends JDocumentRenderer { /** * Renders a component script and returns the results as a string * * @param string $component The name of the component to render * @param array $params Associative array of values * @param string $content Content script * * @return string The output of the script * * @since 11.1 */ public function render($component = null, $params = array(), $content = null) { return $content; } } PK���\����3libraries/joomla/document/html/renderer/message.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDocument system message renderer * * @since 11.1 */ class JDocumentRendererMessage extends JDocumentRenderer { /** * Renders the error stack and returns the results as a string * * @param string $name Not used. * @param array $params Associative array of values * @param string $content Not used. * * @return string The output of the script * * @since 11.1 */ public function render($name, $params = array(), $content = null) { $msgList = $this->getData(); $displayData = array( 'msgList' => $msgList, 'name' => $name, 'params' => $params, 'content' => $content ); $app = JFactory::getApplication(); $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/message.php'; if (file_exists($chromePath)) { include_once $chromePath; } if (function_exists('renderMessage')) { JLog::add('renderMessage() is deprecated. Override system message rendering with layouts instead.', JLog::WARNING, 'deprecated'); return renderMessage($msgList); } return JLayoutHelper::render('joomla.system.message', $displayData); } /** * Get and prepare system message data for output * * @return array An array contains system message * * @since 12.2 */ private function getData() { // Initialise variables. $lists = array(); // Get the message queue $messages = JFactory::getApplication()->getMessageQueue(); // Build the sorted message list if (is_array($messages) && !empty($messages)) { foreach ($messages as $msg) { if (isset($msg['type']) && isset($msg['message'])) { $lists[$msg['type']][] = $msg['message']; } } } return $lists; } } PK���\�-pp3libraries/joomla/document/html/renderer/modules.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDocument Modules renderer * * @since 11.1 */ class JDocumentRendererModules extends JDocumentRenderer { /** * Renders multiple modules script and returns the results as a string * * @param string $position The position of the modules to render * @param array $params Associative array of values * @param string $content Module content * * @return string The output of the script * * @since 11.1 */ public function render($position, $params = array(), $content = null) { $renderer = $this->_doc->loadRenderer('module'); $buffer = ''; $app = JFactory::getApplication(); $user = JFactory::getUser(); $frontediting = ($app->isSite() && $app->get('frontediting', 1) && !$user->guest); $menusEditing = ($app->get('frontediting', 1) == 2) && $user->authorise('core.edit', 'com_menus'); foreach (JModuleHelper::getModules($position) as $mod) { $moduleHtml = $renderer->render($mod, $params, $content); if ($frontediting && trim($moduleHtml) != '' && $user->authorise('module.edit.frontend', 'com_modules.module.' . $mod->id)) { $displayData = array('moduleHtml' => &$moduleHtml, 'module' => $mod, 'position' => $position, 'menusediting' => $menusEditing); JLayoutHelper::render('joomla.edit.frontediting_modules', $displayData); } $buffer .= $moduleHtml; } return $buffer; } } PK���\.M�:E:E'libraries/joomla/document/html/html.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; jimport('joomla.utilities.utility'); /** * DocumentHTML class, provides an easy interface to parse and display a HTML document * * @since 11.1 */ class JDocumentHTML extends JDocument { /** * Array of Header <link> tags * * @var array * @since 11.1 */ public $_links = array(); /** * Array of custom tags * * @var array * @since 11.1 */ public $_custom = array(); /** * Name of the template * * @var string * @since 11.1 */ public $template = null; /** * Base url * * @var string * @since 11.1 */ public $baseurl = null; /** * Array of template parameters * * @var array * @since 11.1 */ public $params = null; /** * File name * * @var array * @since 11.1 */ public $_file = null; /** * String holding parsed template * * @var string * @since 11.1 */ protected $_template = ''; /** * Array of parsed template JDoc tags * * @var array * @since 11.1 */ protected $_template_tags = array(); /** * Integer with caching setting * * @var integer * @since 11.1 */ protected $_caching = null; /** * Set to true when the document should be output as HTML5 * * @var boolean * @since 12.1 */ private $_html5 = null; /** * Class constructor * * @param array $options Associative array of options * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); // Set document type $this->_type = 'html'; // Set default mime type and document metadata (meta data syncs with mime type by default) $this->setMimeEncoding('text/html'); } /** * Get the HTML document head data * * @return array The document head data in array form * * @since 11.1 */ public function getHeadData() { $data = array(); $data['title'] = $this->title; $data['description'] = $this->description; $data['link'] = $this->link; $data['metaTags'] = $this->_metaTags; $data['links'] = $this->_links; $data['styleSheets'] = $this->_styleSheets; $data['style'] = $this->_style; $data['scripts'] = $this->_scripts; $data['script'] = $this->_script; $data['custom'] = $this->_custom; $data['scriptText'] = JText::script(); return $data; } /** * Set the HTML document head data * * @param array $data The document head data in array form * * @return JDocumentHTML instance of $this to allow chaining * * @since 11.1 */ public function setHeadData($data) { if (empty($data) || !is_array($data)) { return; } $this->title = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : $this->title; $this->description = (isset($data['description']) && !empty($data['description'])) ? $data['description'] : $this->description; $this->link = (isset($data['link']) && !empty($data['link'])) ? $data['link'] : $this->link; $this->_metaTags = (isset($data['metaTags']) && !empty($data['metaTags'])) ? $data['metaTags'] : $this->_metaTags; $this->_links = (isset($data['links']) && !empty($data['links'])) ? $data['links'] : $this->_links; $this->_styleSheets = (isset($data['styleSheets']) && !empty($data['styleSheets'])) ? $data['styleSheets'] : $this->_styleSheets; $this->_style = (isset($data['style']) && !empty($data['style'])) ? $data['style'] : $this->_style; $this->_scripts = (isset($data['scripts']) && !empty($data['scripts'])) ? $data['scripts'] : $this->_scripts; $this->_script = (isset($data['script']) && !empty($data['script'])) ? $data['script'] : $this->_script; $this->_custom = (isset($data['custom']) && !empty($data['custom'])) ? $data['custom'] : $this->_custom; if (isset($data['scriptText']) && !empty($data['scriptText'])) { foreach ($data['scriptText'] as $key => $string) { JText::script($key, $string); } } return $this; } /** * Merge the HTML document head data * * @param array $data The document head data in array form * * @return JDocumentHTML instance of $this to allow chaining * * @since 11.1 */ public function mergeHeadData($data) { if (empty($data) || !is_array($data)) { return; } $this->title = (isset($data['title']) && !empty($data['title']) && !stristr($this->title, $data['title'])) ? $this->title . $data['title'] : $this->title; $this->description = (isset($data['description']) && !empty($data['description']) && !stristr($this->description, $data['description'])) ? $this->description . $data['description'] : $this->description; $this->link = (isset($data['link'])) ? $data['link'] : $this->link; if (isset($data['metaTags'])) { foreach ($data['metaTags'] as $type1 => $data1) { $booldog = $type1 == 'http-equiv' ? true : false; foreach ($data1 as $name2 => $data2) { $this->setMetaData($name2, $data2, $booldog); } } } $this->_links = (isset($data['links']) && !empty($data['links']) && is_array($data['links'])) ? array_unique(array_merge($this->_links, $data['links'])) : $this->_links; $this->_styleSheets = (isset($data['styleSheets']) && !empty($data['styleSheets']) && is_array($data['styleSheets'])) ? array_merge($this->_styleSheets, $data['styleSheets']) : $this->_styleSheets; if (isset($data['style'])) { foreach ($data['style'] as $type => $stdata) { if (!isset($this->_style[strtolower($type)]) || !stristr($this->_style[strtolower($type)], $stdata)) { $this->addStyleDeclaration($stdata, $type); } } } $this->_scripts = (isset($data['scripts']) && !empty($data['scripts']) && is_array($data['scripts'])) ? array_merge($this->_scripts, $data['scripts']) : $this->_scripts; if (isset($data['script'])) { foreach ($data['script'] as $type => $sdata) { if (!isset($this->_script[strtolower($type)]) || !stristr($this->_script[strtolower($type)], $sdata)) { $this->addScriptDeclaration($sdata, $type); } } } $this->_custom = (isset($data['custom']) && !empty($data['custom']) && is_array($data['custom'])) ? array_unique(array_merge($this->_custom, $data['custom'])) : $this->_custom; return $this; } /** * Adds <link> tags to the head of the document * * $relType defaults to 'rel' as it is the most common relation type used. * ('rev' refers to reverse relation, 'rel' indicates normal, forward relation.) * Typical tag: <link href="index.php" rel="Start"> * * @param string $href The link that is being related. * @param string $relation Relation of link. * @param string $relType Relation type attribute. Either rel or rev (default: 'rel'). * @param array $attribs Associative array of remaining attributes. * * @return JDocumentHTML instance of $this to allow chaining * * @since 11.1 */ public function addHeadLink($href, $relation, $relType = 'rel', $attribs = array()) { $this->_links[$href]['relation'] = $relation; $this->_links[$href]['relType'] = $relType; $this->_links[$href]['attribs'] = $attribs; return $this; } /** * Adds a shortcut icon (favicon) * * This adds a link to the icon shown in the favorites list or on * the left of the url in the address bar. Some browsers display * it on the tab, as well. * * @param string $href The link that is being related. * @param string $type File type * @param string $relation Relation of link * * @return JDocumentHTML instance of $this to allow chaining * * @since 11.1 */ public function addFavicon($href, $type = 'image/vnd.microsoft.icon', $relation = 'shortcut icon') { $href = str_replace('\\', '/', $href); $this->addHeadLink($href, $relation, 'rel', array('type' => $type)); return $this; } /** * Adds a custom HTML string to the head block * * @param string $html The HTML to add to the head * * @return JDocumentHTML instance of $this to allow chaining * * @since 11.1 */ public function addCustomTag($html) { $this->_custom[] = trim($html); return $this; } /** * Returns whether the document is set up to be output as HTML5 * * @return Boolean true when HTML5 is used * * @since 12.1 */ public function isHtml5() { return $this->_html5; } /** * Sets whether the document should be output as HTML5 * * @param bool $state True when HTML5 should be output * * @return void * * @since 12.1 */ public function setHtml5($state) { if (is_bool($state)) { $this->_html5 = $state; } } /** * Get the contents of a document include * * @param string $type The type of renderer * @param string $name The name of the element to render * @param array $attribs Associative array of remaining attributes. * * @return The output of the renderer * * @since 11.1 */ public function getBuffer($type = null, $name = null, $attribs = array()) { // If no type is specified, return the whole buffer if ($type === null) { return parent::$_buffer; } $title = (isset($attribs['title'])) ? $attribs['title'] : null; if (isset(parent::$_buffer[$type][$name][$title])) { return parent::$_buffer[$type][$name][$title]; } $renderer = $this->loadRenderer($type); if ($this->_caching == true && $type == 'modules') { $cache = JFactory::getCache('com_modules', ''); $hash = md5(serialize(array($name, $attribs, null, $renderer))); $cbuffer = $cache->get('cbuffer_' . $type); if (isset($cbuffer[$hash])) { return JCache::getWorkarounds($cbuffer[$hash], array('mergehead' => 1)); } else { $options = array(); $options['nopathway'] = 1; $options['nomodules'] = 1; $options['modulemode'] = 1; $this->setBuffer($renderer->render($name, $attribs, null), $type, $name); $data = parent::$_buffer[$type][$name][$title]; $tmpdata = JCache::setWorkarounds($data, $options); $cbuffer[$hash] = $tmpdata; $cache->store($cbuffer, 'cbuffer_' . $type); } } else { $this->setBuffer($renderer->render($name, $attribs, null), $type, $name, $title); } return parent::$_buffer[$type][$name][$title]; } /** * Set the contents a document includes * * @param string $content The content to be set in the buffer. * @param array $options Array of optional elements. * * @return JDocumentHTML instance of $this to allow chaining * * @since 11.1 */ public function setBuffer($content, $options = array()) { // The following code is just for backward compatibility. if (func_num_args() > 1 && !is_array($options)) { $args = func_get_args(); $options = array(); $options['type'] = $args[1]; $options['name'] = (isset($args[2])) ? $args[2] : null; $options['title'] = (isset($args[3])) ? $args[3] : null; } parent::$_buffer[$options['type']][$options['name']][$options['title']] = $content; return $this; } /** * Parses the template and populates the buffer * * @param array $params Parameters for fetching the template * * @return JDocumentHTML instance of $this to allow chaining * * @since 11.1 */ public function parse($params = array()) { return $this->_fetchTemplate($params)->_parseTemplate(); } /** * Outputs the template to the browser. * * @param boolean $caching If true, cache the output * @param array $params Associative array of attributes * * @return The rendered data * * @since 11.1 */ public function render($caching = false, $params = array()) { $this->_caching = $caching; if (empty($this->_template)) { $this->parse($params); } $data = $this->_renderTemplate(); parent::render(); return $data; } /** * Count the modules based on the given condition * * @param string $condition The condition to use * * @return integer Number of modules found * * @since 11.1 */ public function countModules($condition) { $operators = '(\+|\-|\*|\/|==|\!=|\<\>|\<|\>|\<=|\>=|and|or|xor)'; $words = preg_split('# ' . $operators . ' #', $condition, null, PREG_SPLIT_DELIM_CAPTURE); if (count($words) === 1) { $name = strtolower($words[0]); $result = ((isset(parent::$_buffer['modules'][$name])) && (parent::$_buffer['modules'][$name] === false)) ? 0 : count(JModuleHelper::getModules($name)); return $result; } JLog::add('Using an expression in JDocumentHtml::countModules() is deprecated.', JLog::WARNING, 'deprecated'); for ($i = 0, $n = count($words); $i < $n; $i += 2) { // Odd parts (modules) $name = strtolower($words[$i]); $words[$i] = ((isset(parent::$_buffer['modules'][$name])) && (parent::$_buffer['modules'][$name] === false)) ? 0 : count(JModuleHelper::getModules($name)); } $str = 'return ' . implode(' ', $words) . ';'; return eval($str); } /** * Count the number of child menu items * * @return integer Number of child menu items * * @since 11.1 */ public function countMenuChildren() { static $children; if (!isset($children)) { $db = JFactory::getDbo(); $app = JFactory::getApplication(); $menu = $app->getMenu(); $active = $menu->getActive(); $children = 0; if ($active) { $query = $db->getQuery(true) ->select('COUNT(*)') ->from('#__menu') ->where('parent_id = ' . $active->id) ->where('published = 1'); $db->setQuery($query); $children = $db->loadResult(); } } return $children; } /** * Load a template file * * @param string $directory The name of the template * @param string $filename The actual filename * * @return string The contents of the template * * @since 11.1 */ protected function _loadTemplate($directory, $filename) { $contents = ''; // Check to see if we have a valid template file if (file_exists($directory . '/' . $filename)) { // Store the file path $this->_file = $directory . '/' . $filename; // Get the file content ob_start(); require $directory . '/' . $filename; $contents = ob_get_contents(); ob_end_clean(); } // Try to find a favicon by checking the template and root folder $icon = '/favicon.ico'; foreach (array($directory, JPATH_BASE) as $dir) { if (file_exists($dir . $icon)) { $path = str_replace(JPATH_BASE, '', $dir); $path = str_replace('\\', '/', $path); $this->addFavicon(JUri::base(true) . $path . $icon); break; } } return $contents; } /** * Fetch the template, and initialise the params * * @param array $params Parameters to determine the template * * @return JDocumentHTML instance of $this to allow chaining * * @since 11.1 */ protected function _fetchTemplate($params = array()) { // Check $directory = isset($params['directory']) ? $params['directory'] : 'templates'; $filter = JFilterInput::getInstance(); $template = $filter->clean($params['template'], 'cmd'); $file = $filter->clean($params['file'], 'cmd'); if (!file_exists($directory . '/' . $template . '/' . $file)) { $template = 'system'; } // Load the language file for the template $lang = JFactory::getLanguage(); // 1.5 or core then 1.6 $lang->load('tpl_' . $template, JPATH_BASE, null, false, true) || $lang->load('tpl_' . $template, $directory . '/' . $template, null, false, true); // Assign the variables $this->template = $template; $this->baseurl = JUri::base(true); $this->params = isset($params['params']) ? $params['params'] : new Registry; // Load $this->_template = $this->_loadTemplate($directory . '/' . $template, $file); return $this; } /** * Parse a document template * * @return JDocumentHTML instance of $this to allow chaining * * @since 11.1 */ protected function _parseTemplate() { $matches = array(); if (preg_match_all('#<jdoc:include\ type="([^"]+)"(.*)\/>#iU', $this->_template, $matches)) { $template_tags_first = array(); $template_tags_last = array(); // Step through the jdocs in reverse order. for ($i = count($matches[0]) - 1; $i >= 0; $i--) { $type = $matches[1][$i]; $attribs = empty($matches[2][$i]) ? array() : JUtility::parseAttributes($matches[2][$i]); $name = isset($attribs['name']) ? $attribs['name'] : null; // Separate buffers to be executed first and last if ($type == 'module' || $type == 'modules') { $template_tags_first[$matches[0][$i]] = array('type' => $type, 'name' => $name, 'attribs' => $attribs); } else { $template_tags_last[$matches[0][$i]] = array('type' => $type, 'name' => $name, 'attribs' => $attribs); } } // Reverse the last array so the jdocs are in forward order. $template_tags_last = array_reverse($template_tags_last); $this->_template_tags = $template_tags_first + $template_tags_last; } return $this; } /** * Render pre-parsed template * * @return string rendered template * * @since 11.1 */ protected function _renderTemplate() { $replace = array(); $with = array(); foreach ($this->_template_tags as $jdoc => $args) { $replace[] = $jdoc; $with[] = $this->getBuffer($args['type'], $args['name'], $args['attribs']); } return str_replace($replace, $with, $this->_template); } } PK���\�w�ww)libraries/joomla/document/image/image.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * DocumentImage class, provides an easy interface to output image data * * @since 12.1 */ class JDocumentImage extends JDocument { /** * Class constructor * * @param array $options Associative array of options * * @since 12.1 */ public function __construct($options = array()) { parent::__construct($options); // Set mime type $this->_mime = 'image/png'; // Set document type $this->_type = 'image'; } /** * Render the document. * * @param boolean $cache If true, cache the output * @param array $params Associative array of attributes * * @return The rendered data * * @since 12.1 */ public function render($cache = false, $params = array()) { // Get the image type $type = JFactory::getApplication()->input->get('type', 'png'); switch ($type) { case 'jpg': case 'jpeg': $this->_mime = 'image/jpeg'; break; case 'gif': $this->_mime = 'image/gif'; break; case 'png': default: $this->_mime = 'image/png'; break; } $this->_charset = null; parent::render(); return $this->getBuffer(); } } PK���\��Ւ""%libraries/joomla/document/raw/raw.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * DocumentRAW class, provides an easy interface to parse and display raw output * * @since 11.1 */ class JDocumentRaw extends JDocument { /** * Class constructor * * @param array $options Associative array of options * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); // Set mime type $this->_mime = 'text/html'; // Set document type $this->_type = 'raw'; } /** * Render the document. * * @param boolean $cache If true, cache the output * @param array $params Associative array of attributes * * @return The rendered data * * @since 11.1 */ public function render($cache = false, $params = array()) { parent::render(); return $this->getBuffer(); } } PK���\�_�NN'libraries/joomla/document/json/json.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JDocumentJSON class, provides an easy interface to parse and display JSON output * * @see http://www.json.org/ * @since 11.1 */ class JDocumentJSON extends JDocument { /** * Document name * * @var string * @since 11.1 */ protected $_name = 'joomla'; /** * Class constructor * * @param array $options Associative array of options * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); // Set mime type if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/json') === false && strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false) { // Internet Explorer < 10 $this->_mime = 'text/plain'; } else { $this->_mime = 'application/json'; } // Set document type $this->_type = 'json'; } /** * Render the document. * * @param boolean $cache If true, cache the output * @param array $params Associative array of attributes * * @return The rendered data * * @since 11.1 */ public function render($cache = false, $params = array()) { $app = JFactory::getApplication(); $app->allowCache(false); if ($this->_mime == 'application/json') { // Browser other than Internet Explorer < 10 $app->setHeader('Content-Disposition', 'attachment; filename="' . $this->getName() . '.json"', true); } parent::render(); return $this->getBuffer(); } /** * Returns the document name * * @return string * * @since 11.1 */ public function getName() { return $this->_name; } /** * Sets the document name * * @param string $name Document name * * @return JDocumentJSON instance of $this to allow chaining * * @since 11.1 */ public function setName($name = 'joomla') { $this->_name = $name; return $this; } } PK���\��M���3libraries/joomla/document/opensearch/opensearch.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * OpenSearch class, provides an easy interface to display an OpenSearch document * * @see http://www.opensearch.org/ * @since 11.1 */ class JDocumentOpensearch extends JDocument { /** * ShortName element * * required * * @var string * @since 11.1 */ private $_shortName = ""; /** * Images collection * * optional * * @var object * @since 11.1 */ private $_images = array(); /** * The url collection * * @var array * @since 11.1 */ private $_urls = array(); /** * Class constructor * * @param array $options Associative array of options * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); // Set document type $this->_type = 'opensearch'; // Set mime type $this->_mime = 'application/opensearchdescription+xml'; // Add the URL for self updating $update = new JOpenSearchUrl; $update->type = 'application/opensearchdescription+xml'; $update->rel = 'self'; $update->template = JRoute::_(JUri::getInstance()); $this->addUrl($update); // Add the favicon as the default image // Try to find a favicon by checking the template and root folder $app = JFactory::getApplication(); $dirs = array(JPATH_THEMES . '/' . $app->getTemplate(), JPATH_BASE); foreach ($dirs as $dir) { if (file_exists($dir . '/favicon.ico')) { $path = str_replace(JPATH_BASE, '', $dir); $path = str_replace('\\', '/', $path); $favicon = new JOpenSearchImage; if ($path == "") { $favicon->data = JUri::base() . 'favicon.ico'; } else { if ($path[0] == "/") { $path = substr($path, 1); } $favicon->data = JUri::base() . $path . '/favicon.ico'; } $favicon->height = '16'; $favicon->width = '16'; $favicon->type = 'image/vnd.microsoft.icon'; $this->addImage($favicon); break; } } } /** * Render the document * * @param boolean $cache If true, cache the output * @param array $params Associative array of attributes * * @return The rendered data * * @since 11.1 */ public function render($cache = false, $params = array()) { $xml = new DOMDocument('1.0', 'utf-8'); if (defined('JDEBUG') && JDEBUG) { $xml->formatOutput = true; } // The OpenSearch Namespace $osns = 'http://a9.com/-/spec/opensearch/1.1/'; // Create the root element $elOs = $xml->createElementNs($osns, 'OpenSearchDescription'); $elShortName = $xml->createElementNs($osns, 'ShortName'); $elShortName->appendChild($xml->createTextNode(htmlspecialchars($this->_shortName))); $elOs->appendChild($elShortName); $elDescription = $xml->createElementNs($osns, 'Description'); $elDescription->appendChild($xml->createTextNode(htmlspecialchars($this->description))); $elOs->appendChild($elDescription); // Always set the accepted input encoding to UTF-8 $elInputEncoding = $xml->createElementNs($osns, 'InputEncoding'); $elInputEncoding->appendChild($xml->createTextNode('UTF-8')); $elOs->appendChild($elInputEncoding); foreach ($this->_images as $image) { $elImage = $xml->createElementNs($osns, 'Image'); $elImage->setAttribute('type', $image->type); $elImage->setAttribute('width', $image->width); $elImage->setAttribute('height', $image->height); $elImage->appendChild($xml->createTextNode(htmlspecialchars($image->data))); $elOs->appendChild($elImage); } foreach ($this->_urls as $url) { $elUrl = $xml->createElementNs($osns, 'Url'); $elUrl->setAttribute('type', $url->type); // Results is the default value so we don't need to add it if ($url->rel != 'results') { $elUrl->setAttribute('rel', $url->rel); } $elUrl->setAttribute('template', $url->template); $elOs->appendChild($elUrl); } $xml->appendChild($elOs); parent::render(); return $xml->saveXml(); } /** * Sets the short name * * @param string $name The name. * * @return JDocumentOpensearch instance of $this to allow chaining * * @since 11.1 */ public function setShortName($name) { $this->_shortName = $name; return $this; } /** * Adds an URL to the OpenSearch description. * * @param JOpenSearchUrl $url The url to add to the description. * * @return JDocumentOpensearch instance of $this to allow chaining * * @since 11.1 */ public function addUrl(JOpenSearchUrl $url) { $this->_urls[] = $url; return $this; } /** * Adds an image to the OpenSearch description. * * @param JOpenSearchImage $image The image to add to the description. * * @return JDocumentOpensearch instance of $this to allow chaining * * @since 11.1 */ public function addImage(JOpenSearchImage $image) { $this->_images[] = $image; return $this; } } /** * JOpenSearchUrl is an internal class that stores the search URLs for the OpenSearch description * * @since 11.1 */ class JOpenSearchUrl { /** * Type item element * * required * * @var string * @since 11.1 */ public $type = 'text/html'; /** * Rel item element * * required * * @var string * @since 11.1 */ public $rel = 'results'; /** * Template item element. Has to contain the {searchTerms} parameter to work. * * required * * @var string * @since 11.1 */ public $template; } /** * JOpenSearchImage is an internal class that stores Images for the OpenSearch Description * * @since 11.1 */ class JOpenSearchImage { /** * The images MIME type * * required * * @var string * @since 11.1 */ public $type = ""; /** * URL of the image or the image as base64 encoded value * * required * * @var string * @since 11.1 */ public $data = ""; /** * The image's width * * required * * @var string * @since 11.1 */ public $width; /** * The image's height * * required * * @var string * @since 11.1 */ public $height; } PK���\\�� &libraries/joomla/document/renderer.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Abstract class for a renderer * * @since 11.1 */ class JDocumentRenderer { /** * Reference to the JDocument object that instantiated the renderer * * @var JDocument * @since 11.1 */ protected $_doc = null; /** * Renderer mime type * * @var string * @since 11.1 */ protected $_mime = "text/html"; /** * Class constructor * * @param JDocument $doc A reference to the JDocument object that instantiated the renderer * * @since 11.1 */ public function __construct(JDocument $doc) { $this->_doc = $doc; } /** * Renders a script and returns the results as a string * * @param string $name The name of the element to render * @param array $params Array of values * @param string $content Override the output of the renderer * * @return string The output of the script * * @since 11.1 */ public function render($name, $params = null, $content = null) { } /** * Return the content type of the renderer * * @return string The contentType * * @since 11.1 */ public function getContentType() { return $this->_mime; } /** * Convert links in a text from relative to absolute * * @param string $text The text processed * * @return string Text with converted links * * @since 11.1 */ protected function _relToAbs($text) { $base = JUri::base(); $text = preg_replace("/(href|src)=\"(?!http|ftp|https|mailto|data)([^\"]*)\"/", "$1=\"$base\$2\"", $text); return $text; } } PK���\|Z��uNuN&libraries/joomla/document/document.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Document class, provides an easy interface to parse and display a document * * @since 11.1 */ class JDocument { /** * Document title * * @var string * @since 11.1 */ public $title = ''; /** * Document description * * @var string * @since 11.1 */ public $description = ''; /** * Document full URL * * @var string * @since 11.1 */ public $link = ''; /** * Document base URL * * @var string * @since 11.1 */ public $base = ''; /** * Contains the document language setting * * @var string * @since 11.1 */ public $language = 'en-gb'; /** * Contains the document direction setting * * @var string * @since 11.1 */ public $direction = 'ltr'; /** * Document generator * * @var string */ public $_generator = 'Joomla! - Open Source Content Management'; /** * Document modified date * * @var string * @since 11.1 */ public $_mdate = ''; /** * Tab string * * @var string * @since 11.1 */ public $_tab = "\11"; /** * Contains the line end string * * @var string * @since 11.1 */ public $_lineEnd = "\12"; /** * Contains the character encoding string * * @var string * @since 11.1 */ public $_charset = 'utf-8'; /** * Document mime type * * @var string * @since 11.1 */ public $_mime = ''; /** * Document namespace * * @var string * @since 11.1 */ public $_namespace = ''; /** * Document profile * * @var string * @since 11.1 */ public $_profile = ''; /** * Array of linked scripts * * @var array * @since 11.1 */ public $_scripts = array(); /** * Array of scripts placed in the header * * @var array * @since 11.1 */ public $_script = array(); /** * Array of linked style sheets * * @var array * @since 11.1 */ public $_styleSheets = array(); /** * Array of included style declarations * * @var array * @since 11.1 */ public $_style = array(); /** * Array of meta tags * * @var array * @since 11.1 */ public $_metaTags = array(); /** * The rendering engine * * @var object * @since 11.1 */ public $_engine = null; /** * The document type * * @var string * @since 11.1 */ public $_type = null; /** * Array of buffered output * * @var mixed (depends on the renderer) * @since 11.1 */ public static $_buffer = null; /** * JDocument instances container. * * @var array * @since 11.3 */ protected static $instances = array(); /** * Media version added to assets * * @var string * @since 3.2 */ protected $mediaVersion = null; /** * Class constructor. * * @param array $options Associative array of options * * @since 11.1 */ public function __construct($options = array()) { if (array_key_exists('lineend', $options)) { $this->setLineEnd($options['lineend']); } if (array_key_exists('charset', $options)) { $this->setCharset($options['charset']); } if (array_key_exists('language', $options)) { $this->setLanguage($options['language']); } if (array_key_exists('direction', $options)) { $this->setDirection($options['direction']); } if (array_key_exists('tab', $options)) { $this->setTab($options['tab']); } if (array_key_exists('link', $options)) { $this->setLink($options['link']); } if (array_key_exists('base', $options)) { $this->setBase($options['base']); } if (array_key_exists('mediaversion', $options)) { $this->setMediaVersion($options['mediaversion']); } } /** * Returns the global JDocument object, only creating it * if it doesn't already exist. * * @param string $type The document type to instantiate * @param array $attributes Array of attributes * * @return object The document object. * * @since 11.1 * @throws RuntimeException */ public static function getInstance($type = 'html', $attributes = array()) { $signature = serialize(array($type, $attributes)); if (empty(self::$instances[$signature])) { $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $path = __DIR__ . '/' . $type . '/' . $type . '.php'; $rawpath = __DIR__ . '/raw/raw.php'; $ntype = null; // Determine the path and class $class = 'JDocument' . $type; if (!class_exists($class)) { if (file_exists($path)) { require_once $path; } // Default to the raw format elseif (file_exists($rawpath)) { $ntype = $type; $type = 'raw'; $class = 'JDocument' . $type; require_once $rawpath; } else { // @codeCoverageIgnoreStart throw new RuntimeException('Invalid JDocument Class', 500); // @codeCoverageIgnoreEnd } } $instance = new $class($attributes); self::$instances[$signature] = $instance; if (!is_null($ntype)) { // Set the type to the Document type originally requested $instance->setType($ntype); } } return self::$instances[$signature]; } /** * Set the document type * * @param string $type Type document is to set to * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setType($type) { $this->_type = $type; return $this; } /** * Returns the document type * * @return string * * @since 11.1 */ public function getType() { return $this->_type; } /** * Get the contents of the document buffer * * @return The contents of the document buffer * * @since 11.1 */ public function getBuffer() { return self::$_buffer; } /** * Set the contents of the document buffer * * @param string $content The content to be set in the buffer. * @param array $options Array of optional elements. * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setBuffer($content, $options = array()) { self::$_buffer = $content; return $this; } /** * Gets a meta tag. * * @param string $name Value of name or http-equiv tag * @param boolean $httpEquiv META type "http-equiv" defaults to null * * @return string * * @since 11.1 */ public function getMetaData($name, $httpEquiv = false) { if ($name == 'generator') { $result = $this->getGenerator(); } elseif ($name == 'description') { $result = $this->getDescription(); } else { if ($httpEquiv == true) { $result = @$this->_metaTags['http-equiv'][$name]; } else { $result = @$this->_metaTags['standard'][$name]; } } return $result; } /** * Sets or alters a meta tag. * * @param string $name Value of name or http-equiv tag * @param string $content Value of the content tag * @param boolean $http_equiv META type "http-equiv" defaults to null * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setMetaData($name, $content, $http_equiv = false) { if ($name == 'generator') { $this->setGenerator($content); } elseif ($name == 'description') { $this->setDescription($content); } else { if ($http_equiv == true) { $this->_metaTags['http-equiv'][$name] = $content; } else { $this->_metaTags['standard'][$name] = $content; } } return $this; } /** * Adds a linked script to the page * * @param string $url URL to the linked script * @param string $type Type of script. Defaults to 'text/javascript' * @param boolean $defer Adds the defer attribute. * @param boolean $async Adds the async attribute. * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function addScript($url, $type = "text/javascript", $defer = false, $async = false) { $this->_scripts[$url]['mime'] = $type; $this->_scripts[$url]['defer'] = $defer; $this->_scripts[$url]['async'] = $async; return $this; } /** * Adds a linked script to the page with a version to allow to flush it. Ex: myscript.js54771616b5bceae9df03c6173babf11d * If not specified Joomla! automatically handles versioning * * @param string $url URL to the linked script * @param string $version Version of the script * @param string $type Type of script. Defaults to 'text/javascript' * @param boolean $defer Adds the defer attribute. * @param boolean $async [description] * * @return JDocument instance of $this to allow chaining * * @since 3.2 */ public function addScriptVersion($url, $version = null, $type = "text/javascript", $defer = false, $async = false) { // Automatic version if ($version === null) { $version = $this->getMediaVersion(); } if (!empty($version) && strpos($url, '?') === false) { $url .= '?' . $version; } return $this->addScript($url, $type, $defer, $async); } /** * Adds a script to the page * * @param string $content Script * @param string $type Scripting mime (defaults to 'text/javascript') * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function addScriptDeclaration($content, $type = 'text/javascript') { if (!isset($this->_script[strtolower($type)])) { $this->_script[strtolower($type)] = $content; } else { $this->_script[strtolower($type)] .= chr(13) . $content; } return $this; } /** * Adds a linked stylesheet to the page * * @param string $url URL to the linked style sheet * @param string $type Mime encoding type * @param string $media Media type that this stylesheet applies to * @param array $attribs Array of attributes * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function addStyleSheet($url, $type = 'text/css', $media = null, $attribs = array()) { $this->_styleSheets[$url]['mime'] = $type; $this->_styleSheets[$url]['media'] = $media; $this->_styleSheets[$url]['attribs'] = $attribs; return $this; } /** * Adds a linked stylesheet version to the page. Ex: template.css?54771616b5bceae9df03c6173babf11d * If not specified Joomla! automatically handles versioning * * @param string $url URL to the linked style sheet * @param string $version Version of the stylesheet * @param string $type Mime encoding type * @param string $media Media type that this stylesheet applies to * @param array $attribs Array of attributes * * @return JDocument instance of $this to allow chaining * * @since 3.2 */ public function addStyleSheetVersion($url, $version = null, $type = "text/css", $media = null, $attribs = array()) { // Automatic version if ($version === null) { $version = $this->getMediaVersion(); } if (!empty($version) && strpos($url, '?') === false) { $url .= '?' . $version; } return $this->addStyleSheet($url, $type, $media, $attribs); } /** * Adds a stylesheet declaration to the page * * @param string $content Style declarations * @param string $type Type of stylesheet (defaults to 'text/css') * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function addStyleDeclaration($content, $type = 'text/css') { if (!isset($this->_style[strtolower($type)])) { $this->_style[strtolower($type)] = $content; } else { $this->_style[strtolower($type)] .= chr(13) . $content; } return $this; } /** * Sets the document charset * * @param string $type Charset encoding string * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setCharset($type = 'utf-8') { $this->_charset = $type; return $this; } /** * Returns the document charset encoding. * * @return string * * @since 11.1 */ public function getCharset() { return $this->_charset; } /** * Sets the global document language declaration. Default is English (en-gb). * * @param string $lang The language to be set * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setLanguage($lang = "en-gb") { $this->language = strtolower($lang); return $this; } /** * Returns the document language. * * @return string * * @since 11.1 */ public function getLanguage() { return $this->language; } /** * Sets the global document direction declaration. Default is left-to-right (ltr). * * @param string $dir The language direction to be set * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setDirection($dir = "ltr") { $this->direction = strtolower($dir); return $this; } /** * Returns the document direction declaration. * * @return string * * @since 11.1 */ public function getDirection() { return $this->direction; } /** * Sets the title of the document * * @param string $title The title to be set * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setTitle($title) { $this->title = $title; return $this; } /** * Return the title of the document. * * @return string * * @since 11.1 */ public function getTitle() { return $this->title; } /** * Set the assets version * * @param string $mediaVersion Media version to use * * @return JDocument instance of $this to allow chaining * * @since 3.2 */ public function setMediaVersion($mediaVersion) { $this->mediaVersion = strtolower($mediaVersion); return $this; } /** * Return the media version * * @return string * * @since 3.2 */ public function getMediaVersion() { return $this->mediaVersion; } /** * Sets the base URI of the document * * @param string $base The base URI to be set * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setBase($base) { $this->base = $base; return $this; } /** * Return the base URI of the document. * * @return string * * @since 11.1 */ public function getBase() { return $this->base; } /** * Sets the description of the document * * @param string $description The description to set * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setDescription($description) { $this->description = $description; return $this; } /** * Return the title of the page. * * @return string * * @since 11.1 */ public function getDescription() { return $this->description; } /** * Sets the document link * * @param string $url A url * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setLink($url) { $this->link = $url; return $this; } /** * Returns the document base url * * @return string * * @since 11.1 */ public function getLink() { return $this->link; } /** * Sets the document generator * * @param string $generator The generator to be set * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setGenerator($generator) { $this->_generator = $generator; return $this; } /** * Returns the document generator * * @return string * * @since 11.1 */ public function getGenerator() { return $this->_generator; } /** * Sets the document modified date * * @param string $date The date to be set * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setModifiedDate($date) { $this->_mdate = $date; return $this; } /** * Returns the document modified date * * @return string * * @since 11.1 */ public function getModifiedDate() { return $this->_mdate; } /** * Sets the document MIME encoding that is sent to the browser. * * This usually will be text/html because most browsers cannot yet * accept the proper mime settings for XHTML: application/xhtml+xml * and to a lesser extent application/xml and text/xml. See the W3C note * ({@link http://www.w3.org/TR/xhtml-media-types/ * http://www.w3.org/TR/xhtml-media-types/}) for more details. * * @param string $type The document type to be sent * @param boolean $sync Should the type be synced with HTML? * * @return JDocument instance of $this to allow chaining * * @since 11.1 * * @link http://www.w3.org/TR/xhtml-media-types */ public function setMimeEncoding($type = 'text/html', $sync = true) { $this->_mime = strtolower($type); // Syncing with meta-data if ($sync) { $this->setMetaData('content-type', $type . '; charset=' . $this->_charset, true); } return $this; } /** * Return the document MIME encoding that is sent to the browser. * * @return string * * @since 11.1 */ public function getMimeEncoding() { return $this->_mime; } /** * Sets the line end style to Windows, Mac, Unix or a custom string. * * @param string $style "win", "mac", "unix" or custom string. * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setLineEnd($style) { switch ($style) { case 'win': $this->_lineEnd = "\15\12"; break; case 'unix': $this->_lineEnd = "\12"; break; case 'mac': $this->_lineEnd = "\15"; break; default: $this->_lineEnd = $style; } return $this; } /** * Returns the lineEnd * * @return string * * @since 11.1 */ public function _getLineEnd() { return $this->_lineEnd; } /** * Sets the string used to indent HTML * * @param string $string String used to indent ("\11", "\t", ' ', etc.). * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function setTab($string) { $this->_tab = $string; return $this; } /** * Returns a string containing the unit for indenting HTML * * @return string * * @since 11.1 */ public function _getTab() { return $this->_tab; } /** * Load a renderer * * @param string $type The renderer type * * @return JDocumentRenderer Object or null if class does not exist * * @since 11.1 * @throws RuntimeException */ public function loadRenderer($type) { $class = 'JDocumentRenderer' . $type; if (!class_exists($class)) { $path = __DIR__ . '/' . $this->_type . '/renderer/' . $type . '.php'; if (file_exists($path)) { require_once $path; } else { throw new RuntimeException('Unable to load renderer class', 500); } } if (!class_exists($class)) { return null; } $instance = new $class($this); return $instance; } /** * Parses the document and prepares the buffers * * @param array $params The array of parameters * * @return JDocument instance of $this to allow chaining * * @since 11.1 */ public function parse($params = array()) { return $this; } /** * Outputs the document * * @param boolean $cache If true, cache the output * @param array $params Associative array of attributes * * @return The rendered data * * @since 11.1 */ public function render($cache = false, $params = array()) { $app = JFactory::getApplication(); if ($mdate = $this->getModifiedDate()) { $app->modifiedDate = $mdate; } $app->mimeType = $this->_mime; $app->charSet = $this->_charset; } } PK���\�����)libraries/joomla/document/error/error.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Document * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * DocumentError class, provides an easy interface to parse and display an error page * * @since 11.1 */ class JDocumentError extends JDocument { /** * Error Object * * @var object * @since 11.1 */ protected $_error; /** * Class constructor * * @param array $options Associative array of attributes * * @since 11.1 */ public function __construct($options = array()) { parent::__construct($options); // Set mime type $this->_mime = 'text/html'; // Set document type $this->_type = 'error'; } /** * Set error object * * @param object $error Error object to set * * @return boolean True on success * * @since 11.1 */ public function setError($error) { if ($error instanceof Exception) { $this->_error = & $error; return true; } else { return false; } } /** * Render the document * * @param boolean $cache If true, cache the output * @param array $params Associative array of attributes * * @return string The rendered data * * @since 11.1 */ public function render($cache = false, $params = array()) { // If no error object is set return null if (!isset($this->_error)) { return; } // Set the status header $status = $this->_error->getCode(); if ($status < 400 || $status > 599) { $status = 500; } JFactory::getApplication()->setHeader('status', $status . ' ' . str_replace("\n", ' ', $this->_error->getMessage())); $file = 'error.php'; // Check template $directory = isset($params['directory']) ? $params['directory'] : 'templates'; $template = isset($params['template']) ? JFilterInput::getInstance()->clean($params['template'], 'cmd') : 'system'; if (!file_exists($directory . '/' . $template . '/' . $file)) { $template = 'system'; } // Set variables $this->baseurl = JUri::base(true); $this->template = $template; $this->debug = isset($params['debug']) ? $params['debug'] : false; $this->error = $this->_error; // Load $data = $this->_loadTemplate($directory . '/' . $template, $file); parent::render(); return $data; } /** * Load a template file * * @param string $directory The name of the template * @param string $filename The actual filename * * @return string The contents of the template * * @since 11.1 */ public function _loadTemplate($directory, $filename) { $contents = ''; // Check to see if we have a valid template file if (file_exists($directory . '/' . $filename)) { // Store the file path $this->_file = $directory . '/' . $filename; // Get the file content ob_start(); require_once $directory . '/' . $filename; $contents = ob_get_contents(); ob_end_clean(); } return $contents; } /** * Render the backtrace * * @return string The contents of the backtrace * * @since 11.1 */ public function renderBacktrace() { // If no error object is set return null if (!isset($this->_error)) { return; } $contents = null; $backtrace = $this->_error->getTrace(); if (is_array($backtrace)) { ob_start(); $j = 1; echo '<table cellpadding="0" cellspacing="0" class="Table">'; echo ' <tr>'; echo ' <td colspan="3" class="TD"><strong>Call stack</strong></td>'; echo ' </tr>'; echo ' <tr>'; echo ' <td class="TD"><strong>#</strong></td>'; echo ' <td class="TD"><strong>Function</strong></td>'; echo ' <td class="TD"><strong>Location</strong></td>'; echo ' </tr>'; for ($i = count($backtrace) - 1; $i >= 0; $i--) { echo ' <tr>'; echo ' <td class="TD">' . $j . '</td>'; if (isset($backtrace[$i]['class'])) { echo ' <td class="TD">' . $backtrace[$i]['class'] . $backtrace[$i]['type'] . $backtrace[$i]['function'] . '()</td>'; } else { echo ' <td class="TD">' . $backtrace[$i]['function'] . '()</td>'; } if (isset($backtrace[$i]['file'])) { echo ' <td class="TD">' . $backtrace[$i]['file'] . ':' . $backtrace[$i]['line'] . '</td>'; } else { echo ' <td class="TD"> </td>'; } echo ' </tr>'; $j++; } echo '</table>'; $contents = ob_get_contents(); ob_end_clean(); } return $contents; } } PK���\�}s�V V $libraries/joomla/form/fields/url.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('text'); /** * Form Field class for the Joomla Platform. * Supports a URL text field * * @link http://www.w3.org/TR/html-markup/input.url.html#input.url * @see JFormRuleUrl for validation of full urls * @since 11.1 */ class JFormFieldUrl extends JFormFieldText { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Url'; /** * Method to get the field input markup. * * @return string The field input markup. * * @since 3.1.2 (CMS) */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : ''; $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $readonly = $this->readonly ? ' readonly' : ''; $disabled = $this->disabled ? ' disabled' : ''; $required = $this->required ? ' required aria-required="true"' : ''; $hint = $hint ? ' placeholder="' . $hint . '"' : ''; $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"'; $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; $autofocus = $this->autofocus ? ' autofocus' : ''; $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"'; // Note that the input type "url" is suitable only for external URLs, so if internal URLs are allowed // we have to use the input type "text" instead. $inputType = $this->element['relative'] ? 'type="text"' : 'type="url"'; // Initialize JavaScript field attributes. $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return '<input ' . $inputType . ' name="' . $this->name . '"' . $class . ' id="' . $this->id . '" value="' . htmlspecialchars(JStringPunycode::urlToUTF8($this->value), ENT_COMPAT, 'UTF-8') . '"' . $size . $disabled . $readonly . $hint . $autocomplete . $autofocus . $spellcheck . $onchange . $maxLength . $required . ' />'; } } PK���\��N�66(libraries/joomla/form/fields/plugins.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Framework. * * @since 11.4 */ class JFormFieldPlugins extends JFormFieldList { /** * The field type. * * @var string * @since 11.4 */ protected $type = 'Plugins'; /** * The path to folder for plugins. * * @var string * @since 3.2 */ protected $folder; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'folder': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'folder': $this->$name = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->folder = (string) $this->element['folder']; } return $return; } /** * Method to get a list of options for a list input. * * @return array An array of JHtml options. * * @since 11.4 */ protected function getOptions() { $folder = $this->folder; if (!empty($folder)) { // Get list of plugins $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('element AS value, name AS text') ->from('#__extensions') ->where('folder = ' . $db->quote($folder)) ->where('enabled = 1') ->order('ordering, name'); $db->setQuery($query); $options = $db->loadObjectList(); $lang = JFactory::getLanguage(); foreach ($options as $i => $item) { $source = JPATH_PLUGINS . '/' . $folder . '/' . $item->value; $extension = 'plg_' . $folder . '_' . $item->value; $lang->load($extension . '.sys', JPATH_ADMINISTRATOR, null, false, true) || $lang->load($extension . '.sys', $source, null, false, true); $options[$i]->text = JText::_($item->text); } } else { JLog::add(JText::_('JFRAMEWORK_FORM_FIELDS_PLUGINS_ERROR_FOLDER_EMPTY'), JLog::WARNING, 'jerror'); } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } } PK���\!�A8��&libraries/joomla/form/fields/range.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('number'); /** * Form Field class for the Joomla Platform. * Provides a horizontal scroll bar to specify a value in a range. * * @link http://www.w3.org/TR/html-markup/input.text.html#input.text * @since 3.2 */ class JFormFieldRange extends JFormFieldNumber { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'Range'; /** * Method to get the field input markup. * * @return string The field input markup. * * @since 3.2 */ protected function getInput() { // Initialize some field attributes. $max = !empty($this->max) ? ' max="' . $this->max . '"' : ''; $min = !empty($this->min) ? ' min="' . $this->min . '"' : ''; $step = !empty($this->step) ? ' step="' . $this->step . '"' : ''; $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $readonly = $this->readonly ? ' readonly' : ''; $disabled = $this->disabled ? ' disabled' : ''; $autofocus = $this->autofocus ? ' autofocus' : ''; $value = (float) $this->value; $value = empty($value) ? $this->min : $value; // Initialize JavaScript field attributes. $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return '<input type="range" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"' . $class . $disabled . $readonly . $onchange . $max . $step . $min . $autofocus . ' />'; } } PK���\������'libraries/joomla/form/fields/hidden.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Provides a hidden field * * @link http://www.w3.org/TR/html-markup/input.hidden.html#input.hidden * @since 11.1 */ class JFormFieldHidden extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Hidden'; /** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { // Initialize some field attributes. $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $disabled = $this->disabled ? ' disabled' : ''; // Initialize JavaScript field attributes. $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; return '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $disabled . $onchange . ' />'; } } PK���\�zT��)libraries/joomla/form/fields/checkbox.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Single check box field. * This is a boolean field with null for false and the specified option for true * * @link http://www.w3.org/TR/html-markup/input.checkbox.html#input.checkbox * @see JFormFieldCheckboxes * @since 11.1 */ class JFormFieldCheckbox extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Checkbox'; /** * The checked state of checkbox field. * * @var boolean * @since 3.2 */ protected $checked = false; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'checked': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'checked': $value = (string) $value; $this->$name = ($value == 'true' || $value == $name || $value == '1'); break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $checked = (string) $this->element['checked']; $this->checked = ($checked == 'true' || $checked == 'checked' || $checked == '1'); empty($this->value) || $this->checked ? null : $this->checked = true; } return $return; } /** * Method to get the field input markup. * The checked element sets the field to selected. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { // Initialize some field attributes. $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $disabled = $this->disabled ? ' disabled' : ''; $value = !empty($this->default) ? $this->default : '1'; $required = $this->required ? ' required aria-required="true"' : ''; $autofocus = $this->autofocus ? ' autofocus' : ''; $checked = $this->checked || !empty($this->value) ? ' checked' : ''; // Initialize JavaScript field attributes. $onclick = !empty($this->onclick) ? ' onclick="' . $this->onclick . '"' : ''; $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return '<input type="checkbox" name="' . $this->name . '" id="' . $this->id . '" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"' . $class . $checked . $disabled . $onclick . $onchange . $required . $autofocus . ' />'; } } PK���\~5ܺ3libraries/joomla/form/fields/databaseconnection.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Provides a list of available database connections, optionally limiting to * a given list. * * @see JDatabaseDriver * @since 11.3 */ class JFormFieldDatabaseConnection extends JFormFieldList { /** * The form field type. * * @var string * @since 11.3 */ protected $type = 'DatabaseConnection'; /** * Method to get the list of database options. * * This method produces a drop down list of available databases supported * by JDatabaseDriver classes that are also supported by the application. * * @return array The field option objects. * * @since 11.3 * @see JDatabaseDriver::getConnectors() */ protected function getOptions() { // This gets the connectors available in the platform and supported by the server. $available = JDatabaseDriver::getConnectors(); /** * This gets the list of database types supported by the application. * This should be entered in the form definition as a comma separated list. * If no supported databases are listed, it is assumed all available databases * are supported. */ $supported = $this->element['supported']; if (!empty($supported)) { $supported = explode(',', $supported); foreach ($supported as $support) { if (in_array($support, $available)) { $options[$support] = JText::_(ucfirst($support)); } } } else { foreach ($available as $support) { $options[$support] = JText::_(ucfirst($support)); } } // This will come into play if an application is installed that requires // a database that is not available on the server. if (empty($options)) { $options[''] = JText::_('JNONE'); } return $options; } } PK���\��R�..&libraries/joomla/form/fields/rules.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Field for assigning permissions to groups for a given asset * * @see JAccess * @since 11.1 */ class JFormFieldRules extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Rules'; /** * The section. * * @var string * @since 3.2 */ protected $section; /** * The component. * * @var string * @since 3.2 */ protected $component; /** * The assetField. * * @var string * @since 3.2 */ protected $assetField; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'section': case 'component': case 'assetField': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'section': case 'component': case 'assetField': $this->$name = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->section = $this->element['section'] ? (string) $this->element['section'] : ''; $this->component = $this->element['component'] ? (string) $this->element['component'] : ''; $this->assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id'; } return $return; } /** * Method to get the field input markup for Access Control Lists. * Optionally can be associated with a specific component and section. * * @return string The field input markup. * * @since 11.1 * @todo: Add access check. */ protected function getInput() { 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 = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) ->where($db->quoteName('name') . ' = ' . $db->quote($component)); $db->setQuery($query); $assetId = (int) $db->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); } // 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 data-chosen="true" 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"><span class="icon-lock icon-white"></span> ' . JText::_('JLIB_RULES_NOT_ALLOWED_LOCKED') . '</span>'; } } } elseif (!empty($component)) { $html[] = '<span class="label label-success"><span class="icon-lock icon-white"></span> ' . 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"><span class="icon-lock icon-white"></span> ' . JText::_('JLIB_RULES_NOT_ALLOWED_ADMIN_CONFLICT') . '</span>'; } else { $html[] = '<span class="label label-success"><span class="icon-lock icon-white"></span> ' . 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); } /** * Get a list of the user groups. * * @return array * * @since 11.1 */ protected function getUserGroups() { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level, a.parent_id') ->from('#__usergroups AS a') ->join('LEFT', $db->quoteName('#__usergroups') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt') ->group('a.id, a.title, a.lft, a.rgt, a.parent_id') ->order('a.lft ASC'); $db->setQuery($query); $options = $db->loadObjectList(); return $options; } } PK���\�c��qq)libraries/joomla/form/fields/calendar.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * * Provides a pop up date picker linked to a button. * Optionally may be filtered to use user's or server's time zone. * * @since 11.1 */ class JFormFieldCalendar extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Calendar'; /** * The allowable maxlength of calendar field. * * @var integer * @since 3.2 */ protected $maxlength; /** * The format of date and time. * * @var integer * @since 3.2 */ protected $format; /** * The filter. * * @var integer * @since 3.2 */ protected $filter; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'maxlength': case 'format': case 'filter': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'maxlength': $value = (int) $value; case 'format': case 'filter': $this->$name = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->maxlength = (int) $this->element['maxlength'] ? (int) $this->element['maxlength'] : 45; $this->format = (string) $this->element['format'] ? (string) $this->element['format'] : '%Y-%m-%d'; $this->filter = (string) $this->element['filter'] ? (string) $this->element['filter'] : 'USER_UTC'; } return $return; } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $format = $this->format; // Build the attributes array. $attributes = array(); empty($this->size) ? null : $attributes['size'] = $this->size; empty($this->maxlength) ? null : $attributes['maxlength'] = $this->maxlength; empty($this->class) ? null : $attributes['class'] = $this->class; !$this->readonly ? null : $attributes['readonly'] = 'readonly'; !$this->disabled ? null : $attributes['disabled'] = 'disabled'; empty($this->onchange) ? null : $attributes['onchange'] = $this->onchange; empty($hint) ? null : $attributes['placeholder'] = $hint; $this->autocomplete ? null : $attributes['autocomplete'] = 'off'; !$this->autofocus ? null : $attributes['autofocus'] = ''; if ($this->required) { $attributes['required'] = ''; $attributes['aria-required'] = 'true'; } // Handle the special case for "now". if (strtoupper($this->value) == 'NOW') { $this->value = JFactory::getDate()->format('Y-m-d H:i:s'); } // Get some system objects. $config = JFactory::getConfig(); $user = JFactory::getUser(); // If a known filter is given use it. switch (strtoupper($this->filter)) { case 'SERVER_UTC': // Convert a date to UTC based on the server timezone. if ($this->value && $this->value != JFactory::getDbo()->getNullDate()) { // Get a date object based on the correct timezone. $date = JFactory::getDate($this->value, 'UTC'); $date->setTimezone(new DateTimeZone($config->get('offset'))); // Transform the date string. $this->value = $date->format('Y-m-d H:i:s', true, false); } break; case 'USER_UTC': // Convert a date to UTC based on the user timezone. if ($this->value && $this->value != JFactory::getDbo()->getNullDate()) { // Get a date object based on the correct timezone. $date = JFactory::getDate($this->value, 'UTC'); $date->setTimezone(new DateTimeZone($user->getParam('timezone', $config->get('offset')))); // Transform the date string. $this->value = $date->format('Y-m-d H:i:s', true, false); } break; } // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return JHtml::_('calendar', $this->value, $this->name, $this->id, $format, $attributes); } } PK���\КMlFF+libraries/joomla/form/fields/folderlist.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); JFormHelper::loadFieldClass('list'); /** * Supports an HTML select list of folder * * @since 11.1 */ class JFormFieldFolderList extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'FolderList'; /** * The filter. * * @var string * @since 3.2 */ protected $filter; /** * The exclude. * * @var string * @since 3.2 */ protected $exclude; /** * The hideNone. * * @var boolean * @since 3.2 */ protected $hideNone = false; /** * The hideDefault. * * @var boolean * @since 3.2 */ protected $hideDefault = false; /** * The directory. * * @var string * @since 3.2 */ protected $directory; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'filter': case 'exclude': case 'hideNone': case 'hideDefault': case 'directory': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'filter': case 'directory': case 'exclude': $this->$name = (string) $value; break; case 'hideNone': case 'hideDefault': $value = (string) $value; $this->$name = ($value === 'true' || $value === $name || $value === '1'); break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->filter = (string) $this->element['filter']; $this->exclude = (string) $this->element['exclude']; $hideNone = (string) $this->element['hide_none']; $this->hideNone = ($hideNone == 'true' || $hideNone == 'hideNone' || $hideNone == '1'); $hideDefault = (string) $this->element['hide_default']; $this->hideDefault = ($hideDefault == 'true' || $hideDefault == 'hideDefault' || $hideDefault == '1'); // Get the path in which to search for file options. $this->directory = (string) $this->element['directory']; } return $return; } /** * Method to get the field options. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { $options = array(); $path = $this->directory; if (!is_dir($path)) { $path = JPATH_ROOT . '/' . $path; } // Prepend some default options based on field attributes. if (!$this->hideNone) { $options[] = JHtml::_('select.option', '-1', JText::alt('JOPTION_DO_NOT_USE', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))); } if (!$this->hideDefault) { $options[] = JHtml::_('select.option', '', JText::alt('JOPTION_USE_DEFAULT', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))); } // Get a list of folders in the search path with the given filter. $folders = JFolder::folders($path, $this->filter); // Build the options list from the list of folders. if (is_array($folders)) { foreach ($folders as $folder) { // Check to see if the file is in the exclude mask. if ($this->exclude) { if (preg_match(chr(1) . $this->exclude . chr(1), $folder)) { continue; } } $options[] = JHtml::_('select.option', $folder, $folder); } } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } } PK���\5 cuu/libraries/joomla/form/fields/sessionhandler.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Provides a select list of session handler options. * * @since 11.1 */ class JFormFieldSessionHandler extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'SessionHandler'; /** * Method to get the session handler field options. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { $options = array(); // Get the options from JSession. foreach (JSession::getStores() as $store) { $options[] = JHtml::_('select.option', $store, JText::_('JLIB_FORM_VALUE_SESSION_' . $store), 'value', 'text'); } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } } PK���\��]�x x *libraries/joomla/form/fields/usergroup.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @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 nested check box field listing user groups. * Multiselect is available by default. * * @since 11.1 * @deprecated 3.5 */ class JFormFieldUsergroup extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Usergroup'; /** * Method to get the user group field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { JLog::add('JFormFieldUsergroup is deprecated. Use JFormFieldUserGroupList instead.', JLog::WARNING, 'deprecated'); $options = array(); $attr = ''; // Initialize some field attributes. $attr .= !empty($this->class) ? ' class="' . $this->class . '"' : ''; $attr .= $this->disabled ? ' disabled' : ''; $attr .= $this->size ? ' size="' . $this->size . '"' : ''; $attr .= $this->multiple ? ' multiple' : ''; $attr .= $this->required ? ' required aria-required="true"' : ''; $attr .= $this->autofocus ? ' autofocus' : ''; // Initialize JavaScript field attributes. $attr .= !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; $attr .= !empty($this->onclick) ? ' onclick="' . $this->onclick . '"' : ''; // Iterate through the children and build an array of options. foreach ($this->element->children() as $option) { // Only add <option /> elements. if ($option->getName() != 'option') { continue; } $disabled = (string) $option['disabled']; $disabled = ($disabled == 'true' || $disabled == 'disabled' || $disabled == '1'); // Create a new option object based on the <option /> element. $tmp = JHtml::_( 'select.option', (string) $option['value'], trim((string) $option), 'value', 'text', $disabled ); // 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; } return JHtml::_('access.usergroup', $this->name, $this->value, $attr, $options, $this->id); } } PK���\��۫��+libraries/joomla/form/fields/checkboxes.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Displays options as a list of check boxes. * Multiselect may be forced to be true. * * @see JFormFieldCheckbox * @since 11.1 */ class JFormFieldCheckboxes extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Checkboxes'; /** * Flag to tell the field to always be in multiple values mode. * * @var boolean * @since 11.1 */ protected $forceMultiple = true; /** * The comma seprated list of checked checkboxes value. * * @var mixed * @since 3.2 */ public $checkedOptions; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'forceMultiple': case 'checkedOptions': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'checkedOptions': $this->checkedOptions = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->checkedOptions = (string) $this->element['checked']; } return $return; } /** * Method to get the field input markup for check boxes. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { $html = array(); // Initialize some field attributes. $class = !empty($this->class) ? ' class="checkboxes ' . $this->class . '"' : ' class="checkboxes"'; $checkedOptions = explode(',', (string) $this->checkedOptions); $required = $this->required ? ' required aria-required="true"' : ''; $autofocus = $this->autofocus ? ' autofocus' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); // Start the checkbox field output. $html[] = '<fieldset id="' . $this->id . '"' . $class . $required . $autofocus . '>'; // Get the field options. $options = $this->getOptions(); // Build the checkbox field output. $html[] = '<ul>'; foreach ($options as $i => $option) { // Initialize some option attributes. if (!isset($this->value) || empty($this->value)) { $checked = (in_array((string) $option->value, (array) $checkedOptions) ? ' checked' : ''); } else { $value = !is_array($this->value) ? explode(',', $this->value) : $this->value; $checked = (in_array((string) $option->value, $value) ? ' checked' : ''); } $checked = empty($checked) && $option->checked ? ' checked' : $checked; $class = !empty($option->class) ? ' class="' . $option->class . '"' : ''; $disabled = !empty($option->disable) || $this->disabled ? ' disabled' : ''; // Initialize some JavaScript option attributes. $onclick = !empty($option->onclick) ? ' onclick="' . $option->onclick . '"' : ''; $onchange = !empty($option->onchange) ? ' onchange="' . $option->onchange . '"' : ''; $html[] = '<li>'; $html[] = '<input type="checkbox" id="' . $this->id . $i . '" name="' . $this->name . '" value="' . htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8') . '"' . $checked . $class . $onclick . $onchange . $disabled . '/>'; $html[] = '<label for="' . $this->id . $i . '"' . $class . '>' . JText::_($option->text) . '</label>'; $html[] = '</li>'; } $html[] = '</ul>'; // End the checkbox field output. $html[] = '</fieldset>'; return implode($html); } } PK���\�ȍ��&libraries/joomla/form/fields/color.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Color Form Field class for the Joomla Platform. * This implementation is designed to be compatible with HTML5's <input type="color"> * * @link http://www.w3.org/TR/html-markup/input.color.html * @since 11.3 */ class JFormFieldColor extends JFormField { /** * The form field type. * * @var string * @since 11.3 */ protected $type = 'Color'; /** * The control. * * @var mixed * @since 3.2 */ protected $control = 'hue'; /** * The position. * * @var mixed * @since 3.2 */ protected $position = 'right'; /** * The colors. * * @var mixed * @since 3.2 */ protected $colors; /** * The split. * * @var integer * @since 3.2 */ protected $split = 3; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'control': case 'exclude': case 'colors': case 'split': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'split': $value = (int) $value; case 'control': case 'exclude': case 'colors': $this->$name = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->control = isset($this->element['control']) ? (string) $this->element['control'] : 'hue'; $this->position = isset($this->element['position']) ? (string) $this->element['position'] : 'right'; $this->colors = (string) $this->element['colors']; $this->split = isset($this->element['split']) ? (int) $this->element['split'] : 3; } return $return; } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.3 */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Control value can be: hue (default), saturation, brightness, wheel or simple $control = $this->control; // Position of the panel can be: right (default), left, top or bottom $position = ' data-position="' . $this->position . '"'; $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; $class = $this->class; $required = $this->required ? ' required aria-required="true"' : ''; $disabled = $this->disabled ? ' disabled' : ''; $autofocus = $this->autofocus ? ' autofocus' : ''; $color = strtolower($this->value); if (!$color || in_array($color, array('none', 'transparent'))) { $color = 'none'; } elseif ($color['0'] != '#') { $color = '#' . $color; } if ($control == 'simple') { $class = ' class="' . trim('simplecolors chzn-done ' . $class) . '"'; JHtml::_('behavior.simplecolorpicker'); $colors = strtolower($this->colors); if (empty($colors)) { $colors = array( 'none', '#049cdb', '#46a546', '#9d261d', '#ffc40d', '#f89406', '#c3325f', '#7a43b6', '#ffffff', '#999999', '#555555', '#000000' ); } else { $colors = explode(',', $colors); } $split = $this->split; if (!$split) { $count = count($colors); if ($count % 5 == 0) { $split = 5; } else { if ($count % 4 == 0) { $split = 4; } } } $split = $split ? $split : 3; $html = array(); $html[] = '<select name="' . $this->name . '" id="' . $this->id . '"' . $disabled . $required . $class . $position . $onchange . $autofocus . ' style="visibility:hidden;width:22px;height:1px">'; foreach ($colors as $i => $c) { $html[] = '<option' . ($c == $color ? ' selected="selected"' : '') . '>' . $c . '</option>'; if (($i + 1) % $split == 0) { $html[] = '<option>-</option>'; } } $html[] = '</select>'; return implode('', $html); } else { $class = ' class="' . trim('minicolors ' . $class) . '"'; $control = $control ? ' data-control="' . $control . '"' : ''; $readonly = $this->readonly ? ' readonly' : ''; $hint = $hint ? ' placeholder="' . $hint . '"' : ' placeholder="#rrggbb"'; $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); JHtml::_('behavior.colorpicker'); return '<input type="text" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($color, ENT_COMPAT, 'UTF-8') . '"' . $hint . $class . $position . $control . $readonly . $disabled . $required . $onchange . $autocomplete . $autofocus . '/>'; } } } PK���\pƭ�+libraries/joomla/form/fields/repeatable.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Display a JSON loaded window with a repeatable set of sub fields * * @since 3.2 */ class JFormFieldRepeatable extends JFormField { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'Repeatable'; /** * Method to get the field input markup. * * @return string The field input markup. * * @since 3.2 */ protected function getInput() { // Initialize variables. $subForm = new JForm($this->name, array('control' => 'jform')); $xml = $this->element->children()->asXml(); $subForm->load($xml); // Needed for repeating modals in gmaps // @TODO: what and where??? $subForm->repeatCounter = (int) @$this->form->repeatCounter; $children = $this->element->children(); $subForm->setFields($children); // If a maximum value isn't set then we'll make the maximum amount of cells a large number $maximum = $this->element['maximum'] ? (int) $this->element['maximum'] : '999'; // Build a Table $head_row_str = array(); $body_row_str = array(); foreach ($subForm->getFieldset() as $field) { // Reset name to simple $field->name = (string) $field->element['name']; // Build heading $head_row_str[] = '<th>' . strip_tags($field->getLabel($field->name)); $head_row_str[] = '<br /><small style="font-weight:normal">' . JText::_($field->description) . '</small>'; $head_row_str[] = '</th>'; // Build body $body_row_str[] = '<td>' . $field->getInput() . '</td>'; } // Append buttons $head_row_str[] = '<th><div class="btn-group"><a href="#" class="add btn button btn-success"><span class="icon-plus"></span> </a></div></th>'; $body_row_str[] = '<td><div class="btn-group">'; $body_row_str[] = '<a class="add btn button btn-success"><span class="icon-plus"></span> </a>'; $body_row_str[] = '<a class="remove btn button btn-danger"><span class="icon-minus"></span> </a>'; $body_row_str[] = '</div></td>'; // Put all table parts together $table = '<table id="' . $this->id . '_table" class="adminlist ' . $this->element['class'] . ' table table-striped">' . '<thead><tr>' . implode("\n", $head_row_str) . '</tr></thead>' . '<tbody><tr>' . implode("\n", $body_row_str) . '</tr></tbody>' . '</table>'; // And finaly build a main container $str = array(); $str[] = '<div id="' . $this->id . '_container">'; // Add the table to modal $str[] = '<div id="' . $this->id . '_modal" class="modal hide">'; $str[] = $table; $str[] = '<div class="modal-footer">'; $str[] = '<button class="close-modal btn button btn-link">' . JText::_('JCANCEL') . '</button>'; $str[] = '<button class="save-modal-data btn button btn-primary">' . JText::_('JAPPLY') . '</button>'; $str[] = '</div>'; // Close modal container $str[] = '</div>'; // Close main container $str[] = '</div>'; // Button for display the modal window $select = (string) $this->element['select'] ? JText::_((string) $this->element['select']) : JText::_('JLIB_FORM_BUTTON_SELECT'); $icon = $this->element['icon'] ? '<span class="icon-' . $this->element['icon'] . '"></span> ' : ''; $str[] = '<button class="open-modal btn" id="' . $this->id . '_button" >' . $icon . $select . '</button>'; if (is_array($this->value)) { $this->value = array_shift($this->value); } // Script params $data = array(); $data[] = 'data-container="#' . $this->id . '_container"'; $data[] = 'data-modal-element="#' . $this->id . '_modal"'; $data[] = 'data-repeatable-element="table tbody tr"'; $data[] = 'data-bt-add="a.add"'; $data[] = 'data-bt-remove="a.remove"'; $data[] = 'data-bt-modal-open="#' . $this->id . '_button"'; $data[] = 'data-bt-modal-close="button.close-modal"'; $data[] = 'data-bt-modal-save-data="button.save-modal-data"'; $data[] = 'data-maximum="' . $maximum . '"'; $data[] = 'data-input="#' . $this->id . '"'; // Hidden input, where the main value is $value = htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'); $str[] = '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '" value="' . $value . '" class="form-field-repeatable" ' . implode(' ', $data) . ' />'; // Add scripts JHtml::_('bootstrap.framework'); JHtml::_('script', 'system/repeatable.js', true, true); return implode("\n", $str); } } PK���\�>��*libraries/joomla/form/fields/imagelist.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('filelist'); /** * Supports an HTML select list of image * * @since 11.1 */ class JFormFieldImageList extends JFormFieldFileList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'ImageList'; /** * Method to get the list of images field options. * Use the filter attribute to specify allowable file extensions. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // Define the image file type filter. $this->filter = '\.png$|\.gif$|\.jpg$|\.bmp$|\.ico$|\.jpeg$|\.psd$|\.eps$'; // Get the field options. return parent::getOptions(); } } PK���\vX�tt)libraries/joomla/form/fields/timezone.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('groupedlist'); /** * Form Field class for the Joomla Platform. * * @since 11.1 */ class JFormFieldTimezone extends JFormFieldGroupedList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Timezone'; /** * The list of available timezone groups to use. * * @var array * @since 11.1 */ protected static $zones = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific'); /** * The keyField of timezone field. * * @var integer * @since 3.2 */ protected $keyField; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'keyField': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'keyField': $this->keyField = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->keyField = (string) $this->element['key_field']; } return $return; } /** * Method to get the time zone field option groups. * * @return array The field option objects as a nested array in groups. * * @since 11.1 */ protected function getGroups() { $groups = array(); $keyField = !empty($this->keyField) ? $this->keyField : 'id'; $keyValue = $this->form->getValue($keyField); // If the timezone is not set use the server setting. if (strlen($this->value) == 0 && empty($keyValue)) { $this->value = JFactory::getConfig()->get('offset'); } // Get the list of time zones from the server. $zones = DateTimeZone::listIdentifiers(); // Build the group lists. foreach ($zones as $zone) { // Time zones not in a group we will ignore. if (strpos($zone, '/') === false) { continue; } // Get the group/locale from the timezone. list ($group, $locale) = explode('/', $zone, 2); // Only use known groups. if (in_array($group, self::$zones)) { // Initialize the group if necessary. if (!isset($groups[$group])) { $groups[$group] = array(); } // Only add options where a locale exists. if (!empty($locale)) { $groups[$group][$zone] = JHtml::_('select.option', $zone, str_replace('_', ' ', $locale), 'value', 'text', false); } } } // Sort the group lists. ksort($groups); foreach ($groups as &$location) { sort($location); } // Merge any additional groups in the XML definition. $groups = array_merge(parent::getGroups(), $groups); return $groups; } } PK���\Vd�u)libraries/joomla/form/fields/password.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Text field for passwords * * @link http://www.w3.org/TR/html-markup/input.password.html#input.password * @note Two password fields may be validated as matching using JFormRuleEquals * @since 11.1 */ class JFormFieldPassword extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Password'; /** * The threshold of password field. * * @var integer * @since 3.2 */ protected $threshold = 66; /** * The allowable maxlength of password. * * @var integer * @since 3.2 */ protected $maxLength; /** * Whether to attach a password strength meter or not. * * @var boolean * @since 3.2 */ protected $meter = false; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'threshold': case 'maxLength': case 'meter': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { $value = (string) $value; switch ($name) { case 'maxLength': case 'threshold': $this->$name = $value; break; case 'meter': $this->meter = ($value === 'true' || $value === $name || $value === '1'); break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->maxLength = $this->element['maxlength'] ? (int) $this->element['maxlength'] : 99; $this->threshold = $this->element['threshold'] ? (int) $this->element['threshold'] : 66; $meter = (string) $this->element['strengthmeter']; $this->meter = ($meter == 'true' || $meter == 'on' || $meter == '1'); } return $return; } /** * Method to get the field input markup for password. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : ''; $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $readonly = $this->readonly ? ' readonly' : ''; $disabled = $this->disabled ? ' disabled' : ''; $required = $this->required ? ' required aria-required="true"' : ''; $hint = $hint ? ' placeholder="' . $hint . '"' : ''; $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ''; $autofocus = $this->autofocus ? ' autofocus' : ''; if ($this->meter) { JHtml::_('script', 'system/passwordstrength.js', true, true); $script = 'new Form.PasswordStrength("' . $this->id . '", { threshold: ' . $this->threshold . ', onUpdate: function(element, strength, threshold) { element.set("data-passwordstrength", strength); } } );'; // Load script on document load. JFactory::getDocument()->addScriptDeclaration( "jQuery(document).ready(function(){" . $script . "});" ); } // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return '<input type="password" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $hint . $autocomplete . $class . $readonly . $disabled . $size . $maxLength . $required . $autofocus . ' />'; } } PK���\�:U )libraries/joomla/form/fields/language.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Supports a list of installed application languages * * @see JFormFieldContentLanguage for a select list of content languages. * @since 11.1 */ class JFormFieldLanguage extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Language'; /** * Method to get the field options. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { // Initialize some field attributes. $client = (string) $this->element['client']; if ($client != 'site' && $client != 'administrator') { $client = 'site'; } // Make sure the languages are sorted base on locale instead of random sorting $languages = JLanguageHelper::createLanguageList($this->value, constant('JPATH_' . strtoupper($client)), true, true); if (count($languages) > 1) { usort( $languages, function ($a, $b) { return strcmp($a["value"], $b["value"]); } ); } // Merge any additional options in the XML definition. $options = array_merge( parent::getOptions(), $languages ); // Set the default value active language if ($langParams = JComponentHelper::getParams('com_languages')) { switch ((string) $this->value) { case 'site': case 'frontend': case '0': $this->value = $langParams->get('site', 'en-GB'); break; case 'admin': case 'administrator': case 'backend': case '1': $this->value = $langParams->get('administrator', 'en-GB'); break; case 'active': case 'auto': $lang = JFactory::getLanguage(); $this->value = $lang->getTag(); break; default: break; } } return $options; } } PK���\�$g��'libraries/joomla/form/fields/number.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Provides a one line text box with up-down handles to set a number in the field. * * @link http://www.w3.org/TR/html-markup/input.text.html#input.text * @since 3.2 */ class JFormFieldNumber extends JFormField { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'Number'; /** * The allowable maximum value of the field. * * @var float * @since 3.2 */ protected $max = null; /** * The allowable minimum value of the field. * * @var float * @since 3.2 */ protected $min = null; /** * The step by which value of the field increased or decreased. * * @var float * @since 3.2 */ protected $step = 0; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'max': case 'min': case 'step': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'step': case 'min': case 'max': $this->$name = (float) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { // It is better not to force any default limits if none is specified $this->max = isset($this->element['max']) ? (float) $this->element['max'] : null; $this->min = isset($this->element['min']) ? (float) $this->element['min'] : null; $this->step = isset($this->element['step']) ? (float) $this->element['step'] : 1; } return $return; } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 3.2 */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; // Must use isset instead of !empty for max/min because "zero" boundaries are always acceptable $max = isset($this->max) ? ' max="' . $this->max . '"' : ''; $min = isset($this->min) ? ' min="' . $this->min . '"' : ''; $step = !empty($this->step) ? ' step="' . $this->step . '"' : ''; $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $readonly = $this->readonly ? ' readonly' : ''; $disabled = $this->disabled ? ' disabled' : ''; $required = $this->required ? ' required aria-required="true"' : ''; $hint = $hint ? ' placeholder="' . $hint . '"' : ''; $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"'; $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; $autofocus = $this->autofocus ? ' autofocus' : ''; $value = (float) $this->value; $value = empty($value) ? $this->min : $value; // Initialize JavaScript field attributes. $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return '<input type="number" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $hint . $onchange . $max . $step . $min . $required . $autocomplete . $autofocus . ' />'; } } PK���\�r�t$libraries/joomla/form/fields/sql.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Supports an custom SQL select list * * @since 11.1 */ class JFormFieldSQL extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ public $type = 'SQL'; /** * The keyField. * * @var string * @since 3.2 */ protected $keyField; /** * The valueField. * * @var string * @since 3.2 */ protected $valueField; /** * The translate. * * @var boolean * @since 3.2 */ protected $translate = false; /** * The query. * * @var string * @since 3.2 */ protected $query; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'keyField': case 'valueField': case 'translate': case 'query': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'keyField': case 'valueField': case 'translate': case 'query': $this->$name = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->keyField = $this->element['key_field'] ? (string) $this->element['key_field'] : 'value'; $this->valueField = $this->element['value_field'] ? (string) $this->element['value_field'] : (string) $this->element['name']; $this->translate = $this->element['translate'] ? (string) $this->element['translate'] : false; $this->query = (string) $this->element['query']; } return $return; } /** * Method to get the custom field options. * Use the query attribute to supply a query to generate the list. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { $options = array(); // Initialize some field attributes. $key = $this->keyField; $value = $this->valueField; // Get the database object. $db = JFactory::getDbo(); // Set the query and get the result list. $db->setQuery($this->query); $items = $db->loadObjectlist(); // Build the field options. if (!empty($items)) { foreach ($items as $item) { if ($this->translate == true) { $options[] = JHtml::_('select.option', $item->$key, JText::_($item->$value)); } else { $options[] = JHtml::_('select.option', $item->$key, $item->$value); } } } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } } PK���\�8ϲ� � &libraries/joomla/form/fields/radio.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Provides radio button inputs * * @link http://www.w3.org/TR/html-markup/command.radio.html#command.radio * @since 11.1 */ class JFormFieldRadio extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Radio'; /** * Method to get the radio button field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { $html = array(); // Initialize some field attributes. $class = !empty($this->class) ? ' class="radio ' . $this->class . '"' : ' class="radio"'; $required = $this->required ? ' required aria-required="true"' : ''; $autofocus = $this->autofocus ? ' autofocus' : ''; $disabled = $this->disabled ? ' disabled' : ''; $readonly = $this->readonly; // Start the radio field output. $html[] = '<fieldset id="' . $this->id . '"' . $class . $required . $autofocus . $disabled . ' >'; // Get the field options. $options = $this->getOptions(); // Build the radio field output. foreach ($options as $i => $option) { // Initialize some option attributes. $checked = ((string) $option->value == (string) $this->value) ? ' checked="checked"' : ''; $class = !empty($option->class) ? ' class="' . $option->class . '"' : ''; $disabled = !empty($option->disable) || ($readonly && !$checked); $disabled = $disabled ? ' disabled' : ''; // Initialize some JavaScript option attributes. $onclick = !empty($option->onclick) ? ' onclick="' . $option->onclick . '"' : ''; $onchange = !empty($option->onchange) ? ' onchange="' . $option->onchange . '"' : ''; $html[] = '<input type="radio" id="' . $this->id . $i . '" name="' . $this->name . '" value="' . htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8') . '"' . $checked . $class . $required . $onclick . $onchange . $disabled . ' />'; $html[] = '<label for="' . $this->id . $i . '"' . $class . ' >' . JText::alt($option->text, preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)) . '</label>'; $required = ''; } // End the radio field output. $html[] = '</fieldset>'; return implode($html); } } PK���\~��z��%libraries/joomla/form/fields/file.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Provides an input field for files * * @link http://www.w3.org/TR/html-markup/input.file.html#input.file * @since 11.1 */ class JFormFieldFile extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'File'; /** * The accepted file type list. * * @var mixed * @since 3.2 */ protected $accept; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'accept': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'accept': $this->$name = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->accept = (string) $this->element['accept']; } return $return; } /** * Method to get the field input markup for the file field. * Field attributes allow specification of a maximum file size and a string * of accepted file extensions. * * @return string The field input markup. * * @note The field does not include an upload mechanism. * @see JFormFieldMedia * @since 11.1 */ protected function getInput() { // Initialize some field attributes. $accept = !empty($this->accept) ? ' accept="' . $this->accept . '"' : ''; $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $disabled = $this->disabled ? ' disabled' : ''; $required = $this->required ? ' required aria-required="true"' : ''; $autofocus = $this->autofocus ? ' autofocus' : ''; $multiple = $this->multiple ? ' multiple' : ''; // Initialize JavaScript field attributes. $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return '<input type="file" name="' . $this->name . '" id="' . $this->id . '"' . $accept . $disabled . $class . $size . $onchange . $required . $autofocus . $multiple . ' />'; } } PK���\,6��PP)libraries/joomla/form/fields/textarea.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @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 multi line area for entry of plain text * * @link http://www.w3.org/TR/html-markup/textarea.html#textarea * @since 11.1 */ class JFormFieldTextarea extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Textarea'; /** * The number of rows in textarea. * * @var mixed * @since 3.2 */ protected $rows; /** * The number of columns in textarea. * * @var mixed * @since 3.2 */ protected $columns; /** * The maximum number of characters in textarea. * * @var mixed * @since 3.4 */ protected $maxlength; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'rows': case 'columns': case 'maxlength': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'rows': case 'columns': case 'maxlength': $this->$name = (int) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->rows = isset($this->element['rows']) ? (int) $this->element['rows'] : false; $this->columns = isset($this->element['cols']) ? (int) $this->element['cols'] : false; $this->maxlength = isset($this->element['maxlength']) ? (int) $this->element['maxlength'] : false; } return $return; } /** * Method to get the textarea field input markup. * Use the rows and columns attributes to specify the dimensions of the area. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $disabled = $this->disabled ? ' disabled' : ''; $readonly = $this->readonly ? ' readonly' : ''; $columns = $this->columns ? ' cols="' . $this->columns . '"' : ''; $rows = $this->rows ? ' rows="' . $this->rows . '"' : ''; $required = $this->required ? ' required aria-required="true"' : ''; $hint = $hint ? ' placeholder="' . $hint . '"' : ''; $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"'; $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; $autofocus = $this->autofocus ? ' autofocus' : ''; $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"'; $maxlength = $this->maxlength ? ' maxlength="' . $this->maxlength . '"' : ''; // Initialize JavaScript field attributes. $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; $onclick = $this->onclick ? ' onclick="' . $this->onclick . '"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return '<textarea name="' . $this->name . '" id="' . $this->id . '"' . $columns . $rows . $class . $hint . $disabled . $readonly . $onchange . $onclick . $required . $autocomplete . $autofocus . $spellcheck . $maxlength . ' >' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '</textarea>'; } } PK���\-�3�TT%libraries/joomla/form/fields/list.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @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 11.1 */ class JFormFieldList extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ 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 11.1 */ 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. { $html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id); } return implode($html); } /** * Method to get the field options. * * @return array The field option objects. * * @since 11.1 */ 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; } } $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']; // Add the option object to the result set. $options[] = (object) $tmp; } reset($options); return $options; } } PK���\������(libraries/joomla/form/fields/integer.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Provides a select list of integers with specified first, last and step values. * * @since 11.1 */ class JFormFieldInteger extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Integer'; /** * Method to get the field options. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { $options = array(); // Initialize some field attributes. $first = (int) $this->element['first']; $last = (int) $this->element['last']; $step = (int) $this->element['step']; // Sanity checks. if ($step == 0) { // Step of 0 will create an endless loop. return $options; } elseif ($first < $last && $step < 0) { // A negative step will never reach the last number. return $options; } elseif ($first > $last && $step > 0) { // A position step will never reach the last number. return $options; } elseif ($step < 0) { // Build the options array backwards. for ($i = $first; $i >= $last; $i += $step) { $options[] = JHtml::_('select.option', $i); } } else { // Build the options array. for ($i = $first; $i <= $last; $i += $step) { $options[] = JHtml::_('select.option', $i); } } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } } PK���\Qw�y y $libraries/joomla/form/fields/tel.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('text'); /** * Form Field class for the Joomla Platform. * Supports a text field telephone numbers. * * @link http://www.w3.org/TR/html-markup/input.tel.html * @see JFormRuleTel for telephone number validation * @see JHtmlTel for rendering of telephone numbers * @since 11.1 */ class JFormFieldTel extends JFormFieldText { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Tel'; /** * Method to get the field input markup. * * @return string The field input markup. * * @since 3.2 */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : ''; $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $readonly = $this->readonly ? ' readonly' : ''; $disabled = $this->disabled ? ' disabled' : ''; $required = $this->required ? ' required aria-required="true"' : ''; $hint = $hint ? ' placeholder="' . $hint . '"' : ''; $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"'; $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; $autofocus = $this->autofocus ? ' autofocus' : ''; $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"'; // Initialize JavaScript field attributes. $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return '<input type="tel" name="' . $this->name . '"' . $class . ' id="' . $this->id . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $size . $disabled . $readonly . $hint . $autocomplete . $autofocus . $spellcheck . $onchange . $maxLength . $required . ' />'; } } PK���\�`]��,libraries/joomla/form/fields/accesslevel.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Provides a list of access levels. Access levels control what users in specific * groups can see. * * @see JAccess * @since 11.1 */ class JFormFieldAccessLevel extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'AccessLevel'; /** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { $attr = ''; // Initialize some field attributes. $attr .= !empty($this->class) ? ' class="' . $this->class . '"' : ''; $attr .= $this->disabled ? ' disabled' : ''; $attr .= !empty($this->size) ? ' size="' . $this->size . '"' : ''; $attr .= $this->multiple ? ' multiple' : ''; $attr .= $this->required ? ' required aria-required="true"' : ''; $attr .= $this->autofocus ? ' autofocus' : ''; // Initialize JavaScript field attributes. $attr .= $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; // Get the field options. $options = $this->getOptions(); return JHtml::_('access.level', $this->name, $this->value, $attr, $options, $this->id); } } PK���\l�� ++%libraries/joomla/form/fields/text.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @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 one line text field. * * @link http://www.w3.org/TR/html-markup/input.text.html#input.text * @since 11.1 */ class JFormFieldText extends JFormField { /** * The form field type. * * @var string * * @since 11.1 */ protected $type = 'Text'; /** * The allowable maxlength of the field. * * @var integer * @since 3.2 */ protected $maxLength; /** * The mode of input associated with the field. * * @var mixed * @since 3.2 */ protected $inputmode; /** * The name of the form field direction (ltr or rtl). * * @var string * @since 3.2 */ protected $dirname; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'maxLength': case 'dirname': case 'inputmode': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'maxLength': $this->maxLength = (int) $value; break; case 'dirname': $value = (string) $value; $value = ($value == $name || $value == 'true' || $value == '1'); case 'inputmode': $this->name = (string) $value; break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $result = parent::setup($element, $value, $group); if ($result == true) { $inputmode = (string) $this->element['inputmode']; $dirname = (string) $this->element['dirname']; $this->inputmode = ''; $inputmode = preg_replace('/\s+/', ' ', trim($inputmode)); $inputmode = explode(' ', $inputmode); if (!empty($inputmode)) { $defaultInputmode = in_array('default', $inputmode) ? JText::_("JLIB_FORM_INPUTMODE") . ' ' : ''; foreach (array_keys($inputmode, 'default') as $key) { unset($inputmode[$key]); } $this->inputmode = $defaultInputmode . implode(" ", $inputmode); } // Set the dirname. $dirname = ((string) $dirname == 'dirname' || $dirname == 'true' || $dirname == '1'); $this->dirname = $dirname ? $this->getName($this->fieldname . '_dir') : false; $this->maxLength = (int) $this->element['maxlength']; } return $result; } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : ''; $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $readonly = $this->readonly ? ' readonly' : ''; $disabled = $this->disabled ? ' disabled' : ''; $required = $this->required ? ' required aria-required="true"' : ''; $hint = $hint ? ' placeholder="' . $hint . '"' : ''; $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"'; $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; $autofocus = $this->autofocus ? ' autofocus' : ''; $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"'; $pattern = !empty($this->pattern) ? ' pattern="' . $this->pattern . '"' : ''; $inputmode = !empty($this->inputmode) ? ' inputmode="' . $this->inputmode . '"' : ''; $dirname = !empty($this->dirname) ? ' dirname="' . $this->dirname . '"' : ''; // Initialize JavaScript field attributes. $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); $datalist = ''; $list = ''; /* Get the field options for the datalist. Note: getSuggestions() is deprecated and will be changed to getOptions() with 4.0. */ $options = (array) $this->getSuggestions(); if ($options) { $datalist = '<datalist id="' . $this->id . '_datalist">'; foreach ($options as $option) { if (!$option->value) { continue; } $datalist .= '<option value="' . $option->value . '">' . $option->text . '</option>'; } $datalist .= '</datalist>'; $list = ' list="' . $this->id . '_datalist"'; } $html[] = '<input type="text" name="' . $this->name . '" id="' . $this->id . '"' . $dirname . ' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $list . $hint . $onchange . $maxLength . $required . $autocomplete . $autofocus . $spellcheck . $inputmode . $pattern . ' />'; $html[] = $datalist; return implode($html); } /** * Method to get the field options. * * @return array The field option objects. * * @since 3.4 */ protected function getOptions() { $options = array(); foreach ($this->element->children() as $option) { // Only add <option /> elements. if ($option->getName() != 'option') { continue; } // Create a new option object based on the <option /> element. $options[] = JHtml::_( 'select.option', (string) $option['value'], JText::alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text' ); } return $options; } /** * Method to get the field suggestions. * * @return array The field option objects. * * @since 3.2 * @deprecated 4.0 Use getOptions instead */ protected function getSuggestions() { return $this->getOptions(); } } PK���\�����/libraries/joomla/form/fields/predefinedlist.phpnu�[���<?php /** * @package Joomla.Libraries * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field to load a list of predefined values * * @since 3.2 */ abstract class JFormFieldPredefinedList extends JFormFieldList { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'PredefinedList'; /** * Cached array of the category items. * * @var array * @since 3.2 */ protected static $options = array(); /** * Available predefined options * * @var array * @since 3.2 */ protected $predefinedOptions = array(); /** * Translate options labels ? * * @var boolean * @since 3.2 */ protected $translate = true; /** * Method to get the options to populate list * * @return array The field option objects. * * @since 3.2 */ protected function getOptions() { // Hash for caching $hash = md5($this->element); $type = strtolower($this->type); if (!isset(static::$options[$type][$hash]) && !empty($this->predefinedOptions)) { static::$options[$type][$hash] = parent::getOptions(); $options = array(); // Allow to only use specific values of the predefined list $filter = isset($this->element['filter']) ? explode(',', $this->element['filter']) : array(); foreach ($this->predefinedOptions as $value => $text) { if (empty($filter) || in_array($value, $filter)) { $text = $this->translate ? JText::_($text) : $text; $options[] = (object) array( 'value' => $value, 'text' => $text ); } } static::$options[$type][$hash] = array_merge(static::$options[$type][$hash], $options); } return static::$options[$type][$hash]; } } PK���\~敷33%libraries/joomla/form/fields/note.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @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 one line text field. * * @link http://www.w3.org/TR/html-markup/input.text.html#input.text * @since 11.1 */ class JFormFieldNote extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Note'; /** * Method to get the field label markup. * * @return string The field label markup. * * @since 11.1 */ protected function getLabel() { if (empty($this->element['label']) && empty($this->element['description'])) { return ''; } $title = $this->element['label'] ? (string) $this->element['label'] : ($this->element['title'] ? (string) $this->element['title'] : ''); $heading = $this->element['heading'] ? (string) $this->element['heading'] : 'h4'; $description = (string) $this->element['description']; $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $close = (string) $this->element['close']; $html = array(); if ($close) { $close = $close == 'true' ? 'alert' : $close; $html[] = '<button type="button" class="close" data-dismiss="' . $close . '">×</button>'; } $html[] = !empty($title) ? '<' . $heading . '>' . JText::_($title) . '</' . $heading . '>' : ''; $html[] = !empty($description) ? JText::_($description) : ''; return '</div><div ' . $class . '>' . implode('', $html); } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { return ''; } } PK���\;L&���&libraries/joomla/form/fields/meter.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('number'); /** * Form Field class for the Joomla Platform. * Provides a meter to show value in a range. * * @link http://www.w3.org/TR/html-markup/input.text.html#input.text * @since 3.2 */ class JFormFieldMeter extends JFormFieldNumber { /** * The form field type. * * @var string * @since 3.2 */ protected $type = 'Meter'; /** * The width of the field increased or decreased. * * @var string * @since 3.2 */ protected $width; /** * Whether the field is active or not. * * @var boolean * @since 3.2 */ protected $active = false; /** * Whether the field is animated or not. * * @var boolean * @since 3.2 */ protected $animated = true; /** * The color of the field * * @var boolean * @since 3.2 */ protected $color; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'active': case 'width': case 'animated': case 'color': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'width': case 'color': $this->$name = (string) $value; break; case 'active': $value = (string) $value; $this->$name = ($value === 'true' || $value === $name || $value === '1'); break; case 'animated': $value = (string) $value; $this->$name = !($value === 'false' || $value === 'off' || $value === '0'); break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->width = isset($this->element['width']) ? (string) $this->element['width'] : ''; $this->color = isset($this->element['color']) ? (string) $this->element['color'] : ''; $active = (string) $this->element['active']; $this->active = ($active == 'true' || $active == 'on' || $active == '1'); $animated = (string) $this->element['animated']; $this->animated = !($animated == 'false' || $animated == 'off' || $animated == '0'); } return $return; } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 3.2 */ protected function getInput() { // Initialize some field attributes. $width = !empty($this->width) ? ' style="width:' . $this->width . ';"' : ''; $color = !empty($this->color) ? ' background-color:' . $this->color . ';' : ''; $data = ''; $data .= ' data-max="' . $this->max . '"'; $data .= ' data-min="' . $this->min . '"'; $data .= ' data-step="' . $this->step . '"'; $class = 'progress ' . $this->class; $class .= $this->animated ? ' progress-striped' : ''; $class .= $this->active ? ' active' : ''; $class = ' class="' . $class . '"'; $value = (float) $this->value; $value = $value < $this->min ? $this->min : $value; $value = $value > $this->max ? $this->max : $value; $data .= ' data-value="' . $this->value . '"'; $value = ((float) ($value - $this->min) * 100) / ($this->max - $this->min); $html[] = '<div ' . $class . $width . $data . ' >'; $html[] = ' <div class="bar" style="width: ' . strval($value) . '%;' . $color . '"></div>'; $html[] = '</div>'; return implode('', $html); } } PK���\�%S&II&libraries/joomla/form/fields/combo.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Implements a combo box field. * * @since 11.1 */ class JFormFieldCombo extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Combo'; /** * Method to get the field input markup for a combo box field. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { $html = array(); $attr = ''; // Initialize some field attributes. $attr .= !empty($this->class) ? ' class="combobox ' . $this->class . '"' : ' class="combobox"'; $attr .= $this->readonly ? ' readonly' : ''; $attr .= $this->disabled ? ' disabled' : ''; $attr .= !empty($this->size) ? ' size="' . $this->size . '"' : ''; $attr .= $this->required ? ' required aria-required="true"' : ''; // Initialize JavaScript field attributes. $attr .= $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; // Get the field options. $options = $this->getOptions(); // Load the combobox behavior. JHtml::_('behavior.combobox'); $html[] = '<div class="combobox input-append">'; // Build the input for the combo box. $html[] = '<input type="text" name="' . $this->name . '" id="' . $this->id . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $attr . ' autocomplete="off" />'; $html[] = '<div class="btn-group">'; $html[] = '<button type="button" class="btn dropdown-toggle">'; $html[] = ' <span class="caret"></span>'; $html[] = '</button>'; // Build the list for the combo box. $html[] = '<ul class="dropdown-menu">'; foreach ($options as $option) { $html[] = '<li><a href="#">' . $option->text . '</a></li>'; } $html[] = '</ul>'; $html[] = '</div></div>'; return implode($html); } } PK���\�ߪ�3 3 'libraries/joomla/form/fields/spacer.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Provides spacer markup to be used in form layouts. * * @since 11.1 */ class JFormFieldSpacer extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Spacer'; /** * Method to get the field input markup for a spacer. * The spacer does not have accept input. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { return ' '; } /** * Method to get the field label markup for a spacer. * Use the label text or name from the XML element as the spacer or * Use a hr="true" to automatically generate plain hr markup * * @return string The field label markup. * * @since 11.1 */ protected function getLabel() { $html = array(); $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $html[] = '<span class="spacer">'; $html[] = '<span class="before"></span>'; $html[] = '<span' . $class . '>'; if ((string) $this->element['hr'] == 'true') { $html[] = '<hr' . $class . ' />'; } else { $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; // Build the class for the label. $class = !empty($this->description) ? 'hasTooltip' : ''; $class = $this->required == true ? $class . ' required' : $class; // Add the opening label tag and main attributes attributes. $label .= '<label id="' . $this->id . '-lbl" class="' . $class . '"'; // If a description is specified, use it to build a tooltip. if (!empty($this->description)) { JHtml::_('bootstrap.tooltip'); $label .= ' title="' . JHtml::tooltipText(trim($text, ':'), JText::_($this->description), 0) . '"'; } // Add the label text and closing tag. $label .= '>' . $text . '</label>'; $html[] = $label; } $html[] = '</span>'; $html[] = '<span class="after"></span>'; $html[] = '</span>'; return implode('', $html); } /** * Method to get the field title. * * @return string The field title. * * @since 11.1 */ protected function getTitle() { return $this->getLabel(); } } PK���\}�����)libraries/joomla/form/fields/filelist.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); JFormHelper::loadFieldClass('list'); /** * Supports an HTML select list of files * * @since 11.1 */ class JFormFieldFileList extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'FileList'; /** * The filter. * * @var string * @since 3.2 */ protected $filter; /** * The exclude. * * @var string * @since 3.2 */ protected $exclude; /** * The hideNone. * * @var boolean * @since 3.2 */ protected $hideNone = false; /** * The hideDefault. * * @var boolean * @since 3.2 */ protected $hideDefault = false; /** * The stripExt. * * @var boolean * @since 3.2 */ protected $stripExt = false; /** * The directory. * * @var string * @since 3.2 */ protected $directory; /** * 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 3.2 */ public function __get($name) { switch ($name) { case 'filter': case 'exclude': case 'hideNone': case 'hideDefault': case 'stripExt': case 'directory': return $this->$name; } return parent::__get($name); } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'filter': case 'directory': case 'exclude': $this->$name = (string) $value; break; case 'hideNone': case 'hideDefault': case 'stripExt': $value = (string) $value; $this->$name = ($value === 'true' || $value === $name || $value === '1'); break; default: parent::__set($name, $value); } } /** * 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 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.2 */ public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $this->filter = (string) $this->element['filter']; $this->exclude = (string) $this->element['exclude']; $hideNone = (string) $this->element['hide_none']; $this->hideNone = ($hideNone == 'true' || $hideNone == 'hideNone' || $hideNone == '1'); $hideDefault = (string) $this->element['hide_default']; $this->hideDefault = ($hideDefault == 'true' || $hideDefault == 'hideDefault' || $hideDefault == '1'); $stripExt = (string) $this->element['stripext']; $this->stripExt = ($stripExt == 'true' || $stripExt == 'stripExt' || $stripExt == '1'); // Get the path in which to search for file options. $this->directory = (string) $this->element['directory']; } return $return; } /** * Method to get the list of files for the field options. * Specify the target directory with a directory attribute * Attributes allow an exclude mask and stripping of extensions from file name. * Default attribute may optionally be set to null (no file) or -1 (use a default). * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { $options = array(); $path = $this->directory; if (!is_dir($path)) { $path = JPATH_ROOT . '/' . $path; } // Prepend some default options based on field attributes. if (!$this->hideNone) { $options[] = JHtml::_('select.option', '-1', JText::alt('JOPTION_DO_NOT_USE', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))); } if (!$this->hideDefault) { $options[] = JHtml::_('select.option', '', JText::alt('JOPTION_USE_DEFAULT', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))); } // Get a list of files in the search path with the given filter. $files = JFolder::files($path, $this->filter); // Build the options list from the list of files. if (is_array($files)) { foreach ($files as $file) { // Check to see if the file is in the exclude mask. if ($this->exclude) { if (preg_match(chr(1) . $this->exclude . chr(1), $file)) { continue; } } // If the extension is to be stripped, do it. if ($this->stripExt) { $file = JFile::stripExt($file); } $options[] = JHtml::_('select.option', $file, $file); } } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } } PK���\�T��//-libraries/joomla/form/fields/cachehandler.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('list'); /** * Form Field class for the Joomla Platform. * Provides a list of available cache handlers * * @see JCache * @since 11.1 */ class JFormFieldCacheHandler extends JFormFieldList { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'CacheHandler'; /** * Method to get the field options. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { $options = array(); // Convert to name => name array. foreach (JCache::getStores() as $store) { $options[] = JHtml::_('select.option', $store, JText::_('JLIB_FORM_VALUE_CACHE_' . $store), 'value', 'text'); } $options = array_merge(parent::getOptions(), $options); return $options; } } PK���\� ����,libraries/joomla/form/fields/groupedlist.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Field class for the Joomla Platform. * Provides a grouped list select field. * * @since 11.1 */ class JFormFieldGroupedList extends JFormField { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'GroupedList'; /** * Method to get the field option groups. * * @return array The field option objects as a nested array in groups. * * @since 11.1 * @throws UnexpectedValueException */ protected function getGroups() { $groups = array(); $label = 0; foreach ($this->element->children() as $element) { switch ($element->getName()) { // The element is an <option /> case 'option': // Initialize the group if necessary. if (!isset($groups[$label])) { $groups[$label] = array(); } $disabled = (string) $element['disabled']; $disabled = ($disabled == 'true' || $disabled == 'disabled' || $disabled == '1'); // Create a new option object based on the <option /> element. $tmp = JHtml::_( 'select.option', ($element['value']) ? (string) $element['value'] : trim((string) $element), JText::alt(trim((string) $element), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text', $disabled ); // Set some option attributes. $tmp->class = (string) $element['class']; // Set some JavaScript option attributes. $tmp->onclick = (string) $element['onclick']; // Add the option. $groups[$label][] = $tmp; break; // The element is a <group /> case 'group': // Get the group label. if ($groupLabel = (string) $element['label']) { $label = JText::_($groupLabel); } // Initialize the group if necessary. if (!isset($groups[$label])) { $groups[$label] = array(); } // Iterate through the children and build an array of options. foreach ($element->children() as $option) { // Only add <option /> elements. if ($option->getName() != 'option') { continue; } $disabled = (string) $option['disabled']; $disabled = ($disabled == 'true' || $disabled == 'disabled' || $disabled == '1'); // Create a new option object based on the <option /> element. $tmp = JHtml::_( 'select.option', ($option['value']) ? (string) $option['value'] : JText::_(trim((string) $option)), JText::_(trim((string) $option)), 'value', 'text', $disabled ); // Set some option attributes. $tmp->class = (string) $option['class']; // Set some JavaScript option attributes. $tmp->onclick = (string) $option['onclick']; // Add the option. $groups[$label][] = $tmp; } if ($groupLabel) { $label = count($groups); } break; // Unknown element type. default: throw new UnexpectedValueException(sprintf('Unsupported element %s in JFormFieldGroupedList', $element->getName()), 500); } } reset($groups); return $groups; } /** * Method to get the field input markup fora grouped list. * Multiselect is enabled by using the multiple attribute. * * @return string The field input markup. * * @since 11.1 */ 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 . '"' : ''; $attr .= $this->multiple ? ' multiple' : ''; $attr .= $this->required ? ' required aria-required="true"' : ''; $attr .= $this->autofocus ? ' autofocus' : ''; // Initialize JavaScript field attributes. $attr .= !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; // Get the field groups. $groups = (array) $this->getGroups(); // Create a read-only list (no name) with a hidden input to store the value. if ($this->readonly) { $html[] = JHtml::_( 'select.groupedlist', $groups, null, array( 'list.attr' => $attr, 'id' => $this->id, 'list.select' => $this->value, 'group.items' => null, 'option.key.toHtml' => false, 'option.text.toHtml' => false ) ); $html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"/>'; } // Create a regular list. else { $html[] = JHtml::_( 'select.groupedlist', $groups, $this->name, array( 'list.attr' => $attr, 'id' => $this->id, 'list.select' => $this->value, 'group.items' => null, 'option.key.toHtml' => false, 'option.text.toHtml' => false ) ); } return implode($html); } } PK���\R�m� � &libraries/joomla/form/fields/email.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JFormHelper::loadFieldClass('text'); /** * Form Field class for the Joomla Platform. * Provides and input field for e-mail addresses * * @link http://www.w3.org/TR/html-markup/input.email.html#input.email * @see JFormRuleEmail * @since 11.1 */ class JFormFieldEMail extends JFormFieldText { /** * The form field type. * * @var string * @since 11.1 */ protected $type = 'Email'; /** * Method to get the field input markup for e-mail addresses. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : ''; $class = !empty($this->class) ? ' class="validate-email ' . $this->class . '"' : ' class="validate-email"'; $readonly = $this->readonly ? ' readonly' : ''; $disabled = $this->disabled ? ' disabled' : ''; $required = $this->required ? ' required aria-required="true"' : ''; $hint = $hint ? ' placeholder="' . $hint . '"' : ''; $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"'; $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; $autofocus = $this->autofocus ? ' autofocus' : ''; $multiple = $this->multiple ? ' multiple' : ''; $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"'; // Initialize JavaScript field attributes. $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); return '<input type="email" name="' . $this->name . '"' . $class . ' id="' . $this->id . '" value="' . htmlspecialchars(JStringPunycode::emailToUTF8($this->value), ENT_COMPAT, 'UTF-8') . '"' . $spellcheck . $size . $disabled . $readonly . $onchange . $autocomplete . $multiple . $maxLength . $hint . $required . $autofocus . ' />'; } } PK���\Ⓐ�3�3�libraries/joomla/form/form.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; jimport('joomla.filesystem.path'); jimport('joomla.utilities.arrayhelper'); /** * Form Class for the Joomla Platform. * * This class implements a robust API for constructing, populating, filtering, and validating forms. * It uses XML definitions to construct form fields and a variety of field and rule classes to * render and validate the form. * * @link http://www.w3.org/TR/html4/interact/forms.html * @link http://www.w3.org/TR/html5/forms.html * @since 11.1 */ class JForm { /** * The Registry data store for form fields during display. * * @var Registry * @since 11.1 */ protected $data; /** * The form object errors array. * * @var array * @since 11.1 */ protected $errors = array(); /** * The name of the form instance. * * @var string * @since 11.1 */ protected $name; /** * The form object options for use in rendering and validation. * * @var array * @since 11.1 */ protected $options = array(); /** * The form XML definition. * * @var SimpleXMLElement * @since 11.1 */ protected $xml; /** * Form instances. * * @var array * @since 11.1 */ protected static $forms = array(); /** * Alows extensions to implement repeating elements * * @var mixed * @since 3.2 */ public $repeat = false; /** * Method to instantiate the form object. * * @param string $name The name of the form. * @param array $options An array of form options. * * @since 11.1 */ public function __construct($name, array $options = array()) { // Set the name for the form. $this->name = $name; // Initialise the Registry data. $this->data = new Registry; // Set the options if specified. $this->options['control'] = isset($options['control']) ? $options['control'] : false; } /** * Method to bind data to the form. * * @param mixed $data An array or object of data to bind to the form. * * @return boolean True on success. * * @since 11.1 */ public function bind($data) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return false; } // The data must be an object or array. if (!is_object($data) && !is_array($data)) { return false; } // Convert the input to an array. if (is_object($data)) { if ($data instanceof Registry) { // Handle a Registry. $data = $data->toArray(); } elseif ($data instanceof JObject) { // Handle a JObject. $data = $data->getProperties(); } else { // Handle other types of objects. $data = (array) $data; } } // Process the input data. foreach ($data as $k => $v) { if ($this->findField($k)) { // If the field exists set the value. $this->data->set($k, $v); } elseif (is_object($v) || JArrayHelper::isAssociative($v)) { // If the value is an object or an associative array hand it off to the recursive bind level method. $this->bindLevel($k, $v); } } return true; } /** * Method to bind data to the form for the group level. * * @param string $group The dot-separated form group path on which to bind the data. * @param mixed $data An array or object of data to bind to the form for the group level. * * @return void * * @since 11.1 */ protected function bindLevel($group, $data) { // Ensure the input data is an array. settype($data, 'array'); // Process the input data. foreach ($data as $k => $v) { if ($this->findField($k, $group)) { // If the field exists set the value. $this->data->set($group . '.' . $k, $v); } elseif (is_object($v) || JArrayHelper::isAssociative($v)) { // If the value is an object or an associative array, hand it off to the recursive bind level method $this->bindLevel($group . '.' . $k, $v); } } } /** * Method to filter the form data. * * @param array $data An array of field values to filter. * @param string $group The dot-separated form group path on which to filter the fields. * * @return mixed Array or false. * * @since 11.1 */ public function filter($data, $group = null) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return false; } $input = new Registry($data); $output = new Registry; // Get the fields for which to filter the data. $fields = $this->findFieldsByGroup($group); if (!$fields) { // PANIC! return false; } // Filter the fields. foreach ($fields as $field) { $name = (string) $field['name']; // Get the field groups for the element. $attrs = $field->xpath('ancestor::fields[@name]/@name'); $groups = array_map('strval', $attrs ? $attrs : array()); $group = implode('.', $groups); $key = $group ? $group . '.' . $name : $name; // Filter the value if it exists. if ($input->exists($key)) { $output->set($key, $this->filterField($field, $input->get($key, (string) $field['default']))); } } return $output->toArray(); } /** * Return all errors, if any. * * @return array Array of error messages or RuntimeException objects. * * @since 11.1 */ public function getErrors() { return $this->errors; } /** * Method to get a form field represented as a JFormField object. * * @param string $name The name of the form field. * @param string $group The optional dot-separated form group path on which to find the field. * @param mixed $value The optional value to use as the default for the field. * * @return mixed The JFormField object for the field or boolean false on error. * * @since 11.1 */ public function getField($name, $group = null, $value = null) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return false; } // Attempt to find the field by name and group. $element = $this->findField($name, $group); // If the field element was not found return false. if (!$element) { return false; } return $this->loadField($element, $group, $value); } /** * Method to get an attribute value from a field XML element. If the attribute doesn't exist or * is null then the optional default value will be used. * * @param string $name The name of the form field for which to get the attribute value. * @param string $attribute The name of the attribute for which to get a value. * @param mixed $default The optional default value to use if no attribute value exists. * @param string $group The optional dot-separated form group path on which to find the field. * * @return mixed The attribute value for the field. * * @since 11.1 * @throws UnexpectedValueException */ public function getFieldAttribute($name, $attribute, $default = null, $group = null) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this))); } // Find the form field element from the definition. $element = $this->findField($name, $group); // If the element exists and the attribute exists for the field return the attribute value. if (($element instanceof SimpleXMLElement) && ((string) $element[$attribute])) { return (string) $element[$attribute]; } // Otherwise return the given default value. else { return $default; } } /** * Method to get an array of JFormField objects in a given fieldset by name. If no name is * given then all fields are returned. * * @param string $set The optional name of the fieldset. * * @return array The array of JFormField objects in the fieldset. * * @since 11.1 */ public function getFieldset($set = null) { $fields = array(); // Get all of the field elements in the fieldset. if ($set) { $elements = $this->findFieldsByFieldset($set); } // Get all fields. else { $elements = $this->findFieldsByGroup(); } // If no field elements were found return empty. if (empty($elements)) { return $fields; } // Build the result array from the found field elements. foreach ($elements as $element) { // Get the field groups for the element. $attrs = $element->xpath('ancestor::fields[@name]/@name'); $groups = array_map('strval', $attrs ? $attrs : array()); $group = implode('.', $groups); // If the field is successfully loaded add it to the result array. if ($field = $this->loadField($element, $group)) { $fields[$field->id] = $field; } } return $fields; } /** * Method to get an array of fieldset objects optionally filtered over a given field group. * * @param string $group The dot-separated form group path on which to filter the fieldsets. * * @return array The array of fieldset objects. * * @since 11.1 */ public function getFieldsets($group = null) { $fieldsets = array(); $sets = array(); // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return $fieldsets; } if ($group) { // Get the fields elements for a given group. $elements = &$this->findGroup($group); foreach ($elements as &$element) { // Get an array of <fieldset /> elements and fieldset attributes within the fields element. if ($tmp = $element->xpath('descendant::fieldset[@name] | descendant::field[@fieldset]/@fieldset')) { $sets = array_merge($sets, (array) $tmp); } } } else { // Get an array of <fieldset /> elements and fieldset attributes. $sets = $this->xml->xpath('//fieldset[@name] | //field[@fieldset]/@fieldset'); } // If no fieldsets are found return empty. if (empty($sets)) { return $fieldsets; } // Process each found fieldset. foreach ($sets as $set) { // Are we dealing with a fieldset element? if ((string) $set['name']) { // Only create it if it doesn't already exist. if (empty($fieldsets[(string) $set['name']])) { // Build the fieldset object. $fieldset = (object) array('name' => '', 'label' => '', 'description' => ''); foreach ($set->attributes() as $name => $value) { $fieldset->$name = (string) $value; } // Add the fieldset object to the list. $fieldsets[$fieldset->name] = $fieldset; } } // Must be dealing with a fieldset attribute. else { // Only create it if it doesn't already exist. if (empty($fieldsets[(string) $set])) { // Attempt to get the fieldset element for data (throughout the entire form document). $tmp = $this->xml->xpath('//fieldset[@name="' . (string) $set . '"]'); // If no element was found, build a very simple fieldset object. if (empty($tmp)) { $fieldset = (object) array('name' => (string) $set, 'label' => '', 'description' => ''); } // Build the fieldset object from the element. else { $fieldset = (object) array('name' => '', 'label' => '', 'description' => ''); foreach ($tmp[0]->attributes() as $name => $value) { $fieldset->$name = (string) $value; } } // Add the fieldset object to the list. $fieldsets[$fieldset->name] = $fieldset; } } } return $fieldsets; } /** * Method to get the form control. This string serves as a container for all form fields. For * example, if there is a field named 'foo' and a field named 'bar' and the form control is * empty the fields will be rendered like: <input name="foo" /> and <input name="bar" />. If * the form control is set to 'joomla' however, the fields would be rendered like: * <input name="joomla[foo]" /> and <input name="joomla[bar]" />. * * @return string The form control string. * * @since 11.1 */ public function getFormControl() { return (string) $this->options['control']; } /** * Method to get an array of JFormField objects in a given field group by name. * * @param string $group The dot-separated form group path for which to get the form fields. * @param boolean $nested True to also include fields in nested groups that are inside of the * group for which to find fields. * * @return array The array of JFormField objects in the field group. * * @since 11.1 */ public function getGroup($group, $nested = false) { $fields = array(); // Get all of the field elements in the field group. $elements = $this->findFieldsByGroup($group, $nested); // If no field elements were found return empty. if (empty($elements)) { return $fields; } // Build the result array from the found field elements. foreach ($elements as $element) { // Get the field groups for the element. $attrs = $element->xpath('ancestor::fields[@name]/@name'); $groups = array_map('strval', $attrs ? $attrs : array()); $group = implode('.', $groups); // If the field is successfully loaded add it to the result array. if ($field = $this->loadField($element, $group)) { $fields[$field->id] = $field; } } return $fields; } /** * Method to get a form field markup for the field input. * * @param string $name The name of the form field. * @param string $group The optional dot-separated form group path on which to find the field. * @param mixed $value The optional value to use as the default for the field. * * @return string The form field markup. * * @since 11.1 */ public function getInput($name, $group = null, $value = null) { // Attempt to get the form field. if ($field = $this->getField($name, $group, $value)) { return $field->input; } return ''; } /** * Method to get the label for a field input. * * @param string $name The name of the form field. * @param string $group The optional dot-separated form group path on which to find the field. * * @return string The form field label. * * @since 11.1 */ public function getLabel($name, $group = null) { // Attempt to get the form field. if ($field = $this->getField($name, $group)) { return $field->label; } return ''; } /** * Method to get the form name. * * @return string The name of the form. * * @since 11.1 */ public function getName() { return $this->name; } /** * Method to get the value of a field. * * @param string $name The name of the field for which to get the value. * @param string $group The optional dot-separated form group path on which to get the value. * @param mixed $default The optional default value of the field value is empty. * * @return mixed The value of the field or the default value if empty. * * @since 11.1 */ public function getValue($name, $group = null, $default = null) { // If a group is set use it. if ($group) { $return = $this->data->get($group . '.' . $name, $default); } else { $return = $this->data->get($name, $default); } return $return; } /** * Method to get a control group with label and input. * * @param string $name The name of the field for which to get the value. * @param string $group The optional dot-separated form group path on which to get the value. * @param mixed $default The optional default value of the field value is empty. * * @return string A string containing the html for the control goup * * @since 3.2 * @deprecated 3.2.3 Use renderField() instead of getControlGroup */ public function getControlGroup($name, $group = null, $default = null) { JLog::add('JForm->getControlGroup() is deprecated use JForm->renderField().', JLog::WARNING, 'deprecated'); return $this->renderField($name, $group, $default); } /** * Method to get all control groups with label and input of a fieldset. * * @param string $name The name of the fieldset for which to get the values. * * @return string A string containing the html for the control goups * * @since 3.2 * @deprecated 3.2.3 Use renderFieldset() instead of getControlGroups */ public function getControlGroups($name) { JLog::add('JForm->getControlGroups() is deprecated use JForm->renderFieldset().', JLog::WARNING, 'deprecated'); return $this->renderFieldset($name); } /** * Method to get a control group with label and input. * * @param string $name The name of the field for which to get the value. * @param string $group The optional dot-separated form group path on which to get the value. * @param mixed $default The optional default value of the field value is empty. * @param array $options Any options to be passed into the rendering of the field * * @return string A string containing the html for the control goup * * @since 3.2.3 */ public function renderField($name, $group = null, $default = null, $options = array()) { $field = $this->getField($name, $group, $default); if ($field) { return $field->renderField($options); } return ''; } /** * Method to get all control groups with label and input of a fieldset. * * @param string $name The name of the fieldset for which to get the values. * @param array $options Any options to be passed into the rendering of the field * * @return string A string containing the html for the control goups * * @since 3.2.3 */ public function renderFieldset($name, $options = array()) { $fields = $this->getFieldset($name); $html = array(); foreach ($fields as $field) { $html[] = $field->renderField($options); } return implode('', $html); } /** * Method to load the form description from an XML string or object. * * The replace option works per field. If a field being loaded already exists in the current * form definition then the behavior or load will vary depending upon the replace flag. If it * is set to true, then the existing field will be replaced in its exact location by the new * field being loaded. If it is false, then the new field being loaded will be ignored and the * method will move on to the next field to load. * * @param string $data The name of an XML string or object. * @param string $replace Flag to toggle whether form fields should be replaced if a field * already exists with the same group/name. * @param string $xpath An optional xpath to search for the fields. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function load($data, $replace = true, $xpath = false) { // If the data to load isn't already an XML element or string return false. if ((!($data instanceof SimpleXMLElement)) && (!is_string($data))) { return false; } // Attempt to load the XML if a string. if (is_string($data)) { try { $data = new SimpleXMLElement($data); } catch (Exception $e) { return false; } // Make sure the XML loaded correctly. if (!$data) { return false; } } // If we have no XML definition at this point let's make sure we get one. if (empty($this->xml)) { // If no XPath query is set to search for fields, and we have a <form />, set it and return. if (!$xpath && ($data->getName() == 'form')) { $this->xml = $data; // Synchronize any paths found in the load. $this->syncPaths(); return true; } // Create a root element for the form. else { $this->xml = new SimpleXMLElement('<form></form>'); } } // Get the XML elements to load. $elements = array(); if ($xpath) { $elements = $data->xpath($xpath); } elseif ($data->getName() == 'form') { $elements = $data->children(); } // If there is nothing to load return true. if (empty($elements)) { return true; } // Load the found form elements. foreach ($elements as $element) { // Get an array of fields with the correct name. $fields = $element->xpath('descendant-or-self::field'); foreach ($fields as $field) { // Get the group names as strings for ancestor fields elements. $attrs = $field->xpath('ancestor::fields[@name]/@name'); $groups = array_map('strval', $attrs ? $attrs : array()); // Check to see if the field exists in the current form. if ($current = $this->findField((string) $field['name'], implode('.', $groups))) { // If set to replace found fields, replace the data and remove the field so we don't add it twice. if ($replace) { $olddom = dom_import_simplexml($current); $loadeddom = dom_import_simplexml($field); $addeddom = $olddom->ownerDocument->importNode($loadeddom, true); $olddom->parentNode->replaceChild($addeddom, $olddom); $loadeddom->parentNode->removeChild($loadeddom); } else { unset($field); } } } // Merge the new field data into the existing XML document. self::addNode($this->xml, $element); } // Synchronize any paths found in the load. $this->syncPaths(); return true; } /** * Method to load the form description from an XML file. * * The reset option works on a group basis. If the XML file references * groups that have already been created they will be replaced with the * fields in the new XML file unless the $reset parameter has been set * to false. * * @param string $file The filesystem path of an XML file. * @param string $reset Flag to toggle whether form fields should be replaced if a field * already exists with the same group/name. * @param string $xpath An optional xpath to search for the fields. * * @return boolean True on success, false otherwise. * * @since 11.1 */ public function loadFile($file, $reset = true, $xpath = false) { // Check to see if the path is an absolute path. if (!is_file($file)) { // Not an absolute path so let's attempt to find one using JPath. $file = JPath::find(self::addFormPath(), strtolower($file) . '.xml'); // If unable to find the file return false. if (!$file) { return false; } } // Attempt to load the XML file. $xml = simplexml_load_file($file); return $this->load($xml, $reset, $xpath); } /** * Method to remove a field from the form definition. * * @param string $name The name of the form field for which remove. * @param string $group The optional dot-separated form group path on which to find the field. * * @return boolean True on success, false otherwise. * * @since 11.1 * @throws UnexpectedValueException */ public function removeField($name, $group = null) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this))); } // Find the form field element from the definition. $element = $this->findField($name, $group); // If the element exists remove it from the form definition. if ($element instanceof SimpleXMLElement) { $dom = dom_import_simplexml($element); $dom->parentNode->removeChild($dom); return true; } return false; } /** * Method to remove a group from the form definition. * * @param string $group The dot-separated form group path for the group to remove. * * @return boolean True on success, false otherwise. * * @since 11.1 * @throws UnexpectedValueException */ public function removeGroup($group) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this))); } // Get the fields elements for a given group. $elements = &$this->findGroup($group); foreach ($elements as &$element) { $dom = dom_import_simplexml($element); $dom->parentNode->removeChild($dom); return true; } return false; } /** * Method to reset the form data store and optionally the form XML definition. * * @param boolean $xml True to also reset the XML form definition. * * @return boolean True on success. * * @since 11.1 */ public function reset($xml = false) { unset($this->data); $this->data = new Registry; if ($xml) { unset($this->xml); $this->xml = new SimpleXMLElement('<form></form>'); } return true; } /** * Method to set a field XML element to the form definition. If the replace flag is set then * the field will be set whether it already exists or not. If it isn't set, then the field * will not be replaced if it already exists. * * @param SimpleXMLElement $element The XML element object representation of the form field. * @param string $group The optional dot-separated form group path on which to set the field. * @param boolean $replace True to replace an existing field if one already exists. * * @return boolean True on success. * * @since 11.1 * @throws UnexpectedValueException */ public function setField(SimpleXMLElement $element, $group = null, $replace = true) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this))); } // Find the form field element from the definition. $old = $this->findField((string) $element['name'], $group); // If an existing field is found and replace flag is false do nothing and return true. if (!$replace && !empty($old)) { return true; } // If an existing field is found and replace flag is true remove the old field. if ($replace && !empty($old) && ($old instanceof SimpleXMLElement)) { $dom = dom_import_simplexml($old); $dom->parentNode->removeChild($dom); } // If no existing field is found find a group element and add the field as a child of it. if ($group) { // Get the fields elements for a given group. $fields = &$this->findGroup($group); // If an appropriate fields element was found for the group, add the element. if (isset($fields[0]) && ($fields[0] instanceof SimpleXMLElement)) { self::addNode($fields[0], $element); } } else { // Set the new field to the form. self::addNode($this->xml, $element); } // Synchronize any paths found in the load. $this->syncPaths(); return true; } /** * Method to set an attribute value for a field XML element. * * @param string $name The name of the form field for which to set the attribute value. * @param string $attribute The name of the attribute for which to set a value. * @param mixed $value The value to set for the attribute. * @param string $group The optional dot-separated form group path on which to find the field. * * @return boolean True on success. * * @since 11.1 * @throws UnexpectedValueException */ public function setFieldAttribute($name, $attribute, $value, $group = null) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this))); } // Find the form field element from the definition. $element = $this->findField($name, $group); // If the element doesn't exist return false. if (!($element instanceof SimpleXMLElement)) { return false; } // Otherwise set the attribute and return true. else { $element[$attribute] = $value; // Synchronize any paths found in the load. $this->syncPaths(); return true; } } /** * Method to set some field XML elements to the form definition. If the replace flag is set then * the fields will be set whether they already exists or not. If it isn't set, then the fields * will not be replaced if they already exist. * * @param array &$elements The array of XML element object representations of the form fields. * @param string $group The optional dot-separated form group path on which to set the fields. * @param boolean $replace True to replace existing fields if they already exist. * * @return boolean True on success. * * @since 11.1 * @throws UnexpectedValueException */ public function setFields(&$elements, $group = null, $replace = true) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { throw new UnexpectedValueException(sprintf('%s::getFieldAttribute `xml` is not an instance of SimpleXMLElement', get_class($this))); } // Make sure the elements to set are valid. foreach ($elements as $element) { if (!($element instanceof SimpleXMLElement)) { throw new UnexpectedValueException(sprintf('$element not SimpleXMLElement in %s::setFields', get_class($this))); } } // Set the fields. $return = true; foreach ($elements as $element) { if (!$this->setField($element, $group, $replace)) { $return = false; } } // Synchronize any paths found in the load. $this->syncPaths(); return $return; } /** * Method to set the value of a field. If the field does not exist in the form then the method * will return false. * * @param string $name The name of the field for which to set the value. * @param string $group The optional dot-separated form group path on which to find the field. * @param mixed $value The value to set for the field. * * @return boolean True on success. * * @since 11.1 */ public function setValue($name, $group = null, $value = null) { // If the field does not exist return false. if (!$this->findField($name, $group)) { return false; } // If a group is set use it. if ($group) { $this->data->set($group . '.' . $name, $value); } else { $this->data->set($name, $value); } return true; } /** * Method to validate form data. * * Validation warnings will be pushed into JForm::errors and should be * retrieved with JForm::getErrors() when validate returns boolean false. * * @param array $data An array of field values to validate. * @param string $group The optional dot-separated form group path on which to filter the * fields to be validated. * * @return mixed True on sucess. * * @since 11.1 */ public function validate($data, $group = null) { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return false; } $return = true; // Create an input registry object from the data to validate. $input = new Registry($data); // Get the fields for which to validate the data. $fields = $this->findFieldsByGroup($group); if (!$fields) { // PANIC! return false; } // Validate the fields. foreach ($fields as $field) { $value = null; $name = (string) $field['name']; // Get the group names as strings for ancestor fields elements. $attrs = $field->xpath('ancestor::fields[@name]/@name'); $groups = array_map('strval', $attrs ? $attrs : array()); $group = implode('.', $groups); // Get the value from the input data. if ($group) { $value = $input->get($group . '.' . $name); } else { $value = $input->get($name); } // Validate the field. $valid = $this->validateField($field, $group, $value, $input); // Check for an error. if ($valid instanceof Exception) { array_push($this->errors, $valid); $return = false; } } return $return; } /** * Method to apply an input filter to a value based on field data. * * @param string $element The XML element object representation of the form field. * @param mixed $value The value to filter for the field. * * @return mixed The filtered value. * * @since 11.1 */ protected function filterField($element, $value) { // Make sure there is a valid SimpleXMLElement. if (!($element instanceof SimpleXMLElement)) { return false; } // Get the field filter type. $filter = (string) $element['filter']; // Process the input value based on the filter. $return = null; switch (strtoupper($filter)) { // Access Control Rules. case 'RULES': $return = array(); foreach ((array) $value as $action => $ids) { // Build the rules array. $return[$action] = array(); foreach ($ids as $id => $p) { if ($p !== '') { $return[$action][$id] = ($p == '1' || $p == 'true') ? true : false; } } } break; // Do nothing, thus leaving the return value as null. case 'UNSET': break; // No Filter. case 'RAW': $return = $value; break; // Filter the input as an array of integers. case 'INT_ARRAY': // Make sure the input is an array. if (is_object($value)) { $value = get_object_vars($value); } $value = is_array($value) ? $value : array($value); JArrayHelper::toInteger($value); $return = $value; break; // Filter safe HTML. case 'SAFEHTML': $return = JFilterInput::getInstance(null, null, 1, 1)->clean($value, 'html'); break; // Convert a date to UTC based on the server timezone offset. case 'SERVER_UTC': if ((int) $value > 0) { // Get the server timezone setting. $offset = JFactory::getConfig()->get('offset'); // Return an SQL formatted datetime string in UTC. $return = JFactory::getDate($value, $offset)->toSql(); } else { $return = ''; } break; // Convert a date to UTC based on the user timezone offset. case 'USER_UTC': if ((int) $value > 0) { // Get the user timezone setting defaulting to the server timezone setting. $offset = JFactory::getUser()->getParam('timezone', JFactory::getConfig()->get('offset')); // Return a MySQL formatted datetime string in UTC. $return = JFactory::getDate($value, $offset)->toSql(); } else { $return = ''; } break; /* * Ensures a protocol is present in the saved field unless the relative flag is set. * Only use when the only permitted protocols require '://'. * See JFormRuleUrl for list of these. */ case 'URL': if (empty($value)) { return false; } // This cleans some of the more dangerous characters but leaves special characters that are valid. $value = JFilterInput::getInstance()->clean($value, 'html'); $value = trim($value); // <>" are never valid in a uri see http://www.ietf.org/rfc/rfc1738.txt. $value = str_replace(array('<', '>', '"'), '', $value); // Check for a protocol $protocol = parse_url($value, PHP_URL_SCHEME); // If there is no protocol and the relative option is not specified, // we assume that it is an external URL and prepend http://. if (($element['type'] == 'url' && !$protocol && !$element['relative']) || (!$element['type'] == 'url' && !$protocol)) { $protocol = 'http'; // If it looks like an internal link, then add the root. if (substr($value, 0, 9) == 'index.php') { $value = JUri::root() . $value; } // Otherwise we treat it as an external link. else { // Put the url back together. $value = $protocol . '://' . $value; } } // If relative URLS are allowed we assume that URLs without protocols are internal. elseif (!$protocol && $element['relative']) { $host = JUri::getInstance('SERVER')->gethost(); // If it starts with the host string, just prepend the protocol. if (substr($value, 0) == $host) { $value = 'http://' . $value; } // Otherwise if it doesn't start with "/" prepend the prefix of the current site. elseif (substr($value, 0, 1) != '/') { $value = JUri::root(true) . '/' . $value; } } $value = JStringPunycode::urlToPunycode($value); $return = $value; break; case 'TEL': $value = trim($value); // Does it match the NANP pattern? if (preg_match('/^(?:\+?1[-. ]?)?\(?([2-9][0-8][0-9])\)?[-. ]?([2-9][0-9]{2})[-. ]?([0-9]{4})$/', $value) == 1) { $number = (string) preg_replace('/[^\d]/', '', $value); if (substr($number, 0, 1) == 1) { $number = substr($number, 1); } if (substr($number, 0, 2) == '+1') { $number = substr($number, 2); } $result = '1.' . $number; } // If not, does it match ITU-T? elseif (preg_match('/^\+(?:[0-9] ?){6,14}[0-9]$/', $value) == 1) { $countrycode = substr($value, 0, strpos($value, ' ')); $countrycode = (string) preg_replace('/[^\d]/', '', $countrycode); $number = strstr($value, ' '); $number = (string) preg_replace('/[^\d]/', '', $number); $result = $countrycode . '.' . $number; } // If not, does it match EPP? elseif (preg_match('/^\+[0-9]{1,3}\.[0-9]{4,14}(?:x.+)?$/', $value) == 1) { if (strstr($value, 'x')) { $xpos = strpos($value, 'x'); $value = substr($value, 0, $xpos); } $result = str_replace('+', '', $value); } // Maybe it is already ccc.nnnnnnn? elseif (preg_match('/[0-9]{1,3}\.[0-9]{4,14}$/', $value) == 1) { $result = $value; } // If not, can we make it a string of digits? else { $value = (string) preg_replace('/[^\d]/', '', $value); if ($value != null && strlen($value) <= 15) { $length = strlen($value); // If it is fewer than 13 digits assume it is a local number if ($length <= 12) { $result = '.' . $value; } else { // If it has 13 or more digits let's make a country code. $cclen = $length - 12; $result = substr($value, 0, $cclen) . '.' . substr($value, $cclen); } } // If not let's not save anything. else { $result = ''; } } $return = $result; break; default: // Check for a callback filter. if (strpos($filter, '::') !== false && is_callable(explode('::', $filter))) { $return = call_user_func(explode('::', $filter), $value); } // Filter using a callback function if specified. elseif (function_exists($filter)) { $return = call_user_func($filter, $value); } // Filter using JFilterInput. All HTML code is filtered by default. else { $return = JFilterInput::getInstance()->clean($value, $filter); } break; } return $return; } /** * Method to get a form field represented as an XML element object. * * @param string $name The name of the form field. * @param string $group The optional dot-separated form group path on which to find the field. * * @return mixed The XML element object for the field or boolean false on error. * * @since 11.1 */ protected function findField($name, $group = null) { $element = false; $fields = array(); // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return false; } // Let's get the appropriate field element based on the method arguments. if ($group) { // Get the fields elements for a given group. $elements = &$this->findGroup($group); // Get all of the field elements with the correct name for the fields elements. foreach ($elements as $element) { // If there are matching field elements add them to the fields array. if ($tmp = $element->xpath('descendant::field[@name="' . $name . '"]')) { $fields = array_merge($fields, $tmp); } } // Make sure something was found. if (!$fields) { return false; } // Use the first correct match in the given group. $groupNames = explode('.', $group); foreach ($fields as &$field) { // Get the group names as strings for ancestor fields elements. $attrs = $field->xpath('ancestor::fields[@name]/@name'); $names = array_map('strval', $attrs ? $attrs : array()); // If the field is in the exact group use it and break out of the loop. if ($names == (array) $groupNames) { $element = &$field; break; } } } else { // Get an array of fields with the correct name. $fields = $this->xml->xpath('//field[@name="' . $name . '"]'); // Make sure something was found. if (!$fields) { return false; } // Search through the fields for the right one. foreach ($fields as &$field) { // If we find an ancestor fields element with a group name then it isn't what we want. if ($field->xpath('ancestor::fields[@name]')) { continue; } // Found it! else { $element = &$field; break; } } } return $element; } /** * Method to get an array of <field /> elements from the form XML document which are * in a specified fieldset by name. * * @param string $name The name of the fieldset. * * @return mixed Boolean false on error or array of SimpleXMLElement objects. * * @since 11.1 */ protected function &findFieldsByFieldset($name) { $false = false; // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return $false; } /* * Get an array of <field /> elements that are underneath a <fieldset /> element * with the appropriate name attribute, and also any <field /> elements with * the appropriate fieldset attribute. To allow repeatable elements only fields * which are not descendants of other fields are selected. */ $fields = $this->xml->xpath('(//fieldset[@name="' . $name . '"]//field | //field[@fieldset="' . $name . '"])[not(ancestor::field)]'); return $fields; } /** * Method to get an array of <field /> elements from the form XML document which are * in a control group by name. * * @param mixed $group The optional dot-separated form group path on which to find the fields. * Null will return all fields. False will return fields not in a group. * @param boolean $nested True to also include fields in nested groups that are inside of the * group for which to find fields. * * @return mixed Boolean false on error or array of SimpleXMLElement objects. * * @since 11.1 */ protected function &findFieldsByGroup($group = null, $nested = false) { $false = false; $fields = array(); // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return $false; } // Get only fields in a specific group? if ($group) { // Get the fields elements for a given group. $elements = &$this->findGroup($group); // Get all of the field elements for the fields elements. foreach ($elements as $element) { // If there are field elements add them to the return result. if ($tmp = $element->xpath('descendant::field')) { // If we also want fields in nested groups then just merge the arrays. if ($nested) { $fields = array_merge($fields, $tmp); } // If we want to exclude nested groups then we need to check each field. else { $groupNames = explode('.', $group); foreach ($tmp as $field) { // Get the names of the groups that the field is in. $attrs = $field->xpath('ancestor::fields[@name]/@name'); $names = array_map('strval', $attrs ? $attrs : array()); // If the field is in the specific group then add it to the return list. if ($names == (array) $groupNames) { $fields = array_merge($fields, array($field)); } } } } } } elseif ($group === false) { // Get only field elements not in a group. $fields = $this->xml->xpath('descendant::fields[not(@name)]/field | descendant::fields[not(@name)]/fieldset/field '); } else { // Get an array of all the <field /> elements. $fields = $this->xml->xpath('//field'); } return $fields; } /** * Method to get a form field group represented as an XML element object. * * @param string $group The dot-separated form group path on which to find the group. * * @return mixed An array of XML element objects for the group or boolean false on error. * * @since 11.1 */ protected function &findGroup($group) { $false = false; $groups = array(); $tmp = array(); // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return $false; } // Make sure there is actually a group to find. $group = explode('.', $group); if (!empty($group)) { // Get any fields elements with the correct group name. $elements = $this->xml->xpath('//fields[@name="' . (string) $group[0] . '"]'); // Check to make sure that there are no parent groups for each element. foreach ($elements as $element) { if (!$element->xpath('ancestor::fields[@name]')) { $tmp[] = $element; } } // Iterate through the nested groups to find any matching form field groups. for ($i = 1, $n = count($group); $i < $n; $i++) { // Initialise some loop variables. $validNames = array_slice($group, 0, $i + 1); $current = $tmp; $tmp = array(); // Check to make sure that there are no parent groups for each element. foreach ($current as $element) { // Get any fields elements with the correct group name. $children = $element->xpath('descendant::fields[@name="' . (string) $group[$i] . '"]'); // For the found fields elements validate that they are in the correct groups. foreach ($children as $fields) { // Get the group names as strings for ancestor fields elements. $attrs = $fields->xpath('ancestor-or-self::fields[@name]/@name'); $names = array_map('strval', $attrs ? $attrs : array()); // If the group names for the fields element match the valid names at this // level add the fields element. if ($validNames == $names) { $tmp[] = $fields; } } } } // Only include valid XML objects. foreach ($tmp as $element) { if ($element instanceof SimpleXMLElement) { $groups[] = $element; } } } return $groups; } /** * Method to load, setup and return a JFormField object based on field data. * * @param string $element The XML element object representation of the form field. * @param string $group The optional dot-separated form group path on which to find the field. * @param mixed $value The optional value to use as the default for the field. * * @return mixed The JFormField object for the field or boolean false on error. * * @since 11.1 */ protected function loadField($element, $group = null, $value = null) { // Make sure there is a valid SimpleXMLElement. if (!($element instanceof SimpleXMLElement)) { return false; } // Get the field type. $type = $element['type'] ? (string) $element['type'] : 'text'; // Load the JFormField object for the field. $field = $this->loadFieldType($type); // If the object could not be loaded, get a text field object. if ($field === false) { $field = $this->loadFieldType('text'); } /* * Get the value for the form field if not set. * Default to the translated version of the 'default' attribute * if 'translate_default' attribute if set to 'true' or '1' * else the value of the 'default' attribute for the field. */ if ($value === null) { $default = (string) $element['default']; if (($translate = $element['translate_default']) && ((string) $translate == 'true' || (string) $translate == '1')) { $lang = JFactory::getLanguage(); if ($lang->hasKey($default)) { $debug = $lang->setDebug(false); $default = JText::_($default); $lang->setDebug($debug); } else { $default = JText::_($default); } } $value = $this->getValue((string) $element['name'], $group, $default); } // Setup the JFormField object. $field->setForm($this); if ($field->setup($element, $value, $group)) { return $field; } else { return false; } } /** * Proxy for {@link JFormHelper::loadFieldType()}. * * @param string $type The field type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed JFormField object on success, false otherwise. * * @since 11.1 */ protected function loadFieldType($type, $new = true) { return JFormHelper::loadFieldType($type, $new); } /** * Proxy for JFormHelper::loadRuleType(). * * @param string $type The rule type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed JFormRule object on success, false otherwise. * * @see JFormHelper::loadRuleType() * @since 11.1 */ protected function loadRuleType($type, $new = true) { return JFormHelper::loadRuleType($type, $new); } /** * Method to synchronize any field, form or rule paths contained in the XML document. * * @return boolean True on success. * * @since 11.1 * @todo Maybe we should receive all addXXXpaths attributes at once? */ protected function syncPaths() { // Make sure there is a valid JForm XML document. if (!($this->xml instanceof SimpleXMLElement)) { return false; } // Get any addfieldpath attributes from the form definition. $paths = $this->xml->xpath('//*[@addfieldpath]/@addfieldpath'); $paths = array_map('strval', $paths ? $paths : array()); // Add the field paths. foreach ($paths as $path) { $path = JPATH_ROOT . '/' . ltrim($path, '/\\'); self::addFieldPath($path); } // Get any addformpath attributes from the form definition. $paths = $this->xml->xpath('//*[@addformpath]/@addformpath'); $paths = array_map('strval', $paths ? $paths : array()); // Add the form paths. foreach ($paths as $path) { $path = JPATH_ROOT . '/' . ltrim($path, '/\\'); self::addFormPath($path); } // Get any addrulepath attributes from the form definition. $paths = $this->xml->xpath('//*[@addrulepath]/@addrulepath'); $paths = array_map('strval', $paths ? $paths : array()); // Add the rule paths. foreach ($paths as $path) { $path = JPATH_ROOT . '/' . ltrim($path, '/\\'); self::addRulePath($path); } return true; } /** * Method to validate a JFormField object based on field data. * * @param SimpleXMLElement $element The XML element object representation of the form field. * @param string $group The optional dot-separated form group path on which to find the field. * @param mixed $value The optional value to use as the default for the field. * @param Registry $input An optional Registry object with the entire data set to validate * against the entire form. * * @return mixed Boolean true if field value is valid, Exception on failure. * * @since 11.1 * @throws InvalidArgumentException * @throws UnexpectedValueException */ protected function validateField(SimpleXMLElement $element, $group = null, $value = null, Registry $input = null) { $valid = true; // Check if the field is required. $required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required'); if ($required) { // If the field is required and the value is empty return an error message. if (($value === '') || ($value === null)) { if ($element['label']) { $message = JText::_($element['label']); } else { $message = JText::_($element['name']); } $message = JText::sprintf('JLIB_FORM_VALIDATE_FIELD_REQUIRED', $message); return new RuntimeException($message); } } // Get the field validation rule. if ($type = (string) $element['validate']) { // Load the JFormRule object for the field. $rule = $this->loadRuleType($type); // If the object could not be loaded return an error message. if ($rule === false) { throw new UnexpectedValueException(sprintf('%s::validateField() rule `%s` missing.', get_class($this), $type)); } // Run the field validation rule test. $valid = $rule->test($element, $value, $group, $input, $this); // Check for an error in the validation test. if ($valid instanceof Exception) { return $valid; } } // Check if the field is valid. if ($valid === false) { // Does the field have a defined error message? $message = (string) $element['message']; if ($message) { $message = JText::_($element['message']); return new UnexpectedValueException($message); } else { $message = JText::_($element['label']); $message = JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', $message); return new UnexpectedValueException($message); } } return true; } /** * Proxy for {@link JFormHelper::addFieldPath()}. * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @since 11.1 */ public static function addFieldPath($new = null) { return JFormHelper::addFieldPath($new); } /** * Proxy for JFormHelper::addFormPath(). * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @see JFormHelper::addFormPath() * @since 11.1 */ public static function addFormPath($new = null) { return JFormHelper::addFormPath($new); } /** * Proxy for JFormHelper::addRulePath(). * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @see JFormHelper::addRulePath() * @since 11.1 */ public static function addRulePath($new = null) { return JFormHelper::addRulePath($new); } /** * Method to get an instance of a form. * * @param string $name The name of the form. * @param string $data The name of an XML file or string to load as the form definition. * @param array $options An array of form options. * @param boolean $replace Flag to toggle whether form fields should be replaced if a field * already exists with the same group/name. * @param string|boolean $xpath An optional xpath to search for the fields. * * @return object JForm instance. * * @since 11.1 * @throws InvalidArgumentException if no data provided. * @throws RuntimeException if the form could not be loaded. */ public static function getInstance($name, $data = null, $options = array(), $replace = true, $xpath = false) { // Reference to array with form instances $forms = &self::$forms; // Only instantiate the form if it does not already exist. if (!isset($forms[$name])) { $data = trim($data); if (empty($data)) { throw new InvalidArgumentException(sprintf('JForm::getInstance(name, *%s*)', gettype($data))); } // Instantiate the form. $forms[$name] = new JForm($name, $options); // Load the data. if (substr(trim($data), 0, 1) == '<') { if ($forms[$name]->load($data, $replace, $xpath) == false) { throw new RuntimeException('JForm::getInstance could not load form'); } } else { if ($forms[$name]->loadFile($data, $replace, $xpath) == false) { throw new RuntimeException('JForm::getInstance could not load file'); } } } return $forms[$name]; } /** * Adds a new child SimpleXMLElement node to the source. * * @param SimpleXMLElement $source The source element on which to append. * @param SimpleXMLElement $new The new element to append. * * @return void * * @since 11.1 */ protected static function addNode(SimpleXMLElement $source, SimpleXMLElement $new) { // Add the new child node. $node = $source->addChild($new->getName(), htmlspecialchars(trim($new))); // Add the attributes of the child node. foreach ($new->attributes() as $name => $value) { $node->addAttribute($name, $value); } // Add any children of the new node. foreach ($new->children() as $child) { self::addNode($node, $child); } } /** * Update the attributes of a child node * * @param SimpleXMLElement $source The source element on which to append the attributes * @param SimpleXMLElement $new The new element to append * * @return void * * @since 11.1 */ protected static function mergeNode(SimpleXMLElement $source, SimpleXMLElement $new) { // Update the attributes of the child node. foreach ($new->attributes() as $name => $value) { if (isset($source[$name])) { $source[$name] = (string) $value; } else { $source->addAttribute($name, $value); } } } /** * Merges new elements into a source <fields> element. * * @param SimpleXMLElement $source The source element. * @param SimpleXMLElement $new The new element to merge. * * @return void * * @since 11.1 */ protected static function mergeNodes(SimpleXMLElement $source, SimpleXMLElement $new) { // The assumption is that the inputs are at the same relative level. // So we just have to scan the children and deal with them. // Update the attributes of the child node. foreach ($new->attributes() as $name => $value) { if (isset($source[$name])) { $source[$name] = (string) $value; } else { $source->addAttribute($name, $value); } } foreach ($new->children() as $child) { $type = $child->getName(); $name = $child['name']; // Does this node exist? $fields = $source->xpath($type . '[@name="' . $name . '"]'); if (empty($fields)) { // This node does not exist, so add it. self::addNode($source, $child); } else { // This node does exist. switch ($type) { case 'field': self::mergeNode($fields[0], $child); break; default: self::mergeNodes($fields[0], $child); break; } } } } /** * Returns the value of an attribute of the form itself * * @param string $name Name of the attribute to get * @param mixed $default Optional value to return if attribute not found * * @return mixed Value of the attribute / default * * @since 3.2 */ public function getAttribute($name, $default = null) { if ($this->xml instanceof SimpleXMLElement) { $attributes = $this->xml->attributes(); // Ensure that the attribute exists if (property_exists($attributes, $name)) { $value = $attributes->$name; if ($value !== null) { return (string) $value; } } } return $default; } /** * Getter for the form data * * @return Registry Object with the data * * @since 3.2 */ public function getData() { return $this->data; } /** * Method to get the XML form object * * @return SimpleXMLElement The form XML object * * @since 3.2 */ public function getXml() { return $this->xml; } } PK���\!j�?N?Nlibraries/joomla/form/field.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Abstract Form Field class for the Joomla Platform. * * @since 11.1 */ abstract class JFormField { /** * The description text for the form field. Usually used in tooltips. * * @var string * @since 11.1 */ protected $description; /** * The hint text for the form field used to display hint inside the field. * * @var string * @since 3.2 */ protected $hint; /** * The autocomplete state for the form field. If 'off' element will not be automatically * completed by browser. * * @var mixed * @since 3.2 */ protected $autocomplete = 'on'; /** * The spellcheck state for the form field. * * @var boolean * @since 3.2 */ protected $spellcheck = true; /** * The autofocus request for the form field. If true element will be automatically * focused on document load. * * @var boolean * @since 3.2 */ protected $autofocus = false; /** * The SimpleXMLElement object of the <field /> XML element that describes the form field. * * @var SimpleXMLElement * @since 11.1 */ protected $element; /** * The JForm object of the form attached to the form field. * * @var JForm * @since 11.1 */ protected $form; /** * The form control prefix for field names from the JForm object attached to the form field. * * @var string * @since 11.1 */ protected $formControl; /** * The hidden state for the form field. * * @var boolean * @since 11.1 */ protected $hidden = false; /** * True to translate the field label string. * * @var boolean * @since 11.1 */ protected $translateLabel = true; /** * True to translate the field description string. * * @var boolean * @since 11.1 */ protected $translateDescription = true; /** * True to translate the field hint string. * * @var boolean * @since 3.2 */ protected $translateHint = true; /** * The document id for the form field. * * @var string * @since 11.1 */ protected $id; /** * The input for the form field. * * @var string * @since 11.1 */ protected $input; /** * The label for the form field. * * @var string * @since 11.1 */ protected $label; /** * The multiple state for the form field. If true then multiple values are allowed for the * field. Most often used for list field types. * * @var boolean * @since 11.1 */ protected $multiple = false; /** * Allows extensions to create repeat elements * * @var mixed * @since 3.2 */ public $repeat = false; /** * The pattern (Reg Ex) of value of the form field. * * @var string * @since 11.1 */ protected $pattern; /** * The name of the form field. * * @var string * @since 11.1 */ protected $name; /** * The name of the field. * * @var string * @since 11.1 */ protected $fieldname; /** * The group of the field. * * @var string * @since 11.1 */ protected $group; /** * The required state for the form field. If true then there must be a value for the field to * be considered valid. * * @var boolean * @since 11.1 */ protected $required = false; /** * The disabled state for the form field. If true then the field will be disabled and user can't * interact with the field. * * @var boolean * @since 3.2 */ protected $disabled = false; /** * The readonly state for the form field. If true then the field will be readonly. * * @var boolean * @since 3.2 */ protected $readonly = false; /** * The form field type. * * @var string * @since 11.1 */ protected $type; /** * The validation method for the form field. This value will determine which method is used * to validate the value for a field. * * @var string * @since 11.1 */ protected $validate; /** * The value of the form field. * * @var mixed * @since 11.1 */ protected $value; /** * The default value of the form field. * * @var mixed * @since 11.1 */ protected $default; /** * The size of the form field. * * @var integer * @since 3.2 */ protected $size; /** * The class of the form field * * @var mixed * @since 3.2 */ protected $class; /** * The label's CSS class of the form field * * @var mixed * @since 11.1 */ protected $labelclass; /** * The javascript onchange of the form field. * * @var string * @since 3.2 */ protected $onchange; /** * The javascript onclick of the form field. * * @var string * @since 3.2 */ protected $onclick; /** * The count value for generated name field * * @var integer * @since 11.1 */ protected static $count = 0; /** * The string used for generated fields names * * @var string * @since 11.1 */ protected static $generated_fieldname = '__field'; /** * Layout to render the form field * * @var string */ protected $renderLayout = 'joomla.form.renderfield'; /** * Layout to render the label * * @var string */ protected $renderLabelLayout = 'joomla.form.renderlabel'; /** * Method to instantiate the form field object. * * @param JForm $form The form to attach to the form field object. * * @since 11.1 */ public function __construct($form = null) { // If there is a form passed into the constructor set the form and form control properties. if ($form instanceof JForm) { $this->form = $form; $this->formControl = $form->getFormControl(); } // Detect the field type if not set if (!isset($this->type)) { $parts = JStringNormalise::fromCamelCase(get_called_class(), true); if ($parts[0] == 'J') { $this->type = JString::ucfirst($parts[count($parts) - 1], '_'); } else { $this->type = JString::ucfirst($parts[0], '_') . JString::ucfirst($parts[count($parts) - 1], '_'); } } } /** * 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 11.1 */ public function __get($name) { switch ($name) { case 'description': case 'hint': case 'formControl': case 'hidden': case 'id': case 'multiple': case 'name': case 'required': case 'type': case 'validate': case 'value': case 'class': case 'labelclass': case 'size': case 'onchange': case 'onclick': case 'fieldname': case 'group': case 'disabled': case 'readonly': case 'autofocus': case 'autocomplete': case 'spellcheck': return $this->$name; case 'input': // If the input hasn't yet been generated, generate it. if (empty($this->input)) { $this->input = $this->getInput(); } return $this->input; case 'label': // If the label hasn't yet been generated, generate it. if (empty($this->label)) { $this->label = $this->getLabel(); } return $this->label; case 'title': return $this->getTitle(); } return null; } /** * Method to set certain otherwise inaccessible properties of the form field object. * * @param string $name The property name for which to the the value. * @param mixed $value The value of the property. * * @return void * * @since 3.2 */ public function __set($name, $value) { switch ($name) { case 'class': // Removes spaces from left & right and extra spaces from middle $value = preg_replace('/\s+/', ' ', trim((string) $value)); case 'description': case 'hint': case 'value': case 'labelclass': case 'onchange': case 'onclick': case 'validate': case 'pattern': case 'group': case 'default': $this->$name = (string) $value; break; case 'id': $this->id = $this->getId((string) $value, $this->fieldname); break; case 'fieldname': $this->fieldname = $this->getFieldName((string) $value); break; case 'name': $this->fieldname = $this->getFieldName((string) $value); $this->name = $this->getName($this->fieldname); break; case 'multiple': // Allow for field classes to force the multiple values option. $value = (string) $value; $value = $value === '' && isset($this->forceMultiple) ? (string) $this->forceMultiple : $value; case 'required': case 'disabled': case 'readonly': case 'autofocus': case 'hidden': $value = (string) $value; $this->$name = ($value === 'true' || $value === $name || $value === '1'); break; case 'autocomplete': $value = (string) $value; $value = ($value == 'on' || $value == '') ? 'on' : $value; $this->$name = ($value === 'false' || $value === 'off' || $value === '0') ? false : $value; break; case 'spellcheck': case 'translateLabel': case 'translateDescription': case 'translateHint': $value = (string) $value; $this->$name = !($value === 'false' || $value === 'off' || $value === '0'); break; case 'translate_label': $value = (string) $value; $this->translateLabel = $this->translateLabel && !($value === 'false' || $value === 'off' || $value === '0'); break; case 'translate_description': $value = (string) $value; $this->translateDescription = $this->translateDescription && !($value === 'false' || $value === 'off' || $value === '0'); break; case 'size': $this->$name = (int) $value; break; default: if (property_exists(__CLASS__, $name)) { JLog::add("Cannot access protected / private property $name of " . __CLASS__); } else { $this->$name = $value; } } } /** * Method to attach a JForm object to the field. * * @param JForm $form The JForm object to attach to the form field. * * @return JFormField The form field object so that the method can be used in a chain. * * @since 11.1 */ public function setForm(JForm $form) { $this->form = $form; $this->formControl = $form->getFormControl(); return $this; } /** * 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 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. * * @since 11.1 */ public function setup(SimpleXMLElement $element, $value, $group = null) { // Make sure there is a valid JFormField XML element. if ((string) $element->getName() != 'field') { return false; } // Reset the input and label values. $this->input = null; $this->label = null; // Set the XML element object. $this->element = $element; // Set the group of the field. $this->group = $group; $attributes = array( 'multiple', 'name', 'id', 'hint', 'class', 'description', 'labelclass', 'onchange', 'onclick', 'validate', 'pattern', 'default', 'required', 'disabled', 'readonly', 'autofocus', 'hidden', 'autocomplete', 'spellcheck', 'translateHint', 'translateLabel','translate_label', 'translateDescription', 'translate_description' ,'size'); $this->default = isset($element['value']) ? (string) $element['value'] : $this->default; // Set the field default value. $this->value = $value; foreach ($attributes as $attributeName) { $this->__set($attributeName, $element[$attributeName]); } // Allow for repeatable elements $repeat = (string) $element['repeat']; $this->repeat = ($repeat == 'true' || $repeat == 'multiple' || (!empty($this->form->repeat) && $this->form->repeat == 1)); // Set the visibility. $this->hidden = ($this->hidden || (string) $element['type'] == 'hidden'); // Add required to class list if field is required. if ($this->required) { $this->class = trim($this->class . ' required'); } return true; } /** * Simple method to set the value * * @param mixed $value Value to set * * @return void * * @since 3.2 */ public function setValue($value) { $this->value = $value; } /** * Method to get the id used for the field input tag. * * @param string $fieldId The field element id. * @param string $fieldName The field element name. * * @return string The id to be used for the field input tag. * * @since 11.1 */ protected function getId($fieldId, $fieldName) { $id = ''; // If there is a form control set for the attached form add it first. if ($this->formControl) { $id .= $this->formControl; } // If the field is in a group add the group control to the field id. if ($this->group) { // If we already have an id segment add the group control as another level. if ($id) { $id .= '_' . str_replace('.', '_', $this->group); } else { $id .= str_replace('.', '_', $this->group); } } // If we already have an id segment add the field id/name as another level. if ($id) { $id .= '_' . ($fieldId ? $fieldId : $fieldName); } else { $id .= ($fieldId ? $fieldId : $fieldName); } // Clean up any invalid characters. $id = preg_replace('#\W#', '_', $id); // If this is a repeatable element, add the repeat count to the ID if ($this->repeat) { $repeatCounter = empty($this->form->repeatCounter) ? 0 : $this->form->repeatCounter; $id .= '-' . $repeatCounter; if (strtolower($this->type) == 'radio') { $id .= '-'; } } return $id; } /** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ abstract protected function getInput(); /** * Method to get the field title. * * @return string The field title. * * @since 11.1 */ protected function getTitle() { $title = ''; if ($this->hidden) { return $title; } // Get the label text from the XML element, defaulting to the element name. $title = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name']; $title = $this->translateLabel ? JText::_($title) : $title; return $title; } /** * Method to get the field label markup. * * @return string The field label markup. * * @since 11.1 */ protected function getLabel() { if ($this->hidden) { return ''; } // 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; // Forcing the Alias field to display the tip below $position = $this->element['name'] == 'alias' ? ' data-placement="bottom" ' : ''; $description = ($this->translateDescription && !empty($this->description)) ? JText::_($this->description) : $this->description; $displayData = array( 'text' => $text, 'description' => $description, 'for' => $this->id, 'required' => (bool) $this->required, 'classes' => explode(' ', $this->labelclass), 'position' => $position ); return JLayoutHelper::render($this->renderLabelLayout, $displayData); } /** * Method to get the name used for the field input tag. * * @param string $fieldName The field element name. * * @return string The name to be used for the field input tag. * * @since 11.1 */ protected function getName($fieldName) { // To support repeated element, extensions can set this in plugin->onRenderSettings $repeatCounter = empty($this->form->repeatCounter) ? 0 : $this->form->repeatCounter; $name = ''; // If there is a form control set for the attached form add it first. if ($this->formControl) { $name .= $this->formControl; } // If the field is in a group add the group control to the field name. if ($this->group) { // If we already have a name segment add the group control as another level. $groups = explode('.', $this->group); if ($name) { foreach ($groups as $group) { $name .= '[' . $group . ']'; } } else { $name .= array_shift($groups); foreach ($groups as $group) { $name .= '[' . $group . ']'; } } } // If we already have a name segment add the field name as another level. if ($name) { $name .= '[' . $fieldName . ']'; } else { $name .= $fieldName; } // If the field should support multiple values add the final array segment. if ($this->multiple) { switch (strtolower((string) $this->element['type'])) { case 'text': case 'textarea': case 'email': case 'password': case 'radio': case 'calendar': case 'editor': case 'hidden': break; default: $name .= '[]'; } } return $name; } /** * Method to get the field name used. * * @param string $fieldName The field element name. * * @return string The field name * * @since 11.1 */ protected function getFieldName($fieldName) { if ($fieldName) { return $fieldName; } else { self::$count = self::$count + 1; return self::$generated_fieldname . self::$count; } } /** * Method to get an attribute of the field * * @param string $name Name of the attribute to get * @param mixed $default Optional value to return if attribute not found * * @return mixed Value of the attribute / default * * @since 3.2 */ public function getAttribute($name, $default = null) { if ($this->element instanceof SimpleXMLElement) { $attributes = $this->element->attributes(); // Ensure that the attribute exists if (property_exists($attributes, $name)) { $value = $attributes->$name; if ($value !== null) { return (string) $value; } } } return $default; } /** * Method to get a control group with label and input. * * @return string A string containing the html for the control group * * @since 3.2 * @deprecated 3.2.3 Use renderField() instead */ public function getControlGroup() { JLog::add('JFormField->getControlGroup() is deprecated use JFormField->renderField().', JLog::WARNING, 'deprecated'); return $this->renderField(); } /** * Method to get a control group with label and input. * * @param array $options Options to be passed into the rendering of the field * * @return string A string containing the html for the control group * * @since 3.2 */ public function renderField($options = array()) { if ($this->hidden) { return $this->getInput(); } if (!isset($options['class'])) { $options['class'] = ''; } $options['rel'] = ''; if (empty($options['hiddenLabel']) && $this->getAttribute('hiddenLabel')) { $options['hiddenLabel'] = true; } if ($showon = $this->getAttribute('showon')) { $showon = explode(':', $showon, 2); $options['class'] .= ' showon_' . implode(' showon_', explode(',', $showon[1])); $id = $this->getName($showon[0]); $id = $this->multiple ? str_replace('[]', '', $id) : $id; $options['rel'] = ' rel="showon_' . $id . '"'; $options['showonEnabled'] = true; } return JLayoutHelper::render($this->renderLayout, array('input' => $this->getInput(), 'label' => $this->getLabel(), 'options' => $options)); } } PK���\�w�!��"libraries/joomla/form/rule/url.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Form Rule class for the Joomla Platform. * * @since 11.1 */ class JFormRuleUrl extends JFormRule { /** * Method to test an external or internal url for all valid parts. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.1 * @link http://www.w3.org/Addressing/URL/url-spec.txt * @see JString */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required'); if (!$required && empty($value)) { return true; } $urlParts = JString::parse_url($value); // See http://www.w3.org/Addressing/URL/url-spec.txt // Use the full list or optionally specify a list of permitted schemes. if ($element['schemes'] == '') { $scheme = array('http', 'https', 'ftp', 'ftps', 'gopher', 'mailto', 'news', 'prospero', 'telnet', 'rlogin', 'tn3270', 'wais', 'url', 'mid', 'cid', 'nntp', 'tel', 'urn', 'ldap', 'file', 'fax', 'modem', 'git'); } else { $scheme = explode(',', $element['schemes']); } /* * Note that parse_url() does not always parse accurately without a scheme, * but at least the path should be set always. Note also that parse_url() * returns False for seriously malformed URLs instead of an associative array. * @see http://php.net/manual/en/function.parse-url.php */ if ($urlParts === false or !array_key_exists('scheme', $urlParts)) { /* * The function parse_url() returned false (seriously malformed URL) or no scheme * was found and the relative option is not set: in both cases the field is not valid. */ if ($urlParts === false or !$element['relative']) { return false; } // The best we can do for the rest is make sure that the path exists and is valid UTF-8. if (!array_key_exists('path', $urlParts) || !JString::valid((string) $urlParts['path'])) { return false; } // The internal URL seems to be good. return true; } // Scheme found, check all parts found. $urlScheme = (string) $urlParts['scheme']; $urlScheme = strtolower($urlScheme); if (in_array($urlScheme, $scheme) == false) { return false; } // For some schemes here must be two slashes. if (($urlScheme == 'http' || $urlScheme == 'https' || $urlScheme == 'ftp' || $urlScheme == 'sftp' || $urlScheme == 'gopher' || $urlScheme == 'wais' || $urlScheme == 'gopher' || $urlScheme == 'prospero' || $urlScheme == 'telnet' || $urlScheme == 'git') && ((substr($value, strlen($urlScheme), 3)) !== '://')) { return false; } // The best we can do for the rest is make sure that the strings are valid UTF-8 // and the port is an integer. if (array_key_exists('host', $urlParts) && !JString::valid((string) $urlParts['host'])) { return false; } if (array_key_exists('port', $urlParts) && !is_int((int) $urlParts['port'])) { return false; } if (array_key_exists('path', $urlParts) && !JString::valid((string) $urlParts['path'])) { return false; } return true; } } PK���\k��N��&libraries/joomla/form/rule/boolean.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Form Rule class for the Joomla Platform. * * @since 11.1 */ class JFormRuleBoolean extends JFormRule { /** * The regular expression to use in testing a form field value. * * @var string * @since 11.1 */ protected $regex = '^(?:[01]|true|false)$'; /** * The regular expression modifiers to use when testing a form field value. * * @var string * @since 11.1 */ protected $modifiers = 'i'; } PK���\�~�6""&libraries/joomla/form/rule/options.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * @copyright Copyright (C) 2005 - 2015 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\Registry\Registry; /** * Form Rule class for the Joomla Platform. * Requires the value entered be one of the options in a field of type="list" * * @since 11.1 */ class JFormRuleOptions extends JFormRule { /** * Method to test the value. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.1 */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { // Make an array of all available option values. $options = array(); foreach ($element->option as $opt) { $options[] = $opt->attributes()->value; } // There may be multiple values in the form of an array (if the element is checkboxes, for example). if (is_array($value)) { // If all values are in the $options array, $diff will be empty and the options valid. $diff = array_diff($value, $options); return empty($diff); } else { // In this case value must be a string return in_array((string) $value, $options); } } } PK���\\Cn n $libraries/joomla/form/rule/rules.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Form Rule class for the Joomla Platform. * * @since 11.1 */ class JFormRuleRules extends JFormRule { /** * Method to test the value. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.1 */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { // Get the possible field actions and the ones posted to validate them. $fieldActions = self::getFieldActions($element); $valueActions = self::getValueActions($value); // Make sure that all posted actions are in the list of possible actions for the field. foreach ($valueActions as $action) { if (!in_array($action, $fieldActions)) { return false; } } return true; } /** * Method to get the list of permission action names from the form field value. * * @param mixed $value The form field value to validate. * * @return array A list of permission action names from the form field value. * * @since 11.1 */ protected function getValueActions($value) { $actions = array(); // Iterate over the asset actions and add to the actions. foreach ((array) $value as $name => $rules) { $actions[] = $name; } return $actions; } /** * Method to get the list of possible permission action names for the form field. * * @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the * form field object. * * @return array A list of permission action names from the form field element definition. * * @since 11.1 */ protected function getFieldActions(SimpleXMLElement $element) { $actions = array(); // Initialise some field attributes. $section = $element['section'] ? (string) $element['section'] : ''; $component = $element['component'] ? (string) $element['component'] : ''; // Get the asset actions for the element. $elActions = JAccess::getActions($component, $section); // Iterate over the asset actions and add to the actions. foreach ($elActions as $item) { $actions[] = $item->name; } // Iterate over the children and add to the actions. foreach ($element->children() as $el) { if ($el->getName() == 'action') { $actions[] = (string) $el['name']; } } return $actions; } } PK���\�Y__$libraries/joomla/form/rule/color.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Form Rule class for the Joomla Platform. * * @since 11.2 */ class JFormRuleColor extends JFormRule { /** * Method to test for a valid color in hexadecimal. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.2 */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { $value = trim($value); if (empty($value)) { // A color field can't be empty return false; } if ($value[0] != '#') { return false; } // Remove the leading # if present to validate the numeric part $value = ltrim($value, '#'); // The value must be 6 or 3 characters long if (!((strlen($value) == 6 || strlen($value) == 3) && ctype_xdigit($value))) { return false; } return true; } } PK���\]�H��'libraries/joomla/form/rule/username.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Form Rule class for the Joomla Platform. * * @since 11.1 */ class JFormRuleUsername extends JFormRule { /** * Method to test the username for uniqueness. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.1 */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { // Get the database object and a new query object. $db = JFactory::getDbo(); $query = $db->getQuery(true); // Build the query. $query->select('COUNT(*)') ->from('#__users') ->where('username = ' . $db->quote($value)); // Get the extra field check attribute. $userId = ($form instanceof JForm) ? $form->getValue('id') : ''; $query->where($db->quoteName('id') . ' <> ' . (int) $userId); // Set and query the database. $db->setQuery($query); $duplicate = (bool) $db->loadResult(); if ($duplicate) { return false; } return true; } } PK���\��(33"libraries/joomla/form/rule/tel.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Form Rule class for the Joomla Platform * * @since 11.1 */ class JFormRuleTel extends JFormRule { /** * Method to test the url for a valid parts. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.1 */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required'); if (!$required && empty($value)) { return true; } /* * @see http://www.nanpa.com/ * @see http://tools.ietf.org/html/rfc4933 * @see http://www.itu.int/rec/T-REC-E.164/en * * Regex by Steve Levithan * @see http://blog.stevenlevithan.com/archives/validate-phone-number * @note that valid ITU-T and EPP must begin with +. */ $regexarray = array('NANP' => '/^(?:\+?1[-. ]?)?\(?([2-9][0-8][0-9])\)?[-. ]?([2-9][0-9]{2})[-. ]?([0-9]{4})$/', 'ITU-T' => '/^\+(?:[0-9] ?){6,14}[0-9]$/', 'EPP' => '/^\+[0-9]{1,3}\.[0-9]{4,14}(?:x.+)?$/'); if (isset($element['plan'])) { $plan = (string) $element['plan']; if ($plan == 'northamerica' || $plan == 'us') { $plan = 'NANP'; } elseif ($plan == 'International' || $plan == 'int' || $plan == 'missdn' || !$plan) { $plan = 'ITU-T'; } elseif ($plan == 'IETF') { $plan = 'EPP'; } $regex = $regexarray[$plan]; // Test the value against the regular expression. if (preg_match($regex, $value) == false) { return false; } } else { /* * If the rule is set but no plan is selected just check that there are between * 7 and 15 digits inclusive and no illegal characters (but common number separators * are allowed). */ $cleanvalue = preg_replace('/[+. \-(\)]/', '', $value); $regex = '/^[0-9]{7,15}?$/'; if (preg_match($regex, $cleanvalue) == true) { return true; } else { return false; } } return true; } } PK���\u�٧FF$libraries/joomla/form/rule/email.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Form Rule class for the Joomla Platform. * * @since 11.1 */ class JFormRuleEmail extends JFormRule { /** * The regular expression to use in testing a form field value. * * @var string * @since 11.1 * @see http://www.w3.org/TR/html-markup/input.email.html */ protected $regex = '^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$'; /** * Method to test the email address and optionally check for uniqueness. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.1 */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { // If the field is empty and not required, the field is valid. $required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required'); if (!$required && empty($value)) { return true; } // If the tld attribute is present, change the regular expression to require at least 2 characters for it. $tld = ((string) $element['tld'] == 'tld' || (string) $element['tld'] == 'required'); if ($tld) { $this->regex = '^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$'; } // Determine if the multiple attribute is present $multiple = ((string) $element['multiple'] == 'true' || (string) $element['multiple'] == 'multiple'); if (!$multiple) { // Handle idn e-mail addresses by converting to punycode. $value = JStringPunycode::emailToPunycode($value); // Test the value against the regular expression. if (!parent::test($element, $value, $group, $input, $form)) { return false; } } else { $values = explode(',', $value); foreach ($values as $value) { // Handle idn e-mail addresses by converting to punycode. $value = JStringPunycode::emailToPunycode($value); // Test the value against the regular expression. if (!parent::test($element, $value, $group, $input, $form)) { return false; } } } // Check if we should test for uniqueness. This only can be used if multiple is not true $unique = ((string) $element['unique'] == 'true' || (string) $element['unique'] == 'unique'); if ($unique && !$multiple) { // Get the database object and a new query object. $db = JFactory::getDbo(); $query = $db->getQuery(true); // Build the query. $query->select('COUNT(*)') ->from('#__users') ->where('email = ' . $db->quote($value)); // Get the extra field check attribute. $userId = ($form instanceof JForm) ? $form->getValue('id') : ''; $query->where($db->quoteName('id') . ' <> ' . (int) $userId); // Set and query the database. $db->setQuery($query); $duplicate = (bool) $db->loadResult(); if ($duplicate) { return false; } } return true; } } PK���\��"f��%libraries/joomla/form/rule/equals.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Form Rule class for the Joomla Platform. * * @since 11.1 */ class JFormRuleEquals extends JFormRule { /** * Method to test if two values are equal. To use this rule, the form * XML needs a validate attribute of equals and a field attribute * that is equal to the field to test against. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.1 * @throws InvalidArgumentException * @throws UnexpectedValueException */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { $field = (string) $element['field']; // Check that a validation field is set. if (!$field) { throw new UnexpectedValueException(sprintf('$field empty in %s::test', get_class($this))); } if (is_null($form)) { throw new InvalidArgumentException(sprintf('The value for $form must not be null in %s', get_class($this))); } if (is_null($input)) { throw new InvalidArgumentException(sprintf('The value for $input must not be null in %s', get_class($this))); } // Test the two values against each other. if ($value == $input->get($field)) { return true; } return false; } } PK���\3��;; libraries/joomla/form/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.path'); /** * JForm's helper class. * Provides a storage for filesystem's paths where JForm's entities reside and methods for creating those entities. * Also stores objects with entities' prototypes for further reusing. * * @since 11.1 */ class JFormHelper { /** * Array with paths where entities(field, rule, form) can be found. * * Array's structure: * <code> * paths: * {ENTITY_NAME}: * - /path/1 * - /path/2 * </code> * * @var array * @since 11.1 * */ protected static $paths; /** * Static array of JForm's entity objects for re-use. * Prototypes for all fields and rules are here. * * Array's structure: * <code> * entities: * {ENTITY_NAME}: * {KEY}: {OBJECT} * </code> * * @var array * @since 11.1 */ protected static $entities = array(); /** * Method to load a form field object given a type. * * @param string $type The field type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed JFormField object on success, false otherwise. * * @since 11.1 */ public static function loadFieldType($type, $new = true) { return self::loadType('field', $type, $new); } /** * Method to load a form rule object given a type. * * @param string $type The rule type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed JFormRule object on success, false otherwise. * * @since 11.1 */ public static function loadRuleType($type, $new = true) { return self::loadType('rule', $type, $new); } /** * Method to load a form entity object given a type. * Each type is loaded only once and then used as a prototype for other objects of same type. * Please, use this method only with those entities which support types (forms don't support them). * * @param string $entity The entity. * @param string $type The entity type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed Entity object on success, false otherwise. * * @since 11.1 */ protected static function loadType($entity, $type, $new = true) { // Reference to an array with current entity's type instances $types = &self::$entities[$entity]; $key = md5($type); // Return an entity object if it already exists and we don't need a new one. if (isset($types[$key]) && $new === false) { return $types[$key]; } $class = self::loadClass($entity, $type); if ($class === false) { return false; } // Instantiate a new type object. $types[$key] = new $class; return $types[$key]; } /** * Attempt to import the JFormField class file if it isn't already imported. * You can use this method outside of JForm for loading a field for inheritance or composition. * * @param string $type Type of a field whose class should be loaded. * * @return mixed Class name on success or false otherwise. * * @since 11.1 */ public static function loadFieldClass($type) { return self::loadClass('field', $type); } /** * Attempt to import the JFormRule class file if it isn't already imported. * You can use this method outside of JForm for loading a rule for inheritance or composition. * * @param string $type Type of a rule whose class should be loaded. * * @return mixed Class name on success or false otherwise. * * @since 11.1 */ public static function loadRuleClass($type) { return self::loadClass('rule', $type); } /** * Load a class for one of the form's entities of a particular type. * Currently, it makes sense to use this method for the "field" and "rule" entities * (but you can support more entities in your subclass). * * @param string $entity One of the form entities (field or rule). * @param string $type Type of an entity. * * @return mixed Class name on success or false otherwise. * * @since 11.1 */ protected static function loadClass($entity, $type) { $prefix = 'J'; if (strpos($type, '.')) { list($prefix, $type) = explode('.', $type); } $class = JString::ucfirst($prefix, '_') . 'Form' . JString::ucfirst($entity, '_') . JString::ucfirst($type, '_'); if (class_exists($class)) { return $class; } // Get the field search path array. $paths = self::addPath($entity); // If the type is complex, add the base type to the paths. if ($pos = strpos($type, '_')) { // Add the complex type prefix to the paths. for ($i = 0, $n = count($paths); $i < $n; $i++) { // Derive the new path. $path = $paths[$i] . '/' . strtolower(substr($type, 0, $pos)); // If the path does not exist, add it. if (!in_array($path, $paths)) { $paths[] = $path; } } // Break off the end of the complex type. $type = substr($type, $pos + 1); } // Try to find the class file. $type = strtolower($type) . '.php'; foreach ($paths as $path) { $file = JPath::find($path, $type); if (!$file) { continue; } require_once $file; if (class_exists($class)) { break; } } // Check for all if the class exists. return class_exists($class) ? $class : false; } /** * Method to add a path to the list of field include paths. * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @since 11.1 */ public static function addFieldPath($new = null) { return self::addPath('field', $new); } /** * Method to add a path to the list of form include paths. * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @since 11.1 */ public static function addFormPath($new = null) { return self::addPath('form', $new); } /** * Method to add a path to the list of rule include paths. * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @since 11.1 */ public static function addRulePath($new = null) { return self::addPath('rule', $new); } /** * Method to add a path to the list of include paths for one of the form's entities. * Currently supported entities: field, rule and form. You are free to support your own in a subclass. * * @param string $entity Form's entity name for which paths will be added. * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @since 11.1 */ protected static function addPath($entity, $new = null) { // Reference to an array with paths for current entity $paths = &self::$paths[$entity]; // Add the default entity's search path if not set. if (empty($paths)) { // While we support limited number of entities (form, field and rule) // we can do this simple pluralisation: $entity_plural = $entity . 's'; /* * But when someday we would want to support more entities, then we should consider adding * an inflector class to "libraries/joomla/utilities" and use it here (or somebody can use a real inflector in his subclass). * See also: pluralization snippet by Paul Osman in JControllerForm's constructor. */ $paths[] = __DIR__ . '/' . $entity_plural; } // Force the new path(s) to an array. settype($new, 'array'); // Add the new paths to the stack if not already there. foreach ($new as $path) { if (!in_array($path, $paths)) { array_unshift($paths, trim($path)); } } return $paths; } } PK���\A���� � libraries/joomla/form/rule.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; // Detect if we have full UTF-8 and unicode PCRE support. if (!defined('JCOMPAT_UNICODE_PROPERTIES')) { define('JCOMPAT_UNICODE_PROPERTIES', (bool) @preg_match('/\pL/u', 'a')); } /** * Form Rule class for the Joomla Platform. * * @since 11.1 */ class JFormRule { /** * The regular expression to use in testing a form field value. * * @var string * @since 11.1 */ protected $regex; /** * The regular expression modifiers to use when testing a form field value. * * @var string * @since 11.1 */ protected $modifiers; /** * Method to test the value. * * @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 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]". * @param Registry $input An optional Registry object with the entire data set to validate against the entire form. * @param JForm $form The form object for which the field is being tested. * * @return boolean True if the value is valid, false otherwise. * * @since 11.1 * @throws UnexpectedValueException if rule is invalid. */ public function test(SimpleXMLElement $element, $value, $group = null, Registry $input = null, JForm $form = null) { // Check for a valid regex. if (empty($this->regex)) { throw new UnexpectedValueException(sprintf('%s has invalid regex.', get_class($this))); } // Add unicode property support if available. if (JCOMPAT_UNICODE_PROPERTIES) { $this->modifiers = (strpos($this->modifiers, 'u') !== false) ? $this->modifiers : $this->modifiers . 'u'; } // Test the value against the regular expression. if (preg_match(chr(1) . $this->regex . chr(1) . $this->modifiers, $value)) { return true; } return false; } } PK���\ bKڧ�(libraries/joomla/form/wrapper/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Form * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JFormHelper * * @package Joomla.Platform * @subpackage Form * @since 3.4 */ class JFormWrapperHelper { /** * Helper wrapper method for loadFieldType * * @param string $type The field type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed JFormField object on success, false otherwise. * * @see JFormHelper::loadFieldType() * @since 3.4 */ public function loadFieldType($type, $new = true) { return JFormHelper::loadFieldType($type, $new); } /** * Helper wrapper method for loadRuleType * * @param string $type The field type. * @param boolean $new Flag to toggle whether we should get a new instance of the object. * * @return mixed JFormField object on success, false otherwise. * * @see JFormHelper::loadRuleType() * @since 3.4 */ public function loadRuleType($type, $new = true) { return JFormHelper::loadRuleType($type, $new); } /** * Helper wrapper method for loadFieldClass * * @param string $type Type of a field whose class should be loaded. * * @return mixed Class name on success or false otherwise. * * @see JFormHelper::loadFieldClass() * @since 3.4 */ public function loadFieldClass($type) { return JFormHelper::loadFieldClass($type); } /** * Helper wrapper method for loadRuleClass * * @param string $type Type of a rule whose class should be loaded. * * @return mixed Class name on success or false otherwise. * * @see JFormHelper::loadRuleClass() * @since 3.4 */ public function loadRuleClass($type) { return JFormHelper::loadRuleClass($type); } /** * Helper wrapper method for addFieldPath * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @see JFormHelper::addFieldPath() * @since 3.4 */ public function addFieldPath($new = null) { return JFormHelper::addFieldPath($new); } /** * Helper wrapper method for addFormPath * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @see JFormHelper::addFormPath() * @since 3.4 */ public function addFormPath($new = null) { return JFormHelper::addFormPath($new); } /** * Helper wrapper method for addRulePath * * @param mixed $new A path or array of paths to add. * * @return array The list of paths that have been added. * * @see JFormHelper::addRulePath() * @since 3.4 */ public function addRulePath($new = null) { return JFormHelper::addRulePath($new); } } PK���\�M�H3%3%libraries/joomla/grid/grid.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Grid * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JGrid class to dynamically generate HTML tables * * @since 11.3 */ class JGrid { /** * Array of columns * @var array * @since 11.3 */ protected $columns = array(); /** * Current active row * @var int * @since 11.3 */ protected $activeRow = 0; /** * Rows of the table (including header and footer rows) * @var array * @since 11.3 */ protected $rows = array(); /** * Header and Footer row-IDs * @var array * @since 11.3 */ protected $specialRows = array('header' => array(), 'footer' => array()); /** * Associative array of attributes for the table-tag * @var array * @since 11.3 */ protected $options; /** * Constructor for a JGrid object * * @param array $options Associative array of attributes for the table-tag * * @since 11.3 */ public function __construct($options = array()) { $this->setTableOptions($options, true); } /** * Magic function to render this object as a table. * * @return string * * @since 11.3 */ public function __toString() { return $this->toString(); } /** * Method to set the attributes for a table-tag * * @param array $options Associative array of attributes for the table-tag * @param bool $replace Replace possibly existing attributes * * @return JGrid This object for chaining * * @since 11.3 */ public function setTableOptions($options = array(), $replace = false) { if ($replace) { $this->options = $options; } else { $this->options = array_merge($this->options, $options); } return $this; } /** * Get the Attributes of the current table * * @return array Associative array of attributes * * @since 11.3 */ public function getTableOptions() { return $this->options; } /** * Add new column name to process * * @param string $name Internal column name * * @return JGrid This object for chaining * * @since 11.3 */ public function addColumn($name) { $this->columns[] = $name; return $this; } /** * Returns the list of internal columns * * @return array List of internal columns * * @since 11.3 */ public function getColumns() { return $this->columns; } /** * Delete column by name * * @param string $name Name of the column to be deleted * * @return JGrid This object for chaining * * @since 11.3 */ public function deleteColumn($name) { $index = array_search($name, $this->columns); if ($index !== false) { unset($this->columns[$index]); $this->columns = array_values($this->columns); } return $this; } /** * Method to set a whole range of columns at once * This can be used to re-order the columns, too * * @param array $columns List of internal column names * * @return JGrid This object for chaining * * @since 11.3 */ public function setColumns($columns) { $this->columns = array_values($columns); return $this; } /** * Adds a row to the table and sets the currently * active row to the new row * * @param array $options Associative array of attributes for the row * @param int $special 1 for a new row in the header, 2 for a new row in the footer * * @return JGrid This object for chaining * * @since 11.3 */ public function addRow($options = array(), $special = false) { $this->rows[]['_row'] = $options; $this->activeRow = count($this->rows) - 1; if ($special) { if ($special === 1) { $this->specialRows['header'][] = $this->activeRow; } else { $this->specialRows['footer'][] = $this->activeRow; } } return $this; } /** * Method to get the attributes of the currently active row * * @return array Associative array of attributes * * @since 11.3 */ public function getRowOptions() { return $this->rows[$this->activeRow]['_row']; } /** * Method to set the attributes of the currently active row * * @param array $options Associative array of attributes * * @return JGrid This object for chaining * * @since 11.3 */ public function setRowOptions($options) { $this->rows[$this->activeRow]['_row'] = $options; return $this; } /** * Get the currently active row ID * * @return int ID of the currently active row * * @since 11.3 */ public function getActiveRow() { return $this->activeRow; } /** * Set the currently active row * * @param int $id ID of the row to be set to current * * @return JGrid This object for chaining * * @since 11.3 */ public function setActiveRow($id) { $this->activeRow = (int) $id; return $this; } /** * Set cell content for a specific column for the * currently active row * * @param string $name Name of the column * @param string $content Content for the cell * @param array $option Associative array of attributes for the td-element * @param bool $replace If false, the content is appended to the current content of the cell * * @return JGrid This object for chaining * * @since 11.3 */ public function setRowCell($name, $content, $option = array(), $replace = true) { if ($replace || !isset($this->rows[$this->activeRow][$name])) { $cell = new stdClass; $cell->options = $option; $cell->content = $content; $this->rows[$this->activeRow][$name] = $cell; } else { $this->rows[$this->activeRow][$name]->content .= $content; $this->rows[$this->activeRow][$name]->options = $option; } return $this; } /** * Get all data for a row * * @param int $id ID of the row to return * * @return array Array of columns of a table row * * @since 11.3 */ public function getRow($id = false) { if ($id === false) { $id = $this->activeRow; } if (isset($this->rows[(int) $id])) { return $this->rows[(int) $id]; } else { return false; } } /** * Get the IDs of all rows in the table * * @param int $special false for the standard rows, 1 for the header rows, 2 for the footer rows * * @return array Array of IDs * * @since 11.3 */ public function getRows($special = false) { if ($special) { if ($special === 1) { return $this->specialRows['header']; } else { return $this->specialRows['footer']; } } return array_diff(array_keys($this->rows), array_merge($this->specialRows['header'], $this->specialRows['footer'])); } /** * Delete a row from the object * * @param int $id ID of the row to be deleted * * @return JGrid This object for chaining * * @since 11.3 */ public function deleteRow($id) { unset($this->rows[$id]); if (in_array($id, $this->specialRows['header'])) { unset($this->specialRows['header'][array_search($id, $this->specialRows['header'])]); } if (in_array($id, $this->specialRows['footer'])) { unset($this->specialRows['footer'][array_search($id, $this->specialRows['footer'])]); } if ($this->activeRow == $id) { end($this->rows); $this->activeRow = key($this->rows); } return $this; } /** * Render the HTML table * * @return string The rendered HTML table * * @since 11.3 */ public function toString() { $output = array(); $output[] = '<table' . $this->renderAttributes($this->getTableOptions()) . '>'; if (count($this->specialRows['header'])) { $output[] = $this->renderArea($this->specialRows['header'], 'thead', 'th'); } if (count($this->specialRows['footer'])) { $output[] = $this->renderArea($this->specialRows['footer'], 'tfoot'); } $ids = array_diff(array_keys($this->rows), array_merge($this->specialRows['header'], $this->specialRows['footer'])); if (count($ids)) { $output[] = $this->renderArea($ids); } $output[] = '</table>'; return implode('', $output); } /** * Render an area of the table * * @param array $ids IDs of the rows to render * @param string $area Name of the area to render. Valid: tbody, tfoot, thead * @param string $cell Name of the cell to render. Valid: td, th * * @return string The rendered table area * * @since 11.3 */ protected function renderArea($ids, $area = 'tbody', $cell = 'td') { $output = array(); $output[] = '<' . $area . ">\n"; foreach ($ids as $id) { $output[] = "\t<tr" . $this->renderAttributes($this->rows[$id]['_row']) . ">\n"; foreach ($this->getColumns() as $name) { if (isset($this->rows[$id][$name])) { $column = $this->rows[$id][$name]; $output[] = "\t\t<" . $cell . $this->renderAttributes($column->options) . '>' . $column->content . '</' . $cell . ">\n"; } } $output[] = "\t</tr>\n"; } $output[] = '</' . $area . '>'; return implode('', $output); } /** * Renders an HTML attribute from an associative array * * @param array $attributes Associative array of attributes * * @return string The HTML attribute string * * @since 11.3 */ protected function renderAttributes($attributes) { if (count((array) $attributes) == 0) { return ''; } $return = array(); foreach ($attributes as $key => $option) { $return[] = $key . '="' . $option . '"'; } return ' ' . implode(' ', $return); } } PK���\��7VEElibraries/joomla/factory.phpnu�[���<?php /** * @package Joomla.Platform * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform Factory class. * * @since 11.1 */ abstract class JFactory { /** * Global application object * * @var JApplicationCms * @since 11.1 */ public static $application = null; /** * Global cache object * * @var JCache * @since 11.1 */ public static $cache = null; /** * Global configuraiton object * * @var JConfig * @since 11.1 */ public static $config = null; /** * Container for JDate instances * * @var array * @since 11.3 */ public static $dates = array(); /** * Global session object * * @var JSession * @since 11.1 */ public static $session = null; /** * Global language object * * @var JLanguage * @since 11.1 */ public static $language = null; /** * Global document object * * @var JDocument * @since 11.1 */ public static $document = null; /** * Global ACL object * * @var JAccess * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) */ public static $acl = null; /** * Global database object * * @var JDatabaseDriver * @since 11.1 */ public static $database = null; /** * Global mailer object * * @var JMail * @since 11.1 */ public static $mailer = null; /** * Get a application object. * * Returns the global {@link JApplicationCms} object, only creating it if it doesn't already exist. * * @param mixed $id A client identifier or name. * @param array $config An optional associative array of configuration settings. * @param string $prefix Application prefix * * @return JApplicationCms object * * @see JApplication * @since 11.1 * @throws Exception */ public static function getApplication($id = null, array $config = array(), $prefix = 'J') { if (!self::$application) { if (!$id) { throw new Exception('Application Instantiation Error', 500); } self::$application = JApplicationCms::getInstance($id); } return self::$application; } /** * Get a configuration object * * Returns the global {@link JConfig} object, only creating it if it doesn't already exist. * * @param string $file The path to the configuration file * @param string $type The type of the configuration file * @param string $namespace The namespace of the configuration file * * @return Registry * * @see Registry * @since 11.1 */ public static function getConfig($file = null, $type = 'PHP', $namespace = '') { if (!self::$config) { if ($file === null) { $file = JPATH_PLATFORM . '/config.php'; } self::$config = self::createConfig($file, $type, $namespace); } return self::$config; } /** * Get a session object. * * Returns the global {@link JSession} object, only creating it if it doesn't already exist. * * @param array $options An array containing session options * * @return JSession object * * @see JSession * @since 11.1 */ public static function getSession(array $options = array()) { if (!self::$session) { self::$session = self::createSession($options); } return self::$session; } /** * Get a language object. * * Returns the global {@link JLanguage} object, only creating it if it doesn't already exist. * * @return JLanguage object * * @see JLanguage * @since 11.1 */ public static function getLanguage() { if (!self::$language) { self::$language = self::createLanguage(); } return self::$language; } /** * Get a document object. * * Returns the global {@link JDocument} object, only creating it if it doesn't already exist. * * @return JDocument object * * @see JDocument * @since 11.1 */ public static function getDocument() { if (!self::$document) { self::$document = self::createDocument(); } return self::$document; } /** * Get an user object. * * Returns the global {@link JUser} object, only creating it if it doesn't already exist. * * @param integer $id The user to load - Can be an integer or string - If string, it is converted to ID automatically. * * @return JUser object * * @see JUser * @since 11.1 */ public static function getUser($id = null) { $instance = self::getSession()->get('user'); if (is_null($id)) { if (!($instance instanceof JUser)) { $instance = JUser::getInstance(); } } // Check if we have a string as the id or if the numeric id is the current instance elseif (!($instance instanceof JUser) || is_string($id) || $instance->id !== $id) { $instance = JUser::getInstance($id); } return $instance; } /** * Get a cache object * * Returns the global {@link JCache} object * * @param string $group The cache group name * @param string $handler The handler to use * @param string $storage The storage method * * @return JCacheController object * * @see JCache * @since 11.1 */ public static function getCache($group = '', $handler = 'callback', $storage = null) { $hash = md5($group . $handler . $storage); if (isset(self::$cache[$hash])) { return self::$cache[$hash]; } $handler = ($handler == 'function') ? 'callback' : $handler; $options = array('defaultgroup' => $group); if (isset($storage)) { $options['storage'] = $storage; } $cache = JCache::getInstance($handler, $options); self::$cache[$hash] = $cache; return self::$cache[$hash]; } /** * Get an authorization object * * Returns the global {@link JAccess} object, only creating it * if it doesn't already exist. * * @return JAccess object * * @deprecated 13.3 (Platform) & 4.0 (CMS) - Use JAccess directly. */ public static function getAcl() { JLog::add(__METHOD__ . ' is deprecated. Use JAccess directly.', JLog::WARNING, 'deprecated'); if (!self::$acl) { self::$acl = new JAccess; } return self::$acl; } /** * Get a database object. * * Returns the global {@link JDatabaseDriver} object, only creating it if it doesn't already exist. * * @return JDatabaseDriver * * @see JDatabaseDriver * @since 11.1 */ public static function getDbo() { if (!self::$database) { self::$database = self::createDbo(); } return self::$database; } /** * Get a mailer object. * * Returns the global {@link JMail} object, only creating it if it doesn't already exist. * * @return JMail object * * @see JMail * @since 11.1 */ public static function getMailer() { if (!self::$mailer) { self::$mailer = self::createMailer(); } $copy = clone self::$mailer; return $copy; } /** * Get a parsed XML Feed Source * * @param string $url Url for feed source. * @param integer $cache_time Time to cache feed for (using internal cache mechanism). * * @return mixed SimplePie parsed object on success, false on failure. * * @since 11.1 * @throws BadMethodCallException * @deprecated 4.0 Use directly JFeedFactory or supply SimplePie instead. Mehod will be proxied to JFeedFactory beginning in 3.2 */ public static function getFeedParser($url, $cache_time = 0) { if (!class_exists('JSimplepieFactory')) { throw new BadMethodCallException('JSimplepieFactory not found'); } JLog::add(__METHOD__ . ' is deprecated. Use JFeedFactory() or supply SimplePie instead.', JLog::WARNING, 'deprecated'); return JSimplepieFactory::getFeedParser($url, $cache_time); } /** * Reads a XML file. * * @param string $data Full path and file name. * @param boolean $isFile true to load a file or false to load a string. * * @return mixed JXMLElement or SimpleXMLElement on success or false on error. * * @see JXMLElement * @since 11.1 * @note When JXMLElement is not present a SimpleXMLElement will be returned. * @deprecated 13.3 (Platform) & 4.0 (CMS) - Use SimpleXML directly. */ public static function getXml($data, $isFile = true) { JLog::add(__METHOD__ . ' is deprecated. Use SimpleXML directly.', JLog::WARNING, 'deprecated'); $class = 'SimpleXMLElement'; if (class_exists('JXMLElement')) { $class = 'JXMLElement'; } // Disable libxml errors and allow to fetch error information as needed libxml_use_internal_errors(true); if ($isFile) { // Try to load the XML file $xml = simplexml_load_file($data, $class); } else { // Try to load the XML string $xml = simplexml_load_string($data, $class); } if ($xml === false) { JLog::add(JText::_('JLIB_UTIL_ERROR_XML_LOAD'), JLog::WARNING, 'jerror'); if ($isFile) { JLog::add($data, JLog::WARNING, 'jerror'); } foreach (libxml_get_errors() as $error) { JLog::add($error->message, JLog::WARNING, 'jerror'); } } return $xml; } /** * Get an editor object. * * @param string $editor The editor to load, depends on the editor plugins that are installed * * @return JEditor instance of JEditor * * @since 11.1 * @throws BadMethodCallException * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JEditor directly */ public static function getEditor($editor = null) { JLog::add(__METHOD__ . ' is deprecated. Use JEditor directly.', JLog::WARNING, 'deprecated'); if (!class_exists('JEditor')) { throw new BadMethodCallException('JEditor not found'); } // Get the editor configuration setting if (is_null($editor)) { $conf = self::getConfig(); $editor = $conf->get('editor'); } return JEditor::getInstance($editor); } /** * Return a reference to the {@link JUri} object * * @param string $uri Uri name. * * @return JUri object * * @see JUri * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) - Use JUri directly. */ public static function getUri($uri = 'SERVER') { JLog::add(__METHOD__ . ' is deprecated. Use JUri directly.', JLog::WARNING, 'deprecated'); return JUri::getInstance($uri); } /** * Return the {@link JDate} object * * @param mixed $time The initial time for the JDate object * @param mixed $tzOffset The timezone offset. * * @return JDate object * * @see JDate * @since 11.1 */ public static function getDate($time = 'now', $tzOffset = null) { static $classname; static $mainLocale; $language = self::getLanguage(); $locale = $language->getTag(); if (!isset($classname) || $locale != $mainLocale) { // Store the locale for future reference $mainLocale = $locale; if ($mainLocale !== false) { $classname = str_replace('-', '_', $mainLocale) . 'Date'; if (!class_exists($classname)) { // The class does not exist, default to JDate $classname = 'JDate'; } } else { // No tag, so default to JDate $classname = 'JDate'; } } $key = $time . '-' . ($tzOffset instanceof DateTimeZone ? $tzOffset->getName() : (string) $tzOffset); if (!isset(self::$dates[$classname][$key])) { self::$dates[$classname][$key] = new $classname($time, $tzOffset); } $date = clone self::$dates[$classname][$key]; return $date; } /** * Create a configuration object * * @param string $file The path to the configuration file. * @param string $type The type of the configuration file. * @param string $namespace The namespace of the configuration file. * * @return Registry * * @see Registry * @since 11.1 */ protected static function createConfig($file, $type = 'PHP', $namespace = '') { if (is_file($file)) { include_once $file; } // Create the registry with a default namespace of config $registry = new Registry; // Sanitize the namespace. $namespace = ucfirst((string) preg_replace('/[^A-Z_]/i', '', $namespace)); // Build the config name. $name = 'JConfig' . $namespace; // Handle the PHP configuration type. if ($type == 'PHP' && class_exists($name)) { // Create the JConfig object $config = new $name; // Load the configuration values into the registry $registry->loadObject($config); } return $registry; } /** * Create a session object * * @param array $options An array containing session options * * @return JSession object * * @since 11.1 */ protected static function createSession(array $options = array()) { // Get the editor configuration setting $conf = self::getConfig(); $handler = $conf->get('session_handler', 'none'); // Config time is in minutes $options['expire'] = ($conf->get('lifetime')) ? $conf->get('lifetime') * 60 : 900; $session = JSession::getInstance($handler, $options); if ($session->getState() == 'expired') { $session->restart(); } return $session; } /** * Create an database object * * @return JDatabaseDriver * * @see JDatabaseDriver * @since 11.1 */ protected static function createDbo() { $conf = self::getConfig(); $host = $conf->get('host'); $user = $conf->get('user'); $password = $conf->get('password'); $database = $conf->get('db'); $prefix = $conf->get('dbprefix'); $driver = $conf->get('dbtype'); $debug = $conf->get('debug'); $options = array('driver' => $driver, 'host' => $host, 'user' => $user, 'password' => $password, 'database' => $database, 'prefix' => $prefix); try { $db = JDatabaseDriver::getInstance($options); } catch (RuntimeException $e) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } jexit('Database Error: ' . $e->getMessage()); } $db->setDebug($debug); return $db; } /** * Create a mailer object * * @return JMail object * * @see JMail * @since 11.1 */ protected static function createMailer() { $conf = self::getConfig(); $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; $smtpuser = $conf->get('smtpuser'); $smtppass = $conf->get('smtppass'); $smtphost = $conf->get('smtphost'); $smtpsecure = $conf->get('smtpsecure'); $smtpport = $conf->get('smtpport'); $mailfrom = $conf->get('mailfrom'); $fromname = $conf->get('fromname'); $mailer = $conf->get('mailer'); // Create a JMail object $mail = JMail::getInstance(); // Set default sender without Reply-to $mail->SetFrom(JMailHelper::cleanLine($mailfrom), JMailHelper::cleanLine($fromname), 0); // Default mailer is to use PHP's mail function switch ($mailer) { case 'smtp': $mail->useSmtp($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport); break; case 'sendmail': $mail->IsSendmail(); break; default: $mail->IsMail(); break; } return $mail; } /** * Create a language object * * @return JLanguage object * * @see JLanguage * @since 11.1 */ protected static function createLanguage() { $conf = self::getConfig(); $locale = $conf->get('language'); $debug = $conf->get('debug_lang'); $lang = JLanguage::getInstance($locale, $debug); return $lang; } /** * Create a document object * * @return JDocument object * * @see JDocument * @since 11.1 */ protected static function createDocument() { $lang = self::getLanguage(); $input = self::getApplication()->input; $type = $input->get('format', 'html', 'word'); $version = new JVersion; $attributes = array( 'charset' => 'utf-8', 'lineend' => 'unix', 'tab' => ' ', 'language' => $lang->getTag(), 'direction' => $lang->isRtl() ? 'rtl' : 'ltr', 'mediaversion' => $version->getMediaVersion() ); return JDocument::getInstance($type, $attributes); } /** * Creates a new stream object with appropriate prefix * * @param boolean $use_prefix Prefix the connections for writing * @param boolean $use_network Use network if available for writing; use false to disable (e.g. FTP, SCP) * @param string $ua UA User agent to use * @param boolean $uamask User agent masking (prefix Mozilla) * * @return JStream * * @see JStream * @since 11.1 */ public static function getStream($use_prefix = true, $use_network = true, $ua = null, $uamask = false) { jimport('joomla.filesystem.stream'); // Setup the context; Joomla! UA and overwrite $context = array(); $version = new JVersion; // Set the UA for HTTP and overwrite for FTP $context['http']['user_agent'] = $version->getUserAgent($ua, $uamask); $context['ftp']['overwrite'] = true; if ($use_prefix) { $FTPOptions = JClientHelper::getCredentials('ftp'); $SCPOptions = JClientHelper::getCredentials('scp'); if ($FTPOptions['enabled'] == 1 && $use_network) { $prefix = 'ftp://' . $FTPOptions['user'] . ':' . $FTPOptions['pass'] . '@' . $FTPOptions['host']; $prefix .= $FTPOptions['port'] ? ':' . $FTPOptions['port'] : ''; $prefix .= $FTPOptions['root']; } elseif ($SCPOptions['enabled'] == 1 && $use_network) { $prefix = 'ssh2.sftp://' . $SCPOptions['user'] . ':' . $SCPOptions['pass'] . '@' . $SCPOptions['host']; $prefix .= $SCPOptions['port'] ? ':' . $SCPOptions['port'] : ''; $prefix .= $SCPOptions['root']; } else { $prefix = JPATH_ROOT . '/'; } $retval = new JStream($prefix, JPATH_ROOT, $context); } else { $retval = new JStream('', '', $context); } return $retval; } } PK���\E��vMvMlibraries/joomla/user/user.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage User * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * User class. Handles all application interaction with a user * * @since 11.1 */ class JUser extends JObject { /** * A cached switch for if this user has root access rights. * * @var boolean * @since 11.1 */ protected $isRoot = null; /** * Unique id * * @var integer * @since 11.1 */ public $id = null; /** * The user's real name (or nickname) * * @var string * @since 11.1 */ public $name = null; /** * The login name * * @var string * @since 11.1 */ public $username = null; /** * The email * * @var string * @since 11.1 */ public $email = null; /** * MD5 encrypted password * * @var string * @since 11.1 */ public $password = null; /** * Clear password, only available when a new password is set for a user * * @var string * @since 11.1 */ public $password_clear = ''; /** * Block status * * @var integer * @since 11.1 */ public $block = null; /** * Should this user receive system email * * @var integer * @since 11.1 */ public $sendEmail = null; /** * Date the user was registered * * @var datetime * @since 11.1 */ public $registerDate = null; /** * Date of last visit * * @var datetime * @since 11.1 */ public $lastvisitDate = null; /** * Activation hash * * @var string * @since 11.1 */ public $activation = null; /** * User parameters * * @var Registry * @since 11.1 */ public $params = null; /** * Associative array of user names => group ids * * @var array * @since 11.1 */ public $groups = array(); /** * Guest status * * @var boolean * @since 11.1 */ public $guest = null; /** * Last Reset Time * * @var string * @since 12.2 */ public $lastResetTime = null; /** * Count since last Reset Time * * @var int * @since 12.2 */ public $resetCount = null; /** * Flag to require the user's password be reset * * @var int * @since 3.2 */ public $requireReset = null; /** * User parameters * * @var Registry * @since 11.1 */ protected $_params = null; /** * Authorised access groups * * @var array * @since 11.1 */ protected $_authGroups = null; /** * Authorised access levels * * @var array * @since 11.1 */ protected $_authLevels = null; /** * Authorised access actions * * @var array * @since 11.1 */ protected $_authActions = null; /** * Error message * * @var string * @since 11.1 */ protected $_errorMsg = null; /** * JUserWrapperHelper object * * @var JUserWrapperHelper * @since 3.4 */ protected $userHelper = null; /** * @var array JUser instances container. * @since 11.3 */ protected static $instances = array(); /** * Constructor activating the default information of the language * * @param integer $identifier The primary key of the user to load (optional). * @param JUserWrapperHelper $userHelper The JUserWrapperHelper for the static methods. * * @since 11.1 */ public function __construct($identifier = 0, JUserWrapperHelper $userHelper = null) { if (null === $userHelper) { $userHelper = new JUserWrapperHelper; } $this->userHelper = $userHelper; // Create the user parameters object $this->_params = new Registry; // Load the user if it exists if (!empty($identifier)) { $this->load($identifier); } else { // Initialise $this->id = 0; $this->sendEmail = 0; $this->aid = 0; $this->guest = 1; } } /** * Returns the global User object, only creating it if it doesn't already exist. * * @param integer $identifier The primary key of the user to load (optional). * @param JUserWrapperHelper $userHelper The JUserWrapperHelper for the static methods. * * @return JUser The User object. * * @since 11.1 */ public static function getInstance($identifier = 0, JUserWrapperHelper $userHelper = null) { if (null === $userHelper) { $userHelper = new JUserWrapperHelper; } // Find the user id if (!is_numeric($identifier)) { if (!$id = $userHelper->getUserId($identifier)) { // If the $identifier doesn't match with any id, just return an empty JUser. return new JUser; } } else { $id = $identifier; } // If the $id is zero, just return an empty JUser. // Note: don't cache this user because it'll have a new ID on save! if ($id === 0) { return new JUser; } // Check if the user ID is already cached. if (empty(self::$instances[$id])) { $user = new JUser($id, $userHelper); self::$instances[$id] = $user; } return self::$instances[$id]; } /** * Method to get a parameter value * * @param string $key Parameter key * @param mixed $default Parameter default value * * @return mixed The value or the default if it did not exist * * @since 11.1 */ public function getParam($key, $default = null) { return $this->_params->get($key, $default); } /** * Method to set a parameter * * @param string $key Parameter key * @param mixed $value Parameter value * * @return mixed Set parameter value * * @since 11.1 */ public function setParam($key, $value) { return $this->_params->set($key, $value); } /** * Method to set a default parameter if it does not exist * * @param string $key Parameter key * @param mixed $value Parameter value * * @return mixed Set parameter value * * @since 11.1 */ public function defParam($key, $value) { return $this->_params->def($key, $value); } /** * Method to check JUser object authorisation against an access control * object and optionally an access extension object * * @param string $action The name of the action to check for permission. * @param string $assetname The name of the asset on which to perform the action. * * @return boolean True if authorised * * @since 11.1 */ public function authorise($action, $assetname = null) { // Make sure we only check for core.admin once during the run. if ($this->isRoot === null) { $this->isRoot = false; // Check for the configuration file failsafe. $config = JFactory::getConfig(); $rootUser = $config->get('root_user'); // The root_user variable can be a numeric user ID or a username. if (is_numeric($rootUser) && $this->id > 0 && $this->id == $rootUser) { $this->isRoot = true; } elseif ($this->username && $this->username == $rootUser) { $this->isRoot = true; } else { // Get all groups against which the user is mapped. $identities = $this->getAuthorisedGroups(); array_unshift($identities, $this->id * -1); if (JAccess::getAssetRules(1)->allow('core.admin', $identities)) { $this->isRoot = true; return true; } } } return $this->isRoot ? true : JAccess::check($this->id, $action, $assetname); } /** * Method to return a list of all categories that a user has permission for a given action * * @param string $component The component from which to retrieve the categories * @param string $action The name of the section within the component from which to retrieve the actions. * * @return array List of categories that this group can do this action to (empty array if none). Categories must be published. * * @since 11.1 */ public function getAuthorisedCategories($component, $action) { // Brute force method: get all published category rows for the component and check each one // TODO: Modify the way permissions are stored in the db to allow for faster implementation and better scaling $db = JFactory::getDbo(); $subQuery = $db->getQuery(true) ->select('id,asset_id') ->from('#__categories') ->where('extension = ' . $db->quote($component)) ->where('published = 1'); $query = $db->getQuery(true) ->select('c.id AS id, a.name AS asset_name') ->from('(' . $subQuery->__toString() . ') AS c') ->join('INNER', '#__assets AS a ON c.asset_id = a.id'); $db->setQuery($query); $allCategories = $db->loadObjectList('id'); $allowedCategories = array(); foreach ($allCategories as $category) { if ($this->authorise($action, $category->asset_name)) { $allowedCategories[] = (int) $category->id; } } return $allowedCategories; } /** * Gets an array of the authorised access levels for the user * * @return array * * @since 11.1 */ public function getAuthorisedViewLevels() { if ($this->_authLevels === null) { $this->_authLevels = array(); } if (empty($this->_authLevels)) { $this->_authLevels = JAccess::getAuthorisedViewLevels($this->id); } return $this->_authLevels; } /** * Gets an array of the authorised user groups * * @return array * * @since 11.1 */ public function getAuthorisedGroups() { if ($this->_authGroups === null) { $this->_authGroups = array(); } if (empty($this->_authGroups)) { $this->_authGroups = JAccess::getGroupsByUser($this->id); } return $this->_authGroups; } /** * Clears the access rights cache of this user * * @return void * * @since 3.4.0 */ public function clearAccessRights() { $this->_authLevels = null; $this->_authGroups = null; $this->isRoot = null; JAccess::clearStatics(); } /** * Pass through method to the table for setting the last visit date * * @param integer $timestamp The timestamp, defaults to 'now'. * * @return boolean True on success. * * @since 11.1 */ public function setLastVisit($timestamp = null) { // Create the user table object $table = $this->getTable(); $table->load($this->id); return $table->setLastVisit($timestamp); } /** * Method to get the user parameters * * This method used to load the user parameters from a file. * * @return object The user parameters object. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) - Instead use JUser::getParam() */ public function getParameters() { // @codeCoverageIgnoreStart JLog::add('JUser::getParameters() is deprecated. JUser::getParam().', JLog::WARNING, 'deprecated'); return $this->_params; // @codeCoverageIgnoreEnd } /** * Method to get the user parameters * * @param object $params The user parameters object * * @return void * * @since 11.1 */ public function setParameters($params) { $this->_params = $params; } /** * Method to get the user table object * * This function uses a static variable to store the table name of the user table to * instantiate. You can call this function statically to set the table name if * needed. * * @param string $type The user table name to be used * @param string $prefix The user table prefix to be used * * @return object The user table object * * @note At 4.0 this method will no longer be static * @since 11.1 */ public static function getTable($type = null, $prefix = 'JTable') { static $tabletype; // Set the default tabletype; if (!isset($tabletype)) { $tabletype['name'] = 'user'; $tabletype['prefix'] = 'JTable'; } // Set a custom table type is defined if (isset($type)) { $tabletype['name'] = $type; $tabletype['prefix'] = $prefix; } // Create the user table object return JTable::getInstance($tabletype['name'], $tabletype['prefix']); } /** * Method to bind an associative array of data to a user object * * @param array &$array The associative array to bind to the object * * @return boolean True on success * * @since 11.1 */ public function bind(&$array) { // Let's check to see if the user is new or not if (empty($this->id)) { // Check the password and create the crypted password if (empty($array['password'])) { $array['password'] = $this->userHelper->genRandomPassword(); $array['password2'] = $array['password']; } // Not all controllers check the password, although they should. // Hence this code is required: if (isset($array['password2']) && $array['password'] != $array['password2']) { JFactory::getApplication()->enqueueMessage(JText::_('JLIB_USER_ERROR_PASSWORD_NOT_MATCH'), 'error'); return false; } $this->password_clear = JArrayHelper::getValue($array, 'password', '', 'string'); $array['password'] = $this->userHelper->hashPassword($array['password']); // Set the registration timestamp $this->set('registerDate', JFactory::getDate()->toSql()); // Check that username is not greater than 150 characters $username = $this->get('username'); if (strlen($username) > 150) { $username = substr($username, 0, 150); $this->set('username', $username); } } else { // Updating an existing user if (!empty($array['password'])) { if ($array['password'] != $array['password2']) { $this->setError(JText::_('JLIB_USER_ERROR_PASSWORD_NOT_MATCH')); return false; } $this->password_clear = JArrayHelper::getValue($array, 'password', '', 'string'); // Check if the user is reusing the current password if required to reset their password if ($this->requireReset == 1 && $this->userHelper->verifyPassword($this->password_clear, $this->password)) { $this->setError(JText::_('JLIB_USER_ERROR_CANNOT_REUSE_PASSWORD')); return false; } $array['password'] = $this->userHelper->hashPassword($array['password']); // Reset the change password flag $array['requireReset'] = 0; } else { $array['password'] = $this->password; } } if (array_key_exists('params', $array)) { $this->_params->loadArray($array['params']); if (is_array($array['params'])) { $params = (string) $this->_params; } else { $params = $array['params']; } $this->params = $params; } // Bind the array if (!$this->setProperties($array)) { $this->setError(JText::_('JLIB_USER_ERROR_BIND_ARRAY')); return false; } // Make sure its an integer $this->id = (int) $this->id; return true; } /** * Method to save the JUser object to the database * * @param boolean $updateOnly Save the object only if not a new user * Currently only used in the user reset password method. * * @return boolean True on success * * @since 11.1 * @throws RuntimeException */ public function save($updateOnly = false) { // Create the user table object $table = $this->getTable(); $this->params = (string) $this->_params; $table->bind($this->getProperties()); // Allow an exception to be thrown. try { // Check and store the object. if (!$table->check()) { $this->setError($table->getError()); return false; } // If user is made a Super Admin group and user is NOT a Super Admin // @todo ACL - this needs to be acl checked $my = JFactory::getUser(); // Are we creating a new user $isNew = empty($this->id); // If we aren't allowed to create new users return if ($isNew && $updateOnly) { return true; } // Get the old user $oldUser = new JUser($this->id); // Access Checks // The only mandatory check is that only Super Admins can operate on other Super Admin accounts. // To add additional business rules, use a user plugin and throw an Exception with onUserBeforeSave. // Check if I am a Super Admin $iAmSuperAdmin = $my->authorise('core.admin'); $iAmRehashingSuperadmin = false; if (($my->id == 0 && !$isNew) && $this->id == $oldUser->id && $oldUser->authorise('core.admin') && $oldUser->password != $this->password) { $iAmRehashingSuperadmin = true; } // We are only worried about edits to this account if I am not a Super Admin. if ($iAmSuperAdmin != true && $iAmRehashingSuperadmin != true) { // I am not a Super Admin, and this one is, so fail. if (!$isNew && JAccess::check($this->id, 'core.admin')) { throw new RuntimeException('User not Super Administrator'); } if ($this->groups != null) { // I am not a Super Admin and I'm trying to make one. foreach ($this->groups as $groupId) { if (JAccess::checkGroup($groupId, 'core.admin')) { throw new RuntimeException('User not Super Administrator'); } } } } // Fire the onUserBeforeSave event. JPluginHelper::importPlugin('user'); $dispatcher = JEventDispatcher::getInstance(); $result = $dispatcher->trigger('onUserBeforeSave', array($oldUser->getProperties(), $isNew, $this->getProperties())); if (in_array(false, $result, true)) { // Plugin will have to raise its own error or throw an exception. return false; } // Store the user data in the database $result = $table->store(); // Set the id for the JUser object in case we created a new user. if (empty($this->id)) { $this->id = $table->get('id'); } if ($my->id == $table->id) { $registry = new Registry; $registry->loadString($table->params); $my->setParameters($registry); } // Fire the onUserAfterSave event $dispatcher->trigger('onUserAfterSave', array($this->getProperties(), $isNew, $result, $this->getError())); } catch (Exception $e) { $this->setError($e->getMessage()); return false; } // Reset the user object in the session on a successful save if ($result === true && JFactory::getUser()->id == $this->id) { JFactory::getSession()->set('user', $this); } return $result; } /** * Method to delete the JUser object from the database * * @return boolean True on success * * @since 11.1 */ public function delete() { JPluginHelper::importPlugin('user'); // Trigger the onUserBeforeDelete event $dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger('onUserBeforeDelete', array($this->getProperties())); // Create the user table object $table = $this->getTable(); if (!$result = $table->delete($this->id)) { $this->setError($table->getError()); } // Trigger the onUserAfterDelete event $dispatcher->trigger('onUserAfterDelete', array($this->getProperties(), $result, $this->getError())); return $result; } /** * Method to load a JUser object by user id number * * @param mixed $id The user id of the user to load * * @return boolean True on success * * @since 11.1 */ public function load($id) { // Create the user table object $table = $this->getTable(); // Load the JUserModel object based on the user id or throw a warning. if (!$table->load($id)) { // Reset to guest user $this->guest = 1; JLog::add(JText::sprintf('JLIB_USER_ERROR_UNABLE_TO_LOAD_USER', $id), JLog::WARNING, 'jerror'); return false; } /* * Set the user parameters using the default XML file. We might want to * extend this in the future to allow for the ability to have custom * user parameters, but for right now we'll leave it how it is. */ $this->_params->loadString($table->params); // Assuming all is well at this point let's bind the data $this->setProperties($table->getProperties()); // The user is no longer a guest if ($this->id != 0) { $this->guest = 0; } else { $this->guest = 1; } return true; } } PK���\1V�[,O,O libraries/joomla/user/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage User * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Authorisation helper class, provides static methods to perform various tasks relevant * to the Joomla user and authorisation classes * * This class has influences and some method logic from the Horde Auth package * * @since 11.1 */ abstract class JUserHelper { /** * Method to add a user to a group. * * @param integer $userId The id of the user. * @param integer $groupId The id of the group. * * @return boolean True on success * * @since 11.1 * @throws RuntimeException */ public static function addUserToGroup($userId, $groupId) { // Get the user object. $user = new JUser((int) $userId); // Add the user to the group if necessary. if (!in_array($groupId, $user->groups)) { // Get the title of the group. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('title')) ->from($db->quoteName('#__usergroups')) ->where($db->quoteName('id') . ' = ' . (int) $groupId); $db->setQuery($query); $title = $db->loadResult(); // If the group does not exist, return an exception. if (!$title) { throw new RuntimeException('Access Usergroup Invalid'); } // Add the group data to the user object. $user->groups[$title] = $groupId; // Store the user object. $user->save(); } if (session_id()) { // Set the group data for any preloaded user objects. $temp = JFactory::getUser((int) $userId); $temp->groups = $user->groups; // Set the group data for the user object in the session. $temp = JFactory::getUser(); if ($temp->id == $userId) { $temp->groups = $user->groups; } } return true; } /** * Method to get a list of groups a user is in. * * @param integer $userId The id of the user. * * @return array List of groups * * @since 11.1 */ public static function getUserGroups($userId) { // Get the user object. $user = JUser::getInstance((int) $userId); return isset($user->groups) ? $user->groups : array(); } /** * Method to remove a user from a group. * * @param integer $userId The id of the user. * @param integer $groupId The id of the group. * * @return boolean True on success * * @since 11.1 */ public static function removeUserFromGroup($userId, $groupId) { // Get the user object. $user = JUser::getInstance((int) $userId); // Remove the user from the group if necessary. $key = array_search($groupId, $user->groups); if ($key !== false) { // Remove the user from the group. unset($user->groups[$key]); // Store the user object. $user->save(); } // Set the group data for any preloaded user objects. $temp = JFactory::getUser((int) $userId); $temp->groups = $user->groups; // Set the group data for the user object in the session. $temp = JFactory::getUser(); if ($temp->id == $userId) { $temp->groups = $user->groups; } return true; } /** * Method to set the groups for a user. * * @param integer $userId The id of the user. * @param array $groups An array of group ids to put the user in. * * @return boolean True on success * * @since 11.1 */ public static function setUserGroups($userId, $groups) { // Get the user object. $user = JUser::getInstance((int) $userId); // Set the group ids. JArrayHelper::toInteger($groups); $user->groups = $groups; // Get the titles for the user groups. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id') . ', ' . $db->quoteName('title')) ->from($db->quoteName('#__usergroups')) ->where($db->quoteName('id') . ' = ' . implode(' OR ' . $db->quoteName('id') . ' = ', $user->groups)); $db->setQuery($query); $results = $db->loadObjectList(); // Set the titles for the user groups. for ($i = 0, $n = count($results); $i < $n; $i++) { $user->groups[$results[$i]->id] = $results[$i]->id; } // Store the user object. $user->save(); if (session_id()) { // Set the group data for any preloaded user objects. $temp = JFactory::getUser((int) $userId); $temp->groups = $user->groups; // Set the group data for the user object in the session. $temp = JFactory::getUser(); if ($temp->id == $userId) { $temp->groups = $user->groups; } } return true; } /** * Gets the user profile information * * @param integer $userId The id of the user. * * @return object * * @since 11.1 */ public static function getProfile($userId = 0) { if ($userId == 0) { $user = JFactory::getUser(); $userId = $user->id; } // Get the dispatcher and load the user's plugins. $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('user'); $data = new JObject; $data->id = $userId; // Trigger the data preparation event. $dispatcher->trigger('onContentPrepareData', array('com_users.profile', &$data)); return $data; } /** * Method to activate a user * * @param string $activation Activation string * * @return boolean True on success * * @since 11.1 */ public static function activateUser($activation) { $db = JFactory::getDbo(); // Let's get the id of the user we want to activate $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__users')) ->where($db->quoteName('activation') . ' = ' . $db->quote($activation)) ->where($db->quoteName('block') . ' = 1') ->where($db->quoteName('lastvisitDate') . ' = ' . $db->quote('0000-00-00 00:00:00')); $db->setQuery($query); $id = (int) $db->loadResult(); // Is it a valid user to activate? if ($id) { $user = JUser::getInstance((int) $id); $user->set('block', '0'); $user->set('activation', ''); // Time to take care of business.... store the user. if (!$user->save()) { JLog::add($user->getError(), JLog::WARNING, 'jerror'); return false; } } else { JLog::add(JText::_('JLIB_USER_ERROR_UNABLE_TO_FIND_USER'), JLog::WARNING, 'jerror'); return false; } return true; } /** * Returns userid if a user exists * * @param string $username The username to search on. * * @return integer The user id or 0 if not found. * * @since 11.1 */ public static function getUserId($username) { // Initialise some variables $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__users')) ->where($db->quoteName('username') . ' = ' . $db->quote($username)); $db->setQuery($query, 0, 1); return $db->loadResult(); } /** * Hashes a password using the current encryption. * * @param string $password The plaintext password to encrypt. * * @return string The encrypted password. * * @since 3.2.1 */ public static function hashPassword($password) { // JCrypt::hasStrongPasswordSupport() includes a fallback for us in the worst case JCrypt::hasStrongPasswordSupport(); return password_hash($password, PASSWORD_DEFAULT); } /** * Formats a password using the current encryption. If the user ID is given * and the hash does not fit the current hashing algorithm, it automatically * updates the hash. * * @param string $password The plaintext password to check. * @param string $hash The hash to verify against. * @param integer $user_id ID of the user if the password hash should be updated * * @return boolean True if the password and hash match, false otherwise * * @since 3.2.1 */ public static function verifyPassword($password, $hash, $user_id = 0) { $rehash = false; $match = false; // If we are using phpass if (strpos($hash, '$P$') === 0) { // Use PHPass's portable hashes with a cost of 10. $phpass = new PasswordHash(10, true); $match = $phpass->CheckPassword($password, $hash); $rehash = true; } elseif ($hash[0] == '$') { // JCrypt::hasStrongPasswordSupport() includes a fallback for us in the worst case JCrypt::hasStrongPasswordSupport(); $match = password_verify($password, $hash); // Uncomment this line if we actually move to bcrypt. $rehash = password_needs_rehash($hash, PASSWORD_DEFAULT); } elseif (substr($hash, 0, 8) == '{SHA256}') { // Check the password $parts = explode(':', $hash); $crypt = $parts[0]; $salt = @$parts[1]; $testcrypt = static::getCryptedPassword($password, $salt, 'sha256', true); $match = JCrypt::timingSafeCompare($hash, $testcrypt); $rehash = true; } else { // Check the password $parts = explode(':', $hash); $crypt = $parts[0]; $salt = @$parts[1]; $rehash = true; // Compile the hash to compare // If the salt is empty AND there is a ':' in the original hash, we must append ':' at the end $testcrypt = md5($password . $salt) . ($salt ? ':' . $salt : (strpos($hash, ':') !== false ? ':' : '')); $match = JCrypt::timingSafeCompare($hash, $testcrypt); } // If we have a match and rehash = true, rehash the password with the current algorithm. if ((int) $user_id > 0 && $match && $rehash) { $user = new JUser($user_id); $user->password = static::hashPassword($password); $user->save(); } return $match; } /** * Formats a password using the current encryption. * * @param string $plaintext The plaintext password to encrypt. * @param string $salt The salt to use to encrypt the password. [] * If not present, a new salt will be * generated. * @param string $encryption The kind of password encryption to use. * Defaults to md5-hex. * @param boolean $show_encrypt Some password systems prepend the kind of * encryption to the crypted password ({SHA}, * etc). Defaults to false. * * @return string The encrypted password. * * @since 11.1 * @deprecated 4.0 */ public static function getCryptedPassword($plaintext, $salt = '', $encryption = 'md5-hex', $show_encrypt = false) { // Get the salt to use. $salt = static::getSalt($encryption, $salt, $plaintext); // Encrypt the password. switch ($encryption) { case 'plain': return $plaintext; case 'sha': $encrypted = base64_encode(mhash(MHASH_SHA1, $plaintext)); return ($show_encrypt) ? '{SHA}' . $encrypted : $encrypted; case 'crypt': case 'crypt-des': case 'crypt-md5': case 'crypt-blowfish': return ($show_encrypt ? '{crypt}' : '') . crypt($plaintext, $salt); case 'md5-base64': $encrypted = base64_encode(mhash(MHASH_MD5, $plaintext)); return ($show_encrypt) ? '{MD5}' . $encrypted : $encrypted; case 'ssha': $encrypted = base64_encode(mhash(MHASH_SHA1, $plaintext . $salt) . $salt); return ($show_encrypt) ? '{SSHA}' . $encrypted : $encrypted; case 'smd5': $encrypted = base64_encode(mhash(MHASH_MD5, $plaintext . $salt) . $salt); return ($show_encrypt) ? '{SMD5}' . $encrypted : $encrypted; case 'aprmd5': $length = strlen($plaintext); $context = $plaintext . '$apr1$' . $salt; $binary = static::_bin(md5($plaintext . $salt . $plaintext)); for ($i = $length; $i > 0; $i -= 16) { $context .= substr($binary, 0, ($i > 16 ? 16 : $i)); } for ($i = $length; $i > 0; $i >>= 1) { $context .= ($i & 1) ? chr(0) : $plaintext[0]; } $binary = static::_bin(md5($context)); for ($i = 0; $i < 1000; $i++) { $new = ($i & 1) ? $plaintext : substr($binary, 0, 16); if ($i % 3) { $new .= $salt; } if ($i % 7) { $new .= $plaintext; } $new .= ($i & 1) ? substr($binary, 0, 16) : $plaintext; $binary = static::_bin(md5($new)); } $p = array(); for ($i = 0; $i < 5; $i++) { $k = $i + 6; $j = $i + 12; if ($j == 16) { $j = 5; } $p[] = static::_toAPRMD5((ord($binary[$i]) << 16) | (ord($binary[$k]) << 8) | (ord($binary[$j])), 5); } return '$apr1$' . $salt . '$' . implode('', $p) . static::_toAPRMD5(ord($binary[11]), 3); case 'sha256': $encrypted = ($salt) ? hash('sha256', $plaintext . $salt) . ':' . $salt : hash('sha256', $plaintext); return ($show_encrypt) ? '{SHA256}' . $encrypted : '{SHA256}' . $encrypted; case 'md5-hex': default: $encrypted = ($salt) ? md5($plaintext . $salt) : md5($plaintext); return ($show_encrypt) ? '{MD5}' . $encrypted : $encrypted; } } /** * Returns a salt for the appropriate kind of password encryption. * Optionally takes a seed and a plaintext password, to extract the seed * of an existing password, or for encryption types that use the plaintext * in the generation of the salt. * * @param string $encryption The kind of password encryption to use. * Defaults to md5-hex. * @param string $seed The seed to get the salt from (probably a * previously generated password). Defaults to * generating a new seed. * @param string $plaintext The plaintext password that we're generating * a salt for. Defaults to none. * * @return string The generated or extracted salt. * * @since 11.1 * @deprecated 4.0 */ public static function getSalt($encryption = 'md5-hex', $seed = '', $plaintext = '') { // Encrypt the password. switch ($encryption) { case 'crypt': case 'crypt-des': if ($seed) { return substr(preg_replace('|^{crypt}|i', '', $seed), 0, 2); } else { return substr(md5(mt_rand()), 0, 2); } break; case 'sha256': if ($seed) { return preg_replace('|^{sha256}|i', '', $seed); } else { return static::genRandomPassword(16); } break; case 'crypt-md5': if ($seed) { return substr(preg_replace('|^{crypt}|i', '', $seed), 0, 12); } else { return '$1$' . substr(md5(JCrypt::genRandomBytes()), 0, 8) . '$'; } break; case 'crypt-blowfish': if ($seed) { return substr(preg_replace('|^{crypt}|i', '', $seed), 0, 16); } else { return '$2$' . substr(md5(JCrypt::genRandomBytes()), 0, 12) . '$'; } break; case 'ssha': if ($seed) { return substr(preg_replace('|^{SSHA}|', '', $seed), -20); } else { return mhash_keygen_s2k(MHASH_SHA1, $plaintext, substr(pack('h*', md5(JCrypt::genRandomBytes())), 0, 8), 4); } break; case 'smd5': if ($seed) { return substr(preg_replace('|^{SMD5}|', '', $seed), -16); } else { return mhash_keygen_s2k(MHASH_MD5, $plaintext, substr(pack('h*', md5(JCrypt::genRandomBytes())), 0, 8), 4); } break; case 'aprmd5': /* 64 characters that are valid for APRMD5 passwords. */ $APRMD5 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; if ($seed) { return substr(preg_replace('/^\$apr1\$(.{8}).*/', '\\1', $seed), 0, 8); } else { $salt = ''; for ($i = 0; $i < 8; $i++) { $salt .= $APRMD5{rand(0, 63)}; } return $salt; } break; default: $salt = ''; if ($seed) { $salt = $seed; } return $salt; break; } } /** * Generate a random password * * @param integer $length Length of the password to generate * * @return string Random Password * * @since 11.1 */ public static function genRandomPassword($length = 8) { $salt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $base = strlen($salt); $makepass = ''; /* * Start with a cryptographic strength random string, then convert it to * a string with the numeric base of the salt. * Shift the base conversion on each character so the character * distribution is even, and randomize the start shift so it's not * predictable. */ $random = JCrypt::genRandomBytes($length + 1); $shift = ord($random[0]); for ($i = 1; $i <= $length; ++$i) { $makepass .= $salt[($shift + ord($random[$i])) % $base]; $shift += ord($random[$i]); } return $makepass; } /** * Converts to allowed 64 characters for APRMD5 passwords. * * @param string $value The value to convert. * @param integer $count The number of characters to convert. * * @return string $value converted to the 64 MD5 characters. * * @since 11.1 */ protected static function _toAPRMD5($value, $count) { /* 64 characters that are valid for APRMD5 passwords. */ $APRMD5 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; $aprmd5 = ''; $count = abs($count); while (--$count) { $aprmd5 .= $APRMD5[$value & 0x3f]; $value >>= 6; } return $aprmd5; } /** * Converts hexadecimal string to binary data. * * @param string $hex Hex data. * * @return string Binary data. * * @since 11.1 */ private static function _bin($hex) { $bin = ''; $length = strlen($hex); for ($i = 0; $i < $length; $i += 2) { $tmp = sscanf(substr($hex, $i, 2), '%x'); $bin .= chr(array_shift($tmp)); } return $bin; } /** * Method to remove a cookie record from the database and the browser * * @param string $userId User ID for this user * @param string $cookieName Series id (cookie name decoded) * * @return boolean True on success * * @since 3.2 * @deprecated 4.0 This is handled in the authentication plugin itself. The 'invalid' column in the db should be removed as well */ public static function invalidateCookie($userId, $cookieName) { $db = JFactory::getDbo(); $query = $db->getQuery(true); // Invalidate cookie in the database $query ->update($db->quoteName('#__user_keys')) ->set($db->quoteName('invalid') . ' = 1') ->where($db->quotename('user_id') . ' = ' . $db->quote($userId)); $db->setQuery($query)->execute(); // Destroy the cookie in the browser. $app = JFactory::getApplication(); $app->input->cookie->set($cookieName, false, time() - 42000, $app->get('cookie_path', '/'), $app->get('cookie_domain'), false, true); return true; } /** * Clear all expired tokens for all users. * * @return mixed Database query result * * @since 3.2 * @deprecated 4.0 This is handled in the authentication plugin itself */ public static function clearExpiredTokens() { $now = time(); $db = JFactory::getDbo(); $query = $db->getQuery(true) ->delete('#__user_keys') ->where($db->quoteName('time') . ' < ' . $db->quote($now)); return $db->setQuery($query)->execute(); } /** * Method to get the remember me cookie data * * @return mixed An array of information from an authentication cookie or false if there is no cookie * * @since 3.2 * @deprecated 4.0 This is handled in the authentication plugin itself */ public static function getRememberCookieData() { // Create the cookie name $cookieName = static::getShortHashedUserAgent(); // Fetch the cookie value $app = JFactory::getApplication(); $cookieValue = $app->input->cookie->get($cookieName); if (!empty($cookieValue)) { return explode('.', $cookieValue); } else { return false; } } /** * Method to get a hashed user agent string that does not include browser version. * Used when frequent version changes cause problems. * * @return string A hashed user agent string with version replaced by 'abcd' * * @since 3.2 */ public static function getShortHashedUserAgent() { $ua = JFactory::getApplication()->client; $uaString = $ua->userAgent; $browserVersion = $ua->browserVersion; $uaShort = str_replace($browserVersion, 'abcd', $uaString); return md5(JUri::base() . $uaShort); } } PK���\�����(libraries/joomla/user/wrapper/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage User * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JUserHelper * * @package Joomla.Platform * @subpackage User * @since 3.4 */ class JUserWrapperHelper { /** * Helper wrapper method for addUserToGroup * * @param integer $userId The id of the user. * @param integer $groupId The id of the group. * * @return boolean True on success * * @see JUserHelper::addUserToGroup() * @since 3.4 * @throws RuntimeException */ public function addUserToGroup($userId, $groupId) { return JUserHelper::addUserToGroup($userId, $groupId); } /** * Helper wrapper method for getUserGroups * * @param integer $userId The id of the user. * * @return array List of groups * * @see JUserHelper::addUserToGroup() * @since 3.4 */ public function getUserGroups($userId) { return JUserHelper::getUserGroups($userId); } /** * Helper wrapper method for removeUserFromGroup * * @param integer $userId The id of the user. * @param integer $groupId The id of the group. * * @return boolean True on success * * @see JUserHelper::removeUserFromGroup() * @since 3.4 */ public function removeUserFromGroup($userId, $groupId) { return JUserHelper::removeUserFromGroup($userId, $groupId); } /** * Helper wrapper method for setUserGroups * * @param integer $userId The id of the user. * @param array $groups An array of group ids to put the user in. * * @return boolean True on success * * @see JUserHelper::setUserGroups() * @since 3.4 */ public function setUserGroups($userId, $groups) { return JUserHelper::setUserGroups($userId, $groups); } /** * Helper wrapper method for getProfile * * @param integer $userId The id of the user. * * @return object * * @see JUserHelper::getProfile() * @since 3.4 */ public function getProfile($userId = 0) { return JUserHelper::getProfile($userId); } /** * Helper wrapper method for activateUser * * @param string $activation Activation string * * @return boolean True on success * * @see JUserHelper::activateUser() * @since 3.4 */ public function activateUser($activation) { return JUserHelper::activateUser($activation); } /** * Helper wrapper method for getUserId * * @param string $username The username to search on. * * @return integer The user id or 0 if not found. * * @see JUserHelper::getUserId() * @since 3.4 */ public function getUserId($username) { return JUserHelper::getUserId($username); } /** * Helper wrapper method for hashPassword * * @param string $password The plaintext password to encrypt. * * @return string The encrypted password. * * @see JUserHelper::hashPassword() * @since 3.4 */ public function hashPassword($password) { return JUserHelper::hashPassword($password); } /** * Helper wrapper method for verifyPassword * * @param string $password The plaintext password to check. * @param string $hash The hash to verify against. * @param integer $user_id ID of the user if the password hash should be updated * * @return boolean True if the password and hash match, false otherwise * * @see JUserHelper::verifyPassword() * @since 3.4 */ public function verifyPassword($password, $hash, $user_id = 0) { return JUserHelper::verifyPassword($password, $hash, $user_id); } /** * Helper wrapper method for getCryptedPassword * * @param string $plaintext The plaintext password to encrypt. * @param string $salt The salt to use to encrypt the password. [] * If not present, a new salt will be * generated. * @param string $encryption The kind of password encryption to use. * Defaults to md5-hex. * @param boolean $show_encrypt Some password systems prepend the kind of * encryption to the crypted password ({SHA}, * etc). Defaults to false. * * @return string The encrypted password. * * @see JUserHelper::getCryptedPassword() * @since 3.4 * @deprecated 4.0 */ public function getCryptedPassword($plaintext, $salt = '', $encryption = 'md5-hex', $show_encrypt = false) { return JUserHelper::getCryptedPassword($plaintext, $salt, $encryption, $show_encrypt); } /** * Helper wrapper method for getSalt * * @param string $encryption The kind of password encryption to use. * Defaults to md5-hex. * @param string $seed The seed to get the salt from (probably a * previously generated password). Defaults to * generating a new seed. * @param string $plaintext The plaintext password that we're generating * a salt for. Defaults to none. * * @return string The generated or extracted salt. * * @see JUserHelper::getSalt() * @since 3.4 * @deprecated 4.0 */ public function getSalt($encryption = 'md5-hex', $seed = '', $plaintext = '') { return JUserHelper::getSalt($encryption, $seed, $plaintext); } /** * Helper wrapper method for genRandomPassword * * @param integer $length Length of the password to generate * * @return string Random Password * * @see JUserHelper::genRandomPassword() * @since 3.4 */ public function genRandomPassword($length = 8) { return JUserHelper::genRandomPassword($length); } /** * Helper wrapper method for invalidateCookie * * @param string $userId User ID for this user * @param string $cookieName Series id (cookie name decoded) * * @return boolean True on success * * @see JUserHelper::invalidateCookie() * @since 3.4 * @deprecated 4.0 */ public function invalidateCookie($userId, $cookieName) { return JUserHelper::invalidateCookie($userId, $cookieName); } /** * Helper wrapper method for clearExpiredTokens * * @return mixed Database query result * * @see JUserHelper::clearExpiredTokens() * @since 3.4 * @deprecated 4.0 */ public function clearExpiredTokens() { return JUserHelper::clearExpiredTokens(); } /** * Helper wrapper method for getRememberCookieData * * @return mixed An array of information from an authentication cookie or false if there is no cookie * * @see JUserHelper::getRememberCookieData() * @since 3.4 * @deprecated 4.0 */ public function getRememberCookieData() { return JUserHelper::getRememberCookieData(); } /** * Helper wrapper method for getShortHashedUserAgent * * @return string A hashed user agent string with version replaced by 'abcd' * * @see JUserHelper::getShortHashedUserAgent() * @since 3.4 */ public function getShortHashedUserAgent() { return JUserHelper::getShortHashedUserAgent(); } } PK���\8�`b'b'(libraries/joomla/user/authentication.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage User * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Authentication class, provides an interface for the Joomla authentication system * * @since 11.1 */ class JAuthentication extends JObject { // Shared success status /** * This is the status code returned when the authentication is success (permit login) * @const STATUS_SUCCESS successful response * @since 11.2 */ const STATUS_SUCCESS = 1; // These are for authentication purposes (username and password is valid) /** * Status to indicate cancellation of authentication (unused) * @const STATUS_CANCEL cancelled request (unused) * @since 11.2 */ const STATUS_CANCEL = 2; /** * This is the status code returned when the authentication failed (prevent login if no success) * @const STATUS_FAILURE failed request * @since 11.2 */ const STATUS_FAILURE = 4; // These are for authorisation purposes (can the user login) /** * This is the status code returned when the account has expired (prevent login) * @const STATUS_EXPIRED an expired account (will prevent login) * @since 11.2 */ const STATUS_EXPIRED = 8; /** * This is the status code returned when the account has been denied (prevent login) * @const STATUS_DENIED denied request (will prevent login) * @since 11.2 */ const STATUS_DENIED = 16; /** * This is the status code returned when the account doesn't exist (not an error) * @const STATUS_UNKNOWN unknown account (won't permit or prevent login) * @since 11.2 */ const STATUS_UNKNOWN = 32; /** * An array of Observer objects to notify * * @var array * @since 12.1 */ protected $observers = array(); /** * The state of the observable object * * @var mixed * @since 12.1 */ protected $state = null; /** * A multi dimensional array of [function][] = key for observers * * @var array * @since 12.1 */ protected $methods = array(); /** * @var JAuthentication JAuthentication instances container. * @since 11.3 */ protected static $instance; /** * Constructor * * @since 11.1 */ public function __construct() { $isLoaded = JPluginHelper::importPlugin('authentication'); if (!$isLoaded) { JLog::add(JText::_('JLIB_USER_ERROR_AUTHENTICATION_LIBRARIES'), JLog::WARNING, 'jerror'); } } /** * Returns the global authentication object, only creating it * if it doesn't already exist. * * @return JAuthentication The global JAuthentication object * * @since 11.1 */ public static function getInstance() { if (empty(self::$instance)) { self::$instance = new JAuthentication; } return self::$instance; } /** * Get the state of the JAuthentication object * * @return mixed The state of the object. * * @since 11.1 */ public function getState() { return $this->state; } /** * Attach an observer object * * @param object $observer An observer object to attach * * @return void * * @since 11.1 */ public function attach($observer) { if (is_array($observer)) { if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler'])) { return; } // Make sure we haven't already attached this array as an observer foreach ($this->observers as $check) { if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler']) { return; } } $this->observers[] = $observer; end($this->observers); $methods = array($observer['event']); } else { if (!($observer instanceof JAuthentication)) { return; } // Make sure we haven't already attached this object as an observer $class = get_class($observer); foreach ($this->observers as $check) { if ($check instanceof $class) { return; } } $this->observers[] = $observer; $methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin')); } $key = key($this->observers); foreach ($methods as $method) { $method = strtolower($method); if (!isset($this->methods[$method])) { $this->methods[$method] = array(); } $this->methods[$method][] = $key; } } /** * Detach an observer object * * @param object $observer An observer object to detach. * * @return boolean True if the observer object was detached. * * @since 11.1 */ public function detach($observer) { $retval = false; $key = array_search($observer, $this->observers); if ($key !== false) { unset($this->observers[$key]); $retval = true; foreach ($this->methods as &$method) { $k = array_search($key, $method); if ($k !== false) { unset($method[$k]); } } } return $retval; } /** * Finds out if a set of login credentials are valid by asking all observing * objects to run their respective authentication routines. * * @param array $credentials Array holding the user credentials. * @param array $options Array holding user options. * * @return JAuthenticationResponse Response object with status variable filled in for last plugin or first successful plugin. * * @see JAuthenticationResponse * @since 11.1 */ public function authenticate($credentials, $options = array()) { // Get plugins $plugins = JPluginHelper::getPlugin('authentication'); // Create authentication response $response = new JAuthenticationResponse; /* * Loop through the plugins and check if the credentials can be used to authenticate * the user * * Any errors raised in the plugin should be returned via the JAuthenticationResponse * and handled appropriately. */ foreach ($plugins as $plugin) { $className = 'plg' . $plugin->type . $plugin->name; if (class_exists($className)) { $plugin = new $className($this, (array) $plugin); } else { // Bail here if the plugin can't be created JLog::add(JText::sprintf('JLIB_USER_ERROR_AUTHENTICATION_FAILED_LOAD_PLUGIN', $className), JLog::WARNING, 'jerror'); continue; } // Try to authenticate $plugin->onUserAuthenticate($credentials, $options, $response); // If authentication is successful break out of the loop if ($response->status === self::STATUS_SUCCESS) { if (empty($response->type)) { $response->type = isset($plugin->_name) ? $plugin->_name : $plugin->name; } break; } } if (empty($response->username)) { $response->username = $credentials['username']; } if (empty($response->fullname)) { $response->fullname = $credentials['username']; } if (empty($response->password) && isset($credentials['password'])) { $response->password = $credentials['password']; } return $response; } /** * Authorises that a particular user should be able to login * * @param JAuthenticationResponse $response response including username of the user to authorise * @param array $options list of options * * @return array[JAuthenticationResponse] results of authorisation * * @since 11.2 */ public static function authorise($response, $options = array()) { // Get plugins in case they haven't been imported already JPluginHelper::importPlugin('user'); JPluginHelper::importPlugin('authentication'); $dispatcher = JEventDispatcher::getInstance(); $results = $dispatcher->trigger('onUserAuthorisation', array($response, $options)); return $results; } } /** * Authentication response class, provides an object for storing user and error details * * @since 11.1 */ class JAuthenticationResponse { /** * Response status (see status codes) * * @var string * @since 11.1 */ public $status = JAuthentication::STATUS_FAILURE; /** * The type of authentication that was successful * * @var string * @since 11.1 */ public $type = ''; /** * The error message * * @var string * @since 11.1 */ public $error_message = ''; /** * Any UTF-8 string that the End User wants to use as a username. * * @var string * @since 11.1 */ public $username = ''; /** * Any UTF-8 string that the End User wants to use as a password. * * @var string * @since 11.1 */ public $password = ''; /** * The email address of the End User as specified in section 3.4.1 of [RFC2822] * * @var string * @since 11.1 */ public $email = ''; /** * UTF-8 string free text representation of the End User's full name. * * @var string * @since 11.1 * */ public $fullname = ''; /** * The End User's date of birth as YYYY-MM-DD. Any values whose representation uses * fewer than the specified number of digits should be zero-padded. The length of this * value MUST always be 10. If the End User user does not want to reveal any particular * component of this value, it MUST be set to zero. * * For instance, if a End User wants to specify that his date of birth is in 1980, but * not the month or day, the value returned SHALL be "1980-00-00". * * @var string * @since 11.1 */ public $birthdate = ''; /** * The End User's gender, "M" for male, "F" for female. * * @var string * @since 11.1 */ public $gender = ''; /** * UTF-8 string free text that SHOULD conform to the End User's country's postal system. * * @var string * @since 11.1 */ public $postcode = ''; /** * The End User's country of residence as specified by ISO3166. * * @var string * @since 11.1 */ public $country = ''; /** * End User's preferred language as specified by ISO639. * * @var string * @since 11.1 */ public $language = ''; /** * ASCII string from TimeZone database * * @var string * @since 11.1 */ public $timezone = ''; } PK���\^Dh-��!libraries/joomla/access/rules.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Access * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JAccessRules class. * * @since 11.4 */ class JAccessRules { /** * A named array. * * @var array * @since 11.1 */ protected $data = array(); /** * Constructor. * * The input array must be in the form: array('action' => array(-42 => true, 3 => true, 4 => false)) * or an equivalent JSON encoded string, or an object where properties are arrays. * * @param mixed $input A JSON format string (probably from the database) or a nested array. * * @since 11.1 */ public function __construct($input = '') { // Convert in input to an array. if (is_string($input)) { $input = json_decode($input, true); } elseif (is_object($input)) { $input = (array) $input; } if (is_array($input)) { // Top level keys represent the actions. foreach ($input as $action => $identities) { $this->mergeAction($action, $identities); } } } /** * Get the data for the action. * * @return array A named array of JAccessRule objects. * * @since 11.1 */ public function getData() { return $this->data; } /** * Method to merge a collection of JAccessRules. * * @param mixed $input JAccessRule or array of JAccessRules * * @return void * * @since 11.1 */ public function mergeCollection($input) { // Check if the input is an array. if (is_array($input)) { foreach ($input as $actions) { $this->merge($actions); } } } /** * Method to merge actions with this object. * * @param mixed $actions JAccessRule object, an array of actions or a JSON string array of actions. * * @return void * * @since 11.1 */ public function merge($actions) { if (is_string($actions)) { $actions = json_decode($actions, true); } if (is_array($actions)) { foreach ($actions as $action => $identities) { $this->mergeAction($action, $identities); } } elseif ($actions instanceof JAccessRules) { $data = $actions->getData(); foreach ($data as $name => $identities) { $this->mergeAction($name, $identities); } } } /** * Merges an array of identities for an action. * * @param string $action The name of the action. * @param array $identities An array of identities * * @return void * * @since 11.1 */ public function mergeAction($action, $identities) { if (isset($this->data[$action])) { // If exists, merge the action. $this->data[$action]->mergeIdentities($identities); } else { // If new, add the action. $this->data[$action] = new JAccessRule($identities); } } /** * Checks that an action can be performed by an identity. * * The identity is an integer where +ve represents a user group, * and -ve represents a user. * * @param string $action The name of the action. * @param mixed $identity An integer representing the identity, or an array of identities * * @return mixed Object or null if there is no information about the action. * * @since 11.1 */ public function allow($action, $identity) { // Check we have information about this action. if (isset($this->data[$action])) { return $this->data[$action]->allow($identity); } return null; } /** * Get the allowed actions for an identity. * * @param mixed $identity An integer representing the identity or an array of identities * * @return JObject Allowed actions for the identity or identities * * @since 11.1 */ public function getAllowed($identity) { // Sweep for the allowed actions. $allowed = new JObject; foreach ($this->data as $name => &$action) { if ($action->allow($identity)) { $allowed->set($name, true); } } return $allowed; } /** * Magic method to convert the object to JSON string representation. * * @return string JSON representation of the actions array * * @since 11.1 */ public function __toString() { $temp = array(); foreach ($this->data as $name => $rule) { // Convert the action to JSON, then back into an array otherwise // re-encoding will quote the JSON for the identities in the action. $temp[$name] = json_decode((string) $rule); } return json_encode($temp); } } PK���\����;�;"libraries/joomla/access/access.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Access * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.utilities.arrayhelper'); /** * Class that handles all access authorisation routines. * * @since 11.1 */ class JAccess { /** * Array of view levels * * @var array * @since 11.1 */ protected static $viewLevels = array(); /** * Array of rules for the asset * * @var array * @since 11.1 */ protected static $assetRules = array(); /** * Array of user groups. * * @var array * @since 11.1 */ protected static $userGroups = array(); /** * Array of user group paths. * * @var array * @since 11.1 */ protected static $userGroupPaths = array(); /** * Array of cached groups by user. * * @var array * @since 11.1 */ protected static $groupsByUser = array(); /** * Method for clearing static caches. * * @return void * * @since 11.3 */ public static function clearStatics() { self::$viewLevels = array(); self::$assetRules = array(); self::$userGroups = array(); self::$userGroupPaths = array(); self::$groupsByUser = array(); } /** * Method to check if a user is authorised to perform an action, optionally on an asset. * * @param integer $userId Id of the user for which to check authorisation. * @param string $action The name of the action to authorise. * @param mixed $asset Integer asset id or the name of the asset as a string. Defaults to the global asset node. * * @return boolean True if authorised. * * @since 11.1 */ public static function check($userId, $action, $asset = null) { // Sanitise inputs. $userId = (int) $userId; $action = strtolower(preg_replace('#[\s\-]+#', '.', trim($action))); $asset = strtolower(preg_replace('#[\s\-]+#', '.', trim($asset))); // Default to the root asset node. if (empty($asset)) { $db = JFactory::getDbo(); $assets = JTable::getInstance('Asset', 'JTable', array('dbo' => $db)); $asset = $assets->getRootId(); } // Get the rules for the asset recursively to root if not already retrieved. if (empty(self::$assetRules[$asset])) { self::$assetRules[$asset] = self::getAssetRules($asset, true); } // Get all groups against which the user is mapped. $identities = self::getGroupsByUser($userId); array_unshift($identities, $userId * -1); return self::$assetRules[$asset]->allow($action, $identities); } /** * Method to check if a group is authorised to perform an action, optionally on an asset. * * @param integer $groupId The path to the group for which to check authorisation. * @param string $action The name of the action to authorise. * @param mixed $asset Integer asset id or the name of the asset as a string. Defaults to the global asset node. * * @return boolean True if authorised. * * @since 11.1 */ public static function checkGroup($groupId, $action, $asset = null) { // Sanitize inputs. $groupId = (int) $groupId; $action = strtolower(preg_replace('#[\s\-]+#', '.', trim($action))); $asset = strtolower(preg_replace('#[\s\-]+#', '.', trim($asset))); // Get group path for group $groupPath = self::getGroupPath($groupId); // Default to the root asset node. if (empty($asset)) { $db = JFactory::getDbo(); $assets = JTable::getInstance('Asset', 'JTable', array('dbo' => $db)); $asset = $assets->getRootId(); } // Get the rules for the asset recursively to root if not already retrieved. if (empty(self::$assetRules[$asset])) { self::$assetRules[$asset] = self::getAssetRules($asset, true); } return self::$assetRules[$asset]->allow($action, $groupPath); } /** * Gets the parent groups that a leaf group belongs to in its branch back to the root of the tree * (including the leaf group id). * * @param mixed $groupId An integer or array of integers representing the identities to check. * * @return mixed True if allowed, false for an explicit deny, null for an implicit deny. * * @since 11.1 */ protected static function getGroupPath($groupId) { // Preload all groups if (empty(self::$userGroups)) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('parent.id, parent.lft, parent.rgt') ->from('#__usergroups AS parent') ->order('parent.lft'); $db->setQuery($query); self::$userGroups = $db->loadObjectList('id'); } // Make sure groupId is valid if (!array_key_exists($groupId, self::$userGroups)) { return array(); } // Get parent groups and leaf group if (!isset(self::$userGroupPaths[$groupId])) { self::$userGroupPaths[$groupId] = array(); foreach (self::$userGroups as $group) { if ($group->lft <= self::$userGroups[$groupId]->lft && $group->rgt >= self::$userGroups[$groupId]->rgt) { self::$userGroupPaths[$groupId][] = $group->id; } } } return self::$userGroupPaths[$groupId]; } /** * Method to return the JAccessRules object for an asset. The returned object can optionally hold * only the rules explicitly set for the asset or the summation of all inherited rules from * parent assets and explicit rules. * * @param mixed $asset Integer asset id or the name of the asset as a string. * @param boolean $recursive True to return the rules object with inherited rules. * * @return JAccessRules JAccessRules object for the asset. * * @since 11.1 */ public static function getAssetRules($asset, $recursive = false) { // Get the database connection object. $db = JFactory::getDbo(); // Build the database query to get the rules for the asset. $query = $db->getQuery(true) ->select($recursive ? 'b.rules' : 'a.rules') ->from('#__assets AS a'); // SQLsrv change $query->group($recursive ? 'b.id, b.rules, b.lft' : 'a.id, a.rules, a.lft'); // If the asset identifier is numeric assume it is a primary key, else lookup by name. if (is_numeric($asset)) { $query->where('(a.id = ' . (int) $asset . ')'); } else { $query->where('(a.name = ' . $db->quote($asset) . ')'); } // If we want the rules cascading up to the global asset node we need a self-join. if ($recursive) { $query->join('LEFT', '#__assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgt') ->order('b.lft'); } // Execute the query and load the rules from the result. $db->setQuery($query); $result = $db->loadColumn(); // Get the root even if the asset is not found and in recursive mode if (empty($result)) { $db = JFactory::getDbo(); $assets = JTable::getInstance('Asset', 'JTable', array('dbo' => $db)); $rootId = $assets->getRootId(); $query->clear() ->select('rules') ->from('#__assets') ->where('id = ' . $db->quote($rootId)); $db->setQuery($query); $result = $db->loadResult(); $result = array($result); } // Instantiate and return the JAccessRules object for the asset rules. $rules = new JAccessRules; $rules->mergeCollection($result); return $rules; } /** * Method to return a list of user groups mapped to a user. The returned list can optionally hold * only the groups explicitly mapped to the user or all groups both explicitly mapped and inherited * by the user. * * @param integer $userId Id of the user for which to get the list of groups. * @param boolean $recursive True to include inherited user groups. * * @return array List of user group ids to which the user is mapped. * * @since 11.1 */ public static function getGroupsByUser($userId, $recursive = true) { // Creates a simple unique string for each parameter combination: $storeId = $userId . ':' . (int) $recursive; if (!isset(self::$groupsByUser[$storeId])) { // TODO: Uncouple this from JComponentHelper and allow for a configuration setting or value injection. if (class_exists('JComponentHelper')) { $guestUsergroup = JComponentHelper::getParams('com_users')->get('guest_usergroup', 1); } else { $guestUsergroup = 1; } // Guest user (if only the actually assigned group is requested) if (empty($userId) && !$recursive) { $result = array($guestUsergroup); } // Registered user and guest if all groups are requested else { $db = JFactory::getDbo(); // Build the database query to get the rules for the asset. $query = $db->getQuery(true) ->select($recursive ? 'b.id' : 'a.id'); if (empty($userId)) { $query->from('#__usergroups AS a') ->where('a.id = ' . (int) $guestUsergroup); } else { $query->from('#__user_usergroup_map AS map') ->where('map.user_id = ' . (int) $userId) ->join('LEFT', '#__usergroups AS a ON a.id = map.group_id'); } // If we want the rules cascading up to the global asset node we need a self-join. if ($recursive) { $query->join('LEFT', '#__usergroups AS b ON b.lft <= a.lft AND b.rgt >= a.rgt'); } // Execute the query and load the rules from the result. $db->setQuery($query); $result = $db->loadColumn(); // Clean up any NULL or duplicate values, just in case JArrayHelper::toInteger($result); if (empty($result)) { $result = array('1'); } else { $result = array_unique($result); } } self::$groupsByUser[$storeId] = $result; } return self::$groupsByUser[$storeId]; } /** * Method to return a list of user Ids contained in a Group * * @param integer $groupId The group Id * @param boolean $recursive Recursively include all child groups (optional) * * @return array * * @since 11.1 * @todo This method should move somewhere else */ public static function getUsersByGroup($groupId, $recursive = false) { // Get a database object. $db = JFactory::getDbo(); $test = $recursive ? '>=' : '='; // First find the users contained in the group $query = $db->getQuery(true) ->select('DISTINCT(user_id)') ->from('#__usergroups as ug1') ->join('INNER', '#__usergroups AS ug2 ON ug2.lft' . $test . 'ug1.lft AND ug1.rgt' . $test . 'ug2.rgt') ->join('INNER', '#__user_usergroup_map AS m ON ug2.id=m.group_id') ->where('ug1.id=' . $db->quote($groupId)); $db->setQuery($query); $result = $db->loadColumn(); // Clean up any NULL values, just in case JArrayHelper::toInteger($result); return $result; } /** * Method to return a list of view levels for which the user is authorised. * * @param integer $userId Id of the user for which to get the list of authorised view levels. * * @return array List of view levels for which the user is authorised. * * @since 11.1 */ public static function getAuthorisedViewLevels($userId) { // Get all groups that the user is mapped to recursively. $groups = self::getGroupsByUser($userId); // Only load the view levels once. if (empty(self::$viewLevels)) { // Get a database object. $db = JFactory::getDbo(); // Build the base query. $query = $db->getQuery(true) ->select('id, rules') ->from($db->quoteName('#__viewlevels')); // Set the query for execution. $db->setQuery($query); // Build the view levels array. foreach ($db->loadAssocList() as $level) { self::$viewLevels[$level['id']] = (array) json_decode($level['rules']); } } // Initialise the authorised array. $authorised = array(1); // Find the authorised levels. foreach (self::$viewLevels as $level => $rule) { foreach ($rule as $id) { if (($id < 0) && (($id * -1) == $userId)) { $authorised[] = $level; break; } // Check to see if the group is mapped to the level. elseif (($id >= 0) && in_array($id, $groups)) { $authorised[] = $level; break; } } } return $authorised; } /** * Method to return a list of actions for which permissions can be set given a component and section. * * @param string $component The component from which to retrieve the actions. * @param string $section The name of the section within the component from which to retrieve the actions. * * @return array List of actions available for the given component and section. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) Use JAccess::getActionsFromFile or JAccess::getActionsFromData instead. * @codeCoverageIgnore */ public static function getActions($component, $section = 'component') { JLog::add(__METHOD__ . ' is deprecated. Use JAccess::getActionsFromFile or JAccess::getActionsFromData instead.', JLog::WARNING, 'deprecated'); $actions = self::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/' . $component . '/access.xml', "/access/section[@name='" . $section . "']/" ); if (empty($actions)) { return array(); } else { return $actions; } } /** * Method to return a list of actions from a file for which permissions can be set. * * @param string $file The path to the XML file. * @param string $xpath An optional xpath to search for the fields. * * @return boolean|array False if case of error or the list of actions available. * * @since 12.1 */ public static function getActionsFromFile($file, $xpath = "/access/section[@name='component']/") { if (!is_file($file) || !is_readable($file)) { // If unable to find the file return false. return false; } else { // Else return the actions from the xml. $xml = simplexml_load_file($file); return self::getActionsFromData($xml, $xpath); } } /** * Method to return a list of actions from a string or from an xml for which permissions can be set. * * @param string|SimpleXMLElement $data The XML string or an XML element. * @param string $xpath An optional xpath to search for the fields. * * @return boolean|array False if case of error or the list of actions available. * * @since 12.1 */ public static function getActionsFromData($data, $xpath = "/access/section[@name='component']/") { // If the data to load isn't already an XML element or string return false. if ((!($data instanceof SimpleXMLElement)) && (!is_string($data))) { return false; } // Attempt to load the XML if a string. if (is_string($data)) { try { $data = new SimpleXMLElement($data); } catch (Exception $e) { return false; } // Make sure the XML loaded correctly. if (!$data) { return false; } } // Initialise the actions array $actions = array(); // Get the elements from the xpath $elements = $data->xpath($xpath . 'action[@name][@title][@description]'); // If there some elements, analyse them if (!empty($elements)) { foreach ($elements as $action) { // Add the action to the actions array $actions[] = (object) array( 'name' => (string) $action['name'], 'title' => (string) $action['title'], 'description' => (string) $action['description'] ); } } // Finally return the actions array return $actions; } } PK���\�ԝ�W W libraries/joomla/access/rule.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Access * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JAccessRule class. * * @since 11.4 */ class JAccessRule { /** * A named array * * @var array * @since 11.1 */ protected $data = array(); /** * Constructor. * * The input array must be in the form: array(-42 => true, 3 => true, 4 => false) * or an equivalent JSON encoded string. * * @param mixed $identities A JSON format string (probably from the database) or a named array. * * @since 11.1 */ public function __construct($identities) { // Convert string input to an array. if (is_string($identities)) { $identities = json_decode($identities, true); } $this->mergeIdentities($identities); } /** * Get the data for the action. * * @return array A named array * * @since 11.1 */ public function getData() { return $this->data; } /** * Merges the identities * * @param mixed $identities An integer or array of integers representing the identities to check. * * @return void * * @since 11.1 */ public function mergeIdentities($identities) { if ($identities instanceof JAccessRule) { $identities = $identities->getData(); } if (is_array($identities)) { foreach ($identities as $identity => $allow) { $this->mergeIdentity($identity, $allow); } } } /** * Merges the values for an identity. * * @param integer $identity The identity. * @param boolean $allow The value for the identity (true == allow, false == deny). * * @return void * * @since 11.1 */ public function mergeIdentity($identity, $allow) { $identity = (int) $identity; $allow = (int) ((boolean) $allow); // Check that the identity exists. if (isset($this->data[$identity])) { // Explicit deny always wins a merge. if ($this->data[$identity] !== 0) { $this->data[$identity] = $allow; } } else { $this->data[$identity] = $allow; } } /** * Checks that this action can be performed by an identity. * * The identity is an integer where +ve represents a user group, * and -ve represents a user. * * @param mixed $identities An integer or array of integers representing the identities to check. * * @return mixed True if allowed, false for an explicit deny, null for an implicit deny. * * @since 11.1 */ public function allow($identities) { // Implicit deny by default. $result = null; // Check that the inputs are valid. if (!empty($identities)) { if (!is_array($identities)) { $identities = array($identities); } foreach ($identities as $identity) { // Technically the identity just needs to be unique. $identity = (int) $identity; // Check if the identity is known. if (isset($this->data[$identity])) { $result = (boolean) $this->data[$identity]; // An explicit deny wins. if ($result === false) { break; } } } } return $result; } /** * Convert this object into a JSON encoded string. * * @return string JSON encoded string * * @since 11.1 */ public function __toString() { return json_encode($this->data); } } PK���\bG�b��*libraries/joomla/access/wrapper/access.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Access * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JAccess * * @package Joomla.Platform * @subpackage User * @since 3.4 */ class JAccessWrapperAccess { /** * Helper wrapper method for addUserToGroup * * @return void * * @see JAccess::clearStatics * @since 3.4 */ public function clearStatics() { return JAccess::clearStatics(); } /** * Helper wrapper method for check * * @param integer $userId Id of the user for which to check authorisation. * @param string $action The name of the action to authorise. * @param mixed $asset Integer asset id or the name of the asset as a string. Defaults to the global asset node. * * @return boolean True if authorised. * * @see JAccess::check() * @since 3.4 */ public function check($userId, $action, $asset = null) { return JAccess::check($userId, $action, $asset); } /** * Helper wrapper method for checkGroup * * @param integer $groupId The path to the group for which to check authorisation. * @param string $action The name of the action to authorise. * @param mixed $asset Integer asset id or the name of the asset as a string. Defaults to the global asset node. * * @return boolean True if authorised. * * @see JAccess::checkGroup() * @since 3.4 */ public function checkGroup($groupId, $action, $asset = null) { return JAccess::checkGroup($groupId, $action, $asset); } /** * Helper wrapper method for getAssetRules * * @param mixed $asset Integer asset id or the name of the asset as a string. * @param boolean $recursive True to return the rules object with inherited rules. * * @return JAccessRules JAccessRules object for the asset. * * @see JAccess::getAssetRules * @since 3.4 */ public function getAssetRules($asset, $recursive = false) { return JAccess::getAssetRules($asset, $recursive); } /** * Helper wrapper method for getGroupsByUser * * @param integer $userId Id of the user for which to get the list of groups. * @param boolean $recursive True to include inherited user groups. * * @return array List of user group ids to which the user is mapped. * * @see JAccess::getGroupsByUser() * @since 3.4 */ public function getGroupsByUser($userId, $recursive = true) { return JAccess::getGroupsByUser($userId, $recursive); } /** * Helper wrapper method for getUsersByGroup * * @param integer $groupId The group Id * @param boolean $recursive Recursively include all child groups (optional) * * @return array * * @see JAccess::getUsersByGroup() * @since 3.4 */ public function getUsersByGroup($groupId, $recursive = false) { return JAccess::getUsersByGroup($groupId, $recursive); } /** * Helper wrapper method for getAuthorisedViewLevels * * @param integer $userId Id of the user for which to get the list of authorised view levels. * * @return array List of view levels for which the user is authorised. * * @see JAccess::getAuthorisedViewLevels() * @since 3.4 */ public function getAuthorisedViewLevels($userId) { return JAccess::getAuthorisedViewLevels($userId); } /** * Helper wrapper method for getActions * * @param string $component The component from which to retrieve the actions. * @param string $section The name of the section within the component from which to retrieve the actions. * * @return array List of actions available for the given component and section. * * @see JAccess::getActions() * @since 3.4 */ public function getActions($component, $section = 'component') { return JAccess::getActions($component, $section); } /** * Helper wrapper method for getActionsFromFile * * @param string $file The path to the XML file. * @param string $xpath An optional xpath to search for the fields. * * @return boolean|array False if case of error or the list of actions available. * * @see JAccess::getActionsFromFile() * @since 3.4 */ public function getActionsFromFile($file, $xpath = '/access/section[@name=\'component\']/') { return JAccess::getActionsFromFile($file, $xpath); } /** * Helper wrapper method for getActionsFromData * * @param string|SimpleXMLElement $data The XML string or an XML element. * @param string $xpath An optional xpath to search for the fields. * * @return boolean|array False if case of error or the list of actions available. * * @see JAccess::getActionsFromData() * @since 3.4 */ public function getActionsFromData($data, $xpath = '/access/section[@name=\'component\']/') { return JAccess::getActionsFromData($data, $xpath); } } PK���\`�2=r-r-$libraries/joomla/mediawiki/users.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MediaWiki API Users class for the Joomla Platform. * * @since 12.3 */ class JMediawikiUsers extends JMediawikiObject { /** * Method to login and get authentication tokens. * * @param string $lgname User Name. * @param string $lgpassword Password. * @param string $lgdomain Domain (optional). * * @return object * * @since 12.3 */ public function login($lgname, $lgpassword, $lgdomain = null) { // Build the request path. $path = '?action=login&lgname=' . $lgname . '&lgpassword=' . $lgpassword; if (isset($lgdomain)) { $path .= '&lgdomain=' . $lgdomain; } // Send the request. $response = $this->client->post($this->fetchUrl($path), null); // Request path with login token. $path = '?action=login&lgname=' . $lgname . '&lgpassword=' . $lgpassword . '&lgtoken=' . $this->validateResponse($response)->login['token']; if (isset($lgdomain)) { $path .= '&lgdomain=' . $lgdomain; } // Set the session cookies returned. $headers = (array) $this->options->get('headers'); $headers['Cookie'] = !empty($headers['Cookie']) ? empty($headers['Cookie']) : ''; $headers['Cookie'] = $headers['Cookie'] . $response->headers['Set-Cookie']; $this->options->set('headers', $headers); // Send the request again with the token. $response = $this->client->post($this->fetchUrl($path), null); $response_body = $this->validateResponse($response); $headers = (array) $this->options->get('headers'); $cookie_prefix = $response_body->login['cookieprefix']; $cookie = $cookie_prefix . 'UserID=' . $response_body->login['lguserid'] . '; ' . $cookie_prefix . 'UserName=' . $response_body->login['lgusername']; $headers['Cookie'] = $headers['Cookie'] . '; ' . $response->headers['Set-Cookie'] . '; ' . $cookie; $this->options->set('headers', $headers); return $this->validateResponse($response); } /** * Method to logout and clear session data. * * @return object * * @since 12.3 */ public function logout() { // Build the request path. $path = '?action=login'; // @TODO clear internal data as well // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get user information. * * @param array $ususers A list of users to obtain the same information for. * @param array $usprop What pieces of information to include. * * @return object * * @since 12.3 */ public function getUserInfo(array $ususers, array $usprop = null) { // Build the request path. $path = '?action=query&list=users'; // Append users to the request. $path .= '&ususers=' . $this->buildParameter($ususers); if (isset($usprop)) { $path .= '&usprop' . $this->buildParameter($usprop); } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get current user information. * * @param array $uiprop What pieces of information to include. * * @return object * * @since 12.3 */ public function getCurrentUserInfo(array $uiprop = null) { // Build the request path. $path = '?action=query&meta=userinfo'; if (isset($uiprop)) { $path .= '&uiprop' . $this->buildParameter($uiprop); } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get user contributions. * * @param string $ucuser The users to retrieve contributions for. * @param string $ucuserprefix Retrieve contibutions for all users whose names begin with this value. * @param integer $uclimit The users to retrieve contributions for. * @param string $ucstart The start timestamp to return from. * @param string $ucend The end timestamp to return to. * @param boolean $uccontinue When more results are available, use this to continue. * @param string $ucdir In which direction to enumerate. * @param array $ucnamespace Only list contributions in these namespaces. * @param array $ucprop Include additional pieces of information. * @param array $ucshow Show only items that meet this criteria. * @param string $uctag Only list revisions tagged with this tag. * @param string $uctoponly Only list changes which are the latest revision * * @return object * * @since 12.3 */ public function getUserContribs($ucuser = null, $ucuserprefix = null, $uclimit = null, $ucstart = null, $ucend = null, $uccontinue = null, $ucdir = null, array $ucnamespace = null, array $ucprop = null, array $ucshow = null, $uctag = null, $uctoponly = null) { // Build the request path. $path = '?action=query&list=usercontribs'; if (isset($ucuser)) { $path .= '&ucuser=' . $ucuser; } if (isset($ucuserprefix)) { $path .= '&ucuserprefix=' . $ucuserprefix; } if (isset($uclimit)) { $path .= '&uclimit=' . $uclimit; } if (isset($ucstart)) { $path .= '&ucstart=' . $ucstart; } if (isset($ucend)) { $path .= '&ucend=' . $ucend; } if ($uccontinue) { $path .= '&uccontinue='; } if (isset($ucdir)) { $path .= '&ucdir=' . $ucdir; } if (isset($ucnamespace)) { $path .= '&ucnamespace=' . $this->buildParameter($ucnamespace); } if (isset($ucprop)) { $path .= '&ucprop=' . $this->buildParameter($ucprop); } if (isset($ucshow)) { $path .= '&ucshow=' . $this->buildParameter($ucshow); } if (isset($uctag)) { $path .= '&uctag=' . $uctag; } if (isset($uctoponly)) { $path .= '&uctoponly=' . $uctoponly; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to block a user. * * @param string $user Username, IP address or IP range you want to block. * @param string $expiry Relative expiry time, Default: never. * @param string $reason Reason for block (optional). * @param boolean $anononly Block anonymous users only. * @param boolean $nocreate Prevent account creation. * @param boolean $autoblock Automatically block the last used IP address, and any subsequent IP addresses they try to login from. * @param boolean $noemail Prevent user from sending e-mail through the wiki. * @param boolean $hidename Hide the username from the block log. * @param boolean $allowusertalk Allow the user to edit their own talk page. * @param boolean $reblock If the user is already blocked, overwrite the existing block. * @param boolean $watchuser Watch the user/IP's user and talk pages. * * @return object * * @since 12.3 */ public function blockUser($user, $expiry = null, $reason = null, $anononly = null, $nocreate = null, $autoblock = null, $noemail = null, $hidename = null, $allowusertalk = null, $reblock = null, $watchuser = null) { // Get the token. $token = $this->getToken($user, 'block'); // Build the request path. $path = '?action=unblock'; // Build the request data. $data = array( 'user' => $user, 'token' => $token, 'expiry' => $expiry, 'reason' => $reason, 'anononly' => $anononly, 'nocreate' => $nocreate, 'autoblock' => $autoblock, 'noemail' => $noemail, 'hidename' => $hidename, 'allowusetalk' => $allowusertalk, 'reblock' => $reblock, 'watchuser' => $watchuser ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to unblock a user. * * @param string $user Username, IP address or IP range you want to unblock. * @param string $reason Reason for unblock (optional). * * @return object * * @since 12.3 */ public function unBlockUserByName($user, $reason = null) { // Get the token. $token = $this->getToken($user, 'unblock'); // Build the request path. $path = '?action=unblock'; // Build the request data. $data = array( 'user' => $user, 'token' => $token, 'reason' => $reason, ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to unblock a user. * * @param int $id Username, IP address or IP range you want to unblock. * @param string $reason Reason for unblock (optional). * * @return object * * @since 12.3 */ public function unBlockUserById($id, $reason = null) { // Get the token. $token = $this->getToken($id, 'unblock'); // Build the request path. $path = '?action=unblock'; // Build the request data. // TODO: $data doesn't seem to be used! $data = array( 'id' => $id, 'token' => $token, 'reason' => $reason, ); // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to assign a user to a group. * * @param string $username User name. * @param array $add Add the user to these groups. * @param array $remove Remove the user from these groups. * @param string $reason Reason for the change. * * @return object * * @since 12.3 */ public function assignGroup($username, $add = null, $remove = null, $reason = null) { // Get the token. $token = $this->getToken($username, 'unblock'); // Build the request path. $path = '?action=userrights'; // Build the request data. $data = array( 'username' => $username, 'token' => $token, 'add' => $add, 'remove' => $remove, 'reason' => $reason ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to email a user. * * @param string $target User to send email to. * @param string $subject Subject header. * @param string $text Mail body. * @param boolean $ccme Send a copy of this mail to me. * * @return object * * @since 12.3 */ public function emailUser($target, $subject = null, $text = null, $ccme = null) { // Get the token. $token = $this->getToken($target, 'emailuser'); // Build the request path. $path = '?action=emailuser'; // Build the request data. $data = array( 'target' => $target, 'token' => $token, 'subject' => $subject, 'text' => $text, 'ccme' => $ccme ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to get access token. * * @param string $user The User to get token. * @param string $intoken The type of token. * * @return object * * @since 12.3 */ public function getToken($user, $intoken) { // Build the request path. $path = '?action=query&prop=info&intoken=' . $intoken . '&titles=User:' . $user; // Send the request. $response = $this->client->post($this->fetchUrl($path), null); return (string) $this->validateResponse($response)->query->pages->page[$intoken . 'token']; } } PK���\mBU[[%libraries/joomla/mediawiki/search.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MediaWiki API Search class for the Joomla Platform. * * @since 12.3 */ class JMediawikiSearch extends JMediawikiObject { /** * Method to perform a full text search. * * @param string $srsearch Search for all page titles (or content) that has this value. * @param array $srnamespace The namespace(s) to enumerate. * @param string $srwhat Search inside the text or titles. * @param array $srinfo What metadata to return. * @param array $srprop What properties to return. * @param boolean $srredirects Include redirect pages in the search. * @param integer $sroffest Use this value to continue paging. * @param integer $srlimit How many total pages to return. * * @return object * * @since 12.3 */ public function search($srsearch, array $srnamespace = null, $srwhat = null, array $srinfo = null, array $srprop = null, $srredirects = null, $sroffest = null, $srlimit = null) { // Build the request. $path = '?action=query&list=search'; if (isset($srsearch)) { $path .= '&srsearch=' . $srsearch; } if (isset($srnamespace)) { $path .= '&srnamespace=' . $this->buildParameter($srnamespace); } if (isset($srwhat)) { $path .= '&srwhat=' . $srwhat; } if (isset($srinfo)) { $path .= '&srinfo=' . $this->buildParameter($srinfo); } if (isset($srprop)) { $path .= '&srprop=' . $this->buildParameter($srprop); } if ($srredirects) { $path .= '&srredirects='; } if (isset($sroffest)) { $path .= '&sroffest=' . $sroffest; } if (isset($srlimit)) { $path .= '&srlimit=' . $srlimit; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to search the wiki using opensearch protocol. * * @param string $search Search string. * @param integer $limit Maximum amount of results to return. * @param array $namespace Namespaces to search. * @param string $suggest Do nothing if $wgEnableOpenSearchSuggest is false. * @param string $format Output format. * * @return object * * @since 12.3 */ public function openSearch($search, $limit = null, array $namespace = null, $suggest = null, $format = null) { // Build the request. $path = '?action=query&list=search'; if (isset($search)) { $path .= '&search=' . $search; } if (isset($limit)) { $path .= '&limit=' . $limit; } if (isset($namespace)) { $path .= '&namespace=' . $this->buildParameter($namespace); } if (isset($suggest)) { $path .= '&suggest=' . $suggest; } if (isset($format)) { $path .= '&format=' . $format; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } } PK���\nm�\��#libraries/joomla/mediawiki/http.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * HTTP client class for connecting to a MediaWiki instance. * * @since 12.3 */ class JMediawikiHttp extends JHttp { /** * Constructor. * * @param Registry $options Client options object. * @param JHttpTransport $transport The HTTP transport object. * * @since 12.3 */ public function __construct(Registry $options = null, JHttpTransport $transport = null) { // Override the JHttp contructor to use JHttpTransportStream. $this->options = isset($options) ? $options : new Registry; $this->transport = isset($transport) ? $transport : new JHttpTransportStream($this->options); // Make sure the user agent string is defined. $this->options->def('api.useragent', 'JMediawiki/1.0'); // Set the default timeout to 120 seconds. $this->options->def('api.timeout', 120); } /** * Method to send the GET command to the server. * * @param string $url Path to the resource. * @param array $headers An array of name-value pairs to include in the header of the request. * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 12.3 */ public function get($url, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('api.timeout')) { $timeout = $this->options->get('api.timeout'); } return $this->transport->request('GET', new JUri($url), null, $headers, $timeout, $this->options->get('api.useragent')); } /** * Method to send the POST command to the server. * * @param string $url Path to the resource. * @param mixed $data Either an associative array or a string to be sent with the request. * @param array $headers An array of name-value pairs to include in the header of the request * @param integer $timeout Read timeout in seconds. * * @return JHttpResponse * * @since 12.3 */ public function post($url, $data, array $headers = null, $timeout = null) { // Look for headers set in the options. $temp = (array) $this->options->get('headers'); foreach ($temp as $key => $val) { if (!isset($headers[$key])) { $headers[$key] = $val; } } // Look for timeout set in the options. if ($timeout === null && $this->options->exists('api.timeout')) { $timeout = $this->options->get('api.timeout'); } return $this->transport->request('POST', new JUri($url), $data, $headers, $timeout, $this->options->get('api.useragent')); } } PK���\�o!�N N %libraries/joomla/mediawiki/object.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * MediaWiki API object class for the Joomla Platform. * * @since 12.3 */ abstract class JMediawikiObject { /** * @var Registry Options for the MediaWiki object. * @since 12.3 */ protected $options; /** * @var JMediawikiHttp The HTTP client object to use in sending HTTP requests. * @since 12.3 */ protected $client; /** * Constructor. * * @param Registry $options Mediawiki options object. * @param JMediawikiHttp $client The HTTP client object. * * @since 12.3 */ public function __construct(Registry $options = null, JMediawikiHttp $client = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JMediawikiHttp($this->options); } /** * Method to build and return a full request URL for the request. * * @param string $path URL to inflect * * @return string The request URL. * * @since 12.3 */ protected function fetchUrl($path) { // Append the path with output format $path .= '&format=xml'; $uri = new JUri($this->options->get('api.url') . '/api.php' . $path); if ($this->options->get('api.username', false)) { $uri->setUser($this->options->get('api.username')); } if ($this->options->get('api.password', false)) { $uri->setPass($this->options->get('api.password')); } return (string) $uri; } /** * Method to build request parameters from a string array. * * @param array $params string array that contains the parameters * * @return string request parameter * * @since 12.3 */ public function buildParameter(array $params) { $path = ''; foreach ($params as $param) { $path .= $param; if (next($params) == true) { $path .= '|'; } } return $path; } /** * Method to validate response for errors * * @param JHttpresponse $response reponse from the mediawiki server * * @return Object * * @since 12.3 * * @throws DomainException */ public function validateResponse($response) { $xml = simplexml_load_string($response->body); if (isset($xml->warnings)) { throw new DomainException($xml->warnings->info); } if (isset($xml->error)) { throw new DomainException($xml->error['info']); } return $xml; } } PK���\�����$libraries/joomla/mediawiki/sites.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MediaWiki API Sites class for the Joomla Platform. * * @since 12.3 */ class JMediawikiSites extends JMediawikiObject { /** * Method to get site information. * * @param array $siprop The sysinfo properties to get. * @param string $sifilteriw Only local or only non local entries to return. * @param boolean $sishowalldb List all database servers. * @param boolean $sinumberingroup List the number of users in usergroups. * @param array $siinlanguagecode Language code for localized languages. * * @return object * * @since 12.3 */ public function getSiteInfo(array $siprop = null, $sifilteriw = null, $sishowalldb = false, $sinumberingroup = false, array $siinlanguagecode = null) { // Build the request. $path = '?action=query&meta=siteinfo'; if (isset($siprop)) { $path .= '&siprop=' . $this->buildParameter($siprop); } if (isset($sifilteriw)) { $path .= '&sifilteriw=' . $sifilteriw; } if ($sishowalldb) { $path .= '&sishowalldb='; } if ($sinumberingroup) { $path .= '&sinumberingroup='; } if (isset($siinlanguagecode)) { $path .= '&siinlanguagecode=' . $this->buildParameter($siinlanguagecode); } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get events from logs. * * @param array $leprop List of properties to get. * @param string $letype Filter log actions to only this type. * @param string $leaction Filter log actions to only this type. * @param string $letitle Filter entries to those related to a page. * @param string $leprefix Filter entries that start with this prefix. * @param string $letag Filter entries with tag. * @param string $leuser Filter entries made by the given user. * @param string $lestart Starting timestamp. * @param string $leend Ending timestamp. * @param string $ledir Direction of enumeration. * @param integer $lelimit Event limit to return. * * @return object * * @since 12.3 */ public function getEvents(array $leprop = null, $letype = null, $leaction = null, $letitle = null, $leprefix = null, $letag = null, $leuser = null, $lestart = null, $leend = null, $ledir = null, $lelimit = null) { // Build the request $path = '?action=query&list=logevents'; if (isset($leprop)) { $path .= '&leprop=' . $this->buildParameter($leprop); } if (isset($letype)) { $path .= '&letype=' . $letype; } if (isset($leaction)) { $path .= '&leaction=' . $leaction; } if (isset($letitle)) { $path .= '&letitle=' . $letitle; } if (isset($leprefix)) { $path .= '&leprefix=' . $leprefix; } if (isset($letag)) { $path .= '&letag=' . $letag; } if (isset($leuser)) { $path .= '&leuser=' . $leuser; } if (isset($lestart)) { $path .= '&lestart=' . $lestart; } if (isset($leend)) { $path .= '&leend=' . $leend; } if (isset($ledir)) { $path .= '&ledir=' . $ledir; } if (isset($lelimit)) { $path .= '&lelimit=' . $lelimit; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get recent changes on a site. * * @param string $rcstart Starting timestamp. * @param string $rcend Ending timestamp. * @param string $rcdir Direction of enumeration. * @param array $rcnamespace Filter changes to only this namespace(s). * @param string $rcuser Filter changes by this user. * @param string $rcexcludeuser Filter changes to exclude changes by this user. * @param string $rctag Filter changes by this tag. * @param array $rcprop Filter log actions to only this type. * @param array $rctoken Which token to obtain for each change. * @param array $rcshow Filter changes by this criteria. * @param string $rclimit Changes limit to return. * @param string $rctype Filter event by type of changes. * @param string $rctoponly Filter changes which are latest revision. * * @return object * * @since 12.3 */ public function getRecentChanges($rcstart = null, $rcend = null, $rcdir = null, array $rcnamespace = null, $rcuser = null, $rcexcludeuser = null, $rctag = null, array $rcprop = null, array $rctoken = null, array $rcshow = null, $rclimit = null, $rctype = null, $rctoponly = null) { // Build the request. $path = '?action=query&list=recentchanges'; if (isset($rcstart)) { $path .= '&rcstart=' . $rcstart; } if (isset($rcend)) { $path .= '&rcend=' . $rcend; } if (isset($rcdir)) { $path .= '&rcdir=' . $rcdir; } if (isset($rcnamespace)) { $path .= '&rcnamespaces=' . $this->buildParameter($rcnamespace); } if (isset($rcuser)) { $path .= '&rcuser=' . $rcuser; } if (isset($rcexcludeuser)) { $path .= '&rcexcludeuser=' . $rcexcludeuser; } if (isset($rctag)) { $path .= '&rctag=' . $rctag; } if (isset($rcprop)) { $path .= '&rcprop=' . $this->buildParameter($rcprop); } if (isset($rctoken)) { $path .= '&rctoken=' . $this->buildParameter($rctoken); } if (isset($rcshow)) { $path .= '&rcshow=' . $this->buildParameter($rcshow); } if (isset($rclimit)) { $path .= '&rclimit=' . $rclimit; } if (isset($rctype)) { $path .= '&rctype=' . $rctype; } if (isset($rctoponly)) { $path .= '&rctoponly=' . $rctoponly; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get protected titles on a site. * * @param array $ptnamespace Only list titles in this namespace. * @param array $ptlevel Only list titles with these protection level. * @param integer $ptlimit Limit of pages to return. * @param string $ptdir Direction of enumeration. * @param string $ptstart Starting timestamp. * @param string $ptend Ending timestamp. * @param array $ptprop List of properties to get. * * @return object * * @since 12.3 */ public function getProtectedTitles(array $ptnamespace = null, array $ptlevel = null, $ptlimit = null, $ptdir = null, $ptstart = null, $ptend = null, array $ptprop = null) { // Build the request. $path = '?action=query&list=protectedtitles'; if (isset($ptnamespace)) { $path .= '&ptnamespace=' . $this->buildParameter($ptnamespace); } if (isset($ptlevel)) { $path .= '&ptlevel=' . $this->buildParameter($ptlevel); } if (isset($ptlimit)) { $path .= '&ptlimit=' . $ptlimit; } if (isset($ptdir)) { $path .= '&ptdir=' . $ptdir; } if (isset($ptstart)) { $path .= '&ptstart=' . $ptstart; } if (isset($ptend)) { $path .= '&ptend=' . $ptend; } if (isset($ptprop)) { $path .= '&ptprop=' . $this->buildParameter($ptprop); } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } } PK���\rL�^%libraries/joomla/mediawiki/images.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MediaWiki API Images class for the Joomla Platform. * * @since 12.3 */ class JMediawikiImages extends JMediawikiObject { /** * Method to get all images contained on the given page(s). * * @param array $titles Page titles to retrieve images. * @param integer $imagelimit How many images to return. * @param boolean $imagecontinue When more results are available, use this to continue. * @param integer $imimages Only list these images. * @param string $imdir The direction in which to list. * * @return object * * @since 12.3 */ public function getImages(array $titles, $imagelimit = null, $imagecontinue = null, $imimages = null, $imdir = null) { // Build the request. $path = '?action=query&prop=images'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if (isset($imagelimit)) { $path .= '&imagelimit=' . $imagelimit; } if ($imagecontinue) { $path .= '&imagecontinue='; } if (isset($imimages)) { $path .= '&imimages=' . $imimages; } if (isset($imdir)) { $path .= '&imdir=' . $imdir; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get all images contained on the given page(s). * * @param array $titles Page titles to retrieve links. * * @return object * * @since 12.3 */ public function getImagesUsed(array $titles) { // Build the request. $path = '?action=query&generator=images&prop=info'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get all image information and upload history. * * @param array $liprop What image information to get. * @param integer $lilimit How many image revisions to return. * @param string $listart Timestamp to start listing from. * @param string $liend Timestamp to stop listing at. * @param integer $liurlwidth URL to an image scaled to this width will be returned.. * @param integer $liurlheight URL to an image scaled to this height will be returned. * @param string $limetadataversion Version of metadata to use. * @param string $liurlparam A handler specific parameter string. * @param boolean $licontinue When more results are available, use this to continue. * * @return object * * @since 12.3 */ public function getImageInfo(array $liprop = null, $lilimit = null, $listart = null, $liend = null, $liurlwidth = null, $liurlheight = null, $limetadataversion = null, $liurlparam = null, $licontinue = null) { // Build the request. $path = '?action=query&prop=imageinfo'; if (isset($liprop)) { $path .= '&liprop=' . $this->buildParameter($liprop); } if (isset($lilimit)) { $path .= '&lilimit=' . $lilimit; } if (isset($listart)) { $path .= '&listart=' . $listart; } if (isset($liend)) { $path .= '&liend=' . $liend; } if (isset($liurlwidth)) { $path .= '&liurlwidth=' . $liurlwidth; } if (isset($liurlheight)) { $path .= '&liurlheight=' . $liurlheight; } if (isset($limetadataversion)) { $path .= '&limetadataversion=' . $limetadataversion; } if (isset($liurlparam)) { $path .= '&liurlparam=' . $liurlparam; } if ($licontinue) { $path .= '&alcontinue='; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to enumerate all images. * * @param string $aifrom The image title to start enumerating from. * @param string $aito The image title to stop enumerating at. * @param string $aiprefix Search for all image titles that begin with this value. * @param integer $aiminsize Limit to images with at least this many bytes. * @param integer $aimaxsize Limit to images with at most this many bytes. * @param integer $ailimit How many images in total to return. * @param string $aidir The direction in which to list. * @param string $aisha1 SHA1 hash of image. * @param string $aisha1base36 SHA1 hash of image in base 36. * @param array $aiprop What image information to get. * @param string $aimime What MIME type to search for. * * @return object * * @since 12.3 */ public function enumerateImages($aifrom = null, $aito = null, $aiprefix = null, $aiminsize = null, $aimaxsize = null, $ailimit = null, $aidir = null, $aisha1 = null, $aisha1base36 = null, array $aiprop = null, $aimime = null) { // Build the request. $path = '?action=query&list=allimages'; if (isset($aifrom)) { $path .= '&aifrom=' . $aifrom; } if (isset($aito)) { $path .= '&aito=' . $aito; } if (isset($aiprefix)) { $path .= '&aiprefix=' . $aiprefix; } if (isset($aiminsize)) { $path .= '&aiminsize=' . $aiminsize; } if (isset($aimaxsize)) { $path .= '&aimaxsize=' . $aimaxsize; } if (isset($ailimit)) { $path .= '&ailimit=' . $ailimit; } if (isset($aidir)) { $path .= '&aidir=' . $aidir; } if (isset($aisha1)) { $path .= '&aisha1=' . $aisha1; } if (isset($aisha1base36)) { $path .= '&$aisha1base36=' . $aisha1base36; } if (isset($aiprop)) { $path .= '&aiprop=' . $this->buildParameter($aiprop); } if (isset($aimime)) { $path .= '&aimime=' . $aimime; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } } PK���\��1PP(libraries/joomla/mediawiki/mediawiki.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform class for interacting with a Mediawiki server instance. * * @property-read JMediawikiSites $sites MediaWiki API object for sites. * @property-read JMediawikiPages $pages MediaWiki API object for pages. * @property-read JMediawikiUsers $users MediaWiki API object for users. * @property-read JMediawikiLinks $links MediaWiki API object for links. * @property-read JMediawikiCategories $categories MediaWiki API object for categories. * @property-read JMediawikiImages $images MediaWiki API object for images. * @property-read JMediawikiSearch $search MediaWiki API object for search. * * @since 12.3 */ class JMediawiki { /** * @var Registry Options for the MediaWiki object. * @since 12.1 */ protected $options; /** * @var JMediawikiHttp The HTTP client object to use in sending HTTP requests. * @since 12.3 */ protected $client; /** * @var JMediawikiSites MediaWiki API object for Site. * @since 12.3 */ protected $sites; /** * @var JMediawikiPages MediaWiki API object for pages. * @since 12.1 */ protected $pages; /** * @var JMediawikiUsers MediaWiki API object for users. * @since 12.3 */ protected $users; /** * @var JMediawikiLinks MediaWiki API object for links. * @since 12.3 */ protected $links; /** * @var JMediawikiCategories MediaWiki API object for categories. * @since 12.3 */ protected $categories; /** * @var JMediawikiImages MediaWiki API object for images. * @since 12.3 */ protected $images; /** * @var JMediawikiSearch MediaWiki API object for search. * @since 12.1 */ protected $search; /** * Constructor. * * @param Registry $options MediaWiki options object. * @param JMediawikiHttp $client The HTTP client object. * * @since 12.3 */ public function __construct(Registry $options = null, JMediawikiHttp $client = null) { $this->options = isset($options) ? $options : new Registry; $this->client = isset($client) ? $client : new JMediawikiHttp($this->options); } /** * Magic method to lazily create API objects * * @param string $name Name of property to retrieve * * @return JMediaWikiObject MediaWiki API object (users, reviews, etc). * * @since 12.3 * @throws InvalidArgumentException */ public function __get($name) { $name = strtolower($name); $class = 'JMediawiki' . ucfirst($name); $accessible = array( 'categories', 'images', 'links', 'pages', 'search', 'sites', 'users' ); if (class_exists($class) && in_array($name, $accessible)) { if (!isset($this->$name)) { $this->$name = new $class($this->options, $this->client); } return $this->$name; } throw new InvalidArgumentException(sprintf('Property %s is not accessible.', $name)); } /** * Get an option from the JMediawiki instance. * * @param string $key The name of the option to get. * * @return mixed The option value. * * @since 12.3 */ public function getOption($key) { return $this->options->get($key); } /** * Set an option for the JMediawiki instance. * * @param string $key The name of the option to set. * @param mixed $value The option value to set. * * @return JMediawiki This object for method chaining. * * @since 12.3 */ public function setOption($key, $value) { $this->options->set($key, $value); return $this; } } PK���\�g 2%2%)libraries/joomla/mediawiki/categories.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MediaWiki API Categories class for the Joomla Platform. * * @since 12.3 */ class JMediawikiCategories extends JMediawikiObject { /** * Method to list all categories the page(s) belong to. * * @param array $titles Page titles to retrieve categories. * @param array $clprop List of additional properties to get. * @param array $clshow Type of categories to show. * @param integer $cllimit Number of categories to return. * @param boolean $clcontinue Continue when more results are available. * @param array $clcategories Only list these categories. * @param string $cldir Direction of listing. * * @return object * * @since 12.1 */ public function getCategories(array $titles, array $clprop = null, array $clshow = null, $cllimit = null, $clcontinue = false, array $clcategories = null, $cldir = null) { // Build the request. $path = '?action=query&prop=categories'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if (isset($clprop)) { $path .= '&clprop=' . $this->buildParameter($clprop); } if (isset($clshow)) { $path .= '&$clshow=' . $this->buildParameter($clshow); } if (isset($cllimit)) { $path .= '&cllimit=' . $cllimit; } if ($clcontinue) { $path .= '&clcontinue='; } if (isset($clcategories)) { $path .= '&clcategories=' . $this->buildParameter($clcategories); } if (isset($cldir)) { $path .= '&cldir=' . $cldir; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get information about all categories used. * * @param array $titles Page titles to retrieve categories. * * @return object * * @since 12.3 */ public function getCategoriesUsed(array $titles) { // Build the request $path = '?action=query&generator=categories&prop=info'; // Append titles to the request $path .= '&titles=' . $this->buildParameter($titles); // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get information about the given categories. * * @param array $titles Page titles to retrieve categories. * @param boolean $clcontinue Continue when more results are available. * * @return object * * @since 12.3 */ public function getCategoriesInfo(array $titles, $clcontinue = false) { // Build the request. $path = '?action=query&prop=categoryinfo'; // Append titles to the request $path .= '&titles=' . $this->buildParameter($titles); if ($clcontinue) { $path .= '&clcontinue='; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get information about the pages within a category * * @param string $cmtitle The category title, must contain 'Category:' prefix, cannot be used together with $cmpageid * @param string $cmpageid The category's page ID, cannot be used together with $cmtitle * @param string $cmlimit Maximum number of pages to retrieve * @param array $cmprop Array of properties to retrieve * @param array $cmnamespace Namespaces to retrieve pages from * @param array $cmtype Array of category members to include, ignored if $cmsort is set to 'timestamp' * @param string $cmstart Timestamp to start listing from, only used if $cmsort is set to 'timestamp' * @param string $cmend Timestamp to end listing at, only used if $cmsort is set to 'timestamp' * @param string $cmstartsortkey Hexadecimal key to start listing from, only used if $cmsort is set to 'sortkey' * @param string $cmendsortkey Hexadecimal key to end listing at, only used if $cmsort is set to 'sortkey' * @param string $cmstartsortkeyprefix Hexadecimal key prefix to start listing from, only used if $cmsort is set to 'sortkey', * overrides $cmstartsortkey * @param string $cmendsortkeyprefix Hexadecimal key prefix to end listing before, only used if $cmsort is set to 'sortkey', * overrides $cmendsortkey * @param string $cmsort Property to sort by * @param string $cmdir Direction to sort in * @param string $cmcontinue Used to continue a previous request * * @return object * * @since 3.2.2 (CMS) * @throws RuntimeException */ public function getCategoryMembers($cmtitle = null, $cmpageid = null, $cmlimit = null, array $cmprop = null, array $cmnamespace = null, array $cmtype = null, $cmstart = null, $cmend = null, $cmstartsortkey = null, $cmendsortkey = null, $cmstartsortkeyprefix = null, $cmendsortkeyprefix = null, $cmsort = null, $cmdir = null, $cmcontinue = null) { // Build the request. $path = '?action=query&list=categorymembers'; // Make sure both $cmtitle and $cmpageid are not set if (isset($cmtitle) && isset($cmpageid)) { throw new RuntimeException('Both the $cmtitle and $cmpageid parameters cannot be set, please only use one of the two.'); } if (isset($cmtitle)) { // Verify that the Category: prefix exists if (strpos($cmtitle, 'Category:') !== 0) { throw new RuntimeException('The $cmtitle parameter must include the Category: prefix.'); } $path .= '&cmtitle=' . $cmtitle; } if (isset($cmpageid)) { $path .= '&cmpageid=' . $cmpageid; } if (isset($cmlimit)) { $path .= '&cmlimit=' . $cmlimit; } if (isset($cmprop)) { $path .= '&cmprop=' . $this->buildParameter($cmprop); } if (isset($cmnamespace)) { $path .= '&cmnamespace=' . $this->buildParameter($cmnamespace); } if (isset($cmtype)) { $path .= '&cmtype=' . $this->buildParameter($cmtype); } if (isset($cmstart)) { $path .= '&cmstart=' . $cmstart; } if (isset($cmend)) { $path .= '&cmend=' . $cmend; } if (isset($cmstartsortkey)) { $path .= '&cmstartsortkey=' . $cmstartsortkey; } if (isset($cmendsortkey)) { $path .= '&cmendsortkey=' . $cmendsortkey; } if (isset($cmstartsortkeyprefix)) { $path .= '&cmstartsortkeyprefix=' . $cmstartsortkeyprefix; } if (isset($cmendsortkeyprefix)) { $path .= '&cmendsortkeyprefix=' . $cmendsortkeyprefix; } if (isset($cmsort)) { $path .= '&cmsort=' . $cmsort; } if (isset($cmdir)) { $path .= '&cmdir=' . $cmdir; } if (isset($cmcontinue)) { $path .= '&cmcontinue=' . $cmcontinue; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to enumerate all categories. * * @param string $acfrom The category to start enumerating from. * @param string $acto The category to stop enumerating at. * @param string $acprefix Search for all category titles that begin with this value. * @param string $acdir Direction to sort in. * @param integer $acmin Minimum number of category members. * @param integer $acmax Maximum number of category members. * @param integer $aclimit How many categories to return. * @param array $acprop Which properties to get. * * @return object * * @since 12.3 */ public function enumerateCategories($acfrom = null, $acto = null, $acprefix = null, $acdir = null, $acmin = null, $acmax = null, $aclimit = null, array $acprop = null) { // Build the request. $path = '?action=query&list=allcategories'; if (isset($acfrom)) { $path .= '&acfrom=' . $acfrom; } if (isset($acto)) { $path .= '&acto=' . $acto; } if (isset($acprefix)) { $path .= '&acprefix=' . $acprefix; } if (isset($acdir)) { $path .= '&acdir=' . $acdir; } if (isset($acfrom)) { $path .= '&acfrom=' . $acfrom; } if (isset($acmin)) { $path .= '&acmin=' . $acmin; } if (isset($acmax)) { $path .= '&acmax=' . $acmax; } if (isset($aclimit)) { $path .= '&aclimit=' . $aclimit; } if (isset($acprop)) { $path .= '&acprop=' . $this->buildParameter($acprop); } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to list change tags. * * @param array $tgprop List of properties to get. * @param string $tglimit The maximum number of tags to limit. * * @return object * * @since 12.3 */ public function getChangeTags(array $tgprop = null, $tglimit = null) { // Build the request. $path = '?action=query&list=tags'; if (isset($tgprop)) { $path .= '&tgprop=' . $this->buildParameter($tgprop); } if (isset($tglimit)) { $path .= '&tglimit=' . $tglimit; } // @TODO add support for $tgcontinue // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } } PK���\�/yu�A�A$libraries/joomla/mediawiki/pages.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MediaWiki API Pages class for the Joomla Platform. * * @since 12.3 */ class JMediawikiPages extends JMediawikiObject { /** * Method to edit a page. * * @param string $title Page title. * @param int $section Section number. * @param string $sectiontitle The title for a new section. * @param string $text Page content. * @param string $summary Title of the page you want to delete. * * @return object * * @since 12.3 */ public function editPage($title, $section = null, $sectiontitle = null, $text = null, $summary = null) { // Get the token. $token = $this->getToken($title, 'edit'); // Build the request path. $path = '?action=edit'; // Build the request data. $data = array( 'title' => $title, 'token' => $token, 'section' => $section, 'sectiontitle' => $section, 'text' => $text, 'summary' => $summary ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to delete a page. * * @param string $title Title of the page you want to delete. * @param string $reason Reason for the deletion. * @param string $watchlist Unconditionally add or remove the page from your watchlis. * @param string $oldimage The name of the old image to delete. * * @return object * * @since 12.3 */ public function deletePageByName($title, $reason = null, $watchlist = null, $oldimage = null) { // Get the token. $token = $this->getToken($title, 'delete'); // Build the request path. $path = '?action=delete'; // Build the request data. $data = array( 'title' => $title, 'token' => $token, 'reason' => $reason, 'watchlist' => $watchlist, 'oldimage' => $oldimage ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to delete a page. * * @param string $pageid Page ID of the page you want to delete. * @param string $reason Reason for the deletion. * @param string $watchlist Unconditionally add or remove the page from your watchlis. * @param string $oldimage The name of the old image to delete. * * @return object * * @since 12.3 */ public function deletePageById($pageid, $reason = null, $watchlist = null, $oldimage = null) { // Get the token. $token = $this->getToken($pageid, 'delete'); // Build the request path. $path = '?action=delete'; // Build the request data. $data = array( 'pageid' => $pageid, 'token' => $token, 'reason' => $reason, 'watchlist' => $watchlist, 'oldimage' => $oldimage ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to restore certain revisions of a deleted page. * * @param string $title Title of the page you want to restore. * @param string $reason Reason for restoring (optional). * @param string $timestamp Timestamps of the revisions to restore. * @param string $watchlist Unconditionally add or remove the page from your watchlist. * * @return object * * @since 12.3 */ public function undeletePage($title, $reason = null, $timestamp = null, $watchlist = null) { // Get the token. $token = $this->getToken($title, 'undelete'); // Build the request path. $path = '?action=undelete'; // Build the request data. $data = array( 'title' => $title, 'token' => $token, 'reason' => $reason, 'timestamp' => $timestamp, 'watchlist' => $watchlist, ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to move a page. * * @param string $from Title of the page you want to move. * @param string $to Title you want to rename the page to. * @param string $reason Reason for the move (optional). * @param string $movetalk Move the talk page, if it exists. * @param string $movesubpages Move subpages, if applicable. * @param boolean $noredirect Don't create a redirect. * @param string $watchlist Unconditionally add or remove the page from your watchlist. * @param boolean $ignorewarnings Ignore any warnings. * * @return object * * @since 12.3 */ public function movePageByName($from, $to, $reason = null, $movetalk = null, $movesubpages = null, $noredirect = null, $watchlist =null, $ignorewarnings = null) { // Get the token. $token = $this->getToken($from, 'move'); // Build the request path. $path = '?action=move'; // Build the request data. $data = array( 'from' => $from, 'to' => $reason, 'token' => $token, 'reason' => $reason, 'movetalk' => $movetalk, 'movesubpages' => $movesubpages, 'noredirect' => $noredirect, 'watchlist' => $watchlist, 'ignorewarnings' => $ignorewarnings ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to move a page. * * @param int $fromid Page ID of the page you want to move. * @param string $to Title you want to rename the page to. * @param string $reason Reason for the move (optional). * @param string $movetalk Move the talk page, if it exists. * @param string $movesubpages Move subpages, if applicable. * @param boolean $noredirect Don't create a redirect. * @param string $watchlist Unconditionally add or remove the page from your watchlist. * @param boolean $ignorewarnings Ignore any warnings. * * @return object * * @since 12.3 */ public function movePageById($fromid, $to, $reason = null, $movetalk = null, $movesubpages = null, $noredirect = null, $watchlist =null, $ignorewarnings = null) { // Get the token. $token = $this->getToken($fromid, 'move'); // Build the request path. $path = '?action=move'; // Build the request data. $data = array( 'fromid' => $fromid, 'to' => $reason, 'token' => $token, 'reason' => $reason, 'movetalk' => $movetalk, 'movesubpages' => $movesubpages, 'noredirect' => $noredirect, 'watchlist' => $watchlist, 'ignorewarnings' => $ignorewarnings ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to undo the last edit to the page. * * @param string $title Title of the page you want to rollback. * @param string $user Name of the user whose edits are to be rolled back. * @param string $summary Custom edit summary. If not set, default summary will be used. * @param string $markbot Mark the reverted edits and the revert as bot edits. * @param string $watchlist Unconditionally add or remove the page from your watchlist. * * @return object * * @since 12.3 */ public function rollback($title, $user, $summary = null, $markbot = null, $watchlist = null) { // Get the token. $token = $this->getToken($title, 'rollback'); // Build the request path. $path = '?action=rollback'; // Build the request data. $data = array( 'title' => $title, 'token' => $token, 'user' => $user, 'expiry' => $summary, 'markbot' => $markbot, 'watchlist' => $watchlist ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to change the protection level of a page. * * @param string $title Title of the page you want to (un)protect. * @param string $protections Pipe-separated list of protection levels. * @param string $expiry Expiry timestamps. * @param string $reason Reason for (un)protecting (optional). * @param string $cascade Enable cascading protection. * @param string $watchlist Unconditionally add or remove the page from your watchlist. * * @return object * * @since 12.3 */ public function changeProtection($title, $protections, $expiry = null, $reason = null, $cascade = null, $watchlist = null) { // Get the token. $token = $this->getToken($title, 'unblock'); // Build the request path. $path = '?action=protect'; // Build the request data. $data = array( 'title' => $title, 'token' => $token, 'protections' => $protections, 'expiry' => $expiry, 'reason' => $reason, 'cascade' => $cascade, 'watchlist' => $watchlist ); // Send the request. $response = $this->client->post($this->fetchUrl($path), $data); return $this->validateResponse($response); } /** * Method to get basic page information. * * @param array $titles Page titles to retrieve info. * @param array $inprop Which additional properties to get. * @param array $intoken Request a token to perform a data-modifying action on a page * @param boolean $incontinue When more results are available, use this to continue. * * @return object * * @since 12.3 */ public function getPageInfo(array $titles, array $inprop = null, array $intoken = null, $incontinue = null) { // Build the request $path = '?action=query&prop=info'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if (isset($inprop)) { $path .= '&inprop=' . $this->buildParameter($inprop); } if (isset($intoken)) { $path .= '&intoken=' . $this->buildParameter($intoken); } if ($incontinue) { $path .= '&incontinue='; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get various properties defined in the page content. * * @param array $titles Page titles to retrieve properties. * @param boolean $ppcontinue When more results are available, use this to continue. * @param string $ppprop Page prop to look on the page for. * * @return object * * @since 12.3 */ public function getPageProperties(array $titles, $ppcontinue = null, $ppprop = null) { // Build the request $path = '?action=query&prop=pageprops'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if ($ppcontinue) { $path .= '&ppcontinue='; } if (isset($ppprop)) { $path .= '&ppprop=' . $ppprop; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get a list of revisions. * * @param array $titles Page titles to retrieve revisions. * @param array $rvprop Which properties to get for each revision. * @param boolean $rvparse Parse revision content. * @param int $rvlimit Limit how many revisions will be returned. * * @return object * * @since 12.3 */ public function getRevisions(array $titles, array $rvprop = null, $rvparse = null, $rvlimit = null) { // Build the request $path = '?action=query&prop=revisions'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if (isset($rvprop)) { $path .= '&rvprop=' . $this->buildParameter($rvprop); } if ($rvparse) { $path .= '&rvparse='; } if (isset($rvlimit)) { $path .= '&rvlimit=' . $rvlimit; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get all page templates from the given page. * * @param array $titles Page titles to retrieve templates. * @param array $tlnamespace Show templates in this namespace(s) only. * @param integer $tllimit How many templates to return. * @param boolean $tlcontinue When more results are available, use this to continue. * @param string $tltemplates Only list these templates. * @param string $tldir The direction in which to list. * * @return object * * @since 12.3 */ public function getPageTemplates(array $titles, array $tlnamespace = null, $tllimit = null, $tlcontinue = null, $tltemplates = null, $tldir = null) { // Build the request. $path = '?action=query&prop=templates'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if (isset($tlnamespace)) { $path .= '&tlnamespace=' . $this->buildParameter($tlnamespace); } if (isset($tllimit)) { $path .= '&tllimit=' . $tllimit; } if ($tlcontinue) { $path .= '&tlcontinue='; } if (isset($tltemplates)) { $path .= '&tltemplates=' . $tltemplates; } if (isset($tldir)) { $path .= '&tldir=' . $tldir; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get all pages that link to the given page. * * @param string $bltitle Title to search. * @param integer $blpageid Pageid to search. * @param boolean $blcontinue When more results are available, use this to continue. * @param array $blnamespace The namespace to enumerate. * @param string $blfilterredirect How to filter for redirects.. * @param integer $bllimit How many total pages to return. * @param boolean $blredirect If linking page is a redirect, find all pages that link to that redirect as well. * * @return object * * @since 12.3 */ public function getBackLinks($bltitle, $blpageid = null, $blcontinue = null, array $blnamespace = null, $blfilterredirect = null, $bllimit = null, $blredirect = null) { // Build the request. $path = '?action=query&list=backlinks'; if (isset($bltitle)) { $path .= '&bltitle=' . $bltitle; } if (isset($blpageid)) { $path .= '&blpageid=' . $blpageid; } if ($blcontinue) { $path .= '&blcontinue='; } if (isset($blnamespace)) { $path .= '&blnamespace=' . $this->buildParameter($blnamespace); } if (isset($blfilterredirect)) { $path .= '&blfilterredirect=' . $blfilterredirect; } if (isset($bllimit)) { $path .= '&bllimit=' . $bllimit; } if ($blredirect) { $path .= '&blredirect='; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get all pages that link to the given interwiki link. * * @param string $iwbltitle Interwiki link to search for. Must be used with iwblprefix. * @param string $iwblprefix Prefix for the interwiki. * @param boolean $iwblcontinue When more results are available, use this to continue. * @param integer $iwbllimit How many total pages to return. * @param array $iwblprop Which properties to get. * * @return object * * @since 12.3 */ public function getIWBackLinks($iwbltitle, $iwblprefix = null, $iwblcontinue = null, $iwbllimit = null, array $iwblprop = null) { // Build the request $path = '?action=query&list=iwbacklinks'; if (isset($iwbltitle)) { $path .= '&iwbltitle=' . $iwbltitle; } if (isset($iwblprefix)) { $path .= '&iwblprefix=' . $iwblprefix; } if ($iwblcontinue) { $path .= '&iwblcontinue='; } if (isset($iwbllimit)) { $path .= '&bllimit=' . $iwbllimit; } if (isset($iwblprop)) { $path .= '&iwblprop=' . $this->buildParameter($iwblprop); } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to get access token. * * @param string $user The User to get token. * @param string $intoken The type of token. * * @return object * * @since 12.1 */ public function getToken($user, $intoken) { // Build the request path. $path = '?action=query&prop=info&intoken=' . $intoken . '&titles=User:' . $user; // Send the request. $response = $this->client->post($this->fetchUrl($path), null); return (string) $this->validateResponse($response)->query->pages->page[$intoken . 'token']; } } PK���\��ϖ��$libraries/joomla/mediawiki/links.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage MediaWiki * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * MediaWiki API Links class for the Joomla Platform. * * @since 12.3 */ class JMediawikiLinks extends JMediawikiObject { /** * Method to return all links from the given page(s). * * @param array $titles Page titles to retrieve links. * @param array $plnamespace Namespaces to get links. * @param string $pllimit Number of links to return. * @param string $plcontinue Continue when more results are available. * @param array $pltitles List links to these titles. * @param string $pldir Direction of listing. * * @return object * * @since 12.3 */ public function getLinks(array $titles, array $plnamespace = null, $pllimit = null, $plcontinue = null, array $pltitles = null, $pldir = null) { // Build the request. $path = '?action=query&prop=links'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if (isset($plnamespace)) { $path .= '&plnamespace=' . $this->buildParameter($plnamespace); } if (isset($pllimit)) { $path .= '&pllimit=' . $pllimit; } if (isset($plcontinue)) { $path .= '&plcontinue=' . $plcontinue; } if (isset($pltitles)) { $path .= '&pltitles=' . $this->buildParameter($pltitles); } if (isset($pldir)) { $path .= '&pldir=' . $pldir; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to return info about the link pages. * * @param array $titles Page titles to retrieve links. * * @return object * * @since 12.3 */ public function getLinksUsed(array $titles) { // Build the request. $path = '?action=query&generator=links&prop=info'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to return all interwiki links from the given page(s). * * @param array $titles Page titles to retrieve links. * @param boolean $iwurl Whether to get the full url. * @param integer $iwlimit Number of interwiki links to return. * @param boolean $iwcontinue When more results are available, use this to continue. * @param string $iwprefix Prefix for the interwiki. * @param string $iwtitle Interwiki link to search for. * @param string $iwdir The direction in which to list. * * @return object * * @since 12.3 */ public function getIWLinks(array $titles, $iwurl = false, $iwlimit = null, $iwcontinue = false, $iwprefix = null, $iwtitle = null, $iwdir = null) { // Build the request. $path = '?action=query&prop=links'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if ($iwurl) { $path .= '&iwurl='; } if (isset($iwlimit)) { $path .= '&iwlimit=' . $iwlimit; } if ($iwcontinue) { $path .= '&iwcontinue='; } if (isset($iwprefix)) { $path .= '&iwprefix=' . $iwprefix; } if (isset($iwtitle)) { $path .= '&iwtitle=' . $iwtitle; } if (isset($iwdir)) { $path .= '&iwdir=' . $iwdir; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to return all interlanguage links from the given page(s). * * @param array $titles Page titles to retrieve links. * @param integer $lllimit Number of langauge links to return. * @param boolean $llcontinue When more results are available, use this to continue. * @param string $llurl Whether to get the full URL. * @param string $lllang Language code. * @param string $lltitle Link to search for. * @param string $lldir The direction in which to list. * * @return object * * @since 12.3 */ public function getLangLinks(array $titles, $lllimit = null, $llcontinue = false, $llurl = null, $lllang = null, $lltitle = null, $lldir = null) { // Build the request. $path = '?action=query&prop=langlinks'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if (isset($lllimit)) { $path .= '&lllimit=' . $lllimit; } if ($llcontinue) { $path .= '&llcontinue='; } if (isset($llurl)) { $path .= '&llurl=' . $llurl; } if (isset($lllang)) { $path .= '&lllang=' . $lllang; } if (isset($lltitle)) { $path .= '&lltitle=' . $lltitle; } if (isset($lldir)) { $path .= '&lldir=' . $lldir; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to return all external urls from the given page(s). * * @param array $titles Page titles to retrieve links. * @param integer $ellimit Number of links to return. * @param string $eloffset When more results are available, use this to continue. * @param string $elprotocol Protocol of the url. * @param string $elquery Search string without protocol. * * @return object * * @since 12.3 */ public function getExtLinks(array $titles, $ellimit = null, $eloffset = null, $elprotocol = null, $elquery = null) { // Build the request. $path = '?action=query&prop=extlinks'; // Append titles to the request. $path .= '&titles=' . $this->buildParameter($titles); if (isset($ellimit)) { $path .= '&ellimit=' . $ellimit; } if (isset($eloffset)) { $path .= '&eloffset=' . $eloffset; } if (isset($elprotocol)) { $path .= '&elprotocol=' . $elprotocol; } if (isset($elquery)) { $path .= '&elquery=' . $elquery; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } /** * Method to enumerate all links that point to a given namespace. * * @param boolean $alcontinue When more results are available, use this to continue. * @param string $alfrom Start listing at this title. The title need not exist. * @param string $alto The page title to stop enumerating at. * @param string $alprefix Search for all page titles that begin with this value. * @param string $alunique Only show unique links. * @param array $alprop What pieces of information to include. * @param string $alnamespace The namespace to enumerate. * @param integer $allimit Number of links to return. * * @return object * * @since 12.3 */ public function enumerateLinks($alcontinue = false, $alfrom = null, $alto = null, $alprefix = null, $alunique = null, array $alprop = null, $alnamespace = null, $allimit = null) { // Build the request. $path = '?action=query&meta=siteinfo'; if ($alcontinue) { $path .= '&alcontinue='; } if (isset($alfrom)) { $path .= '&alfrom=' . $alfrom; } if (isset($alto)) { $path .= '&alto=' . $alto; } if (isset($alprefix)) { $path .= '&alprefix=' . $alprefix; } if (isset($alunique)) { $path .= '&alunique=' . $alunique; } if (isset($alprop)) { $path .= '&alprop=' . $this->buildParameter($alprop); } if (isset($alnamespace)) { $path .= '&alnamespace=' . $alnamespace; } if (isset($allimit)) { $path .= '&allimit=' . $allimit; } // Send the request. $response = $this->client->get($this->fetchUrl($path)); return $this->validateResponse($response); } } PK���\0'XQ� � $libraries/joomla/observer/mapper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Observer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Observer mapping pattern implementation for Joomla * * @link https://docs.joomla.org/JObserverMapper * @since 3.1.2 */ class JObserverMapper { /** * Array: array( JObservableInterface_classname => array( JObserverInterface_classname => array( paramname => param, .... ) ) ) * * @var array * @since 3.1.2 */ protected static $observations = array(); /** * Adds a mapping to observe $observerClass subjects with $observableClass observer/listener, attaching it on creation with $params * on $observableClass instance creations * * @param string $observerClass The name of the observer class (implementing JObserverInterface) * @param string $observableClass The name of the observable class (implementing JObservableInterface) * @param array|boolean $params The params to give to the JObserverInterface::createObserver() function, or false to remove mapping * * @return void * * @since 3.1.2 */ public static function addObserverClassToClass($observerClass, $observableClass, $params = array()) { if ($params !== false) { static::$observations[$observableClass][$observerClass] = $params; } else { unset(static::$observations[$observableClass][$observerClass]); } } /** * Attaches all applicable observers to an $observableObject * * @param JObservableInterface $observableObject The observable subject object * * @return void * * @since 3.1.2 */ public static function attachAllObservers(JObservableInterface $observableObject) { $observableClass = get_class($observableObject); while ($observableClass != false) { // Attach applicable Observers for the class to the Observable subject: if (isset(static::$observations[$observableClass])) { foreach (static::$observations[$observableClass] as $observerClass => $params) { // Attach an Observer to the Observable subject: /** * @var JObserverInterface $observerClass */ $observerClass::createObserver($observableObject, $params); } } // Get parent class name (or false if none), and redo the above on it: $observableClass = get_parent_class($observableClass); } } } PK���\����MM'libraries/joomla/observer/interface.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Observer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Observer pattern interface for Joomla * * A class that wants to observe another class must: * * 1) Add: implements JObserverInterface * to its class * * 2) Implement a constructor, that can look like this: * public function __construct(JObservableInterface $observableObject) * { * $observableObject->attachObserver($this); * $this->observableObject = $observableObject; * } * * 3) and must implement the instanciator function createObserver() below, e.g. as follows: * public static function createObserver(JObservableInterface $observableObject, $params = array()) * { * $observer = new self($observableObject); * $observer->... = $params['...']; ... * return $observer; * } * * 4) Then add functions corresponding to the events to be observed, * E.g. to respond to event: $this->_observers->update('onBeforeLoad', array($keys, $reset)); * following function is needed in the obser: * public function onBeforeLoad($keys, $reset) { ... } * * 5) Finally, the binding is made outside the observable and observer classes, using: * JObserverMapper::addObserverClassToClass('ObserverClassname', 'ObservableClassname', array('paramName' => 'paramValue')); * where the last array will be provided to the observer instanciator function createObserver. * * @link https://docs.joomla.org/JObserverInterface * @since 3.1.2 */ interface JObserverInterface { /** * Creates the associated observer instance and attaches it to the $observableObject * * @param JObservableInterface $observableObject The observable subject object * @param array $params Params for this observer * * @return JObserverInterface * * @since 3.1.2 */ public static function createObserver(JObservableInterface $observableObject, $params = array()); } PK���\��%libraries/joomla/observer/updater.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Observer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Observer updater pattern implementation for Joomla * * @link https://docs.joomla.org/JObserverUpdater * @since 3.1.2 */ class JObserverUpdater implements JObserverUpdaterInterface { /** * Generic JObserverInterface observers for this JObservableInterface * * @var JObserverInterface * @since 3.1.2 */ protected $observers = array(); /** * Process observers (useful when a class extends significantly an observerved method, and calls observers itself * * @var boolean * @since 3.1.2 */ protected $doCallObservers = true; /** * Constructor * * @param JObservableInterface $observable The observable subject object * * @since 3.1.2 */ public function __construct(JObservableInterface $observable) { // Not yet needed, but possible: $this->observable = $observable; } /** * Adds an observer to the JObservableInterface instance updated by this * This method can be called fron JObservableInterface::attachObserver * * @param JObserverInterface $observer The observer object * * @return void * * @since 3.1.2 */ public function attachObserver(JObserverInterface $observer) { $this->observers[get_class($observer)] = $observer; } /** * Gets the instance of the observer of class $observerClass * * @param string $observerClass The class name of the observer * * @return JTableObserver|null The observer object of this class if any * * @since 3.1.2 */ public function getObserverOfClass($observerClass) { if (isset($this->observers[$observerClass])) { return $this->observers[$observerClass]; } return null; } /** * Call all observers for $event with $params * * @param string $event Name of the event * @param array $params Params of the event * * @return void * * @since 3.1.2 */ public function update($event, $params) { if ($this->doCallObservers) { foreach ($this->observers as $observer) { $eventListener = array($observer, $event); if (is_callable($eventListener)) { call_user_func_array($eventListener, $params); } } } } /** * Enable/Disable calling of observers (this is useful when calling parent:: function * * @param boolean $enabled Enable (true) or Disable (false) the observer events * * @return boolean Returns old state * * @since 3.1.2 */ public function doCallObservers($enabled) { $oldState = $this->doCallObservers; $this->doCallObservers = $enabled; return $oldState; } } PK���\P���,libraries/joomla/observer/wrapper/mapper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Observer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JObserverMapper * * @package Joomla.Platform * @subpackage Observer * @since 3.4 */ class JObserverWrapperMapper { /** * Helper wrapper method for addObserverClassToClass * * @param string $observerClass The name of the observer class (implementing JObserverInterface). * @param string $observableClass The name of the observable class (implementing JObservableInterface). * @param array|boolean $params The params to give to the JObserverInterface::createObserver() function, or false to remove mapping. * * @return void * * @see JObserverMapper::addObserverClassToClass * @since 3.4 */ public function addObserverClassToClass($observerClass, $observableClass, $params = array()) { return JObserverMapper::addObserverClassToClass($observerClass, $observableClass, $params); } /** * Helper wrapper method for attachAllObservers * * @param JObservableInterface $observableObject The observable subject object. * * @return void * * @see JObserverMapper::attachAllObservers * @since 3.4 */ public function attachAllObservers(JObservableInterface $observableObject) { return JObserverMapper::attachAllObservers($observableObject); } } PK���\5ĺ� /libraries/joomla/observer/updater/interface.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Observer * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Observer updater pattern implementation for Joomla * * @link https://docs.joomla.org/JObserverUpdater * @since 3.1.2 */ interface JObserverUpdaterInterface { /** * Constructor * * @param JObservableInterface $observable The observable subject object * * @since 3.1.2 */ public function __construct(JObservableInterface $observable); /** * Adds an observer to the JObservableInterface instance updated by this * This method can be called fron JObservableInterface::attachObserver * * @param JObserverInterface $observer The observer object * * @return void * * @since 3.1.2 */ public function attachObserver(JObserverInterface $observer); /** * Call all observers for $event with $params * * @param string $event Event name (function name in observer) * @param array $params Params of event (params in observer function) * * @return void * * @since 3.1.2 */ public function update($event, $params); /** * Enable/Disable calling of observers (this is useful when calling parent:: function * * @param boolean $enabled Enable (true) or Disable (false) the observer events * * @return boolean Returns old state * * @since 3.1.2 */ public function doCallObservers($enabled); } PK���\�%�NN(libraries/joomla/microdata/microdata.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Microdata * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform class for interacting with Microdata semantics. * * @since 3.2 */ class JMicrodata { /** * Array with all available Types and Properties * * @var array * @since 3.2 */ protected static $types = null; /** * The Schema.org Type * * @var string * @since 3.2 */ protected $type = null; /** * The Property * * @var string * @since 3.2 */ protected $property = null; /** * The Human value or Machine value * * @var string * @since 3.2 */ protected $content = null; /** * The Machine value * * @var string * @since 3.2 */ protected $machineContent = null; /** * Fallback Type * * @var string * @since 3.2 */ protected $fallbackType = null; /** * Fallback Property * * @var string * @since 3.2 */ protected $fallbackProperty = null; /** * Used to check if a Fallback must be used * * @var string * @since 3.2 */ protected $fallback = false; /** * Used to check if the Microdata semantics output are enabled or disabled * * @var boolean * @since 3.2 */ protected $enabled = true; /** * Initialize the class and setup the default Type * * @param string $type Optional, Fallback to Thing Type * @param boolean $flag Enable or disable microdata output * * @since 3.2 */ public function __construct($type = '', $flag = true) { if ($this->enabled = (boolean) $flag) { // Fallback to Thing Type if (!$type) { $type = 'Thing'; } $this->setType($type); } } /** * Load all Types and Properties from the types.json file * * @return void * * @since 3.2 */ protected static function loadTypes() { // Load the JSON if (!static::$types) { $path = JPATH_PLATFORM . '/joomla/microdata/types.json'; static::$types = json_decode(file_get_contents($path), true); } } /** * Reset all params * * @return void * * @since 3.2 */ protected function resetParams() { $this->content = null; $this->machineContent = null; $this->property = null; $this->fallbackProperty = null; $this->fallbackType = null; $this->fallback = false; } /** * Enable or Disable Microdata semantics output * * @param boolean $flag Enable or disable microdata output * * @return JMicrodata Instance of $this * * @since 3.2 */ public function enable($flag = true) { $this->enabled = (boolean) $flag; return $this; } /** * Return true if Microdata semantics output are enabled * * @return boolean * * @since 3.2 */ public function isEnabled() { return $this->enabled; } /** * Set a new Schema.org Type * * @param string $type The Type to be setup * * @return JMicrodata Instance of $this * * @since 3.2 */ public function setType($type) { if (!$this->enabled) { return $this; } // Sanitize the Type $this->type = static::sanitizeType($type); // If the given Type isn't available, fallback to Thing if (!static::isTypeAvailable($this->type)) { $this->type = 'Thing'; } return $this; } /** * Return the current Type name * * @return string * * @since 3.2 */ public function getType() { return $this->type; } /** * Setup a Property * * @param string $property The Property * * @return JMicrodata Instance of $this * * @since 3.2 */ public function property($property) { if (!$this->enabled) { return $this; } // Sanitize the Property $property = static::sanitizeProperty($property); // Control if the Property exist in the given Type and setup it, if not leave NULL if (static::isPropertyInType($this->type, $property)) { $this->property = $property; } else { $this->fallback = true; } return $this; } /** * Return the property variable * * @return string * * @since 3.2 */ public function getProperty() { return $this->property; } /** * Setup a Text value or Content value for the Microdata * * @param string $value The human value or marchine value to be used * @param string $machineValue The machine value * * @return JMicrodata Instance of $this * * @since 3.2 */ public function content($value, $machineValue = null) { $this->content = $value; $this->machineContent = $machineValue; return $this; } /** * Return the content variable * * @return string * * @since 3.2 */ public function getContent() { return $this->content; } /** * Setup a Fallback Type and Property * * @param string $type The Fallback Type * @param string $property The Fallback Property * * @return JMicrodata Instance of $this * * @since 3.2 */ public function fallback($type, $property) { if (!$this->enabled) { return $this; } // Sanitize the Type $this->fallbackType = static::sanitizeType($type); // If the given Type isn't available, fallback to Thing if (!static::isTypeAvailable($this->fallbackType)) { $this->fallbackType = 'Thing'; } // Control if the Property exist in the given Type and setup it, if not leave NULL if (static::isPropertyInType($this->fallbackType, $property)) { $this->fallbackProperty = $property; } else { $this->fallbackProperty = null; } return $this; } /** * Return the fallbackType variable * * @return string * * @since 3.2 */ public function getFallbackType() { return $this->fallbackType; } /** * Return the fallbackProperty variable * * @return string * * @since 3.2 */ public function getFallbackProperty() { return $this->fallbackProperty; } /** * This function handle the logic of a Microdata intelligent display. * Check if the Type, Property are available, if not check for a Fallback, * then reset all params for the next use and * return the Microdata HTML * * @param string $displayType Optional, 'inline', available ['inline'|'span'|'div'|meta] * @param boolean $emptyOutput Return an empty string if the microdata output is disabled and there is a $content value * * @return string * * @since 3.2 */ public function display($displayType = '', $emptyOutput = false) { // Initialize the HTML to output $html = ($this->content !== null) ? $this->content : ''; // Control if the Microdata output is enabled, otherwise return the content or empty string if (!$this->enabled) { // Reset params $this->resetParams(); return ($emptyOutput) ? '' : $html; } // If the property is wrong for the current Type check if Fallback available, otherwise return empty HTML if ($this->property && !$this->fallback) { // Process and return the HTML the way the user expects to if ($displayType) { switch ($displayType) { case 'span': $html = static::htmlSpan($html, $this->property); break; case 'div': $html = static::htmlDiv($html, $this->property); break; case 'meta': $html = ($this->machineContent !== null) ? $this->machineContent : $html; $html = static::htmlMeta($html, $this->property); break; default: // Default $displayType = 'inline' $html = static::htmlProperty($this->property); break; } } else { /* * Process and return the HTML in an automatic way, * with the Property expected Types and display the Microdata in the right way, * check if the Property is normal, nested or must be rendered in a metadata tag */ switch (static::getExpectedDisplayType($this->type, $this->property)) { case 'nested': // Retrive the expected nested Type of the Property $nestedType = static::getExpectedTypes($this->type, $this->property); $nestedProperty = ''; // If there is a Fallback Type then probably it could be the expectedType if (in_array($this->fallbackType, $nestedType)) { $nestedType = $this->fallbackType; if ($this->fallbackProperty) { $nestedProperty = $this->fallbackProperty; } } else { $nestedType = $nestedType[0]; } // Check if a Content is available, otherwise Fallback to an 'inline' display type if ($this->content !== null) { if ($nestedProperty) { $html = static::htmlSpan( $this->content, $nestedProperty ); } $html = static::htmlSpan( $html, $this->property, $nestedType, true ); } else { $html = static::htmlProperty($this->property) . ' ' . static::htmlScope($nestedType); if ($nestedProperty) { $html .= ' ' . static::htmlProperty($nestedProperty); } } break; case 'meta': // Check if the Content value is available, otherwise Fallback to an 'inline' display Type if ($this->content !== null) { $html = ($this->machineContent !== null) ? $this->machineContent : $this->content; $html = static::htmlMeta($html, $this->property) . $this->content; } else { $html = static::htmlProperty($this->property); } break; default: /* * Default expected display type = 'normal' * Check if the Content value is available, * otherwise Fallback to an 'inline' display Type */ if ($this->content !== null) { $html = static::htmlSpan($this->content, $this->property); } else { $html = static::htmlProperty($this->property); } break; } } } elseif ($this->fallbackProperty) { // Process and return the HTML the way the user expects to if ($displayType) { switch ($displayType) { case 'span': $html = static::htmlSpan($html, $this->fallbackProperty, $this->fallbackType); break; case 'div': $html = static::htmlDiv($html, $this->fallbackProperty, $this->fallbackType); break; case 'meta': $html = ($this->machineContent !== null) ? $this->machineContent : $html; $html = static::htmlMeta($html, $this->fallbackProperty, $this->fallbackType); break; default: // Default $displayType = 'inline' $html = static::htmlScope($type::scope()) . ' ' . static::htmlProperty($this->fallbackProperty); break; } } else { /* * Process and return the HTML in an automatic way, * with the Property expected Types an display the Microdata in the right way, * check if the Property is nested or must be rendered in a metadata tag */ switch (static::getExpectedDisplayType($this->fallbackType, $this->fallbackProperty)) { case 'meta': // Check if the Content value is available, otherwise Fallback to an 'inline' display Type if ($this->content !== null) { $html = ($this->machineContent !== null) ? $this->machineContent : $this->content; $html = static::htmlMeta($html, $this->fallbackProperty, $this->fallbackType); } else { $html = static::htmlScope($this->fallbackType) . ' ' . static::htmlProperty($this->fallbackProperty); } break; default: /* * Default expected display type = 'normal' * Check if the Content value is available, * otherwise Fallback to an 'inline' display Type */ if ($this->content !== null) { $html = static::htmlSpan($this->content, $this->fallbackProperty); $html = static::htmlSpan($html, '', $this->fallbackType); } else { $html = static::htmlScope($this->fallbackType) . ' ' . static::htmlProperty($this->fallbackProperty); } break; } } } elseif (!$this->fallbackProperty && $this->fallbackType !== null) { $html = static::htmlScope($this->fallbackType); } // Reset params $this->resetParams(); return $html; } /** * Return the HTML of the current Scope * * @return string * * @since 3.2 */ public function displayScope() { // Control if the Microdata output is enabled, otherwise return the content or empty string if (!$this->enabled) { return ''; } return static::htmlScope($this->type); } /** * Return the sanitized Type * * @param string $type The Type to sanitize * * @return string * * @since 3.2 */ public static function sanitizeType($type) { return ucfirst(trim($type)); } /** * Return the sanitized Property * * @param string $property The Property to sanitize * * @return string * * @since 3.2 */ public static function sanitizeProperty($property) { return lcfirst(trim($property)); } /** * Return an array with all Types and Properties * * @return array * * @since 3.2 */ public static function getTypes() { static::loadTypes(); return static::$types; } /** * Return an array with all available Types * * @return array * * @since 3.2 */ public static function getAvailableTypes() { static::loadTypes(); return array_keys(static::$types); } /** * Return the expected types of the Property * * @param string $type The Type to process * @param string $property The Property to process * * @return array * * @since 3.2 */ public static function getExpectedTypes($type, $property) { static::loadTypes(); $tmp = static::$types[$type]['properties']; // Check if the Property is in the Type if (isset($tmp[$property])) { return $tmp[$property]['expectedTypes']; } // Check if the Property is inherit $extendedType = static::$types[$type]['extends']; // Recursive if (!empty($extendedType)) { return static::getExpectedTypes($extendedType, $property); } return array(); } /** * Return the expected display type of the [normal|nested|meta] * In wich way to display the Property: * normal -> itemprop="name" * nested -> itemprop="director" itemscope itemtype="http://schema.org/Person" * meta -> <meta itemprop="datePublished" content="1991-05-01"> * * @param string $type The Type where to find the Property * @param string $property The Property to process * * @return string * * @since 3.2 */ protected static function getExpectedDisplayType($type, $property) { $expectedTypes = static::getExpectedTypes($type, $property); // Retrieve the first expected type $type = $expectedTypes[0]; // Check if it's a meta display if ($type === 'Date' || $type === 'DateTime' || $property === 'interactionCount') { return 'meta'; } // Check if it's a normal display if ($type === 'Text' || $type === 'URL' || $type === 'Boolean' || $type === 'Number') { return 'normal'; } // Otherwise it's a nested display return 'nested'; } /** * Recursive function, control if the given Type has the given Property * * @param string $type The Type where to check * @param string $property The Property to check * * @return boolean * * @since 3.2 */ public static function isPropertyInType($type, $property) { if (!static::isTypeAvailable($type)) { return false; } // Control if the Property exists, and return true if (array_key_exists($property, static::$types[$type]['properties'])) { return true; } // Recursive: Check if the Property is inherit $extendedType = static::$types[$type]['extends']; if (!empty($extendedType)) { return static::isPropertyInType($extendedType, $property); } return false; } /** * Control if the given Type class is available * * @param string $type The Type to check * * @return boolean * * @since 3.2 */ public static function isTypeAvailable($type) { static::loadTypes(); return (array_key_exists($type, static::$types)) ? true : false; } /** * Return the microdata in a <meta> tag with content for machines. * * @param string $content The machine content to display * @param string $property The Property * @param string $scope Optional, the Type scope to display * @param boolean $inverse Optional, default = false, inverse the $scope with the $property * * @return string * * @since 3.2 */ public static function htmlMeta($content, $property, $scope = '', $inverse = false) { // Control if the Property has allready the itemprop if (stripos($property, 'itemprop') !== 0) { $property = static::htmlProperty($property); } // Control if the Scope have allready the itemtype if (!empty($scope) && stripos($scope, 'itemscope') !== 0) { $scope = static::htmlScope($scope); } if ($inverse) { $tmp = join(' ', array($property, $scope)); } else { $tmp = join(' ', array($scope, $property)); } $tmp = trim($tmp); return "<meta $tmp content='$content'/>"; } /** * Return the microdata in a <span> tag. * * @param string $content The human value * @param string $property Optional, the human value to display * @param string $scope Optional, the Type scope to display * @param boolean $inverse Optional, default = false, inverse the $scope with the $property * * @return string * * @since 3.2 */ public static function htmlSpan($content, $property = '', $scope = '', $inverse = false) { // Control if the Property has allready the itemprop if (!empty($property) && stripos($property, 'itemprop') !== 0) { $property = static::htmlProperty($property); } // Control if the Scope have allready the itemtype if (!empty($scope) && stripos($scope, 'itemscope') !== 0) { $scope = static::htmlScope($scope); } if ($inverse) { $tmp = join(' ', array($property, $scope)); } else { $tmp = join(' ', array($scope, $property)); } $tmp = trim($tmp); $tmp = ($tmp) ? ' ' . $tmp : ''; return "<span$tmp>$content</span>"; } /** * Return the microdata in an <div> tag. * * @param string $content The human value * @param string $property Optional, the human value to display * @param string $scope Optional, the Type scope to display * @param boolean $inverse Optional, default = false, inverse the $scope with the $property * * @return string * * @since 3.2 */ public static function htmlDiv($content, $property = '', $scope = '', $inverse = false) { // Control if the Property has allready the itemprop if (!empty($property) && stripos($property, 'itemprop') !== 0) { $property = static::htmlProperty($property); } // Control if the Scope have allready the itemtype if (!empty($scope) && stripos($scope, 'itemscope') !== 0) { $scope = static::htmlScope($scope); } if ($inverse) { $tmp = join(' ', array($property, $scope)); } else { $tmp = join(' ', array($scope, $property)); } $tmp = trim($tmp); $tmp = ($tmp) ? ' ' . $tmp : ''; return "<div$tmp>$content</div>"; } /** * Return the HTML Scope * * @param string $scope The Scope to process * * @return string * * @since 3.2 */ public static function htmlScope($scope) { if (stripos($scope, 'http') !== 0) { $scope = 'https://schema.org/' . ucfirst($scope); } return "itemscope itemtype='$scope'"; } /** * Return the HTML Property * * @param string $property The Property to process * * @return string * * @since 3.2 */ public static function htmlProperty($property) { return "itemprop='$property'"; } } PK���\/�ܻ*�*%libraries/joomla/microdata/types.jsonnu�[���{"DataType":{"extends":"","properties":[]},"Boolean":{"extends":"DataType","properties":[]},"Date":{"extends":"DataType","properties":[]},"DateTime":{"extends":"DataType","properties":[]},"Number":{"extends":"DataType","properties":[]},"Float":{"extends":"Number","properties":[]},"Integer":{"extends":"Number","properties":[]},"Text":{"extends":"DataType","properties":[]},"URL":{"extends":"Text","properties":[]},"Time":{"extends":"DataType","properties":[]},"Thing":{"extends":"","properties":{"additionalType":{"expectedTypes":["URL"]},"alternateName":{"expectedTypes":["Text"]},"description":{"expectedTypes":["Text"]},"image":{"expectedTypes":["URL"]},"name":{"expectedTypes":["Text"]},"sameAs":{"expectedTypes":["URL"]},"url":{"expectedTypes":["URL"]}}},"Action":{"extends":"Thing","properties":{"agent":{"expectedTypes":["Organization","Person"]},"endTime":{"expectedTypes":["DateTime"]},"instrument":{"expectedTypes":["Thing"]},"location":{"expectedTypes":["Place","PostalAddress"]},"object":{"expectedTypes":["Thing"]},"participant":{"expectedTypes":["Organization","Person"]},"result":{"expectedTypes":["Thing"]},"startTime":{"expectedTypes":["DateTime"]}}},"AchieveAction":{"extends":"Action","properties":[]},"LoseAction":{"extends":"AchieveAction","properties":{"winner":{"expectedTypes":["Person"]}}},"TieAction":{"extends":"AchieveAction","properties":[]},"WinAction":{"extends":"AchieveAction","properties":{"loser":{"expectedTypes":["Person"]}}},"AssessAction":{"extends":"Action","properties":[]},"ChooseAction":{"extends":"AssessAction","properties":{"option":{"expectedTypes":["Text","Thing"]}}},"VoteAction":{"extends":"ChooseAction","properties":{"candidate":{"expectedTypes":["Person"]}}},"IgnoreAction":{"extends":"AssessAction","properties":[]},"ReactAction":{"extends":"AssessAction","properties":[]},"AgreeAction":{"extends":"ReactAction","properties":[]},"DisagreeAction":{"extends":"ReactAction","properties":[]},"DislikeAction":{"extends":"ReactAction","properties":[]},"EndorseAction":{"extends":"ReactAction","properties":{"endorsee":{"expectedTypes":["Organization","Person"]}}},"LikeAction":{"extends":"ReactAction","properties":[]},"WantAction":{"extends":"ReactAction","properties":[]},"ReviewAction":{"extends":"AssessAction","properties":{"resultReview":{"expectedTypes":["Review"]}}},"ConsumeAction":{"extends":"Action","properties":[]},"DrinkAction":{"extends":"ConsumeAction","properties":[]},"EatAction":{"extends":"ConsumeAction","properties":[]},"InstallAction":{"extends":"ConsumeAction","properties":[]},"ListenAction":{"extends":"ConsumeAction","properties":[]},"ReadAction":{"extends":"ConsumeAction","properties":[]},"UseAction":{"extends":"ConsumeAction","properties":[]},"WearAction":{"extends":"UseAction","properties":[]},"ViewAction":{"extends":"ConsumeAction","properties":[]},"WatchAction":{"extends":"ConsumeAction","properties":[]},"CreateAction":{"extends":"Action","properties":[]},"CookAction":{"extends":"CreateAction","properties":{"foodEstablishment":{"expectedTypes":["FoodEstablishment","Place"]},"foodEvent":{"expectedTypes":["FoodEvent"]},"recipe":{"expectedTypes":["Recipe"]}}},"DrawAction":{"extends":"CreateAction","properties":[]},"FilmAction":{"extends":"CreateAction","properties":[]},"PaintAction":{"extends":"CreateAction","properties":[]},"PhotographAction":{"extends":"CreateAction","properties":[]},"WriteAction":{"extends":"CreateAction","properties":{"language":{"expectedTypes":["Language"]}}},"FindAction":{"extends":"Action","properties":[]},"CheckAction":{"extends":"FindAction","properties":[]},"DiscoverAction":{"extends":"FindAction","properties":[]},"TrackAction":{"extends":"FindAction","properties":{"deliveryMethod":{"expectedTypes":["DeliveryMethod"]}}},"InteractAction":{"extends":"Action","properties":[]},"BefriendAction":{"extends":"InteractAction","properties":[]},"CommunicateAction":{"extends":"InteractAction","properties":{"about":{"expectedTypes":["Thing"]},"language":{"expectedTypes":["Language"]},"recipient":{"expectedTypes":["Audience","Organization","Person"]}}},"AskAction":{"extends":"CommunicateAction","properties":{"question":{"expectedTypes":["Text"]}}},"CheckInAction":{"extends":"CommunicateAction","properties":[]},"CheckOutAction":{"extends":"CommunicateAction","properties":[]},"CommentAction":{"extends":"CommunicateAction","properties":[]},"InformAction":{"extends":"CommunicateAction","properties":{"event":{"expectedTypes":["Event"]}}},"ConfirmAction":{"extends":"InformAction","properties":[]},"RsvpAction":{"extends":"InformAction","properties":[]},"InviteAction":{"extends":"CommunicateAction","properties":{"event":{"expectedTypes":["Event"]}}},"ReplyAction":{"extends":"CommunicateAction","properties":[]},"ShareAction":{"extends":"CommunicateAction","properties":[]},"FollowAction":{"extends":"InteractAction","properties":{"followee":{"expectedTypes":["Organization","Person"]}}},"JoinAction":{"extends":"InteractAction","properties":{"event":{"expectedTypes":["Event"]}}},"LeaveAction":{"extends":"InteractAction","properties":{"event":{"expectedTypes":["Event"]}}},"MarryAction":{"extends":"InteractAction","properties":[]},"RegisterAction":{"extends":"InteractAction","properties":[]},"SubscribeAction":{"extends":"InteractAction","properties":[]},"UnRegisterAction":{"extends":"InteractAction","properties":[]},"MoveAction":{"extends":"Action","properties":{"fromLocation":{"expectedTypes":["Number","Place"]},"toLocation":{"expectedTypes":["Number","Place"]}}},"ArriveAction":{"extends":"MoveAction","properties":[]},"DepartAction":{"extends":"MoveAction","properties":[]},"TravelAction":{"extends":"MoveAction","properties":{"distance":{"expectedTypes":["Distance"]}}},"OrganizeAction":{"extends":"Action","properties":[]},"AllocateAction":{"extends":"OrganizeAction","properties":{"purpose":{"expectedTypes":["MedicalDevicePurpose","Thing"]}}},"AcceptAction":{"extends":"AllocateAction","properties":[]},"AssignAction":{"extends":"AllocateAction","properties":[]},"AuthorizeAction":{"extends":"AllocateAction","properties":{"recipient":{"expectedTypes":["Audience","Organization","Person"]}}},"RejectAction":{"extends":"AllocateAction","properties":[]},"ApplyAction":{"extends":"OrganizeAction","properties":[]},"BookmarkAction":{"extends":"OrganizeAction","properties":[]},"PlanAction":{"extends":"OrganizeAction","properties":{"scheduledTime":{"expectedTypes":["DateTime"]}}},"CancelAction":{"extends":"PlanAction","properties":[]},"ReserveAction":{"extends":"PlanAction","properties":[]},"ScheduleAction":{"extends":"PlanAction","properties":[]},"PlayAction":{"extends":"Action","properties":{"audience":{"expectedTypes":["Audience"]},"event":{"expectedTypes":["Event"]}}},"ExerciseAction":{"extends":"PlayAction","properties":{"course":{"expectedTypes":["Place"]},"diet":{"expectedTypes":["Diet"]},"distance":{"expectedTypes":["Distance"]},"exercisePlan":{"expectedTypes":["ExercisePlan"]},"exerciseType":{"expectedTypes":["Text"]},"fromLocation":{"expectedTypes":["Number","Place"]},"oponent":{"expectedTypes":["Person"]},"sportsActivityLocation":{"expectedTypes":["SportsActivityLocation"]},"sportsEvent":{"expectedTypes":["SportsEvent"]},"sportsTeam":{"expectedTypes":["SportsTeam"]},"toLocation":{"expectedTypes":["Number","Place"]}}},"PerformAction":{"extends":"PlayAction","properties":{"entertainmentBusiness":{"expectedTypes":["EntertainmentBusiness"]}}},"SearchAction":{"extends":"Action","properties":{"query":{"expectedTypes":["Class","Text"]}}},"TradeAction":{"extends":"Action","properties":{"price":{"expectedTypes":["Number","Text"]}}},"BuyAction":{"extends":"TradeAction","properties":{"vendor":{"expectedTypes":["Organization","Person"]},"warrantyPromise":{"expectedTypes":["WarrantyPromise"]}}},"DonateAction":{"extends":"TradeAction","properties":{"recipient":{"expectedTypes":["Audience","Organization","Person"]}}},"OrderAction":{"extends":"TradeAction","properties":[]},"PayAction":{"extends":"TradeAction","properties":{"purpose":{"expectedTypes":["MedicalDevicePurpose","Thing"]},"recipient":{"expectedTypes":["Audience","Organization","Person"]}}},"QuoteAction":{"extends":"TradeAction","properties":[]},"RentAction":{"extends":"TradeAction","properties":{"landlord":{"expectedTypes":["Organization","Person"]},"realEstateAgent":{"expectedTypes":["RealEstateAgent"]}}},"SellAction":{"extends":"TradeAction","properties":{"buyer":{"expectedTypes":["Person"]},"warrantyPromise":{"expectedTypes":["WarrantyPromise"]}}},"TipAction":{"extends":"TradeAction","properties":{"recipient":{"expectedTypes":["Audience","Organization","Person"]}}},"TransferAction":{"extends":"Action","properties":{"fromLocation":{"expectedTypes":["Number","Place"]},"toLocation":{"expectedTypes":["Number","Place"]}}},"BorrowAction":{"extends":"TransferAction","properties":{"lender":{"expectedTypes":["Person"]}}},"DownloadAction":{"extends":"TransferAction","properties":[]},"GiveAction":{"extends":"TransferAction","properties":{"recipient":{"expectedTypes":["Audience","Organization","Person"]}}},"LendAction":{"extends":"TransferAction","properties":{"borrower":{"expectedTypes":["Person"]}}},"ReceiveAction":{"extends":"TransferAction","properties":{"deliveryMethod":{"expectedTypes":["DeliveryMethod"]},"sender":{"expectedTypes":["Audience","Organization","Person"]}}},"ReturnAction":{"extends":"TransferAction","properties":{"recipient":{"expectedTypes":["Audience","Organization","Person"]}}},"SendAction":{"extends":"TransferAction","properties":{"deliveryMethod":{"expectedTypes":["DeliveryMethod"]},"recipient":{"expectedTypes":["Audience","Organization","Person"]}}},"TakeAction":{"extends":"TransferAction","properties":[]},"UpdateAction":{"extends":"Action","properties":{"collection":{"expectedTypes":["Thing"]}}},"AddAction":{"extends":"UpdateAction","properties":[]},"InsertAction":{"extends":"AddAction","properties":{"toLocation":{"expectedTypes":["Number","Place"]}}},"AppendAction":{"extends":"InsertAction","properties":[]},"PrependAction":{"extends":"InsertAction","properties":[]},"DeleteAction":{"extends":"UpdateAction","properties":[]},"ReplaceAction":{"extends":"UpdateAction","properties":{"replacee":{"expectedTypes":["Thing"]},"replacer":{"expectedTypes":["Thing"]}}},"BroadcastService":{"extends":"Thing","properties":{"area":{"expectedTypes":["Place"]},"broadcaster":{"expectedTypes":["Organization"]},"parentService":{"expectedTypes":["BroadcastService"]}}},"Class":{"extends":"Thing","properties":[]},"CreativeWork":{"extends":"Thing","properties":{"about":{"expectedTypes":["Thing"]},"accessibilityAPI":{"expectedTypes":["Text"]},"accessibilityControl":{"expectedTypes":["Text"]},"accessibilityFeature":{"expectedTypes":["Text"]},"accessibilityHazard":{"expectedTypes":["Text"]},"accountablePerson":{"expectedTypes":["Person"]},"aggregateRating":{"expectedTypes":["AggregateRating"]},"alternativeHeadline":{"expectedTypes":["Text"]},"associatedMedia":{"expectedTypes":["MediaObject"]},"audience":{"expectedTypes":["Audience"]},"audio":{"expectedTypes":["AudioObject"]},"author":{"expectedTypes":["Organization","Person"]},"award":{"expectedTypes":["Text"]},"awards":{"expectedTypes":["Text"]},"citation":{"expectedTypes":["CreativeWork","Text"]},"comment":{"expectedTypes":["UserComments"]},"contentLocation":{"expectedTypes":["Place"]},"contentRating":{"expectedTypes":["Text"]},"contributor":{"expectedTypes":["Organization","Person"]},"copyrightHolder":{"expectedTypes":["Organization","Person"]},"copyrightYear":{"expectedTypes":["Number"]},"creator":{"expectedTypes":["Organization","Person"]},"dateCreated":{"expectedTypes":["Date"]},"dateModified":{"expectedTypes":["Date"]},"datePublished":{"expectedTypes":["Date"]},"discussionUrl":{"expectedTypes":["URL"]},"editor":{"expectedTypes":["Person"]},"educationalAlignment":{"expectedTypes":["AlignmentObject"]},"educationalUse":{"expectedTypes":["Text"]},"encoding":{"expectedTypes":["MediaObject"]},"encodings":{"expectedTypes":["MediaObject"]},"genre":{"expectedTypes":["Text"]},"headline":{"expectedTypes":["Text"]},"inLanguage":{"expectedTypes":["Text"]},"interactionCount":{"expectedTypes":["Text"]},"interactivityType":{"expectedTypes":["Text"]},"isBasedOnUrl":{"expectedTypes":["URL"]},"isFamilyFriendly":{"expectedTypes":["Boolean"]},"keywords":{"expectedTypes":["Text"]},"learningResourceType":{"expectedTypes":["Text"]},"mentions":{"expectedTypes":["Thing"]},"offers":{"expectedTypes":["Offer"]},"provider":{"expectedTypes":["Organization","Person"]},"publisher":{"expectedTypes":["Organization"]},"publishingPrinciples":{"expectedTypes":["URL"]},"review":{"expectedTypes":["Review"]},"reviews":{"expectedTypes":["Review"]},"sourceOrganization":{"expectedTypes":["Organization"]},"text":{"expectedTypes":["Text"]},"thumbnailUrl":{"expectedTypes":["URL"]},"timeRequired":{"expectedTypes":["Duration"]},"typicalAgeRange":{"expectedTypes":["Text"]},"version":{"expectedTypes":["Number"]},"video":{"expectedTypes":["VideoObject"]}}},"Article":{"extends":"CreativeWork","properties":{"articleBody":{"expectedTypes":["Text"]},"articleSection":{"expectedTypes":["Text"]},"wordCount":{"expectedTypes":["Integer"]}}},"BlogPosting":{"extends":"Article","properties":[]},"NewsArticle":{"extends":"Article","properties":{"dateline":{"expectedTypes":["Text"]},"printColumn":{"expectedTypes":["Text"]},"printEdition":{"expectedTypes":["Text"]},"printPage":{"expectedTypes":["Text"]},"printSection":{"expectedTypes":["Text"]}}},"ScholarlyArticle":{"extends":"Article","properties":[]},"MedicalScholarlyArticle":{"extends":"ScholarlyArticle","properties":{"publicationType":{"expectedTypes":["Text"]}}},"TechArticle":{"extends":"Article","properties":{"dependencies":{"expectedTypes":["Text"]},"proficiencyLevel":{"expectedTypes":["Text"]}}},"APIReference":{"extends":"TechArticle","properties":{"assembly":{"expectedTypes":["Text"]},"assemblyVersion":{"expectedTypes":["Text"]},"programmingModel":{"expectedTypes":["Text"]},"targetPlatform":{"expectedTypes":["Text"]}}},"Blog":{"extends":"CreativeWork","properties":{"blogPost":{"expectedTypes":["BlogPosting"]},"blogPosts":{"expectedTypes":["BlogPosting"]}}},"Book":{"extends":"CreativeWork","properties":{"bookEdition":{"expectedTypes":["Text"]},"bookFormat":{"expectedTypes":["BookFormatType"]},"illustrator":{"expectedTypes":["Person"]},"isbn":{"expectedTypes":["Text"]},"numberOfPages":{"expectedTypes":["Integer"]}}},"Clip":{"extends":"CreativeWork","properties":{"clipNumber":{"expectedTypes":["Integer"]},"partOfEpisode":{"expectedTypes":["Episode"]},"partOfSeason":{"expectedTypes":["Season"]},"partOfSeries":{"expectedTypes":["Series"]},"position":{"expectedTypes":["Text"]},"publication":{"expectedTypes":["PublicationEvent"]}}},"RadioClip":{"extends":"Clip","properties":[]},"TVClip":{"extends":"Clip","properties":{"partOfTVSeries":{"expectedTypes":["TVSeries"]}}},"Code":{"extends":"CreativeWork","properties":{"codeRepository":{"expectedTypes":["URL"]},"programmingLanguage":{"expectedTypes":["Thing"]},"runtime":{"expectedTypes":["Text"]},"sampleType":{"expectedTypes":["Text"]},"targetProduct":{"expectedTypes":["SoftwareApplication"]}}},"Comment":{"extends":"CreativeWork","properties":[]},"DataCatalog":{"extends":"CreativeWork","properties":{"dataset":{"expectedTypes":["Dataset"]}}},"Dataset":{"extends":"CreativeWork","properties":{"catalog":{"expectedTypes":["DataCatalog"]},"distribution":{"expectedTypes":["DataDownload"]},"spatial":{"expectedTypes":["Place"]},"temporal":{"expectedTypes":["DateTime"]}}},"Diet":{"extends":"CreativeWork","properties":{"dietFeatures":{"expectedTypes":["Text"]},"endorsers":{"expectedTypes":["Organization","Person"]},"expertConsiderations":{"expectedTypes":["Text"]},"overview":{"expectedTypes":["Text"]},"physiologicalBenefits":{"expectedTypes":["Text"]},"proprietaryName":{"expectedTypes":["Text"]},"risks":{"expectedTypes":["Text"]}}},"Episode":{"extends":"CreativeWork","properties":{"actor":{"expectedTypes":["Person"]},"actors":{"expectedTypes":["Person"]},"director":{"expectedTypes":["Person"]},"directors":{"expectedTypes":["Person"]},"episodeNumber":{"expectedTypes":["Integer"]},"musicBy":{"expectedTypes":["MusicGroup","Person"]},"partOfSeason":{"expectedTypes":["Season"]},"partOfSeries":{"expectedTypes":["Series"]},"position":{"expectedTypes":["Text"]},"producer":{"expectedTypes":["Person"]},"productionCompany":{"expectedTypes":["Organization"]},"publication":{"expectedTypes":["PublicationEvent"]},"trailer":{"expectedTypes":["VideoObject"]}}},"RadioEpisode":{"extends":"Episode","properties":[]},"TVEpisode":{"extends":"Episode","properties":{"partOfTVSeries":{"expectedTypes":["TVSeries"]}}},"ExercisePlan":{"extends":"CreativeWork","properties":{"activityDuration":{"expectedTypes":["Duration"]},"activityFrequency":{"expectedTypes":["Text"]},"additionalVariable":{"expectedTypes":["Text"]},"exerciseType":{"expectedTypes":["Text"]},"intensity":{"expectedTypes":["Text"]},"repetitions":{"expectedTypes":["Number"]},"restPeriods":{"expectedTypes":["Text"]},"workload":{"expectedTypes":["Energy"]}}},"ItemList":{"extends":"CreativeWork","properties":{"itemListElement":{"expectedTypes":["Text"]},"itemListOrder":{"expectedTypes":["Text"]}}},"Map":{"extends":"CreativeWork","properties":[]},"MediaObject":{"extends":"CreativeWork","properties":{"associatedArticle":{"expectedTypes":["NewsArticle"]},"bitrate":{"expectedTypes":["Text"]},"contentSize":{"expectedTypes":["Text"]},"contentUrl":{"expectedTypes":["URL"]},"duration":{"expectedTypes":["Duration"]},"embedUrl":{"expectedTypes":["URL"]},"encodesCreativeWork":{"expectedTypes":["CreativeWork"]},"encodingFormat":{"expectedTypes":["Text"]},"expires":{"expectedTypes":["Date"]},"height":{"expectedTypes":["Distance","QuantitativeValue"]},"playerType":{"expectedTypes":["Text"]},"productionCompany":{"expectedTypes":["Organization"]},"publication":{"expectedTypes":["PublicationEvent"]},"regionsAllowed":{"expectedTypes":["Place"]},"requiresSubscription":{"expectedTypes":["Boolean"]},"uploadDate":{"expectedTypes":["Date"]},"width":{"expectedTypes":["Distance","QuantitativeValue"]}}},"AudioObject":{"extends":"MediaObject","properties":{"transcript":{"expectedTypes":["Text"]}}},"DataDownload":{"extends":"MediaObject","properties":[]},"ImageObject":{"extends":"MediaObject","properties":{"caption":{"expectedTypes":["Text"]},"exifData":{"expectedTypes":["Text"]},"representativeOfPage":{"expectedTypes":["Boolean"]},"thumbnail":{"expectedTypes":["ImageObject"]}}},"MusicVideoObject":{"extends":"MediaObject","properties":[]},"VideoObject":{"extends":"MediaObject","properties":{"caption":{"expectedTypes":["Text"]},"thumbnail":{"expectedTypes":["ImageObject"]},"transcript":{"expectedTypes":["Text"]},"videoFrameSize":{"expectedTypes":["Text"]},"videoQuality":{"expectedTypes":["Text"]}}},"Movie":{"extends":"CreativeWork","properties":{"actor":{"expectedTypes":["Person"]},"actors":{"expectedTypes":["Person"]},"director":{"expectedTypes":["Person"]},"directors":{"expectedTypes":["Person"]},"duration":{"expectedTypes":["Duration"]},"musicBy":{"expectedTypes":["MusicGroup","Person"]},"producer":{"expectedTypes":["Person"]},"productionCompany":{"expectedTypes":["Organization"]},"trailer":{"expectedTypes":["VideoObject"]}}},"MusicPlaylist":{"extends":"CreativeWork","properties":{"numTracks":{"expectedTypes":["Integer"]},"track":{"expectedTypes":["MusicRecording"]},"tracks":{"expectedTypes":["MusicRecording"]}}},"MusicAlbum":{"extends":"MusicPlaylist","properties":{"byArtist":{"expectedTypes":["MusicGroup"]}}},"MusicRecording":{"extends":"CreativeWork","properties":{"byArtist":{"expectedTypes":["MusicGroup"]},"duration":{"expectedTypes":["Duration"]},"inAlbum":{"expectedTypes":["MusicAlbum"]},"inPlaylist":{"expectedTypes":["MusicPlaylist"]}}},"Painting":{"extends":"CreativeWork","properties":[]},"Photograph":{"extends":"CreativeWork","properties":[]},"Recipe":{"extends":"CreativeWork","properties":{"cookingMethod":{"expectedTypes":["Text"]},"cookTime":{"expectedTypes":["Duration"]},"ingredients":{"expectedTypes":["Text"]},"nutrition":{"expectedTypes":["NutritionInformation"]},"prepTime":{"expectedTypes":["Duration"]},"recipeCategory":{"expectedTypes":["Text"]},"recipeCuisine":{"expectedTypes":["Text"]},"recipeInstructions":{"expectedTypes":["Text"]},"recipeYield":{"expectedTypes":["Text"]},"totalTime":{"expectedTypes":["Duration"]}}},"Review":{"extends":"CreativeWork","properties":{"itemReviewed":{"expectedTypes":["Thing"]},"reviewBody":{"expectedTypes":["Text"]},"reviewRating":{"expectedTypes":["Rating"]}}},"Sculpture":{"extends":"CreativeWork","properties":[]},"Season":{"extends":"CreativeWork","properties":{"endDate":{"expectedTypes":["Date"]},"episode":{"expectedTypes":["Episode"]},"episodes":{"expectedTypes":["Episode"]},"numberOfEpisodes":{"expectedTypes":["Number"]},"partOfSeries":{"expectedTypes":["Series"]},"position":{"expectedTypes":["Text"]},"producer":{"expectedTypes":["Person"]},"productionCompany":{"expectedTypes":["Organization"]},"seasonNumber":{"expectedTypes":["Integer"]},"startDate":{"expectedTypes":["Date"]},"trailer":{"expectedTypes":["VideoObject"]}}},"RadioSeason":{"extends":"Season","properties":[]},"TVSeason":{"extends":"CreativeWork","properties":{"partOfTVSeries":{"expectedTypes":["TVSeries"]}}},"Series":{"extends":"CreativeWork","properties":{"actor":{"expectedTypes":["Person"]},"actors":{"expectedTypes":["Person"]},"director":{"expectedTypes":["Person"]},"directors":{"expectedTypes":["Person"]},"endDate":{"expectedTypes":["Date"]},"episode":{"expectedTypes":["Episode"]},"episodes":{"expectedTypes":["Episode"]},"musicBy":{"expectedTypes":["MusicGroup","Person"]},"numberOfEpisodes":{"expectedTypes":["Number"]},"numberOfSeasons":{"expectedTypes":["Number"]},"producer":{"expectedTypes":["Person"]},"productionCompany":{"expectedTypes":["Organization"]},"season":{"expectedTypes":["Season"]},"seasons":{"expectedTypes":["Season"]},"startDate":{"expectedTypes":["Date"]},"trailer":{"expectedTypes":["VideoObject"]}}},"RadioSeries":{"extends":"Series","properties":[]},"TVSeries":{"extends":"CreativeWork","properties":[]},"SoftwareApplication":{"extends":"CreativeWork","properties":{"applicationCategory":{"expectedTypes":["Text","URL"]},"applicationSubCategory":{"expectedTypes":["Text","URL"]},"applicationSuite":{"expectedTypes":["Text"]},"countriesNotSupported":{"expectedTypes":["Text"]},"countriesSupported":{"expectedTypes":["Text"]},"device":{"expectedTypes":["Text"]},"downloadUrl":{"expectedTypes":["URL"]},"featureList":{"expectedTypes":["Text","URL"]},"fileFormat":{"expectedTypes":["Text"]},"fileSize":{"expectedTypes":["Integer"]},"installUrl":{"expectedTypes":["URL"]},"memoryRequirements":{"expectedTypes":["Text","URL"]},"operatingSystem":{"expectedTypes":["Text"]},"permissions":{"expectedTypes":["Text"]},"processorRequirements":{"expectedTypes":["Text"]},"releaseNotes":{"expectedTypes":["Text","URL"]},"requirements":{"expectedTypes":["Text","URL"]},"screenshot":{"expectedTypes":["ImageObject","URL"]},"softwareVersion":{"expectedTypes":["Text"]},"storageRequirements":{"expectedTypes":["Text","URL"]}}},"MobileApplication":{"extends":"SoftwareApplication","properties":{"carrierRequirements":{"expectedTypes":["Text"]}}},"WebApplication":{"extends":"SoftwareApplication","properties":{"browserRequirements":{"expectedTypes":["Text"]}}},"WebPage":{"extends":"CreativeWork","properties":{"breadcrumb":{"expectedTypes":["Text"]},"isPartOf":{"expectedTypes":["CollectionPage"]},"lastReviewed":{"expectedTypes":["Date"]},"mainContentOfPage":{"expectedTypes":["WebPageElement"]},"primaryImageOfPage":{"expectedTypes":["ImageObject"]},"relatedLink":{"expectedTypes":["URL"]},"reviewedBy":{"expectedTypes":["Organization","Person"]},"significantLink":{"expectedTypes":["URL"]},"significantLinks":{"expectedTypes":["URL"]},"specialty":{"expectedTypes":["Specialty"]}}},"AboutPage":{"extends":"WebPage","properties":[]},"CheckoutPage":{"extends":"WebPage","properties":[]},"CollectionPage":{"extends":"WebPage","properties":[]},"ImageGallery":{"extends":"CollectionPage","properties":[]},"VideoGallery":{"extends":"CollectionPage","properties":[]},"ContactPage":{"extends":"WebPage","properties":[]},"ItemPage":{"extends":"WebPage","properties":[]},"MedicalWebPage":{"extends":"WebPage","properties":{"aspect":{"expectedTypes":["Text"]}}},"ProfilePage":{"extends":"WebPage","properties":[]},"SearchResultsPage":{"extends":"WebPage","properties":[]},"WebPageElement":{"extends":"CreativeWork","properties":[]},"SiteNavigationElement":{"extends":"WebPageElement","properties":[]},"Table":{"extends":"WebPageElement","properties":[]},"WPAdBlock":{"extends":"WebPageElement","properties":[]},"WPFooter":{"extends":"WebPageElement","properties":[]},"WPHeader":{"extends":"WebPageElement","properties":[]},"WPSideBar":{"extends":"WebPageElement","properties":[]},"Event":{"extends":"Thing","properties":{"attendee":{"expectedTypes":["Organization","Person"]},"attendees":{"expectedTypes":["Organization","Person"]},"doorTime":{"expectedTypes":["DateTime"]},"duration":{"expectedTypes":["Duration"]},"endDate":{"expectedTypes":["Date"]},"eventStatus":{"expectedTypes":["EventStatusType"]},"location":{"expectedTypes":["Place","PostalAddress"]},"offers":{"expectedTypes":["Offer"]},"performer":{"expectedTypes":["Organization","Person"]},"performers":{"expectedTypes":["Organization","Person"]},"previousStartDate":{"expectedTypes":["Date"]},"startDate":{"expectedTypes":["Date"]},"subEvent":{"expectedTypes":["Event"]},"subEvents":{"expectedTypes":["Event"]},"superEvent":{"expectedTypes":["Event"]},"typicalAgeRange":{"expectedTypes":["Text"]}}},"BusinessEvent":{"extends":"Event","properties":[]},"ChildrensEvent":{"extends":"Event","properties":[]},"ComedyEvent":{"extends":"Event","properties":[]},"DanceEvent":{"extends":"Event","properties":[]},"DeliveryEvent":{"extends":"Event","properties":{"accessCode":{"expectedTypes":["Text"]},"availableFrom":{"expectedTypes":["DateTime"]},"availableThrough":{"expectedTypes":["DateTime"]},"hasDeliveryMethod":{"expectedTypes":["DeliveryMethod"]}}},"EducationEvent":{"extends":"Event","properties":[]},"Festival":{"extends":"Event","properties":[]},"FoodEvent":{"extends":"Event","properties":[]},"LiteraryEvent":{"extends":"Event","properties":[]},"MusicEvent":{"extends":"Event","properties":[]},"PublicationEvent":{"extends":"Event","properties":{"free":{"expectedTypes":["Boolean"]},"publishedOn":{"expectedTypes":["BroadcastService"]}}},"BroadcastEvent":{"extends":"PublicationEvent","properties":[]},"OnDemandEvent":{"extends":"PublicationEvent","properties":[]},"SaleEvent":{"extends":"Event","properties":[]},"SocialEvent":{"extends":"Event","properties":[]},"SportsEvent":{"extends":"Event","properties":[]},"TheaterEvent":{"extends":"Event","properties":[]},"UserInteraction":{"extends":"Event","properties":[]},"UserBlocks":{"extends":"UserInteraction","properties":[]},"UserCheckins":{"extends":"UserInteraction","properties":[]},"UserComments":{"extends":"UserInteraction","properties":{"commentText":{"expectedTypes":["Text"]},"commentTime":{"expectedTypes":["Date"]},"creator":{"expectedTypes":["Organization","Person"]},"discusses":{"expectedTypes":["CreativeWork"]},"replyToUrl":{"expectedTypes":["URL"]}}},"UserDownloads":{"extends":"UserInteraction","properties":[]},"UserLikes":{"extends":"UserInteraction","properties":[]},"UserPageVisits":{"extends":"UserInteraction","properties":[]},"UserPlays":{"extends":"UserInteraction","properties":[]},"UserPlusOnes":{"extends":"UserInteraction","properties":[]},"UserTweets":{"extends":"UserInteraction","properties":[]},"VisualArtsEvent":{"extends":"Event","properties":[]},"Intangible":{"extends":"Thing","properties":[]},"AlignmentObject":{"extends":"Intangible","properties":{"alignmentType":{"expectedTypes":["Text"]},"educationalFramework":{"expectedTypes":["Text"]},"targetDescription":{"expectedTypes":["Text"]},"targetName":{"expectedTypes":["Text"]},"targetUrl":{"expectedTypes":["URL"]}}},"Audience":{"extends":"Intangible","properties":{"audienceType":{"expectedTypes":["Text"]},"geographicArea":{"expectedTypes":["AdministrativeArea"]}}},"BusinessAudience":{"extends":"Audience","properties":{"numberofEmployees":{"expectedTypes":["QuantitativeValue"]},"yearlyRevenue":{"expectedTypes":["QuantitativeValue"]},"yearsInOperation":{"expectedTypes":["QuantitativeValue"]}}},"EducationalAudience":{"extends":"Audience","properties":{"educationalRole":{"expectedTypes":["Text"]}}},"MedicalAudience":{"extends":"Audience","properties":[]},"PeopleAudience":{"extends":"Audience","properties":{"healthCondition":{"expectedTypes":["MedicalCondition"]},"requiredGender":{"expectedTypes":["Text"]},"requiredMaxAge":{"expectedTypes":["Integer"]},"requiredMinAge":{"expectedTypes":["Integer"]},"suggestedGender":{"expectedTypes":["Text"]},"suggestedMaxAge":{"expectedTypes":["Number"]},"suggestedMinAge":{"expectedTypes":["Number"]}}},"ParentAudience":{"extends":"PeopleAudience","properties":{"childMaxAge":{"expectedTypes":["Number"]},"childMinAge":{"expectedTypes":["Number"]}}},"Brand":{"extends":"Intangible","properties":{"logo":{"expectedTypes":["ImageObject","URL"]}}},"Demand":{"extends":"Intangible","properties":{"acceptedPaymentMethod":{"expectedTypes":["PaymentMethod"]},"advanceBookingRequirement":{"expectedTypes":["QuantitativeValue"]},"availability":{"expectedTypes":["ItemAvailability"]},"availabilityEnds":{"expectedTypes":["DateTime"]},"availabilityStarts":{"expectedTypes":["DateTime"]},"availableAtOrFrom":{"expectedTypes":["Place"]},"availableDeliveryMethod":{"expectedTypes":["DeliveryMethod"]},"businessFunction":{"expectedTypes":["BusinessFunction"]},"deliveryLeadTime":{"expectedTypes":["QuantitativeValue"]},"eligibleCustomerType":{"expectedTypes":["BusinessEntityType"]},"eligibleDuration":{"expectedTypes":["QuantitativeValue"]},"eligibleQuantity":{"expectedTypes":["QuantitativeValue"]},"eligibleRegion":{"expectedTypes":["GeoShape","Text"]},"eligibleTransactionVolume":{"expectedTypes":["PriceSpecification"]},"gtin13":{"expectedTypes":["Text"]},"gtin14":{"expectedTypes":["Text"]},"gtin8":{"expectedTypes":["Text"]},"includesObject":{"expectedTypes":["TypeAndQuantityNode"]},"inventoryLevel":{"expectedTypes":["QuantitativeValue"]},"itemCondition":{"expectedTypes":["OfferItemCondition"]},"itemOffered":{"expectedTypes":["Product"]},"mpn":{"expectedTypes":["Text"]},"priceSpecification":{"expectedTypes":["PriceSpecification"]},"seller":{"expectedTypes":["Organization","Person"]},"serialNumber":{"expectedTypes":["Text"]},"sku":{"expectedTypes":["Text"]},"validFrom":{"expectedTypes":["DateTime"]},"validThrough":{"expectedTypes":["DateTime"]},"warranty":{"expectedTypes":["WarrantyPromise"]}}},"Enumeration":{"extends":"Intangible","properties":[]},"BookFormatType":{"extends":"Enumeration","properties":[]},"BusinessEntityType":{"extends":"Enumeration","properties":[]},"BusinessFunction":{"extends":"Enumeration","properties":[]},"ContactPointOption":{"extends":"Enumeration","properties":[]},"DayOfWeek":{"extends":"Enumeration","properties":[]},"DeliveryMethod":{"extends":"Enumeration","properties":[]},"LockerDelivery":{"extends":"DeliveryMethod","properties":[]},"OnSitePickup":{"extends":"DeliveryMethod","properties":[]},"ParcelService":{"extends":"DeliveryMethod","properties":[]},"EventStatusType":{"extends":"Enumeration","properties":[]},"ItemAvailability":{"extends":"Enumeration","properties":[]},"OfferItemCondition":{"extends":"Enumeration","properties":[]},"OrderStatus":{"extends":"Enumeration","properties":[]},"PaymentMethod":{"extends":"Enumeration","properties":[]},"CreditCard":{"extends":"PaymentMethod","properties":[]},"QualitativeValue":{"extends":"Enumeration","properties":{"equal":{"expectedTypes":["QualitativeValue"]},"greater":{"expectedTypes":["QualitativeValue"]},"greaterOrEqual":{"expectedTypes":["QualitativeValue"]},"lesser":{"expectedTypes":["QualitativeValue"]},"lesserOrEqual":{"expectedTypes":["QualitativeValue"]},"nonEqual":{"expectedTypes":["QualitativeValue"]},"valueReference":{"expectedTypes":["Enumeration","StructuredValue"]}}},"Specialty":{"extends":"Enumeration","properties":[]},"MedicalSpecialty":{"extends":"MedicalEnumeration","properties":[]},"WarrantyScope":{"extends":"Enumeration","properties":[]},"JobPosting":{"extends":"Intangible","properties":{"baseSalary":{"expectedTypes":["Number"]},"benefits":{"expectedTypes":["Text"]},"datePosted":{"expectedTypes":["Date"]},"educationRequirements":{"expectedTypes":["Text"]},"employmentType":{"expectedTypes":["Text"]},"experienceRequirements":{"expectedTypes":["Text"]},"hiringOrganization":{"expectedTypes":["Organization"]},"incentives":{"expectedTypes":["Text"]},"industry":{"expectedTypes":["Text"]},"jobLocation":{"expectedTypes":["Place"]},"occupationalCategory":{"expectedTypes":["Text"]},"qualifications":{"expectedTypes":["Text"]},"responsibilities":{"expectedTypes":["Text"]},"salaryCurrency":{"expectedTypes":["Text"]},"skills":{"expectedTypes":["Text"]},"specialCommitments":{"expectedTypes":["Text"]},"title":{"expectedTypes":["Text"]},"workHours":{"expectedTypes":["Text"]}}},"Language":{"extends":"Intangible","properties":[]},"Offer":{"extends":"Intangible","properties":{"acceptedPaymentMethod":{"expectedTypes":["PaymentMethod"]},"addOn":{"expectedTypes":["Offer"]},"advanceBookingRequirement":{"expectedTypes":["QuantitativeValue"]},"aggregateRating":{"expectedTypes":["AggregateRating"]},"availability":{"expectedTypes":["ItemAvailability"]},"availabilityEnds":{"expectedTypes":["DateTime"]},"availabilityStarts":{"expectedTypes":["DateTime"]},"availableAtOrFrom":{"expectedTypes":["Place"]},"availableDeliveryMethod":{"expectedTypes":["DeliveryMethod"]},"businessFunction":{"expectedTypes":["BusinessFunction"]},"category":{"expectedTypes":["PhysicalActivityCategory","Text","Thing"]},"deliveryLeadTime":{"expectedTypes":["QuantitativeValue"]},"eligibleCustomerType":{"expectedTypes":["BusinessEntityType"]},"eligibleDuration":{"expectedTypes":["QuantitativeValue"]},"eligibleQuantity":{"expectedTypes":["QuantitativeValue"]},"eligibleRegion":{"expectedTypes":["GeoShape","Text"]},"eligibleTransactionVolume":{"expectedTypes":["PriceSpecification"]},"gtin13":{"expectedTypes":["Text"]},"gtin14":{"expectedTypes":["Text"]},"gtin8":{"expectedTypes":["Text"]},"includesObject":{"expectedTypes":["TypeAndQuantityNode"]},"inventoryLevel":{"expectedTypes":["QuantitativeValue"]},"itemCondition":{"expectedTypes":["OfferItemCondition"]},"itemOffered":{"expectedTypes":["Product"]},"mpn":{"expectedTypes":["Text"]},"price":{"expectedTypes":["Number","Text"]},"priceCurrency":{"expectedTypes":["Text"]},"priceSpecification":{"expectedTypes":["PriceSpecification"]},"priceValidUntil":{"expectedTypes":["Date"]},"review":{"expectedTypes":["Review"]},"reviews":{"expectedTypes":["Review"]},"seller":{"expectedTypes":["Organization","Person"]},"serialNumber":{"expectedTypes":["Text"]},"sku":{"expectedTypes":["Text"]},"validFrom":{"expectedTypes":["DateTime"]},"validThrough":{"expectedTypes":["DateTime"]},"warranty":{"expectedTypes":["WarrantyPromise"]}}},"AggregateOffer":{"extends":"Offer","properties":{"highPrice":{"expectedTypes":["Number","Text"]},"lowPrice":{"expectedTypes":["Number","Text"]},"offerCount":{"expectedTypes":["Integer"]}}},"Order":{"extends":"Intangible","properties":{"acceptedOffer":{"expectedTypes":["Offer"]},"billingAddress":{"expectedTypes":["PostalAddress"]},"confirmationNumber":{"expectedTypes":["Text"]},"customer":{"expectedTypes":["Organization","Person"]},"discount":{"expectedTypes":["Number","Text"]},"discountCode":{"expectedTypes":["Text"]},"discountCurrency":{"expectedTypes":["Text"]},"isGift":{"expectedTypes":["Boolean"]},"merchant":{"expectedTypes":["Organization","Person"]},"orderDate":{"expectedTypes":["DateTime"]},"orderedItem":{"expectedTypes":["Product"]},"orderNumber":{"expectedTypes":["Text"]},"orderStatus":{"expectedTypes":["OrderStatus"]},"paymentDue":{"expectedTypes":["DateTime"]},"paymentMethod":{"expectedTypes":["PaymentMethod"]},"paymentMethodId":{"expectedTypes":["Text"]},"paymentUrl":{"expectedTypes":["URL"]}}},"ParcelDelivery":{"extends":"Intangible","properties":{"carrier":{"expectedTypes":["Organization"]},"deliveryAddress":{"expectedTypes":["PostalAddress"]},"deliveryStatus":{"expectedTypes":["DeliveryEvent"]},"expectedArrivalFrom":{"expectedTypes":["DateTime"]},"expectedArrivalUntil":{"expectedTypes":["DateTime"]},"hasDeliveryMethod":{"expectedTypes":["DeliveryMethod"]},"itemShipped":{"expectedTypes":["Product"]},"originAddress":{"expectedTypes":["PostalAddress"]},"partOfOrder":{"expectedTypes":["Order"]},"trackingNumber":{"expectedTypes":["Text"]},"trackingUrl":{"expectedTypes":["URL"]}}},"Permit":{"extends":"Intangible","properties":{"issuedBy":{"expectedTypes":["Organization"]},"issuedThrough":{"expectedTypes":["Service"]},"permitAudience":{"expectedTypes":["Audience"]},"validFor":{"expectedTypes":["Duration"]},"validFrom":{"expectedTypes":["DateTime"]},"validIn":{"expectedTypes":["AdministrativeArea"]},"validUntil":{"expectedTypes":["Date"]}}},"GovernmentPermit":{"extends":"Permit","properties":[]},"Quantity":{"extends":"Intangible","properties":[]},"Distance":{"extends":"Quantity","properties":[]},"Duration":{"extends":"Quantity","properties":[]},"Energy":{"extends":"Quantity","properties":[]},"Mass":{"extends":"Quantity","properties":[]},"Rating":{"extends":"Intangible","properties":{"bestRating":{"expectedTypes":["Number","Text"]},"ratingValue":{"expectedTypes":["Text"]},"worstRating":{"expectedTypes":["Number","Text"]}}},"AggregateRating":{"extends":"Rating","properties":{"itemReviewed":{"expectedTypes":["Thing"]},"ratingCount":{"expectedTypes":["Number"]},"reviewCount":{"expectedTypes":["Number"]}}},"Service":{"extends":"Intangible","properties":{"availableChannel":{"expectedTypes":["ServiceChannel"]},"produces":{"expectedTypes":["Thing"]},"provider":{"expectedTypes":["Organization","Person"]},"serviceArea":{"expectedTypes":["AdministrativeArea"]},"serviceAudience":{"expectedTypes":["Audience"]},"serviceType":{"expectedTypes":["Text"]}}},"GovernmentService":{"extends":"Service","properties":{"serviceOperator":{"expectedTypes":["Organization"]}}},"ServiceChannel":{"extends":"Intangible","properties":{"availableLanguage":{"expectedTypes":["Language"]},"processingTime":{"expectedTypes":["Duration"]},"providesService":{"expectedTypes":["Service"]},"serviceLocation":{"expectedTypes":["Place"]},"servicePhone":{"expectedTypes":["ContactPoint"]},"servicePostalAddress":{"expectedTypes":["PostalAddress"]},"serviceSmsNumber":{"expectedTypes":["ContactPoint"]},"serviceUrl":{"expectedTypes":["URL"]}}},"StructuredValue":{"extends":"Intangible","properties":[]},"ContactPoint":{"extends":"StructuredValue","properties":{"areaServed":{"expectedTypes":["AdministrativeArea"]},"availableLanguage":{"expectedTypes":["Language"]},"contactOption":{"expectedTypes":["ContactPointOption"]},"contactType":{"expectedTypes":["Text"]},"email":{"expectedTypes":["Text"]},"faxNumber":{"expectedTypes":["Text"]},"hoursAvailable":{"expectedTypes":["OpeningHoursSpecification"]},"productSupported":{"expectedTypes":["Product","Text"]},"telephone":{"expectedTypes":["Text"]}}},"PostalAddress":{"extends":"ContactPoint","properties":{"addressCountry":{"expectedTypes":["Country"]},"addressLocality":{"expectedTypes":["Text"]},"addressRegion":{"expectedTypes":["Text"]},"postalCode":{"expectedTypes":["Text"]},"postOfficeBoxNumber":{"expectedTypes":["Text"]},"streetAddress":{"expectedTypes":["Text"]}}},"GeoCoordinates":{"extends":"StructuredValue","properties":{"elevation":{"expectedTypes":["Number","Text"]},"latitude":{"expectedTypes":["Number","Text"]},"longitude":{"expectedTypes":["Number","Text"]}}},"GeoShape":{"extends":"StructuredValue","properties":{"box":{"expectedTypes":["Text"]},"circle":{"expectedTypes":["Text"]},"elevation":{"expectedTypes":["Number","Text"]},"line":{"expectedTypes":["Text"]},"polygon":{"expectedTypes":["Text"]}}},"NutritionInformation":{"extends":"StructuredValue","properties":{"calories":{"expectedTypes":["Energy"]},"carbohydrateContent":{"expectedTypes":["Mass"]},"cholesterolContent":{"expectedTypes":["Mass"]},"fatContent":{"expectedTypes":["Mass"]},"fiberContent":{"expectedTypes":["Mass"]},"proteinContent":{"expectedTypes":["Mass"]},"saturatedFatContent":{"expectedTypes":["Mass"]},"servingSize":{"expectedTypes":["Text"]},"sodiumContent":{"expectedTypes":["Mass"]},"sugarContent":{"expectedTypes":["Mass"]},"transFatContent":{"expectedTypes":["Mass"]},"unsaturatedFatContent":{"expectedTypes":["Mass"]}}},"OpeningHoursSpecification":{"extends":"StructuredValue","properties":{"closes":{"expectedTypes":["Time"]},"dayOfWeek":{"expectedTypes":["DayOfWeek"]},"opens":{"expectedTypes":["Time"]},"validFrom":{"expectedTypes":["DateTime"]},"validThrough":{"expectedTypes":["DateTime"]}}},"OwnershipInfo":{"extends":"StructuredValue","properties":{"acquiredFrom":{"expectedTypes":["Organization","Person"]},"ownedFrom":{"expectedTypes":["DateTime"]},"ownedThrough":{"expectedTypes":["DateTime"]},"typeOfGood":{"expectedTypes":["Product"]}}},"PriceSpecification":{"extends":"StructuredValue","properties":{"eligibleQuantity":{"expectedTypes":["QuantitativeValue"]},"eligibleTransactionVolume":{"expectedTypes":["PriceSpecification"]},"maxPrice":{"expectedTypes":["Number"]},"minPrice":{"expectedTypes":["Number"]},"price":{"expectedTypes":["Number","Text"]},"priceCurrency":{"expectedTypes":["Text"]},"validFrom":{"expectedTypes":["DateTime"]},"validThrough":{"expectedTypes":["DateTime"]},"valueAddedTaxIncluded":{"expectedTypes":["Boolean"]}}},"DeliveryChargeSpecification":{"extends":"PriceSpecification","properties":{"appliesToDeliveryMethod":{"expectedTypes":["DeliveryMethod"]},"eligibleRegion":{"expectedTypes":["GeoShape","Text"]}}},"PaymentChargeSpecification":{"extends":"PriceSpecification","properties":{"appliesToDeliveryMethod":{"expectedTypes":["DeliveryMethod"]},"appliesToPaymentMethod":{"expectedTypes":["PaymentMethod"]}}},"UnitPriceSpecification":{"extends":"PriceSpecification","properties":{"billingIncrement":{"expectedTypes":["Number"]},"priceType":{"expectedTypes":["Text"]},"unitCode":{"expectedTypes":["Text"]}}},"QuantitativeValue":{"extends":"StructuredValue","properties":{"maxValue":{"expectedTypes":["Number"]},"minValue":{"expectedTypes":["Number"]},"unitCode":{"expectedTypes":["Text"]},"value":{"expectedTypes":["Number"]},"valueReference":{"expectedTypes":["Enumeration","StructuredValue"]}}},"TypeAndQuantityNode":{"extends":"StructuredValue","properties":{"amountOfThisGood":{"expectedTypes":["Number"]},"businessFunction":{"expectedTypes":["BusinessFunction"]},"typeOfGood":{"expectedTypes":["Product"]},"unitCode":{"expectedTypes":["Text"]}}},"WarrantyPromise":{"extends":"StructuredValue","properties":{"durationOfWarranty":{"expectedTypes":["QuantitativeValue"]},"warrantyScope":{"expectedTypes":["WarrantyScope"]}}},"MedicalEntity":{"extends":"Thing","properties":{"code":{"expectedTypes":["MedicalCode"]},"guideline":{"expectedTypes":["MedicalGuideline"]},"medicineSystem":{"expectedTypes":["MedicineSystem"]},"recognizingAuthority":{"expectedTypes":["Organization"]},"relevantSpecialty":{"expectedTypes":["MedicalSpecialty"]},"study":{"expectedTypes":["MedicalStudy"]}}},"AnatomicalStructure":{"extends":"MedicalEntity","properties":{"associatedPathophysiology":{"expectedTypes":["Text"]},"bodyLocation":{"expectedTypes":["Text"]},"connectedTo":{"expectedTypes":["AnatomicalStructure"]},"diagram":{"expectedTypes":["ImageObject"]},"function":{"expectedTypes":["Text"]},"partOfSystem":{"expectedTypes":["AnatomicalSystem"]},"relatedCondition":{"expectedTypes":["MedicalCondition"]},"relatedTherapy":{"expectedTypes":["MedicalTherapy"]},"subStructure":{"expectedTypes":["AnatomicalStructure"]}}},"Bone":{"extends":"AnatomicalStructure","properties":[]},"BrainStructure":{"extends":"AnatomicalStructure","properties":[]},"Joint":{"extends":"AnatomicalStructure","properties":{"biomechnicalClass":{"expectedTypes":["Text"]},"functionalClass":{"expectedTypes":["Text"]},"structuralClass":{"expectedTypes":["Text"]}}},"Ligament":{"extends":"AnatomicalStructure","properties":[]},"Muscle":{"extends":"AnatomicalStructure","properties":{"action":{"expectedTypes":["Text"]},"antagonist":{"expectedTypes":["Muscle"]},"bloodSupply":{"expectedTypes":["Vessel"]},"insertion":{"expectedTypes":["AnatomicalStructure"]},"nerve":{"expectedTypes":["Nerve"]},"origin":{"expectedTypes":["AnatomicalStructure"]}}},"Nerve":{"extends":"AnatomicalStructure","properties":{"branch":{"expectedTypes":["AnatomicalStructure","Nerve"]},"nerveMotor":{"expectedTypes":["Muscle"]},"sensoryUnit":{"expectedTypes":["AnatomicalStructure","SuperficialAnatomy"]},"sourcedFrom":{"expectedTypes":["BrainStructure"]}}},"Vessel":{"extends":"AnatomicalStructure","properties":[]},"Artery":{"extends":"Vessel","properties":{"arterialBranch":{"expectedTypes":["AnatomicalStructure"]},"source":{"expectedTypes":["AnatomicalStructure"]},"supplyTo":{"expectedTypes":["AnatomicalStructure"]}}},"LymphaticVessel":{"extends":"Vessel","properties":{"originatesFrom":{"expectedTypes":["Vessel"]},"regionDrained":{"expectedTypes":["AnatomicalStructure","AnatomicalSystem"]},"runsTo":{"expectedTypes":["Vessel"]}}},"Vein":{"extends":"Vessel","properties":{"drainsTo":{"expectedTypes":["Vessel"]},"regionDrained":{"expectedTypes":["AnatomicalStructure","AnatomicalSystem"]},"tributary":{"expectedTypes":["AnatomicalStructure"]}}},"AnatomicalSystem":{"extends":"MedicalEntity","properties":{"associatedPathophysiology":{"expectedTypes":["Text"]},"comprisedOf":{"expectedTypes":["AnatomicalStructure","AnatomicalSystem"]},"relatedCondition":{"expectedTypes":["MedicalCondition"]},"relatedStructure":{"expectedTypes":["AnatomicalStructure"]},"relatedTherapy":{"expectedTypes":["MedicalTherapy"]}}},"MedicalCause":{"extends":"MedicalEntity","properties":{"causeOf":{"expectedTypes":["MedicalEntity"]}}},"MedicalCondition":{"extends":"MedicalEntity","properties":{"associatedAnatomy":{"expectedTypes":["AnatomicalStructure","AnatomicalSystem","SuperficialAnatomy"]},"cause":{"expectedTypes":["MedicalCause"]},"differentialDiagnosis":{"expectedTypes":["DDxElement"]},"epidemiology":{"expectedTypes":["Text"]},"expectedPrognosis":{"expectedTypes":["Text"]},"naturalProgression":{"expectedTypes":["Text"]},"pathophysiology":{"expectedTypes":["Text"]},"possibleComplication":{"expectedTypes":["Text"]},"possibleTreatment":{"expectedTypes":["MedicalTherapy"]},"primaryPrevention":{"expectedTypes":["MedicalTherapy"]},"riskFactor":{"expectedTypes":["MedicalRiskFactor"]},"secondaryPrevention":{"expectedTypes":["MedicalTherapy"]},"signOrSymptom":{"expectedTypes":["MedicalSignOrSymptom"]},"stage":{"expectedTypes":["MedicalConditionStage"]},"subtype":{"expectedTypes":["Text"]},"typicalTest":{"expectedTypes":["MedicalTest"]}}},"InfectiousDisease":{"extends":"MedicalCondition","properties":{"infectiousAgent":{"expectedTypes":["Text"]},"infectiousAgentClass":{"expectedTypes":["InfectiousAgentClass"]},"transmissionMethod":{"expectedTypes":["Text"]}}},"MedicalContraindication":{"extends":"MedicalEntity","properties":[]},"MedicalDevice":{"extends":"MedicalEntity","properties":{"adverseOutcome":{"expectedTypes":["MedicalEntity"]},"contraindication":{"expectedTypes":["MedicalContraindication"]},"indication":{"expectedTypes":["MedicalIndication"]},"postOp":{"expectedTypes":["Text"]},"preOp":{"expectedTypes":["Text"]},"procedure":{"expectedTypes":["Text"]},"purpose":{"expectedTypes":["MedicalDevicePurpose","Thing"]},"seriousAdverseOutcome":{"expectedTypes":["MedicalEntity"]}}},"MedicalGuideline":{"extends":"MedicalEntity","properties":{"evidenceLevel":{"expectedTypes":["MedicalEvidenceLevel"]},"evidenceOrigin":{"expectedTypes":["Text"]},"guidelineDate":{"expectedTypes":["Date"]},"guidelineSubject":{"expectedTypes":["MedicalEntity"]}}},"MedicalGuidelineContraindication":{"extends":"MedicalGuideline","properties":[]},"MedicalGuidelineRecommendation":{"extends":"MedicalGuideline","properties":{"recommendationStrength":{"expectedTypes":["Text"]}}},"MedicalIndication":{"extends":"MedicalEntity","properties":[]},"ApprovedIndication":{"extends":"MedicalIndication","properties":[]},"PreventionIndication":{"extends":"MedicalIndication","properties":[]},"TreatmentIndication":{"extends":"MedicalIndication","properties":[]},"MedicalIntangible":{"extends":"MedicalEntity","properties":[]},"DDxElement":{"extends":"MedicalIntangible","properties":{"diagnosis":{"expectedTypes":["MedicalCondition"]},"distinguishingSign":{"expectedTypes":["MedicalSignOrSymptom"]}}},"DoseSchedule":{"extends":"MedicalIntangible","properties":{"doseUnit":{"expectedTypes":["Text"]},"doseValue":{"expectedTypes":["Number"]},"frequency":{"expectedTypes":["Text"]},"targetPopulation":{"expectedTypes":["Text"]}}},"MaximumDoseSchedule":{"extends":"DoseSchedule","properties":[]},"RecommendedDoseSchedule":{"extends":"DoseSchedule","properties":[]},"ReportedDoseSchedule":{"extends":"DoseSchedule","properties":[]},"DrugCost":{"extends":"MedicalIntangible","properties":{"applicableLocation":{"expectedTypes":["AdministrativeArea"]},"costCategory":{"expectedTypes":["DrugCostCategory"]},"costCurrency":{"expectedTypes":["Text"]},"costOrigin":{"expectedTypes":["Text"]},"costPerUnit":{"expectedTypes":["Number","Text"]},"drugUnit":{"expectedTypes":["Text"]}}},"DrugLegalStatus":{"extends":"MedicalIntangible","properties":{"applicableLocation":{"expectedTypes":["AdministrativeArea"]}}},"DrugStrength":{"extends":"MedicalIntangible","properties":{"activeIngredient":{"expectedTypes":["Text"]},"availableIn":{"expectedTypes":["AdministrativeArea"]},"strengthUnit":{"expectedTypes":["Text"]},"strengthValue":{"expectedTypes":["Number"]}}},"MedicalCode":{"extends":"MedicalIntangible","properties":{"codeValue":{"expectedTypes":["Text"]},"codingSystem":{"expectedTypes":["Text"]}}},"MedicalConditionStage":{"extends":"MedicalIntangible","properties":{"stageAsNumber":{"expectedTypes":["Number"]},"subStageSuffix":{"expectedTypes":["Text"]}}},"MedicalEnumeration":{"extends":"MedicalIntangible","properties":[]},"DrugCostCategory":{"extends":"MedicalEnumeration","properties":[]},"DrugPregnancyCategory":{"extends":"MedicalEnumeration","properties":[]},"DrugPrescriptionStatus":{"extends":"MedicalEnumeration","properties":[]},"InfectiousAgentClass":{"extends":"MedicalEnumeration","properties":[]},"MedicalDevicePurpose":{"extends":"MedicalEnumeration","properties":[]},"MedicalEvidenceLevel":{"extends":"MedicalEnumeration","properties":[]},"MedicalImagingTechnique":{"extends":"MedicalEnumeration","properties":[]},"MedicalObservationalStudyDesign":{"extends":"MedicalEnumeration","properties":[]},"MedicalProcedureType":{"extends":"MedicalEnumeration","properties":[]},"MedicalStudyStatus":{"extends":"MedicalEnumeration","properties":[]},"MedicalTrialDesign":{"extends":"MedicalEnumeration","properties":[]},"MedicineSystem":{"extends":"MedicalEnumeration","properties":[]},"PhysicalActivityCategory":{"extends":"MedicalEnumeration","properties":[]},"PhysicalExam":{"extends":"MedicalEnumeration","properties":[]},"MedicalProcedure":{"extends":"MedicalEntity","properties":{"followup":{"expectedTypes":["Text"]},"howPerformed":{"expectedTypes":["Text"]},"preparation":{"expectedTypes":["Text"]},"procedureType":{"expectedTypes":["MedicalProcedureType"]}}},"DiagnosticProcedure":{"extends":"MedicalProcedure","properties":[]},"PalliativeProcedure":{"extends":"MedicalProcedure","properties":[]},"TherapeuticProcedure":{"extends":"MedicalProcedure","properties":[]},"MedicalRiskEstimator":{"extends":"MedicalEntity","properties":{"estimatesRiskOf":{"expectedTypes":["MedicalEntity"]},"includedRiskFactor":{"expectedTypes":["MedicalRiskFactor"]}}},"MedicalRiskCalculator":{"extends":"MedicalRiskEstimator","properties":[]},"MedicalRiskScore":{"extends":"MedicalRiskEstimator","properties":{"algorithm":{"expectedTypes":["Text"]}}},"MedicalRiskFactor":{"extends":"MedicalEntity","properties":{"increasesRiskOf":{"expectedTypes":["MedicalEntity"]}}},"MedicalSignOrSymptom":{"extends":"MedicalEntity","properties":{"cause":{"expectedTypes":["MedicalCause"]},"possibleTreatment":{"expectedTypes":["MedicalTherapy"]}}},"MedicalSign":{"extends":"MedicalSignOrSymptom","properties":{"identifyingExam":{"expectedTypes":["PhysicalExam"]},"identifyingTest":{"expectedTypes":["MedicalTest"]}}},"MedicalSymptom":{"extends":"MedicalSignOrSymptom","properties":[]},"MedicalStudy":{"extends":"MedicalEntity","properties":{"outcome":{"expectedTypes":["Text"]},"population":{"expectedTypes":["Text"]},"sponsor":{"expectedTypes":["Organization"]},"status":{"expectedTypes":["MedicalStudyStatus"]},"studyLocation":{"expectedTypes":["AdministrativeArea"]},"studySubject":{"expectedTypes":["MedicalEntity"]}}},"MedicalObservationalStudy":{"extends":"MedicalStudy","properties":{"studyDesign":{"expectedTypes":["MedicalObservationalStudyDesign"]}}},"MedicalTrial":{"extends":"MedicalStudy","properties":{"phase":{"expectedTypes":["Text"]},"trialDesign":{"expectedTypes":["MedicalTrialDesign"]}}},"MedicalTest":{"extends":"MedicalEntity","properties":{"affectedBy":{"expectedTypes":["Drug"]},"normalRange":{"expectedTypes":["Text"]},"signDetected":{"expectedTypes":["MedicalSign"]},"usedToDiagnose":{"expectedTypes":["MedicalCondition"]},"usesDevice":{"expectedTypes":["MedicalDevice"]}}},"BloodTest":{"extends":"MedicalTest","properties":[]},"ImagingTest":{"extends":"MedicalTest","properties":{"imagingTechnique":{"expectedTypes":["MedicalImagingTechnique"]}}},"MedicalTestPanel":{"extends":"MedicalTest","properties":{"subTest":{"expectedTypes":["MedicalTest"]}}},"PathologyTest":{"extends":"MedicalTest","properties":{"tissueSample":{"expectedTypes":["Text"]}}},"MedicalTherapy":{"extends":"MedicalEntity","properties":{"adverseOutcome":{"expectedTypes":["MedicalEntity"]},"contraindication":{"expectedTypes":["MedicalContraindication"]},"duplicateTherapy":{"expectedTypes":["MedicalTherapy"]},"indication":{"expectedTypes":["MedicalIndication"]},"seriousAdverseOutcome":{"expectedTypes":["MedicalEntity"]}}},"DietarySupplement":{"extends":"MedicalTherapy","properties":{"activeIngredient":{"expectedTypes":["Text"]},"background":{"expectedTypes":["Text"]},"dosageForm":{"expectedTypes":["Text"]},"isProprietary":{"expectedTypes":["Boolean"]},"legalStatus":{"expectedTypes":["DrugLegalStatus"]},"manufacturer":{"expectedTypes":["Organization"]},"maximumIntake":{"expectedTypes":["MaximumDoseSchedule"]},"mechanismOfAction":{"expectedTypes":["Text"]},"nonProprietaryName":{"expectedTypes":["Text"]},"recommendedIntake":{"expectedTypes":["RecommendedDoseSchedule"]},"safetyConsideration":{"expectedTypes":["Text"]},"targetPopulation":{"expectedTypes":["Text"]}}},"Drug":{"extends":"MedicalTherapy","properties":{"activeIngredient":{"expectedTypes":["Text"]},"administrationRoute":{"expectedTypes":["Text"]},"alcoholWarning":{"expectedTypes":["Text"]},"availableStrength":{"expectedTypes":["DrugStrength"]},"breastfeedingWarning":{"expectedTypes":["Text"]},"clincalPharmacology":{"expectedTypes":["Text"]},"cost":{"expectedTypes":["DrugCost"]},"dosageForm":{"expectedTypes":["Text"]},"doseSchedule":{"expectedTypes":["DoseSchedule"]},"drugClass":{"expectedTypes":["DrugClass"]},"foodWarning":{"expectedTypes":["Text"]},"interactingDrug":{"expectedTypes":["Drug"]},"isAvailableGenerically":{"expectedTypes":["Boolean"]},"isProprietary":{"expectedTypes":["Boolean"]},"labelDetails":{"expectedTypes":["URL"]},"legalStatus":{"expectedTypes":["DrugLegalStatus"]},"manufacturer":{"expectedTypes":["Organization"]},"mechanismOfAction":{"expectedTypes":["Text"]},"nonProprietaryName":{"expectedTypes":["Text"]},"overdosage":{"expectedTypes":["Text"]},"pregnancyCategory":{"expectedTypes":["DrugPregnancyCategory"]},"pregnancyWarning":{"expectedTypes":["Text"]},"prescribingInfo":{"expectedTypes":["URL"]},"prescriptionStatus":{"expectedTypes":["DrugPrescriptionStatus"]},"relatedDrug":{"expectedTypes":["Drug"]},"warning":{"expectedTypes":["Text","URL"]}}},"DrugClass":{"extends":"MedicalTherapy","properties":{"drug":{"expectedTypes":["Drug"]}}},"LifestyleModification":{"extends":"MedicalTherapy","properties":[]},"PhysicalActivity":{"extends":"LifestyleModification","properties":{"associatedAnatomy":{"expectedTypes":["AnatomicalStructure","AnatomicalSystem","SuperficialAnatomy"]},"category":{"expectedTypes":["PhysicalActivityCategory","Text","Thing"]},"epidemiology":{"expectedTypes":["Text"]},"pathophysiology":{"expectedTypes":["Text"]}}},"PhysicalTherapy":{"extends":"MedicalTherapy","properties":[]},"PsychologicalTreatment":{"extends":"MedicalTherapy","properties":[]},"RadiationTherapy":{"extends":"MedicalTherapy","properties":[]},"SuperficialAnatomy":{"extends":"MedicalEntity","properties":{"associatedPathophysiology":{"expectedTypes":["Text"]},"relatedAnatomy":{"expectedTypes":["AnatomicalStructure","AnatomicalSystem"]},"relatedCondition":{"expectedTypes":["MedicalCondition"]},"relatedTherapy":{"expectedTypes":["MedicalTherapy"]},"significance":{"expectedTypes":["Text"]}}},"Organization":{"extends":"Thing","properties":{"address":{"expectedTypes":["PostalAddress"]},"aggregateRating":{"expectedTypes":["AggregateRating"]},"brand":{"expectedTypes":["Brand","Organization"]},"contactPoint":{"expectedTypes":["ContactPoint"]},"contactPoints":{"expectedTypes":["ContactPoint"]},"department":{"expectedTypes":["Organization"]},"duns":{"expectedTypes":["Text"]},"email":{"expectedTypes":["Text"]},"employee":{"expectedTypes":["Person"]},"employees":{"expectedTypes":["Person"]},"event":{"expectedTypes":["Event"]},"events":{"expectedTypes":["Event"]},"faxNumber":{"expectedTypes":["Text"]},"founder":{"expectedTypes":["Person"]},"founders":{"expectedTypes":["Person"]},"foundingDate":{"expectedTypes":["Date"]},"globalLocationNumber":{"expectedTypes":["Text"]},"hasPOS":{"expectedTypes":["Place"]},"interactionCount":{"expectedTypes":["Text"]},"isicV4":{"expectedTypes":["Text"]},"legalName":{"expectedTypes":["Text"]},"location":{"expectedTypes":["Place","PostalAddress"]},"logo":{"expectedTypes":["ImageObject","URL"]},"makesOffer":{"expectedTypes":["Offer"]},"member":{"expectedTypes":["Organization","Person"]},"members":{"expectedTypes":["Organization","Person"]},"naics":{"expectedTypes":["Text"]},"owns":{"expectedTypes":["OwnershipInfo","Product"]},"review":{"expectedTypes":["Review"]},"reviews":{"expectedTypes":["Review"]},"seeks":{"expectedTypes":["Demand"]},"subOrganization":{"expectedTypes":["Organization"]},"taxID":{"expectedTypes":["Text"]},"telephone":{"expectedTypes":["Text"]},"vatID":{"expectedTypes":["Text"]}}},"Corporation":{"extends":"Organization","properties":{"tickerSymbol":{"expectedTypes":["Text"]}}},"EducationalOrganization":{"extends":"Organization","properties":{"alumni":{"expectedTypes":["Person"]}}},"CollegeOrUniversity":{"extends":"EducationalOrganization","properties":[]},"ElementarySchool":{"extends":"EducationalOrganization","properties":[]},"HighSchool":{"extends":"EducationalOrganization","properties":[]},"MiddleSchool":{"extends":"EducationalOrganization","properties":[]},"Preschool":{"extends":"EducationalOrganization","properties":[]},"School":{"extends":"EducationalOrganization","properties":[]},"GovernmentOrganization":{"extends":"Organization","properties":[]},"LocalBusiness":{"extends":"Organization","properties":{"branchOf":{"expectedTypes":["Organization"]},"currenciesAccepted":{"expectedTypes":["Text"]},"openingHours":{"expectedTypes":["Duration"]},"paymentAccepted":{"expectedTypes":["Text"]},"priceRange":{"expectedTypes":["Text"]}}},"AnimalShelter":{"extends":"LocalBusiness","properties":[]},"AutomotiveBusiness":{"extends":"LocalBusiness","properties":[]},"AutoBodyShop":{"extends":"AutomotiveBusiness","properties":[]},"AutoDealer":{"extends":"AutomotiveBusiness","properties":[]},"AutoPartsStore":{"extends":"AutomotiveBusiness","properties":[]},"AutoRental":{"extends":"AutomotiveBusiness","properties":[]},"AutoRepair":{"extends":"AutomotiveBusiness","properties":[]},"AutoWash":{"extends":"AutomotiveBusiness","properties":[]},"GasStation":{"extends":"AutomotiveBusiness","properties":[]},"MotorcycleDealer":{"extends":"AutomotiveBusiness","properties":[]},"MotorcycleRepair":{"extends":"AutomotiveBusiness","properties":[]},"ChildCare":{"extends":"LocalBusiness","properties":[]},"DryCleaningOrLaundry":{"extends":"LocalBusiness","properties":[]},"EmergencyService":{"extends":"LocalBusiness","properties":[]},"FireStation":{"extends":"CivicStructure","properties":[]},"Hospital":{"extends":"CivicStructure","properties":{"availableService":{"expectedTypes":["MedicalProcedure","MedicalTest","MedicalTherapy"]},"medicalSpecialty":{"expectedTypes":["MedicalSpecialty"]}}},"PoliceStation":{"extends":"CivicStructure","properties":[]},"EmploymentAgency":{"extends":"LocalBusiness","properties":[]},"EntertainmentBusiness":{"extends":"LocalBusiness","properties":[]},"AdultEntertainment":{"extends":"EntertainmentBusiness","properties":[]},"AmusementPark":{"extends":"EntertainmentBusiness","properties":[]},"ArtGallery":{"extends":"EntertainmentBusiness","properties":[]},"Casino":{"extends":"EntertainmentBusiness","properties":[]},"ComedyClub":{"extends":"EntertainmentBusiness","properties":[]},"MovieTheater":{"extends":"CivicStructure","properties":[]},"NightClub":{"extends":"EntertainmentBusiness","properties":[]},"FinancialService":{"extends":"LocalBusiness","properties":[]},"AccountingService":{"extends":"FinancialService","properties":[]},"AutomatedTeller":{"extends":"FinancialService","properties":[]},"BankOrCreditUnion":{"extends":"FinancialService","properties":[]},"InsuranceAgency":{"extends":"FinancialService","properties":[]},"FoodEstablishment":{"extends":"LocalBusiness","properties":{"acceptsReservations":{"expectedTypes":["Text","URL"]},"menu":{"expectedTypes":["Text","URL"]},"servesCuisine":{"expectedTypes":["Text"]}}},"Bakery":{"extends":"FoodEstablishment","properties":[]},"BarOrPub":{"extends":"FoodEstablishment","properties":[]},"Brewery":{"extends":"FoodEstablishment","properties":[]},"CafeOrCoffeeShop":{"extends":"FoodEstablishment","properties":[]},"FastFoodRestaurant":{"extends":"FoodEstablishment","properties":[]},"IceCreamShop":{"extends":"FoodEstablishment","properties":[]},"Restaurant":{"extends":"FoodEstablishment","properties":[]},"Winery":{"extends":"FoodEstablishment","properties":[]},"GovernmentOffice":{"extends":"LocalBusiness","properties":[]},"PostOffice":{"extends":"GovernmentOffice","properties":[]},"HealthAndBeautyBusiness":{"extends":"LocalBusiness","properties":[]},"BeautySalon":{"extends":"HealthAndBeautyBusiness","properties":[]},"DaySpa":{"extends":"HealthAndBeautyBusiness","properties":[]},"HairSalon":{"extends":"HealthAndBeautyBusiness","properties":[]},"HealthClub":{"extends":"HealthAndBeautyBusiness","properties":[]},"NailSalon":{"extends":"HealthAndBeautyBusiness","properties":[]},"TattooParlor":{"extends":"HealthAndBeautyBusiness","properties":[]},"HomeAndConstructionBusiness":{"extends":"LocalBusiness","properties":[]},"Electrician":{"extends":"HomeAndConstructionBusiness","properties":[]},"GeneralContractor":{"extends":"HomeAndConstructionBusiness","properties":[]},"HVACBusiness":{"extends":"HomeAndConstructionBusiness","properties":[]},"HousePainter":{"extends":"HomeAndConstructionBusiness","properties":[]},"Locksmith":{"extends":"HomeAndConstructionBusiness","properties":[]},"MovingCompany":{"extends":"HomeAndConstructionBusiness","properties":[]},"Plumber":{"extends":"HomeAndConstructionBusiness","properties":[]},"RoofingContractor":{"extends":"HomeAndConstructionBusiness","properties":[]},"InternetCafe":{"extends":"LocalBusiness","properties":[]},"Library":{"extends":"LocalBusiness","properties":[]},"LodgingBusiness":{"extends":"LocalBusiness","properties":[]},"BedAndBreakfast":{"extends":"LodgingBusiness","properties":[]},"Hostel":{"extends":"LodgingBusiness","properties":[]},"Hotel":{"extends":"LodgingBusiness","properties":[]},"Motel":{"extends":"LodgingBusiness","properties":[]},"MedicalOrganization":{"extends":"LocalBusiness","properties":[]},"Dentist":{"extends":"MedicalOrganization","properties":[]},"DiagnosticLab":{"extends":"MedicalOrganization","properties":{"availableTest":{"expectedTypes":["MedicalTest"]}}},"MedicalClinic":{"extends":"MedicalOrganization","properties":{"availableService":{"expectedTypes":["MedicalProcedure","MedicalTest","MedicalTherapy"]},"medicalSpecialty":{"expectedTypes":["MedicalSpecialty"]}}},"Optician":{"extends":"MedicalOrganization","properties":[]},"Pharmacy":{"extends":"MedicalOrganization","properties":[]},"Physician":{"extends":"MedicalOrganization","properties":{"availableService":{"expectedTypes":["MedicalProcedure","MedicalTest","MedicalTherapy"]},"hospitalAffiliation":{"expectedTypes":["Hospital"]},"medicalSpecialty":{"expectedTypes":["MedicalSpecialty"]}}},"VeterinaryCare":{"extends":"MedicalOrganization","properties":[]},"ProfessionalService":{"extends":"LocalBusiness","properties":[]},"Attorney":{"extends":"ProfessionalService","properties":[]},"Notary":{"extends":"ProfessionalService","properties":[]},"RadioStation":{"extends":"LocalBusiness","properties":[]},"RealEstateAgent":{"extends":"LocalBusiness","properties":[]},"RecyclingCenter":{"extends":"LocalBusiness","properties":[]},"SelfStorage":{"extends":"LocalBusiness","properties":[]},"ShoppingCenter":{"extends":"LocalBusiness","properties":[]},"SportsActivityLocation":{"extends":"LocalBusiness","properties":[]},"BowlingAlley":{"extends":"SportsActivityLocation","properties":[]},"ExerciseGym":{"extends":"SportsActivityLocation","properties":[]},"GolfCourse":{"extends":"SportsActivityLocation","properties":[]},"PublicSwimmingPool":{"extends":"SportsActivityLocation","properties":[]},"SkiResort":{"extends":"SportsActivityLocation","properties":[]},"SportsClub":{"extends":"SportsActivityLocation","properties":[]},"StadiumOrArena":{"extends":"CivicStructure","properties":[]},"TennisComplex":{"extends":"SportsActivityLocation","properties":[]},"Store":{"extends":"LocalBusiness","properties":[]},"BikeStore":{"extends":"Store","properties":[]},"BookStore":{"extends":"Store","properties":[]},"ClothingStore":{"extends":"Store","properties":[]},"ComputerStore":{"extends":"Store","properties":[]},"ConvenienceStore":{"extends":"Store","properties":[]},"DepartmentStore":{"extends":"Store","properties":[]},"ElectronicsStore":{"extends":"Store","properties":[]},"Florist":{"extends":"Store","properties":[]},"FurnitureStore":{"extends":"Store","properties":[]},"GardenStore":{"extends":"Store","properties":[]},"GroceryStore":{"extends":"Store","properties":[]},"HardwareStore":{"extends":"Store","properties":[]},"HobbyShop":{"extends":"Store","properties":[]},"HomeGoodsStore":{"extends":"Store","properties":[]},"JewelryStore":{"extends":"Store","properties":[]},"LiquorStore":{"extends":"Store","properties":[]},"MensClothingStore":{"extends":"Store","properties":[]},"MobilePhoneStore":{"extends":"Store","properties":[]},"MovieRentalStore":{"extends":"Store","properties":[]},"MusicStore":{"extends":"Store","properties":[]},"OfficeEquipmentStore":{"extends":"Store","properties":[]},"OutletStore":{"extends":"Store","properties":[]},"PawnShop":{"extends":"Store","properties":[]},"PetStore":{"extends":"Store","properties":[]},"ShoeStore":{"extends":"Store","properties":[]},"SportingGoodsStore":{"extends":"Store","properties":[]},"TireShop":{"extends":"Store","properties":[]},"ToyStore":{"extends":"Store","properties":[]},"WholesaleStore":{"extends":"Store","properties":[]},"TelevisionStation":{"extends":"LocalBusiness","properties":[]},"TouristInformationCenter":{"extends":"LocalBusiness","properties":[]},"TravelAgency":{"extends":"LocalBusiness","properties":[]},"NGO":{"extends":"Organization","properties":[]},"PerformingGroup":{"extends":"Organization","properties":[]},"DanceGroup":{"extends":"PerformingGroup","properties":[]},"MusicGroup":{"extends":"PerformingGroup","properties":{"album":{"expectedTypes":["MusicAlbum"]},"albums":{"expectedTypes":["MusicAlbum"]},"musicGroupMember":{"expectedTypes":["Person"]},"track":{"expectedTypes":["MusicRecording"]},"tracks":{"expectedTypes":["MusicRecording"]}}},"TheaterGroup":{"extends":"PerformingGroup","properties":[]},"SportsTeam":{"extends":"Organization","properties":[]},"Person":{"extends":"Thing","properties":{"additionalName":{"expectedTypes":["Text"]},"address":{"expectedTypes":["PostalAddress"]},"affiliation":{"expectedTypes":["Organization"]},"alumniOf":{"expectedTypes":["EducationalOrganization"]},"award":{"expectedTypes":["Text"]},"awards":{"expectedTypes":["Text"]},"birthDate":{"expectedTypes":["Date"]},"brand":{"expectedTypes":["Brand","Organization"]},"children":{"expectedTypes":["Person"]},"colleague":{"expectedTypes":["Person"]},"colleagues":{"expectedTypes":["Person"]},"contactPoint":{"expectedTypes":["ContactPoint"]},"contactPoints":{"expectedTypes":["ContactPoint"]},"deathDate":{"expectedTypes":["Date"]},"duns":{"expectedTypes":["Text"]},"email":{"expectedTypes":["Text"]},"familyName":{"expectedTypes":["Text"]},"faxNumber":{"expectedTypes":["Text"]},"follows":{"expectedTypes":["Person"]},"gender":{"expectedTypes":["Text"]},"givenName":{"expectedTypes":["Text"]},"globalLocationNumber":{"expectedTypes":["Text"]},"hasPOS":{"expectedTypes":["Place"]},"homeLocation":{"expectedTypes":["ContactPoint","Place"]},"honorificPrefix":{"expectedTypes":["Text"]},"honorificSuffix":{"expectedTypes":["Text"]},"interactionCount":{"expectedTypes":["Text"]},"isicV4":{"expectedTypes":["Text"]},"jobTitle":{"expectedTypes":["Text"]},"knows":{"expectedTypes":["Person"]},"makesOffer":{"expectedTypes":["Offer"]},"memberOf":{"expectedTypes":["Organization"]},"naics":{"expectedTypes":["Text"]},"nationality":{"expectedTypes":["Country"]},"owns":{"expectedTypes":["OwnershipInfo","Product"]},"parent":{"expectedTypes":["Person"]},"parents":{"expectedTypes":["Person"]},"performerIn":{"expectedTypes":["Event"]},"relatedTo":{"expectedTypes":["Person"]},"seeks":{"expectedTypes":["Demand"]},"sibling":{"expectedTypes":["Person"]},"siblings":{"expectedTypes":["Person"]},"spouse":{"expectedTypes":["Person"]},"taxID":{"expectedTypes":["Text"]},"telephone":{"expectedTypes":["Text"]},"vatID":{"expectedTypes":["Text"]},"workLocation":{"expectedTypes":["ContactPoint","Place"]},"worksFor":{"expectedTypes":["Organization"]}}},"Place":{"extends":"Thing","properties":{"address":{"expectedTypes":["PostalAddress"]},"aggregateRating":{"expectedTypes":["AggregateRating"]},"containedIn":{"expectedTypes":["Place"]},"event":{"expectedTypes":["Event"]},"events":{"expectedTypes":["Event"]},"faxNumber":{"expectedTypes":["Text"]},"geo":{"expectedTypes":["GeoCoordinates","GeoShape"]},"globalLocationNumber":{"expectedTypes":["Text"]},"interactionCount":{"expectedTypes":["Text"]},"isicV4":{"expectedTypes":["Text"]},"logo":{"expectedTypes":["ImageObject","URL"]},"map":{"expectedTypes":["URL"]},"maps":{"expectedTypes":["URL"]},"openingHoursSpecification":{"expectedTypes":["OpeningHoursSpecification"]},"photo":{"expectedTypes":["ImageObject","Photograph"]},"photos":{"expectedTypes":["ImageObject","Photograph"]},"review":{"expectedTypes":["Review"]},"reviews":{"expectedTypes":["Review"]},"telephone":{"expectedTypes":["Text"]}}},"AdministrativeArea":{"extends":"Place","properties":[]},"City":{"extends":"AdministrativeArea","properties":[]},"Country":{"extends":"AdministrativeArea","properties":[]},"State":{"extends":"AdministrativeArea","properties":[]},"CivicStructure":{"extends":"Place","properties":{"openingHours":{"expectedTypes":["Duration"]}}},"Airport":{"extends":"CivicStructure","properties":[]},"Aquarium":{"extends":"CivicStructure","properties":[]},"Beach":{"extends":"CivicStructure","properties":[]},"BusStation":{"extends":"CivicStructure","properties":[]},"BusStop":{"extends":"CivicStructure","properties":[]},"Campground":{"extends":"CivicStructure","properties":[]},"Cemetery":{"extends":"CivicStructure","properties":[]},"Crematorium":{"extends":"CivicStructure","properties":[]},"EventVenue":{"extends":"CivicStructure","properties":[]},"GovernmentBuilding":{"extends":"CivicStructure","properties":[]},"CityHall":{"extends":"GovernmentBuilding","properties":[]},"Courthouse":{"extends":"GovernmentBuilding","properties":[]},"DefenceEstablishment":{"extends":"GovernmentBuilding","properties":[]},"Embassy":{"extends":"GovernmentBuilding","properties":[]},"LegislativeBuilding":{"extends":"GovernmentBuilding","properties":[]},"Museum":{"extends":"CivicStructure","properties":[]},"MusicVenue":{"extends":"CivicStructure","properties":[]},"Park":{"extends":"CivicStructure","properties":[]},"ParkingFacility":{"extends":"CivicStructure","properties":[]},"PerformingArtsTheater":{"extends":"CivicStructure","properties":[]},"PlaceOfWorship":{"extends":"CivicStructure","properties":[]},"BuddhistTemple":{"extends":"PlaceOfWorship","properties":[]},"CatholicChurch":{"extends":"PlaceOfWorship","properties":[]},"Church":{"extends":"PlaceOfWorship","properties":[]},"HinduTemple":{"extends":"PlaceOfWorship","properties":[]},"Mosque":{"extends":"PlaceOfWorship","properties":[]},"Synagogue":{"extends":"PlaceOfWorship","properties":[]},"Playground":{"extends":"CivicStructure","properties":[]},"RVPark":{"extends":"CivicStructure","properties":[]},"SubwayStation":{"extends":"CivicStructure","properties":[]},"TaxiStand":{"extends":"CivicStructure","properties":[]},"TrainStation":{"extends":"CivicStructure","properties":[]},"Zoo":{"extends":"CivicStructure","properties":[]},"Landform":{"extends":"Place","properties":[]},"BodyOfWater":{"extends":"Landform","properties":[]},"Canal":{"extends":"BodyOfWater","properties":[]},"LakeBodyOfWater":{"extends":"BodyOfWater","properties":[]},"OceanBodyOfWater":{"extends":"BodyOfWater","properties":[]},"Pond":{"extends":"BodyOfWater","properties":[]},"Reservoir":{"extends":"BodyOfWater","properties":[]},"RiverBodyOfWater":{"extends":"BodyOfWater","properties":[]},"SeaBodyOfWater":{"extends":"BodyOfWater","properties":[]},"Waterfall":{"extends":"BodyOfWater","properties":[]},"Continent":{"extends":"Landform","properties":[]},"Mountain":{"extends":"Landform","properties":[]},"Volcano":{"extends":"Landform","properties":[]},"LandmarksOrHistoricalBuildings":{"extends":"Place","properties":[]},"Residence":{"extends":"Place","properties":[]},"ApartmentComplex":{"extends":"Residence","properties":[]},"GatedResidenceCommunity":{"extends":"Residence","properties":[]},"SingleFamilyResidence":{"extends":"Residence","properties":[]},"TouristAttraction":{"extends":"Place","properties":[]},"Product":{"extends":"Thing","properties":{"aggregateRating":{"expectedTypes":["AggregateRating"]},"audience":{"expectedTypes":["Audience"]},"brand":{"expectedTypes":["Brand","Organization"]},"color":{"expectedTypes":["Text"]},"depth":{"expectedTypes":["Distance","QuantitativeValue"]},"gtin13":{"expectedTypes":["Text"]},"gtin14":{"expectedTypes":["Text"]},"gtin8":{"expectedTypes":["Text"]},"height":{"expectedTypes":["Distance","QuantitativeValue"]},"isAccessoryOrSparePartFor":{"expectedTypes":["Product"]},"isConsumableFor":{"expectedTypes":["Product"]},"isRelatedTo":{"expectedTypes":["Product"]},"isSimilarTo":{"expectedTypes":["Product"]},"itemCondition":{"expectedTypes":["OfferItemCondition"]},"logo":{"expectedTypes":["ImageObject","URL"]},"manufacturer":{"expectedTypes":["Organization"]},"model":{"expectedTypes":["ProductModel","Text"]},"mpn":{"expectedTypes":["Text"]},"offers":{"expectedTypes":["Offer"]},"productID":{"expectedTypes":["Text"]},"releaseDate":{"expectedTypes":["Date"]},"review":{"expectedTypes":["Review"]},"reviews":{"expectedTypes":["Review"]},"sku":{"expectedTypes":["Text"]},"weight":{"expectedTypes":["QuantitativeValue"]},"width":{"expectedTypes":["Distance","QuantitativeValue"]}}},"IndividualProduct":{"extends":"Product","properties":{"serialNumber":{"expectedTypes":["Text"]}}},"ProductModel":{"extends":"Product","properties":{"isVariantOf":{"expectedTypes":["ProductModel"]},"predecessorOf":{"expectedTypes":["ProductModel"]},"successorOf":{"expectedTypes":["ProductModel"]}}},"SomeProducts":{"extends":"Product","properties":{"inventoryLevel":{"expectedTypes":["QuantitativeValue"]}}},"Property":{"extends":"Thing","properties":{"domainIncludes":{"expectedTypes":["Class"]},"rangeIncludes":{"expectedTypes":["Class"]}}}}PK���\R6�� libraries/joomla/crypt/crypt.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JCrypt is a Joomla Platform class for handling basic encryption/decryption of data. * * @since 12.1 */ class JCrypt { /** * @var JCryptCipher The encryption cipher object. * @since 12.1 */ private $_cipher; /** * @var JCryptKey The encryption key[/pair)]. * @since 12.1 */ private $_key; /** * Object Constructor takes an optional key to be used for encryption/decryption. If no key is given then the * secret word from the configuration object is used. * * @param JCryptCipher $cipher The encryption cipher object. * @param JCryptKey $key The encryption key[/pair)]. * * @since 12.1 */ public function __construct(JCryptCipher $cipher = null, JCryptKey $key = null) { // Set the encryption key[/pair)]. $this->_key = $key; // Set the encryption cipher. $this->_cipher = isset($cipher) ? $cipher : new JCryptCipherSimple; } /** * Method to decrypt a data string. * * @param string $data The encrypted string to decrypt. * * @return string The decrypted data string. * * @since 12.1 * @throws InvalidArgumentException */ public function decrypt($data) { try { return $this->_cipher->decrypt($data, $this->_key); } catch (InvalidArgumentException $e) { return false; } } /** * Method to encrypt a data string. * * @param string $data The data string to encrypt. * * @return string The encrypted data string. * * @since 12.1 */ public function encrypt($data) { return $this->_cipher->encrypt($data, $this->_key); } /** * Method to generate a new encryption key[/pair] object. * * @param array $options Key generation options. * * @return JCryptKey * * @since 12.1 */ public function generateKey(array $options = array()) { return $this->_cipher->generateKey($options); } /** * Method to set the encryption key[/pair] object. * * @param JCryptKey $key The key object to set. * * @return JCrypt * * @since 12.1 */ public function setKey(JCryptKey $key) { $this->_key = $key; return $this; } /** * Generate random bytes. * * @param integer $length Length of the random data to generate * * @return string Random binary data * * @since 12.1 */ public static function genRandomBytes($length = 16) { $length = (int) $length; $sslStr = ''; // If a secure randomness generator exists use it. if (function_exists('openssl_random_pseudo_bytes')) { $sslStr = openssl_random_pseudo_bytes($length, $strong); if ($strong) { return $sslStr; } } /* * Collect any entropy available in the system along with a number * of time measurements of operating system randomness. */ $bitsPerRound = 2; $maxTimeMicro = 400; $shaHashLength = 20; $randomStr = ''; $total = $length; // Check if we can use /dev/urandom. $urandom = false; $handle = null; // This is PHP 5.3.3 and up if (function_exists('stream_set_read_buffer') && @is_readable('/dev/urandom')) { $handle = @fopen('/dev/urandom', 'rb'); if ($handle) { $urandom = true; } } while ($length > strlen($randomStr)) { $bytes = ($total > $shaHashLength)? $shaHashLength : $total; $total -= $bytes; /* * Collect any entropy available from the PHP system and filesystem. * If we have ssl data that isn't strong, we use it once. */ $entropy = rand() . uniqid(mt_rand(), true) . $sslStr; $entropy .= implode('', @fstat(fopen(__FILE__, 'r'))); $entropy .= memory_get_usage(); $sslStr = ''; if ($urandom) { stream_set_read_buffer($handle, 0); $entropy .= @fread($handle, $bytes); } else { /* * There is no external source of entropy so we repeat calls * to mt_rand until we are assured there's real randomness in * the result. * * Measure the time that the operations will take on average. */ $samples = 3; $duration = 0; for ($pass = 0; $pass < $samples; ++$pass) { $microStart = microtime(true) * 1000000; $hash = sha1(mt_rand(), true); for ($count = 0; $count < 50; ++$count) { $hash = sha1($hash, true); } $microEnd = microtime(true) * 1000000; $entropy .= $microStart . $microEnd; if ($microStart >= $microEnd) { $microEnd += 1000000; } $duration += $microEnd - $microStart; } $duration = $duration / $samples; /* * Based on the average time, determine the total rounds so that * the total running time is bounded to a reasonable number. */ $rounds = (int) (($maxTimeMicro / $duration) * 50); /* * Take additional measurements. On average we can expect * at least $bitsPerRound bits of entropy from each measurement. */ $iter = $bytes * (int) ceil(8 / $bitsPerRound); for ($pass = 0; $pass < $iter; ++$pass) { $microStart = microtime(true); $hash = sha1(mt_rand(), true); for ($count = 0; $count < $rounds; ++$count) { $hash = sha1($hash, true); } $entropy .= $microStart . microtime(true); } } $randomStr .= sha1($entropy, true); } if ($urandom) { @fclose($handle); } return substr($randomStr, 0, $length); } /** * A timing safe comparison method. This defeats hacking * attempts that use timing based attack vectors. * * @param string $known A known string to check against. * @param string $unknown An unknown string to check. * * @return boolean True if the two strings are exactly the same. * * @since 3.2 */ public static function timingSafeCompare($known, $unknown) { // Prevent issues if string length is 0 $known .= chr(0); $unknown .= chr(0); $knownLength = strlen($known); $unknownLength = strlen($unknown); // Set the result to the difference between the lengths $result = $knownLength - $unknownLength; // Note that we ALWAYS iterate over the user-supplied length to prevent leaking length info. for ($i = 0; $i < $unknownLength; $i++) { // Using % here is a trick to prevent notices. It's safe, since if the lengths are different, $result is already non-0 $result |= (ord($known[$i % $knownLength]) ^ ord($unknown[$i])); } // They are only identical strings if $result is exactly 0... return $result === 0; } /** * Tests for the availability of updated crypt(). * Based on a method by Anthony Ferrera * * @return boolean Always returns true since 3.3 * * @note To be removed when PHP 5.3.7 or higher is the minimum supported version. * @see https://github.com/ircmaxell/password_compat/blob/master/version-test.php * @since 3.2 * @deprecated 4.0 */ public static function hasStrongPasswordSupport() { // Log usage of deprecated function JLog::add(__METHOD__ . '() is deprecated without replacement.', JLog::WARNING, 'deprecated'); if (!defined('PASSWORD_DEFAULT')) { // Always make sure that the password hashing API has been defined. include_once JPATH_ROOT . '/vendor/ircmaxell/password-compat/lib/password.php'; } return true; } } PK���\�[�[ll#libraries/joomla/crypt/password.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Password Hashing Interface * * @since 12.2 */ interface JCryptPassword { const BLOWFISH = '$2y$'; const JOOMLA = 'Joomla'; const PBKDF = '$pbkdf$'; const MD5 = '$1$'; /** * Creates a password hash * * @param string $password The password to hash. * @param string $type The type of hash. This determines the prefix of the hashing function. * * @return string The hashed password. * * @since 12.2 */ public function create($password, $type = null); /** * Verifies a password hash * * @param string $password The password to verify. * @param string $hash The password hash to check. * * @return boolean True if the password is valid, false otherwise. * * @since 12.2 */ public function verify($password, $hash); /** * Sets a default prefix * * @param string $type The prefix to set as default * * @return void * * @since 12.3 */ public function setDefaultType($type); /** * Gets the default type * * @return void * * @since 12.3 */ public function getDefaultType(); } PK���\,T'���*libraries/joomla/crypt/password/simple.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Password Crypter * * @since 12.2 */ class JCryptPasswordSimple implements JCryptPassword { /** * @var integer The cost parameter for hashing algorithms. * @since 12.2 */ protected $cost = 10; /** * @var string The default hash type * @since 12.3 */ protected $defaultType = '$2y$'; /** * Creates a password hash * * @param string $password The password to hash. * @param string $type The hash type. * * @return mixed The hashed password or false if the password is too long. * * @since 12.2 * @throws InvalidArgumentException */ public function create($password, $type = null) { if (empty($type)) { $type = $this->defaultType; } switch ($type) { case '$2a$': case JCryptPassword::BLOWFISH: if (JCrypt::hasStrongPasswordSupport()) { $type = '$2y$'; } else { $type = '$2a$'; } $salt = $type . str_pad($this->cost, 2, '0', STR_PAD_LEFT) . '$' . $this->getSalt(22); return crypt($password, $salt); case JCryptPassword::MD5: $salt = $this->getSalt(12); $salt = '$1$' . $salt; return crypt($password, $salt); case JCryptPassword::JOOMLA: $salt = $this->getSalt(32); return md5($password . $salt) . ':' . $salt; default: throw new InvalidArgumentException(sprintf('Hash type %s is not supported', $type)); break; } } /** * Sets the cost parameter for the generated hash for algorithms that use a cost factor. * * @param integer $cost The new cost value. * * @return void * * @since 12.2 */ public function setCost($cost) { $this->cost = $cost; } /** * Generates a salt of specified length. The salt consists of characters in the set [./0-9A-Za-z]. * * @param integer $length The number of characters to return. * * @return string The string of random characters. * * @since 12.2 */ protected function getSalt($length) { $bytes = ceil($length * 6 / 8); $randomData = str_replace('+', '.', base64_encode(JCrypt::genRandomBytes($bytes))); return substr($randomData, 0, $length); } /** * Verifies a password hash * * @param string $password The password to verify. * @param string $hash The password hash to check. * * @return boolean True if the password is valid, false otherwise. * * @since 12.2 */ public function verify($password, $hash) { // Check if the hash is a blowfish hash. if (substr($hash, 0, 4) == '$2a$' || substr($hash, 0, 4) == '$2y$') { if (JCrypt::hasStrongPasswordSupport()) { $type = '$2y$'; } else { $type = '$2a$'; } $hash = $type . substr($hash, 4); return (crypt($password, $hash) === $hash); } // Check if the hash is an MD5 hash. if (substr($hash, 0, 3) == '$1$') { return (crypt($password, $hash) === $hash); } // Check if the hash is a Joomla hash. if (preg_match('#[a-z0-9]{32}:[A-Za-z0-9]{32}#', $hash) === 1) { return md5($password . substr($hash, 33)) == substr($hash, 0, 32); } return false; } /** * Sets a default type * * @param string $type The value to set as default. * * @return void * * @since 12.3 */ public function setDefaultType($type) { if (!empty($type)) { $this->defaultType = $type; } } /** * Gets the default type * * @return string $type The default type * * @since 12.3 */ public function getDefaultType() { return $this->defaultType; } } PK���\=U|��!libraries/joomla/crypt/cipher.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JCrypt cipher interface. * * @since 12.1 */ interface JCryptCipher { /** * Method to decrypt a data string. * * @param string $data The encrypted string to decrypt. * @param JCryptKey $key The key[/pair] object to use for decryption. * * @return string The decrypted data string. * * @since 12.1 */ public function decrypt($data, JCryptKey $key); /** * Method to encrypt a data string. * * @param string $data The data string to encrypt. * @param JCryptKey $key The key[/pair] object to use for encryption. * * @return string The encrypted data string. * * @since 12.1 */ public function encrypt($data, JCryptKey $key); /** * Method to generate a new encryption key[/pair] object. * * @param array $options Key generation options. * * @return JCryptKey * * @since 12.1 */ public function generateKey(array $options = array()); } PK���\T�I�libraries/joomla/crypt/key.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Encryption key object for the Joomla Platform. * * @property-read string $type The key type. * * @since 12.1 */ class JCryptKey { /** * @var string The private key. * @since 12.1 */ public $private; /** * @var string The public key. * @since 12.1 */ public $public; /** * @var string The key type. * @since 12.1 */ protected $type; /** * Constructor. * * @param string $type The key type. * @param string $private The private key. * @param string $public The public key. * * @since 12.1 */ public function __construct($type, $private = null, $public = null) { // Set the key type. $this->type = (string) $type; // Set the optional public/private key strings. $this->private = isset($private) ? (string) $private : null; $this->public = isset($public) ? (string) $public : null; } /** * Magic method to return some protected property values. * * @param string $name The name of the property to return. * * @return mixed * * @since 12.1 */ public function __get($name) { if ($name == 'type') { return $this->type; } else { trigger_error('Cannot access property ' . __CLASS__ . '::' . $name, E_USER_WARNING); } } } PK���\����(libraries/joomla/crypt/cipher/simple.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JCrypt cipher for Simple encryption, decryption and key generation. * * @since 12.1 * @deprecated 4.0 (CMS) */ class JCryptCipherSimple implements JCryptCipher { /** * Method to decrypt a data string. * * @param string $data The encrypted string to decrypt. * @param JCryptKey $key The key[/pair] object to use for decryption. * * @return string The decrypted data string. * * @since 12.1 * @throws InvalidArgumentException */ public function decrypt($data, JCryptKey $key) { // Validate key. if ($key->type != 'simple') { throw new InvalidArgumentException('Invalid key of type: ' . $key->type . '. Expected simple.'); } $decrypted = ''; $tmp = $key->public; // Convert the HEX input into an array of integers and get the number of characters. $chars = $this->_hexToIntArray($data); $charCount = count($chars); // Repeat the key as many times as necessary to ensure that the key is at least as long as the input. for ($i = 0; $i < $charCount; $i = strlen($tmp)) { $tmp = $tmp . $tmp; } // Get the XOR values between the ASCII values of the input and key characters for all input offsets. for ($i = 0; $i < $charCount; $i++) { $decrypted .= chr($chars[$i] ^ ord($tmp[$i])); } return $decrypted; } /** * Method to encrypt a data string. * * @param string $data The data string to encrypt. * @param JCryptKey $key The key[/pair] object to use for encryption. * * @return string The encrypted data string. * * @since 12.1 * @throws InvalidArgumentException */ public function encrypt($data, JCryptKey $key) { // Validate key. if ($key->type != 'simple') { throw new InvalidArgumentException('Invalid key of type: ' . $key->type . '. Expected simple.'); } $encrypted = ''; $tmp = $key->private; // Split up the input into a character array and get the number of characters. $chars = preg_split('//', $data, -1, PREG_SPLIT_NO_EMPTY); $charCount = count($chars); // Repeat the key as many times as necessary to ensure that the key is at least as long as the input. for ($i = 0; $i < $charCount; $i = strlen($tmp)) { $tmp = $tmp . $tmp; } // Get the XOR values between the ASCII values of the input and key characters for all input offsets. for ($i = 0; $i < $charCount; $i++) { $encrypted .= $this->_intToHex(ord($tmp[$i]) ^ ord($chars[$i])); } return $encrypted; } /** * Method to generate a new encryption key[/pair] object. * * @param array $options Key generation options. * * @return JCryptKey * * @since 12.1 */ public function generateKey(array $options = array()) { // Create the new encryption key[/pair] object. $key = new JCryptKey('simple'); // Just a random key of a given length. $key->private = JCrypt::genRandomBytes(256); $key->public = $key->private; return $key; } /** * Convert hex to an integer * * @param string $s The hex string to convert. * @param integer $i The offset? * * @return integer * * @since 11.1 */ private function _hexToInt($s, $i) { $j = (int) $i * 2; $k = 0; $s1 = (string) $s; // Get the character at position $j. $c = substr($s1, $j, 1); // Get the character at position $j + 1. $c1 = substr($s1, $j + 1, 1); switch ($c) { case 'A': $k += 160; break; case 'B': $k += 176; break; case 'C': $k += 192; break; case 'D': $k += 208; break; case 'E': $k += 224; break; case 'F': $k += 240; break; case ' ': $k += 0; break; default: (int) $k = $k + (16 * (int) $c); break; } switch ($c1) { case 'A': $k += 10; break; case 'B': $k += 11; break; case 'C': $k += 12; break; case 'D': $k += 13; break; case 'E': $k += 14; break; case 'F': $k += 15; break; case ' ': $k += 0; break; default: $k += (int) $c1; break; } return $k; } /** * Convert hex to an array of integers * * @param string $hex The hex string to convert to an integer array. * * @return array An array of integers. * * @since 11.1 */ private function _hexToIntArray($hex) { $array = array(); $j = (int) strlen($hex) / 2; for ($i = 0; $i < $j; $i++) { $array[$i] = (int) $this->_hexToInt($hex, $i); } return $array; } /** * Convert an integer to a hexadecimal string. * * @param integer $i An integer value to convert to a hex string. * * @return string * * @since 11.1 */ private function _intToHex($i) { // Sanitize the input. $i = (int) $i; // Get the first character of the hexadecimal string if there is one. $j = (int) ($i / 16); if ($j === 0) { $s = ' '; } else { $s = strtoupper(dechex($j)); } // Get the second character of the hexadecimal string. $k = $i - $j * 16; $s = $s . strtoupper(dechex($k)); return $s; } } PK���\U3� ��-libraries/joomla/crypt/cipher/rijndael256.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JCrypt cipher for Rijndael 256 encryption, decryption and key generation. * * @since 12.1 */ class JCryptCipherRijndael256 extends JCryptCipherMcrypt { /** * @var integer The mcrypt cipher constant. * @see http://www.php.net/manual/en/mcrypt.ciphers.php * @since 12.1 */ protected $type = MCRYPT_RIJNDAEL_256; /** * @var integer The mcrypt block cipher mode. * @see http://www.php.net/manual/en/mcrypt.constants.php * @since 12.1 */ protected $mode = MCRYPT_MODE_CBC; /** * @var string The JCrypt key type for validation. * @since 12.1 */ protected $keyType = 'rijndael256'; } PK���\6+vv&libraries/joomla/crypt/cipher/3des.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JCrypt cipher for Triple DES encryption, decryption and key generation. * * @since 12.1 */ class JCryptCipher3Des extends JCryptCipherMcrypt { /** * @var integer The mcrypt cipher constant. * @see http://www.php.net/manual/en/mcrypt.ciphers.php * @since 12.1 */ protected $type = MCRYPT_3DES; /** * @var integer The mcrypt block cipher mode. * @see http://www.php.net/manual/en/mcrypt.constants.php * @since 12.1 */ protected $mode = MCRYPT_MODE_CBC; /** * @var string The JCrypt key type for validation. * @since 12.1 */ protected $keyType = '3des'; } PK���\�����*libraries/joomla/crypt/cipher/blowfish.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JCrypt cipher for Blowfish encryption, decryption and key generation. * * @since 12.1 */ class JCryptCipherBlowfish extends JCryptCipherMcrypt { /** * @var integer The mcrypt cipher constant. * @see http://www.php.net/manual/en/mcrypt.ciphers.php * @since 12.1 */ protected $type = MCRYPT_BLOWFISH; /** * @var integer The mcrypt block cipher mode. * @see http://www.php.net/manual/en/mcrypt.constants.php * @since 12.1 */ protected $mode = MCRYPT_MODE_CBC; /** * @var string The JCrypt key type for validation. * @since 12.1 */ protected $keyType = 'blowfish'; } PK���\q�(((libraries/joomla/crypt/cipher/mcrypt.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JCrypt cipher for mcrypt algorithm encryption, decryption and key generation. * * @since 12.1 */ abstract class JCryptCipherMcrypt implements JCryptCipher { /** * @var integer The mcrypt cipher constant. * @see http://www.php.net/manual/en/mcrypt.ciphers.php * @since 12.1 */ protected $type; /** * @var integer The mcrypt block cipher mode. * @see http://www.php.net/manual/en/mcrypt.constants.php * @since 12.1 */ protected $mode; /** * @var string The JCrypt key type for validation. * @since 12.1 */ protected $keyType; /** * Constructor. * * @since 12.1 * @throws RuntimeException */ public function __construct() { if (!is_callable('mcrypt_encrypt')) { throw new RuntimeException('The mcrypt extension is not available.'); } } /** * Method to decrypt a data string. * * @param string $data The encrypted string to decrypt. * @param JCryptKey $key The key object to use for decryption. * * @return string The decrypted data string. * * @since 12.1 * @throws InvalidArgumentException */ public function decrypt($data, JCryptKey $key) { // Validate key. if ($key->type != $this->keyType) { throw new InvalidArgumentException('Invalid key of type: ' . $key->type . '. Expected ' . $this->keyType . '.'); } // Decrypt the data. $decrypted = trim(mcrypt_decrypt($this->type, $key->private, $data, $this->mode, $key->public)); return $decrypted; } /** * Method to encrypt a data string. * * @param string $data The data string to encrypt. * @param JCryptKey $key The key object to use for encryption. * * @return string The encrypted data string. * * @since 12.1 * @throws InvalidArgumentException */ public function encrypt($data, JCryptKey $key) { // Validate key. if ($key->type != $this->keyType) { throw new InvalidArgumentException('Invalid key of type: ' . $key->type . '. Expected ' . $this->keyType . '.'); } // Encrypt the data. $encrypted = mcrypt_encrypt($this->type, $key->private, $data, $this->mode, $key->public); return $encrypted; } /** * Method to generate a new encryption key object. * * @param array $options Key generation options. * * @return JCryptKey * * @since 12.1 * @throws InvalidArgumentException */ public function generateKey(array $options = array()) { // Create the new encryption key object. $key = new JCryptKey($this->keyType); // Generate an initialisation vector based on the algorithm. $key->public = mcrypt_create_iv(mcrypt_get_iv_size($this->type, $this->mode)); // Get the salt and password setup. $salt = (isset($options['salt'])) ? $options['salt'] : substr(pack("h*", md5(JCrypt::genRandomBytes())), 0, 16); if (!isset($options['password'])) { throw new InvalidArgumentException('Password is not set.'); } // Generate the derived key. $key->private = $this->pbkdf2($options['password'], $salt, mcrypt_get_key_size($this->type, $this->mode)); return $key; } /** * PBKDF2 Implementation for deriving keys. * * @param string $p Password * @param string $s Salt * @param integer $kl Key length * @param integer $c Iteration count * @param string $a Hash algorithm * * @return string The derived key. * * @see http://en.wikipedia.org/wiki/PBKDF2 * @see http://www.ietf.org/rfc/rfc2898.txt * @since 12.1 */ public function pbkdf2($p, $s, $kl, $c = 10000, $a = 'sha256') { // Hash length. $hl = strlen(hash($a, null, true)); // Key blocks to compute. $kb = ceil($kl / $hl); // Derived key. $dk = ''; // Create the key. for ($block = 1; $block <= $kb; $block++) { // Initial hash for this block. $ib = $b = hash_hmac($a, $s . pack('N', $block), $p, true); // Perform block iterations. for ($i = 1; $i < $c; $i++) { $ib ^= ($b = hash_hmac($a, $b, $p, true)); } // Append the iterated block. $dk .= $ib; } // Return derived key of correct length. return substr($dk, 0, $kl); } } PK���\�@Nvv(libraries/joomla/route/wrapper/route.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JRoute * * @package Joomla.Platform * @subpackage Application * @since 3.4 */ class JRouteWrapperRoute { /** * Helper wrapper method for _ * * @param string $url Absolute or Relative URI to Joomla resource. * @param boolean $xhtml Replace & by & for XML compliance. * @param integer $ssl Secure state for the resolved URI. * * @return string The translated humanly readable URL. * * @see JRoute::_() * @since 3.4 */ public function _($url, $xhtml = true, $ssl = null) { return JRoute::_($url, $xhtml, $ssl); } } PK���\�:2���%libraries/joomla/event/dispatcher.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Event * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Class to handle dispatching of events. * * This is the Observable part of the Observer design pattern * for the event architecture. * * @link https://docs.joomla.org/Tutorial:Plugins Plugin tutorials * @see JPlugin * @since 12.1 */ class JEventDispatcher extends JObject { /** * An array of Observer objects to notify * * @var array * @since 11.3 */ protected $_observers = array(); /** * The state of the observable object * * @var mixed * @since 11.3 */ protected $_state = null; /** * A multi dimensional array of [function][] = key for observers * * @var array * @since 11.3 */ protected $_methods = array(); /** * Stores the singleton instance of the dispatcher. * * @var JEventDispatcher * @since 11.3 */ protected static $instance = null; /** * Returns the global Event Dispatcher object, only creating it * if it doesn't already exist. * * @return JEventDispatcher The EventDispatcher object. * * @since 11.1 */ public static function getInstance() { if (self::$instance === null) { self::$instance = new static; } return self::$instance; } /** * Get the state of the JEventDispatcher object * * @return mixed The state of the object. * * @since 11.3 */ public function getState() { return $this->_state; } /** * Registers an event handler to the event dispatcher * * @param string $event Name of the event to register handler for * @param string $handler Name of the event handler * * @return void * * @since 11.1 * @throws InvalidArgumentException */ public function register($event, $handler) { // Are we dealing with a class or callback type handler? if (is_callable($handler)) { // Ok, function type event handler... let's attach it. $method = array('event' => $event, 'handler' => $handler); $this->attach($method); } elseif (class_exists($handler)) { // Ok, class type event handler... let's instantiate and attach it. $this->attach(new $handler($this)); } else { throw new InvalidArgumentException('Invalid event handler.'); } } /** * Triggers an event by dispatching arguments to all observers that handle * the event and returning their return values. * * @param string $event The event to trigger. * @param array $args An array of arguments. * * @return array An array of results from each function call. * * @since 11.1 */ public function trigger($event, $args = array()) { $result = array(); /* * If no arguments were passed, we still need to pass an empty array to * the call_user_func_array function. */ $args = (array) $args; $event = strtolower($event); // Check if any plugins are attached to the event. if (!isset($this->_methods[$event]) || empty($this->_methods[$event])) { // No Plugins Associated To Event! return $result; } // Loop through all plugins having a method matching our event foreach ($this->_methods[$event] as $key) { // Check if the plugin is present. if (!isset($this->_observers[$key])) { continue; } // Fire the event for an object based observer. if (is_object($this->_observers[$key])) { $args['event'] = $event; $value = $this->_observers[$key]->update($args); } // Fire the event for a function based observer. elseif (is_array($this->_observers[$key])) { $value = call_user_func_array($this->_observers[$key]['handler'], $args); } if (isset($value)) { $result[] = $value; } } return $result; } /** * Attach an observer object * * @param object $observer An observer object to attach * * @return void * * @since 11.3 */ public function attach($observer) { if (is_array($observer)) { if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler'])) { return; } // Make sure we haven't already attached this array as an observer foreach ($this->_observers as $check) { if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler']) { return; } } $this->_observers[] = $observer; $methods = array($observer['event']); } else { if (!($observer instanceof JEvent)) { return; } // Make sure we haven't already attached this object as an observer $class = get_class($observer); foreach ($this->_observers as $check) { if ($check instanceof $class) { return; } } $this->_observers[] = $observer; $methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin')); } end($this->_observers); $key = key($this->_observers); foreach ($methods as $method) { $method = strtolower($method); if (!isset($this->_methods[$method])) { $this->_methods[$method] = array(); } $this->_methods[$method][] = $key; } } /** * Detach an observer object * * @param object $observer An observer object to detach. * * @return boolean True if the observer object was detached. * * @since 11.3 */ public function detach($observer) { $retval = false; $key = array_search($observer, $this->_observers); if ($key !== false) { unset($this->_observers[$key]); $retval = true; foreach ($this->_methods as &$method) { $k = array_search($key, $method); if ($k !== false) { unset($method[$k]); } } } return $retval; } } PK���\ ��� libraries/joomla/event/event.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Event * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JEvent Class * * @since 11.1 */ abstract class JEvent extends JObject { /** * Event object to observe. * * @var object * @since 11.3 */ protected $_subject = null; /** * Constructor * * @param object &$subject The object to observe. * * @since 11.3 */ public function __construct(&$subject) { // Register the observer ($this) so we can be notified $subject->attach($this); // Set the subject to observe $this->_subject = &$subject; } /** * Method to trigger events. * The method first generates the even from the argument array. Then it unsets the argument * since the argument has no bearing on the event handler. * If the method exists it is called and returns its return value. If it does not exist it * returns null. * * @param array &$args Arguments * * @return mixed Routine return value * * @since 11.1 */ public function update(&$args) { // First let's get the event from the argument array. Next we will unset the // event argument as it has no bearing on the method to handle the event. $event = $args['event']; unset($args['event']); /* * If the method to handle an event exists, call it and return its return * value. If it does not exist, return null. */ if (method_exists($this, $event)) { return call_user_func_array(array($this, $event), $args); } else { return null; } } } PK���\�{���(libraries/joomla/archive/extractable.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Archieve class interface * * @since 12.1 */ interface JArchiveExtractable { /** * Extract a compressed file to a given path * * @param string $archive Path to archive to extract * @param string $destination Path to extract archive to * @param array $options Extraction options [may be unused] * * @return boolean True if successful * * @since 12.1 */ public function extract($archive, $destination, array $options = array()); /** * Tests whether this adapter can unpack files on this computer. * * @return boolean True if supported * * @since 12.1 */ public static function isSupported(); } PK���\}�thh$libraries/joomla/archive/archive.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); /** * An Archive handling class * * @since 11.1 */ class JArchive { /** * @var array The array of instantiated archive adapters. * @since 12.1 */ protected static $adapters = array(); /** * Extract an archive file to a directory. * * @param string $archivename The name of the archive file * @param string $extractdir Directory to unpack into * * @return boolean True for success * * @since 11.1 * @throws InvalidArgumentException */ public static function extract($archivename, $extractdir) { $untar = false; $result = false; $ext = JFile::getExt(strtolower($archivename)); // Check if a tar is embedded...gzip/bzip2 can just be plain files! if (JFile::getExt(JFile::stripExt(strtolower($archivename))) == 'tar') { $untar = true; } switch ($ext) { case 'zip': $adapter = self::getAdapter('zip'); if ($adapter) { $result = $adapter->extract($archivename, $extractdir); } break; case 'tar': $adapter = self::getAdapter('tar'); if ($adapter) { $result = $adapter->extract($archivename, $extractdir); } break; case 'tgz': // This format is a tarball gzip'd $untar = true; case 'gz': case 'gzip': // This may just be an individual file (e.g. sql script) $adapter = self::getAdapter('gzip'); if ($adapter) { $config = JFactory::getConfig(); $tmpfname = $config->get('tmp_path') . '/' . uniqid('gzip'); $gzresult = $adapter->extract($archivename, $tmpfname); if ($gzresult instanceof Exception) { @unlink($tmpfname); return false; } if ($untar) { // Try to untar the file $tadapter = self::getAdapter('tar'); if ($tadapter) { $result = $tadapter->extract($tmpfname, $extractdir); } } else { $path = JPath::clean($extractdir); JFolder::create($path); $result = JFile::copy($tmpfname, $path . '/' . JFile::stripExt(basename(strtolower($archivename))), null, 1); } @unlink($tmpfname); } break; case 'tbz2': // This format is a tarball bzip2'd $untar = true; case 'bz2': case 'bzip2': // This may just be an individual file (e.g. sql script) $adapter = self::getAdapter('bzip2'); if ($adapter) { $config = JFactory::getConfig(); $tmpfname = $config->get('tmp_path') . '/' . uniqid('bzip2'); $bzresult = $adapter->extract($archivename, $tmpfname); if ($bzresult instanceof Exception) { @unlink($tmpfname); return false; } if ($untar) { // Try to untar the file $tadapter = self::getAdapter('tar'); if ($tadapter) { $result = $tadapter->extract($tmpfname, $extractdir); } } else { $path = JPath::clean($extractdir); JFolder::create($path); $result = JFile::copy($tmpfname, $path . '/' . JFile::stripExt(basename(strtolower($archivename))), null, 1); } @unlink($tmpfname); } break; default: throw new InvalidArgumentException('Unknown Archive Type'); } if (!$result || $result instanceof Exception) { return false; } return true; } /** * Get a file compression adapter. * * @param string $type The type of adapter (bzip2|gzip|tar|zip). * * @return JArchiveExtractable Adapter for the requested type * * @since 11.1 * @throws UnexpectedValueException */ public static function getAdapter($type) { if (!isset(self::$adapters[$type])) { // Try to load the adapter object $class = 'JArchive' . ucfirst($type); if (!class_exists($class)) { throw new UnexpectedValueException('Unable to load archive', 500); } self::$adapters[$type] = new $class; } return self::$adapters[$type]; } } PK���\�3�@�� libraries/joomla/archive/tar.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.path'); /** * Tar format adapter for the JArchive class * * This class is inspired from and draws heavily in code and concept from the Compress package of * The Horde Project <http://www.horde.org> * * @contributor Michael Slusarz <slusarz@horde.org> * @contributor Michael Cochrane <mike@graftonhall.co.nz> * * @since 11.1 */ class JArchiveTar implements JArchiveExtractable { /** * Tar file types. * * @var array * @since 11.1 */ private $_types = array( 0x0 => 'Unix file', 0x30 => 'File', 0x31 => 'Link', 0x32 => 'Symbolic link', 0x33 => 'Character special file', 0x34 => 'Block special file', 0x35 => 'Directory', 0x36 => 'FIFO special file', 0x37 => 'Contiguous file'); /** * Tar file data buffer * * @var string * @since 11.1 */ private $_data = null; /** * Tar file metadata array * * @var array * @since 11.1 */ private $_metadata = null; /** * Extract a ZIP compressed file to a given path * * @param string $archive Path to ZIP archive to extract * @param string $destination Path to extract archive into * @param array $options Extraction options [unused] * * @return boolean True if successful * * @throws RuntimeException * @since 11.1 */ public function extract($archive, $destination, array $options = array()) { $this->_data = null; $this->_metadata = null; $this->_data = file_get_contents($archive); if (!$this->_data) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to read archive'); } else { throw new RuntimeException('Unable to read archive'); } } $this->_getTarInfo($this->_data); for ($i = 0, $n = count($this->_metadata); $i < $n; $i++) { $type = strtolower($this->_metadata[$i]['type']); if ($type == 'file' || $type == 'unix file') { $buffer = $this->_metadata[$i]['data']; $path = JPath::clean($destination . '/' . $this->_metadata[$i]['name']); // Make sure the destination folder exists if (!JFolder::create(dirname($path))) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to create destination'); } else { throw new RuntimeException('Unable to create destination'); } } if (JFile::write($path, $buffer) === false) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to write entry'); } else { throw new RuntimeException('Unable to write entry'); } } } } return true; } /** * Tests whether this adapter can unpack files on this computer. * * @return boolean True if supported * * @since 11.3 */ public static function isSupported() { return true; } /** * Get the list of files/data from a Tar archive buffer. * * @param string &$data The Tar archive buffer. * * @return array Archive metadata array * <pre> * KEY: Position in the array * VALUES: 'attr' -- File attributes * 'data' -- Raw file contents * 'date' -- File modification time * 'name' -- Filename * 'size' -- Original file size * 'type' -- File type * </pre> * * @since 11.1 */ protected function _getTarInfo(& $data) { $position = 0; $return_array = array(); while ($position < strlen($data)) { if (version_compare(PHP_VERSION, '5.5', '>=')) { $info = @unpack( "Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Ctypeflag/Z100link/Z6magic/Z2version/Z32uname/Z32gname/Z8devmajor/Z8devminor", substr($data, $position) ); } else { $info = @unpack( "a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/Ctypeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor", substr($data, $position) ); } /** * This variable has been set in the previous loop, * meaning that the filename was present in the previous block * to allow more than 100 characters - see below */ if (isset($longlinkfilename)) { $info['filename'] = $longlinkfilename; unset($longlinkfilename); } if (!$info) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to decompress data'); } else { throw new RuntimeException('Unable to decompress data'); } } $position += 512; $contents = substr($data, $position, octdec($info['size'])); $position += ceil(octdec($info['size']) / 512) * 512; if ($info['filename']) { $file = array( 'attr' => null, 'data' => null, 'date' => octdec($info['mtime']), 'name' => trim($info['filename']), 'size' => octdec($info['size']), 'type' => isset($this->_types[$info['typeflag']]) ? $this->_types[$info['typeflag']] : null); if (($info['typeflag'] == 0) || ($info['typeflag'] == 0x30) || ($info['typeflag'] == 0x35)) { // File or folder. $file['data'] = $contents; $mode = hexdec(substr($info['mode'], 4, 3)); $file['attr'] = (($info['typeflag'] == 0x35) ? 'd' : '-') . (($mode & 0x400) ? 'r' : '-') . (($mode & 0x200) ? 'w' : '-') . (($mode & 0x100) ? 'x' : '-') . (($mode & 0x040) ? 'r' : '-') . (($mode & 0x020) ? 'w' : '-') . (($mode & 0x010) ? 'x' : '-') . (($mode & 0x004) ? 'r' : '-') . (($mode & 0x002) ? 'w' : '-') . (($mode & 0x001) ? 'x' : '-'); } elseif (chr($info['typeflag']) == 'L' && $info['filename'] == '././@LongLink') { // GNU tar ././@LongLink support - the filename is actually in the contents, // setting a variable here so we can test in the next loop $longlinkfilename = $contents; // And the file contents are in the next block so we'll need to skip this continue; } else { // Some other type. } $return_array[] = $file; } } $this->_metadata = $return_array; return true; } } PK���\��&՜�,libraries/joomla/archive/wrapper/archive.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JArchive * * @package Joomla.Platform * @subpackage Archive * @since 3.4 */ class JArchiveWrapperArchive { /** * Helper wrapper method for extract * * @param string $archivename The name of the archive file * @param string $extractdir Directory to unpack into * * @return boolean True for success * * @see JArchive::extract() * @since 3.4 * @throws InvalidArgumentException */ public function extract($archivename, $extractdir) { return JArchive::extract($archivename, $extractdir); } /** * Helper wrapper method for getAdapter * * @param string $type The type of adapter (bzip2|gzip|tar|zip). * * @return JArchiveExtractable Adapter for the requested type * * @see JUserHelper::getAdapter() * @since 3.4 */ public function getAdapter($type) { return JArchive::getAdapter($type); } } PK���\ ��!libraries/joomla/archive/gzip.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); /** * Gzip format adapter for the JArchive class * * This class is inspired from and draws heavily in code and concept from the Compress package of * The Horde Project <http://www.horde.org> * * @contributor Michael Slusarz <slusarz@horde.org> * @contributor Michael Cochrane <mike@graftonhall.co.nz> * * @since 11.1 */ class JArchiveGzip implements JArchiveExtractable { /** * Gzip file flags. * * @var array * @since 11.1 */ private $_flags = array('FTEXT' => 0x01, 'FHCRC' => 0x02, 'FEXTRA' => 0x04, 'FNAME' => 0x08, 'FCOMMENT' => 0x10); /** * Gzip file data buffer * * @var string * @since 11.1 */ private $_data = null; /** * Extract a Gzip compressed file to a given path * * @param string $archive Path to ZIP archive to extract * @param string $destination Path to extract archive to * @param array $options Extraction options [unused] * * @return boolean True if successful * * @since 11.1 * @throws RuntimeException */ public function extract($archive, $destination, array $options = array ()) { $this->_data = null; if (!extension_loaded('zlib')) { if (class_exists('JError')) { return JError::raiseWarning(100, 'The zlib extension is not available.'); } else { throw new RuntimeException('The zlib extension is not available.'); } } if (!isset($options['use_streams']) || $options['use_streams'] == false) { $this->_data = file_get_contents($archive); if (!$this->_data) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to read archive'); } else { throw new RuntimeException('Unable to read archive'); } } $position = $this->_getFilePosition(); $buffer = gzinflate(substr($this->_data, $position, strlen($this->_data) - $position)); if (empty($buffer)) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to decompress data'); } else { throw new RuntimeException('Unable to decompress data'); } } if (JFile::write($destination, $buffer) === false) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to write archive'); } else { throw new RuntimeException('Unable to write archive'); } } } else { // New style! streams! $input = JFactory::getStream(); // Use gz $input->set('processingmethod', 'gz'); if (!$input->open($archive)) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to read archive (gz)'); } else { throw new RuntimeException('Unable to read archive (gz)'); } } $output = JFactory::getStream(); if (!$output->open($destination, 'w')) { $input->close(); if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to write archive (gz)'); } else { throw new RuntimeException('Unable to write archive (gz)'); } } do { $this->_data = $input->read($input->get('chunksize', 8196)); if ($this->_data) { if (!$output->write($this->_data)) { $input->close(); if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to write file (gz)'); } else { throw new RuntimeException('Unable to write file (gz)'); } } } } while ($this->_data); $output->close(); $input->close(); } return true; } /** * Tests whether this adapter can unpack files on this computer. * * @return boolean True if supported * * @since 11.3 */ public static function isSupported() { return extension_loaded('zlib'); } /** * Get file data offset for archive * * @return integer Data position marker for archive * * @since 11.1 * @throws RuntimeException */ public function _getFilePosition() { // Gzipped file... unpack it first $position = 0; $info = @ unpack('CCM/CFLG/VTime/CXFL/COS', substr($this->_data, $position + 2)); if (!$info) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to decompress data.'); } else { throw new RuntimeException('Unable to decompress data.'); } } $position += 10; if ($info['FLG'] & $this->_flags['FEXTRA']) { $XLEN = unpack('vLength', substr($this->_data, $position + 0, 2)); $XLEN = $XLEN['Length']; $position += $XLEN + 2; } if ($info['FLG'] & $this->_flags['FNAME']) { $filenamePos = strpos($this->_data, "\x0", $position); $position = $filenamePos + 1; } if ($info['FLG'] & $this->_flags['FCOMMENT']) { $commentPos = strpos($this->_data, "\x0", $position); $position = $commentPos + 1; } if ($info['FLG'] & $this->_flags['FHCRC']) { $hcrc = unpack('vCRC', substr($this->_data, $position + 0, 2)); $hcrc = $hcrc['CRC']; $position += 2; } return $position; } } PK���\q�jVII"libraries/joomla/archive/bzip2.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); jimport('joomla.filesystem.stream'); /** * Bzip2 format adapter for the JArchive class * * @since 11.1 */ class JArchiveBzip2 implements JArchiveExtractable { /** * Bzip2 file data buffer * * @var string * @since 11.1 */ private $_data = null; /** * Extract a Bzip2 compressed file to a given path * * @param string $archive Path to Bzip2 archive to extract * @param string $destination Path to extract archive to * @param array $options Extraction options [unused] * * @return boolean True if successful * * @since 11.1 * @throws RuntimeException */ public function extract($archive, $destination, array $options = array ()) { $this->_data = null; if (!extension_loaded('bz2')) { if (class_exists('JError')) { return JError::raiseWarning(100, 'The bz2 extension is not available.'); } else { throw new RuntimeException('The bz2 extension is not available.'); } } if (!isset($options['use_streams']) || $options['use_streams'] == false) { // Old style: read the whole file and then parse it $this->_data = file_get_contents($archive); if (!$this->_data) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to read archive'); } else { throw new RuntimeException('Unable to read archive'); } } $buffer = bzdecompress($this->_data); unset($this->_data); if (empty($buffer)) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to decompress data'); } else { throw new RuntimeException('Unable to decompress data'); } } if (JFile::write($destination, $buffer) === false) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to write archive'); } else { throw new RuntimeException('Unable to write archive'); } } } else { // New style! streams! $input = JFactory::getStream(); // Use bzip $input->set('processingmethod', 'bz'); if (!$input->open($archive)) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to read archive (bz2)'); } else { throw new RuntimeException('Unable to read archive (bz2)'); } } $output = JFactory::getStream(); if (!$output->open($destination, 'w')) { $input->close(); if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to write archive (bz2)'); } else { throw new RuntimeException('Unable to write archive (bz2)'); } } do { $this->_data = $input->read($input->get('chunksize', 8196)); if ($this->_data) { if (!$output->write($this->_data)) { $input->close(); if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to write archive (bz2)'); } else { throw new RuntimeException('Unable to write archive (bz2)'); } } } } while ($this->_data); $output->close(); $input->close(); } return true; } /** * Tests whether this adapter can unpack files on this computer. * * @return boolean True if supported * * @since 11.3 */ public static function isSupported() { return extension_loaded('bz2'); } } PK���\l�w�_F_F libraries/joomla/archive/zip.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Archive * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); /** * ZIP format adapter for the JArchive class * * The ZIP compression code is partially based on code from: * Eric Mueller <eric@themepark.com> * http://www.zend.com/codex.php?id=535&single=1 * * Deins125 <webmaster@atlant.ru> * http://www.zend.com/codex.php?id=470&single=1 * * The ZIP compression date code is partially based on code from * Peter Listiak <mlady@users.sourceforge.net> * * This class is inspired from and draws heavily in code and concept from the Compress package of * The Horde Project <http://www.horde.org> * * @contributor Chuck Hagenbuch <chuck@horde.org> * @contributor Michael Slusarz <slusarz@horde.org> * @contributor Michael Cochrane <mike@graftonhall.co.nz> * * @since 11.1 */ class JArchiveZip implements JArchiveExtractable { /** * ZIP compression methods. * * @var array * @since 11.1 */ private $_methods = array(0x0 => 'None', 0x1 => 'Shrunk', 0x2 => 'Super Fast', 0x3 => 'Fast', 0x4 => 'Normal', 0x5 => 'Maximum', 0x6 => 'Imploded', 0x8 => 'Deflated'); /** * Beginning of central directory record. * * @var string * @since 11.1 */ private $_ctrlDirHeader = "\x50\x4b\x01\x02"; /** * End of central directory record. * * @var string * @since 11.1 */ private $_ctrlDirEnd = "\x50\x4b\x05\x06\x00\x00\x00\x00"; /** * Beginning of file contents. * * @var string * @since 11.1 */ private $_fileHeader = "\x50\x4b\x03\x04"; /** * ZIP file data buffer * * @var string * @since 11.1 */ private $_data = null; /** * ZIP file metadata array * * @var array * @since 11.1 */ private $_metadata = null; /** * Create a ZIP compressed file from an array of file data. * * @param string $archive Path to save archive. * @param array $files Array of files to add to archive. * * @return boolean True if successful. * * @since 11.1 * * @todo Finish Implementation */ public function create($archive, $files) { $contents = array(); $ctrldir = array(); foreach ($files as $file) { $this->_addToZIPFile($file, $contents, $ctrldir); } return $this->_createZIPFile($contents, $ctrldir, $archive); } /** * Extract a ZIP compressed file to a given path * * @param string $archive Path to ZIP archive to extract * @param string $destination Path to extract archive into * @param array $options Extraction options [unused] * * @return boolean True if successful * * @since 11.1 * @throws RuntimeException */ public function extract($archive, $destination, array $options = array()) { if (!is_file($archive)) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Archive does not exist'); } else { throw new RuntimeException('Archive does not exist'); } } if ($this->hasNativeSupport()) { return $this->extractNative($archive, $destination); } else { return $this->extractCustom($archive, $destination); } } /** * Tests whether this adapter can unpack files on this computer. * * @return boolean True if supported * * @since 11.3 */ public static function isSupported() { return (self::hasNativeSupport() || extension_loaded('zlib')); } /** * Method to determine if the server has native zip support for faster handling * * @return boolean True if php has native ZIP support * * @since 11.1 */ public static function hasNativeSupport() { return (function_exists('zip_open') && function_exists('zip_read')); } /** * Checks to see if the data is a valid ZIP file. * * @param string &$data ZIP archive data buffer. * * @return boolean True if valid, false if invalid. * * @since 11.1 */ public function checkZipData(&$data) { if (strpos($data, $this->_fileHeader) === false) { return false; } else { return true; } } /** * Extract a ZIP compressed file to a given path using a php based algorithm that only requires zlib support * * @param string $archive Path to ZIP archive to extract. * @param string $destination Path to extract archive into. * * @return mixed True if successful * * @since 11.1 * @throws RuntimeException */ protected function extractCustom($archive, $destination) { $this->_data = null; $this->_metadata = null; if (!extension_loaded('zlib')) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Zlib not supported'); } else { throw new RuntimeException('Zlib not supported'); } } $this->_data = file_get_contents($archive); if (!$this->_data) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to read archive (zip)'); } else { throw new RuntimeException('Unable to read archive (zip)'); } } if (!$this->_readZipInfo($this->_data)) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Get ZIP Information failed'); } else { throw new RuntimeException('Get ZIP Information failed'); } } for ($i = 0, $n = count($this->_metadata); $i < $n; $i++) { $lastPathCharacter = substr($this->_metadata[$i]['name'], -1, 1); if ($lastPathCharacter !== '/' && $lastPathCharacter !== '\\') { $buffer = $this->_getFileData($i); $path = JPath::clean($destination . '/' . $this->_metadata[$i]['name']); // Make sure the destination folder exists if (!JFolder::create(dirname($path))) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to create destination'); } else { throw new RuntimeException('Unable to create destination'); } } if (JFile::write($path, $buffer) === false) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to write entry'); } else { throw new RuntimeException('Unable to write entry'); } } } } return true; } /** * Extract a ZIP compressed file to a given path using native php api calls for speed * * @param string $archive Path to ZIP archive to extract * @param string $destination Path to extract archive into * * @return boolean True on success * * @since 11.1 * @throws RuntimeException */ protected function extractNative($archive, $destination) { $zip = zip_open($archive); if (is_resource($zip)) { // Make sure the destination folder exists if (!JFolder::create($destination)) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to create destination'); } else { throw new RuntimeException('Unable to create destination'); } } // Read files in the archive while ($file = @zip_read($zip)) { if (zip_entry_open($zip, $file, "r")) { if (substr(zip_entry_name($file), strlen(zip_entry_name($file)) - 1) != "/") { $buffer = zip_entry_read($file, zip_entry_filesize($file)); if (JFile::write($destination . '/' . zip_entry_name($file), $buffer) === false) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to write entry'); } else { throw new RuntimeException('Unable to write entry'); } } zip_entry_close($file); } } else { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to read entry'); } else { throw new RuntimeException('Unable to read entry'); } } } @zip_close($zip); } else { if (class_exists('JError')) { return JError::raiseWarning(100, 'Unable to open archive'); } else { throw new RuntimeException('Unable to open archive'); } } return true; } /** * Get the list of files/data from a ZIP archive buffer. * * <pre> * KEY: Position in zipfile * VALUES: 'attr' -- File attributes * 'crc' -- CRC checksum * 'csize' -- Compressed file size * 'date' -- File modification time * 'name' -- Filename * 'method'-- Compression method * 'size' -- Original file size * 'type' -- File type * </pre> * * @param string &$data The ZIP archive buffer. * * @return boolean True on success * * @since 11.1 * @throws RuntimeException */ private function _readZipInfo(&$data) { $entries = array(); // Find the last central directory header entry $fhLast = strpos($data, $this->_ctrlDirEnd); do { $last = $fhLast; } while (($fhLast = strpos($data, $this->_ctrlDirEnd, $fhLast + 1)) !== false); // Find the central directory offset $offset = 0; if ($last) { $endOfCentralDirectory = unpack( 'vNumberOfDisk/vNoOfDiskWithStartOfCentralDirectory/vNoOfCentralDirectoryEntriesOnDisk/' . 'vTotalCentralDirectoryEntries/VSizeOfCentralDirectory/VCentralDirectoryOffset/vCommentLength', substr($data, $last + 4) ); $offset = $endOfCentralDirectory['CentralDirectoryOffset']; } // Get details from central directory structure. $fhStart = strpos($data, $this->_ctrlDirHeader, $offset); $dataLength = strlen($data); do { if ($dataLength < $fhStart + 31) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Invalid Zip Data'); } else { throw new RuntimeException('Invalid Zip Data'); } } $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength', substr($data, $fhStart + 10, 20)); $name = substr($data, $fhStart + 46, $info['Length']); $entries[$name] = array( 'attr' => null, 'crc' => sprintf("%08s", dechex($info['CRC32'])), 'csize' => $info['Compressed'], 'date' => null, '_dataStart' => null, 'name' => $name, 'method' => $this->_methods[$info['Method']], '_method' => $info['Method'], 'size' => $info['Uncompressed'], 'type' => null ); $entries[$name]['date'] = mktime( (($info['Time'] >> 11) & 0x1f), (($info['Time'] >> 5) & 0x3f), (($info['Time'] << 1) & 0x3e), (($info['Time'] >> 21) & 0x07), (($info['Time'] >> 16) & 0x1f), ((($info['Time'] >> 25) & 0x7f) + 1980) ); if ($dataLength < $fhStart + 43) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Invalid ZIP data'); } else { throw new RuntimeException('Invalid ZIP data'); } } $info = unpack('vInternal/VExternal/VOffset', substr($data, $fhStart + 36, 10)); $entries[$name]['type'] = ($info['Internal'] & 0x01) ? 'text' : 'binary'; $entries[$name]['attr'] = (($info['External'] & 0x10) ? 'D' : '-') . (($info['External'] & 0x20) ? 'A' : '-') . (($info['External'] & 0x03) ? 'S' : '-') . (($info['External'] & 0x02) ? 'H' : '-') . (($info['External'] & 0x01) ? 'R' : '-'); $entries[$name]['offset'] = $info['Offset']; // Get details from local file header since we have the offset $lfhStart = strpos($data, $this->_fileHeader, $entries[$name]['offset']); if ($dataLength < $lfhStart + 34) { if (class_exists('JError')) { return JError::raiseWarning(100, 'Invalid Zip Data'); } else { throw new RuntimeException('Invalid Zip Data'); } } $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength/vExtraLength', substr($data, $lfhStart + 8, 25)); $name = substr($data, $lfhStart + 30, $info['Length']); $entries[$name]['_dataStart'] = $lfhStart + 30 + $info['Length'] + $info['ExtraLength']; // Bump the max execution time because not using the built in php zip libs makes this process slow. @set_time_limit(ini_get('max_execution_time')); } while ((($fhStart = strpos($data, $this->_ctrlDirHeader, $fhStart + 46)) !== false)); $this->_metadata = array_values($entries); return true; } /** * Returns the file data for a file by offsest in the ZIP archive * * @param integer $key The position of the file in the archive. * * @return string Uncompressed file data buffer. * * @since 11.1 */ private function _getFileData($key) { if ($this->_metadata[$key]['_method'] == 0x8) { return gzinflate(substr($this->_data, $this->_metadata[$key]['_dataStart'], $this->_metadata[$key]['csize'])); } elseif ($this->_metadata[$key]['_method'] == 0x0) { /* Files that aren't compressed. */ return substr($this->_data, $this->_metadata[$key]['_dataStart'], $this->_metadata[$key]['csize']); } elseif ($this->_metadata[$key]['_method'] == 0x12) { // If bz2 extension is loaded use it if (extension_loaded('bz2')) { return bzdecompress(substr($this->_data, $this->_metadata[$key]['_dataStart'], $this->_metadata[$key]['csize'])); } } return ''; } /** * Converts a UNIX timestamp to a 4-byte DOS date and time format * (date in high 2-bytes, time in low 2-bytes allowing magnitude * comparison). * * @param int $unixtime The current UNIX timestamp. * * @return int The current date in a 4-byte DOS format. * * @since 11.1 */ protected function _unix2DOSTime($unixtime = null) { $timearray = (is_null($unixtime)) ? getdate() : getdate($unixtime); if ($timearray['year'] < 1980) { $timearray['year'] = 1980; $timearray['mon'] = 1; $timearray['mday'] = 1; $timearray['hours'] = 0; $timearray['minutes'] = 0; $timearray['seconds'] = 0; } return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1); } /** * Adds a "file" to the ZIP archive. * * @param array &$file File data array to add * @param array &$contents An array of existing zipped files. * @param array &$ctrldir An array of central directory information. * * @return void * * @since 11.1 * * @todo Review and finish implementation */ private function _addToZIPFile(array &$file, array &$contents, array &$ctrldir) { $data = &$file['data']; $name = str_replace('\\', '/', $file['name']); /* See if time/date information has been provided. */ $ftime = null; if (isset($file['time'])) { $ftime = $file['time']; } // Get the hex time. $dtime = dechex($this->_unix2DosTime($ftime)); $hexdtime = chr(hexdec($dtime[6] . $dtime[7])) . chr(hexdec($dtime[4] . $dtime[5])) . chr(hexdec($dtime[2] . $dtime[3])) . chr(hexdec($dtime[0] . $dtime[1])); /* Begin creating the ZIP data. */ $fr = $this->_fileHeader; /* Version needed to extract. */ $fr .= "\x14\x00"; /* General purpose bit flag. */ $fr .= "\x00\x00"; /* Compression method. */ $fr .= "\x08\x00"; /* Last modification time/date. */ $fr .= $hexdtime; /* "Local file header" segment. */ $unc_len = strlen($data); $crc = crc32($data); $zdata = gzcompress($data); $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); $c_len = strlen($zdata); /* CRC 32 information. */ $fr .= pack('V', $crc); /* Compressed filesize. */ $fr .= pack('V', $c_len); /* Uncompressed filesize. */ $fr .= pack('V', $unc_len); /* Length of filename. */ $fr .= pack('v', strlen($name)); /* Extra field length. */ $fr .= pack('v', 0); /* File name. */ $fr .= $name; /* "File data" segment. */ $fr .= $zdata; /* Add this entry to array. */ $old_offset = strlen(implode('', $contents)); $contents[] = &$fr; /* Add to central directory record. */ $cdrec = $this->_ctrlDirHeader; /* Version made by. */ $cdrec .= "\x00\x00"; /* Version needed to extract */ $cdrec .= "\x14\x00"; /* General purpose bit flag */ $cdrec .= "\x00\x00"; /* Compression method */ $cdrec .= "\x08\x00"; /* Last mod time/date. */ $cdrec .= $hexdtime; /* CRC 32 information. */ $cdrec .= pack('V', $crc); /* Compressed filesize. */ $cdrec .= pack('V', $c_len); /* Uncompressed filesize. */ $cdrec .= pack('V', $unc_len); /* Length of filename. */ $cdrec .= pack('v', strlen($name)); /* Extra field length. */ $cdrec .= pack('v', 0); /* File comment length. */ $cdrec .= pack('v', 0); /* Disk number start. */ $cdrec .= pack('v', 0); /* Internal file attributes. */ $cdrec .= pack('v', 0); /* External file attributes -'archive' bit set. */ $cdrec .= pack('V', 32); /* Relative offset of local header. */ $cdrec .= pack('V', $old_offset); /* File name. */ $cdrec .= $name; /* Optional extra field, file comment goes here. */ /* Save to central directory array. */ $ctrldir[] = &$cdrec; } /** * Creates the ZIP file. * * Official ZIP file format: http://www.pkware.com/appnote.txt * * @param array &$contents An array of existing zipped files. * @param array &$ctrlDir An array of central directory information. * @param string $path The path to store the archive. * * @return boolean True if successful * * @since 11.1 * * @todo Review and finish implementation */ private function _createZIPFile(array &$contents, array &$ctrlDir, $path) { $data = implode('', $contents); $dir = implode('', $ctrlDir); $buffer = $data . $dir . $this->_ctrlDirEnd . /* Total # of entries "on this disk". */ pack('v', count($ctrlDir)) . /* Total # of entries overall. */ pack('v', count($ctrlDir)) . /* Size of central directory. */ pack('V', strlen($dir)) . /* Offset to start of central dir. */ pack('V', strlen($data)) . /* ZIP file comment length. */ "\x00\x00"; if (JFile::write($path, $buffer) === false) { return false; } else { return true; } } } PK���\?Ċ8�8 libraries/joomla/client/ldap.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Client * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * LDAP client class * * @since 12.1 */ class JClientLdap { /** * @var string Hostname of LDAP server * @since 12.1 */ public $host = null; /** * @var bool Authorization Method to use * @since 12.1 */ public $auth_method = null; /** * @var int Port of LDAP server * @since 12.1 */ public $port = null; /** * @var string Base DN (e.g. o=MyDir) * @since 12.1 */ public $base_dn = null; /** * @var string User DN (e.g. cn=Users,o=MyDir) * @since 12.1 */ public $users_dn = null; /** * @var string Search String * @since 12.1 */ public $search_string = null; /** * @var boolean Use LDAP Version 3 * @since 12.1 */ public $use_ldapV3 = null; /** * @var boolean No referrals (server transfers) * @since 11.1 */ public $no_referrals = null; /** * @var boolean Negotiate TLS (encrypted communications) * @since 12.1 */ public $negotiate_tls = null; /** * @var string Username to connect to server * @since 12.1 */ public $username = null; /** * * @var string Password to connect to server * @since 12.1 */ public $password = null; /** * @var mixed LDAP Resource Identifier * @since 12.1 */ private $_resource = null; /** * * @var string Current DN * @since 12.1 */ private $_dn = null; /** * Constructor * * @param object $configObj An object of configuration variables * * @since 12.1 */ public function __construct($configObj = null) { if (is_object($configObj)) { $vars = get_class_vars(get_class($this)); foreach (array_keys($vars) as $var) { if (substr($var, 0, 1) != '_') { $param = $configObj->get($var); if ($param) { $this->$var = $param; } } } } } /** * Connect to server * * @return boolean True if successful * * @since 12.1 */ public function connect() { if ($this->host == '') { return false; } $this->_resource = @ ldap_connect($this->host, $this->port); if ($this->_resource) { if ($this->use_ldapV3) { if (!@ldap_set_option($this->_resource, LDAP_OPT_PROTOCOL_VERSION, 3)) { return false; } } if (!@ldap_set_option($this->_resource, LDAP_OPT_REFERRALS, (int) $this->no_referrals)) { return false; } if ($this->negotiate_tls) { if (!@ldap_start_tls($this->_resource)) { return false; } } return true; } else { return false; } } /** * Close the connection * * @return void * * @since 12.1 */ public function close() { @ ldap_close($this->_resource); } /** * Sets the DN with some template replacements * * @param string $username The username * @param string $nosub ... * * @return void * * @since 12.1 */ public function setDn($username, $nosub = 0) { if ($this->users_dn == '' || $nosub) { $this->_dn = $username; } elseif (strlen($username)) { $this->_dn = str_replace('[username]', $username, $this->users_dn); } else { $this->_dn = ''; } } /** * Get the DN * * @return string The current dn * * @since 12.1 */ public function getDn() { return $this->_dn; } /** * Anonymously binds to LDAP directory * * @return array * * @since 12.1 */ public function anonymous_bind() { $bindResult = @ldap_bind($this->_resource); return $bindResult; } /** * Binds to the LDAP directory * * @param string $username The username * @param string $password The password * @param string $nosub ... * * @return boolean * * @since 12.1 */ public function bind($username = null, $password = null, $nosub = 0) { if (is_null($username)) { $username = $this->username; } if (is_null($password)) { $password = $this->password; } $this->setDn($username, $nosub); $bindResult = @ldap_bind($this->_resource, $this->getDn(), $password); return $bindResult; } /** * Perform an LDAP search using comma separated search strings * * @param string $search search string of search values * * @return array Search results * * @since 12.1 */ public function simple_search($search) { $results = explode(';', $search); foreach ($results as $key => $result) { $results[$key] = '(' . $result . ')'; } return $this->search($results); } /** * Performs an LDAP search * * @param array $filters Search Filters (array of strings) * @param string $dnoverride DN Override * @param array $attributes An array of attributes to return (if empty, all fields are returned). * * @return array Multidimensional array of results * * @since 12.1 */ public function search(array $filters, $dnoverride = null, array $attributes = array()) { $result = array(); if ($dnoverride) { $dn = $dnoverride; } else { $dn = $this->base_dn; } $resource = $this->_resource; foreach ($filters as $search_filter) { $search_result = @ldap_search($resource, $dn, $search_filter, $attributes); if ($search_result && ($count = @ldap_count_entries($resource, $search_result)) > 0) { for ($i = 0; $i < $count; $i++) { $result[$i] = array(); if (!$i) { $firstentry = @ldap_first_entry($resource, $search_result); } else { $firstentry = @ldap_next_entry($resource, $firstentry); } // Load user-specified attributes $result_array = @ldap_get_attributes($resource, $firstentry); // LDAP returns an array of arrays, fit this into attributes result array foreach ($result_array as $ki => $ai) { if (is_array($ai)) { $subcount = $ai['count']; $result[$i][$ki] = array(); for ($k = 0; $k < $subcount; $k++) { $result[$i][$ki][$k] = $ai[$k]; } } } $result[$i]['dn'] = @ldap_get_dn($resource, $firstentry); } } } return $result; } /** * Replace an entry and return a true or false result * * @param string $dn The DN which contains the attribute you want to replace * @param string $attribute The attribute values you want to replace * * @return mixed result of comparison (true, false, -1 on error) * * @since 12.1 */ public function replace($dn, $attribute) { return @ldap_mod_replace($this->_resource, $dn, $attribute); } /** * Modifies an entry and return a true or false result * * @param string $dn The DN which contains the attribute you want to modify * @param string $attribute The attribute values you want to modify * * @return mixed result of comparison (true, false, -1 on error) * * @since 12.1 */ public function modify($dn, $attribute) { return @ldap_modify($this->_resource, $dn, $attribute); } /** * Removes attribute value from given dn and return a true or false result * * @param string $dn The DN which contains the attribute you want to remove * @param string $attribute The attribute values you want to remove * * @return mixed result of comparison (true, false, -1 on error) * * @since 12.1 */ public function remove($dn, $attribute) { $resource = $this->_resource; return @ldap_mod_del($resource, $dn, $attribute); } /** * Compare an entry and return a true or false result * * @param string $dn The DN which contains the attribute you want to compare * @param string $attribute The attribute whose value you want to compare * @param string $value The value you want to check against the LDAP attribute * * @return mixed result of comparison (true, false, -1 on error) * * @since 12.1 */ public function compare($dn, $attribute, $value) { return @ldap_compare($this->_resource, $dn, $attribute, $value); } /** * Read all or specified attributes of given dn * * @param string $dn The DN of the object you want to read * * @return mixed array of attributes or -1 on error * * @since 12.1 */ public function read($dn) { $base = substr($dn, strpos($dn, ',') + 1); $cn = substr($dn, 0, strpos($dn, ',')); $result = @ldap_read($this->_resource, $base, $cn); if ($result) { return @ldap_get_entries($this->_resource, $result); } else { return $result; } } /** * Deletes a given DN from the tree * * @param string $dn The DN of the object you want to delete * * @return boolean Result of operation * * @since 12.1 */ public function delete($dn) { return @ldap_delete($this->_resource, $dn); } /** * Create a new DN * * @param string $dn The DN where you want to put the object * @param array $entries An array of arrays describing the object to add * * @return boolean Result of operation * * @since 12.1 */ public function create($dn, array $entries) { return @ldap_add($this->_resource, $dn, $entries); } /** * Add an attribute to the given DN * Note: DN has to exist already * * @param string $dn The DN of the entry to add the attribute * @param array $entry An array of arrays with attributes to add * * @return boolean Result of operation * * @since 12.1 */ public function add($dn, array $entry) { return @ldap_mod_add($this->_resource, $dn, $entry); } /** * Rename the entry * * @param string $dn The DN of the entry at the moment * @param string $newdn The DN of the entry should be (only cn=newvalue) * @param string $newparent The full DN of the parent (null by default) * @param boolean $deleteolddn Delete the old values (default) * * @return boolean Result of operation * * @since 12.1 */ public function rename($dn, $newdn, $newparent, $deleteolddn) { return @ldap_rename($this->_resource, $dn, $newdn, $newparent, $deleteolddn); } /** * Returns the error message * * @return string error message * * @since 12.1 */ public function getErrorMsg() { return @ldap_error($this->_resource); } /** * Converts a dot notation IP address to net address (e.g. for Netware, etc) * * @param string $ip IP Address (e.g. xxx.xxx.xxx.xxx) * * @return string Net address * * @since 12.1 */ public static function ipToNetAddress($ip) { $parts = explode('.', $ip); $address = '1#'; foreach ($parts as $int) { $tmp = dechex($int); if (strlen($tmp) != 2) { $tmp = '0' . $tmp; } $address .= '\\' . $tmp; } return $address; } /** * Extract readable network address from the LDAP encoded networkAddress attribute. * * Please keep this document block and author attribution in place. * * Novell Docs, see: http://developer.novell.com/ndk/doc/ndslib/schm_enu/data/sdk5624.html#sdk5624 * for Address types: http://developer.novell.com/ndk/doc/ndslib/index.html?page=/ndk/doc/ndslib/schm_enu/data/sdk4170.html * LDAP Format, String: * taggedData = uint32String "#" octetstring * byte 0 = uint32String = Address Type: 0= IPX Address; 1 = IP Address * byte 1 = char = "#" - separator * byte 2+ = octetstring - the ordinal value of the address * Note: with eDirectory 8.6.2, the IP address (type 1) returns * correctly, however, an IPX address does not seem to. eDir 8.7 may correct this. * Enhancement made by Merijn van de Schoot: * If addresstype is 8 (UDP) or 9 (TCP) do some additional parsing like still returning the IP address * * @param string $networkaddress The network address * * @return array * * @author Jay Burrell, Systems & Networks, Mississippi State University * @since 12.1 */ public static function LDAPNetAddr($networkaddress) { $addr = ""; $addrtype = (int) substr($networkaddress, 0, 1); // Throw away bytes 0 and 1 which should be the addrtype and the "#" separator $networkaddress = substr($networkaddress, 2); if (($addrtype == 8) || ($addrtype = 9)) { // TODO 1.6: If UDP or TCP, (TODO fill addrport and) strip portnumber information from address $networkaddress = substr($networkaddress, (strlen($networkaddress) - 4)); } $addrtypes = array( 'IPX', 'IP', 'SDLC', 'Token Ring', 'OSI', 'AppleTalk', 'NetBEUI', 'Socket', 'UDP', 'TCP', 'UDP6', 'TCP6', 'Reserved (12)', 'URL', 'Count'); $len = strlen($networkaddress); if ($len > 0) { for ($i = 0; $i < $len; $i++) { $byte = substr($networkaddress, $i, 1); $addr .= ord($byte); if (($addrtype == 1) || ($addrtype == 8) || ($addrtype = 9)) { // Dot separate IP addresses... $addr .= "."; } } if (($addrtype == 1) || ($addrtype == 8) || ($addrtype = 9)) { // Strip last period from end of $addr $addr = substr($addr, 0, strlen($addr) - 1); } } else { $addr .= JText::_('JLIB_CLIENT_ERROR_LDAP_ADDRESS_NOT_AVAILABLE'); } return array('protocol' => $addrtypes[$addrtype], 'address' => $addr); } /** * Generates a LDAP compatible password * * @param string $password Clear text password to encrypt * @param string $type Type of password hash, either md5 or SHA * * @return string Encrypted password * * @since 12.1 */ public static function generatePassword($password, $type = 'md5') { switch (strtolower($type)) { case 'sha': $userpassword = '{SHA}' . base64_encode(pack('H*', sha1($password))); break; case 'md5': default: $userpassword = '{MD5}' . base64_encode(pack('H*', md5($password))); break; } return $userpassword; } } /** * Deprecated class placeholder. You should use JClientLdap instead. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) */ class JLDAP extends JClientLdap { /** * Constructor * * @param object $configObj An object of configuration variables * * @since 11.1 */ public function __construct($configObj = null) { JLog::add('JLDAP is deprecated. Use JClientLdap instead.', JLog::WARNING, 'deprecated'); parent::__construct($configObj); } } PK���\�[`�`�`�libraries/joomla/client/ftp.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Client * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** Error Codes: * - 30 : Unable to connect to host * - 31 : Not connected * - 32 : Unable to send command to server * - 33 : Bad username * - 34 : Bad password * - 35 : Bad response * - 36 : Passive mode failed * - 37 : Data transfer error * - 38 : Local filesystem error */ if (!defined('CRLF')) { define('CRLF', "\r\n"); } if (!defined("FTP_AUTOASCII")) { define("FTP_AUTOASCII", -1); } if (!defined("FTP_BINARY")) { define("FTP_BINARY", 1); } if (!defined("FTP_ASCII")) { define("FTP_ASCII", 0); } if (!defined('FTP_NATIVE')) { define('FTP_NATIVE', (function_exists('ftp_connect')) ? 1 : 0); } /** * FTP client class * * @since 12.1 */ class JClientFtp { /** * @var resource Socket resource * @since 12.1 */ protected $_conn = null; /** * @var resource Data port connection resource * @since 12.1 */ protected $_dataconn = null; /** * @var array Passive connection information * @since 12.1 */ protected $_pasv = null; /** * @var string Response Message * @since 12.1 */ protected $_response = null; /** * @var integer Timeout limit * @since 12.1 */ protected $_timeout = 15; /** * @var integer Transfer Type * @since 12.1 */ protected $_type = null; /** * @var array Array to hold ascii format file extensions * @since 12.1 */ protected $_autoAscii = array( "asp", "bat", "c", "cpp", "csv", "h", "htm", "html", "shtml", "ini", "inc", "log", "php", "php3", "pl", "perl", "sh", "sql", "txt", "xhtml", "xml"); /** * Array to hold native line ending characters * * @var array * @since 12.1 */ protected $_lineEndings = array('UNIX' => "\n", 'WIN' => "\r\n"); /** * @var array JClientFtp instances container. * @since 12.1 */ protected static $instances = array(); /** * JClientFtp object constructor * * @param array $options Associative array of options to set * * @since 12.1 */ public function __construct(array $options = array()) { // If default transfer type is not set, set it to autoascii detect if (!isset($options['type'])) { $options['type'] = FTP_BINARY; } $this->setOptions($options); if (FTP_NATIVE) { // Import the generic buffer stream handler jimport('joomla.utilities.buffer'); // Autoloading fails for JBuffer as the class is used as a stream handler JLoader::load('JBuffer'); } } /** * JClientFtp object destructor * * Closes an existing connection, if we have one * * @since 12.1 */ public function __destruct() { if (is_resource($this->_conn)) { $this->quit(); } } /** * Returns the global FTP connector object, only creating it * if it doesn't already exist. * * You may optionally specify a username and password in the parameters. If you do so, * you may not login() again with different credentials using the same object. * If you do not use this option, you must quit() the current connection when you * are done, to free it for use by others. * * @param string $host Host to connect to * @param string $port Port to connect to * @param array $options Array with any of these options: type=>[FTP_AUTOASCII|FTP_ASCII|FTP_BINARY], timeout=>(int) * @param string $user Username to use for a connection * @param string $pass Password to use for a connection * * @return JClientFtp The FTP Client object. * * @since 12.1 */ public static function getInstance($host = '127.0.0.1', $port = '21', array $options = array(), $user = null, $pass = null) { $signature = $user . ':' . $pass . '@' . $host . ":" . $port; // Create a new instance, or set the options of an existing one if (!isset(static::$instances[$signature]) || !is_object(static::$instances[$signature])) { static::$instances[$signature] = new static($options); } else { static::$instances[$signature]->setOptions($options); } // Connect to the server, and login, if requested if (!static::$instances[$signature]->isConnected()) { $return = static::$instances[$signature]->connect($host, $port); if ($return && $user !== null && $pass !== null) { static::$instances[$signature]->login($user, $pass); } } return static::$instances[$signature]; } /** * Set client options * * @param array $options Associative array of options to set * * @return boolean True if successful * * @since 12.1 */ public function setOptions(array $options) { if (isset($options['type'])) { $this->_type = $options['type']; } if (isset($options['timeout'])) { $this->_timeout = $options['timeout']; } return true; } /** * Method to connect to a FTP server * * @param string $host Host to connect to [Default: 127.0.0.1] * @param string $port Port to connect on [Default: port 21] * * @return boolean True if successful * * @since 12.1 */ public function connect($host = '127.0.0.1', $port = 21) { $errno = null; $err = null; // If already connected, return if (is_resource($this->_conn)) { return true; } // If native FTP support is enabled let's use it... if (FTP_NATIVE) { $this->_conn = @ftp_connect($host, $port, $this->_timeout); if ($this->_conn === false) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_NO_CONNECT', $host, $port), JLog::WARNING, 'jerror'); return false; } // Set the timeout for this connection ftp_set_option($this->_conn, FTP_TIMEOUT_SEC, $this->_timeout); return true; } // Connect to the FTP server. $this->_conn = @ fsockopen($host, $port, $errno, $err, $this->_timeout); if (!$this->_conn) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_NO_CONNECT_SOCKET', $host, $port, $errno, $err), JLog::WARNING, 'jerror'); return false; } // Set the timeout for this connection socket_set_timeout($this->_conn, $this->_timeout, 0); // Check for welcome response code if (!$this->_verifyResponse(220)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_BAD_RESPONSE', $this->_response), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to determine if the object is connected to an FTP server * * @return boolean True if connected * * @since 12.1 */ public function isConnected() { return is_resource($this->_conn); } /** * Method to login to a server once connected * * @param string $user Username to login to the server * @param string $pass Password to login to the server * * @return boolean True if successful * * @since 12.1 */ public function login($user = 'anonymous', $pass = 'jftp@joomla.org') { // If native FTP support is enabled let's use it... if (FTP_NATIVE) { if (@ftp_login($this->_conn, $user, $pass) === false) { JLog::add('JFtp::login: Unable to login', JLog::WARNING, 'jerror'); return false; } return true; } // Send the username if (!$this->_putCmd('USER ' . $user, array(331, 503))) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_BAD_USERNAME', $this->_response, $user), JLog::WARNING, 'jerror'); return false; } // If we are already logged in, continue :) if ($this->_responseCode == 503) { return true; } // Send the password if (!$this->_putCmd('PASS ' . $pass, 230)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_BAD_PASSWORD', $this->_response, str_repeat('*', strlen($pass))), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to quit and close the connection * * @return boolean True if successful * * @since 12.1 */ public function quit() { // If native FTP support is enabled lets use it... if (FTP_NATIVE) { @ftp_close($this->_conn); return true; } // Logout and close connection @fwrite($this->_conn, "QUIT\r\n"); @fclose($this->_conn); return true; } /** * Method to retrieve the current working directory on the FTP server * * @return string Current working directory * * @since 12.1 */ public function pwd() { // If native FTP support is enabled let's use it... if (FTP_NATIVE) { if (($ret = @ftp_pwd($this->_conn)) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_PWD_BAD_RESPONSE_NATIVE'), JLog::WARNING, 'jerror'); return false; } return $ret; } $match = array(null); // Send print working directory command and verify success if (!$this->_putCmd('PWD', 257)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_PWD_BAD_RESPONSE', $this->_response), JLog::WARNING, 'jerror'); return false; } // Match just the path preg_match('/"[^"\r\n]*"/', $this->_response, $match); // Return the cleaned path return preg_replace("/\"/", "", $match[0]); } /** * Method to system string from the FTP server * * @return string System identifier string * * @since 12.1 */ public function syst() { // If native FTP support is enabled lets use it... if (FTP_NATIVE) { if (($ret = @ftp_systype($this->_conn)) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_SYS_BAD_RESPONSE_NATIVE'), JLog::WARNING, 'jerror'); return false; } } else { // Send print working directory command and verify success if (!$this->_putCmd('SYST', 215)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_SYST_BAD_RESPONSE', $this->_response), JLog::WARNING, 'jerror'); return false; } $ret = $this->_response; } // Match the system string to an OS if (strpos(strtoupper($ret), 'MAC') !== false) { $ret = 'MAC'; } elseif (strpos(strtoupper($ret), 'WIN') !== false) { $ret = 'WIN'; } else { $ret = 'UNIX'; } // Return the os type return $ret; } /** * Method to change the current working directory on the FTP server * * @param string $path Path to change into on the server * * @return boolean True if successful * * @since 12.1 */ public function chdir($path) { // If native FTP support is enabled lets use it... if (FTP_NATIVE) { if (@ftp_chdir($this->_conn, $path) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_CHDIR_BAD_RESPONSE_NATIVE'), JLog::WARNING, 'jerror'); return false; } return true; } // Send change directory command and verify success if (!$this->_putCmd('CWD ' . $path, 250)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_CHDIR_BAD_RESPONSE', $this->_response, $path), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to reinitialise the server, ie. need to login again * * NOTE: This command not available on all servers * * @return boolean True if successful * * @since 12.1 */ public function reinit() { // If native FTP support is enabled let's use it... if (FTP_NATIVE) { if (@ftp_site($this->_conn, 'REIN') === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_REINIT_BAD_RESPONSE_NATIVE'), JLog::WARNING, 'jerror'); return false; } return true; } // Send reinitialise command to the server if (!$this->_putCmd('REIN', 220)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_REINIT_BAD_RESPONSE', $this->_response), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to rename a file/folder on the FTP server * * @param string $from Path to change file/folder from * @param string $to Path to change file/folder to * * @return boolean True if successful * * @since 12.1 */ public function rename($from, $to) { // If native FTP support is enabled let's use it... if (FTP_NATIVE) { if (@ftp_rename($this->_conn, $from, $to) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_RENAME_BAD_RESPONSE_NATIVE'), JLog::WARNING, 'jerror'); return false; } return true; } // Send rename from command to the server if (!$this->_putCmd('RNFR ' . $from, 350)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_RENAME_BAD_RESPONSE_FROM', $this->_response, $from), JLog::WARNING, 'jerror'); return false; } // Send rename to command to the server if (!$this->_putCmd('RNTO ' . $to, 250)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_RENAME_BAD_RESPONSE_TO', $this->_response, $to), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to change mode for a path on the FTP server * * @param string $path Path to change mode on * @param mixed $mode Octal value to change mode to, e.g. '0777', 0777 or 511 (string or integer) * * @return boolean True if successful * * @since 12.1 */ public function chmod($path, $mode) { // If no filename is given, we assume the current directory is the target if ($path == '') { $path = '.'; } // Convert the mode to a string if (is_int($mode)) { $mode = decoct($mode); } // If native FTP support is enabled let's use it... if (FTP_NATIVE) { if (@ftp_site($this->_conn, 'CHMOD ' . $mode . ' ' . $path) === false) { if (!IS_WIN) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_CHMOD_BAD_RESPONSE_NATIVE'), JLog::WARNING, 'jerror'); } return false; } return true; } // Send change mode command and verify success [must convert mode from octal] if (!$this->_putCmd('SITE CHMOD ' . $mode . ' ' . $path, array(200, 250))) { if (!IS_WIN) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_CHMOD_BAD_RESPONSE', $this->_response, $path, $mode), JLog::WARNING, 'jerror'); } return false; } return true; } /** * Method to delete a path [file/folder] on the FTP server * * @param string $path Path to delete * * @return boolean True if successful * * @since 12.1 */ public function delete($path) { // If native FTP support is enabled let's use it... if (FTP_NATIVE) { if (@ftp_delete($this->_conn, $path) === false) { if (@ftp_rmdir($this->_conn, $path) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_DELETE_BAD_RESPONSE_NATIVE'), JLog::WARNING, 'jerror'); return false; } } return true; } // Send delete file command and if that doesn't work, try to remove a directory if (!$this->_putCmd('DELE ' . $path, 250)) { if (!$this->_putCmd('RMD ' . $path, 250)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_DELETE_BAD_RESPONSE', $this->_response, $path), JLog::WARNING, 'jerror'); return false; } } return true; } /** * Method to create a directory on the FTP server * * @param string $path Directory to create * * @return boolean True if successful * * @since 12.1 */ public function mkdir($path) { // If native FTP support is enabled let's use it... if (FTP_NATIVE) { if (@ftp_mkdir($this->_conn, $path) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE_NATIVE'), JLog::WARNING, 'jerror'); return false; } return true; } // Send change directory command and verify success if (!$this->_putCmd('MKD ' . $path, 257)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE', $this->_response, $path), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to restart data transfer at a given byte * * @param integer $point Byte to restart transfer at * * @return boolean True if successful * * @since 12.1 */ public function restart($point) { // If native FTP support is enabled let's use it... if (FTP_NATIVE) { if (@ftp_site($this->_conn, 'REST ' . $point) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_RESTART_BAD_RESPONSE_NATIVE'), JLog::WARNING, 'jerror'); return false; } return true; } // Send restart command and verify success if (!$this->_putCmd('REST ' . $point, 350)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_RESTART_BAD_RESPONSE', $this->_response, $point), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to create an empty file on the FTP server * * @param string $path Path local file to store on the FTP server * * @return boolean True if successful * * @since 12.1 */ public function create($path) { // If native FTP support is enabled let's use it... if (FTP_NATIVE) { // Turn passive mode on if (@ftp_pasv($this->_conn, true) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_CREATE_BAD_RESPONSE_PASSIVE'), JLog::WARNING, 'jerror'); return false; } $buffer = fopen('buffer://tmp', 'r'); if (@ftp_fput($this->_conn, $path, $buffer, FTP_ASCII) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_CREATE_BAD_RESPONSE_BUFFER'), JLog::WARNING, 'jerror'); fclose($buffer); return false; } fclose($buffer); return true; } // Start passive mode if (!$this->_passive()) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_CREATE_BAD_RESPONSE_PASSIVE'), JLog::WARNING, 'jerror'); return false; } if (!$this->_putCmd('STOR ' . $path, array(150, 125))) { @ fclose($this->_dataconn); JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_CREATE_BAD_RESPONSE', $this->_response, $path), JLog::WARNING, 'jerror'); return false; } // To create a zero byte upload close the data port connection fclose($this->_dataconn); if (!$this->_verifyResponse(226)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_CREATE_BAD_RESPONSE_TRANSFER', $this->_response, $path), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to read a file from the FTP server's contents into a buffer * * @param string $remote Path to remote file to read on the FTP server * @param string &$buffer Buffer variable to read file contents into * * @return boolean True if successful * * @since 12.1 */ public function read($remote, &$buffer) { // Determine file type $mode = $this->_findMode($remote); // If native FTP support is enabled let's use it... if (FTP_NATIVE) { // Turn passive mode on if (@ftp_pasv($this->_conn, true) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_READ_BAD_RESPONSE_PASSIVE'), JLog::WARNING, 'jerror'); return false; } $tmp = fopen('buffer://tmp', 'br+'); if (@ftp_fget($this->_conn, $tmp, $remote, $mode) === false) { fclose($tmp); JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_READ_BAD_RESPONSE_BUFFER'), JLog::WARNING, 'jerror'); return false; } // Read tmp buffer contents rewind($tmp); $buffer = ''; while (!feof($tmp)) { $buffer .= fread($tmp, 8192); } fclose($tmp); return true; } $this->_mode($mode); // Start passive mode if (!$this->_passive()) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_READ_BAD_RESPONSE_PASSIVE'), JLog::WARNING, 'jerror'); return false; } if (!$this->_putCmd('RETR ' . $remote, array(150, 125))) { @ fclose($this->_dataconn); JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_READ_BAD_RESPONSE', $this->_response, $remote), JLog::WARNING, 'jerror'); return false; } // Read data from data port connection and add to the buffer $buffer = ''; while (!feof($this->_dataconn)) { $buffer .= fread($this->_dataconn, 4096); } // Close the data port connection fclose($this->_dataconn); // Let's try to cleanup some line endings if it is ascii if ($mode == FTP_ASCII) { $os = 'UNIX'; if (IS_WIN) { $os = 'WIN'; } $buffer = preg_replace("/" . CRLF . "/", $this->_lineEndings[$os], $buffer); } if (!$this->_verifyResponse(226)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_READ_BAD_RESPONSE_TRANSFER', $this->_response, $remote), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to get a file from the FTP server and save it to a local file * * @param string $local Local path to save remote file to * @param string $remote Path to remote file to get on the FTP server * * @return boolean True if successful * * @since 12.1 */ public function get($local, $remote) { // Determine file type $mode = $this->_findMode($remote); // If native FTP support is enabled let's use it... if (FTP_NATIVE) { // Turn passive mode on if (@ftp_pasv($this->_conn, true) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_GET_PASSIVE'), JLog::WARNING, 'jerror'); return false; } if (@ftp_get($this->_conn, $local, $remote, $mode) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_GET_BAD_RESPONSE'), JLog::WARNING, 'jerror'); return false; } return true; } $this->_mode($mode); // Check to see if the local file can be opened for writing $fp = fopen($local, "wb"); if (!$fp) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_GET_WRITING_LOCAL', $local), JLog::WARNING, 'jerror'); return false; } // Start passive mode if (!$this->_passive()) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_GET_PASSIVE'), JLog::WARNING, 'jerror'); return false; } if (!$this->_putCmd('RETR ' . $remote, array(150, 125))) { @ fclose($this->_dataconn); JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_GET_BAD_RESPONSE_RETR', $this->_response, $remote), JLog::WARNING, 'jerror'); return false; } // Read data from data port connection and add to the buffer while (!feof($this->_dataconn)) { $buffer = fread($this->_dataconn, 4096); fwrite($fp, $buffer, 4096); } // Close the data port connection and file pointer fclose($this->_dataconn); fclose($fp); if (!$this->_verifyResponse(226)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_GET_BAD_RESPONSE_TRANSFER', $this->_response, $remote), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to store a file to the FTP server * * @param string $local Path to local file to store on the FTP server * @param string $remote FTP path to file to create * * @return boolean True if successful * * @since 12.1 */ public function store($local, $remote = null) { // If remote file is not given, use the filename of the local file in the current // working directory. if ($remote == null) { $remote = basename($local); } // Determine file type $mode = $this->_findMode($remote); // If native FTP support is enabled let's use it... if (FTP_NATIVE) { // Turn passive mode on if (@ftp_pasv($this->_conn, true) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_STORE_PASSIVE'), JLog::WARNING, 'jerror'); return false; } if (@ftp_put($this->_conn, $remote, $local, $mode) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_STORE_BAD_RESPONSE'), JLog::WARNING, 'jerror'); return false; } return true; } $this->_mode($mode); // Check to see if the local file exists and if so open it for reading if (@ file_exists($local)) { $fp = fopen($local, "rb"); if (!$fp) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_STORE_READING_LOCAL', $local), JLog::WARNING, 'jerror'); return false; } } else { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_STORE_FIND_LOCAL', $local), JLog::WARNING, 'jerror'); return false; } // Start passive mode if (!$this->_passive()) { @ fclose($fp); JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_STORE_PASSIVE'), JLog::WARNING, 'jerror'); return false; } // Send store command to the FTP server if (!$this->_putCmd('STOR ' . $remote, array(150, 125))) { @ fclose($fp); @ fclose($this->_dataconn); JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_STORE_BAD_RESPONSE_STOR', $this->_response, $remote), JLog::WARNING, 'jerror'); return false; } // Do actual file transfer, read local file and write to data port connection while (!feof($fp)) { $line = fread($fp, 4096); do { if (($result = @ fwrite($this->_dataconn, $line)) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_STORE_DATA_PORT'), JLog::WARNING, 'jerror'); return false; } $line = substr($line, $result); } while ($line != ""); } fclose($fp); fclose($this->_dataconn); if (!$this->_verifyResponse(226)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_STORE_BAD_RESPONSE_TRANSFER', $this->_response, $remote), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to write a string to the FTP server * * @param string $remote FTP path to file to write to * @param string $buffer Contents to write to the FTP server * * @return boolean True if successful * * @since 12.1 */ public function write($remote, $buffer) { // Determine file type $mode = $this->_findMode($remote); // If native FTP support is enabled let's use it... if (FTP_NATIVE) { // Turn passive mode on if (@ftp_pasv($this->_conn, true) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_WRITE_PASSIVE'), JLog::WARNING, 'jerror'); return false; } $tmp = fopen('buffer://tmp', 'br+'); fwrite($tmp, $buffer); rewind($tmp); if (@ftp_fput($this->_conn, $remote, $tmp, $mode) === false) { fclose($tmp); JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_WRITE_BAD_RESPONSE'), JLog::WARNING, 'jerror'); return false; } fclose($tmp); return true; } // First we need to set the transfer mode $this->_mode($mode); // Start passive mode if (!$this->_passive()) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_WRITE_PASSIVE'), JLog::WARNING, 'jerror'); return false; } // Send store command to the FTP server if (!$this->_putCmd('STOR ' . $remote, array(150, 125))) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_WRITE_BAD_RESPONSE_STOR', $this->_response, $remote), JLog::WARNING, 'jerror'); @ fclose($this->_dataconn); return false; } // Write buffer to the data connection port do { if (($result = @ fwrite($this->_dataconn, $buffer)) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_WRITE_DATA_PORT'), JLog::WARNING, 'jerror'); return false; } $buffer = substr($buffer, $result); } while ($buffer != ""); // Close the data connection port [Data transfer complete] fclose($this->_dataconn); // Verify that the server recieved the transfer if (!$this->_verifyResponse(226)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_WRITE_BAD_RESPONSE_TRANSFER', $this->_response, $remote), JLog::WARNING, 'jerror'); return false; } return true; } /** * Method to list the filenames of the contents of a directory on the FTP server * * Note: Some servers also return folder names. However, to be sure to list folders on all * servers, you should use listDetails() instead if you also need to deal with folders * * @param string $path Path local file to store on the FTP server * * @return string Directory listing * * @since 12.1 */ public function listNames($path = null) { $data = null; // If native FTP support is enabled let's use it... if (FTP_NATIVE) { // Turn passive mode on if (@ftp_pasv($this->_conn, true) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_LISTNAMES_PASSIVE'), JLog::WARNING, 'jerror'); return false; } if (($list = @ftp_nlist($this->_conn, $path)) === false) { // Workaround for empty directories on some servers if ($this->listDetails($path, 'files') === array()) { return array(); } JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_LISTNAMES_BAD_RESPONSE'), JLog::WARNING, 'jerror'); return false; } $list = preg_replace('#^' . preg_quote($path, '#') . '[/\\\\]?#', '', $list); if ($keys = array_merge(array_keys($list, '.'), array_keys($list, '..'))) { foreach ($keys as $key) { unset($list[$key]); } } return $list; } // If a path exists, prepend a space if ($path != null) { $path = ' ' . $path; } // Start passive mode if (!$this->_passive()) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_LISTNAMES_PASSIVE'), JLog::WARNING, 'jerror'); return false; } if (!$this->_putCmd('NLST' . $path, array(150, 125))) { @ fclose($this->_dataconn); // Workaround for empty directories on some servers if ($this->listDetails($path, 'files') === array()) { return array(); } JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_LISTNAMES_BAD_RESPONSE_NLST', $this->_response, $path), JLog::WARNING, 'jerror'); return false; } // Read in the file listing. while (!feof($this->_dataconn)) { $data .= fread($this->_dataconn, 4096); } fclose($this->_dataconn); // Everything go okay? if (!$this->_verifyResponse(226)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_LISTNAMES_BAD_RESPONSE_TRANSFER', $this->_response, $path), JLog::WARNING, 'jerror'); return false; } $data = preg_split("/[" . CRLF . "]+/", $data, -1, PREG_SPLIT_NO_EMPTY); $data = preg_replace('#^' . preg_quote(substr($path, 1), '#') . '[/\\\\]?#', '', $data); if ($keys = array_merge(array_keys($data, '.'), array_keys($data, '..'))) { foreach ($keys as $key) { unset($data[$key]); } } return $data; } /** * Method to list the contents of a directory on the FTP server * * @param string $path Path to the local file to be stored on the FTP server * @param string $type Return type [raw|all|folders|files] * * @return mixed If $type is raw: string Directory listing, otherwise array of string with file-names * * @since 12.1 */ public function listDetails($path = null, $type = 'all') { $dir_list = array(); $data = null; $regs = null; // TODO: Deal with recurse -- nightmare // For now we will just set it to false $recurse = false; // If native FTP support is enabled let's use it... if (FTP_NATIVE) { // Turn passive mode on if (@ftp_pasv($this->_conn, true) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_PASSIVE'), JLog::WARNING, 'jerror'); return false; } if (($contents = @ftp_rawlist($this->_conn, $path)) === false) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_BAD_RESPONSE'), JLog::WARNING, 'jerror'); return false; } } else { // Non Native mode // Start passive mode if (!$this->_passive()) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_PASSIVE'), JLog::WARNING, 'jerror'); return false; } // If a path exists, prepend a space if ($path != null) { $path = ' ' . $path; } // Request the file listing if (!$this->_putCmd(($recurse == true) ? 'LIST -R' : 'LIST' . $path, array(150, 125))) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_BAD_RESPONSE_LIST', $this->_response, $path), JLog::WARNING, 'jerror'); @ fclose($this->_dataconn); return false; } // Read in the file listing. while (!feof($this->_dataconn)) { $data .= fread($this->_dataconn, 4096); } fclose($this->_dataconn); // Everything go okay? if (!$this->_verifyResponse(226)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_BAD_RESPONSE_TRANSFER', $this->_response, $path), JLog::WARNING, 'jerror'); return false; } $contents = explode(CRLF, $data); } // If only raw output is requested we are done if ($type == 'raw') { return $data; } // If we received the listing of an empty directory, we are done as well if (empty($contents[0])) { return $dir_list; } // If the server returned the number of results in the first response, let's dump it if (strtolower(substr($contents[0], 0, 6)) == 'total ') { array_shift($contents); if (!isset($contents[0]) || empty($contents[0])) { return $dir_list; } } // Regular expressions for the directory listing parsing. $regexps = array( 'UNIX' => '#([-dl][rwxstST-]+).* ([0-9]*) ([a-zA-Z0-9]+).* ([a-zA-Z0-9]+).* ([0-9]*)' . ' ([a-zA-Z]+[0-9: ]*[0-9])[ ]+(([0-9]{1,2}:[0-9]{2})|[0-9]{4}) (.+)#', 'MAC' => '#([-dl][rwxstST-]+).* ?([0-9 ]*)?([a-zA-Z0-9]+).* ([a-zA-Z0-9]+).* ([0-9]*)' . ' ([a-zA-Z]+[0-9: ]*[0-9])[ ]+(([0-9]{2}:[0-9]{2})|[0-9]{4}) (.+)#', 'WIN' => '#([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)#' ); // Find out the format of the directory listing by matching one of the regexps $osType = null; foreach ($regexps as $k => $v) { if (@preg_match($v, $contents[0])) { $osType = $k; $regexp = $v; break; } } if (!$osType) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_UNRECOGNISED'), JLog::WARNING, 'jerror'); return false; } // Here is where it is going to get dirty.... if ($osType == 'UNIX' || $osType == 'MAC') { foreach ($contents as $file) { $tmp_array = null; if (@preg_match($regexp, $file, $regs)) { $fType = (int) strpos("-dl", $regs[1]{0}); // $tmp_array['line'] = $regs[0]; $tmp_array['type'] = $fType; $tmp_array['rights'] = $regs[1]; // $tmp_array['number'] = $regs[2]; $tmp_array['user'] = $regs[3]; $tmp_array['group'] = $regs[4]; $tmp_array['size'] = $regs[5]; $tmp_array['date'] = @date("m-d", strtotime($regs[6])); $tmp_array['time'] = $regs[7]; $tmp_array['name'] = $regs[9]; } // If we just want files, do not add a folder if ($type == 'files' && $tmp_array['type'] == 1) { continue; } // If we just want folders, do not add a file if ($type == 'folders' && $tmp_array['type'] == 0) { continue; } if (is_array($tmp_array) && $tmp_array['name'] != '.' && $tmp_array['name'] != '..') { $dir_list[] = $tmp_array; } } } else { foreach ($contents as $file) { $tmp_array = null; if (@preg_match($regexp, $file, $regs)) { $fType = (int) ($regs[7] == '<DIR>'); $timestamp = strtotime("$regs[3]-$regs[1]-$regs[2] $regs[4]:$regs[5]$regs[6]"); // $tmp_array['line'] = $regs[0]; $tmp_array['type'] = $fType; $tmp_array['rights'] = ''; // $tmp_array['number'] = 0; $tmp_array['user'] = ''; $tmp_array['group'] = ''; $tmp_array['size'] = (int) $regs[7]; $tmp_array['date'] = date('m-d', $timestamp); $tmp_array['time'] = date('H:i', $timestamp); $tmp_array['name'] = $regs[8]; } // If we just want files, do not add a folder if ($type == 'files' && $tmp_array['type'] == 1) { continue; } // If we just want folders, do not add a file if ($type == 'folders' && $tmp_array['type'] == 0) { continue; } if (is_array($tmp_array) && $tmp_array['name'] != '.' && $tmp_array['name'] != '..') { $dir_list[] = $tmp_array; } } } return $dir_list; } /** * Send command to the FTP server and validate an expected response code * * @param string $cmd Command to send to the FTP server * @param mixed $expectedResponse Integer response code or array of integer response codes * * @return boolean True if command executed successfully * * @since 12.1 */ protected function _putCmd($cmd, $expectedResponse) { // Make sure we have a connection to the server if (!is_resource($this->_conn)) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_PUTCMD_UNCONNECTED'), JLog::WARNING, 'jerror'); return false; } // Send the command to the server if (!fwrite($this->_conn, $cmd . "\r\n")) { JLog::add(JText::sprintf('DDD', JText::sprintf('JLIB_CLIENT_ERROR_JFTP_PUTCMD_SEND', $cmd)), JLog::WARNING, 'jerror'); } return $this->_verifyResponse($expectedResponse); } /** * Verify the response code from the server and log response if flag is set * * @param mixed $expected Integer response code or array of integer response codes * * @return boolean True if response code from the server is expected * * @since 12.1 */ protected function _verifyResponse($expected) { $parts = null; // Wait for a response from the server, but timeout after the set time limit $endTime = time() + $this->_timeout; $this->_response = ''; do { $this->_response .= fgets($this->_conn, 4096); } while (!preg_match("/^([0-9]{3})(-(.*" . CRLF . ")+\\1)? [^" . CRLF . "]+" . CRLF . "$/", $this->_response, $parts) && time() < $endTime); // Catch a timeout or bad response if (!isset($parts[1])) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_VERIFYRESPONSE', $this->_response), JLog::WARNING, 'jerror'); return false; } // Separate the code from the message $this->_responseCode = $parts[1]; $this->_responseMsg = $parts[0]; // Did the server respond with the code we wanted? if (is_array($expected)) { if (in_array($this->_responseCode, $expected)) { $retval = true; } else { $retval = false; } } else { if ($this->_responseCode == $expected) { $retval = true; } else { $retval = false; } } return $retval; } /** * Set server to passive mode and open a data port connection * * @return boolean True if successful * * @since 12.1 */ protected function _passive() { $match = array(); $parts = array(); $errno = null; $err = null; // Make sure we have a connection to the server if (!is_resource($this->_conn)) { JLog::add(JText::_('JLIB_CLIENT_ERROR_JFTP_PASSIVE_CONNECT_PORT'), JLog::WARNING, 'jerror'); return false; } // Request a passive connection - this means, we'll talk to you, you don't talk to us. @ fwrite($this->_conn, "PASV\r\n"); // Wait for a response from the server, but timeout after the set time limit $endTime = time() + $this->_timeout; $this->_response = ''; do { $this->_response .= fgets($this->_conn, 4096); } while (!preg_match("/^([0-9]{3})(-(.*" . CRLF . ")+\\1)? [^" . CRLF . "]+" . CRLF . "$/", $this->_response, $parts) && time() < $endTime); // Catch a timeout or bad response if (!isset($parts[1])) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_PASSIVE_RESPONSE', $this->_response), JLog::WARNING, 'jerror'); return false; } // Separate the code from the message $this->_responseCode = $parts[1]; $this->_responseMsg = $parts[0]; // If it's not 227, we weren't given an IP and port, which means it failed. if ($this->_responseCode != '227') { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_PASSIVE_IP_OBTAIN', $this->_responseMsg), JLog::WARNING, 'jerror'); return false; } // Snatch the IP and port information, or die horribly trying... if (preg_match('~\((\d+),\s*(\d+),\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))\)~', $this->_responseMsg, $match) == 0) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_PASSIVE_IP_VALID', $this->_responseMsg), JLog::WARNING, 'jerror'); return false; } // This is pretty simple - store it for later use ;). $this->_pasv = array('ip' => $match[1] . '.' . $match[2] . '.' . $match[3] . '.' . $match[4], 'port' => $match[5] * 256 + $match[6]); // Connect, assuming we've got a connection. $this->_dataconn = @fsockopen($this->_pasv['ip'], $this->_pasv['port'], $errno, $err, $this->_timeout); if (!$this->_dataconn) { JLog::add( JText::sprintf('JLIB_CLIENT_ERROR_JFTP_PASSIVE_CONNECT', $this->_pasv['ip'], $this->_pasv['port'], $errno, $err), JLog::WARNING, 'jerror' ); return false; } // Set the timeout for this connection socket_set_timeout($this->_conn, $this->_timeout, 0); return true; } /** * Method to find out the correct transfer mode for a specific file * * @param string $fileName Name of the file * * @return integer Transfer-mode for this filetype [FTP_ASCII|FTP_BINARY] * * @since 12.1 */ protected function _findMode($fileName) { if ($this->_type == FTP_AUTOASCII) { $dot = strrpos($fileName, '.') + 1; $ext = substr($fileName, $dot); if (in_array($ext, $this->_autoAscii)) { $mode = FTP_ASCII; } else { $mode = FTP_BINARY; } } elseif ($this->_type == FTP_ASCII) { $mode = FTP_ASCII; } else { $mode = FTP_BINARY; } return $mode; } /** * Set transfer mode * * @param integer $mode Integer representation of data transfer mode [1:Binary|0:Ascii] * Defined constants can also be used [FTP_BINARY|FTP_ASCII] * * @return boolean True if successful * * @since 12.1 */ protected function _mode($mode) { if ($mode == FTP_BINARY) { if (!$this->_putCmd("TYPE I", 200)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_MODE_BINARY', $this->_response), JLog::WARNING, 'jerror'); return false; } } else { if (!$this->_putCmd("TYPE A", 200)) { JLog::add(JText::sprintf('JLIB_CLIENT_ERROR_JFTP_MODE_ASCII', $this->_response), JLog::WARNING, 'jerror'); return false; } } return true; } } /** * Deprecated class placeholder. You should use JClientFtp instead. * * @since 11.1 * @deprecated 12.3 (Platform) & 4.0 (CMS) */ class JFTP extends JClientFtp { /** * JFTP object constructor * * @param array $options Associative array of options to set * * @since 11.1 */ public function __construct(array $options = array()) { JLog::add('JFTP is deprecated. Use JClientFtp instead.', JLog::WARNING, 'deprecated'); parent::__construct($options); } } PK���\&�65UU"libraries/joomla/client/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Client * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Client helper class * * @since 11.1 */ class JClientHelper { /** * Method to return the array of client layer configuration options * * @param string $client Client name, currently only 'ftp' is supported * @param boolean $force Forces re-creation of the login credentials. Set this to * true if login credentials in the session storage have changed * * @return array Client layer configuration options, consisting of at least * these fields: enabled, host, port, user, pass, root * * @since 11.1 */ public static function getCredentials($client, $force = false) { static $credentials = array(); $client = strtolower($client); if (!isset($credentials[$client]) || $force) { $config = JFactory::getConfig(); // Fetch the client layer configuration options for the specific client switch ($client) { case 'ftp': $options = array( 'enabled' => $config->get('ftp_enable'), 'host' => $config->get('ftp_host'), 'port' => $config->get('ftp_port'), 'user' => $config->get('ftp_user'), 'pass' => $config->get('ftp_pass'), 'root' => $config->get('ftp_root')); break; default: $options = array('enabled' => false, 'host' => '', 'port' => '', 'user' => '', 'pass' => '', 'root' => ''); break; } // If user and pass are not set in global config lets see if they are in the session if ($options['enabled'] == true && ($options['user'] == '' || $options['pass'] == '')) { $session = JFactory::getSession(); $options['user'] = $session->get($client . '.user', null, 'JClientHelper'); $options['pass'] = $session->get($client . '.pass', null, 'JClientHelper'); } // If user or pass are missing, disable this client if ($options['user'] == '' || $options['pass'] == '') { $options['enabled'] = false; } // Save the credentials for later use $credentials[$client] = $options; } return $credentials[$client]; } /** * Method to set client login credentials * * @param string $client Client name, currently only 'ftp' is supported * @param string $user Username * @param string $pass Password * * @return boolean True if the given login credentials have been set and are valid * * @since 11.1 */ public static function setCredentials($client, $user, $pass) { $return = false; $client = strtolower($client); // Test if the given credentials are valid switch ($client) { case 'ftp': $config = JFactory::getConfig(); $options = array('enabled' => $config->get('ftp_enable'), 'host' => $config->get('ftp_host'), 'port' => $config->get('ftp_port')); if ($options['enabled']) { $ftp = JClientFtp::getInstance($options['host'], $options['port']); // Test the connection and try to log in if ($ftp->isConnected()) { if ($ftp->login($user, $pass)) { $return = true; } $ftp->quit(); } } break; default: break; } if ($return) { // Save valid credentials to the session $session = JFactory::getSession(); $session->set($client . '.user', $user, 'JClientHelper'); $session->set($client . '.pass', $pass, 'JClientHelper'); // Force re-creation of the data saved within JClientHelper::getCredentials() self::getCredentials($client, true); } return $return; } /** * Method to determine if client login credentials are present * * @param string $client Client name, currently only 'ftp' is supported * * @return boolean True if login credentials are available * * @since 11.1 */ public static function hasCredentials($client) { $return = false; $client = strtolower($client); // Get (unmodified) credentials for this client switch ($client) { case 'ftp': $config = JFactory::getConfig(); $options = array('enabled' => $config->get('ftp_enable'), 'user' => $config->get('ftp_user'), 'pass' => $config->get('ftp_pass')); break; default: $options = array('enabled' => false, 'user' => '', 'pass' => ''); break; } if ($options['enabled'] == false) { // The client is disabled in global config, so let's pretend we are OK $return = true; } elseif ($options['user'] != '' && $options['pass'] != '') { // Login credentials are available in global config $return = true; } else { // Check if login credentials are available in the session $session = JFactory::getSession(); $user = $session->get($client . '.user', null, 'JClientHelper'); $pass = $session->get($client . '.pass', null, 'JClientHelper'); if ($user != '' && $pass != '') { $return = true; } } return $return; } /** * Determine whether input fields for client settings need to be shown * * If valid credentials were passed along with the request, they are saved to the session. * This functions returns an exception if invalid credentials have been given or if the * connection to the server failed for some other reason. * * @param string $client The name of the client. * * @return mixed True, if FTP settings; JError if using legacy tree. * * @since 11.1 * @throws InvalidArgumentException if credentials invalid */ public static function setCredentialsFromRequest($client) { // Determine whether FTP credentials have been passed along with the current request $input = JFactory::getApplication()->input; $user = $input->post->getString('username', null); $pass = $input->post->getString('password', null); if ($user != '' && $pass != '') { // Add credentials to the session if (self::setCredentials($client, $user, $pass)) { $return = false; } else { if (class_exists('JError')) { $return = JError::raiseWarning('SOME_ERROR_CODE', JText::_('JLIB_CLIENT_ERROR_HELPER_SETCREDENTIALSFROMREQUEST_FAILED')); } else { throw new InvalidArgumentException('Invalid user credentials'); } } } else { // Just determine if the FTP input fields need to be shown $return = !self::hasCredentials('ftp'); } return $return; } } PK���\p�F���*libraries/joomla/client/wrapper/helper.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Client * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JClientHelper * * @package Joomla.Platform * @subpackage Client * @since 3.4 */ class JClientWrapperHelper { /** * Helper wrapper method for getCredentials * * @param string $client Client name, currently only 'ftp' is supported * @param boolean $force Forces re-creation of the login credentials. Set this to * * @return array Client layer configuration options, consisting of at least * * @see JClientHelper::getCredentials() * @since 3.4 */ public function getCredentials($client, $force = false) { return JClientHelper::getCredentials($client, $force); } /** * Helper wrapper method for setCredentials * * @param string $client Client name, currently only 'ftp' is supported * @param string $user Username * @param string $pass Password * * @return boolean True if the given login credentials have been set and are valid * * @see JClientHelper::setCredentials() * @since 3.4 */ public function setCredentials($client, $user, $pass) { return JClientHelper::setCredentials($client, $user, $pass); } /** * Helper wrapper method for hasCredentials * * @param string $client Client name, currently only 'ftp' is supported * * @return boolean True if login credentials are available * * @see JClientHelper::hasCredentials() * @since 3.4 */ public function hasCredentials($client) { return JClientHelper::hasCredentials($client); } /** * Helper wrapper method for setCredentialsFromRequest * * @param string $client The name of the client. * * @return mixed True, if FTP settings; JError if using legacy tree * * @see JUserHelper::setCredentialsFromRequest() * @since 3.4 * @throws InvalidArgumentException if credentials invalid */ public function setCredentialsFromRequest($client) { return JClientHelper::setCredentialsFromRequest($client); } } PK���\�ku�� libraries/joomla/model/model.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Model * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform Model Interface * * @since 12.1 */ interface JModel { /** * Get the model state. * * @return Registry The state object. * * @since 12.1 */ public function getState(); /** * Set the model state. * * @param Registry $state The state object. * * @return void * * @since 12.1 */ public function setState(Registry $state); } PK���\� ��libraries/joomla/model/base.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Model * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform Base Model Class * * @since 12.1 */ abstract class JModelBase implements JModel { /** * The model state. * * @var Registry * @since 12.1 */ protected $state; /** * Instantiate the model. * * @param Registry $state The model state. * * @since 12.1 */ public function __construct(Registry $state = null) { // Setup the model. $this->state = isset($state) ? $state : $this->loadState(); } /** * Get the model state. * * @return Registry The state object. * * @since 12.1 */ public function getState() { return $this->state; } /** * Set the model state. * * @param Registry $state The state object. * * @return void * * @since 12.1 */ public function setState(Registry $state) { $this->state = $state; } /** * Load the model state. * * @return Registry The state object. * * @since 12.1 */ protected function loadState() { return new Registry; } } PK���\)U��#libraries/joomla/model/database.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Model * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Joomla Platform Database Model Class * * @since 12.1 */ abstract class JModelDatabase extends JModelBase { /** * The database driver. * * @var JDatabaseDriver * @since 12.1 */ protected $db; /** * Instantiate the model. * * @param Registry $state The model state. * @param JDatabaseDriver $db The database adpater. * * @since 12.1 */ public function __construct(Registry $state = null, JDatabaseDriver $db = null) { parent::__construct($state); // Setup the model. $this->db = isset($db) ? $db : $this->loadDb(); } /** * Get the database driver. * * @return JDatabaseDriver The database driver. * * @since 12.1 */ public function getDb() { return $this->db; } /** * Set the database driver. * * @param JDatabaseDriver $db The database driver. * * @return void * * @since 12.1 */ public function setDb(JDatabaseDriver $db) { $this->db = $db; } /** * Load the database driver. * * @return JDatabaseDriver The database driver. * * @since 12.1 */ protected function loadDb() { return JFactory::getDbo(); } } PK���\�d.oo"libraries/joomla/string/string.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage String * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\String\String; /** * String handling class for utf-8 data * Wraps the phputf8 library * All functions assume the validity of utf-8 strings. * * @since 11.1 * @deprecated 4.0 Use {@link \Joomla\String\String} instead unless otherwise noted. */ abstract class JString extends String { /** * Split a string in camel case format * * "FooBarABCDef" becomes array("Foo", "Bar", "ABC", "Def"); * "JFooBar" becomes array("J", "Foo", "Bar"); * "J001FooBar002" becomes array("J001", "Foo", "Bar002"); * "abcDef" becomes array("abc", "Def"); * "abc_defGhi_Jkl" becomes array("abc_def", "Ghi_Jkl"); * "ThisIsA_NASAAstronaut" becomes array("This", "Is", "A_NASA", "Astronaut")), * "JohnFitzgerald_Kennedy" becomes array("John", "Fitzgerald_Kennedy")), * * @param string $string The source string. * * @return array The splitted string. * * @deprecated 12.3 (Platform) & 4.0 (CMS) - Use JStringNormalise::fromCamelCase() * @since 11.3 */ public static function splitCamelCase($string) { JLog::add('JString::splitCamelCase has been deprecated. Use JStringNormalise::fromCamelCase.', JLog::WARNING, 'deprecated'); return JStringNormalise::fromCamelCase($string, true); } /** * Does a UTF-8 safe version of PHP parse_url function * * @param string $url URL to parse * * @return mixed Associative array or false if badly formed URL. * * @see http://us3.php.net/manual/en/function.parse-url.php * @since 11.1 * @deprecated 4.0 (CMS) - Use {@link \Joomla\Uri\UriHelper::parse_url()} instead. */ public static function parse_url($url) { JLog::add('JString::parse_url has been deprecated. Use \\Joomla\\Uri\\UriHelper::parse_url.', JLog::WARNING, 'deprecated'); return \Joomla\Uri\UriHelper::parse_url($url); } } PK���\���44$libraries/joomla/string/punycode.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage String * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLoader::register('idna_convert', JPATH_LIBRARIES . '/idna_convert/idna_convert.class.php'); /** * Joomla Platform String Punycode Class * * Class for handling UTF-8 URLs * Wraps the Punycode library * All functions assume the validity of utf-8 URLs. * * @since 3.1.2 */ abstract class JStringPunycode { /** * Transforms a UTF-8 string to a Punycode string * * @param string $utfString The UTF-8 string to transform * * @return string The punycode string * * @since 3.1.2 */ public static function toPunycode($utfString) { $idn = new idna_convert; return $idn->encode($utfString); } /** * Transforms a Punycode string to a UTF-8 string * * @param string $punycodeString The Punycode string to transform * * @return string The UF-8 URL * * @since 3.1.2 */ public static function fromPunycode($punycodeString) { $idn = new idna_convert; return $idn->decode($punycodeString); } /** * Transforms a UTF-8 URL to a Punycode URL * * @param string $uri The UTF-8 URL to transform * * @return string The punycode URL * * @since 3.1.2 */ public static function urlToPunycode($uri) { $parsed = JString::parse_url($uri); if (!isset($parsed['host']) || $parsed['host'] == '') { // If there is no host we do not need to convert it. return $uri; } $host = $parsed['host']; $hostExploded = explode('.', $host); $newhost = ''; foreach ($hostExploded as $hostex) { $hostex = static::toPunycode($hostex); $newhost .= $hostex . '.'; } $newhost = substr($newhost, 0, -1); $newuri = ''; if (!empty($parsed['scheme'])) { // Assume :// is required although it is not always. $newuri .= $parsed['scheme'] . '://'; } if (!empty($newhost)) { $newuri .= $newhost; } if (!empty($parsed['port'])) { $newuri .= ':' . $parsed['port']; } if (!empty($parsed['path'])) { $newuri .= $parsed['path']; } if (!empty($parsed['query'])) { $newuri .= '?' . $parsed['query']; } if (!empty($parsed['fragment'])) { $newuri .= '#' . $parsed['fragment']; } return $newuri; } /** * Transforms a Punycode URL to a UTF-8 URL * * @param string $uri The Punycode URL to transform * * @return string The UTF-8 URL * * @since 3.1.2 */ public static function urlToUTF8($uri) { if (empty($uri)) { return; } $parsed = JString::parse_url($uri); if (!isset($parsed['host']) || $parsed['host'] == '') { // If there is no host we do not need to convert it. return $uri; } $host = $parsed['host']; $hostExploded = explode('.', $host); $newhost = ''; foreach ($hostExploded as $hostex) { $hostex = self::fromPunycode($hostex); $newhost .= $hostex . '.'; } $newhost = substr($newhost, 0, -1); $newuri = ''; if (!empty($parsed['scheme'])) { // Assume :// is required although it is not always. $newuri .= $parsed['scheme'] . '://'; } if (!empty($newhost)) { $newuri .= $newhost; } if (!empty($parsed['port'])) { $newuri .= ':' . $parsed['port']; } if (!empty($parsed['path'])) { $newuri .= $parsed['path']; } if (!empty($parsed['query'])) { $newuri .= '?' . $parsed['query']; } if (!empty($parsed['fragment'])) { $newuri .= '#' . $parsed['fragment']; } return $newuri; } /** * Transforms a UTF-8 e-mail to a Punycode e-mail * This assumes a valid email address * * @param string $email The UTF-8 e-mail to transform * * @return string The punycode e-mail * * @since 3.1.2 */ public static function emailToPunycode($email) { $explodedAddress = explode('@', $email); // Not addressing UTF-8 user names $newEmail = $explodedAddress[0]; if (!empty($explodedAddress[1])) { $domainExploded = explode('.', $explodedAddress[1]); $newdomain = ''; foreach ($domainExploded as $domainex) { $domainex = static::toPunycode($domainex); $newdomain .= $domainex . '.'; } $newdomain = substr($newdomain, 0, -1); $newEmail = $newEmail . '@' . $newdomain; } return $newEmail; } /** * Transforms a Punycode e-mail to a UTF-8 e-mail * This assumes a valid email address * * @param string $email The punycode e-mail to transform * * @return string The punycode e-mail * * @since 3.1.2 */ public static function emailToUTF8($email) { $explodedAddress = explode('@', $email); // Not addressing UTF-8 user names $newEmail = $explodedAddress[0]; if (!empty($explodedAddress[1])) { $domainExploded = explode('.', $explodedAddress[1]); $newdomain = ''; foreach ($domainExploded as $domainex) { $domainex = static::fromPunycode($domainex); $newdomain .= $domainex . '.'; } $newdomain = substr($newdomain, 0, -1); $newEmail = $newEmail . '@' . $newdomain; } return $newEmail; } } PK���\6tʉ � ,libraries/joomla/string/wrapper/punycode.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage String * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; JLoader::register('idna_convert', JPATH_LIBRARIES . '/idna_convert/idna_convert.class.php'); /** * Wrapper class for JStringPunycode * * @package Joomla.Platform * @subpackage String * @since 3.4 */ class JStringWrapperPunycode { /** * Helper wrapper method for toPunycode * * @param string $utfString The UTF-8 string to transform. * * @return string The punycode string. * * @see JUserHelper::toPunycode() * @since 3.4 */ public function toPunycode($utfString) { return JStringPunycode::toPunycode($utfString); } /** * Helper wrapper method for fromPunycode * * @param string $punycodeString The Punycode string to transform. * * @return string The UF-8 URL. * * @see JUserHelper::fromPunycode() * @since 3.4 */ public function fromPunycode($punycodeString) { return JStringPunycode::fromPunycode($punycodeString); } /** * Helper wrapper method for urlToPunycode * * @param string $uri The UTF-8 URL to transform. * * @return string The punycode URL. * * @see JUserHelper::urlToPunycode() * @since 3.4 */ public function urlToPunycode($uri) { return JStringPunycode::urlToPunycode($uri); } /** * Helper wrapper method for urlToUTF8 * * @param string $uri The Punycode URL to transform. * * @return string The UTF-8 URL. * * @see JStringPunycode::urlToUTF8() * @since 3.4 */ public function urlToUTF8($uri) { return JStringPunycode::urlToUTF8($uri); } /** * Helper wrapper method for emailToPunycode * * @param string $email The UTF-8 e-mail to transform. * * @return string The punycode e-mail. * * @see JStringPunycode::emailToPunycode() * @since 3.4 */ public function emailToPunycode($email) { return JStringPunycode::emailToPunycode($email); } /** * Helper wrapper method for emailToUTF8 * * @param string $email The punycode e-mail to transform. * * @return string The punycode e-mail. * * @see JStringPunycode::emailToUTF8() * @since 3.4 */ public function emailToUTF8($email) { return JStringPunycode::emailToUTF8($email); } } PK���\�K��BB-libraries/joomla/string/wrapper/normalise.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage String * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Wrapper class for JStringNormalise * * @package Joomla.Platform * @subpackage String * @since 3.4 */ class JStringWrapperNormalise { /** * Helper wrapper method for fromCamelCase * * @param string $input The string input (ASCII only). * @param boolean $grouped Optionally allows splitting on groups of uppercase characters. * * @return mixed The space separated string or an array of substrings if grouped is true. * * @see JUserHelper::fromCamelCase() * @since 3.4 */ public function fromCamelCase($input, $grouped = false) { return JStringNormalise::fromCamelCase($input, $grouped); } /** * Helper wrapper method for toCamelCase * * @param string $input The string input (ASCII only). * * @return string The camel case string. * * @see JUserHelper::toCamelCase() * @since 3.4 */ public function toCamelCase($input) { return JStringNormalise::toCamelCase($input); } /** * Helper wrapper method for toDashSeparated * * @param string $input The string input (ASCII only). * * @return string The dash separated string. * * @see JUserHelper::toDashSeparated() * @since 3.4 */ public function toDashSeparated($input) { return JStringNormalise::toDashSeparated($input); } /** * Helper wrapper method for toSpaceSeparated * * @param string $input The string input (ASCII only). * * @return string The space separated string. * * @see JUserHelper::toSpaceSeparated() * @since 3.4 */ public function toSpaceSeparated($input) { return JStringNormalise::toSpaceSeparated($input); } /** * Helper wrapper method for toUnderscoreSeparated * * @param string $input The string input (ASCII only). * * @return string The underscore separated string. * * @see JUserHelper::toUnderscoreSeparated() * @since 3.4 */ public function toUnderscoreSeparated($input) { return JStringNormalise::toUnderscoreSeparated($input); } /** * Helper wrapper method for toVariable * * @param string $input The string input (ASCII only). * * @return string The variable string. * * @see JUserHelper::toVariable() * @since 3.4 */ public function toVariable($input) { return JStringNormalise::toVariable($input); } /** * Helper wrapper method for toKey * * @param string $input The string input (ASCII only). * * @return string The key string. * * @see JUserHelper::toKey() * @since 3.4 */ public function toKey($input) { return JStringNormalise::toKey($input); } } PK���\����;�;(libraries/joomla/environment/browser.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Environment * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Browser class, provides capability information about the current web client. * * Browser identification is performed by examining the HTTP_USER_AGENT * environment variable provided by the web server. * * This class has many influences from the lib/Browser.php code in * version 3 of Horde by Chuck Hagenbuch and Jon Parise. * * @since 11.1 */ class JBrowser { /** * @var integer Major version number * @since 12.1 */ protected $majorVersion = 0; /** * @var integer Minor version number * @since 12.1 */ protected $minorVersion = 0; /** * @var string Browser name. * @since 12.1 */ protected $browser = ''; /** * @var string Full user agent string. * @since 12.1 */ protected $agent = ''; /** * @var string Lower-case user agent string * @since 12.1 */ protected $lowerAgent = ''; /** * @var string HTTP_ACCEPT string. * @since 12.1 */ protected $accept = ''; /** * @var array Parsed HTTP_ACCEPT string * @since 12.1 */ protected $acceptParsed = array(); /** * @var string Platform the browser is running on * @since 12.1 */ protected $platform = ''; /** * @var array Known robots. * @since 12.1 */ protected $robots = array( /* The most common ones. */ 'Googlebot', 'msnbot', 'Slurp', 'Yahoo', /* The rest alphabetically. */ 'Arachnoidea', 'ArchitextSpider', 'Ask Jeeves', 'B-l-i-t-z-Bot', 'Baiduspider', 'BecomeBot', 'cfetch', 'ConveraCrawler', 'ExtractorPro', 'FAST-WebCrawler', 'FDSE robot', 'fido', 'geckobot', 'Gigabot', 'Girafabot', 'grub-client', 'Gulliver', 'HTTrack', 'ia_archiver', 'InfoSeek', 'kinjabot', 'KIT-Fireball', 'larbin', 'LEIA', 'lmspider', 'Lycos_Spider', 'Mediapartners-Google', 'MuscatFerret', 'NaverBot', 'OmniExplorer_Bot', 'polybot', 'Pompos', 'Scooter', 'Teoma', 'TheSuBot', 'TurnitinBot', 'Ultraseek', 'ViolaBot', 'webbandit', 'www.almaden.ibm.com/cs/crawler', 'ZyBorg'); /** * @var boolean Is this a mobile browser? * @since 12.1 */ protected $mobile = false; /** * List of viewable image MIME subtypes. * This list of viewable images works for IE and Netscape/Mozilla. * * @var array * @since 12.1 */ protected $images = array('jpeg', 'gif', 'png', 'pjpeg', 'x-png', 'bmp'); /** * @var array JBrowser instances container. * @since 11.3 */ protected static $instances = array(); /** * Create a browser instance (constructor). * * @param string $userAgent The browser string to parse. * @param string $accept The HTTP_ACCEPT settings to use. * * @since 11.1 */ public function __construct($userAgent = null, $accept = null) { $this->match($userAgent, $accept); } /** * Returns the global Browser object, only creating it * if it doesn't already exist. * * @param string $userAgent The browser string to parse. * @param string $accept The HTTP_ACCEPT settings to use. * * @return JBrowser The Browser object. * * @since 11.1 */ public static function getInstance($userAgent = null, $accept = null) { $signature = serialize(array($userAgent, $accept)); if (empty(self::$instances[$signature])) { self::$instances[$signature] = new JBrowser($userAgent, $accept); } return self::$instances[$signature]; } /** * Parses the user agent string and inititializes the object with * all the known features and quirks for the given browser. * * @param string $userAgent The browser string to parse. * @param string $accept The HTTP_ACCEPT settings to use. * * @return void * * @since 11.1 */ public function match($userAgent = null, $accept = null) { // Set our agent string. if (is_null($userAgent)) { if (isset($_SERVER['HTTP_USER_AGENT'])) { $this->agent = trim($_SERVER['HTTP_USER_AGENT']); } } else { $this->agent = $userAgent; } $this->lowerAgent = strtolower($this->agent); // Set our accept string. if (is_null($accept)) { if (isset($_SERVER['HTTP_ACCEPT'])) { $this->accept = strtolower(trim($_SERVER['HTTP_ACCEPT'])); } } else { $this->accept = strtolower($accept); } if (!empty($this->agent)) { $this->_setPlatform(); if (strpos($this->lowerAgent, 'mobileexplorer') !== false || strpos($this->lowerAgent, 'openwave') !== false || strpos($this->lowerAgent, 'opera mini') !== false || strpos($this->lowerAgent, 'opera mobi') !== false || strpos($this->lowerAgent, 'operamini') !== false) { $this->mobile = true; } elseif (preg_match('|Opera[/ ]([0-9.]+)|', $this->agent, $version)) { $this->setBrowser('opera'); list ($this->majorVersion, $this->minorVersion) = explode('.', $version[1]); /* Due to changes in Opera UA, we need to check Version/xx.yy, * but only if version is > 9.80. See: http://dev.opera.com/articles/view/opera-ua-string-changes/ */ if ($this->majorVersion == 9 && $this->minorVersion >= 80) { $this->identifyBrowserVersion(); } } elseif (preg_match('|Chrome[/ ]([0-9.]+)|', $this->agent, $version)) { $this->setBrowser('chrome'); list ($this->majorVersion, $this->minorVersion) = explode('.', $version[1]); } elseif (preg_match('|CrMo[/ ]([0-9.]+)|', $this->agent, $version)) { $this->setBrowser('chrome'); list ($this->majorVersion, $this->minorVersion) = explode('.', $version[1]); } elseif (preg_match('|CriOS[/ ]([0-9.]+)|', $this->agent, $version)) { $this->setBrowser('chrome'); list ($this->majorVersion, $this->minorVersion) = explode('.', $version[1]); $this->mobile = true; } elseif (strpos($this->lowerAgent, 'elaine/') !== false || strpos($this->lowerAgent, 'palmsource') !== false || strpos($this->lowerAgent, 'digital paths') !== false) { $this->setBrowser('palm'); $this->mobile = true; } elseif ((preg_match('|MSIE ([0-9.]+)|', $this->agent, $version)) || (preg_match('|Internet Explorer/([0-9.]+)|', $this->agent, $version))) { $this->setBrowser('msie'); if (strpos($version[1], '.') !== false) { list ($this->majorVersion, $this->minorVersion) = explode('.', $version[1]); } else { $this->majorVersion = $version[1]; $this->minorVersion = 0; } /* Some Handhelds have their screen resolution in the * user agent string, which we can use to look for * mobile agents. */ if (preg_match('/; (120x160|240x280|240x320|320x320)\)/', $this->agent)) { $this->mobile = true; } } elseif (preg_match('|amaya/([0-9.]+)|', $this->agent, $version)) { $this->setBrowser('amaya'); $this->majorVersion = $version[1]; if (isset($version[2])) { $this->minorVersion = $version[2]; } } elseif (preg_match('|ANTFresco/([0-9]+)|', $this->agent, $version)) { $this->setBrowser('fresco'); } elseif (strpos($this->lowerAgent, 'avantgo') !== false) { $this->setBrowser('avantgo'); $this->mobile = true; } elseif (preg_match('|[Kk]onqueror/([0-9]+)|', $this->agent, $version) || preg_match('|Safari/([0-9]+)\.?([0-9]+)?|', $this->agent, $version)) { // Konqueror and Apple's Safari both use the KHTML // rendering engine. $this->setBrowser('konqueror'); $this->majorVersion = $version[1]; if (isset($version[2])) { $this->minorVersion = $version[2]; } if (strpos($this->agent, 'Safari') !== false && $this->majorVersion >= 60) { // Safari. $this->setBrowser('safari'); $this->identifyBrowserVersion(); } } elseif (preg_match('|Mozilla/([0-9.]+)|', $this->agent, $version)) { $this->setBrowser('mozilla'); list ($this->majorVersion, $this->minorVersion) = explode('.', $version[1]); } elseif (preg_match('|Lynx/([0-9]+)|', $this->agent, $version)) { $this->setBrowser('lynx'); } elseif (preg_match('|Links \(([0-9]+)|', $this->agent, $version)) { $this->setBrowser('links'); } elseif (preg_match('|HotJava/([0-9]+)|', $this->agent, $version)) { $this->setBrowser('hotjava'); } elseif (strpos($this->agent, 'UP/') !== false || strpos($this->agent, 'UP.B') !== false || strpos($this->agent, 'UP.L') !== false) { $this->setBrowser('up'); $this->mobile = true; } elseif (strpos($this->agent, 'Xiino/') !== false) { $this->setBrowser('xiino'); $this->mobile = true; } elseif (strpos($this->agent, 'Palmscape/') !== false) { $this->setBrowser('palmscape'); $this->mobile = true; } elseif (strpos($this->agent, 'Nokia') !== false) { $this->setBrowser('nokia'); $this->mobile = true; } elseif (strpos($this->agent, 'Ericsson') !== false) { $this->setBrowser('ericsson'); $this->mobile = true; } elseif (strpos($this->lowerAgent, 'wap') !== false) { $this->setBrowser('wap'); $this->mobile = true; } elseif (strpos($this->lowerAgent, 'docomo') !== false || strpos($this->lowerAgent, 'portalmmm') !== false) { $this->setBrowser('imode'); $this->mobile = true; } elseif (strpos($this->agent, 'BlackBerry') !== false) { $this->setBrowser('blackberry'); $this->mobile = true; } elseif (strpos($this->agent, 'MOT-') !== false) { $this->setBrowser('motorola'); $this->mobile = true; } elseif (strpos($this->lowerAgent, 'j-') !== false) { $this->setBrowser('mml'); $this->mobile = true; } } } /** * Match the platform of the browser. * * This is a pretty simplistic implementation, but it's intended * to let us tell what line breaks to send, so it's good enough * for its purpose. * * @return void * * @since 11.1 */ protected function _setPlatform() { if (strpos($this->lowerAgent, 'wind') !== false) { $this->platform = 'win'; } elseif (strpos($this->lowerAgent, 'mac') !== false) { $this->platform = 'mac'; } else { $this->platform = 'unix'; } } /** * Return the currently matched platform. * * @return string The user's platform. * * @since 11.1 */ public function getPlatform() { return $this->platform; } /** * Set browser version, not by engine version * Fallback to use when no other method identify the engine version * * @return void * * @since 11.1 */ protected function identifyBrowserVersion() { if (preg_match('|Version[/ ]([0-9.]+)|', $this->agent, $version)) { list ($this->majorVersion, $this->minorVersion) = explode('.', $version[1]); return; } // Can't identify browser version $this->majorVersion = 0; $this->minorVersion = 0; } /** * Sets the current browser. * * @param string $browser The browser to set as current. * * @return void * * @since 11.1 */ public function setBrowser($browser) { $this->browser = $browser; } /** * Retrieve the current browser. * * @return string The current browser. * * @since 11.1 */ public function getBrowser() { return $this->browser; } /** * Retrieve the current browser's major version. * * @return integer The current browser's major version * * @since 11.1 */ public function getMajor() { return $this->majorVersion; } /** * Retrieve the current browser's minor version. * * @return integer The current browser's minor version. * * @since 11.1 */ public function getMinor() { return $this->minorVersion; } /** * Retrieve the current browser's version. * * @return string The current browser's version. * * @since 11.1 */ public function getVersion() { return $this->majorVersion . '.' . $this->minorVersion; } /** * Return the full browser agent string. * * @return string The browser agent string * * @since 11.1 */ public function getAgentString() { return $this->agent; } /** * Returns the server protocol in use on the current server. * * @return string The HTTP server protocol version. * * @since 11.1 */ public function getHTTPProtocol() { if (isset($_SERVER['SERVER_PROTOCOL'])) { if (($pos = strrpos($_SERVER['SERVER_PROTOCOL'], '/'))) { return substr($_SERVER['SERVER_PROTOCOL'], $pos + 1); } } return null; } /** * Determines if a browser can display a given MIME type. * * Note that image/jpeg and image/pjpeg *appear* to be the same * entity, but Mozilla doesn't seem to want to accept the latter. * For our purposes, we will treat them the same. * * @param string $mimetype The MIME type to check. * * @return boolean True if the browser can display the MIME type. * * @since 11.1 */ public function isViewable($mimetype) { $mimetype = strtolower($mimetype); list ($type, $subtype) = explode('/', $mimetype); if (!empty($this->accept)) { $wildcard_match = false; if (strpos($this->accept, $mimetype) !== false) { return true; } if (strpos($this->accept, '*/*') !== false) { $wildcard_match = true; if ($type != 'image') { return true; } } // Deal with Mozilla pjpeg/jpeg issue if ($this->isBrowser('mozilla') && ($mimetype == 'image/pjpeg') && (strpos($this->accept, 'image/jpeg') !== false)) { return true; } if (!$wildcard_match) { return false; } } if ($type != 'image') { return false; } return (in_array($subtype, $this->images)); } /** * Determine if the given browser is the same as the current. * * @param string $browser The browser to check. * * @return boolean Is the given browser the same as the current? * * @since 11.1 */ public function isBrowser($browser) { return ($this->browser === $browser); } /** * Determines if the browser is a robot or not. * * @return boolean True if browser is a known robot. * * @since 11.1 */ public function isRobot() { foreach ($this->robots as $robot) { if (strpos($this->agent, $robot) !== false) { return true; } } return false; } /** * Determines if the browser is mobile version or not. * * @return boolean True if browser is a known mobile version. * * @since 11.1 */ public function isMobile() { return $this->mobile; } /** * Determine if we are using a secure (SSL) connection. * * @return boolean True if using SSL, false if not. * * @since 11.1 * @deprecated 13.3 (Platform) & 4.0 (CMS) - Use the isSSLConnection method on the application object. */ public function isSSLConnection() { JLog::add('JBrowser::isSSLConnection() is deprecated. Use the isSSLConnection method on the application object instead.', JLog::WARNING, 'deprecated'); return ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) || getenv('SSL_PROTOCOL_VERSION')); } } PK���\8wK��"libraries/joomla/object/object.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Object * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Joomla Platform Object Class * * This class allows for simple but smart objects with get and set methods * and an internal error handler. * * @since 11.1 * @deprecated 4.0 */ class JObject { /** * An array of error messages or Exception objects. * * @var array * @since 11.1 * @see JError * @deprecated 12.3 JError has been deprecated */ protected $_errors = array(); /** * Class constructor, overridden in descendant classes. * * @param mixed $properties Either and associative array or another * object to set the initial properties of the object. * * @since 11.1 */ public function __construct($properties = null) { if ($properties !== null) { $this->setProperties($properties); } } /** * Magic method to convert the object to a string gracefully. * * @return string The classname. * * @since 11.1 * @deprecated 12.3 Classes should provide their own __toString() implementation. */ public function __toString() { return get_class($this); } /** * Sets a default value if not already assigned * * @param string $property The name of the property. * @param mixed $default The default value. * * @return mixed * * @since 11.1 */ public function def($property, $default = null) { $value = $this->get($property, $default); return $this->set($property, $value); } /** * Returns a property of the object or the default value if the property is not set. * * @param string $property The name of the property. * @param mixed $default The default value. * * @return mixed The value of the property. * * @since 11.1 * * @see JObject::getProperties() */ public function get($property, $default = null) { if (isset($this->$property)) { return $this->$property; } return $default; } /** * Returns an associative array of object properties. * * @param boolean $public If true, returns only the public properties. * * @return array * * @since 11.1 * * @see JObject::get() */ public function getProperties($public = true) { $vars = get_object_vars($this); if ($public) { foreach ($vars as $key => $value) { if ('_' == substr($key, 0, 1)) { unset($vars[$key]); } } } return $vars; } /** * Get the most recent error message. * * @param integer $i Option error index. * @param boolean $toString Indicates if JError objects should return their error message. * * @return string Error message * * @since 11.1 * @see JError * @deprecated 12.3 JError has been deprecated */ public function getError($i = null, $toString = true) { // Find the error if ($i === null) { // Default, return the last message $error = end($this->_errors); } elseif (!array_key_exists($i, $this->_errors)) { // If $i has been specified but does not exist, return false return false; } else { $error = $this->_errors[$i]; } // Check if only the string is requested if ($error instanceof Exception && $toString) { return (string) $error; } return $error; } /** * Return all errors, if any. * * @return array Array of error messages or JErrors. * * @since 11.1 * @see JError * @deprecated 12.3 JError has been deprecated */ public function getErrors() { return $this->_errors; } /** * Modifies a property of the object, creating it if it does not already exist. * * @param string $property The name of the property. * @param mixed $value The value of the property to set. * * @return mixed Previous value of the property. * * @since 11.1 */ public function set($property, $value = null) { $previous = isset($this->$property) ? $this->$property : null; $this->$property = $value; return $previous; } /** * Set the object properties based on a named array/hash. * * @param mixed $properties Either an associative array or another object. * * @return boolean * * @since 11.1 * * @see JObject::set() */ public function setProperties($properties) { if (is_array($properties) || is_object($properties)) { foreach ((array) $properties as $k => $v) { // Use the set function which might be overridden. $this->set($k, $v); } return true; } return false; } /** * Add an error message. * * @param string $error Error message. * * @return void * * @since 11.1 * @see JError * @deprecated 12.3 JError has been deprecated */ public function setError($error) { array_push($this->_errors, $error); } } PK���\���r $libraries/joomla/application/cli.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Application\Cli\CliOutput; use Joomla\Registry\Registry; /** * Base class for a Joomla! command line application. * * @since 11.4 */ class JApplicationCli extends JApplicationBase { /** * @var CliOutput The output type. * @since 3.3 */ protected $output; /** * @var JApplicationCli The application instance. * @since 11.1 */ protected static $instance; /** * Class constructor. * * @param JInputCli $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInputCli object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param JEventDispatcher $dispatcher An optional argument to provide dependency injection for the application's * event dispatcher. If the argument is a JEventDispatcher object that object will become * the application's event dispatcher, if it is null then the default event dispatcher * will be created based on the application's loadDispatcher() method. * * @see JApplicationBase::loadDispatcher() * @since 11.1 */ public function __construct(JInputCli $input = null, Registry $config = null, JEventDispatcher $dispatcher = null) { // Close the application if we are not executed from the command line. // @codeCoverageIgnoreStart if (!defined('STDOUT') || !defined('STDIN') || !isset($_SERVER['argv'])) { $this->close(); } // @codeCoverageIgnoreEnd // If a input object is given use it. if ($input instanceof JInput) { $this->input = $input; } // Create the input based on the application logic. else { if (class_exists('JInput')) { $this->input = new JInputCli; } } // If a config object is given use it. if ($config instanceof Registry) { $this->config = $config; } // Instantiate a new configuration object. else { $this->config = new Registry; } $this->loadDispatcher($dispatcher); // Load the configuration object. $this->loadConfiguration($this->fetchConfigurationData()); // Set the execution datetime and timestamp; $this->set('execution.datetime', gmdate('Y-m-d H:i:s')); $this->set('execution.timestamp', time()); // Set the current directory. $this->set('cwd', getcwd()); } /** * Returns a reference to the global JApplicationCli object, only creating it if it doesn't already exist. * * This method must be invoked as: $cli = JApplicationCli::getInstance(); * * @param string $name The name (optional) of the JApplicationCli class to instantiate. * * @return JApplicationCli * * @since 11.1 */ public static function getInstance($name = null) { // Only create the object if it doesn't exist. if (empty(self::$instance)) { if (class_exists($name) && (is_subclass_of($name, 'JApplicationCli'))) { self::$instance = new $name; } else { self::$instance = new JApplicationCli; } } return self::$instance; } /** * Execute the application. * * @return void * * @since 11.1 */ public function execute() { // Trigger the onBeforeExecute event. $this->triggerEvent('onBeforeExecute'); // Perform application routines. $this->doExecute(); // Trigger the onAfterExecute event. $this->triggerEvent('onAfterExecute'); } /** * Load an object or array into the application configuration object. * * @param mixed $data Either an array or object to be loaded into the configuration object. * * @return JApplicationCli Instance of $this to allow chaining. * * @since 11.1 */ public function loadConfiguration($data) { // Load the data into the configuration object. if (is_array($data)) { $this->config->loadArray($data); } elseif (is_object($data)) { $this->config->loadObject($data); } return $this; } /** * Write a string to standard output. * * @param string $text The text to display. * @param boolean $nl True (default) to append a new line at the end of the output string. * * @return JApplicationCli Instance of $this to allow chaining. * * @codeCoverageIgnore * @since 11.1 */ public function out($text = '', $nl = true) { $output = $this->getOutput(); $output->out($text, $nl); return $this; } /** * Get an output object. * * @return CliOutput * * @since 3.3 */ public function getOutput() { if (!$this->output) { // In 4.0, this will convert to throwing an exception and you will expected to // initialize this in the constructor. Until then set a default. $default = new Joomla\Application\Cli\Output\Xml; $this->setOutput($default); } return $this->output; } /** * Set an output object. * * @param CliOutput $output CliOutput object * * @return JApplicationCli Instance of $this to allow chaining. * * @since 3.3 */ public function setOutput(CliOutput $output) { $this->output = $output; return $this; } /** * Get a value from standard input. * * @return string The input string from standard input. * * @codeCoverageIgnore * @since 11.1 */ public function in() { return rtrim(fread(STDIN, 8192), "\n"); } /** * Method to load a PHP configuration class file based on convention and return the instantiated data object. You * will extend this method in child classes to provide configuration data from whatever data source is relevant * for your specific application. * * @param string $file The path and filename of the configuration file. If not provided, configuration.php * in JPATH_BASE will be used. * @param string $class The class name to instantiate. * * @return mixed Either an array or object to be loaded into the configuration object. * * @since 11.1 */ protected function fetchConfigurationData($file = '', $class = 'JConfig') { // Instantiate variables. $config = array(); if (empty($file) && defined('JPATH_BASE')) { $file = JPATH_BASE . '/configuration.php'; // Applications can choose not to have any configuration data // by not implementing this method and not having a config file. if (!file_exists($file)) { $file = ''; } } if (!empty($file)) { JLoader::register($class, $file); if (class_exists($class)) { $config = new $class; } else { throw new RuntimeException('Configuration class does not exist.'); } } return $config; } /** * Method to run the application routines. Most likely you will want to instantiate a controller * and execute it, or perform some sort of task directly. * * @return void * * @codeCoverageIgnore * @since 11.3 */ protected function doExecute() { // Your application routines go here. } } PK���\�o9)tbtb'libraries/joomla/application/daemon.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); use Joomla\Registry\Registry; /** * Class to turn JApplicationCli applications into daemons. It requires CLI and PCNTL support built into PHP. * * @see http://www.php.net/manual/en/book.pcntl.php * @see http://php.net/manual/en/features.commandline.php * @since 11.1 */ class JApplicationDaemon extends JApplicationCli { /** * @var array The available POSIX signals to be caught by default. * @see http://php.net/manual/pcntl.constants.php * @since 11.1 */ protected static $signals = array( 'SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGIOT', 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGALRM', 'SIGTERM', 'SIGSTKFLT', 'SIGCLD', 'SIGCHLD', 'SIGCONT', 'SIGTSTP', 'SIGTTIN', 'SIGTTOU', 'SIGURG', 'SIGXCPU', 'SIGXFSZ', 'SIGVTALRM', 'SIGPROF', 'SIGWINCH', 'SIGPOLL', 'SIGIO', 'SIGPWR', 'SIGSYS', 'SIGBABY', 'SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK' ); /** * @var boolean True if the daemon is in the process of exiting. * @since 11.1 */ protected $exiting = false; /** * @var integer The parent process id. * @since 12.1 */ protected $parentId = 0; /** * @var integer The process id of the daemon. * @since 11.1 */ protected $processId = 0; /** * @var boolean True if the daemon is currently running. * @since 11.1 */ protected $running = false; /** * Class constructor. * * @param JInputCli $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInputCli object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param JEventDispatcher $dispatcher An optional argument to provide dependency injection for the application's * event dispatcher. If the argument is a JEventDispatcher object that object will become * the application's event dispatcher, if it is null then the default event dispatcher * will be created based on the application's loadDispatcher() method. * * @since 11.1 * @throws RuntimeException */ public function __construct(JInputCli $input = null, Registry $config = null, JEventDispatcher $dispatcher = null) { // Verify that the process control extension for PHP is available. // @codeCoverageIgnoreStart if (!defined('SIGHUP')) { JLog::add('The PCNTL extension for PHP is not available.', JLog::ERROR); throw new RuntimeException('The PCNTL extension for PHP is not available.'); } // Verify that POSIX support for PHP is available. if (!function_exists('posix_getpid')) { JLog::add('The POSIX extension for PHP is not available.', JLog::ERROR); throw new RuntimeException('The POSIX extension for PHP is not available.'); } // @codeCoverageIgnoreEnd // Call the parent constructor. parent::__construct($input, $config, $dispatcher); // Set some system limits. @set_time_limit($this->config->get('max_execution_time', 0)); if ($this->config->get('max_memory_limit') !== null) { ini_set('memory_limit', $this->config->get('max_memory_limit', '256M')); } // Flush content immediately. ob_implicit_flush(); } /** * Method to handle POSIX signals. * * @param integer $signal The received POSIX signal. * * @return void * * @since 11.1 * @see pcntl_signal() * @throws RuntimeException */ public static function signal($signal) { // Log all signals sent to the daemon. JLog::add('Received signal: ' . $signal, JLog::DEBUG); // Let's make sure we have an application instance. if (!is_subclass_of(static::$instance, 'JApplicationDaemon')) { JLog::add('Cannot find the application instance.', JLog::EMERGENCY); throw new RuntimeException('Cannot find the application instance.'); } // Fire the onReceiveSignal event. static::$instance->triggerEvent('onReceiveSignal', array($signal)); switch ($signal) { case SIGINT: case SIGTERM: // Handle shutdown tasks if (static::$instance->running && static::$instance->isActive()) { static::$instance->shutdown(); } else { static::$instance->close(); } break; case SIGHUP: // Handle restart tasks if (static::$instance->running && static::$instance->isActive()) { static::$instance->shutdown(true); } else { static::$instance->close(); } break; case SIGCHLD: // A child process has died while (static::$instance->pcntlWait($signal, WNOHANG || WUNTRACED) > 0) { usleep(1000); } break; case SIGCLD: while (static::$instance->pcntlWait($signal, WNOHANG) > 0) { $signal = static::$instance->pcntlChildExitStatus($signal); } break; default: break; } } /** * Check to see if the daemon is active. This does not assume that $this daemon is active, but * only if an instance of the application is active as a daemon. * * @return boolean True if daemon is active. * * @since 11.1 */ public function isActive() { // Get the process id file location for the application. $pidFile = $this->config->get('application_pid_file'); // If the process id file doesn't exist then the daemon is obviously not running. if (!is_file($pidFile)) { return false; } // Read the contents of the process id file as an integer. $fp = fopen($pidFile, 'r'); $pid = fread($fp, filesize($pidFile)); $pid = (int) $pid; fclose($fp); // Check to make sure that the process id exists as a positive integer. if (!$pid) { return false; } // Check to make sure the process is active by pinging it and ensure it responds. if (!posix_kill($pid, 0)) { // No response so remove the process id file and log the situation. @ unlink($pidFile); JLog::add('The process found based on PID file was unresponsive.', JLog::WARNING); return false; } return true; } /** * Load an object or array into the application configuration object. * * @param mixed $data Either an array or object to be loaded into the configuration object. * * @return JCli Instance of $this to allow chaining. * * @since 11.1 */ public function loadConfiguration($data) { // Execute the parent load method. parent::loadConfiguration($data); /* * Setup some application metadata options. This is useful if we ever want to write out startup scripts * or just have some sort of information available to share about things. */ // The application author name. This string is used in generating startup scripts and has // a maximum of 50 characters. $tmp = (string) $this->config->get('author_name', 'Joomla Platform'); $this->config->set('author_name', (strlen($tmp) > 50) ? substr($tmp, 0, 50) : $tmp); // The application author email. This string is used in generating startup scripts. $tmp = (string) $this->config->get('author_email', 'admin@joomla.org'); $this->config->set('author_email', filter_var($tmp, FILTER_VALIDATE_EMAIL)); // The application name. This string is used in generating startup scripts. $tmp = (string) $this->config->get('application_name', 'JApplicationDaemon'); $this->config->set('application_name', (string) preg_replace('/[^A-Z0-9_-]/i', '', $tmp)); // The application description. This string is used in generating startup scripts. $tmp = (string) $this->config->get('application_description', 'A generic Joomla Platform application.'); $this->config->set('application_description', filter_var($tmp, FILTER_SANITIZE_STRING)); /* * Setup the application path options. This defines the default executable name, executable directory, * and also the path to the daemon process id file. */ // The application executable daemon. This string is used in generating startup scripts. $tmp = (string) $this->config->get('application_executable', basename($this->input->executable)); $this->config->set('application_executable', $tmp); // The home directory of the daemon. $tmp = (string) $this->config->get('application_directory', dirname($this->input->executable)); $this->config->set('application_directory', $tmp); // The pid file location. This defaults to a path inside the /tmp directory. $name = $this->config->get('application_name'); $tmp = (string) $this->config->get('application_pid_file', strtolower('/tmp/' . $name . '/' . $name . '.pid')); $this->config->set('application_pid_file', $tmp); /* * Setup the application identity options. It is important to remember if the default of 0 is set for * either UID or GID then changing that setting will not be attempted as there is no real way to "change" * the identity of a process from some user to root. */ // The user id under which to run the daemon. $tmp = (int) $this->config->get('application_uid', 0); $options = array('options' => array('min_range' => 0, 'max_range' => 65000)); $this->config->set('application_uid', filter_var($tmp, FILTER_VALIDATE_INT, $options)); // The group id under which to run the daemon. $tmp = (int) $this->config->get('application_gid', 0); $options = array('options' => array('min_range' => 0, 'max_range' => 65000)); $this->config->set('application_gid', filter_var($tmp, FILTER_VALIDATE_INT, $options)); // Option to kill the daemon if it cannot switch to the chosen identity. $tmp = (bool) $this->config->get('application_require_identity', 1); $this->config->set('application_require_identity', $tmp); /* * Setup the application runtime options. By default our execution time limit is infinite obviously * because a daemon should be constantly running unless told otherwise. The default limit for memory * usage is 256M, which admittedly is a little high, but remember it is a "limit" and PHP's memory * management leaves a bit to be desired :-) */ // The maximum execution time of the application in seconds. Zero is infinite. $tmp = $this->config->get('max_execution_time'); if ($tmp !== null) { $this->config->set('max_execution_time', (int) $tmp); } // The maximum amount of memory the application can use. $tmp = $this->config->get('max_memory_limit', '256M'); if ($tmp !== null) { $this->config->set('max_memory_limit', (string) $tmp); } return $this; } /** * Execute the daemon. * * @return void * * @since 11.1 */ public function execute() { // Trigger the onBeforeExecute event. $this->triggerEvent('onBeforeExecute'); // Enable basic garbage collection. gc_enable(); JLog::add('Starting ' . $this->name, JLog::INFO); // Set off the process for becoming a daemon. if ($this->daemonize()) { // Declare ticks to start signal monitoring. When you declare ticks, PCNTL will monitor // incoming signals after each tick and call the relevant signal handler automatically. declare (ticks = 1); // Start the main execution loop. while (true) { // Perform basic garbage collection. $this->gc(); // Don't completely overload the CPU. usleep(1000); // Execute the main application logic. $this->doExecute(); } } // We were not able to daemonize the application so log the failure and die gracefully. else { JLog::add('Starting ' . $this->name . ' failed', JLog::INFO); } // Trigger the onAfterExecute event. $this->triggerEvent('onAfterExecute'); } /** * Restart daemon process. * * @return void * * @codeCoverageIgnore * @since 11.1 */ public function restart() { JLog::add('Stopping ' . $this->name, JLog::INFO); $this->shutdown(true); } /** * Stop daemon process. * * @return void * * @codeCoverageIgnore * @since 11.1 */ public function stop() { JLog::add('Stopping ' . $this->name, JLog::INFO); $this->shutdown(); } /** * Method to change the identity of the daemon process and resources. * * @return boolean True if identity successfully changed * * @since 11.1 * @see posix_setuid() */ protected function changeIdentity() { // Get the group and user ids to set for the daemon. $uid = (int) $this->config->get('application_uid', 0); $gid = (int) $this->config->get('application_gid', 0); // Get the application process id file path. $file = $this->config->get('application_pid_file'); // Change the user id for the process id file if necessary. if ($uid && (fileowner($file) != $uid) && (!@ chown($file, $uid))) { JLog::add('Unable to change user ownership of the process id file.', JLog::ERROR); return false; } // Change the group id for the process id file if necessary. if ($gid && (filegroup($file) != $gid) && (!@ chgrp($file, $gid))) { JLog::add('Unable to change group ownership of the process id file.', JLog::ERROR); return false; } // Set the correct home directory for the process. if ($uid && ($info = posix_getpwuid($uid)) && is_dir($info['dir'])) { system('export HOME="' . $info['dir'] . '"'); } // Change the user id for the process necessary. if ($uid && (posix_getuid($file) != $uid) && (!@ posix_setuid($uid))) { JLog::add('Unable to change user ownership of the proccess.', JLog::ERROR); return false; } // Change the group id for the process necessary. if ($gid && (posix_getgid($file) != $gid) && (!@ posix_setgid($gid))) { JLog::add('Unable to change group ownership of the proccess.', JLog::ERROR); return false; } // Get the user and group information based on uid and gid. $user = posix_getpwuid($uid); $group = posix_getgrgid($gid); JLog::add('Changed daemon identity to ' . $user['name'] . ':' . $group['name'], JLog::INFO); return true; } /** * Method to put the application into the background. * * @return boolean * * @since 11.1 * @throws RuntimeException */ protected function daemonize() { // Is there already an active daemon running? if ($this->isActive()) { JLog::add($this->name . ' daemon is still running. Exiting the application.', JLog::EMERGENCY); return false; } // Reset Process Information $this->safeMode = !!@ ini_get('safe_mode'); $this->processId = 0; $this->running = false; // Detach process! try { // Check if we should run in the foreground. if (!$this->input->get('f')) { // Detach from the terminal. $this->detach(); } else { // Setup running values. $this->exiting = false; $this->running = true; // Set the process id. $this->processId = (int) posix_getpid(); $this->parentId = $this->processId; } } catch (RuntimeException $e) { JLog::add('Unable to fork.', JLog::EMERGENCY); return false; } // Verify the process id is valid. if ($this->processId < 1) { JLog::add('The process id is invalid; the fork failed.', JLog::EMERGENCY); return false; } // Clear the umask. @ umask(0); // Write out the process id file for concurrency management. if (!$this->writeProcessIdFile()) { JLog::add('Unable to write the pid file at: ' . $this->config->get('application_pid_file'), JLog::EMERGENCY); return false; } // Attempt to change the identity of user running the process. if (!$this->changeIdentity()) { // If the identity change was required then we need to return false. if ($this->config->get('application_require_identity')) { JLog::add('Unable to change process owner.', JLog::CRITICAL); return false; } else { JLog::add('Unable to change process owner.', JLog::WARNING); } } // Setup the signal handlers for the daemon. if (!$this->setupSignalHandlers()) { return false; } // Change the current working directory to the application working directory. @ chdir($this->config->get('application_directory')); return true; } /** * This is truly where the magic happens. This is where we fork the process and kill the parent * process, which is essentially what turns the application into a daemon. * * @return void * * @since 12.1 * @throws RuntimeException */ protected function detach() { JLog::add('Detaching the ' . $this->name . ' daemon.', JLog::DEBUG); // Attempt to fork the process. $pid = $this->fork(); // If the pid is positive then we successfully forked, and can close this application. if ($pid) { // Add the log entry for debugging purposes and exit gracefully. JLog::add('Ending ' . $this->name . ' parent process', JLog::DEBUG); $this->close(); } // We are in the forked child process. else { // Setup some protected values. $this->exiting = false; $this->running = true; // Set the parent to self. $this->parentId = $this->processId; } } /** * Method to fork the process. * * @return integer The child process id to the parent process, zero to the child process. * * @since 11.1 * @throws RuntimeException */ protected function fork() { // Attempt to fork the process. $pid = $this->pcntlFork(); // If the fork failed, throw an exception. if ($pid === -1) { throw new RuntimeException('The process could not be forked.'); } // Update the process id for the child. elseif ($pid === 0) { $this->processId = (int) posix_getpid(); } // Log the fork in the parent. else { // Log the fork. JLog::add('Process forked ' . $pid, JLog::DEBUG); } // Trigger the onFork event. $this->postFork(); return $pid; } /** * Method to perform basic garbage collection and memory management in the sense of clearing the * stat cache. We will probably call this method pretty regularly in our main loop. * * @return void * * @codeCoverageIgnore * @since 11.1 */ protected function gc() { // Perform generic garbage collection. gc_collect_cycles(); // Clear the stat cache so it doesn't blow up memory. clearstatcache(); } /** * Method to attach the JApplicationDaemon signal handler to the known signals. Applications * can override these handlers by using the pcntl_signal() function and attaching a different * callback method. * * @return boolean * * @since 11.1 * @see pcntl_signal() */ protected function setupSignalHandlers() { // We add the error suppression for the loop because on some platforms some constants are not defined. foreach (self::$signals as $signal) { // Ignore signals that are not defined. if (!defined($signal) || !is_int(constant($signal)) || (constant($signal) === 0)) { // Define the signal to avoid notices. JLog::add('Signal "' . $signal . '" not defined. Defining it as null.', JLog::DEBUG); define($signal, null); // Don't listen for signal. continue; } // Attach the signal handler for the signal. if (!$this->pcntlSignal(constant($signal), array('JApplicationDaemon', 'signal'))) { JLog::add(sprintf('Unable to reroute signal handler: %s', $signal), JLog::EMERGENCY); return false; } } return true; } /** * Method to shut down the daemon and optionally restart it. * * @param boolean $restart True to restart the daemon on exit. * * @return void * * @since 11.1 */ protected function shutdown($restart = false) { // If we are already exiting, chill. if ($this->exiting) { return; } // If not, now we are. else { $this->exiting = true; } // If we aren't already daemonized then just kill the application. if (!$this->running && !$this->isActive()) { JLog::add('Process was not daemonized yet, just halting current process', JLog::INFO); $this->close(); } // Only read the pid for the parent file. if ($this->parentId == $this->processId) { // Read the contents of the process id file as an integer. $fp = fopen($this->config->get('application_pid_file'), 'r'); $pid = fread($fp, filesize($this->config->get('application_pid_file'))); $pid = (int) $pid; fclose($fp); // Remove the process id file. @ unlink($this->config->get('application_pid_file')); // If we are supposed to restart the daemon we need to execute the same command. if ($restart) { $this->close(exec(implode(' ', $GLOBALS['argv']) . ' > /dev/null &')); } // If we are not supposed to restart the daemon let's just kill -9. else { passthru('kill -9 ' . $pid); $this->close(); } } } /** * Method to write the process id file out to disk. * * @return boolean * * @since 11.1 */ protected function writeProcessIdFile() { // Verify the process id is valid. if ($this->processId < 1) { JLog::add('The process id is invalid.', JLog::EMERGENCY); return false; } // Get the application process id file path. $file = $this->config->get('application_pid_file'); if (empty($file)) { JLog::add('The process id file path is empty.', JLog::ERROR); return false; } // Make sure that the folder where we are writing the process id file exists. $folder = dirname($file); if (!is_dir($folder) && !JFolder::create($folder)) { JLog::add('Unable to create directory: ' . $folder, JLog::ERROR); return false; } // Write the process id file out to disk. if (!file_put_contents($file, $this->processId)) { JLog::add('Unable to write proccess id file: ' . $file, JLog::ERROR); return false; } // Make sure the permissions for the proccess id file are accurate. if (!chmod($file, 0644)) { JLog::add('Unable to adjust permissions for the proccess id file: ' . $file, JLog::ERROR); return false; } return true; } /** * Method to handle post-fork triggering of the onFork event. * * @return void * * @since 12.1 */ protected function postFork() { // Trigger the onFork event. $this->triggerEvent('onFork'); } /** * Method to return the exit code of a terminated child process. * * @param integer $status The status parameter is the status parameter supplied to a successful call to pcntl_waitpid(). * * @return integer The child process exit code. * * @codeCoverageIgnore * @see pcntl_wexitstatus() * @since 11.3 */ protected function pcntlChildExitStatus($status) { return pcntl_wexitstatus($status); } /** * Method to return the exit code of a terminated child process. * * @return integer On success, the PID of the child process is returned in the parent's thread * of execution, and a 0 is returned in the child's thread of execution. On * failure, a -1 will be returned in the parent's context, no child process * will be created, and a PHP error is raised. * * @codeCoverageIgnore * @see pcntl_fork() * @since 11.3 */ protected function pcntlFork() { return pcntl_fork(); } /** * Method to install a signal handler. * * @param integer $signal The signal number. * @param callable $handler The signal handler which may be the name of a user created function, * or method, or either of the two global constants SIG_IGN or SIG_DFL. * @param boolean $restart Specifies whether system call restarting should be used when this * signal arrives. * * @return boolean True on success. * * @codeCoverageIgnore * @see pcntl_signal() * @since 11.3 */ protected function pcntlSignal($signal , $handler, $restart = true) { return pcntl_signal($signal, $handler, $restart); } /** * Method to wait on or return the status of a forked child. * * @param integer &$status Status information. * @param integer $options If wait3 is available on your system (mostly BSD-style systems), * you can provide the optional options parameter. * * @return integer The process ID of the child which exited, -1 on error or zero if WNOHANG * was provided as an option (on wait3-available systems) and no child was available. * * @codeCoverageIgnore * @see pcntl_wait() * @since 11.3 */ protected function pcntlWait(&$status, $options = 0) { return pcntl_wait($status, $options); } } PK���\��s��0libraries/joomla/application/web/router/base.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Basic Web application router class for the Joomla Platform. * * @since 12.2 */ class JApplicationWebRouterBase extends JApplicationWebRouter { /** * @var array An array of rules, each rule being an associative array('regex'=> $regex, 'vars' => $vars, 'controller' => $controller) * for routing the request. * @since 12.2 */ protected $maps = array(); /** * Add a route map to the router. If the pattern already exists it will be overwritten. * * @param string $pattern The route pattern to use for matching. * @param string $controller The controller name to map to the given pattern. * * @return JApplicationWebRouter This object for method chaining. * * @since 12.2 */ public function addMap($pattern, $controller) { // Sanitize and explode the pattern. $pattern = explode('/', trim(parse_url((string) $pattern, PHP_URL_PATH), ' /')); // Prepare the route variables $vars = array(); // Initialize regular expression $regex = array(); // Loop on each segment foreach ($pattern as $segment) { // Match a splat with no variable. if ($segment == '*') { $regex[] = '.*'; } // Match a splat and capture the data to a named variable. elseif ($segment[0] == '*') { $vars[] = substr($segment, 1); $regex[] = '(.*)'; } // Match an escaped splat segment. elseif ($segment[0] == '\\' && $segment[1] == '*') { $regex[] = '\*' . preg_quote(substr($segment, 2)); } // Match an unnamed variable without capture. elseif ($segment == ':') { $regex[] = '[^/]*'; } // Match a named variable and capture the data. elseif ($segment[0] == ':') { $vars[] = substr($segment, 1); $regex[] = '([^/]*)'; } // Match a segment with an escaped variable character prefix. elseif ($segment[0] == '\\' && $segment[1] == ':') { $regex[] = preg_quote(substr($segment, 1)); } // Match the standard segment. else { $regex[] = preg_quote($segment); } } $this->maps[] = array( 'regex' => chr(1) . '^' . implode('/', $regex) . '$' . chr(1), 'vars' => $vars, 'controller' => (string) $controller ); return $this; } /** * Add a route map to the router. If the pattern already exists it will be overwritten. * * @param array $maps A list of route maps to add to the router as $pattern => $controller. * * @return JApplicationWebRouter This object for method chaining. * * @since 12.2 */ public function addMaps($maps) { foreach ($maps as $pattern => $controller) { $this->addMap($pattern, $controller); } return $this; } /** * Parse the given route and return the name of a controller mapped to the given route. * * @param string $route The route string for which to find and execute a controller. * * @return string The controller name for the given route excluding prefix. * * @since 12.2 * @throws InvalidArgumentException */ protected function parseRoute($route) { $controller = false; // Trim the query string off. $route = preg_replace('/([^?]*).*/u', '\1', $route); // Sanitize and explode the route. $route = trim(parse_url($route, PHP_URL_PATH), ' /'); // If the route is empty then simply return the default route. No parsing necessary. if ($route == '') { return $this->default; } // Iterate through all of the known route maps looking for a match. foreach ($this->maps as $rule) { if (preg_match($rule['regex'], $route, $matches)) { // If we have gotten this far then we have a positive match. $controller = $rule['controller']; // Time to set the input variables. // We are only going to set them if they don't already exist to avoid overwriting things. foreach ($rule['vars'] as $i => $var) { $this->input->def($var, $matches[$i + 1]); // Don't forget to do an explicit set on the GET superglobal. $this->input->get->def($var, $matches[$i + 1]); } $this->input->def('_rawRoute', $route); break; } } // We were unable to find a route match for the request. Panic. if (!$controller) { throw new InvalidArgumentException(sprintf('Unable to handle request for route `%s`.', $route), 404); } return $controller; } } PK���\���� � 0libraries/joomla/application/web/router/rest.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * RESTful Web application router class for the Joomla Platform. * * @since 12.2 */ class JApplicationWebRouterRest extends JApplicationWebRouterBase { /** * @var boolean A boolean allowing to pass _method as parameter in POST requests * * @since 12.2 */ protected $methodInPostRequest = false; /** * @var array An array of HTTP Method => controller suffix pairs for routing the request. * @since 12.2 */ protected $suffixMap = array( 'GET' => 'Get', 'POST' => 'Create', 'PUT' => 'Update', 'PATCH' => 'Update', 'DELETE' => 'Delete', 'HEAD' => 'Head', 'OPTIONS' => 'Options' ); /** * Find and execute the appropriate controller based on a given route. * * @param string $route The route string for which to find and execute a controller. * * @return void * * @since 12.2 * @throws InvalidArgumentException * @throws RuntimeException */ public function execute($route) { // Get the controller name based on the route patterns and requested route. $name = $this->parseRoute($route); // Append the HTTP method based suffix. $name .= $this->fetchControllerSuffix(); // Get the controller object by name. $controller = $this->fetchController($name); // Execute the controller. $controller->execute(); } /** * Set a controller class suffix for a given HTTP method. * * @param string $method The HTTP method for which to set the class suffix. * @param string $suffix The class suffix to use when fetching the controller name for a given request. * * @return JApplicationWebRouter This object for method chaining. * * @since 12.2 */ public function setHttpMethodSuffix($method, $suffix) { $this->suffixMap[strtoupper((string) $method)] = (string) $suffix; return $this; } /** * Set to allow or not method in POST request * * @param boolean $value A boolean to allow or not method in POST request * * @return void * * @since 12.2 */ public function setMethodInPostRequest($value) { $this->methodInPostRequest = $value; } /** * Get the property to allow or not method in POST request * * @return boolean * * @since 12.2 */ public function isMethodInPostRequest() { return $this->methodInPostRequest; } /** * Get the controller class suffix string. * * @return string * * @since 12.2 * @throws RuntimeException */ protected function fetchControllerSuffix() { // Validate that we have a map to handle the given HTTP method. if (!isset($this->suffixMap[$this->input->getMethod()])) { throw new RuntimeException(sprintf('Unable to support the HTTP method `%s`.', $this->input->getMethod()), 404); } // Check if request method is POST if ( $this->methodInPostRequest == true && strcmp(strtoupper($this->input->server->getMethod()), 'POST') === 0) { // Get the method from input $postMethod = $this->input->get->getWord('_method'); // Validate that we have a map to handle the given HTTP method from input if ($postMethod && isset($this->suffixMap[strtoupper($postMethod)])) { return ucfirst($this->suffixMap[strtoupper($postMethod)]); } } return ucfirst($this->suffixMap[$this->input->getMethod()]); } } PK���\�8{�00+libraries/joomla/application/web/router.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Class to define an abstract Web application router. * * @since 12.2 */ abstract class JApplicationWebRouter { /** * @var JApplicationWeb The web application on whose behalf we are routing the request. * @since 12.2 */ protected $app; /** * @var string The default page controller name for an empty route. * @since 12.2 */ protected $default; /** * @var string Controller class name prefix for creating controller objects by name. * @since 12.2 */ protected $controllerPrefix; /** * @var JInput An input object from which to derive the route. * @since 12.2 */ protected $input; /** * Constructor. * * @param JApplicationWeb $app The web application on whose behalf we are routing the request. * @param JInput $input An optional input object from which to derive the route. If none * is given than the input from the application object will be used. * * @since 12.2 */ public function __construct(JApplicationWeb $app, JInput $input = null) { $this->app = $app; $this->input = ($input === null) ? $this->app->input : $input; } /** * Find and execute the appropriate controller based on a given route. * * @param string $route The route string for which to find and execute a controller. * * @return mixed The return value of the controller executed * * @since 12.2 * @throws InvalidArgumentException * @throws RuntimeException */ public function execute($route) { // Get the controller name based on the route patterns and requested route. $name = $this->parseRoute($route); // Get the controller object by name. $controller = $this->fetchController($name); // Execute the controller. return $controller->execute(); } /** * Set the controller name prefix. * * @param string $prefix Controller class name prefix for creating controller objects by name. * * @return JApplicationWebRouter This object for method chaining. * * @since 12.2 */ public function setControllerPrefix($prefix) { $this->controllerPrefix = (string) $prefix; return $this; } /** * Set the default controller name. * * @param string $name The default page controller name for an empty route. * * @return JApplicationWebRouter This object for method chaining. * * @since 12.2 */ public function setDefaultController($name) { $this->default = (string) $name; return $this; } /** * Parse the given route and return the name of a controller mapped to the given route. * * @param string $route The route string for which to find and execute a controller. * * @return string The controller name for the given route excluding prefix. * * @since 12.2 * @throws InvalidArgumentException */ abstract protected function parseRoute($route); /** * Get a JController object for a given name. * * @param string $name The controller name (excluding prefix) for which to fetch and instance. * * @return JController * * @since 12.2 * @throws RuntimeException */ protected function fetchController($name) { // Derive the controller class name. $class = $this->controllerPrefix . ucfirst($name); // If the controller class does not exist panic. if (!class_exists($class) || !is_subclass_of($class, 'JController')) { throw new RuntimeException(sprintf('Unable to locate controller `%s`.', $class), 404); } // Instantiate the controller. $controller = new $class($this->input, $this->app); return $controller; } } PK���\"b�Q�6�6+libraries/joomla/application/web/client.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Class to model a Web Client. * * @property-read integer $platform The detected platform on which the web client runs. * @property-read boolean $mobile True if the web client is a mobile device. * @property-read integer $engine The detected rendering engine used by the web client. * @property-read integer $browser The detected browser used by the web client. * @property-read string $browserVersion The detected browser version used by the web client. * @property-read array $languages The priority order detected accepted languages for the client. * @property-read array $encodings The priority order detected accepted encodings for the client. * @property-read string $userAgent The web client's user agent string. * @property-read string $acceptEncoding The web client's accepted encoding string. * @property-read string $acceptLanguage The web client's accepted languages string. * @property-read array $detection An array of flags determining whether or not a detection routine has been run. * @property-read boolean $robot True if the web client is a robot * * @since 12.1 */ class JApplicationWebClient { const WINDOWS = 1; const WINDOWS_PHONE = 2; const WINDOWS_CE = 3; const IPHONE = 4; const IPAD = 5; const IPOD = 6; const MAC = 7; const BLACKBERRY = 8; const ANDROID = 9; const LINUX = 10; const TRIDENT = 11; const WEBKIT = 12; const GECKO = 13; const PRESTO = 14; const KHTML = 15; const AMAYA = 16; const IE = 17; const FIREFOX = 18; const CHROME = 19; const SAFARI = 20; const OPERA = 21; const ANDROIDTABLET = 22; /** * @var integer The detected platform on which the web client runs. * @since 12.1 */ protected $platform; /** * @var boolean True if the web client is a mobile device. * @since 12.1 */ protected $mobile = false; /** * @var integer The detected rendering engine used by the web client. * @since 12.1 */ protected $engine; /** * @var integer The detected browser used by the web client. * @since 12.1 */ protected $browser; /** * @var string The detected browser version used by the web client. * @since 12.1 */ protected $browserVersion; /** * @var array The priority order detected accepted languages for the client. * @since 12.1 */ protected $languages = array(); /** * @var array The priority order detected accepted encodings for the client. * @since 12.1 */ protected $encodings = array(); /** * @var string The web client's user agent string. * @since 12.1 */ protected $userAgent; /** * @var string The web client's accepted encoding string. * @since 12.1 */ protected $acceptEncoding; /** * @var string The web client's accepted languages string. * @since 12.1 */ protected $acceptLanguage; /** * @var boolean True if the web client is a robot. * @since 12.3 */ protected $robot = false; /** * @var array An array of flags determining whether or not a detection routine has been run. * @since 12.1 */ protected $detection = array(); /** * Class constructor. * * @param string $userAgent The optional user-agent string to parse. * @param string $acceptEncoding The optional client accept encoding string to parse. * @param string $acceptLanguage The optional client accept language string to parse. * * @since 12.1 */ public function __construct($userAgent = null, $acceptEncoding = null, $acceptLanguage = null) { // If no explicit user agent string was given attempt to use the implicit one from server environment. if (empty($userAgent) && isset($_SERVER['HTTP_USER_AGENT'])) { $this->userAgent = $_SERVER['HTTP_USER_AGENT']; } else { $this->userAgent = $userAgent; } // If no explicit acceptable encoding string was given attempt to use the implicit one from server environment. if (empty($acceptEncoding) && isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { $this->acceptEncoding = $_SERVER['HTTP_ACCEPT_ENCODING']; } else { $this->acceptEncoding = $acceptEncoding; } // If no explicit acceptable languages string was given attempt to use the implicit one from server environment. if (empty($acceptLanguage) && isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $this->acceptLanguage = $_SERVER['HTTP_ACCEPT_LANGUAGE']; } else { $this->acceptLanguage = $acceptLanguage; } } /** * Magic method to get an object property's value by name. * * @param string $name Name of the property for which to return a value. * * @return mixed The requested value if it exists. * * @since 12.1 */ public function __get($name) { switch ($name) { case 'mobile': case 'platform': if (empty($this->detection['platform'])) { $this->detectPlatform($this->userAgent); } break; case 'engine': if (empty($this->detection['engine'])) { $this->detectEngine($this->userAgent); } break; case 'browser': case 'browserVersion': if (empty($this->detection['browser'])) { $this->detectBrowser($this->userAgent); } break; case 'languages': if (empty($this->detection['acceptLanguage'])) { $this->detectLanguage($this->acceptLanguage); } break; case 'encodings': if (empty($this->detection['acceptEncoding'])) { $this->detectEncoding($this->acceptEncoding); } break; case 'robot': if (empty($this->detection['robot'])) { $this->detectRobot($this->userAgent); } break; } // Return the property if it exists. if (isset($this->$name)) { return $this->$name; } } /** * Detects the client browser and version in a user agent string. * * @param string $userAgent The user-agent string to parse. * * @return void * * @since 12.1 */ protected function detectBrowser($userAgent) { // Attempt to detect the browser type. Obviously we are only worried about major browsers. if ((stripos($userAgent, 'MSIE') !== false) && (stripos($userAgent, 'Opera') === false)) { $this->browser = self::IE; $patternBrowser = 'MSIE'; } elseif ((stripos($userAgent, 'Firefox') !== false) && (stripos($userAgent, 'like Firefox') === false)) { $this->browser = self::FIREFOX; $patternBrowser = 'Firefox'; } elseif (stripos($userAgent, 'Chrome') !== false) { $this->browser = self::CHROME; $patternBrowser = 'Chrome'; } elseif (stripos($userAgent, 'Safari') !== false) { $this->browser = self::SAFARI; $patternBrowser = 'Safari'; } elseif (stripos($userAgent, 'Opera') !== false) { $this->browser = self::OPERA; $patternBrowser = 'Opera'; } // If we detected a known browser let's attempt to determine the version. if ($this->browser) { // Build the REGEX pattern to match the browser version string within the user agent string. $pattern = '#(?<browser>Version|' . $patternBrowser . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#'; // Attempt to find version strings in the user agent string. $matches = array(); if (preg_match_all($pattern, $userAgent, $matches)) { // Do we have both a Version and browser match? if (count($matches['browser']) == 2) { // See whether Version or browser came first, and use the number accordingly. if (strripos($userAgent, 'Version') < strripos($userAgent, $patternBrowser)) { $this->browserVersion = $matches['version'][0]; } else { $this->browserVersion = $matches['version'][1]; } } elseif (count($matches['browser']) > 2) { $key = array_search('Version', $matches['browser']); if ($key) { $this->browserVersion = $matches['version'][$key]; } } // We only have a Version or a browser so use what we have. else { $this->browserVersion = $matches['version'][0]; } } } // Mark this detection routine as run. $this->detection['browser'] = true; } /** * Method to detect the accepted response encoding by the client. * * @param string $acceptEncoding The client accept encoding string to parse. * * @return void * * @since 12.1 */ protected function detectEncoding($acceptEncoding) { // Parse the accepted encodings. $this->encodings = array_map('trim', (array) explode(',', $acceptEncoding)); // Mark this detection routine as run. $this->detection['acceptEncoding'] = true; } /** * Detects the client rendering engine in a user agent string. * * @param string $userAgent The user-agent string to parse. * * @return void * * @since 12.1 */ protected function detectEngine($userAgent) { // Attempt to detect the client engine -- starting with the most popular ... for now. if (stripos($userAgent, 'MSIE') !== false || stripos($userAgent, 'Trident') !== false) { $this->engine = self::TRIDENT; } // Evidently blackberry uses WebKit and doesn't necessarily report it. Bad RIM. elseif (stripos($userAgent, 'AppleWebKit') !== false || stripos($userAgent, 'blackberry') !== false) { $this->engine = self::WEBKIT; } // We have to check for like Gecko because some other browsers spoof Gecko. elseif (stripos($userAgent, 'Gecko') !== false && stripos($userAgent, 'like Gecko') === false) { $this->engine = self::GECKO; } // Sometimes Opera browsers don't say Presto. elseif (stripos($userAgent, 'Opera') !== false || stripos($userAgent, 'Presto') !== false) { $this->engine = self::PRESTO; } // *sigh* elseif (stripos($userAgent, 'KHTML') !== false) { $this->engine = self::KHTML; } // Lesser known engine but it finishes off the major list from Wikipedia :-) elseif (stripos($userAgent, 'Amaya') !== false) { $this->engine = self::AMAYA; } // Mark this detection routine as run. $this->detection['engine'] = true; } /** * Method to detect the accepted languages by the client. * * @param mixed $acceptLanguage The client accept language string to parse. * * @return void * * @since 12.1 */ protected function detectLanguage($acceptLanguage) { // Parse the accepted encodings. $this->languages = array_map('trim', (array) explode(',', $acceptLanguage)); // Mark this detection routine as run. $this->detection['acceptLanguage'] = true; } /** * Detects the client platform in a user agent string. * * @param string $userAgent The user-agent string to parse. * * @return void * * @since 12.1 */ protected function detectPlatform($userAgent) { // Attempt to detect the client platform. if (stripos($userAgent, 'Windows') !== false) { $this->platform = self::WINDOWS; // Let's look at the specific mobile options in the Windows space. if (stripos($userAgent, 'Windows Phone') !== false) { $this->mobile = true; $this->platform = self::WINDOWS_PHONE; } elseif (stripos($userAgent, 'Windows CE') !== false) { $this->mobile = true; $this->platform = self::WINDOWS_CE; } } // Interestingly 'iPhone' is present in all iOS devices so far including iPad and iPods. elseif (stripos($userAgent, 'iPhone') !== false) { $this->mobile = true; $this->platform = self::IPHONE; // Let's look at the specific mobile options in the iOS space. if (stripos($userAgent, 'iPad') !== false) { $this->platform = self::IPAD; } elseif (stripos($userAgent, 'iPod') !== false) { $this->platform = self::IPOD; } } // In case where iPhone is not mentioed in iPad user agent string elseif (stripos($userAgent, 'iPad') !== false) { $this->mobile = true; $this->platform = self::IPAD; } // In case where iPhone is not mentioed in iPod user agent string elseif (stripos($userAgent, 'iPod') !== false) { $this->mobile = true; $this->platform = self::IPOD; } // This has to come after the iPhone check because mac strings are also present in iOS devices. elseif (preg_match('/macintosh|mac os x/i', $userAgent)) { $this->platform = self::MAC; } elseif (stripos($userAgent, 'Blackberry') !== false) { $this->mobile = true; $this->platform = self::BLACKBERRY; } elseif (stripos($userAgent, 'Android') !== false) { $this->mobile = true; $this->platform = self::ANDROID; /** * Attempt to distinguish between Android phones and tablets * There is no totally foolproof method but certain rules almost always hold * Android 3.x is only used for tablets * Some devices and browsers encourage users to change their UA string to include Tablet. * Google encourages manufacturers to exclude the string Mobile from tablet device UA strings. * In some modes Kindle Android devices include the string Mobile but they include the string Silk. */ if (stripos($userAgent, 'Android 3') !== false || stripos($userAgent, 'Tablet') !== false || stripos($userAgent, 'Mobile') === false || stripos($userAgent, 'Silk') !== false ) { $this->platform = self::ANDROIDTABLET; } } elseif (stripos($userAgent, 'Linux') !== false) { $this->platform = self::LINUX; } // Mark this detection routine as run. $this->detection['platform'] = true; } /** * Determines if the browser is a robot or not. * * @param string $userAgent The user-agent string to parse. * * @return void * * @since 12.3 */ protected function detectRobot($userAgent) { if (preg_match('/http|bot|robot|spider|crawler|curl|^$/i', $userAgent)) { $this->robot = true; } else { $this->robot = false; } $this->detection['robot'] = true; } } PK���\c�e| &libraries/joomla/application/route.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Route handling class * * @since 11.1 */ class JRoute { /** * The route object so we don't have to keep fetching it. * * @var JRouter * @since 12.2 */ private static $_router = null; /** * Translates an internal Joomla URL to a humanly readable URL. * * @param string $url Absolute or Relative URI to Joomla resource. * @param boolean $xhtml Replace & by & for XML compliance. * @param integer $ssl Secure state for the resolved URI. * 0: (default) No change, use the protocol currently used in the request * 1: Make URI secure using global secure site URI. * 2: Make URI unsecure using the global unsecure site URI. * * @return string The translated humanly readable URL. * * @since 11.1 */ public static function _($url, $xhtml = true, $ssl = null) { if (!self::$_router) { // Get the router. $app = JFactory::getApplication(); self::$_router = $app::getRouter(); // Make sure that we have our router if (!self::$_router) { return null; } } if (!is_array($url) && (strpos($url, '&') !== 0) && (strpos($url, 'index.php') !== 0)) { return $url; } // Build route. $uri = self::$_router->build($url); $scheme = array('path', 'query', 'fragment'); /* * Get the secure/unsecure URLs. * * If the first 5 characters of the BASE are 'https', then we are on an ssl connection over * https and need to set our secure URL to the current request URL, if not, and the scheme is * 'http', then we need to do a quick string manipulation to switch schemes. */ if ((int) $ssl || $uri->isSsl()) { static $host_port; if (!is_array($host_port)) { $uri2 = JUri::getInstance(); $host_port = array($uri2->getHost(), $uri2->getPort()); } // Determine which scheme we want. $uri->setScheme(((int) $ssl === 1 || $uri->isSsl()) ? 'https' : 'http'); $uri->setHost($host_port[0]); $uri->setPort($host_port[1]); $scheme = array_merge($scheme, array('host', 'port', 'scheme')); } $url = $uri->toString($scheme); // Replace spaces. $url = preg_replace('/\s/u', '%20', $url); if ($xhtml) { $url = htmlspecialchars($url); } return $url; } } PK���\���%libraries/joomla/application/base.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Application\AbstractApplication; use Joomla\Registry\Registry; /** * Joomla Platform Base Application Class * * @property-read JInput $input The application input object * * @since 12.1 */ abstract class JApplicationBase extends AbstractApplication { /** * The application dispatcher object. * * @var JEventDispatcher * @since 12.1 */ protected $dispatcher; /** * The application identity object. * * @var JUser * @since 12.1 */ protected $identity; /** * Class constructor. * * @param JInput $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInput object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * * @since 12.1 */ public function __construct(JInput $input = null, Registry $config = null) { $this->input = $input instanceof JInput ? $input : new JInput; $this->config = $config instanceof Registry ? $config : new Registry; $this->initialise(); } /** * Get the application identity. * * @return mixed A JUser object or null. * * @since 12.1 */ public function getIdentity() { return $this->identity; } /** * Registers a handler to a particular event group. * * @param string $event The event name. * @param callable $handler The handler, a function or an instance of a event object. * * @return JApplicationBase The application to allow chaining. * * @since 12.1 */ public function registerEvent($event, $handler) { if ($this->dispatcher instanceof JEventDispatcher) { $this->dispatcher->register($event, $handler); } return $this; } /** * Calls all handlers associated with an event group. * * @param string $event The event name. * @param array $args An array of arguments (optional). * * @return array An array of results from each function call, or null if no dispatcher is defined. * * @since 12.1 */ public function triggerEvent($event, array $args = null) { if ($this->dispatcher instanceof JEventDispatcher) { return $this->dispatcher->trigger($event, $args); } return null; } /** * Allows the application to load a custom or default dispatcher. * * The logic and options for creating this object are adequately generic for default cases * but for many applications it will make sense to override this method and create event * dispatchers, if required, based on more specific needs. * * @param JEventDispatcher $dispatcher An optional dispatcher object. If omitted, the factory dispatcher is created. * * @return JApplicationBase This method is chainable. * * @since 12.1 */ public function loadDispatcher(JEventDispatcher $dispatcher = null) { $this->dispatcher = ($dispatcher === null) ? JEventDispatcher::getInstance() : $dispatcher; return $this; } /** * Allows the application to load a custom or default identity. * * The logic and options for creating this object are adequately generic for default cases * but for many applications it will make sense to override this method and create an identity, * if required, based on more specific needs. * * @param JUser $identity An optional identity object. If omitted, the factory user is created. * * @return JApplicationBase This method is chainable. * * @since 12.1 */ public function loadIdentity(JUser $identity = null) { $this->identity = ($identity === null) ? JFactory::getUser() : $identity; return $this; } /** * Method to run the application routines. Most likely you will want to instantiate a controller * and execute it, or perform some sort of task directly. * * @return void * * @since 3.4 (CMS) */ protected function doExecute() { return; } } PK���\q2܂ � �$libraries/joomla/application/web.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Application * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Base class for a Joomla! Web application. * * @since 11.4 */ class JApplicationWeb extends JApplicationBase { /** * @var string Character encoding string. * @since 11.3 */ public $charSet = 'utf-8'; /** * @var string Response mime type. * @since 11.3 */ public $mimeType = 'text/html'; /** * @var JDate The body modified date for response headers. * @since 11.3 */ public $modifiedDate; /** * @var JApplicationWebClient The application client object. * @since 11.3 */ public $client; /** * @var JDocument The application document object. * @since 11.3 */ protected $document; /** * @var JLanguage The application language object. * @since 11.3 */ protected $language; /** * @var JSession The application session object. * @since 11.3 */ protected $session; /** * @var object The application response object. * @since 11.3 */ protected $response; /** * @var JApplicationWeb The application instance. * @since 11.3 */ protected static $instance; /** * A map of integer HTTP 1.1 response codes to the full HTTP Status for the headers. * * @var object * @since 3.4 * @see http://tools.ietf.org/pdf/rfc7231.pdf */ private $responseMap = array( 300 => 'HTTP/1.1 300 Multiple Choices', 301 => 'HTTP/1.1 301 Moved Permanently', 302 => 'HTTP/1.1 302 Found', 303 => 'HTTP/1.1 303 See other', 304 => 'Not Modified', 305 => 'HTTP/1.1 305 Use Proxy', 306 => 'HTTP/1.1 306 (Unused)', 307 => 'HTTP/1.1 307 Temporary Redirect', 308 => 'Permanent Redirect' ); /** * Class constructor. * * @param JInput $input An optional argument to provide dependency injection for the application's * input object. If the argument is a JInput object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param JApplicationWebClient $client An optional argument to provide dependency injection for the application's * client object. If the argument is a JApplicationWebClient object that object will become * the application's client object, otherwise a default client object is created. * * @since 11.3 */ public function __construct(JInput $input = null, Registry $config = null, JApplicationWebClient $client = null) { // If a input object is given use it. if ($input instanceof JInput) { $this->input = $input; } // Create the input based on the application logic. else { $this->input = new JInput; } // If a config object is given use it. if ($config instanceof Registry) { $this->config = $config; } // Instantiate a new configuration object. else { $this->config = new Registry; } // If a client object is given use it. if ($client instanceof JApplicationWebClient) { $this->client = $client; } // Instantiate a new web client object. else { $this->client = new JApplicationWebClient; } // Load the configuration object. $this->loadConfiguration($this->fetchConfigurationData()); // Set the execution datetime and timestamp; $this->set('execution.datetime', gmdate('Y-m-d H:i:s')); $this->set('execution.timestamp', time()); // Setup the response object. $this->response = new stdClass; $this->response->cachable = false; $this->response->headers = array(); $this->response->body = array(); // Set the system URIs. $this->loadSystemUris(); } /** * Returns a reference to the global JApplicationWeb object, only creating it if it doesn't already exist. * * This method must be invoked as: $web = JApplicationWeb::getInstance(); * * @param string $name The name (optional) of the JApplicationWeb class to instantiate. * * @return JApplicationWeb * * @since 11.3 */ public static function getInstance($name = null) { // Only create the object if it doesn't exist. if (empty(self::$instance)) { if (class_exists($name) && (is_subclass_of($name, 'JApplicationWeb'))) { self::$instance = new $name; } else { self::$instance = new JApplicationWeb; } } return self::$instance; } /** * Initialise the application. * * @param mixed $session An optional argument to provide dependency injection for the application's * session object. If the argument is a JSession object that object will become * the application's session object, if it is false then there will be no session * object, and if it is null then the default session object will be created based * on the application's loadSession() method. * @param mixed $document An optional argument to provide dependency injection for the application's * document object. If the argument is a JDocument object that object will become * the application's document object, if it is false then there will be no document * object, and if it is null then the default document object will be created based * on the application's loadDocument() method. * @param mixed $language An optional argument to provide dependency injection for the application's * language object. If the argument is a JLanguage object that object will become * the application's language object, if it is false then there will be no language * object, and if it is null then the default language object will be created based * on the application's loadLanguage() method. * @param mixed $dispatcher An optional argument to provide dependency injection for the application's * event dispatcher. If the argument is a JEventDispatcher object that object will become * the application's event dispatcher, if it is null then the default event dispatcher * will be created based on the application's loadDispatcher() method. * * @return JApplicationWeb Instance of $this to allow chaining. * * @deprecated 13.1 (Platform) & 4.0 (CMS) * @see JApplicationWeb::loadSession() * @see JApplicationWeb::loadDocument() * @see JApplicationWeb::loadLanguage() * @see JApplicationBase::loadDispatcher() * @since 11.3 */ public function initialise($session = null, $document = null, $language = null, $dispatcher = null) { // Create the session based on the application logic. if ($session !== false) { $this->loadSession($session); } // Create the document based on the application logic. if ($document !== false) { $this->loadDocument($document); } // Create the language based on the application logic. if ($language !== false) { $this->loadLanguage($language); } $this->loadDispatcher($dispatcher); return $this; } /** * Execute the application. * * @return void * * @since 11.3 */ public function execute() { // Trigger the onBeforeExecute event. $this->triggerEvent('onBeforeExecute'); // Perform application routines. $this->doExecute(); // Trigger the onAfterExecute event. $this->triggerEvent('onAfterExecute'); // If we have an application document object, render it. if ($this->document instanceof JDocument) { // Trigger the onBeforeRender event. $this->triggerEvent('onBeforeRender'); // Render the application output. $this->render(); // Trigger the onAfterRender event. $this->triggerEvent('onAfterRender'); } // If gzip compression is enabled in configuration and the server is compliant, compress the output. if ($this->get('gzip') && !ini_get('zlib.output_compression') && (ini_get('output_handler') != 'ob_gzhandler')) { $this->compress(); } // Trigger the onBeforeRespond event. $this->triggerEvent('onBeforeRespond'); // Send the application response. $this->respond(); // Trigger the onAfterRespond event. $this->triggerEvent('onAfterRespond'); } /** * Method to run the Web application routines. Most likely you will want to instantiate a controller * and execute it, or perform some sort of action that populates a JDocument object so that output * can be rendered to the client. * * @return void * * @codeCoverageIgnore * @since 11.3 */ protected function doExecute() { // Your application routines go here. } /** * Rendering is the process of pushing the document buffers into the template * placeholders, retrieving data from the document and pushing it into * the application response buffer. * * @return void * * @since 11.3 */ protected function render() { // Setup the document options. $options = array( 'template' => $this->get('theme'), 'file' => $this->get('themeFile', 'index.php'), 'params' => $this->get('themeParams') ); if ($this->get('themes.base')) { $options['directory'] = $this->get('themes.base'); } // Fall back to constants. else { $options['directory'] = defined('JPATH_THEMES') ? JPATH_THEMES : (defined('JPATH_BASE') ? JPATH_BASE : __DIR__) . '/themes'; } // Parse the document. $this->document->parse($options); // Render the document. $data = $this->document->render($this->get('cache_enabled'), $options); // Set the application output data. $this->setBody($data); } /** * Checks the accept encoding of the browser and compresses the data before * sending it to the client if possible. * * @return void * * @since 11.3 */ protected function compress() { // Supported compression encodings. $supported = array( 'x-gzip' => 'gz', 'gzip' => 'gz', 'deflate' => 'deflate' ); // Get the supported encoding. $encodings = array_intersect($this->client->encodings, array_keys($supported)); // If no supported encoding is detected do nothing and return. if (empty($encodings)) { return; } // Verify that headers have not yet been sent, and that our connection is still alive. if ($this->checkHeadersSent() || !$this->checkConnectionAlive()) { return; } // Iterate through the encodings and attempt to compress the data using any found supported encodings. foreach ($encodings as $encoding) { if (($supported[$encoding] == 'gz') || ($supported[$encoding] == 'deflate')) { // Verify that the server supports gzip compression before we attempt to gzip encode the data. // @codeCoverageIgnoreStart if (!extension_loaded('zlib') || ini_get('zlib.output_compression')) { continue; } // @codeCoverageIgnoreEnd // Attempt to gzip encode the data with an optimal level 4. $data = $this->getBody(); $gzdata = gzencode($data, 4, ($supported[$encoding] == 'gz') ? FORCE_GZIP : FORCE_DEFLATE); // If there was a problem encoding the data just try the next encoding scheme. // @codeCoverageIgnoreStart if ($gzdata === false) { continue; } // @codeCoverageIgnoreEnd // Set the encoding headers. $this->setHeader('Content-Encoding', $encoding); // Header will be removed at 4.0 if ($this->get('MetaVersion')) { $this->setHeader('X-Content-Encoded-By', 'Joomla'); } // Replace the output with the encoded data. $this->setBody($gzdata); // Compression complete, let's break out of the loop. break; } } } /** * Method to send the application response to the client. All headers will be sent prior to the main * application output data. * * @return void * * @since 11.3 */ protected function respond() { // Send the content-type header. $this->setHeader('Content-Type', $this->mimeType . '; charset=' . $this->charSet); // If the response is set to uncachable, we need to set some appropriate headers so browsers don't cache the response. if (!$this->response->cachable) { // Expires in the past. $this->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true); // Always modified. $this->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true); $this->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false); // HTTP 1.0 $this->setHeader('Pragma', 'no-cache'); } else { // Expires. $this->setHeader('Expires', gmdate('D, d M Y H:i:s', time() + 900) . ' GMT'); // Last modified. if ($this->modifiedDate instanceof JDate) { $this->setHeader('Last-Modified', $this->modifiedDate->format('D, d M Y H:i:s')); } } $this->sendHeaders(); echo $this->getBody(); } /** * Redirect to another URL. * * If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" * or "303 See Other" code in the header pointing to the new location. If the headers have already been * sent this will be accomplished using a JavaScript statement. * * @param string $url The URL to redirect to. Can only be http/https URL. * @param integer $status The HTTP 1.1 status code to be provided. 303 is assumed by default. * * @return void * * @since 11.3 */ public function redirect($url, $status = 303) { // Import library dependencies. jimport('phputf8.utils.ascii'); // Check for relative internal links. if (preg_match('#^index\.php#', $url)) { // We changed this from "$this->get('uri.base.full') . $url" due to the inability to run the system tests with the original code $url = JUri::base() . $url; } // Perform a basic sanity check to make sure we don't have any CRLF garbage. $url = preg_split("/[\r\n]/", $url); $url = $url[0]; /* * Here we need to check and see if the URL is relative or absolute. Essentially, do we need to * prepend the URL with our base URL for a proper redirect. The rudimentary way we are looking * at this is to simply check whether or not the URL string has a valid scheme or not. */ if (!preg_match('#^[a-z]+\://#i', $url)) { // Get a JUri instance for the requested URI. $uri = JUri::getInstance($this->get('uri.request')); // Get a base URL to prepend from the requested URI. $prefix = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); // We just need the prefix since we have a path relative to the root. if ($url[0] == '/') { $url = $prefix . $url; } // It's relative to where we are now, so lets add that. else { $parts = explode('/', $uri->toString(array('path'))); array_pop($parts); $path = implode('/', $parts) . '/'; $url = $prefix . $path . $url; } } // If the headers have already been sent we need to send the redirect statement via JavaScript. if ($this->checkHeadersSent()) { echo "<script>document.location.href='" . str_replace("'", "'", $url) . "';</script>\n"; } else { // We have to use a JavaScript redirect here because MSIE doesn't play nice with utf-8 URLs. if (($this->client->engine == JApplicationWebClient::TRIDENT) && !utf8_is_ascii($url)) { $html = '<html><head>'; $html .= '<meta http-equiv="content-type" content="text/html; charset=' . $this->charSet . '" />'; $html .= '<script>document.location.href=\'' . str_replace("'", "'", $url) . '\';</script>'; $html .= '</head><body></body></html>'; echo $html; } else { // Check if we have a boolean for the status variable for compatability with old $move parameter // @deprecated 4.0 if (is_bool($status)) { $status = $status ? 301 : 303; } // Now check if we have an integer status code that maps to a valid redirect. If we don't then set a 303 // @deprecated 4.0 From 4.0 if no valid status code is given a InvalidArgumentException will be thrown if (!is_int($status) || is_int($status) && !isset($this->responseMap[$status])) { $status = 303; } // All other cases use the more efficient HTTP header for redirection. $this->header($this->responseMap[$status]); $this->header('Location: ' . $url); $this->header('Content-Type: text/html; charset=' . $this->charSet); } } // Close the application after the redirect. $this->close(); } /** * Load an object or array into the application configuration object. * * @param mixed $data Either an array or object to be loaded into the configuration object. * * @return JApplicationWeb Instance of $this to allow chaining. * * @since 11.3 */ public function loadConfiguration($data) { // Load the data into the configuration object. if (is_array($data)) { $this->config->loadArray($data); } elseif (is_object($data)) { $this->config->loadObject($data); } return $this; } /** * Set/get cachable state for the response. If $allow is set, sets the cachable state of the * response. Always returns the current state. * * @param boolean $allow True to allow browser caching. * * @return boolean * * @since 11.3 */ public function allowCache($allow = null) { if ($allow !== null) { $this->response->cachable = (bool) $allow; } return $this->response->cachable; } /** * Method to set a response header. If the replace flag is set then all headers * with the given name will be replaced by the new one. The headers are stored * in an internal array to be sent when the site is sent to the browser. * * @param string $name The name of the header to set. * @param string $value The value of the header to set. * @param boolean $replace True to replace any headers with the same name. * * @return JApplicationWeb Instance of $this to allow chaining. * * @since 11.3 */ public function setHeader($name, $value, $replace = false) { // Sanitize the input values. $name = (string) $name; $value = (string) $value; // If the replace flag is set, unset all known headers with the given name. if ($replace) { foreach ($this->response->headers as $key => $header) { if ($name == $header['name']) { unset($this->response->headers[$key]); } } // Clean up the array as unsetting nested arrays leaves some junk. $this->response->headers = array_values($this->response->headers); } // Add the header to the internal array. $this->response->headers[] = array('name' => $name, 'value' => $value); return $this; } /** * Method to get the array of response headers to be sent when the response is sent * to the client. * * @return array * * @since 11.3 */ public function getHeaders() { return $this->response->headers; } /** * Method to clear any set response headers. * * @return JApplicationWeb Instance of $this to allow chaining. * * @since 11.3 */ public function clearHeaders() { $this->response->headers = array(); return $this; } /** * Send the response headers. * * @return JApplicationWeb Instance of $this to allow chaining. * * @since 11.3 */ public function sendHeaders() { if (!$this->checkHeadersSent()) { foreach ($this->response->headers as $header) { if ('status' == strtolower($header['name'])) { // 'status' headers indicate an HTTP status, and need to be handled slightly differently $this->header('HTTP/1.1 ' . $header['value'], null, (int) $header['value']); } else { $this->header($header['name'] . ': ' . $header['value']); } } } return $this; } /** * Set body content. If body content already defined, this will replace it. * * @param string $content The content to set as the response body. * * @return JApplicationWeb Instance of $this to allow chaining. * * @since 11.3 */ public function setBody($content) { $this->response->body = array((string) $content); return $this; } /** * Prepend content to the body content * * @param string $content The content to prepend to the response body. * * @return JApplicationWeb Instance of $this to allow chaining. * * @since 11.3 */ public function prependBody($content) { array_unshift($this->response->body, (string) $content); return $this; } /** * Append content to the body content * * @param string $content The content to append to the response body. * * @return JApplicationWeb Instance of $this to allow chaining. * * @since 11.3 */ public function appendBody($content) { array_push($this->response->body, (string) $content); return $this; } /** * Return the body content * * @param boolean $asArray True to return the body as an array of strings. * * @return mixed The response body either as an array or concatenated string. * * @since 11.3 */ public function getBody($asArray = false) { return $asArray ? $this->response->body : implode((array) $this->response->body); } /** * Method to get the application document object. * * @return JDocument The document object * * @since 11.3 */ public function getDocument() { return $this->document; } /** * Method to get the application language object. * * @return JLanguage The language object * * @since 11.3 */ public function getLanguage() { return $this->language; } /** * Method to get the application session object. * * @return JSession The session object * * @since 11.3 */ public function getSession() { return $this->session; } /** * Method to check the current client connnection status to ensure that it is alive. We are * wrapping this to isolate the connection_status() function from our code base for testing reasons. * * @return boolean True if the connection is valid and normal. * * @codeCoverageIgnore * @see connection_status() * @since 11.3 */ protected function checkConnectionAlive() { return (connection_status() === CONNECTION_NORMAL); } /** * Method to check to see if headers have already been sent. We are wrapping this to isolate the * headers_sent() function from our code base for testing reasons. * * @return boolean True if the headers have already been sent. * * @codeCoverageIgnore * @see headers_sent() * @since 11.3 */ protected function checkHeadersSent() { return headers_sent(); } /** * Method to detect the requested URI from server environment variables. * * @return string The requested URI * * @since 11.3 */ protected function detectRequestUri() { // First we need to detect the URI scheme. if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) { $scheme = 'https://'; } else { $scheme = 'http://'; } /* * There are some differences in the way that Apache and IIS populate server environment variables. To * properly detect the requested URI we need to adjust our algorithm based on whether or not we are getting * information from Apache or IIS. */ // If PHP_SELF and REQUEST_URI are both populated then we will assume "Apache Mode". if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) { // The URI is built from the HTTP_HOST and REQUEST_URI environment variables in an Apache environment. $uri = $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; } // If not in "Apache Mode" we will assume that we are in an IIS environment and proceed. else { // IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS $uri = $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; // If the QUERY_STRING variable exists append it to the URI string. if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { $uri .= '?' . $_SERVER['QUERY_STRING']; } } return trim($uri); } /** * Method to load a PHP configuration class file based on convention and return the instantiated data object. You * will extend this method in child classes to provide configuration data from whatever data source is relevant * for your specific application. * * @param string $file The path and filename of the configuration file. If not provided, configuration.php * in JPATH_BASE will be used. * @param string $class The class name to instantiate. * * @return mixed Either an array or object to be loaded into the configuration object. * * @since 11.3 * @throws RuntimeException */ protected function fetchConfigurationData($file = '', $class = 'JConfig') { // Instantiate variables. $config = array(); if (empty($file) && defined('JPATH_ROOT')) { $file = JPATH_ROOT . '/configuration.php'; // Applications can choose not to have any configuration data // by not implementing this method and not having a config file. if (!file_exists($file)) { $file = ''; } } if (!empty($file)) { JLoader::register($class, $file); if (class_exists($class)) { $config = new $class; } else { throw new RuntimeException('Configuration class does not exist.'); } } return $config; } /** * Flush the media version to refresh versionable assets * * @return void * * @since 3.2 */ public function flushAssets() { $version = new JVersion; $version->refreshMediaVersion(); } /** * Method to send a header to the client. We are wrapping this to isolate the header() function * from our code base for testing reasons. * * @param string $string The header string. * @param boolean $replace The optional replace parameter indicates whether the header should * replace a previous similar header, or add a second header of the same type. * @param integer $code Forces the HTTP response code to the specified value. Note that * this parameter only has an effect if the string is not empty. * * @return void * * @codeCoverageIgnore * @see header() * @since 11.3 */ protected function header($string, $replace = true, $code = null) { header($string, $replace, $code); } /** * Determine if we are using a secure (SSL) connection. * * @return boolean True if using SSL, false if not. * * @since 12.2 */ public function isSSLConnection() { return ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) || getenv('SSL_PROTOCOL_VERSION')); } /** * Allows the application to load a custom or default document. * * The logic and options for creating this object are adequately generic for default cases * but for many applications it will make sense to override this method and create a document, * if required, based on more specific needs. * * @param JDocument $document An optional document object. If omitted, the factory document is created. * * @return JApplicationWeb This method is chainable. * * @since 11.3 */ public function loadDocument(JDocument $document = null) { $this->document = ($document === null) ? JFactory::getDocument() : $document; return $this; } /** * Allows the application to load a custom or default language. * * The logic and options for creating this object are adequately generic for default cases * but for many applications it will make sense to override this method and create a language, * if required, based on more specific needs. * * @param JLanguage $language An optional language object. If omitted, the factory language is created. * * @return JApplicationWeb This method is chainable. * * @since 11.3 */ public function loadLanguage(JLanguage $language = null) { $this->language = ($language === null) ? JFactory::getLanguage() : $language; return $this; } /** * Allows the application to load a custom or default session. * * The logic and options for creating this object are adequately generic for default cases * but for many applications it will make sense to override this method and create a session, * if required, based on more specific needs. * * @param JSession $session An optional session object. If omitted, the session is created. * * @return JApplicationWeb This method is chainable. * * @since 11.3 */ public function loadSession(JSession $session = null) { if ($session !== null) { $this->session = $session; return $this; } // Generate a session name. $name = md5($this->get('secret') . $this->get('session_name', get_class($this))); // Calculate the session lifetime. $lifetime = (($this->get('sess_lifetime')) ? $this->get('sess_lifetime') * 60 : 900); // Get the session handler from the configuration. $handler = $this->get('sess_handler', 'none'); // Initialize the options for JSession. $options = array( 'name' => $name, 'expire' => $lifetime, 'force_ssl' => $this->get('force_ssl') ); $this->registerEvent('onAfterSessionStart', array($this, 'afterSessionStart')); // Instantiate the session object. $session = JSession::getInstance($handler, $options); $session->initialise($this->input, $this->dispatcher); if ($session->getState() == 'expired') { $session->restart(); } else { $session->start(); } // Set the session object. $this->session = $session; return $this; } /** * After the session has been started we need to populate it with some default values. * * @return void * * @since 12.2 */ public function afterSessionStart() { $session = JFactory::getSession(); if ($session->isNew()) { $session->set('registry', new Registry('session')); $session->set('user', new JUser); } } /** * Method to load the system URI strings for the application. * * @param string $requestUri An optional request URI to use instead of detecting one from the * server environment variables. * * @return void * * @since 11.3 */ protected function loadSystemUris($requestUri = null) { // Set the request URI. // @codeCoverageIgnoreStart if (!empty($requestUri)) { $this->set('uri.request', $requestUri); } else { $this->set('uri.request', $this->detectRequestUri()); } // @codeCoverageIgnoreEnd // Check to see if an explicit base URI has been set. $siteUri = trim($this->get('site_uri')); if ($siteUri != '') { $uri = JUri::getInstance($siteUri); $path = $uri->toString(array('path')); } // No explicit base URI was set so we need to detect it. else { // Start with the requested URI. $uri = JUri::getInstance($this->get('uri.request')); // If we are working from a CGI SAPI with the 'cgi.fix_pathinfo' directive disabled we use PHP_SELF. if (strpos(php_sapi_name(), 'cgi') !== false && !ini_get('cgi.fix_pathinfo') && !empty($_SERVER['REQUEST_URI'])) { // We aren't expecting PATH_INFO within PHP_SELF so this should work. $path = dirname($_SERVER['PHP_SELF']); } // Pretty much everything else should be handled with SCRIPT_NAME. else { $path = dirname($_SERVER['SCRIPT_NAME']); } } $host = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); // Check if the path includes "index.php". if (strpos($path, 'index.php') !== false) { // Remove the index.php portion of the path. $path = substr_replace($path, '', strpos($path, 'index.php'), 9); } $path = rtrim($path, '/\\'); // Set the base URI both as just a path and as the full URI. $this->set('uri.base.full', $host . $path . '/'); $this->set('uri.base.host', $host); $this->set('uri.base.path', $path . '/'); // Set the extended (non-base) part of the request URI as the route. if (stripos($this->get('uri.request'), $this->get('uri.base.full')) === 0) { $this->set('uri.route', substr_replace($this->get('uri.request'), '', 0, strlen($this->get('uri.base.full')))); } // Get an explicitly set media URI is present. $mediaURI = trim($this->get('media_uri')); if ($mediaURI) { if (strpos($mediaURI, '://') !== false) { $this->set('uri.media.full', $mediaURI); $this->set('uri.media.path', $mediaURI); } else { // Normalise slashes. $mediaURI = trim($mediaURI, '/\\'); $mediaURI = !empty($mediaURI) ? '/' . $mediaURI . '/' : '/'; $this->set('uri.media.full', $this->get('uri.base.host') . $mediaURI); $this->set('uri.media.path', $mediaURI); } } // No explicit media URI was set, build it dynamically from the base uri. else { $this->set('uri.media.full', $this->get('uri.base.full') . 'media/'); $this->set('uri.media.path', $this->get('uri.base.path') . 'media/'); } } } PK���\*HL��'�'#libraries/joomla/updater/update.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Updater * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Update class. It is used by JUpdater::update() to install an update. Use JUpdater::findUpdates() to find updates for * an extension. * * @since 11.1 */ class JUpdate extends JObject { /** * Update manifest <name> element * * @var string * @since 11.1 */ protected $name; /** * Update manifest <description> element * * @var string * @since 11.1 */ protected $description; /** * Update manifest <element> element * * @var string * @since 11.1 */ protected $element; /** * Update manifest <type> element * * @var string * @since 11.1 */ protected $type; /** * Update manifest <version> element * * @var string * @since 11.1 */ protected $version; /** * Update manifest <infourl> element * * @var string * @since 11.1 */ protected $infourl; /** * Update manifest <client> element * * @var string * @since 11.1 */ protected $client; /** * Update manifest <group> element * * @var string * @since 11.1 */ protected $group; /** * Update manifest <downloads> element * * @var string * @since 11.1 */ protected $downloads; /** * Update manifest <tags> element * * @var string * @since 11.1 */ protected $tags; /** * Update manifest <maintainer> element * * @var string * @since 11.1 */ protected $maintainer; /** * Update manifest <maintainerurl> element * * @var string * @since 11.1 */ protected $maintainerurl; /** * Update manifest <category> element * * @var string * @since 11.1 */ protected $category; /** * Update manifest <relationships> element * * @var string * @since 11.1 */ protected $relationships; /** * Update manifest <targetplatform> element * * @var string * @since 11.1 */ protected $targetplatform; /** * Extra query for download URLs * * @var string * @since 13.1 */ protected $extra_query; /** * Resource handle for the XML Parser * * @var resource * @since 12.1 */ protected $xmlParser; /** * Element call stack * * @var array * @since 12.1 */ protected $stack = array('base'); /** * Unused state array * * @var array * @since 12.1 */ protected $stateStore = array(); /** * Object containing the current update data * * @var stdClass * @since 12.1 */ protected $currentUpdate; /** * Object containing the latest update data * * @var stdClass * @since 12.1 */ protected $latest; /** * The minimum stability required for updates to be taken into account. The possible values are: * 0 dev Development snapshots, nightly builds, pre-release versions and so on * 1 alpha Alpha versions (work in progress, things are likely to be broken) * 2 beta Beta versions (major functionality in place, show-stopper bugs are likely to be present) * 3 rc Release Candidate versions (almost stable, minor bugs might be present) * 4 stable Stable versions (production quality code) * * @var int * @since 14.1 * * @see JUpdater */ protected $minimum_stability = JUpdater::STABILITY_STABLE; /** * Gets the reference to the current direct parent * * @return object * * @since 11.1 */ protected function _getStackLocation() { return implode('->', $this->stack); } /** * Get the last position in stack count * * @return string * * @since 11.1 */ protected function _getLastTag() { return $this->stack[count($this->stack) - 1]; } /** * XML Start Element callback * * @param object $parser Parser object * @param string $name Name of the tag found * @param array $attrs Attributes of the tag * * @return void * * @note This is public because it is called externally * @since 11.1 */ public function _startElement($parser, $name, $attrs = array()) { array_push($this->stack, $name); $tag = $this->_getStackLocation(); // Reset the data if (isset($this->$tag)) { $this->$tag->_data = ""; } switch ($name) { // This is a new update; create a current update case 'UPDATE': $this->currentUpdate = new stdClass; break; // Don't do anything case 'UPDATES': break; // For everything else there's...the default! default: $name = strtolower($name); if (!isset($this->currentUpdate->$name)) { $this->currentUpdate->$name = new stdClass; } $this->currentUpdate->$name->_data = ''; foreach ($attrs as $key => $data) { $key = strtolower($key); $this->currentUpdate->$name->$key = $data; } break; } } /** * Callback for closing the element * * @param object $parser Parser object * @param string $name Name of element that was closed * * @return void * * @note This is public because it is called externally * @since 11.1 */ public function _endElement($parser, $name) { array_pop($this->stack); switch ($name) { // Closing update, find the latest version and check case 'UPDATE': $ver = new JVersion; $product = strtolower(JFilterInput::getInstance()->clean($ver->PRODUCT, 'cmd')); // Check for optional min_dev_level and max_dev_level attributes to further specify targetplatform (e.g., 3.0.1) if (isset($this->currentUpdate->targetplatform->name) && $product == $this->currentUpdate->targetplatform->name && preg_match('/' . $this->currentUpdate->targetplatform->version . '/', $ver->RELEASE) && ((!isset($this->currentUpdate->targetplatform->min_dev_level)) || $ver->DEV_LEVEL >= $this->currentUpdate->targetplatform->min_dev_level) && ((!isset($this->currentUpdate->targetplatform->max_dev_level)) || $ver->DEV_LEVEL <= $this->currentUpdate->targetplatform->max_dev_level)) { // Check if PHP version supported via <php_minimum> tag, assume true if tag isn't present if (!isset($this->currentUpdate->php_minimum) || version_compare(PHP_VERSION, $this->currentUpdate->php_minimum->_data, '>=')) { $phpMatch = true; } else { $phpMatch = false; } // Check minimum stability $stabilityMatch = true; if (isset($this->currentUpdate->stability) && ($this->currentUpdate->stability < $this->minimum_stability)) { $stabilityMatch = false; } if ($phpMatch && $stabilityMatch) { if (isset($this->latest)) { if (version_compare($this->currentUpdate->version->_data, $this->latest->version->_data, '>') == 1) { $this->latest = $this->currentUpdate; } } else { $this->latest = $this->currentUpdate; } } } break; case 'UPDATES': // If the latest item is set then we transfer it to where we want to if (isset($this->latest)) { foreach (get_object_vars($this->latest) as $key => $val) { $this->$key = $val; } unset($this->latest); unset($this->currentUpdate); } elseif (isset($this->currentUpdate)) { // The update might be for an older version of j! unset($this->currentUpdate); } break; } } /** * Character Parser Function * * @param object $parser Parser object. * @param object $data The data. * * @return void * * @note This is public because its called externally. * @since 11.1 */ public function _characterData($parser, $data) { $tag = $this->_getLastTag(); // @todo remove code: if(!isset($this->$tag->_data)) $this->$tag->_data = ''; // @todo remove code: $this->$tag->_data .= $data; // Throw the data for this item together $tag = strtolower($tag); if ($tag == 'tag') { $this->currentUpdate->stability = $this->stabilityTagToInteger((string) $data); return; } if (isset($this->currentUpdate->$tag)) { $this->currentUpdate->$tag->_data .= $data; } } /** * Loads an XML file from a URL. * * @param string $url The URL. * @param int $minimum_stability The minimum stability required for updating the extension {@see JUpdater} * * @return boolean True on success * * @since 11.1 */ public function loadFromXml($url, $minimum_stability = JUpdater::STABILITY_STABLE) { $http = JHttpFactory::getHttp(); try { $response = $http->get($url); } catch (RuntimeException $e) { $response = null; } if ($response === null || $response->code !== 200) { // TODO: Add a 'mark bad' setting here somehow JLog::add(JText::sprintf('JLIB_UPDATER_ERROR_EXTENSION_OPEN_URL', $url), JLog::WARNING, 'jerror'); return false; } $this->minimum_stability = $minimum_stability; $this->xmlParser = xml_parser_create(''); xml_set_object($this->xmlParser, $this); xml_set_element_handler($this->xmlParser, '_startElement', '_endElement'); xml_set_character_data_handler($this->xmlParser, '_characterData'); if (!xml_parse($this->xmlParser, $response->body)) { JLog::add( sprintf( "XML error: %s at line %d", xml_error_string(xml_get_error_code($this->xmlParser)), xml_get_current_line_number($this->xmlParser) ), JLog::WARNING, 'updater' ); return false; } xml_parser_free($this->xmlParser); return true; } /** * Converts a tag to numeric stability representation. If the tag doesn't represent a known stability level (one of * dev, alpha, beta, rc, stable) it is ignored. * * @param string $tag The tag string, e.g. dev, alpha, beta, rc, stable * * @return integer * * @since 3.4 */ protected function stabilityTagToInteger($tag) { $constant = 'JUpdater::STABILITY_' . strtoupper($tag); if (defined($constant)) { return constant($constant); } return JUpdater::STABILITY_STABLE; } } PK���\�C���*libraries/joomla/updater/updateadapter.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Updater * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.base.adapterinstance'); /** * UpdateAdapter class. * * @since 11.1 */ abstract class JUpdateAdapter extends JAdapterInstance { /** * Resource handle for the XML Parser * * @var resource * @since 12.1 */ protected $xmlParser; /** * Element call stack * * @var array * @since 12.1 */ protected $stack = array('base'); /** * ID of update site * * @var string * @since 12.1 */ protected $updateSiteId = 0; /** * Columns in the extensions table to be updated * * @var array * @since 12.1 */ protected $updatecols = array('NAME', 'ELEMENT', 'TYPE', 'FOLDER', 'CLIENT', 'VERSION', 'DESCRIPTION', 'INFOURL'); /** * Should we try appending a .xml extension to the update site's URL? * * @var bool */ protected $appendExtension = false; /** * The name of the update site (used in logging) * * @var string */ protected $updateSiteName = ''; /** * The update site URL from which we will get the update information * * @var string */ protected $_url = ''; /** * The minimum stability required for updates to be taken into account. The possible values are: * 0 dev Development snapshots, nightly builds, pre-release versions and so on * 1 alpha Alpha versions (work in progress, things are likely to be broken) * 2 beta Beta versions (major functionality in place, show-stopper bugs are likely to be present) * 3 rc Release Candidate versions (almost stable, minor bugs might be present) * 4 stable Stable versions (production quality code) * * @var int * @since 14.1 * * @see JUpdater */ protected $minimum_stability = JUpdater::STABILITY_STABLE; /** * Gets the reference to the current direct parent * * @return object * * @since 11.1 */ protected function _getStackLocation() { return implode('->', $this->stack); } /** * Gets the reference to the last tag * * @return object * * @since 11.1 */ protected function _getLastTag() { return $this->stack[count($this->stack) - 1]; } /** * Finds an update * * @param array $options Options to use: update_site_id: the unique ID of the update site to look at * * @return array Update_sites and updates discovered * * @since 11.1 */ abstract public function findUpdate($options); /** * Toggles the enabled status of an update site. Update sites are disabled before getting the update information * from their URL and enabled afterwards. If the URL fetch fails with a PHP fatal error (e.g. timeout) the faulty * update site will remain disabled the next time we attempt to load the update information. * * @param int $update_site_id The numeric ID of the update site to enable/disable * @param bool $enabled Enable the site when true, disable it when false * * @return void */ protected function toggleUpdateSite($update_site_id, $enabled = true) { $update_site_id = (int) $update_site_id; $enabled = (bool) $enabled; if (empty($update_site_id)) { return; } $db = $this->parent->getDbo(); $query = $db->getQuery(true) ->update($db->qn('#__update_sites')) ->set($db->qn('enabled') . ' = ' . $db->q($enabled ? 1 : 0)) ->where($db->qn('update_site_id') . ' = ' . $db->q($update_site_id)); $db->setQuery($query); try { $db->execute(); } catch (Exception $e) { // Do nothing } } /** * Get the name of an update site. This is used in logging. * * @param int $updateSiteId The numeric ID of the update site * * @return string The name of the update site or an empty string if it's not found */ protected function getUpdateSiteName($updateSiteId) { $updateSiteId = (int) $updateSiteId; if (empty($updateSiteId)) { return ''; } $db = $this->parent->getDbo(); $query = $db->getQuery(true) ->select($db->qn('name')) ->from($db->qn('#__update_sites')) ->where($db->qn('update_site_id') . ' = ' . $db->q($updateSiteId)); $db->setQuery($query); $name = ''; try { $name = $db->loadResult(); } catch (Exception $e) { } return $name; } /** * Try to get the raw HTTP response from the update site, hopefully containing the update XML. * * @param array $options The update options, see findUpdate() in children classes * * @return bool|JHttpResponse False if we can't connect to the site, JHttpResponse otherwise * * @throws Exception */ protected function getUpdateSiteResponse($options = array()) { $url = trim($options['location']); $this->_url = &$url; $this->updateSiteId = $options['update_site_id']; if (!isset($options['update_site_name'])) { $options['update_site_name'] = $this->getUpdateSiteName($this->updateSiteId); } $this->updateSiteName = $options['update_site_name']; $this->appendExtension = false; if (array_key_exists('append_extension', $options)) { $this->appendExtension = $options['append_extension']; } if ($this->appendExtension && (substr($url, -4) != '.xml')) { if (substr($url, -1) != '/') { $url .= '/'; } $url .= 'extension.xml'; } // Disable the update site. If the get() below fails with a fatal error (e.g. timeout) the faulty update // site will remain disabled $this->toggleUpdateSite($this->updateSiteId, false); $startTime = microtime(true); // JHttp transport throws an exception when there's no response. try { $http = JHttpFactory::getHttp(); $response = $http->get($url); } catch (RuntimeException $e) { $response = null; } // Enable the update site. Since the get() returned the update site should remain enabled $this->toggleUpdateSite($this->updateSiteId, true); // Log the time it took to load this update site's information $endTime = microtime(true); $timeToLoad = sprintf('%0.2f', $endTime - $startTime); JLog::add( "Loading information from update site #{$this->updateSiteId} with name " . "\"$this->updateSiteName\" and URL $url took $timeToLoad seconds", JLog::INFO, 'updater' ); if ($response === null || $response->code !== 200) { // If the URL is missing the .xml extension, try appending it and retry loading the update if (!$this->appendExtension && (substr($url, -4) != '.xml')) { $options['append_extension'] = true; return $this->getUpdateSiteResponse($options); } // Log the exact update site name and URL which could not be loaded JLog::add("Error opening url: " . $url . ' for update site: ' . $this->updateSiteName, JLog::WARNING, 'updater'); $app = JFactory::getApplication(); $app->enqueueMessage(JText::sprintf('JLIB_UPDATER_ERROR_OPEN_UPDATE_SITE', $this->updateSiteId, $this->updateSiteName, $url), 'warning'); return false; } return $response; } } PK���\%?���$libraries/joomla/updater/updater.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Updater * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.path'); jimport('joomla.base.adapter'); jimport('joomla.utilities.arrayhelper'); /** * Updater Class * * @since 11.1 */ class JUpdater extends JAdapter { /** * Development snapshots, nightly builds, pre-release versions and so on * * @const integer * @since 3.4 */ const STABILITY_DEV = 0; /** * Alpha versions (work in progress, things are likely to be broken) * * @const integer * @since 3.4 */ const STABILITY_ALPHA = 1; /** * Beta versions (major functionality in place, show-stopper bugs are likely to be present) * * @const integer * @since 3.4 */ const STABILITY_BETA = 2; /** * Release Candidate versions (almost stable, minor bugs might be present) * * @const integer * @since 3.4 */ const STABILITY_RC = 3; /** * Stable versions (production quality code) * * @const integer * @since 3.4 */ const STABILITY_STABLE = 4; /** * @var JUpdater JUpdater instance container. * @since 11.3 */ protected static $instance; /** * Constructor * * @since 11.1 */ public function __construct() { // Adapter base path, class prefix parent::__construct(__DIR__, 'JUpdater'); } /** * Returns a reference to the global Installer object, only creating it * if it doesn't already exist. * * @return JUpdater An installer object * * @since 11.1 */ public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new JUpdater; } return self::$instance; } /** * Finds an update for an extension * * @param integer $eid Extension Identifier; if zero use all sites * @param integer $cacheTimeout How many seconds to cache update information; if zero, force reload the update information * @param integer $minimum_stability Minimum stability for the updates; 0=dev, 1=alpha, 2=beta, 3=rc, 4=stable * * @return boolean True if there are updates * * @since 11.1 */ public function findUpdates($eid = 0, $cacheTimeout = 0, $minimum_stability = self::STABILITY_STABLE) { $db = $this->getDbo(); $query = $db->getQuery(true); $retval = false; $query->select('DISTINCT a.update_site_id, a.type, a.location, a.last_check_timestamp, a.extra_query') ->from('#__update_sites AS a') ->where('a.enabled = 1'); if ($eid) { $query->join('INNER', '#__update_sites_extensions AS b ON a.update_site_id = b.update_site_id'); if (is_array($eid)) { $query->where('b.extension_id IN (' . implode(',', $eid) . ')'); } elseif ((int) $eid) { $query->where('b.extension_id = ' . $eid); } } $db->setQuery($query); $results = $db->loadAssocList(); $result_count = count($results); $now = time(); for ($i = 0; $i < $result_count; $i++) { $result = &$results[$i]; $this->setAdapter($result['type']); if (!isset($this->_adapters[$result['type']])) { // Ignore update sites requiring adapters we don't have installed continue; } if ($cacheTimeout > 0) { if (isset($result['last_check_timestamp']) && ($now - $result['last_check_timestamp'] <= $cacheTimeout)) { // Ignore update sites whose information we have fetched within // the cache time limit $retval = true; continue; } } $result['minimum_stability'] = $minimum_stability; /** @var JUpdateAdapter $adapter */ $adapter = $this->_adapters[$result['type']]; $update_result = $adapter->findUpdate($result); if (is_array($update_result)) { if (array_key_exists('update_sites', $update_result) && count($update_result['update_sites'])) { $results = JArrayHelper::arrayUnique(array_merge($results, $update_result['update_sites'])); $result_count = count($results); } if (array_key_exists('updates', $update_result) && count($update_result['updates'])) { for ($k = 0, $count = count($update_result['updates']); $k < $count; $k++) { $current_update = &$update_result['updates'][$k]; $current_update->extra_query = $result['extra_query']; $update = JTable::getInstance('update'); $extension = JTable::getInstance('extension'); $uid = $update ->find( array( 'element' => strtolower($current_update->get('element')), 'type' => strtolower($current_update->get('type')), 'client_id' => strtolower($current_update->get('client_id')), 'folder' => strtolower($current_update->get('folder')) ) ); $eid = $extension ->find( array( 'element' => strtolower($current_update->get('element')), 'type' => strtolower($current_update->get('type')), 'client_id' => strtolower($current_update->get('client_id')), 'folder' => strtolower($current_update->get('folder')) ) ); if (!$uid) { // Set the extension id if ($eid) { // We have an installed extension, check the update is actually newer $extension->load($eid); $data = json_decode($extension->manifest_cache, true); if (version_compare($current_update->version, $data['version'], '>') == 1) { $current_update->extension_id = $eid; $current_update->store(); } } else { // A potentially new extension to be installed $current_update->store(); } } else { $update->load($uid); // If there is an update, check that the version is newer then replaces if (version_compare($current_update->version, $update->version, '>') == 1) { $current_update->store(); } } } } } // Finally, update the last update check timestamp $query = $db->getQuery(true) ->update($db->quoteName('#__update_sites')) ->set($db->quoteName('last_check_timestamp') . ' = ' . $db->quote($now)) ->where($db->quoteName('update_site_id') . ' = ' . $db->quote($result['update_site_id'])); $db->setQuery($query); $db->execute(); } return $retval; } /** * Finds an update for an extension * * @param integer $id Id of the extension * * @return mixed * * @since 11.1 */ public function update($id) { $updaterow = JTable::getInstance('update'); $updaterow->load($id); $update = new JUpdate; if ($update->loadFromXml($updaterow->detailsurl)) { return $update->install(); } return false; } } PK���\L��8UU0libraries/joomla/updater/adapters/collection.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Updater * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.updater.updateadapter'); /** * Collection Update Adapter Class * * @since 11.1 */ class JUpdaterCollection extends JUpdateAdapter { /** * Root of the tree * * @var object * @since 11.1 */ protected $base; /** * Tree of objects * * @var array * @since 11.1 */ protected $parent = array(0); /** * Used to control if an item has a child or not * * @var boolean * @since 11.1 */ protected $pop_parent = 0; /** * @var array A list of discovered update sites */ protected $update_sites; /** * A list of discovered updates * * @var array */ protected $updates; /** * Gets the reference to the current direct parent * * @return object * * @since 11.1 */ protected function _getStackLocation() { return implode('->', $this->stack); } /** * Get the parent tag * * @return string parent * * @since 11.1 */ protected function _getParent() { return end($this->parent); } /** * Opening an XML element * * @param object $parser Parser object * @param string $name Name of element that is opened * @param array $attrs Array of attributes for the element * * @return void * * @since 11.1 */ public function _startElement($parser, $name, $attrs = array()) { array_push($this->stack, $name); $tag = $this->_getStackLocation(); // Reset the data if (isset($this->$tag)) { $this->$tag->_data = ""; } switch ($name) { case 'CATEGORY': if (isset($attrs['REF'])) { $this->update_sites[] = array('type' => 'collection', 'location' => $attrs['REF'], 'update_site_id' => $this->updateSiteId); } else { // This item will have children, so prepare to attach them $this->pop_parent = 1; } break; case 'EXTENSION': $update = JTable::getInstance('update'); $update->set('update_site_id', $this->updateSiteId); foreach ($this->updatecols as $col) { // Reset the values if it doesn't exist if (!array_key_exists($col, $attrs)) { $attrs[$col] = ''; if ($col == 'CLIENT') { $attrs[$col] = 'site'; } } } $client = JApplicationHelper::getClientInfo($attrs['CLIENT'], 1); if (isset($client->id)) { $attrs['CLIENT_ID'] = $client->id; } // Lower case all of the fields foreach ($attrs as $key => $attr) { $values[strtolower($key)] = $attr; } // Only add the update if it is on the same platform and release as we are $ver = new JVersion; // Lower case and remove the exclamation mark $product = strtolower(JFilterInput::getInstance()->clean($ver->PRODUCT, 'cmd')); /* * Set defaults, the extension file should clarify in case but it may be only available in one version * This allows an update site to specify a targetplatform * targetplatformversion can be a regexp, so 1.[56] would be valid for an extension that supports 1.5 and 1.6 * Note: Whilst the version is a regexp here, the targetplatform is not (new extension per platform) * Additionally, the version is a regexp here and it may also be in an extension file if the extension is * compatible against multiple versions of the same platform (e.g. a library) */ if (!isset($values['targetplatform'])) { $values['targetplatform'] = $product; } // Set this to ourself as a default if (!isset($values['targetplatformversion'])) { $values['targetplatformversion'] = $ver->RELEASE; } // Set this to ourselves as a default // validate that we can install the extension if ($product == $values['targetplatform'] && preg_match('/' . $values['targetplatformversion'] . '/', $ver->RELEASE)) { $update->bind($values); $this->updates[] = $update; } break; } } /** * Closing an XML element * Note: This is a protected function though has to be exposed externally as a callback * * @param object $parser Parser object * @param string $name Name of the element closing * * @return void * * @since 11.1 */ protected function _endElement($parser, $name) { array_pop($this->stack); switch ($name) { case 'CATEGORY': if ($this->pop_parent) { $this->pop_parent = 0; array_pop($this->parent); } break; } } // Note: we don't care about char data in collection because there should be none /** * Finds an update * * @param array $options Options to use: update_site_id: the unique ID of the update site to look at * * @return array Update_sites and updates discovered * * @since 11.1 */ public function findUpdate($options) { $response = $this->getUpdateSiteResponse($options); if ($response === false) { return false; } $this->xmlParser = xml_parser_create(''); xml_set_object($this->xmlParser, $this); xml_set_element_handler($this->xmlParser, '_startElement', '_endElement'); if (!xml_parse($this->xmlParser, $response->body)) { // If the URL is missing the .xml extension, try appending it and retry loading the update if (!$this->appendExtension && (substr($this->_url, -4) != '.xml')) { $options['append_extension'] = true; return $this->findUpdate($options); } JLog::add("Error parsing url: " . $this->_url, JLog::WARNING, 'updater'); $app = JFactory::getApplication(); $app->enqueueMessage(JText::sprintf('JLIB_UPDATER_ERROR_COLLECTION_PARSE_URL', $this->_url), 'warning'); return false; } // TODO: Decrement the bad counter if non-zero return array('update_sites' => $this->update_sites, 'updates' => $this->updates); } } PK���\��8GG/libraries/joomla/updater/adapters/extension.phpnu�[���<?php /** * @package Joomla.Platform * @subpackage Updater * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; jimport('joomla.updater.updateadapter'); /** * Extension class for updater * * @since 11.1 */ class JUpdaterExtension extends JUpdateAdapter { /** * Start element parser callback. * * @param object $parser The parser object. * @param string $name The name of the element. * @param array $attrs The attributes of the element. * * @return void * * @since 11.1 */ protected function _startElement($parser, $name, $attrs = array()) { array_push($this->stack, $name); $tag = $this->_getStackLocation(); // Reset the data if (isset($this->$tag)) { $this->$tag->_data = ""; } switch ($name) { case 'UPDATE': $this->currentUpdate = JTable::getInstance('update'); $this->currentUpdate->update_site_id = $this->updateSiteId; $this->currentUpdate->detailsurl = $this->_url; $this->currentUpdate->folder = ""; $this->currentUpdate->client_id = 1; break; // Don't do anything case 'UPDATES': break; default: if (in_array($name, $this->updatecols)) { $name = strtolower($name); $this->currentUpdate->$name = ''; } if ($name == 'TARGETPLATFORM') { $this->currentUpdate->targetplatform = $attrs; } if ($name == 'PHP_MINIMUM') { $this->currentUpdate->php_minimum = ''; } break; } } /** * Character Parser Function * * @param object $parser Parser object. * @param object $name The name of the element. * * @return void * * @since 11.1 */ protected function _endElement($parser, $name) { array_pop($this->stack); // @todo remove code: echo 'Closing: '. $name .'<br />'; switch ($name) { case 'UPDATE': $ver = new JVersion; // Lower case and remove the exclamation mark $product = strtolower(JFilterInput::getInstance()->clean($ver->PRODUCT, 'cmd')); // Check that the product matches and that the version matches (optionally a regexp) // Check for optional min_dev_level and max_dev_level attributes to further specify targetplatform (e.g., 3.0.1) if ($product == $this->currentUpdate->targetplatform['NAME'] && preg_match('/' . $this->currentUpdate->targetplatform['VERSION'] . '/', $ver->RELEASE) && ((!isset($this->currentUpdate->targetplatform->min_dev_level)) || $ver->DEV_LEVEL >= $this->currentUpdate->targetplatform->min_dev_level) && ((!isset($this->currentUpdate->targetplatform->max_dev_level)) || $ver->DEV_LEVEL <= $this->currentUpdate->targetplatform->max_dev_level)) { // Check if PHP version supported via <php_minimum> tag, assume true if tag isn't present if (!isset($this->currentUpdate->php_minimum) || version_compare(PHP_VERSION, $this->currentUpdate->php_minimum, '>=')) { $phpMatch = true; } else { // Notify the user of the potential update $msg = JText::sprintf( 'JLIB_INSTALLER_AVAILABLE_UPDATE_PHP_VERSION', $this->currentUpdate->name, $this->currentUpdate->version, $this->currentUpdate->php_minimum, PHP_VERSION ); JFactory::getApplication()->enqueueMessage($msg, 'warning'); $phpMatch = false; } // Check minimum stability $stabilityMatch = true; if (isset($this->currentUpdate->stability) && ($this->currentUpdate->stability < $this->minimum_stability)) { $stabilityMatch = false; } // Some properties aren't valid fields in the update table so unset them to prevent J! from trying to store them unset($this->currentUpdate->targetplatform); if (isset($this->currentUpdate->php_minimum)) { unset($this->currentUpdate->php_minimum); } if (isset($this->currentUpdate->stability)) { unset($this->currentUpdate->stability); } // If the PHP version and minimum stability checks pass, consider this version as a possible update if ($phpMatch && $stabilityMatch) { if (isset($this->latest)) { // We already have a possible update. Check the version. if (version_compare($this->currentUpdate->version, $this->latest->version, '>') == 1) { $this->latest = $this->currentUpdate; } } else { // We don't have any possible updates yet, assume this is an available update. $this->latest = $this->currentUpdate; } } } break; case 'UPDATES': // :D break; } } /** * Character Parser Function * * @param object $parser Parser object. * @param object $data The data. * * @return void * * @note This is public because its called externally. * @since 11.1 */ protected function _characterData($parser, $data) { $tag = $this->_getLastTag(); if (in_array($tag, $this->updatecols)) { $tag = strtolower($tag); $this->currentUpdate->$tag .= $data; } if ($tag == 'PHP_MINIMUM') { $this->currentUpdate->php_minimum = $data; } if ($tag == 'TAG') { $this->currentUpdate->stability = $this->stabilityTagToInteger((string) $data); } } /** * Finds an update. * * @param array $options Update options. * * @return array Array containing the array of update sites and array of updates * * @since 11.1 */ public function findUpdate($options) { $response = $this->getUpdateSiteResponse($options); if ($response === false) { return false; } if (array_key_exists('minimum_stability', $options)) { $this->minimum_stability = $options['minimum_stability']; } $this->xmlParser = xml_parser_create(''); xml_set_object($this->xmlParser, $this); xml_set_element_handler($this->xmlParser, '_startElement', '_endElement'); xml_set_character_data_handler($this->xmlParser, '_characterData'); if (!xml_parse($this->xmlParser, $response->body)) { // If the URL is missing the .xml extension, try appending it and retry loading the update if (!$this->appendExtension && (substr($this->_url, -4) != '.xml')) { $options['append_extension'] = true; return $this->findUpdate($options); } JLog::add("Error parsing url: " . $this->_url, JLog::WARNING, 'updater'); $app = JFactory::getApplication(); $app->enqueueMessage(JText::sprintf('JLIB_UPDATER_ERROR_EXTENSION_PARSE_URL', $this->_url), 'warning'); return false; } xml_parser_free($this->xmlParser); if (isset($this->latest)) { if (isset($this->latest->client) && strlen($this->latest->client)) { if (is_numeric($this->latest->client)) { $byName = false; // <client> has to be 'administrator' or 'site', numeric values are deprecated. See https://docs.joomla.org/Design_of_JUpdate JLog::add( 'Using numeric values for <client> in the updater xml is deprecated. Use \'administrator\' or \'site\' instead.', JLog::WARNING, 'deprecated' ); } else { $byName = true; } $this->latest->client_id = JApplicationHelper::getClientInfo($this->latest->client, $byName)->id; unset($this->latest->client); } $updates = array($this->latest); } else { $updates = array(); } return array('update_sites' => array(), 'updates' => $updates); } /** * Converts a tag to numeric stability representation. If the tag doesn't represent a known stability level (one of * dev, alpha, beta, rc, stable) it is ignored. * * @param string $tag The tag string, e.g. dev, alpha, beta, rc, stable * * @return integer * * @since 3.4 */ protected function stabilityTagToInteger($tag) { $constant = 'JUpdater::STABILITY_' . strtoupper($tag); if (defined($constant)) { return constant($constant); } return JUpdater::STABILITY_STABLE; } } PK���\��/F��!libraries/phpass/PasswordHash.phpnu�[���<?php # # Portable PHP password hashing framework. # # Version 0.3 / genuine. # # Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in # the public domain. Revised in subsequent years, still public domain. # # There's absolutely no warranty. # # The homepage URL for this framework is: # # http://www.openwall.com/phpass/ # # Please be sure to update the Version line if you edit this file in any way. # It is suggested that you leave the main version number intact, but indicate # your project name (after the slash) and add your own revision information. # # Please do not change the "private" password hashing method implemented in # here, thereby making your hashes incompatible. However, if you must, please # change the hash type identifier (the "$P$") to something different. # # Obviously, since this code is in the public domain, the above are not # requirements (there can be none), but merely suggestions. # class PasswordHash { var $itoa64; var $iteration_count_log2; var $portable_hashes; var $random_state; function PasswordHash($iteration_count_log2, $portable_hashes) { $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) $iteration_count_log2 = 8; $this->iteration_count_log2 = $iteration_count_log2; $this->portable_hashes = $portable_hashes; $this->random_state = microtime(); if (function_exists('getmypid')) $this->random_state .= getmypid(); } function get_random_bytes($count) { $output = ''; if (is_readable('/dev/urandom') && ($fh = @fopen('/dev/urandom', 'rb'))) { $output = fread($fh, $count); fclose($fh); } if (strlen($output) < $count) { $output = ''; for ($i = 0; $i < $count; $i += 16) { $this->random_state = md5(microtime() . $this->random_state); $output .= pack('H*', md5($this->random_state)); } $output = substr($output, 0, $count); } return $output; } function encode64($input, $count) { $output = ''; $i = 0; do { $value = ord($input[$i++]); $output .= $this->itoa64[$value & 0x3f]; if ($i < $count) $value |= ord($input[$i]) << 8; $output .= $this->itoa64[($value >> 6) & 0x3f]; if ($i++ >= $count) break; if ($i < $count) $value |= ord($input[$i]) << 16; $output .= $this->itoa64[($value >> 12) & 0x3f]; if ($i++ >= $count) break; $output .= $this->itoa64[($value >> 18) & 0x3f]; } while ($i < $count); return $output; } function gensalt_private($input) { $output = '$P$'; $output .= $this->itoa64[min($this->iteration_count_log2 + ((PHP_VERSION >= '5') ? 5 : 3), 30)]; $output .= $this->encode64($input, 6); return $output; } function crypt_private($password, $setting) { $output = '*0'; if (substr($setting, 0, 2) == $output) $output = '*1'; $id = substr($setting, 0, 3); # We use "$P$", phpBB3 uses "$H$" for the same thing if ($id != '$P$' && $id != '$H$') return $output; $count_log2 = strpos($this->itoa64, $setting[3]); if ($count_log2 < 7 || $count_log2 > 30) return $output; $count = 1 << $count_log2; $salt = substr($setting, 4, 8); if (strlen($salt) != 8) return $output; # We're kind of forced to use MD5 here since it's the only # cryptographic primitive available in all versions of PHP # currently in use. To implement our own low-level crypto # in PHP would result in much worse performance and # consequently in lower iteration counts and hashes that are # quicker to crack (by non-PHP code). if (PHP_VERSION >= '5') { $hash = md5($salt . $password, TRUE); do { $hash = md5($hash . $password, TRUE); } while (--$count); } else { $hash = pack('H*', md5($salt . $password)); do { $hash = pack('H*', md5($hash . $password)); } while (--$count); } $output = substr($setting, 0, 12); $output .= $this->encode64($hash, 16); return $output; } function gensalt_extended($input) { $count_log2 = min($this->iteration_count_log2 + 8, 24); # This should be odd to not reveal weak DES keys, and the # maximum valid value is (2**24 - 1) which is odd anyway. $count = (1 << $count_log2) - 1; $output = '_'; $output .= $this->itoa64[$count & 0x3f]; $output .= $this->itoa64[($count >> 6) & 0x3f]; $output .= $this->itoa64[($count >> 12) & 0x3f]; $output .= $this->itoa64[($count >> 18) & 0x3f]; $output .= $this->encode64($input, 3); return $output; } function gensalt_blowfish($input) { # This one needs to use a different order of characters and a # different encoding scheme from the one in encode64() above. # We care because the last character in our encoded string will # only represent 2 bits. While two known implementations of # bcrypt will happily accept and correct a salt string which # has the 4 unused bits set to non-zero, we do not want to take # chances and we also do not want to waste an additional byte # of entropy. $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $output = '$2a$'; $output .= chr(ord('0') + $this->iteration_count_log2 / 10); $output .= chr(ord('0') + $this->iteration_count_log2 % 10); $output .= '$'; $i = 0; do { $c1 = ord($input[$i++]); $output .= $itoa64[$c1 >> 2]; $c1 = ($c1 & 0x03) << 4; if ($i >= 16) { $output .= $itoa64[$c1]; break; } $c2 = ord($input[$i++]); $c1 |= $c2 >> 4; $output .= $itoa64[$c1]; $c1 = ($c2 & 0x0f) << 2; $c2 = ord($input[$i++]); $c1 |= $c2 >> 6; $output .= $itoa64[$c1]; $output .= $itoa64[$c2 & 0x3f]; } while (1); return $output; } function HashPassword($password) { $random = ''; if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) { $random = $this->get_random_bytes(16); $hash = crypt($password, $this->gensalt_blowfish($random)); if (strlen($hash) == 60) return $hash; } if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) { if (strlen($random) < 3) $random = $this->get_random_bytes(3); $hash = crypt($password, $this->gensalt_extended($random)); if (strlen($hash) == 20) return $hash; } if (strlen($random) < 6) $random = $this->get_random_bytes(6); $hash = $this->crypt_private($password, $this->gensalt_private($random)); if (strlen($hash) == 34) return $hash; # Returning '*' on error is safe here, but would _not_ be safe # in a crypt(3)-like function used _both_ for generating new # hashes and for validating passwords against existing hashes. return '*'; } function CheckPassword($password, $stored_hash) { $hash = $this->crypt_private($password, $stored_hash); if ($hash[0] == '*') $hash = crypt($password, $stored_hash); return $hash == $stored_hash; } } ?> PK���\�H���"libraries/simplepie/idn/ReadMe.txtnu�[���******************************************************************************* * * * IDNA Convert (idna_convert.class.php) * * * * http://idnaconv.phlymail.de mailto:phlymail@phlylabs.de * ******************************************************************************* * (c) 2004-2007 phlyLabs, Berlin * * This file is encoded in UTF-8 * ******************************************************************************* Introduction ------------ The class idna_convert allows to convert internationalized domain names (see RFC 3490, 3491, 3492 and 3454 for detials) as they can be used with various registries worldwide to be translated between their original (localized) form and their encoded form as it will be used in the DNS (Domain Name System). The class provides two public methods, encode() and decode(), which do exactly what you would expect them to do. You are allowed to use complete domain names, simple strings and complete email addresses as well. That means, that you might use any of the following notations: - www.nörgler.com - xn--nrgler-wxa - xn--brse-5qa.xn--knrz-1ra.info Errors, incorrectly encoded or invalid strings will lead to either a FALSE response (when in strict mode) or to only partially converted strings. You can query the occured error by calling the method get_last_error(). Unicode strings are expected to be either UTF-8 strings, UCS-4 strings or UCS-4 arrays. The default format is UTF-8. For setting different encodings, you can call the method setParams() - please see the inline documentation for details. ACE strings (the Punycode form) are always 7bit ASCII strings. ATTENTION: We no longer supply the PHP5 version of the class. It is not necessary for achieving a successfull conversion, since the supplied PHP code is compatible with both PHP4 and PHP5. We expect to see no compatibility issues with the upcoming PHP6, too. Files ----- idna_convert.class.php - The actual class idna_convert.create.npdata.php - Useful for (re)creating the NPData file npdata.ser - Serialized data for NamePrep example.php - An example web page for converting ReadMe.txt - This file LICENCE - The LGPL licence file The class is contained in idna_convert.class.php. MAKE SURE to copy the npdata.ser file into the same folder as the class file itself! Examples -------- 1. Say we wish to encode the domain name nörgler.com: // Include the class include_once('idna_convert.class.php'); // Instantiate it * $IDN = new idna_convert(); // The input string, if input is not UTF-8 or UCS-4, it must be converted before $input = utf8_encode('nörgler.com'); // Encode it to its punycode presentation $output = $IDN->encode($input); // Output, what we got now echo $output; // This will read: xn--nrgler-wxa.com 2. We received an email from a punycoded domain and are willing to learn, how the domain name reads originally // Include the class include_once('idna_convert.class.php'); // Instantiate it (depending on the version you are using) with $IDN = new idna_convert(); // The input string $input = 'andre@xn--brse-5qa.xn--knrz-1ra.info'; // Encode it to its punycode presentation $output = $IDN->decode($input); // Output, what we got now, if output should be in a format different to UTF-8 // or UCS-4, you will have to convert it before outputting it echo utf8_decode($output); // This will read: andre@börse.knörz.info 3. The input is read from a UCS-4 coded file and encoded line by line. By appending the optional second parameter we tell enode() about the input format to be used // Include the class include_once('idna_convert.class.php'); // Instantiate it $IDN = new dinca_convert(); // Iterate through the input file line by line foreach (file('ucs4-domains.txt') as $line) { echo $IDN->encode(trim($line), 'ucs4_string'); echo "\n"; } NPData ------ Should you need to recreate the npdata.ser file, which holds all necessary translation tables in a serialized format, you can run the file idna_convert.create.npdata.php, which creates the file for you and stores it in the same folder, where it is placed. Should you need to do changes to the tables you can do so, but beware of the consequences. Contact us ---------- In case of errors, bugs, questions, wishes, please don't hesitate to contact us under the email address above. The team of phlyLabs http://phlylabs.de mailto:phlymail@phlylabs.dePK���\nq?&�&�.libraries/simplepie/idn/idna_convert.class.phpnu�[���<?php // {{{ license /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */ // // +----------------------------------------------------------------------+ // | This library is free software; you can redistribute it and/or modify | // | it under the terms of the GNU Lesser General Public License as | // | published by the Free Software Foundation; either version 2.1 of the | // | License, or (at your option) any later version. | // | | // | This library is distributed in the hope that it will be useful, but | // | WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | // | Lesser General Public License for more details. | // | | // | You should have received a copy of the GNU Lesser General Public | // | License along with this library; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | // | USA. | // +----------------------------------------------------------------------+ // // }}} /** * Encode/decode Internationalized Domain Names. * * The class allows to convert internationalized domain names * (see RFC 3490 for details) as they can be used with various registries worldwide * to be translated between their original (localized) form and their encoded form * as it will be used in the DNS (Domain Name System). * * The class provides two public methods, encode() and decode(), which do exactly * what you would expect them to do. You are allowed to use complete domain names, * simple strings and complete email addresses as well. That means, that you might * use any of the following notations: * * - www.nörgler.com * - xn--nrgler-wxa * - xn--brse-5qa.xn--knrz-1ra.info * * Unicode input might be given as either UTF-8 string, UCS-4 string or UCS-4 * array. Unicode output is available in the same formats. * You can select your preferred format via {@link set_paramter()}. * * ACE input and output is always expected to be ASCII. * * @author Matthias Sommerfeld <mso@phlylabs.de> * @copyright 2004-2007 phlyLabs Berlin, http://phlylabs.de * @version 0.5.1 * */ class idna_convert { /** * Holds all relevant mapping tables, loaded from a seperate file on construct * See RFC3454 for details * * @var array * @access private */ var $NP = array(); // Internal settings, do not mess with them var $_punycode_prefix = 'xn--'; var $_invalid_ucs = 0x80000000; var $_max_ucs = 0x10FFFF; var $_base = 36; var $_tmin = 1; var $_tmax = 26; var $_skew = 38; var $_damp = 700; var $_initial_bias = 72; var $_initial_n = 0x80; var $_sbase = 0xAC00; var $_lbase = 0x1100; var $_vbase = 0x1161; var $_tbase = 0x11A7; var $_lcount = 19; var $_vcount = 21; var $_tcount = 28; var $_ncount = 588; // _vcount * _tcount var $_scount = 11172; // _lcount * _tcount * _vcount var $_error = false; // See {@link set_paramter()} for details of how to change the following // settings from within your script / application var $_api_encoding = 'utf8'; // Default input charset is UTF-8 var $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden var $_strict_mode = false; // Behave strict or not // The constructor function idna_convert($options = false) { $this->slast = $this->_sbase + $this->_lcount * $this->_vcount * $this->_tcount; if (function_exists('file_get_contents')) { $this->NP = unserialize(file_get_contents(dirname(__FILE__).'/npdata.ser')); } else { $this->NP = unserialize(join('', file(dirname(__FILE__).'/npdata.ser'))); } // If parameters are given, pass these to the respective method if (is_array($options)) { return $this->set_parameter($options); } return true; } /** * Sets a new option value. Available options and values: * [encoding - Use either UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8, * 'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always UTF-8] * [overlong - Unicode does not allow unnecessarily long encodings of chars, * to allow this, set this parameter to true, else to false; * default is false.] * [strict - true: strict mode, good for registration purposes - Causes errors * on failures; false: loose mode, ideal for "wildlife" applications * by silently ignoring errors and returning the original input instead * * @param mixed Parameter to set (string: single parameter; array of Parameter => Value pairs) * @param string Value to use (if parameter 1 is a string) * @return boolean true on success, false otherwise * @access public */ function set_parameter($option, $value = false) { if (!is_array($option)) { $option = array($option => $value); } foreach ($option as $k => $v) { switch ($k) { case 'encoding': switch ($v) { case 'utf8': case 'ucs4_string': case 'ucs4_array': $this->_api_encoding = $v; break; default: $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); return false; } break; case 'overlong': $this->_allow_overlong = ($v) ? true : false; break; case 'strict': $this->_strict_mode = ($v) ? true : false; break; default: $this->_error('Set Parameter: Unknown option '.$k); return false; } } return true; } /** * Decode a given ACE domain name * @param string Domain name (ACE string) * [@param string Desired output encoding, see {@link set_parameter}] * @return string Decoded Domain name (UTF-8 or UCS-4) * @access public */ function decode($input, $one_time_encoding = false) { // Optionally set if ($one_time_encoding) { switch ($one_time_encoding) { case 'utf8': case 'ucs4_string': case 'ucs4_array': break; default: $this->_error('Unknown encoding '.$one_time_encoding); return false; } } // Make sure to drop any newline characters around $input = trim($input); // Negotiate input and try to determine, whether it is a plain string, // an email address or something like a complete URL if (strpos($input, '@')) { // Maybe it is an email address // No no in strict mode if ($this->_strict_mode) { $this->_error('Only simple domain name parts can be handled in strict mode'); return false; } list ($email_pref, $input) = explode('@', $input, 2); $arr = explode('.', $input); foreach ($arr as $k => $v) { if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { $conv = $this->_decode($v); if ($conv) $arr[$k] = $conv; } } $input = join('.', $arr); $arr = explode('.', $email_pref); foreach ($arr as $k => $v) { if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { $conv = $this->_decode($v); if ($conv) $arr[$k] = $conv; } } $email_pref = join('.', $arr); $return = $email_pref . '@' . $input; } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters) // No no in strict mode if ($this->_strict_mode) { $this->_error('Only simple domain name parts can be handled in strict mode'); return false; } $parsed = parse_url($input); if (isset($parsed['host'])) { $arr = explode('.', $parsed['host']); foreach ($arr as $k => $v) { $conv = $this->_decode($v); if ($conv) $arr[$k] = $conv; } $parsed['host'] = join('.', $arr); $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')) .(empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@') .$parsed['host'] .(empty($parsed['port']) ? '' : ':'.$parsed['port']) .(empty($parsed['path']) ? '' : $parsed['path']) .(empty($parsed['query']) ? '' : '?'.$parsed['query']) .(empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']); } else { // parse_url seems to have failed, try without it $arr = explode('.', $input); foreach ($arr as $k => $v) { $conv = $this->_decode($v); $arr[$k] = ($conv) ? $conv : $v; } $return = join('.', $arr); } } else { // Otherwise we consider it being a pure domain name string $return = $this->_decode($input); if (!$return) $return = $input; } // The output is UTF-8 by default, other output formats need conversion here // If one time encoding is given, use this, else the objects property switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { case 'utf8': return $return; break; case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); break; case 'ucs4_array': return $this->_utf8_to_ucs4($return); break; default: $this->_error('Unsupported output format'); return false; } } /** * Encode a given UTF-8 domain name * @param string Domain name (UTF-8 or UCS-4) * [@param string Desired input encoding, see {@link set_parameter}] * @return string Encoded Domain name (ACE string) * @access public */ function encode($decoded, $one_time_encoding = false) { // Forcing conversion of input to UCS4 array // If one time encoding is given, use this, else the objects property switch ($one_time_encoding ? $one_time_encoding : $this->_api_encoding) { case 'utf8': $decoded = $this->_utf8_to_ucs4($decoded); break; case 'ucs4_string': $decoded = $this->_ucs4_string_to_ucs4($decoded); case 'ucs4_array': break; default: $this->_error('Unsupported input format: '.($one_time_encoding ? $one_time_encoding : $this->_api_encoding)); return false; } // No input, no output, what else did you expect? if (empty($decoded)) return ''; // Anchors for iteration $last_begin = 0; // Output string $output = ''; foreach ($decoded as $k => $v) { // Make sure to use just the plain dot switch($v) { case 0x3002: case 0xFF0E: case 0xFF61: $decoded[$k] = 0x2E; // Right, no break here, the above are converted to dots anyway // Stumbling across an anchoring character case 0x2E: case 0x2F: case 0x3A: case 0x3F: case 0x40: // Neither email addresses nor URLs allowed in strict mode if ($this->_strict_mode) { $this->_error('Neither email addresses nor URLs are allowed in strict mode.'); return false; } else { // Skip first char if ($k) { $encoded = ''; $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin))); if ($encoded) { $output .= $encoded; } else { $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin))); } $output .= chr($decoded[$k]); } $last_begin = $k + 1; } } } // Catch the rest of the string if ($last_begin) { $inp_len = sizeof($decoded); $encoded = ''; $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len)-$last_begin))); if ($encoded) { $output .= $encoded; } else { $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len)-$last_begin))); } return $output; } else { if ($output = $this->_encode($decoded)) { return $output; } else { return $this->_ucs4_to_utf8($decoded); } } } /** * Use this method to get the last error ocurred * @param void * @return string The last error, that occured * @access public */ function get_last_error() { return $this->_error; } /** * The actual decoding algorithm * @access private */ function _decode($encoded) { // We do need to find the Punycode prefix if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) { $this->_error('This is not a punycode string'); return false; } $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded); // If nothing left after removing the prefix, it is hopeless if (!$encode_test) { $this->_error('The given encoded string was empty'); return false; } // Find last occurence of the delimiter $delim_pos = strrpos($encoded, '-'); if ($delim_pos > strlen($this->_punycode_prefix)) { for ($k = strlen($this->_punycode_prefix); $k < $delim_pos; ++$k) { $decoded[] = ord($encoded{$k}); } } else { $decoded = array(); } $deco_len = count($decoded); $enco_len = strlen($encoded); // Wandering through the strings; init $is_first = true; $bias = $this->_initial_bias; $idx = 0; $char = $this->_initial_n; for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) { for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) { $digit = $this->_decode_digit($encoded{$enco_idx++}); $idx += $digit * $w; $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); if ($digit < $t) break; $w = (int) ($w * ($this->_base - $t)); } $bias = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first); $is_first = false; $char += (int) ($idx / ($deco_len + 1)); $idx %= ($deco_len + 1); if ($deco_len > 0) { // Make room for the decoded char for ($i = $deco_len; $i > $idx; $i--) { $decoded[$i] = $decoded[($i - 1)]; } } $decoded[$idx++] = $char; } return $this->_ucs4_to_utf8($decoded); } /** * The actual encoding algorithm * @access private */ function _encode($decoded) { // We cannot encode a domain name containing the Punycode prefix $extract = strlen($this->_punycode_prefix); $check_pref = $this->_utf8_to_ucs4($this->_punycode_prefix); $check_deco = array_slice($decoded, 0, $extract); if ($check_pref == $check_deco) { $this->_error('This is already a punycode string'); return false; } // We will not try to encode strings consisting of basic code points only $encodable = false; foreach ($decoded as $k => $v) { if ($v > 0x7a) { $encodable = true; break; } } if (!$encodable) { $this->_error('The given string does not contain encodable chars'); return false; } // Do NAMEPREP $decoded = $this->_nameprep($decoded); if (!$decoded || !is_array($decoded)) return false; // NAMEPREP failed $deco_len = count($decoded); if (!$deco_len) return false; // Empty array $codecount = 0; // How many chars have been consumed $encoded = ''; // Copy all basic code points to output for ($i = 0; $i < $deco_len; ++$i) { $test = $decoded[$i]; // Will match [-0-9a-zA-Z] if ((0x2F < $test && $test < 0x40) || (0x40 < $test && $test < 0x5B) || (0x60 < $test && $test <= 0x7B) || (0x2D == $test)) { $encoded .= chr($decoded[$i]); $codecount++; } } if ($codecount == $deco_len) return $encoded; // All codepoints were basic ones // Start with the prefix; copy it to output $encoded = $this->_punycode_prefix.$encoded; // If we have basic code points in output, add an hyphen to the end if ($codecount) $encoded .= '-'; // Now find and encode all non-basic code points $is_first = true; $cur_code = $this->_initial_n; $bias = $this->_initial_bias; $delta = 0; while ($codecount < $deco_len) { // Find the smallest code point >= the current code point and // remember the last ouccrence of it in the input for ($i = 0, $next_code = $this->_max_ucs; $i < $deco_len; $i++) { if ($decoded[$i] >= $cur_code && $decoded[$i] <= $next_code) { $next_code = $decoded[$i]; } } $delta += ($next_code - $cur_code) * ($codecount + 1); $cur_code = $next_code; // Scan input again and encode all characters whose code point is $cur_code for ($i = 0; $i < $deco_len; $i++) { if ($decoded[$i] < $cur_code) { $delta++; } elseif ($decoded[$i] == $cur_code) { for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) { $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); if ($q < $t) break; $encoded .= $this->_encode_digit(intval($t + (($q - $t) % ($this->_base - $t)))); //v0.4.5 Changed from ceil() to intval() $q = (int) (($q - $t) / ($this->_base - $t)); } $encoded .= $this->_encode_digit($q); $bias = $this->_adapt($delta, $codecount+1, $is_first); $codecount++; $delta = 0; $is_first = false; } } $delta++; $cur_code++; } return $encoded; } /** * Adapt the bias according to the current code point and position * @access private */ function _adapt($delta, $npoints, $is_first) { $delta = intval($is_first ? ($delta / $this->_damp) : ($delta / 2)); $delta += intval($delta / $npoints); for ($k = 0; $delta > (($this->_base - $this->_tmin) * $this->_tmax) / 2; $k += $this->_base) { $delta = intval($delta / ($this->_base - $this->_tmin)); } return intval($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew)); } /** * Encoding a certain digit * @access private */ function _encode_digit($d) { return chr($d + 22 + 75 * ($d < 26)); } /** * Decode a certain digit * @access private */ function _decode_digit($cp) { $cp = ord($cp); return ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $this->_base)); } /** * Internal error handling method * @access private */ function _error($error = '') { $this->_error = $error; } /** * Do Nameprep according to RFC3491 and RFC3454 * @param array Unicode Characters * @return string Unicode Characters, Nameprep'd * @access private */ function _nameprep($input) { $output = array(); $error = false; // // Mapping // Walking through the input array, performing the required steps on each of // the input chars and putting the result into the output array // While mapping required chars we apply the cannonical ordering foreach ($input as $v) { // Map to nothing == skip that code point if (in_array($v, $this->NP['map_nothing'])) continue; // Try to find prohibited input if (in_array($v, $this->NP['prohibit']) || in_array($v, $this->NP['general_prohibited'])) { $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); return false; } foreach ($this->NP['prohibit_ranges'] as $range) { if ($range[0] <= $v && $v <= $range[1]) { $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); return false; } } // // Hangul syllable decomposition if (0xAC00 <= $v && $v <= 0xD7AF) { foreach ($this->_hangul_decompose($v) as $out) { $output[] = (int) $out; } // There's a decomposition mapping for that code point } elseif (isset($this->NP['replacemaps'][$v])) { foreach ($this->_apply_cannonical_ordering($this->NP['replacemaps'][$v]) as $out) { $output[] = (int) $out; } } else { $output[] = (int) $v; } } // Before applying any Combining, try to rearrange any Hangul syllables $output = $this->_hangul_compose($output); // // Combine code points // $last_class = 0; $last_starter = 0; $out_len = count($output); for ($i = 0; $i < $out_len; ++$i) { $class = $this->_get_combining_class($output[$i]); if ((!$last_class || $last_class > $class) && $class) { // Try to match $seq_len = $i - $last_starter; $out = $this->_combine(array_slice($output, $last_starter, $seq_len)); // On match: Replace the last starter with the composed character and remove // the now redundant non-starter(s) if ($out) { $output[$last_starter] = $out; if (count($out) != $seq_len) { for ($j = $i+1; $j < $out_len; ++$j) { $output[$j-1] = $output[$j]; } unset($output[$out_len]); } // Rewind the for loop by one, since there can be more possible compositions $i--; $out_len--; $last_class = ($i == $last_starter) ? 0 : $this->_get_combining_class($output[$i-1]); continue; } } // The current class is 0 if (!$class) $last_starter = $i; $last_class = $class; } return $output; } /** * Decomposes a Hangul syllable * (see http://www.unicode.org/unicode/reports/tr15/#Hangul * @param integer 32bit UCS4 code point * @return array Either Hangul Syllable decomposed or original 32bit value as one value array * @access private */ function _hangul_decompose($char) { $sindex = (int) $char - $this->_sbase; if ($sindex < 0 || $sindex >= $this->_scount) { return array($char); } $result = array(); $result[] = (int) $this->_lbase + $sindex / $this->_ncount; $result[] = (int) $this->_vbase + ($sindex % $this->_ncount) / $this->_tcount; $T = intval($this->_tbase + $sindex % $this->_tcount); if ($T != $this->_tbase) $result[] = $T; return $result; } /** * Ccomposes a Hangul syllable * (see http://www.unicode.org/unicode/reports/tr15/#Hangul * @param array Decomposed UCS4 sequence * @return array UCS4 sequence with syllables composed * @access private */ function _hangul_compose($input) { $inp_len = count($input); if (!$inp_len) return array(); $result = array(); $last = (int) $input[0]; $result[] = $last; // copy first char from input to output for ($i = 1; $i < $inp_len; ++$i) { $char = (int) $input[$i]; $sindex = $last - $this->_sbase; $lindex = $last - $this->_lbase; $vindex = $char - $this->_vbase; $tindex = $char - $this->_tbase; // Find out, whether two current characters are LV and T if (0 <= $sindex && $sindex < $this->_scount && ($sindex % $this->_tcount == 0) && 0 <= $tindex && $tindex <= $this->_tcount) { // create syllable of form LVT $last += $tindex; $result[(count($result) - 1)] = $last; // reset last continue; // discard char } // Find out, whether two current characters form L and V if (0 <= $lindex && $lindex < $this->_lcount && 0 <= $vindex && $vindex < $this->_vcount) { // create syllable of form LV $last = (int) $this->_sbase + ($lindex * $this->_vcount + $vindex) * $this->_tcount; $result[(count($result) - 1)] = $last; // reset last continue; // discard char } // if neither case was true, just add the character $last = $char; $result[] = $char; } return $result; } /** * Returns the combining class of a certain wide char * @param integer Wide char to check (32bit integer) * @return integer Combining class if found, else 0 * @access private */ function _get_combining_class($char) { return isset($this->NP['norm_combcls'][$char]) ? $this->NP['norm_combcls'][$char] : 0; } /** * Apllies the cannonical ordering of a decomposed UCS4 sequence * @param array Decomposed UCS4 sequence * @return array Ordered USC4 sequence * @access private */ function _apply_cannonical_ordering($input) { $swap = true; $size = count($input); while ($swap) { $swap = false; $last = $this->_get_combining_class(intval($input[0])); for ($i = 0; $i < $size-1; ++$i) { $next = $this->_get_combining_class(intval($input[$i+1])); if ($next != 0 && $last > $next) { // Move item leftward until it fits for ($j = $i + 1; $j > 0; --$j) { if ($this->_get_combining_class(intval($input[$j-1])) <= $next) break; $t = intval($input[$j]); $input[$j] = intval($input[$j-1]); $input[$j-1] = $t; $swap = true; } // Reentering the loop looking at the old character again $next = $last; } $last = $next; } } return $input; } /** * Do composition of a sequence of starter and non-starter * @param array UCS4 Decomposed sequence * @return array Ordered USC4 sequence * @access private */ function _combine($input) { $inp_len = count($input); foreach ($this->NP['replacemaps'] as $np_src => $np_target) { if ($np_target[0] != $input[0]) continue; if (count($np_target) != $inp_len) continue; $hit = false; foreach ($input as $k2 => $v2) { if ($v2 == $np_target[$k2]) { $hit = true; } else { $hit = false; break; } } if ($hit) return $np_src; } return false; } /** * This converts an UTF-8 encoded string to its UCS-4 representation * By talking about UCS-4 "strings" we mean arrays of 32bit integers representing * each of the "chars". This is due to PHP not being able to handle strings with * bit depth different from 8. This apllies to the reverse method _ucs4_to_utf8(), too. * The following UTF-8 encodings are supported: * bytes bits representation * 1 7 0xxxxxxx * 2 11 110xxxxx 10xxxxxx * 3 16 1110xxxx 10xxxxxx 10xxxxxx * 4 21 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx * 5 26 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx * 6 31 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx * Each x represents a bit that can be used to store character data. * The five and six byte sequences are part of Annex D of ISO/IEC 10646-1:2000 * @access private */ function _utf8_to_ucs4($input) { $output = array(); $out_len = 0; $inp_len = strlen($input); $mode = 'next'; $test = 'none'; for ($k = 0; $k < $inp_len; ++$k) { $v = ord($input{$k}); // Extract byte from input string if ($v < 128) { // We found an ASCII char - put into stirng as is $output[$out_len] = $v; ++$out_len; if ('add' == $mode) { $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); return false; } continue; } if ('next' == $mode) { // Try to find the next start byte; determine the width of the Unicode char $start_byte = $v; $mode = 'add'; $test = 'range'; if ($v >> 5 == 6) { // &110xxxxx 10xxxxx $next_byte = 0; // Tells, how many times subsequent bitmasks must rotate 6bits to the left $v = ($v - 192) << 6; } elseif ($v >> 4 == 14) { // &1110xxxx 10xxxxxx 10xxxxxx $next_byte = 1; $v = ($v - 224) << 12; } elseif ($v >> 3 == 30) { // &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx $next_byte = 2; $v = ($v - 240) << 18; } elseif ($v >> 2 == 62) { // &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx $next_byte = 3; $v = ($v - 248) << 24; } elseif ($v >> 1 == 126) { // &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx $next_byte = 4; $v = ($v - 252) << 30; } else { $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k); return false; } if ('add' == $mode) { $output[$out_len] = (int) $v; ++$out_len; continue; } } if ('add' == $mode) { if (!$this->_allow_overlong && $test == 'range') { $test = 'none'; if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k); return false; } } if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx $v = ($v - 128) << ($next_byte * 6); $output[($out_len - 1)] += $v; --$next_byte; } else { $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); return false; } if ($next_byte < 0) { $mode = 'next'; } } } // for return $output; } /** * Convert UCS-4 string into UTF-8 string * See _utf8_to_ucs4() for details * @access private */ function _ucs4_to_utf8($input) { $output = ''; $k = 0; foreach ($input as $v) { ++$k; // $v = ord($v); if ($v < 128) { // 7bit are transferred literally $output .= chr($v); } elseif ($v < (1 << 11)) { // 2 bytes $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); } elseif ($v < (1 << 16)) { // 3 bytes $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); } elseif ($v < (1 << 21)) { // 4 bytes $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); } elseif ($v < (1 << 26)) { // 5 bytes $output .= chr(248 + ($v >> 24)) . chr(128 + (($v >> 18) & 63)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); } elseif ($v < (1 << 31)) { // 6 bytes $output .= chr(252 + ($v >> 30)) . chr(128 + (($v >> 24) & 63)) . chr(128 + (($v >> 18) & 63)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); } else { $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k); return false; } } return $output; } /** * Convert UCS-4 array into UCS-4 string * * @access private */ function _ucs4_to_ucs4_string($input) { $output = ''; // Take array values and split output to 4 bytes per value // The bit mask is 255, which reads &11111111 foreach ($input as $v) { $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255); } return $output; } /** * Convert UCS-4 strin into UCS-4 garray * * @access private */ function _ucs4_string_to_ucs4($input) { $output = array(); $inp_len = strlen($input); // Input length must be dividable by 4 if ($inp_len % 4) { $this->_error('Input UCS4 string is broken'); return false; } // Empty input - return empty output if (!$inp_len) return $output; for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) { // Increment output position every 4 input bytes if (!($i % 4)) { $out_len++; $output[$out_len] = 0; } $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); } return $output; } } /** * Adapter class for aligning the API of idna_convert with that of Net_IDNA * @author Matthias Sommerfeld <mso@phlylabs.de> */ class Net_IDNA_php4 extends idna_convert { /** * Sets a new option value. Available options and values: * [encoding - Use either UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8, * 'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always UTF-8] * [overlong - Unicode does not allow unnecessarily long encodings of chars, * to allow this, set this parameter to true, else to false; * default is false.] * [strict - true: strict mode, good for registration purposes - Causes errors * on failures; false: loose mode, ideal for "wildlife" applications * by silently ignoring errors and returning the original input instead * * @param mixed Parameter to set (string: single parameter; array of Parameter => Value pairs) * @param string Value to use (if parameter 1 is a string) * @return boolean true on success, false otherwise * @access public */ function setParams($option, $param = false) { return $this->IC->set_parameters($option, $param); } } ?>PK���\%��@�g�glibraries/simplepie/idn/LICENCEnu�[��� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! PK���\$0Qs����"libraries/simplepie/idn/npdata.sernu�[���a:6:{s:11:"map_nothing";a:27:{i:0;i:173;i:1;i:847;i:2;i:6150;i:3;i:6155;i:4;i:6156;i:5;i:6157;i:6;i:8203;i:7;i:8204;i:8;i:8205;i:9;i:8288;i:10;i:65024;i:11;i:65025;i:12;i:65026;i:13;i:65027;i:14;i:65028;i:15;i:65029;i:16;i:65030;i:17;i:65031;i:18;i:65032;i:19;i:65033;i:20;i:65034;i:21;i:65035;i:22;i:65036;i:23;i:65037;i:24;i:65038;i:25;i:65039;i:26;i:65279;}s:18:"general_prohibited";a:64:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:5;i:6;i:6;i:7;i:7;i:8;i:8;i:9;i:9;i:10;i:10;i:11;i:11;i:12;i:12;i:13;i:13;i:14;i:14;i:15;i:15;i:16;i:16;i:17;i:17;i:18;i:18;i:19;i:19;i:20;i:20;i:21;i:21;i:22;i:22;i:23;i:23;i:24;i:24;i:25;i:25;i:26;i:26;i:27;i:27;i:28;i:28;i:29;i:29;i:30;i:30;i:31;i:31;i:32;i:32;i:33;i:33;i:34;i:34;i:35;i:35;i:36;i:36;i:37;i:37;i:38;i:38;i:39;i:39;i:40;i:40;i:41;i:41;i:42;i:42;i:43;i:43;i:44;i:44;i:45;i:47;i:46;i:59;i:47;i:60;i:48;i:61;i:49;i:62;i:50;i:63;i:51;i:64;i:52;i:91;i:53;i:92;i:54;i:93;i:55;i:94;i:56;i:95;i:57;i:96;i:58;i:123;i:59;i:124;i:60;i:125;i:61;i:126;i:62;i:127;i:63;i:12290;}s:8:"prohibit";a:84:{i:0;i:160;i:1;i:5760;i:2;i:8192;i:3;i:8193;i:4;i:8194;i:5;i:8195;i:6;i:8196;i:7;i:8197;i:8;i:8198;i:9;i:8199;i:10;i:8200;i:11;i:8201;i:12;i:8202;i:13;i:8203;i:14;i:8239;i:15;i:8287;i:16;i:12288;i:17;i:1757;i:18;i:1807;i:19;i:6158;i:20;i:8204;i:21;i:8205;i:22;i:8232;i:23;i:8233;i:24;i:65279;i:25;i:65529;i:26;i:65530;i:27;i:65531;i:28;i:65532;i:29;i:65534;i:30;i:65535;i:31;i:131070;i:32;i:131071;i:33;i:196606;i:34;i:196607;i:35;i:262142;i:36;i:262143;i:37;i:327678;i:38;i:327679;i:39;i:393214;i:40;i:393215;i:41;i:458750;i:42;i:458751;i:43;i:524286;i:44;i:524287;i:45;i:589822;i:46;i:589823;i:47;i:655358;i:48;i:655359;i:49;i:720894;i:50;i:720895;i:51;i:786430;i:52;i:786431;i:53;i:851966;i:54;i:851967;i:55;i:917502;i:56;i:917503;i:57;i:983038;i:58;i:983039;i:59;i:1048574;i:60;i:1048575;i:61;i:1114110;i:62;i:1114111;i:63;i:65529;i:64;i:65530;i:65;i:65531;i:66;i:65532;i:67;i:65533;i:68;i:832;i:69;i:833;i:70;i:8206;i:71;i:8207;i:72;i:8234;i:73;i:8235;i:74;i:8236;i:75;i:8237;i:76;i:8238;i:77;i:8298;i:78;i:8299;i:79;i:8300;i:80;i:8301;i:81;i:8302;i:82;i:8303;i:83;i:917505;}s:15:"prohibit_ranges";a:10:{i:0;a:2:{i:0;i:128;i:1;i:159;}i:1;a:2:{i:0;i:8288;i:1;i:8303;}i:2;a:2:{i:0;i:119155;i:1;i:119162;}i:3;a:2:{i:0;i:57344;i:1;i:63743;}i:4;a:2:{i:0;i:983040;i:1;i:1048573;}i:5;a:2:{i:0;i:1048576;i:1;i:1114109;}i:6;a:2:{i:0;i:64976;i:1;i:65007;}i:7;a:2:{i:0;i:55296;i:1;i:57343;}i:8;a:2:{i:0;i:12272;i:1;i:12283;}i:9;a:2:{i:0;i:917536;i:1;i:917631;}}s:11:"replacemaps";a:1401:{i:65;a:1:{i:0;i:97;}i:66;a:1:{i:0;i:98;}i:67;a:1:{i:0;i:99;}i:68;a:1:{i:0;i:100;}i:69;a:1:{i:0;i:101;}i:70;a:1:{i:0;i:102;}i:71;a:1:{i:0;i:103;}i:72;a:1:{i:0;i:104;}i:73;a:1:{i:0;i:105;}i:74;a:1:{i:0;i:106;}i:75;a:1:{i:0;i:107;}i:76;a:1:{i:0;i:108;}i:77;a:1:{i:0;i:109;}i:78;a:1:{i:0;i:110;}i:79;a:1:{i:0;i:111;}i:80;a:1:{i:0;i:112;}i:81;a:1:{i:0;i:113;}i:82;a:1:{i:0;i:114;}i:83;a:1:{i:0;i:115;}i:84;a:1:{i:0;i:116;}i:85;a:1:{i:0;i:117;}i:86;a:1:{i:0;i:118;}i:87;a:1:{i:0;i:119;}i:88;a:1:{i:0;i:120;}i:89;a:1:{i:0;i:121;}i:90;a:1:{i:0;i:122;}i:181;a:1:{i:0;i:956;}i:192;a:1:{i:0;i:224;}i:193;a:1:{i:0;i:225;}i:194;a:1:{i:0;i:226;}i:195;a:1:{i:0;i:227;}i:196;a:1:{i:0;i:228;}i:197;a:1:{i:0;i:229;}i:198;a:1:{i:0;i:230;}i:199;a:1:{i:0;i:231;}i:200;a:1:{i:0;i:232;}i:201;a:1:{i:0;i:233;}i:202;a:1:{i:0;i:234;}i:203;a:1:{i:0;i:235;}i:204;a:1:{i:0;i:236;}i:205;a:1:{i:0;i:237;}i:206;a:1:{i:0;i:238;}i:207;a:1:{i:0;i:239;}i:208;a:1:{i:0;i:240;}i:209;a:1:{i:0;i:241;}i:210;a:1:{i:0;i:242;}i:211;a:1:{i:0;i:243;}i:212;a:1:{i:0;i:244;}i:213;a:1:{i:0;i:245;}i:214;a:1:{i:0;i:246;}i:216;a:1:{i:0;i:248;}i:217;a:1:{i:0;i:249;}i:218;a:1:{i:0;i:250;}i:219;a:1:{i:0;i:251;}i:220;a:1:{i:0;i:252;}i:221;a:1:{i:0;i:253;}i:222;a:1:{i:0;i:254;}i:223;a:2:{i:0;i:115;i:1;i:115;}i:256;a:1:{i:0;i:257;}i:258;a:1:{i:0;i:259;}i:260;a:1:{i:0;i:261;}i:262;a:1:{i:0;i:263;}i:264;a:1:{i:0;i:265;}i:266;a:1:{i:0;i:267;}i:268;a:1:{i:0;i:269;}i:270;a:1:{i:0;i:271;}i:272;a:1:{i:0;i:273;}i:274;a:1:{i:0;i:275;}i:276;a:1:{i:0;i:277;}i:278;a:1:{i:0;i:279;}i:280;a:1:{i:0;i:281;}i:282;a:1:{i:0;i:283;}i:284;a:1:{i:0;i:285;}i:286;a:1:{i:0;i:287;}i:288;a:1:{i:0;i:289;}i:290;a:1:{i:0;i:291;}i:292;a:1:{i:0;i:293;}i:294;a:1:{i:0;i:295;}i:296;a:1:{i:0;i:297;}i:298;a:1:{i:0;i:299;}i:300;a:1:{i:0;i:301;}i:302;a:1:{i:0;i:303;}i:304;a:2:{i:0;i:105;i:1;i:775;}i:306;a:1:{i:0;i:307;}i:308;a:1:{i:0;i:309;}i:310;a:1:{i:0;i:311;}i:313;a:1:{i:0;i:314;}i:315;a:1:{i:0;i:316;}i:317;a:1:{i:0;i:318;}i:319;a:1:{i:0;i:320;}i:321;a:1:{i:0;i:322;}i:323;a:1:{i:0;i:324;}i:325;a:1:{i:0;i:326;}i:327;a:1:{i:0;i:328;}i:329;a:2:{i:0;i:700;i:1;i:110;}i:330;a:1:{i:0;i:331;}i:332;a:1:{i:0;i:333;}i:334;a:1:{i:0;i:335;}i:336;a:1:{i:0;i:337;}i:338;a:1:{i:0;i:339;}i:340;a:1:{i:0;i:341;}i:342;a:1:{i:0;i:343;}i:344;a:1:{i:0;i:345;}i:346;a:1:{i:0;i:347;}i:348;a:1:{i:0;i:349;}i:350;a:1:{i:0;i:351;}i:352;a:1:{i:0;i:353;}i:354;a:1:{i:0;i:355;}i:356;a:1:{i:0;i:357;}i:358;a:1:{i:0;i:359;}i:360;a:1:{i:0;i:361;}i:362;a:1:{i:0;i:363;}i:364;a:1:{i:0;i:365;}i:366;a:1:{i:0;i:367;}i:368;a:1:{i:0;i:369;}i:370;a:1:{i:0;i:371;}i:372;a:1:{i:0;i:373;}i:374;a:1:{i:0;i:375;}i:376;a:1:{i:0;i:255;}i:377;a:1:{i:0;i:378;}i:379;a:1:{i:0;i:380;}i:381;a:1:{i:0;i:382;}i:383;a:1:{i:0;i:115;}i:385;a:1:{i:0;i:595;}i:386;a:1:{i:0;i:387;}i:388;a:1:{i:0;i:389;}i:390;a:1:{i:0;i:596;}i:391;a:1:{i:0;i:392;}i:393;a:1:{i:0;i:598;}i:394;a:1:{i:0;i:599;}i:395;a:1:{i:0;i:396;}i:398;a:1:{i:0;i:477;}i:399;a:1:{i:0;i:601;}i:400;a:1:{i:0;i:603;}i:401;a:1:{i:0;i:402;}i:403;a:1:{i:0;i:608;}i:404;a:1:{i:0;i:611;}i:406;a:1:{i:0;i:617;}i:407;a:1:{i:0;i:616;}i:408;a:1:{i:0;i:409;}i:412;a:1:{i:0;i:623;}i:413;a:1:{i:0;i:626;}i:415;a:1:{i:0;i:629;}i:416;a:1:{i:0;i:417;}i:418;a:1:{i:0;i:419;}i:420;a:1:{i:0;i:421;}i:422;a:1:{i:0;i:640;}i:423;a:1:{i:0;i:424;}i:425;a:1:{i:0;i:643;}i:428;a:1:{i:0;i:429;}i:430;a:1:{i:0;i:648;}i:431;a:1:{i:0;i:432;}i:433;a:1:{i:0;i:650;}i:434;a:1:{i:0;i:651;}i:435;a:1:{i:0;i:436;}i:437;a:1:{i:0;i:438;}i:439;a:1:{i:0;i:658;}i:440;a:1:{i:0;i:441;}i:444;a:1:{i:0;i:445;}i:452;a:1:{i:0;i:454;}i:453;a:1:{i:0;i:454;}i:455;a:1:{i:0;i:457;}i:456;a:1:{i:0;i:457;}i:458;a:1:{i:0;i:460;}i:459;a:1:{i:0;i:460;}i:461;a:1:{i:0;i:462;}i:463;a:1:{i:0;i:464;}i:465;a:1:{i:0;i:466;}i:467;a:1:{i:0;i:468;}i:469;a:1:{i:0;i:470;}i:471;a:1:{i:0;i:472;}i:473;a:1:{i:0;i:474;}i:475;a:1:{i:0;i:476;}i:478;a:1:{i:0;i:479;}i:480;a:1:{i:0;i:481;}i:482;a:1:{i:0;i:483;}i:484;a:1:{i:0;i:485;}i:486;a:1:{i:0;i:487;}i:488;a:1:{i:0;i:489;}i:490;a:1:{i:0;i:491;}i:492;a:1:{i:0;i:493;}i:494;a:1:{i:0;i:495;}i:496;a:2:{i:0;i:106;i:1;i:780;}i:497;a:1:{i:0;i:499;}i:498;a:1:{i:0;i:499;}i:500;a:1:{i:0;i:501;}i:502;a:1:{i:0;i:405;}i:503;a:1:{i:0;i:447;}i:504;a:1:{i:0;i:505;}i:506;a:1:{i:0;i:507;}i:508;a:1:{i:0;i:509;}i:510;a:1:{i:0;i:511;}i:512;a:1:{i:0;i:513;}i:514;a:1:{i:0;i:515;}i:516;a:1:{i:0;i:517;}i:518;a:1:{i:0;i:519;}i:520;a:1:{i:0;i:521;}i:522;a:1:{i:0;i:523;}i:524;a:1:{i:0;i:525;}i:526;a:1:{i:0;i:527;}i:528;a:1:{i:0;i:529;}i:530;a:1:{i:0;i:531;}i:532;a:1:{i:0;i:533;}i:534;a:1:{i:0;i:535;}i:536;a:1:{i:0;i:537;}i:538;a:1:{i:0;i:539;}i:540;a:1:{i:0;i:541;}i:542;a:1:{i:0;i:543;}i:544;a:1:{i:0;i:414;}i:546;a:1:{i:0;i:547;}i:548;a:1:{i:0;i:549;}i:550;a:1:{i:0;i:551;}i:552;a:1:{i:0;i:553;}i:554;a:1:{i:0;i:555;}i:556;a:1:{i:0;i:557;}i:558;a:1:{i:0;i:559;}i:560;a:1:{i:0;i:561;}i:562;a:1:{i:0;i:563;}i:837;a:1:{i:0;i:953;}i:890;a:2:{i:0;i:32;i:1;i:953;}i:902;a:1:{i:0;i:940;}i:904;a:1:{i:0;i:941;}i:905;a:1:{i:0;i:942;}i:906;a:1:{i:0;i:943;}i:908;a:1:{i:0;i:972;}i:910;a:1:{i:0;i:973;}i:911;a:1:{i:0;i:974;}i:912;a:3:{i:0;i:953;i:1;i:776;i:2;i:769;}i:913;a:1:{i:0;i:945;}i:914;a:1:{i:0;i:946;}i:915;a:1:{i:0;i:947;}i:916;a:1:{i:0;i:948;}i:917;a:1:{i:0;i:949;}i:918;a:1:{i:0;i:950;}i:919;a:1:{i:0;i:951;}i:920;a:1:{i:0;i:952;}i:921;a:1:{i:0;i:953;}i:922;a:1:{i:0;i:954;}i:923;a:1:{i:0;i:955;}i:924;a:1:{i:0;i:956;}i:925;a:1:{i:0;i:957;}i:926;a:1:{i:0;i:958;}i:927;a:1:{i:0;i:959;}i:928;a:1:{i:0;i:960;}i:929;a:1:{i:0;i:961;}i:931;a:1:{i:0;i:963;}i:932;a:1:{i:0;i:964;}i:933;a:1:{i:0;i:965;}i:934;a:1:{i:0;i:966;}i:935;a:1:{i:0;i:967;}i:936;a:1:{i:0;i:968;}i:937;a:1:{i:0;i:969;}i:938;a:1:{i:0;i:970;}i:939;a:1:{i:0;i:971;}i:944;a:3:{i:0;i:965;i:1;i:776;i:2;i:769;}i:962;a:1:{i:0;i:963;}i:976;a:1:{i:0;i:946;}i:977;a:1:{i:0;i:952;}i:978;a:1:{i:0;i:965;}i:979;a:1:{i:0;i:973;}i:980;a:1:{i:0;i:971;}i:981;a:1:{i:0;i:966;}i:982;a:1:{i:0;i:960;}i:984;a:1:{i:0;i:985;}i:986;a:1:{i:0;i:987;}i:988;a:1:{i:0;i:989;}i:990;a:1:{i:0;i:991;}i:992;a:1:{i:0;i:993;}i:994;a:1:{i:0;i:995;}i:996;a:1:{i:0;i:997;}i:998;a:1:{i:0;i:999;}i:1000;a:1:{i:0;i:1001;}i:1002;a:1:{i:0;i:1003;}i:1004;a:1:{i:0;i:1005;}i:1006;a:1:{i:0;i:1007;}i:1008;a:1:{i:0;i:954;}i:1009;a:1:{i:0;i:961;}i:1010;a:1:{i:0;i:963;}i:1012;a:1:{i:0;i:952;}i:1013;a:1:{i:0;i:949;}i:1024;a:1:{i:0;i:1104;}i:1025;a:1:{i:0;i:1105;}i:1026;a:1:{i:0;i:1106;}i:1027;a:1:{i:0;i:1107;}i:1028;a:1:{i:0;i:1108;}i:1029;a:1:{i:0;i:1109;}i:1030;a:1:{i:0;i:1110;}i:1031;a:1:{i:0;i:1111;}i:1032;a:1:{i:0;i:1112;}i:1033;a:1:{i:0;i:1113;}i:1034;a:1:{i:0;i:1114;}i:1035;a:1:{i:0;i:1115;}i:1036;a:1:{i:0;i:1116;}i:1037;a:1:{i:0;i:1117;}i:1038;a:1:{i:0;i:1118;}i:1039;a:1:{i:0;i:1119;}i:1040;a:1:{i:0;i:1072;}i:1041;a:1:{i:0;i:1073;}i:1042;a:1:{i:0;i:1074;}i:1043;a:1:{i:0;i:1075;}i:1044;a:1:{i:0;i:1076;}i:1045;a:1:{i:0;i:1077;}i:1046;a:1:{i:0;i:1078;}i:1047;a:1:{i:0;i:1079;}i:1048;a:1:{i:0;i:1080;}i:1049;a:1:{i:0;i:1081;}i:1050;a:1:{i:0;i:1082;}i:1051;a:1:{i:0;i:1083;}i:1052;a:1:{i:0;i:1084;}i:1053;a:1:{i:0;i:1085;}i:1054;a:1:{i:0;i:1086;}i:1055;a:1:{i:0;i:1087;}i:1056;a:1:{i:0;i:1088;}i:1057;a:1:{i:0;i:1089;}i:1058;a:1:{i:0;i:1090;}i:1059;a:1:{i:0;i:1091;}i:1060;a:1:{i:0;i:1092;}i:1061;a:1:{i:0;i:1093;}i:1062;a:1:{i:0;i:1094;}i:1063;a:1:{i:0;i:1095;}i:1064;a:1:{i:0;i:1096;}i:1065;a:1:{i:0;i:1097;}i:1066;a:1:{i:0;i:1098;}i:1067;a:1:{i:0;i:1099;}i:1068;a:1:{i:0;i:1100;}i:1069;a:1:{i:0;i:1101;}i:1070;a:1:{i:0;i:1102;}i:1071;a:1:{i:0;i:1103;}i:1120;a:1:{i:0;i:1121;}i:1122;a:1:{i:0;i:1123;}i:1124;a:1:{i:0;i:1125;}i:1126;a:1:{i:0;i:1127;}i:1128;a:1:{i:0;i:1129;}i:1130;a:1:{i:0;i:1131;}i:1132;a:1:{i:0;i:1133;}i:1134;a:1:{i:0;i:1135;}i:1136;a:1:{i:0;i:1137;}i:1138;a:1:{i:0;i:1139;}i:1140;a:1:{i:0;i:1141;}i:1142;a:1:{i:0;i:1143;}i:1144;a:1:{i:0;i:1145;}i:1146;a:1:{i:0;i:1147;}i:1148;a:1:{i:0;i:1149;}i:1150;a:1:{i:0;i:1151;}i:1152;a:1:{i:0;i:1153;}i:1162;a:1:{i:0;i:1163;}i:1164;a:1:{i:0;i:1165;}i:1166;a:1:{i:0;i:1167;}i:1168;a:1:{i:0;i:1169;}i:1170;a:1:{i:0;i:1171;}i:1172;a:1:{i:0;i:1173;}i:1174;a:1:{i:0;i:1175;}i:1176;a:1:{i:0;i:1177;}i:1178;a:1:{i:0;i:1179;}i:1180;a:1:{i:0;i:1181;}i:1182;a:1:{i:0;i:1183;}i:1184;a:1:{i:0;i:1185;}i:1186;a:1:{i:0;i:1187;}i:1188;a:1:{i:0;i:1189;}i:1190;a:1:{i:0;i:1191;}i:1192;a:1:{i:0;i:1193;}i:1194;a:1:{i:0;i:1195;}i:1196;a:1:{i:0;i:1197;}i:1198;a:1:{i:0;i:1199;}i:1200;a:1:{i:0;i:1201;}i:1202;a:1:{i:0;i:1203;}i:1204;a:1:{i:0;i:1205;}i:1206;a:1:{i:0;i:1207;}i:1208;a:1:{i:0;i:1209;}i:1210;a:1:{i:0;i:1211;}i:1212;a:1:{i:0;i:1213;}i:1214;a:1:{i:0;i:1215;}i:1217;a:1:{i:0;i:1218;}i:1219;a:1:{i:0;i:1220;}i:1221;a:1:{i:0;i:1222;}i:1223;a:1:{i:0;i:1224;}i:1225;a:1:{i:0;i:1226;}i:1227;a:1:{i:0;i:1228;}i:1229;a:1:{i:0;i:1230;}i:1232;a:1:{i:0;i:1233;}i:1234;a:1:{i:0;i:1235;}i:1236;a:1:{i:0;i:1237;}i:1238;a:1:{i:0;i:1239;}i:1240;a:1:{i:0;i:1241;}i:1242;a:1:{i:0;i:1243;}i:1244;a:1:{i:0;i:1245;}i:1246;a:1:{i:0;i:1247;}i:1248;a:1:{i:0;i:1249;}i:1250;a:1:{i:0;i:1251;}i:1252;a:1:{i:0;i:1253;}i:1254;a:1:{i:0;i:1255;}i:1256;a:1:{i:0;i:1257;}i:1258;a:1:{i:0;i:1259;}i:1260;a:1:{i:0;i:1261;}i:1262;a:1:{i:0;i:1263;}i:1264;a:1:{i:0;i:1265;}i:1266;a:1:{i:0;i:1267;}i:1268;a:1:{i:0;i:1269;}i:1272;a:1:{i:0;i:1273;}i:1280;a:1:{i:0;i:1281;}i:1282;a:1:{i:0;i:1283;}i:1284;a:1:{i:0;i:1285;}i:1286;a:1:{i:0;i:1287;}i:1288;a:1:{i:0;i:1289;}i:1290;a:1:{i:0;i:1291;}i:1292;a:1:{i:0;i:1293;}i:1294;a:1:{i:0;i:1295;}i:1329;a:1:{i:0;i:1377;}i:1330;a:1:{i:0;i:1378;}i:1331;a:1:{i:0;i:1379;}i:1332;a:1:{i:0;i:1380;}i:1333;a:1:{i:0;i:1381;}i:1334;a:1:{i:0;i:1382;}i:1335;a:1:{i:0;i:1383;}i:1336;a:1:{i:0;i:1384;}i:1337;a:1:{i:0;i:1385;}i:1338;a:1:{i:0;i:1386;}i:1339;a:1:{i:0;i:1387;}i:1340;a:1:{i:0;i:1388;}i:1341;a:1:{i:0;i:1389;}i:1342;a:1:{i:0;i:1390;}i:1343;a:1:{i:0;i:1391;}i:1344;a:1:{i:0;i:1392;}i:1345;a:1:{i:0;i:1393;}i:1346;a:1:{i:0;i:1394;}i:1347;a:1:{i:0;i:1395;}i:1348;a:1:{i:0;i:1396;}i:1349;a:1:{i:0;i:1397;}i:1350;a:1:{i:0;i:1398;}i:1351;a:1:{i:0;i:1399;}i:1352;a:1:{i:0;i:1400;}i:1353;a:1:{i:0;i:1401;}i:1354;a:1:{i:0;i:1402;}i:1355;a:1:{i:0;i:1403;}i:1356;a:1:{i:0;i:1404;}i:1357;a:1:{i:0;i:1405;}i:1358;a:1:{i:0;i:1406;}i:1359;a:1:{i:0;i:1407;}i:1360;a:1:{i:0;i:1408;}i:1361;a:1:{i:0;i:1409;}i:1362;a:1:{i:0;i:1410;}i:1363;a:1:{i:0;i:1411;}i:1364;a:1:{i:0;i:1412;}i:1365;a:1:{i:0;i:1413;}i:1366;a:1:{i:0;i:1414;}i:1415;a:2:{i:0;i:1381;i:1;i:1410;}i:7680;a:1:{i:0;i:7681;}i:7682;a:1:{i:0;i:7683;}i:7684;a:1:{i:0;i:7685;}i:7686;a:1:{i:0;i:7687;}i:7688;a:1:{i:0;i:7689;}i:7690;a:1:{i:0;i:7691;}i:7692;a:1:{i:0;i:7693;}i:7694;a:1:{i:0;i:7695;}i:7696;a:1:{i:0;i:7697;}i:7698;a:1:{i:0;i:7699;}i:7700;a:1:{i:0;i:7701;}i:7702;a:1:{i:0;i:7703;}i:7704;a:1:{i:0;i:7705;}i:7706;a:1:{i:0;i:7707;}i:7708;a:1:{i:0;i:7709;}i:7710;a:1:{i:0;i:7711;}i:7712;a:1:{i:0;i:7713;}i:7714;a:1:{i:0;i:7715;}i:7716;a:1:{i:0;i:7717;}i:7718;a:1:{i:0;i:7719;}i:7720;a:1:{i:0;i:7721;}i:7722;a:1:{i:0;i:7723;}i:7724;a:1:{i:0;i:7725;}i:7726;a:1:{i:0;i:7727;}i:7728;a:1:{i:0;i:7729;}i:7730;a:1:{i:0;i:7731;}i:7732;a:1:{i:0;i:7733;}i:7734;a:1:{i:0;i:7735;}i:7736;a:1:{i:0;i:7737;}i:7738;a:1:{i:0;i:7739;}i:7740;a:1:{i:0;i:7741;}i:7742;a:1:{i:0;i:7743;}i:7744;a:1:{i:0;i:7745;}i:7746;a:1:{i:0;i:7747;}i:7748;a:1:{i:0;i:7749;}i:7750;a:1:{i:0;i:7751;}i:7752;a:1:{i:0;i:7753;}i:7754;a:1:{i:0;i:7755;}i:7756;a:1:{i:0;i:7757;}i:7758;a:1:{i:0;i:7759;}i:7760;a:1:{i:0;i:7761;}i:7762;a:1:{i:0;i:7763;}i:7764;a:1:{i:0;i:7765;}i:7766;a:1:{i:0;i:7767;}i:7768;a:1:{i:0;i:7769;}i:7770;a:1:{i:0;i:7771;}i:7772;a:1:{i:0;i:7773;}i:7774;a:1:{i:0;i:7775;}i:7776;a:1:{i:0;i:7777;}i:7778;a:1:{i:0;i:7779;}i:7780;a:1:{i:0;i:7781;}i:7782;a:1:{i:0;i:7783;}i:7784;a:1:{i:0;i:7785;}i:7786;a:1:{i:0;i:7787;}i:7788;a:1:{i:0;i:7789;}i:7790;a:1:{i:0;i:7791;}i:7792;a:1:{i:0;i:7793;}i:7794;a:1:{i:0;i:7795;}i:7796;a:1:{i:0;i:7797;}i:7798;a:1:{i:0;i:7799;}i:7800;a:1:{i:0;i:7801;}i:7802;a:1:{i:0;i:7803;}i:7804;a:1:{i:0;i:7805;}i:7806;a:1:{i:0;i:7807;}i:7808;a:1:{i:0;i:7809;}i:7810;a:1:{i:0;i:7811;}i:7812;a:1:{i:0;i:7813;}i:7814;a:1:{i:0;i:7815;}i:7816;a:1:{i:0;i:7817;}i:7818;a:1:{i:0;i:7819;}i:7820;a:1:{i:0;i:7821;}i:7822;a:1:{i:0;i:7823;}i:7824;a:1:{i:0;i:7825;}i:7826;a:1:{i:0;i:7827;}i:7828;a:1:{i:0;i:7829;}i:7830;a:2:{i:0;i:104;i:1;i:817;}i:7831;a:2:{i:0;i:116;i:1;i:776;}i:7832;a:2:{i:0;i:119;i:1;i:778;}i:7833;a:2:{i:0;i:121;i:1;i:778;}i:7834;a:2:{i:0;i:97;i:1;i:702;}i:7835;a:1:{i:0;i:7777;}i:7840;a:1:{i:0;i:7841;}i:7842;a:1:{i:0;i:7843;}i:7844;a:1:{i:0;i:7845;}i:7846;a:1:{i:0;i:7847;}i:7848;a:1:{i:0;i:7849;}i:7850;a:1:{i:0;i:7851;}i:7852;a:1:{i:0;i:7853;}i:7854;a:1:{i:0;i:7855;}i:7856;a:1:{i:0;i:7857;}i:7858;a:1:{i:0;i:7859;}i:7860;a:1:{i:0;i:7861;}i:7862;a:1:{i:0;i:7863;}i:7864;a:1:{i:0;i:7865;}i:7866;a:1:{i:0;i:7867;}i:7868;a:1:{i:0;i:7869;}i:7870;a:1:{i:0;i:7871;}i:7872;a:1:{i:0;i:7873;}i:7874;a:1:{i:0;i:7875;}i:7876;a:1:{i:0;i:7877;}i:7878;a:1:{i:0;i:7879;}i:7880;a:1:{i:0;i:7881;}i:7882;a:1:{i:0;i:7883;}i:7884;a:1:{i:0;i:7885;}i:7886;a:1:{i:0;i:7887;}i:7888;a:1:{i:0;i:7889;}i:7890;a:1:{i:0;i:7891;}i:7892;a:1:{i:0;i:7893;}i:7894;a:1:{i:0;i:7895;}i:7896;a:1:{i:0;i:7897;}i:7898;a:1:{i:0;i:7899;}i:7900;a:1:{i:0;i:7901;}i:7902;a:1:{i:0;i:7903;}i:7904;a:1:{i:0;i:7905;}i:7906;a:1:{i:0;i:7907;}i:7908;a:1:{i:0;i:7909;}i:7910;a:1:{i:0;i:7911;}i:7912;a:1:{i:0;i:7913;}i:7914;a:1:{i:0;i:7915;}i:7916;a:1:{i:0;i:7917;}i:7918;a:1:{i:0;i:7919;}i:7920;a:1:{i:0;i:7921;}i:7922;a:1:{i:0;i:7923;}i:7924;a:1:{i:0;i:7925;}i:7926;a:1:{i:0;i:7927;}i:7928;a:1:{i:0;i:7929;}i:7944;a:1:{i:0;i:7936;}i:7945;a:1:{i:0;i:7937;}i:7946;a:1:{i:0;i:7938;}i:7947;a:1:{i:0;i:7939;}i:7948;a:1:{i:0;i:7940;}i:7949;a:1:{i:0;i:7941;}i:7950;a:1:{i:0;i:7942;}i:7951;a:1:{i:0;i:7943;}i:7960;a:1:{i:0;i:7952;}i:7961;a:1:{i:0;i:7953;}i:7962;a:1:{i:0;i:7954;}i:7963;a:1:{i:0;i:7955;}i:7964;a:1:{i:0;i:7956;}i:7965;a:1:{i:0;i:7957;}i:7976;a:1:{i:0;i:7968;}i:7977;a:1:{i:0;i:7969;}i:7978;a:1:{i:0;i:7970;}i:7979;a:1:{i:0;i:7971;}i:7980;a:1:{i:0;i:7972;}i:7981;a:1:{i:0;i:7973;}i:7982;a:1:{i:0;i:7974;}i:7983;a:1:{i:0;i:7975;}i:7992;a:1:{i:0;i:7984;}i:7993;a:1:{i:0;i:7985;}i:7994;a:1:{i:0;i:7986;}i:7995;a:1:{i:0;i:7987;}i:7996;a:1:{i:0;i:7988;}i:7997;a:1:{i:0;i:7989;}i:7998;a:1:{i:0;i:7990;}i:7999;a:1:{i:0;i:7991;}i:8008;a:1:{i:0;i:8000;}i:8009;a:1:{i:0;i:8001;}i:8010;a:1:{i:0;i:8002;}i:8011;a:1:{i:0;i:8003;}i:8012;a:1:{i:0;i:8004;}i:8013;a:1:{i:0;i:8005;}i:8016;a:2:{i:0;i:965;i:1;i:787;}i:8018;a:3:{i:0;i:965;i:1;i:787;i:2;i:768;}i:8020;a:3:{i:0;i:965;i:1;i:787;i:2;i:769;}i:8022;a:3:{i:0;i:965;i:1;i:787;i:2;i:834;}i:8025;a:1:{i:0;i:8017;}i:8027;a:1:{i:0;i:8019;}i:8029;a:1:{i:0;i:8021;}i:8031;a:1:{i:0;i:8023;}i:8040;a:1:{i:0;i:8032;}i:8041;a:1:{i:0;i:8033;}i:8042;a:1:{i:0;i:8034;}i:8043;a:1:{i:0;i:8035;}i:8044;a:1:{i:0;i:8036;}i:8045;a:1:{i:0;i:8037;}i:8046;a:1:{i:0;i:8038;}i:8047;a:1:{i:0;i:8039;}i:8064;a:2:{i:0;i:7936;i:1;i:953;}i:8065;a:2:{i:0;i:7937;i:1;i:953;}i:8066;a:2:{i:0;i:7938;i:1;i:953;}i:8067;a:2:{i:0;i:7939;i:1;i:953;}i:8068;a:2:{i:0;i:7940;i:1;i:953;}i:8069;a:2:{i:0;i:7941;i:1;i:953;}i:8070;a:2:{i:0;i:7942;i:1;i:953;}i:8071;a:2:{i:0;i:7943;i:1;i:953;}i:8072;a:2:{i:0;i:7936;i:1;i:953;}i:8073;a:2:{i:0;i:7937;i:1;i:953;}i:8074;a:2:{i:0;i:7938;i:1;i:953;}i:8075;a:2:{i:0;i:7939;i:1;i:953;}i:8076;a:2:{i:0;i:7940;i:1;i:953;}i:8077;a:2:{i:0;i:7941;i:1;i:953;}i:8078;a:2:{i:0;i:7942;i:1;i:953;}i:8079;a:2:{i:0;i:7943;i:1;i:953;}i:8080;a:2:{i:0;i:7968;i:1;i:953;}i:8081;a:2:{i:0;i:7969;i:1;i:953;}i:8082;a:2:{i:0;i:7970;i:1;i:953;}i:8083;a:2:{i:0;i:7971;i:1;i:953;}i:8084;a:2:{i:0;i:7972;i:1;i:953;}i:8085;a:2:{i:0;i:7973;i:1;i:953;}i:8086;a:2:{i:0;i:7974;i:1;i:953;}i:8087;a:2:{i:0;i:7975;i:1;i:953;}i:8088;a:2:{i:0;i:7968;i:1;i:953;}i:8089;a:2:{i:0;i:7969;i:1;i:953;}i:8090;a:2:{i:0;i:7970;i:1;i:953;}i:8091;a:2:{i:0;i:7971;i:1;i:953;}i:8092;a:2:{i:0;i:7972;i:1;i:953;}i:8093;a:2:{i:0;i:7973;i:1;i:953;}i:8094;a:2:{i:0;i:7974;i:1;i:953;}i:8095;a:2:{i:0;i:7975;i:1;i:953;}i:8096;a:2:{i:0;i:8032;i:1;i:953;}i:8097;a:2:{i:0;i:8033;i:1;i:953;}i:8098;a:2:{i:0;i:8034;i:1;i:953;}i:8099;a:2:{i:0;i:8035;i:1;i:953;}i:8100;a:2:{i:0;i:8036;i:1;i:953;}i:8101;a:2:{i:0;i:8037;i:1;i:953;}i:8102;a:2:{i:0;i:8038;i:1;i:953;}i:8103;a:2:{i:0;i:8039;i:1;i:953;}i:8104;a:2:{i:0;i:8032;i:1;i:953;}i:8105;a:2:{i:0;i:8033;i:1;i:953;}i:8106;a:2:{i:0;i:8034;i:1;i:953;}i:8107;a:2:{i:0;i:8035;i:1;i:953;}i:8108;a:2:{i:0;i:8036;i:1;i:953;}i:8109;a:2:{i:0;i:8037;i:1;i:953;}i:8110;a:2:{i:0;i:8038;i:1;i:953;}i:8111;a:2:{i:0;i:8039;i:1;i:953;}i:8114;a:2:{i:0;i:8048;i:1;i:953;}i:8115;a:2:{i:0;i:945;i:1;i:953;}i:8116;a:2:{i:0;i:940;i:1;i:953;}i:8118;a:2:{i:0;i:945;i:1;i:834;}i:8119;a:3:{i:0;i:945;i:1;i:834;i:2;i:953;}i:8120;a:1:{i:0;i:8112;}i:8121;a:1:{i:0;i:8113;}i:8122;a:1:{i:0;i:8048;}i:8123;a:1:{i:0;i:8049;}i:8124;a:2:{i:0;i:945;i:1;i:953;}i:8126;a:1:{i:0;i:953;}i:8130;a:2:{i:0;i:8052;i:1;i:953;}i:8131;a:2:{i:0;i:951;i:1;i:953;}i:8132;a:2:{i:0;i:942;i:1;i:953;}i:8134;a:2:{i:0;i:951;i:1;i:834;}i:8135;a:3:{i:0;i:951;i:1;i:834;i:2;i:953;}i:8136;a:1:{i:0;i:8050;}i:8137;a:1:{i:0;i:8051;}i:8138;a:1:{i:0;i:8052;}i:8139;a:1:{i:0;i:8053;}i:8140;a:2:{i:0;i:951;i:1;i:953;}i:8146;a:3:{i:0;i:953;i:1;i:776;i:2;i:768;}i:8147;a:3:{i:0;i:953;i:1;i:776;i:2;i:769;}i:8150;a:2:{i:0;i:953;i:1;i:834;}i:8151;a:3:{i:0;i:953;i:1;i:776;i:2;i:834;}i:8152;a:1:{i:0;i:8144;}i:8153;a:1:{i:0;i:8145;}i:8154;a:1:{i:0;i:8054;}i:8155;a:1:{i:0;i:8055;}i:8162;a:3:{i:0;i:965;i:1;i:776;i:2;i:768;}i:8163;a:3:{i:0;i:965;i:1;i:776;i:2;i:769;}i:8164;a:2:{i:0;i:961;i:1;i:787;}i:8166;a:2:{i:0;i:965;i:1;i:834;}i:8167;a:3:{i:0;i:965;i:1;i:776;i:2;i:834;}i:8168;a:1:{i:0;i:8160;}i:8169;a:1:{i:0;i:8161;}i:8170;a:1:{i:0;i:8058;}i:8171;a:1:{i:0;i:8059;}i:8172;a:1:{i:0;i:8165;}i:8178;a:2:{i:0;i:8060;i:1;i:953;}i:8179;a:2:{i:0;i:969;i:1;i:953;}i:8180;a:2:{i:0;i:974;i:1;i:953;}i:8182;a:2:{i:0;i:969;i:1;i:834;}i:8183;a:3:{i:0;i:969;i:1;i:834;i:2;i:953;}i:8184;a:1:{i:0;i:8056;}i:8185;a:1:{i:0;i:8057;}i:8186;a:1:{i:0;i:8060;}i:8187;a:1:{i:0;i:8061;}i:8188;a:2:{i:0;i:969;i:1;i:953;}i:8360;a:2:{i:0;i:114;i:1;i:115;}i:8450;a:1:{i:0;i:99;}i:8451;a:2:{i:0;i:176;i:1;i:99;}i:8455;a:1:{i:0;i:603;}i:8457;a:2:{i:0;i:176;i:1;i:102;}i:8459;a:1:{i:0;i:104;}i:8460;a:1:{i:0;i:104;}i:8461;a:1:{i:0;i:104;}i:8464;a:1:{i:0;i:105;}i:8465;a:1:{i:0;i:105;}i:8466;a:1:{i:0;i:108;}i:8469;a:1:{i:0;i:110;}i:8470;a:2:{i:0;i:110;i:1;i:111;}i:8473;a:1:{i:0;i:112;}i:8474;a:1:{i:0;i:113;}i:8475;a:1:{i:0;i:114;}i:8476;a:1:{i:0;i:114;}i:8477;a:1:{i:0;i:114;}i:8480;a:2:{i:0;i:115;i:1;i:109;}i:8481;a:3:{i:0;i:116;i:1;i:101;i:2;i:108;}i:8482;a:2:{i:0;i:116;i:1;i:109;}i:8484;a:1:{i:0;i:122;}i:8486;a:1:{i:0;i:969;}i:8488;a:1:{i:0;i:122;}i:8490;a:1:{i:0;i:107;}i:8491;a:1:{i:0;i:229;}i:8492;a:1:{i:0;i:98;}i:8493;a:1:{i:0;i:99;}i:8496;a:1:{i:0;i:101;}i:8497;a:1:{i:0;i:102;}i:8499;a:1:{i:0;i:109;}i:8510;a:1:{i:0;i:947;}i:8511;a:1:{i:0;i:960;}i:8517;a:1:{i:0;i:100;}i:8544;a:1:{i:0;i:8560;}i:8545;a:1:{i:0;i:8561;}i:8546;a:1:{i:0;i:8562;}i:8547;a:1:{i:0;i:8563;}i:8548;a:1:{i:0;i:8564;}i:8549;a:1:{i:0;i:8565;}i:8550;a:1:{i:0;i:8566;}i:8551;a:1:{i:0;i:8567;}i:8552;a:1:{i:0;i:8568;}i:8553;a:1:{i:0;i:8569;}i:8554;a:1:{i:0;i:8570;}i:8555;a:1:{i:0;i:8571;}i:8556;a:1:{i:0;i:8572;}i:8557;a:1:{i:0;i:8573;}i:8558;a:1:{i:0;i:8574;}i:8559;a:1:{i:0;i:8575;}i:9398;a:1:{i:0;i:9424;}i:9399;a:1:{i:0;i:9425;}i:9400;a:1:{i:0;i:9426;}i:9401;a:1:{i:0;i:9427;}i:9402;a:1:{i:0;i:9428;}i:9403;a:1:{i:0;i:9429;}i:9404;a:1:{i:0;i:9430;}i:9405;a:1:{i:0;i:9431;}i:9406;a:1:{i:0;i:9432;}i:9407;a:1:{i:0;i:9433;}i:9408;a:1:{i:0;i:9434;}i:9409;a:1:{i:0;i:9435;}i:9410;a:1:{i:0;i:9436;}i:9411;a:1:{i:0;i:9437;}i:9412;a:1:{i:0;i:9438;}i:9413;a:1:{i:0;i:9439;}i:9414;a:1:{i:0;i:9440;}i:9415;a:1:{i:0;i:9441;}i:9416;a:1:{i:0;i:9442;}i:9417;a:1:{i:0;i:9443;}i:9418;a:1:{i:0;i:9444;}i:9419;a:1:{i:0;i:9445;}i:9420;a:1:{i:0;i:9446;}i:9421;a:1:{i:0;i:9447;}i:9422;a:1:{i:0;i:9448;}i:9423;a:1:{i:0;i:9449;}i:13169;a:3:{i:0;i:104;i:1;i:112;i:2;i:97;}i:13171;a:2:{i:0;i:97;i:1;i:117;}i:13173;a:2:{i:0;i:111;i:1;i:118;}i:13184;a:2:{i:0;i:112;i:1;i:97;}i:13185;a:2:{i:0;i:110;i:1;i:97;}i:13186;a:2:{i:0;i:956;i:1;i:97;}i:13187;a:2:{i:0;i:109;i:1;i:97;}i:13188;a:2:{i:0;i:107;i:1;i:97;}i:13189;a:2:{i:0;i:107;i:1;i:98;}i:13190;a:2:{i:0;i:109;i:1;i:98;}i:13191;a:2:{i:0;i:103;i:1;i:98;}i:13194;a:2:{i:0;i:112;i:1;i:102;}i:13195;a:2:{i:0;i:110;i:1;i:102;}i:13196;a:2:{i:0;i:956;i:1;i:102;}i:13200;a:2:{i:0;i:104;i:1;i:122;}i:13201;a:3:{i:0;i:107;i:1;i:104;i:2;i:122;}i:13202;a:3:{i:0;i:109;i:1;i:104;i:2;i:122;}i:13203;a:3:{i:0;i:103;i:1;i:104;i:2;i:122;}i:13204;a:3:{i:0;i:116;i:1;i:104;i:2;i:122;}i:13225;a:2:{i:0;i:112;i:1;i:97;}i:13226;a:3:{i:0;i:107;i:1;i:112;i:2;i:97;}i:13227;a:3:{i:0;i:109;i:1;i:112;i:2;i:97;}i:13228;a:3:{i:0;i:103;i:1;i:112;i:2;i:97;}i:13236;a:2:{i:0;i:112;i:1;i:118;}i:13237;a:2:{i:0;i:110;i:1;i:118;}i:13238;a:2:{i:0;i:956;i:1;i:118;}i:13239;a:2:{i:0;i:109;i:1;i:118;}i:13240;a:2:{i:0;i:107;i:1;i:118;}i:13241;a:2:{i:0;i:109;i:1;i:118;}i:13242;a:2:{i:0;i:112;i:1;i:119;}i:13243;a:2:{i:0;i:110;i:1;i:119;}i:13244;a:2:{i:0;i:956;i:1;i:119;}i:13245;a:2:{i:0;i:109;i:1;i:119;}i:13246;a:2:{i:0;i:107;i:1;i:119;}i:13247;a:2:{i:0;i:109;i:1;i:119;}i:13248;a:2:{i:0;i:107;i:1;i:969;}i:13249;a:2:{i:0;i:109;i:1;i:969;}i:13251;a:2:{i:0;i:98;i:1;i:113;}i:13254;a:4:{i:0;i:99;i:1;i:8725;i:2;i:107;i:3;i:103;}i:13255;a:3:{i:0;i:99;i:1;i:111;i:2;i:46;}i:13256;a:2:{i:0;i:100;i:1;i:98;}i:13257;a:2:{i:0;i:103;i:1;i:121;}i:13259;a:2:{i:0;i:104;i:1;i:112;}i:13261;a:2:{i:0;i:107;i:1;i:107;}i:13262;a:2:{i:0;i:107;i:1;i:109;}i:13271;a:2:{i:0;i:112;i:1;i:104;}i:13273;a:3:{i:0;i:112;i:1;i:112;i:2;i:109;}i:13274;a:2:{i:0;i:112;i:1;i:114;}i:13276;a:2:{i:0;i:115;i:1;i:118;}i:13277;a:2:{i:0;i:119;i:1;i:98;}i:64256;a:2:{i:0;i:102;i:1;i:102;}i:64257;a:2:{i:0;i:102;i:1;i:105;}i:64258;a:2:{i:0;i:102;i:1;i:108;}i:64259;a:3:{i:0;i:102;i:1;i:102;i:2;i:105;}i:64260;a:3:{i:0;i:102;i:1;i:102;i:2;i:108;}i:64261;a:2:{i:0;i:115;i:1;i:116;}i:64262;a:2:{i:0;i:115;i:1;i:116;}i:64275;a:2:{i:0;i:1396;i:1;i:1398;}i:64276;a:2:{i:0;i:1396;i:1;i:1381;}i:64277;a:2:{i:0;i:1396;i:1;i:1387;}i:64278;a:2:{i:0;i:1406;i:1;i:1398;}i:64279;a:2:{i:0;i:1396;i:1;i:1389;}i:65313;a:1:{i:0;i:65345;}i:65314;a:1:{i:0;i:65346;}i:65315;a:1:{i:0;i:65347;}i:65316;a:1:{i:0;i:65348;}i:65317;a:1:{i:0;i:65349;}i:65318;a:1:{i:0;i:65350;}i:65319;a:1:{i:0;i:65351;}i:65320;a:1:{i:0;i:65352;}i:65321;a:1:{i:0;i:65353;}i:65322;a:1:{i:0;i:65354;}i:65323;a:1:{i:0;i:65355;}i:65324;a:1:{i:0;i:65356;}i:65325;a:1:{i:0;i:65357;}i:65326;a:1:{i:0;i:65358;}i:65327;a:1:{i:0;i:65359;}i:65328;a:1:{i:0;i:65360;}i:65329;a:1:{i:0;i:65361;}i:65330;a:1:{i:0;i:65362;}i:65331;a:1:{i:0;i:65363;}i:65332;a:1:{i:0;i:65364;}i:65333;a:1:{i:0;i:65365;}i:65334;a:1:{i:0;i:65366;}i:65335;a:1:{i:0;i:65367;}i:65336;a:1:{i:0;i:65368;}i:65337;a:1:{i:0;i:65369;}i:65338;a:1:{i:0;i:65370;}i:66560;a:1:{i:0;i:66600;}i:66561;a:1:{i:0;i:66601;}i:66562;a:1:{i:0;i:66602;}i:66563;a:1:{i:0;i:66603;}i:66564;a:1:{i:0;i:66604;}i:66565;a:1:{i:0;i:66605;}i:66566;a:1:{i:0;i:66606;}i:66567;a:1:{i:0;i:66607;}i:66568;a:1:{i:0;i:66608;}i:66569;a:1:{i:0;i:66609;}i:66570;a:1:{i:0;i:66610;}i:66571;a:1:{i:0;i:66611;}i:66572;a:1:{i:0;i:66612;}i:66573;a:1:{i:0;i:66613;}i:66574;a:1:{i:0;i:66614;}i:66575;a:1:{i:0;i:66615;}i:66576;a:1:{i:0;i:66616;}i:66577;a:1:{i:0;i:66617;}i:66578;a:1:{i:0;i:66618;}i:66579;a:1:{i:0;i:66619;}i:66580;a:1:{i:0;i:66620;}i:66581;a:1:{i:0;i:66621;}i:66582;a:1:{i:0;i:66622;}i:66583;a:1:{i:0;i:66623;}i:66584;a:1:{i:0;i:66624;}i:66585;a:1:{i:0;i:66625;}i:66586;a:1:{i:0;i:66626;}i:66587;a:1:{i:0;i:66627;}i:66588;a:1:{i:0;i:66628;}i:66589;a:1:{i:0;i:66629;}i:66590;a:1:{i:0;i:66630;}i:66591;a:1:{i:0;i:66631;}i:66592;a:1:{i:0;i:66632;}i:66593;a:1:{i:0;i:66633;}i:66594;a:1:{i:0;i:66634;}i:66595;a:1:{i:0;i:66635;}i:66596;a:1:{i:0;i:66636;}i:66597;a:1:{i:0;i:66637;}i:119808;a:1:{i:0;i:97;}i:119809;a:1:{i:0;i:98;}i:119810;a:1:{i:0;i:99;}i:119811;a:1:{i:0;i:100;}i:119812;a:1:{i:0;i:101;}i:119813;a:1:{i:0;i:102;}i:119814;a:1:{i:0;i:103;}i:119815;a:1:{i:0;i:104;}i:119816;a:1:{i:0;i:105;}i:119817;a:1:{i:0;i:106;}i:119818;a:1:{i:0;i:107;}i:119819;a:1:{i:0;i:108;}i:119820;a:1:{i:0;i:109;}i:119821;a:1:{i:0;i:110;}i:119822;a:1:{i:0;i:111;}i:119823;a:1:{i:0;i:112;}i:119824;a:1:{i:0;i:113;}i:119825;a:1:{i:0;i:114;}i:119826;a:1:{i:0;i:115;}i:119827;a:1:{i:0;i:116;}i:119828;a:1:{i:0;i:117;}i:119829;a:1:{i:0;i:118;}i:119830;a:1:{i:0;i:119;}i:119831;a:1:{i:0;i:120;}i:119832;a:1:{i:0;i:121;}i:119833;a:1:{i:0;i:122;}i:119860;a:1:{i:0;i:97;}i:119861;a:1:{i:0;i:98;}i:119862;a:1:{i:0;i:99;}i:119863;a:1:{i:0;i:100;}i:119864;a:1:{i:0;i:101;}i:119865;a:1:{i:0;i:102;}i:119866;a:1:{i:0;i:103;}i:119867;a:1:{i:0;i:104;}i:119868;a:1:{i:0;i:105;}i:119869;a:1:{i:0;i:106;}i:119870;a:1:{i:0;i:107;}i:119871;a:1:{i:0;i:108;}i:119872;a:1:{i:0;i:109;}i:119873;a:1:{i:0;i:110;}i:119874;a:1:{i:0;i:111;}i:119875;a:1:{i:0;i:112;}i:119876;a:1:{i:0;i:113;}i:119877;a:1:{i:0;i:114;}i:119878;a:1:{i:0;i:115;}i:119879;a:1:{i:0;i:116;}i:119880;a:1:{i:0;i:117;}i:119881;a:1:{i:0;i:118;}i:119882;a:1:{i:0;i:119;}i:119883;a:1:{i:0;i:120;}i:119884;a:1:{i:0;i:121;}i:119885;a:1:{i:0;i:122;}i:119912;a:1:{i:0;i:97;}i:119913;a:1:{i:0;i:98;}i:119914;a:1:{i:0;i:99;}i:119915;a:1:{i:0;i:100;}i:119916;a:1:{i:0;i:101;}i:119917;a:1:{i:0;i:102;}i:119918;a:1:{i:0;i:103;}i:119919;a:1:{i:0;i:104;}i:119920;a:1:{i:0;i:105;}i:119921;a:1:{i:0;i:106;}i:119922;a:1:{i:0;i:107;}i:119923;a:1:{i:0;i:108;}i:119924;a:1:{i:0;i:109;}i:119925;a:1:{i:0;i:110;}i:119926;a:1:{i:0;i:111;}i:119927;a:1:{i:0;i:112;}i:119928;a:1:{i:0;i:113;}i:119929;a:1:{i:0;i:114;}i:119930;a:1:{i:0;i:115;}i:119931;a:1:{i:0;i:116;}i:119932;a:1:{i:0;i:117;}i:119933;a:1:{i:0;i:118;}i:119934;a:1:{i:0;i:119;}i:119935;a:1:{i:0;i:120;}i:119936;a:1:{i:0;i:121;}i:119937;a:1:{i:0;i:122;}i:119964;a:1:{i:0;i:97;}i:119966;a:1:{i:0;i:99;}i:119967;a:1:{i:0;i:100;}i:119970;a:1:{i:0;i:103;}i:119973;a:1:{i:0;i:106;}i:119974;a:1:{i:0;i:107;}i:119977;a:1:{i:0;i:110;}i:119978;a:1:{i:0;i:111;}i:119979;a:1:{i:0;i:112;}i:119980;a:1:{i:0;i:113;}i:119982;a:1:{i:0;i:115;}i:119983;a:1:{i:0;i:116;}i:119984;a:1:{i:0;i:117;}i:119985;a:1:{i:0;i:118;}i:119986;a:1:{i:0;i:119;}i:119987;a:1:{i:0;i:120;}i:119988;a:1:{i:0;i:121;}i:119989;a:1:{i:0;i:122;}i:120016;a:1:{i:0;i:97;}i:120017;a:1:{i:0;i:98;}i:120018;a:1:{i:0;i:99;}i:120019;a:1:{i:0;i:100;}i:120020;a:1:{i:0;i:101;}i:120021;a:1:{i:0;i:102;}i:120022;a:1:{i:0;i:103;}i:120023;a:1:{i:0;i:104;}i:120024;a:1:{i:0;i:105;}i:120025;a:1:{i:0;i:106;}i:120026;a:1:{i:0;i:107;}i:120027;a:1:{i:0;i:108;}i:120028;a:1:{i:0;i:109;}i:120029;a:1:{i:0;i:110;}i:120030;a:1:{i:0;i:111;}i:120031;a:1:{i:0;i:112;}i:120032;a:1:{i:0;i:113;}i:120033;a:1:{i:0;i:114;}i:120034;a:1:{i:0;i:115;}i:120035;a:1:{i:0;i:116;}i:120036;a:1:{i:0;i:117;}i:120037;a:1:{i:0;i:118;}i:120038;a:1:{i:0;i:119;}i:120039;a:1:{i:0;i:120;}i:120040;a:1:{i:0;i:121;}i:120041;a:1:{i:0;i:122;}i:120068;a:1:{i:0;i:97;}i:120069;a:1:{i:0;i:98;}i:120071;a:1:{i:0;i:100;}i:120072;a:1:{i:0;i:101;}i:120073;a:1:{i:0;i:102;}i:120074;a:1:{i:0;i:103;}i:120077;a:1:{i:0;i:106;}i:120078;a:1:{i:0;i:107;}i:120079;a:1:{i:0;i:108;}i:120080;a:1:{i:0;i:109;}i:120081;a:1:{i:0;i:110;}i:120082;a:1:{i:0;i:111;}i:120083;a:1:{i:0;i:112;}i:120084;a:1:{i:0;i:113;}i:120086;a:1:{i:0;i:115;}i:120087;a:1:{i:0;i:116;}i:120088;a:1:{i:0;i:117;}i:120089;a:1:{i:0;i:118;}i:120090;a:1:{i:0;i:119;}i:120091;a:1:{i:0;i:120;}i:120092;a:1:{i:0;i:121;}i:120120;a:1:{i:0;i:97;}i:120121;a:1:{i:0;i:98;}i:120123;a:1:{i:0;i:100;}i:120124;a:1:{i:0;i:101;}i:120125;a:1:{i:0;i:102;}i:120126;a:1:{i:0;i:103;}i:120128;a:1:{i:0;i:105;}i:120129;a:1:{i:0;i:106;}i:120130;a:1:{i:0;i:107;}i:120131;a:1:{i:0;i:108;}i:120132;a:1:{i:0;i:109;}i:120134;a:1:{i:0;i:111;}i:120138;a:1:{i:0;i:115;}i:120139;a:1:{i:0;i:116;}i:120140;a:1:{i:0;i:117;}i:120141;a:1:{i:0;i:118;}i:120142;a:1:{i:0;i:119;}i:120143;a:1:{i:0;i:120;}i:120144;a:1:{i:0;i:121;}i:120172;a:1:{i:0;i:97;}i:120173;a:1:{i:0;i:98;}i:120174;a:1:{i:0;i:99;}i:120175;a:1:{i:0;i:100;}i:120176;a:1:{i:0;i:101;}i:120177;a:1:{i:0;i:102;}i:120178;a:1:{i:0;i:103;}i:120179;a:1:{i:0;i:104;}i:120180;a:1:{i:0;i:105;}i:120181;a:1:{i:0;i:106;}i:120182;a:1:{i:0;i:107;}i:120183;a:1:{i:0;i:108;}i:120184;a:1:{i:0;i:109;}i:120185;a:1:{i:0;i:110;}i:120186;a:1:{i:0;i:111;}i:120187;a:1:{i:0;i:112;}i:120188;a:1:{i:0;i:113;}i:120189;a:1:{i:0;i:114;}i:120190;a:1:{i:0;i:115;}i:120191;a:1:{i:0;i:116;}i:120192;a:1:{i:0;i:117;}i:120193;a:1:{i:0;i:118;}i:120194;a:1:{i:0;i:119;}i:120195;a:1:{i:0;i:120;}i:120196;a:1:{i:0;i:121;}i:120197;a:1:{i:0;i:122;}i:120224;a:1:{i:0;i:97;}i:120225;a:1:{i:0;i:98;}i:120226;a:1:{i:0;i:99;}i:120227;a:1:{i:0;i:100;}i:120228;a:1:{i:0;i:101;}i:120229;a:1:{i:0;i:102;}i:120230;a:1:{i:0;i:103;}i:120231;a:1:{i:0;i:104;}i:120232;a:1:{i:0;i:105;}i:120233;a:1:{i:0;i:106;}i:120234;a:1:{i:0;i:107;}i:120235;a:1:{i:0;i:108;}i:120236;a:1:{i:0;i:109;}i:120237;a:1:{i:0;i:110;}i:120238;a:1:{i:0;i:111;}i:120239;a:1:{i:0;i:112;}i:120240;a:1:{i:0;i:113;}i:120241;a:1:{i:0;i:114;}i:120242;a:1:{i:0;i:115;}i:120243;a:1:{i:0;i:116;}i:120244;a:1:{i:0;i:117;}i:120245;a:1:{i:0;i:118;}i:120246;a:1:{i:0;i:119;}i:120247;a:1:{i:0;i:120;}i:120248;a:1:{i:0;i:121;}i:120249;a:1:{i:0;i:122;}i:120276;a:1:{i:0;i:97;}i:120277;a:1:{i:0;i:98;}i:120278;a:1:{i:0;i:99;}i:120279;a:1:{i:0;i:100;}i:120280;a:1:{i:0;i:101;}i:120281;a:1:{i:0;i:102;}i:120282;a:1:{i:0;i:103;}i:120283;a:1:{i:0;i:104;}i:120284;a:1:{i:0;i:105;}i:120285;a:1:{i:0;i:106;}i:120286;a:1:{i:0;i:107;}i:120287;a:1:{i:0;i:108;}i:120288;a:1:{i:0;i:109;}i:120289;a:1:{i:0;i:110;}i:120290;a:1:{i:0;i:111;}i:120291;a:1:{i:0;i:112;}i:120292;a:1:{i:0;i:113;}i:120293;a:1:{i:0;i:114;}i:120294;a:1:{i:0;i:115;}i:120295;a:1:{i:0;i:116;}i:120296;a:1:{i:0;i:117;}i:120297;a:1:{i:0;i:118;}i:120298;a:1:{i:0;i:119;}i:120299;a:1:{i:0;i:120;}i:120300;a:1:{i:0;i:121;}i:120301;a:1:{i:0;i:122;}i:120328;a:1:{i:0;i:97;}i:120329;a:1:{i:0;i:98;}i:120330;a:1:{i:0;i:99;}i:120331;a:1:{i:0;i:100;}i:120332;a:1:{i:0;i:101;}i:120333;a:1:{i:0;i:102;}i:120334;a:1:{i:0;i:103;}i:120335;a:1:{i:0;i:104;}i:120336;a:1:{i:0;i:105;}i:120337;a:1:{i:0;i:106;}i:120338;a:1:{i:0;i:107;}i:120339;a:1:{i:0;i:108;}i:120340;a:1:{i:0;i:109;}i:120341;a:1:{i:0;i:110;}i:120342;a:1:{i:0;i:111;}i:120343;a:1:{i:0;i:112;}i:120344;a:1:{i:0;i:113;}i:120345;a:1:{i:0;i:114;}i:120346;a:1:{i:0;i:115;}i:120347;a:1:{i:0;i:116;}i:120348;a:1:{i:0;i:117;}i:120349;a:1:{i:0;i:118;}i:120350;a:1:{i:0;i:119;}i:120351;a:1:{i:0;i:120;}i:120352;a:1:{i:0;i:121;}i:120353;a:1:{i:0;i:122;}i:120380;a:1:{i:0;i:97;}i:120381;a:1:{i:0;i:98;}i:120382;a:1:{i:0;i:99;}i:120383;a:1:{i:0;i:100;}i:120384;a:1:{i:0;i:101;}i:120385;a:1:{i:0;i:102;}i:120386;a:1:{i:0;i:103;}i:120387;a:1:{i:0;i:104;}i:120388;a:1:{i:0;i:105;}i:120389;a:1:{i:0;i:106;}i:120390;a:1:{i:0;i:107;}i:120391;a:1:{i:0;i:108;}i:120392;a:1:{i:0;i:109;}i:120393;a:1:{i:0;i:110;}i:120394;a:1:{i:0;i:111;}i:120395;a:1:{i:0;i:112;}i:120396;a:1:{i:0;i:113;}i:120397;a:1:{i:0;i:114;}i:120398;a:1:{i:0;i:115;}i:120399;a:1:{i:0;i:116;}i:120400;a:1:{i:0;i:117;}i:120401;a:1:{i:0;i:118;}i:120402;a:1:{i:0;i:119;}i:120403;a:1:{i:0;i:120;}i:120404;a:1:{i:0;i:121;}i:120405;a:1:{i:0;i:122;}i:120432;a:1:{i:0;i:97;}i:120433;a:1:{i:0;i:98;}i:120434;a:1:{i:0;i:99;}i:120435;a:1:{i:0;i:100;}i:120436;a:1:{i:0;i:101;}i:120437;a:1:{i:0;i:102;}i:120438;a:1:{i:0;i:103;}i:120439;a:1:{i:0;i:104;}i:120440;a:1:{i:0;i:105;}i:120441;a:1:{i:0;i:106;}i:120442;a:1:{i:0;i:107;}i:120443;a:1:{i:0;i:108;}i:120444;a:1:{i:0;i:109;}i:120445;a:1:{i:0;i:110;}i:120446;a:1:{i:0;i:111;}i:120447;a:1:{i:0;i:112;}i:120448;a:1:{i:0;i:113;}i:120449;a:1:{i:0;i:114;}i:120450;a:1:{i:0;i:115;}i:120451;a:1:{i:0;i:116;}i:120452;a:1:{i:0;i:117;}i:120453;a:1:{i:0;i:118;}i:120454;a:1:{i:0;i:119;}i:120455;a:1:{i:0;i:120;}i:120456;a:1:{i:0;i:121;}i:120457;a:1:{i:0;i:122;}i:120488;a:1:{i:0;i:945;}i:120489;a:1:{i:0;i:946;}i:120490;a:1:{i:0;i:947;}i:120491;a:1:{i:0;i:948;}i:120492;a:1:{i:0;i:949;}i:120493;a:1:{i:0;i:950;}i:120494;a:1:{i:0;i:951;}i:120495;a:1:{i:0;i:952;}i:120496;a:1:{i:0;i:953;}i:120497;a:1:{i:0;i:954;}i:120498;a:1:{i:0;i:955;}i:120499;a:1:{i:0;i:956;}i:120500;a:1:{i:0;i:957;}i:120501;a:1:{i:0;i:958;}i:120502;a:1:{i:0;i:959;}i:120503;a:1:{i:0;i:960;}i:120504;a:1:{i:0;i:961;}i:120505;a:1:{i:0;i:952;}i:120506;a:1:{i:0;i:963;}i:120507;a:1:{i:0;i:964;}i:120508;a:1:{i:0;i:965;}i:120509;a:1:{i:0;i:966;}i:120510;a:1:{i:0;i:967;}i:120511;a:1:{i:0;i:968;}i:120512;a:1:{i:0;i:969;}i:120531;a:1:{i:0;i:963;}i:120546;a:1:{i:0;i:945;}i:120547;a:1:{i:0;i:946;}i:120548;a:1:{i:0;i:947;}i:120549;a:1:{i:0;i:948;}i:120550;a:1:{i:0;i:949;}i:120551;a:1:{i:0;i:950;}i:120552;a:1:{i:0;i:951;}i:120553;a:1:{i:0;i:952;}i:120554;a:1:{i:0;i:953;}i:120555;a:1:{i:0;i:954;}i:120556;a:1:{i:0;i:955;}i:120557;a:1:{i:0;i:956;}i:120558;a:1:{i:0;i:957;}i:120559;a:1:{i:0;i:958;}i:120560;a:1:{i:0;i:959;}i:120561;a:1:{i:0;i:960;}i:120562;a:1:{i:0;i:961;}i:120563;a:1:{i:0;i:952;}i:120564;a:1:{i:0;i:963;}i:120565;a:1:{i:0;i:964;}i:120566;a:1:{i:0;i:965;}i:120567;a:1:{i:0;i:966;}i:120568;a:1:{i:0;i:967;}i:120569;a:1:{i:0;i:968;}i:120570;a:1:{i:0;i:969;}i:120589;a:1:{i:0;i:963;}i:120604;a:1:{i:0;i:945;}i:120605;a:1:{i:0;i:946;}i:120606;a:1:{i:0;i:947;}i:120607;a:1:{i:0;i:948;}i:120608;a:1:{i:0;i:949;}i:120609;a:1:{i:0;i:950;}i:120610;a:1:{i:0;i:951;}i:120611;a:1:{i:0;i:952;}i:120612;a:1:{i:0;i:953;}i:120613;a:1:{i:0;i:954;}i:120614;a:1:{i:0;i:955;}i:120615;a:1:{i:0;i:956;}i:120616;a:1:{i:0;i:957;}i:120617;a:1:{i:0;i:958;}i:120618;a:1:{i:0;i:959;}i:120619;a:1:{i:0;i:960;}i:120620;a:1:{i:0;i:961;}i:120621;a:1:{i:0;i:952;}i:120622;a:1:{i:0;i:963;}i:120623;a:1:{i:0;i:964;}i:120624;a:1:{i:0;i:965;}i:120625;a:1:{i:0;i:966;}i:120626;a:1:{i:0;i:967;}i:120627;a:1:{i:0;i:968;}i:120628;a:1:{i:0;i:969;}i:120647;a:1:{i:0;i:963;}i:120662;a:1:{i:0;i:945;}i:120663;a:1:{i:0;i:946;}i:120664;a:1:{i:0;i:947;}i:120665;a:1:{i:0;i:948;}i:120666;a:1:{i:0;i:949;}i:120667;a:1:{i:0;i:950;}i:120668;a:1:{i:0;i:951;}i:120669;a:1:{i:0;i:952;}i:120670;a:1:{i:0;i:953;}i:120671;a:1:{i:0;i:954;}i:120672;a:1:{i:0;i:955;}i:120673;a:1:{i:0;i:956;}i:120674;a:1:{i:0;i:957;}i:120675;a:1:{i:0;i:958;}i:120676;a:1:{i:0;i:959;}i:120677;a:1:{i:0;i:960;}i:120678;a:1:{i:0;i:961;}i:120679;a:1:{i:0;i:952;}i:120680;a:1:{i:0;i:963;}i:120681;a:1:{i:0;i:964;}i:120682;a:1:{i:0;i:965;}i:120683;a:1:{i:0;i:966;}i:120684;a:1:{i:0;i:967;}i:120685;a:1:{i:0;i:968;}i:120686;a:1:{i:0;i:969;}i:120705;a:1:{i:0;i:963;}i:120720;a:1:{i:0;i:945;}i:120721;a:1:{i:0;i:946;}i:120722;a:1:{i:0;i:947;}i:120723;a:1:{i:0;i:948;}i:120724;a:1:{i:0;i:949;}i:120725;a:1:{i:0;i:950;}i:120726;a:1:{i:0;i:951;}i:120727;a:1:{i:0;i:952;}i:120728;a:1:{i:0;i:953;}i:120729;a:1:{i:0;i:954;}i:120730;a:1:{i:0;i:955;}i:120731;a:1:{i:0;i:956;}i:120732;a:1:{i:0;i:957;}i:120733;a:1:{i:0;i:958;}i:120734;a:1:{i:0;i:959;}i:120735;a:1:{i:0;i:960;}i:120736;a:1:{i:0;i:961;}i:120737;a:1:{i:0;i:952;}i:120738;a:1:{i:0;i:963;}i:120739;a:1:{i:0;i:964;}i:120740;a:1:{i:0;i:965;}i:120741;a:1:{i:0;i:966;}i:120742;a:1:{i:0;i:967;}i:120743;a:1:{i:0;i:968;}i:120744;a:1:{i:0;i:969;}i:120763;a:1:{i:0;i:963;}i:1017;a:1:{i:0;i:963;}i:7468;a:1:{i:0;i:97;}i:7469;a:1:{i:0;i:230;}i:7470;a:1:{i:0;i:98;}i:7472;a:1:{i:0;i:100;}i:7473;a:1:{i:0;i:101;}i:7474;a:1:{i:0;i:477;}i:7475;a:1:{i:0;i:103;}i:7476;a:1:{i:0;i:104;}i:7477;a:1:{i:0;i:105;}i:7478;a:1:{i:0;i:106;}i:7479;a:1:{i:0;i:107;}i:7480;a:1:{i:0;i:108;}i:7481;a:1:{i:0;i:109;}i:7482;a:1:{i:0;i:110;}i:7484;a:1:{i:0;i:111;}i:7485;a:1:{i:0;i:547;}i:7486;a:1:{i:0;i:112;}i:7487;a:1:{i:0;i:114;}i:7488;a:1:{i:0;i:116;}i:7489;a:1:{i:0;i:117;}i:7490;a:1:{i:0;i:119;}i:8507;a:3:{i:0;i:102;i:1;i:97;i:2;i:120;}i:12880;a:3:{i:0;i:112;i:1;i:116;i:2;i:101;}i:13004;a:2:{i:0;i:104;i:1;i:103;}i:13006;a:2:{i:0;i:101;i:1;i:118;}i:13007;a:3:{i:0;i:108;i:1;i:116;i:2;i:100;}i:13178;a:2:{i:0;i:105;i:1;i:117;}i:13278;a:3:{i:0;i:118;i:1;i:8725;i:2;i:109;}i:13279;a:3:{i:0;i:97;i:1;i:8725;i:2;i:109;}}s:12:"norm_combcls";a:341:{i:820;i:1;i:821;i:1;i:822;i:1;i:823;i:1;i:824;i:1;i:2364;i:7;i:2492;i:7;i:2620;i:7;i:2748;i:7;i:2876;i:7;i:3260;i:7;i:4151;i:7;i:12441;i:8;i:12442;i:8;i:2381;i:9;i:2509;i:9;i:2637;i:9;i:2765;i:9;i:2893;i:9;i:3021;i:9;i:3149;i:9;i:3277;i:9;i:3405;i:9;i:3530;i:9;i:3642;i:9;i:3972;i:9;i:4153;i:9;i:5908;i:9;i:5940;i:9;i:6098;i:9;i:1456;i:10;i:1457;i:11;i:1458;i:12;i:1459;i:13;i:1460;i:14;i:1461;i:15;i:1462;i:16;i:1463;i:17;i:1464;i:18;i:1465;i:19;i:1467;i:20;i:1468;i:21;i:1469;i:22;i:1471;i:23;i:1473;i:24;i:1474;i:25;i:64286;i:26;i:1611;i:27;i:1612;i:28;i:1613;i:29;i:1614;i:30;i:1615;i:31;i:1616;i:32;i:1617;i:33;i:1618;i:34;i:1648;i:35;i:1809;i:36;i:3157;i:84;i:3158;i:91;i:3640;i:103;i:3641;i:103;i:3656;i:107;i:3657;i:107;i:3658;i:107;i:3659;i:107;i:3768;i:118;i:3769;i:118;i:3784;i:122;i:3785;i:122;i:3786;i:122;i:3787;i:122;i:3953;i:129;i:3954;i:130;i:3962;i:130;i:3963;i:130;i:3964;i:130;i:3965;i:130;i:3968;i:130;i:3956;i:132;i:801;i:202;i:802;i:202;i:807;i:202;i:808;i:202;i:795;i:216;i:3897;i:216;i:119141;i:216;i:119142;i:216;i:119150;i:216;i:119151;i:216;i:119152;i:216;i:119153;i:216;i:119154;i:216;i:12330;i:218;i:790;i:220;i:791;i:220;i:792;i:220;i:793;i:220;i:796;i:220;i:797;i:220;i:798;i:220;i:799;i:220;i:800;i:220;i:803;i:220;i:804;i:220;i:805;i:220;i:806;i:220;i:809;i:220;i:810;i:220;i:811;i:220;i:812;i:220;i:813;i:220;i:814;i:220;i:815;i:220;i:816;i:220;i:817;i:220;i:818;i:220;i:819;i:220;i:825;i:220;i:826;i:220;i:827;i:220;i:828;i:220;i:839;i:220;i:840;i:220;i:841;i:220;i:845;i:220;i:846;i:220;i:851;i:220;i:852;i:220;i:853;i:220;i:854;i:220;i:1425;i:220;i:1430;i:220;i:1435;i:220;i:1443;i:220;i:1444;i:220;i:1445;i:220;i:1446;i:220;i:1447;i:220;i:1450;i:220;i:1621;i:220;i:1622;i:220;i:1763;i:220;i:1770;i:220;i:1773;i:220;i:1841;i:220;i:1844;i:220;i:1847;i:220;i:1848;i:220;i:1849;i:220;i:1851;i:220;i:1852;i:220;i:1854;i:220;i:1858;i:220;i:1860;i:220;i:1862;i:220;i:1864;i:220;i:2386;i:220;i:3864;i:220;i:3865;i:220;i:3893;i:220;i:3895;i:220;i:4038;i:220;i:6459;i:220;i:8424;i:220;i:119163;i:220;i:119164;i:220;i:119165;i:220;i:119166;i:220;i:119167;i:220;i:119168;i:220;i:119169;i:220;i:119170;i:220;i:119178;i:220;i:119179;i:220;i:1434;i:222;i:1453;i:222;i:6441;i:222;i:12333;i:222;i:12334;i:224;i:12335;i:224;i:119149;i:226;i:1454;i:228;i:6313;i:228;i:12331;i:228;i:768;i:230;i:769;i:230;i:770;i:230;i:771;i:230;i:772;i:230;i:773;i:230;i:774;i:230;i:775;i:230;i:776;i:230;i:777;i:230;i:778;i:230;i:779;i:230;i:780;i:230;i:781;i:230;i:782;i:230;i:783;i:230;i:784;i:230;i:785;i:230;i:786;i:230;i:787;i:230;i:788;i:230;i:829;i:230;i:830;i:230;i:831;i:230;i:832;i:230;i:833;i:230;i:834;i:230;i:835;i:230;i:836;i:230;i:838;i:230;i:842;i:230;i:843;i:230;i:844;i:230;i:848;i:230;i:849;i:230;i:850;i:230;i:855;i:230;i:867;i:230;i:868;i:230;i:869;i:230;i:870;i:230;i:871;i:230;i:872;i:230;i:873;i:230;i:874;i:230;i:875;i:230;i:876;i:230;i:877;i:230;i:878;i:230;i:879;i:230;i:1155;i:230;i:1156;i:230;i:1157;i:230;i:1158;i:230;i:1426;i:230;i:1427;i:230;i:1428;i:230;i:1429;i:230;i:1431;i:230;i:1432;i:230;i:1433;i:230;i:1436;i:230;i:1437;i:230;i:1438;i:230;i:1439;i:230;i:1440;i:230;i:1441;i:230;i:1448;i:230;i:1449;i:230;i:1451;i:230;i:1452;i:230;i:1455;i:230;i:1476;i:230;i:1552;i:230;i:1553;i:230;i:1554;i:230;i:1555;i:230;i:1556;i:230;i:1557;i:230;i:1619;i:230;i:1620;i:230;i:1623;i:230;i:1624;i:230;i:1750;i:230;i:1751;i:230;i:1752;i:230;i:1753;i:230;i:1754;i:230;i:1755;i:230;i:1756;i:230;i:1759;i:230;i:1760;i:230;i:1761;i:230;i:1762;i:230;i:1764;i:230;i:1767;i:230;i:1768;i:230;i:1771;i:230;i:1772;i:230;i:1840;i:230;i:1842;i:230;i:1843;i:230;i:1845;i:230;i:1846;i:230;i:1850;i:230;i:1853;i:230;i:1855;i:230;i:1856;i:230;i:1857;i:230;i:1859;i:230;i:1861;i:230;i:1863;i:230;i:1865;i:230;i:1866;i:230;i:2385;i:230;i:2387;i:230;i:2388;i:230;i:3970;i:230;i:3971;i:230;i:3974;i:230;i:3975;i:230;i:5901;i:230;i:6458;i:230;i:8400;i:230;i:8401;i:230;i:8404;i:230;i:8405;i:230;i:8406;i:230;i:8407;i:230;i:8411;i:230;i:8412;i:230;i:8417;i:230;i:8423;i:230;i:8425;i:230;i:65056;i:230;i:65057;i:230;i:65058;i:230;i:65059;i:230;i:119173;i:230;i:119174;i:230;i:119175;i:230;i:119177;i:230;i:119176;i:230;i:119210;i:230;i:119211;i:230;i:119212;i:230;i:119213;i:230;i:789;i:232;i:794;i:232;i:12332;i:232;i:863;i:233;i:866;i:233;i:861;i:234;i:862;i:234;i:864;i:234;i:865;i:234;i:837;i:240;}}PK���\�g&��libraries/simplepie/LICENSE.txtnu�[���Copyright (c) 2004-2007, Ryan Parman and Geoffrey Sneddon. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the SimplePie Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.PK���\a��S�S�!libraries/simplepie/simplepie.phpnu�[���<?php /** * This file will be removed in Joomla! CMS version 4.0. Developers should either supply their own copy * in their installation packages or switch to JFeed. */ /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2009, Ryan Parman and Geoffrey Sneddon * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.2 * @copyright 2004-2009 Ryan Parman, Geoffrey Sneddon * @author Ryan Parman * @author Geoffrey Sneddon * @link http://simplepie.org/ SimplePie * @link http://simplepie.org/support/ Please submit all bug reports and feature requests to the SimplePie forums * @license http://www.opensource.org/licenses/bsd-license.php BSD License * @todo phpDoc comments */ /** * SimplePie Name */ define('SIMPLEPIE_NAME', 'SimplePie'); /** * SimplePie Version */ define('SIMPLEPIE_VERSION', '1.2'); /** * SimplePie Build */ define('SIMPLEPIE_BUILD', '20090627192103'); /** * SimplePie Website URL */ define('SIMPLEPIE_URL', 'http://simplepie.org'); /** * SimplePie Useragent * @see SimplePie::set_useragent() */ define('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION . ' (Feed Parser; ' . SIMPLEPIE_URL . '; Allow like Gecko) Build/' . SIMPLEPIE_BUILD); /** * SimplePie Linkback */ define('SIMPLEPIE_LINKBACK', '<a href="' . SIMPLEPIE_URL . '" title="' . SIMPLEPIE_NAME . ' ' . SIMPLEPIE_VERSION . '">' . SIMPLEPIE_NAME . '</a>'); /** * No Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_NONE', 0); /** * Feed Link Element Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_AUTODISCOVERY', 1); /** * Local Feed Extension Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_LOCAL_EXTENSION', 2); /** * Local Feed Body Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_LOCAL_BODY', 4); /** * Remote Feed Extension Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_REMOTE_EXTENSION', 8); /** * Remote Feed Body Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_REMOTE_BODY', 16); /** * All Feed Autodiscovery * @see SimplePie::set_autodiscovery_level() */ define('SIMPLEPIE_LOCATOR_ALL', 31); /** * No known feed type */ define('SIMPLEPIE_TYPE_NONE', 0); /** * RSS 0.90 */ define('SIMPLEPIE_TYPE_RSS_090', 1); /** * RSS 0.91 (Netscape) */ define('SIMPLEPIE_TYPE_RSS_091_NETSCAPE', 2); /** * RSS 0.91 (Userland) */ define('SIMPLEPIE_TYPE_RSS_091_USERLAND', 4); /** * RSS 0.91 (both Netscape and Userland) */ define('SIMPLEPIE_TYPE_RSS_091', 6); /** * RSS 0.92 */ define('SIMPLEPIE_TYPE_RSS_092', 8); /** * RSS 0.93 */ define('SIMPLEPIE_TYPE_RSS_093', 16); /** * RSS 0.94 */ define('SIMPLEPIE_TYPE_RSS_094', 32); /** * RSS 1.0 */ define('SIMPLEPIE_TYPE_RSS_10', 64); /** * RSS 2.0 */ define('SIMPLEPIE_TYPE_RSS_20', 128); /** * RDF-based RSS */ define('SIMPLEPIE_TYPE_RSS_RDF', 65); /** * Non-RDF-based RSS (truly intended as syndication format) */ define('SIMPLEPIE_TYPE_RSS_SYNDICATION', 190); /** * All RSS */ define('SIMPLEPIE_TYPE_RSS_ALL', 255); /** * Atom 0.3 */ define('SIMPLEPIE_TYPE_ATOM_03', 256); /** * Atom 1.0 */ define('SIMPLEPIE_TYPE_ATOM_10', 512); /** * All Atom */ define('SIMPLEPIE_TYPE_ATOM_ALL', 768); /** * All feed types */ define('SIMPLEPIE_TYPE_ALL', 1023); /** * No construct */ define('SIMPLEPIE_CONSTRUCT_NONE', 0); /** * Text construct */ define('SIMPLEPIE_CONSTRUCT_TEXT', 1); /** * HTML construct */ define('SIMPLEPIE_CONSTRUCT_HTML', 2); /** * XHTML construct */ define('SIMPLEPIE_CONSTRUCT_XHTML', 4); /** * base64-encoded construct */ define('SIMPLEPIE_CONSTRUCT_BASE64', 8); /** * IRI construct */ define('SIMPLEPIE_CONSTRUCT_IRI', 16); /** * A construct that might be HTML */ define('SIMPLEPIE_CONSTRUCT_MAYBE_HTML', 32); /** * All constructs */ define('SIMPLEPIE_CONSTRUCT_ALL', 63); /** * Don't change case */ define('SIMPLEPIE_SAME_CASE', 1); /** * Change to lowercase */ define('SIMPLEPIE_LOWERCASE', 2); /** * Change to uppercase */ define('SIMPLEPIE_UPPERCASE', 4); /** * PCRE for HTML attributes */ define('SIMPLEPIE_PCRE_HTML_ATTRIBUTE', '((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*'); /** * PCRE for XML attributes */ define('SIMPLEPIE_PCRE_XML_ATTRIBUTE', '((?:\s+(?:(?:[^\s:]+:)?[^\s:]+)\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\s*'); /** * XML Namespace */ define('SIMPLEPIE_NAMESPACE_XML', 'http://www.w3.org/XML/1998/namespace'); /** * Atom 1.0 Namespace */ define('SIMPLEPIE_NAMESPACE_ATOM_10', 'http://www.w3.org/2005/Atom'); /** * Atom 0.3 Namespace */ define('SIMPLEPIE_NAMESPACE_ATOM_03', 'http://purl.org/atom/ns#'); /** * RDF Namespace */ define('SIMPLEPIE_NAMESPACE_RDF', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); /** * RSS 0.90 Namespace */ define('SIMPLEPIE_NAMESPACE_RSS_090', 'http://my.netscape.com/rdf/simple/0.9/'); /** * RSS 1.0 Namespace */ define('SIMPLEPIE_NAMESPACE_RSS_10', 'http://purl.org/rss/1.0/'); /** * RSS 1.0 Content Module Namespace */ define('SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT', 'http://purl.org/rss/1.0/modules/content/'); /** * RSS 2.0 Namespace * (Stupid, I know, but I'm certain it will confuse people less with support.) */ define('SIMPLEPIE_NAMESPACE_RSS_20', ''); /** * DC 1.0 Namespace */ define('SIMPLEPIE_NAMESPACE_DC_10', 'http://purl.org/dc/elements/1.0/'); /** * DC 1.1 Namespace */ define('SIMPLEPIE_NAMESPACE_DC_11', 'http://purl.org/dc/elements/1.1/'); /** * W3C Basic Geo (WGS84 lat/long) Vocabulary Namespace */ define('SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO', 'http://www.w3.org/2003/01/geo/wgs84_pos#'); /** * GeoRSS Namespace */ define('SIMPLEPIE_NAMESPACE_GEORSS', 'http://www.georss.org/georss'); /** * Media RSS Namespace */ define('SIMPLEPIE_NAMESPACE_MEDIARSS', 'http://search.yahoo.com/mrss/'); /** * Wrong Media RSS Namespace */ define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG', 'http://search.yahoo.com/mrss'); /** * iTunes RSS Namespace */ define('SIMPLEPIE_NAMESPACE_ITUNES', 'http://www.itunes.com/dtds/podcast-1.0.dtd'); /** * XHTML Namespace */ define('SIMPLEPIE_NAMESPACE_XHTML', 'http://www.w3.org/1999/xhtml'); /** * IANA Link Relations Registry */ define('SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY', 'http://www.iana.org/assignments/relation/'); /** * Whether we're running on PHP5 */ define('SIMPLEPIE_PHP5', version_compare(PHP_VERSION, '5.0.0', '>=')); /** * No file source */ define('SIMPLEPIE_FILE_SOURCE_NONE', 0); /** * Remote file source */ define('SIMPLEPIE_FILE_SOURCE_REMOTE', 1); /** * Local file source */ define('SIMPLEPIE_FILE_SOURCE_LOCAL', 2); /** * fsockopen() file source */ define('SIMPLEPIE_FILE_SOURCE_FSOCKOPEN', 4); /** * cURL file source */ define('SIMPLEPIE_FILE_SOURCE_CURL', 8); /** * file_get_contents() file source */ define('SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS', 16); /** * SimplePie * * @package SimplePie */ class SimplePie { /** * @var array Raw data * @access private */ var $data = array(); /** * @var mixed Error string * @access private */ var $error; /** * @var object Instance of SimplePie_Sanitize (or other class) * @see SimplePie::set_sanitize_class() * @access private */ var $sanitize; /** * @var string SimplePie Useragent * @see SimplePie::set_useragent() * @access private */ var $useragent = SIMPLEPIE_USERAGENT; /** * @var string Feed URL * @see SimplePie::set_feed_url() * @access private */ var $feed_url; /** * @var object Instance of SimplePie_File to use as a feed * @see SimplePie::set_file() * @access private */ var $file; /** * @var string Raw feed data * @see SimplePie::set_raw_data() * @access private */ var $raw_data; /** * @var int Timeout for fetching remote files * @see SimplePie::set_timeout() * @access private */ var $timeout = 10; /** * @var bool Forces fsockopen() to be used for remote files instead * of cURL, even if a new enough version is installed * @see SimplePie::force_fsockopen() * @access private */ var $force_fsockopen = false; /** * @var bool Force the given data/URL to be treated as a feed no matter what * it appears like * @see SimplePie::force_feed() * @access private */ var $force_feed = false; /** * @var bool Enable/Disable XML dump * @see SimplePie::enable_xml_dump() * @access private */ var $xml_dump = false; /** * @var bool Enable/Disable Caching * @see SimplePie::enable_cache() * @access private */ var $cache = true; /** * @var int Cache duration (in seconds) * @see SimplePie::set_cache_duration() * @access private */ var $cache_duration = 3600; /** * @var int Auto-discovery cache duration (in seconds) * @see SimplePie::set_autodiscovery_cache_duration() * @access private */ var $autodiscovery_cache_duration = 604800; // 7 Days. /** * @var string Cache location (relative to executing script) * @see SimplePie::set_cache_location() * @access private */ var $cache_location = './cache'; /** * @var string Function that creates the cache filename * @see SimplePie::set_cache_name_function() * @access private */ var $cache_name_function = 'md5'; /** * @var bool Reorder feed by date descending * @see SimplePie::enable_order_by_date() * @access private */ var $order_by_date = true; /** * @var mixed Force input encoding to be set to the follow value * (false, or anything type-cast to false, disables this feature) * @see SimplePie::set_input_encoding() * @access private */ var $input_encoding = false; /** * @var int Feed Autodiscovery Level * @see SimplePie::set_autodiscovery_level() * @access private */ var $autodiscovery = SIMPLEPIE_LOCATOR_ALL; /** * @var string Class used for caching feeds * @see SimplePie::set_cache_class() * @access private */ var $cache_class = 'SimplePie_Cache'; /** * @var string Class used for locating feeds * @see SimplePie::set_locator_class() * @access private */ var $locator_class = 'SimplePie_Locator'; /** * @var string Class used for parsing feeds * @see SimplePie::set_parser_class() * @access private */ var $parser_class = 'SimplePie_Parser'; /** * @var string Class used for fetching feeds * @see SimplePie::set_file_class() * @access private */ var $file_class = 'SimplePie_File'; /** * @var string Class used for items * @see SimplePie::set_item_class() * @access private */ var $item_class = 'SimplePie_Item'; /** * @var string Class used for authors * @see SimplePie::set_author_class() * @access private */ var $author_class = 'SimplePie_Author'; /** * @var string Class used for categories * @see SimplePie::set_category_class() * @access private */ var $category_class = 'SimplePie_Category'; /** * @var string Class used for enclosures * @see SimplePie::set_enclosures_class() * @access private */ var $enclosure_class = 'SimplePie_Enclosure'; /** * @var string Class used for Media RSS <media:text> captions * @see SimplePie::set_caption_class() * @access private */ var $caption_class = 'SimplePie_Caption'; /** * @var string Class used for Media RSS <media:copyright> * @see SimplePie::set_copyright_class() * @access private */ var $copyright_class = 'SimplePie_Copyright'; /** * @var string Class used for Media RSS <media:credit> * @see SimplePie::set_credit_class() * @access private */ var $credit_class = 'SimplePie_Credit'; /** * @var string Class used for Media RSS <media:rating> * @see SimplePie::set_rating_class() * @access private */ var $rating_class = 'SimplePie_Rating'; /** * @var string Class used for Media RSS <media:restriction> * @see SimplePie::set_restriction_class() * @access private */ var $restriction_class = 'SimplePie_Restriction'; /** * @var string Class used for content-type sniffing * @see SimplePie::set_content_type_sniffer_class() * @access private */ var $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer'; /** * @var string Class used for item sources. * @see SimplePie::set_source_class() * @access private */ var $source_class = 'SimplePie_Source'; /** * @var mixed Set javascript query string parameter (false, or * anything type-cast to false, disables this feature) * @see SimplePie::set_javascript() * @access private */ var $javascript = 'js'; /** * @var int Maximum number of feeds to check with autodiscovery * @see SimplePie::set_max_checked_feeds() * @access private */ var $max_checked_feeds = 10; /** * @var array All the feeds found during the autodiscovery process * @see SimplePie::get_all_discovered_feeds() * @access private */ var $all_discovered_feeds = array(); /** * @var string Web-accessible path to the handler_favicon.php file. * @see SimplePie::set_favicon_handler() * @access private */ var $favicon_handler = ''; /** * @var string Web-accessible path to the handler_image.php file. * @see SimplePie::set_image_handler() * @access private */ var $image_handler = ''; /** * @var array Stores the URLs when multiple feeds are being initialized. * @see SimplePie::set_feed_url() * @access private */ var $multifeed_url = array(); /** * @var array Stores SimplePie objects when multiple feeds initialized. * @access private */ var $multifeed_objects = array(); /** * @var array Stores the get_object_vars() array for use with multifeeds. * @see SimplePie::set_feed_url() * @access private */ var $config_settings = null; /** * @var integer Stores the number of items to return per-feed with multifeeds. * @see SimplePie::set_item_limit() * @access private */ var $item_limit = 0; /** * @var array Stores the default attributes to be stripped by strip_attributes(). * @see SimplePie::strip_attributes() * @access private */ var $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'); /** * @var array Stores the default tags to be stripped by strip_htmltags(). * @see SimplePie::strip_htmltags() * @access private */ var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'); /** * The SimplePie class contains feed level data and options * * There are two ways that you can create a new SimplePie object. The first * is by passing a feed URL as a parameter to the SimplePie constructor * (as well as optionally setting the cache location and cache expiry). This * will initialise the whole feed with all of the default settings, and you * can begin accessing methods and properties immediately. * * The second way is to create the SimplePie object with no parameters * at all. This will enable you to set configuration options. After setting * them, you must initialise the feed using $feed->init(). At that point the * object's methods and properties will be available to you. This format is * what is used throughout this documentation. * * @access public * @since 1.0 Preview Release * @param string $feed_url This is the URL you want to parse. * @param string $cache_location This is where you want the cache to be stored. * @param int $cache_duration This is the number of seconds that you want to store the cache file for. */ function SimplePie($feed_url = null, $cache_location = null, $cache_duration = null) { // Other objects, instances created here so we can set options on them $this->sanitize = new SimplePie_Sanitize; // Set options if they're passed to the constructor if ($cache_location !== null) { $this->set_cache_location($cache_location); } if ($cache_duration !== null) { $this->set_cache_duration($cache_duration); } // Only init the script if we're passed a feed URL if ($feed_url !== null) { $this->set_feed_url($feed_url); $this->init(); } } /** * Used for converting object to a string */ function __toString() { return md5(serialize($this->data)); } /** * Remove items that link back to this before destroying this object */ function __destruct() { if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode')) { if (!empty($this->data['items'])) { foreach ($this->data['items'] as $item) { $item->__destruct(); } unset($item, $this->data['items']); } if (!empty($this->data['ordered_items'])) { foreach ($this->data['ordered_items'] as $item) { $item->__destruct(); } unset($item, $this->data['ordered_items']); } } } /** * Force the given data/URL to be treated as a feed no matter what it * appears like * * @access public * @since 1.1 * @param bool $enable Force the given data/URL to be treated as a feed */ function force_feed($enable = false) { $this->force_feed = (bool) $enable; } /** * This is the URL of the feed you want to parse. * * This allows you to enter the URL of the feed you want to parse, or the * website you want to try to use auto-discovery on. This takes priority * over any set raw data. * * You can set multiple feeds to mash together by passing an array instead * of a string for the $url. Remember that with each additional feed comes * additional processing and resources. * * @access public * @since 1.0 Preview Release * @param mixed $url This is the URL (or array of URLs) that you want to parse. * @see SimplePie::set_raw_data() */ function set_feed_url($url) { if (is_array($url)) { $this->multifeed_url = array(); foreach ($url as $value) { $this->multifeed_url[] = SimplePie_Misc::fix_protocol($value, 1); } } else { $this->feed_url = SimplePie_Misc::fix_protocol($url, 1); } } /** * Provides an instance of SimplePie_File to use as a feed * * @access public * @param object &$file Instance of SimplePie_File (or subclass) * @return bool True on success, false on failure */ function set_file(&$file) { if (is_a($file, 'SimplePie_File')) { $this->feed_url = $file->url; $this->file =& $file; return true; } return false; } /** * Allows you to use a string of RSS/Atom data instead of a remote feed. * * If you have a feed available as a string in PHP, you can tell SimplePie * to parse that data string instead of a remote feed. Any set feed URL * takes precedence. * * @access public * @since 1.0 Beta 3 * @param string $data RSS or Atom data as a string. * @see SimplePie::set_feed_url() */ function set_raw_data($data) { $this->raw_data = $data; } /** * Allows you to override the default timeout for fetching remote feeds. * * This allows you to change the maximum time the feed's server to respond * and send the feed back. * * @access public * @since 1.0 Beta 3 * @param int $timeout The maximum number of seconds to spend waiting to retrieve a feed. */ function set_timeout($timeout = 10) { $this->timeout = (int) $timeout; } /** * Forces SimplePie to use fsockopen() instead of the preferred cURL * functions. * * @access public * @since 1.0 Beta 3 * @param bool $enable Force fsockopen() to be used */ function force_fsockopen($enable = false) { $this->force_fsockopen = (bool) $enable; } /** * Outputs the raw XML content of the feed, after it has gone through * SimplePie's filters. * * Used only for debugging, this function will output the XML content as * text/xml. When SimplePie reads in a feed, it does a bit of cleaning up * before trying to parse it. Many parts of the feed are re-written in * memory, and in the end, you have a parsable feed. XML dump shows you the * actual XML that SimplePie tries to parse, which may or may not be very * different from the original feed. * * @access public * @since 1.0 Preview Release * @param bool $enable Enable XML dump */ function enable_xml_dump($enable = false) { $this->xml_dump = (bool) $enable; } /** * Enables/disables caching in SimplePie. * * This option allows you to disable caching all-together in SimplePie. * However, disabling the cache can lead to longer load times. * * @access public * @since 1.0 Preview Release * @param bool $enable Enable caching */ function enable_cache($enable = true) { $this->cache = (bool) $enable; } /** * Set the length of time (in seconds) that the contents of a feed * will be cached. * * @access public * @param int $seconds The feed content cache duration. */ function set_cache_duration($seconds = 3600) { $this->cache_duration = (int) $seconds; } /** * Set the length of time (in seconds) that the autodiscovered feed * URL will be cached. * * @access public * @param int $seconds The autodiscovered feed URL cache duration. */ function set_autodiscovery_cache_duration($seconds = 604800) { $this->autodiscovery_cache_duration = (int) $seconds; } /** * Set the file system location where the cached files should be stored. * * @access public * @param string $location The file system location. */ function set_cache_location($location = './cache') { $this->cache_location = (string) $location; } /** * Determines whether feed items should be sorted into reverse chronological order. * * @access public * @param bool $enable Sort as reverse chronological order. */ function enable_order_by_date($enable = true) { $this->order_by_date = (bool) $enable; } /** * Allows you to override the character encoding reported by the feed. * * @access public * @param string $encoding Character encoding. */ function set_input_encoding($encoding = false) { if ($encoding) { $this->input_encoding = (string) $encoding; } else { $this->input_encoding = false; } } /** * Set how much feed autodiscovery to do * * @access public * @see SIMPLEPIE_LOCATOR_NONE * @see SIMPLEPIE_LOCATOR_AUTODISCOVERY * @see SIMPLEPIE_LOCATOR_LOCAL_EXTENSION * @see SIMPLEPIE_LOCATOR_LOCAL_BODY * @see SIMPLEPIE_LOCATOR_REMOTE_EXTENSION * @see SIMPLEPIE_LOCATOR_REMOTE_BODY * @see SIMPLEPIE_LOCATOR_ALL * @param int $level Feed Autodiscovery Level (level can be a * combination of the above constants, see bitwise OR operator) */ function set_autodiscovery_level($level = SIMPLEPIE_LOCATOR_ALL) { $this->autodiscovery = (int) $level; } /** * Allows you to change which class SimplePie uses for caching. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_cache_class($class = 'SimplePie_Cache') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Cache')) { $this->cache_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for auto-discovery. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_locator_class($class = 'SimplePie_Locator') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Locator')) { $this->locator_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for XML parsing. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_parser_class($class = 'SimplePie_Parser') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Parser')) { $this->parser_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for remote file fetching. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_file_class($class = 'SimplePie_File') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_File')) { $this->file_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for data sanitization. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_sanitize_class($class = 'SimplePie_Sanitize') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Sanitize')) { $this->sanitize = new $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for handling feed items. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_item_class($class = 'SimplePie_Item') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Item')) { $this->item_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for handling author data. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_author_class($class = 'SimplePie_Author') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Author')) { $this->author_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for handling category data. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_category_class($class = 'SimplePie_Category') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Category')) { $this->category_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for feed enclosures. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_enclosure_class($class = 'SimplePie_Enclosure') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Enclosure')) { $this->enclosure_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for <media:text> captions * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_caption_class($class = 'SimplePie_Caption') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Caption')) { $this->caption_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for <media:copyright> * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_copyright_class($class = 'SimplePie_Copyright') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Copyright')) { $this->copyright_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for <media:credit> * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_credit_class($class = 'SimplePie_Credit') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Credit')) { $this->credit_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for <media:rating> * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_rating_class($class = 'SimplePie_Rating') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Rating')) { $this->rating_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for <media:restriction> * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_restriction_class($class = 'SimplePie_Restriction') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Restriction')) { $this->restriction_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses for content-type sniffing. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_content_type_sniffer_class($class = 'SimplePie_Content_Type_Sniffer') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Content_Type_Sniffer')) { $this->content_type_sniffer_class = $class; return true; } return false; } /** * Allows you to change which class SimplePie uses item sources. * Useful when you are overloading or extending SimplePie's default classes. * * @access public * @param string $class Name of custom class. * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation */ function set_source_class($class = 'SimplePie_Source') { if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Source')) { $this->source_class = $class; return true; } return false; } /** * Allows you to override the default user agent string. * * @access public * @param string $ua New user agent string. */ function set_useragent($ua = SIMPLEPIE_USERAGENT) { $this->useragent = (string) $ua; } /** * Set callback function to create cache filename with * * @access public * @param mixed $function Callback function */ function set_cache_name_function($function = 'md5') { if (is_callable($function)) { $this->cache_name_function = $function; } } /** * Set javascript query string parameter * * @access public * @param mixed $get Javascript query string parameter */ function set_javascript($get = 'js') { if ($get) { $this->javascript = (string) $get; } else { $this->javascript = false; } } /** * Set options to make SP as fast as possible. Forgoes a * substantial amount of data sanitization in favor of speed. * * @access public * @param bool $set Whether to set them or not */ function set_stupidly_fast($set = false) { if ($set) { $this->enable_order_by_date(false); $this->remove_div(false); $this->strip_comments(false); $this->strip_htmltags(false); $this->strip_attributes(false); $this->set_image_handler(false); } } /** * Set maximum number of feeds to check with autodiscovery * * @access public * @param int $max Maximum number of feeds to check */ function set_max_checked_feeds($max = 10) { $this->max_checked_feeds = (int) $max; } function remove_div($enable = true) { $this->sanitize->remove_div($enable); } function strip_htmltags($tags = '', $encode = null) { if ($tags === '') { $tags = $this->strip_htmltags; } $this->sanitize->strip_htmltags($tags); if ($encode !== null) { $this->sanitize->encode_instead_of_strip($tags); } } function encode_instead_of_strip($enable = true) { $this->sanitize->encode_instead_of_strip($enable); } function strip_attributes($attribs = '') { if ($attribs === '') { $attribs = $this->strip_attributes; } $this->sanitize->strip_attributes($attribs); } function set_output_encoding($encoding = 'UTF-8') { $this->sanitize->set_output_encoding($encoding); } function strip_comments($strip = false) { $this->sanitize->strip_comments($strip); } /** * Set element/attribute key/value pairs of HTML attributes * containing URLs that need to be resolved relative to the feed * * @access public * @since 1.0 * @param array $element_attribute Element/attribute key/value pairs */ function set_url_replacements($element_attribute = array('a' => 'href', 'area' => 'href', 'blockquote' => 'cite', 'del' => 'cite', 'form' => 'action', 'img' => array('longdesc', 'src'), 'input' => 'src', 'ins' => 'cite', 'q' => 'cite')) { $this->sanitize->set_url_replacements($element_attribute); } /** * Set the handler to enable the display of cached favicons. * * @access public * @param str $page Web-accessible path to the handler_favicon.php file. * @param str $qs The query string that the value should be passed to. */ function set_favicon_handler($page = false, $qs = 'i') { if ($page !== false) { $this->favicon_handler = $page . '?' . $qs . '='; } else { $this->favicon_handler = ''; } } /** * Set the handler to enable the display of cached images. * * @access public * @param str $page Web-accessible path to the handler_image.php file. * @param str $qs The query string that the value should be passed to. */ function set_image_handler($page = false, $qs = 'i') { if ($page !== false) { $this->sanitize->set_image_handler($page . '?' . $qs . '='); } else { $this->image_handler = ''; } } /** * Set the limit for items returned per-feed with multifeeds. * * @access public * @param integer $limit The maximum number of items to return. */ function set_item_limit($limit = 0) { $this->item_limit = (int) $limit; } function init() { // Check absolute bare minimum requirements. if ((function_exists('version_compare') && version_compare(PHP_VERSION, '4.3.0', '<')) || !extension_loaded('xml') || !extension_loaded('pcre')) { return false; } // Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader. elseif (!extension_loaded('xmlreader')) { static $xml_is_sane = null; if ($xml_is_sane === null) { $parser_check = xml_parser_create(); xml_parse_into_struct($parser_check, '<foo>&</foo>', $values); xml_parser_free($parser_check); $xml_is_sane = isset($values[0]['value']); } if (!$xml_is_sane) { return false; } } if (isset($_GET[$this->javascript])) { SimplePie_Misc::output_javascript(); exit; } // Pass whatever was set with config options over to the sanitizer. $this->sanitize->pass_cache_data($this->cache, $this->cache_location, $this->cache_name_function, $this->cache_class); $this->sanitize->pass_file_data($this->file_class, $this->timeout, $this->useragent, $this->force_fsockopen); if ($this->feed_url !== null || $this->raw_data !== null) { $this->data = array(); $this->multifeed_objects = array(); $cache = false; if ($this->feed_url !== null) { $parsed_feed_url = SimplePie_Misc::parse_url($this->feed_url); // Decide whether to enable caching if ($this->cache && $parsed_feed_url['scheme'] !== '') { $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc'); } // If it's enabled and we don't want an XML dump, use the cache if ($cache && !$this->xml_dump) { // Load the Cache $this->data = $cache->load(); if (!empty($this->data)) { // If the cache is for an outdated build of SimplePie if (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD) { $cache->unlink(); $this->data = array(); } // If we've hit a collision just rerun it with caching disabled elseif (isset($this->data['url']) && $this->data['url'] !== $this->feed_url) { $cache = false; $this->data = array(); } // If we've got a non feed_url stored (if the page isn't actually a feed, or is a redirect) use that URL. elseif (isset($this->data['feed_url'])) { // If the autodiscovery cache is still valid use it. if ($cache->mtime() + $this->autodiscovery_cache_duration > time()) { // Do not need to do feed autodiscovery yet. if ($this->data['feed_url'] === $this->data['url']) { $cache->unlink(); $this->data = array(); } else { $this->set_feed_url($this->data['feed_url']); return $this->init(); } } } // Check if the cache has been updated elseif ($cache->mtime() + $this->cache_duration < time()) { // If we have last-modified and/or etag set if (isset($this->data['headers']['last-modified']) || isset($this->data['headers']['etag'])) { $headers = array(); if (isset($this->data['headers']['last-modified'])) { $headers['if-modified-since'] = $this->data['headers']['last-modified']; } if (isset($this->data['headers']['etag'])) { $headers['if-none-match'] = '"' . $this->data['headers']['etag'] . '"'; } $file = new $this->file_class($this->feed_url, $this->timeout/10, 5, $headers, $this->useragent, $this->force_fsockopen); if ($file->success) { if ($file->status_code === 304) { $cache->touch(); return true; } else { $headers = $file->headers; } } else { unset($file); } } } // If the cache is still valid, just return true else { return true; } } // If the cache is empty, delete it else { $cache->unlink(); $this->data = array(); } } // If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it. if (!isset($file)) { if (is_a($this->file, 'SimplePie_File') && $this->file->url === $this->feed_url) { $file =& $this->file; } else { $file = new $this->file_class($this->feed_url, $this->timeout, 5, null, $this->useragent, $this->force_fsockopen); } } // If the file connection has an error, set SimplePie::error to that and quit if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) { $this->error = $file->error; if (!empty($this->data)) { return true; } else { return false; } } if (!$this->force_feed) { // Check if the supplied URL is a feed, if it isn't, look for it. $locate = new $this->locator_class($file, $this->timeout, $this->useragent, $this->file_class, $this->max_checked_feeds, $this->content_type_sniffer_class); if (!$locate->is_feed($file)) { // We need to unset this so that if SimplePie::set_file() has been called that object is untouched unset($file); if ($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds)) { if ($cache) { $this->data = array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD); if (!$cache->save($this)) { trigger_error("$this->cache_location is not writeable", E_USER_WARNING); } $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc'); } $this->feed_url = $file->url; } else { $this->error = "A feed could not be found at $this->feed_url"; SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__); return false; } } $locate = null; } $headers = $file->headers; $data = $file->body; $sniffer = new $this->content_type_sniffer_class($file); $sniffed = $sniffer->get_type(); } else { $data = $this->raw_data; } // Set up array of possible encodings $encodings = array(); // First check to see if input has been overridden. if ($this->input_encoding !== false) { $encodings[] = $this->input_encoding; } $application_types = array('application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity'); $text_types = array('text/xml', 'text/xml-external-parsed-entity'); // RFC 3023 (only applies to sniffed content) if (isset($sniffed)) { if (in_array($sniffed, $application_types) || substr($sniffed, 0, 12) === 'application/' && substr($sniffed, -4) === '+xml') { if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) { $encodings[] = strtoupper($charset[1]); } $encodings = array_merge($encodings, SimplePie_Misc::xml_encoding($data)); $encodings[] = 'UTF-8'; } elseif (in_array($sniffed, $text_types) || substr($sniffed, 0, 5) === 'text/' && substr($sniffed, -4) === '+xml') { if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) { $encodings[] = $charset[1]; } $encodings[] = 'US-ASCII'; } // Text MIME-type default elseif (substr($sniffed, 0, 5) === 'text/') { $encodings[] = 'US-ASCII'; } } // Fallback to XML 1.0 Appendix F.1/UTF-8/ISO-8859-1 $encodings = array_merge($encodings, SimplePie_Misc::xml_encoding($data)); $encodings[] = 'UTF-8'; $encodings[] = 'ISO-8859-1'; // There's no point in trying an encoding twice $encodings = array_unique($encodings); // If we want the XML, just output that with the most likely encoding and quit if ($this->xml_dump) { header('Content-type: text/xml; charset=' . $encodings[0]); echo $data; exit; } // Loop through each possible encoding, till we return something, or run out of possibilities foreach ($encodings as $encoding) { // Change the encoding to UTF-8 (as we always use UTF-8 internally) if ($utf8_data = SimplePie_Misc::change_encoding($data, $encoding, 'UTF-8')) { // Create new parser $parser = new $this->parser_class(); // If it's parsed fine if ($parser->parse($utf8_data, 'UTF-8')) { $this->data = $parser->get_data(); if ($this->get_type() & ~SIMPLEPIE_TYPE_NONE) { if (isset($headers)) { $this->data['headers'] = $headers; } $this->data['build'] = SIMPLEPIE_BUILD; // Cache the file if caching is enabled if ($cache && !$cache->save($this)) { trigger_error("$cache->name is not writeable", E_USER_WARNING); } return true; } else { $this->error = "A feed could not be found at $this->feed_url"; SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__); return false; } } } } if(isset($parser)) { // We have an error, just set SimplePie_Misc::error to it and quit $this->error = sprintf('XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column()); } else { $this->error = 'The data could not be converted to UTF-8'; } SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__); return false; } elseif (!empty($this->multifeed_url)) { $i = 0; $success = 0; $this->multifeed_objects = array(); foreach ($this->multifeed_url as $url) { if (SIMPLEPIE_PHP5) { // This keyword needs to defy coding standards for PHP4 compatibility $this->multifeed_objects[$i] = clone($this); } else { $this->multifeed_objects[$i] = $this; } $this->multifeed_objects[$i]->set_feed_url($url); $success |= $this->multifeed_objects[$i]->init(); $i++; } return (bool) $success; } else { return false; } } /** * Return the error message for the occured error * * @access public * @return string Error message */ function error() { return $this->error; } function get_encoding() { return $this->sanitize->output_encoding; } function handle_content_type($mime = 'text/html') { if (!headers_sent()) { $header = "Content-type: $mime;"; if ($this->get_encoding()) { $header .= ' charset=' . $this->get_encoding(); } else { $header .= ' charset=UTF-8'; } header($header); } } function get_type() { if (!isset($this->data['type'])) { $this->data['type'] = SIMPLEPIE_TYPE_ALL; if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'])) { $this->data['type'] &= SIMPLEPIE_TYPE_ATOM_10; } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'])) { $this->data['type'] &= SIMPLEPIE_TYPE_ATOM_03; } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'])) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['channel']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['image']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['textinput'])) { $this->data['type'] &= SIMPLEPIE_TYPE_RSS_10; } if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['channel']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['image']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']) || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['textinput'])) { $this->data['type'] &= SIMPLEPIE_TYPE_RSS_090; } } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'])) { $this->data['type'] &= SIMPLEPIE_TYPE_RSS_ALL; if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version'])) { switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version'])) { case '0.91': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091; if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data'])) { switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data'])) { case '0': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_NETSCAPE; break; case '24': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_USERLAND; break; } } break; case '0.92': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_092; break; case '0.93': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_093; break; case '0.94': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_094; break; case '2.0': $this->data['type'] &= SIMPLEPIE_TYPE_RSS_20; break; } } } else { $this->data['type'] = SIMPLEPIE_TYPE_NONE; } } return $this->data['type']; } /** * Returns the URL for the favicon of the feed's website. * * @todo Cache atom:icon * @access public * @since 1.0 */ function get_favicon() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif (($url = $this->get_link()) !== null && preg_match('/^http(s)?:\/\//i', $url)) { $favicon = SimplePie_Misc::absolutize_url('/favicon.ico', $url); if ($this->cache && $this->favicon_handler) { $favicon_filename = call_user_func($this->cache_name_function, $favicon); $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, $favicon_filename, 'spi'); if ($cache->load()) { return $this->sanitize($this->favicon_handler . $favicon_filename, SIMPLEPIE_CONSTRUCT_IRI); } else { $file = new $this->file_class($favicon, $this->timeout / 10, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen); if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0) { $sniffer = new $this->content_type_sniffer_class($file); if (substr($sniffer->get_type(), 0, 6) === 'image/') { if ($cache->save(array('headers' => $file->headers, 'body' => $file->body))) { return $this->sanitize($this->favicon_handler . $favicon_filename, SIMPLEPIE_CONSTRUCT_IRI); } else { trigger_error("$cache->name is not writeable", E_USER_WARNING); return $this->sanitize($favicon, SIMPLEPIE_CONSTRUCT_IRI); } } // not an image else { return false; } } } } else { return $this->sanitize($favicon, SIMPLEPIE_CONSTRUCT_IRI); } } return false; } /** * @todo If we have a perm redirect we should return the new URL * @todo When we make the above change, let's support <itunes:new-feed-url> as well * @todo Also, |atom:link|@rel=self */ function subscribe_url() { if ($this->feed_url !== null) { return $this->sanitize($this->feed_url, SIMPLEPIE_CONSTRUCT_IRI); } else { return null; } } function subscribe_feed() { if ($this->feed_url !== null) { return $this->sanitize(SimplePie_Misc::fix_protocol($this->feed_url, 2), SIMPLEPIE_CONSTRUCT_IRI); } else { return null; } } function subscribe_outlook() { if ($this->feed_url !== null) { return $this->sanitize('outlook' . SimplePie_Misc::fix_protocol($this->feed_url, 2), SIMPLEPIE_CONSTRUCT_IRI); } else { return null; } } function subscribe_podcast() { if ($this->feed_url !== null) { return $this->sanitize(SimplePie_Misc::fix_protocol($this->feed_url, 3), SIMPLEPIE_CONSTRUCT_IRI); } else { return null; } } function subscribe_itunes() { if ($this->feed_url !== null) { return $this->sanitize(SimplePie_Misc::fix_protocol($this->feed_url, 4), SIMPLEPIE_CONSTRUCT_IRI); } else { return null; } } /** * Creates the subscribe_* methods' return data * * @access private * @param string $feed_url String to prefix to the feed URL * @param string $site_url String to prefix to the site URL (and * suffix to the feed URL) * @return mixed URL if feed exists, false otherwise */ function subscribe_service($feed_url, $site_url = null) { if ($this->subscribe_url()) { $return = $feed_url . rawurlencode($this->feed_url); if ($site_url !== null && $this->get_link() !== null) { $return .= $site_url . rawurlencode($this->get_link()); } return $this->sanitize($return, SIMPLEPIE_CONSTRUCT_IRI); } else { return null; } } function subscribe_aol() { return $this->subscribe_service('http://feeds.my.aol.com/add.jsp?url='); } function subscribe_bloglines() { return $this->subscribe_service('http://www.bloglines.com/sub/'); } function subscribe_eskobo() { return $this->subscribe_service('http://www.eskobo.com/?AddToMyPage='); } function subscribe_feedfeeds() { return $this->subscribe_service('http://www.feedfeeds.com/add?feed='); } function subscribe_feedster() { return $this->subscribe_service('http://www.feedster.com/myfeedster.php?action=addrss&confirm=no&rssurl='); } function subscribe_google() { return $this->subscribe_service('http://fusion.google.com/add?feedurl='); } function subscribe_gritwire() { return $this->subscribe_service('http://my.gritwire.com/feeds/addExternalFeed.aspx?FeedUrl='); } function subscribe_msn() { return $this->subscribe_service('http://my.msn.com/addtomymsn.armx?id=rss&ut=', '&ru='); } function subscribe_netvibes() { return $this->subscribe_service('http://www.netvibes.com/subscribe.php?url='); } function subscribe_newsburst() { return $this->subscribe_service('http://www.newsburst.com/Source/?add='); } function subscribe_newsgator() { return $this->subscribe_service('http://www.newsgator.com/ngs/subscriber/subext.aspx?url='); } function subscribe_odeo() { return $this->subscribe_service('http://www.odeo.com/listen/subscribe?feed='); } function subscribe_podnova() { return $this->subscribe_service('http://www.podnova.com/index_your_podcasts.srf?action=add&url='); } function subscribe_rojo() { return $this->subscribe_service('http://www.rojo.com/add-subscription?resource='); } function subscribe_yahoo() { return $this->subscribe_service('http://add.my.yahoo.com/rss?url='); } function get_feed_tags($namespace, $tag) { $type = $this->get_type(); if ($type & SIMPLEPIE_TYPE_ATOM_10) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag])) { return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag]; } } if ($type & SIMPLEPIE_TYPE_ATOM_03) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag])) { return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag]; } } if ($type & SIMPLEPIE_TYPE_RSS_RDF) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag])) { return $this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag]; } } if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) { if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag])) { return $this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]; } } return null; } function get_channel_tags($namespace, $tag) { $type = $this->get_type(); if ($type & SIMPLEPIE_TYPE_ATOM_ALL) { if ($return = $this->get_feed_tags($namespace, $tag)) { return $return; } } if ($type & SIMPLEPIE_TYPE_RSS_10) { if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'channel')) { if (isset($channel[0]['child'][$namespace][$tag])) { return $channel[0]['child'][$namespace][$tag]; } } } if ($type & SIMPLEPIE_TYPE_RSS_090) { if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'channel')) { if (isset($channel[0]['child'][$namespace][$tag])) { return $channel[0]['child'][$namespace][$tag]; } } } if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) { if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel')) { if (isset($channel[0]['child'][$namespace][$tag])) { return $channel[0]['child'][$namespace][$tag]; } } } return null; } function get_image_tags($namespace, $tag) { $type = $this->get_type(); if ($type & SIMPLEPIE_TYPE_RSS_10) { if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'image')) { if (isset($image[0]['child'][$namespace][$tag])) { return $image[0]['child'][$namespace][$tag]; } } } if ($type & SIMPLEPIE_TYPE_RSS_090) { if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'image')) { if (isset($image[0]['child'][$namespace][$tag])) { return $image[0]['child'][$namespace][$tag]; } } } if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION) { if ($image = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image')) { if (isset($image[0]['child'][$namespace][$tag])) { return $image[0]['child'][$namespace][$tag]; } } } return null; } function get_base($element = array()) { if (!($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base'])) { return $element['xml_base']; } elseif ($this->get_link() !== null) { return $this->get_link(); } else { return $this->subscribe_url(); } } function sanitize($data, $type, $base = '') { return $this->sanitize->sanitize($data, $type, $base); } function get_title() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } else { return null; } } function get_categories() { $categories = array(); foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['attribs']['']['term'])) { $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = new $this->category_class($term, $scheme, $label); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { // This is really the label, but keep this as the term also for BC. // Label will also work on retrieving because that falls back to term. $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); if (isset($category['attribs']['']['domain'])) { $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = null; } $categories[] = new $this->category_class($term, $scheme, null); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { $categories[] = new $this->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category) { $categories[] = new $this->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } if (!empty($categories)) { return SimplePie_Misc::array_unique($categories); } else { return null; } } function get_author($key = 0) { $authors = $this->get_authors(); if (isset($authors[$key])) { return $authors[$key]; } else { return null; } } function get_authors() { $authors = array(); foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author) { $name = null; $uri = null; $email = null; if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $authors[] = new $this->author_class($name, $uri, $email); } } if ($author = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) { $name = null; $url = null; $email = null; if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $authors[] = new $this->author_class($name, $url, $email); } } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author) { $authors[] = new $this->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author) { $authors[] = new $this->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author) { $authors[] = new $this->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } if (!empty($authors)) { return SimplePie_Misc::array_unique($authors); } else { return null; } } function get_contributor($key = 0) { $contributors = $this->get_contributors(); if (isset($contributors[$key])) { return $contributors[$key]; } else { return null; } } function get_contributors() { $contributors = array(); foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor) { $name = null; $uri = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $contributors[] = new $this->author_class($name, $uri, $email); } } foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) { $name = null; $url = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $contributors[] = new $this->author_class($name, $url, $email); } } if (!empty($contributors)) { return SimplePie_Misc::array_unique($contributors); } else { return null; } } function get_link($key = 0, $rel = 'alternate') { $links = $this->get_links($rel); if (isset($links[$key])) { return $links[$key]; } else { return null; } } /** * Added for parity between the parent-level and the item/entry-level. */ function get_permalink() { return $this->get_link(0); } function get_links($rel = 'alternate') { if (!isset($this->data['links'])) { $this->data['links'] = array(); if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } $keys = array_keys($this->data['links']); foreach ($keys as $key) { if (SimplePie_Misc::is_isegment_nz_nc($key)) { if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; } else { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } $this->data['links'][$key] = array_unique($this->data['links'][$key]); } } if (isset($this->data['links'][$rel])) { return $this->data['links'][$rel]; } else { return null; } } function get_all_discovered_feeds() { return $this->all_discovered_feeds; } function get_description() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } else { return null; } } function get_copyright() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } function get_language() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['xml_lang'])) { return $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['xml_lang'])) { return $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['xml_lang'])) { return $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['headers']['content-language'])) { return $this->sanitize($this->data['headers']['content-language'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } function get_latitude() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat')) { return (float) $return[0]['data']; } elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match)) { return (float) $match[1]; } else { return null; } } function get_longitude() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long')) { return (float) $return[0]['data']; } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) { return (float) $return[0]['data']; } elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match)) { return (float) $match[2]; } else { return null; } } function get_image_title() { if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } function get_image_url() { if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image')) { return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'url')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'url')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } else { return null; } } function get_image_link() { if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } else { return null; } } function get_image_width() { if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'width')) { return round($return[0]['data']); } elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) { return 88.0; } else { return null; } } function get_image_height() { if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'height')) { return round($return[0]['data']); } elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url')) { return 31.0; } else { return null; } } function get_item_quantity($max = 0) { $max = (int) $max; $qty = count($this->get_items()); if ($max === 0) { return $qty; } else { return ($qty > $max) ? $max : $qty; } } function get_item($key = 0) { $items = $this->get_items(); if (isset($items[$key])) { return $items[$key]; } else { return null; } } function get_items($start = 0, $end = 0) { if (!isset($this->data['items'])) { if (!empty($this->multifeed_objects)) { $this->data['items'] = SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit); } else { $this->data['items'] = array(); if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = new $this->item_class($this, $items[$key]); } } if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = new $this->item_class($this, $items[$key]); } } if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = new $this->item_class($this, $items[$key]); } } if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = new $this->item_class($this, $items[$key]); } } if ($items = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'item')) { $keys = array_keys($items); foreach ($keys as $key) { $this->data['items'][] = new $this->item_class($this, $items[$key]); } } } } if (!empty($this->data['items'])) { // If we want to order it by date, check if all items have a date, and then sort it if ($this->order_by_date && empty($this->multifeed_objects)) { if (!isset($this->data['ordered_items'])) { $do_sort = true; foreach ($this->data['items'] as $item) { if (!$item->get_date('U')) { $do_sort = false; break; } } $item = null; $this->data['ordered_items'] = $this->data['items']; if ($do_sort) { usort($this->data['ordered_items'], array(&$this, 'sort_items')); } } $items = $this->data['ordered_items']; } else { $items = $this->data['items']; } // Slice the data as desired if ($end === 0) { return array_slice($items, $start); } else { return array_slice($items, $start, $end); } } else { return array(); } } /** * @static */ function sort_items($a, $b) { return $a->get_date('U') <= $b->get_date('U'); } /** * @static */ function merge_items($urls, $start = 0, $end = 0, $limit = 0) { if (is_array($urls) && sizeof($urls) > 0) { $items = array(); foreach ($urls as $arg) { if (is_a($arg, 'SimplePie')) { $items = array_merge($items, $arg->get_items(0, $limit)); } else { trigger_error('Arguments must be SimplePie objects', E_USER_WARNING); } } $do_sort = true; foreach ($items as $item) { if (!$item->get_date('U')) { $do_sort = false; break; } } $item = null; if ($do_sort) { usort($items, array('SimplePie', 'sort_items')); } if ($end === 0) { return array_slice($items, $start); } else { return array_slice($items, $start, $end); } } else { trigger_error('Cannot merge zero SimplePie objects', E_USER_WARNING); return array(); } } } class SimplePie_Item { var $feed; var $data = array(); function SimplePie_Item($feed, $data) { $this->feed = $feed; $this->data = $data; } function __toString() { return md5(serialize($this->data)); } /** * Remove items that link back to this before destroying this object */ function __destruct() { if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode')) { unset($this->feed); } } function get_item_tags($namespace, $tag) { if (isset($this->data['child'][$namespace][$tag])) { return $this->data['child'][$namespace][$tag]; } else { return null; } } function get_base($element = array()) { return $this->feed->get_base($element); } function sanitize($data, $type, $base = '') { return $this->feed->sanitize($data, $type, $base); } function get_feed() { return $this->feed; } function get_id($hash = false) { if (!$hash) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (($return = $this->get_permalink()) !== null) { return $return; } elseif (($return = $this->get_title()) !== null) { return $return; } } if ($this->get_permalink() !== null || $this->get_title() !== null) { return md5($this->get_permalink() . $this->get_title()); } else { return md5(serialize($this->data)); } } function get_title() { if (!isset($this->data['title'])) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) { $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $this->data['title'] = null; } } return $this->data['title']; } function get_description($description_only = false) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'summary')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'summary')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (!$description_only) { return $this->get_content(true); } else { return null; } } function get_content($content_only = false) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'content')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_content_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif (!$content_only) { return $this->get_description(true); } else { return null; } } function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } else { return null; } } function get_categories() { $categories = array(); foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['attribs']['']['term'])) { $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = new $this->feed->category_class($term, $scheme, $label); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { // This is really the label, but keep this as the term also for BC. // Label will also work on retrieving because that falls back to term. $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); if (isset($category['attribs']['']['domain'])) { $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = null; } $categories[] = new $this->feed->category_class($term, $scheme, null); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { $categories[] = new $this->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category) { $categories[] = new $this->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } if (!empty($categories)) { return SimplePie_Misc::array_unique($categories); } else { return null; } } function get_author($key = 0) { $authors = $this->get_authors(); if (isset($authors[$key])) { return $authors[$key]; } else { return null; } } function get_contributor($key = 0) { $contributors = $this->get_contributors(); if (isset($contributors[$key])) { return $contributors[$key]; } else { return null; } } function get_contributors() { $contributors = array(); foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor) { $name = null; $uri = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $contributors[] = new $this->feed->author_class($name, $uri, $email); } } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) { $name = null; $url = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $contributors[] = new $this->feed->author_class($name, $url, $email); } } if (!empty($contributors)) { return SimplePie_Misc::array_unique($contributors); } else { return null; } } function get_authors() { $authors = array(); foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author) { $name = null; $uri = null; $email = null; if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $authors[] = new $this->feed->author_class($name, $uri, $email); } } if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) { $name = null; $url = null; $email = null; if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $authors[] = new $this->feed->author_class($name, $url, $email); } } if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author')) { $authors[] = new $this->feed->author_class(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author) { $authors[] = new $this->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author) { $authors[] = new $this->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author) { $authors[] = new $this->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } if (!empty($authors)) { return SimplePie_Misc::array_unique($authors); } elseif (($source = $this->get_source()) && ($authors = $source->get_authors())) { return $authors; } elseif ($authors = $this->feed->get_authors()) { return $authors; } else { return null; } } function get_copyright() { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } function get_date($date_format = 'j F Y, g:i a') { if (!isset($this->data['date'])) { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date')) { $this->data['date']['raw'] = $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date')) { $this->data['date']['raw'] = $return[0]['data']; } if (!empty($this->data['date']['raw'])) { $parser = SimplePie_Parse_Date::get(); $this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']); } else { $this->data['date'] = null; } } if ($this->data['date']) { $date_format = (string) $date_format; switch ($date_format) { case '': return $this->sanitize($this->data['date']['raw'], SIMPLEPIE_CONSTRUCT_TEXT); case 'U': return $this->data['date']['parsed']; default: return date($date_format, $this->data['date']['parsed']); } } else { return null; } } function get_local_date($date_format = '%c') { if (!$date_format) { return $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT); } elseif (($date = $this->get_date('U')) !== null) { return strftime($date_format, $date); } else { return null; } } function get_permalink() { $link = $this->get_link(); $enclosure = $this->get_enclosure(0); if ($link !== null) { return $link; } elseif ($enclosure !== null) { return $enclosure->get_link(); } else { return null; } } function get_link($key = 0, $rel = 'alternate') { $links = $this->get_links($rel); if ($links[$key] !== null) { return $links[$key]; } else { return null; } } function get_links($rel = 'alternate') { if (!isset($this->data['links'])) { $this->data['links'] = array(); foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) { if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true') { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } } $keys = array_keys($this->data['links']); foreach ($keys as $key) { if (SimplePie_Misc::is_isegment_nz_nc($key)) { if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; } else { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } $this->data['links'][$key] = array_unique($this->data['links'][$key]); } } if (isset($this->data['links'][$rel])) { return $this->data['links'][$rel]; } else { return null; } } /** * @todo Add ability to prefer one type of content over another (in a media group). */ function get_enclosure($key = 0, $prefer = null) { $enclosures = $this->get_enclosures(); if (isset($enclosures[$key])) { return $enclosures[$key]; } else { return null; } } /** * Grabs all available enclosures (podcasts, etc.) * * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS. * * At this point, we're pretty much assuming that all enclosures for an item are the same content. Anything else is too complicated to properly support. * * @todo Add support for end-user defined sorting of enclosures by type/handler (so we can prefer the faster-loading FLV over MP4). * @todo If an element exists at a level, but it's value is empty, we should fall back to the value from the parent (if it exists). */ function get_enclosures() { if (!isset($this->data['enclosures'])) { $this->data['enclosures'] = array(); // Elements $captions_parent = null; $categories_parent = null; $copyrights_parent = null; $credits_parent = null; $description_parent = null; $duration_parent = null; $hashes_parent = null; $keywords_parent = null; $player_parent = null; $ratings_parent = null; $restrictions_parent = null; $thumbnails_parent = null; $title_parent = null; // Let's do the channel and item-level ones first, and just re-use them if we need to. $parent = $this->get_feed(); // CAPTIONS if ($captions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text')) { foreach ($captions as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions_parent[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text); } } elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text')) { foreach ($captions as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions_parent[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text); } } if (is_array($captions_parent)) { $captions_parent = array_values(SimplePie_Misc::array_unique($captions_parent)); } // CATEGORIES foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories_parent[] = new $this->feed->category_class($term, $scheme, $label); } foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories_parent[] = new $this->feed->category_class($term, $scheme, $label); } foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'category') as $category) { $term = null; $scheme = 'http://www.itunes.com/dtds/podcast-1.0.dtd'; $label = null; if (isset($category['attribs']['']['text'])) { $label = $this->sanitize($category['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories_parent[] = new $this->feed->category_class($term, $scheme, $label); if (isset($category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category'])) { foreach ((array) $category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category'] as $subcategory) { if (isset($subcategory['attribs']['']['text'])) { $label = $this->sanitize($subcategory['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories_parent[] = new $this->feed->category_class($term, $scheme, $label); } } } if (is_array($categories_parent)) { $categories_parent = array_values(SimplePie_Misc::array_unique($categories_parent)); } // COPYRIGHT if ($copyright = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright')) { $copyright_url = null; $copyright_label = null; if (isset($copyright[0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($copyright[0]['data'])) { $copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights_parent = new $this->feed->copyright_class($copyright_url, $copyright_label); } elseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright')) { $copyright_url = null; $copyright_label = null; if (isset($copyright[0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($copyright[0]['data'])) { $copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights_parent = new $this->feed->copyright_class($copyright_url, $copyright_label); } // CREDITS if ($credits = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit')) { foreach ($credits as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits_parent[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name); } } elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit')) { foreach ($credits as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits_parent[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name); } } if (is_array($credits_parent)) { $credits_parent = array_values(SimplePie_Misc::array_unique($credits_parent)); } // DESCRIPTION if ($description_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description')) { if (isset($description_parent[0]['data'])) { $description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } } elseif ($description_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description')) { if (isset($description_parent[0]['data'])) { $description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } } // DURATION if ($duration_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'duration')) { $seconds = null; $minutes = null; $hours = null; if (isset($duration_parent[0]['data'])) { $temp = explode(':', $this->sanitize($duration_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); if (sizeof($temp) > 0) { (int) $seconds = array_pop($temp); } if (sizeof($temp) > 0) { (int) $minutes = array_pop($temp); $seconds += $minutes * 60; } if (sizeof($temp) > 0) { (int) $hours = array_pop($temp); $seconds += $hours * 3600; } unset($temp); $duration_parent = $seconds; } } // HASHES if ($hashes_iterator = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash')) { foreach ($hashes_iterator as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes_parent[] = $algo.':'.$value; } } elseif ($hashes_iterator = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash')) { foreach ($hashes_iterator as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes_parent[] = $algo.':'.$value; } } if (is_array($hashes_parent)) { $hashes_parent = array_values(SimplePie_Misc::array_unique($hashes_parent)); } // KEYWORDS if ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords')) { if (isset($keywords[0]['data'])) { $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords_parent[] = trim($word); } } unset($temp); } elseif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords')) { if (isset($keywords[0]['data'])) { $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords_parent[] = trim($word); } } unset($temp); } elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords')) { if (isset($keywords[0]['data'])) { $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords_parent[] = trim($word); } } unset($temp); } elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords')) { if (isset($keywords[0]['data'])) { $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords_parent[] = trim($word); } } unset($temp); } if (is_array($keywords_parent)) { $keywords_parent = array_values(SimplePie_Misc::array_unique($keywords_parent)); } // PLAYER if ($player_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player')) { if (isset($player_parent[0]['attribs']['']['url'])) { $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } } elseif ($player_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player')) { if (isset($player_parent[0]['attribs']['']['url'])) { $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } } // RATINGS if ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating')) { foreach ($ratings as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value); } } elseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) { foreach ($ratings as $rating) { $rating_scheme = 'urn:itunes'; $rating_value = null; if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value); } } elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating')) { foreach ($ratings as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value); } } elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) { foreach ($ratings as $rating) { $rating_scheme = 'urn:itunes'; $rating_value = null; if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value); } } if (is_array($ratings_parent)) { $ratings_parent = array_values(SimplePie_Misc::array_unique($ratings_parent)); } // RESTRICTIONS if ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction')) { foreach ($restrictions as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value); } } elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) { foreach ($restrictions as $restriction) { $restriction_relationship = 'allow'; $restriction_type = null; $restriction_value = 'itunes'; if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') { $restriction_relationship = 'deny'; } $restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value); } } elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction')) { foreach ($restrictions as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value); } } elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) { foreach ($restrictions as $restriction) { $restriction_relationship = 'allow'; $restriction_type = null; $restriction_value = 'itunes'; if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') { $restriction_relationship = 'deny'; } $restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value); } } if (is_array($restrictions_parent)) { $restrictions_parent = array_values(SimplePie_Misc::array_unique($restrictions_parent)); } // THUMBNAILS if ($thumbnails = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail')) { foreach ($thumbnails as $thumbnail) { if (isset($thumbnail['attribs']['']['url'])) { $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } } } elseif ($thumbnails = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail')) { foreach ($thumbnails as $thumbnail) { if (isset($thumbnail['attribs']['']['url'])) { $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } } } // TITLES if ($title_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title')) { if (isset($title_parent[0]['data'])) { $title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } } elseif ($title_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title')) { if (isset($title_parent[0]['data'])) { $title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } } // Clear the memory unset($parent); // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; // Elements $captions = null; $categories = null; $copyrights = null; $credits = null; $description = null; $hashes = null; $keywords = null; $player = null; $ratings = null; $restrictions = null; $thumbnails = null; $title = null; // If we have media:group tags, loop through them. foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group) { // If we have media:content tags, loop through them. foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content) { if (isset($content['attribs']['']['url'])) { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; // Elements $captions = null; $categories = null; $copyrights = null; $credits = null; $description = null; $hashes = null; $keywords = null; $player = null; $ratings = null; $restrictions = null; $thumbnails = null; $title = null; // Start checking the attributes of media:content if (isset($content['attribs']['']['bitrate'])) { $bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['channels'])) { $channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['duration'])) { $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $duration = $duration_parent; } if (isset($content['attribs']['']['expression'])) { $expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['framerate'])) { $framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['height'])) { $height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['lang'])) { $lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['fileSize'])) { $length = ceil($content['attribs']['']['fileSize']); } if (isset($content['attribs']['']['medium'])) { $medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['samplingrate'])) { $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['type'])) { $type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['width'])) { $width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT); } $url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); // Checking the other optional media: elements. Priority: media:content, media:group, item, channel // CAPTIONS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text); } if (is_array($captions)) { $captions = array_values(SimplePie_Misc::array_unique($captions)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text); } if (is_array($captions)) { $captions = array_values(SimplePie_Misc::array_unique($captions)); } } else { $captions = $captions_parent; } // CATEGORIES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'])) { foreach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = new $this->feed->category_class($term, $scheme, $label); } } if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'])) { foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = new $this->feed->category_class($term, $scheme, $label); } } if (is_array($categories) && is_array($categories_parent)) { $categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent))); } elseif (is_array($categories)) { $categories = array_values(SimplePie_Misc::array_unique($categories)); } elseif (is_array($categories_parent)) { $categories = array_values(SimplePie_Misc::array_unique($categories_parent)); } // COPYRIGHTS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'])) { $copyright_url = null; $copyright_label = null; if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'])) { $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label); } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'])) { $copyright_url = null; $copyright_label = null; if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'])) { $copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label); } else { $copyrights = $copyrights_parent; } // CREDITS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name); } if (is_array($credits)) { $credits = array_values(SimplePie_Misc::array_unique($credits)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name); } if (is_array($credits)) { $credits = array_values(SimplePie_Misc::array_unique($credits)); } } else { $credits = $credits_parent; } // DESCRIPTION if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) { $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) { $description = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $description = $description_parent; } // HASHES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes[] = $algo.':'.$value; } if (is_array($hashes)) { $hashes = array_values(SimplePie_Misc::array_unique($hashes)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes[] = $algo.':'.$value; } if (is_array($hashes)) { $hashes = array_values(SimplePie_Misc::array_unique($hashes)); } } else { $hashes = $hashes_parent; } // KEYWORDS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'])) { if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'])) { $temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords[] = trim($word); } unset($temp); } if (is_array($keywords)) { $keywords = array_values(SimplePie_Misc::array_unique($keywords)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'])) { if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'])) { $temp = explode(',', $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords[] = trim($word); } unset($temp); } if (is_array($keywords)) { $keywords = array_values(SimplePie_Misc::array_unique($keywords)); } } else { $keywords = $keywords_parent; } // PLAYER if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) { $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) { $player = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } else { $player = $player_parent; } // RATINGS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value); } if (is_array($ratings)) { $ratings = array_values(SimplePie_Misc::array_unique($ratings)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value); } if (is_array($ratings)) { $ratings = array_values(SimplePie_Misc::array_unique($ratings)); } } else { $ratings = $ratings_parent; } // RESTRICTIONS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value); } if (is_array($restrictions)) { $restrictions = array_values(SimplePie_Misc::array_unique($restrictions)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value); } if (is_array($restrictions)) { $restrictions = array_values(SimplePie_Misc::array_unique($restrictions)); } } else { $restrictions = $restrictions_parent; } // THUMBNAILS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } if (is_array($thumbnails)) { $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails)); } } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'])) { foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } if (is_array($thumbnails)) { $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails)); } } else { $thumbnails = $thumbnails_parent; } // TITLES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) { $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) { $title = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $title = $title_parent; } $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width); } } } // If we have standalone media:content tags, loop through them. if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'])) { foreach ((array) $this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content) { if (isset($content['attribs']['']['url'])) { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; // Elements $captions = null; $categories = null; $copyrights = null; $credits = null; $description = null; $hashes = null; $keywords = null; $player = null; $ratings = null; $restrictions = null; $thumbnails = null; $title = null; // Start checking the attributes of media:content if (isset($content['attribs']['']['bitrate'])) { $bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['channels'])) { $channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['duration'])) { $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $duration = $duration_parent; } if (isset($content['attribs']['']['expression'])) { $expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['framerate'])) { $framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['height'])) { $height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['lang'])) { $lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['fileSize'])) { $length = ceil($content['attribs']['']['fileSize']); } if (isset($content['attribs']['']['medium'])) { $medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['samplingrate'])) { $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['type'])) { $type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['attribs']['']['width'])) { $width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT); } $url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); // Checking the other optional media: elements. Priority: media:content, media:group, item, channel // CAPTIONS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption) { $caption_type = null; $caption_lang = null; $caption_startTime = null; $caption_endTime = null; $caption_text = null; if (isset($caption['attribs']['']['type'])) { $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['lang'])) { $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['start'])) { $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['attribs']['']['end'])) { $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($caption['data'])) { $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text); } if (is_array($captions)) { $captions = array_values(SimplePie_Misc::array_unique($captions)); } } else { $captions = $captions_parent; } // CATEGORIES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'])) { foreach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category) { $term = null; $scheme = null; $label = null; if (isset($category['data'])) { $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = 'http://search.yahoo.com/mrss/category_schema'; } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = new $this->feed->category_class($term, $scheme, $label); } } if (is_array($categories) && is_array($categories_parent)) { $categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent))); } elseif (is_array($categories)) { $categories = array_values(SimplePie_Misc::array_unique($categories)); } elseif (is_array($categories_parent)) { $categories = array_values(SimplePie_Misc::array_unique($categories_parent)); } else { $categories = null; } // COPYRIGHTS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'])) { $copyright_url = null; $copyright_label = null; if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'])) { $copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'])) { $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label); } else { $copyrights = $copyrights_parent; } // CREDITS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit) { $credit_role = null; $credit_scheme = null; $credit_name = null; if (isset($credit['attribs']['']['role'])) { $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($credit['attribs']['']['scheme'])) { $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $credit_scheme = 'urn:ebu'; } if (isset($credit['data'])) { $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name); } if (is_array($credits)) { $credits = array_values(SimplePie_Misc::array_unique($credits)); } } else { $credits = $credits_parent; } // DESCRIPTION if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) { $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $description = $description_parent; } // HASHES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash) { $value = null; $algo = null; if (isset($hash['data'])) { $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($hash['attribs']['']['algo'])) { $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $algo = 'md5'; } $hashes[] = $algo.':'.$value; } if (is_array($hashes)) { $hashes = array_values(SimplePie_Misc::array_unique($hashes)); } } else { $hashes = $hashes_parent; } // KEYWORDS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'])) { if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'])) { $temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); foreach ($temp as $word) { $keywords[] = trim($word); } unset($temp); } if (is_array($keywords)) { $keywords = array_values(SimplePie_Misc::array_unique($keywords)); } } else { $keywords = $keywords_parent; } // PLAYER if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) { $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } else { $player = $player_parent; } // RATINGS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating) { $rating_scheme = null; $rating_value = null; if (isset($rating['attribs']['']['scheme'])) { $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $rating_scheme = 'urn:simple'; } if (isset($rating['data'])) { $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value); } if (is_array($ratings)) { $ratings = array_values(SimplePie_Misc::array_unique($ratings)); } } else { $ratings = $ratings_parent; } // RESTRICTIONS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction) { $restriction_relationship = null; $restriction_type = null; $restriction_value = null; if (isset($restriction['attribs']['']['relationship'])) { $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['attribs']['']['type'])) { $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($restriction['data'])) { $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT); } $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value); } if (is_array($restrictions)) { $restrictions = array_values(SimplePie_Misc::array_unique($restrictions)); } } else { $restrictions = $restrictions_parent; } // THUMBNAILS if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'])) { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); } if (is_array($thumbnails)) { $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails)); } } else { $thumbnails = $thumbnails_parent; } // TITLES if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) { $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $title = $title_parent; } $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width); } } } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link) { if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; $url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); if (isset($link['attribs']['']['type'])) { $type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($link['attribs']['']['length'])) { $length = ceil($link['attribs']['']['length']); } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width); } } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link) { if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; $url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); if (isset($link['attribs']['']['type'])) { $type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($link['attribs']['']['length'])) { $length = ceil($link['attribs']['']['length']); } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width); } } if ($enclosure = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'enclosure')) { if (isset($enclosure[0]['attribs']['']['url'])) { // Attributes $bitrate = null; $channels = null; $duration = null; $expression = null; $framerate = null; $height = null; $javascript = null; $lang = null; $length = null; $medium = null; $samplingrate = null; $type = null; $url = null; $width = null; $url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0])); if (isset($enclosure[0]['attribs']['']['type'])) { $type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($enclosure[0]['attribs']['']['length'])) { $length = ceil($enclosure[0]['attribs']['']['length']); } // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width); } } if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width)) { // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width); } $this->data['enclosures'] = array_values(SimplePie_Misc::array_unique($this->data['enclosures'])); } if (!empty($this->data['enclosures'])) { return $this->data['enclosures']; } else { return null; } } function get_latitude() { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat')) { return (float) $return[0]['data']; } elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match)) { return (float) $match[1]; } else { return null; } } function get_longitude() { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long')) { return (float) $return[0]['data']; } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) { return (float) $return[0]['data']; } elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match)) { return (float) $match[2]; } else { return null; } } function get_source() { if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'source')) { return new $this->feed->source_class($this, $return[0]); } else { return null; } } /** * Creates the add_to_* methods' return data * * @access private * @param string $item_url String to prefix to the item permalink * @param string $title_url String to prefix to the item title * (and suffix to the item permalink) * @return mixed URL if feed exists, false otherwise */ function add_to_service($item_url, $title_url = null, $summary_url = null) { if ($this->get_permalink() !== null) { $return = $item_url . rawurlencode($this->get_permalink()); if ($title_url !== null && $this->get_title() !== null) { $return .= $title_url . rawurlencode($this->get_title()); } if ($summary_url !== null && $this->get_description() !== null) { $return .= $summary_url . rawurlencode($this->get_description()); } return $this->sanitize($return, SIMPLEPIE_CONSTRUCT_IRI); } else { return null; } } function add_to_blinklist() { return $this->add_to_service('http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url=', '&Title='); } function add_to_blogmarks() { return $this->add_to_service('http://blogmarks.net/my/new.php?mini=1&simple=1&url=', '&title='); } function add_to_delicious() { return $this->add_to_service('http://del.icio.us/post/?v=4&url=', '&title='); } function add_to_digg() { return $this->add_to_service('http://digg.com/submit?url=', '&title=', '&bodytext='); } function add_to_furl() { return $this->add_to_service('http://www.furl.net/storeIt.jsp?u=', '&t='); } function add_to_magnolia() { return $this->add_to_service('http://ma.gnolia.com/bookmarklet/add?url=', '&title='); } function add_to_myweb20() { return $this->add_to_service('http://myweb2.search.yahoo.com/myresults/bookmarklet?u=', '&t='); } function add_to_newsvine() { return $this->add_to_service('http://www.newsvine.com/_wine/save?u=', '&h='); } function add_to_reddit() { return $this->add_to_service('http://reddit.com/submit?url=', '&title='); } function add_to_segnalo() { return $this->add_to_service('http://segnalo.com/post.html.php?url=', '&title='); } function add_to_simpy() { return $this->add_to_service('http://www.simpy.com/simpy/LinkAdd.do?href=', '&title='); } function add_to_spurl() { return $this->add_to_service('http://www.spurl.net/spurl.php?v=3&url=', '&title='); } function add_to_wists() { return $this->add_to_service('http://wists.com/r.php?c=&r=', '&title='); } function search_technorati() { return $this->add_to_service('http://www.technorati.com/search/'); } } class SimplePie_Source { var $item; var $data = array(); function SimplePie_Source($item, $data) { $this->item = $item; $this->data = $data; } function __toString() { return md5(serialize($this->data)); } function get_source_tags($namespace, $tag) { if (isset($this->data['child'][$namespace][$tag])) { return $this->data['child'][$namespace][$tag]; } else { return null; } } function get_base($element = array()) { return $this->item->get_base($element); } function sanitize($data, $type, $base = '') { return $this->item->sanitize($data, $type, $base); } function get_item() { return $this->item; } function get_title() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } else { return null; } } function get_categories() { $categories = array(); foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['attribs']['']['term'])) { $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = new $this->item->feed->category_class($term, $scheme, $label); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { // This is really the label, but keep this as the term also for BC. // Label will also work on retrieving because that falls back to term. $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); if (isset($category['attribs']['']['domain'])) { $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = null; } $categories[] = new $this->item->feed->category_class($term, $scheme, null); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { $categories[] = new $this->item->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category) { $categories[] = new $this->item->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } if (!empty($categories)) { return SimplePie_Misc::array_unique($categories); } else { return null; } } function get_author($key = 0) { $authors = $this->get_authors(); if (isset($authors[$key])) { return $authors[$key]; } else { return null; } } function get_authors() { $authors = array(); foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author) { $name = null; $uri = null; $email = null; if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $authors[] = new $this->item->feed->author_class($name, $uri, $email); } } if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) { $name = null; $url = null; $email = null; if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $authors[] = new $this->item->feed->author_class($name, $url, $email); } } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author) { $authors[] = new $this->item->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author) { $authors[] = new $this->item->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author) { $authors[] = new $this->item->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null); } if (!empty($authors)) { return SimplePie_Misc::array_unique($authors); } else { return null; } } function get_contributor($key = 0) { $contributors = $this->get_contributors(); if (isset($contributors[$key])) { return $contributors[$key]; } else { return null; } } function get_contributors() { $contributors = array(); foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor) { $name = null; $uri = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $contributors[] = new $this->item->feed->author_class($name, $uri, $email); } } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) { $name = null; $url = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $contributors[] = new $this->item->feed->author_class($name, $url, $email); } } if (!empty($contributors)) { return SimplePie_Misc::array_unique($contributors); } else { return null; } } function get_link($key = 0, $rel = 'alternate') { $links = $this->get_links($rel); if (isset($links[$key])) { return $links[$key]; } else { return null; } } /** * Added for parity between the parent-level and the item/entry-level. */ function get_permalink() { return $this->get_link(0); } function get_links($rel = 'alternate') { if (!isset($this->data['links'])) { $this->data['links'] = array(); if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } $keys = array_keys($this->data['links']); foreach ($keys as $key) { if (SimplePie_Misc::is_isegment_nz_nc($key)) { if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; } else { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } $this->data['links'][$key] = array_unique($this->data['links'][$key]); } } if (isset($this->data['links'][$rel])) { return $this->data['links'][$rel]; } else { return null; } } function get_description() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } else { return null; } } function get_copyright() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright')) { return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } function get_language() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['xml_lang'])) { return $this->sanitize($this->data['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } function get_latitude() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat')) { return (float) $return[0]['data']; } elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match)) { return (float) $match[1]; } else { return null; } } function get_longitude() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long')) { return (float) $return[0]['data']; } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) { return (float) $return[0]['data']; } elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', $return[0]['data'], $match)) { return (float) $match[2]; } else { return null; } } function get_image_url() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image')) { return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } else { return null; } } } class SimplePie_Author { var $name; var $link; var $email; // Constructor, used to input the data function SimplePie_Author($name = null, $link = null, $email = null) { $this->name = $name; $this->link = $link; $this->email = $email; } function __toString() { // There is no $this->data here return md5(serialize($this)); } function get_name() { if ($this->name !== null) { return $this->name; } else { return null; } } function get_link() { if ($this->link !== null) { return $this->link; } else { return null; } } function get_email() { if ($this->email !== null) { return $this->email; } else { return null; } } } class SimplePie_Category { var $term; var $scheme; var $label; // Constructor, used to input the data function SimplePie_Category($term = null, $scheme = null, $label = null) { $this->term = $term; $this->scheme = $scheme; $this->label = $label; } function __toString() { // There is no $this->data here return md5(serialize($this)); } function get_term() { if ($this->term !== null) { return $this->term; } else { return null; } } function get_scheme() { if ($this->scheme !== null) { return $this->scheme; } else { return null; } } function get_label() { if ($this->label !== null) { return $this->label; } else { return $this->get_term(); } } } class SimplePie_Enclosure { var $bitrate; var $captions; var $categories; var $channels; var $copyright; var $credits; var $description; var $duration; var $expression; var $framerate; var $handler; var $hashes; var $height; var $javascript; var $keywords; var $lang; var $length; var $link; var $medium; var $player; var $ratings; var $restrictions; var $samplingrate; var $thumbnails; var $title; var $type; var $width; // Constructor, used to input the data function SimplePie_Enclosure($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null) { $this->bitrate = $bitrate; $this->captions = $captions; $this->categories = $categories; $this->channels = $channels; $this->copyright = $copyright; $this->credits = $credits; $this->description = $description; $this->duration = $duration; $this->expression = $expression; $this->framerate = $framerate; $this->hashes = $hashes; $this->height = $height; $this->javascript = $javascript; $this->keywords = $keywords; $this->lang = $lang; $this->length = $length; $this->link = $link; $this->medium = $medium; $this->player = $player; $this->ratings = $ratings; $this->restrictions = $restrictions; $this->samplingrate = $samplingrate; $this->thumbnails = $thumbnails; $this->title = $title; $this->type = $type; $this->width = $width; if (class_exists('idna_convert')) { $idn = new idna_convert; $parsed = SimplePie_Misc::parse_url($link); $this->link = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']); } $this->handler = $this->get_handler(); // Needs to load last } function __toString() { // There is no $this->data here return md5(serialize($this)); } function get_bitrate() { if ($this->bitrate !== null) { return $this->bitrate; } else { return null; } } function get_caption($key = 0) { $captions = $this->get_captions(); if (isset($captions[$key])) { return $captions[$key]; } else { return null; } } function get_captions() { if ($this->captions !== null) { return $this->captions; } else { return null; } } function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } else { return null; } } function get_categories() { if ($this->categories !== null) { return $this->categories; } else { return null; } } function get_channels() { if ($this->channels !== null) { return $this->channels; } else { return null; } } function get_copyright() { if ($this->copyright !== null) { return $this->copyright; } else { return null; } } function get_credit($key = 0) { $credits = $this->get_credits(); if (isset($credits[$key])) { return $credits[$key]; } else { return null; } } function get_credits() { if ($this->credits !== null) { return $this->credits; } else { return null; } } function get_description() { if ($this->description !== null) { return $this->description; } else { return null; } } function get_duration($convert = false) { if ($this->duration !== null) { if ($convert) { $time = SimplePie_Misc::time_hms($this->duration); return $time; } else { return $this->duration; } } else { return null; } } function get_expression() { if ($this->expression !== null) { return $this->expression; } else { return 'full'; } } function get_extension() { if ($this->link !== null) { $url = SimplePie_Misc::parse_url($this->link); if ($url['path'] !== '') { return pathinfo($url['path'], PATHINFO_EXTENSION); } } return null; } function get_framerate() { if ($this->framerate !== null) { return $this->framerate; } else { return null; } } function get_handler() { return $this->get_real_type(true); } function get_hash($key = 0) { $hashes = $this->get_hashes(); if (isset($hashes[$key])) { return $hashes[$key]; } else { return null; } } function get_hashes() { if ($this->hashes !== null) { return $this->hashes; } else { return null; } } function get_height() { if ($this->height !== null) { return $this->height; } else { return null; } } function get_language() { if ($this->lang !== null) { return $this->lang; } else { return null; } } function get_keyword($key = 0) { $keywords = $this->get_keywords(); if (isset($keywords[$key])) { return $keywords[$key]; } else { return null; } } function get_keywords() { if ($this->keywords !== null) { return $this->keywords; } else { return null; } } function get_length() { if ($this->length !== null) { return $this->length; } else { return null; } } function get_link() { if ($this->link !== null) { return urldecode($this->link); } else { return null; } } function get_medium() { if ($this->medium !== null) { return $this->medium; } else { return null; } } function get_player() { if ($this->player !== null) { return $this->player; } else { return null; } } function get_rating($key = 0) { $ratings = $this->get_ratings(); if (isset($ratings[$key])) { return $ratings[$key]; } else { return null; } } function get_ratings() { if ($this->ratings !== null) { return $this->ratings; } else { return null; } } function get_restriction($key = 0) { $restrictions = $this->get_restrictions(); if (isset($restrictions[$key])) { return $restrictions[$key]; } else { return null; } } function get_restrictions() { if ($this->restrictions !== null) { return $this->restrictions; } else { return null; } } function get_sampling_rate() { if ($this->samplingrate !== null) { return $this->samplingrate; } else { return null; } } function get_size() { $length = $this->get_length(); if ($length !== null) { return round($length/1048576, 2); } else { return null; } } function get_thumbnail($key = 0) { $thumbnails = $this->get_thumbnails(); if (isset($thumbnails[$key])) { return $thumbnails[$key]; } else { return null; } } function get_thumbnails() { if ($this->thumbnails !== null) { return $this->thumbnails; } else { return null; } } function get_title() { if ($this->title !== null) { return $this->title; } else { return null; } } function get_type() { if ($this->type !== null) { return $this->type; } else { return null; } } function get_width() { if ($this->width !== null) { return $this->width; } else { return null; } } function native_embed($options='') { return $this->embed($options, true); } /** * @todo If the dimensions for media:content are defined, use them when width/height are set to 'auto'. */ function embed($options = '', $native = false) { // Set up defaults $audio = ''; $video = ''; $alt = ''; $altclass = ''; $loop = 'false'; $width = 'auto'; $height = 'auto'; $bgcolor = '#ffffff'; $mediaplayer = ''; $widescreen = false; $handler = $this->get_handler(); $type = $this->get_real_type(); // Process options and reassign values as necessary if (is_array($options)) { extract($options); } else { $options = explode(',', $options); foreach($options as $option) { $opt = explode(':', $option, 2); if (isset($opt[0], $opt[1])) { $opt[0] = trim($opt[0]); $opt[1] = trim($opt[1]); switch ($opt[0]) { case 'audio': $audio = $opt[1]; break; case 'video': $video = $opt[1]; break; case 'alt': $alt = $opt[1]; break; case 'altclass': $altclass = $opt[1]; break; case 'loop': $loop = $opt[1]; break; case 'width': $width = $opt[1]; break; case 'height': $height = $opt[1]; break; case 'bgcolor': $bgcolor = $opt[1]; break; case 'mediaplayer': $mediaplayer = $opt[1]; break; case 'widescreen': $widescreen = $opt[1]; break; } } } } $mime = explode('/', $type, 2); $mime = $mime[0]; // Process values for 'auto' if ($width === 'auto') { if ($mime === 'video') { if ($height === 'auto') { $width = 480; } elseif ($widescreen) { $width = round((intval($height)/9)*16); } else { $width = round((intval($height)/3)*4); } } else { $width = '100%'; } } if ($height === 'auto') { if ($mime === 'audio') { $height = 0; } elseif ($mime === 'video') { if ($width === 'auto') { if ($widescreen) { $height = 270; } else { $height = 360; } } elseif ($widescreen) { $height = round((intval($width)/16)*9); } else { $height = round((intval($width)/4)*3); } } else { $height = 376; } } elseif ($mime === 'audio') { $height = 0; } // Set proper placeholder value if ($mime === 'audio') { $placeholder = $audio; } elseif ($mime === 'video') { $placeholder = $video; } $embed = ''; // Make sure the JS library is included if (!$native) { static $javascript_outputted = null; if (!$javascript_outputted && $this->javascript) { $embed .= '<script type="text/javascript" src="?' . htmlspecialchars($this->javascript) . '"></script>'; $javascript_outputted = true; } } // Odeo Feed MP3's if ($handler === 'odeo') { if ($native) { $embed .= '<embed src="http://odeo.com/flash/audio_player_fullsize.swf" pluginspage="http://adobe.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="440" height="80" wmode="transparent" allowScriptAccess="any" flashvars="valid_sample_rate=true&external_url=' . $this->get_link() . '"></embed>'; } else { $embed .= '<script type="text/javascript">embed_odeo("' . $this->get_link() . '");</script>'; } } // Flash elseif ($handler === 'flash') { if ($native) { $embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>"; } else { $embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>"; } } // Flash Media Player file types. // Preferred handler for MP3 file types. elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== '')) { $height += 20; if ($native) { $embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>"; } else { $embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>"; } } // QuickTime 7 file types. Need to test with QuickTime 6. // Only handle MP3's if the Flash Media Player is not present. elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === '')) { $height += 16; if ($native) { if ($placeholder !== '') { $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; } else { $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; } } else { $embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$placeholder', '$loop');</script>"; } } // Windows Media elseif ($handler === 'wmedia') { $height += 45; if ($native) { $embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>"; } else { $embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '" . $this->get_link() . "');</script>"; } } // Everything else else $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>'; return $embed; } function get_real_type($find_handler = false) { // If it's Odeo, let's get it out of the way. if (substr(strtolower($this->get_link()), 0, 15) === 'http://odeo.com') { return 'odeo'; } // Mime-types by handler. $types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash $types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player $types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime $types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media $types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3 if ($this->get_type() !== null) { $type = strtolower($this->type); } else { $type = null; } // If we encounter an unsupported mime-type, check the file extension and guess intelligently. if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3))) { switch (strtolower($this->get_extension())) { // Audio mime-types case 'aac': case 'adts': $type = 'audio/acc'; break; case 'aif': case 'aifc': case 'aiff': case 'cdda': $type = 'audio/aiff'; break; case 'bwf': $type = 'audio/wav'; break; case 'kar': case 'mid': case 'midi': case 'smf': $type = 'audio/midi'; break; case 'm4a': $type = 'audio/x-m4a'; break; case 'mp3': case 'swa': $type = 'audio/mp3'; break; case 'wav': $type = 'audio/wav'; break; case 'wax': $type = 'audio/x-ms-wax'; break; case 'wma': $type = 'audio/x-ms-wma'; break; // Video mime-types case '3gp': case '3gpp': $type = 'video/3gpp'; break; case '3g2': case '3gp2': $type = 'video/3gpp2'; break; case 'asf': $type = 'video/x-ms-asf'; break; case 'flv': $type = 'video/x-flv'; break; case 'm1a': case 'm1s': case 'm1v': case 'm15': case 'm75': case 'mp2': case 'mpa': case 'mpeg': case 'mpg': case 'mpm': case 'mpv': $type = 'video/mpeg'; break; case 'm4v': $type = 'video/x-m4v'; break; case 'mov': case 'qt': $type = 'video/quicktime'; break; case 'mp4': case 'mpg4': $type = 'video/mp4'; break; case 'sdv': $type = 'video/sd-video'; break; case 'wm': $type = 'video/x-ms-wm'; break; case 'wmv': $type = 'video/x-ms-wmv'; break; case 'wvx': $type = 'video/x-ms-wvx'; break; // Flash mime-types case 'spl': $type = 'application/futuresplash'; break; case 'swf': $type = 'application/x-shockwave-flash'; break; } } if ($find_handler) { if (in_array($type, $types_flash)) { return 'flash'; } elseif (in_array($type, $types_fmedia)) { return 'fmedia'; } elseif (in_array($type, $types_quicktime)) { return 'quicktime'; } elseif (in_array($type, $types_wmedia)) { return 'wmedia'; } elseif (in_array($type, $types_mp3)) { return 'mp3'; } else { return null; } } else { return $type; } } } class SimplePie_Caption { var $type; var $lang; var $startTime; var $endTime; var $text; // Constructor, used to input the data function SimplePie_Caption($type = null, $lang = null, $startTime = null, $endTime = null, $text = null) { $this->type = $type; $this->lang = $lang; $this->startTime = $startTime; $this->endTime = $endTime; $this->text = $text; } function __toString() { // There is no $this->data here return md5(serialize($this)); } function get_endtime() { if ($this->endTime !== null) { return $this->endTime; } else { return null; } } function get_language() { if ($this->lang !== null) { return $this->lang; } else { return null; } } function get_starttime() { if ($this->startTime !== null) { return $this->startTime; } else { return null; } } function get_text() { if ($this->text !== null) { return $this->text; } else { return null; } } function get_type() { if ($this->type !== null) { return $this->type; } else { return null; } } } class SimplePie_Credit { var $role; var $scheme; var $name; // Constructor, used to input the data function SimplePie_Credit($role = null, $scheme = null, $name = null) { $this->role = $role; $this->scheme = $scheme; $this->name = $name; } function __toString() { // There is no $this->data here return md5(serialize($this)); } function get_role() { if ($this->role !== null) { return $this->role; } else { return null; } } function get_scheme() { if ($this->scheme !== null) { return $this->scheme; } else { return null; } } function get_name() { if ($this->name !== null) { return $this->name; } else { return null; } } } class SimplePie_Copyright { var $url; var $label; // Constructor, used to input the data function SimplePie_Copyright($url = null, $label = null) { $this->url = $url; $this->label = $label; } function __toString() { // There is no $this->data here return md5(serialize($this)); } function get_url() { if ($this->url !== null) { return $this->url; } else { return null; } } function get_attribution() { if ($this->label !== null) { return $this->label; } else { return null; } } } class SimplePie_Rating { var $scheme; var $value; // Constructor, used to input the data function SimplePie_Rating($scheme = null, $value = null) { $this->scheme = $scheme; $this->value = $value; } function __toString() { // There is no $this->data here return md5(serialize($this)); } function get_scheme() { if ($this->scheme !== null) { return $this->scheme; } else { return null; } } function get_value() { if ($this->value !== null) { return $this->value; } else { return null; } } } class SimplePie_Restriction { var $relationship; var $type; var $value; // Constructor, used to input the data function SimplePie_Restriction($relationship = null, $type = null, $value = null) { $this->relationship = $relationship; $this->type = $type; $this->value = $value; } function __toString() { // There is no $this->data here return md5(serialize($this)); } function get_relationship() { if ($this->relationship !== null) { return $this->relationship; } else { return null; } } function get_type() { if ($this->type !== null) { return $this->type; } else { return null; } } function get_value() { if ($this->value !== null) { return $this->value; } else { return null; } } } /** * @todo Move to properly supporting RFC2616 (HTTP/1.1) */ class SimplePie_File { var $url; var $useragent; var $success = true; var $headers = array(); var $body; var $status_code; var $redirects = 0; var $error; var $method = SIMPLEPIE_FILE_SOURCE_NONE; function SimplePie_File($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) { if (class_exists('idna_convert')) { $idn = new idna_convert; $parsed = SimplePie_Misc::parse_url($url); $url = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']); } $this->url = $url; $this->useragent = $useragent; if (preg_match('/^http(s)?:\/\//i', $url)) { if ($useragent === null) { $useragent = ini_get('user_agent'); $this->useragent = $useragent; } if (!is_array($headers)) { $headers = array(); } if (!$force_fsockopen && function_exists('curl_exec')) { $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_CURL; $fp = curl_init(); $headers2 = array(); foreach ($headers as $key => $value) { $headers2[] = "$key: $value"; } if (version_compare(SimplePie_Misc::get_curl_version(), '7.10.5', '>=')) { curl_setopt($fp, CURLOPT_ENCODING, ''); } curl_setopt($fp, CURLOPT_URL, $url); curl_setopt($fp, CURLOPT_HEADER, 1); curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1); curl_setopt($fp, CURLOPT_TIMEOUT, $timeout); curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($fp, CURLOPT_REFERER, $url); curl_setopt($fp, CURLOPT_USERAGENT, $useragent); curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); if (!ini_get('open_basedir') && !ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>=')) { curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects); } $this->headers = curl_exec($fp); if (curl_errno($fp) === 23 || curl_errno($fp) === 61) { curl_setopt($fp, CURLOPT_ENCODING, 'none'); $this->headers = curl_exec($fp); } if (curl_errno($fp)) { $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); $this->success = false; } else { $info = curl_getinfo($fp); curl_close($fp); $this->headers = explode("\r\n\r\n", $this->headers, $info['redirect_count'] + 1); $this->headers = array_pop($this->headers); $parser = new SimplePie_HTTP_Parser($this->headers); if ($parser->parse()) { $this->headers = $parser->headers; $this->body = $parser->body; $this->status_code = $parser->status_code; if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); return $this->SimplePie_File($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); } } } } else { $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN; $url_parts = parse_url($url); if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') { $url_parts['host'] = "ssl://$url_parts[host]"; $url_parts['port'] = 443; } if (!isset($url_parts['port'])) { $url_parts['port'] = 80; } $fp = @fsockopen($url_parts['host'], $url_parts['port'], $errno, $errstr, $timeout); if (!$fp) { $this->error = 'fsockopen error: ' . $errstr; $this->success = false; } else { stream_set_timeout($fp, $timeout); if (isset($url_parts['path'])) { if (isset($url_parts['query'])) { $get = "$url_parts[path]?$url_parts[query]"; } else { $get = $url_parts['path']; } } else { $get = '/'; } $out = "GET $get HTTP/1.0\r\n"; $out .= "Host: $url_parts[host]\r\n"; $out .= "User-Agent: $useragent\r\n"; if (extension_loaded('zlib')) { $out .= "Accept-Encoding: x-gzip,gzip,deflate\r\n"; } if (isset($url_parts['user']) && isset($url_parts['pass'])) { $out .= "Authorization: Basic " . base64_encode("$url_parts[user]:$url_parts[pass]") . "\r\n"; } foreach ($headers as $key => $value) { $out .= "$key: $value\r\n"; } $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); $info = stream_get_meta_data($fp); $this->headers = ''; while (!$info['eof'] && !$info['timed_out']) { $this->headers .= fread($fp, 1160); $info = stream_get_meta_data($fp); } if (!$info['timed_out']) { $parser = new SimplePie_HTTP_Parser($this->headers); if ($parser->parse()) { $this->headers = $parser->headers; $this->body = $parser->body; $this->status_code = $parser->status_code; if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); return $this->SimplePie_File($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); } if (isset($this->headers['content-encoding'])) { // Hey, we act dumb elsewhere, so let's do that here too switch (strtolower(trim($this->headers['content-encoding'], "\x09\x0A\x0D\x20"))) { case 'gzip': case 'x-gzip': $decoder = new SimplePie_gzdecode($this->body); if (!$decoder->parse()) { $this->error = 'Unable to decode HTTP "gzip" stream'; $this->success = false; } else { $this->body = $decoder->data; } break; case 'deflate': if (($body = gzuncompress($this->body)) === false) { if (($body = gzinflate($this->body)) === false) { $this->error = 'Unable to decode HTTP "deflate" stream'; $this->success = false; } } $this->body = $body; break; default: $this->error = 'Unknown content coding'; $this->success = false; } } } } else { $this->error = 'fsocket timed out'; $this->success = false; } fclose($fp); } } } else { $this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS; if (!$this->body = file_get_contents($url)) { $this->error = 'file_get_contents could not read the file'; $this->success = false; } } } } /** * HTTP Response Parser * * @package SimplePie */ class SimplePie_HTTP_Parser { /** * HTTP Version * * @access public * @var float */ var $http_version = 0.0; /** * Status code * * @access public * @var int */ var $status_code = 0; /** * Reason phrase * * @access public * @var string */ var $reason = ''; /** * Key/value pairs of the headers * * @access public * @var array */ var $headers = array(); /** * Body of the response * * @access public * @var string */ var $body = ''; /** * Current state of the state machine * * @access private * @var string */ var $state = 'http_version'; /** * Input data * * @access private * @var string */ var $data = ''; /** * Input data length (to avoid calling strlen() everytime this is needed) * * @access private * @var int */ var $data_length = 0; /** * Current position of the pointer * * @var int * @access private */ var $position = 0; /** * Name of the hedaer currently being parsed * * @access private * @var string */ var $name = ''; /** * Value of the hedaer currently being parsed * * @access private * @var string */ var $value = ''; /** * Create an instance of the class with the input data * * @access public * @param string $data Input data */ function SimplePie_HTTP_Parser($data) { $this->data = $data; $this->data_length = strlen($this->data); } /** * Parse the input data * * @access public * @return bool true on success, false on failure */ function parse() { while ($this->state && $this->state !== 'emit' && $this->has_data()) { $state = $this->state; $this->$state(); } $this->data = ''; if ($this->state === 'emit' || $this->state === 'body') { return true; } else { $this->http_version = ''; $this->status_code = ''; $this->reason = ''; $this->headers = array(); $this->body = ''; return false; } } /** * Check whether there is data beyond the pointer * * @access private * @return bool true if there is further data, false if not */ function has_data() { return (bool) ($this->position < $this->data_length); } /** * See if the next character is LWS * * @access private * @return bool true if the next character is LWS, false if not */ function is_linear_whitespace() { return (bool) ($this->data[$this->position] === "\x09" || $this->data[$this->position] === "\x20" || ($this->data[$this->position] === "\x0A" && isset($this->data[$this->position + 1]) && ($this->data[$this->position + 1] === "\x09" || $this->data[$this->position + 1] === "\x20"))); } /** * Parse the HTTP version * * @access private */ function http_version() { if (strpos($this->data, "\x0A") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/') { $len = strspn($this->data, '0123456789.', 5); $this->http_version = substr($this->data, 5, $len); $this->position += 5 + $len; if (substr_count($this->http_version, '.') <= 1) { $this->http_version = (float) $this->http_version; $this->position += strspn($this->data, "\x09\x20", $this->position); $this->state = 'status'; } else { $this->state = false; } } else { $this->state = false; } } /** * Parse the status code * * @access private */ function status() { if ($len = strspn($this->data, '0123456789', $this->position)) { $this->status_code = (int) substr($this->data, $this->position, $len); $this->position += $len; $this->state = 'reason'; } else { $this->state = false; } } /** * Parse the reason phrase * * @access private */ function reason() { $len = strcspn($this->data, "\x0A", $this->position); $this->reason = trim(substr($this->data, $this->position, $len), "\x09\x0D\x20"); $this->position += $len + 1; $this->state = 'new_line'; } /** * Deal with a new line, shifting data around as needed * * @access private */ function new_line() { $this->value = trim($this->value, "\x0D\x20"); if ($this->name !== '' && $this->value !== '') { $this->name = strtolower($this->name); if (isset($this->headers[$this->name])) { $this->headers[$this->name] .= ', ' . $this->value; } else { $this->headers[$this->name] = $this->value; } } $this->name = ''; $this->value = ''; if (substr($this->data[$this->position], 0, 2) === "\x0D\x0A") { $this->position += 2; $this->state = 'body'; } elseif ($this->data[$this->position] === "\x0A") { $this->position++; $this->state = 'body'; } else { $this->state = 'name'; } } /** * Parse a header name * * @access private */ function name() { $len = strcspn($this->data, "\x0A:", $this->position); if (isset($this->data[$this->position + $len])) { if ($this->data[$this->position + $len] === "\x0A") { $this->position += $len; $this->state = 'new_line'; } else { $this->name = substr($this->data, $this->position, $len); $this->position += $len + 1; $this->state = 'value'; } } else { $this->state = false; } } /** * Parse LWS, replacing consecutive LWS characters with a single space * * @access private */ function linear_whitespace() { do { if (substr($this->data, $this->position, 2) === "\x0D\x0A") { $this->position += 2; } elseif ($this->data[$this->position] === "\x0A") { $this->position++; } $this->position += strspn($this->data, "\x09\x20", $this->position); } while ($this->has_data() && $this->is_linear_whitespace()); $this->value .= "\x20"; } /** * See what state to move to while within non-quoted header values * * @access private */ function value() { if ($this->is_linear_whitespace()) { $this->linear_whitespace(); } else { switch ($this->data[$this->position]) { case '"': $this->position++; $this->state = 'quote'; break; case "\x0A": $this->position++; $this->state = 'new_line'; break; default: $this->state = 'value_char'; break; } } } /** * Parse a header value while outside quotes * * @access private */ function value_char() { $len = strcspn($this->data, "\x09\x20\x0A\"", $this->position); $this->value .= substr($this->data, $this->position, $len); $this->position += $len; $this->state = 'value'; } /** * See what state to move to while within quoted header values * * @access private */ function quote() { if ($this->is_linear_whitespace()) { $this->linear_whitespace(); } else { switch ($this->data[$this->position]) { case '"': $this->position++; $this->state = 'value'; break; case "\x0A": $this->position++; $this->state = 'new_line'; break; case '\\': $this->position++; $this->state = 'quote_escaped'; break; default: $this->state = 'quote_char'; break; } } } /** * Parse a header value while within quotes * * @access private */ function quote_char() { $len = strcspn($this->data, "\x09\x20\x0A\"\\", $this->position); $this->value .= substr($this->data, $this->position, $len); $this->position += $len; $this->state = 'value'; } /** * Parse an escaped character within quotes * * @access private */ function quote_escaped() { $this->value .= $this->data[$this->position]; $this->position++; $this->state = 'quote'; } /** * Parse the body * * @access private */ function body() { $this->body = substr($this->data, $this->position); $this->state = 'emit'; } } /** * gzdecode * * @package SimplePie */ class SimplePie_gzdecode { /** * Compressed data * * @access private * @see gzdecode::$data */ var $compressed_data; /** * Size of compressed data * * @access private */ var $compressed_size; /** * Minimum size of a valid gzip string * * @access private */ var $min_compressed_size = 18; /** * Current position of pointer * * @access private */ var $position = 0; /** * Flags (FLG) * * @access private */ var $flags; /** * Uncompressed data * * @access public * @see gzdecode::$compressed_data */ var $data; /** * Modified time * * @access public */ var $MTIME; /** * Extra Flags * * @access public */ var $XFL; /** * Operating System * * @access public */ var $OS; /** * Subfield ID 1 * * @access public * @see gzdecode::$extra_field * @see gzdecode::$SI2 */ var $SI1; /** * Subfield ID 2 * * @access public * @see gzdecode::$extra_field * @see gzdecode::$SI1 */ var $SI2; /** * Extra field content * * @access public * @see gzdecode::$SI1 * @see gzdecode::$SI2 */ var $extra_field; /** * Original filename * * @access public */ var $filename; /** * Human readable comment * * @access public */ var $comment; /** * Don't allow anything to be set * * @access public */ function __set($name, $value) { trigger_error("Cannot write property $name", E_USER_ERROR); } /** * Set the compressed string and related properties * * @access public */ function SimplePie_gzdecode($data) { $this->compressed_data = $data; $this->compressed_size = strlen($data); } /** * Decode the GZIP stream * * @access public */ function parse() { if ($this->compressed_size >= $this->min_compressed_size) { // Check ID1, ID2, and CM if (substr($this->compressed_data, 0, 3) !== "\x1F\x8B\x08") { return false; } // Get the FLG (FLaGs) $this->flags = ord($this->compressed_data[3]); // FLG bits above (1 << 4) are reserved if ($this->flags > 0x1F) { return false; } // Advance the pointer after the above $this->position += 4; // MTIME $mtime = substr($this->compressed_data, $this->position, 4); // Reverse the string if we're on a big-endian arch because l is the only signed long and is machine endianness if (current(unpack('S', "\x00\x01")) === 1) { $mtime = strrev($mtime); } $this->MTIME = current(unpack('l', $mtime)); $this->position += 4; // Get the XFL (eXtra FLags) $this->XFL = ord($this->compressed_data[$this->position++]); // Get the OS (Operating System) $this->OS = ord($this->compressed_data[$this->position++]); // Parse the FEXTRA if ($this->flags & 4) { // Read subfield IDs $this->SI1 = $this->compressed_data[$this->position++]; $this->SI2 = $this->compressed_data[$this->position++]; // SI2 set to zero is reserved for future use if ($this->SI2 === "\x00") { return false; } // Get the length of the extra field $len = current(unpack('v', substr($this->compressed_data, $this->position, 2))); $position += 2; // Check the length of the string is still valid $this->min_compressed_size += $len + 4; if ($this->compressed_size >= $this->min_compressed_size) { // Set the extra field to the given data $this->extra_field = substr($this->compressed_data, $this->position, $len); $this->position += $len; } else { return false; } } // Parse the FNAME if ($this->flags & 8) { // Get the length of the filename $len = strcspn($this->compressed_data, "\x00", $this->position); // Check the length of the string is still valid $this->min_compressed_size += $len + 1; if ($this->compressed_size >= $this->min_compressed_size) { // Set the original filename to the given string $this->filename = substr($this->compressed_data, $this->position, $len); $this->position += $len + 1; } else { return false; } } // Parse the FCOMMENT if ($this->flags & 16) { // Get the length of the comment $len = strcspn($this->compressed_data, "\x00", $this->position); // Check the length of the string is still valid $this->min_compressed_size += $len + 1; if ($this->compressed_size >= $this->min_compressed_size) { // Set the original comment to the given string $this->comment = substr($this->compressed_data, $this->position, $len); $this->position += $len + 1; } else { return false; } } // Parse the FHCRC if ($this->flags & 2) { // Check the length of the string is still valid $this->min_compressed_size += $len + 2; if ($this->compressed_size >= $this->min_compressed_size) { // Read the CRC $crc = current(unpack('v', substr($this->compressed_data, $this->position, 2))); // Check the CRC matches if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc) { $this->position += 2; } else { return false; } } else { return false; } } // Decompress the actual data if (($this->data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false) { return false; } else { $this->position = $this->compressed_size - 8; } // Check CRC of data $crc = current(unpack('V', substr($this->compressed_data, $this->position, 4))); $this->position += 4; /*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc)) { return false; }*/ // Check ISIZE of data $isize = current(unpack('V', substr($this->compressed_data, $this->position, 4))); $this->position += 4; if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize)) { return false; } // Wow, against all odds, we've actually got a valid gzip string return true; } else { return false; } } } class SimplePie_Cache { /** * Don't call the constructor. Please. * * @access private */ function SimplePie_Cache() { trigger_error('Please call SimplePie_Cache::create() instead of the constructor', E_USER_ERROR); } /** * Create a new SimplePie_Cache object * * @static * @access public */ function create($location, $filename, $extension) { $location_iri = new SimplePie_IRI($location); switch ($location_iri->get_scheme()) { case 'mysql': if (extension_loaded('mysql')) { return new SimplePie_Cache_MySQL($location_iri, $filename, $extension); } break; default: return new SimplePie_Cache_File($location, $filename, $extension); } } } class SimplePie_Cache_File { var $location; var $filename; var $extension; var $name; function SimplePie_Cache_File($location, $filename, $extension) { $this->location = $location; $this->filename = $filename; $this->extension = $extension; $this->name = "$this->location/$this->filename.$this->extension"; } function save($data) { if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location)) { if (is_a($data, 'SimplePie')) { $data = $data->data; } $data = serialize($data); if (function_exists('file_put_contents')) { return (bool) file_put_contents($this->name, $data); } else { $fp = fopen($this->name, 'wb'); if ($fp) { fwrite($fp, $data); fclose($fp); return true; } } } return false; } function load() { if (file_exists($this->name) && is_readable($this->name)) { return unserialize(file_get_contents($this->name)); } return false; } function mtime() { if (file_exists($this->name)) { return filemtime($this->name); } return false; } function touch() { if (file_exists($this->name)) { return touch($this->name); } return false; } function unlink() { if (file_exists($this->name)) { return unlink($this->name); } return false; } } class SimplePie_Cache_DB { function prepare_simplepie_object_for_cache($data) { $items = $data->get_items(); $items_by_id = array(); if (!empty($items)) { foreach ($items as $item) { $items_by_id[$item->get_id()] = $item; } if (count($items_by_id) !== count($items)) { $items_by_id = array(); foreach ($items as $item) { $items_by_id[$item->get_id(true)] = $item; } } if (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) { $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; } elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) { $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; } elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) { $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; } elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0])) { $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]; } else { $channel = null; } if ($channel !== null) { if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']); } if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']); } if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']); } if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']); } if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item'])) { unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']); } } if (isset($data->data['items'])) { unset($data->data['items']); } if (isset($data->data['ordered_items'])) { unset($data->data['ordered_items']); } } return array(serialize($data->data), $items_by_id); } } class SimplePie_Cache_MySQL extends SimplePie_Cache_DB { var $mysql; var $options; var $id; function SimplePie_Cache_MySQL($mysql_location, $name, $extension) { $host = $mysql_location->get_host(); if (SimplePie_Misc::stripos($host, 'unix(') === 0 && substr($host, -1) === ')') { $server = ':' . substr($host, 5, -1); } else { $server = $host; if ($mysql_location->get_port() !== null) { $server .= ':' . $mysql_location->get_port(); } } if (strpos($mysql_location->get_userinfo(), ':') !== false) { list($username, $password) = explode(':', $mysql_location->get_userinfo(), 2); } else { $username = $mysql_location->get_userinfo(); $password = null; } if ($this->mysql = mysql_connect($server, $username, $password)) { $this->id = $name . $extension; $this->options = SimplePie_Misc::parse_str($mysql_location->get_query()); if (!isset($this->options['prefix'][0])) { $this->options['prefix'][0] = ''; } if (mysql_select_db(ltrim($mysql_location->get_path(), '/')) && mysql_query('SET NAMES utf8') && ($query = mysql_unbuffered_query('SHOW TABLES'))) { $db = array(); while ($row = mysql_fetch_row($query)) { $db[] = $row[0]; } if (!in_array($this->options['prefix'][0] . 'cache_data', $db)) { if (!mysql_query('CREATE TABLE `' . $this->options['prefix'][0] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))')) { $this->mysql = null; } } if (!in_array($this->options['prefix'][0] . 'items', $db)) { if (!mysql_query('CREATE TABLE `' . $this->options['prefix'][0] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` TEXT CHARACTER SET utf8 NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))')) { $this->mysql = null; } } } else { $this->mysql = null; } } } function save($data) { if ($this->mysql) { $feed_id = "'" . mysql_real_escape_string($this->id) . "'"; if (is_a($data, 'SimplePie')) { if (SIMPLEPIE_PHP5) { // This keyword needs to defy coding standards for PHP4 compatibility $data = clone($data); } $prepared = $this->prepare_simplepie_object_for_cache($data); if ($query = mysql_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = ' . $feed_id, $this->mysql)) { if (mysql_num_rows($query)) { $items = count($prepared[1]); if ($items) { $sql = 'UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `items` = ' . $items . ', `data` = \'' . mysql_real_escape_string($prepared[0]) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id; } else { $sql = 'UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `data` = \'' . mysql_real_escape_string($prepared[0]) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id; } if (!mysql_query($sql, $this->mysql)) { return false; } } elseif (!mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(' . $feed_id . ', ' . count($prepared[1]) . ', \'' . mysql_real_escape_string($prepared[0]) . '\', ' . time() . ')', $this->mysql)) { return false; } $ids = array_keys($prepared[1]); if (!empty($ids)) { foreach ($ids as $id) { $database_ids[] = mysql_real_escape_string($id); } if ($query = mysql_unbuffered_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'items` WHERE `id` = \'' . implode('\' OR `id` = \'', $database_ids) . '\' AND `feed_id` = ' . $feed_id, $this->mysql)) { $existing_ids = array(); while ($row = mysql_fetch_row($query)) { $existing_ids[] = $row[0]; } $new_ids = array_diff($ids, $existing_ids); foreach ($new_ids as $new_id) { if (!($date = $prepared[1][$new_id]->get_date('U'))) { $date = time(); } if (!mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(' . $feed_id . ', \'' . mysql_real_escape_string($new_id) . '\', \'' . mysql_real_escape_string(serialize($prepared[1][$new_id]->data)) . '\', ' . $date . ')', $this->mysql)) { return false; } } return true; } } else { return true; } } } elseif ($query = mysql_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = ' . $feed_id, $this->mysql)) { if (mysql_num_rows($query)) { if (mysql_query('UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `items` = 0, `data` = \'' . mysql_real_escape_string(serialize($data)) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id, $this->mysql)) { return true; } } elseif (mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(\'' . mysql_real_escape_string($this->id) . '\', 0, \'' . mysql_real_escape_string(serialize($data)) . '\', ' . time() . ')', $this->mysql)) { return true; } } } return false; } function load() { if ($this->mysql && ($query = mysql_query('SELECT `items`, `data` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($row = mysql_fetch_row($query))) { $data = unserialize($row[1]); if (isset($this->options['items'][0])) { $items = (int) $this->options['items'][0]; } else { $items = (int) $row[0]; } if ($items !== 0) { if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0])) { $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]; } elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0])) { $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]; } elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0])) { $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]; } elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0])) { $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]; } else { $feed = null; } if ($feed !== null) { $sql = 'SELECT `data` FROM `' . $this->options['prefix'][0] . 'items` WHERE `feed_id` = \'' . mysql_real_escape_string($this->id) . '\' ORDER BY `posted` DESC'; if ($items > 0) { $sql .= ' LIMIT ' . $items; } if ($query = mysql_unbuffered_query($sql, $this->mysql)) { while ($row = mysql_fetch_row($query)) { $feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row[0]); } } else { return false; } } } return $data; } return false; } function mtime() { if ($this->mysql && ($query = mysql_query('SELECT `mtime` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($row = mysql_fetch_row($query))) { return $row[0]; } else { return false; } } function touch() { if ($this->mysql && ($query = mysql_query('UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `mtime` = ' . time() . ' WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && mysql_affected_rows($this->mysql)) { return true; } else { return false; } } function unlink() { if ($this->mysql && ($query = mysql_query('DELETE FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($query2 = mysql_query('DELETE FROM `' . $this->options['prefix'][0] . 'items` WHERE `feed_id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql))) { return true; } else { return false; } } } class SimplePie_Misc { function time_hms($seconds) { $time = ''; $hours = floor($seconds / 3600); $remainder = $seconds % 3600; if ($hours > 0) { $time .= $hours.':'; } $minutes = floor($remainder / 60); $seconds = $remainder % 60; if ($minutes < 10 && $hours > 0) { $minutes = '0' . $minutes; } if ($seconds < 10) { $seconds = '0' . $seconds; } $time .= $minutes.':'; $time .= $seconds; return $time; } function absolutize_url($relative, $base) { $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative); return $iri->get_iri(); } function remove_dot_segments($input) { $output = ''; while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') { // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, if (strpos($input, '../') === 0) { $input = substr($input, 3); } elseif (strpos($input, './') === 0) { $input = substr($input, 2); } // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise, elseif (strpos($input, '/./') === 0) { $input = substr_replace($input, '/', 0, 3); } elseif ($input === '/.') { $input = '/'; } // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, elseif (strpos($input, '/../') === 0) { $input = substr_replace($input, '/', 0, 4); $output = substr_replace($output, '', strrpos($output, '/')); } elseif ($input === '/..') { $input = '/'; $output = substr_replace($output, '', strrpos($output, '/')); } // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, elseif ($input === '.' || $input === '..') { $input = ''; } // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer elseif (($pos = strpos($input, '/', 1)) !== false) { $output .= substr($input, 0, $pos); $input = substr_replace($input, '', 0, $pos); } else { $output .= $input; $input = ''; } } return $output . $input; } function get_element($realname, $string) { $return = array(); $name = preg_quote($realname, '/'); if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++) { $return[$i]['tag'] = $realname; $return[$i]['full'] = $matches[$i][0][0]; $return[$i]['offset'] = $matches[$i][0][1]; if (strlen($matches[$i][3][0]) <= 2) { $return[$i]['self_closing'] = true; } else { $return[$i]['self_closing'] = false; $return[$i]['content'] = $matches[$i][4][0]; } $return[$i]['attribs'] = array(); if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER)) { for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++) { if (count($attribs[$j]) === 2) { $attribs[$j][2] = $attribs[$j][1]; } $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]), 'UTF-8'); } } } } return $return; } function element_implode($element) { $full = "<$element[tag]"; foreach ($element['attribs'] as $key => $value) { $key = strtolower($key); $full .= " $key=\"" . htmlspecialchars($value['data']) . '"'; } if ($element['self_closing']) { $full .= ' />'; } else { $full .= ">$element[content]</$element[tag]>"; } return $full; } function error($message, $level, $file, $line) { if ((ini_get('error_reporting') & $level) > 0) { switch ($level) { case E_USER_ERROR: $note = 'PHP Error'; break; case E_USER_WARNING: $note = 'PHP Warning'; break; case E_USER_NOTICE: $note = 'PHP Notice'; break; default: $note = 'Unknown Error'; break; } error_log("$note: $message in $file on line $line", 0); } return $message; } /** * If a file has been cached, retrieve and display it. * * This is most useful for caching images (get_favicon(), etc.), * however it works for all cached files. This WILL NOT display ANY * file/image/page/whatever, but rather only display what has already * been cached by SimplePie. * * @access public * @see SimplePie::get_favicon() * @param str $identifier_url URL that is used to identify the content. * This may or may not be the actual URL of the live content. * @param str $cache_location Location of SimplePie's cache. Defaults * to './cache'. * @param str $cache_extension The file extension that the file was * cached with. Defaults to 'spc'. * @param str $cache_class Name of the cache-handling class being used * in SimplePie. Defaults to 'SimplePie_Cache', and should be left * as-is unless you've overloaded the class. * @param str $cache_name_function Obsolete. Exists for backwards * compatibility reasons only. */ function display_cached_file($identifier_url, $cache_location = './cache', $cache_extension = 'spc', $cache_class = 'SimplePie_Cache', $cache_name_function = 'md5') { $cache = call_user_func(array($cache_class, 'create'), $cache_location, $identifier_url, $cache_extension); if ($file = $cache->load()) { if (isset($file['headers']['content-type'])) { header('Content-type:' . $file['headers']['content-type']); } else { header('Content-type: application/octet-stream'); } header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days echo $file['body']; exit; } die('Cached file for ' . $identifier_url . ' cannot be found.'); } function fix_protocol($url, $http = 1) { $url = SimplePie_Misc::normalize_url($url); $parsed = SimplePie_Misc::parse_url($url); if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https') { return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http); } if ($parsed['scheme'] === '' && $parsed['authority'] === '' && !file_exists($url)) { return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http); } if ($http === 2 && $parsed['scheme'] !== '') { return "feed:$url"; } elseif ($http === 3 && strtolower($parsed['scheme']) === 'http') { return substr_replace($url, 'podcast', 0, 4); } elseif ($http === 4 && strtolower($parsed['scheme']) === 'http') { return substr_replace($url, 'itpc', 0, 4); } else { return $url; } } function parse_url($url) { $iri = new SimplePie_IRI($url); return array( 'scheme' => (string) $iri->get_scheme(), 'authority' => (string) $iri->get_authority(), 'path' => (string) $iri->get_path(), 'query' => (string) $iri->get_query(), 'fragment' => (string) $iri->get_fragment() ); } function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '') { $iri = new SimplePie_IRI(''); $iri->set_scheme($scheme); $iri->set_authority($authority); $iri->set_path($path); $iri->set_query($query); $iri->set_fragment($fragment); return $iri->get_iri(); } function normalize_url($url) { $iri = new SimplePie_IRI($url); return $iri->get_iri(); } function percent_encoding_normalization($match) { $integer = hexdec($match[1]); if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E) { return chr($integer); } else { return strtoupper($match[0]); } } /** * Remove bad UTF-8 bytes * * PCRE Pattern to locate bad bytes in a UTF-8 string comes from W3C * FAQ: Multilingual Forms (modified to include full ASCII range) * * @author Geoffrey Sneddon * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @param string $str String to remove bad UTF-8 bytes from * @return string UTF-8 string */ function utf8_bad_replace($str) { if (function_exists('iconv') && ($return = @iconv('UTF-8', 'UTF-8//IGNORE', $str))) { return $return; } elseif (function_exists('mb_convert_encoding') && ($return = @mb_convert_encoding($str, 'UTF-8', 'UTF-8'))) { return $return; } elseif (preg_match_all('/(?:[\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})+/', $str, $matches)) { return implode("\xEF\xBF\xBD", $matches[0]); } elseif ($str !== '') { return "\xEF\xBF\xBD"; } else { return ''; } } /** * Converts a Windows-1252 encoded string to a UTF-8 encoded string * * @static * @access public * @param string $string Windows-1252 encoded string * @return string UTF-8 encoded string */ function windows_1252_to_utf8($string) { static $convert_table = array("\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF"); return strtr($string, $convert_table); } function change_encoding($data, $input, $output) { $input = SimplePie_Misc::encoding($input); $output = SimplePie_Misc::encoding($output); // We fail to fail on non US-ASCII bytes if ($input === 'US-ASCII') { static $non_ascii_octects = ''; if (!$non_ascii_octects) { for ($i = 0x80; $i <= 0xFF; $i++) { $non_ascii_octects .= chr($i); } } $data = substr($data, 0, strcspn($data, $non_ascii_octects)); } // This is first, as behaviour of this is completely predictable if ($input === 'Windows-1252' && $output === 'UTF-8') { return SimplePie_Misc::windows_1252_to_utf8($data); } // This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported). elseif (function_exists('mb_convert_encoding') && @mb_convert_encoding("\x80", 'UTF-16BE', $input) !== "\x00\x80" && ($return = @mb_convert_encoding($data, $output, $input))) { return $return; } // This is last, as behaviour of this varies with OS userland and PHP version elseif (function_exists('iconv') && ($return = @iconv($input, $output, $data))) { return $return; } // If we can't do anything, just fail else { return false; } } function encoding($charset) { // Normalization from UTS #22 switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset))) { case 'adobestandardencoding': case 'csadobestandardencoding': return 'Adobe-Standard-Encoding'; case 'adobesymbolencoding': case 'cshppsmath': return 'Adobe-Symbol-Encoding'; case 'ami1251': case 'amiga1251': return 'Amiga-1251'; case 'ansix31101983': case 'csat5001983': case 'csiso99naplps': case 'isoir99': case 'naplps': return 'ANSI_X3.110-1983'; case 'arabic7': case 'asmo449': case 'csiso89asmo449': case 'iso9036': case 'isoir89': return 'ASMO_449'; case 'big5': case 'csbig5': case 'xxbig5': return 'Big5'; case 'big5hkscs': return 'Big5-HKSCS'; case 'bocu1': case 'csbocu1': return 'BOCU-1'; case 'brf': case 'csbrf': return 'BRF'; case 'bs4730': case 'csiso4unitedkingdom': case 'gb': case 'iso646gb': case 'isoir4': case 'uk': return 'BS_4730'; case 'bsviewdata': case 'csiso47bsviewdata': case 'isoir47': return 'BS_viewdata'; case 'cesu8': case 'cscesu8': return 'CESU-8'; case 'ca': case 'csa71': case 'csaz243419851': case 'csiso121canadian1': case 'iso646ca': case 'isoir121': return 'CSA_Z243.4-1985-1'; case 'csa72': case 'csaz243419852': case 'csiso122canadian2': case 'iso646ca2': case 'isoir122': return 'CSA_Z243.4-1985-2'; case 'csaz24341985gr': case 'csiso123csaz24341985gr': case 'isoir123': return 'CSA_Z243.4-1985-gr'; case 'csiso139csn369103': case 'csn369103': case 'isoir139': return 'CSN_369103'; case 'csdecmcs': case 'dec': case 'decmcs': return 'DEC-MCS'; case 'csiso21german': case 'de': case 'din66003': case 'iso646de': case 'isoir21': return 'DIN_66003'; case 'csdkus': case 'dkus': return 'dk-us'; case 'csiso646danish': case 'dk': case 'ds2089': case 'iso646dk': return 'DS_2089'; case 'csibmebcdicatde': case 'ebcdicatde': return 'EBCDIC-AT-DE'; case 'csebcdicatdea': case 'ebcdicatdea': return 'EBCDIC-AT-DE-A'; case 'csebcdiccafr': case 'ebcdiccafr': return 'EBCDIC-CA-FR'; case 'csebcdicdkno': case 'ebcdicdkno': return 'EBCDIC-DK-NO'; case 'csebcdicdknoa': case 'ebcdicdknoa': return 'EBCDIC-DK-NO-A'; case 'csebcdices': case 'ebcdices': return 'EBCDIC-ES'; case 'csebcdicesa': case 'ebcdicesa': return 'EBCDIC-ES-A'; case 'csebcdicess': case 'ebcdicess': return 'EBCDIC-ES-S'; case 'csebcdicfise': case 'ebcdicfise': return 'EBCDIC-FI-SE'; case 'csebcdicfisea': case 'ebcdicfisea': return 'EBCDIC-FI-SE-A'; case 'csebcdicfr': case 'ebcdicfr': return 'EBCDIC-FR'; case 'csebcdicit': case 'ebcdicit': return 'EBCDIC-IT'; case 'csebcdicpt': case 'ebcdicpt': return 'EBCDIC-PT'; case 'csebcdicuk': case 'ebcdicuk': return 'EBCDIC-UK'; case 'csebcdicus': case 'ebcdicus': return 'EBCDIC-US'; case 'csiso111ecmacyrillic': case 'ecmacyrillic': case 'isoir111': case 'koi8e': return 'ECMA-cyrillic'; case 'csiso17spanish': case 'es': case 'iso646es': case 'isoir17': return 'ES'; case 'csiso85spanish2': case 'es2': case 'iso646es2': case 'isoir85': return 'ES2'; case 'cseucfixwidjapanese': case 'extendedunixcodefixedwidthforjapanese': return 'Extended_UNIX_Code_Fixed_Width_for_Japanese'; case 'cseucpkdfmtjapanese': case 'eucjp': case 'extendedunixcodepackedformatforjapanese': return 'Extended_UNIX_Code_Packed_Format_for_Japanese'; case 'gb18030': return 'GB18030'; case 'chinese': case 'cp936': case 'csgb2312': case 'csiso58gb231280': case 'gb2312': case 'gb231280': case 'gbk': case 'isoir58': case 'ms936': case 'windows936': return 'GBK'; case 'cn': case 'csiso57gb1988': case 'gb198880': case 'iso646cn': case 'isoir57': return 'GB_1988-80'; case 'csiso153gost1976874': case 'gost1976874': case 'isoir153': case 'stsev35888': return 'GOST_19768-74'; case 'csiso150': case 'csiso150greekccitt': case 'greekccitt': case 'isoir150': return 'greek-ccitt'; case 'csiso88greek7': case 'greek7': case 'isoir88': return 'greek7'; case 'csiso18greek7old': case 'greek7old': case 'isoir18': return 'greek7-old'; case 'cshpdesktop': case 'hpdesktop': return 'HP-DeskTop'; case 'cshplegal': case 'hplegal': return 'HP-Legal'; case 'cshpmath8': case 'hpmath8': return 'HP-Math8'; case 'cshppifont': case 'hppifont': return 'HP-Pi-font'; case 'cshproman8': case 'hproman8': case 'r8': case 'roman8': return 'hp-roman8'; case 'hzgb2312': return 'HZ-GB-2312'; case 'csibmsymbols': case 'ibmsymbols': return 'IBM-Symbols'; case 'csibmthai': case 'ibmthai': return 'IBM-Thai'; case 'ccsid858': case 'cp858': case 'ibm858': case 'pcmultilingual850euro': return 'IBM00858'; case 'ccsid924': case 'cp924': case 'ebcdiclatin9euro': case 'ibm924': return 'IBM00924'; case 'ccsid1140': case 'cp1140': case 'ebcdicus37euro': case 'ibm1140': return 'IBM01140'; case 'ccsid1141': case 'cp1141': case 'ebcdicde273euro': case 'ibm1141': return 'IBM01141'; case 'ccsid1142': case 'cp1142': case 'ebcdicdk277euro': case 'ebcdicno277euro': case 'ibm1142': return 'IBM01142'; case 'ccsid1143': case 'cp1143': case 'ebcdicfi278euro': case 'ebcdicse278euro': case 'ibm1143': return 'IBM01143'; case 'ccsid1144': case 'cp1144': case 'ebcdicit280euro': case 'ibm1144': return 'IBM01144'; case 'ccsid1145': case 'cp1145': case 'ebcdices284euro': case 'ibm1145': return 'IBM01145'; case 'ccsid1146': case 'cp1146': case 'ebcdicgb285euro': case 'ibm1146': return 'IBM01146'; case 'ccsid1147': case 'cp1147': case 'ebcdicfr297euro': case 'ibm1147': return 'IBM01147'; case 'ccsid1148': case 'cp1148': case 'ebcdicinternational500euro': case 'ibm1148': return 'IBM01148'; case 'ccsid1149': case 'cp1149': case 'ebcdicis871euro': case 'ibm1149': return 'IBM01149'; case 'cp37': case 'csibm37': case 'ebcdiccpca': case 'ebcdiccpnl': case 'ebcdiccpus': case 'ebcdiccpwt': case 'ibm37': return 'IBM037'; case 'cp38': case 'csibm38': case 'ebcdicint': case 'ibm38': return 'IBM038'; case 'cp273': case 'csibm273': case 'ibm273': return 'IBM273'; case 'cp274': case 'csibm274': case 'ebcdicbe': case 'ibm274': return 'IBM274'; case 'cp275': case 'csibm275': case 'ebcdicbr': case 'ibm275': return 'IBM275'; case 'csibm277': case 'ebcdiccpdk': case 'ebcdiccpno': case 'ibm277': return 'IBM277'; case 'cp278': case 'csibm278': case 'ebcdiccpfi': case 'ebcdiccpse': case 'ibm278': return 'IBM278'; case 'cp280': case 'csibm280': case 'ebcdiccpit': case 'ibm280': return 'IBM280'; case 'cp281': case 'csibm281': case 'ebcdicjpe': case 'ibm281': return 'IBM281'; case 'cp284': case 'csibm284': case 'ebcdiccpes': case 'ibm284': return 'IBM284'; case 'cp285': case 'csibm285': case 'ebcdiccpgb': case 'ibm285': return 'IBM285'; case 'cp290': case 'csibm290': case 'ebcdicjpkana': case 'ibm290': return 'IBM290'; case 'cp297': case 'csibm297': case 'ebcdiccpfr': case 'ibm297': return 'IBM297'; case 'cp420': case 'csibm420': case 'ebcdiccpar1': case 'ibm420': return 'IBM420'; case 'cp423': case 'csibm423': case 'ebcdiccpgr': case 'ibm423': return 'IBM423'; case 'cp424': case 'csibm424': case 'ebcdiccphe': case 'ibm424': return 'IBM424'; case '437': case 'cp437': case 'cspc8codepage437': case 'ibm437': return 'IBM437'; case 'cp500': case 'csibm500': case 'ebcdiccpbe': case 'ebcdiccpch': case 'ibm500': return 'IBM500'; case 'cp775': case 'cspc775baltic': case 'ibm775': return 'IBM775'; case '850': case 'cp850': case 'cspc850multilingual': case 'ibm850': return 'IBM850'; case '851': case 'cp851': case 'csibm851': case 'ibm851': return 'IBM851'; case '852': case 'cp852': case 'cspcp852': case 'ibm852': return 'IBM852'; case '855': case 'cp855': case 'csibm855': case 'ibm855': return 'IBM855'; case '857': case 'cp857': case 'csibm857': case 'ibm857': return 'IBM857'; case '860': case 'cp860': case 'csibm860': case 'ibm860': return 'IBM860'; case '861': case 'cp861': case 'cpis': case 'csibm861': case 'ibm861': return 'IBM861'; case '862': case 'cp862': case 'cspc862latinhebrew': case 'ibm862': return 'IBM862'; case '863': case 'cp863': case 'csibm863': case 'ibm863': return 'IBM863'; case 'cp864': case 'csibm864': case 'ibm864': return 'IBM864'; case '865': case 'cp865': case 'csibm865': case 'ibm865': return 'IBM865'; case '866': case 'cp866': case 'csibm866': case 'ibm866': return 'IBM866'; case 'cp868': case 'cpar': case 'csibm868': case 'ibm868': return 'IBM868'; case '869': case 'cp869': case 'cpgr': case 'csibm869': case 'ibm869': return 'IBM869'; case 'cp870': case 'csibm870': case 'ebcdiccproece': case 'ebcdiccpyu': case 'ibm870': return 'IBM870'; case 'cp871': case 'csibm871': case 'ebcdiccpis': case 'ibm871': return 'IBM871'; case 'cp880': case 'csibm880': case 'ebcdiccyrillic': case 'ibm880': return 'IBM880'; case 'cp891': case 'csibm891': case 'ibm891': return 'IBM891'; case 'cp903': case 'csibm903': case 'ibm903': return 'IBM903'; case '904': case 'cp904': case 'csibbm904': case 'ibm904': return 'IBM904'; case 'cp905': case 'csibm905': case 'ebcdiccptr': case 'ibm905': return 'IBM905'; case 'cp918': case 'csibm918': case 'ebcdiccpar2': case 'ibm918': return 'IBM918'; case 'cp1026': case 'csibm1026': case 'ibm1026': return 'IBM1026'; case 'ibm1047': return 'IBM1047'; case 'csiso143iecp271': case 'iecp271': case 'isoir143': return 'IEC_P27-1'; case 'csiso49inis': case 'inis': case 'isoir49': return 'INIS'; case 'csiso50inis8': case 'inis8': case 'isoir50': return 'INIS-8'; case 'csiso51iniscyrillic': case 'iniscyrillic': case 'isoir51': return 'INIS-cyrillic'; case 'csinvariant': case 'invariant': return 'INVARIANT'; case 'iso2022cn': return 'ISO-2022-CN'; case 'iso2022cnext': return 'ISO-2022-CN-EXT'; case 'csiso2022jp': case 'iso2022jp': return 'ISO-2022-JP'; case 'csiso2022jp2': case 'iso2022jp2': return 'ISO-2022-JP-2'; case 'csiso2022kr': case 'iso2022kr': return 'ISO-2022-KR'; case 'cswindows30latin1': case 'iso88591windows30latin1': return 'ISO-8859-1-Windows-3.0-Latin-1'; case 'cswindows31latin1': case 'iso88591windows31latin1': return 'ISO-8859-1-Windows-3.1-Latin-1'; case 'csisolatin2': case 'iso88592': case 'iso885921987': case 'isoir101': case 'l2': case 'latin2': return 'ISO-8859-2'; case 'cswindows31latin2': case 'iso88592windowslatin2': return 'ISO-8859-2-Windows-Latin-2'; case 'csisolatin3': case 'iso88593': case 'iso885931988': case 'isoir109': case 'l3': case 'latin3': return 'ISO-8859-3'; case 'csisolatin4': case 'iso88594': case 'iso885941988': case 'isoir110': case 'l4': case 'latin4': return 'ISO-8859-4'; case 'csisolatincyrillic': case 'cyrillic': case 'iso88595': case 'iso885951988': case 'isoir144': return 'ISO-8859-5'; case 'arabic': case 'asmo708': case 'csisolatinarabic': case 'ecma114': case 'iso88596': case 'iso885961987': case 'isoir127': return 'ISO-8859-6'; case 'csiso88596e': case 'iso88596e': return 'ISO-8859-6-E'; case 'csiso88596i': case 'iso88596i': return 'ISO-8859-6-I'; case 'csisolatingreek': case 'ecma118': case 'elot928': case 'greek': case 'greek8': case 'iso88597': case 'iso885971987': case 'isoir126': return 'ISO-8859-7'; case 'csisolatinhebrew': case 'hebrew': case 'iso88598': case 'iso885981988': case 'isoir138': return 'ISO-8859-8'; case 'csiso88598e': case 'iso88598e': return 'ISO-8859-8-E'; case 'csiso88598i': case 'iso88598i': return 'ISO-8859-8-I'; case 'cswindows31latin5': case 'iso88599windowslatin5': return 'ISO-8859-9-Windows-Latin-5'; case 'csisolatin6': case 'iso885910': case 'iso8859101992': case 'isoir157': case 'l6': case 'latin6': return 'ISO-8859-10'; case 'iso885913': return 'ISO-8859-13'; case 'iso885914': case 'iso8859141998': case 'isoceltic': case 'isoir199': case 'l8': case 'latin8': return 'ISO-8859-14'; case 'iso885915': case 'latin9': return 'ISO-8859-15'; case 'iso885916': case 'iso8859162001': case 'isoir226': case 'l10': case 'latin10': return 'ISO-8859-16'; case 'iso10646j1': return 'ISO-10646-J-1'; case 'csunicode': case 'iso10646ucs2': return 'ISO-10646-UCS-2'; case 'csucs4': case 'iso10646ucs4': return 'ISO-10646-UCS-4'; case 'csunicodeascii': case 'iso10646ucsbasic': return 'ISO-10646-UCS-Basic'; case 'csunicodelatin1': case 'iso10646': case 'iso10646unicodelatin1': return 'ISO-10646-Unicode-Latin1'; case 'csiso10646utf1': case 'iso10646utf1': return 'ISO-10646-UTF-1'; case 'csiso115481': case 'iso115481': case 'isotr115481': return 'ISO-11548-1'; case 'csiso90': case 'isoir90': return 'iso-ir-90'; case 'csunicodeibm1261': case 'isounicodeibm1261': return 'ISO-Unicode-IBM-1261'; case 'csunicodeibm1264': case 'isounicodeibm1264': return 'ISO-Unicode-IBM-1264'; case 'csunicodeibm1265': case 'isounicodeibm1265': return 'ISO-Unicode-IBM-1265'; case 'csunicodeibm1268': case 'isounicodeibm1268': return 'ISO-Unicode-IBM-1268'; case 'csunicodeibm1276': case 'isounicodeibm1276': return 'ISO-Unicode-IBM-1276'; case 'csiso646basic1983': case 'iso646basic1983': case 'ref': return 'ISO_646.basic:1983'; case 'csiso2intlrefversion': case 'irv': case 'iso646irv1983': case 'isoir2': return 'ISO_646.irv:1983'; case 'csiso2033': case 'e13b': case 'iso20331983': case 'isoir98': return 'ISO_2033-1983'; case 'csiso5427cyrillic': case 'iso5427': case 'isoir37': return 'ISO_5427'; case 'iso5427cyrillic1981': case 'iso54271981': case 'isoir54': return 'ISO_5427:1981'; case 'csiso5428greek': case 'iso54281980': case 'isoir55': return 'ISO_5428:1980'; case 'csiso6937add': case 'iso6937225': case 'isoir152': return 'ISO_6937-2-25'; case 'csisotextcomm': case 'iso69372add': case 'isoir142': return 'ISO_6937-2-add'; case 'csiso8859supp': case 'iso8859supp': case 'isoir154': case 'latin125': return 'ISO_8859-supp'; case 'csiso10367box': case 'iso10367box': case 'isoir155': return 'ISO_10367-box'; case 'csiso15italian': case 'iso646it': case 'isoir15': case 'it': return 'IT'; case 'csiso13jisc6220jp': case 'isoir13': case 'jisc62201969': case 'jisc62201969jp': case 'katakana': case 'x2017': return 'JIS_C6220-1969-jp'; case 'csiso14jisc6220ro': case 'iso646jp': case 'isoir14': case 'jisc62201969ro': case 'jp': return 'JIS_C6220-1969-ro'; case 'csiso42jisc62261978': case 'isoir42': case 'jisc62261978': return 'JIS_C6226-1978'; case 'csiso87jisx208': case 'isoir87': case 'jisc62261983': case 'jisx2081983': case 'x208': return 'JIS_C6226-1983'; case 'csiso91jisc62291984a': case 'isoir91': case 'jisc62291984a': case 'jpocra': return 'JIS_C6229-1984-a'; case 'csiso92jisc62991984b': case 'iso646jpocrb': case 'isoir92': case 'jisc62291984b': case 'jpocrb': return 'JIS_C6229-1984-b'; case 'csiso93jis62291984badd': case 'isoir93': case 'jisc62291984badd': case 'jpocrbadd': return 'JIS_C6229-1984-b-add'; case 'csiso94jis62291984hand': case 'isoir94': case 'jisc62291984hand': case 'jpocrhand': return 'JIS_C6229-1984-hand'; case 'csiso95jis62291984handadd': case 'isoir95': case 'jisc62291984handadd': case 'jpocrhandadd': return 'JIS_C6229-1984-hand-add'; case 'csiso96jisc62291984kana': case 'isoir96': case 'jisc62291984kana': return 'JIS_C6229-1984-kana'; case 'csjisencoding': case 'jisencoding': return 'JIS_Encoding'; case 'cshalfwidthkatakana': case 'jisx201': case 'x201': return 'JIS_X0201'; case 'csiso159jisx2121990': case 'isoir159': case 'jisx2121990': case 'x212': return 'JIS_X0212-1990'; case 'csiso141jusib1002': case 'iso646yu': case 'isoir141': case 'js': case 'jusib1002': case 'yu': return 'JUS_I.B1.002'; case 'csiso147macedonian': case 'isoir147': case 'jusib1003mac': case 'macedonian': return 'JUS_I.B1.003-mac'; case 'csiso146serbian': case 'isoir146': case 'jusib1003serb': case 'serbian': return 'JUS_I.B1.003-serb'; case 'koi7switched': return 'KOI7-switched'; case 'cskoi8r': case 'koi8r': return 'KOI8-R'; case 'koi8u': return 'KOI8-U'; case 'csksc5636': case 'iso646kr': case 'ksc5636': return 'KSC5636'; case 'cskz1048': case 'kz1048': case 'rk1048': case 'strk10482002': return 'KZ-1048'; case 'csiso19latingreek': case 'isoir19': case 'latingreek': return 'latin-greek'; case 'csiso27latingreek1': case 'isoir27': case 'latingreek1': return 'Latin-greek-1'; case 'csiso158lap': case 'isoir158': case 'lap': case 'latinlap': return 'latin-lap'; case 'csmacintosh': case 'mac': case 'macintosh': return 'macintosh'; case 'csmicrosoftpublishing': case 'microsoftpublishing': return 'Microsoft-Publishing'; case 'csmnem': case 'mnem': return 'MNEM'; case 'csmnemonic': case 'mnemonic': return 'MNEMONIC'; case 'csiso86hungarian': case 'hu': case 'iso646hu': case 'isoir86': case 'msz77953': return 'MSZ_7795.3'; case 'csnatsdano': case 'isoir91': case 'natsdano': return 'NATS-DANO'; case 'csnatsdanoadd': case 'isoir92': case 'natsdanoadd': return 'NATS-DANO-ADD'; case 'csnatssefi': case 'isoir81': case 'natssefi': return 'NATS-SEFI'; case 'csnatssefiadd': case 'isoir82': case 'natssefiadd': return 'NATS-SEFI-ADD'; case 'csiso151cuba': case 'cuba': case 'iso646cu': case 'isoir151': case 'ncnc1081': return 'NC_NC00-10:81'; case 'csiso69french': case 'fr': case 'iso646fr': case 'isoir69': case 'nfz62010': return 'NF_Z_62-010'; case 'csiso25french': case 'iso646fr1': case 'isoir25': case 'nfz620101973': return 'NF_Z_62-010_(1973)'; case 'csiso60danishnorwegian': case 'csiso60norwegian1': case 'iso646no': case 'isoir60': case 'no': case 'ns45511': return 'NS_4551-1'; case 'csiso61norwegian2': case 'iso646no2': case 'isoir61': case 'no2': case 'ns45512': return 'NS_4551-2'; case 'osdebcdicdf3irv': return 'OSD_EBCDIC_DF03_IRV'; case 'osdebcdicdf41': return 'OSD_EBCDIC_DF04_1'; case 'osdebcdicdf415': return 'OSD_EBCDIC_DF04_15'; case 'cspc8danishnorwegian': case 'pc8danishnorwegian': return 'PC8-Danish-Norwegian'; case 'cspc8turkish': case 'pc8turkish': return 'PC8-Turkish'; case 'csiso16portuguese': case 'iso646pt': case 'isoir16': case 'pt': return 'PT'; case 'csiso84portuguese2': case 'iso646pt2': case 'isoir84': case 'pt2': return 'PT2'; case 'cp154': case 'csptcp154': case 'cyrillicasian': case 'pt154': case 'ptcp154': return 'PTCP154'; case 'scsu': return 'SCSU'; case 'csiso10swedish': case 'fi': case 'iso646fi': case 'iso646se': case 'isoir10': case 'se': case 'sen850200b': return 'SEN_850200_B'; case 'csiso11swedishfornames': case 'iso646se2': case 'isoir11': case 'se2': case 'sen850200c': return 'SEN_850200_C'; case 'csshiftjis': case 'mskanji': case 'shiftjis': return 'Shift_JIS'; case 'csiso102t617bit': case 'isoir102': case 't617bit': return 'T.61-7bit'; case 'csiso103t618bit': case 'isoir103': case 't61': case 't618bit': return 'T.61-8bit'; case 'csiso128t101g2': case 'isoir128': case 't101g2': return 'T.101-G2'; case 'cstscii': case 'tscii': return 'TSCII'; case 'csunicode11': case 'unicode11': return 'UNICODE-1-1'; case 'csunicode11utf7': case 'unicode11utf7': return 'UNICODE-1-1-UTF-7'; case 'csunknown8bit': case 'unknown8bit': return 'UNKNOWN-8BIT'; case 'ansix341968': case 'ansix341986': case 'ascii': case 'cp367': case 'csascii': case 'ibm367': case 'iso646irv1991': case 'iso646us': case 'isoir6': case 'us': case 'usascii': return 'US-ASCII'; case 'csusdk': case 'usdk': return 'us-dk'; case 'utf7': return 'UTF-7'; case 'utf8': return 'UTF-8'; case 'utf16': return 'UTF-16'; case 'utf16be': return 'UTF-16BE'; case 'utf16le': return 'UTF-16LE'; case 'utf32': return 'UTF-32'; case 'utf32be': return 'UTF-32BE'; case 'utf32le': return 'UTF-32LE'; case 'csventurainternational': case 'venturainternational': return 'Ventura-International'; case 'csventuramath': case 'venturamath': return 'Ventura-Math'; case 'csventuraus': case 'venturaus': return 'Ventura-US'; case 'csiso70videotexsupp1': case 'isoir70': case 'videotexsuppl': return 'videotex-suppl'; case 'csviqr': case 'viqr': return 'VIQR'; case 'csviscii': case 'viscii': return 'VISCII'; case 'cswindows31j': case 'windows31j': return 'Windows-31J'; case 'iso885911': case 'tis620': return 'windows-874'; case 'cseuckr': case 'csksc56011987': case 'euckr': case 'isoir149': case 'korean': case 'ksc5601': case 'ksc56011987': case 'ksc56011989': case 'windows949': return 'windows-949'; case 'windows1250': return 'windows-1250'; case 'windows1251': return 'windows-1251'; case 'cp819': case 'csisolatin1': case 'ibm819': case 'iso88591': case 'iso885911987': case 'isoir100': case 'l1': case 'latin1': case 'windows1252': return 'windows-1252'; case 'windows1253': return 'windows-1253'; case 'csisolatin5': case 'iso88599': case 'iso885991989': case 'isoir148': case 'l5': case 'latin5': case 'windows1254': return 'windows-1254'; case 'windows1255': return 'windows-1255'; case 'windows1256': return 'windows-1256'; case 'windows1257': return 'windows-1257'; case 'windows1258': return 'windows-1258'; default: return $charset; } } function get_curl_version() { if (is_array($curl = curl_version())) { $curl = $curl['version']; } elseif (substr($curl, 0, 5) === 'curl/') { $curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5)); } elseif (substr($curl, 0, 8) === 'libcurl/') { $curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8)); } else { $curl = 0; } return $curl; } function is_subclass_of($class1, $class2) { if (func_num_args() !== 2) { trigger_error('Wrong parameter count for SimplePie_Misc::is_subclass_of()', E_USER_WARNING); } elseif (version_compare(PHP_VERSION, '5.0.3', '>=') || is_object($class1)) { return is_subclass_of($class1, $class2); } elseif (is_string($class1) && is_string($class2)) { if (class_exists($class1)) { if (class_exists($class2)) { $class2 = strtolower($class2); while ($class1 = strtolower(get_parent_class($class1))) { if ($class1 === $class2) { return true; } } } } else { trigger_error('Unknown class passed as parameter', E_USER_WARNNG); } } return false; } /** * Strip HTML comments * * @access public * @param string $data Data to strip comments from * @return string Comment stripped string */ function strip_comments($data) { $output = ''; while (($start = strpos($data, '<!--')) !== false) { $output .= substr($data, 0, $start); if (($end = strpos($data, '-->', $start)) !== false) { $data = substr_replace($data, '', 0, $end + 3); } else { $data = ''; } } return $output . $data; } function parse_date($dt) { $parser = SimplePie_Parse_Date::get(); return $parser->parse($dt); } /** * Decode HTML entities * * @static * @access public * @param string $data Input data * @return string Output data */ function entities_decode($data) { $decoder = new SimplePie_Decode_HTML_Entities($data); return $decoder->parse(); } /** * Remove RFC822 comments * * @access public * @param string $data Data to strip comments from * @return string Comment stripped string */ function uncomment_rfc822($string) { $string = (string) $string; $position = 0; $length = strlen($string); $depth = 0; $output = ''; while ($position < $length && ($pos = strpos($string, '(', $position)) !== false) { $output .= substr($string, $position, $pos - $position); $position = $pos + 1; if ($string[$pos - 1] !== '\\') { $depth++; while ($depth && $position < $length) { $position += strcspn($string, '()', $position); if ($string[$position - 1] === '\\') { $position++; continue; } elseif (isset($string[$position])) { switch ($string[$position]) { case '(': $depth++; break; case ')': $depth--; break; } $position++; } else { break; } } } else { $output .= '('; } } $output .= substr($string, $position); return $output; } function parse_mime($mime) { if (($pos = strpos($mime, ';')) === false) { return trim($mime); } else { return trim(substr($mime, 0, $pos)); } } function htmlspecialchars_decode($string, $quote_style) { if (function_exists('htmlspecialchars_decode')) { return htmlspecialchars_decode($string, $quote_style); } else { return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style))); } } function atom_03_construct_type($attribs) { if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64')) { $mode = SIMPLEPIE_CONSTRUCT_BASE64; } else { $mode = SIMPLEPIE_CONSTRUCT_NONE; } if (isset($attribs['']['type'])) { switch (strtolower(trim($attribs['']['type']))) { case 'text': case 'text/plain': return SIMPLEPIE_CONSTRUCT_TEXT | $mode; case 'html': case 'text/html': return SIMPLEPIE_CONSTRUCT_HTML | $mode; case 'xhtml': case 'application/xhtml+xml': return SIMPLEPIE_CONSTRUCT_XHTML | $mode; default: return SIMPLEPIE_CONSTRUCT_NONE | $mode; } } else { return SIMPLEPIE_CONSTRUCT_TEXT | $mode; } } function atom_10_construct_type($attribs) { if (isset($attribs['']['type'])) { switch (strtolower(trim($attribs['']['type']))) { case 'text': return SIMPLEPIE_CONSTRUCT_TEXT; case 'html': return SIMPLEPIE_CONSTRUCT_HTML; case 'xhtml': return SIMPLEPIE_CONSTRUCT_XHTML; default: return SIMPLEPIE_CONSTRUCT_NONE; } } return SIMPLEPIE_CONSTRUCT_TEXT; } function atom_10_content_construct_type($attribs) { if (isset($attribs['']['type'])) { $type = strtolower(trim($attribs['']['type'])); switch ($type) { case 'text': return SIMPLEPIE_CONSTRUCT_TEXT; case 'html': return SIMPLEPIE_CONSTRUCT_HTML; case 'xhtml': return SIMPLEPIE_CONSTRUCT_XHTML; } if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/') { return SIMPLEPIE_CONSTRUCT_NONE; } else { return SIMPLEPIE_CONSTRUCT_BASE64; } } else { return SIMPLEPIE_CONSTRUCT_TEXT; } } function is_isegment_nz_nc($string) { return (bool) preg_match('/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string); } function space_seperated_tokens($string) { $space_characters = "\x20\x09\x0A\x0B\x0C\x0D"; $string_length = strlen($string); $position = strspn($string, $space_characters); $tokens = array(); while ($position < $string_length) { $len = strcspn($string, $space_characters, $position); $tokens[] = substr($string, $position, $len); $position += $len; $position += strspn($string, $space_characters, $position); } return $tokens; } function array_unique($array) { if (version_compare(PHP_VERSION, '5.2', '>=')) { return array_unique($array); } else { $array = (array) $array; $new_array = array(); $new_array_strings = array(); foreach ($array as $key => $value) { if (is_object($value)) { if (method_exists($value, '__toString')) { $cmp = $value->__toString(); } else { trigger_error('Object of class ' . get_class($value) . ' could not be converted to string', E_USER_ERROR); } } elseif (is_array($value)) { $cmp = (string) reset($value); } else { $cmp = (string) $value; } if (!in_array($cmp, $new_array_strings)) { $new_array[$key] = $value; $new_array_strings[] = $cmp; } } return $new_array; } } /** * Converts a unicode codepoint to a UTF-8 character * * @static * @access public * @param int $codepoint Unicode codepoint * @return string UTF-8 character */ function codepoint_to_utf8($codepoint) { $codepoint = (int) $codepoint; if ($codepoint < 0) { return false; } else if ($codepoint <= 0x7f) { return chr($codepoint); } else if ($codepoint <= 0x7ff) { return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f)); } else if ($codepoint <= 0xffff) { return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); } else if ($codepoint <= 0x10ffff) { return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); } else { // U+FFFD REPLACEMENT CHARACTER return "\xEF\xBF\xBD"; } } /** * Re-implementation of PHP 5's stripos() * * Returns the numeric position of the first occurrence of needle in the * haystack string. * * @static * @access string * @param object $haystack * @param string $needle Note that the needle may be a string of one or more * characters. If needle is not a string, it is converted to an integer * and applied as the ordinal value of a character. * @param int $offset The optional offset parameter allows you to specify which * character in haystack to start searching. The position returned is still * relative to the beginning of haystack. * @return bool If needle is not found, stripos() will return boolean false. */ function stripos($haystack, $needle, $offset = 0) { if (function_exists('stripos')) { return stripos($haystack, $needle, $offset); } else { if (is_string($needle)) { $needle = strtolower($needle); } elseif (is_int($needle) || is_bool($needle) || is_double($needle)) { $needle = strtolower(chr($needle)); } else { trigger_error('needle is not a string or an integer', E_USER_WARNING); return false; } return strpos(strtolower($haystack), $needle, $offset); } } /** * Similar to parse_str() * * Returns an associative array of name/value pairs, where the value is an * array of values that have used the same name * * @static * @access string * @param string $str The input string. * @return array */ function parse_str($str) { $return = array(); $str = explode('&', $str); foreach ($str as $section) { if (strpos($section, '=') !== false) { list($name, $value) = explode('=', $section, 2); $return[urldecode($name)][] = urldecode($value); } else { $return[urldecode($section)][] = null; } } return $return; } /** * Detect XML encoding, as per XML 1.0 Appendix F.1 * * @todo Add support for EBCDIC * @param string $data XML data * @return array Possible encodings */ function xml_encoding($data) { // UTF-32 Big Endian BOM if (substr($data, 0, 4) === "\x00\x00\xFE\xFF") { $encoding[] = 'UTF-32BE'; } // UTF-32 Little Endian BOM elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00") { $encoding[] = 'UTF-32LE'; } // UTF-16 Big Endian BOM elseif (substr($data, 0, 2) === "\xFE\xFF") { $encoding[] = 'UTF-16BE'; } // UTF-16 Little Endian BOM elseif (substr($data, 0, 2) === "\xFF\xFE") { $encoding[] = 'UTF-16LE'; } // UTF-8 BOM elseif (substr($data, 0, 3) === "\xEF\xBB\xBF") { $encoding[] = 'UTF-8'; } // UTF-32 Big Endian Without BOM elseif (substr($data, 0, 20) === "\x00\x00\x00\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C") { if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E")) { $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8')); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-32BE'; } // UTF-32 Little Endian Without BOM elseif (substr($data, 0, 20) === "\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C\x00\x00\x00") { if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00")) { $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8')); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-32LE'; } // UTF-16 Big Endian Without BOM elseif (substr($data, 0, 10) === "\x00\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C") { if ($pos = strpos($data, "\x00\x3F\x00\x3E")) { $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8')); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-16BE'; } // UTF-16 Little Endian Without BOM elseif (substr($data, 0, 10) === "\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C\x00") { if ($pos = strpos($data, "\x3F\x00\x3E\x00")) { $parser = new SimplePie_XML_Declaration_Parser(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8')); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-16LE'; } // US-ASCII (or superset) elseif (substr($data, 0, 5) === "\x3C\x3F\x78\x6D\x6C") { if ($pos = strpos($data, "\x3F\x3E")) { $parser = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5)); if ($parser->parse()) { $encoding[] = $parser->encoding; } } $encoding[] = 'UTF-8'; } // Fallback to UTF-8 else { $encoding[] = 'UTF-8'; } return $encoding; } function output_javascript() { if (function_exists('ob_gzhandler')) { ob_start('ob_gzhandler'); } header('Content-type: text/javascript; charset: UTF-8'); header('Cache-Control: must-revalidate'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days ?> function embed_odeo(link) { document.writeln('<embed src="http://odeo.com/flash/audio_player_fullsize.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="440" height="80" wmode="transparent" allowScriptAccess="any" flashvars="valid_sample_rate=true&external_url='+link+'"></embed>'); } function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) { if (placeholder != '') { document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>'); } else { document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" src="'+link+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="true" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>'); } } function embed_flash(bgcolor, width, height, link, loop, type) { document.writeln('<embed src="'+link+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+'" quality="high" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" loop="'+loop+'"></embed>'); } function embed_flv(width, height, link, placeholder, loop, player) { document.writeln('<embed src="'+player+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+'" height="'+height+'" wmode="transparent" flashvars="file='+link+'&autostart=false&repeat='+loop+'&showdigits=true&showfsbutton=false"></embed>'); } function embed_wmedia(width, height, link) { document.writeln('<embed type="application/x-mplayer2" src="'+link+'" autosize="1" width="'+width+'" height="'+height+'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>'); } <?php } } /** * Decode HTML Entities * * This implements HTML5 as of revision 967 (2007-06-28) * * @package SimplePie */ class SimplePie_Decode_HTML_Entities { /** * Data to be parsed * * @access private * @var string */ var $data = ''; /** * Currently consumed bytes * * @access private * @var string */ var $consumed = ''; /** * Position of the current byte being parsed * * @access private * @var int */ var $position = 0; /** * Create an instance of the class with the input data * * @access public * @param string $data Input data */ function SimplePie_Decode_HTML_Entities($data) { $this->data = $data; } /** * Parse the input data * * @access public * @return string Output data */ function parse() { while (($this->position = strpos($this->data, '&', $this->position)) !== false) { $this->consume(); $this->entity(); $this->consumed = ''; } return $this->data; } /** * Consume the next byte * * @access private * @return mixed The next byte, or false, if there is no more data */ function consume() { if (isset($this->data[$this->position])) { $this->consumed .= $this->data[$this->position]; return $this->data[$this->position++]; } else { return false; } } /** * Consume a range of characters * * @access private * @param string $chars Characters to consume * @return mixed A series of characters that match the range, or false */ function consume_range($chars) { if ($len = strspn($this->data, $chars, $this->position)) { $data = substr($this->data, $this->position, $len); $this->consumed .= $data; $this->position += $len; return $data; } else { return false; } } /** * Unconsume one byte * * @access private */ function unconsume() { $this->consumed = substr($this->consumed, 0, -1); $this->position--; } /** * Decode an entity * * @access private */ function entity() { switch ($this->consume()) { case "\x09": case "\x0A": case "\x0B": case "\x0B": case "\x0C": case "\x20": case "\x3C": case "\x26": case false: break; case "\x23": switch ($this->consume()) { case "\x78": case "\x58": $range = '0123456789ABCDEFabcdef'; $hex = true; break; default: $range = '0123456789'; $hex = false; $this->unconsume(); break; } if ($codepoint = $this->consume_range($range)) { static $windows_1252_specials = array(0x0D => "\x0A", 0x80 => "\xE2\x82\xAC", 0x81 => "\xEF\xBF\xBD", 0x82 => "\xE2\x80\x9A", 0x83 => "\xC6\x92", 0x84 => "\xE2\x80\x9E", 0x85 => "\xE2\x80\xA6", 0x86 => "\xE2\x80\xA0", 0x87 => "\xE2\x80\xA1", 0x88 => "\xCB\x86", 0x89 => "\xE2\x80\xB0", 0x8A => "\xC5\xA0", 0x8B => "\xE2\x80\xB9", 0x8C => "\xC5\x92", 0x8D => "\xEF\xBF\xBD", 0x8E => "\xC5\xBD", 0x8F => "\xEF\xBF\xBD", 0x90 => "\xEF\xBF\xBD", 0x91 => "\xE2\x80\x98", 0x92 => "\xE2\x80\x99", 0x93 => "\xE2\x80\x9C", 0x94 => "\xE2\x80\x9D", 0x95 => "\xE2\x80\xA2", 0x96 => "\xE2\x80\x93", 0x97 => "\xE2\x80\x94", 0x98 => "\xCB\x9C", 0x99 => "\xE2\x84\xA2", 0x9A => "\xC5\xA1", 0x9B => "\xE2\x80\xBA", 0x9C => "\xC5\x93", 0x9D => "\xEF\xBF\xBD", 0x9E => "\xC5\xBE", 0x9F => "\xC5\xB8"); if ($hex) { $codepoint = hexdec($codepoint); } else { $codepoint = intval($codepoint); } if (isset($windows_1252_specials[$codepoint])) { $replacement = $windows_1252_specials[$codepoint]; } else { $replacement = SimplePie_Misc::codepoint_to_utf8($codepoint); } if (!in_array($this->consume(), array(';', false), true)) { $this->unconsume(); } $consumed_length = strlen($this->consumed); $this->data = substr_replace($this->data, $replacement, $this->position - $consumed_length, $consumed_length); $this->position += strlen($replacement) - $consumed_length; } break; default: static $entities = array('Aacute' => "\xC3\x81", 'aacute' => "\xC3\xA1", 'Aacute;' => "\xC3\x81", 'aacute;' => "\xC3\xA1", 'Acirc' => "\xC3\x82", 'acirc' => "\xC3\xA2", 'Acirc;' => "\xC3\x82", 'acirc;' => "\xC3\xA2", 'acute' => "\xC2\xB4", 'acute;' => "\xC2\xB4", 'AElig' => "\xC3\x86", 'aelig' => "\xC3\xA6", 'AElig;' => "\xC3\x86", 'aelig;' => "\xC3\xA6", 'Agrave' => "\xC3\x80", 'agrave' => "\xC3\xA0", 'Agrave;' => "\xC3\x80", 'agrave;' => "\xC3\xA0", 'alefsym;' => "\xE2\x84\xB5", 'Alpha;' => "\xCE\x91", 'alpha;' => "\xCE\xB1", 'AMP' => "\x26", 'amp' => "\x26", 'AMP;' => "\x26", 'amp;' => "\x26", 'and;' => "\xE2\x88\xA7", 'ang;' => "\xE2\x88\xA0", 'apos;' => "\x27", 'Aring' => "\xC3\x85", 'aring' => "\xC3\xA5", 'Aring;' => "\xC3\x85", 'aring;' => "\xC3\xA5", 'asymp;' => "\xE2\x89\x88", 'Atilde' => "\xC3\x83", 'atilde' => "\xC3\xA3", 'Atilde;' => "\xC3\x83", 'atilde;' => "\xC3\xA3", 'Auml' => "\xC3\x84", 'auml' => "\xC3\xA4", 'Auml;' => "\xC3\x84", 'auml;' => "\xC3\xA4", 'bdquo;' => "\xE2\x80\x9E", 'Beta;' => "\xCE\x92", 'beta;' => "\xCE\xB2", 'brvbar' => "\xC2\xA6", 'brvbar;' => "\xC2\xA6", 'bull;' => "\xE2\x80\xA2", 'cap;' => "\xE2\x88\xA9", 'Ccedil' => "\xC3\x87", 'ccedil' => "\xC3\xA7", 'Ccedil;' => "\xC3\x87", 'ccedil;' => "\xC3\xA7", 'cedil' => "\xC2\xB8", 'cedil;' => "\xC2\xB8", 'cent' => "\xC2\xA2", 'cent;' => "\xC2\xA2", 'Chi;' => "\xCE\xA7", 'chi;' => "\xCF\x87", 'circ;' => "\xCB\x86", 'clubs;' => "\xE2\x99\xA3", 'cong;' => "\xE2\x89\x85", 'COPY' => "\xC2\xA9", 'copy' => "\xC2\xA9", 'COPY;' => "\xC2\xA9", 'copy;' => "\xC2\xA9", 'crarr;' => "\xE2\x86\xB5", 'cup;' => "\xE2\x88\xAA", 'curren' => "\xC2\xA4", 'curren;' => "\xC2\xA4", 'Dagger;' => "\xE2\x80\xA1", 'dagger;' => "\xE2\x80\xA0", 'dArr;' => "\xE2\x87\x93", 'darr;' => "\xE2\x86\x93", 'deg' => "\xC2\xB0", 'deg;' => "\xC2\xB0", 'Delta;' => "\xCE\x94", 'delta;' => "\xCE\xB4", 'diams;' => "\xE2\x99\xA6", 'divide' => "\xC3\xB7", 'divide;' => "\xC3\xB7", 'Eacute' => "\xC3\x89", 'eacute' => "\xC3\xA9", 'Eacute;' => "\xC3\x89", 'eacute;' => "\xC3\xA9", 'Ecirc' => "\xC3\x8A", 'ecirc' => "\xC3\xAA", 'Ecirc;' => "\xC3\x8A", 'ecirc;' => "\xC3\xAA", 'Egrave' => "\xC3\x88", 'egrave' => "\xC3\xA8", 'Egrave;' => "\xC3\x88", 'egrave;' => "\xC3\xA8", 'empty;' => "\xE2\x88\x85", 'emsp;' => "\xE2\x80\x83", 'ensp;' => "\xE2\x80\x82", 'Epsilon;' => "\xCE\x95", 'epsilon;' => "\xCE\xB5", 'equiv;' => "\xE2\x89\xA1", 'Eta;' => "\xCE\x97", 'eta;' => "\xCE\xB7", 'ETH' => "\xC3\x90", 'eth' => "\xC3\xB0", 'ETH;' => "\xC3\x90", 'eth;' => "\xC3\xB0", 'Euml' => "\xC3\x8B", 'euml' => "\xC3\xAB", 'Euml;' => "\xC3\x8B", 'euml;' => "\xC3\xAB", 'euro;' => "\xE2\x82\xAC", 'exist;' => "\xE2\x88\x83", 'fnof;' => "\xC6\x92", 'forall;' => "\xE2\x88\x80", 'frac12' => "\xC2\xBD", 'frac12;' => "\xC2\xBD", 'frac14' => "\xC2\xBC", 'frac14;' => "\xC2\xBC", 'frac34' => "\xC2\xBE", 'frac34;' => "\xC2\xBE", 'frasl;' => "\xE2\x81\x84", 'Gamma;' => "\xCE\x93", 'gamma;' => "\xCE\xB3", 'ge;' => "\xE2\x89\xA5", 'GT' => "\x3E", 'gt' => "\x3E", 'GT;' => "\x3E", 'gt;' => "\x3E", 'hArr;' => "\xE2\x87\x94", 'harr;' => "\xE2\x86\x94", 'hearts;' => "\xE2\x99\xA5", 'hellip;' => "\xE2\x80\xA6", 'Iacute' => "\xC3\x8D", 'iacute' => "\xC3\xAD", 'Iacute;' => "\xC3\x8D", 'iacute;' => "\xC3\xAD", 'Icirc' => "\xC3\x8E", 'icirc' => "\xC3\xAE", 'Icirc;' => "\xC3\x8E", 'icirc;' => "\xC3\xAE", 'iexcl' => "\xC2\xA1", 'iexcl;' => "\xC2\xA1", 'Igrave' => "\xC3\x8C", 'igrave' => "\xC3\xAC", 'Igrave;' => "\xC3\x8C", 'igrave;' => "\xC3\xAC", 'image;' => "\xE2\x84\x91", 'infin;' => "\xE2\x88\x9E", 'int;' => "\xE2\x88\xAB", 'Iota;' => "\xCE\x99", 'iota;' => "\xCE\xB9", 'iquest' => "\xC2\xBF", 'iquest;' => "\xC2\xBF", 'isin;' => "\xE2\x88\x88", 'Iuml' => "\xC3\x8F", 'iuml' => "\xC3\xAF", 'Iuml;' => "\xC3\x8F", 'iuml;' => "\xC3\xAF", 'Kappa;' => "\xCE\x9A", 'kappa;' => "\xCE\xBA", 'Lambda;' => "\xCE\x9B", 'lambda;' => "\xCE\xBB", 'lang;' => "\xE3\x80\x88", 'laquo' => "\xC2\xAB", 'laquo;' => "\xC2\xAB", 'lArr;' => "\xE2\x87\x90", 'larr;' => "\xE2\x86\x90", 'lceil;' => "\xE2\x8C\x88", 'ldquo;' => "\xE2\x80\x9C", 'le;' => "\xE2\x89\xA4", 'lfloor;' => "\xE2\x8C\x8A", 'lowast;' => "\xE2\x88\x97", 'loz;' => "\xE2\x97\x8A", 'lrm;' => "\xE2\x80\x8E", 'lsaquo;' => "\xE2\x80\xB9", 'lsquo;' => "\xE2\x80\x98", 'LT' => "\x3C", 'lt' => "\x3C", 'LT;' => "\x3C", 'lt;' => "\x3C", 'macr' => "\xC2\xAF", 'macr;' => "\xC2\xAF", 'mdash;' => "\xE2\x80\x94", 'micro' => "\xC2\xB5", 'micro;' => "\xC2\xB5", 'middot' => "\xC2\xB7", 'middot;' => "\xC2\xB7", 'minus;' => "\xE2\x88\x92", 'Mu;' => "\xCE\x9C", 'mu;' => "\xCE\xBC", 'nabla;' => "\xE2\x88\x87", 'nbsp' => "\xC2\xA0", 'nbsp;' => "\xC2\xA0", 'ndash;' => "\xE2\x80\x93", 'ne;' => "\xE2\x89\xA0", 'ni;' => "\xE2\x88\x8B", 'not' => "\xC2\xAC", 'not;' => "\xC2\xAC", 'notin;' => "\xE2\x88\x89", 'nsub;' => "\xE2\x8A\x84", 'Ntilde' => "\xC3\x91", 'ntilde' => "\xC3\xB1", 'Ntilde;' => "\xC3\x91", 'ntilde;' => "\xC3\xB1", 'Nu;' => "\xCE\x9D", 'nu;' => "\xCE\xBD", 'Oacute' => "\xC3\x93", 'oacute' => "\xC3\xB3", 'Oacute;' => "\xC3\x93", 'oacute;' => "\xC3\xB3", 'Ocirc' => "\xC3\x94", 'ocirc' => "\xC3\xB4", 'Ocirc;' => "\xC3\x94", 'ocirc;' => "\xC3\xB4", 'OElig;' => "\xC5\x92", 'oelig;' => "\xC5\x93", 'Ograve' => "\xC3\x92", 'ograve' => "\xC3\xB2", 'Ograve;' => "\xC3\x92", 'ograve;' => "\xC3\xB2", 'oline;' => "\xE2\x80\xBE", 'Omega;' => "\xCE\xA9", 'omega;' => "\xCF\x89", 'Omicron;' => "\xCE\x9F", 'omicron;' => "\xCE\xBF", 'oplus;' => "\xE2\x8A\x95", 'or;' => "\xE2\x88\xA8", 'ordf' => "\xC2\xAA", 'ordf;' => "\xC2\xAA", 'ordm' => "\xC2\xBA", 'ordm;' => "\xC2\xBA", 'Oslash' => "\xC3\x98", 'oslash' => "\xC3\xB8", 'Oslash;' => "\xC3\x98", 'oslash;' => "\xC3\xB8", 'Otilde' => "\xC3\x95", 'otilde' => "\xC3\xB5", 'Otilde;' => "\xC3\x95", 'otilde;' => "\xC3\xB5", 'otimes;' => "\xE2\x8A\x97", 'Ouml' => "\xC3\x96", 'ouml' => "\xC3\xB6", 'Ouml;' => "\xC3\x96", 'ouml;' => "\xC3\xB6", 'para' => "\xC2\xB6", 'para;' => "\xC2\xB6", 'part;' => "\xE2\x88\x82", 'permil;' => "\xE2\x80\xB0", 'perp;' => "\xE2\x8A\xA5", 'Phi;' => "\xCE\xA6", 'phi;' => "\xCF\x86", 'Pi;' => "\xCE\xA0", 'pi;' => "\xCF\x80", 'piv;' => "\xCF\x96", 'plusmn' => "\xC2\xB1", 'plusmn;' => "\xC2\xB1", 'pound' => "\xC2\xA3", 'pound;' => "\xC2\xA3", 'Prime;' => "\xE2\x80\xB3", 'prime;' => "\xE2\x80\xB2", 'prod;' => "\xE2\x88\x8F", 'prop;' => "\xE2\x88\x9D", 'Psi;' => "\xCE\xA8", 'psi;' => "\xCF\x88", 'QUOT' => "\x22", 'quot' => "\x22", 'QUOT;' => "\x22", 'quot;' => "\x22", 'radic;' => "\xE2\x88\x9A", 'rang;' => "\xE3\x80\x89", 'raquo' => "\xC2\xBB", 'raquo;' => "\xC2\xBB", 'rArr;' => "\xE2\x87\x92", 'rarr;' => "\xE2\x86\x92", 'rceil;' => "\xE2\x8C\x89", 'rdquo;' => "\xE2\x80\x9D", 'real;' => "\xE2\x84\x9C", 'REG' => "\xC2\xAE", 'reg' => "\xC2\xAE", 'REG;' => "\xC2\xAE", 'reg;' => "\xC2\xAE", 'rfloor;' => "\xE2\x8C\x8B", 'Rho;' => "\xCE\xA1", 'rho;' => "\xCF\x81", 'rlm;' => "\xE2\x80\x8F", 'rsaquo;' => "\xE2\x80\xBA", 'rsquo;' => "\xE2\x80\x99", 'sbquo;' => "\xE2\x80\x9A", 'Scaron;' => "\xC5\xA0", 'scaron;' => "\xC5\xA1", 'sdot;' => "\xE2\x8B\x85", 'sect' => "\xC2\xA7", 'sect;' => "\xC2\xA7", 'shy' => "\xC2\xAD", 'shy;' => "\xC2\xAD", 'Sigma;' => "\xCE\xA3", 'sigma;' => "\xCF\x83", 'sigmaf;' => "\xCF\x82", 'sim;' => "\xE2\x88\xBC", 'spades;' => "\xE2\x99\xA0", 'sub;' => "\xE2\x8A\x82", 'sube;' => "\xE2\x8A\x86", 'sum;' => "\xE2\x88\x91", 'sup;' => "\xE2\x8A\x83", 'sup1' => "\xC2\xB9", 'sup1;' => "\xC2\xB9", 'sup2' => "\xC2\xB2", 'sup2;' => "\xC2\xB2", 'sup3' => "\xC2\xB3", 'sup3;' => "\xC2\xB3", 'supe;' => "\xE2\x8A\x87", 'szlig' => "\xC3\x9F", 'szlig;' => "\xC3\x9F", 'Tau;' => "\xCE\xA4", 'tau;' => "\xCF\x84", 'there4;' => "\xE2\x88\xB4", 'Theta;' => "\xCE\x98", 'theta;' => "\xCE\xB8", 'thetasym;' => "\xCF\x91", 'thinsp;' => "\xE2\x80\x89", 'THORN' => "\xC3\x9E", 'thorn' => "\xC3\xBE", 'THORN;' => "\xC3\x9E", 'thorn;' => "\xC3\xBE", 'tilde;' => "\xCB\x9C", 'times' => "\xC3\x97", 'times;' => "\xC3\x97", 'TRADE;' => "\xE2\x84\xA2", 'trade;' => "\xE2\x84\xA2", 'Uacute' => "\xC3\x9A", 'uacute' => "\xC3\xBA", 'Uacute;' => "\xC3\x9A", 'uacute;' => "\xC3\xBA", 'uArr;' => "\xE2\x87\x91", 'uarr;' => "\xE2\x86\x91", 'Ucirc' => "\xC3\x9B", 'ucirc' => "\xC3\xBB", 'Ucirc;' => "\xC3\x9B", 'ucirc;' => "\xC3\xBB", 'Ugrave' => "\xC3\x99", 'ugrave' => "\xC3\xB9", 'Ugrave;' => "\xC3\x99", 'ugrave;' => "\xC3\xB9", 'uml' => "\xC2\xA8", 'uml;' => "\xC2\xA8", 'upsih;' => "\xCF\x92", 'Upsilon;' => "\xCE\xA5", 'upsilon;' => "\xCF\x85", 'Uuml' => "\xC3\x9C", 'uuml' => "\xC3\xBC", 'Uuml;' => "\xC3\x9C", 'uuml;' => "\xC3\xBC", 'weierp;' => "\xE2\x84\x98", 'Xi;' => "\xCE\x9E", 'xi;' => "\xCE\xBE", 'Yacute' => "\xC3\x9D", 'yacute' => "\xC3\xBD", 'Yacute;' => "\xC3\x9D", 'yacute;' => "\xC3\xBD", 'yen' => "\xC2\xA5", 'yen;' => "\xC2\xA5", 'yuml' => "\xC3\xBF", 'Yuml;' => "\xC5\xB8", 'yuml;' => "\xC3\xBF", 'Zeta;' => "\xCE\x96", 'zeta;' => "\xCE\xB6", 'zwj;' => "\xE2\x80\x8D", 'zwnj;' => "\xE2\x80\x8C"); for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++) { $consumed = substr($this->consumed, 1); if (isset($entities[$consumed])) { $match = $consumed; } } if ($match !== null) { $this->data = substr_replace($this->data, $entities[$match], $this->position - strlen($consumed) - 1, strlen($match) + 1); $this->position += strlen($entities[$match]) - strlen($consumed) - 1; } break; } } } /** * IRI parser/serialiser * * @package SimplePie */ class SimplePie_IRI { /** * Scheme * * @access private * @var string */ var $scheme; /** * User Information * * @access private * @var string */ var $userinfo; /** * Host * * @access private * @var string */ var $host; /** * Port * * @access private * @var string */ var $port; /** * Path * * @access private * @var string */ var $path; /** * Query * * @access private * @var string */ var $query; /** * Fragment * * @access private * @var string */ var $fragment; /** * Whether the object represents a valid IRI * * @access private * @var array */ var $valid = array(); /** * Return the entire IRI when you try and read the object as a string * * @access public * @return string */ function __toString() { return $this->get_iri(); } /** * Create a new IRI object, from a specified string * * @access public * @param string $iri * @return SimplePie_IRI */ function SimplePie_IRI($iri) { $iri = (string) $iri; if ($iri !== '') { $parsed = $this->parse_iri($iri); $this->set_scheme($parsed['scheme']); $this->set_authority($parsed['authority']); $this->set_path($parsed['path']); $this->set_query($parsed['query']); $this->set_fragment($parsed['fragment']); } } /** * Create a new IRI object by resolving a relative IRI * * @static * @access public * @param SimplePie_IRI $base Base IRI * @param string $relative Relative IRI * @return SimplePie_IRI */ function absolutize($base, $relative) { $relative = (string) $relative; if ($relative !== '') { $relative = new SimplePie_IRI($relative); if ($relative->get_scheme() !== null) { $target = $relative; } elseif ($base->get_iri() !== null) { if ($relative->get_authority() !== null) { $target = $relative; $target->set_scheme($base->get_scheme()); } else { $target = new SimplePie_IRI(''); $target->set_scheme($base->get_scheme()); $target->set_userinfo($base->get_userinfo()); $target->set_host($base->get_host()); $target->set_port($base->get_port()); if ($relative->get_path() !== null) { if (strpos($relative->get_path(), '/') === 0) { $target->set_path($relative->get_path()); } elseif (($base->get_userinfo() !== null || $base->get_host() !== null || $base->get_port() !== null) && $base->get_path() === null) { $target->set_path('/' . $relative->get_path()); } elseif (($last_segment = strrpos($base->get_path(), '/')) !== false) { $target->set_path(substr($base->get_path(), 0, $last_segment + 1) . $relative->get_path()); } else { $target->set_path($relative->get_path()); } $target->set_query($relative->get_query()); } else { $target->set_path($base->get_path()); if ($relative->get_query() !== null) { $target->set_query($relative->get_query()); } elseif ($base->get_query() !== null) { $target->set_query($base->get_query()); } } } $target->set_fragment($relative->get_fragment()); } else { // No base URL, just return the relative URL $target = $relative; } } else { $target = $base; } return $target; } /** * Parse an IRI into scheme/authority/path/query/fragment segments * * @access private * @param string $iri * @return array */ function parse_iri($iri) { preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $iri, $match); for ($i = count($match); $i <= 9; $i++) { $match[$i] = ''; } return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]); } /** * Remove dot segments from a path * * @access private * @param string $input * @return string */ function remove_dot_segments($input) { $output = ''; while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') { // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, if (strpos($input, '../') === 0) { $input = substr($input, 3); } elseif (strpos($input, './') === 0) { $input = substr($input, 2); } // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise, elseif (strpos($input, '/./') === 0) { $input = substr_replace($input, '/', 0, 3); } elseif ($input === '/.') { $input = '/'; } // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, elseif (strpos($input, '/../') === 0) { $input = substr_replace($input, '/', 0, 4); $output = substr_replace($output, '', strrpos($output, '/')); } elseif ($input === '/..') { $input = '/'; $output = substr_replace($output, '', strrpos($output, '/')); } // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, elseif ($input === '.' || $input === '..') { $input = ''; } // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer elseif (($pos = strpos($input, '/', 1)) !== false) { $output .= substr($input, 0, $pos); $input = substr_replace($input, '', 0, $pos); } else { $output .= $input; $input = ''; } } return $output . $input; } /** * Replace invalid character with percent encoding * * @access private * @param string $string Input string * @param string $valid_chars Valid characters * @param int $case Normalise case * @return string */ function replace_invalid_with_pct_encoding($string, $valid_chars, $case = SIMPLEPIE_SAME_CASE) { // Normalise case if ($case & SIMPLEPIE_LOWERCASE) { $string = strtolower($string); } elseif ($case & SIMPLEPIE_UPPERCASE) { $string = strtoupper($string); } // Store position and string length (to avoid constantly recalculating this) $position = 0; $strlen = strlen($string); // Loop as long as we have invalid characters, advancing the position to the next invalid character while (($position += strspn($string, $valid_chars, $position)) < $strlen) { // If we have a % character if ($string[$position] === '%') { // If we have a pct-encoded section if ($position + 2 < $strlen && strspn($string, '0123456789ABCDEFabcdef', $position + 1, 2) === 2) { // Get the the represented character $chr = chr(hexdec(substr($string, $position + 1, 2))); // If the character is valid, replace the pct-encoded with the actual character while normalising case if (strpos($valid_chars, $chr) !== false) { if ($case & SIMPLEPIE_LOWERCASE) { $chr = strtolower($chr); } elseif ($case & SIMPLEPIE_UPPERCASE) { $chr = strtoupper($chr); } $string = substr_replace($string, $chr, $position, 3); $strlen -= 2; $position++; } // Otherwise just normalise the pct-encoded to uppercase else { $string = substr_replace($string, strtoupper(substr($string, $position + 1, 2)), $position + 1, 2); $position += 3; } } // If we don't have a pct-encoded section, just replace the % with its own esccaped form else { $string = substr_replace($string, '%25', $position, 1); $strlen += 2; $position += 3; } } // If we have an invalid character, change into its pct-encoded form else { $replacement = sprintf("%%%02X", ord($string[$position])); $string = str_replace($string[$position], $replacement, $string); $strlen = strlen($string); } } return $string; } /** * Check if the object represents a valid IRI * * @access public * @return bool */ function is_valid() { return array_sum($this->valid) === count($this->valid); } /** * Set the scheme. Returns true on success, false on failure (if there are * any invalid characters). * * @access public * @param string $scheme * @return bool */ function set_scheme($scheme) { if ($scheme === null || $scheme === '') { $this->scheme = null; } else { $len = strlen($scheme); switch (true) { case $len > 1: if (!strspn($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-.', 1)) { $this->scheme = null; $this->valid[__FUNCTION__] = false; return false; } case $len > 0: if (!strspn($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 0, 1)) { $this->scheme = null; $this->valid[__FUNCTION__] = false; return false; } } $this->scheme = strtolower($scheme); } $this->valid[__FUNCTION__] = true; return true; } /** * Set the authority. Returns true on success, false on failure (if there are * any invalid characters). * * @access public * @param string $authority * @return bool */ function set_authority($authority) { if (($userinfo_end = strrpos($authority, '@')) !== false) { $userinfo = substr($authority, 0, $userinfo_end); $authority = substr($authority, $userinfo_end + 1); } else { $userinfo = null; } if (($port_start = strpos($authority, ':')) !== false) { $port = substr($authority, $port_start + 1); $authority = substr($authority, 0, $port_start); } else { $port = null; } return $this->set_userinfo($userinfo) && $this->set_host($authority) && $this->set_port($port); } /** * Set the userinfo. * * @access public * @param string $userinfo * @return bool */ function set_userinfo($userinfo) { if ($userinfo === null || $userinfo === '') { $this->userinfo = null; } else { $this->userinfo = $this->replace_invalid_with_pct_encoding($userinfo, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:'); } $this->valid[__FUNCTION__] = true; return true; } /** * Set the host. Returns true on success, false on failure (if there are * any invalid characters). * * @access public * @param string $host * @return bool */ function set_host($host) { if ($host === null || $host === '') { $this->host = null; $this->valid[__FUNCTION__] = true; return true; } elseif ($host[0] === '[' && substr($host, -1) === ']') { if (Net_IPv6::checkIPv6(substr($host, 1, -1))) { $this->host = $host; $this->valid[__FUNCTION__] = true; return true; } else { $this->host = null; $this->valid[__FUNCTION__] = false; return false; } } else { $this->host = $this->replace_invalid_with_pct_encoding($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=', SIMPLEPIE_LOWERCASE); $this->valid[__FUNCTION__] = true; return true; } } /** * Set the port. Returns true on success, false on failure (if there are * any invalid characters). * * @access public * @param string $port * @return bool */ function set_port($port) { if ($port === null || $port === '') { $this->port = null; $this->valid[__FUNCTION__] = true; return true; } elseif (strspn($port, '0123456789') === strlen($port)) { $this->port = (int) $port; $this->valid[__FUNCTION__] = true; return true; } else { $this->port = null; $this->valid[__FUNCTION__] = false; return false; } } /** * Set the path. * * @access public * @param string $path * @return bool */ function set_path($path) { if ($path === null || $path === '') { $this->path = null; $this->valid[__FUNCTION__] = true; return true; } elseif (substr($path, 0, 2) === '//' && $this->userinfo === null && $this->host === null && $this->port === null) { $this->path = null; $this->valid[__FUNCTION__] = false; return false; } else { $this->path = $this->replace_invalid_with_pct_encoding($path, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=@/'); if ($this->scheme !== null) { $this->path = $this->remove_dot_segments($this->path); } $this->valid[__FUNCTION__] = true; return true; } } /** * Set the query. * * @access public * @param string $query * @return bool */ function set_query($query) { if ($query === null || $query === '') { $this->query = null; } else { $this->query = $this->replace_invalid_with_pct_encoding($query, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:@/?'); } $this->valid[__FUNCTION__] = true; return true; } /** * Set the fragment. * * @access public * @param string $fragment * @return bool */ function set_fragment($fragment) { if ($fragment === null || $fragment === '') { $this->fragment = null; } else { $this->fragment = $this->replace_invalid_with_pct_encoding($fragment, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:@/?'); } $this->valid[__FUNCTION__] = true; return true; } /** * Get the complete IRI * * @access public * @return string */ function get_iri() { $iri = ''; if ($this->scheme !== null) { $iri .= $this->scheme . ':'; } if (($authority = $this->get_authority()) !== null) { $iri .= '//' . $authority; } if ($this->path !== null) { $iri .= $this->path; } if ($this->query !== null) { $iri .= '?' . $this->query; } if ($this->fragment !== null) { $iri .= '#' . $this->fragment; } if ($iri !== '') { return $iri; } else { return null; } } /** * Get the scheme * * @access public * @return string */ function get_scheme() { return $this->scheme; } /** * Get the complete authority * * @access public * @return string */ function get_authority() { $authority = ''; if ($this->userinfo !== null) { $authority .= $this->userinfo . '@'; } if ($this->host !== null) { $authority .= $this->host; } if ($this->port !== null) { $authority .= ':' . $this->port; } if ($authority !== '') { return $authority; } else { return null; } } /** * Get the user information * * @access public * @return string */ function get_userinfo() { return $this->userinfo; } /** * Get the host * * @access public * @return string */ function get_host() { return $this->host; } /** * Get the port * * @access public * @return string */ function get_port() { return $this->port; } /** * Get the path * * @access public * @return string */ function get_path() { return $this->path; } /** * Get the query * * @access public * @return string */ function get_query() { return $this->query; } /** * Get the fragment * * @access public * @return string */ function get_fragment() { return $this->fragment; } } /** * Class to validate and to work with IPv6 addresses. * * @package SimplePie * @copyright 2003-2005 The PHP Group * @license http://www.opensource.org/licenses/bsd-license.php * @link http://pear.php.net/package/Net_IPv6 * @author Alexander Merz <alexander.merz@web.de> * @author elfrink at introweb dot nl * @author Josh Peck <jmp at joshpeck dot org> * @author Geoffrey Sneddon <geoffers@gmail.com> */ class SimplePie_Net_IPv6 { /** * Removes a possible existing netmask specification of an IP address. * * @param string $ip the (compressed) IP as Hex representation * @return string the IP the without netmask * @since 1.1.0 * @access public * @static */ function removeNetmaskSpec($ip) { if (strpos($ip, '/') !== false) { list($addr, $nm) = explode('/', $ip); } else { $addr = $ip; } return $addr; } /** * Uncompresses an IPv6 address * * RFC 2373 allows you to compress zeros in an address to '::'. This * function expects an valid IPv6 address and expands the '::' to * the required zeros. * * Example: FF01::101 -> FF01:0:0:0:0:0:0:101 * ::1 -> 0:0:0:0:0:0:0:1 * * @access public * @static * @param string $ip a valid IPv6-address (hex format) * @return string the uncompressed IPv6-address (hex format) */ function Uncompress($ip) { $uip = SimplePie_Net_IPv6::removeNetmaskSpec($ip); $c1 = -1; $c2 = -1; if (strpos($ip, '::') !== false) { list($ip1, $ip2) = explode('::', $ip); if ($ip1 === '') { $c1 = -1; } else { $pos = 0; if (($pos = substr_count($ip1, ':')) > 0) { $c1 = $pos; } else { $c1 = 0; } } if ($ip2 === '') { $c2 = -1; } else { $pos = 0; if (($pos = substr_count($ip2, ':')) > 0) { $c2 = $pos; } else { $c2 = 0; } } if (strstr($ip2, '.')) { $c2++; } // :: if ($c1 === -1 && $c2 === -1) { $uip = '0:0:0:0:0:0:0:0'; } // ::xxx else if ($c1 === -1) { $fill = str_repeat('0:', 7 - $c2); $uip = str_replace('::', $fill, $uip); } // xxx:: else if ($c2 === -1) { $fill = str_repeat(':0', 7 - $c1); $uip = str_replace('::', $fill, $uip); } // xxx::xxx else { $fill = str_repeat(':0:', 6 - $c2 - $c1); $uip = str_replace('::', $fill, $uip); $uip = str_replace('::', ':', $uip); } } return $uip; } /** * Splits an IPv6 address into the IPv6 and a possible IPv4 part * * RFC 2373 allows you to note the last two parts of an IPv6 address as * an IPv4 compatible address * * Example: 0:0:0:0:0:0:13.1.68.3 * 0:0:0:0:0:FFFF:129.144.52.38 * * @access public * @static * @param string $ip a valid IPv6-address (hex format) * @return array [0] contains the IPv6 part, [1] the IPv4 part (hex format) */ function SplitV64($ip) { $ip = SimplePie_Net_IPv6::Uncompress($ip); if (strstr($ip, '.')) { $pos = strrpos($ip, ':'); $ip[$pos] = '_'; $ipPart = explode('_', $ip); return $ipPart; } else { return array($ip, ''); } } /** * Checks an IPv6 address * * Checks if the given IP is IPv6-compatible * * @access public * @static * @param string $ip a valid IPv6-address * @return bool true if $ip is an IPv6 address */ function checkIPv6($ip) { $ipPart = SimplePie_Net_IPv6::SplitV64($ip); $count = 0; if (!empty($ipPart[0])) { $ipv6 = explode(':', $ipPart[0]); for ($i = 0; $i < count($ipv6); $i++) { $dec = hexdec($ipv6[$i]); $hex = strtoupper(preg_replace('/^[0]{1,3}(.*[0-9a-fA-F])$/', '\\1', $ipv6[$i])); if ($ipv6[$i] >= 0 && $dec <= 65535 && $hex === strtoupper(dechex($dec))) { $count++; } } if ($count === 8) { return true; } elseif ($count === 6 && !empty($ipPart[1])) { $ipv4 = explode('.', $ipPart[1]); $count = 0; foreach ($ipv4 as $ipv4_part) { if ($ipv4_part >= 0 && $ipv4_part <= 255 && preg_match('/^\d{1,3}$/', $ipv4_part)) { $count++; } } if ($count === 4) { return true; } } else { return false; } } else { return false; } } } /** * Date Parser * * @package SimplePie */ class SimplePie_Parse_Date { /** * Input data * * @access protected * @var string */ var $date; /** * List of days, calendar day name => ordinal day number in the week * * @access protected * @var array */ var $day = array( // English 'mon' => 1, 'monday' => 1, 'tue' => 2, 'tuesday' => 2, 'wed' => 3, 'wednesday' => 3, 'thu' => 4, 'thursday' => 4, 'fri' => 5, 'friday' => 5, 'sat' => 6, 'saturday' => 6, 'sun' => 7, 'sunday' => 7, // Dutch 'maandag' => 1, 'dinsdag' => 2, 'woensdag' => 3, 'donderdag' => 4, 'vrijdag' => 5, 'zaterdag' => 6, 'zondag' => 7, // French 'lundi' => 1, 'mardi' => 2, 'mercredi' => 3, 'jeudi' => 4, 'vendredi' => 5, 'samedi' => 6, 'dimanche' => 7, // German 'montag' => 1, 'dienstag' => 2, 'mittwoch' => 3, 'donnerstag' => 4, 'freitag' => 5, 'samstag' => 6, 'sonnabend' => 6, 'sonntag' => 7, // Italian 'lunedì' => 1, 'martedì' => 2, 'mercoledì' => 3, 'giovedì' => 4, 'venerdì' => 5, 'sabato' => 6, 'domenica' => 7, // Spanish 'lunes' => 1, 'martes' => 2, 'miércoles' => 3, 'jueves' => 4, 'viernes' => 5, 'sábado' => 6, 'domingo' => 7, // Finnish 'maanantai' => 1, 'tiistai' => 2, 'keskiviikko' => 3, 'torstai' => 4, 'perjantai' => 5, 'lauantai' => 6, 'sunnuntai' => 7, // Hungarian 'hétfő' => 1, 'kedd' => 2, 'szerda' => 3, 'csütörtok' => 4, 'péntek' => 5, 'szombat' => 6, 'vasárnap' => 7, // Greek 'Δευ' => 1, 'Τρι' => 2, 'Τετ' => 3, 'Πεμ' => 4, 'Παρ' => 5, 'Σαβ' => 6, 'Κυρ' => 7, ); /** * List of months, calendar month name => calendar month number * * @access protected * @var array */ var $month = array( // English 'jan' => 1, 'january' => 1, 'feb' => 2, 'february' => 2, 'mar' => 3, 'march' => 3, 'apr' => 4, 'april' => 4, 'may' => 5, // No long form of May 'jun' => 6, 'june' => 6, 'jul' => 7, 'july' => 7, 'aug' => 8, 'august' => 8, 'sep' => 9, 'september' => 8, 'oct' => 10, 'october' => 10, 'nov' => 11, 'november' => 11, 'dec' => 12, 'december' => 12, // Dutch 'januari' => 1, 'februari' => 2, 'maart' => 3, 'april' => 4, 'mei' => 5, 'juni' => 6, 'juli' => 7, 'augustus' => 8, 'september' => 9, 'oktober' => 10, 'november' => 11, 'december' => 12, // French 'janvier' => 1, 'février' => 2, 'mars' => 3, 'avril' => 4, 'mai' => 5, 'juin' => 6, 'juillet' => 7, 'août' => 8, 'septembre' => 9, 'octobre' => 10, 'novembre' => 11, 'décembre' => 12, // German 'januar' => 1, 'februar' => 2, 'märz' => 3, 'april' => 4, 'mai' => 5, 'juni' => 6, 'juli' => 7, 'august' => 8, 'september' => 9, 'oktober' => 10, 'november' => 11, 'dezember' => 12, // Italian 'gennaio' => 1, 'febbraio' => 2, 'marzo' => 3, 'aprile' => 4, 'maggio' => 5, 'giugno' => 6, 'luglio' => 7, 'agosto' => 8, 'settembre' => 9, 'ottobre' => 10, 'novembre' => 11, 'dicembre' => 12, // Spanish 'enero' => 1, 'febrero' => 2, 'marzo' => 3, 'abril' => 4, 'mayo' => 5, 'junio' => 6, 'julio' => 7, 'agosto' => 8, 'septiembre' => 9, 'setiembre' => 9, 'octubre' => 10, 'noviembre' => 11, 'diciembre' => 12, // Finnish 'tammikuu' => 1, 'helmikuu' => 2, 'maaliskuu' => 3, 'huhtikuu' => 4, 'toukokuu' => 5, 'kesäkuu' => 6, 'heinäkuu' => 7, 'elokuu' => 8, 'suuskuu' => 9, 'lokakuu' => 10, 'marras' => 11, 'joulukuu' => 12, // Hungarian 'január' => 1, 'február' => 2, 'március' => 3, 'április' => 4, 'május' => 5, 'június' => 6, 'július' => 7, 'augusztus' => 8, 'szeptember' => 9, 'október' => 10, 'november' => 11, 'december' => 12, // Greek 'Ιαν' => 1, 'Φεβ' => 2, 'Μάώ' => 3, 'Μαώ' => 3, 'Απρ' => 4, 'Μάι' => 5, 'Μαϊ' => 5, 'Μαι' => 5, 'Ιούν' => 6, 'Ιον' => 6, 'Ιούλ' => 7, 'Ιολ' => 7, 'Αύγ' => 8, 'Αυγ' => 8, 'Σεπ' => 9, 'Οκτ' => 10, 'Νοέ' => 11, 'Δεκ' => 12, ); /** * List of timezones, abbreviation => offset from UTC * * @access protected * @var array */ var $timezone = array( 'ACDT' => 37800, 'ACIT' => 28800, 'ACST' => 34200, 'ACT' => -18000, 'ACWDT' => 35100, 'ACWST' => 31500, 'AEDT' => 39600, 'AEST' => 36000, 'AFT' => 16200, 'AKDT' => -28800, 'AKST' => -32400, 'AMDT' => 18000, 'AMT' => -14400, 'ANAST' => 46800, 'ANAT' => 43200, 'ART' => -10800, 'AZOST' => -3600, 'AZST' => 18000, 'AZT' => 14400, 'BIOT' => 21600, 'BIT' => -43200, 'BOT' => -14400, 'BRST' => -7200, 'BRT' => -10800, 'BST' => 3600, 'BTT' => 21600, 'CAST' => 18000, 'CAT' => 7200, 'CCT' => 23400, 'CDT' => -18000, 'CEDT' => 7200, 'CET' => 3600, 'CGST' => -7200, 'CGT' => -10800, 'CHADT' => 49500, 'CHAST' => 45900, 'CIST' => -28800, 'CKT' => -36000, 'CLDT' => -10800, 'CLST' => -14400, 'COT' => -18000, 'CST' => -21600, 'CVT' => -3600, 'CXT' => 25200, 'DAVT' => 25200, 'DTAT' => 36000, 'EADT' => -18000, 'EAST' => -21600, 'EAT' => 10800, 'ECT' => -18000, 'EDT' => -14400, 'EEST' => 10800, 'EET' => 7200, 'EGT' => -3600, 'EKST' => 21600, 'EST' => -18000, 'FJT' => 43200, 'FKDT' => -10800, 'FKST' => -14400, 'FNT' => -7200, 'GALT' => -21600, 'GEDT' => 14400, 'GEST' => 10800, 'GFT' => -10800, 'GILT' => 43200, 'GIT' => -32400, 'GST' => 14400, 'GST' => -7200, 'GYT' => -14400, 'HAA' => -10800, 'HAC' => -18000, 'HADT' => -32400, 'HAE' => -14400, 'HAP' => -25200, 'HAR' => -21600, 'HAST' => -36000, 'HAT' => -9000, 'HAY' => -28800, 'HKST' => 28800, 'HMT' => 18000, 'HNA' => -14400, 'HNC' => -21600, 'HNE' => -18000, 'HNP' => -28800, 'HNR' => -25200, 'HNT' => -12600, 'HNY' => -32400, 'IRDT' => 16200, 'IRKST' => 32400, 'IRKT' => 28800, 'IRST' => 12600, 'JFDT' => -10800, 'JFST' => -14400, 'JST' => 32400, 'KGST' => 21600, 'KGT' => 18000, 'KOST' => 39600, 'KOVST' => 28800, 'KOVT' => 25200, 'KRAST' => 28800, 'KRAT' => 25200, 'KST' => 32400, 'LHDT' => 39600, 'LHST' => 37800, 'LINT' => 50400, 'LKT' => 21600, 'MAGST' => 43200, 'MAGT' => 39600, 'MAWT' => 21600, 'MDT' => -21600, 'MESZ' => 7200, 'MEZ' => 3600, 'MHT' => 43200, 'MIT' => -34200, 'MNST' => 32400, 'MSDT' => 14400, 'MSST' => 10800, 'MST' => -25200, 'MUT' => 14400, 'MVT' => 18000, 'MYT' => 28800, 'NCT' => 39600, 'NDT' => -9000, 'NFT' => 41400, 'NMIT' => 36000, 'NOVST' => 25200, 'NOVT' => 21600, 'NPT' => 20700, 'NRT' => 43200, 'NST' => -12600, 'NUT' => -39600, 'NZDT' => 46800, 'NZST' => 43200, 'OMSST' => 25200, 'OMST' => 21600, 'PDT' => -25200, 'PET' => -18000, 'PETST' => 46800, 'PETT' => 43200, 'PGT' => 36000, 'PHOT' => 46800, 'PHT' => 28800, 'PKT' => 18000, 'PMDT' => -7200, 'PMST' => -10800, 'PONT' => 39600, 'PST' => -28800, 'PWT' => 32400, 'PYST' => -10800, 'PYT' => -14400, 'RET' => 14400, 'ROTT' => -10800, 'SAMST' => 18000, 'SAMT' => 14400, 'SAST' => 7200, 'SBT' => 39600, 'SCDT' => 46800, 'SCST' => 43200, 'SCT' => 14400, 'SEST' => 3600, 'SGT' => 28800, 'SIT' => 28800, 'SRT' => -10800, 'SST' => -39600, 'SYST' => 10800, 'SYT' => 7200, 'TFT' => 18000, 'THAT' => -36000, 'TJT' => 18000, 'TKT' => -36000, 'TMT' => 18000, 'TOT' => 46800, 'TPT' => 32400, 'TRUT' => 36000, 'TVT' => 43200, 'TWT' => 28800, 'UYST' => -7200, 'UYT' => -10800, 'UZT' => 18000, 'VET' => -14400, 'VLAST' => 39600, 'VLAT' => 36000, 'VOST' => 21600, 'VUT' => 39600, 'WAST' => 7200, 'WAT' => 3600, 'WDT' => 32400, 'WEST' => 3600, 'WFT' => 43200, 'WIB' => 25200, 'WIT' => 32400, 'WITA' => 28800, 'WKST' => 18000, 'WST' => 28800, 'YAKST' => 36000, 'YAKT' => 32400, 'YAPT' => 36000, 'YEKST' => 21600, 'YEKT' => 18000, ); /** * Cached PCRE for SimplePie_Parse_Date::$day * * @access protected * @var string */ var $day_pcre; /** * Cached PCRE for SimplePie_Parse_Date::$month * * @access protected * @var string */ var $month_pcre; /** * Array of user-added callback methods * * @access private * @var array */ var $built_in = array(); /** * Array of user-added callback methods * * @access private * @var array */ var $user = array(); /** * Create new SimplePie_Parse_Date object, and set self::day_pcre, * self::month_pcre, and self::built_in * * @access private */ function SimplePie_Parse_Date() { $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')'; $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')'; static $cache; if (!isset($cache[get_class($this)])) { $all_methods = get_class_methods($this); foreach ($all_methods as $method) { if (strtolower(substr($method, 0, 5)) === 'date_') { $cache[get_class($this)][] = $method; } } } foreach ($cache[get_class($this)] as $method) { $this->built_in[] = $method; } } /** * Get the object * * @access public */ function get() { static $object; if (!$object) { $object = new SimplePie_Parse_Date; } return $object; } /** * Parse a date * * @final * @access public * @param string $date Date to parse * @return int Timestamp corresponding to date string, or false on failure */ function parse($date) { foreach ($this->user as $method) { if (($returned = call_user_func($method, $date)) !== false) { return $returned; } } foreach ($this->built_in as $method) { if (($returned = call_user_func(array(&$this, $method), $date)) !== false) { return $returned; } } return false; } /** * Add a callback method to parse a date * * @final * @access public * @param callback $callback */ function add_callback($callback) { if (is_callable($callback)) { $this->user[] = $callback; } else { trigger_error('User-supplied function must be a valid callback', E_USER_WARNING); } } /** * Parse a superset of W3C-DTF (allows hyphens and colons to be omitted, as * well as allowing any of upper or lower case "T", horizontal tabs, or * spaces to be used as the time seperator (including more than one)) * * @access protected * @return int Timestamp */ function date_w3cdtf($date) { static $pcre; if (!$pcre) { $year = '([0-9]{4})'; $month = $day = $hour = $minute = $second = '([0-9]{2})'; $decimal = '([0-9]*)'; $zone = '(?:(Z)|([+\-])([0-9]{1,2}):?([0-9]{1,2}))'; $pcre = '/^' . $year . '(?:-?' . $month . '(?:-?' . $day . '(?:[Tt\x09\x20]+' . $hour . '(?::?' . $minute . '(?::?' . $second . '(?:.' . $decimal . ')?)?)?' . $zone . ')?)?)?$/'; } if (preg_match($pcre, $date, $match)) { /* Capturing subpatterns: 1: Year 2: Month 3: Day 4: Hour 5: Minute 6: Second 7: Decimal fraction of a second 8: Zulu 9: Timezone ± 10: Timezone hours 11: Timezone minutes */ // Fill in empty matches for ($i = count($match); $i <= 3; $i++) { $match[$i] = '1'; } for ($i = count($match); $i <= 7; $i++) { $match[$i] = '0'; } // Numeric timezone if (isset($match[9]) && $match[9] !== '') { $timezone = $match[10] * 3600; $timezone += $match[11] * 60; if ($match[9] === '-') { $timezone = 0 - $timezone; } } else { $timezone = 0; } // Convert the number of seconds to an integer, taking decimals into account $second = round($match[6] + $match[7] / pow(10, strlen($match[7]))); return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone; } else { return false; } } /** * Remove RFC822 comments * * @access protected * @param string $data Data to strip comments from * @return string Comment stripped string */ function remove_rfc2822_comments($string) { $string = (string) $string; $position = 0; $length = strlen($string); $depth = 0; $output = ''; while ($position < $length && ($pos = strpos($string, '(', $position)) !== false) { $output .= substr($string, $position, $pos - $position); $position = $pos + 1; if ($string[$pos - 1] !== '\\') { $depth++; while ($depth && $position < $length) { $position += strcspn($string, '()', $position); if ($string[$position - 1] === '\\') { $position++; continue; } elseif (isset($string[$position])) { switch ($string[$position]) { case '(': $depth++; break; case ')': $depth--; break; } $position++; } else { break; } } } else { $output .= '('; } } $output .= substr($string, $position); return $output; } /** * Parse RFC2822's date format * * @access protected * @return int Timestamp */ function date_rfc2822($date) { static $pcre; if (!$pcre) { $wsp = '[\x09\x20]'; $fws = '(?:' . $wsp . '+|' . $wsp . '*(?:\x0D\x0A' . $wsp . '+)+)'; $optional_fws = $fws . '?'; $day_name = $this->day_pcre; $month = $this->month_pcre; $day = '([0-9]{1,2})'; $hour = $minute = $second = '([0-9]{2})'; $year = '([0-9]{2,4})'; $num_zone = '([+\-])([0-9]{2})([0-9]{2})'; $character_zone = '([A-Z]{1,5})'; $zone = '(?:' . $num_zone . '|' . $character_zone . ')'; $pcre = '/(?:' . $optional_fws . $day_name . $optional_fws . ',)?' . $optional_fws . $day . $fws . $month . $fws . $year . $fws . $hour . $optional_fws . ':' . $optional_fws . $minute . '(?:' . $optional_fws . ':' . $optional_fws . $second . ')?' . $fws . $zone . '/i'; } if (preg_match($pcre, $this->remove_rfc2822_comments($date), $match)) { /* Capturing subpatterns: 1: Day name 2: Day 3: Month 4: Year 5: Hour 6: Minute 7: Second 8: Timezone ± 9: Timezone hours 10: Timezone minutes 11: Alphabetic timezone */ // Find the month number $month = $this->month[strtolower($match[3])]; // Numeric timezone if ($match[8] !== '') { $timezone = $match[9] * 3600; $timezone += $match[10] * 60; if ($match[8] === '-') { $timezone = 0 - $timezone; } } // Character timezone elseif (isset($this->timezone[strtoupper($match[11])])) { $timezone = $this->timezone[strtoupper($match[11])]; } // Assume everything else to be -0000 else { $timezone = 0; } // Deal with 2/3 digit years if ($match[4] < 50) { $match[4] += 2000; } elseif ($match[4] < 1000) { $match[4] += 1900; } // Second is optional, if it is empty set it to zero if ($match[7] !== '') { $second = $match[7]; } else { $second = 0; } return gmmktime($match[5], $match[6], $second, $month, $match[2], $match[4]) - $timezone; } else { return false; } } /** * Parse RFC850's date format * * @access protected * @return int Timestamp */ function date_rfc850($date) { static $pcre; if (!$pcre) { $space = '[\x09\x20]+'; $day_name = $this->day_pcre; $month = $this->month_pcre; $day = '([0-9]{1,2})'; $year = $hour = $minute = $second = '([0-9]{2})'; $zone = '([A-Z]{1,5})'; $pcre = '/^' . $day_name . ',' . $space . $day . '-' . $month . '-' . $year . $space . $hour . ':' . $minute . ':' . $second . $space . $zone . '$/i'; } if (preg_match($pcre, $date, $match)) { /* Capturing subpatterns: 1: Day name 2: Day 3: Month 4: Year 5: Hour 6: Minute 7: Second 8: Timezone */ // Month $month = $this->month[strtolower($match[3])]; // Character timezone if (isset($this->timezone[strtoupper($match[8])])) { $timezone = $this->timezone[strtoupper($match[8])]; } // Assume everything else to be -0000 else { $timezone = 0; } // Deal with 2 digit year if ($match[4] < 50) { $match[4] += 2000; } else { $match[4] += 1900; } return gmmktime($match[5], $match[6], $match[7], $month, $match[2], $match[4]) - $timezone; } else { return false; } } /** * Parse C99's asctime()'s date format * * @access protected * @return int Timestamp */ function date_asctime($date) { static $pcre; if (!$pcre) { $space = '[\x09\x20]+'; $wday_name = $this->day_pcre; $mon_name = $this->month_pcre; $day = '([0-9]{1,2})'; $hour = $sec = $min = '([0-9]{2})'; $year = '([0-9]{4})'; $terminator = '\x0A?\x00?'; $pcre = '/^' . $wday_name . $space . $mon_name . $space . $day . $space . $hour . ':' . $min . ':' . $sec . $space . $year . $terminator . '$/i'; } if (preg_match($pcre, $date, $match)) { /* Capturing subpatterns: 1: Day name 2: Month 3: Day 4: Hour 5: Minute 6: Second 7: Year */ $month = $this->month[strtolower($match[2])]; return gmmktime($match[4], $match[5], $match[6], $month, $match[3], $match[7]); } else { return false; } } /** * Parse dates using strtotime() * * @access protected * @return int Timestamp */ function date_strtotime($date) { $strtotime = strtotime($date); if ($strtotime === -1 || $strtotime === false) { return false; } else { return $strtotime; } } } /** * Content-type sniffing * * @package SimplePie */ class SimplePie_Content_Type_Sniffer { /** * File object * * @var SimplePie_File * @access private */ var $file; /** * Create an instance of the class with the input file * * @access public * @param SimplePie_Content_Type_Sniffer $file Input file */ function SimplePie_Content_Type_Sniffer($file) { $this->file = $file; } /** * Get the Content-Type of the specified file * * @access public * @return string Actual Content-Type */ function get_type() { if (isset($this->file->headers['content-type'])) { if (!isset($this->file->headers['content-encoding']) && ($this->file->headers['content-type'] === 'text/plain' || $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1' || $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1')) { return $this->text_or_binary(); } if (($pos = strpos($this->file->headers['content-type'], ';')) !== false) { $official = substr($this->file->headers['content-type'], 0, $pos); } else { $official = $this->file->headers['content-type']; } $official = strtolower($official); if ($official === 'unknown/unknown' || $official === 'application/unknown') { return $this->unknown(); } elseif (substr($official, -4) === '+xml' || $official === 'text/xml' || $official === 'application/xml') { return $official; } elseif (substr($official, 0, 6) === 'image/') { if ($return = $this->image()) { return $return; } else { return $official; } } elseif ($official === 'text/html') { return $this->feed_or_html(); } else { return $official; } } else { return $this->unknown(); } } /** * Sniff text or binary * * @access private * @return string Actual Content-Type */ function text_or_binary() { if (substr($this->file->body, 0, 2) === "\xFE\xFF" || substr($this->file->body, 0, 2) === "\xFF\xFE" || substr($this->file->body, 0, 4) === "\x00\x00\xFE\xFF" || substr($this->file->body, 0, 3) === "\xEF\xBB\xBF") { return 'text/plain'; } elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body)) { return 'application/octect-stream'; } else { return 'text/plain'; } } /** * Sniff unknown * * @access private * @return string Actual Content-Type */ function unknown() { $ws = strspn($this->file->body, "\x09\x0A\x0B\x0C\x0D\x20"); if (strtolower(substr($this->file->body, $ws, 14)) === '<!doctype html' || strtolower(substr($this->file->body, $ws, 5)) === '<html' || strtolower(substr($this->file->body, $ws, 7)) === '<script') { return 'text/html'; } elseif (substr($this->file->body, 0, 5) === '%PDF-') { return 'application/pdf'; } elseif (substr($this->file->body, 0, 11) === '%!PS-Adobe-') { return 'application/postscript'; } elseif (substr($this->file->body, 0, 6) === 'GIF87a' || substr($this->file->body, 0, 6) === 'GIF89a') { return 'image/gif'; } elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") { return 'image/png'; } elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") { return 'image/jpeg'; } elseif (substr($this->file->body, 0, 2) === "\x42\x4D") { return 'image/bmp'; } else { return $this->text_or_binary(); } } /** * Sniff images * * @access private * @return string Actual Content-Type */ function image() { if (substr($this->file->body, 0, 6) === 'GIF87a' || substr($this->file->body, 0, 6) === 'GIF89a') { return 'image/gif'; } elseif (substr($this->file->body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") { return 'image/png'; } elseif (substr($this->file->body, 0, 3) === "\xFF\xD8\xFF") { return 'image/jpeg'; } elseif (substr($this->file->body, 0, 2) === "\x42\x4D") { return 'image/bmp'; } else { return false; } } /** * Sniff HTML * * @access private * @return string Actual Content-Type */ function feed_or_html() { $len = strlen($this->file->body); $pos = strspn($this->file->body, "\x09\x0A\x0D\x20"); while ($pos < $len) { switch ($this->file->body[$pos]) { case "\x09": case "\x0A": case "\x0D": case "\x20": $pos += strspn($this->file->body, "\x09\x0A\x0D\x20", $pos); continue 2; case '<': $pos++; break; default: return 'text/html'; } if (substr($this->file->body, $pos, 3) === '!--') { $pos += 3; if ($pos < $len && ($pos = strpos($this->file->body, '-->', $pos)) !== false) { $pos += 3; } else { return 'text/html'; } } elseif (substr($this->file->body, $pos, 1) === '!') { if ($pos < $len && ($pos = strpos($this->file->body, '>', $pos)) !== false) { $pos++; } else { return 'text/html'; } } elseif (substr($this->file->body, $pos, 1) === '?') { if ($pos < $len && ($pos = strpos($this->file->body, '?>', $pos)) !== false) { $pos += 2; } else { return 'text/html'; } } elseif (substr($this->file->body, $pos, 3) === 'rss' || substr($this->file->body, $pos, 7) === 'rdf:RDF') { return 'application/rss+xml'; } elseif (substr($this->file->body, $pos, 4) === 'feed') { return 'application/atom+xml'; } else { return 'text/html'; } } return 'text/html'; } } /** * Parses the XML Declaration * * @package SimplePie */ class SimplePie_XML_Declaration_Parser { /** * XML Version * * @access public * @var string */ var $version = '1.0'; /** * Encoding * * @access public * @var string */ var $encoding = 'UTF-8'; /** * Standalone * * @access public * @var bool */ var $standalone = false; /** * Current state of the state machine * * @access private * @var string */ var $state = 'before_version_name'; /** * Input data * * @access private * @var string */ var $data = ''; /** * Input data length (to avoid calling strlen() everytime this is needed) * * @access private * @var int */ var $data_length = 0; /** * Current position of the pointer * * @var int * @access private */ var $position = 0; /** * Create an instance of the class with the input data * * @access public * @param string $data Input data */ function SimplePie_XML_Declaration_Parser($data) { $this->data = $data; $this->data_length = strlen($this->data); } /** * Parse the input data * * @access public * @return bool true on success, false on failure */ function parse() { while ($this->state && $this->state !== 'emit' && $this->has_data()) { $state = $this->state; $this->$state(); } $this->data = ''; if ($this->state === 'emit') { return true; } else { $this->version = ''; $this->encoding = ''; $this->standalone = ''; return false; } } /** * Check whether there is data beyond the pointer * * @access private * @return bool true if there is further data, false if not */ function has_data() { return (bool) ($this->position < $this->data_length); } /** * Advance past any whitespace * * @return int Number of whitespace characters passed */ function skip_whitespace() { $whitespace = strspn($this->data, "\x09\x0A\x0D\x20", $this->position); $this->position += $whitespace; return $whitespace; } /** * Read value */ function get_value() { $quote = substr($this->data, $this->position, 1); if ($quote === '"' || $quote === "'") { $this->position++; $len = strcspn($this->data, $quote, $this->position); if ($this->has_data()) { $value = substr($this->data, $this->position, $len); $this->position += $len + 1; return $value; } } return false; } function before_version_name() { if ($this->skip_whitespace()) { $this->state = 'version_name'; } else { $this->state = false; } } function version_name() { if (substr($this->data, $this->position, 7) === 'version') { $this->position += 7; $this->skip_whitespace(); $this->state = 'version_equals'; } else { $this->state = false; } } function version_equals() { if (substr($this->data, $this->position, 1) === '=') { $this->position++; $this->skip_whitespace(); $this->state = 'version_value'; } else { $this->state = false; } } function version_value() { if ($this->version = $this->get_value()) { $this->skip_whitespace(); if ($this->has_data()) { $this->state = 'encoding_name'; } else { $this->state = 'emit'; } } else { $this->state = 'standalone_name'; } } function encoding_name() { if (substr($this->data, $this->position, 8) === 'encoding') { $this->position += 8; $this->skip_whitespace(); $this->state = 'encoding_equals'; } else { $this->state = false; } } function encoding_equals() { if (substr($this->data, $this->position, 1) === '=') { $this->position++; $this->skip_whitespace(); $this->state = 'encoding_value'; } else { $this->state = false; } } function encoding_value() { if ($this->encoding = $this->get_value()) { $this->skip_whitespace(); if ($this->has_data()) { $this->state = 'standalone_name'; } else { $this->state = 'emit'; } } else { $this->state = false; } } function standalone_name() { if (substr($this->data, $this->position, 10) === 'standalone') { $this->position += 10; $this->skip_whitespace(); $this->state = 'standalone_equals'; } else { $this->state = false; } } function standalone_equals() { if (substr($this->data, $this->position, 1) === '=') { $this->position++; $this->skip_whitespace(); $this->state = 'standalone_value'; } else { $this->state = false; } } function standalone_value() { if ($standalone = $this->get_value()) { switch ($standalone) { case 'yes': $this->standalone = true; break; case 'no': $this->standalone = false; break; default: $this->state = false; return; } $this->skip_whitespace(); if ($this->has_data()) { $this->state = false; } else { $this->state = 'emit'; } } else { $this->state = false; } } } class SimplePie_Locator { var $useragent; var $timeout; var $file; var $local = array(); var $elsewhere = array(); var $file_class = 'SimplePie_File'; var $cached_entities = array(); var $http_base; var $base; var $base_location = 0; var $checked_feeds = 0; var $max_checked_feeds = 10; var $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer'; function SimplePie_Locator(&$file, $timeout = 10, $useragent = null, $file_class = 'SimplePie_File', $max_checked_feeds = 10, $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer') { $this->file =& $file; $this->file_class = $file_class; $this->useragent = $useragent; $this->timeout = $timeout; $this->max_checked_feeds = $max_checked_feeds; $this->content_type_sniffer_class = $content_type_sniffer_class; } function find($type = SIMPLEPIE_LOCATOR_ALL, &$working) { if ($this->is_feed($this->file)) { return $this->file; } if ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE) { $sniffer = new $this->content_type_sniffer_class($this->file); if ($sniffer->get_type() !== 'text/html') { return null; } } if ($type & ~SIMPLEPIE_LOCATOR_NONE) { $this->get_base(); } if ($type & SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery()) { return $working[0]; } if ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links()) { if ($type & SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local)) { return $working; } if ($type & SIMPLEPIE_LOCATOR_LOCAL_BODY && $working = $this->body($this->local)) { return $working; } if ($type & SIMPLEPIE_LOCATOR_REMOTE_EXTENSION && $working = $this->extension($this->elsewhere)) { return $working; } if ($type & SIMPLEPIE_LOCATOR_REMOTE_BODY && $working = $this->body($this->elsewhere)) { return $working; } } return null; } function is_feed(&$file) { if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE) { $sniffer = new $this->content_type_sniffer_class($file); $sniffed = $sniffer->get_type(); if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml'))) { return true; } else { return false; } } elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL) { return true; } else { return false; } } function get_base() { $this->http_base = $this->file->url; $this->base = $this->http_base; $elements = SimplePie_Misc::get_element('base', $this->file->body); foreach ($elements as $element) { if ($element['attribs']['href']['data'] !== '') { $this->base = SimplePie_Misc::absolutize_url(trim($element['attribs']['href']['data']), $this->http_base); $this->base_location = $element['offset']; break; } } } function autodiscovery() { $links = array_merge(SimplePie_Misc::get_element('link', $this->file->body), SimplePie_Misc::get_element('a', $this->file->body), SimplePie_Misc::get_element('area', $this->file->body)); $done = array(); $feeds = array(); foreach ($links as $link) { if ($this->checked_feeds === $this->max_checked_feeds) { break; } if (isset($link['attribs']['href']['data']) && isset($link['attribs']['rel']['data'])) { $rel = array_unique(SimplePie_Misc::space_seperated_tokens(strtolower($link['attribs']['rel']['data']))); if ($this->base_location < $link['offset']) { $href = SimplePie_Misc::absolutize_url(trim($link['attribs']['href']['data']), $this->base); } else { $href = SimplePie_Misc::absolutize_url(trim($link['attribs']['href']['data']), $this->http_base); } if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !empty($link['attribs']['type']['data']) && in_array(strtolower(SimplePie_Misc::parse_mime($link['attribs']['type']['data'])), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href])) { $this->checked_feeds++; $feed = new $this->file_class($href, $this->timeout, 5, null, $this->useragent); if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) { $feeds[$href] = $feed; } } $done[] = $href; } } if (!empty($feeds)) { return array_values($feeds); } else { return null; } } function get_links() { $links = SimplePie_Misc::get_element('a', $this->file->body); foreach ($links as $link) { if (isset($link['attribs']['href']['data'])) { $href = trim($link['attribs']['href']['data']); $parsed = SimplePie_Misc::parse_url($href); if ($parsed['scheme'] === '' || preg_match('/^(http(s)|feed)?$/i', $parsed['scheme'])) { if ($this->base_location < $link['offset']) { $href = SimplePie_Misc::absolutize_url(trim($link['attribs']['href']['data']), $this->base); } else { $href = SimplePie_Misc::absolutize_url(trim($link['attribs']['href']['data']), $this->http_base); } $current = SimplePie_Misc::parse_url($this->file->url); if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority']) { $this->local[] = $href; } else { $this->elsewhere[] = $href; } } } } $this->local = array_unique($this->local); $this->elsewhere = array_unique($this->elsewhere); if (!empty($this->local) || !empty($this->elsewhere)) { return true; } return null; } function extension(&$array) { foreach ($array as $key => $value) { if ($this->checked_feeds === $this->max_checked_feeds) { break; } if (in_array(strtolower(strrchr($value, '.')), array('.rss', '.rdf', '.atom', '.xml'))) { $this->checked_feeds++; $feed = new $this->file_class($value, $this->timeout, 5, null, $this->useragent); if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) { return $feed; } else { unset($array[$key]); } } } return null; } function body(&$array) { foreach ($array as $key => $value) { if ($this->checked_feeds === $this->max_checked_feeds) { break; } if (preg_match('/(rss|rdf|atom|xml)/i', $value)) { $this->checked_feeds++; $feed = new $this->file_class($value, $this->timeout, 5, null, $this->useragent); if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) { return $feed; } else { unset($array[$key]); } } } return null; } } class SimplePie_Parser { var $error_code; var $error_string; var $current_line; var $current_column; var $current_byte; var $separator = ' '; var $namespace = array(''); var $element = array(''); var $xml_base = array(''); var $xml_base_explicit = array(false); var $xml_lang = array(''); var $data = array(); var $datas = array(array()); var $current_xhtml_construct = -1; var $encoding; function parse(&$data, $encoding) { // Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character if (strtoupper($encoding) === 'US-ASCII') { $this->encoding = 'UTF-8'; } else { $this->encoding = $encoding; } // Strip BOM: // UTF-32 Big Endian BOM if (substr($data, 0, 4) === "\x00\x00\xFE\xFF") { $data = substr($data, 4); } // UTF-32 Little Endian BOM elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00") { $data = substr($data, 4); } // UTF-16 Big Endian BOM elseif (substr($data, 0, 2) === "\xFE\xFF") { $data = substr($data, 2); } // UTF-16 Little Endian BOM elseif (substr($data, 0, 2) === "\xFF\xFE") { $data = substr($data, 2); } // UTF-8 BOM elseif (substr($data, 0, 3) === "\xEF\xBB\xBF") { $data = substr($data, 3); } if (substr($data, 0, 5) === '<?xml' && strspn(substr($data, 5, 1), "\x09\x0A\x0D\x20") && ($pos = strpos($data, '?>')) !== false) { $declaration = new SimplePie_XML_Declaration_Parser(substr($data, 5, $pos - 5)); if ($declaration->parse()) { $data = substr($data, $pos + 2); $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' . $data; } else { $this->error_string = 'SimplePie bug! Please report this!'; return false; } } $return = true; static $xml_is_sane = null; if ($xml_is_sane === null) { $parser_check = xml_parser_create(); xml_parse_into_struct($parser_check, '<foo>&</foo>', $values); xml_parser_free($parser_check); $xml_is_sane = isset($values[0]['value']); } // Create the parser if ($xml_is_sane) { $xml = xml_parser_create_ns($this->encoding, $this->separator); xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1); xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0); xml_set_object($xml, $this); xml_set_character_data_handler($xml, 'cdata'); xml_set_element_handler($xml, 'tag_open', 'tag_close'); // Parse! if (!xml_parse($xml, $data, true)) { $this->error_code = xml_get_error_code($xml); $this->error_string = xml_error_string($this->error_code); $return = false; } $this->current_line = xml_get_current_line_number($xml); $this->current_column = xml_get_current_column_number($xml); $this->current_byte = xml_get_current_byte_index($xml); xml_parser_free($xml); return $return; } else { libxml_clear_errors(); $xml = new XMLReader(); $xml->xml($data); while (@$xml->read()) { switch ($xml->nodeType) { case constant('XMLReader::END_ELEMENT'): if ($xml->namespaceURI !== '') { $tagName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}"; } else { $tagName = $xml->localName; } $this->tag_close(null, $tagName); break; case constant('XMLReader::ELEMENT'): $empty = $xml->isEmptyElement; if ($xml->namespaceURI !== '') { $tagName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}"; } else { $tagName = $xml->localName; } $attributes = array(); while ($xml->moveToNextAttribute()) { if ($xml->namespaceURI !== '') { $attrName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}"; } else { $attrName = $xml->localName; } $attributes[$attrName] = $xml->value; } $this->tag_open(null, $tagName, $attributes); if ($empty) { $this->tag_close(null, $tagName); } break; case constant('XMLReader::TEXT'): case constant('XMLReader::CDATA'): $this->cdata(null, $xml->value); break; } } if ($error = libxml_get_last_error()) { $this->error_code = $error->code; $this->error_string = $error->message; $this->current_line = $error->line; $this->current_column = $error->column; return false; } else { return true; } } } function get_error_code() { return $this->error_code; } function get_error_string() { return $this->error_string; } function get_current_line() { return $this->current_line; } function get_current_column() { return $this->current_column; } function get_current_byte() { return $this->current_byte; } function get_data() { return $this->data; } function tag_open($parser, $tag, $attributes) { list($this->namespace[], $this->element[]) = $this->split_ns($tag); $attribs = array(); foreach ($attributes as $name => $value) { list($attrib_namespace, $attribute) = $this->split_ns($name); $attribs[$attrib_namespace][$attribute] = $value; } if (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['base'])) { $this->xml_base[] = SimplePie_Misc::absolutize_url($attribs[SIMPLEPIE_NAMESPACE_XML]['base'], end($this->xml_base)); $this->xml_base_explicit[] = true; } else { $this->xml_base[] = end($this->xml_base); $this->xml_base_explicit[] = end($this->xml_base_explicit); } if (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['lang'])) { $this->xml_lang[] = $attribs[SIMPLEPIE_NAMESPACE_XML]['lang']; } else { $this->xml_lang[] = end($this->xml_lang); } if ($this->current_xhtml_construct >= 0) { $this->current_xhtml_construct++; if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML) { $this->data['data'] .= '<' . end($this->element); if (isset($attribs[''])) { foreach ($attribs[''] as $name => $value) { $this->data['data'] .= ' ' . $name . '="' . htmlspecialchars($value, ENT_COMPAT, $this->encoding) . '"'; } } $this->data['data'] .= '>'; } } else { $this->datas[] =& $this->data; $this->data =& $this->data['child'][end($this->namespace)][end($this->element)][]; $this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang)); if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml') || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')) { $this->current_xhtml_construct = 0; } } } function cdata($parser, $cdata) { if ($this->current_xhtml_construct >= 0) { $this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding); } else { $this->data['data'] .= $cdata; } } function tag_close($parser, $tag) { if ($this->current_xhtml_construct >= 0) { $this->current_xhtml_construct--; if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'))) { $this->data['data'] .= '</' . end($this->element) . '>'; } } if ($this->current_xhtml_construct === -1) { $this->data =& $this->datas[count($this->datas) - 1]; array_pop($this->datas); } array_pop($this->element); array_pop($this->namespace); array_pop($this->xml_base); array_pop($this->xml_base_explicit); array_pop($this->xml_lang); } function split_ns($string) { static $cache = array(); if (!isset($cache[$string])) { if ($pos = strpos($string, $this->separator)) { static $separator_length; if (!$separator_length) { $separator_length = strlen($this->separator); } $namespace = substr($string, 0, $pos); $local_name = substr($string, $pos + $separator_length); if (strtolower($namespace) === SIMPLEPIE_NAMESPACE_ITUNES) { $namespace = SIMPLEPIE_NAMESPACE_ITUNES; } // Normalize the Media RSS namespaces if ($namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG) { $namespace = SIMPLEPIE_NAMESPACE_MEDIARSS; } $cache[$string] = array($namespace, $local_name); } else { $cache[$string] = array('', $string); } } return $cache[$string]; } } /** * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shorten a string while preserving HTML tags */ class SimplePie_Sanitize { // Private vars var $base; // Options var $remove_div = true; var $image_handler = ''; var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'); var $encode_instead_of_strip = false; var $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'); var $strip_comments = false; var $output_encoding = 'UTF-8'; var $enable_cache = true; var $cache_location = './cache'; var $cache_name_function = 'md5'; var $cache_class = 'SimplePie_Cache'; var $file_class = 'SimplePie_File'; var $timeout = 10; var $useragent = ''; var $force_fsockopen = false; var $replace_url_attributes = array( 'a' => 'href', 'area' => 'href', 'blockquote' => 'cite', 'del' => 'cite', 'form' => 'action', 'img' => array('longdesc', 'src'), 'input' => 'src', 'ins' => 'cite', 'q' => 'cite' ); function remove_div($enable = true) { $this->remove_div = (bool) $enable; } function set_image_handler($page = false) { if ($page) { $this->image_handler = (string) $page; } else { $this->image_handler = false; } } function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie_Cache') { if (isset($enable_cache)) { $this->enable_cache = (bool) $enable_cache; } if ($cache_location) { $this->cache_location = (string) $cache_location; } if ($cache_name_function) { $this->cache_name_function = (string) $cache_name_function; } if ($cache_class) { $this->cache_class = (string) $cache_class; } } function pass_file_data($file_class = 'SimplePie_File', $timeout = 10, $useragent = '', $force_fsockopen = false) { if ($file_class) { $this->file_class = (string) $file_class; } if ($timeout) { $this->timeout = (string) $timeout; } if ($useragent) { $this->useragent = (string) $useragent; } if ($force_fsockopen) { $this->force_fsockopen = (string) $force_fsockopen; } } function strip_htmltags($tags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style')) { if ($tags) { if (is_array($tags)) { $this->strip_htmltags = $tags; } else { $this->strip_htmltags = explode(',', $tags); } } else { $this->strip_htmltags = false; } } function encode_instead_of_strip($encode = false) { $this->encode_instead_of_strip = (bool) $encode; } function strip_attributes($attribs = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc')) { if ($attribs) { if (is_array($attribs)) { $this->strip_attributes = $attribs; } else { $this->strip_attributes = explode(',', $attribs); } } else { $this->strip_attributes = false; } } function strip_comments($strip = false) { $this->strip_comments = (bool) $strip; } function set_output_encoding($encoding = 'UTF-8') { $this->output_encoding = (string) $encoding; } /** * Set element/attribute key/value pairs of HTML attributes * containing URLs that need to be resolved relative to the feed * * @access public * @since 1.0 * @param array $element_attribute Element/attribute key/value pairs */ function set_url_replacements($element_attribute = array('a' => 'href', 'area' => 'href', 'blockquote' => 'cite', 'del' => 'cite', 'form' => 'action', 'img' => array('longdesc', 'src'), 'input' => 'src', 'ins' => 'cite', 'q' => 'cite')) { $this->replace_url_attributes = (array) $element_attribute; } function sanitize($data, $type, $base = '') { $data = trim($data); if ($data !== '' || $type & SIMPLEPIE_CONSTRUCT_IRI) { if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML) { if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data)) { $type |= SIMPLEPIE_CONSTRUCT_HTML; } else { $type |= SIMPLEPIE_CONSTRUCT_TEXT; } } if ($type & SIMPLEPIE_CONSTRUCT_BASE64) { $data = base64_decode($data); } if ($type & SIMPLEPIE_CONSTRUCT_XHTML) { if ($this->remove_div) { $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '', $data); $data = preg_replace('/<\/div>$/', '', $data); } else { $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '<div>', $data); } } if ($type & (SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML)) { // Strip comments if ($this->strip_comments) { $data = SimplePie_Misc::strip_comments($data); } // Strip out HTML tags and attributes that might cause various security problems. // Based on recommendations by Mark Pilgrim at: // http://diveintomark.org/archives/2003/06/12/how_to_consume_rss_safely if ($this->strip_htmltags) { foreach ($this->strip_htmltags as $tag) { $pcre = "/<($tag)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$tag" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>|(\/)?>)/siU'; while (preg_match($pcre, $data)) { $data = preg_replace_callback($pcre, array(&$this, 'do_strip_htmltags'), $data); } } } if ($this->strip_attributes) { foreach ($this->strip_attributes as $attrib) { $data = preg_replace('/(<[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*)' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . trim($attrib) . '(?:\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>/', '\1\2\3>', $data); } } // Replace relative URLs $this->base = $base; foreach ($this->replace_url_attributes as $element => $attributes) { $data = $this->replace_urls($data, $element, $attributes); } // If image handling (caching, etc.) is enabled, cache and rewrite all the image tags. if (isset($this->image_handler) && ((string) $this->image_handler) !== '' && $this->enable_cache) { $images = SimplePie_Misc::get_element('img', $data); foreach ($images as $img) { if (isset($img['attribs']['src']['data'])) { $image_url = call_user_func($this->cache_name_function, $img['attribs']['src']['data']); $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, $image_url, 'spi'); if ($cache->load()) { $img['attribs']['src']['data'] = $this->image_handler . $image_url; $data = str_replace($img['full'], SimplePie_Misc::element_implode($img), $data); } else { $file = new $this->file_class($img['attribs']['src']['data'], $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen); $headers = $file->headers; if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) { if ($cache->save(array('headers' => $file->headers, 'body' => $file->body))) { $img['attribs']['src']['data'] = $this->image_handler . $image_url; $data = str_replace($img['full'], SimplePie_Misc::element_implode($img), $data); } else { trigger_error("$this->cache_location is not writeable", E_USER_WARNING); } } } } } } // Having (possibly) taken stuff out, there may now be whitespace at the beginning/end of the data $data = trim($data); } if ($type & SIMPLEPIE_CONSTRUCT_IRI) { $data = SimplePie_Misc::absolutize_url($data, $base); } if ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI)) { $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8'); } if ($this->output_encoding !== 'UTF-8') { $data = SimplePie_Misc::change_encoding($data, 'UTF-8', $this->output_encoding); } } return $data; } function replace_urls($data, $tag, $attributes) { if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags)) { $elements = SimplePie_Misc::get_element($tag, $data); foreach ($elements as $element) { if (is_array($attributes)) { foreach ($attributes as $attribute) { if (isset($element['attribs'][$attribute]['data'])) { $element['attribs'][$attribute]['data'] = SimplePie_Misc::absolutize_url($element['attribs'][$attribute]['data'], $this->base); $new_element = SimplePie_Misc::element_implode($element); $data = str_replace($element['full'], $new_element, $data); $element['full'] = $new_element; } } } elseif (isset($element['attribs'][$attributes]['data'])) { $element['attribs'][$attributes]['data'] = SimplePie_Misc::absolutize_url($element['attribs'][$attributes]['data'], $this->base); $data = str_replace($element['full'], SimplePie_Misc::element_implode($element), $data); } } } return $data; } function do_strip_htmltags($match) { if ($this->encode_instead_of_strip) { if (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'))) { $match[1] = htmlspecialchars($match[1], ENT_COMPAT, 'UTF-8'); $match[2] = htmlspecialchars($match[2], ENT_COMPAT, 'UTF-8'); return "<$match[1]$match[2]>$match[3]</$match[1]>"; } else { return htmlspecialchars($match[0], ENT_COMPAT, 'UTF-8'); } } elseif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'))) { return $match[4]; } else { return ''; } } } ?> PK���\b�n��libraries/simplepie/README.txtnu�[���SIMPLEPIE http://simplepie.org By Ryan Parman and Geoffrey Sneddon BSD-LICENSED http://www.opensource.org/licenses/bsd-license.php WHAT COMES IN THE PACKAGE? 1) simplepie.inc - The SimplePie library. This is all that's required for your pages. 2) README.txt - This document. 3) LICENSE.txt - A copy of the BSD license. 4) compatibility_test - The SimplePie compatibility test that checks your server for required settings. 5) demo - A basic feed reader demo that shows off some of SimplePie's more noticable features. 6) idn - A third-party library that SimplePie can optionally use to understand Internationalized Domain Names (IDNs). 7) test - SimplePie's unit test suite. This is only available in SVN builds. TO START THE DEMO: 1) Upload this package to your webserver. 2) Make sure that the cache folder inside of the demo folder is server-writable. 3) Navigate your browser to the demo folder. SUPPORT: For further setup and install documentation, function references, etc., visit: http://simplepie.org/wiki/ For bug reports, feature requests and other support, visit: http://simplepie.org/support/ For more insight on SimplePie development, visit: http://simplepie.org/development/PK���\ ���eelibraries/classmap.phpnu�[���<?php /** * @package Joomla.Libraries * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ JLoader::registerAlias('JRegistry', '\\Joomla\\Registry\\Registry'); JLoader::registerAlias('JRegistryFormat', '\\Joomla\\Registry\\AbstractRegistryFormat'); JLoader::registerAlias('JRegistryFormatIni', '\\Joomla\\Registry\\Format\\Ini'); JLoader::registerAlias('JRegistryFormatJson', '\\Joomla\\Registry\\Format\\Json'); JLoader::registerAlias('JRegistryFormatPhp', '\\Joomla\\Registry\\Format\\Php'); JLoader::registerAlias('JRegistryFormatXml', '\\Joomla\\Registry\\Format\\Xml'); JLoader::registerAlias('JStringInflector', '\\Joomla\\String\\Inflector'); JLoader::registerAlias('JStringNormalise', '\\Joomla\\String\\Normalise'); PK���\��-��libraries/vendor/autoload.phpnu�[���<?php // autoload.php @generated by Composer require_once __DIR__ . '/composer' . '/autoload_real.php'; return ComposerAutoloaderInitf9aed076f12471aff0049364a504b3f7::getLoader(); PK���\p��O== libraries/vendor/psr/log/LICENSEnu�[���Copyright (c) 2012 PHP Framework Interoperability Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK���\SjT 9libraries/vendor/psr/log/Psr/Log/LoggerAwareInterface.phpnu�[���<?php namespace Psr\Log; /** * Describes a logger-aware instance */ interface LoggerAwareInterface { /** * Sets a logger instance on the object * * @param LoggerInterface $logger * @return null */ public function setLogger(LoggerInterface $logger); } PK���\=����0libraries/vendor/psr/log/Psr/Log/LoggerTrait.phpnu�[���<?php namespace Psr\Log; /** * This is a simple Logger trait that classes unable to extend AbstractLogger * (because they extend another class, etc) can include. * * It simply delegates all log-level-specific methods to the `log` method to * reduce boilerplate code that a simple Logger that does the same thing with * messages regardless of the error level has to implement. */ trait LoggerTrait { /** * System is unusable. * * @param string $message * @param array $context * @return null */ public function emergency($message, array $context = array()) { $this->log(LogLevel::EMERGENCY, $message, $context); } /** * Action must be taken immediately. * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * * @param string $message * @param array $context * @return null */ public function alert($message, array $context = array()) { $this->log(LogLevel::ALERT, $message, $context); } /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * * @param string $message * @param array $context * @return null */ public function critical($message, array $context = array()) { $this->log(LogLevel::CRITICAL, $message, $context); } /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * * @param string $message * @param array $context * @return null */ public function error($message, array $context = array()) { $this->log(LogLevel::ERROR, $message, $context); } /** * Exceptional occurrences that are not errors. * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * * @param string $message * @param array $context * @return null */ public function warning($message, array $context = array()) { $this->log(LogLevel::WARNING, $message, $context); } /** * Normal but significant events. * * @param string $message * @param array $context * @return null */ public function notice($message, array $context = array()) { $this->log(LogLevel::NOTICE, $message, $context); } /** * Interesting events. * * Example: User logs in, SQL logs. * * @param string $message * @param array $context * @return null */ public function info($message, array $context = array()) { $this->log(LogLevel::INFO, $message, $context); } /** * Detailed debug information. * * @param string $message * @param array $context * @return null */ public function debug($message, array $context = array()) { $this->log(LogLevel::DEBUG, $message, $context); } /** * Logs with an arbitrary level. * * @param mixed $level * @param string $message * @param array $context * @return null */ abstract public function log($level, $message, array $context = array()); } PK���\�b����4libraries/vendor/psr/log/Psr/Log/LoggerInterface.phpnu�[���<?php namespace Psr\Log; /** * Describes a logger instance * * The message MUST be a string or object implementing __toString(). * * The message MAY contain placeholders in the form: {foo} where foo * will be replaced by the context data in key "foo". * * The context array can contain arbitrary data, the only assumption that * can be made by implementors is that if an Exception instance is given * to produce a stack trace, it MUST be in a key named "exception". * * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md * for the full interface specification. */ interface LoggerInterface { /** * System is unusable. * * @param string $message * @param array $context * @return null */ public function emergency($message, array $context = array()); /** * Action must be taken immediately. * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * * @param string $message * @param array $context * @return null */ public function alert($message, array $context = array()); /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * * @param string $message * @param array $context * @return null */ public function critical($message, array $context = array()); /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * * @param string $message * @param array $context * @return null */ public function error($message, array $context = array()); /** * Exceptional occurrences that are not errors. * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * * @param string $message * @param array $context * @return null */ public function warning($message, array $context = array()); /** * Normal but significant events. * * @param string $message * @param array $context * @return null */ public function notice($message, array $context = array()); /** * Interesting events. * * Example: User logs in, SQL logs. * * @param string $message * @param array $context * @return null */ public function info($message, array $context = array()); /** * Detailed debug information. * * @param string $message * @param array $context * @return null */ public function debug($message, array $context = array()); /** * Logs with an arbitrary level. * * @param mixed $level * @param string $message * @param array $context * @return null */ public function log($level, $message, array $context = array()); } PK���\l$ӥ88-libraries/vendor/psr/log/Psr/Log/LogLevel.phpnu�[���<?php namespace Psr\Log; /** * Describes log levels */ class LogLevel { const EMERGENCY = 'emergency'; const ALERT = 'alert'; const CRITICAL = 'critical'; const ERROR = 'error'; const WARNING = 'warning'; const NOTICE = 'notice'; const INFO = 'info'; const DEBUG = 'debug'; } PK���\ �X1``=libraries/vendor/psr/log/Psr/Log/InvalidArgumentException.phpnu�[���<?php namespace Psr\Log; class InvalidArgumentException extends \InvalidArgumentException { } PK���\��,��3libraries/vendor/psr/log/Psr/Log/AbstractLogger.phpnu�[���<?php namespace Psr\Log; /** * This is a simple Logger implementation that other Loggers can inherit from. * * It simply delegates all log-level-specific methods to the `log` method to * reduce boilerplate code that a simple Logger that does the same thing with * messages regardless of the error level has to implement. */ abstract class AbstractLogger implements LoggerInterface { /** * System is unusable. * * @param string $message * @param array $context * @return null */ public function emergency($message, array $context = array()) { $this->log(LogLevel::EMERGENCY, $message, $context); } /** * Action must be taken immediately. * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * * @param string $message * @param array $context * @return null */ public function alert($message, array $context = array()) { $this->log(LogLevel::ALERT, $message, $context); } /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * * @param string $message * @param array $context * @return null */ public function critical($message, array $context = array()) { $this->log(LogLevel::CRITICAL, $message, $context); } /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * * @param string $message * @param array $context * @return null */ public function error($message, array $context = array()) { $this->log(LogLevel::ERROR, $message, $context); } /** * Exceptional occurrences that are not errors. * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * * @param string $message * @param array $context * @return null */ public function warning($message, array $context = array()) { $this->log(LogLevel::WARNING, $message, $context); } /** * Normal but significant events. * * @param string $message * @param array $context * @return null */ public function notice($message, array $context = array()) { $this->log(LogLevel::NOTICE, $message, $context); } /** * Interesting events. * * Example: User logs in, SQL logs. * * @param string $message * @param array $context * @return null */ public function info($message, array $context = array()) { $this->log(LogLevel::INFO, $message, $context); } /** * Detailed debug information. * * @param string $message * @param array $context * @return null */ public function debug($message, array $context = array()) { $this->log(LogLevel::DEBUG, $message, $context); } } PK���\�>���/libraries/vendor/psr/log/Psr/Log/NullLogger.phpnu�[���<?php namespace Psr\Log; /** * This Logger can be used to avoid conditional log calls * * Logging should always be optional, and if no logger is provided to your * library creating a NullLogger instance to have something to throw logs at * is a good way to avoid littering your code with `if ($this->logger) { }` * blocks. */ class NullLogger extends AbstractLogger { /** * Logs with an arbitrary level. * * @param mixed $level * @param string $message * @param array $context * @return null */ public function log($level, $message, array $context = array()) { // noop } } PK���\b���__5libraries/vendor/psr/log/Psr/Log/LoggerAwareTrait.phpnu�[���<?php namespace Psr\Log; /** * Basic Implementation of LoggerAwareInterface. */ trait LoggerAwareTrait { /** @var LoggerInterface */ protected $logger; /** * Sets a logger. * * @param LoggerInterface $logger */ public function setLogger(LoggerInterface $logger) { $this->logger = $logger; } } PK���\|4�`r�r�&libraries/vendor/leafo/lessphp/LICENSEnu�[���For ease of distribution, lessphp 0.2.0 is under a dual license. You are free to pick which one suits your needs. MIT LICENSE Copyright (c) 2010 Leaf Corcoran, http://leafo.net/lessphp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. GPL VERSION 3 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. PK���\G<�@�S�S,libraries/vendor/leafo/lessphp/lessc.inc.phpnu�[���<?php /** * lessphp v0.3.9 * http://leafo.net/lessphp * * LESS css compiler, adapted from http://lesscss.org * * Copyright 2012, Leaf Corcoran <leafot@gmail.com> * Licensed under MIT or GPLv3, see LICENSE */ /** * The less compiler and parser. * * Converting LESS to CSS is a three stage process. The incoming file is parsed * by `lessc_parser` into a syntax tree, then it is compiled into another tree * representing the CSS structure by `lessc`. The CSS tree is fed into a * formatter, like `lessc_formatter` which then outputs CSS as a string. * * During the first compile, all values are *reduced*, which means that their * types are brought to the lowest form before being dump as strings. This * handles math equations, variable dereferences, and the like. * * The `parse` function of `lessc` is the entry point. * * In summary: * * The `lessc` class creates an intstance of the parser, feeds it LESS code, * then transforms the resulting tree to a CSS tree. This class also holds the * evaluation context, such as all available mixins and variables at any given * time. * * The `lessc_parser` class is only concerned with parsing its input. * * The `lessc_formatter` takes a CSS tree, and dumps it to a formatted string, * handling things like indentation. */ class lessc { static public $VERSION = "v0.3.9"; static protected $TRUE = array("keyword", "true"); static protected $FALSE = array("keyword", "false"); protected $libFunctions = array(); protected $registeredVars = array(); protected $preserveComments = false; public $vPrefix = '@'; // prefix of abstract properties public $mPrefix = '$'; // prefix of abstract blocks public $parentSelector = '&'; public $importDisabled = false; public $importDir = ''; protected $numberPrecision = null; // set to the parser that generated the current line when compiling // so we know how to create error messages protected $sourceParser = null; protected $sourceLoc = null; static public $defaultValue = array("keyword", ""); static protected $nextImportId = 0; // uniquely identify imports // attempts to find the path of an import url, returns null for css files protected function findImport($url) { foreach ((array)$this->importDir as $dir) { $full = $dir.(substr($dir, -1) != '/' ? '/' : '').$url; if ($this->fileExists($file = $full.'.less') || $this->fileExists($file = $full)) { return $file; } } return null; } protected function fileExists($name) { return is_file($name); } static public function compressList($items, $delim) { if (!isset($items[1]) && isset($items[0])) return $items[0]; else return array('list', $delim, $items); } static public function preg_quote($what) { return preg_quote($what, '/'); } protected function tryImport($importPath, $parentBlock, $out) { if ($importPath[0] == "function" && $importPath[1] == "url") { $importPath = $this->flattenList($importPath[2]); } $str = $this->coerceString($importPath); if ($str === null) return false; $url = $this->compileValue($this->lib_e($str)); // don't import if it ends in css if (substr_compare($url, '.css', -4, 4) === 0) return false; $realPath = $this->findImport($url); if ($realPath === null) return false; if ($this->importDisabled) { return array(false, "/* import disabled */"); } $this->addParsedFile($realPath); $parser = $this->makeParser($realPath); $root = $parser->parse(file_get_contents($realPath)); // set the parents of all the block props foreach ($root->props as $prop) { if ($prop[0] == "block") { $prop[1]->parent = $parentBlock; } } // copy mixins into scope, set their parents // bring blocks from import into current block // TODO: need to mark the source parser these came from this file foreach ($root->children as $childName => $child) { if (isset($parentBlock->children[$childName])) { $parentBlock->children[$childName] = array_merge( $parentBlock->children[$childName], $child); } else { $parentBlock->children[$childName] = $child; } } $pi = pathinfo($realPath); $dir = $pi["dirname"]; list($top, $bottom) = $this->sortProps($root->props, true); $this->compileImportedProps($top, $parentBlock, $out, $parser, $dir); return array(true, $bottom, $parser, $dir); } protected function compileImportedProps($props, $block, $out, $sourceParser, $importDir) { $oldSourceParser = $this->sourceParser; $oldImport = $this->importDir; // TODO: this is because the importDir api is stupid $this->importDir = (array)$this->importDir; array_unshift($this->importDir, $importDir); foreach ($props as $prop) { $this->compileProp($prop, $block, $out); } $this->importDir = $oldImport; $this->sourceParser = $oldSourceParser; } /** * Recursively compiles a block. * * A block is analogous to a CSS block in most cases. A single LESS document * is encapsulated in a block when parsed, but it does not have parent tags * so all of it's children appear on the root level when compiled. * * Blocks are made up of props and children. * * Props are property instructions, array tuples which describe an action * to be taken, eg. write a property, set a variable, mixin a block. * * The children of a block are just all the blocks that are defined within. * This is used to look up mixins when performing a mixin. * * Compiling the block involves pushing a fresh environment on the stack, * and iterating through the props, compiling each one. * * See lessc::compileProp() * */ protected function compileBlock($block) { switch ($block->type) { case "root": $this->compileRoot($block); break; case null: $this->compileCSSBlock($block); break; case "media": $this->compileMedia($block); break; case "directive": $name = "@" . $block->name; if (!empty($block->value)) { $name .= " " . $this->compileValue($this->reduce($block->value)); } $this->compileNestedBlock($block, array($name)); break; default: $this->throwError("unknown block type: $block->type\n"); } } protected function compileCSSBlock($block) { $env = $this->pushEnv(); $selectors = $this->compileSelectors($block->tags); $env->selectors = $this->multiplySelectors($selectors); $out = $this->makeOutputBlock(null, $env->selectors); $this->scope->children[] = $out; $this->compileProps($block, $out); $block->scope = $env; // mixins carry scope with them! $this->popEnv(); } protected function compileMedia($media) { $env = $this->pushEnv($media); $parentScope = $this->mediaParent($this->scope); $query = $this->compileMediaQuery($this->multiplyMedia($env)); $this->scope = $this->makeOutputBlock($media->type, array($query)); $parentScope->children[] = $this->scope; $this->compileProps($media, $this->scope); if (count($this->scope->lines) > 0) { $orphanSelelectors = $this->findClosestSelectors(); if (!is_null($orphanSelelectors)) { $orphan = $this->makeOutputBlock(null, $orphanSelelectors); $orphan->lines = $this->scope->lines; array_unshift($this->scope->children, $orphan); $this->scope->lines = array(); } } $this->scope = $this->scope->parent; $this->popEnv(); } protected function mediaParent($scope) { while (!empty($scope->parent)) { if (!empty($scope->type) && $scope->type != "media") { break; } $scope = $scope->parent; } return $scope; } protected function compileNestedBlock($block, $selectors) { $this->pushEnv($block); $this->scope = $this->makeOutputBlock($block->type, $selectors); $this->scope->parent->children[] = $this->scope; $this->compileProps($block, $this->scope); $this->scope = $this->scope->parent; $this->popEnv(); } protected function compileRoot($root) { $this->pushEnv(); $this->scope = $this->makeOutputBlock($root->type); $this->compileProps($root, $this->scope); $this->popEnv(); } protected function compileProps($block, $out) { foreach ($this->sortProps($block->props) as $prop) { $this->compileProp($prop, $block, $out); } } protected function sortProps($props, $split = false) { $vars = array(); $imports = array(); $other = array(); foreach ($props as $prop) { switch ($prop[0]) { case "assign": if (isset($prop[1][0]) && $prop[1][0] == $this->vPrefix) { $vars[] = $prop; } else { $other[] = $prop; } break; case "import": $id = self::$nextImportId++; $prop[] = $id; $imports[] = $prop; $other[] = array("import_mixin", $id); break; default: $other[] = $prop; } } if ($split) { return array(array_merge($vars, $imports), $other); } else { return array_merge($vars, $imports, $other); } } protected function compileMediaQuery($queries) { $compiledQueries = array(); foreach ($queries as $query) { $parts = array(); foreach ($query as $q) { switch ($q[0]) { case "mediaType": $parts[] = implode(" ", array_slice($q, 1)); break; case "mediaExp": if (isset($q[2])) { $parts[] = "($q[1]: " . $this->compileValue($this->reduce($q[2])) . ")"; } else { $parts[] = "($q[1])"; } break; case "variable": $parts[] = $this->compileValue($this->reduce($q)); break; } } if (count($parts) > 0) { $compiledQueries[] = implode(" and ", $parts); } } $out = "@media"; if (!empty($parts)) { $out .= " " . implode($this->formatter->selectorSeparator, $compiledQueries); } return $out; } protected function multiplyMedia($env, $childQueries = null) { if (is_null($env) || !empty($env->block->type) && $env->block->type != "media") { return $childQueries; } // plain old block, skip if (empty($env->block->type)) { return $this->multiplyMedia($env->parent, $childQueries); } $out = array(); $queries = $env->block->queries; if (is_null($childQueries)) { $out = $queries; } else { foreach ($queries as $parent) { foreach ($childQueries as $child) { $out[] = array_merge($parent, $child); } } } return $this->multiplyMedia($env->parent, $out); } protected function expandParentSelectors(&$tag, $replace) { $parts = explode("$&$", $tag); $count = 0; foreach ($parts as &$part) { $part = str_replace($this->parentSelector, $replace, $part, $c); $count += $c; } $tag = implode($this->parentSelector, $parts); return $count; } protected function findClosestSelectors() { $env = $this->env; $selectors = null; while ($env !== null) { if (isset($env->selectors)) { $selectors = $env->selectors; break; } $env = $env->parent; } return $selectors; } // multiply $selectors against the nearest selectors in env protected function multiplySelectors($selectors) { // find parent selectors $parentSelectors = $this->findClosestSelectors(); if (is_null($parentSelectors)) { // kill parent reference in top level selector foreach ($selectors as &$s) { $this->expandParentSelectors($s, ""); } return $selectors; } $out = array(); foreach ($parentSelectors as $parent) { foreach ($selectors as $child) { $count = $this->expandParentSelectors($child, $parent); // don't prepend the parent tag if & was used if ($count > 0) { $out[] = trim($child); } else { $out[] = trim($parent . ' ' . $child); } } } return $out; } // reduces selector expressions protected function compileSelectors($selectors) { $out = array(); foreach ($selectors as $s) { if (is_array($s)) { list(, $value) = $s; $out[] = trim($this->compileValue($this->reduce($value))); } else { $out[] = $s; } } return $out; } protected function eq($left, $right) { return $left == $right; } protected function patternMatch($block, $callingArgs) { // match the guards if it has them // any one of the groups must have all its guards pass for a match if (!empty($block->guards)) { $groupPassed = false; foreach ($block->guards as $guardGroup) { foreach ($guardGroup as $guard) { $this->pushEnv(); $this->zipSetArgs($block->args, $callingArgs); $negate = false; if ($guard[0] == "negate") { $guard = $guard[1]; $negate = true; } $passed = $this->reduce($guard) == self::$TRUE; if ($negate) $passed = !$passed; $this->popEnv(); if ($passed) { $groupPassed = true; } else { $groupPassed = false; break; } } if ($groupPassed) break; } if (!$groupPassed) { return false; } } $numCalling = count($callingArgs); if (empty($block->args)) { return $block->isVararg || $numCalling == 0; } $i = -1; // no args // try to match by arity or by argument literal foreach ($block->args as $i => $arg) { switch ($arg[0]) { case "lit": if (empty($callingArgs[$i]) || !$this->eq($arg[1], $callingArgs[$i])) { return false; } break; case "arg": // no arg and no default value if (!isset($callingArgs[$i]) && !isset($arg[2])) { return false; } break; case "rest": $i--; // rest can be empty break 2; } } if ($block->isVararg) { return true; // not having enough is handled above } else { $numMatched = $i + 1; // greater than becuase default values always match return $numMatched >= $numCalling; } } protected function patternMatchAll($blocks, $callingArgs) { $matches = null; foreach ($blocks as $block) { if ($this->patternMatch($block, $callingArgs)) { $matches[] = $block; } } return $matches; } // attempt to find blocks matched by path and args protected function findBlocks($searchIn, $path, $args, $seen=array()) { if ($searchIn == null) return null; if (isset($seen[$searchIn->id])) return null; $seen[$searchIn->id] = true; $name = $path[0]; if (isset($searchIn->children[$name])) { $blocks = $searchIn->children[$name]; if (count($path) == 1) { $matches = $this->patternMatchAll($blocks, $args); if (!empty($matches)) { // This will return all blocks that match in the closest // scope that has any matching block, like lessjs return $matches; } } else { $matches = array(); foreach ($blocks as $subBlock) { $subMatches = $this->findBlocks($subBlock, array_slice($path, 1), $args, $seen); if (!is_null($subMatches)) { foreach ($subMatches as $sm) { $matches[] = $sm; } } } return count($matches) > 0 ? $matches : null; } } if ($searchIn->parent === $searchIn) return null; return $this->findBlocks($searchIn->parent, $path, $args, $seen); } // sets all argument names in $args to either the default value // or the one passed in through $values protected function zipSetArgs($args, $values) { $i = 0; $assignedValues = array(); foreach ($args as $a) { if ($a[0] == "arg") { if ($i < count($values) && !is_null($values[$i])) { $value = $values[$i]; } elseif (isset($a[2])) { $value = $a[2]; } else $value = null; $value = $this->reduce($value); $this->set($a[1], $value); $assignedValues[] = $value; } $i++; } // check for a rest $last = end($args); if ($last[0] == "rest") { $rest = array_slice($values, count($args) - 1); $this->set($last[1], $this->reduce(array("list", " ", $rest))); } $this->env->arguments = $assignedValues; } // compile a prop and update $lines or $blocks appropriately protected function compileProp($prop, $block, $out) { // set error position context $this->sourceLoc = isset($prop[-1]) ? $prop[-1] : -1; switch ($prop[0]) { case 'assign': list(, $name, $value) = $prop; if ($name[0] == $this->vPrefix) { $this->set($name, $value); } else { $out->lines[] = $this->formatter->property($name, $this->compileValue($this->reduce($value))); } break; case 'block': list(, $child) = $prop; $this->compileBlock($child); break; case 'mixin': list(, $path, $args, $suffix) = $prop; $args = array_map(array($this, "reduce"), (array)$args); $mixins = $this->findBlocks($block, $path, $args); if ($mixins === null) { // fwrite(STDERR,"failed to find block: ".implode(" > ", $path)."\n"); break; // throw error here?? } foreach ($mixins as $mixin) { $haveScope = false; if (isset($mixin->parent->scope)) { $haveScope = true; $mixinParentEnv = $this->pushEnv(); $mixinParentEnv->storeParent = $mixin->parent->scope; } $haveArgs = false; if (isset($mixin->args)) { $haveArgs = true; $this->pushEnv(); $this->zipSetArgs($mixin->args, $args); } $oldParent = $mixin->parent; if ($mixin != $block) $mixin->parent = $block; foreach ($this->sortProps($mixin->props) as $subProp) { if ($suffix !== null && $subProp[0] == "assign" && is_string($subProp[1]) && $subProp[1]{0} != $this->vPrefix) { $subProp[2] = array( 'list', ' ', array($subProp[2], array('keyword', $suffix)) ); } $this->compileProp($subProp, $mixin, $out); } $mixin->parent = $oldParent; if ($haveArgs) $this->popEnv(); if ($haveScope) $this->popEnv(); } break; case 'raw': $out->lines[] = $prop[1]; break; case "directive": list(, $name, $value) = $prop; $out->lines[] = "@$name " . $this->compileValue($this->reduce($value)).';'; break; case "comment": $out->lines[] = $prop[1]; break; case "import"; list(, $importPath, $importId) = $prop; $importPath = $this->reduce($importPath); if (!isset($this->env->imports)) { $this->env->imports = array(); } $result = $this->tryImport($importPath, $block, $out); $this->env->imports[$importId] = $result === false ? array(false, "@import " . $this->compileValue($importPath).";") : $result; break; case "import_mixin": list(,$importId) = $prop; $import = $this->env->imports[$importId]; if ($import[0] === false) { $out->lines[] = $import[1]; } else { list(, $bottom, $parser, $importDir) = $import; $this->compileImportedProps($bottom, $block, $out, $parser, $importDir); } break; default: $this->throwError("unknown op: {$prop[0]}\n"); } } /** * Compiles a primitive value into a CSS property value. * * Values in lessphp are typed by being wrapped in arrays, their format is * typically: * * array(type, contents [, additional_contents]*) * * The input is expected to be reduced. This function will not work on * things like expressions and variables. */ protected function compileValue($value) { switch ($value[0]) { case 'list': // [1] - delimiter // [2] - array of values return implode($value[1], array_map(array($this, 'compileValue'), $value[2])); case 'raw_color': if (!empty($this->formatter->compressColors)) { return $this->compileValue($this->coerceColor($value)); } return $value[1]; case 'keyword': // [1] - the keyword return $value[1]; case 'number': list(, $num, $unit) = $value; // [1] - the number // [2] - the unit if ($this->numberPrecision !== null) { $num = round($num, $this->numberPrecision); } return $num . $unit; case 'string': // [1] - contents of string (includes quotes) list(, $delim, $content) = $value; foreach ($content as &$part) { if (is_array($part)) { $part = $this->compileValue($part); } } return $delim . implode($content) . $delim; case 'color': // [1] - red component (either number or a %) // [2] - green component // [3] - blue component // [4] - optional alpha component list(, $r, $g, $b) = $value; $r = round($r); $g = round($g); $b = round($b); if (count($value) == 5 && $value[4] != 1) { // rgba return 'rgba('.$r.','.$g.','.$b.','.$value[4].')'; } $h = sprintf("#%02x%02x%02x", $r, $g, $b); if (!empty($this->formatter->compressColors)) { // Converting hex color to short notation (e.g. #003399 to #039) if ($h[1] === $h[2] && $h[3] === $h[4] && $h[5] === $h[6]) { $h = '#' . $h[1] . $h[3] . $h[5]; } } return $h; case 'function': list(, $name, $args) = $value; return $name.'('.$this->compileValue($args).')'; default: // assumed to be unit $this->throwError("unknown value type: $value[0]"); } } protected function lib_isnumber($value) { return $this->toBool($value[0] == "number"); } protected function lib_isstring($value) { return $this->toBool($value[0] == "string"); } protected function lib_iscolor($value) { return $this->toBool($this->coerceColor($value)); } protected function lib_iskeyword($value) { return $this->toBool($value[0] == "keyword"); } protected function lib_ispixel($value) { return $this->toBool($value[0] == "number" && $value[2] == "px"); } protected function lib_ispercentage($value) { return $this->toBool($value[0] == "number" && $value[2] == "%"); } protected function lib_isem($value) { return $this->toBool($value[0] == "number" && $value[2] == "em"); } protected function lib_isrem($value) { return $this->toBool($value[0] == "number" && $value[2] == "rem"); } protected function lib_rgbahex($color) { $color = $this->coerceColor($color); if (is_null($color)) $this->throwError("color expected for rgbahex"); return sprintf("#%02x%02x%02x%02x", isset($color[4]) ? $color[4]*255 : 255, $color[1],$color[2], $color[3]); } protected function lib_argb($color){ return $this->lib_rgbahex($color); } // utility func to unquote a string protected function lib_e($arg) { switch ($arg[0]) { case "list": $items = $arg[2]; if (isset($items[0])) { return $this->lib_e($items[0]); } return self::$defaultValue; case "string": $arg[1] = ""; return $arg; case "keyword": return $arg; default: return array("keyword", $this->compileValue($arg)); } } protected function lib__sprintf($args) { if ($args[0] != "list") return $args; $values = $args[2]; $string = array_shift($values); $template = $this->compileValue($this->lib_e($string)); $i = 0; if (preg_match_all('/%[dsa]/', $template, $m)) { foreach ($m[0] as $match) { $val = isset($values[$i]) ? $this->reduce($values[$i]) : array('keyword', ''); // lessjs compat, renders fully expanded color, not raw color if ($color = $this->coerceColor($val)) { $val = $color; } $i++; $rep = $this->compileValue($this->lib_e($val)); $template = preg_replace('/'.self::preg_quote($match).'/', $rep, $template, 1); } } $d = $string[0] == "string" ? $string[1] : '"'; return array("string", $d, array($template)); } protected function lib_floor($arg) { $value = $this->assertNumber($arg); return array("number", floor($value), $arg[2]); } protected function lib_ceil($arg) { $value = $this->assertNumber($arg); return array("number", ceil($value), $arg[2]); } protected function lib_round($arg) { $value = $this->assertNumber($arg); return array("number", round($value), $arg[2]); } protected function lib_unit($arg) { if ($arg[0] == "list") { list($number, $newUnit) = $arg[2]; return array("number", $this->assertNumber($number), $this->compileValue($this->lib_e($newUnit))); } else { return array("number", $this->assertNumber($arg), ""); } } /** * Helper function to get arguments for color manipulation functions. * takes a list that contains a color like thing and a percentage */ protected function colorArgs($args) { if ($args[0] != 'list' || count($args[2]) < 2) { return array(array('color', 0, 0, 0), 0); } list($color, $delta) = $args[2]; $color = $this->assertColor($color); $delta = floatval($delta[1]); return array($color, $delta); } protected function lib_darken($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[3] = $this->clamp($hsl[3] - $delta, 100); return $this->toRGB($hsl); } protected function lib_lighten($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[3] = $this->clamp($hsl[3] + $delta, 100); return $this->toRGB($hsl); } protected function lib_saturate($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[2] = $this->clamp($hsl[2] + $delta, 100); return $this->toRGB($hsl); } protected function lib_desaturate($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[2] = $this->clamp($hsl[2] - $delta, 100); return $this->toRGB($hsl); } protected function lib_spin($args) { list($color, $delta) = $this->colorArgs($args); $hsl = $this->toHSL($color); $hsl[1] = $hsl[1] + $delta % 360; if ($hsl[1] < 0) $hsl[1] += 360; return $this->toRGB($hsl); } protected function lib_fadeout($args) { list($color, $delta) = $this->colorArgs($args); $color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) - $delta/100); return $color; } protected function lib_fadein($args) { list($color, $delta) = $this->colorArgs($args); $color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) + $delta/100); return $color; } protected function lib_hue($color) { $hsl = $this->toHSL($this->assertColor($color)); return round($hsl[1]); } protected function lib_saturation($color) { $hsl = $this->toHSL($this->assertColor($color)); return round($hsl[2]); } protected function lib_lightness($color) { $hsl = $this->toHSL($this->assertColor($color)); return round($hsl[3]); } // get the alpha of a color // defaults to 1 for non-colors or colors without an alpha protected function lib_alpha($value) { if (!is_null($color = $this->coerceColor($value))) { return isset($color[4]) ? $color[4] : 1; } } // set the alpha of the color protected function lib_fade($args) { list($color, $alpha) = $this->colorArgs($args); $color[4] = $this->clamp($alpha / 100.0); return $color; } protected function lib_percentage($arg) { $num = $this->assertNumber($arg); return array("number", $num*100, "%"); } // mixes two colors by weight // mix(@color1, @color2, @weight); // http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method protected function lib_mix($args) { if ($args[0] != "list" || count($args[2]) < 3) $this->throwError("mix expects (color1, color2, weight)"); list($first, $second, $weight) = $args[2]; $first = $this->assertColor($first); $second = $this->assertColor($second); $first_a = $this->lib_alpha($first); $second_a = $this->lib_alpha($second); $weight = $weight[1] / 100.0; $w = $weight * 2 - 1; $a = $first_a - $second_a; $w1 = (($w * $a == -1 ? $w : ($w + $a)/(1 + $w * $a)) + 1) / 2.0; $w2 = 1.0 - $w1; $new = array('color', $w1 * $first[1] + $w2 * $second[1], $w1 * $first[2] + $w2 * $second[2], $w1 * $first[3] + $w2 * $second[3], ); if ($first_a != 1.0 || $second_a != 1.0) { $new[] = $first_a * $weight + $second_a * ($weight - 1); } return $this->fixColor($new); } protected function lib_contrast($args) { if ($args[0] != 'list' || count($args[2]) < 3) { return array(array('color', 0, 0, 0), 0); } list($inputColor, $darkColor, $lightColor) = $args[2]; $inputColor = $this->assertColor($inputColor); $darkColor = $this->assertColor($darkColor); $lightColor = $this->assertColor($lightColor); $hsl = $this->toHSL($inputColor); if ($hsl[3] > 50) { return $darkColor; } return $lightColor; } protected function assertColor($value, $error = "expected color value") { $color = $this->coerceColor($value); if (is_null($color)) $this->throwError($error); return $color; } protected function assertNumber($value, $error = "expecting number") { if ($value[0] == "number") return $value[1]; $this->throwError($error); } protected function toHSL($color) { if ($color[0] == 'hsl') return $color; $r = $color[1] / 255; $g = $color[2] / 255; $b = $color[3] / 255; $min = min($r, $g, $b); $max = max($r, $g, $b); $L = ($min + $max) / 2; if ($min == $max) { $S = $H = 0; } else { if ($L < 0.5) $S = ($max - $min)/($max + $min); else $S = ($max - $min)/(2.0 - $max - $min); if ($r == $max) $H = ($g - $b)/($max - $min); elseif ($g == $max) $H = 2.0 + ($b - $r)/($max - $min); elseif ($b == $max) $H = 4.0 + ($r - $g)/($max - $min); } $out = array('hsl', ($H < 0 ? $H + 6 : $H)*60, $S*100, $L*100, ); if (count($color) > 4) $out[] = $color[4]; // copy alpha return $out; } protected function toRGB_helper($comp, $temp1, $temp2) { if ($comp < 0) $comp += 1.0; elseif ($comp > 1) $comp -= 1.0; if (6 * $comp < 1) return $temp1 + ($temp2 - $temp1) * 6 * $comp; if (2 * $comp < 1) return $temp2; if (3 * $comp < 2) return $temp1 + ($temp2 - $temp1)*((2/3) - $comp) * 6; return $temp1; } /** * Converts a hsl array into a color value in rgb. * Expects H to be in range of 0 to 360, S and L in 0 to 100 */ protected function toRGB($color) { if ($color[0] == 'color') return $color; $H = $color[1] / 360; $S = $color[2] / 100; $L = $color[3] / 100; if ($S == 0) { $r = $g = $b = $L; } else { $temp2 = $L < 0.5 ? $L*(1.0 + $S) : $L + $S - $L * $S; $temp1 = 2.0 * $L - $temp2; $r = $this->toRGB_helper($H + 1/3, $temp1, $temp2); $g = $this->toRGB_helper($H, $temp1, $temp2); $b = $this->toRGB_helper($H - 1/3, $temp1, $temp2); } // $out = array('color', round($r*255), round($g*255), round($b*255)); $out = array('color', $r*255, $g*255, $b*255); if (count($color) > 4) $out[] = $color[4]; // copy alpha return $out; } protected function clamp($v, $max = 1, $min = 0) { return min($max, max($min, $v)); } /** * Convert the rgb, rgba, hsl color literals of function type * as returned by the parser into values of color type. */ protected function funcToColor($func) { $fname = $func[1]; if ($func[2][0] != 'list') return false; // need a list of arguments $rawComponents = $func[2][2]; if ($fname == 'hsl' || $fname == 'hsla') { $hsl = array('hsl'); $i = 0; foreach ($rawComponents as $c) { $val = $this->reduce($c); $val = isset($val[1]) ? floatval($val[1]) : 0; if ($i == 0) $clamp = 360; elseif ($i < 3) $clamp = 100; else $clamp = 1; $hsl[] = $this->clamp($val, $clamp); $i++; } while (count($hsl) < 4) $hsl[] = 0; return $this->toRGB($hsl); } elseif ($fname == 'rgb' || $fname == 'rgba') { $components = array(); $i = 1; foreach ($rawComponents as $c) { $c = $this->reduce($c); if ($i < 4) { if ($c[0] == "number" && $c[2] == "%") { $components[] = 255 * ($c[1] / 100); } else { $components[] = floatval($c[1]); } } elseif ($i == 4) { if ($c[0] == "number" && $c[2] == "%") { $components[] = 1.0 * ($c[1] / 100); } else { $components[] = floatval($c[1]); } } else break; $i++; } while (count($components) < 3) $components[] = 0; array_unshift($components, 'color'); return $this->fixColor($components); } return false; } protected function reduce($value, $forExpression = false) { switch ($value[0]) { case "interpolate": $reduced = $this->reduce($value[1]); $var = $this->compileValue($reduced); $res = $this->reduce(array("variable", $this->vPrefix . $var)); if (empty($value[2])) $res = $this->lib_e($res); return $res; case "variable": $key = $value[1]; if (is_array($key)) { $key = $this->reduce($key); $key = $this->vPrefix . $this->compileValue($this->lib_e($key)); } $seen =& $this->env->seenNames; if (!empty($seen[$key])) { $this->throwError("infinite loop detected: $key"); } $seen[$key] = true; $out = $this->reduce($this->get($key, self::$defaultValue)); $seen[$key] = false; return $out; case "list": foreach ($value[2] as &$item) { $item = $this->reduce($item, $forExpression); } return $value; case "expression": return $this->evaluate($value); case "string": foreach ($value[2] as &$part) { if (is_array($part)) { $strip = $part[0] == "variable"; $part = $this->reduce($part); if ($strip) $part = $this->lib_e($part); } } return $value; case "escape": list(,$inner) = $value; return $this->lib_e($this->reduce($inner)); case "function": $color = $this->funcToColor($value); if ($color) return $color; list(, $name, $args) = $value; if ($name == "%") $name = "_sprintf"; $f = isset($this->libFunctions[$name]) ? $this->libFunctions[$name] : array($this, 'lib_'.$name); if (is_callable($f)) { if ($args[0] == 'list') $args = self::compressList($args[2], $args[1]); $ret = call_user_func($f, $this->reduce($args, true), $this); if (is_null($ret)) { return array("string", "", array( $name, "(", $args, ")" )); } // convert to a typed value if the result is a php primitive if (is_numeric($ret)) $ret = array('number', $ret, ""); elseif (!is_array($ret)) $ret = array('keyword', $ret); return $ret; } // plain function, reduce args $value[2] = $this->reduce($value[2]); return $value; case "unary": list(, $op, $exp) = $value; $exp = $this->reduce($exp); if ($exp[0] == "number") { switch ($op) { case "+": return $exp; case "-": $exp[1] *= -1; return $exp; } } return array("string", "", array($op, $exp)); } if ($forExpression) { switch ($value[0]) { case "keyword": if ($color = $this->coerceColor($value)) { return $color; } break; case "raw_color": return $this->coerceColor($value); } } return $value; } // coerce a value for use in color operation protected function coerceColor($value) { switch($value[0]) { case 'color': return $value; case 'raw_color': $c = array("color", 0, 0, 0); $colorStr = substr($value[1], 1); $num = hexdec($colorStr); $width = strlen($colorStr) == 3 ? 16 : 256; for ($i = 3; $i > 0; $i--) { // 3 2 1 $t = $num % $width; $num /= $width; $c[$i] = $t * (256/$width) + $t * floor(16/$width); } return $c; case 'keyword': $name = $value[1]; if (isset(self::$cssColors[$name])) { $rgba = explode(',', self::$cssColors[$name]); if(isset($rgba[3])) return array('color', $rgba[0], $rgba[1], $rgba[2], $rgba[3]); return array('color', $rgba[0], $rgba[1], $rgba[2]); } return null; } } // make something string like into a string protected function coerceString($value) { switch ($value[0]) { case "string": return $value; case "keyword": return array("string", "", array($value[1])); } return null; } // turn list of length 1 into value type protected function flattenList($value) { if ($value[0] == "list" && count($value[2]) == 1) { return $this->flattenList($value[2][0]); } return $value; } protected function toBool($a) { if ($a) return self::$TRUE; else return self::$FALSE; } // evaluate an expression protected function evaluate($exp) { list(, $op, $left, $right, $whiteBefore, $whiteAfter) = $exp; $left = $this->reduce($left, true); $right = $this->reduce($right, true); if ($leftColor = $this->coerceColor($left)) { $left = $leftColor; } if ($rightColor = $this->coerceColor($right)) { $right = $rightColor; } $ltype = $left[0]; $rtype = $right[0]; // operators that work on all types if ($op == "and") { return $this->toBool($left == self::$TRUE && $right == self::$TRUE); } if ($op == "=") { return $this->toBool($this->eq($left, $right) ); } if ($op == "+" && !is_null($str = $this->stringConcatenate($left, $right))) { return $str; } // type based operators $fname = "op_${ltype}_${rtype}"; if (is_callable(array($this, $fname))) { $out = $this->$fname($op, $left, $right); if (!is_null($out)) return $out; } // make the expression look it did before being parsed $paddedOp = $op; if ($whiteBefore) $paddedOp = " " . $paddedOp; if ($whiteAfter) $paddedOp .= " "; return array("string", "", array($left, $paddedOp, $right)); } protected function stringConcatenate($left, $right) { if ($strLeft = $this->coerceString($left)) { if ($right[0] == "string") { $right[1] = ""; } $strLeft[2][] = $right; return $strLeft; } if ($strRight = $this->coerceString($right)) { array_unshift($strRight[2], $left); return $strRight; } } // make sure a color's components don't go out of bounds protected function fixColor($c) { foreach (range(1, 3) as $i) { if ($c[$i] < 0) $c[$i] = 0; if ($c[$i] > 255) $c[$i] = 255; } return $c; } protected function op_number_color($op, $lft, $rgt) { if ($op == '+' || $op == '*') { return $this->op_color_number($op, $rgt, $lft); } } protected function op_color_number($op, $lft, $rgt) { if ($rgt[0] == '%') $rgt[1] /= 100; return $this->op_color_color($op, $lft, array_fill(1, count($lft) - 1, $rgt[1])); } protected function op_color_color($op, $left, $right) { $out = array('color'); $max = count($left) > count($right) ? count($left) : count($right); foreach (range(1, $max - 1) as $i) { $lval = isset($left[$i]) ? $left[$i] : 0; $rval = isset($right[$i]) ? $right[$i] : 0; switch ($op) { case '+': $out[] = $lval + $rval; break; case '-': $out[] = $lval - $rval; break; case '*': $out[] = $lval * $rval; break; case '%': $out[] = $lval % $rval; break; case '/': if ($rval == 0) $this->throwError("evaluate error: can't divide by zero"); $out[] = $lval / $rval; break; default: $this->throwError('evaluate error: color op number failed on op '.$op); } } return $this->fixColor($out); } function lib_red($color){ $color = $this->coerceColor($color); if (is_null($color)) { $this->throwError('color expected for red()'); } return $color[1]; } function lib_green($color){ $color = $this->coerceColor($color); if (is_null($color)) { $this->throwError('color expected for green()'); } return $color[2]; } function lib_blue($color){ $color = $this->coerceColor($color); if (is_null($color)) { $this->throwError('color expected for blue()'); } return $color[3]; } // operator on two numbers protected function op_number_number($op, $left, $right) { $unit = empty($left[2]) ? $right[2] : $left[2]; $value = 0; switch ($op) { case '+': $value = $left[1] + $right[1]; break; case '*': $value = $left[1] * $right[1]; break; case '-': $value = $left[1] - $right[1]; break; case '%': $value = $left[1] % $right[1]; break; case '/': if ($right[1] == 0) $this->throwError('parse error: divide by zero'); $value = $left[1] / $right[1]; break; case '<': return $this->toBool($left[1] < $right[1]); case '>': return $this->toBool($left[1] > $right[1]); case '>=': return $this->toBool($left[1] >= $right[1]); case '=<': return $this->toBool($left[1] <= $right[1]); default: $this->throwError('parse error: unknown number operator: '.$op); } return array("number", $value, $unit); } /* environment functions */ protected function makeOutputBlock($type, $selectors = null) { $b = new stdclass; $b->lines = array(); $b->children = array(); $b->selectors = $selectors; $b->type = $type; $b->parent = $this->scope; return $b; } // the state of execution protected function pushEnv($block = null) { $e = new stdclass; $e->parent = $this->env; $e->store = array(); $e->block = $block; $this->env = $e; return $e; } // pop something off the stack protected function popEnv() { $old = $this->env; $this->env = $this->env->parent; return $old; } // set something in the current env protected function set($name, $value) { $this->env->store[$name] = $value; } // get the highest occurrence entry for a name protected function get($name, $default=null) { $current = $this->env; $isArguments = $name == $this->vPrefix . 'arguments'; while ($current) { if ($isArguments && isset($current->arguments)) { return array('list', ' ', $current->arguments); } if (isset($current->store[$name])) return $current->store[$name]; else { $current = isset($current->storeParent) ? $current->storeParent : $current->parent; } } return $default; } // inject array of unparsed strings into environment as variables protected function injectVariables($args) { $this->pushEnv(); $parser = new lessc_parser($this, __METHOD__); foreach ($args as $name => $strValue) { if ($name{0} != '@') $name = '@'.$name; $parser->count = 0; $parser->buffer = (string)$strValue; if (!$parser->propertyValue($value)) { throw new Exception("failed to parse passed in variable $name: $strValue"); } $this->set($name, $value); } } /** * Initialize any static state, can initialize parser for a file * $opts isn't used yet */ public function __construct($fname = null) { if ($fname !== null) { // used for deprecated parse method $this->_parseFile = $fname; } } public function compile($string, $name = null) { $locale = setlocale(LC_NUMERIC, 0); setlocale(LC_NUMERIC, "C"); $this->parser = $this->makeParser($name); $root = $this->parser->parse($string); $this->env = null; $this->scope = null; $this->formatter = $this->newFormatter(); if (!empty($this->registeredVars)) { $this->injectVariables($this->registeredVars); } $this->sourceParser = $this->parser; // used for error messages $this->compileBlock($root); ob_start(); $this->formatter->block($this->scope); $out = ob_get_clean(); setlocale(LC_NUMERIC, $locale); return $out; } public function compileFile($fname, $outFname = null) { if (!is_readable($fname)) { throw new Exception('load error: failed to find '.$fname); } $pi = pathinfo($fname); $oldImport = $this->importDir; $this->importDir = (array)$this->importDir; $this->importDir[] = $pi['dirname'].'/'; $this->allParsedFiles = array(); $this->addParsedFile($fname); $out = $this->compile(file_get_contents($fname), $fname); $this->importDir = $oldImport; if ($outFname !== null) { return file_put_contents($outFname, $out); } return $out; } // compile only if changed input has changed or output doesn't exist public function checkedCompile($in, $out) { if (!is_file($out) || filemtime($in) > filemtime($out)) { $this->compileFile($in, $out); return true; } return false; } /** * Execute lessphp on a .less file or a lessphp cache structure * * The lessphp cache structure contains information about a specific * less file having been parsed. It can be used as a hint for future * calls to determine whether or not a rebuild is required. * * The cache structure contains two important keys that may be used * externally: * * compiled: The final compiled CSS * updated: The time (in seconds) the CSS was last compiled * * The cache structure is a plain-ol' PHP associative array and can * be serialized and unserialized without a hitch. * * @param mixed $in Input * @param bool $force Force rebuild? * @return array lessphp cache structure */ public function cachedCompile($in, $force = false) { // assume no root $root = null; if (is_string($in)) { $root = $in; } elseif (is_array($in) and isset($in['root'])) { if ($force or ! isset($in['files'])) { // If we are forcing a recompile or if for some reason the // structure does not contain any file information we should // specify the root to trigger a rebuild. $root = $in['root']; } elseif (isset($in['files']) and is_array($in['files'])) { foreach ($in['files'] as $fname => $ftime ) { if (!file_exists($fname) or filemtime($fname) > $ftime) { // One of the files we knew about previously has changed // so we should look at our incoming root again. $root = $in['root']; break; } } } } else { // TODO: Throw an exception? We got neither a string nor something // that looks like a compatible lessphp cache structure. return null; } if ($root !== null) { // If we have a root value which means we should rebuild. $out = array(); $out['root'] = $root; $out['compiled'] = $this->compileFile($root); $out['files'] = $this->allParsedFiles(); $out['updated'] = time(); return $out; } else { // No changes, pass back the structure // we were given initially. return $in; } } // parse and compile buffer // This is deprecated public function parse($str = null, $initialVariables = null) { if (is_array($str)) { $initialVariables = $str; $str = null; } $oldVars = $this->registeredVars; if ($initialVariables !== null) { $this->setVariables($initialVariables); } if ($str == null) { if (empty($this->_parseFile)) { throw new exception("nothing to parse"); } $out = $this->compileFile($this->_parseFile); } else { $out = $this->compile($str); } $this->registeredVars = $oldVars; return $out; } protected function makeParser($name) { $parser = new lessc_parser($this, $name); $parser->writeComments = $this->preserveComments; return $parser; } public function setFormatter($name) { $this->formatterName = $name; } protected function newFormatter() { $className = "lessc_formatter_lessjs"; if (!empty($this->formatterName)) { if (!is_string($this->formatterName)) return $this->formatterName; $className = "lessc_formatter_$this->formatterName"; } return new $className; } public function setPreserveComments($preserve) { $this->preserveComments = $preserve; } public function registerFunction($name, $func) { $this->libFunctions[$name] = $func; } public function unregisterFunction($name) { unset($this->libFunctions[$name]); } public function setVariables($variables) { $this->registeredVars = array_merge($this->registeredVars, $variables); } public function unsetVariable($name) { unset($this->registeredVars[$name]); } public function setImportDir($dirs) { $this->importDir = (array)$dirs; } public function addImportDir($dir) { $this->importDir = (array)$this->importDir; $this->importDir[] = $dir; } public function allParsedFiles() { return $this->allParsedFiles; } protected function addParsedFile($file) { $this->allParsedFiles[realpath($file)] = filemtime($file); } /** * Uses the current value of $this->count to show line and line number */ protected function throwError($msg = null) { if ($this->sourceLoc >= 0) { $this->sourceParser->throwError($msg, $this->sourceLoc); } throw new exception($msg); } // compile file $in to file $out if $in is newer than $out // returns true when it compiles, false otherwise public static function ccompile($in, $out, $less = null) { if ($less === null) { $less = new self; } return $less->checkedCompile($in, $out); } public static function cexecute($in, $force = false, $less = null) { if ($less === null) { $less = new self; } return $less->cachedCompile($in, $force); } static protected $cssColors = array( 'aliceblue' => '240,248,255', 'antiquewhite' => '250,235,215', 'aqua' => '0,255,255', 'aquamarine' => '127,255,212', 'azure' => '240,255,255', 'beige' => '245,245,220', 'bisque' => '255,228,196', 'black' => '0,0,0', 'blanchedalmond' => '255,235,205', 'blue' => '0,0,255', 'blueviolet' => '138,43,226', 'brown' => '165,42,42', 'burlywood' => '222,184,135', 'cadetblue' => '95,158,160', 'chartreuse' => '127,255,0', 'chocolate' => '210,105,30', 'coral' => '255,127,80', 'cornflowerblue' => '100,149,237', 'cornsilk' => '255,248,220', 'crimson' => '220,20,60', 'cyan' => '0,255,255', 'darkblue' => '0,0,139', 'darkcyan' => '0,139,139', 'darkgoldenrod' => '184,134,11', 'darkgray' => '169,169,169', 'darkgreen' => '0,100,0', 'darkgrey' => '169,169,169', 'darkkhaki' => '189,183,107', 'darkmagenta' => '139,0,139', 'darkolivegreen' => '85,107,47', 'darkorange' => '255,140,0', 'darkorchid' => '153,50,204', 'darkred' => '139,0,0', 'darksalmon' => '233,150,122', 'darkseagreen' => '143,188,143', 'darkslateblue' => '72,61,139', 'darkslategray' => '47,79,79', 'darkslategrey' => '47,79,79', 'darkturquoise' => '0,206,209', 'darkviolet' => '148,0,211', 'deeppink' => '255,20,147', 'deepskyblue' => '0,191,255', 'dimgray' => '105,105,105', 'dimgrey' => '105,105,105', 'dodgerblue' => '30,144,255', 'firebrick' => '178,34,34', 'floralwhite' => '255,250,240', 'forestgreen' => '34,139,34', 'fuchsia' => '255,0,255', 'gainsboro' => '220,220,220', 'ghostwhite' => '248,248,255', 'gold' => '255,215,0', 'goldenrod' => '218,165,32', 'gray' => '128,128,128', 'green' => '0,128,0', 'greenyellow' => '173,255,47', 'grey' => '128,128,128', 'honeydew' => '240,255,240', 'hotpink' => '255,105,180', 'indianred' => '205,92,92', 'indigo' => '75,0,130', 'ivory' => '255,255,240', 'khaki' => '240,230,140', 'lavender' => '230,230,250', 'lavenderblush' => '255,240,245', 'lawngreen' => '124,252,0', 'lemonchiffon' => '255,250,205', 'lightblue' => '173,216,230', 'lightcoral' => '240,128,128', 'lightcyan' => '224,255,255', 'lightgoldenrodyellow' => '250,250,210', 'lightgray' => '211,211,211', 'lightgreen' => '144,238,144', 'lightgrey' => '211,211,211', 'lightpink' => '255,182,193', 'lightsalmon' => '255,160,122', 'lightseagreen' => '32,178,170', 'lightskyblue' => '135,206,250', 'lightslategray' => '119,136,153', 'lightslategrey' => '119,136,153', 'lightsteelblue' => '176,196,222', 'lightyellow' => '255,255,224', 'lime' => '0,255,0', 'limegreen' => '50,205,50', 'linen' => '250,240,230', 'magenta' => '255,0,255', 'maroon' => '128,0,0', 'mediumaquamarine' => '102,205,170', 'mediumblue' => '0,0,205', 'mediumorchid' => '186,85,211', 'mediumpurple' => '147,112,219', 'mediumseagreen' => '60,179,113', 'mediumslateblue' => '123,104,238', 'mediumspringgreen' => '0,250,154', 'mediumturquoise' => '72,209,204', 'mediumvioletred' => '199,21,133', 'midnightblue' => '25,25,112', 'mintcream' => '245,255,250', 'mistyrose' => '255,228,225', 'moccasin' => '255,228,181', 'navajowhite' => '255,222,173', 'navy' => '0,0,128', 'oldlace' => '253,245,230', 'olive' => '128,128,0', 'olivedrab' => '107,142,35', 'orange' => '255,165,0', 'orangered' => '255,69,0', 'orchid' => '218,112,214', 'palegoldenrod' => '238,232,170', 'palegreen' => '152,251,152', 'paleturquoise' => '175,238,238', 'palevioletred' => '219,112,147', 'papayawhip' => '255,239,213', 'peachpuff' => '255,218,185', 'peru' => '205,133,63', 'pink' => '255,192,203', 'plum' => '221,160,221', 'powderblue' => '176,224,230', 'purple' => '128,0,128', 'red' => '255,0,0', 'rosybrown' => '188,143,143', 'royalblue' => '65,105,225', 'saddlebrown' => '139,69,19', 'salmon' => '250,128,114', 'sandybrown' => '244,164,96', 'seagreen' => '46,139,87', 'seashell' => '255,245,238', 'sienna' => '160,82,45', 'silver' => '192,192,192', 'skyblue' => '135,206,235', 'slateblue' => '106,90,205', 'slategray' => '112,128,144', 'slategrey' => '112,128,144', 'snow' => '255,250,250', 'springgreen' => '0,255,127', 'steelblue' => '70,130,180', 'tan' => '210,180,140', 'teal' => '0,128,128', 'thistle' => '216,191,216', 'tomato' => '255,99,71', 'transparent' => '0,0,0,0', 'turquoise' => '64,224,208', 'violet' => '238,130,238', 'wheat' => '245,222,179', 'white' => '255,255,255', 'whitesmoke' => '245,245,245', 'yellow' => '255,255,0', 'yellowgreen' => '154,205,50' ); } // responsible for taking a string of LESS code and converting it into a // syntax tree class lessc_parser { static protected $nextBlockId = 0; // used to uniquely identify blocks static protected $precedence = array( '=<' => 0, '>=' => 0, '=' => 0, '<' => 0, '>' => 0, '+' => 1, '-' => 1, '*' => 2, '/' => 2, '%' => 2, ); static protected $whitePattern; static protected $commentMulti; static protected $commentSingle = "//"; static protected $commentMultiLeft = "/*"; static protected $commentMultiRight = "*/"; // regex string to match any of the operators static protected $operatorString; // these properties will supress division unless it's inside parenthases static protected $supressDivisionProps = array('/border-radius$/i', '/^font$/i'); protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document"); protected $lineDirectives = array("charset"); /** * if we are in parens we can be more liberal with whitespace around * operators because it must evaluate to a single value and thus is less * ambiguous. * * Consider: * property1: 10 -5; // is two numbers, 10 and -5 * property2: (10 -5); // should evaluate to 5 */ protected $inParens = false; // caches preg escaped literals static protected $literalCache = array(); public function __construct($lessc, $sourceName = null) { $this->eatWhiteDefault = true; // reference to less needed for vPrefix, mPrefix, and parentSelector $this->lessc = $lessc; $this->sourceName = $sourceName; // name used for error messages $this->writeComments = false; if (!self::$operatorString) { self::$operatorString = '('.implode('|', array_map(array('lessc', 'preg_quote'), array_keys(self::$precedence))).')'; $commentSingle = lessc::preg_quote(self::$commentSingle); $commentMultiLeft = lessc::preg_quote(self::$commentMultiLeft); $commentMultiRight = lessc::preg_quote(self::$commentMultiRight); self::$commentMulti = $commentMultiLeft.'.*?'.$commentMultiRight; self::$whitePattern = '/'.$commentSingle.'[^\n]*\s*|('.self::$commentMulti.')\s*|\s+/Ais'; } } public function parse($buffer) { $this->count = 0; $this->line = 1; $this->env = null; // block stack $this->buffer = $this->writeComments ? $buffer : $this->removeComments($buffer); $this->pushSpecialBlock("root"); $this->eatWhiteDefault = true; $this->seenComments = array(); // trim whitespace on head // if (preg_match('/^\s+/', $this->buffer, $m)) { // $this->line += substr_count($m[0], "\n"); // $this->buffer = ltrim($this->buffer); // } $this->whitespace(); // parse the entire file $lastCount = $this->count; while (false !== $this->parseChunk()); if ($this->count != strlen($this->buffer)) $this->throwError(); // TODO report where the block was opened if (!is_null($this->env->parent)) throw new exception('parse error: unclosed block'); return $this->env; } /** * Parse a single chunk off the head of the buffer and append it to the * current parse environment. * Returns false when the buffer is empty, or when there is an error. * * This function is called repeatedly until the entire document is * parsed. * * This parser is most similar to a recursive descent parser. Single * functions represent discrete grammatical rules for the language, and * they are able to capture the text that represents those rules. * * Consider the function lessc::keyword(). (all parse functions are * structured the same) * * The function takes a single reference argument. When calling the * function it will attempt to match a keyword on the head of the buffer. * If it is successful, it will place the keyword in the referenced * argument, advance the position in the buffer, and return true. If it * fails then it won't advance the buffer and it will return false. * * All of these parse functions are powered by lessc::match(), which behaves * the same way, but takes a literal regular expression. Sometimes it is * more convenient to use match instead of creating a new function. * * Because of the format of the functions, to parse an entire string of * grammatical rules, you can chain them together using &&. * * But, if some of the rules in the chain succeed before one fails, then * the buffer position will be left at an invalid state. In order to * avoid this, lessc::seek() is used to remember and set buffer positions. * * Before parsing a chain, use $s = $this->seek() to remember the current * position into $s. Then if a chain fails, use $this->seek($s) to * go back where we started. */ protected function parseChunk() { if (empty($this->buffer)) return false; $s = $this->seek(); // setting a property if ($this->keyword($key) && $this->assign() && $this->propertyValue($value, $key) && $this->end()) { $this->append(array('assign', $key, $value), $s); return true; } else { $this->seek($s); } // look for special css blocks if ($this->literal('@', false)) { $this->count--; // media if ($this->literal('@media')) { if (($this->mediaQueryList($mediaQueries) || true) && $this->literal('{')) { $media = $this->pushSpecialBlock("media"); $media->queries = is_null($mediaQueries) ? array() : $mediaQueries; return true; } else { $this->seek($s); return false; } } if ($this->literal("@", false) && $this->keyword($dirName)) { if ($this->isDirective($dirName, $this->blockDirectives)) { if (($this->openString("{", $dirValue, null, array(";")) || true) && $this->literal("{")) { $dir = $this->pushSpecialBlock("directive"); $dir->name = $dirName; if (isset($dirValue)) $dir->value = $dirValue; return true; } } elseif ($this->isDirective($dirName, $this->lineDirectives)) { if ($this->propertyValue($dirValue) && $this->end()) { $this->append(array("directive", $dirName, $dirValue)); return true; } } } $this->seek($s); } // setting a variable if ($this->variable($var) && $this->assign() && $this->propertyValue($value) && $this->end()) { $this->append(array('assign', $var, $value), $s); return true; } else { $this->seek($s); } if ($this->import($importValue)) { $this->append($importValue, $s); return true; } // opening parametric mixin if ($this->tag($tag, true) && $this->argumentDef($args, $isVararg) && ($this->guards($guards) || true) && $this->literal('{')) { $block = $this->pushBlock($this->fixTags(array($tag))); $block->args = $args; $block->isVararg = $isVararg; if (!empty($guards)) $block->guards = $guards; return true; } else { $this->seek($s); } // opening a simple block if ($this->tags($tags) && $this->literal('{')) { $tags = $this->fixTags($tags); $this->pushBlock($tags); return true; } else { $this->seek($s); } // closing a block if ($this->literal('}', false)) { try { $block = $this->pop(); } catch (exception $e) { $this->seek($s); $this->throwError($e->getMessage()); } $hidden = false; if (is_null($block->type)) { $hidden = true; if (!isset($block->args)) { foreach ($block->tags as $tag) { if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) { $hidden = false; break; } } } foreach ($block->tags as $tag) { if (is_string($tag)) { $this->env->children[$tag][] = $block; } } } if (!$hidden) { $this->append(array('block', $block), $s); } // this is done here so comments aren't bundled into he block that // was just closed $this->whitespace(); return true; } // mixin if ($this->mixinTags($tags) && ($this->argumentValues($argv) || true) && ($this->keyword($suffix) || true) && $this->end()) { $tags = $this->fixTags($tags); $this->append(array('mixin', $tags, $argv, $suffix), $s); return true; } else { $this->seek($s); } // spare ; if ($this->literal(';')) return true; return false; // got nothing, throw error } protected function isDirective($dirname, $directives) { // TODO: cache pattern in parser $pattern = implode("|", array_map(array("lessc", "preg_quote"), $directives)); $pattern = '/^(-[a-z-]+-)?(' . $pattern . ')$/i'; return preg_match($pattern, $dirname); } protected function fixTags($tags) { // move @ tags out of variable namespace foreach ($tags as &$tag) { if ($tag{0} == $this->lessc->vPrefix) $tag[0] = $this->lessc->mPrefix; } return $tags; } // a list of expressions protected function expressionList(&$exps) { $values = array(); while ($this->expression($exp)) { $values[] = $exp; } if (count($values) == 0) return false; $exps = lessc::compressList($values, ' '); return true; } /** * Attempt to consume an expression. * @link http://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudo-code */ protected function expression(&$out) { if ($this->value($lhs)) { $out = $this->expHelper($lhs, 0); // look for / shorthand if (!empty($this->env->supressedDivision)) { unset($this->env->supressedDivision); $s = $this->seek(); if ($this->literal("/") && $this->value($rhs)) { $out = array("list", "", array($out, array("keyword", "/"), $rhs)); } else { $this->seek($s); } } return true; } return false; } /** * recursively parse infix equation with $lhs at precedence $minP */ protected function expHelper($lhs, $minP) { $this->inExp = true; $ss = $this->seek(); while (true) { $whiteBefore = isset($this->buffer[$this->count - 1]) && ctype_space($this->buffer[$this->count - 1]); // If there is whitespace before the operator, then we require // whitespace after the operator for it to be an expression $needWhite = $whiteBefore && !$this->inParens; if ($this->match(self::$operatorString.($needWhite ? '\s' : ''), $m) && self::$precedence[$m[1]] >= $minP) { if (!$this->inParens && isset($this->env->currentProperty) && $m[1] == "/" && empty($this->env->supressedDivision)) { foreach (self::$supressDivisionProps as $pattern) { if (preg_match($pattern, $this->env->currentProperty)) { $this->env->supressedDivision = true; break 2; } } } $whiteAfter = isset($this->buffer[$this->count - 1]) && ctype_space($this->buffer[$this->count - 1]); if (!$this->value($rhs)) break; // peek for next operator to see what to do with rhs if ($this->peek(self::$operatorString, $next) && self::$precedence[$next[1]] > self::$precedence[$m[1]]) { $rhs = $this->expHelper($rhs, self::$precedence[$next[1]]); } $lhs = array('expression', $m[1], $lhs, $rhs, $whiteBefore, $whiteAfter); $ss = $this->seek(); continue; } break; } $this->seek($ss); return $lhs; } // consume a list of values for a property public function propertyValue(&$value, $keyName = null) { $values = array(); if ($keyName !== null) $this->env->currentProperty = $keyName; $s = null; while ($this->expressionList($v)) { $values[] = $v; $s = $this->seek(); if (!$this->literal(',')) break; } if ($s) $this->seek($s); if ($keyName !== null) unset($this->env->currentProperty); if (count($values) == 0) return false; $value = lessc::compressList($values, ', '); return true; } protected function parenValue(&$out) { $s = $this->seek(); // speed shortcut if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "(") { return false; } $inParens = $this->inParens; if ($this->literal("(") && ($this->inParens = true) && $this->expression($exp) && $this->literal(")")) { $out = $exp; $this->inParens = $inParens; return true; } else { $this->inParens = $inParens; $this->seek($s); } return false; } // a single value protected function value(&$value) { $s = $this->seek(); // speed shortcut if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "-") { // negation if ($this->literal("-", false) && (($this->variable($inner) && $inner = array("variable", $inner)) || $this->unit($inner) || $this->parenValue($inner))) { $value = array("unary", "-", $inner); return true; } else { $this->seek($s); } } if ($this->parenValue($value)) return true; if ($this->unit($value)) return true; if ($this->color($value)) return true; if ($this->func($value)) return true; if ($this->string($value)) return true; if ($this->keyword($word)) { $value = array('keyword', $word); return true; } // try a variable if ($this->variable($var)) { $value = array('variable', $var); return true; } // unquote string (should this work on any type? if ($this->literal("~") && $this->string($str)) { $value = array("escape", $str); return true; } else { $this->seek($s); } // css hack: \0 if ($this->literal('\\') && $this->match('([0-9]+)', $m)) { $value = array('keyword', '\\'.$m[1]); return true; } else { $this->seek($s); } return false; } // an import statement protected function import(&$out) { $s = $this->seek(); if (!$this->literal('@import')) return false; // @import "something.css" media; // @import url("something.css") media; // @import url(something.css) media; if ($this->propertyValue($value)) { $out = array("import", $value); return true; } } protected function mediaQueryList(&$out) { if ($this->genericList($list, "mediaQuery", ",", false)) { $out = $list[2]; return true; } return false; } protected function mediaQuery(&$out) { $s = $this->seek(); $expressions = null; $parts = array(); if (($this->literal("only") && ($only = true) || $this->literal("not") && ($not = true) || true) && $this->keyword($mediaType)) { $prop = array("mediaType"); if (isset($only)) $prop[] = "only"; if (isset($not)) $prop[] = "not"; $prop[] = $mediaType; $parts[] = $prop; } else { $this->seek($s); } if (!empty($mediaType) && !$this->literal("and")) { // ~ } else { $this->genericList($expressions, "mediaExpression", "and", false); if (is_array($expressions)) $parts = array_merge($parts, $expressions[2]); } if (count($parts) == 0) { $this->seek($s); return false; } $out = $parts; return true; } protected function mediaExpression(&$out) { $s = $this->seek(); $value = null; if ($this->literal("(") && $this->keyword($feature) && ($this->literal(":") && $this->expression($value) || true) && $this->literal(")")) { $out = array("mediaExp", $feature); if ($value) $out[] = $value; return true; } elseif ($this->variable($variable)) { $out = array('variable', $variable); return true; } $this->seek($s); return false; } // an unbounded string stopped by $end protected function openString($end, &$out, $nestingOpen=null, $rejectStrs = null) { $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; $stop = array("'", '"', "@{", $end); $stop = array_map(array("lessc", "preg_quote"), $stop); // $stop[] = self::$commentMulti; if (!is_null($rejectStrs)) { $stop = array_merge($stop, $rejectStrs); } $patt = '(.*?)('.implode("|", $stop).')'; $nestingLevel = 0; $content = array(); while ($this->match($patt, $m, false)) { if (!empty($m[1])) { $content[] = $m[1]; if ($nestingOpen) { $nestingLevel += substr_count($m[1], $nestingOpen); } } $tok = $m[2]; $this->count-= strlen($tok); if ($tok == $end) { if ($nestingLevel == 0) { break; } else { $nestingLevel--; } } if (($tok == "'" || $tok == '"') && $this->string($str)) { $content[] = $str; continue; } if ($tok == "@{" && $this->interpolation($inter)) { $content[] = $inter; continue; } if (!empty($rejectStrs) && in_array($tok, $rejectStrs)) { $ount = null; break; } $content[] = $tok; $this->count+= strlen($tok); } $this->eatWhiteDefault = $oldWhite; if (count($content) == 0) return false; // trim the end if (is_string(end($content))) { $content[count($content) - 1] = rtrim(end($content)); } $out = array("string", "", $content); return true; } protected function string(&$out) { $s = $this->seek(); if ($this->literal('"', false)) { $delim = '"'; } elseif ($this->literal("'", false)) { $delim = "'"; } else { return false; } $content = array(); // look for either ending delim , escape, or string interpolation $patt = '([^\n]*?)(@\{|\\\\|' . lessc::preg_quote($delim).')'; $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; while ($this->match($patt, $m, false)) { $content[] = $m[1]; if ($m[2] == "@{") { $this->count -= strlen($m[2]); if ($this->interpolation($inter, false)) { $content[] = $inter; } else { $this->count += strlen($m[2]); $content[] = "@{"; // ignore it } } elseif ($m[2] == '\\') { $content[] = $m[2]; if ($this->literal($delim, false)) { $content[] = $delim; } } else { $this->count -= strlen($delim); break; // delim } } $this->eatWhiteDefault = $oldWhite; if ($this->literal($delim)) { $out = array("string", $delim, $content); return true; } $this->seek($s); return false; } protected function interpolation(&$out) { $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = true; $s = $this->seek(); if ($this->literal("@{") && $this->openString("}", $interp, null, array("'", '"', ";")) && $this->literal("}", false)) { $out = array("interpolate", $interp); $this->eatWhiteDefault = $oldWhite; if ($this->eatWhiteDefault) $this->whitespace(); return true; } $this->eatWhiteDefault = $oldWhite; $this->seek($s); return false; } protected function unit(&$unit) { // speed shortcut if (isset($this->buffer[$this->count])) { $char = $this->buffer[$this->count]; if (!ctype_digit($char) && $char != ".") return false; } if ($this->match('([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m)) { $unit = array("number", $m[1], empty($m[2]) ? "" : $m[2]); return true; } return false; } // a # color protected function color(&$out) { if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) { if (strlen($m[1]) > 7) { $out = array("string", "", array($m[1])); } else { $out = array("raw_color", $m[1]); } return true; } return false; } // consume a list of property values delimited by ; and wrapped in () protected function argumentValues(&$args, $delim = ',') { $s = $this->seek(); if (!$this->literal('(')) return false; $values = array(); while (true) { if ($this->expressionList($value)) $values[] = $value; if (!$this->literal($delim)) break; else { if ($value == null) $values[] = null; $value = null; } } if (!$this->literal(')')) { $this->seek($s); return false; } $args = $values; return true; } // consume an argument definition list surrounded by () // each argument is a variable name with optional value // or at the end a ... or a variable named followed by ... protected function argumentDef(&$args, &$isVararg, $delim = ',') { $s = $this->seek(); if (!$this->literal('(')) return false; $values = array(); $isVararg = false; while (true) { if ($this->literal("...")) { $isVararg = true; break; } if ($this->variable($vname)) { $arg = array("arg", $vname); $ss = $this->seek(); if ($this->assign() && $this->expressionList($value)) { $arg[] = $value; } else { $this->seek($ss); if ($this->literal("...")) { $arg[0] = "rest"; $isVararg = true; } } $values[] = $arg; if ($isVararg) break; continue; } if ($this->value($literal)) { $values[] = array("lit", $literal); } if (!$this->literal($delim)) break; } if (!$this->literal(')')) { $this->seek($s); return false; } $args = $values; return true; } // consume a list of tags // this accepts a hanging delimiter protected function tags(&$tags, $simple = false, $delim = ',') { $tags = array(); while ($this->tag($tt, $simple)) { $tags[] = $tt; if (!$this->literal($delim)) break; } if (count($tags) == 0) return false; return true; } // list of tags of specifying mixin path // optionally separated by > (lazy, accepts extra >) protected function mixinTags(&$tags) { $s = $this->seek(); $tags = array(); while ($this->tag($tt, true)) { $tags[] = $tt; $this->literal(">"); } if (count($tags) == 0) return false; return true; } // a bracketed value (contained within in a tag definition) protected function tagBracket(&$value) { // speed shortcut if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") { return false; } $s = $this->seek(); if ($this->literal('[') && $this->to(']', $c, true) && $this->literal(']', false)) { $value = '['.$c.']'; // whitespace? if ($this->whitespace()) $value .= " "; // escape parent selector, (yuck) $value = str_replace($this->lessc->parentSelector, "$&$", $value); return true; } $this->seek($s); return false; } protected function tagExpression(&$value) { $s = $this->seek(); if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) { $value = array('exp', $exp); return true; } $this->seek($s); return false; } // a space separated list of selectors protected function tag(&$tag, $simple = false) { if ($simple) $chars = '^@,:;{}\][>\(\) "\''; else $chars = '^@,;{}["\''; $s = $this->seek(); if (!$simple && $this->tagExpression($tag)) { return true; } $hasExpression = false; $parts = array(); while ($this->tagBracket($first)) $parts[] = $first; $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; while (true) { if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) { $parts[] = $m[1]; if ($simple) break; while ($this->tagBracket($brack)) { $parts[] = $brack; } continue; } if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "@") { if ($this->interpolation($interp)) { $hasExpression = true; $interp[2] = true; // don't unescape $parts[] = $interp; continue; } if ($this->literal("@")) { $parts[] = "@"; continue; } } if ($this->unit($unit)) { // for keyframes $parts[] = $unit[1]; $parts[] = $unit[2]; continue; } break; } $this->eatWhiteDefault = $oldWhite; if (!$parts) { $this->seek($s); return false; } if ($hasExpression) { $tag = array("exp", array("string", "", $parts)); } else { $tag = trim(implode($parts)); } $this->whitespace(); return true; } // a css function protected function func(&$func) { $s = $this->seek(); if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) { $fname = $m[1]; $sPreArgs = $this->seek(); $args = array(); while (true) { $ss = $this->seek(); // this ugly nonsense is for ie filter properties if ($this->keyword($name) && $this->literal('=') && $this->expressionList($value)) { $args[] = array("string", "", array($name, "=", $value)); } else { $this->seek($ss); if ($this->expressionList($value)) { $args[] = $value; } } if (!$this->literal(',')) break; } $args = array('list', ',', $args); if ($this->literal(')')) { $func = array('function', $fname, $args); return true; } elseif ($fname == 'url') { // couldn't parse and in url? treat as string $this->seek($sPreArgs); if ($this->openString(")", $string) && $this->literal(")")) { $func = array('function', $fname, $string); return true; } } } $this->seek($s); return false; } // consume a less variable protected function variable(&$name) { $s = $this->seek(); if ($this->literal($this->lessc->vPrefix, false) && ($this->variable($sub) || $this->keyword($name))) { if (!empty($sub)) { $name = array('variable', $sub); } else { $name = $this->lessc->vPrefix.$name; } return true; } $name = null; $this->seek($s); return false; } /** * Consume an assignment operator * Can optionally take a name that will be set to the current property name */ protected function assign($name = null) { if ($name) $this->currentProperty = $name; return $this->literal(':') || $this->literal('='); } // consume a keyword protected function keyword(&$word) { if ($this->match('([\w_\-\*!"][\w\-_"]*)', $m)) { $word = $m[1]; return true; } return false; } // consume an end of statement delimiter protected function end() { if ($this->literal(';')) { return true; } elseif ($this->count == strlen($this->buffer) || $this->buffer{$this->count} == '}') { // if there is end of file or a closing block next then we don't need a ; return true; } return false; } protected function guards(&$guards) { $s = $this->seek(); if (!$this->literal("when")) { $this->seek($s); return false; } $guards = array(); while ($this->guardGroup($g)) { $guards[] = $g; if (!$this->literal(",")) break; } if (count($guards) == 0) { $guards = null; $this->seek($s); return false; } return true; } // a bunch of guards that are and'd together // TODO rename to guardGroup protected function guardGroup(&$guardGroup) { $s = $this->seek(); $guardGroup = array(); while ($this->guard($guard)) { $guardGroup[] = $guard; if (!$this->literal("and")) break; } if (count($guardGroup) == 0) { $guardGroup = null; $this->seek($s); return false; } return true; } protected function guard(&$guard) { $s = $this->seek(); $negate = $this->literal("not"); if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) { $guard = $exp; if ($negate) $guard = array("negate", $guard); return true; } $this->seek($s); return false; } /* raw parsing functions */ protected function literal($what, $eatWhitespace = null) { if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault; // shortcut on single letter if (!isset($what[1]) && isset($this->buffer[$this->count])) { if ($this->buffer[$this->count] == $what) { if (!$eatWhitespace) { $this->count++; return true; } // goes below... } else { return false; } } if (!isset(self::$literalCache[$what])) { self::$literalCache[$what] = lessc::preg_quote($what); } return $this->match(self::$literalCache[$what], $m, $eatWhitespace); } protected function genericList(&$out, $parseItem, $delim="", $flatten=true) { $s = $this->seek(); $items = array(); while ($this->$parseItem($value)) { $items[] = $value; if ($delim) { if (!$this->literal($delim)) break; } } if (count($items) == 0) { $this->seek($s); return false; } if ($flatten && count($items) == 1) { $out = $items[0]; } else { $out = array("list", $delim, $items); } return true; } // advance counter to next occurrence of $what // $until - don't include $what in advance // $allowNewline, if string, will be used as valid char set protected function to($what, &$out, $until = false, $allowNewline = false) { if (is_string($allowNewline)) { $validChars = $allowNewline; } else { $validChars = $allowNewline ? "." : "[^\n]"; } if (!$this->match('('.$validChars.'*?)'.lessc::preg_quote($what), $m, !$until)) return false; if ($until) $this->count -= strlen($what); // give back $what $out = $m[1]; return true; } // try to match something on head of buffer protected function match($regex, &$out, $eatWhitespace = null) { if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault; $r = '/'.$regex.($eatWhitespace && !$this->writeComments ? '\s*' : '').'/Ais'; if (preg_match($r, $this->buffer, $out, null, $this->count)) { $this->count += strlen($out[0]); if ($eatWhitespace && $this->writeComments) $this->whitespace(); return true; } return false; } // match some whitespace protected function whitespace() { if ($this->writeComments) { $gotWhite = false; while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) { if (isset($m[1]) && empty($this->commentsSeen[$this->count])) { $this->append(array("comment", $m[1])); $this->commentsSeen[$this->count] = true; } $this->count += strlen($m[0]); $gotWhite = true; } return $gotWhite; } else { $this->match("", $m); return strlen($m[0]) > 0; } } // match something without consuming it protected function peek($regex, &$out = null, $from=null) { if (is_null($from)) $from = $this->count; $r = '/'.$regex.'/Ais'; $result = preg_match($r, $this->buffer, $out, null, $from); return $result; } // seek to a spot in the buffer or return where we are on no argument protected function seek($where = null) { if ($where === null) return $this->count; else $this->count = $where; return true; } /* misc functions */ public function throwError($msg = "parse error", $count = null) { $count = is_null($count) ? $this->count : $count; $line = $this->line + substr_count(substr($this->buffer, 0, $count), "\n"); if (!empty($this->sourceName)) { $loc = "$this->sourceName on line $line"; } else { $loc = "line: $line"; } // TODO this depends on $this->count if ($this->peek("(.*?)(\n|$)", $m, $count)) { throw new exception("$msg: failed at `$m[1]` $loc"); } else { throw new exception("$msg: $loc"); } } protected function pushBlock($selectors=null, $type=null) { $b = new stdclass; $b->parent = $this->env; $b->type = $type; $b->id = self::$nextBlockId++; $b->isVararg = false; // TODO: kill me from here $b->tags = $selectors; $b->props = array(); $b->children = array(); $this->env = $b; return $b; } // push a block that doesn't multiply tags protected function pushSpecialBlock($type) { return $this->pushBlock(null, $type); } // append a property to the current block protected function append($prop, $pos = null) { if ($pos !== null) $prop[-1] = $pos; $this->env->props[] = $prop; } // pop something off the stack protected function pop() { $old = $this->env; $this->env = $this->env->parent; return $old; } // remove comments from $text // todo: make it work for all functions, not just url protected function removeComments($text) { $look = array( 'url(', '//', '/*', '"', "'" ); $out = ''; $min = null; while (true) { // find the next item foreach ($look as $token) { $pos = strpos($text, $token); if ($pos !== false) { if (!isset($min) || $pos < $min[1]) $min = array($token, $pos); } } if (is_null($min)) break; $count = $min[1]; $skip = 0; $newlines = 0; switch ($min[0]) { case 'url(': if (preg_match('/url\(.*?\)/', $text, $m, 0, $count)) $count += strlen($m[0]) - strlen($min[0]); break; case '"': case "'": if (preg_match('/'.$min[0].'.*?'.$min[0].'/', $text, $m, 0, $count)) $count += strlen($m[0]) - 1; break; case '//': $skip = strpos($text, "\n", $count); if ($skip === false) $skip = strlen($text) - $count; else $skip -= $count; break; case '/*': if (preg_match('/\/\*.*?\*\//s', $text, $m, 0, $count)) { $skip = strlen($m[0]); $newlines = substr_count($m[0], "\n"); } break; } if ($skip == 0) $count += strlen($min[0]); $out .= substr($text, 0, $count).str_repeat("\n", $newlines); $text = substr($text, $count + $skip); $min = null; } return $out.$text; } } class lessc_formatter_classic { public $indentChar = " "; public $break = "\n"; public $open = " {"; public $close = "}"; public $selectorSeparator = ", "; public $assignSeparator = ":"; public $openSingle = " { "; public $closeSingle = " }"; public $disableSingle = false; public $breakSelectors = false; public $compressColors = false; public function __construct() { $this->indentLevel = 0; } public function indentStr($n = 0) { return str_repeat($this->indentChar, max($this->indentLevel + $n, 0)); } public function property($name, $value) { return $name . $this->assignSeparator . $value . ";"; } protected function isEmpty($block) { if (empty($block->lines)) { foreach ($block->children as $child) { if (!$this->isEmpty($child)) return false; } return true; } return false; } public function block($block) { if ($this->isEmpty($block)) return; $inner = $pre = $this->indentStr(); $isSingle = !$this->disableSingle && is_null($block->type) && count($block->lines) == 1; if (!empty($block->selectors)) { $this->indentLevel++; if ($this->breakSelectors) { $selectorSeparator = $this->selectorSeparator . $this->break . $pre; } else { $selectorSeparator = $this->selectorSeparator; } echo $pre . implode($selectorSeparator, $block->selectors); if ($isSingle) { echo $this->openSingle; $inner = ""; } else { echo $this->open . $this->break; $inner = $this->indentStr(); } } if (!empty($block->lines)) { $glue = $this->break.$inner; echo $inner . implode($glue, $block->lines); if (!$isSingle && !empty($block->children)) { echo $this->break; } } foreach ($block->children as $child) { $this->block($child); } if (!empty($block->selectors)) { if (!$isSingle && empty($block->children)) echo $this->break; if ($isSingle) { echo $this->closeSingle . $this->break; } else { echo $pre . $this->close . $this->break; } $this->indentLevel--; } } } class lessc_formatter_compressed extends lessc_formatter_classic { public $disableSingle = true; public $open = "{"; public $selectorSeparator = ","; public $assignSeparator = ":"; public $break = ""; public $compressColors = true; public function indentStr($n = 0) { return ""; } } class lessc_formatter_lessjs extends lessc_formatter_classic { public $disableSingle = true; public $breakSelectors = true; public $assignSeparator = ": "; public $selectorSeparator = ","; } PK���\d�ZF��&libraries/vendor/leafo/lessphp/lessifynu�[���#!/usr/bin/php <?php if (php_sapi_name() != "cli") { err($fa.$argv[0]." must be run in the command line."); exit(1); } $exe = array_shift($argv); // remove filename if (!$fname = array_shift($argv)) { exit("Usage: ".$exe." input-file\n"); } require "lessify.inc.php"; try { $parser = new lessify($fname); echo $parser->parse(); } catch (exception $e) { exit("Fatal error: ".$e->getMessage()."\n"); } PK���\��b//%libraries/vendor/leafo/lessphp/plesscnu�[���#!/usr/bin/env php <?php // Command line utility to compile LESS to STDOUT // Leaf Corcoran <leafot@gmail.com>, 2012 $exe = array_shift($argv); // remove filename $HELP = <<<EOT Usage: $exe [options] input-file [output-file] Options include: -h, --help Show this message -v Print the version -f=format Set the output format, includes "default", "compressed" -c Keep /* */ comments in output -r Read from STDIN instead of input-file -w Watch input-file, and compile to output-file if it is changed -T Dump formatted parse tree -X Dump raw parse tree EOT; $opts = getopt('hvrwncXTf:', array('help')); while (count($argv) > 0 && preg_match('/^-([-hvrwncXT]$|[f]=)/', $argv[0])) { array_shift($argv); } function has() { global $opts; foreach (func_get_args() as $arg) { if (isset($opts[$arg])) return true; } return false; } if (has("h", "help")) { exit($HELP); } error_reporting(E_ALL); $path = realpath(dirname(__FILE__)).'/'; require $path."lessc.inc.php"; $VERSION = lessc::$VERSION; $fa = "Fatal Error: "; function err($msg) { fwrite(STDERR, $msg."\n"); } if (php_sapi_name() != "cli") { err($fa.$argv[0]." must be run in the command line."); exit(1); } function make_less($fname = null) { global $opts; $l = new lessc($fname); if (has("f")) { $format = $opts["f"]; if ($format != "default") $l->setFormatter($format); } if (has("c")) { $l->setPreserveComments(true); } return $l; } function process($data, $import = null) { global $fa; $l = make_less(); if ($import) $l->importDir = $import; try { echo $l->parse($data); exit(0); } catch (exception $ex) { err($fa."\n".str_repeat('=', 20)."\n". $ex->getMessage()); exit(1); } } if (has("v")) { exit($VERSION."\n"); } if (has("r")) { if (!empty($argv)) { $data = $argv[0]; } else { $data = ""; while (!feof(STDIN)) { $data .= fread(STDIN, 8192); } } exit(process($data)); } if (has("w")) { // need two files if (!is_file($in = array_shift($argv)) || null == $out = array_shift($argv)) { err($fa.$exe." -w infile outfile"); exit(1); } echo "Watching ".$in. (has("n") ? ' with notifications' : ''). ", press Ctrl + c to exit.\n"; $cache = $in; $last_action = 0; while (true) { clearstatcache(); // check if anything has changed since last fail $updated = false; if (is_array($cache)) { foreach ($cache['files'] as $fname=>$_) { if (filemtime($fname) > $last_action) { $updated = true; break; } } } else $updated = true; // try to compile it if ($updated) { $last_action = time(); try { $cache = lessc::cexecute($cache); echo "Writing updated file: ".$out."\n"; if (!file_put_contents($out, $cache['compiled'])) { err($fa."Could not write to file ".$out); exit(1); } } catch (exception $ex) { echo "\nFatal Error:\n".str_repeat('=', 20)."\n". $ex->getMessage()."\n\n"; if (has("n")) { `notify-send -u critical "compile failed" "{$ex->getMessage()}"`; } } } sleep(1); } exit(0); } if (!$fname = array_shift($argv)) { echo $HELP; exit(1); } function dumpValue($node, $depth = 0) { if (is_object($node)) { $indent = str_repeat(" ", $depth); $out = array(); foreach ($node->props as $prop) { $out[] = $indent . dumpValue($prop, $depth + 1); } $out = implode("\n", $out); if (!empty($node->tags)) { $out = "+ ".implode(", ", $node->tags)."\n".$out; } return $out; } elseif (is_array($node)) { if (empty($node)) return "[]"; $type = $node[0]; if ($type == "block") return dumpValue($node[1], $depth); $out = array(); foreach ($node as $value) { $out[] = dumpValue($value, $depth); } return "{ ".implode(", ", $out)." }"; } else { if (is_string($node) && preg_match("/[\s,]/", $node)) { return '"'.$node.'"'; } return $node; // normal value } } function stripValue($o, $toStrip) { if (is_array($o) || is_object($o)) { $isObject = is_object($o); $o = (array)$o; foreach ($toStrip as $removeKey) { if (!empty($o[$removeKey])) { $o[$removeKey] = "*stripped*"; } } foreach ($o as $k => $v) { $o[$k] = stripValue($v, $toStrip); } if ($isObject) { $o = (object)$o; } } return $o; } function dumpWithoutParent($o, $alsoStrip=array()) { $toStrip = array_merge(array("parent"), $alsoStrip); print_r(stripValue($o, $toStrip)); } try { $less = make_less($fname); if (has("T", "X")) { $parser = new lessc_parser($less, $fname); $tree = $parser->parse(file_get_contents($fname)); if (has("X")) $out = print_r($tree, 1); else $out = dumpValue($tree)."\n"; } else { $out = $less->parse(); } if (!$fout = array_shift($argv)) { echo $out; } else { file_put_contents($fout, $out); } } catch (exception $ex) { err($fa.$ex->getMessage()); exit(1); } ?> PK���\�t�%�%.libraries/vendor/leafo/lessphp/lessify.inc.phpnu�[���<?php /** * lessify * Convert a css file into a less file * http://leafo.net/lessphp * Copyright 2010, leaf corcoran <leafot@gmail.com> * * WARNING: THIS DOES NOT WORK ANYMORE. NEEDS TO BE UPDATED FOR * LATEST VERSION OF LESSPHP. * */ require "lessc.inc.php"; // // check if the merge during mixin is overwriting values. should or should it not? // // // 1. split apart class tags // class easyparse { var $buffer; var $count; function __construct($str) { $this->count = 0; $this->buffer = trim($str); } function seek($where = null) { if ($where === null) return $this->count; else $this->count = $where; return true; } function preg_quote($what) { return preg_quote($what, '/'); } function match($regex, &$out, $eatWhitespace = true) { $r = '/'.$regex.($eatWhitespace ? '\s*' : '').'/Ais'; if (preg_match($r, $this->buffer, $out, null, $this->count)) { $this->count += strlen($out[0]); return true; } return false; } function literal($what, $eatWhitespace = true) { // this is here mainly prevent notice from { } string accessor if ($this->count >= strlen($this->buffer)) return false; // shortcut on single letter if (!$eatWhitespace and strlen($what) == 1) { if ($this->buffer{$this->count} == $what) { $this->count++; return true; } else return false; } return $this->match($this->preg_quote($what), $m, $eatWhitespace); } } class tagparse extends easyparse { static private $combinators = null; static private $match_opts = null; function parse() { if (empty(self::$combinators)) { self::$combinators = '('.implode('|', array_map(array($this, 'preg_quote'), array('+', '>', '~'))).')'; self::$match_opts = '('.implode('|', array_map(array($this, 'preg_quote'), array('=', '~=', '|=', '$=', '*='))).')'; } // crush whitespace $this->buffer = preg_replace('/\s+/', ' ', $this->buffer).' '; $tags = array(); while ($this->tag($t)) $tags[] = $t; return $tags; } static function compileString($string) { list(, $delim, $str) = $string; $str = str_replace($delim, "\\".$delim, $str); $str = str_replace("\n", "\\\n", $str); return $delim.$str.$delim; } static function compilePaths($paths) { return implode(', ', array_map(array('self', 'compilePath'), $paths)); } // array of tags static function compilePath($path) { return implode(' ', array_map(array('self', 'compileTag'), $path)); } static function compileTag($tag) { ob_start(); if (isset($tag['comb'])) echo $tag['comb']." "; if (isset($tag['front'])) echo $tag['front']; if (isset($tag['attr'])) { echo '['.$tag['attr']; if (isset($tag['op'])) { echo $tag['op'].$tag['op_value']; } echo ']'; } return ob_get_clean(); } function string(&$out) { $s = $this->seek(); if ($this->literal('"')) { $delim = '"'; } elseif ($this->literal("'")) { $delim = "'"; } else { return false; } while (true) { // step through letters looking for either end or escape $buff = ""; $escapeNext = false; $finished = false; for ($i = $this->count; $i < strlen($this->buffer); $i++) { $char = $this->buffer[$i]; switch ($char) { case $delim: if ($escapeNext) { $buff .= $char; $escapeNext = false; break; } $finished = true; break 2; case "\\": if ($escapeNext) { $buff .= $char; $escapeNext = false; } else { $escapeNext = true; } break; case "\n": if (!$escapeNext) { break 3; } $buff .= $char; $escapeNext = false; break; default: if ($escapeNext) { $buff .= "\\"; $escapeNext = false; } $buff .= $char; } } if (!$finished) break; $out = array('string', $delim, $buff); $this->seek($i+1); return true; } $this->seek($s); return false; } function tag(&$out) { $s = $this->seek(); $tag = array(); if ($this->combinator($op)) $tag['comb'] = $op; if (!$this->match('(.*?)( |$|\[|'.self::$combinators.')', $match)) { $this->seek($s); return false; } if (!empty($match[3])) { // give back combinator $this->count-=strlen($match[3]); } if (!empty($match[1])) $tag['front'] = $match[1]; if ($match[2] == '[') { if ($this->ident($i)) { $tag['attr'] = $i; if ($this->match(self::$match_opts, $m) && $this->value($v)) { $tag['op'] = $m[1]; $tag['op_value'] = $v; } if ($this->literal(']')) { $out = $tag; return true; } } } elseif (isset($tag['front'])) { $out = $tag; return true; } $this->seek($s); return false; } function ident(&$out) { // [-]?{nmstart}{nmchar}* // nmstart: [_a-z]|{nonascii}|{escape} // nmchar: [_a-z0-9-]|{nonascii}|{escape} if ($this->match('(-?[_a-z][_\w]*)', $m)) { $out = $m[1]; return true; } return false; } function value(&$out) { if ($this->string($str)) { $out = $this->compileString($str); return true; } elseif ($this->ident($id)) { $out = $id; return true; } return false; } function combinator(&$op) { if ($this->match(self::$combinators, $m)) { $op = $m[1]; return true; } return false; } } class nodecounter { var $count = 0; var $children = array(); var $name; var $child_blocks; var $the_block; function __construct($name) { $this->name = $name; } function dump($stack = null) { if (is_null($stack)) $stack = array(); $stack[] = $this->getName(); echo implode(' -> ', $stack)." ($this->count)\n"; foreach ($this->children as $child) { $child->dump($stack); } } static function compileProperties($c, $block) { foreach($block as $name => $value) { if ($c->isProperty($name, $value)) { echo $c->compileProperty($name, $value)."\n"; } } } function compile($c, $path = null) { if (is_null($path)) $path = array(); $path[] = $this->name; $isVisible = !is_null($this->the_block) || !is_null($this->child_blocks); if ($isVisible) { echo $c->indent(implode(' ', $path).' {'); $c->indentLevel++; $path = array(); if ($this->the_block) { $this->compileProperties($c, $this->the_block); } if ($this->child_blocks) { foreach ($this->child_blocks as $block) { echo $c->indent(tagparse::compilePaths($block['__tags']).' {'); $c->indentLevel++; $this->compileProperties($c, $block); $c->indentLevel--; echo $c->indent('}'); } } } // compile child nodes foreach($this->children as $node) { $node->compile($c, $path); } if ($isVisible) { $c->indentLevel--; echo $c->indent('}'); } } function getName() { if (is_null($this->name)) return "[root]"; else return $this->name; } function getNode($name) { if (!isset($this->children[$name])) { $this->children[$name] = new nodecounter($name); } return $this->children[$name]; } function findNode($path) { $current = $this; for ($i = 0; $i < count($path); $i++) { $t = tagparse::compileTag($path[$i]); $current = $current->getNode($t); } return $current; } function addBlock($path, $block) { $node = $this->findNode($path); if (!is_null($node->the_block)) throw new exception("can this happen?"); unset($block['__tags']); $node->the_block = $block; } function addToNode($path, $block) { $node = $this->findNode($path); $node->child_blocks[] = $block; } } /** * create a less file from a css file by combining blocks where appropriate */ class lessify extends lessc { public function dump() { print_r($this->env); } public function parse($str = null) { $this->prepareParser($str ? $str : $this->buffer); while (false !== $this->parseChunk()); $root = new nodecounter(null); // attempt to preserve some of the block order $order = array(); $visitedTags = array(); foreach (end($this->env) as $name => $block) { if (!$this->isBlock($name, $block)) continue; if (isset($visitedTags[$name])) continue; foreach ($block['__tags'] as $t) { $visitedTags[$t] = true; } // skip those with more than 1 if (count($block['__tags']) == 1) { $p = new tagparse(end($block['__tags'])); $path = $p->parse(); $root->addBlock($path, $block); $order[] = array('compressed', $path, $block); continue; } else { $common = null; $paths = array(); foreach ($block['__tags'] as $rawtag) { $p = new tagparse($rawtag); $paths[] = $path = $p->parse(); if (is_null($common)) $common = $path; else { $new_common = array(); foreach ($path as $tag) { $head = array_shift($common); if ($tag == $head) { $new_common[] = $head; } else break; } $common = $new_common; if (empty($common)) { // nothing in common break; } } } if (!empty($common)) { $new_paths = array(); foreach ($paths as $p) $new_paths[] = array_slice($p, count($common)); $block['__tags'] = $new_paths; $root->addToNode($common, $block); $order[] = array('compressed', $common, $block); continue; } } $order[] = array('none', $block['__tags'], $block); } $compressed = $root->children; foreach ($order as $item) { list($type, $tags, $block) = $item; if ($type == 'compressed') { $top = tagparse::compileTag(reset($tags)); if (isset($compressed[$top])) { $compressed[$top]->compile($this); unset($compressed[$top]); } } else { echo $this->indent(implode(', ', $tags).' {'); $this->indentLevel++; nodecounter::compileProperties($this, $block); $this->indentLevel--; echo $this->indent('}'); } } } } PK���\�O|�)�)3libraries/vendor/phpmailer/phpmailer/class.pop3.phpnu�[���<?php /** * PHPMailer POP-Before-SMTP Authentication Class. * PHP Version 5 * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) * @copyright 2012 - 2014 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. */ /** * PHPMailer POP-Before-SMTP Authentication Class. * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication. * Does not support APOP. * @package PHPMailer * @author Richard Davey (original author) <rich@corephp.co.uk> * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> */ class POP3 { /** * The POP3 PHPMailer Version number. * @type string * @access public */ public $Version = '5.2.9'; /** * Default POP3 port number. * @type integer * @access public */ public $POP3_PORT = 110; /** * Default timeout in seconds. * @type integer * @access public */ public $POP3_TIMEOUT = 30; /** * POP3 Carriage Return + Line Feed. * @type string * @access public * @deprecated Use the constant instead */ public $CRLF = "\r\n"; /** * Debug display level. * Options: 0 = no, 1+ = yes * @type integer * @access public */ public $do_debug = 0; /** * POP3 mail server hostname. * @type string * @access public */ public $host; /** * POP3 port number. * @type integer * @access public */ public $port; /** * POP3 Timeout Value in seconds. * @type integer * @access public */ public $tval; /** * POP3 username * @type string * @access public */ public $username; /** * POP3 password. * @type string * @access public */ public $password; /** * Resource handle for the POP3 connection socket. * @type resource * @access private */ private $pop_conn; /** * Are we connected? * @type boolean * @access private */ private $connected = false; /** * Error container. * @type array * @access private */ private $errors = array(); /** * Line break constant */ const CRLF = "\r\n"; /** * Simple static wrapper for all-in-one POP before SMTP * @param $host * @param boolean $port * @param boolean $tval * @param string $username * @param string $password * @param integer $debug_level * @return boolean */ public static function popBeforeSmtp( $host, $port = false, $tval = false, $username = '', $password = '', $debug_level = 0 ) { $pop = new POP3; return $pop->authorise($host, $port, $tval, $username, $password, $debug_level); } /** * Authenticate with a POP3 server. * A connect, login, disconnect sequence * appropriate for POP-before SMTP authorisation. * @access public * @param string $host The hostname to connect to * @param integer|boolean $port The port number to connect to * @param integer|boolean $timeout The timeout value * @param string $username * @param string $password * @param integer $debug_level * @return boolean */ public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) { $this->host = $host; // If no port value provided, use default if ($port === false) { $this->port = $this->POP3_PORT; } else { $this->port = (integer)$port; } // If no timeout value provided, use default if ($timeout === false) { $this->tval = $this->POP3_TIMEOUT; } else { $this->tval = (integer)$timeout; } $this->do_debug = $debug_level; $this->username = $username; $this->password = $password; // Reset the error log $this->errors = array(); // connect $result = $this->connect($this->host, $this->port, $this->tval); if ($result) { $login_result = $this->login($this->username, $this->password); if ($login_result) { $this->disconnect(); return true; } } // We need to disconnect regardless of whether the login succeeded $this->disconnect(); return false; } /** * Connect to a POP3 server. * @access public * @param string $host * @param integer|boolean $port * @param integer $tval * @return boolean */ public function connect($host, $port = false, $tval = 30) { // Are we already connected? if ($this->connected) { return true; } //On Windows this will raise a PHP Warning error if the hostname doesn't exist. //Rather than suppress it with @fsockopen, capture it cleanly instead set_error_handler(array($this, 'catchWarning')); if ($port === false) { $port = $this->POP3_PORT; } // connect to the POP3 server $this->pop_conn = fsockopen( $host, // POP3 Host $port, // Port # $errno, // Error Number $errstr, // Error Message $tval ); // Timeout (seconds) // Restore the error handler restore_error_handler(); // Did we connect? if ($this->pop_conn === false) { // It would appear not... $this->setError(array( 'error' => "Failed to connect to server $host on port $port", 'errno' => $errno, 'errstr' => $errstr )); return false; } // Increase the stream time-out stream_set_timeout($this->pop_conn, $tval, 0); // Get the POP3 server response $pop3_response = $this->getResponse(); // Check for the +OK if ($this->checkResponse($pop3_response)) { // The connection is established and the POP3 server is talking $this->connected = true; return true; } return false; } /** * Log in to the POP3 server. * Does not support APOP (RFC 2828, 4949). * @access public * @param string $username * @param string $password * @return boolean */ public function login($username = '', $password = '') { if (!$this->connected) { $this->setError('Not connected to POP3 server'); } if (empty($username)) { $username = $this->username; } if (empty($password)) { $password = $this->password; } // Send the Username $this->sendString("USER $username" . self::CRLF); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { // Send the Password $this->sendString("PASS $password" . self::CRLF); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { return true; } } return false; } /** * Disconnect from the POP3 server. * @access public */ public function disconnect() { $this->sendString('QUIT'); //The QUIT command may cause the daemon to exit, which will kill our connection //So ignore errors here try { @fclose($this->pop_conn); } catch (Exception $e) { //Do nothing }; } /** * Get a response from the POP3 server. * $size is the maximum number of bytes to retrieve * @param integer $size * @return string * @access private */ private function getResponse($size = 128) { $response = fgets($this->pop_conn, $size); if ($this->do_debug >= 1) { echo "Server -> Client: $response"; } return $response; } /** * Send raw data to the POP3 server. * @param string $string * @return integer * @access private */ private function sendString($string) { if ($this->pop_conn) { if ($this->do_debug >= 2) { //Show client messages when debug >= 2 echo "Client -> Server: $string"; } return fwrite($this->pop_conn, $string, strlen($string)); } return 0; } /** * Checks the POP3 server response. * Looks for for +OK or -ERR. * @param string $string * @return boolean * @access private */ private function checkResponse($string) { if (substr($string, 0, 3) !== '+OK') { $this->setError(array( 'error' => "Server reported an error: $string", 'errno' => 0, 'errstr' => '' )); return false; } else { return true; } } /** * Add an error to the internal error store. * Also display debug output if it's enabled. * @param $error */ private function setError($error) { $this->errors[] = $error; if ($this->do_debug >= 1) { echo '<pre>'; foreach ($this->errors as $error) { print_r($error); } echo '</pre>'; } } /** * POP3 connection error handler. * @param integer $errno * @param string $errstr * @param string $errfile * @param integer $errline * @access private */ private function catchWarning($errno, $errstr, $errfile, $errline) { $this->setError(array( 'error' => "Connecting to the POP3 server raised a PHP warning: ", 'errno' => $errno, 'errstr' => $errstr, 'errfile' => $errfile, 'errline' => $errline )); } } PK���\�Z���:libraries/vendor/phpmailer/phpmailer/PHPMailerAutoload.phpnu�[���<?php /** * PHPMailer SPL autoloader. * PHP Version 5 * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) * @copyright 2012 - 2014 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. */ /** * PHPMailer SPL autoloader. * @param string $classname The name of the class to load */ function PHPMailerAutoload($classname) { //Can't use __DIR__ as it's only in PHP 5.3+ $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php'; if (is_readable($filename)) { require $filename; } } if (version_compare(PHP_VERSION, '5.1.2', '>=')) { //SPL autoloading was introduced in PHP 5.1.2 if (version_compare(PHP_VERSION, '5.3.0', '>=')) { spl_autoload_register('PHPMailerAutoload', true, true); } else { spl_autoload_register('PHPMailerAutoload'); } } else { /** * Fall back to traditional autoload for old PHP versions * @param string $classname The name of the class to load */ function __autoload($classname) { PHPMailerAutoload($classname); } } PK���\�&��5g5g,libraries/vendor/phpmailer/phpmailer/LICENSEnu�[��� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! PK���\�OԀ{�{3libraries/vendor/phpmailer/phpmailer/class.smtp.phpnu�[���<?php /** * PHPMailer RFC821 SMTP email transport class. * PHP Version 5 * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) * @copyright 2014 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. */ /** * PHPMailer RFC821 SMTP email transport class. * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server. * @package PHPMailer * @author Chris Ryan <unknown@example.com> * @author Marcus Bointon <phpmailer@synchromedia.co.uk> */ class SMTP { /** * The PHPMailer SMTP version number. * @type string */ const VERSION = '5.2.9'; /** * SMTP line break constant. * @type string */ const CRLF = "\r\n"; /** * The SMTP port to use if one is not specified. * @type integer */ const DEFAULT_SMTP_PORT = 25; /** * The maximum line length allowed by RFC 2822 section 2.1.1 * @type integer */ const MAX_LINE_LENGTH = 998; /** * Debug level for no output */ const DEBUG_OFF = 0; /** * Debug level to show client -> server messages */ const DEBUG_CLIENT = 1; /** * Debug level to show client -> server and server -> client messages */ const DEBUG_SERVER = 2; /** * Debug level to show connection status, client -> server and server -> client messages */ const DEBUG_CONNECTION = 3; /** * Debug level to show all messages */ const DEBUG_LOWLEVEL = 4; /** * The PHPMailer SMTP Version number. * @type string * @deprecated Use the `VERSION` constant instead * @see SMTP::VERSION */ public $Version = '5.2.9'; /** * SMTP server port number. * @type integer * @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead * @see SMTP::DEFAULT_SMTP_PORT */ public $SMTP_PORT = 25; /** * SMTP reply line ending. * @type string * @deprecated Use the `CRLF` constant instead * @see SMTP::CRLF */ public $CRLF = "\r\n"; /** * Debug output level. * Options: * * self::DEBUG_OFF (`0`) No debug output, default * * self::DEBUG_CLIENT (`1`) Client commands * * self::DEBUG_SERVER (`2`) Client commands and server responses * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages * @type integer */ public $do_debug = self::DEBUG_OFF; /** * How to handle debug output. * Options: * * `echo` Output plain-text as-is, appropriate for CLI * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output * * `error_log` Output to error log as configured in php.ini * * Alternatively, you can provide a callable expecting two params: a message string and the debug level: * <code> * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; * </code> * @type string|callable */ public $Debugoutput = 'echo'; /** * Whether to use VERP. * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path * @link http://www.postfix.org/VERP_README.html Info on VERP * @type boolean */ public $do_verp = false; /** * The timeout value for connection, in seconds. * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. * @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2 * @type integer */ public $Timeout = 300; /** * The SMTP timelimit value for reads, in seconds. * @type integer */ public $Timelimit = 30; /** * The socket for the server connection. * @type resource */ protected $smtp_conn; /** * Error message, if any, for the last call. * @type array */ protected $error = array(); /** * The reply the server sent to us for HELO. * If null, no HELO string has yet been received. * @type string|null */ protected $helo_rply = null; /** * The most recent reply received from the server. * @type string */ protected $last_reply = ''; /** * Output debugging info via a user-selected method. * @see SMTP::$Debugoutput * @see SMTP::$do_debug * @param string $str Debug string to output * @param integer $level The debug level of this message; see DEBUG_* constants * @return void */ protected function edebug($str, $level = 0) { if ($level > $this->do_debug) { return; } if (is_callable($this->Debugoutput)) { call_user_func($this->Debugoutput, $str, $this->do_debug); return; } switch ($this->Debugoutput) { case 'error_log': //Don't output, just log error_log($str); break; case 'html': //Cleans up output a bit for a better looking, HTML-safe output echo htmlentities( preg_replace('/[\r\n]+/', '', $str), ENT_QUOTES, 'UTF-8' ) . "<br>\n"; break; case 'echo': default: //Normalize line breaks $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str); echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( "\n", "\n \t ", trim($str) )."\n"; } } /** * Connect to an SMTP server. * @param string $host SMTP server IP or host name * @param integer $port The port number to connect to * @param integer $timeout How long to wait for the connection to open * @param array $options An array of options for stream_context_create() * @access public * @return boolean */ public function connect($host, $port = null, $timeout = 30, $options = array()) { static $streamok; //This is enabled by default since 5.0.0 but some providers disable it //Check this once and cache the result if (is_null($streamok)) { $streamok = function_exists('stream_socket_client'); } // Clear errors to avoid confusion $this->error = array(); // Make sure we are __not__ connected if ($this->connected()) { // Already connected, generate error $this->error = array('error' => 'Already connected to a server'); return false; } if (empty($port)) { $port = self::DEFAULT_SMTP_PORT; } // Connect to the SMTP server $this->edebug( "Connection: opening to $host:$port, t=$timeout, opt=".var_export($options, true), self::DEBUG_CONNECTION ); $errno = 0; $errstr = ''; if ($streamok) { $socket_context = stream_context_create($options); //Suppress errors; connection failures are handled at a higher level $this->smtp_conn = @stream_socket_client( $host . ":" . $port, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $socket_context ); } else { //Fall back to fsockopen which should work in more places, but is missing some features $this->edebug( "Connection: stream_socket_client not available, falling back to fsockopen", self::DEBUG_CONNECTION ); $this->smtp_conn = fsockopen( $host, $port, $errno, $errstr, $timeout ); } // Verify we connected properly if (!is_resource($this->smtp_conn)) { $this->error = array( 'error' => 'Failed to connect to server', 'errno' => $errno, 'errstr' => $errstr ); $this->edebug( 'SMTP ERROR: ' . $this->error['error'] . ": $errstr ($errno)", self::DEBUG_CLIENT ); return false; } $this->edebug('Connection: opened', self::DEBUG_CONNECTION); // SMTP server can take longer to respond, give longer timeout for first read // Windows does not have support for this timeout function if (substr(PHP_OS, 0, 3) != 'WIN') { $max = ini_get('max_execution_time'); if ($max != 0 && $timeout > $max) { // Don't bother if unlimited @set_time_limit($timeout); } stream_set_timeout($this->smtp_conn, $timeout, 0); } // Get any announcement $announce = $this->get_lines(); $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER); return true; } /** * Initiate a TLS (encrypted) session. * @access public * @return boolean */ public function startTLS() { if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) { return false; } // Begin encrypted connection if (!stream_socket_enable_crypto( $this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT )) { return false; } return true; } /** * Perform SMTP authentication. * Must be run after hello(). * @see hello() * @param string $username The user name * @param string $password The password * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5) * @param string $realm The auth realm for NTLM * @param string $workstation The auth workstation for NTLM * @access public * @return boolean True if successfully authenticated. */ public function authenticate( $username, $password, $authtype = 'LOGIN', $realm = '', $workstation = '' ) { if (empty($authtype)) { $authtype = 'LOGIN'; } switch ($authtype) { case 'PLAIN': // Start authentication if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { return false; } // Send encoded username and password if (!$this->sendCommand( 'User & Password', base64_encode("\0" . $username . "\0" . $password), 235 ) ) { return false; } break; case 'LOGIN': // Start authentication if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { return false; } if (!$this->sendCommand("Username", base64_encode($username), 334)) { return false; } if (!$this->sendCommand("Password", base64_encode($password), 235)) { return false; } break; case 'NTLM': /* * ntlm_sasl_client.php * Bundled with Permission * * How to telnet in windows: * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication */ require_once 'extras/ntlm_sasl_client.php'; $temp = new stdClass(); $ntlm_client = new ntlm_sasl_client_class; //Check that functions are available if (!$ntlm_client->Initialize($temp)) { $this->error = array('error' => $temp->error); $this->edebug( 'You need to enable some modules in your php.ini file: ' . $this->error['error'], self::DEBUG_CLIENT ); return false; } //msg1 $msg1 = $ntlm_client->TypeMsg1($realm, $workstation); //msg1 if (!$this->sendCommand( 'AUTH NTLM', 'AUTH NTLM ' . base64_encode($msg1), 334 ) ) { return false; } //Though 0 based, there is a white space after the 3 digit number //msg2 $challenge = substr($this->last_reply, 3); $challenge = base64_decode($challenge); $ntlm_res = $ntlm_client->NTLMResponse( substr($challenge, 24, 8), $password ); //msg3 $msg3 = $ntlm_client->TypeMsg3( $ntlm_res, $username, $realm, $workstation ); // send encoded username return $this->sendCommand('Username', base64_encode($msg3), 235); case 'CRAM-MD5': // Start authentication if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { return false; } // Get the challenge $challenge = base64_decode(substr($this->last_reply, 4)); // Build the response $response = $username . ' ' . $this->hmac($challenge, $password); // send encoded credentials return $this->sendCommand('Username', base64_encode($response), 235); } return true; } /** * Calculate an MD5 HMAC hash. * Works like hash_hmac('md5', $data, $key) * in case that function is not available * @param string $data The data to hash * @param string $key The key to hash with * @access protected * @return string */ protected function hmac($data, $key) { if (function_exists('hash_hmac')) { return hash_hmac('md5', $data, $key); } // The following borrowed from // http://php.net/manual/en/function.mhash.php#27225 // RFC 2104 HMAC implementation for php. // Creates an md5 HMAC. // Eliminates the need to install mhash to compute a HMAC // by Lance Rushing $bytelen = 64; // byte length for md5 if (strlen($key) > $bytelen) { $key = pack('H*', md5($key)); } $key = str_pad($key, $bytelen, chr(0x00)); $ipad = str_pad('', $bytelen, chr(0x36)); $opad = str_pad('', $bytelen, chr(0x5c)); $k_ipad = $key ^ $ipad; $k_opad = $key ^ $opad; return md5($k_opad . pack('H*', md5($k_ipad . $data))); } /** * Check connection state. * @access public * @return boolean True if connected. */ public function connected() { if (is_resource($this->smtp_conn)) { $sock_status = stream_get_meta_data($this->smtp_conn); if ($sock_status['eof']) { // The socket is valid but we are not connected $this->edebug( 'SMTP NOTICE: EOF caught while checking if connected', self::DEBUG_CLIENT ); $this->close(); return false; } return true; // everything looks good } return false; } /** * Close the socket and clean up the state of the class. * Don't use this function without first trying to use QUIT. * @see quit() * @access public * @return void */ public function close() { $this->error = array(); $this->helo_rply = null; if (is_resource($this->smtp_conn)) { // close the connection and cleanup fclose($this->smtp_conn); $this->smtp_conn = null; //Makes for cleaner serialization $this->edebug('Connection: closed', self::DEBUG_CONNECTION); } } /** * Send an SMTP DATA command. * Issues a data command and sends the msg_data to the server, * finializing the mail transaction. $msg_data is the message * that is to be send with the headers. Each header needs to be * on a single line followed by a <CRLF> with the message headers * and the message body being separated by and additional <CRLF>. * Implements rfc 821: DATA <CRLF> * @param string $msg_data Message data to send * @access public * @return boolean */ public function data($msg_data) { if (!$this->sendCommand('DATA', 'DATA', 354)) { return false; } /* The server is ready to accept data! * According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF) * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into * smaller lines to fit within the limit. * We will also look for lines that start with a '.' and prepend an additional '.'. * NOTE: this does not count towards line-length limit. */ // Normalize line breaks before exploding $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data)); /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field * of the first line (':' separated) does not contain a space then it _should_ be a header and we will * process all lines before a blank line as headers. */ $field = substr($lines[0], 0, strpos($lines[0], ':')); $in_headers = false; if (!empty($field) && strpos($field, ' ') === false) { $in_headers = true; } foreach ($lines as $line) { $lines_out = array(); if ($in_headers and $line == '') { $in_headers = false; } // ok we need to break this line up into several smaller lines //This is a small micro-optimisation: isset($str[$len]) is equivalent to (strlen($str) > $len) while (isset($line[self::MAX_LINE_LENGTH])) { //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on //so as to avoid breaking in the middle of a word $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); if (!$pos) { //Deliberately matches both false and 0 //No nice break found, add a hard break $pos = self::MAX_LINE_LENGTH - 1; $lines_out[] = substr($line, 0, $pos); $line = substr($line, $pos); } else { //Break at the found point $lines_out[] = substr($line, 0, $pos); //Move along by the amount we dealt with $line = substr($line, $pos + 1); } /* If processing headers add a LWSP-char to the front of new line * RFC822 section 3.1.1 */ if ($in_headers) { $line = "\t" . $line; } } $lines_out[] = $line; // Send the lines to the server foreach ($lines_out as $line_out) { //RFC2821 section 4.5.2 if (!empty($line_out) and $line_out[0] == '.') { $line_out = '.' . $line_out; } $this->client_send($line_out . self::CRLF); } } // Message data has been sent, complete the command return $this->sendCommand('DATA END', '.', 250); } /** * Send an SMTP HELO or EHLO command. * Used to identify the sending server to the receiving server. * This makes sure that client and server are in a known state. * Implements RFC 821: HELO <SP> <domain> <CRLF> * and RFC 2821 EHLO. * @param string $host The host name or IP to connect to * @access public * @return boolean */ public function hello($host = '') { // Try extended hello first (RFC 2821) return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host)); } /** * Send an SMTP HELO or EHLO command. * Low-level implementation used by hello() * @see hello() * @param string $hello The HELO string * @param string $host The hostname to say we are * @access protected * @return boolean */ protected function sendHello($hello, $host) { $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); $this->helo_rply = $this->last_reply; return $noerror; } /** * Send an SMTP MAIL command. * Starts a mail transaction from the email address specified in * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more recipient * commands may be called followed by a data command. * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF> * @param string $from Source address of this message * @access public * @return boolean */ public function mail($from) { $useVerp = ($this->do_verp ? ' XVERP' : ''); return $this->sendCommand( 'MAIL FROM', 'MAIL FROM:<' . $from . '>' . $useVerp, 250 ); } /** * Send an SMTP QUIT command. * Closes the socket if there is no error or the $close_on_error argument is true. * Implements from rfc 821: QUIT <CRLF> * @param boolean $close_on_error Should the connection close if an error occurs? * @access public * @return boolean */ public function quit($close_on_error = true) { $noerror = $this->sendCommand('QUIT', 'QUIT', 221); $err = $this->error; //Save any error if ($noerror or $close_on_error) { $this->close(); $this->error = $err; //Restore any error from the quit command } return $noerror; } /** * Send an SMTP RCPT command. * Sets the TO argument to $toaddr. * Returns true if the recipient was accepted false if it was rejected. * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF> * @param string $toaddr The address the message is being sent to * @access public * @return boolean */ public function recipient($toaddr) { return $this->sendCommand( 'RCPT TO', 'RCPT TO:<' . $toaddr . '>', array(250, 251) ); } /** * Send an SMTP RSET command. * Abort any transaction that is currently in progress. * Implements rfc 821: RSET <CRLF> * @access public * @return boolean True on success. */ public function reset() { return $this->sendCommand('RSET', 'RSET', 250); } /** * Send a command to an SMTP server and check its return code. * @param string $command The command name - not sent to the server * @param string $commandstring The actual command to send * @param integer|array $expect One or more expected integer success codes * @access protected * @return boolean True on success. */ protected function sendCommand($command, $commandstring, $expect) { if (!$this->connected()) { $this->error = array( 'error' => "Called $command without being connected" ); return false; } $this->client_send($commandstring . self::CRLF); $this->last_reply = $this->get_lines(); $code = substr($this->last_reply, 0, 3); $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); if (!in_array($code, (array)$expect)) { $this->error = array( 'error' => "$command command failed", 'smtp_code' => $code, 'detail' => substr($this->last_reply, 4) ); $this->edebug( 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, self::DEBUG_CLIENT ); return false; } $this->error = array(); return true; } /** * Send an SMTP SAML command. * Starts a mail transaction from the email address specified in $from. * Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more recipient * commands may be called followed by a data command. This command * will send the message to the users terminal if they are logged * in and send them an email. * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF> * @param string $from The address the message is from * @access public * @return boolean */ public function sendAndMail($from) { return $this->sendCommand('SAML', "SAML FROM:$from", 250); } /** * Send an SMTP VRFY command. * @param string $name The name to verify * @access public * @return boolean */ public function verify($name) { return $this->sendCommand('VRFY', "VRFY $name", array(250, 251)); } /** * Send an SMTP NOOP command. * Used to keep keep-alives alive, doesn't actually do anything * @access public * @return boolean */ public function noop() { return $this->sendCommand('NOOP', 'NOOP', 250); } /** * Send an SMTP TURN command. * This is an optional command for SMTP that this class does not support. * This method is here to make the RFC821 Definition complete for this class * and _may_ be implemented in future * Implements from rfc 821: TURN <CRLF> * @access public * @return boolean */ public function turn() { $this->error = array( 'error' => 'The SMTP TURN command is not implemented' ); $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); return false; } /** * Send raw data to the server. * @param string $data The data to send * @access public * @return integer|boolean The number of bytes sent to the server or false on error */ public function client_send($data) { $this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT); return fwrite($this->smtp_conn, $data); } /** * Get the latest error. * @access public * @return array */ public function getError() { return $this->error; } /** * Get the last reply from the server. * @access public * @return string */ public function getLastReply() { return $this->last_reply; } /** * Read the SMTP server's response. * Either before eof or socket timeout occurs on the operation. * With SMTP we can tell if we have more lines to read if the * 4th character is '-' symbol. If it is a space then we don't * need to read anything else. * @access protected * @return string */ protected function get_lines() { // If the connection is bad, give up straight away if (!is_resource($this->smtp_conn)) { return ''; } $data = ''; $endtime = 0; stream_set_timeout($this->smtp_conn, $this->Timeout); if ($this->Timelimit > 0) { $endtime = time() + $this->Timelimit; } while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { $str = @fgets($this->smtp_conn, 515); $this->edebug("SMTP -> get_lines(): \$data was \"$data\"", self::DEBUG_LOWLEVEL); $this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL); $data .= $str; $this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL); // If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen if ((isset($str[3]) and $str[3] == ' ')) { break; } // Timed-out? Log and break $info = stream_get_meta_data($this->smtp_conn); if ($info['timed_out']) { $this->edebug( 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', self::DEBUG_LOWLEVEL ); break; } // Now check if reads took too long if ($endtime and time() > $endtime) { $this->edebug( 'SMTP -> get_lines(): timelimit reached ('. $this->Timelimit . ' sec)', self::DEBUG_LOWLEVEL ); break; } } return $data; } /** * Enable or disable VERP address generation. * @param boolean $enabled */ public function setVerp($enabled = false) { $this->do_verp = $enabled; } /** * Get VERP address generation mode. * @return boolean */ public function getVerp() { return $this->do_verp; } /** * Set debug output method. * @param string $method The function/method to use for debugging output. */ public function setDebugOutput($method = 'echo') { $this->Debugoutput = $method; } /** * Get debug output method. * @return string */ public function getDebugOutput() { return $this->Debugoutput; } /** * Set debug output level. * @param integer $level */ public function setDebugLevel($level = 0) { $this->do_debug = $level; } /** * Get debug output level. * @return integer */ public function getDebugLevel() { return $this->do_debug; } /** * Set SMTP timeout. * @param integer $timeout */ public function setTimeout($timeout = 0) { $this->Timeout = $timeout; } /** * Get SMTP timeout. * @return integer */ public function getTimeout() { return $this->Timeout; } } PK���\���`u`u:libraries/vendor/phpmailer/phpmailer/extras/htmlfilter.phpnu�[���<?php /** * htmlfilter.inc * --------------- * This set of functions allows you to filter html in order to remove * any malicious tags from it. Useful in cases when you need to filter * user input for any cross-site-scripting attempts. * * Copyright (C) 2002-2004 by Duke University * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * * @Author Konstantin Riabitsev <icon@linux.duke.edu> * @Author Jim Jagielski <jim@jaguNET.com / jimjag@gmail.com> */ /** * This function returns the final tag out of the tag name, an array * of attributes, and the type of the tag. This function is called by * tln_sanitize internally. * * @param string $tagname the name of the tag. * @param array $attary the array of attributes and their values * @param integer $tagtype The type of the tag (see in comments). * @return string A string with the final tag representation. */ function tln_tagprint($tagname, $attary, $tagtype) { if ($tagtype == 2) { $fulltag = '</' . $tagname . '>'; } else { $fulltag = '<' . $tagname; if (is_array($attary) && sizeof($attary)) { $atts = array(); while (list($attname, $attvalue) = each($attary)) { array_push($atts, "$attname=$attvalue"); } $fulltag .= ' ' . join(' ', $atts); } if ($tagtype == 3) { $fulltag .= ' /'; } $fulltag .= '>'; } return $fulltag; } /** * A small helper function to use with array_walk. Modifies a by-ref * value and makes it lowercase. * * @param string $val a value passed by-ref. * @return void since it modifies a by-ref value. */ function tln_casenormalize(&$val) { $val = strtolower($val); } /** * This function skips any whitespace from the current position within * a string and to the next non-whitespace value. * * @param string $body the string * @param integer $offset the offset within the string where we should start * looking for the next non-whitespace character. * @return integer the location within the $body where the next * non-whitespace char is located. */ function tln_skipspace($body, $offset) { preg_match('/^(\s*)/s', substr($body, $offset), $matches); if (sizeof($matches[1])) { $count = strlen($matches[1]); $offset += $count; } return $offset; } /** * This function looks for the next character within a string. It's * really just a glorified "strpos", except it catches the failures * nicely. * * @param string $body The string to look for needle in. * @param integer $offset Start looking from this position. * @param string $needle The character/string to look for. * @return integer location of the next occurrence of the needle, or * strlen($body) if needle wasn't found. */ function tln_findnxstr($body, $offset, $needle) { $pos = strpos($body, $needle, $offset); if ($pos === false) { $pos = strlen($body); } return $pos; } /** * This function takes a PCRE-style regexp and tries to match it * within the string. * * @param string $body The string to look for needle in. * @param integer $offset Start looking from here. * @param string $reg A PCRE-style regex to match. * @return array|boolean Returns a false if no matches found, or an array * with the following members: * - integer with the location of the match within $body * - string with whatever content between offset and the match * - string with whatever it is we matched */ function tln_findnxreg($body, $offset, $reg) { $matches = array(); $retarr = array(); $preg_rule = '%^(.*?)(' . $reg . ')%s'; preg_match($preg_rule, substr($body, $offset), $matches); if (!isset($matches[0])) { $retarr = false; } else { $retarr[0] = $offset + strlen($matches[1]); $retarr[1] = $matches[1]; $retarr[2] = $matches[2]; } return $retarr; } /** * This function looks for the next tag. * * @param string $body String where to look for the next tag. * @param integer $offset Start looking from here. * @return array|boolean false if no more tags exist in the body, or * an array with the following members: * - string with the name of the tag * - array with attributes and their values * - integer with tag type (1, 2, or 3) * - integer where the tag starts (starting "<") * - integer where the tag ends (ending ">") * first three members will be false, if the tag is invalid. */ function tln_getnxtag($body, $offset) { if ($offset > strlen($body)) { return false; } $lt = tln_findnxstr($body, $offset, '<'); if ($lt == strlen($body)) { return false; } /** * We are here: * blah blah <tag attribute="value"> * \---------^ */ $pos = tln_skipspace($body, $lt + 1); if ($pos >= strlen($body)) { return array(false, false, false, $lt, strlen($body)); } /** * There are 3 kinds of tags: * 1. Opening tag, e.g.: * <a href="blah"> * 2. Closing tag, e.g.: * </a> * 3. XHTML-style content-less tag, e.g.: * <img src="blah"/> */ switch (substr($body, $pos, 1)) { case '/': $tagtype = 2; $pos++; break; case '!': /** * A comment or an SGML declaration. */ if (substr($body, $pos + 1, 2) == '--') { $gt = strpos($body, '-->', $pos); if ($gt === false) { $gt = strlen($body); } else { $gt += 2; } return array(false, false, false, $lt, $gt); } else { $gt = tln_findnxstr($body, $pos, '>'); return array(false, false, false, $lt, $gt); } break; default: /** * Assume tagtype 1 for now. If it's type 3, we'll switch values * later. */ $tagtype = 1; break; } /** * Look for next [\W-_], which will indicate the end of the tag name. */ $regary = tln_findnxreg($body, $pos, '[^\w\-_]'); if ($regary == false) { return array(false, false, false, $lt, strlen($body)); } list($pos, $tagname, $match) = $regary; $tagname = strtolower($tagname); /** * $match can be either of these: * '>' indicating the end of the tag entirely. * '\s' indicating the end of the tag name. * '/' indicating that this is type-3 xhtml tag. * * Whatever else we find there indicates an invalid tag. */ switch ($match) { case '/': /** * This is an xhtml-style tag with a closing / at the * end, like so: <img src="blah"/>. Check if it's followed * by the closing bracket. If not, then this tag is invalid */ if (substr($body, $pos, 2) == '/>') { $pos++; $tagtype = 3; } else { $gt = tln_findnxstr($body, $pos, '>'); $retary = array(false, false, false, $lt, $gt); return $retary; } //intentional fall-through case '>': return array($tagname, false, $tagtype, $lt, $pos); break; default: /** * Check if it's whitespace */ if (preg_match('/\s/', $match)) { } else { /** * This is an invalid tag! Look for the next closing ">". */ $gt = tln_findnxstr($body, $lt, '>'); return array(false, false, false, $lt, $gt); } } /** * At this point we're here: * <tagname attribute='blah'> * \-------^ * * At this point we loop in order to find all attributes. */ $attary = array(); while ($pos <= strlen($body)) { $pos = tln_skipspace($body, $pos); if ($pos == strlen($body)) { /** * Non-closed tag. */ return array(false, false, false, $lt, $pos); } /** * See if we arrived at a ">" or "/>", which means that we reached * the end of the tag. */ $matches = array(); preg_match('%^(\s*)(>|/>)%s', substr($body, $pos), $matches); if (isset($matches[0]) && $matches[0]) { /** * Yep. So we did. */ $pos += strlen($matches[1]); if ($matches[2] == '/>') { $tagtype = 3; $pos++; } return array($tagname, $attary, $tagtype, $lt, $pos); } /** * There are several types of attributes, with optional * [:space:] between members. * Type 1: * attrname[:space:]=[:space:]'CDATA' * Type 2: * attrname[:space:]=[:space:]"CDATA" * Type 3: * attr[:space:]=[:space:]CDATA * Type 4: * attrname * * We leave types 1 and 2 the same, type 3 we check for * '"' and convert to """ if needed, then wrap in * double quotes. Type 4 we convert into: * attrname="yes". */ $regary = tln_findnxreg($body, $pos, '[^\w\-_]'); if ($regary == false) { /** * Looks like body ended before the end of tag. */ return array(false, false, false, $lt, strlen($body)); } list($pos, $attname, $match) = $regary; $attname = strtolower($attname); /** * We arrived at the end of attribute name. Several things possible * here: * '>' means the end of the tag and this is attribute type 4 * '/' if followed by '>' means the same thing as above * '\s' means a lot of things -- look what it's followed by. * anything else means the attribute is invalid. */ switch ($match) { case '/': /** * This is an xhtml-style tag with a closing / at the * end, like so: <img src="blah"/>. Check if it's followed * by the closing bracket. If not, then this tag is invalid */ if (substr($body, $pos, 2) == '/>') { $pos++; $tagtype = 3; } else { $gt = tln_findnxstr($body, $pos, '>'); $retary = array(false, false, false, $lt, $gt); return $retary; } //intentional fall-through case '>': $attary{$attname} = '"yes"'; return array($tagname, $attary, $tagtype, $lt, $pos); break; default: /** * Skip whitespace and see what we arrive at. */ $pos = tln_skipspace($body, $pos); $char = substr($body, $pos, 1); /** * Two things are valid here: * '=' means this is attribute type 1 2 or 3. * \w means this was attribute type 4. * anything else we ignore and re-loop. End of tag and * invalid stuff will be caught by our checks at the beginning * of the loop. */ if ($char == '=') { $pos++; $pos = tln_skipspace($body, $pos); /** * Here are 3 possibilities: * "'" attribute type 1 * '"' attribute type 2 * everything else is the content of tag type 3 */ $quot = substr($body, $pos, 1); if ($quot == '\'') { $regary = tln_findnxreg($body, $pos + 1, '\''); if ($regary == false) { return array(false, false, false, $lt, strlen($body)); } list($pos, $attval, $match) = $regary; $pos++; $attary{$attname} = '\'' . $attval . '\''; } else { if ($quot == '"') { $regary = tln_findnxreg($body, $pos + 1, '\"'); if ($regary == false) { return array(false, false, false, $lt, strlen($body)); } list($pos, $attval, $match) = $regary; $pos++; $attary{$attname} = '"' . $attval . '"'; } else { /** * These are hateful. Look for \s, or >. */ $regary = tln_findnxreg($body, $pos, '[\s>]'); if ($regary == false) { return array(false, false, false, $lt, strlen($body)); } list($pos, $attval, $match) = $regary; /** * If it's ">" it will be caught at the top. */ $attval = preg_replace('/\"/s', '"', $attval); $attary{$attname} = '"' . $attval . '"'; } } } else { if (preg_match('|[\w/>]|', $char)) { /** * That was attribute type 4. */ $attary{$attname} = '"yes"'; } else { /** * An illegal character. Find next '>' and return. */ $gt = tln_findnxstr($body, $pos, '>'); return array(false, false, false, $lt, $gt); } } } } /** * The fact that we got here indicates that the tag end was never * found. Return invalid tag indication so it gets stripped. */ return array(false, false, false, $lt, strlen($body)); } /** * Translates entities into literal values so they can be checked. * * @param string $attvalue the by-ref value to check. * @param string $regex the regular expression to check against. * @param boolean $hex whether the entites are hexadecimal. * @return boolean True or False depending on whether there were matches. */ function tln_deent(&$attvalue, $regex, $hex = false) { preg_match_all($regex, $attvalue, $matches); if (is_array($matches) && sizeof($matches[0]) > 0) { $repl = array(); for ($i = 0; $i < sizeof($matches[0]); $i++) { $numval = $matches[1][$i]; if ($hex) { $numval = hexdec($numval); } $repl{$matches[0][$i]} = chr($numval); } $attvalue = strtr($attvalue, $repl); return true; } else { return false; } } /** * This function checks attribute values for entity-encoded values * and returns them translated into 8-bit strings so we can run * checks on them. * * @param string $attvalue A string to run entity check against. * @return Void, modifies a reference value. */ function tln_defang(&$attvalue) { /** * Skip this if there aren't ampersands or backslashes. */ if (strpos($attvalue, '&') === false && strpos($attvalue, '\\') === false ) { return; } do { $m = false; $m = $m || tln_deent($attvalue, '/\�*(\d+);*/s'); $m = $m || tln_deent($attvalue, '/\�*((\d|[a-f])+);*/si', true); $m = $m || tln_deent($attvalue, '/\\\\(\d+)/s', true); } while ($m == true); $attvalue = stripslashes($attvalue); } /** * Kill any tabs, newlines, or carriage returns. Our friends the * makers of the browser with 95% market value decided that it'd * be funny to make "java[tab]script" be just as good as "javascript". * * @param string $attvalue The attribute value before extraneous spaces removed. * @return Void, modifies a reference value. */ function tln_unspace(&$attvalue) { if (strcspn($attvalue, "\t\r\n\0 ") != strlen($attvalue)) { $attvalue = str_replace( array("\t", "\r", "\n", "\0", " "), array('', '', '', '', ''), $attvalue ); } } /** * This function runs various checks against the attributes. * * @param string $tagname String with the name of the tag. * @param array $attary Array with all tag attributes. * @param array $rm_attnames See description for tln_sanitize * @param array $bad_attvals See description for tln_sanitize * @param array $add_attr_to_tag See description for tln_sanitize * @return Array with modified attributes. */ function tln_fixatts( $tagname, $attary, $rm_attnames, $bad_attvals, $add_attr_to_tag ) { while (list($attname, $attvalue) = each($attary)) { /** * See if this attribute should be removed. */ foreach ($rm_attnames as $matchtag => $matchattrs) { if (preg_match($matchtag, $tagname)) { foreach ($matchattrs as $matchattr) { if (preg_match($matchattr, $attname)) { unset($attary{$attname}); continue; } } } } /** * Remove any backslashes, entities, or extraneous whitespace. */ tln_defang($attvalue); tln_unspace($attvalue); /** * Now let's run checks on the attvalues. * I don't expect anyone to comprehend this. If you do, * get in touch with me so I can drive to where you live and * shake your hand personally. :) */ foreach ($bad_attvals as $matchtag => $matchattrs) { if (preg_match($matchtag, $tagname)) { foreach ($matchattrs as $matchattr => $valary) { if (preg_match($matchattr, $attname)) { /** * There are two arrays in valary. * First is matches. * Second one is replacements */ list($valmatch, $valrepl) = $valary; $newvalue = preg_replace($valmatch, $valrepl, $attvalue); if ($newvalue != $attvalue) { $attary{$attname} = $newvalue; } } } } } } /** * See if we need to append any attributes to this tag. */ foreach ($add_attr_to_tag as $matchtag => $addattary) { if (preg_match($matchtag, $tagname)) { $attary = array_merge($attary, $addattary); } } return $attary; } /** * * @param string $body The HTML you wish to filter * @param array $tag_list see description above * @param array $rm_tags_with_content see description above * @param array $self_closing_tags see description above * @param boolean $force_tag_closing see description above * @param array $rm_attnames see description above * @param array $bad_attvals see description above * @param array $add_attr_to_tag see description above * @return string Sanitized html safe to show on your pages. */ function tln_sanitize( $body, $tag_list, $rm_tags_with_content, $self_closing_tags, $force_tag_closing, $rm_attnames, $bad_attvals, $add_attr_to_tag ) { /** * Normalize rm_tags and rm_tags_with_content. */ $rm_tags = array_shift($tag_list); @array_walk($tag_list, 'tln_casenormalize'); @array_walk($rm_tags_with_content, 'tln_casenormalize'); @array_walk($self_closing_tags, 'tln_casenormalize'); /** * See if tag_list is of tags to remove or tags to allow. * false means remove these tags * true means allow these tags */ $curpos = 0; $open_tags = array(); $trusted = "<!-- begin tln_sanitized html -->\n"; $skip_content = false; /** * Take care of netscape's stupid javascript entities like * &{alert('boo')}; */ $body = preg_replace('/&(\{.*?\};)/si', '&\\1', $body); while (($curtag = tln_getnxtag($body, $curpos)) != false) { list($tagname, $attary, $tagtype, $lt, $gt) = $curtag; $free_content = substr($body, $curpos, $lt - $curpos); if ($skip_content == false) { $trusted .= $free_content; } else { } if ($tagname != false) { if ($tagtype == 2) { if ($skip_content == $tagname) { /** * Got to the end of tag we needed to remove. */ $tagname = false; $skip_content = false; } else { if ($skip_content == false) { if (isset($open_tags{$tagname}) && $open_tags{$tagname} > 0 ) { $open_tags{$tagname}--; } else { $tagname = false; } } else { } } } else { /** * $rm_tags_with_content */ if ($skip_content == false) { /** * See if this is a self-closing type and change * tagtype appropriately. */ if ($tagtype == 1 && in_array($tagname, $self_closing_tags) ) { $tagtype = 3; } /** * See if we should skip this tag and any content * inside it. */ if ($tagtype == 1 && in_array($tagname, $rm_tags_with_content) ) { $skip_content = $tagname; } else { if (($rm_tags == false && in_array($tagname, $tag_list)) || ($rm_tags == true && !in_array($tagname, $tag_list)) ) { $tagname = false; } else { if ($tagtype == 1) { if (isset($open_tags{$tagname})) { $open_tags{$tagname}++; } else { $open_tags{$tagname} = 1; } } /** * This is where we run other checks. */ if (is_array($attary) && sizeof($attary) > 0) { $attary = tln_fixatts( $tagname, $attary, $rm_attnames, $bad_attvals, $add_attr_to_tag ); } } } } else { } } if ($tagname != false && $skip_content == false) { $trusted .= tln_tagprint($tagname, $attary, $tagtype); } } else { } $curpos = $gt + 1; } $trusted .= substr($body, $curpos, strlen($body) - $curpos); if ($force_tag_closing == true) { foreach ($open_tags as $tagname => $opentimes) { while ($opentimes > 0) { $trusted .= '</' . $tagname . '>'; $opentimes--; } } $trusted .= "\n"; } $trusted .= "<!-- end tln_sanitized html -->\n"; return $trusted; } // // Use the nifty htmlfilter library // function HTMLFilter($body, $trans_image_path, $block_external_images = false) { $tag_list = array( false, "object", "meta", "html", "head", "base", "link", "frame", "iframe", "plaintext", "marquee" ); $rm_tags_with_content = array( "script", "applet", "embed", "title", "frameset", "xmp", "xml" ); $self_closing_tags = array( "img", "br", "hr", "input", "outbind" ); $force_tag_closing = true; $rm_attnames = array( "/.*/" => array( // "/target/i", "/^on.*/i", "/^dynsrc/i", "/^data.*/i", "/^lowsrc.*/i" ) ); $bad_attvals = array( "/.*/" => array( "/^src|background/i" => array( array( '/^([\'"])\s*\S+script\s*:.*([\'"])/si', '/^([\'"])\s*mocha\s*:*.*([\'"])/si', '/^([\'"])\s*about\s*:.*([\'"])/si' ), array( "\\1$trans_image_path\\2", "\\1$trans_image_path\\2", "\\1$trans_image_path\\2", "\\1$trans_image_path\\2" ) ), "/^href|action/i" => array( array( '/^([\'"])\s*\S+script\s*:.*([\'"])/si', '/^([\'"])\s*mocha\s*:*.*([\'"])/si', '/^([\'"])\s*about\s*:.*([\'"])/si' ), array( "\\1#\\1", "\\1#\\1", "\\1#\\1", "\\1#\\1" ) ), "/^style/i" => array( array( "/expression/i", "/binding/i", "/behaviou*r/i", "/include-source/i", '/position\s*:\s*absolute/i', '/url\s*\(\s*([\'"])\s*\S+script\s*:.*([\'"])\s*\)/si', '/url\s*\(\s*([\'"])\s*mocha\s*:.*([\'"])\s*\)/si', '/url\s*\(\s*([\'"])\s*about\s*:.*([\'"])\s*\)/si', '/(.*)\s*:\s*url\s*\(\s*([\'"]*)\s*\S+script\s*:.*([\'"]*)\s*\)/si' ), array( "idiocy", "idiocy", "idiocy", "idiocy", "", "url(\\1#\\1)", "url(\\1#\\1)", "url(\\1#\\1)", "url(\\1#\\1)", "url(\\1#\\1)", "\\1:url(\\2#\\3)" ) ) ) ); if ($block_external_images) { array_push( $bad_attvals{'/.*/'}{'/^src|background/i'}[0], '/^([\'\"])\s*https*:.*([\'\"])/si' ); array_push( $bad_attvals{'/.*/'}{'/^src|background/i'}[1], "\\1$trans_image_path\\1" ); array_push( $bad_attvals{'/.*/'}{'/^style/i'}[0], '/url\(([\'\"])\s*https*:.*([\'\"])\)/si' ); array_push( $bad_attvals{'/.*/'}{'/^style/i'}[1], "url(\\1$trans_image_path\\1)" ); } $add_attr_to_tag = array( "/^a$/i" => array('target' => '"_blank"') ); $trusted = tln_sanitize( $body, $tag_list, $rm_tags_with_content, $self_closing_tags, $force_tag_closing, $rm_attnames, $bad_attvals, $add_attr_to_tag ); return $trusted; } PK���\�y ��Z�Z?libraries/vendor/phpmailer/phpmailer/extras/class.html2text.phpnu�[���<?php /************************************************************************* * * * Converts HTML to formatted plain text * * * * Portions Copyright (c) 2005-2007 Jon Abernathy <jon@chuggnutt.com> * * * * This script is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * The GNU General Public License can be found at * * http://www.gnu.org/copyleft/gpl.html. * * * * This script is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * *************************************************************************/ /** * Converts HTML to formatted plain text */ class Html2Text { /** * Contains the HTML content to convert. * * @type string */ protected $html; /** * Contains the converted, formatted text. * * @type string */ protected $text; /** * Maximum width of the formatted text, in columns. * * Set this value to 0 (or less) to ignore word wrapping * and not constrain text to a fixed-width column. * * @type integer */ protected $width = 70; /** * List of preg* regular expression patterns to search for, * used in conjunction with $replace. * * @type array * @see $replace */ protected $search = array( "/\r/", // Non-legal carriage return "/[\n\t]+/", // Newlines and tabs '/<head[^>]*>.*?<\/head>/i', // <head> '/<script[^>]*>.*?<\/script>/i', // <script>s -- which strip_tags supposedly has problems with '/<style[^>]*>.*?<\/style>/i', // <style>s -- which strip_tags supposedly has problems with '/<p[^>]*>/i', // <P> '/<br[^>]*>/i', // <br> '/<i[^>]*>(.*?)<\/i>/i', // <i> '/<em[^>]*>(.*?)<\/em>/i', // <em> '/(<ul[^>]*>|<\/ul>)/i', // <ul> and </ul> '/(<ol[^>]*>|<\/ol>)/i', // <ol> and </ol> '/(<dl[^>]*>|<\/dl>)/i', // <dl> and </dl> '/<li[^>]*>(.*?)<\/li>/i', // <li> and </li> '/<dd[^>]*>(.*?)<\/dd>/i', // <dd> and </dd> '/<dt[^>]*>(.*?)<\/dt>/i', // <dt> and </dt> '/<li[^>]*>/i', // <li> '/<hr[^>]*>/i', // <hr> '/<div[^>]*>/i', // <div> '/(<table[^>]*>|<\/table>)/i', // <table> and </table> '/(<tr[^>]*>|<\/tr>)/i', // <tr> and </tr> '/<td[^>]*>(.*?)<\/td>/i', // <td> and </td> '/<span class="_html2text_ignore">.+?<\/span>/i' // <span class="_html2text_ignore">...</span> ); /** * List of pattern replacements corresponding to patterns searched. * * @type array * @see $search */ protected $replace = array( '', // Non-legal carriage return ' ', // Newlines and tabs '', // <head> '', // <script>s -- which strip_tags supposedly has problems with '', // <style>s -- which strip_tags supposedly has problems with "\n\n", // <P> "\n", // <br> '_\\1_', // <i> '_\\1_', // <em> "\n\n", // <ul> and </ul> "\n\n", // <ol> and </ol> "\n\n", // <dl> and </dl> "\t* \\1\n", // <li> and </li> " \\1\n", // <dd> and </dd> "\t* \\1", // <dt> and </dt> "\n\t* ", // <li> "\n-------------------------\n", // <hr> "<div>\n", // <div> "\n\n", // <table> and </table> "\n", // <tr> and </tr> "\t\t\\1\n", // <td> and </td> "" // <span class="_html2text_ignore">...</span> ); /** * List of preg* regular expression patterns to search for, * used in conjunction with $ent_replace. * * @type array * @see $ent_replace */ protected $ent_search = array( '/&(nbsp|#160);/i', // Non-breaking space '/&(quot|rdquo|ldquo|#8220|#8221|#147|#148);/i', // Double quotes '/&(apos|rsquo|lsquo|#8216|#8217);/i', // Single quotes '/>/i', // Greater-than '/</i', // Less-than '/&(copy|#169);/i', // Copyright '/&(trade|#8482|#153);/i', // Trademark '/&(reg|#174);/i', // Registered '/&(mdash|#151|#8212);/i', // mdash '/&(ndash|minus|#8211|#8722);/i', // ndash '/&(bull|#149|#8226);/i', // Bullet '/&(pound|#163);/i', // Pound sign '/&(euro|#8364);/i', // Euro sign '/&(amp|#38);/i', // Ampersand: see _converter() '/[ ]{2,}/', // Runs of spaces, post-handling ); /** * List of pattern replacements corresponding to patterns searched. * * @type array * @see $ent_search */ protected $ent_replace = array( ' ', // Non-breaking space '"', // Double quotes "'", // Single quotes '>', '<', '(c)', '(tm)', '(R)', '--', '-', '*', '£', 'EUR', // Euro sign. € ? '|+|amp|+|', // Ampersand: see _converter() ' ', // Runs of spaces, post-handling ); /** * List of preg* regular expression patterns to search for * and replace using callback function. * * @type array */ protected $callback_search = array( '/<(a) [^>]*href=("|\')([^"\']+)\2([^>]*)>(.*?)<\/a>/i', // <a href=""> '/<(h)[123456]( [^>]*)?>(.*?)<\/h[123456]>/i', // h1 - h6 '/<(b)( [^>]*)?>(.*?)<\/b>/i', // <b> '/<(strong)( [^>]*)?>(.*?)<\/strong>/i', // <strong> '/<(th)( [^>]*)?>(.*?)<\/th>/i', // <th> and </th> ); /** * List of preg* regular expression patterns to search for in PRE body, * used in conjunction with $pre_replace. * * @type array * @see $pre_replace */ protected $pre_search = array( "/\n/", "/\t/", '/ /', '/<pre[^>]*>/', '/<\/pre>/' ); /** * List of pattern replacements corresponding to patterns searched for PRE body. * * @type array * @see $pre_search */ protected $pre_replace = array( '<br>', ' ', ' ', '', '' ); /** * Temporary workspace used during PRE processing. * * @type string */ protected $pre_content = ''; /** * Contains a list of HTML tags to allow in the resulting text. * * @type string * @see set_allowed_tags() */ protected $allowed_tags = ''; /** * Contains the base URL that relative links should resolve to. * * @type string */ protected $url; /** * Indicates whether content in the $html variable has been converted yet. * * @type boolean * @see $html, $text */ protected $_converted = false; /** * Contains URL addresses from links to be rendered in plain text. * * @type array * @see _build_link_list() */ protected $_link_list = array(); /** * Various configuration options (able to be set in the constructor) * * @type array */ protected $_options = array( // 'none' // 'inline' (show links inline) // 'nextline' (show links on the next line) // 'table' (if a table of link URLs should be listed after the text. 'do_links' => 'inline', // Maximum width of the formatted text, in columns. // Set this value to 0 (or less) to ignore word wrapping // and not constrain text to a fixed-width column. 'width' => 70, ); /** * Constructor. * * If the HTML source string (or file) is supplied, the class * will instantiate with that source propagated, all that has * to be done it to call get_text(). * * @param string $source HTML content * @param boolean $from_file Indicates $source is a file to pull content from * @param array $options Set configuration options */ public function __construct($source = '', $from_file = false, $options = array()) { $this->_options = array_merge($this->_options, $options); if (!empty($source)) { $this->set_html($source, $from_file); } $this->set_base_url(); } /** * Loads source HTML into memory, either from $source string or a file. * * @param string $source HTML content * @param boolean $from_file Indicates $source is a file to pull content from */ public function set_html($source, $from_file = false) { if ($from_file && file_exists($source)) { $this->html = file_get_contents($source); } else { $this->html = $source; } $this->_converted = false; } /** * Returns the text, converted from HTML. * * @return string */ public function get_text() { if (!$this->_converted) { $this->_convert(); } return $this->text; } /** * Prints the text, converted from HTML. */ public function print_text() { print $this->get_text(); } /** * Alias to print_text(), operates identically. * * @see print_text() */ public function p() { print $this->get_text(); } /** * Sets the allowed HTML tags to pass through to the resulting text. * * Tags should be in the form "<p>", with no corresponding closing tag. * @param string $allowed_tags */ public function set_allowed_tags($allowed_tags = '') { if (!empty($allowed_tags)) { $this->allowed_tags = $allowed_tags; } } /** * Sets a base URL to handle relative links. * * @param string $url */ public function set_base_url($url = '') { if (empty($url)) { if (!empty($_SERVER['HTTP_HOST'])) { $this->url = 'http://' . $_SERVER['HTTP_HOST']; } else { $this->url = ''; } } else { // Strip any trailing slashes for consistency (relative // URLs may already start with a slash like "/file.html") if (substr($url, -1) == '/') { $url = substr($url, 0, -1); } $this->url = $url; } } /** * Workhorse function that does actual conversion (calls _converter() method). */ protected function _convert() { // Variables used for building the link list $this->_link_list = array(); $text = trim(stripslashes($this->html)); // Convert HTML to TXT $this->_converter($text); // Add link list if (!empty($this->_link_list)) { $text .= "\n\nLinks:\n------\n"; foreach ($this->_link_list as $idx => $url) { $text .= '[' . ($idx + 1) . '] ' . $url . "\n"; } } $this->text = $text; $this->_converted = true; } /** * Workhorse function that does actual conversion. * * First performs custom tag replacement specified by $search and * $replace arrays. Then strips any remaining HTML tags, reduces whitespace * and newlines to a readable format, and word wraps the text to * $this->_options['width'] characters. * * @param string $text Reference to HTML content string */ protected function _converter(&$text) { // Convert <BLOCKQUOTE> (before PRE!) $this->_convert_blockquotes($text); // Convert <PRE> $this->_convert_pre($text); // Run our defined tags search-and-replace $text = preg_replace($this->search, $this->replace, $text); // Run our defined tags search-and-replace with callback $text = preg_replace_callback($this->callback_search, array($this, '_preg_callback'), $text); // Strip any other HTML tags $text = strip_tags($text, $this->allowed_tags); // Run our defined entities/characters search-and-replace $text = preg_replace($this->ent_search, $this->ent_replace, $text); // Replace known html entities $text = html_entity_decode($text, ENT_QUOTES); // Remove unknown/unhandled entities (this cannot be done in search-and-replace block) $text = preg_replace('/&([a-zA-Z0-9]{2,6}|#[0-9]{2,4});/', '', $text); // Convert "|+|amp|+|" into "&", need to be done after handling of unknown entities // This properly handles situation of "&quot;" in input string $text = str_replace('|+|amp|+|', '&', $text); // Bring down number of empty lines to 2 max $text = preg_replace("/\n\s+\n/", "\n\n", $text); $text = preg_replace("/[\n]{3,}/", "\n\n", $text); // remove leading empty lines (can be produced by eg. P tag on the beginning) $text = ltrim($text, "\n"); // Wrap the text to a readable format // for PHP versions >= 4.0.2. Default width is 75 // If width is 0 or less, don't wrap the text. if ($this->_options['width'] > 0) { $text = wordwrap($text, $this->_options['width']); } } /** * Helper function called by preg_replace() on link replacement. * * Maintains an internal list of links to be displayed at the end of the * text, with numeric indices to the original point in the text they * appeared. Also makes an effort at identifying and handling absolute * and relative links. * * @param string $link URL of the link * @param string $display Part of the text to associate number with * @param null $link_override * @return string */ protected function _build_link_list($link, $display, $link_override = null) { $link_method = ($link_override) ? $link_override : $this->_options['do_links']; if ($link_method == 'none') { return $display; } // Ignored link types if (preg_match('!^(javascript:|mailto:|#)!i', $link)) { return $display; } if (preg_match('!^([a-z][a-z0-9.+-]+:)!i', $link)) { $url = $link; } else { $url = $this->url; if (substr($link, 0, 1) != '/') { $url .= '/'; } $url .= "$link"; } if ($link_method == 'table') { if (($index = array_search($url, $this->_link_list)) === false) { $index = count($this->_link_list); $this->_link_list[] = $url; } return $display . ' [' . ($index + 1) . ']'; } elseif ($link_method == 'nextline') { return $display . "\n[" . $url . ']'; } else { // link_method defaults to inline return $display . ' [' . $url . ']'; } } /** * Helper function for PRE body conversion. * * @param string $text HTML content */ protected function _convert_pre(&$text) { // get the content of PRE element while (preg_match('/<pre[^>]*>(.*)<\/pre>/ismU', $text, $matches)) { $this->pre_content = $matches[1]; // Run our defined tags search-and-replace with callback $this->pre_content = preg_replace_callback( $this->callback_search, array($this, '_preg_callback'), $this->pre_content ); // convert the content $this->pre_content = sprintf( '<div><br>%s<br></div>', preg_replace($this->pre_search, $this->pre_replace, $this->pre_content) ); // replace the content (use callback because content can contain $0 variable) $text = preg_replace_callback( '/<pre[^>]*>.*<\/pre>/ismU', array($this, '_preg_pre_callback'), $text, 1 ); // free memory $this->pre_content = ''; } } /** * Helper function for BLOCKQUOTE body conversion. * * @param string $text HTML content */ protected function _convert_blockquotes(&$text) { if (preg_match_all('/<\/*blockquote[^>]*>/i', $text, $matches, PREG_OFFSET_CAPTURE)) { $start = 0; $taglen = 0; $level = 0; $diff = 0; foreach ($matches[0] as $m) { if ($m[0][0] == '<' && $m[0][1] == '/') { $level--; if ($level < 0) { $level = 0; // malformed HTML: go to next blockquote } elseif ($level > 0) { // skip inner blockquote } else { $end = $m[1]; $len = $end - $taglen - $start; // Get blockquote content $body = substr($text, $start + $taglen - $diff, $len); // Set text width $p_width = $this->_options['width']; if ($this->_options['width'] > 0) $this->_options['width'] -= 2; // Convert blockquote content $body = trim($body); $this->_converter($body); // Add citation markers and create PRE block $body = preg_replace('/((^|\n)>*)/', '\\1> ', trim($body)); $body = '<pre>' . htmlspecialchars($body) . '</pre>'; // Re-set text width $this->_options['width'] = $p_width; // Replace content $text = substr($text, 0, $start - $diff) . $body . substr($text, $end + strlen($m[0]) - $diff); $diff = $len + $taglen + strlen($m[0]) - strlen($body); unset($body); } } else { if ($level == 0) { $start = $m[1]; $taglen = strlen($m[0]); } $level++; } } } } /** * Callback function for preg_replace_callback use. * * @param array $matches PREG matches * @return string */ protected function _preg_callback($matches) { switch (strtolower($matches[1])) { case 'b': case 'strong': return $this->_toupper($matches[3]); case 'th': return $this->_toupper("\t\t" . $matches[3] . "\n"); case 'h': return $this->_toupper("\n\n" . $matches[3] . "\n\n"); case 'a': // override the link method $link_override = null; if (preg_match('/_html2text_link_(\w+)/', $matches[4], $link_override_match)) { $link_override = $link_override_match[1]; } // Remove spaces in URL (#1487805) $url = str_replace(' ', '', $matches[3]); return $this->_build_link_list($url, $matches[5], $link_override); } return ''; } /** * Callback function for preg_replace_callback use in PRE content handler. * * @param array $matches PREG matches * @return string */ protected function _preg_pre_callback( /** @noinspection PhpUnusedParameterInspection */ $matches) { return $this->pre_content; } /** * Strtoupper function with HTML tags and entities handling. * * @param string $str Text to convert * @return string Converted text */ private function _toupper($str) { // string can contain HTML tags $chunks = preg_split('/(<[^>]*>)/', $str, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); // convert toupper only the text between HTML tags foreach ($chunks as $idx => $chunk) { if ($chunk[0] != '<') { $chunks[$idx] = $this->_strtoupper($chunk); } } return implode($chunks); } /** * Strtoupper multibyte wrapper function with HTML entities handling. * Forces mb_strtoupper-call to UTF-8. * * @param string $str Text to convert * @return string Converted text */ private function _strtoupper($str) { $str = html_entity_decode($str, ENT_COMPAT); if (function_exists('mb_strtoupper')) $str = mb_strtoupper($str, 'UTF-8'); else $str = strtoupper($str); $str = htmlspecialchars($str, ENT_COMPAT); return $str; } } PK���\<�\���<libraries/vendor/phpmailer/phpmailer/extras/EasyPeasyICS.phpnu�[���<?php /* ------------------------------------------------------------------------ */ /* EasyPeasyICS /* ------------------------------------------------------------------------ */ /* Manuel Reinhard, manu@sprain.ch /* Twitter: @sprain /* Web: www.sprain.ch /* /* Built with inspiration by /" http://stackoverflow.com/questions/1463480/how-can-i-use-php-to-dynamically-publish-an-ical-file-to-be-read-by-google-calend/1464355#1464355 /* ------------------------------------------------------------------------ */ /* History: /* 2010/12/17 - Manuel Reinhard - when it all started /* ------------------------------------------------------------------------ */ class EasyPeasyICS { protected $calendarName; protected $events = array(); /** * Constructor * @param string $calendarName */ public function __construct($calendarName=""){ $this->calendarName = $calendarName; }//function /** * Add event to calendar * @param string $calendarName */ public function addEvent($start, $end, $summary="", $description="", $url=""){ $this->events[] = array( "start" => $start, "end" => $end, "summary" => $summary, "description" => $description, "url" => $url ); }//function public function render($output = true){ //start Variable $ics = ""; //Add header $ics .= "BEGIN:VCALENDAR METHOD:PUBLISH VERSION:2.0 X-WR-CALNAME:".$this->calendarName." PRODID:-//hacksw/handcal//NONSGML v1.0//EN"; //Add events foreach($this->events as $event){ $ics .= " BEGIN:VEVENT UID:". md5(uniqid(mt_rand(), true)) ."@EasyPeasyICS.php DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z DTSTART:".gmdate('Ymd', $event["start"])."T".gmdate('His', $event["start"])."Z DTEND:".gmdate('Ymd', $event["end"])."T".gmdate('His', $event["end"])."Z SUMMARY:".str_replace("\n", "\\n", $event['summary'])." DESCRIPTION:".str_replace("\n", "\\n", $event['description'])." URL;VALUE=URI:".$event['url']." END:VEVENT"; }//foreach //Footer $ics .= " END:VCALENDAR"; if ($output) { //Output header('Content-type: text/calendar; charset=utf-8'); header('Content-Disposition: inline; filename='.$this->calendarName.'.ics'); echo $ics; } else { return $ics; } }//function }//classPK���\P�gmm@libraries/vendor/phpmailer/phpmailer/extras/ntlm_sasl_client.phpnu�[���<?php /* * ntlm_sasl_client.php * * @(#) $Id: ntlm_sasl_client.php,v 1.3 2004/11/17 08:00:37 mlemos Exp $ * ** ** Source: http://www.phpclasses.org/browse/file/7495.html ** License: BSD (http://www.phpclasses.org/package/1888-PHP-Single-API-for-standard-authentication-mechanisms.html) ** Bundled with Permission ** */ define("SASL_NTLM_STATE_START", 0); define("SASL_NTLM_STATE_IDENTIFY_DOMAIN", 1); define("SASL_NTLM_STATE_RESPOND_CHALLENGE", 2); define("SASL_NTLM_STATE_DONE", 3); class ntlm_sasl_client_class { var $credentials=array(); var $state=SASL_NTLM_STATE_START; Function Initialize(&$client) { if(!function_exists($function="mcrypt_encrypt") || !function_exists($function="mhash")) { $extensions=array( "mcrypt_encrypt"=>"mcrypt", "mhash"=>"mhash" ); $client->error="the extension ".$extensions[$function]." required by the NTLM SASL client class is not available in this PHP configuration"; return(0); } return(1); } Function ASCIIToUnicode($ascii) { for($unicode="",$a=0;$a<strlen($ascii);$a++) $unicode.=substr($ascii,$a,1).chr(0); return($unicode); } Function TypeMsg1($domain,$workstation) { $domain_length=strlen($domain); $workstation_length=strlen($workstation); $workstation_offset=32; $domain_offset=$workstation_offset+$workstation_length; return( "NTLMSSP\0". "\x01\x00\x00\x00". "\x07\x32\x00\x00". pack("v",$domain_length). pack("v",$domain_length). pack("V",$domain_offset). pack("v",$workstation_length). pack("v",$workstation_length). pack("V",$workstation_offset). $workstation. $domain ); } Function NTLMResponse($challenge,$password) { $unicode=$this->ASCIIToUnicode($password); $md4=mhash(MHASH_MD4,$unicode); $padded=$md4.str_repeat(chr(0),21-strlen($md4)); $iv_size=mcrypt_get_iv_size(MCRYPT_DES,MCRYPT_MODE_ECB); $iv=mcrypt_create_iv($iv_size,MCRYPT_RAND); for($response="",$third=0;$third<21;$third+=7) { for($packed="",$p=$third;$p<$third+7;$p++) $packed.=str_pad(decbin(ord(substr($padded,$p,1))),8,"0",STR_PAD_LEFT); for($key="",$p=0;$p<strlen($packed);$p+=7) { $s=substr($packed,$p,7); $b=$s.((substr_count($s,"1") % 2) ? "0" : "1"); $key.=chr(bindec($b)); } $ciphertext=mcrypt_encrypt(MCRYPT_DES,$key,$challenge,MCRYPT_MODE_ECB,$iv); $response.=$ciphertext; } return $response; } Function TypeMsg3($ntlm_response,$user,$domain,$workstation) { $domain_unicode=$this->ASCIIToUnicode($domain); $domain_length=strlen($domain_unicode); $domain_offset=64; $user_unicode=$this->ASCIIToUnicode($user); $user_length=strlen($user_unicode); $user_offset=$domain_offset+$domain_length; $workstation_unicode=$this->ASCIIToUnicode($workstation); $workstation_length=strlen($workstation_unicode); $workstation_offset=$user_offset+$user_length; $lm=""; $lm_length=strlen($lm); $lm_offset=$workstation_offset+$workstation_length; $ntlm=$ntlm_response; $ntlm_length=strlen($ntlm); $ntlm_offset=$lm_offset+$lm_length; $session=""; $session_length=strlen($session); $session_offset=$ntlm_offset+$ntlm_length; return( "NTLMSSP\0". "\x03\x00\x00\x00". pack("v",$lm_length). pack("v",$lm_length). pack("V",$lm_offset). pack("v",$ntlm_length). pack("v",$ntlm_length). pack("V",$ntlm_offset). pack("v",$domain_length). pack("v",$domain_length). pack("V",$domain_offset). pack("v",$user_length). pack("v",$user_length). pack("V",$user_offset). pack("v",$workstation_length). pack("v",$workstation_length). pack("V",$workstation_offset). pack("v",$session_length). pack("v",$session_length). pack("V",$session_offset). "\x01\x02\x00\x00". $domain_unicode. $user_unicode. $workstation_unicode. $lm. $ntlm ); } Function Start(&$client, &$message, &$interactions) { if($this->state!=SASL_NTLM_STATE_START) { $client->error="NTLM authentication state is not at the start"; return(SASL_FAIL); } $this->credentials=array( "user"=>"", "password"=>"", "realm"=>"", "workstation"=>"" ); $defaults=array(); $status=$client->GetCredentials($this->credentials,$defaults,$interactions); if($status==SASL_CONTINUE) $this->state=SASL_NTLM_STATE_IDENTIFY_DOMAIN; Unset($message); return($status); } Function Step(&$client, $response, &$message, &$interactions) { switch($this->state) { case SASL_NTLM_STATE_IDENTIFY_DOMAIN: $message=$this->TypeMsg1($this->credentials["realm"],$this->credentials["workstation"]); $this->state=SASL_NTLM_STATE_RESPOND_CHALLENGE; break; case SASL_NTLM_STATE_RESPOND_CHALLENGE: $ntlm_response=$this->NTLMResponse(substr($response,24,8),$this->credentials["password"]); $message=$this->TypeMsg3($ntlm_response,$this->credentials["user"],$this->credentials["realm"],$this->credentials["workstation"]); $this->state=SASL_NTLM_STATE_DONE; break; case SASL_NTLM_STATE_DONE: $client->error="NTLM authentication was finished without success"; return(SASL_FAIL); default: $client->error="invalid NTLM authentication step state"; return(SASL_FAIL); } return(SASL_CONTINUE); } }; ?>PK���\��6����8libraries/vendor/phpmailer/phpmailer/class.phpmailer.phpnu�[���<?php /** * PHPMailer - PHP email creation and transport class. * PHP Version 5 * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) * @copyright 2012 - 2014 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. */ /** * PHPMailer - PHP email creation and transport class. * @package PHPMailer * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) */ class PHPMailer { /** * The PHPMailer Version number. * @type string */ public $Version = '5.2.9'; /** * Email priority. * Options: 1 = High, 3 = Normal, 5 = low. * @type integer */ public $Priority = 3; /** * The character set of the message. * @type string */ public $CharSet = 'iso-8859-1'; /** * The MIME Content-type of the message. * @type string */ public $ContentType = 'text/plain'; /** * The message encoding. * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". * @type string */ public $Encoding = '8bit'; /** * Holds the most recent mailer error message. * @type string */ public $ErrorInfo = ''; /** * The From email address for the message. * @type string */ public $From = 'root@localhost'; /** * The From name of the message. * @type string */ public $FromName = 'Root User'; /** * The Sender email (Return-Path) of the message. * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. * @type string */ public $Sender = ''; /** * The Return-Path of the message. * If empty, it will be set to either From or Sender. * @type string * @deprecated Email senders should never set a return-path header; * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything. * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference */ public $ReturnPath = ''; /** * The Subject of the message. * @type string */ public $Subject = ''; /** * An HTML or plain text message body. * If HTML then call isHTML(true). * @type string */ public $Body = ''; /** * The plain-text message body. * This body can be read by mail clients that do not have HTML email * capability such as mutt & Eudora. * Clients that can read HTML will view the normal Body. * @type string */ public $AltBody = ''; /** * An iCal message part body. * Only supported in simple alt or alt_inline message types * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ * @link http://kigkonsult.se/iCalcreator/ * @type string */ public $Ical = ''; /** * The complete compiled MIME message body. * @access protected * @type string */ protected $MIMEBody = ''; /** * The complete compiled MIME message headers. * @type string * @access protected */ protected $MIMEHeader = ''; /** * Extra headers that createHeader() doesn't fold in. * @type string * @access protected */ protected $mailHeader = ''; /** * Word-wrap the message body to this number of chars. * @type integer */ public $WordWrap = 0; /** * Which method to use to send mail. * Options: "mail", "sendmail", or "smtp". * @type string */ public $Mailer = 'mail'; /** * The path to the sendmail program. * @type string */ public $Sendmail = '/usr/sbin/sendmail'; /** * Whether mail() uses a fully sendmail-compatible MTA. * One which supports sendmail's "-oi -f" options. * @type boolean */ public $UseSendmailOptions = true; /** * Path to PHPMailer plugins. * Useful if the SMTP class is not in the PHP include path. * @type string * @deprecated Should not be needed now there is an autoloader. */ public $PluginDir = ''; /** * The email address that a reading confirmation should be sent to. * @type string */ public $ConfirmReadingTo = ''; /** * The hostname to use in Message-Id and Received headers * and as default HELO string. * If empty, the value returned * by SERVER_NAME is used or 'localhost.localdomain'. * @type string */ public $Hostname = ''; /** * An ID to be used in the Message-Id header. * If empty, a unique id will be generated. * @type string */ public $MessageID = ''; /** * The message Date to be used in the Date header. * If empty, the current date will be added. * @type string */ public $MessageDate = ''; /** * SMTP hosts. * Either a single hostname or multiple semicolon-delimited hostnames. * You can also specify a different port * for each host by using this format: [hostname:port] * (e.g. "smtp1.example.com:25;smtp2.example.com"). * You can also specify encryption type, for example: * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). * Hosts will be tried in order. * @type string */ public $Host = 'localhost'; /** * The default SMTP server port. * @type integer * @TODO Why is this needed when the SMTP class takes care of it? */ public $Port = 25; /** * The SMTP HELO of the message. * Default is $Hostname. * @type string * @see PHPMailer::$Hostname */ public $Helo = ''; /** * The secure connection prefix. * Options: "", "ssl" or "tls" * @type string */ public $SMTPSecure = ''; /** * Whether to use SMTP authentication. * Uses the Username and Password properties. * @type boolean * @see PHPMailer::$Username * @see PHPMailer::$Password */ public $SMTPAuth = false; /** * SMTP username. * @type string */ public $Username = ''; /** * SMTP password. * @type string */ public $Password = ''; /** * SMTP auth type. * Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5 * @type string */ public $AuthType = ''; /** * SMTP realm. * Used for NTLM auth * @type string */ public $Realm = ''; /** * SMTP workstation. * Used for NTLM auth * @type string */ public $Workstation = ''; /** * The SMTP server timeout in seconds. * @type integer */ public $Timeout = 10; /** * SMTP class debug output mode. * Debug output level. * Options: * * `0` No output * * `1` Commands * * `2` Data and commands * * `3` As 2 plus connection status * * `4` Low-level data output * @type integer * @see SMTP::$do_debug */ public $SMTPDebug = 0; /** * How to handle debug output. * Options: * * `echo` Output plain-text as-is, appropriate for CLI * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output * * `error_log` Output to error log as configured in php.ini * * Alternatively, you can provide a callable expecting two params: a message string and the debug level: * <code> * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; * </code> * @type string|callable * @see SMTP::$Debugoutput */ public $Debugoutput = 'echo'; /** * Whether to keep SMTP connection open after each message. * If this is set to true then to close the connection * requires an explicit call to smtpClose(). * @type boolean */ public $SMTPKeepAlive = false; /** * Whether to split multiple to addresses into multiple messages * or send them all in one message. * @type boolean */ public $SingleTo = false; /** * Storage for addresses when SingleTo is enabled. * @type array * @TODO This should really not be public */ public $SingleToArray = array(); /** * Whether to generate VERP addresses on send. * Only applicable when sending via SMTP. * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path * @link http://www.postfix.org/VERP_README.html Postfix VERP info * @type boolean */ public $do_verp = false; /** * Whether to allow sending messages with an empty body. * @type boolean */ public $AllowEmpty = false; /** * The default line ending. * @note The default remains "\n". We force CRLF where we know * it must be used via self::CRLF. * @type string */ public $LE = "\n"; /** * DKIM selector. * @type string */ public $DKIM_selector = ''; /** * DKIM Identity. * Usually the email address used as the source of the email * @type string */ public $DKIM_identity = ''; /** * DKIM passphrase. * Used if your key is encrypted. * @type string */ public $DKIM_passphrase = ''; /** * DKIM signing domain name. * @example 'example.com' * @type string */ public $DKIM_domain = ''; /** * DKIM private key file path. * @type string */ public $DKIM_private = ''; /** * Callback Action function name. * * The function that handles the result of the send email action. * It is called out by send() for each email sent. * * Value can be any php callable: http://www.php.net/is_callable * * Parameters: * boolean $result result of the send action * string $to email address of the recipient * string $cc cc email addresses * string $bcc bcc email addresses * string $subject the subject * string $body the email body * string $from email address of sender * @type string */ public $action_function = ''; /** * What to use in the X-Mailer header. * Options: null for default, whitespace for none, or a string to use * @type string */ public $XMailer = ''; /** * An instance of the SMTP sender class. * @type SMTP * @access protected */ protected $smtp = null; /** * The array of 'to' addresses. * @type array * @access protected */ protected $to = array(); /** * The array of 'cc' addresses. * @type array * @access protected */ protected $cc = array(); /** * The array of 'bcc' addresses. * @type array * @access protected */ protected $bcc = array(); /** * The array of reply-to names and addresses. * @type array * @access protected */ protected $ReplyTo = array(); /** * An array of all kinds of addresses. * Includes all of $to, $cc, $bcc, $replyto * @type array * @access protected */ protected $all_recipients = array(); /** * The array of attachments. * @type array * @access protected */ protected $attachment = array(); /** * The array of custom headers. * @type array * @access protected */ protected $CustomHeader = array(); /** * The most recent Message-ID (including angular brackets). * @type string * @access protected */ protected $lastMessageID = ''; /** * The message's MIME type. * @type string * @access protected */ protected $message_type = ''; /** * The array of MIME boundary strings. * @type array * @access protected */ protected $boundary = array(); /** * The array of available languages. * @type array * @access protected */ protected $language = array(); /** * The number of errors encountered. * @type integer * @access protected */ protected $error_count = 0; /** * The S/MIME certificate file path. * @type string * @access protected */ protected $sign_cert_file = ''; /** * The S/MIME key file path. * @type string * @access protected */ protected $sign_key_file = ''; /** * The S/MIME password for the key. * Used only if the key is encrypted. * @type string * @access protected */ protected $sign_key_pass = ''; /** * Whether to throw exceptions for errors. * @type boolean * @access protected */ protected $exceptions = false; /** * Error severity: message only, continue processing. */ const STOP_MESSAGE = 0; /** * Error severity: message, likely ok to continue processing. */ const STOP_CONTINUE = 1; /** * Error severity: message, plus full stop, critical error reached. */ const STOP_CRITICAL = 2; /** * SMTP RFC standard line ending. */ const CRLF = "\r\n"; /** * Constructor. * @param boolean $exceptions Should we throw external exceptions? */ public function __construct($exceptions = false) { $this->exceptions = ($exceptions == true); } /** * Destructor. */ public function __destruct() { if ($this->Mailer == 'smtp') { //close any open SMTP connection nicely $this->smtpClose(); } } /** * Call mail() in a safe_mode-aware fashion. * Also, unless sendmail_path points to sendmail (or something that * claims to be sendmail), don't pass params (not a perfect fix, * but it will do) * @param string $to To * @param string $subject Subject * @param string $body Message Body * @param string $header Additional Header(s) * @param string $params Params * @access private * @return boolean */ private function mailPassthru($to, $subject, $body, $header, $params) { //Check overloading of mail function to avoid double-encoding if (ini_get('mbstring.func_overload') & 1) { $subject = $this->secureHeader($subject); } else { $subject = $this->encodeHeader($this->secureHeader($subject)); } if (ini_get('safe_mode') || !($this->UseSendmailOptions)) { $result = @mail($to, $subject, $body, $header); } else { $result = @mail($to, $subject, $body, $header, $params); } return $result; } /** * Output debugging info via user-defined method. * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug). * @see PHPMailer::$Debugoutput * @see PHPMailer::$SMTPDebug * @param string $str */ protected function edebug($str) { if ($this->SMTPDebug <= 0) { return; } if (is_callable($this->Debugoutput)) { call_user_func($this->Debugoutput, $str, $this->SMTPDebug); return; } switch ($this->Debugoutput) { case 'error_log': //Don't output, just log error_log($str); break; case 'html': //Cleans up output a bit for a better looking, HTML-safe output echo htmlentities( preg_replace('/[\r\n]+/', '', $str), ENT_QUOTES, 'UTF-8' ) . "<br>\n"; break; case 'echo': default: //Normalize line breaks $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str); echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( "\n", "\n \t ", trim($str) ) . "\n"; } } /** * Sets message type to HTML or plain. * @param boolean $isHtml True for HTML mode. * @return void */ public function isHTML($isHtml = true) { if ($isHtml) { $this->ContentType = 'text/html'; } else { $this->ContentType = 'text/plain'; } } /** * Send messages using SMTP. * @return void */ public function isSMTP() { $this->Mailer = 'smtp'; } /** * Send messages using PHP's mail() function. * @return void */ public function isMail() { $this->Mailer = 'mail'; } /** * Send messages using $Sendmail. * @return void */ public function isSendmail() { $ini_sendmail_path = ini_get('sendmail_path'); if (!stristr($ini_sendmail_path, 'sendmail')) { $this->Sendmail = '/usr/sbin/sendmail'; } else { $this->Sendmail = $ini_sendmail_path; } $this->Mailer = 'sendmail'; } /** * Send messages using qmail. * @return void */ public function isQmail() { $ini_sendmail_path = ini_get('sendmail_path'); if (!stristr($ini_sendmail_path, 'qmail')) { $this->Sendmail = '/var/qmail/bin/qmail-inject'; } else { $this->Sendmail = $ini_sendmail_path; } $this->Mailer = 'qmail'; } /** * Add a "To" address. * @param string $address * @param string $name * @return boolean true on success, false if address already used */ public function addAddress($address, $name = '') { return $this->addAnAddress('to', $address, $name); } /** * Add a "CC" address. * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. * @param string $address * @param string $name * @return boolean true on success, false if address already used */ public function addCC($address, $name = '') { return $this->addAnAddress('cc', $address, $name); } /** * Add a "BCC" address. * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. * @param string $address * @param string $name * @return boolean true on success, false if address already used */ public function addBCC($address, $name = '') { return $this->addAnAddress('bcc', $address, $name); } /** * Add a "Reply-to" address. * @param string $address * @param string $name * @return boolean */ public function addReplyTo($address, $name = '') { return $this->addAnAddress('Reply-To', $address, $name); } /** * Add an address to one of the recipient arrays. * Addresses that have been added already return false, but do not throw exceptions * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo' * @param string $address The email address to send to * @param string $name * @throws phpmailerException * @return boolean true on success, false if address already used or invalid in some way * @access protected */ protected function addAnAddress($kind, $address, $name = '') { if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) { $this->setError($this->lang('Invalid recipient array') . ': ' . $kind); $this->edebug($this->lang('Invalid recipient array') . ': ' . $kind); if ($this->exceptions) { throw new phpmailerException('Invalid recipient array: ' . $kind); } return false; } $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!$this->validateAddress($address)) { $this->setError($this->lang('invalid_address') . ': ' . $address); $this->edebug($this->lang('invalid_address') . ': ' . $address); if ($this->exceptions) { throw new phpmailerException($this->lang('invalid_address') . ': ' . $address); } return false; } if ($kind != 'Reply-To') { if (!isset($this->all_recipients[strtolower($address)])) { array_push($this->$kind, array($address, $name)); $this->all_recipients[strtolower($address)] = true; return true; } } else { if (!array_key_exists(strtolower($address), $this->ReplyTo)) { $this->ReplyTo[strtolower($address)] = array($address, $name); return true; } } return false; } /** * Set the From and FromName properties. * @param string $address * @param string $name * @param boolean $auto Whether to also set the Sender address, defaults to true * @throws phpmailerException * @return boolean */ public function setFrom($address, $name = '', $auto = true) { $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!$this->validateAddress($address)) { $this->setError($this->lang('invalid_address') . ': ' . $address); $this->edebug($this->lang('invalid_address') . ': ' . $address); if ($this->exceptions) { throw new phpmailerException($this->lang('invalid_address') . ': ' . $address); } return false; } $this->From = $address; $this->FromName = $name; if ($auto) { if (empty($this->Sender)) { $this->Sender = $address; } } return true; } /** * Return the Message-ID header of the last email. * Technically this is the value from the last time the headers were created, * but it's also the message ID of the last sent message except in * pathological cases. * @return string */ public function getLastMessageID() { return $this->lastMessageID; } /** * Check that a string looks like an email address. * @param string $address The email address to check * @param string $patternselect A selector for the validation pattern to use : * * `auto` Pick strictest one automatically; * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; * * `pcre` Use old PCRE implementation; * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; same as pcre8 but does not allow 'dotless' domains; * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. * * `noregex` Don't use a regex: super fast, really dumb. * @return boolean * @static * @access public */ public static function validateAddress($address, $patternselect = 'auto') { if (!$patternselect or $patternselect == 'auto') { //Check this constant first so it works when extension_loaded() is disabled by safe mode //Constant was added in PHP 5.2.4 if (defined('PCRE_VERSION')) { //This pattern can get stuck in a recursive loop in PCRE <= 8.0.2 if (version_compare(PCRE_VERSION, '8.0.3') >= 0) { $patternselect = 'pcre8'; } else { $patternselect = 'pcre'; } } elseif (function_exists('extension_loaded') and extension_loaded('pcre')) { //Fall back to older PCRE $patternselect = 'pcre'; } else { //Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension if (version_compare(PHP_VERSION, '5.2.0') >= 0) { $patternselect = 'php'; } else { $patternselect = 'noregex'; } } } switch ($patternselect) { case 'pcre8': /** * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains. * @link http://squiloople.com/2009/12/20/email-address-validation/ * @copyright 2009-2010 Michael Rushton * Feel free to use and redistribute this code. But please keep this copyright notice. */ return (boolean)preg_match( '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', $address ); case 'pcre': //An older regex that doesn't need a recent PCRE return (boolean)preg_match( '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', $address ); case 'html5': /** * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) */ return (boolean)preg_match( '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', $address ); case 'noregex': //No PCRE! Do something _very_ approximate! //Check the address is 3 chars or longer and contains an @ that's not the first or last char return (strlen($address) >= 3 and strpos($address, '@') >= 1 and strpos($address, '@') != strlen($address) - 1); case 'php': default: return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL); } } /** * Create a message and send it. * Uses the sending method specified by $Mailer. * @throws phpmailerException * @return boolean false on error - See the ErrorInfo property for details of the error. */ public function send() { try { if (!$this->preSend()) { return false; } return $this->postSend(); } catch (phpmailerException $exc) { $this->mailHeader = ''; $this->setError($exc->getMessage()); if ($this->exceptions) { throw $exc; } return false; } } /** * Prepare a message for sending. * @throws phpmailerException * @return boolean */ public function preSend() { try { $this->mailHeader = ''; if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL); } // Set whether the message is multipart/alternative if (!empty($this->AltBody)) { $this->ContentType = 'multipart/alternative'; } $this->error_count = 0; // reset errors $this->setMessageType(); // Refuse to send an empty message unless we are specifically allowing it if (!$this->AllowEmpty and empty($this->Body)) { throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL); } $this->MIMEHeader = $this->createHeader(); $this->MIMEBody = $this->createBody(); // To capture the complete message when using mail(), create // an extra header list which createHeader() doesn't fold in if ($this->Mailer == 'mail') { if (count($this->to) > 0) { $this->mailHeader .= $this->addrAppend('To', $this->to); } else { $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); } $this->mailHeader .= $this->headerLine( 'Subject', $this->encodeHeader($this->secureHeader(trim($this->Subject))) ); } // Sign with DKIM if enabled if (!empty($this->DKIM_domain) && !empty($this->DKIM_private) && !empty($this->DKIM_selector) && !empty($this->DKIM_domain) && file_exists($this->DKIM_private)) { $header_dkim = $this->DKIM_Add( $this->MIMEHeader . $this->mailHeader, $this->encodeHeader($this->secureHeader($this->Subject)), $this->MIMEBody ); $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF . str_replace("\r\n", "\n", $header_dkim) . self::CRLF; } return true; } catch (phpmailerException $exc) { $this->setError($exc->getMessage()); if ($this->exceptions) { throw $exc; } return false; } } /** * Actually send a message. * Send the email via the selected mechanism * @throws phpmailerException * @return boolean */ public function postSend() { try { // Choose the mailer and send through it switch ($this->Mailer) { case 'sendmail': case 'qmail': return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); case 'smtp': return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); case 'mail': return $this->mailSend($this->MIMEHeader, $this->MIMEBody); default: $sendMethod = $this->Mailer.'Send'; if (method_exists($this, $sendMethod)) { return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); } return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } } catch (phpmailerException $exc) { $this->setError($exc->getMessage()); $this->edebug($exc->getMessage()); if ($this->exceptions) { throw $exc; } } return false; } /** * Send mail using the $Sendmail program. * @param string $header The message headers * @param string $body The message body * @see PHPMailer::$Sendmail * @throws phpmailerException * @access protected * @return boolean */ protected function sendmailSend($header, $body) { if ($this->Sender != '') { if ($this->Mailer == 'qmail') { $sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); } else { $sendmail = sprintf('%s -oi -f%s -t', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); } } else { if ($this->Mailer == 'qmail') { $sendmail = sprintf('%s', escapeshellcmd($this->Sendmail)); } else { $sendmail = sprintf('%s -oi -t', escapeshellcmd($this->Sendmail)); } } if ($this->SingleTo === true) { foreach ($this->SingleToArray as $toAddr) { if (!@$mail = popen($sendmail, 'w')) { throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } fputs($mail, 'To: ' . $toAddr . "\n"); fputs($mail, $header); fputs($mail, $body); $result = pclose($mail); $this->doCallback( ($result == 0), array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From ); if ($result != 0) { throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } } } else { if (!@$mail = popen($sendmail, 'w')) { throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } fputs($mail, $header); fputs($mail, $body); $result = pclose($mail); $this->doCallback(($result == 0), $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From); if ($result != 0) { throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } } return true; } /** * Send mail using the PHP mail() function. * @param string $header The message headers * @param string $body The message body * @link http://www.php.net/manual/en/book.mail.php * @throws phpmailerException * @access protected * @return boolean */ protected function mailSend($header, $body) { $toArr = array(); foreach ($this->to as $toaddr) { $toArr[] = $this->addrFormat($toaddr); } $to = implode(', ', $toArr); if (empty($this->Sender)) { $params = ' '; } else { $params = sprintf('-f%s', $this->Sender); } if ($this->Sender != '' and !ini_get('safe_mode')) { $old_from = ini_get('sendmail_from'); ini_set('sendmail_from', $this->Sender); } $result = false; if ($this->SingleTo === true && count($toArr) > 1) { foreach ($toArr as $toAddr) { $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); $this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From); } } else { $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From); } if (isset($old_from)) { ini_set('sendmail_from', $old_from); } if (!$result) { throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL); } return true; } /** * Get an instance to use for SMTP operations. * Override this function to load your own SMTP implementation * @return SMTP */ public function getSMTPInstance() { if (!is_object($this->smtp)) { $this->smtp = new SMTP; } return $this->smtp; } /** * Send mail via SMTP. * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. * Uses the PHPMailerSMTP class by default. * @see PHPMailer::getSMTPInstance() to use a different class. * @param string $header The message headers * @param string $body The message body * @throws phpmailerException * @uses SMTP * @access protected * @return boolean */ protected function smtpSend($header, $body) { $bad_rcpt = array(); if (!$this->smtpConnect()) { throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); } $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; if (!$this->smtp->mail($smtp_from)) { $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); } // Attempt to send to all recipients foreach ($this->to as $to) { if (!$this->smtp->recipient($to[0])) { $bad_rcpt[] = $to[0]; $isSent = false; } else { $isSent = true; } $this->doCallback($isSent, array($to[0]), array(), array(), $this->Subject, $body, $this->From); } foreach ($this->cc as $cc) { if (!$this->smtp->recipient($cc[0])) { $bad_rcpt[] = $cc[0]; $isSent = false; } else { $isSent = true; } $this->doCallback($isSent, array(), array($cc[0]), array(), $this->Subject, $body, $this->From); } foreach ($this->bcc as $bcc) { if (!$this->smtp->recipient($bcc[0])) { $bad_rcpt[] = $bcc[0]; $isSent = false; } else { $isSent = true; } $this->doCallback($isSent, array(), array(), array($bcc[0]), $this->Subject, $body, $this->From); } // Only send the DATA command if we have viable recipients if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) { throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL); } if ($this->SMTPKeepAlive == true) { $this->smtp->reset(); } else { $this->smtp->quit(); $this->smtp->close(); } if (count($bad_rcpt) > 0) { // Create error message for any bad addresses throw new phpmailerException( $this->lang('recipients_failed') . implode(', ', $bad_rcpt), self::STOP_CONTINUE ); } return true; } /** * Initiate a connection to an SMTP server. * Returns false if the operation failed. * @param array $options An array of options compatible with stream_context_create() * @uses SMTP * @access public * @throws phpmailerException * @return boolean */ public function smtpConnect($options = array()) { if (is_null($this->smtp)) { $this->smtp = $this->getSMTPInstance(); } // Already connected? if ($this->smtp->connected()) { return true; } $this->smtp->setTimeout($this->Timeout); $this->smtp->setDebugLevel($this->SMTPDebug); $this->smtp->setDebugOutput($this->Debugoutput); $this->smtp->setVerp($this->do_verp); $hosts = explode(';', $this->Host); $lastexception = null; foreach ($hosts as $hostentry) { $hostinfo = array(); if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) { // Not a valid host entry continue; } // $hostinfo[2]: optional ssl or tls prefix // $hostinfo[3]: the hostname // $hostinfo[4]: optional port number // The host string prefix can temporarily override the current setting for SMTPSecure // If it's not specified, the default value is used $prefix = ''; $tls = ($this->SMTPSecure == 'tls'); if ($hostinfo[2] == 'ssl' or ($hostinfo[2] == '' and $this->SMTPSecure == 'ssl')) { $prefix = 'ssl://'; $tls = false; // Can't have SSL and TLS at once } elseif ($hostinfo[2] == 'tls') { $tls = true; // tls doesn't use a prefix } $host = $hostinfo[3]; $port = $this->Port; $tport = (integer)$hostinfo[4]; if ($tport > 0 and $tport < 65536) { $port = $tport; } if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { try { if ($this->Helo) { $hello = $this->Helo; } else { $hello = $this->serverHostname(); } $this->smtp->hello($hello); if ($tls) { if (!$this->smtp->startTLS()) { throw new phpmailerException($this->lang('connect_host')); } // We must resend HELO after tls negotiation $this->smtp->hello($hello); } if ($this->SMTPAuth) { if (!$this->smtp->authenticate( $this->Username, $this->Password, $this->AuthType, $this->Realm, $this->Workstation ) ) { throw new phpmailerException($this->lang('authenticate')); } } return true; } catch (phpmailerException $exc) { $lastexception = $exc; // We must have connected, but then failed TLS or Auth, so close connection nicely $this->smtp->quit(); } } } // If we get here, all connection attempts have failed, so close connection hard $this->smtp->close(); // As we've caught all exceptions, just report whatever the last one was if ($this->exceptions and !is_null($lastexception)) { throw $lastexception; } return false; } /** * Close the active SMTP session if one exists. * @return void */ public function smtpClose() { if ($this->smtp !== null) { if ($this->smtp->connected()) { $this->smtp->quit(); $this->smtp->close(); } } } /** * Set the language for error messages. * Returns false if it cannot load the language file. * The default language is English. * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") * @param string $lang_path Path to the language file directory, with trailing separator (slash) * @return boolean * @access public */ public function setLanguage($langcode = 'en', $lang_path = '') { // Define full set of translatable strings in English $PHPMAILER_LANG = array( 'authenticate' => 'SMTP Error: Could not authenticate.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'data_not_accepted' => 'SMTP Error: data not accepted.', 'empty_message' => 'Message body empty', 'encoding' => 'Unknown encoding: ', 'execute' => 'Could not execute: ', 'file_access' => 'Could not access file: ', 'file_open' => 'File Error: Could not open file: ', 'from_failed' => 'The following From address failed: ', 'instantiate' => 'Could not instantiate mail function.', 'invalid_address' => 'Invalid address', 'mailer_not_supported' => ' mailer is not supported.', 'provide_address' => 'You must provide at least one recipient email address.', 'recipients_failed' => 'SMTP Error: The following recipients failed: ', 'signing' => 'Signing Error: ', 'smtp_connect_failed' => 'SMTP connect() failed.', 'smtp_error' => 'SMTP server error: ', 'variable_set' => 'Cannot set or reset variable: ' ); if (empty($lang_path)) { // Calculate an absolute path so it can work if CWD is not here $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR; } $foundlang = true; $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; if ($langcode != 'en') { // There is no English translation file // Make sure language file path is readable if (!is_readable($lang_file)) { $foundlang = false; } else { // Overwrite language-specific strings. // This way we'll never have missing translations. $foundlang = include $lang_file; } } $this->language = $PHPMAILER_LANG; return ($foundlang == true); // Returns false if language not found } /** * Get the array of strings for the current language. * @return array */ public function getTranslations() { return $this->language; } /** * Create recipient headers. * @access public * @param string $type * @param array $addr An array of recipient, * where each recipient is a 2-element indexed array with element 0 containing an address * and element 1 containing a name, like: * array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User')) * @return string */ public function addrAppend($type, $addr) { $addresses = array(); foreach ($addr as $address) { $addresses[] = $this->addrFormat($address); } return $type . ': ' . implode(', ', $addresses) . $this->LE; } /** * Format an address for use in a message header. * @access public * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name * like array('joe@example.com', 'Joe User') * @return string */ public function addrFormat($addr) { if (empty($addr[1])) { // No name provided return $this->secureHeader($addr[0]); } else { return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader( $addr[0] ) . '>'; } } /** * Word-wrap message. * For use with mailers that do not automatically perform wrapping * and for quoted-printable encoded messages. * Original written by philippe. * @param string $message The message to wrap * @param integer $length The line length to wrap to * @param boolean $qp_mode Whether to run in Quoted-Printable mode * @access public * @return string */ public function wrapText($message, $length, $qp_mode = false) { $soft_break = ($qp_mode) ? sprintf(' =%s', $this->LE) : $this->LE; // If utf-8 encoding is used, we will need to make sure we don't // split multibyte characters when we wrap $is_utf8 = (strtolower($this->CharSet) == 'utf-8'); $lelen = strlen($this->LE); $crlflen = strlen(self::CRLF); $message = $this->fixEOL($message); if (substr($message, -$lelen) == $this->LE) { $message = substr($message, 0, -$lelen); } $line = explode($this->LE, $message); // Magic. We know fixEOL uses $LE $message = ''; for ($i = 0; $i < count($line); $i++) { $line_part = explode(' ', $line[$i]); $buf = ''; for ($e = 0; $e < count($line_part); $e++) { $word = $line_part[$e]; if ($qp_mode and (strlen($word) > $length)) { $space_left = $length - strlen($buf) - $crlflen; if ($e != 0) { if ($space_left > 20) { $len = $space_left; if ($is_utf8) { $len = $this->utf8CharBoundary($word, $len); } elseif (substr($word, $len - 1, 1) == '=') { $len--; } elseif (substr($word, $len - 2, 1) == '=') { $len -= 2; } $part = substr($word, 0, $len); $word = substr($word, $len); $buf .= ' ' . $part; $message .= $buf . sprintf('=%s', self::CRLF); } else { $message .= $buf . $soft_break; } $buf = ''; } while (strlen($word) > 0) { if ($length <= 0) { break; } $len = $length; if ($is_utf8) { $len = $this->utf8CharBoundary($word, $len); } elseif (substr($word, $len - 1, 1) == '=') { $len--; } elseif (substr($word, $len - 2, 1) == '=') { $len -= 2; } $part = substr($word, 0, $len); $word = substr($word, $len); if (strlen($word) > 0) { $message .= $part . sprintf('=%s', self::CRLF); } else { $buf = $part; } } } else { $buf_o = $buf; $buf .= ($e == 0) ? $word : (' ' . $word); if (strlen($buf) > $length and $buf_o != '') { $message .= $buf_o . $soft_break; $buf = $word; } } } $message .= $buf . self::CRLF; } return $message; } /** * Find the last character boundary prior to $maxLength in a utf-8 * quoted (printable) encoded string. * Original written by Colin Brown. * @access public * @param string $encodedText utf-8 QP text * @param integer $maxLength find last character boundary prior to this length * @return integer */ public function utf8CharBoundary($encodedText, $maxLength) { $foundSplitPos = false; $lookBack = 3; while (!$foundSplitPos) { $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); $encodedCharPos = strpos($lastChunk, '='); if ($encodedCharPos !== false) { // Found start of encoded character byte within $lookBack block. // Check the encoded byte value (the 2 chars after the '=') $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); $dec = hexdec($hex); if ($dec < 128) { // Single byte character. // If the encoded char was found at pos 0, it will fit // otherwise reduce maxLength to start of the encoded char $maxLength = ($encodedCharPos == 0) ? $maxLength : $maxLength - ($lookBack - $encodedCharPos); $foundSplitPos = true; } elseif ($dec >= 192) { // First byte of a multi byte character // Reduce maxLength to split at start of character $maxLength = $maxLength - ($lookBack - $encodedCharPos); $foundSplitPos = true; } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back $lookBack += 3; } } else { // No encoded character found $foundSplitPos = true; } } return $maxLength; } /** * Set the body wrapping. * @access public * @return void */ public function setWordWrap() { if ($this->WordWrap < 1) { return; } switch ($this->message_type) { case 'alt': case 'alt_inline': case 'alt_attach': case 'alt_inline_attach': $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); break; default: $this->Body = $this->wrapText($this->Body, $this->WordWrap); break; } } /** * Assemble message headers. * @access public * @return string The assembled headers */ public function createHeader() { $result = ''; // Set the boundaries $uniq_id = md5(uniqid(time())); $this->boundary[1] = 'b1_' . $uniq_id; $this->boundary[2] = 'b2_' . $uniq_id; $this->boundary[3] = 'b3_' . $uniq_id; if ($this->MessageDate == '') { $this->MessageDate = self::rfcDate(); } $result .= $this->headerLine('Date', $this->MessageDate); // To be created automatically by mail() if ($this->SingleTo === true) { if ($this->Mailer != 'mail') { foreach ($this->to as $toaddr) { $this->SingleToArray[] = $this->addrFormat($toaddr); } } } else { if (count($this->to) > 0) { if ($this->Mailer != 'mail') { $result .= $this->addrAppend('To', $this->to); } } elseif (count($this->cc) == 0) { $result .= $this->headerLine('To', 'undisclosed-recipients:;'); } } $result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName))); // sendmail and mail() extract Cc from the header before sending if (count($this->cc) > 0) { $result .= $this->addrAppend('Cc', $this->cc); } // sendmail and mail() extract Bcc from the header before sending if (( $this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail' ) and count($this->bcc) > 0 ) { $result .= $this->addrAppend('Bcc', $this->bcc); } if (count($this->ReplyTo) > 0) { $result .= $this->addrAppend('Reply-To', $this->ReplyTo); } // mail() sets the subject itself if ($this->Mailer != 'mail') { $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); } if ($this->MessageID != '') { $this->lastMessageID = $this->MessageID; } else { $this->lastMessageID = sprintf('<%s@%s>', $uniq_id, $this->ServerHostname()); } $result .= $this->HeaderLine('Message-ID', $this->lastMessageID); $result .= $this->headerLine('X-Priority', $this->Priority); if ($this->XMailer == '') { $result .= $this->headerLine( 'X-Mailer', 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer/)' ); } else { $myXmailer = trim($this->XMailer); if ($myXmailer) { $result .= $this->headerLine('X-Mailer', $myXmailer); } } if ($this->ConfirmReadingTo != '') { $result .= $this->headerLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>'); } // Add custom headers for ($index = 0; $index < count($this->CustomHeader); $index++) { $result .= $this->headerLine( trim($this->CustomHeader[$index][0]), $this->encodeHeader(trim($this->CustomHeader[$index][1])) ); } if (!$this->sign_key_file) { $result .= $this->headerLine('MIME-Version', '1.0'); $result .= $this->getMailMIME(); } return $result; } /** * Get the message MIME type headers. * @access public * @return string */ public function getMailMIME() { $result = ''; $ismultipart = true; switch ($this->message_type) { case 'inline': $result .= $this->headerLine('Content-Type', 'multipart/related;'); $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); break; case 'attach': case 'inline_attach': case 'alt_attach': case 'alt_inline_attach': $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); break; case 'alt': case 'alt_inline': $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); break; default: // Catches case 'plain': and case '': $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); $ismultipart = false; break; } // RFC1341 part 5 says 7bit is assumed if not specified if ($this->Encoding != '7bit') { // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE if ($ismultipart) { if ($this->Encoding == '8bit') { $result .= $this->headerLine('Content-Transfer-Encoding', '8bit'); } // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible } else { $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); } } if ($this->Mailer != 'mail') { $result .= $this->LE; } return $result; } /** * Returns the whole MIME message. * Includes complete headers and body. * Only valid post preSend(). * @see PHPMailer::preSend() * @access public * @return string */ public function getSentMIMEMessage() { return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody; } /** * Assemble the message body. * Returns an empty string on failure. * @access public * @throws phpmailerException * @return string The assembled message body */ public function createBody() { $body = ''; if ($this->sign_key_file) { $body .= $this->getMailMIME() . $this->LE; } $this->setWordWrap(); $bodyEncoding = $this->Encoding; $bodyCharSet = $this->CharSet; if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) { $bodyEncoding = '7bit'; $bodyCharSet = 'us-ascii'; } $altBodyEncoding = $this->Encoding; $altBodyCharSet = $this->CharSet; if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) { $altBodyEncoding = '7bit'; $altBodyCharSet = 'us-ascii'; } switch ($this->message_type) { case 'inline': $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[1]); break; case 'attach': $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; case 'inline_attach': $body .= $this->textLine('--' . $this->boundary[1]); $body .= $this->headerLine('Content-Type', 'multipart/related;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[2]); $body .= $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; case 'alt': $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; if (!empty($this->Ical)) { $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); $body .= $this->encodeString($this->Ical, $this->Encoding); $body .= $this->LE . $this->LE; } $body .= $this->endBoundary($this->boundary[1]); break; case 'alt_inline': $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->textLine('--' . $this->boundary[1]); $body .= $this->headerLine('Content-Type', 'multipart/related;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[2]); $body .= $this->LE; $body .= $this->endBoundary($this->boundary[1]); break; case 'alt_attach': $body .= $this->textLine('--' . $this->boundary[1]); $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->endBoundary($this->boundary[2]); $body .= $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; case 'alt_inline_attach': $body .= $this->textLine('--' . $this->boundary[1]); $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); $body .= $this->encodeString($this->AltBody, $altBodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->textLine('--' . $this->boundary[2]); $body .= $this->headerLine('Content-Type', 'multipart/related;'); $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); $body .= $this->LE; $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); $body .= $this->encodeString($this->Body, $bodyEncoding); $body .= $this->LE . $this->LE; $body .= $this->attachAll('inline', $this->boundary[3]); $body .= $this->LE; $body .= $this->endBoundary($this->boundary[2]); $body .= $this->LE; $body .= $this->attachAll('attachment', $this->boundary[1]); break; default: // catch case 'plain' and case '' $body .= $this->encodeString($this->Body, $bodyEncoding); break; } if ($this->isError()) { $body = ''; } elseif ($this->sign_key_file) { try { if (!defined('PKCS7_TEXT')) { throw new phpmailerException($this->lang('signing') . ' OpenSSL extension missing.'); } // @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 $file = tempnam(sys_get_temp_dir(), 'mail'); file_put_contents($file, $body); // @TODO check this worked $signed = tempnam(sys_get_temp_dir(), 'signed'); if (@openssl_pkcs7_sign( $file, $signed, 'file://' . realpath($this->sign_cert_file), array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), null ) ) { @unlink($file); $body = file_get_contents($signed); @unlink($signed); } else { @unlink($file); @unlink($signed); throw new phpmailerException($this->lang('signing') . openssl_error_string()); } } catch (phpmailerException $exc) { $body = ''; if ($this->exceptions) { throw $exc; } } } return $body; } /** * Return the start of a message boundary. * @access protected * @param string $boundary * @param string $charSet * @param string $contentType * @param string $encoding * @return string */ protected function getBoundary($boundary, $charSet, $contentType, $encoding) { $result = ''; if ($charSet == '') { $charSet = $this->CharSet; } if ($contentType == '') { $contentType = $this->ContentType; } if ($encoding == '') { $encoding = $this->Encoding; } $result .= $this->textLine('--' . $boundary); $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); $result .= $this->LE; // RFC1341 part 5 says 7bit is assumed if not specified if ($encoding != '7bit') { $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); } $result .= $this->LE; return $result; } /** * Return the end of a message boundary. * @access protected * @param string $boundary * @return string */ protected function endBoundary($boundary) { return $this->LE . '--' . $boundary . '--' . $this->LE; } /** * Set the message type. * PHPMailer only supports some preset message types, * not arbitrary MIME structures. * @access protected * @return void */ protected function setMessageType() { $type = array(); if ($this->alternativeExists()) { $type[] = 'alt'; } if ($this->inlineImageExists()) { $type[] = 'inline'; } if ($this->attachmentExists()) { $type[] = 'attach'; } $this->message_type = implode('_', $type); if ($this->message_type == '') { $this->message_type = 'plain'; } } /** * Format a header line. * @access public * @param string $name * @param string $value * @return string */ public function headerLine($name, $value) { return $name . ': ' . $value . $this->LE; } /** * Return a formatted mail line. * @access public * @param string $value * @return string */ public function textLine($value) { return $value . $this->LE; } /** * Add an attachment from a path on the filesystem. * Returns false if the file could not be found or read. * @param string $path Path to the attachment. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @param string $disposition Disposition to use * @throws phpmailerException * @return boolean */ public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') { try { if (!@is_file($path)) { throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE); } // If a MIME type is not specified, try to work it out from the file name if ($type == '') { $type = self::filenameToType($path); } $filename = basename($path); if ($name == '') { $name = $filename; } $this->attachment[] = array( 0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, 5 => false, // isStringAttachment 6 => $disposition, 7 => 0 ); } catch (phpmailerException $exc) { $this->setError($exc->getMessage()); $this->edebug($exc->getMessage()); if ($this->exceptions) { throw $exc; } return false; } return true; } /** * Return the array of attachments. * @return array */ public function getAttachments() { return $this->attachment; } /** * Attach all file, string, and binary attachments to the message. * Returns an empty string on failure. * @access protected * @param string $disposition_type * @param string $boundary * @return string */ protected function attachAll($disposition_type, $boundary) { // Return text of body $mime = array(); $cidUniq = array(); $incl = array(); // Add all attachments foreach ($this->attachment as $attachment) { // Check if it is a valid disposition_filter if ($attachment[6] == $disposition_type) { // Check for string attachment $string = ''; $path = ''; $bString = $attachment[5]; if ($bString) { $string = $attachment[0]; } else { $path = $attachment[0]; } $inclhash = md5(serialize($attachment)); if (in_array($inclhash, $incl)) { continue; } $incl[] = $inclhash; $name = $attachment[2]; $encoding = $attachment[3]; $type = $attachment[4]; $disposition = $attachment[6]; $cid = $attachment[7]; if ($disposition == 'inline' && isset($cidUniq[$cid])) { continue; } $cidUniq[$cid] = true; $mime[] = sprintf('--%s%s', $boundary, $this->LE); $mime[] = sprintf( 'Content-Type: %s; name="%s"%s', $type, $this->encodeHeader($this->secureHeader($name)), $this->LE ); // RFC1341 part 5 says 7bit is assumed if not specified if ($encoding != '7bit') { $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE); } if ($disposition == 'inline') { $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE); } // If a filename contains any of these chars, it should be quoted, // but not otherwise: RFC2183 & RFC2045 5.1 // Fixes a warning in IETF's msglint MIME checker // Allow for bypassing the Content-Disposition header totally if (!(empty($disposition))) { $encoded_name = $this->encodeHeader($this->secureHeader($name)); if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $encoded_name)) { $mime[] = sprintf( 'Content-Disposition: %s; filename="%s"%s', $disposition, $encoded_name, $this->LE . $this->LE ); } else { $mime[] = sprintf( 'Content-Disposition: %s; filename=%s%s', $disposition, $encoded_name, $this->LE . $this->LE ); } } else { $mime[] = $this->LE; } // Encode as string attachment if ($bString) { $mime[] = $this->encodeString($string, $encoding); if ($this->isError()) { return ''; } $mime[] = $this->LE . $this->LE; } else { $mime[] = $this->encodeFile($path, $encoding); if ($this->isError()) { return ''; } $mime[] = $this->LE . $this->LE; } } } $mime[] = sprintf('--%s--%s', $boundary, $this->LE); return implode('', $mime); } /** * Encode a file attachment in requested format. * Returns an empty string on failure. * @param string $path The full path to the file * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' * @throws phpmailerException * @see EncodeFile(encodeFile * @access protected * @return string */ protected function encodeFile($path, $encoding = 'base64') { try { if (!is_readable($path)) { throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE); } $magic_quotes = get_magic_quotes_runtime(); if ($magic_quotes) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { set_magic_quotes_runtime(false); } else { //Doesn't exist in PHP 5.4, but we don't need to check because //get_magic_quotes_runtime always returns false in 5.4+ //so it will never get here ini_set('magic_quotes_runtime', 0); } } $file_buffer = file_get_contents($path); $file_buffer = $this->encodeString($file_buffer, $encoding); if ($magic_quotes) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { set_magic_quotes_runtime($magic_quotes); } else { ini_set('magic_quotes_runtime', ($magic_quotes?'1':'0')); } } return $file_buffer; } catch (Exception $exc) { $this->setError($exc->getMessage()); return ''; } } /** * Encode a string in requested format. * Returns an empty string on failure. * @param string $str The text to encode * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' * @access public * @return string */ public function encodeString($str, $encoding = 'base64') { $encoded = ''; switch (strtolower($encoding)) { case 'base64': $encoded = chunk_split(base64_encode($str), 76, $this->LE); break; case '7bit': case '8bit': $encoded = $this->fixEOL($str); // Make sure it ends with a line break if (substr($encoded, -(strlen($this->LE))) != $this->LE) { $encoded .= $this->LE; } break; case 'binary': $encoded = $str; break; case 'quoted-printable': $encoded = $this->encodeQP($str); break; default: $this->setError($this->lang('encoding') . $encoding); break; } return $encoded; } /** * Encode a header string optimally. * Picks shortest of Q, B, quoted-printable or none. * @access public * @param string $str * @param string $position * @return string */ public function encodeHeader($str, $position = 'text') { $matchcount = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { // Can't use addslashes as we don't know the value of magic_quotes_sybase $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { return ($encoded); } else { return ("\"$encoded\""); } } $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); break; /** @noinspection PhpMissingBreakStatementInspection */ case 'comment': $matchcount = preg_match_all('/[()"]/', $str, $matches); // Intentional fall-through case 'text': default: $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); break; } if ($matchcount == 0) { // There are no chars that need encoding return ($str); } $maxlen = 75 - 7 - strlen($this->CharSet); // Try to select the encoding which should produce the shortest output if ($matchcount > strlen($str) / 3) { // More than a third of the content will need encoding, so B encoding will be most efficient $encoding = 'B'; if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) { // Use a custom function which correctly encodes and wraps long // multibyte strings without breaking lines within a character $encoded = $this->base64EncodeWrapMB($str, "\n"); } else { $encoded = base64_encode($str); $maxlen -= $maxlen % 4; $encoded = trim(chunk_split($encoded, $maxlen, "\n")); } } else { $encoding = 'Q'; $encoded = $this->encodeQ($str, $position); $encoded = $this->wrapText($encoded, $maxlen, true); $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded)); } $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); $encoded = trim(str_replace("\n", $this->LE, $encoded)); return $encoded; } /** * Check if a string contains multi-byte characters. * @access public * @param string $str multi-byte text to wrap encode * @return boolean */ public function hasMultiBytes($str) { if (function_exists('mb_strlen')) { return (strlen($str) > mb_strlen($str, $this->CharSet)); } else { // Assume no multibytes (we can't handle without mbstring functions anyway) return false; } } /** * Does a string contain any 8-bit chars (in any charset)? * @param string $text * @return boolean */ public function has8bitChars($text) { return (boolean)preg_match('/[\x80-\xFF]/', $text); } /** * Encode and wrap long multibyte strings for mail headers * without breaking lines within a character. * Adapted from a function by paravoid * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 * @access public * @param string $str multi-byte text to wrap encode * @param string $linebreak string to use as linefeed/end-of-line * @return string */ public function base64EncodeWrapMB($str, $linebreak = null) { $start = '=?' . $this->CharSet . '?B?'; $end = '?='; $encoded = ''; if ($linebreak === null) { $linebreak = $this->LE; } $mb_length = mb_strlen($str, $this->CharSet); // Each line must have length <= 75, including $start and $end $length = 75 - strlen($start) - strlen($end); // Average multi-byte ratio $ratio = $mb_length / strlen($str); // Base64 has a 4:3 ratio $avgLength = floor($length * $ratio * .75); for ($i = 0; $i < $mb_length; $i += $offset) { $lookBack = 0; do { $offset = $avgLength - $lookBack; $chunk = mb_substr($str, $i, $offset, $this->CharSet); $chunk = base64_encode($chunk); $lookBack++; } while (strlen($chunk) > $length); $encoded .= $chunk . $linebreak; } // Chomp the last linefeed $encoded = substr($encoded, 0, -strlen($linebreak)); return $encoded; } /** * Encode a string in quoted-printable format. * According to RFC2045 section 6.7. * @access public * @param string $string The text to encode * @param integer $line_max Number of chars allowed on a line before wrapping * @return string * @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment */ public function encodeQP($string, $line_max = 76) { if (function_exists('quoted_printable_encode')) { // Use native function if it's available (>= PHP5.3) return $this->fixEOL(quoted_printable_encode($string)); } // Fall back to a pure PHP implementation $string = str_replace( array('%20', '%0D%0A.', '%0D%0A', '%'), array(' ', "\r\n=2E", "\r\n", '='), rawurlencode($string) ); $string = preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string); return $this->fixEOL($string); } /** * Backward compatibility wrapper for an old QP encoding function that was removed. * @see PHPMailer::encodeQP() * @access public * @param string $string * @param integer $line_max * @param boolean $space_conv * @return string * @deprecated Use encodeQP instead. */ public function encodeQPphp( $string, $line_max = 76, /** @noinspection PhpUnusedParameterInspection */ $space_conv = false ) { return $this->encodeQP($string, $line_max); } /** * Encode a string using Q encoding. * @link http://tools.ietf.org/html/rfc2047 * @param string $str the text to encode * @param string $position Where the text is going to be used, see the RFC for what that means * @access public * @return string */ public function encodeQ($str, $position = 'text') { // There should not be any EOL in the string $pattern = ''; $encoded = str_replace(array("\r", "\n"), '', $str); switch (strtolower($position)) { case 'phrase': // RFC 2047 section 5.3 $pattern = '^A-Za-z0-9!*+\/ -'; break; /** @noinspection PhpMissingBreakStatementInspection */ case 'comment': // RFC 2047 section 5.2 $pattern = '\(\)"'; // intentional fall-through // for this reason we build the $pattern without including delimiters and [] case 'text': default: // RFC 2047 section 5.1 // Replace every high ascii, control, =, ? and _ characters $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; break; } $matches = array(); if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { // If the string contains an '=', make sure it's the first thing we replace // so as to avoid double-encoding $eqkey = array_search('=', $matches[0]); if ($eqkey !== false) { unset($matches[0][$eqkey]); array_unshift($matches[0], '='); } foreach (array_unique($matches[0]) as $char) { $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); } } // Replace every spaces to _ (more readable than =20) return str_replace(' ', '_', $encoded); } /** * Add a string or binary attachment (non-filesystem). * This method can be used to attach ascii or binary data, * such as a BLOB record from a database. * @param string $string String attachment data. * @param string $filename Name of the attachment. * @param string $encoding File encoding (see $Encoding). * @param string $type File extension (MIME) type. * @param string $disposition Disposition to use * @return void */ public function addStringAttachment( $string, $filename, $encoding = 'base64', $type = '', $disposition = 'attachment' ) { // If a MIME type is not specified, try to work it out from the file name if ($type == '') { $type = self::filenameToType($filename); } // Append to $attachment array $this->attachment[] = array( 0 => $string, 1 => $filename, 2 => basename($filename), 3 => $encoding, 4 => $type, 5 => true, // isStringAttachment 6 => $disposition, 7 => 0 ); } /** * Add an embedded (inline) attachment from a file. * This can include images, sounds, and just about any other document type. * These differ from 'regular' attachmants in that they are intended to be * displayed inline with the message, not just attached for download. * This is used in HTML messages that embed the images * the HTML refers to using the $cid value. * @param string $path Path to the attachment. * @param string $cid Content ID of the attachment; Use this to reference * the content when using an embedded image in HTML. * @param string $name Overrides the attachment name. * @param string $encoding File encoding (see $Encoding). * @param string $type File MIME type. * @param string $disposition Disposition to use * @return boolean True on successfully adding an attachment */ public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') { if (!@is_file($path)) { $this->setError($this->lang('file_access') . $path); return false; } // If a MIME type is not specified, try to work it out from the file name if ($type == '') { $type = self::filenameToType($path); } $filename = basename($path); if ($name == '') { $name = $filename; } // Append to $attachment array $this->attachment[] = array( 0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, 5 => false, // isStringAttachment 6 => $disposition, 7 => $cid ); return true; } /** * Add an embedded stringified attachment. * This can include images, sounds, and just about any other document type. * Be sure to set the $type to an image type for images: * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'. * @param string $string The attachment binary data. * @param string $cid Content ID of the attachment; Use this to reference * the content when using an embedded image in HTML. * @param string $name * @param string $encoding File encoding (see $Encoding). * @param string $type MIME type. * @param string $disposition Disposition to use * @return boolean True on successfully adding an attachment */ public function addStringEmbeddedImage( $string, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline' ) { // If a MIME type is not specified, try to work it out from the name if ($type == '') { $type = self::filenameToType($name); } // Append to $attachment array $this->attachment[] = array( 0 => $string, 1 => $name, 2 => $name, 3 => $encoding, 4 => $type, 5 => true, // isStringAttachment 6 => $disposition, 7 => $cid ); return true; } /** * Check if an inline attachment is present. * @access public * @return boolean */ public function inlineImageExists() { foreach ($this->attachment as $attachment) { if ($attachment[6] == 'inline') { return true; } } return false; } /** * Check if an attachment (non-inline) is present. * @return boolean */ public function attachmentExists() { foreach ($this->attachment as $attachment) { if ($attachment[6] == 'attachment') { return true; } } return false; } /** * Check if this message has an alternative body set. * @return boolean */ public function alternativeExists() { return !empty($this->AltBody); } /** * Clear all To recipients. * @return void */ public function clearAddresses() { foreach ($this->to as $to) { unset($this->all_recipients[strtolower($to[0])]); } $this->to = array(); } /** * Clear all CC recipients. * @return void */ public function clearCCs() { foreach ($this->cc as $cc) { unset($this->all_recipients[strtolower($cc[0])]); } $this->cc = array(); } /** * Clear all BCC recipients. * @return void */ public function clearBCCs() { foreach ($this->bcc as $bcc) { unset($this->all_recipients[strtolower($bcc[0])]); } $this->bcc = array(); } /** * Clear all ReplyTo recipients. * @return void */ public function clearReplyTos() { $this->ReplyTo = array(); } /** * Clear all recipient types. * @return void */ public function clearAllRecipients() { $this->to = array(); $this->cc = array(); $this->bcc = array(); $this->all_recipients = array(); } /** * Clear all filesystem, string, and binary attachments. * @return void */ public function clearAttachments() { $this->attachment = array(); } /** * Clear all custom headers. * @return void */ public function clearCustomHeaders() { $this->CustomHeader = array(); } /** * Add an error message to the error container. * @access protected * @param string $msg * @return void */ protected function setError($msg) { $this->error_count++; if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { $lasterror = $this->smtp->getError(); if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) { $msg .= '<p>' . $this->lang('smtp_error') . $lasterror['smtp_msg'] . "</p>\n"; } } $this->ErrorInfo = $msg; } /** * Return an RFC 822 formatted date. * @access public * @return string * @static */ public static function rfcDate() { // Set the time zone to whatever the default is to avoid 500 errors // Will default to UTC if it's not set properly in php.ini date_default_timezone_set(@date_default_timezone_get()); return date('D, j M Y H:i:s O'); } /** * Get the server hostname. * Returns 'localhost.localdomain' if unknown. * @access protected * @return string */ protected function serverHostname() { $result = 'localhost.localdomain'; if (!empty($this->Hostname)) { $result = $this->Hostname; } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) { $result = $_SERVER['SERVER_NAME']; } elseif (function_exists('gethostname') && gethostname() !== false) { $result = gethostname(); } elseif (php_uname('n') !== false) { $result = php_uname('n'); } return $result; } /** * Get an error message in the current language. * @access protected * @param string $key * @return string */ protected function lang($key) { if (count($this->language) < 1) { $this->setLanguage('en'); // set the default language } if (isset($this->language[$key])) { return $this->language[$key]; } else { return 'Language string failed to load: ' . $key; } } /** * Check if an error occurred. * @access public * @return boolean True if an error did occur. */ public function isError() { return ($this->error_count > 0); } /** * Ensure consistent line endings in a string. * Changes every end of line from CRLF, CR or LF to $this->LE. * @access public * @param string $str String to fixEOL * @return string */ public function fixEOL($str) { // Normalise to \n $nstr = str_replace(array("\r\n", "\r"), "\n", $str); // Now convert LE as needed if ($this->LE !== "\n") { $nstr = str_replace("\n", $this->LE, $nstr); } return $nstr; } /** * Add a custom header. * $name value can be overloaded to contain * both header name and value (name:value) * @access public * @param string $name Custom header name * @param string $value Header value * @return void */ public function addCustomHeader($name, $value = null) { if ($value === null) { // Value passed in as name:value $this->CustomHeader[] = explode(':', $name, 2); } else { $this->CustomHeader[] = array($name, $value); } } /** * Create a message from an HTML string. * Automatically makes modifications for inline images and backgrounds * and creates a plain-text version by converting the HTML. * Overwrites any existing values in $this->Body and $this->AltBody * @access public * @param string $message HTML message string * @param string $basedir baseline directory for path * @param boolean $advanced Whether to use the advanced HTML to text converter * @return string $message */ public function msgHTML($message, $basedir = '', $advanced = false) { preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images); if (isset($images[2])) { foreach ($images[2] as $imgindex => $url) { // Convert data URIs into embedded images if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) { $data = substr($url, strpos($url, ',')); if ($match[2]) { $data = base64_decode($data); } else { $data = rawurldecode($data); } $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 if ($this->addStringEmbeddedImage($data, $cid, '', 'base64', $match[1])) { $message = preg_replace( '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', $images[1][$imgindex] . '="cid:' . $cid . '"', $message ); } } elseif (!preg_match('#^[A-z]+://#', $url)) { // Do not change urls for absolute images (thanks to corvuscorax) $filename = basename($url); $directory = dirname($url); if ($directory == '.') { $directory = ''; } $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 if (strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; } if (strlen($directory) > 1 && substr($directory, -1) != '/') { $directory .= '/'; } if ($this->addEmbeddedImage( $basedir . $directory . $filename, $cid, $filename, 'base64', self::_mime_types(self::mb_pathinfo($filename, PATHINFO_EXTENSION)) ) ) { $message = preg_replace( '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', $images[1][$imgindex] . '="cid:' . $cid . '"', $message ); } } } } $this->isHTML(true); // Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better $this->Body = $this->normalizeBreaks($message); $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced)); if (empty($this->AltBody)) { $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . self::CRLF . self::CRLF; } return $this->Body; } /** * Convert an HTML string into plain text. * @param string $html The HTML text to convert * @param boolean $advanced Should this use the more complex html2text converter or just a simple one? * @return string */ public function html2text($html, $advanced = false) { if ($advanced) { require_once 'extras/class.html2text.php'; $htmlconverter = new html2text($html); return $htmlconverter->get_text(); } return html_entity_decode( trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), ENT_QUOTES, $this->CharSet ); } /** * Get the MIME type for a file extension. * @param string $ext File extension * @access public * @return string MIME type of file. * @static */ public static function _mime_types($ext = '') { $mimes = array( 'xl' => 'application/excel', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'bin' => 'application/macbinary', 'doc' => 'application/msword', 'word' => 'application/msword', 'class' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'psd' => 'application/octet-stream', 'sea' => 'application/octet-stream', 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'gtar' => 'application/x-gtar', 'php3' => 'application/x-httpd-php', 'php4' => 'application/x-httpd-php', 'php' => 'application/x-httpd-php', 'phtml' => 'application/x-httpd-php', 'phps' => 'application/x-httpd-php-source', 'js' => 'application/x-javascript', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'tar' => 'application/x-tar', 'tgz' => 'application/x-tar', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'zip' => 'application/zip', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mpga' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'eml' => 'message/rfc822', 'css' => 'text/css', 'html' => 'text/html', 'htm' => 'text/html', 'shtml' => 'text/html', 'log' => 'text/plain', 'text' => 'text/plain', 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'vcf' => 'text/vcard', 'vcard' => 'text/vcard', 'xml' => 'text/xml', 'xsl' => 'text/xml', 'mpeg' => 'video/mpeg', 'mpe' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'qt' => 'video/quicktime', 'rv' => 'video/vnd.rn-realvideo', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie' ); return (array_key_exists(strtolower($ext), $mimes) ? $mimes[strtolower($ext)]: 'application/octet-stream'); } /** * Map a file name to a MIME type. * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. * @param string $filename A file name or full path, does not need to exist as a file * @return string * @static */ public static function filenameToType($filename) { // In case the path is a URL, strip any query string before getting extension $qpos = strpos($filename, '?'); if ($qpos !== false) { $filename = substr($filename, 0, $qpos); } $pathinfo = self::mb_pathinfo($filename); return self::_mime_types($pathinfo['extension']); } /** * Multi-byte-safe pathinfo replacement. * Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe. * Works similarly to the one in PHP >= 5.2.0 * @link http://www.php.net/manual/en/function.pathinfo.php#107461 * @param string $path A filename or path, does not need to exist as a file * @param integer|string $options Either a PATHINFO_* constant, * or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2 * @return string|array * @static */ public static function mb_pathinfo($path, $options = null) { $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''); $pathinfo = array(); if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) { if (array_key_exists(1, $pathinfo)) { $ret['dirname'] = $pathinfo[1]; } if (array_key_exists(2, $pathinfo)) { $ret['basename'] = $pathinfo[2]; } if (array_key_exists(5, $pathinfo)) { $ret['extension'] = $pathinfo[5]; } if (array_key_exists(3, $pathinfo)) { $ret['filename'] = $pathinfo[3]; } } switch ($options) { case PATHINFO_DIRNAME: case 'dirname': return $ret['dirname']; case PATHINFO_BASENAME: case 'basename': return $ret['basename']; case PATHINFO_EXTENSION: case 'extension': return $ret['extension']; case PATHINFO_FILENAME: case 'filename': return $ret['filename']; default: return $ret; } } /** * Set or reset instance properties. * * Usage Example: * $page->set('X-Priority', '3'); * * @access public * @param string $name * @param mixed $value * NOTE: will not work with arrays, there are no arrays to set/reset * @throws phpmailerException * @return boolean * @TODO Should this not be using __set() magic function? */ public function set($name, $value = '') { try { if (isset($this->$name)) { $this->$name = $value; } else { throw new phpmailerException($this->lang('variable_set') . $name, self::STOP_CRITICAL); } } catch (Exception $exc) { $this->setError($exc->getMessage()); if ($exc->getCode() == self::STOP_CRITICAL) { return false; } } return true; } /** * Strip newlines to prevent header injection. * @access public * @param string $str * @return string */ public function secureHeader($str) { return trim(str_replace(array("\r", "\n"), '', $str)); } /** * Normalize line breaks in a string. * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. * Defaults to CRLF (for message bodies) and preserves consecutive breaks. * @param string $text * @param string $breaktype What kind of line break to use, defaults to CRLF * @return string * @access public * @static */ public static function normalizeBreaks($text, $breaktype = "\r\n") { return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text); } /** * Set the public and private key files and password for S/MIME signing. * @access public * @param string $cert_filename * @param string $key_filename * @param string $key_pass Password for private key */ public function sign($cert_filename, $key_filename, $key_pass) { $this->sign_cert_file = $cert_filename; $this->sign_key_file = $key_filename; $this->sign_key_pass = $key_pass; } /** * Quoted-Printable-encode a DKIM header. * @access public * @param string $txt * @return string */ public function DKIM_QP($txt) { $line = ''; for ($i = 0; $i < strlen($txt); $i++) { $ord = ord($txt[$i]); if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { $line .= $txt[$i]; } else { $line .= '=' . sprintf('%02X', $ord); } } return $line; } /** * Generate a DKIM signature. * @access public * @param string $signHeader * @throws phpmailerException * @return string */ public function DKIM_Sign($signHeader) { if (!defined('PKCS7_TEXT')) { if ($this->exceptions) { throw new phpmailerException($this->lang('signing') . ' OpenSSL extension missing.'); } return ''; } $privKeyStr = file_get_contents($this->DKIM_private); if ($this->DKIM_passphrase != '') { $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); } else { $privKey = $privKeyStr; } if (openssl_sign($signHeader, $signature, $privKey)) { return base64_encode($signature); } return ''; } /** * Generate a DKIM canonicalization header. * @access public * @param string $signHeader Header * @return string */ public function DKIM_HeaderC($signHeader) { $signHeader = preg_replace('/\r\n\s+/', ' ', $signHeader); $lines = explode("\r\n", $signHeader); foreach ($lines as $key => $line) { list($heading, $value) = explode(':', $line, 2); $heading = strtolower($heading); $value = preg_replace('/\s+/', ' ', $value); // Compress useless spaces $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value } $signHeader = implode("\r\n", $lines); return $signHeader; } /** * Generate a DKIM canonicalization body. * @access public * @param string $body Message Body * @return string */ public function DKIM_BodyC($body) { if ($body == '') { return "\r\n"; } // stabilize line endings $body = str_replace("\r\n", "\n", $body); $body = str_replace("\n", "\r\n", $body); // END stabilize line endings while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") { $body = substr($body, 0, strlen($body) - 2); } return $body; } /** * Create the DKIM header and body in a new message header. * @access public * @param string $headers_line Header lines * @param string $subject Subject * @param string $body Body * @return string */ public function DKIM_Add($headers_line, $subject, $body) { $DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body $DKIMquery = 'dns/txt'; // Query method $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone) $subject_header = "Subject: $subject"; $headers = explode($this->LE, $headers_line); $from_header = ''; $to_header = ''; $current = ''; foreach ($headers as $header) { if (strpos($header, 'From:') === 0) { $from_header = $header; $current = 'from_header'; } elseif (strpos($header, 'To:') === 0) { $to_header = $header; $current = 'to_header'; } else { if ($current && strpos($header, ' =?') === 0) { $current .= $header; } else { $current = ''; } } } $from = str_replace('|', '=7C', $this->DKIM_QP($from_header)); $to = str_replace('|', '=7C', $this->DKIM_QP($to_header)); $subject = str_replace( '|', '=7C', $this->DKIM_QP($subject_header) ); // Copied header fields (dkim-quoted-printable) $body = $this->DKIM_BodyC($body); $DKIMlen = strlen($body); // Length of body $DKIMb64 = base64_encode(pack('H*', sha1($body))); // Base64 of packed binary SHA-1 hash of body $ident = ($this->DKIM_identity == '') ? '' : ' i=' . $this->DKIM_identity . ';'; $dkimhdrs = 'DKIM-Signature: v=1; a=' . $DKIMsignatureType . '; q=' . $DKIMquery . '; l=' . $DKIMlen . '; s=' . $this->DKIM_selector . ";\r\n" . "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" . "\th=From:To:Subject;\r\n" . "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" . "\tz=$from\r\n" . "\t|$to\r\n" . "\t|$subject;\r\n" . "\tbh=" . $DKIMb64 . ";\r\n" . "\tb="; $toSign = $this->DKIM_HeaderC( $from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs ); $signed = $this->DKIM_Sign($toSign); return $dkimhdrs . $signed . "\r\n"; } /** * Allows for public read access to 'to' property. * @access public * @return array */ public function getToAddresses() { return $this->to; } /** * Allows for public read access to 'cc' property. * @access public * @return array */ public function getCcAddresses() { return $this->cc; } /** * Allows for public read access to 'bcc' property. * @access public * @return array */ public function getBccAddresses() { return $this->bcc; } /** * Allows for public read access to 'ReplyTo' property. * @access public * @return array */ public function getReplyToAddresses() { return $this->ReplyTo; } /** * Allows for public read access to 'all_recipients' property. * @access public * @return array */ public function getAllRecipientAddresses() { return $this->all_recipients; } /** * Perform a callback. * @param boolean $isSent * @param array $to * @param array $cc * @param array $bcc * @param string $subject * @param string $body * @param string $from */ protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from) { if (!empty($this->action_function) && is_callable($this->action_function)) { $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from); call_user_func_array($this->action_function, $params); } } } /** * PHPMailer exception handler * @package PHPMailer */ class phpmailerException extends Exception { /** * Prettify error message output * @return string */ public function errorMessage() { $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n"; return $errorMsg; } } PK���\�P�E�E%libraries/vendor/joomla/input/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\9�$�"�"+libraries/vendor/joomla/input/src/Input.phpnu�[���<?php /** * Part of the Joomla Framework Input Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Input; use Joomla\Filter; /** * Joomla! Input Base Class * * This is an abstracted input class used to manage retrieving data from the application environment. * * @since 1.0 * * @property-read Input $get * @property-read Input $post * @property-read Input $request * @property-read Input $server * @property-read Files $files * @property-read Cookie $cookie * * @method integer getInt($name, $default = null) Get a signed integer. * @method integer getUint($name, $default = null) Get an unsigned integer. * @method float getFloat($name, $default = null) Get a floating-point number. * @method boolean getBool($name, $default = null) Get a boolean value. * @method string getWord($name, $default = null) Get a word. * @method string getAlnum($name, $default = null) Get an alphanumeric string. * @method string getCmd($name, $default = null) Get a CMD filtered string. * @method string getBase64($name, $default = null) Get a base64 encoded string. * @method string getString($name, $default = null) Get a string. * @method string getHtml($name, $default = null) Get a HTML string. * @method string getPath($name, $default = null) Get a file path. * @method string getUsername($name, $default = null) Get a username. */ class Input implements \Serializable, \Countable { /** * Options array for the Input instance. * * @var array * @since 1.0 */ protected $options = array(); /** * Filter object to use. * * @var Filter\InputFilter * @since 1.0 */ protected $filter = null; /** * Input data. * * @var array * @since 1.0 */ protected $data = array(); /** * Input objects * * @var Input[] * @since 1.0 */ protected $inputs = array(); /** * Is all GLOBAL added * * @var boolean * @since 1.1.4 */ protected static $loaded = false; /** * Constructor. * * @param array $source Optional source data. If omitted, a copy of the server variable '_REQUEST' is used. * @param array $options An optional associative array of configuration parameters: * filter: An instance of Filter\Input. If omitted, a default filter is initialised. * * @since 1.0 */ public function __construct($source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = new Filter\InputFilter; } if (is_null($source)) { $this->data = &$_REQUEST; } else { $this->data = $source; } // Set the options for the class. $this->options = $options; } /** * Magic method to get an input object * * @param mixed $name Name of the input object to retrieve. * * @return Input The request input object * * @since 1.0 */ public function __get($name) { if (isset($this->inputs[$name])) { return $this->inputs[$name]; } $className = '\\Joomla\\Input\\' . ucfirst($name); if (class_exists($className)) { $this->inputs[$name] = new $className(null, $this->options); return $this->inputs[$name]; } $superGlobal = '_' . strtoupper($name); if (isset($GLOBALS[$superGlobal])) { $this->inputs[$name] = new Input($GLOBALS[$superGlobal], $this->options); return $this->inputs[$name]; } // TODO throw an exception } /** * Get the number of variables. * * @return integer The number of variables in the input. * * @since 1.0 * @see Countable::count() */ public function count() { return count($this->data); } /** * Gets a value from the input data. * * @param string $name Name of the value to get. * @param mixed $default Default value to return if variable does not exist. * @param string $filter Filter to apply to the value. * * @return mixed The filtered input value. * * @see \Joomla\Filter\InputFilter::clean() * @since 1.0 */ public function get($name, $default = null, $filter = 'cmd') { if (isset($this->data[$name])) { return $this->filter->clean($this->data[$name], $filter); } return $default; } /** * Gets an array of values from the request. * * @param array $vars Associative array of keys and filter types to apply. * If empty and datasource is null, all the input data will be returned * but filtered using the default case in JFilterInput::clean. * @param mixed $datasource Array to retrieve data from, or null * * @return mixed The filtered input data. * * @since 1.0 */ public function getArray(array $vars = array(), $datasource = null) { if (empty($vars) && is_null($datasource)) { $vars = $this->data; } $results = array(); foreach ($vars as $k => $v) { if (is_array($v)) { if (is_null($datasource)) { $results[$k] = $this->getArray($v, $this->get($k, null, 'array')); } else { $results[$k] = $this->getArray($v, $datasource[$k]); } } else { if (is_null($datasource)) { $results[$k] = $this->get($k, null, $v); } elseif (isset($datasource[$k])) { $results[$k] = $this->filter->clean($datasource[$k], $v); } else { $results[$k] = $this->filter->clean(null, $v); } } } return $results; } /** * Sets a value * * @param string $name Name of the value to set. * @param mixed $value Value to assign to the input. * * @return void * * @since 1.0 */ public function set($name, $value) { $this->data[$name] = $value; } /** * Define a value. The value will only be set if there's no value for the name or if it is null. * * @param string $name Name of the value to define. * @param mixed $value Value to assign to the input. * * @return void * * @since 1.0 */ public function def($name, $value) { if (isset($this->data[$name])) { return; } $this->data[$name] = $value; } /** * Check if a value name exists. * * @param string $path Value name * * @return boolean * * @since 1.2.0 */ public function exists($name) { return isset($this->data[$name]); } /** * Magic method to get filtered input data. * * @param string $name Name of the filter type prefixed with 'get'. * @param array $arguments [0] The name of the variable [1] The default value. * * @return mixed The filtered input value. * * @since 1.0 */ public function __call($name, $arguments) { if (substr($name, 0, 3) == 'get') { $filter = substr($name, 3); $default = null; if (isset($arguments[1])) { $default = $arguments[1]; } return $this->get($arguments[0], $default, $filter); } } /** * Gets the request method. * * @return string The request method. * * @since 1.0 */ public function getMethod() { $method = strtoupper($_SERVER['REQUEST_METHOD']); return $method; } /** * Method to serialize the input. * * @return string The serialized input. * * @since 1.0 */ public function serialize() { // Load all of the inputs. $this->loadAllInputs(); // Remove $_ENV and $_SERVER from the inputs. $inputs = $this->inputs; unset($inputs['env']); unset($inputs['server']); // Serialize the options, data, and inputs. return serialize(array($this->options, $this->data, $inputs)); } /** * Method to unserialize the input. * * @param string $input The serialized input. * * @return Input The input object. * * @since 1.0 */ public function unserialize($input) { // Unserialize the options, data, and inputs. list($this->options, $this->data, $this->inputs) = unserialize($input); // Load the filter. if (isset($this->options['filter'])) { $this->filter = $this->options['filter']; } else { $this->filter = new Filter\InputFilter; } } /** * Method to load all of the global inputs. * * @return void * * @since 1.0 */ protected function loadAllInputs() { if (!self::$loaded) { // Load up all the globals. foreach ($GLOBALS as $global => $data) { // Check if the global starts with an underscore. if (strpos($global, '_') === 0) { // Convert global name to input name. $global = strtolower($global); $global = substr($global, 1); // Get the input. $this->$global; } } self::$loaded = true; } } } PK���\�Ѕ�[[)libraries/vendor/joomla/input/src/Cli.phpnu�[���<?php /** * Part of the Joomla Framework Input Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Input; use Joomla\Filter; /** * Joomla! Input CLI Class * * @since 1.0 */ class Cli extends Input { /** * The executable that was called to run the CLI script. * * @var string * @since 1.0 */ public $executable; /** * The additional arguments passed to the script that are not associated * with a specific argument name. * * @var array * @since 1.0 */ public $args = array(); /** * Constructor. * * @param array $source Source data (Optional, default is $_REQUEST) * @param array $options Array of configuration parameters (Optional) * * @since 1.0 */ public function __construct(array $source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = new Filter\InputFilter; } // Get the command line options $this->parseArguments(); // Set the options for the class. $this->options = $options; } /** * Method to serialize the input. * * @return string The serialized input. * * @since 1.0 */ public function serialize() { // Load all of the inputs. $this->loadAllInputs(); // Remove $_ENV and $_SERVER from the inputs. $inputs = $this->inputs; unset($inputs['env']); unset($inputs['server']); // Serialize the executable, args, options, data, and inputs. return serialize(array($this->executable, $this->args, $this->options, $this->data, $inputs)); } /** * Gets a value from the input data. * * @param string $name Name of the value to get. * @param mixed $default Default value to return if variable does not exist. * @param string $filter Filter to apply to the value. * * @return mixed The filtered input value. * * @since 1.0 */ public function get($name, $default = null, $filter = 'string') { return parent::get($name, $default, $filter); } /** * Method to unserialize the input. * * @param string $input The serialized input. * * @return Input The input object. * * @since 1.0 */ public function unserialize($input) { // Unserialize the executable, args, options, data, and inputs. list($this->executable, $this->args, $this->options, $this->data, $this->inputs) = unserialize($input); // Load the filter. if (isset($this->options['filter'])) { $this->filter = $this->options['filter']; } else { $this->filter = new Filter\InputFilter; } } /** * Initialise the options and arguments * * Not supported: -abc c-value * * @return void * * @since 1.0 */ protected function parseArguments() { $argv = $_SERVER['argv']; $this->executable = array_shift($argv); $out = array(); for ($i = 0, $j = count($argv); $i < $j; $i++) { $arg = $argv[$i]; // --foo --bar=baz if (substr($arg, 0, 2) === '--') { $eqPos = strpos($arg, '='); // --foo if ($eqPos === false) { $key = substr($arg, 2); // --foo value if ($i + 1 < $j && $argv[$i + 1][0] !== '-') { $value = $argv[$i + 1]; $i++; } else { $value = isset($out[$key]) ? $out[$key] : true; } $out[$key] = $value; } // --bar=baz else { $key = substr($arg, 2, $eqPos - 2); $value = substr($arg, $eqPos + 1); $out[$key] = $value; } } // -k=value -abc else if (substr($arg, 0, 1) === '-') { // -k=value if (substr($arg, 2, 1) === '=') { $key = substr($arg, 1, 1); $value = substr($arg, 3); $out[$key] = $value; } // -abc else { $chars = str_split(substr($arg, 1)); foreach ($chars as $char) { $key = $char; $value = isset($out[$key]) ? $out[$key] : true; $out[$key] = $value; } // -a a-value if ((count($chars) === 1) && ($i + 1 < $j) && ($argv[$i + 1][0] !== '-')) { $out[$key] = $argv[$i + 1]; $i++; } } } // plain-arg else { $this->args[] = $arg; } } $this->data = $out; } } PK���\ I��*libraries/vendor/joomla/input/src/Json.phpnu�[���<?php /** * Part of the Joomla Framework Input Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Input; use Joomla\Filter; /** * Joomla! Input JSON Class * * This class decodes a JSON string from the raw request data and makes it available via * the standard Input interface. * * @since 1.0 */ class Json extends Input { /** * @var string The raw JSON string from the request. * @since 1.0 */ private $raw; /** * Constructor. * * @param array $source Source data (Optional, default is the raw HTTP input decoded from JSON) * @param array $options Array of configuration parameters (Optional) * * @since 1.0 */ public function __construct(array $source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = new Filter\InputFilter; } if (is_null($source)) { $this->raw = file_get_contents('php://input'); // This is a workaround for where php://input has already been read. // See note under php://input on http://php.net/manual/en/wrappers.php.php if (empty($this->raw) && isset($GLOBALS['HTTP_RAW_POST_DATA'])) { $this->raw = $GLOBALS['HTTP_RAW_POST_DATA']; } $this->data = json_decode($this->raw, true); if (!is_array($this->data)) { $this->data = array(); } } else { $this->data = $source; } // Set the options for the class. $this->options = $options; } /** * Gets the raw JSON string from the request. * * @return string The raw JSON string from the request. * * @since 1.0 */ public function getRaw() { return $this->raw; } } PK���\��� � +libraries/vendor/joomla/input/src/Files.phpnu�[���<?php /** * Part of the Joomla Framework Input Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Input; use Joomla\Filter; /** * Joomla! Input Files Class * * @since 1.0 */ class Files extends Input { /** * The pivoted data from a $_FILES or compatible array. * * @var array * @since 1.0 */ protected $decodedData = array(); /** * The class constructor. * * @param array $source The source argument is ignored. $_FILES is always used. * @param array $options An optional array of configuration options: * filter : a custom JFilterInput object. * * @since 1.0 */ public function __construct(array $source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = new Filter\InputFilter; } // Set the data source. $this->data = & $_FILES; // Set the options for the class. $this->options = $options; } /** * Gets a value from the input data. * * @param string $name The name of the input property (usually the name of the files INPUT tag) to get. * @param mixed $default The default value to return if the named property does not exist. * @param string $filter The filter to apply to the value. * * @return mixed The filtered input value. * * @see \Joomla\Filter\InputFilter::clean() * @since 1.0 */ public function get($name, $default = null, $filter = 'cmd') { if (isset($this->data[$name])) { $results = $this->decodeData( array( $this->data[$name]['name'], $this->data[$name]['type'], $this->data[$name]['tmp_name'], $this->data[$name]['error'], $this->data[$name]['size'] ) ); return $results; } return $default; } /** * Method to decode a data array. * * @param array $data The data array to decode. * * @return array * * @since 1.0 */ protected function decodeData(array $data) { $result = array(); if (is_array($data[0])) { foreach ($data[0] as $k => $v) { $result[$k] = $this->decodeData(array($data[0][$k], $data[1][$k], $data[2][$k], $data[3][$k], $data[4][$k])); } return $result; } return array('name' => $data[0], 'type' => $data[1], 'tmp_name' => $data[2], 'error' => $data[3], 'size' => $data[4]); } /** * Sets a value. * * @param string $name The name of the input property to set. * @param mixed $value The value to assign to the input property. * * @return void * * @since 1.0 */ public function set($name, $value) { // Restricts the usage of parent's set method. } } PK���\p���,libraries/vendor/joomla/input/src/Cookie.phpnu�[���<?php /** * Part of the Joomla Framework Input Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Input; use Joomla\Filter; /** * Joomla! Input Cookie Class * * @since 1.0 */ class Cookie extends Input { /** * Constructor. * * @param array $source Ignored. * @param array $options Array of configuration parameters (Optional) * * @since 1.0 */ public function __construct(array $source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter = $options['filter']; } else { $this->filter = new Filter\InputFilter; } // Set the data source. $this->data = & $_COOKIE; // Set the options for the class. $this->options = $options; } /** * Sets a value * * @param string $name Name of the value to set. * @param mixed $value Value to assign to the input. * @param integer $expire The time the cookie expires. This is a Unix timestamp so is in number * of seconds since the epoch. In other words, you'll most likely set this * with the time() function plus the number of seconds before you want it * to expire. Or you might use mktime(). time()+60*60*24*30 will set the * cookie to expire in 30 days. If set to 0, or omitted, the cookie will * expire at the end of the session (when the browser closes). * @param string $path The path on the server in which the cookie will be available on. If set * to '/', the cookie will be available within the entire domain. If set to * '/foo/', the cookie will only be available within the /foo/ directory and * all sub-directories such as /foo/bar/ of domain. The default value is the * current directory that the cookie is being set in. * @param string $domain The domain that the cookie is available to. To make the cookie available * on all subdomains of example.com (including example.com itself) then you'd * set it to '.example.com'. Although some browsers will accept cookies without * the initial ., RFC 2109 requires it to be included. Setting the domain to * 'www.example.com' or '.www.example.com' will make the cookie only available * in the www subdomain. * @param boolean $secure Indicates that the cookie should only be transmitted over a secure HTTPS * connection from the client. When set to TRUE, the cookie will only be set * if a secure connection exists. On the server-side, it's on the programmer * to send this kind of cookie only on secure connection (e.g. with respect * to $_SERVER["HTTPS"]). * @param boolean $httpOnly When TRUE the cookie will be made accessible only through the HTTP protocol. * This means that the cookie won't be accessible by scripting languages, such * as JavaScript. This setting can effectively help to reduce identity theft * through XSS attacks (although it is not supported by all browsers). * * @return void * * @link http://www.ietf.org/rfc/rfc2109.txt * @see setcookie() * @since 1.0 */ public function set($name, $value, $expire = 0, $path = '', $domain = '', $secure = false, $httpOnly = false) { setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly); $this->data[$name] = $value; } } PK���\�P�E�E#libraries/vendor/joomla/uri/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\���'libraries/vendor/joomla/uri/src/Uri.phpnu�[���<?php /** * Part of the Joomla Framework Uri Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Uri; /** * Uri Class * * This class parses a URI and provides a common interface for the Joomla Framework * to access and manipulate a URI. * * @since 1.0 */ class Uri extends AbstractUri { /** * Adds a query variable and value, replacing the value if it * already exists and returning the old value. * * @param string $name Name of the query variable to set. * @param string $value Value of the query variable. * * @return string Previous value for the query variable. * * @since 1.0 */ public function setVar($name, $value) { $tmp = isset($this->vars[$name]) ? $this->vars[$name] : null; $this->vars[$name] = $value; // Empty the query $this->query = null; return $tmp; } /** * Removes an item from the query string variables if it exists. * * @param string $name Name of variable to remove. * * @return void * * @since 1.0 */ public function delVar($name) { if (array_key_exists($name, $this->vars)) { unset($this->vars[$name]); // Empty the query $this->query = null; } } /** * Sets the query to a supplied string in format: * foo=bar&x=y * * @param mixed $query The query string or array. * * @return void * * @since 1.0 */ public function setQuery($query) { if (is_array($query)) { $this->vars = $query; } else { if (strpos($query, '&') !== false) { $query = str_replace('&', '&', $query); } parse_str($query, $this->vars); } // Empty the query $this->query = null; } /** * Set URI scheme (protocol) * ie. http, https, ftp, etc... * * @param string $scheme The URI scheme. * * @return void * * @since 1.0 */ public function setScheme($scheme) { $this->scheme = $scheme; } /** * Set URI username. * * @param string $user The URI username. * * @return void * * @since 1.0 */ public function setUser($user) { $this->user = $user; } /** * Set URI password. * * @param string $pass The URI password. * * @return void * * @since 1.0 */ public function setPass($pass) { $this->pass = $pass; } /** * Set URI host. * * @param string $host The URI host. * * @return void * * @since 1.0 */ public function setHost($host) { $this->host = $host; } /** * Set URI port. * * @param integer $port The URI port number. * * @return void * * @since 1.0 */ public function setPort($port) { $this->port = $port; } /** * Set the URI path string. * * @param string $path The URI path string. * * @return void * * @since 1.0 */ public function setPath($path) { $this->path = $this->cleanPath($path); } /** * Set the URI anchor string * everything after the "#". * * @param string $anchor The URI anchor string. * * @return void * * @since 1.0 */ public function setFragment($anchor) { $this->fragment = $anchor; } } PK���\G�.uu0libraries/vendor/joomla/uri/src/UriImmutable.phpnu�[���<?php /** * Part of the Joomla Framework Uri Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Uri; /** * Uri Class * * This is an immutable version of the uri class. * * @since 1.0 */ final class UriImmutable extends AbstractUri { /** * @var boolean Has this class been instantiated yet. * @since 1.0 */ private $constructed = false; /** * Prevent setting undeclared properties. * * @param string $name This is an immutable object, setting $name is not allowed. * @param mixed $value This is an immutable object, setting $value is not allowed. * * @return null This method always throws an exception. * * @since 1.0 * @throws \BadMethodCallException */ public function __set($name, $value) { throw new \BadMethodCallException('This is an immutable object'); } /** * This is a special constructor that prevents calling the __construct method again. * * @param string $uri The optional URI string * * @since 1.0 * @throws \BadMethodCallException */ public function __construct($uri = null) { if ($this->constructed === true) { throw new \BadMethodCallException('This is an immutable object'); } $this->constructed = true; parent::__construct($uri); } } PK���\f���0libraries/vendor/joomla/uri/src/UriInterface.phpnu�[���<?php /** * Part of the Joomla Framework Uri Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Uri; /** * Uri Interface * * Interface for read-only access to Uris. * * @since 1.0 */ interface UriInterface { /** * Magic method to get the string representation of the URI object. * * @return string * * @since 1.0 */ public function __toString(); /** * Returns full uri string. * * @param array $parts An array specifying the parts to render. * * @return string The rendered URI string. * * @since 1.0 */ public function toString(array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment')); /** * Checks if variable exists. * * @param string $name Name of the query variable to check. * * @return boolean True if the variable exists. * * @since 1.0 */ public function hasVar($name); /** * Returns a query variable by name. * * @param string $name Name of the query variable to get. * @param string $default Default value to return if the variable is not set. * * @return array Query variables. * * @since 1.0 */ public function getVar($name, $default = null); /** * Returns flat query string. * * @param boolean $toArray True to return the query as a key => value pair array. * * @return string Query string. * * @since 1.0 */ public function getQuery($toArray = false); /** * Get URI scheme (protocol) * ie. http, https, ftp, etc... * * @return string The URI scheme. * * @since 1.0 */ public function getScheme(); /** * Get URI username * Returns the username, or null if no username was specified. * * @return string The URI username. * * @since 1.0 */ public function getUser(); /** * Get URI password * Returns the password, or null if no password was specified. * * @return string The URI password. * * @since 1.0 */ public function getPass(); /** * Get URI host * Returns the hostname/ip or null if no hostname/ip was specified. * * @return string The URI host. * * @since 1.0 */ public function getHost(); /** * Get URI port * Returns the port number, or null if no port was specified. * * @return integer The URI port number. * * @since 1.0 */ public function getPort(); /** * Gets the URI path string. * * @return string The URI path string. * * @since 1.0 */ public function getPath(); /** * Get the URI archor string * Everything after the "#". * * @return string The URI anchor string. * * @since 1.0 */ public function getFragment(); /** * Checks whether the current URI is using HTTPS. * * @return boolean True if using SSL via HTTPS. * * @since 1.0 */ public function isSSL(); } PK���\n�����-libraries/vendor/joomla/uri/src/UriHelper.phpnu�[���<?php /** * Part of the Joomla Framework Uri Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Uri; /** * Uri Helper * * This class provides an UTF-8 safe version of parse_url(). * * @since 1.0 */ class UriHelper { /** * Does a UTF-8 safe version of PHP parse_url function * * @param string $url URL to parse * * @return mixed Associative array or false if badly formed URL. * * @see http://us3.php.net/manual/en/function.parse-url.php * @since 1.0 */ public static function parse_url($url) { $result = false; // Build arrays of values we need to decode before parsing $entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%24', '%2C', '%2F', '%3F', '%23', '%5B', '%5D'); $replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "$", ",", "/", "?", "#", "[", "]"); // Create encoded URL with special URL characters decoded so it can be parsed // All other characters will be encoded $encodedURL = str_replace($entities, $replacements, urlencode($url)); // Parse the encoded URL $encodedParts = parse_url($encodedURL); // Now, decode each value of the resulting array if ($encodedParts) { foreach ($encodedParts as $key => $value) { $result[$key] = urldecode(str_replace($replacements, $entities, $value)); } } return $result; } } PK���\T<8(� � /libraries/vendor/joomla/uri/src/AbstractUri.phpnu�[���<?php /** * Part of the Joomla Framework Uri Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Uri; /** * Uri Class * * Abstract base for out uri classes. * * This class should be considered an implementation detail. Typehint against UriInterface. * * @since 1.0 */ abstract class AbstractUri implements UriInterface { /** * @var string Original URI * @since 1.0 */ protected $uri = null; /** * @var string Protocol * @since 1.0 */ protected $scheme = null; /** * @var string Host * @since 1.0 */ protected $host = null; /** * @var integer Port * @since 1.0 */ protected $port = null; /** * @var string Username * @since 1.0 */ protected $user = null; /** * @var string Password * @since 1.0 */ protected $pass = null; /** * @var string Path * @since 1.0 */ protected $path = null; /** * @var string Query * @since 1.0 */ protected $query = null; /** * @var string Anchor * @since 1.0 */ protected $fragment = null; /** * @var array Query variable hash * @since 1.0 */ protected $vars = array(); /** * Constructor. * You can pass a URI string to the constructor to initialise a specific URI. * * @param string $uri The optional URI string * * @since 1.0 */ public function __construct($uri = null) { if (!is_null($uri)) { $this->parse($uri); } } /** * Magic method to get the string representation of the URI object. * * @return string * * @since 1.0 */ public function __toString() { return $this->toString(); } /** * Returns full uri string. * * @param array $parts An array specifying the parts to render. * * @return string The rendered URI string. * * @since 1.0 */ public function toString(array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment')) { // Make sure the query is created $query = $this->getQuery(); $uri = ''; $uri .= in_array('scheme', $parts) ? (!empty($this->scheme) ? $this->scheme . '://' : '') : ''; $uri .= in_array('user', $parts) ? $this->user : ''; $uri .= in_array('pass', $parts) ? (!empty($this->pass) ? ':' : '') . $this->pass . (!empty($this->user) ? '@' : '') : ''; $uri .= in_array('host', $parts) ? $this->host : ''; $uri .= in_array('port', $parts) ? (!empty($this->port) ? ':' : '') . $this->port : ''; $uri .= in_array('path', $parts) ? $this->path : ''; $uri .= in_array('query', $parts) ? (!empty($query) ? '?' . $query : '') : ''; $uri .= in_array('fragment', $parts) ? (!empty($this->fragment) ? '#' . $this->fragment : '') : ''; return $uri; } /** * Checks if variable exists. * * @param string $name Name of the query variable to check. * * @return boolean True if the variable exists. * * @since 1.0 */ public function hasVar($name) { return array_key_exists($name, $this->vars); } /** * Returns a query variable by name. * * @param string $name Name of the query variable to get. * @param string $default Default value to return if the variable is not set. * * @return array Query variables. * * @since 1.0 */ public function getVar($name, $default = null) { if (array_key_exists($name, $this->vars)) { return $this->vars[$name]; } return $default; } /** * Returns flat query string. * * @param boolean $toArray True to return the query as a key => value pair array. * * @return string Query string. * * @since 1.0 */ public function getQuery($toArray = false) { if ($toArray) { return $this->vars; } // If the query is empty build it first if (is_null($this->query)) { $this->query = self::buildQuery($this->vars); } return $this->query; } /** * Get URI scheme (protocol) * ie. http, https, ftp, etc... * * @return string The URI scheme. * * @since 1.0 */ public function getScheme() { return $this->scheme; } /** * Get URI username * Returns the username, or null if no username was specified. * * @return string The URI username. * * @since 1.0 */ public function getUser() { return $this->user; } /** * Get URI password * Returns the password, or null if no password was specified. * * @return string The URI password. * * @since 1.0 */ public function getPass() { return $this->pass; } /** * Get URI host * Returns the hostname/ip or null if no hostname/ip was specified. * * @return string The URI host. * * @since 1.0 */ public function getHost() { return $this->host; } /** * Get URI port * Returns the port number, or null if no port was specified. * * @return integer The URI port number. * * @since 1.0 */ public function getPort() { return (isset($this->port)) ? $this->port : null; } /** * Gets the URI path string. * * @return string The URI path string. * * @since 1.0 */ public function getPath() { return $this->path; } /** * Get the URI archor string * Everything after the "#". * * @return string The URI anchor string. * * @since 1.0 */ public function getFragment() { return $this->fragment; } /** * Checks whether the current URI is using HTTPS. * * @return boolean True if using SSL via HTTPS. * * @since 1.0 */ public function isSSL() { return $this->getScheme() == 'https' ? true : false; } /** * Build a query from a array (reverse of the PHP parse_str()). * * @param array $params The array of key => value pairs to return as a query string. * * @return string The resulting query string. * * @see parse_str() * @since 1.0 */ protected static function buildQuery(array $params) { return urldecode(http_build_query($params, '', '&')); } /** * Parse a given URI and populate the class fields. * * @param string $uri The URI string to parse. * * @return boolean True on success. * * @since 1.0 */ protected function parse($uri) { // Set the original URI to fall back on $this->uri = $uri; /* * Parse the URI and populate the object fields. If URI is parsed properly, * set method return value to true. */ $parts = UriHelper::parse_url($uri); $retval = ($parts) ? true : false; // We need to replace & with & for parse_str to work right... if (isset($parts['query']) && strpos($parts['query'], '&')) { $parts['query'] = str_replace('&', '&', $parts['query']); } $this->scheme = isset($parts['scheme']) ? $parts['scheme'] : null; $this->user = isset($parts['user']) ? $parts['user'] : null; $this->pass = isset($parts['pass']) ? $parts['pass'] : null; $this->host = isset($parts['host']) ? $parts['host'] : null; $this->port = isset($parts['port']) ? $parts['port'] : null; $this->path = isset($parts['path']) ? $parts['path'] : null; $this->query = isset($parts['query']) ? $parts['query'] : null; $this->fragment = isset($parts['fragment']) ? $parts['fragment'] : null; // Parse the query if (isset($parts['query'])) { parse_str($parts['query'], $this->vars); } return $retval; } /** * Resolves //, ../ and ./ from a path and returns * the result. Eg: * * /foo/bar/../boo.php => /foo/boo.php * /foo/bar/../../boo.php => /boo.php * /foo/bar/.././/boo.php => /foo/boo.php * * @param string $path The URI path to clean. * * @return string Cleaned and resolved URI path. * * @since 1.0 */ protected function cleanPath($path) { $path = explode('/', preg_replace('#(/+)#', '/', $path)); for ($i = 0, $n = count($path); $i < $n; $i++) { if ($path[$i] == '.' || $path[$i] == '..') { if (($path[$i] == '.') || ($path[$i] == '..' && $i == 1 && $path[0] == '')) { unset($path[$i]); $path = array_values($path); $i--; $n--; } elseif ($path[$i] == '..' && ($i > 1 || ($i == 1 && $path[0] != ''))) { unset($path[$i]); unset($path[$i - 1]); $path = array_values($path); $i -= 2; $n -= 2; } } } return implode('/', $path); } } PK���\�P�E�E"libraries/vendor/joomla/di/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\<�v��:libraries/vendor/joomla/di/src/ContainerAwareInterface.phpnu�[���<?php /** * Part of the Joomla Framework DI Package * * @copyright Copyright (C) 2013 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\DI; /** * Defines the interface for a Container Aware class. * * @since 1.0 */ interface ContainerAwareInterface { /** * Get the DI container. * * @return Container * * @since 1.0 * * @throws \UnexpectedValueException May be thrown if the container has not been set. */ public function getContainer(); /** * Set the DI container. * * @param Container $container The DI container. * * @return mixed * * @since 1.0 */ public function setContainer(Container $container); } PK���\�U��??;libraries/vendor/joomla/di/src/ServiceProviderInterface.phpnu�[���<?php /** * Part of the Joomla Framework DI Package * * @copyright Copyright (C) 2013 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\DI; /** * Defines the interface for a Service Provider. * * @since 1.0 */ interface ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 1.0 */ public function register(Container $container); } PK���\'�;�~~6libraries/vendor/joomla/di/src/ContainerAwareTrait.phpnu�[���<?php /** * Part of the Joomla Framework DI Package * * @copyright Copyright (C) 2013 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\DI; use Joomla\DI\Container; /** * Defines the trait for a Container Aware Class. * * @since 1.2 * * @note Traits are available in PHP 5.4+ */ trait ContainerAwareTrait { /** * DI Container * * @var Container * @since 1.2 */ private $container; /** * Get the DI container. * * @return Container * * @since 1.2 * * @throws \UnexpectedValueException May be thrown if the container has not been set. */ public function getContainer() { if ($this->container) { return $this->container; } throw new \UnexpectedValueException('Container not set in ' . __CLASS__); } /** * Set the DI container. * * @param Container $container The DI container. * * @return mixed Returns itself to support chaining. * * @since 1.2 */ public function setContainer(Container $container) { $this->container = $container; return $this; } } PK���\C�U�E(E(,libraries/vendor/joomla/di/src/Container.phpnu�[���<?php /** * Part of the Joomla Framework DI Package * * @copyright Copyright (C) 2013 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\DI; use Joomla\DI\Exception\DependencyResolutionException; /** * The Container class. * * @since 1.0 */ class Container { /** * Holds the key aliases. * * @var array $aliases * @since 1.0 */ protected $aliases = array(); /** * Holds the shared instances. * * @var array $instances * @since 1.0 */ protected $instances = array(); /** * Holds the keys, their callbacks, and whether or not * the item is meant to be a shared resource. * * @var array $dataStore * @since 1.0 */ protected $dataStore = array(); /** * Parent for hierarchical containers. * * @var Container * @since 1.0 */ protected $parent; /** * Constructor for the DI Container * * @param Container $parent Parent for hierarchical containers. * * @since 1.0 */ public function __construct(Container $parent = null) { $this->parent = $parent; } /** * Create an alias for a given key for easy access. * * @param string $alias The alias name * @param string $key The key to alias * * @return Container This object for chaining. * * @since 1.0 */ public function alias($alias, $key) { $this->aliases[$alias] = $key; return $this; } /** * Search the aliases property for a matching alias key. * * @param string $key The key to search for. * * @return string * * @since 1.0 */ protected function resolveAlias($key) { if (isset($this->aliases[$key])) { return $this->aliases[$key]; } return $key; } /** * Build an object of class $key; * * @param string $key The class name to build. * @param boolean $shared True to create a shared resource. * * @return mixed Instance of class specified by $key with all dependencies injected. * Returns an object if the class exists and false otherwise * * @since 1.0 */ public function buildObject($key, $shared = false) { try { $reflection = new \ReflectionClass($key); } catch (\ReflectionException $e) { return false; } $constructor = $reflection->getConstructor(); // If there are no parameters, just return a new object. if (is_null($constructor)) { $callback = function () use ($key) { return new $key; }; } else { $newInstanceArgs = $this->getMethodArgs($constructor); // Create a callable for the dataStore $callback = function () use ($reflection, $newInstanceArgs) { return $reflection->newInstanceArgs($newInstanceArgs); }; } return $this->set($key, $callback, $shared)->get($key); } /** * Convenience method for building a shared object. * * @param string $key The class name to build. * * @return object Instance of class specified by $key with all dependencies injected. * * @since 1.0 */ public function buildSharedObject($key) { return $this->buildObject($key, true); } /** * Create a child Container with a new property scope that * that has the ability to access the parent scope when resolving. * * @return Container This object for chaining. * * @since 1.0 */ public function createChild() { return new static($this); } /** * Extend a defined service Closure by wrapping the existing one with a new Closure. This * works very similar to a decorator pattern. Note that this only works on service Closures * that have been defined in the current Provider, not parent providers. * * @param string $key The unique identifier for the Closure or property. * @param \Closure $callable A Closure to wrap the original service Closure. * * @return void * * @since 1.0 * @throws \InvalidArgumentException */ public function extend($key, \Closure $callable) { $key = $this->resolveAlias($key); $raw = $this->getRaw($key); if (is_null($raw)) { throw new \InvalidArgumentException(sprintf('The requested key %s does not exist to extend.', $key)); } $closure = function ($c) use($callable, $raw) { return $callable($raw['callback']($c), $c); }; $this->set($key, $closure, $raw['shared']); } /** * Build an array of constructor parameters. * * @param \ReflectionMethod $method Method for which to build the argument array. * * @return array Array of arguments to pass to the method. * * @since 1.0 * @throws DependencyResolutionException */ protected function getMethodArgs(\ReflectionMethod $method) { $methodArgs = array(); foreach ($method->getParameters() as $param) { $dependency = $param->getClass(); $dependencyVarName = $param->getName(); // If we have a dependency, that means it has been type-hinted. if (!is_null($dependency)) { $dependencyClassName = $dependency->getName(); // If the dependency class name is registered with this container or a parent, use it. if ($this->getRaw($dependencyClassName) !== null) { $depObject = $this->get($dependencyClassName); } else { $depObject = $this->buildObject($dependencyClassName); } if ($depObject instanceof $dependencyClassName) { $methodArgs[] = $depObject; continue; } } // Finally, if there is a default parameter, use it. if ($param->isOptional()) { $methodArgs[] = $param->getDefaultValue(); continue; } // Couldn't resolve dependency, and no default was provided. throw new DependencyResolutionException(sprintf('Could not resolve dependency: %s', $dependencyVarName)); } return $methodArgs; } /** * Method to set the key and callback to the dataStore array. * * @param string $key Name of dataStore key to set. * @param mixed $value Callable function to run or string to retrive when requesting the specified $key. * @param boolean $shared True to create and store a shared instance. * @param boolean $protected True to protect this item from being overwritten. Useful for services. * * @return Container This object for chaining. * * @throws \OutOfBoundsException Thrown if the provided key is already set and is protected. * * @since 1.0 */ public function set($key, $value, $shared = false, $protected = false) { if (isset($this->dataStore[$key]) && $this->dataStore[$key]['protected'] === true) { throw new \OutOfBoundsException(sprintf('Key %s is protected and can\'t be overwritten.', $key)); } // If the provided $value is not a closure, make it one now for easy resolution. if (!is_callable($value)) { $value = function () use ($value) { return $value; }; } $this->dataStore[$key] = array( 'callback' => $value, 'shared' => $shared, 'protected' => $protected ); return $this; } /** * Convenience method for creating protected keys. * * @param string $key Name of dataStore key to set. * @param callable $callback Callable function to run when requesting the specified $key. * @param bool $shared True to create and store a shared instance. * * @return Container This object for chaining. * * @since 1.0 */ public function protect($key, $callback, $shared = false) { return $this->set($key, $callback, $shared, true); } /** * Convenience method for creating shared keys. * * @param string $key Name of dataStore key to set. * @param callable $callback Callable function to run when requesting the specified $key. * @param bool $protected True to create and store a shared instance. * * @return Container This object for chaining. * * @since 1.0 */ public function share($key, $callback, $protected = false) { return $this->set($key, $callback, true, $protected); } /** * Method to retrieve the results of running the $callback for the specified $key; * * @param string $key Name of the dataStore key to get. * @param boolean $forceNew True to force creation and return of a new instance. * * @return mixed Results of running the $callback for the specified $key. * * @since 1.0 * @throws \InvalidArgumentException */ public function get($key, $forceNew = false) { $key = $this->resolveAlias($key); $raw = $this->getRaw($key); if (is_null($raw)) { throw new \InvalidArgumentException(sprintf('Key %s has not been registered with the container.', $key)); } if ($raw['shared']) { if (!isset($this->instances[$key]) || $forceNew) { $this->instances[$key] = $raw['callback']($this); } return $this->instances[$key]; } return call_user_func($raw['callback'], $this); } /** * Method to check if specified dataStore key exists. * * @param string $key Name of the dataStore key to check. * * @return boolean True for success * * @since 1.0 */ public function exists($key) { $key = $this->resolveAlias($key); return (bool) $this->getRaw($key); } /** * Get the raw data assigned to a key. * * @param string $key The key for which to get the stored item. * * @return mixed * * @since 1.0 */ protected function getRaw($key) { if (isset($this->dataStore[$key])) { return $this->dataStore[$key]; } elseif ($this->parent instanceof Container) { return $this->parent->getRaw($key); } return null; } /** * Method to force the container to return a new instance * of the results of the callback for requested $key. * * @param string $key Name of the dataStore key to get. * * @return mixed Results of running the $callback for the specified $key. * * @since 1.0 */ public function getNewInstance($key) { return $this->get($key, true); } /** * Register a service provider to the container. * * @param ServiceProviderInterface $provider The service provider to register. * * @return Container This object for chaining. * * @since 1.0 */ public function registerServiceProvider(ServiceProviderInterface $provider) { $provider->register($this); return $this; } } PK���\��G��Jlibraries/vendor/joomla/di/src/Exception/DependencyResolutionException.phpnu�[���<?php /** * Part of the Joomla Framework DI Package * * @copyright Copyright (C) 2013 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\DI\Exception; /** * Exception class for handling errors in resolving a dependency * * @since 1.0 */ class DependencyResolutionException extends \Exception { } PK���\�P�E�E&libraries/vendor/joomla/filter/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\2��3libraries/vendor/joomla/filter/src/OutputFilter.phpnu�[���<?php /** * Part of the Joomla Framework Filter Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Filter; use Joomla\Language\Language; use Joomla\String\String; /** * OutputFilter * * @since 1.0 */ class OutputFilter { /** * Makes an object safe to display in forms * * Object parameters that are non-string, array, object or start with underscore * will be converted * * @param object &$mixed An object to be parsed * @param integer $quote_style The optional quote style for the htmlspecialchars function * @param mixed $exclude_keys An optional string single field name or array of field names not to be parsed (eg, for a textarea) * * @return void * * @since 1.0 */ public static function objectHTMLSafe(&$mixed, $quote_style = ENT_QUOTES, $exclude_keys = '') { if (is_object($mixed)) { foreach (get_object_vars($mixed) as $k => $v) { if (is_array($v) || is_object($v) || $v == null || substr($k, 1, 1) == '_') { continue; } if (is_string($exclude_keys) && $k == $exclude_keys) { continue; } elseif (is_array($exclude_keys) && in_array($k, $exclude_keys)) { continue; } $mixed->$k = htmlspecialchars($v, $quote_style, 'UTF-8'); } } } /** * This method processes a string and replaces all instances of & with & in links only. * * @param string $input String to process * * @return string Processed string * * @since 1.0 */ public static function linkXHTMLSafe($input) { $regex = 'href="([^"]*(&(amp;){0})[^"]*)*?"'; return preg_replace_callback( "#$regex#i", function($m) { $rx = '&(?!amp;)'; return preg_replace('#' . $rx . '#', '&', $m[0]); }, $input ); } /** * This method processes a string and replaces all accented UTF-8 characters by unaccented * ASCII-7 "equivalents", whitespaces are replaced by hyphens and the string is lowercase. * * @param string $string String to process * * @return string Processed string * * @since 1.0 */ public static function stringURLSafe($string) { // Remove any '-' from the string since they will be used as concatenaters $str = str_replace('-', ' ', $string); $lang = Language::getInstance(); $str = $lang->transliterate($str); // Trim white spaces at beginning and end of alias and make lowercase $str = trim(String::strtolower($str)); // Remove any duplicate whitespace, and ensure all characters are alphanumeric $str = preg_replace('/(\s|[^A-Za-z0-9\-])+/', '-', $str); // Trim dashes at beginning and end of alias $str = trim($str, '-'); return $str; } /** * This method implements unicode slugs instead of transliteration. * * @param string $string String to process * * @return string Processed string * * @since 1.0 */ public static function stringURLUnicodeSlug($string) { // Replace double byte whitespaces by single byte (East Asian languages) $str = preg_replace('/\xE3\x80\x80/', ' ', $string); // Remove any '-' from the string as they will be used as concatenator. // Would be great to let the spaces in but only Firefox is friendly with this $str = str_replace('-', ' ', $str); // Replace forbidden characters by whitespaces $str = preg_replace('#[:\#\*"@+=;!><&\.%()\]\/\'\\\\|\[]#', "\x20", $str); // Delete all '?' $str = str_replace('?', '', $str); // Trim white spaces at beginning and end of alias and make lowercase $str = trim(String::strtolower($str)); // Remove any duplicate whitespace and replace whitespaces by hyphens $str = preg_replace('#\x20+#', '-', $str); return $str; } /** * Replaces & with & for XHTML compliance * * @param string $text Text to process * * @return string Processed string. * * @since 1.0 * * @todo There must be a better way??? */ public static function ampReplace($text) { $text = str_replace('&&', '*--*', $text); $text = str_replace('&#', '*-*', $text); $text = str_replace('&', '&', $text); $text = preg_replace('|&(?![\w]+;)|', '&', $text); $text = str_replace('*-*', '&#', $text); $text = str_replace('*--*', '&&', $text); return $text; } /** * Cleans text of all formatting and scripting code * * @param string &$text Text to clean * * @return string Cleaned text. * * @since 1.0 */ public static function cleanText(&$text) { $text = preg_replace("'<script[^>]*>.*?</script>'si", '', $text); $text = preg_replace('/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is', '\2 (\1)', $text); $text = preg_replace('/<!--.+?-->/', '', $text); $text = preg_replace('/{.+?}/', '', $text); $text = preg_replace('/ /', ' ', $text); $text = preg_replace('/&/', ' ', $text); $text = preg_replace('/"/', ' ', $text); $text = strip_tags($text); $text = htmlspecialchars($text, ENT_COMPAT, 'UTF-8'); return $text; } /** * Strip img-tags from string * * @param string $string Sting to be cleaned. * * @return string Cleaned string * * @since 1.0 */ public static function stripImages($string) { return preg_replace('#(<[/]?img.*>)#U', '', $string); } /** * Strip iframe-tags from string * * @param string $string Sting to be cleaned. * * @return string Cleaned string * * @since 1.0 */ public static function stripIframes($string) { return preg_replace('#(<[/]?iframe.*>)#U', '', $string); } } PK���\Ě��SS2libraries/vendor/joomla/filter/src/InputFilter.phpnu�[���<?php /** * Part of the Joomla Framework Filter Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Filter; /** * InputFilter is a class for filtering input from any data source * * Forked from the php input filter library by: Daniel Morris <dan@rootcube.com> * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie. * * @since 1.0 */ class InputFilter { /** * A container for InputFilter instances. * * @var InputFilter[] * @since 1.0 */ protected static $instances = array(); /** * The array of permitted tags (white list). * * @var array * @since 1.0 */ public $tagsArray; /** * The array of permitted tag attributes (white list). * * @var array * @since 1.0 */ public $attrArray; /** * The method for sanitising tags: WhiteList method = 0 (default), BlackList method = 1 * * @var integer * @since 1.0 */ public $tagsMethod; /** * The method for sanitising attributes: WhiteList method = 0 (default), BlackList method = 1 * * @var integer * @since 1.0 */ public $attrMethod; /** * A flag for XSS checks. Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 * * @var integer * @since 1.0 */ public $xssAuto; /** * The list of the default blacklisted tags. * * @var array * @since 1.0 */ public $tagBlacklist = array( 'applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml' ); /** * The list of the default blacklisted tag attributes. All event handlers implicit. * * @var array * @since 1.0 */ public $attrBlacklist = array( 'action', 'background', 'codebase', 'dynsrc', 'lowsrc' ); /** * Constructor for inputFilter class. Only first parameter is required. * * @param array $tagsArray List of user-defined tags * @param array $attrArray List of user-defined attributes * @param integer $tagsMethod WhiteList method = 0, BlackList method = 1 * @param integer $attrMethod WhiteList method = 0, BlackList method = 1 * @param integer $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 * * @since 1.0 */ public function __construct($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) { // Make sure user defined arrays are in lowercase $tagsArray = array_map('strtolower', (array) $tagsArray); $attrArray = array_map('strtolower', (array) $attrArray); // Assign member variables $this->tagsArray = $tagsArray; $this->attrArray = $attrArray; $this->tagsMethod = $tagsMethod; $this->attrMethod = $attrMethod; $this->xssAuto = $xssAuto; } /** * Method to be called by another php script. Processes for XSS and * specified bad code. * * @param mixed $source Input string/array-of-string to be 'cleaned' * @param string $type The return type for the variable: * INT: An integer, * UINT: An unsigned integer, * FLOAT: A floating point number, * BOOLEAN: A boolean value, * WORD: A string containing A-Z or underscores only (not case sensitive), * ALNUM: A string containing A-Z or 0-9 only (not case sensitive), * CMD: A string containing A-Z, 0-9, underscores, periods or hyphens (not case sensitive), * BASE64: A string containing A-Z, 0-9, forward slashes, plus or equals (not case sensitive), * STRING: A fully decoded and sanitised string (default), * HTML: A sanitised string, * ARRAY: An array, * PATH: A sanitised file path, * TRIM: A string trimmed from normal, non-breaking and multibyte spaces * USERNAME: Do not use (use an application specific filter), * RAW: The raw string is returned with no filtering, * unknown: An unknown filter will act like STRING. If the input is an array it will return an * array of fully decoded and sanitised strings. * * @return mixed 'Cleaned' version of input parameter * * @since 1.0 */ public function clean($source, $type = 'string') { // Handle the type constraint switch (strtoupper($type)) { case 'INT': case 'INTEGER': // Only use the first integer value preg_match('/-?[0-9]+/', (string) $source, $matches); $result = isset($matches[0]) ? (int) $matches[0] : 0; break; case 'UINT': // Only use the first integer value preg_match('/-?[0-9]+/', (string) $source, $matches); $result = isset($matches[0]) ? abs((int) $matches[0]) : 0; break; case 'FLOAT': case 'DOUBLE': // Only use the first floating point value preg_match('/-?[0-9]+(\.[0-9]+)?/', (string) $source, $matches); $result = isset($matches[0]) ? (float) $matches[0] : 0; break; case 'BOOL': case 'BOOLEAN': $result = (bool) $source; break; case 'WORD': $result = (string) preg_replace('/[^A-Z_]/i', '', $source); break; case 'ALNUM': $result = (string) preg_replace('/[^A-Z0-9]/i', '', $source); break; case 'CMD': $result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source); $result = ltrim($result, '.'); break; case 'BASE64': $result = (string) preg_replace('/[^A-Z0-9\/+=]/i', '', $source); break; case 'STRING': $result = (string) $this->remove($this->decode((string) $source)); break; case 'HTML': $result = (string) $this->remove((string) $source); break; case 'ARRAY': $result = (array) $source; break; case 'PATH': $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/'; preg_match($pattern, (string) $source, $matches); $result = isset($matches[0]) ? (string) $matches[0] : ''; break; case 'TRIM': $result = (string) trim($source); $result = trim($result, chr(0xE3) . chr(0x80) . chr(0x80)); $result = trim($result, chr(0xC2) . chr(0xA0)); break; case 'USERNAME': $result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); break; case 'RAW': $result = $source; break; default: // Are we dealing with an array? if (is_array($source)) { foreach ($source as $key => $value) { // Filter element for XSS and other 'bad' code etc. if (is_string($value)) { $source[$key] = $this->remove($this->decode($value)); } } $result = $source; } else { // Or a string? if (is_string($source) && !empty($source)) { // Filter source for XSS and other 'bad' code etc. $result = $this->remove($this->decode($source)); } else { // Not an array or string.. return the passed parameter $result = $source; } } break; } return $result; } /** * Function to determine if contents of an attribute are safe * * @param array $attrSubSet A 2 element array for attribute's name, value * * @return boolean True if bad code is detected * * @since 1.0 */ public static function checkAttribute($attrSubSet) { $attrSubSet[0] = strtolower($attrSubSet[0]); $attrSubSet[1] = strtolower($attrSubSet[1]); return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || (strpos($attrSubSet[1], 'javascript:') !== false) || (strpos($attrSubSet[1], 'behaviour:') !== false) || (strpos($attrSubSet[1], 'vbscript:') !== false) || (strpos($attrSubSet[1], 'mocha:') !== false) || (strpos($attrSubSet[1], 'livescript:') !== false)); } /** * Internal method to iteratively remove all unwanted tags and attributes * * @param string $source Input string to be 'cleaned' * * @return string 'Cleaned' version of input parameter * * @since 1.0 */ protected function remove($source) { $loopCounter = 0; // Iteration provides nested tag protection while ($source != $this->cleanTags($source)) { $source = $this->cleanTags($source); $loopCounter++; } return $source; } /** * Internal method to strip a string of certain tags * * @param string $source Input string to be 'cleaned' * * @return string 'Cleaned' version of input parameter * * @since 1.0 */ protected function cleanTags($source) { // First, pre-process this for illegal characters inside attribute values $source = $this->escapeAttributeValues($source); // In the beginning we don't really have a tag, so everything is postTag $preTag = null; $postTag = $source; $currentSpace = false; // Setting to null to deal with undefined variables $attr = ''; // Is there a tag? If so it will certainly start with a '<'. $tagOpen_start = strpos($source, '<'); while ($tagOpen_start !== false) { // Get some information about the tag we are processing $preTag .= substr($postTag, 0, $tagOpen_start); $postTag = substr($postTag, $tagOpen_start); $fromTagOpen = substr($postTag, 1); $tagOpen_end = strpos($fromTagOpen, '>'); // Check for mal-formed tag where we have a second '<' before the first '>' $nextOpenTag = (strlen($postTag) > $tagOpen_start) ? strpos($postTag, '<', $tagOpen_start + 1) : false; if (($nextOpenTag !== false) && ($nextOpenTag < $tagOpen_end)) { // At this point we have a mal-formed tag -- remove the offending open $postTag = substr($postTag, 0, $tagOpen_start) . substr($postTag, $tagOpen_start + 1); $tagOpen_start = strpos($postTag, '<'); continue; } // Let's catch any non-terminated tags and skip over them if ($tagOpen_end === false) { $postTag = substr($postTag, $tagOpen_start + 1); $tagOpen_start = strpos($postTag, '<'); continue; } // Do we have a nested tag? $tagOpen_nested = strpos($fromTagOpen, '<'); if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) { $preTag .= substr($postTag, 0, ($tagOpen_nested + 1)); $postTag = substr($postTag, ($tagOpen_nested + 1)); $tagOpen_start = strpos($postTag, '<'); continue; } // Let's get some information about our tag and setup attribute pairs $tagOpen_nested = (strpos($fromTagOpen, '<') + $tagOpen_start + 1); $currentTag = substr($fromTagOpen, 0, $tagOpen_end); $tagLength = strlen($currentTag); $tagLeft = $currentTag; $attrSet = array(); $currentSpace = strpos($tagLeft, ' '); // Are we an open tag or a close tag? if (substr($currentTag, 0, 1) == '/') { // Close Tag $isCloseTag = true; list ($tagName) = explode(' ', $currentTag); $tagName = substr($tagName, 1); } else { // Open Tag $isCloseTag = false; list ($tagName) = explode(' ', $currentTag); } /* * Exclude all "non-regular" tagnames * OR no tagname * OR remove if xssauto is on and tag is blacklisted */ if ((!preg_match("/^[a-z][a-z0-9]*$/i", $tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) { $postTag = substr($postTag, ($tagLength + 2)); $tagOpen_start = strpos($postTag, '<'); // Strip tag continue; } /* * Time to grab any attributes from the tag... need this section in * case attributes have spaces in the values. */ while ($currentSpace !== false) { $attr = ''; $fromSpace = substr($tagLeft, ($currentSpace + 1)); $nextEqual = strpos($fromSpace, '='); $nextSpace = strpos($fromSpace, ' '); $openQuotes = strpos($fromSpace, '"'); $closeQuotes = strpos(substr($fromSpace, ($openQuotes + 1)), '"') + $openQuotes + 1; $startAtt = ''; $startAttPosition = 0; // Find position of equal and open quotes ignoring if (preg_match('#\s*=\s*\"#', $fromSpace, $matches, PREG_OFFSET_CAPTURE)) { $startAtt = $matches[0][0]; $startAttPosition = $matches[0][1]; $closeQuotes = strpos(substr($fromSpace, ($startAttPosition + strlen($startAtt))), '"') + $startAttPosition + strlen($startAtt); $nextEqual = $startAttPosition + strpos($startAtt, '='); $openQuotes = $startAttPosition + strpos($startAtt, '"'); $nextSpace = strpos(substr($fromSpace, $closeQuotes), ' ') + $closeQuotes; } // Do we have an attribute to process? [check for equal sign] if ($fromSpace != '/' && (($nextEqual && $nextSpace && $nextSpace < $nextEqual) || !$nextEqual)) { if (!$nextEqual) { $attribEnd = strpos($fromSpace, '/') - 1; } else { $attribEnd = $nextSpace - 1; } // If there is an ending, use this, if not, do not worry. if ($attribEnd > 0) { $fromSpace = substr($fromSpace, $attribEnd + 1); } } if (strpos($fromSpace, '=') !== false) { // If the attribute value is wrapped in quotes we need to grab the substring from // the closing quote, otherwise grab until the next space. if (($openQuotes !== false) && (strpos(substr($fromSpace, ($openQuotes + 1)), '"') !== false)) { $attr = substr($fromSpace, 0, ($closeQuotes + 1)); } else { $attr = substr($fromSpace, 0, $nextSpace); } } else // No more equal signs so add any extra text in the tag into the attribute array [eg. checked] { if ($fromSpace != '/') { $attr = substr($fromSpace, 0, $nextSpace); } } // Last Attribute Pair if (!$attr && $fromSpace != '/') { $attr = $fromSpace; } // Add attribute pair to the attribute array $attrSet[] = $attr; // Move search point and continue iteration $tagLeft = substr($fromSpace, strlen($attr)); $currentSpace = strpos($tagLeft, ' '); } // Is our tag in the user input array? $tagFound = in_array(strtolower($tagName), $this->tagsArray); // If the tag is allowed let's append it to the output string. if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) { // Reconstruct tag with allowed attributes if (!$isCloseTag) { // Open or single tag $attrSet = $this->cleanAttributes($attrSet); $preTag .= '<' . $tagName; for ($i = 0, $count = count($attrSet); $i < $count; $i++) { $preTag .= ' ' . $attrSet[$i]; } // Reformat single tags to XHTML if (strpos($fromTagOpen, '</' . $tagName)) { $preTag .= '>'; } else { $preTag .= ' />'; } } else // Closing tag { $preTag .= '</' . $tagName . '>'; } } // Find next tag's start and continue iteration $postTag = substr($postTag, ($tagLength + 2)); $tagOpen_start = strpos($postTag, '<'); } // Append any code after the end of tags and return if ($postTag != '<') { $preTag .= $postTag; } return $preTag; } /** * Internal method to strip a tag of certain attributes * * @param array $attrSet Array of attribute pairs to filter * * @return array Filtered array of attribute pairs * * @since 1.0 */ protected function cleanAttributes($attrSet) { $newSet = array(); $count = count($attrSet); // Iterate through attribute pairs for ($i = 0; $i < $count; $i++) { // Skip blank spaces if (!$attrSet[$i]) { continue; } // Split into name/value pairs $attrSubSet = explode('=', trim($attrSet[$i]), 2); // Take the last attribute in case there is an attribute with no value $attrSubSet_0 = explode(' ', trim($attrSubSet[0])); $attrSubSet[0] = array_pop($attrSubSet_0); // Remove all "non-regular" attribute names // AND blacklisted attributes if ((!preg_match('/[a-z]*$/i', $attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on')))) { continue; } // XSS attribute value filtering if (isset($attrSubSet[1])) { // Trim leading and trailing spaces $attrSubSet[1] = trim($attrSubSet[1]); // Strips unicode, hex, etc $attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]); // Strip normal newline within attr value $attrSubSet[1] = preg_replace('/[\n\r]/', '', $attrSubSet[1]); // Strip double quotes $attrSubSet[1] = str_replace('"', '', $attrSubSet[1]); // Convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr values) if ((substr($attrSubSet[1], 0, 1) == "'") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'")) { $attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2)); } // Strip slashes $attrSubSet[1] = stripslashes($attrSubSet[1]); } else { continue; } // Autostrip script tags if (self::checkAttribute($attrSubSet)) { continue; } // Is our attribute in the user input array? $attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray); // If the tag is allowed lets keep it if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) { // Does the attribute have a value? if (empty($attrSubSet[1]) === false) { $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"'; } elseif ($attrSubSet[1] === "0") { // Special Case // Is the value 0? $newSet[] = $attrSubSet[0] . '="0"'; } else { // Leave empty attributes alone $newSet[] = $attrSubSet[0] . '=""'; } } } return $newSet; } /** * Try to convert to plaintext * * @param string $source The source string. * * @return string Plaintext string * * @since 1.0 * @deprecated This method will be removed once support for PHP 5.3 is discontinued. */ protected function decode($source) { return html_entity_decode($source, ENT_QUOTES, 'UTF-8'); } /** * Escape < > and " inside attribute values * * @param string $source The source string. * * @return string Filtered string * * @since 1.0 */ protected function escapeAttributeValues($source) { $alreadyFiltered = ''; $remainder = $source; $badChars = array('<', '"', '>'); $escapedChars = array('<', '"', '>'); // Process each portion based on presence of =" and "<space>, "/>, or "> // See if there are any more attributes to process while (preg_match('#<[^>]*?=\s*?(\"|\')#s', $remainder, $matches, PREG_OFFSET_CAPTURE)) { // Get the portion before the attribute value $quotePosition = $matches[0][1]; $nextBefore = $quotePosition + strlen($matches[0][0]); // Figure out if we have a single or double quote and look for the matching closing quote // Closing quote should be "/>, ">, "<space>, or " at the end of the string $quote = substr($matches[0][0], -1); $pregMatch = ($quote == '"') ? '#(\"\s*/\s*>|\"\s*>|\"\s+|\"$)#' : "#(\'\s*/\s*>|\'\s*>|\'\s+|\'$)#"; // Get the portion after attribute value if (preg_match($pregMatch, substr($remainder, $nextBefore), $matches, PREG_OFFSET_CAPTURE)) { // We have a closing quote $nextAfter = $nextBefore + $matches[0][1]; } else { // No closing quote $nextAfter = strlen($remainder); } // Get the actual attribute value $attributeValue = substr($remainder, $nextBefore, $nextAfter - $nextBefore); // Escape bad chars $attributeValue = str_replace($badChars, $escapedChars, $attributeValue); $attributeValue = $this->stripCssExpressions($attributeValue); $alreadyFiltered .= substr($remainder, 0, $nextBefore) . $attributeValue . $quote; $remainder = substr($remainder, $nextAfter + 1); } // At this point, we just have to return the $alreadyFiltered and the $remainder return $alreadyFiltered . $remainder; } /** * Remove CSS Expressions in the form of <property>:expression(...) * * @param string $source The source string. * * @return string Filtered string * * @since 1.0 */ protected function stripCssExpressions($source) { // Strip any comments out (in the form of /*...*/) $test = preg_replace('#\/\*.*\*\/#U', '', $source); // Test for :expression if (!stripos($test, ':expression')) { // Not found, so we are done $return = $source; } else { // At this point, we have stripped out the comments and have found :expression // Test stripped string for :expression followed by a '(' if (preg_match_all('#:expression\s*\(#', $test, $matches)) { // If found, remove :expression $test = str_ireplace(':expression', '', $test); $return = $test; } } return $return; } } PK���\�P�E�E(libraries/vendor/joomla/registry/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\M�{� � 3libraries/vendor/joomla/registry/src/Format/Php.phpnu�[���<?php /** * Part of the Joomla Framework Registry Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Registry\Format; use Joomla\Registry\AbstractRegistryFormat; /** * PHP class format handler for Registry * * @since 1.0 */ class Php extends AbstractRegistryFormat { /** * Converts an object into a php class string. * - NOTE: Only one depth level is supported. * * @param object $object Data Source Object * @param array $params Parameters used by the formatter * * @return string Config class formatted string * * @since 1.0 */ public function objectToString($object, $params = array()) { // Build the object variables string $vars = ''; foreach (get_object_vars($object) as $k => $v) { if (is_scalar($v)) { $vars .= "\tpublic $" . $k . " = '" . addcslashes($v, '\\\'') . "';\n"; } elseif (is_array($v) || is_object($v)) { $vars .= "\tpublic $" . $k . " = " . $this->getArrayString((array) $v) . ";\n"; } } $str = "<?php\n"; // If supplied, add a namespace to the class object if (isset($params['namespace']) && $params['namespace'] != '') { $str .= "namespace " . $params['namespace'] . ";\n\n"; } $str .= "class " . $params['class'] . " {\n"; $str .= $vars; $str .= "}"; // Use the closing tag if it not set to false in parameters. if (!isset($params['closingtag']) || $params['closingtag'] !== false) { $str .= "\n?>"; } return $str; } /** * Parse a PHP class formatted string and convert it into an object. * * @param string $data PHP Class formatted string to convert. * @param array $options Options used by the formatter. * * @return object Data object. * * @since 1.0 */ public function stringToObject($data, array $options = array()) { return true; } /** * Method to get an array as an exported string. * * @param array $a The array to get as a string. * * @return array * * @since 1.0 */ protected function getArrayString($a) { $s = 'array('; $i = 0; foreach ($a as $k => $v) { $s .= ($i) ? ', ' : ''; $s .= '"' . $k . '" => '; if (is_array($v) || is_object($v)) { $s .= $this->getArrayString((array) $v); } else { $s .= '"' . addslashes($v) . '"'; } $i++; } $s .= ')'; return $s; } } PK���\Σ���4libraries/vendor/joomla/registry/src/Format/Yaml.phpnu�[���<?php /** * Part of the Joomla Framework Registry Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Registry\Format; use Joomla\Registry\AbstractRegistryFormat; use Symfony\Component\Yaml\Parser as SymfonyYamlParser; use Symfony\Component\Yaml\Dumper as SymfonyYamlDumper; /** * YAML format handler for Registry. * * @since 1.0 */ class Yaml extends AbstractRegistryFormat { /** * The YAML parser class. * * @var \Symfony\Component\Yaml\Parser; * * @since 1.0 */ private $parser; /** * The YAML dumper class. * * @var \Symfony\Component\Yaml\Dumper; * * @since 1.0 */ private $dumper; /** * Construct to set up the parser and dumper * * @since 1.0 */ public function __construct() { $this->parser = new SymfonyYamlParser; $this->dumper = new SymfonyYamlDumper; } /** * Converts an object into a YAML formatted string. * We use json_* to convert the passed object to an array. * * @param object $object Data source object. * @param array $options Options used by the formatter. * * @return string YAML formatted string. * * @since 1.0 */ public function objectToString($object, $options = array()) { $array = json_decode(json_encode($object), true); return $this->dumper->dump($array, 2, 0); } /** * Parse a YAML formatted string and convert it into an object. * We use the json_* methods to convert the parsed YAML array to an object. * * @param string $data YAML formatted string to convert. * @param array $options Options used by the formatter. * * @return object Data object. * * @since 1.0 */ public function stringToObject($data, array $options = array()) { $array = $this->parser->parse(trim($data)); return json_decode(json_encode($array)); } } PK���\�E��4libraries/vendor/joomla/registry/src/Format/Json.phpnu�[���<?php /** * Part of the Joomla Framework Registry Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Registry\Format; use Joomla\Registry\AbstractRegistryFormat; use Joomla\String\String; /** * JSON format handler for Registry. * * @since 1.0 */ class Json extends AbstractRegistryFormat { /** * Converts an object into a JSON formatted string. * * @param object $object Data source object. * @param array $options Options used by the formatter. * * @return string JSON formatted string. * * @since 1.0 */ public function objectToString($object, $options = array()) { return String::unicode_to_utf8(json_encode($object)); } /** * Parse a JSON formatted string and convert it into an object. * * If the string is not in JSON format, this method will attempt to parse it as INI format. * * @param string $data JSON formatted string to convert. * @param array $options Options used by the formatter. * * @return object Data object. * * @since 1.0 */ public function stringToObject($data, array $options = array('processSections' => false)) { $data = trim($data); if ((substr($data, 0, 1) != '{') && (substr($data, -1, 1) != '}')) { $ini = AbstractRegistryFormat::getInstance('Ini'); $obj = $ini->stringToObject($data, $options); } else { $obj = json_decode($data); } return $obj; } } PK���\K��:��3libraries/vendor/joomla/registry/src/Format/Xml.phpnu�[���<?php /** * Part of the Joomla Framework Registry Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Registry\Format; use Joomla\Registry\AbstractRegistryFormat; use SimpleXMLElement; use stdClass; /** * XML format handler for Registry. * * @since 1.0 */ class Xml extends AbstractRegistryFormat { /** * Converts an object into an XML formatted string. * - If more than two levels of nested groups are necessary, since INI is not * useful, XML or another format should be used. * * @param object $object Data source object. * @param array $options Options used by the formatter. * * @return string XML formatted string. * * @since 1.0 */ public function objectToString($object, $options = array()) { $rootName = (isset($options['name'])) ? $options['name'] : 'registry'; $nodeName = (isset($options['nodeName'])) ? $options['nodeName'] : 'node'; // Create the root node. $root = simplexml_load_string('<' . $rootName . ' />'); // Iterate over the object members. $this->getXmlChildren($root, $object, $nodeName); return $root->asXML(); } /** * Parse a XML formatted string and convert it into an object. * * @param string $data XML formatted string to convert. * @param array $options Options used by the formatter. * * @return object Data object. * * @since 1.0 */ public function stringToObject($data, array $options = array()) { $obj = new stdClass; // Parse the XML string. $xml = simplexml_load_string($data); foreach ($xml->children() as $node) { $obj->{$node['name']} = $this->getValueFromNode($node); } return $obj; } /** * Method to get a PHP native value for a SimpleXMLElement object. -- called recursively * * @param object $node SimpleXMLElement object for which to get the native value. * * @return mixed Native value of the SimpleXMLElement object. * * @since 1.0 */ protected function getValueFromNode($node) { switch ($node['type']) { case 'integer': $value = (string) $node; return (int) $value; break; case 'string': return (string) $node; break; case 'boolean': $value = (string) $node; return (bool) $value; break; case 'double': $value = (string) $node; return (float) $value; break; case 'array': $value = array(); foreach ($node->children() as $child) { $value[(string) $child['name']] = $this->getValueFromNode($child); } break; default: $value = new stdClass; foreach ($node->children() as $child) { $value->{$child['name']} = $this->getValueFromNode($child); } break; } return $value; } /** * Method to build a level of the XML string -- called recursively * * @param SimpleXMLElement $node SimpleXMLElement object to attach children. * @param object $var Object that represents a node of the XML document. * @param string $nodeName The name to use for node elements. * * @return void * * @since 1.0 */ protected function getXmlChildren(SimpleXMLElement $node, $var, $nodeName) { // Iterate over the object members. foreach ((array) $var as $k => $v) { if (is_scalar($v)) { $n = $node->addChild($nodeName, $v); $n->addAttribute('name', $k); $n->addAttribute('type', gettype($v)); } else { $n = $node->addChild($nodeName); $n->addAttribute('name', $k); $n->addAttribute('type', gettype($v)); $this->getXmlChildren($n, $v, $nodeName); } } } } PK���\�P���3libraries/vendor/joomla/registry/src/Format/Ini.phpnu�[���<?php /** * Part of the Joomla Framework Registry Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Registry\Format; use Joomla\Registry\AbstractRegistryFormat; use Joomla\Utilities\ArrayHelper; use stdClass; /** * INI format handler for Registry. * * @since 1.0 */ class Ini extends AbstractRegistryFormat { /** * Default options array * * @var array * @since 1.3.0 */ protected static $options = array( 'supportArrayValues' => false, 'parseBooleanWords' => false, 'processSections' => false, ); /** * A cache used by stringToobject. * * @var array * @since 1.0 */ protected static $cache = array(); /** * Converts an object into an INI formatted string * - Unfortunately, there is no way to have ini values nested further than two * levels deep. Therefore we will only go through the first two levels of * the object. * * @param object $object Data source object. * @param array $options Options used by the formatter. * * @return string INI formatted string. * * @since 1.0 */ public function objectToString($object, $options = array()) { $options = array_merge(self::$options, $options); $local = array(); $global = array(); $variables = get_object_vars($object); $last = count($variables); // Assume that the first element is in section $in_section = true; // Iterate over the object to set the properties. foreach ($variables as $key => $value) { // If the value is an object then we need to put it in a local section. if (is_object($value)) { // Add an empty line if previous string wasn't in a section if (!$in_section) { $local[] = ''; } // Add the section line. $local[] = '[' . $key . ']'; // Add the properties for this section. foreach (get_object_vars($value) as $k => $v) { if (is_array($v) && $options['supportArrayValues']) { $assoc = ArrayHelper::isAssociative($v); foreach ($v as $array_key => $item) { $array_key = ($assoc) ? $array_key : ''; $local[] = $k . '[' . $array_key . ']=' . $this->getValueAsINI($item); } } else { $local[] = $k . '=' . $this->getValueAsINI($v); } } // Add empty line after section if it is not the last one if (0 != --$last) { $local[] = ''; } } elseif (is_array($value) && $options['supportArrayValues']) { $assoc = ArrayHelper::isAssociative($value); foreach ($value as $array_key => $item) { $array_key = ($assoc) ? $array_key : ''; $global[] = $key . '[' . $array_key . ']=' . $this->getValueAsINI($item); } } else { // Not in a section so add the property to the global array. $global[] = $key . '=' . $this->getValueAsINI($value); $in_section = false; } } return implode("\n", array_merge($global, $local)); } /** * Parse an INI formatted string and convert it into an object. * * @param string $data INI formatted string to convert. * @param array $options An array of options used by the formatter, or a boolean setting to process sections. * * @return object Data object. * * @since 1.0 */ public function stringToObject($data, array $options = array()) { $options = array_merge(self::$options, $options); // Check the memory cache for already processed strings. $hash = md5($data . ':' . (int) $options['processSections']); if (isset(self::$cache[$hash])) { return self::$cache[$hash]; } // If no lines present just return the object. if (empty($data)) { return new stdClass; } $obj = new stdClass; $section = false; $array = false; $lines = explode("\n", $data); // Process the lines. foreach ($lines as $line) { // Trim any unnecessary whitespace. $line = trim($line); // Ignore empty lines and comments. if (empty($line) || ($line{0} == ';')) { continue; } if ($options['processSections']) { $length = strlen($line); // If we are processing sections and the line is a section add the object and continue. if (($line[0] == '[') && ($line[$length - 1] == ']')) { $section = substr($line, 1, $length - 2); $obj->$section = new stdClass; continue; } } elseif ($line{0} == '[') { continue; } // Check that an equal sign exists and is not the first character of the line. if (!strpos($line, '=')) { // Maybe throw exception? continue; } // Get the key and value for the line. list ($key, $value) = explode('=', $line, 2); // If we have an array item if (substr($key, -1) == ']' && ($open_brace = strpos($key, '[', 1)) !== false) { if ($options['supportArrayValues']) { $array = true; $array_key = substr($key, $open_brace + 1, -1); // If we have a multi-dimensional array or malformed key if (strpos($array_key, '[') !== false || strpos($array_key, ']') !== false) { // Maybe throw exception? continue; } $key = substr($key, 0, $open_brace); } else { continue; } } // Validate the key. if (preg_match('/[^A-Z0-9_]/i', $key)) { // Maybe throw exception? continue; } // If the value is quoted then we assume it is a string. $length = strlen($value); if ($length && ($value[0] == '"') && ($value[$length - 1] == '"')) { // Strip the quotes and Convert the new line characters. $value = stripcslashes(substr($value, 1, ($length - 2))); $value = str_replace('\n', "\n", $value); } else { // If the value is not quoted, we assume it is not a string. // If the value is 'false' assume boolean false. if ($value == 'false') { $value = false; } elseif ($value == 'true') // If the value is 'true' assume boolean true. { $value = true; } elseif ($options['parseBooleanWords'] && in_array(strtolower($value), array('yes', 'no'))) // If the value is 'yes' or 'no' and option is enabled assume appropriate boolean { $value = (strtolower($value) == 'yes'); } elseif (is_numeric($value)) // If the value is numeric than it is either a float or int. { // If there is a period then we assume a float. if (strpos($value, '.') !== false) { $value = (float) $value; } else { $value = (int) $value; } } } // If a section is set add the key/value to the section, otherwise top level. if ($section) { if ($array) { if (!isset($obj->$section->$key)) { $obj->$section->$key = array(); } if (!empty($array_key)) { $obj->$section->{$key}[$array_key] = $value; } else { $obj->$section->{$key}[] = $value; } } else { $obj->$section->$key = $value; } } else { if ($array) { if (!isset($obj->$key)) { $obj->$key = array(); } if (!empty($array_key)) { $obj->{$key}[$array_key] = $value; } else { $obj->{$key}[] = $value; } } else { $obj->$key = $value; } } $array = false; } // Cache the string to save cpu cycles -- thus the world :) self::$cache[$hash] = clone $obj; return $obj; } /** * Method to get a value in an INI format. * * @param mixed $value The value to convert to INI format. * * @return string The value in INI format. * * @since 1.0 */ protected function getValueAsINI($value) { $string = ''; switch (gettype($value)) { case 'integer': case 'double': $string = $value; break; case 'boolean': $string = $value ? 'true' : 'false'; break; case 'string': // Sanitize any CRLF characters.. $string = '"' . str_replace(array("\r\n", "\n"), '\\n', $value) . '"'; break; } return $string; } } PK���\��s``?libraries/vendor/joomla/registry/src/AbstractRegistryFormat.phpnu�[���<?php /** * Part of the Joomla Framework Registry Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Registry; /** * Abstract Format for Registry * * @since 1.0 */ abstract class AbstractRegistryFormat { /** * @var array Format instances container. * @since 1.0 */ protected static $instances = array(); /** * Returns a reference to a Format object, only creating it * if it doesn't already exist. * * @param string $type The format to load * * @return AbstractRegistryFormat Registry format handler * * @since 1.0 * @throws \InvalidArgumentException */ public static function getInstance($type) { // Sanitize format type. $type = strtolower(preg_replace('/[^A-Z0-9_]/i', '', $type)); // Only instantiate the object if it doesn't already exist. if (!isset(self::$instances[$type])) { $class = '\\Joomla\\Registry\\Format\\' . ucfirst($type); if (!class_exists($class)) { throw new \InvalidArgumentException('Unable to load format class.', 500); } self::$instances[$type] = new $class; } return self::$instances[$type]; } /** * Converts an object into a formatted string. * * @param object $object Data Source Object. * @param array $options An array of options for the formatter. * * @return string Formatted string. * * @since 1.0 */ abstract public function objectToString($object, $options = null); /** * Converts a formatted string into an object. * * @param string $data Formatted string * @param array $options An array of options for the formatter. * * @return object Data Object * * @since 1.0 */ abstract public function stringToObject($data, array $options = array()); } PK���\���n�@�@1libraries/vendor/joomla/registry/src/Registry.phpnu�[���<?php /** * Part of the Joomla Framework Registry Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Registry; use Joomla\Utilities\ArrayHelper; /** * Registry class * * @since 1.0 */ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable { /** * Registry Object * * @var object * @since 1.0 */ protected $data; /** * Registry instances container. * * @var array * @since 1.0 */ protected static $instances = array(); /** * Path separator * * @var string * @since 1.4.0 */ public $separator = '.'; /** * Constructor * * @param mixed $data The data to bind to the new Registry object. * * @since 1.0 */ public function __construct($data = null) { // Instantiate the internal data object. $this->data = new \stdClass; // Optionally load supplied data. if (is_array($data) || is_object($data)) { $this->bindData($this->data, $data); return; } if (!empty($data) && is_string($data)) { $this->loadString($data); } } /** * Magic function to clone the registry object. * * @return Registry * * @since 1.0 */ public function __clone() { $this->data = unserialize(serialize($this->data)); } /** * Magic function to render this object as a string using default args of toString method. * * @return string * * @since 1.0 */ public function __toString() { return $this->toString(); } /** * Count elements of the data object * * @return integer The custom count as an integer. * * @link http://php.net/manual/en/countable.count.php * @since 1.3.0 */ public function count() { return count(get_object_vars($this->data)); } /** * Implementation for the JsonSerializable interface. * Allows us to pass Registry objects to json_encode. * * @return object * * @since 1.0 * @note The interface is only present in PHP 5.4 and up. */ public function jsonSerialize() { return $this->data; } /** * Sets a default value if not already assigned. * * @param string $key The name of the parameter. * @param mixed $default An optional value for the parameter. * * @return mixed The value set, or the default if the value was not previously set (or null). * * @since 1.0 */ public function def($key, $default = '') { $value = $this->get($key, $default); $this->set($key, $value); return $value; } /** * Check if a registry path exists. * * @param string $path Registry path (e.g. joomla.content.showauthor) * * @return boolean * * @since 1.0 */ public function exists($path) { // Return default value if path is empty if (empty($path)) { return false; } // Explode the registry path into an array $nodes = explode($this->separator, $path); // Initialize the current node to be the registry root. $node = $this->data; $found = false; // Traverse the registry to find the correct node for the result. foreach ($nodes as $n) { if (is_array($node) && isset($node[$n])) { $node = $node[$n]; $found = true; continue; } if (!isset($node->$n)) { return false; } $node = $node->$n; $found = true; } return $found; } /** * Get a registry value. * * @param string $path Registry path (e.g. joomla.content.showauthor) * @param mixed $default Optional default value, returned if the internal value is null. * * @return mixed Value of entry or null * * @since 1.0 */ public function get($path, $default = null) { // Return default value if path is empty if (empty($path)) { return $default; } if (!strpos($path, $this->separator)) { return (isset($this->data->$path) && $this->data->$path !== null && $this->data->$path !== '') ? $this->data->$path : $default; } // Explode the registry path into an array $nodes = explode($this->separator, trim($path)); // Initialize the current node to be the registry root. $node = $this->data; $found = false; // Traverse the registry to find the correct node for the result. foreach ($nodes as $n) { if (is_array($node) && isset($node[$n])) { $node = $node[$n]; $found = true; continue; } if (!isset($node->$n)) { return $default; } $node = $node->$n; $found = true; } if (!$found || $node === null || $node === '') { return $default; } return $node; } /** * Returns a reference to a global Registry object, only creating it * if it doesn't already exist. * * This method must be invoked as: * <pre>$registry = Registry::getInstance($id);</pre> * * @param string $id An ID for the registry instance * * @return Registry The Registry object. * * @since 1.0 */ public static function getInstance($id) { if (empty(self::$instances[$id])) { self::$instances[$id] = new self; } return self::$instances[$id]; } /** * Gets this object represented as an ArrayIterator. * * This allows the data properties to be accessed via a foreach statement. * * @return \ArrayIterator This object represented as an ArrayIterator. * * @see IteratorAggregate::getIterator() * @since 1.3.0 */ public function getIterator() { return new \ArrayIterator($this->data); } /** * Load a associative array of values into the default namespace * * @param array $array Associative array of value to load * @param boolean $flattened Load from a one-dimensional array * @param string $separator The key separator * * @return Registry Return this object to support chaining. * * @since 1.0 */ public function loadArray($array, $flattened = false, $separator = null) { if (!$flattened) { $this->bindData($this->data, $array); return $this; } foreach ($array as $k => $v) { $this->set($k, $v, $separator); } return $this; } /** * Load the public variables of the object into the default namespace. * * @param object $object The object holding the publics to load * * @return Registry Return this object to support chaining. * * @since 1.0 */ public function loadObject($object) { $this->bindData($this->data, $object); return $this; } /** * Load the contents of a file into the registry * * @param string $file Path to file to load * @param string $format Format of the file [optional: defaults to JSON] * @param array $options Options used by the formatter * * @return Registry Return this object to support chaining. * * @since 1.0 */ public function loadFile($file, $format = 'JSON', $options = array()) { $data = file_get_contents($file); return $this->loadString($data, $format, $options); } /** * Load a string into the registry * * @param string $data String to load into the registry * @param string $format Format of the string * @param array $options Options used by the formatter * * @return Registry Return this object to support chaining. * * @since 1.0 */ public function loadString($data, $format = 'JSON', $options = array()) { // Load a string into the given namespace [or default namespace if not given] $handler = AbstractRegistryFormat::getInstance($format); $obj = $handler->stringToObject($data, $options); $this->loadObject($obj); return $this; } /** * Merge a Registry object into this one * * @param Registry $source Source Registry object to merge. * @param boolean $recursive True to support recursive merge the children values. * * @return Registry Return this object to support chaining. * * @since 1.0 */ public function merge($source, $recursive = false) { if (!$source instanceof Registry) { return false; } $this->bindData($this->data, $source->toArray(), $recursive, false); return $this; } /** * Method to extract a sub-registry from path * * @param string $path Registry path (e.g. joomla.content.showauthor) * * @return Registry|null Registry object if data is present * * @since 1.2.0 */ public function extract($path) { $data = $this->get($path); if (is_null($data)) { return null; } return new Registry($data); } /** * Checks whether an offset exists in the iterator. * * @param mixed $offset The array offset. * * @return boolean True if the offset exists, false otherwise. * * @since 1.0 */ public function offsetExists($offset) { return (boolean) ($this->get($offset) !== null); } /** * Gets an offset in the iterator. * * @param mixed $offset The array offset. * * @return mixed The array value if it exists, null otherwise. * * @since 1.0 */ public function offsetGet($offset) { return $this->get($offset); } /** * Sets an offset in the iterator. * * @param mixed $offset The array offset. * @param mixed $value The array value. * * @return void * * @since 1.0 */ public function offsetSet($offset, $value) { $this->set($offset, $value); } /** * Unsets an offset in the iterator. * * @param mixed $offset The array offset. * * @return void * * @since 1.0 */ public function offsetUnset($offset) { $this->set($offset, null); } /** * Set a registry value. * * @param string $path Registry Path (e.g. joomla.content.showauthor) * @param mixed $value Value of entry * @param string $separator The key separator * * @return mixed The value of the that has been set. * * @since 1.0 */ public function set($path, $value, $separator = null) { if (empty($separator)) { $separator = $this->separator; } /** * Explode the registry path into an array and remove empty * nodes that occur as a result of a double separator. ex: joomla..test * Finally, re-key the array so they are sequential. */ $nodes = array_values(array_filter(explode($separator, $path), 'strlen')); if (!$nodes) { return null; } // Initialize the current node to be the registry root. $node = $this->data; // Traverse the registry to find the correct node for the result. for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++) { if (is_object($node)) { if (!isset($node->{$nodes[$i]}) && ($i != $n)) { $node->{$nodes[$i]} = new \stdClass; } // Pass the child as pointer in case it is an object $node = &$node->{$nodes[$i]}; continue; } if (is_array($node)) { if (!isset($node[$nodes[$i]]) && ($i != $n)) { $node[$nodes[$i]] = new \stdClass; } // Pass the child as pointer in case it is an array $node = &$node[$nodes[$i]]; } } // Get the old value if exists so we can return it switch (true) { case (is_object($node)): $result = $node->{$nodes[$i]} = $value; break; case (is_array($node)): $result = $node[$nodes[$i]] = $value; break; default: $result = null; break; } return $result; } /** * Append value to a path in registry * * @param string $path Parent registry Path (e.g. joomla.content.showauthor) * @param mixed $value Value of entry * * @return mixed The value of the that has been set. * * @since 1.4.0 */ public function append($path, $value) { $result = null; /** * Explode the registry path into an array and remove empty * nodes that occur as a result of a double dot. ex: joomla..test * Finally, re-key the array so they are sequential. */ $nodes = array_values(array_filter(explode('.', $path), 'strlen')); if ($nodes) { // Initialize the current node to be the registry root. $node = $this->data; // Traverse the registry to find the correct node for the result. // TODO Create a new private method from part of code below, as it is almost equal to 'set' method for ($i = 0, $n = count($nodes) - 1; $i <= $n; $i++) { if (is_object($node)) { if (!isset($node->{$nodes[$i]}) && ($i != $n)) { $node->{$nodes[$i]} = new \stdClass; } // Pass the child as pointer in case it is an array $node = &$node->{$nodes[$i]}; } elseif (is_array($node)) { if (!isset($node[$nodes[$i]]) && ($i != $n)) { $node[$nodes[$i]] = new \stdClass; } // Pass the child as pointer in case it is an array $node = &$node[$nodes[$i]]; } } if (!is_array($node)) // Convert the node to array to make append possible { $node = get_object_vars($node); } array_push($node, $value); $result = $value; } return $result; } /** * Transforms a namespace to an array * * @return array An associative array holding the namespace data * * @since 1.0 */ public function toArray() { return (array) $this->asArray($this->data); } /** * Transforms a namespace to an object * * @return object An an object holding the namespace data * * @since 1.0 */ public function toObject() { return $this->data; } /** * Get a namespace in a given string format * * @param string $format Format to return the string in * @param mixed $options Parameters used by the formatter, see formatters for more info * * @return string Namespace in string format * * @since 1.0 */ public function toString($format = 'JSON', $options = array()) { // Return a namespace in a given format $handler = AbstractRegistryFormat::getInstance($format); return $handler->objectToString($this->data, $options); } /** * Method to recursively bind data to a parent object. * * @param object $parent The parent object on which to attach the data values. * @param mixed $data An array or object of data to bind to the parent object. * @param boolean $recursive True to support recursive bindData. * @param boolean $allowNull True to allow null values. * * @return void * * @since 1.0 */ protected function bindData($parent, $data, $recursive = true, $allowNull = true) { // Ensure the input data is an array. $data = is_object($data) ? get_object_vars($data) : (array) $data; foreach ($data as $k => $v) { if (!$allowNull && !(($v !== null) && ($v !== ''))) { continue; } if ($recursive && ((is_array($v) && ArrayHelper::isAssociative($v)) || is_object($v))) { if (!isset($parent->$k)) { $parent->$k = new \stdClass; } $this->bindData($parent->$k, $v); continue; } $parent->$k = $v; } } /** * Method to recursively convert an object of data to an array. * * @param object $data An object of data to return as an array. * * @return array Array representation of the input object. * * @since 1.0 */ protected function asArray($data) { $array = array(); if (is_object($data)) { $data = get_object_vars($data); } foreach ($data as $k => $v) { if (is_object($v) || is_array($v)) { $array[$k] = $this->asArray($v); continue; } $array[$k] = $v; } return $array; } /** * Dump to one dimension array. * * @param string $separator The key separator. * * @return string[] Dumped array. * * @since 1.3.0 */ public function flatten($separator = null) { $array = array(); if (empty($separator)) { $separator = $this->separator; } $this->toFlatten($separator, $this->data, $array); return $array; } /** * Method to recursively convert data to one dimension array. * * @param string $separator The key separator. * @param array|object $data Data source of this scope. * @param array &$array The result array, it is pass by reference. * @param string $prefix Last level key prefix. * * @return void * * @since 1.3.0 */ protected function toFlatten($separator = null, $data = null, &$array = array(), $prefix = '') { $data = (array) $data; if (empty($separator)) { $separator = $this->separator; } foreach ($data as $k => $v) { $key = $prefix ? $prefix . $separator . $k : $k; if (is_object($v) || is_array($v)) { $this->toFlatten($separator, $v, $array, $key); continue; } $array[$key] = $v; } } } PK���\�P�E�E)libraries/vendor/joomla/utilities/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\a���6�65libraries/vendor/joomla/utilities/src/ArrayHelper.phpnu�[���<?php /** * Part of the Joomla Framework Utilities Package * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Utilities; use Joomla\String\String; /** * ArrayHelper is an array utility class for doing all sorts of odds and ends with arrays. * * @since 1.0 */ final class ArrayHelper { /** * Private constructor to prevent instantiation of this class */ private function __construct() { } /** * Function to convert array to integer values * * @param array $array The source array to convert * @param mixed $default A default value (int|array) to assign if $array is not an array * * @return array The converted array * * @since 1.0 */ public static function toInteger($array, $default = null) { if (is_array($array)) { $array = array_map('intval', $array); } else { if ($default === null) { $array = array(); } elseif (is_array($default)) { $array = self::toInteger($default, null); } else { $array = array((int) $default); } } return $array; } /** * Utility function to map an array to a stdClass object. * * @param array $array The array to map. * @param string $class Name of the class to create * @param boolean $recursive Convert also any array inside the main array * * @return object The object mapped from the given array * * @since 1.0 */ public static function toObject(array $array, $class = 'stdClass', $recursive = true) { $obj = new $class; foreach ($array as $k => $v) { if ($recursive && is_array($v)) { $obj->$k = self::toObject($v, $class); } else { $obj->$k = $v; } } return $obj; } /** * Utility function to map an array to a string. * * @param array $array The array to map. * @param string $inner_glue The glue (optional, defaults to '=') between the key and the value. * @param string $outer_glue The glue (optional, defaults to ' ') between array elements. * @param boolean $keepOuterKey True if final key should be kept. * * @return string The string mapped from the given array * * @since 1.0 */ public static function toString(array $array, $inner_glue = '=', $outer_glue = ' ', $keepOuterKey = false) { $output = array(); foreach ($array as $key => $item) { if (is_array($item)) { if ($keepOuterKey) { $output[] = $key; } // This is value is an array, go and do it again! $output[] = self::toString($item, $inner_glue, $outer_glue, $keepOuterKey); } else { $output[] = $key . $inner_glue . '"' . $item . '"'; } } return implode($outer_glue, $output); } /** * Utility function to map an object to an array * * @param object $p_obj The source object * @param boolean $recurse True to recurse through multi-level objects * @param string $regex An optional regular expression to match on field names * * @return array The array mapped from the given object * * @since 1.0 */ public static function fromObject($p_obj, $recurse = true, $regex = null) { if (is_object($p_obj)) { return self::arrayFromObject($p_obj, $recurse, $regex); } else { return null; } } /** * Utility function to map an object or array to an array * * @param mixed $item The source object or array * @param boolean $recurse True to recurse through multi-level objects * @param string $regex An optional regular expression to match on field names * * @return array The array mapped from the given object * * @since 1.0 */ private static function arrayFromObject($item, $recurse, $regex) { if (is_object($item)) { $result = array(); foreach (get_object_vars($item) as $k => $v) { if (!$regex || preg_match($regex, $k)) { if ($recurse) { $result[$k] = self::arrayFromObject($v, $recurse, $regex); } else { $result[$k] = $v; } } } } elseif (is_array($item)) { $result = array(); foreach ($item as $k => $v) { $result[$k] = self::arrayFromObject($v, $recurse, $regex); } } else { $result = $item; } return $result; } /** * Extracts a column from an array of arrays or objects * * @param array $array The source array * @param string $index The index of the column or name of object property * * @return array Column of values from the source array * * @since 1.0 */ public static function getColumn(array $array, $index) { $result = array(); foreach ($array as $item) { if (is_array($item) && isset($item[$index])) { $result[] = $item[$index]; } elseif (is_object($item) && isset($item->$index)) { $result[] = $item->$index; } } return $result; } /** * Utility function to return a value from a named array or a specified default * * @param array|\ArrayAccess $array A named array or object that implements ArrayAccess * @param string $name The key to search for * @param mixed $default The default value to give if no key found * @param string $type Return type for the variable (INT, FLOAT, STRING, WORD, BOOLEAN, ARRAY) * * @return mixed The value from the source array * * @throws InvalidArgumentException * * @since 1.0 */ public static function getValue($array, $name, $default = null, $type = '') { if (!is_array($array) && !($array instanceof \ArrayAccess)) { throw new \InvalidArgumentException('The object must be an array or a object that implements ArrayAccess'); } $result = null; if (isset($array[$name])) { $result = $array[$name]; } // Handle the default case if (is_null($result)) { $result = $default; } // Handle the type constraint switch (strtoupper($type)) { case 'INT': case 'INTEGER': // Only use the first integer value @preg_match('/-?[0-9]+/', $result, $matches); $result = @(int) $matches[0]; break; case 'FLOAT': case 'DOUBLE': // Only use the first floating point value @preg_match('/-?[0-9]+(\.[0-9]+)?/', $result, $matches); $result = @(float) $matches[0]; break; case 'BOOL': case 'BOOLEAN': $result = (bool) $result; break; case 'ARRAY': if (!is_array($result)) { $result = array($result); } break; case 'STRING': $result = (string) $result; break; case 'WORD': $result = (string) preg_replace('#\W#', '', $result); break; case 'NONE': default: // No casting necessary break; } return $result; } /** * Takes an associative array of arrays and inverts the array keys to values using the array values as keys. * * Example: * $input = array( * 'New' => array('1000', '1500', '1750'), * 'Used' => array('3000', '4000', '5000', '6000') * ); * $output = ArrayHelper::invert($input); * * Output would be equal to: * $output = array( * '1000' => 'New', * '1500' => 'New', * '1750' => 'New', * '3000' => 'Used', * '4000' => 'Used', * '5000' => 'Used', * '6000' => 'Used' * ); * * @param array $array The source array. * * @return array The inverted array. * * @since 1.0 */ public static function invert(array $array) { $return = array(); foreach ($array as $base => $values) { if (!is_array($values)) { continue; } foreach ($values as $key) { // If the key isn't scalar then ignore it. if (is_scalar($key)) { $return[$key] = $base; } } } return $return; } /** * Method to determine if an array is an associative array. * * @param array $array An array to test. * * @return boolean True if the array is an associative array. * * @since 1.0 */ public static function isAssociative($array) { if (is_array($array)) { foreach (array_keys($array) as $k => $v) { if ($k !== $v) { return true; } } } return false; } /** * Pivots an array to create a reverse lookup of an array of scalars, arrays or objects. * * @param array $source The source array. * @param string $key Where the elements of the source array are objects or arrays, the key to pivot on. * * @return array An array of arrays pivoted either on the value of the keys, or an individual key of an object or array. * * @since 1.0 */ public static function pivot(array $source, $key = null) { $result = array(); $counter = array(); foreach ($source as $index => $value) { // Determine the name of the pivot key, and its value. if (is_array($value)) { // If the key does not exist, ignore it. if (!isset($value[$key])) { continue; } $resultKey = $value[$key]; $resultValue = $source[$index]; } elseif (is_object($value)) { // If the key does not exist, ignore it. if (!isset($value->$key)) { continue; } $resultKey = $value->$key; $resultValue = $source[$index]; } else { // Just a scalar value. $resultKey = $value; $resultValue = $index; } // The counter tracks how many times a key has been used. if (empty($counter[$resultKey])) { // The first time around we just assign the value to the key. $result[$resultKey] = $resultValue; $counter[$resultKey] = 1; } elseif ($counter[$resultKey] == 1) { // If there is a second time, we convert the value into an array. $result[$resultKey] = array( $result[$resultKey], $resultValue, ); $counter[$resultKey]++; } else { // After the second time, no need to track any more. Just append to the existing array. $result[$resultKey][] = $resultValue; } } unset($counter); return $result; } /** * Utility function to sort an array of objects on a given field * * @param array $a An array of objects * @param mixed $k The key (string) or a array of key to sort on * @param mixed $direction Direction (integer) or an array of direction to sort in [1 = Ascending] [-1 = Descending] * @param mixed $caseSensitive Boolean or array of booleans to let sort occur case sensitive or insensitive * @param mixed $locale Boolean or array of booleans to let sort occur using the locale language or not * * @return array The sorted array of objects * * @since 1.0 */ public static function sortObjects(array $a, $k, $direction = 1, $caseSensitive = true, $locale = false) { if (!is_array($locale) || !is_array($locale[0])) { $locale = array($locale); } $sortCase = (array) $caseSensitive; $sortDirection = (array) $direction; $key = (array) $k; $sortLocale = $locale; usort( $a, function($a, $b) use($sortCase, $sortDirection, $key, $sortLocale) { for ($i = 0, $count = count($key); $i < $count; $i++) { if (isset($sortDirection[$i])) { $direction = $sortDirection[$i]; } if (isset($sortCase[$i])) { $caseSensitive = $sortCase[$i]; } if (isset($sortLocale[$i])) { $locale = $sortLocale[$i]; } $va = $a->{$key[$i]}; $vb = $b->{$key[$i]}; if ((is_bool($va) || is_numeric($va)) && (is_bool($vb) || is_numeric($vb))) { $cmp = $va - $vb; } elseif ($caseSensitive) { $cmp = String::strcmp($va, $vb, $locale); } else { $cmp = String::strcasecmp($va, $vb, $locale); } if ($cmp > 0) { return $direction; } if ($cmp < 0) { return -$direction; } } return 0; } ); return $a; } /** * Multidimensional array safe unique test * * @param array $array The array to make unique. * * @return array * * @see http://php.net/manual/en/function.array-unique.php * @since 1.0 */ public static function arrayUnique(array $array) { $array = array_map('serialize', $array); $array = array_unique($array); $array = array_map('unserialize', $array); return $array; } /** * An improved array_search that allows for partial matching * of strings values in associative arrays. * * @param string $needle The text to search for within the array. * @param array $haystack Associative array to search in to find $needle. * @param boolean $caseSensitive True to search case sensitive, false otherwise. * * @return mixed Returns the matching array $key if found, otherwise false. * * @since 1.0 */ public static function arraySearch($needle, array $haystack, $caseSensitive = true) { foreach ($haystack as $key => $value) { $searchFunc = ($caseSensitive) ? 'strpos' : 'stripos'; if ($searchFunc($value, $needle) === 0) { return $key; } } return false; } /** * Method to recursively convert data to a one dimension array. * * @param array|object $array The array or object to convert. * @param string $separator The key separator. * @param string $prefix Last level key prefix. * * @return array * * @since 1.3.0 */ public static function flatten($array, $separator = '.', $prefix = '') { if ($array instanceof \Traversable) { $array = iterator_to_array($array); } elseif (is_object($array)) { $array = get_object_vars($array); } foreach ($array as $k => $v) { $key = $prefix ? $prefix . $separator . $k : $k; if (is_object($v) || is_array($v)) { $array = array_merge($array, static::flatten($v, $separator, $key)); } else { $array[$key] = $v; } } return $array; } } PK���\�P�E�E6libraries/vendor/joomla/session/Joomla/Session/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\3w�H}}Clibraries/vendor/joomla/session/Joomla/Session/Storage/Memcache.phpnu�[���<?php /** * Part of the Joomla Framework Session Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Session\Storage; use Joomla\Session\Storage; /** * Memcache session storage handler for PHP * * @since 1.0 * @deprecated The joomla/session package is deprecated */ class Memcache extends Storage { /** * Constructor * * @param array $options Optional parameters. * * @since 1.0 * @throws \RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new \RuntimeException('Memcache Extension is not available', 404); } parent::__construct($options); // This will be an array of loveliness // @todo: multiple servers $this->_servers = array( array( 'host' => isset($options['memcache_server_host']) ? $options['memcache_server_host'] : 'localhost', 'port' => isset($options['memcache_server_port']) ? $options['memcache_server_port'] : 11211 ) ); } /** * Register the functions of this class with PHP's session handler * * @return void * * @since 1.0 */ public function register() { ini_set('session.save_path', $this->_servers[0]['host'] . ':' . $this->_servers[0]['port']); ini_set('session.save_handler', 'memcache'); } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 1.0 */ static public function isSupported() { return (extension_loaded('memcache') && class_exists('Memcache')); } } PK���\��3W��Alibraries/vendor/joomla/session/Joomla/Session/Storage/Xcache.phpnu�[���<?php /** * Part of the Joomla Framework Session Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Session\Storage; use Joomla\Session\Storage; /** * XCache session storage handler * * @since 1.0 * @deprecated The joomla/session package is deprecated */ class Xcache extends Storage { /** * Constructor * * @param array $options Optional parameters. * * @since 1.0 * @throws \RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new \RuntimeException('XCache Extension is not available', 404); } parent::__construct($options); } /** * Read the data for a particular session identifier from the SessionHandler backend. * * @param string $id The session identifier. * * @return string The session data. * * @since 1.0 */ public function read($id) { $sess_id = 'sess_' . $id; // Check if id exists if (!xcache_isset($sess_id)) { return; } return (string) xcache_get($sess_id); } /** * Write session data to the SessionHandler backend. * * @param string $id The session identifier. * @param string $session_data The session data. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function write($id, $session_data) { $sess_id = 'sess_' . $id; return xcache_set($sess_id, $session_data, ini_get("session.gc_maxlifetime")); } /** * Destroy the data for a particular session identifier in the SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function destroy($id) { $sess_id = 'sess_' . $id; if (!xcache_isset($sess_id)) { return true; } return xcache_unset($sess_id); } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 1.0 */ static public function isSupported() { return (extension_loaded('xcache')); } } PK���\�MId��?libraries/vendor/joomla/session/Joomla/Session/Storage/None.phpnu�[���<?php /** * Part of the Joomla Framework Session Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Session\Storage; use Joomla\Session\Storage; /** * Default PHP configured session handler for Joomla! * * @see http://www.php.net/manual/en/function.session-set-save-handler.php * @since 1.0 * @deprecated The joomla/session package is deprecated */ class None extends Storage { /** * Register the functions of this class with PHP's session handler * * @return void * * @since 1.0 */ public function register() { } } PK���\DRClibraries/vendor/joomla/session/Joomla/Session/Storage/Wincache.phpnu�[���<?php /** * Part of the Joomla Framework Session Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Session\Storage; use Joomla\Session\Storage; /** * WINCACHE session storage handler for PHP * * @since 1.0 * @deprecated The joomla/session package is deprecated */ class Wincache extends Storage { /** * Constructor * * @param array $options Optional parameters. * * @since 1.0 * @throws \RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new \RuntimeException('Wincache Extension is not available', 404); } parent::__construct($options); } /** * Register the functions of this class with PHP's session handler * * @return void * * @since 1.0 */ public function register() { ini_set('session.save_handler', 'wincache'); } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 1.0 */ static public function isSupported() { return (extension_loaded('wincache') && function_exists('wincache_ucache_get') && !strcmp(ini_get('wincache.ucenabled'), "1")); } } PK���\PQb�``>libraries/vendor/joomla/session/Joomla/Session/Storage/Apc.phpnu�[���<?php /** * Part of the Joomla Framework Session Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Session\Storage; use Joomla\Session\Storage; /** * APC session storage handler for PHP * * @see http://www.php.net/manual/en/function.session-set-save-handler.php * @since 1.0 * @deprecated The joomla/session package is deprecated */ class Apc extends Storage { /** * Constructor * * @param array $options Optional parameters * * @since 1.0 * @throws \RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new \RuntimeException('APC Extension is not available', 404); } parent::__construct($options); } /** * Read the data for a particular session identifier from the * SessionHandler backend. * * @param string $id The session identifier. * * @return string The session data. * * @since 1.0 */ public function read($id) { $sess_id = 'sess_' . $id; return (string) apc_fetch($sess_id); } /** * Write session data to the SessionHandler backend. * * @param string $id The session identifier. * @param string $session_data The session data. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function write($id, $session_data) { $sess_id = 'sess_' . $id; return apc_store($sess_id, $session_data, ini_get("session.gc_maxlifetime")); } /** * Destroy the data for a particular session identifier in the SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function destroy($id) { $sess_id = 'sess_' . $id; return apc_delete($sess_id); } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public static function isSupported() { return extension_loaded('apc'); } } PK���\/��jjDlibraries/vendor/joomla/session/Joomla/Session/Storage/Memcached.phpnu�[���<?php /** * Part of the Joomla Framework Session Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Session\Storage; use Joomla\Session\Storage; /** * Memcached session storage handler for PHP * * @since 1.0 * @deprecated The joomla/session package is deprecated */ class Memcached extends Storage { /** * Constructor * * @param array $options Optional parameters. * * @since 1.0 * @throws \RuntimeException */ public function __construct($options = array()) { if (!self::isSupported()) { throw new \RuntimeException('Memcached Extension is not available', 404); } // This will be an array of loveliness // @todo: multiple servers $this->_servers = array( array( 'host' => isset($options['memcache_server_host']) ? $options['memcache_server_host'] : 'localhost', 'port' => isset($options['memcache_server_port']) ? $options['memcache_server_port'] : 11211 ) ); // Only construct parent AFTER host and port are sent, otherwise when register is called this will fail. parent::__construct($options); } /** * Register the functions of this class with PHP's session handler * * @return void * * @since 1.0 */ public function register() { ini_set('session.save_path', $this->_servers[0]['host'] . ':' . $this->_servers[0]['port']); ini_set('session.save_handler', 'memcached'); } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 1.0 */ static public function isSupported() { // GAE and HHVM have both had instances where Memcached the class was defined but no extension was loaded. If the class is there, we can assume it works. return (class_exists('Memcached')); } } PK���\??�W��Clibraries/vendor/joomla/session/Joomla/Session/Storage/Database.phpnu�[���<?php /** * Part of the Joomla Framework Session Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Session\Storage; use Joomla\Session\Storage; use Joomla\Database\DatabaseDriver; /** * Database session storage handler for PHP * * @see http://www.php.net/manual/en/function.session-set-save-handler.php * @since 1.0 * @deprecated The joomla/session package is deprecated */ class Database extends Storage { /** * The DatabaseDriver to use when querying. * * @var \Joomla\Database\DatabaseDriver */ protected $db; /** * Constructor * * @param array $options Optional parameters. A `dbo` options is required. * * @since 1.0 * @throws \RuntimeException */ public function __construct($options = array()) { if (isset($options['db']) && ($options['db'] instanceof DatabaseDriver)) { parent::__construct($options); $this->db = $options['db']; } else { throw new \RuntimeException( sprintf('The %s storage engine requires a `db` option that is an instance of Joomla\\Database\\DatabaseDriver.', __CLASS__) ); } } /** * Read the data for a particular session identifier from the SessionHandler backend. * * @param string $id The session identifier. * * @return string The session data. * * @since 1.0 */ public function read($id) { try { // Get the session data from the database table. $query = $this->db->getQuery(true); $query->select($this->db->quoteName('data')) ->from($this->db->quoteName('#__session')) ->where($this->db->quoteName('session_id') . ' = ' . $this->db->quote($id)); $this->db->setQuery($query); return (string) $this->db->loadResult(); } catch (\Exception $e) { return false; } } /** * Write session data to the SessionHandler backend. * * @param string $id The session identifier. * @param string $data The session data. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function write($id, $data) { try { $query = $this->db->getQuery(true); $query->update($this->db->quoteName('#__session')) ->set($this->db->quoteName('data') . ' = ' . $this->db->quote($data)) ->set($this->db->quoteName('time') . ' = ' . $this->db->quote((int) time())) ->where($this->db->quoteName('session_id') . ' = ' . $this->db->quote($id)); // Try to update the session data in the database table. $this->db->setQuery($query); if (!$this->db->execute()) { return false; } // Since $this->db->execute did not throw an exception the query was successful. // Either the data changed, or the data was identical. In either case we are done. return true; } catch (\Exception $e) { return false; } } /** * Destroy the data for a particular session identifier in the SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function destroy($id) { try { $query = $this->db->getQuery(true); $query->delete($this->db->quoteName('#__session')) ->where($this->db->quoteName('session_id') . ' = ' . $this->db->quote($id)); // Remove a session from the database. $this->db->setQuery($query); return (boolean) $this->db->execute(); } catch (\Exception $e) { return false; } } /** * Garbage collect stale sessions from the SessionHandler backend. * * @param integer $lifetime The maximum age of a session. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function gc($lifetime = 1440) { // Determine the timestamp threshold with which to purge old sessions. $past = time() - $lifetime; try { $query = $this->db->getQuery(true); $query->delete($this->db->quoteName('#__session')) ->where($this->db->quoteName('time') . ' < ' . $this->db->quote((int) $past)); // Remove expired sessions from the database. $this->db->setQuery($query); return (boolean) $this->db->execute(); } catch (\Exception $e) { return false; } } } PK���\�vy��N�N:libraries/vendor/joomla/session/Joomla/Session/Session.phpnu�[���<?php /** * Part of the Joomla Framework Session Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Session; use Joomla\Event\DispatcherInterface; use Joomla\Input\Input; /** * Class for managing HTTP sessions * * Provides access to session-state values as well as session-level * settings and lifetime management methods. * Based on the standard PHP session handling mechanism it provides * more advanced features such as expire timeouts. * * @since 1.0 * @deprecated The joomla/session package is deprecated */ class Session implements \IteratorAggregate { /** * Internal state. * One of 'inactive'|'active'|'expired'|'destroyed'|'error' * * @var string * @see getState() * @since 1.0 */ protected $state = 'inactive'; /** * Maximum age of unused session in minutes * * @var string * @since 1.0 */ protected $expire = 15; /** * The session store object. * * @var Storage * @since 1.0 */ protected $store = null; /** * Security policy. * List of checks that will be done. * * Default values: * - fix_browser * - fix_adress * * @var array * @since 1.0 */ protected $security = array('fix_browser'); /** * Force cookies to be SSL only * Default false * * @var boolean * @since 1.0 */ protected $force_ssl = false; /** * The domain to use when setting cookies. * * @var mixed * @since 1.0 */ protected $cookie_domain; /** * The path to use when setting cookies. * * @var mixed * @since 1.0 */ protected $cookie_path; /** * Session instances container. * * @var Session * @since 1.0 */ protected static $instance; /** * The type of storage for the session. * * @var string * @since 1.0 */ protected $storeName; /** * Holds the Input object * * @var Input * @since 1.0 */ private $input = null; /** * Holds the Dispatcher object * * @var DispatcherInterface * @since 1.0 */ private $dispatcher = null; /** * Constructor * * @param string $store The type of storage for the session. * @param array $options Optional parameters * * @since 1.0 */ public function __construct($store = 'none', array $options = array()) { // Need to destroy any existing sessions started with session.auto_start if (session_id()) { session_unset(); session_destroy(); } // Disable transparent sid support ini_set('session.use_trans_sid', '0'); // Only allow the session ID to come from cookies and nothing else. ini_set('session.use_only_cookies', '1'); // Create handler $this->store = Storage::getInstance($store, $options); $this->storeName = $store; // Set options $this->_setOptions($options); $this->_setCookieParams(); $this->state = 'inactive'; } /** * Magic method to get read-only access to properties. * * @param string $name Name of property to retrieve * * @return mixed The value of the property * * @since 1.0 */ public function __get($name) { if ($name === 'storeName' || $name === 'state' || $name === 'expire') { return $this->$name; } } /** * Returns the global Session object, only creating it * if it doesn't already exist. * * @param string $handler The type of session handler. * @param array $options An array of configuration options (for new sessions only). * * @return Session The Session object. * * @since 1.0 */ public static function getInstance($handler, array $options = array ()) { if (!is_object(self::$instance)) { self::$instance = new self($handler, $options); } return self::$instance; } /** * Get current state of session * * @return string The session state * * @since 1.0 */ public function getState() { return $this->state; } /** * Get expiration time in minutes * * @return integer The session expiration time in minutes * * @since 1.0 */ public function getExpire() { return $this->expire; } /** * Get a session token, if a token isn't set yet one will be generated. * * Tokens are used to secure forms from spamming attacks. Once a token * has been generated the system will check the post request to see if * it is present, if not it will invalidate the session. * * @param boolean $forceNew If true, force a new token to be created * * @return string The session token * * @since 1.0 */ public function getToken($forceNew = false) { $token = $this->get('session.token'); // Create a token if ($token === null || $forceNew) { $token = $this->_createToken(12); $this->set('session.token', $token); } return $token; } /** * Method to determine if a token exists in the session. If not the * session will be set to expired * * @param string $tCheck Hashed token to be verified * @param boolean $forceExpire If true, expires the session * * @return boolean * * @since 1.0 */ public function hasToken($tCheck, $forceExpire = true) { // Check if a token exists in the session $tStored = $this->get('session.token'); // Check token if (($tStored !== $tCheck)) { if ($forceExpire) { $this->state = 'expired'; } return false; } return true; } /** * Retrieve an external iterator. * * @return \ArrayIterator Return an ArrayIterator of $_SESSION. * * @since 1.0 */ public function getIterator() { return new \ArrayIterator($_SESSION); } /** * Get session name * * @return string The session name * * @since 1.0 */ public function getName() { if ($this->state === 'destroyed') { // @TODO : raise error return null; } return session_name(); } /** * Get session id * * @return string The session name * * @since 1.0 */ public function getId() { if ($this->state === 'destroyed') { return null; } return session_id(); } /** * Get the session handlers * * @return array An array of available session handlers * * @since 1.0 */ public static function getStores() { $connectors = array(); // Get an iterator and loop trough the driver classes. $iterator = new \DirectoryIterator(__DIR__ . '/Storage'); foreach ($iterator as $file) { $fileName = $file->getFilename(); // Only load for php files. if (!$file->isFile() || $file->getExtension() != 'php') { continue; } // Derive the class name from the type. $class = str_ireplace('.php', '', '\\Joomla\\Session\\Storage\\' . ucfirst(trim($fileName))); // If the class doesn't exist we have nothing left to do but look at the next type. We did our best. if (!class_exists($class)) { continue; } // Sweet! Our class exists, so now we just need to know if it passes its test method. if ($class::isSupported()) { // Connector names should not have file extensions. $connectors[] = str_ireplace('.php', '', $fileName); } } return $connectors; } /** * Shorthand to check if the session is active * * @return boolean * * @since 1.0 */ public function isActive() { return (bool) ($this->state == 'active'); } /** * Check whether this session is currently created * * @return boolean True on success. * * @since 1.0 */ public function isNew() { $counter = $this->get('session.counter'); return (bool) ($counter === 1); } /** * Check whether this session is currently created * * @param Input $input Input object for the session to use. * @param Dispatcher $dispatcher Dispatcher object for the session to use. * * @return void. * * @since 1.0 */ public function initialise(Input $input, DispatcherInterface $dispatcher = null) { $this->input = $input; $this->dispatcher = $dispatcher; } /** * Get data from the session store * * @param string $name Name of a variable * @param mixed $default Default value of a variable if not set * @param string $namespace Namespace to use, default to 'default' * * @return mixed Value of a variable * * @since 1.0 */ public function get($name, $default = null, $namespace = 'default') { // Add prefix to namespace to avoid collisions $namespace = '__' . $namespace; if ($this->state !== 'active' && $this->state !== 'expired') { // @TODO :: generated error here $error = null; return $error; } if (isset($_SESSION[$namespace][$name])) { return $_SESSION[$namespace][$name]; } return $default; } /** * Set data into the session store. * * @param string $name Name of a variable. * @param mixed $value Value of a variable. * @param string $namespace Namespace to use, default to 'default'. * * @return mixed Old value of a variable. * * @since 1.0 */ public function set($name, $value = null, $namespace = 'default') { // Add prefix to namespace to avoid collisions $namespace = '__' . $namespace; if ($this->state !== 'active') { // @TODO :: generated error here return null; } $old = isset($_SESSION[$namespace][$name]) ? $_SESSION[$namespace][$name] : null; if (null === $value) { unset($_SESSION[$namespace][$name]); } else { $_SESSION[$namespace][$name] = $value; } return $old; } /** * Check whether data exists in the session store * * @param string $name Name of variable * @param string $namespace Namespace to use, default to 'default' * * @return boolean True if the variable exists * * @since 1.0 */ public function has($name, $namespace = 'default') { // Add prefix to namespace to avoid collisions. $namespace = '__' . $namespace; if ($this->state !== 'active') { // @TODO :: generated error here return null; } return isset($_SESSION[$namespace][$name]); } /** * Unset data from the session store * * @param string $name Name of variable * @param string $namespace Namespace to use, default to 'default' * * @return mixed The value from session or NULL if not set * * @since 1.0 */ public function clear($name, $namespace = 'default') { // Add prefix to namespace to avoid collisions $namespace = '__' . $namespace; if ($this->state !== 'active') { // @TODO :: generated error here return null; } $value = null; if (isset($_SESSION[$namespace][$name])) { $value = $_SESSION[$namespace][$name]; unset($_SESSION[$namespace][$name]); } return $value; } /** * Start a session. * * @return void * * @since 1.0 */ public function start() { if ($this->state === 'active') { return; } $this->_start(); $this->state = 'active'; // Initialise the session $this->_setCounter(); $this->_setTimers(); // Perform security checks $this->_validate(); if ($this->dispatcher instanceof DispatcherInterface) { $this->dispatcher->triggerEvent('onAfterSessionStart'); } } /** * Start a session. * * Creates a session (or resumes the current one based on the state of the session) * * @return boolean true on success * * @since 1.0 */ protected function _start() { // Start session if not started if ($this->state === 'restart') { session_regenerate_id(true); } else { $session_name = session_name(); // Get the JInputCookie object $cookie = $this->input->cookie; if (is_null($cookie->get($session_name))) { $session_clean = $this->input->get($session_name, false, 'string'); if ($session_clean) { session_id($session_clean); $cookie->set($session_name, '', time() - 3600); } } } /** * Write and Close handlers are called after destructing objects since PHP 5.0.5. * Thus destructors can use sessions but session handler can't use objects. * So we are moving session closure before destructing objects. * * Replace with session_register_shutdown() when dropping compatibility with PHP 5.3 */ register_shutdown_function('session_write_close'); session_cache_limiter('none'); session_start(); return true; } /** * Frees all session variables and destroys all data registered to a session * * This method resets the $_SESSION variable and destroys all of the data associated * with the current session in its storage (file or DB). It forces new session to be * started after this method is called. It does not unset the session cookie. * * @return boolean True on success * * @see session_destroy() * @see session_unset() * @since 1.0 */ public function destroy() { // Session was already destroyed if ($this->state === 'destroyed') { return true; } /* * In order to kill the session altogether, such as to log the user out, the session id * must also be unset. If a cookie is used to propagate the session id (default behavior), * then the session cookie must be deleted. */ if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time() - 42000, $this->cookie_path, $this->cookie_domain); } session_unset(); session_destroy(); $this->state = 'destroyed'; return true; } /** * Restart an expired or locked session. * * @return boolean True on success * * @see destroy * @since 1.0 */ public function restart() { $this->destroy(); if ($this->state !== 'destroyed') { // @TODO :: generated error here return false; } // Re-register the session handler after a session has been destroyed, to avoid PHP bug $this->store->register(); $this->state = 'restart'; // Regenerate session id session_regenerate_id(true); $this->_start(); $this->state = 'active'; $this->_validate(); $this->_setCounter(); return true; } /** * Create a new session and copy variables from the old one * * @return boolean $result true on success * * @since 1.0 */ public function fork() { if ($this->state !== 'active') { // @TODO :: generated error here return false; } // Keep session config $cookie = session_get_cookie_params(); // Kill session session_destroy(); // Re-register the session store after a session has been destroyed, to avoid PHP bug $this->store->register(); // Restore config session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'], true); // Restart session with new id session_regenerate_id(true); session_start(); return true; } /** * Writes session data and ends session * * Session data is usually stored after your script terminated without the need * to call JSession::close(), but as session data is locked to prevent concurrent * writes only one script may operate on a session at any time. When using * framesets together with sessions you will experience the frames loading one * by one due to this locking. You can reduce the time needed to load all the * frames by ending the session as soon as all changes to session variables are * done. * * @return void * * @see session_write_close() * @since 1.0 */ public function close() { session_write_close(); } /** * Set session cookie parameters * * @return void * * @since 1.0 */ protected function _setCookieParams() { $cookie = session_get_cookie_params(); if ($this->force_ssl) { $cookie['secure'] = true; } if ($this->cookie_domain) { $cookie['domain'] = $this->cookie_domain; } if ($this->cookie_path) { $cookie['path'] = $this->cookie_path; } session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'], true); } /** * Create a token-string * * @param integer $length Length of string * * @return string Generated token * * @since 1.0 */ protected function _createToken($length = 32) { static $chars = '0123456789abcdef'; $max = strlen($chars) - 1; $token = ''; $name = session_name(); for ($i = 0; $i < $length; ++$i) { $token .= $chars[(rand(0, $max))]; } return md5($token . $name); } /** * Set counter of session usage * * @return boolean True on success * * @since 1.0 */ protected function _setCounter() { $counter = $this->get('session.counter', 0); ++$counter; $this->set('session.counter', $counter); return true; } /** * Set the session timers * * @return boolean True on success * * @since 1.0 */ protected function _setTimers() { if (!$this->has('session.timer.start')) { $start = time(); $this->set('session.timer.start', $start); $this->set('session.timer.last', $start); $this->set('session.timer.now', $start); } $this->set('session.timer.last', $this->get('session.timer.now')); $this->set('session.timer.now', time()); return true; } /** * Set additional session options * * @param array $options List of parameter * * @return boolean True on success * * @since 1.0 */ protected function _setOptions(array $options) { // Set name if (isset($options['name'])) { session_name(md5($options['name'])); } // Set id if (isset($options['id'])) { session_id($options['id']); } // Set expire time if (isset($options['expire'])) { $this->expire = $options['expire']; } // Get security options if (isset($options['security'])) { $this->security = explode(',', $options['security']); } if (isset($options['force_ssl'])) { $this->force_ssl = (bool) $options['force_ssl']; } if (isset($options['cookie_domain'])) { $this->cookie_domain = $options['cookie_domain']; } if (isset($options['cookie_path'])) { $this->cookie_path = $options['cookie_path']; } // Sync the session maxlifetime ini_set('session.gc_maxlifetime', $this->expire); return true; } /** * Do some checks for security reason * * - timeout check (expire) * - ip-fixiation * - browser-fixiation * * If one check failed, session data has to be cleaned. * * @param boolean $restart Reactivate session * * @return boolean True on success * * @see http://shiflett.org/articles/the-truth-about-sessions * @since 1.0 */ protected function _validate($restart = false) { // Allow to restart a session if ($restart) { $this->state = 'active'; $this->set('session.client.address', null); $this->set('session.client.forwarded', null); $this->set('session.client.browser', null); $this->set('session.token', null); } // Check if session has expired if ($this->expire) { $curTime = $this->get('session.timer.now', 0); $maxTime = $this->get('session.timer.last', 0) + $this->expire; // Empty session variables if ($maxTime < $curTime) { $this->state = 'expired'; return false; } } // Record proxy forwarded for in the session in case we need it later if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $this->set('session.client.forwarded', $_SERVER['HTTP_X_FORWARDED_FOR']); } // Check for client address if (in_array('fix_adress', $this->security) && isset($_SERVER['REMOTE_ADDR'])) { $ip = $this->get('session.client.address'); if ($ip === null) { $this->set('session.client.address', $_SERVER['REMOTE_ADDR']); } elseif ($_SERVER['REMOTE_ADDR'] !== $ip) { $this->state = 'error'; return false; } } // Check for clients browser if (in_array('fix_browser', $this->security) && isset($_SERVER['HTTP_USER_AGENT'])) { $browser = $this->get('session.client.browser'); if ($browser === null) { $this->set('session.client.browser', $_SERVER['HTTP_USER_AGENT']); } elseif ($_SERVER['HTTP_USER_AGENT'] !== $browser) { // @todo remove code: $this->_state = 'error'; // @todo remove code: return false; } } return true; } } PK���\����11:libraries/vendor/joomla/session/Joomla/Session/Storage.phpnu�[���<?php /** * Part of the Joomla Framework Session Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Session; use Joomla\Filter\InputFilter; /** * Custom session storage handler for PHP * * @see http://www.php.net/manual/en/function.session-set-save-handler.php * @todo When dropping compatibility with PHP 5.3 use the SessionHandlerInterface and the SessionHandler class * @since 1.0 * @deprecated The joomla/session package is deprecated */ abstract class Storage { /** * @var array JSessionStorage instances container. * @since 1.0 */ protected static $instances = array(); /** * Constructor * * @param array $options Optional parameters. * * @since 1.0 */ public function __construct($options = array()) { $this->register($options); } /** * Returns a session storage handler object, only creating it if it doesn't already exist. * * @param string $name The session store to instantiate * @param array $options Array of options * * @return Storage * * @since 1.0 */ public static function getInstance($name = 'none', $options = array()) { $filter = new InputFilter; $name = strtolower($filter->clean($name, 'word')); if (empty(self::$instances[$name])) { $class = '\\Joomla\\Session\\Storage\\' . ucfirst($name); if (!class_exists($class)) { $path = __DIR__ . '/storage/' . $name . '.php'; if (file_exists($path)) { require_once $path; } else { // No attempt to die gracefully here, as it tries to close the non-existing session exit('Unable to load session storage class: ' . $name); } } self::$instances[$name] = new $class($options); } return self::$instances[$name]; } /** * Register the functions of this class with PHP's session handler * * @return void * * @since 1.0 */ public function register() { // Use this object as the session handler session_set_save_handler( array($this, 'open'), array($this, 'close'), array($this, 'read'), array($this, 'write'), array($this, 'destroy'), array($this, 'gc') ); } /** * Open the SessionHandler backend. * * @param string $save_path The path to the session object. * @param string $session_name The name of the session. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function open($save_path, $session_name) { return true; } /** * Close the SessionHandler backend. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function close() { return true; } /** * Read the data for a particular session identifier from the * SessionHandler backend. * * @param string $id The session identifier. * * @return string The session data. * * @since 1.0 */ public function read($id) { return; } /** * Write session data to the SessionHandler backend. * * @param string $id The session identifier. * @param string $session_data The session data. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function write($id, $session_data) { return true; } /** * Destroy the data for a particular session identifier in the * SessionHandler backend. * * @param string $id The session identifier. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function destroy($id) { return true; } /** * Garbage collect stale sessions from the SessionHandler backend. * * @param integer $maxlifetime The maximum age of a session. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public function gc($maxlifetime = null) { return true; } /** * Test to see if the SessionHandler is available. * * @return boolean True on success, false otherwise. * * @since 1.0 */ public static function isSupported() { return true; } } PK���\�P�E�E&libraries/vendor/joomla/compat/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\�����7libraries/vendor/joomla/compat/src/JsonSerializable.phpnu�[���<?php /** * Part of the Joomla Framework Compat Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ /** * JsonSerializable interface. This file provides backwards compatibility to PHP 5.3 and ensures * the interface is present in systems where JSON related code was removed. * * @link http://www.php.net/manual/en/jsonserializable.jsonserialize.php * @since 1.0 */ interface JsonSerializable { /** * Return data which should be serialized by json_encode(). * * @return mixed * * @since 1.0 */ public function jsonSerialize(); } PK���\�P�E�E%libraries/vendor/joomla/event/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\J|�uVV9libraries/vendor/joomla/event/src/DispatcherInterface.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; /** * Interface for event dispatchers. * * @since 1.0 */ interface DispatcherInterface { /** * Trigger an event. * * @param EventInterface|string $event The event object or name. * * @return EventInterface The event after being passed through all listeners. * * @since 1.0 */ public function triggerEvent($event); } PK���\QT�n22.libraries/vendor/joomla/event/src/Priority.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; /** * An enumeration of priorities for event listeners, * that you are encouraged to use when adding them in the Dispatcher. * * @since 1.0 */ final class Priority { const MIN = -3; const LOW = -2; const BELOW_NORMAL = -1; const NORMAL = 0; const ABOVE_NORMAL = 1; const HIGH = 2; const MAX = 3; } PK���\噘���4libraries/vendor/joomla/event/src/EventInterface.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; /** * Interface for events. * An event has a name and its propagation can be stopped (if the implementation supports it). * * @since 1.0 */ interface EventInterface { /** * Get the event name. * * @return string The event name. * * @since 1.0 */ public function getName(); /** * Tell if the event propagation is stopped. * * @return boolean True if stopped, false otherwise. * * @since 1.0 */ public function isStopped(); } PK���\l�:Z� � 3libraries/vendor/joomla/event/src/AbstractEvent.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; use Serializable; use ArrayAccess; use Countable; /** * Implementation of EventInterface. * * @since 1.0 */ abstract class AbstractEvent implements EventInterface, ArrayAccess, Serializable, Countable { /** * The event name. * * @var string * * @since 1.0 */ protected $name; /** * The event arguments. * * @var array * * @since 1.0 */ protected $arguments; /** * A flag to see if the event propagation is stopped. * * @var boolean * * @since 1.0 */ protected $stopped = false; /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @since 1.0 */ public function __construct($name, array $arguments = array()) { $this->name = $name; $this->arguments = $arguments; } /** * Get the event name. * * @return string The event name. * * @since 1.0 */ public function getName() { return $this->name; } /** * Get an event argument value. * * @param string $name The argument name. * @param mixed $default The default value if not found. * * @return mixed The argument value or the default value. * * @since 1.0 */ public function getArgument($name, $default = null) { if (isset($this->arguments[$name])) { return $this->arguments[$name]; } return $default; } /** * Tell if the given event argument exists. * * @param string $name The argument name. * * @return boolean True if it exists, false otherwise. * * @since 1.0 */ public function hasArgument($name) { return isset($this->arguments[$name]); } /** * Get all event arguments. * * @return array An associative array of argument names as keys * and their values as values. * * @since 1.0 */ public function getArguments() { return $this->arguments; } /** * Tell if the event propagation is stopped. * * @return boolean True if stopped, false otherwise. * * @since 1.0 */ public function isStopped() { return true === $this->stopped; } /** * Count the number of arguments. * * @return integer The number of arguments. * * @since 1.0 */ public function count() { return count($this->arguments); } /** * Serialize the event. * * @return string The serialized event. * * @since 1.0 */ public function serialize() { return serialize(array($this->name, $this->arguments, $this->stopped)); } /** * Unserialize the event. * * @param string $serialized The serialized event. * * @return void * * @since 1.0 */ public function unserialize($serialized) { list($this->name, $this->arguments, $this->stopped) = unserialize($serialized); } /** * Tell if the given event argument exists. * * @param string $name The argument name. * * @return boolean True if it exists, false otherwise. * * @since 1.0 */ public function offsetExists($name) { return $this->hasArgument($name); } /** * Get an event argument value. * * @param string $name The argument name. * * @return mixed The argument value or null if not existing. * * @since 1.0 */ public function offsetGet($name) { return $this->getArgument($name); } } PK���\W�EF��>libraries/vendor/joomla/event/src/DispatcherAwareInterface.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; /** * Interface to be implemented by classes depending on a dispatcher. * * @since 1.0 */ interface DispatcherAwareInterface { /** * Set the dispatcher to use. * * @param DispatcherInterface $dispatcher The dispatcher to use. * * @return DispatcherAwareInterface This method is chainable. * * @since 1.0 */ public function setDispatcher(DispatcherInterface $dispatcher); } PK���\T�� +libraries/vendor/joomla/event/src/Event.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; use InvalidArgumentException; /** * Default Event class. * * @since 1.0 */ class Event extends AbstractEvent { /** * Add an event argument, only if it is not existing. * * @param string $name The argument name. * @param mixed $value The argument value. * * @return Event This method is chainable. * * @since 1.0 */ public function addArgument($name, $value) { if (!isset($this->arguments[$name])) { $this->arguments[$name] = $value; } return $this; } /** * Set the value of an event argument. * If the argument already exists, it will be overridden. * * @param string $name The argument name. * @param mixed $value The argument value. * * @return Event This method is chainable. * * @since 1.0 */ public function setArgument($name, $value) { $this->arguments[$name] = $value; return $this; } /** * Remove an event argument. * * @param string $name The argument name. * * @return mixed The old argument value or null if it is not existing. * * @since 1.0 */ public function removeArgument($name) { $return = null; if (isset($this->arguments[$name])) { $return = $this->arguments[$name]; unset($this->arguments[$name]); } return $return; } /** * Clear all event arguments. * * @return array The old arguments. * * @since 1.0 */ public function clearArguments() { $arguments = $this->arguments; $this->arguments = array(); return $arguments; } /** * Stop the event propagation. * * @return void * * @since 1.0 */ public function stop() { $this->stopped = true; } /** * Set the value of an event argument. * * @param string $name The argument name. * @param mixed $value The argument value. * * @return void * * @throws InvalidArgumentException If the argument name is null. * * @since 1.0 */ public function offsetSet($name, $value) { if (is_null($name)) { throw new InvalidArgumentException('The argument name cannot be null.'); } $this->setArgument($name, $value); } /** * Remove an event argument. * * @param string $name The argument name. * * @return void * * @since 1.0 */ public function offsetUnset($name) { $this->removeArgument($name); } } PK���\�m�� 4libraries/vendor/joomla/event/src/EventImmutable.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; use BadMethodCallException; /** * Implementation of an immutable Event. * An immutable event cannot be modified after instanciation : * * - its propagation cannot be stopped * - its arguments cannot be modified * * You may want to use this event when you want to ensure that * the listeners won't manipulate it. * * @since 1.0 */ final class EventImmutable extends AbstractEvent { /** * A flag to see if the constructor has been * already called. * * @var boolean */ private $constructed = false; /** * Constructor. * * @param string $name The event name. * @param array $arguments The event arguments. * * @throws BadMethodCallException * * @since 1.0 */ public function __construct($name, array $arguments = array()) { if ($this->constructed) { throw new BadMethodCallException( sprintf('Cannot reconstruct the EventImmutable %s.', $this->name) ); } $this->constructed = true; parent::__construct($name, $arguments); } /** * Set the value of an event argument. * * @param string $name The argument name. * @param mixed $value The argument value. * * @return void * * @throws BadMethodCallException * * @since 1.0 */ public function offsetSet($name, $value) { throw new BadMethodCallException( sprintf( 'Cannot set the argument %s of the immutable event %s.', $name, $this->name ) ); } /** * Remove an event argument. * * @param string $name The argument name. * * @return void * * @throws BadMethodCallException * * @since 1.0 */ public function offsetUnset($name) { throw new BadMethodCallException( sprintf( 'Cannot remove the argument %s of the immutable event %s.', $name, $this->name ) ); } } PK���\��<&&:libraries/vendor/joomla/event/src/DelegatingDispatcher.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; /** * A dispatcher delegating its methods to an other dispatcher. * * @since 1.0 */ final class DelegatingDispatcher implements DispatcherInterface { /** * The delegated dispatcher. * * @var DispatcherInterface * * @since 1.0 */ private $dispatcher; /** * Constructor. * * @param DispatcherInterface $dispatcher The delegated dispatcher. * * @since 1.0 */ public function __construct(DispatcherInterface $dispatcher) { $this->dispatcher = $dispatcher; } /** * Trigger an event. * * @param EventInterface|string $event The event object or name. * * @return EventInterface The event after being passed through all listeners. * * @since 1.0 */ public function triggerEvent($event) { return $this->dispatcher->triggerEvent($event); } } PK���\%��.ss<libraries/vendor/joomla/event/src/ListenersPriorityQueue.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; use SplPriorityQueue; use SplObjectStorage; use IteratorAggregate; use Countable; /** * A class containing an inner listeners priority queue that can be iterated multiple times. * One instance of ListenersPriorityQueue is used per Event in the Dispatcher. * * @since 1.0 */ class ListenersPriorityQueue implements IteratorAggregate, Countable { /** * The inner priority queue. * * @var SplPriorityQueue * * @since 1.0 */ protected $queue; /** * A copy of the listeners contained in the queue * that is used when detaching them to * recreate the queue or to see if the queue contains * a given listener. * * @var SplObjectStorage * * @since 1.0 */ protected $storage; /** * A decreasing counter used to compute * the internal priority as an array because * SplPriorityQueue dequeues elements with the same priority. * * @var integer * * @since 1.0 */ private $counter = PHP_INT_MAX; /** * Constructor. * * @since 1.0 */ public function __construct() { $this->queue = new SplPriorityQueue; $this->storage = new SplObjectStorage; } /** * Add a listener with the given priority only if not already present. * * @param \Closure|object $listener The listener. * @param integer $priority The listener priority. * * @return ListenersPriorityQueue This method is chainable. * * @since 1.0 */ public function add($listener, $priority) { if (!$this->storage->contains($listener)) { // Compute the internal priority as an array. $priority = array($priority, $this->counter--); $this->storage->attach($listener, $priority); $this->queue->insert($listener, $priority); } return $this; } /** * Remove a listener from the queue. * * @param \Closure|object $listener The listener. * * @return ListenersPriorityQueue This method is chainable. * * @since 1.0 */ public function remove($listener) { if ($this->storage->contains($listener)) { $this->storage->detach($listener); $this->storage->rewind(); $this->queue = new SplPriorityQueue; foreach ($this->storage as $listener) { $priority = $this->storage->getInfo(); $this->queue->insert($listener, $priority); } } return $this; } /** * Tell if the listener exists in the queue. * * @param \Closure|object $listener The listener. * * @return boolean True if it exists, false otherwise. * * @since 1.0 */ public function has($listener) { return $this->storage->contains($listener); } /** * Get the priority of the given listener. * * @param \Closure|object $listener The listener. * @param mixed $default The default value to return if the listener doesn't exist. * * @return mixed The listener priority if it exists, null otherwise. * * @since 1.0 */ public function getPriority($listener, $default = null) { if ($this->storage->contains($listener)) { return $this->storage[$listener][0]; } return $default; } /** * Get all listeners contained in this queue, sorted according to their priority. * * @return object[] An array of listeners. * * @since 1.0 */ public function getAll() { $listeners = array(); // Get a clone of the queue. $queue = $this->getIterator(); foreach ($queue as $listener) { $listeners[] = $listener; } return $listeners; } /** * Get the inner queue with its cursor on top of the heap. * * @return SplPriorityQueue The inner queue. * * @since 1.0 */ public function getIterator() { // SplPriorityQueue queue is a heap. $queue = clone $this->queue; if (!$queue->isEmpty()) { $queue->top(); } return $queue; } /** * Count the number of listeners in the queue. * * @return integer The number of listeners in the queue. * * @since 1.0 */ public function count() { return count($this->queue); } } PK���\b��^T)T)0libraries/vendor/joomla/event/src/Dispatcher.phpnu�[���<?php /** * Part of the Joomla Framework Event Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Event; use InvalidArgumentException; use Closure; /** * Implementation of a DispatcherInterface supporting * prioritized listeners. * * @since 1.0 */ class Dispatcher implements DispatcherInterface { /** * An array of registered events indexed by * the event names. * * @var EventInterface[] * * @since 1.0 */ protected $events = array(); /** * A regular expression that will filter listener method names. * * @var string * @since 1.0 * @deprecated */ protected $listenerFilter; /** * An array of ListenersPriorityQueue indexed * by the event names. * * @var ListenersPriorityQueue[] * * @since 1.0 */ protected $listeners = array(); /** * Set an event to the dispatcher. * It will replace any event with the same name. * * @param EventInterface $event The event. * * @return Dispatcher This method is chainable. * * @since 1.0 */ public function setEvent(EventInterface $event) { $this->events[$event->getName()] = $event; return $this; } /** * Sets a regular expression to filter the class methods when adding a listener. * * @param string $regex A regular expression (for example '^on' will only register methods starting with "on"). * * @return Dispatcher This method is chainable. * * @since 1.0 * @deprecated Incorporate a method in your listener object such as `getEvents` to feed into the `setListener` method. */ public function setListenerFilter($regex) { $this->listenerFilter = $regex; return $this; } /** * Add an event to this dispatcher, only if it is not existing. * * @param EventInterface $event The event. * * @return Dispatcher This method is chainable. * * @since 1.0 */ public function addEvent(EventInterface $event) { if (!isset($this->events[$event->getName()])) { $this->events[$event->getName()] = $event; } return $this; } /** * Tell if the given event has been added to this dispatcher. * * @param EventInterface|string $event The event object or name. * * @return boolean True if the listener has the given event, false otherwise. * * @since 1.0 */ public function hasEvent($event) { if ($event instanceof EventInterface) { $event = $event->getName(); } return isset($this->events[$event]); } /** * Get the event object identified by the given name. * * @param string $name The event name. * @param mixed $default The default value if the event was not registered. * * @return EventInterface|mixed The event of the default value. * * @since 1.0 */ public function getEvent($name, $default = null) { if (isset($this->events[$name])) { return $this->events[$name]; } return $default; } /** * Remove an event from this dispatcher. * The registered listeners will remain. * * @param EventInterface|string $event The event object or name. * * @return Dispatcher This method is chainable. * * @since 1.0 */ public function removeEvent($event) { if ($event instanceof EventInterface) { $event = $event->getName(); } if (isset($this->events[$event])) { unset($this->events[$event]); } return $this; } /** * Get the registered events. * * @return EventInterface[] The registered event. * * @since 1.0 */ public function getEvents() { return $this->events; } /** * Clear all events. * * @return EventInterface[] The old events. * * @since 1.0 */ public function clearEvents() { $events = $this->events; $this->events = array(); return $events; } /** * Count the number of registered event. * * @return integer The numer of registered events. * * @since 1.0 */ public function countEvents() { return count($this->events); } /** * Add a listener to this dispatcher, only if not already registered to these events. * If no events are specified, it will be registered to all events matching it's methods name. * In the case of a closure, you must specify at least one event name. * * @param object|Closure $listener The listener * @param array $events An associative array of event names as keys * and the corresponding listener priority as values. * * @return Dispatcher This method is chainable. * * @throws InvalidArgumentException * * @since 1.0 */ public function addListener($listener, array $events = array()) { if (!is_object($listener)) { throw new InvalidArgumentException('The given listener is not an object.'); } // We deal with a closure. if ($listener instanceof Closure) { if (empty($events)) { throw new InvalidArgumentException('No event name(s) and priority specified for the Closure listener.'); } foreach ($events as $name => $priority) { if (!isset($this->listeners[$name])) { $this->listeners[$name] = new ListenersPriorityQueue; } $this->listeners[$name]->add($listener, $priority); } return $this; } // We deal with a "normal" object. $methods = get_class_methods($listener); if (!empty($events)) { $methods = array_intersect($methods, array_keys($events)); } // @deprecated $regex = $this->listenerFilter ?: '.*'; foreach ($methods as $event) { // @deprecated - this outer `if` is deprecated. if (preg_match("#$regex#", $event)) { // Retain this inner code after removal of the outer `if`. if (!isset($this->listeners[$event])) { $this->listeners[$event] = new ListenersPriorityQueue; } $priority = isset($events[$event]) ? $events[$event] : Priority::NORMAL; $this->listeners[$event]->add($listener, $priority); } } return $this; } /** * Get the priority of the given listener for the given event. * * @param object|Closure $listener The listener. * @param EventInterface|string $event The event object or name. * * @return mixed The listener priority or null if the listener doesn't exist. * * @since 1.0 */ public function getListenerPriority($listener, $event) { if ($event instanceof EventInterface) { $event = $event->getName(); } if (isset($this->listeners[$event])) { return $this->listeners[$event]->getPriority($listener); } return null; } /** * Get the listeners registered to the given event. * * @param EventInterface|string $event The event object or name. * * @return object[] An array of registered listeners sorted according to their priorities. * * @since 1.0 */ public function getListeners($event) { if ($event instanceof EventInterface) { $event = $event->getName(); } if (isset($this->listeners[$event])) { return $this->listeners[$event]->getAll(); } return array(); } /** * Tell if the given listener has been added. * If an event is specified, it will tell if the listener is registered for that event. * * @param object|Closure $listener The listener. * @param EventInterface|string $event The event object or name. * * @return boolean True if the listener is registered, false otherwise. * * @since 1.0 */ public function hasListener($listener, $event = null) { if ($event) { if ($event instanceof EventInterface) { $event = $event->getName(); } if (isset($this->listeners[$event])) { return $this->listeners[$event]->has($listener); } } else { foreach ($this->listeners as $queue) { if ($queue->has($listener)) { return true; } } } return false; } /** * Remove the given listener from this dispatcher. * If no event is specified, it will be removed from all events it is listening to. * * @param object|Closure $listener The listener to remove. * @param EventInterface|string $event The event object or name. * * @return Dispatcher This method is chainable. * * @since 1.0 */ public function removeListener($listener, $event = null) { if ($event) { if ($event instanceof EventInterface) { $event = $event->getName(); } if (isset($this->listeners[$event])) { $this->listeners[$event]->remove($listener); } } else { foreach ($this->listeners as $queue) { $queue->remove($listener); } } return $this; } /** * Clear the listeners in this dispatcher. * If an event is specified, the listeners will be cleared only for that event. * * @param EventInterface|string $event The event object or name. * * @return Dispatcher This method is chainable. * * @since 1.0 */ public function clearListeners($event = null) { if ($event) { if ($event instanceof EventInterface) { $event = $event->getName(); } if (isset($this->listeners[$event])) { unset($this->listeners[$event]); } } else { $this->listeners = array(); } return $this; } /** * Count the number of registered listeners for the given event. * * @param EventInterface|string $event The event object or name. * * @return integer The number of registered listeners for the given event. * * @since 1.0 */ public function countListeners($event) { if ($event instanceof EventInterface) { $event = $event->getName(); } return isset($this->listeners[$event]) ? count($this->listeners[$event]) : 0; } /** * Trigger an event. * * @param EventInterface|string $event The event object or name. * * @return EventInterface The event after being passed through all listeners. * * @since 1.0 */ public function triggerEvent($event) { if (!($event instanceof EventInterface)) { if (isset($this->events[$event])) { $event = $this->events[$event]; } else { $event = new Event($event); } } if (isset($this->listeners[$event->getName()])) { foreach ($this->listeners[$event->getName()] as $listener) { if ($event->isStopped()) { return $event; } if ($listener instanceof Closure) { call_user_func($listener, $event); } else { call_user_func(array($listener, $event->getName()), $event); } } } return $event; } } PK���\�P�E�E&libraries/vendor/joomla/string/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\� V''0libraries/vendor/joomla/string/src/Inflector.phpnu�[���<?php /** * Part of the Joomla Framework String Package * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\String; use InvalidArgumentException; /** * Joomla Framework String Inflector Class * * The Inflector transforms words * * @since 1.0 */ class Inflector { /** * The singleton instance. * * @var Inflector * @since 1.0 */ private static $instance; /** * The inflector rules for singularisation, pluralisation and countability. * * @var array * @since 1.0 */ private $rules = array( 'singular' => array( '/(matr)ices$/i' => '\1ix', '/(vert|ind)ices$/i' => '\1ex', '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us', '/([ftw]ax)es/i' => '\1', '/(cris|ax|test)es$/i' => '\1is', '/(shoe|slave)s$/i' => '\1', '/(o)es$/i' => '\1', '/([^aeiouy]|qu)ies$/i' => '\1y', '/$1ses$/i' => '\s', '/ses$/i' => '\s', '/eaus$/' => 'eau', '/^(.*us)$/' => '\\1', '/s$/i' => '', ), 'plural' => array( '/([m|l])ouse$/i' => '\1ice', '/(matr|vert|ind)(ix|ex)$/i' => '\1ices', '/(x|ch|ss|sh)$/i' => '\1es', '/([^aeiouy]|qu)y$/i' => '\1ies', '/([^aeiouy]|qu)ies$/i' => '\1y', '/(?:([^f])fe|([lr])f)$/i' => '\1\2ves', '/sis$/i' => 'ses', '/([ti])um$/i' => '\1a', '/(buffal|tomat)o$/i' => '\1\2oes', '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$/i' => '\1i', '/us$/i' => 'uses', '/(ax|cris|test)is$/i' => '\1es', '/s$/i' => 's', '/$/' => 's', ), 'countable' => array( 'id', 'hits', 'clicks', ), ); /** * Cached inflections. * * The array is in the form [singular => plural] * * @var array * @since 1.0 */ private $cache = array(); /** * Protected constructor. * * @since 1.0 */ protected function __construct() { // Pre=populate the irregual singular/plural. $this ->addWord('deer') ->addWord('moose') ->addWord('sheep') ->addWord('bison') ->addWord('salmon') ->addWord('pike') ->addWord('trout') ->addWord('fish') ->addWord('swine') ->addWord('alias', 'aliases') ->addWord('bus', 'buses') ->addWord('foot', 'feet') ->addWord('goose', 'geese') ->addWord('hive', 'hives') ->addWord('louse', 'lice') ->addWord('man', 'men') ->addWord('mouse', 'mice') ->addWord('ox', 'oxen') ->addWord('quiz', 'quizes') ->addWord('status', 'statuses') ->addWord('tooth', 'teeth') ->addWord('woman', 'women'); } /** * Adds inflection regex rules to the inflector. * * @param mixed $data A string or an array of strings or regex rules to add. * @param string $ruleType The rule type: singular | plural | countable * * @return void * * @since 1.0 * @throws InvalidArgumentException */ private function addRule($data, $ruleType) { if (is_string($data)) { $data = array($data); } elseif (!is_array($data)) { // Do not translate. throw new InvalidArgumentException('Invalid inflector rule data.'); } foreach ($data as $rule) { // Ensure a string is pushed. array_push($this->rules[$ruleType], (string) $rule); } } /** * Gets an inflected word from the cache where the singular form is supplied. * * @param string $singular A singular form of a word. * * @return mixed The cached inflection or false if none found. * * @since 1.0 */ private function getCachedPlural($singular) { $singular = String::strtolower($singular); // Check if the word is in cache. if (isset($this->cache[$singular])) { return $this->cache[$singular]; } return false; } /** * Gets an inflected word from the cache where the plural form is supplied. * * @param string $plural A plural form of a word. * * @return mixed The cached inflection or false if none found. * * @since 1.0 */ private function getCachedSingular($plural) { $plural = String::strtolower($plural); return array_search($plural, $this->cache); } /** * Execute a regex from rules. * * The 'plural' rule type expects a singular word. * The 'singular' rule type expects a plural word. * * @param string $word The string input. * @param string $ruleType String (eg, singular|plural) * * @return mixed An inflected string, or false if no rule could be applied. * * @since 1.0 */ private function matchRegexRule($word, $ruleType) { // Cycle through the regex rules. foreach ($this->rules[$ruleType] as $regex => $replacement) { $matches = 0; $matchedWord = preg_replace($regex, $replacement, $word, -1, $matches); if ($matches > 0) { return $matchedWord; } } return false; } /** * Sets an inflected word in the cache. * * @param string $singular The singular form of the word. * @param string $plural The plural form of the word. If omitted, it is assumed the singular and plural are identical. * * @return void * * @since 1.0 */ private function setCache($singular, $plural = null) { $singular = String::strtolower($singular); if ($plural === null) { $plural = $singular; } else { $plural = String::strtolower($plural); } $this->cache[$singular] = $plural; } /** * Adds a countable word. * * @param mixed $data A string or an array of strings to add. * * @return Inflector Returns this object to support chaining. * * @since 1.0 */ public function addCountableRule($data) { $this->addRule($data, 'countable'); return $this; } /** * Adds a specific singular-plural pair for a word. * * @param string $singular The singular form of the word. * @param string $plural The plural form of the word. If omitted, it is assumed the singular and plural are identical. * * @return Inflector Returns this object to support chaining. * * @since 1.0 */ public function addWord($singular, $plural =null) { $this->setCache($singular, $plural); return $this; } /** * Adds a pluralisation rule. * * @param mixed $data A string or an array of regex rules to add. * * @return Inflector Returns this object to support chaining. * * @since 1.0 */ public function addPluraliseRule($data) { $this->addRule($data, 'plural'); return $this; } /** * Adds a singularisation rule. * * @param mixed $data A string or an array of regex rules to add. * * @return Inflector Returns this object to support chaining. * * @since 1.0 */ public function addSingulariseRule($data) { $this->addRule($data, 'singular'); return $this; } /** * Gets an instance of the JStringInflector singleton. * * @param boolean $new If true (default is false), returns a new instance regardless if one exists. * This argument is mainly used for testing. * * @return Inflector * * @since 1.0 */ public static function getInstance($new = false) { if ($new) { return new static; } elseif (!is_object(self::$instance)) { self::$instance = new static; } return self::$instance; } /** * Checks if a word is countable. * * @param string $word The string input. * * @return boolean True if word is countable, false otherwise. * * @since 1.0 */ public function isCountable($word) { return (boolean) in_array($word, $this->rules['countable']); } /** * Checks if a word is in a plural form. * * @param string $word The string input. * * @return boolean True if word is plural, false if not. * * @since 1.0 */ public function isPlural($word) { // Try the cache for an known inflection. $inflection = $this->getCachedSingular($word); if ($inflection !== false) { return true; } // Compute the inflection to cache the values, and compare. return $this->toPlural($this->toSingular($word)) == $word; } /** * Checks if a word is in a singular form. * * @param string $word The string input. * * @return boolean True if word is singular, false if not. * * @since 1.0 */ public function isSingular($word) { // Try the cache for an known inflection. $inflection = $this->getCachedPlural($word); if ($inflection !== false) { return true; } // Compute the inflection to cache the values, and compare. return $this->toSingular($this->toPlural($word)) == $word; } /** * Converts a word into its plural form. * * @param string $word The singular word to pluralise. * * @return mixed An inflected string, or false if no rule could be applied. * * @since 1.0 */ public function toPlural($word) { // Try to get the cached plural form from the singular. $cache = $this->getCachedPlural($word); if ($cache !== false) { return $cache; } // Check if the word is a known singular. if ($this->getCachedSingular($word)) { return false; } // Compute the inflection. $inflected = $this->matchRegexRule($word, 'plural'); if ($inflected !== false) { $this->setCache($word, $inflected); return $inflected; } // Dead code return false; } /** * Converts a word into its singular form. * * @param string $word The plural word to singularise. * * @return mixed An inflected string, or false if no rule could be applied. * * @since 1.0 */ public function toSingular($word) { // Try to get the cached singular form from the plural. $cache = $this->getCachedSingular($word); if ($cache !== false) { return $cache; } // Check if the word is a known plural. if ($this->getCachedPlural($word)) { return false; } // Compute the inflection. $inflected = $this->matchRegexRule($word, 'singular'); if ($inflected !== false) { $this->setCache($inflected, $word); return $inflected; } return false; } } PK���\���22=libraries/vendor/joomla/string/src/phputf8/substr_replace.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware substr_replace. * Note: requires utf8_substr to be loaded * @see http://www.php.net/substr_replace * @see utf8_strlen * @see utf8_substr */ function utf8_substr_replace($str, $repl, $start , $length = NULL ) { preg_match_all('/./us', $str, $ar); preg_match_all('/./us', $repl, $rar); if( $length === NULL ) { $length = utf8_strlen($str); } array_splice( $ar[0], $start, $length, $rar[0] ); return join('',$ar[0]); } PK���\�7�k>g>g2libraries/vendor/joomla/string/src/phputf8/LICENSEnu�[��� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! PK���\L�����3libraries/vendor/joomla/string/src/phputf8/utf8.phpnu�[���<?php /** * This is the dynamic loader for the library. It checks whether you have * the mbstring extension available and includes relevant files * on that basis, falling back to the native (as in written in PHP) version * if mbstring is unavailabe. * * It's probably easiest to use this, if you don't want to understand * the dependencies involved, in conjunction with PHP versions etc. At * the same time, you might get better performance by managing loading * yourself. The smartest way to do this, bearing in mind performance, * is probably to "load on demand" - i.e. just before you use these * functions in your code, load the version you need. * * It makes sure the the following functions are available; * utf8_strlen, utf8_strpos, utf8_strrpos, utf8_substr, * utf8_strtolower, utf8_strtoupper * Other functions in the ./native directory depend on these * six functions being available * @package utf8 */ /** * Put the current directory in this constant */ if ( !defined('UTF8') ) { define('UTF8',dirname(__FILE__)); } /** * If string overloading is active, it will break many of the * native implementations. mbstring.func_overload must be set * to 0, 1 or 4 in php.ini (string overloading disabled). * Also need to check we have the correct internal mbstring * encoding */ if ( extension_loaded('mbstring')) { if ( ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING ) { trigger_error('String functions are overloaded by mbstring',E_USER_ERROR); } mb_internal_encoding('UTF-8'); } /** * Check whether PCRE has been compiled with UTF-8 support */ $UTF8_ar = array(); if ( preg_match('/^.{1}$/u',"ñ",$UTF8_ar) != 1 ) { trigger_error('PCRE is not compiled with UTF-8 support',E_USER_ERROR); } unset($UTF8_ar); /** * Load the smartest implementations of utf8_strpos, utf8_strrpos * and utf8_substr */ if ( !defined('UTF8_CORE') ) { if ( function_exists('mb_substr') ) { require_once UTF8 . '/mbstring/core.php'; } else { require_once UTF8 . '/utils/unicode.php'; require_once UTF8 . '/native/core.php'; } } /** * Load the native implementation of utf8_substr_replace */ require_once UTF8 . '/substr_replace.php'; /** * You should now be able to use all the other utf_* string functions */ PK���\���RR3libraries/vendor/joomla/string/src/phputf8/trim.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware replacement for ltrim() * Note: you only need to use this if you are supplying the charlist * optional arg and it contains UTF-8 characters. Otherwise ltrim will * work normally on a UTF-8 string * @author Andreas Gohr <andi@splitbrain.org> * @see http://www.php.net/ltrim * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @return string * @package utf8 */ function utf8_ltrim( $str, $charlist = FALSE ) { if($charlist === FALSE) return ltrim($str); //quote charlist for use in a characterclass $charlist = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$charlist); return preg_replace('/^['.$charlist.']+/u','',$str); } //--------------------------------------------------------------- /** * UTF-8 aware replacement for rtrim() * Note: you only need to use this if you are supplying the charlist * optional arg and it contains UTF-8 characters. Otherwise rtrim will * work normally on a UTF-8 string * @author Andreas Gohr <andi@splitbrain.org> * @see http://www.php.net/rtrim * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @return string * @package utf8 */ function utf8_rtrim( $str, $charlist = FALSE ) { if($charlist === FALSE) return rtrim($str); //quote charlist for use in a characterclass $charlist = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$charlist); return preg_replace('/['.$charlist.']+$/u','',$str); } //--------------------------------------------------------------- /** * UTF-8 aware replacement for trim() * Note: you only need to use this if you are supplying the charlist * optional arg and it contains UTF-8 characters. Otherwise trim will * work normally on a UTF-8 string * @author Andreas Gohr <andi@splitbrain.org> * @see http://www.php.net/trim * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @return string * @package utf8 */ function utf8_trim( $str, $charlist = FALSE ) { if($charlist === FALSE) return trim($str); return utf8_ltrim(utf8_rtrim($str, $charlist), $charlist); } PK���\��]7= = 2libraries/vendor/joomla/string/src/phputf8/ord.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to ord * Returns the unicode ordinal for a character * @param string UTF-8 encoded character * @return int unicode ordinal for the character * @see http://www.php.net/ord * @see http://www.php.net/manual/en/function.ord.php#46267 */ function utf8_ord($chr) { $ord0 = ord($chr); if ( $ord0 >= 0 && $ord0 <= 127 ) { return $ord0; } if ( !isset($chr{1}) ) { trigger_error('Short sequence - at least 2 bytes expected, only 1 seen'); return FALSE; } $ord1 = ord($chr{1}); if ( $ord0 >= 192 && $ord0 <= 223 ) { return ( $ord0 - 192 ) * 64 + ( $ord1 - 128 ); } if ( !isset($chr{2}) ) { trigger_error('Short sequence - at least 3 bytes expected, only 2 seen'); return FALSE; } $ord2 = ord($chr{2}); if ( $ord0 >= 224 && $ord0 <= 239 ) { return ($ord0-224)*4096 + ($ord1-128)*64 + ($ord2-128); } if ( !isset($chr{3}) ) { trigger_error('Short sequence - at least 4 bytes expected, only 3 seen'); return FALSE; } $ord3 = ord($chr{3}); if ($ord0>=240 && $ord0<=247) { return ($ord0-240)*262144 + ($ord1-128)*4096 + ($ord2-128)*64 + ($ord3-128); } if ( !isset($chr{4}) ) { trigger_error('Short sequence - at least 5 bytes expected, only 4 seen'); return FALSE; } $ord4 = ord($chr{4}); if ($ord0>=248 && $ord0<=251) { return ($ord0-248)*16777216 + ($ord1-128)*262144 + ($ord2-128)*4096 + ($ord3-128)*64 + ($ord4-128); } if ( !isset($chr{5}) ) { trigger_error('Short sequence - at least 6 bytes expected, only 5 seen'); return FALSE; } if ($ord0>=252 && $ord0<=253) { return ($ord0-252) * 1073741824 + ($ord1-128)*16777216 + ($ord2-128)*262144 + ($ord3-128)*4096 + ($ord4-128)*64 + (ord($chr{5})-128); } if ( $ord0 >= 254 && $ord0 <= 255 ) { trigger_error('Invalid UTF-8 with surrogate ordinal '.$ord0); return FALSE; } } PK���\@�����;libraries/vendor/joomla/string/src/phputf8/str_ireplace.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to str_ireplace * Case-insensitive version of str_replace * Note: requires utf8_strtolower * Note: it's not fast and gets slower if $search / $replace is array * Notes: it's based on the assumption that the lower and uppercase * versions of a UTF-8 character will have the same length in bytes * which is currently true given the hash table to strtolower * @param string * @return string * @see http://www.php.net/str_ireplace * @see utf8_strtolower * @package utf8 */ function utf8_ireplace($search, $replace, $str, $count = NULL){ if ( !is_array($search) ) { $slen = strlen($search); if ( $slen == 0 ) { return $str; } $lendif = strlen($replace) - strlen($search); $search = utf8_strtolower($search); $search = preg_quote($search, '/'); $lstr = utf8_strtolower($str); $i = 0; $matched = 0; while ( preg_match('/(.*)'.$search.'/Us',$lstr, $matches) ) { if ( $i === $count ) { break; } $mlen = strlen($matches[0]); $lstr = substr($lstr, $mlen); $str = substr_replace($str, $replace, $matched+strlen($matches[1]), $slen); $matched += $mlen + $lendif; $i++; } return $str; } else { foreach ( array_keys($search) as $k ) { if ( is_array($replace) ) { if ( array_key_exists($k,$replace) ) { $str = utf8_ireplace($search[$k], $replace[$k], $str, $count); } else { $str = utf8_ireplace($search[$k], '', $str, $count); } } else { $str = utf8_ireplace($search[$k], $replace, $str, $count); } } return $str; } } PK���\��(���<libraries/vendor/joomla/string/src/phputf8/mbstring/core.phpnu�[���<?php /** * @package utf8 */ /** * Define UTF8_CORE as required */ if ( !defined('UTF8_CORE') ) { define('UTF8_CORE',TRUE); } //-------------------------------------------------------------------- /** * Wrapper round mb_strlen * Assumes you have mb_internal_encoding to UTF-8 already * Note: this function does not count bad bytes in the string - these * are simply ignored * @param string UTF-8 string * @return int number of UTF-8 characters in string * @package utf8 */ function utf8_strlen($str){ return mb_strlen($str); } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_strpos * Find position of first occurrence of a string * @param string haystack * @param string needle (you should validate this with utf8_is_valid) * @param integer offset in characters (from left) * @return mixed integer position or FALSE on failure * @package utf8 */ function utf8_strpos($str, $search, $offset = FALSE){ if ( $offset === FALSE ) { return mb_strpos($str, $search); } else { return mb_strpos($str, $search, $offset); } } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_strrpos * Find position of last occurrence of a char in a string * @param string haystack * @param string needle (you should validate this with utf8_is_valid) * @param integer (optional) offset (from left) * @return mixed integer position or FALSE on failure * @package utf8 */ function utf8_strrpos($str, $search, $offset = FALSE){ if ( $offset === FALSE ) { # Emulate behaviour of strrpos rather than raising warning if ( empty($str) ) { return FALSE; } return mb_strrpos($str, $search); } else { if ( !is_int($offset) ) { trigger_error('utf8_strrpos expects parameter 3 to be long',E_USER_WARNING); return FALSE; } $str = mb_substr($str, $offset); if ( FALSE !== ( $pos = mb_strrpos($str, $search) ) ) { return $pos + $offset; } return FALSE; } } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_substr * Return part of a string given character offset (and optionally length) * @param string * @param integer number of UTF-8 characters offset (from left) * @param integer (optional) length in UTF-8 characters from offset * @return mixed string or FALSE if failure * @package utf8 */ function utf8_substr($str, $offset, $length = FALSE){ if ( $length === FALSE ) { return mb_substr($str, $offset); } else { return mb_substr($str, $offset, $length); } } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_strtolower * Make a string lowercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * @param string * @return mixed either string in lowercase or FALSE is UTF-8 invalid * @package utf8 */ function utf8_strtolower($str){ return mb_strtolower($str); } //-------------------------------------------------------------------- /** * Assumes mbstring internal encoding is set to UTF-8 * Wrapper around mb_strtoupper * Make a string uppercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * @param string * @return mixed either string in lowercase or FALSE is UTF-8 invalid * @package utf8 */ function utf8_strtoupper($str){ return mb_strtoupper($str); } PK���\+OcgBB=libraries/vendor/joomla/string/src/phputf8/utils/specials.phpnu�[���<?php /** * Utilities for processing "special" characters in UTF-8. "Special" largely means anything which would * be regarded as a non-word character, like ASCII control characters and punctuation. This has a "Roman" * bias - it would be unaware of modern Chinese "punctuation" characters for example. * Note: requires utils/unicode.php to be loaded * @package utf8 * @see utf8_is_valid */ //-------------------------------------------------------------------- /** * Used internally. Builds a PCRE pattern from the $UTF8_SPECIAL_CHARS * array defined in this file * The $UTF8_SPECIAL_CHARS should contain all special characters (non-letter/non-digit) * defined in the various local charsets - it's not a complete list of * non-alphanum characters in UTF-8. It's not perfect but should match most * cases of special chars. * This function adds the control chars 0x00 to 0x19 to the array of * special chars (they are not included in $UTF8_SPECIAL_CHARS) * @package utf8 * @return string * @see utf8_from_unicode * @see utf8_is_word_chars * @see utf8_strip_specials */ function utf8_specials_pattern() { static $pattern = NULL; if ( !$pattern ) { $UTF8_SPECIAL_CHARS = array( 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002f, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 0x00d7, 0x00f7, 0x02c7, 0x02d8, 0x02d9, 0x02da, 0x02db, 0x02dc, 0x02dd, 0x0300, 0x0301, 0x0303, 0x0309, 0x0323, 0x0384, 0x0385, 0x0387, 0x03b2, 0x03c6, 0x03d1, 0x03d2, 0x03d5, 0x03d6, 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7, 0x05b8, 0x05b9, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf, 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05f3, 0x05f4, 0x060c, 0x061b, 0x061f, 0x0640, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, 0x0650, 0x0651, 0x0652, 0x066a, 0x0e3f, 0x200c, 0x200d, 0x200e, 0x200f, 0x2013, 0x2014, 0x2015, 0x2017, 0x2018, 0x2019, 0x201a, 0x201c, 0x201d, 0x201e, 0x2020, 0x2021, 0x2022, 0x2026, 0x2030, 0x2032, 0x2033, 0x2039, 0x203a, 0x2044, 0x20a7, 0x20aa, 0x20ab, 0x20ac, 0x2116, 0x2118, 0x2122, 0x2126, 0x2135, 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x21b5, 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x2200, 0x2202, 0x2203, 0x2205, 0x2206, 0x2207, 0x2208, 0x2209, 0x220b, 0x220f, 0x2211, 0x2212, 0x2215, 0x2217, 0x2219, 0x221a, 0x221d, 0x221e, 0x2220, 0x2227, 0x2228, 0x2229, 0x222a, 0x222b, 0x2234, 0x223c, 0x2245, 0x2248, 0x2260, 0x2261, 0x2264, 0x2265, 0x2282, 0x2283, 0x2284, 0x2286, 0x2287, 0x2295, 0x2297, 0x22a5, 0x22c5, 0x2310, 0x2320, 0x2321, 0x2329, 0x232a, 0x2469, 0x2500, 0x2502, 0x250c, 0x2510, 0x2514, 0x2518, 0x251c, 0x2524, 0x252c, 0x2534, 0x253c, 0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, 0x255f, 0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x2580, 0x2584, 0x2588, 0x258c, 0x2590, 0x2591, 0x2592, 0x2593, 0x25a0, 0x25b2, 0x25bc, 0x25c6, 0x25ca, 0x25cf, 0x25d7, 0x2605, 0x260e, 0x261b, 0x261e, 0x2660, 0x2663, 0x2665, 0x2666, 0x2701, 0x2702, 0x2703, 0x2704, 0x2706, 0x2707, 0x2708, 0x2709, 0x270c, 0x270d, 0x270e, 0x270f, 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717, 0x2718, 0x2719, 0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f, 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e, 0x272f, 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738, 0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f, 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747, 0x2748, 0x2749, 0x274a, 0x274b, 0x274d, 0x274f, 0x2750, 0x2751, 0x2752, 0x2756, 0x2758, 0x2759, 0x275a, 0x275b, 0x275c, 0x275d, 0x275e, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, 0x277f, 0x2789, 0x2793, 0x2794, 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e, 0x279f, 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7, 0x27a8, 0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af, 0x27b1, 0x27b2, 0x27b3, 0x27b4, 0x27b5, 0x27b6, 0x27b7, 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd, 0x27be, 0xf6d9, 0xf6da, 0xf6db, 0xf8d7, 0xf8d8, 0xf8d9, 0xf8da, 0xf8db, 0xf8dc, 0xf8dd, 0xf8de, 0xf8df, 0xf8e0, 0xf8e1, 0xf8e2, 0xf8e3, 0xf8e4, 0xf8e5, 0xf8e6, 0xf8e7, 0xf8e8, 0xf8e9, 0xf8ea, 0xf8eb, 0xf8ec, 0xf8ed, 0xf8ee, 0xf8ef, 0xf8f0, 0xf8f1, 0xf8f2, 0xf8f3, 0xf8f4, 0xf8f5, 0xf8f6, 0xf8f7, 0xf8f8, 0xf8f9, 0xf8fa, 0xf8fb, 0xf8fc, 0xf8fd, 0xf8fe, 0xfe7c, 0xfe7d, ); $pattern = preg_quote(utf8_from_unicode($UTF8_SPECIAL_CHARS), '/'); $pattern = '/[\x00-\x19'.$pattern.']/u'; } return $pattern; } //-------------------------------------------------------------------- /** * Checks a string for whether it contains only word characters. This * is logically equivalent to the \w PCRE meta character. Note that * this is not a 100% guarantee that the string only contains alpha / * numeric characters but just that common non-alphanumeric are not * in the string, including ASCII device control characters. * @package utf8 * @param string to check * @return boolean TRUE if the string only contains word characters * @see utf8_specials_pattern */ function utf8_is_word_chars($str) { return !(bool)preg_match(utf8_specials_pattern(),$str); } //-------------------------------------------------------------------- /** * Removes special characters (nonalphanumeric) from a UTF-8 string * * This can be useful as a helper for sanitizing a string for use as * something like a file name or a unique identifier. Be warned though * it does not handle all possible non-alphanumeric characters and is * not intended is some kind of security / injection filter. * * @package utf8 * @author Andreas Gohr <andi@splitbrain.org> * @param string $string The UTF8 string to strip of special chars * @param string (optional) $repl Replace special with this string * @return string with common non-alphanumeric characters removed * @see utf8_specials_pattern */ function utf8_strip_specials($string, $repl=''){ return preg_replace(utf8_specials_pattern(), $repl, $string); } PK���\�"�5"$"$<libraries/vendor/joomla/string/src/phputf8/utils/unicode.phpnu�[���<?php /** * Tools for conversion between UTF-8 and unicode * The Original Code is Mozilla Communicator client code. * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * Ported to PHP by Henri Sivonen (http://hsivonen.iki.fi) * Slight modifications to fit with phputf8 library by Harry Fuecks (hfuecks gmail com) * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUTF8ToUnicode.cpp * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUnicodeToUTF8.cpp * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 */ //-------------------------------------------------------------------- /** * Takes an UTF-8 string and returns an array of ints representing the * Unicode characters. Astral planes are supported ie. the ints in the * output can be > 0xFFFF. Occurrances of the BOM are ignored. Surrogates * are not allowed. * Returns false if the input string isn't a valid UTF-8 octet sequence * and raises a PHP error at level E_USER_WARNING * Note: this function has been modified slightly in this library to * trigger errors on encountering bad bytes * @author <hsivonen@iki.fi> * @param string UTF-8 encoded string * @return mixed array of unicode code points or FALSE if UTF-8 invalid * @see utf8_from_unicode * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 */ function utf8_to_unicode($str) { $mState = 0; // cached expected number of octets after the current octet // until the beginning of the next UTF8 character sequence $mUcs4 = 0; // cached Unicode character $mBytes = 1; // cached expected number of octets in the current sequence $out = array(); $len = strlen($str); for($i = 0; $i < $len; $i++) { $in = ord($str{$i}); if ( $mState == 0) { // When mState is zero we expect either a US-ASCII character or a // multi-octet sequence. if (0 == (0x80 & ($in))) { // US-ASCII, pass straight through. $out[] = $in; $mBytes = 1; } else if (0xC0 == (0xE0 & ($in))) { // First octet of 2 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x1F) << 6; $mState = 1; $mBytes = 2; } else if (0xE0 == (0xF0 & ($in))) { // First octet of 3 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x0F) << 12; $mState = 2; $mBytes = 3; } else if (0xF0 == (0xF8 & ($in))) { // First octet of 4 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x07) << 18; $mState = 3; $mBytes = 4; } else if (0xF8 == (0xFC & ($in))) { /* First octet of 5 octet sequence. * * This is illegal because the encoded codepoint must be either * (a) not the shortest form or * (b) outside the Unicode range of 0-0x10FFFF. * Rather than trying to resynchronize, we will carry on until the end * of the sequence and let the later error handling code catch it. */ $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x03) << 24; $mState = 4; $mBytes = 5; } else if (0xFC == (0xFE & ($in))) { // First octet of 6 octet sequence, see comments for 5 octet sequence. $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 1) << 30; $mState = 5; $mBytes = 6; } else { /* Current octet is neither in the US-ASCII range nor a legal first * octet of a multi-octet sequence. */ trigger_error( 'utf8_to_unicode: Illegal sequence identifier '. 'in UTF-8 at byte '.$i, E_USER_WARNING ); return FALSE; } } else { // When mState is non-zero, we expect a continuation of the multi-octet // sequence if (0x80 == (0xC0 & ($in))) { // Legal continuation. $shift = ($mState - 1) * 6; $tmp = $in; $tmp = ($tmp & 0x0000003F) << $shift; $mUcs4 |= $tmp; /** * End of the multi-octet sequence. mUcs4 now contains the final * Unicode codepoint to be output */ if (0 == --$mState) { /* * Check for illegal sequences and codepoints. */ // From Unicode 3.1, non-shortest form is illegal if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || ((3 == $mBytes) && ($mUcs4 < 0x0800)) || ((4 == $mBytes) && ($mUcs4 < 0x10000)) || (4 < $mBytes) || // From Unicode 3.2, surrogate characters are illegal (($mUcs4 & 0xFFFFF800) == 0xD800) || // Codepoints outside the Unicode range are illegal ($mUcs4 > 0x10FFFF)) { trigger_error( 'utf8_to_unicode: Illegal sequence or codepoint '. 'in UTF-8 at byte '.$i, E_USER_WARNING ); return FALSE; } if (0xFEFF != $mUcs4) { // BOM is legal but we don't want to output it $out[] = $mUcs4; } //initialize UTF8 cache $mState = 0; $mUcs4 = 0; $mBytes = 1; } } else { /** *((0xC0 & (*in) != 0x80) && (mState != 0)) * Incomplete multi-octet sequence. */ trigger_error( 'utf8_to_unicode: Incomplete multi-octet '. ' sequence in UTF-8 at byte '.$i, E_USER_WARNING ); return FALSE; } } } return $out; } //-------------------------------------------------------------------- /** * Takes an array of ints representing the Unicode characters and returns * a UTF-8 string. Astral planes are supported ie. the ints in the * input can be > 0xFFFF. Occurrances of the BOM are ignored. Surrogates * are not allowed. * Returns false if the input array contains ints that represent * surrogates or are outside the Unicode range * and raises a PHP error at level E_USER_WARNING * Note: this function has been modified slightly in this library to use * output buffering to concatenate the UTF-8 string (faster) as well as * reference the array by it's keys * @param array of unicode code points representing a string * @return mixed UTF-8 string or FALSE if array contains invalid code points * @author <hsivonen@iki.fi> * @see utf8_to_unicode * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 */ function utf8_from_unicode($arr) { ob_start(); foreach (array_keys($arr) as $k) { # ASCII range (including control chars) if ( ($arr[$k] >= 0) && ($arr[$k] <= 0x007f) ) { echo chr($arr[$k]); # 2 byte sequence } else if ($arr[$k] <= 0x07ff) { echo chr(0xc0 | ($arr[$k] >> 6)); echo chr(0x80 | ($arr[$k] & 0x003f)); # Byte order mark (skip) } else if($arr[$k] == 0xFEFF) { // nop -- zap the BOM # Test for illegal surrogates } else if ($arr[$k] >= 0xD800 && $arr[$k] <= 0xDFFF) { // found a surrogate trigger_error( 'utf8_from_unicode: Illegal surrogate '. 'at index: '.$k.', value: '.$arr[$k], E_USER_WARNING ); return FALSE; # 3 byte sequence } else if ($arr[$k] <= 0xffff) { echo chr(0xe0 | ($arr[$k] >> 12)); echo chr(0x80 | (($arr[$k] >> 6) & 0x003f)); echo chr(0x80 | ($arr[$k] & 0x003f)); # 4 byte sequence } else if ($arr[$k] <= 0x10ffff) { echo chr(0xf0 | ($arr[$k] >> 18)); echo chr(0x80 | (($arr[$k] >> 12) & 0x3f)); echo chr(0x80 | (($arr[$k] >> 6) & 0x3f)); echo chr(0x80 | ($arr[$k] & 0x3f)); } else { trigger_error( 'utf8_from_unicode: Codepoint out of Unicode range '. 'at index: '.$k.', value: '.$arr[$k], E_USER_WARNING ); // out of range return FALSE; } } $result = ob_get_contents(); ob_end_clean(); return $result; } PK���\�vV�5�58libraries/vendor/joomla/string/src/phputf8/utils/bad.phpnu�[���<?php /** * Tools for locating / replacing bad bytes in UTF-8 strings * The Original Code is Mozilla Communicator client code. * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * Ported to PHP by Henri Sivonen (http://hsivonen.iki.fi) * Slight modifications to fit with phputf8 library by Harry Fuecks (hfuecks gmail com) * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUTF8ToUnicode.cpp * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUnicodeToUTF8.cpp * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 * @see utf8_is_valid */ //-------------------------------------------------------------------- /** * Locates the first bad byte in a UTF-8 string returning it's * byte index in the string * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @param string * @return mixed integer byte index or FALSE if no bad found * @package utf8 */ function utf8_bad_find($str) { $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte $pos = 0; $badList = array(); while (preg_match('/'.$UTF8_BAD.'/S', $str, $matches)) { $bytes = strlen($matches[0]); if ( isset($matches[2])) { return $pos; } $pos += $bytes; $str = substr($str,$bytes); } return FALSE; } //-------------------------------------------------------------------- /** * Locates all bad bytes in a UTF-8 string and returns a list of their * byte index in the string * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @param string * @return mixed array of integers or FALSE if no bad found * @package utf8 */ function utf8_bad_findall($str) { $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte $pos = 0; $badList = array(); while (preg_match('/'.$UTF8_BAD.'/S', $str, $matches)) { $bytes = strlen($matches[0]); if ( isset($matches[2])) { $badList[] = $pos; } $pos += $bytes; $str = substr($str,$bytes); } if ( count($badList) > 0 ) { return $badList; } return FALSE; } //-------------------------------------------------------------------- /** * Strips out any bad bytes from a UTF-8 string and returns the rest * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @param string * @return string * @package utf8 */ function utf8_bad_strip($str) { $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte ob_start(); while (preg_match('/'.$UTF8_BAD.'/S', $str, $matches)) { if ( !isset($matches[2])) { echo $matches[0]; } $str = substr($str,strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //-------------------------------------------------------------------- /** * Replace bad bytes with an alternative character - ASCII character * recommended is replacement char * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @param string to search * @param string to replace bad bytes with (defaults to '?') - use ASCII * @return string * @package utf8 */ function utf8_bad_replace($str, $replace = '?') { $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte ob_start(); while (preg_match('/'.$UTF8_BAD.'/S', $str, $matches)) { if ( !isset($matches[2])) { echo $matches[0]; } else { echo $replace; } $str = substr($str,strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //-------------------------------------------------------------------- /** * Return code from utf8_bad_identify() when a five octet sequence is detected. * Note: 5 octets sequences are valid UTF-8 but are not supported by Unicode so * do not represent a useful character * @see utf8_bad_identify * @package utf8 */ define('UTF8_BAD_5OCTET',1); /** * Return code from utf8_bad_identify() when a six octet sequence is detected. * Note: 6 octets sequences are valid UTF-8 but are not supported by Unicode so * do not represent a useful character * @see utf8_bad_identify * @package utf8 */ define('UTF8_BAD_6OCTET',2); /** * Return code from utf8_bad_identify(). * Invalid octet for use as start of multi-byte UTF-8 sequence * @see utf8_bad_identify * @package utf8 */ define('UTF8_BAD_SEQID',3); /** * Return code from utf8_bad_identify(). * From Unicode 3.1, non-shortest form is illegal * @see utf8_bad_identify * @package utf8 */ define('UTF8_BAD_NONSHORT',4); /** * Return code from utf8_bad_identify(). * From Unicode 3.2, surrogate characters are illegal * @see utf8_bad_identify * @package utf8 */ define('UTF8_BAD_SURROGATE',5); /** * Return code from utf8_bad_identify(). * Codepoints outside the Unicode range are illegal * @see utf8_bad_identify * @package utf8 */ define('UTF8_BAD_UNIOUTRANGE',6); /** * Return code from utf8_bad_identify(). * Incomplete multi-octet sequence * Note: this is kind of a "catch-all" * @see utf8_bad_identify * @package utf8 */ define('UTF8_BAD_SEQINCOMPLETE',7); //-------------------------------------------------------------------- /** * Reports on the type of bad byte found in a UTF-8 string. Returns a * status code on the first bad byte found * @author <hsivonen@iki.fi> * @param string UTF-8 encoded string * @return mixed integer constant describing problem or FALSE if valid UTF-8 * @see utf8_bad_explain * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 */ function utf8_bad_identify($str, &$i) { $mState = 0; // cached expected number of octets after the current octet // until the beginning of the next UTF8 character sequence $mUcs4 = 0; // cached Unicode character $mBytes = 1; // cached expected number of octets in the current sequence $len = strlen($str); for($i = 0; $i < $len; $i++) { $in = ord($str{$i}); if ( $mState == 0) { // When mState is zero we expect either a US-ASCII character or a // multi-octet sequence. if (0 == (0x80 & ($in))) { // US-ASCII, pass straight through. $mBytes = 1; } else if (0xC0 == (0xE0 & ($in))) { // First octet of 2 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x1F) << 6; $mState = 1; $mBytes = 2; } else if (0xE0 == (0xF0 & ($in))) { // First octet of 3 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x0F) << 12; $mState = 2; $mBytes = 3; } else if (0xF0 == (0xF8 & ($in))) { // First octet of 4 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x07) << 18; $mState = 3; $mBytes = 4; } else if (0xF8 == (0xFC & ($in))) { /* First octet of 5 octet sequence. * * This is illegal because the encoded codepoint must be either * (a) not the shortest form or * (b) outside the Unicode range of 0-0x10FFFF. */ return UTF8_BAD_5OCTET; } else if (0xFC == (0xFE & ($in))) { // First octet of 6 octet sequence, see comments for 5 octet sequence. return UTF8_BAD_6OCTET; } else { // Current octet is neither in the US-ASCII range nor a legal first // octet of a multi-octet sequence. return UTF8_BAD_SEQID; } } else { // When mState is non-zero, we expect a continuation of the multi-octet // sequence if (0x80 == (0xC0 & ($in))) { // Legal continuation. $shift = ($mState - 1) * 6; $tmp = $in; $tmp = ($tmp & 0x0000003F) << $shift; $mUcs4 |= $tmp; /** * End of the multi-octet sequence. mUcs4 now contains the final * Unicode codepoint to be output */ if (0 == --$mState) { // From Unicode 3.1, non-shortest form is illegal if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || ((3 == $mBytes) && ($mUcs4 < 0x0800)) || ((4 == $mBytes) && ($mUcs4 < 0x10000)) ) { return UTF8_BAD_NONSHORT; // From Unicode 3.2, surrogate characters are illegal } else if (($mUcs4 & 0xFFFFF800) == 0xD800) { return UTF8_BAD_SURROGATE; // Codepoints outside the Unicode range are illegal } else if ($mUcs4 > 0x10FFFF) { return UTF8_BAD_UNIOUTRANGE; } //initialize UTF8 cache $mState = 0; $mUcs4 = 0; $mBytes = 1; } } else { // ((0xC0 & (*in) != 0x80) && (mState != 0)) // Incomplete multi-octet sequence. $i--; return UTF8_BAD_SEQINCOMPLETE; } } } if ( $mState != 0 ) { // Incomplete multi-octet sequence. $i--; return UTF8_BAD_SEQINCOMPLETE; } // No bad octets found $i = NULL; return FALSE; } //-------------------------------------------------------------------- /** * Takes a return code from utf8_bad_identify() are returns a message * (in English) explaining what the problem is. * @param int return code from utf8_bad_identify * @return mixed string message or FALSE if return code unknown * @see utf8_bad_identify * @package utf8 */ function utf8_bad_explain($code) { switch ($code) { case UTF8_BAD_5OCTET: return 'Five octet sequences are valid UTF-8 but are not supported by Unicode'; break; case UTF8_BAD_6OCTET: return 'Six octet sequences are valid UTF-8 but are not supported by Unicode'; break; case UTF8_BAD_SEQID: return 'Invalid octet for use as start of multi-byte UTF-8 sequence'; break; case UTF8_BAD_NONSHORT: return 'From Unicode 3.1, non-shortest form is illegal'; break; case UTF8_BAD_SURROGATE: return 'From Unicode 3.2, surrogate characters are illegal'; break; case UTF8_BAD_UNIOUTRANGE: return 'Codepoints outside the Unicode range are illegal'; break; case UTF8_BAD_SEQINCOMPLETE: return 'Incomplete multi-octet sequence'; break; } trigger_error('Unknown error code: '.$code,E_USER_WARNING); return FALSE; } PK���\Qc�!!:libraries/vendor/joomla/string/src/phputf8/utils/ascii.phpnu�[���<?php /** * Tools to help with ASCII in UTF-8 * * @package utf8 */ //-------------------------------------------------------------------- /** * Tests whether a string contains only 7bit ASCII bytes. * You might use this to conditionally check whether a string * needs handling as UTF-8 or not, potentially offering performance * benefits by using the native PHP equivalent if it's just ASCII e.g.; * * <code> * if ( utf8_is_ascii($someString) ) { * // It's just ASCII - use the native PHP version * $someString = strtolower($someString); * } else { * $someString = utf8_strtolower($someString); * } * </code> * * @param string * @return boolean TRUE if it's all ASCII * @package utf8 * @see utf8_is_ascii_ctrl */ function utf8_is_ascii($str) { // Search for any bytes which are outside the ASCII range... return (preg_match('/(?:[^\x00-\x7F])/',$str) !== 1); } //-------------------------------------------------------------------- /** * Tests whether a string contains only 7bit ASCII bytes with device * control codes omitted. The device control codes can be found on the * second table here: http://www.w3schools.com/tags/ref_ascii.asp * * @param string * @return boolean TRUE if it's all ASCII without device control codes * @package utf8 * @see utf8_is_ascii */ function utf8_is_ascii_ctrl($str) { if ( strlen($str) > 0 ) { // Search for any bytes which are outside the ASCII range, // or are device control codes return (preg_match('/[^\x09\x0A\x0D\x20-\x7E]/',$str) !== 1); } return FALSE; } //-------------------------------------------------------------------- /** * Strip out all non-7bit ASCII bytes * If you need to transmit a string to system which you know can only * support 7bit ASCII, you could use this function. * @param string * @return string with non ASCII bytes removed * @package utf8 * @see utf8_strip_non_ascii_ctrl */ function utf8_strip_non_ascii($str) { ob_start(); while ( preg_match( '/^([\x00-\x7F]+)|([^\x00-\x7F]+)/S', $str, $matches) ) { if ( !isset($matches[2]) ) { echo $matches[0]; } $str = substr($str, strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //-------------------------------------------------------------------- /** * Strip out device control codes in the ASCII range * which are not permitted in XML. Note that this leaves * multi-byte characters untouched - it only removes device * control codes * @see http://hsivonen.iki.fi/producing-xml/#controlchar * @param string * @return string control codes removed */ function utf8_strip_ascii_ctrl($str) { ob_start(); while ( preg_match( '/^([^\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+)|([\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+)/S', $str, $matches) ) { if ( !isset($matches[2]) ) { echo $matches[0]; } $str = substr($str, strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //-------------------------------------------------------------------- /** * Strip out all non 7bit ASCII bytes and ASCII device control codes. * For a list of ASCII device control codes see the 2nd table here: * http://www.w3schools.com/tags/ref_ascii.asp * * @param string * @return boolean TRUE if it's all ASCII * @package utf8 */ function utf8_strip_non_ascii_ctrl($str) { ob_start(); while ( preg_match( '/^([\x09\x0A\x0D\x20-\x7E]+)|([^\x09\x0A\x0D\x20-\x7E]+)/S', $str, $matches) ) { if ( !isset($matches[2]) ) { echo $matches[0]; } $str = substr($str, strlen($matches[0])); } $result = ob_get_contents(); ob_end_clean(); return $result; } //--------------------------------------------------------------- /** * Replace accented UTF-8 characters by unaccented ASCII-7 "equivalents". * The purpose of this function is to replace characters commonly found in Latin * alphabets with something more or less equivalent from the ASCII range. This can * be useful for converting a UTF-8 to something ready for a filename, for example. * Following the use of this function, you would probably also pass the string * through utf8_strip_non_ascii to clean out any other non-ASCII chars * Use the optional parameter to just deaccent lower ($case = -1) or upper ($case = 1) * letters. Default is to deaccent both cases ($case = 0) * * For a more complete implementation of transliteration, see the utf8_to_ascii package * available from the phputf8 project downloads: * http://prdownloads.sourceforge.net/phputf8 * * @param string UTF-8 string * @param int (optional) -1 lowercase only, +1 uppercase only, 1 both cases * @param string UTF-8 with accented characters replaced by ASCII chars * @return string accented chars replaced with ascii equivalents * @author Andreas Gohr <andi@splitbrain.org> * @package utf8 */ function utf8_accents_to_ascii( $str, $case=0 ){ static $UTF8_LOWER_ACCENTS = NULL; static $UTF8_UPPER_ACCENTS = NULL; if($case <= 0){ if ( is_null($UTF8_LOWER_ACCENTS) ) { $UTF8_LOWER_ACCENTS = array( 'à' => 'a', 'ô' => 'o', 'ď' => 'd', 'ḟ' => 'f', 'ë' => 'e', 'š' => 's', 'ơ' => 'o', 'ß' => 'ss', 'ă' => 'a', 'ř' => 'r', 'ț' => 't', 'ň' => 'n', 'ā' => 'a', 'ķ' => 'k', 'ŝ' => 's', 'ỳ' => 'y', 'ņ' => 'n', 'ĺ' => 'l', 'ħ' => 'h', 'ṗ' => 'p', 'ó' => 'o', 'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', 'ẁ' => 'w', 'ċ' => 'c', 'õ' => 'o', 'ṡ' => 's', 'ø' => 'o', 'ģ' => 'g', 'ŧ' => 't', 'ș' => 's', 'ė' => 'e', 'ĉ' => 'c', 'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'ŵ' => 'w', 'ṫ' => 't', 'ū' => 'u', 'č' => 'c', 'ö' => 'oe', 'è' => 'e', 'ŷ' => 'y', 'ą' => 'a', 'ł' => 'l', 'ų' => 'u', 'ů' => 'u', 'ş' => 's', 'ğ' => 'g', 'ļ' => 'l', 'ƒ' => 'f', 'ž' => 'z', 'ẃ' => 'w', 'ḃ' => 'b', 'å' => 'a', 'ì' => 'i', 'ï' => 'i', 'ḋ' => 'd', 'ť' => 't', 'ŗ' => 'r', 'ä' => 'ae', 'í' => 'i', 'ŕ' => 'r', 'ê' => 'e', 'ü' => 'ue', 'ò' => 'o', 'ē' => 'e', 'ñ' => 'n', 'ń' => 'n', 'ĥ' => 'h', 'ĝ' => 'g', 'đ' => 'd', 'ĵ' => 'j', 'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o', 'â' => 'a', 'ľ' => 'l', 'ẅ' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g', 'ṁ' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a', 'û' => 'u', 'þ' => 'th', 'ð' => 'dh', 'æ' => 'ae', 'µ' => 'u', 'ĕ' => 'e', ); } $str = str_replace( array_keys($UTF8_LOWER_ACCENTS), array_values($UTF8_LOWER_ACCENTS), $str ); } if($case >= 0){ if ( is_null($UTF8_UPPER_ACCENTS) ) { $UTF8_UPPER_ACCENTS = array( 'À' => 'A', 'Ô' => 'O', 'Ď' => 'D', 'Ḟ' => 'F', 'Ë' => 'E', 'Š' => 'S', 'Ơ' => 'O', 'Ă' => 'A', 'Ř' => 'R', 'Ț' => 'T', 'Ň' => 'N', 'Ā' => 'A', 'Ķ' => 'K', 'Ŝ' => 'S', 'Ỳ' => 'Y', 'Ņ' => 'N', 'Ĺ' => 'L', 'Ħ' => 'H', 'Ṗ' => 'P', 'Ó' => 'O', 'Ú' => 'U', 'Ě' => 'E', 'É' => 'E', 'Ç' => 'C', 'Ẁ' => 'W', 'Ċ' => 'C', 'Õ' => 'O', 'Ṡ' => 'S', 'Ø' => 'O', 'Ģ' => 'G', 'Ŧ' => 'T', 'Ș' => 'S', 'Ė' => 'E', 'Ĉ' => 'C', 'Ś' => 'S', 'Î' => 'I', 'Ű' => 'U', 'Ć' => 'C', 'Ę' => 'E', 'Ŵ' => 'W', 'Ṫ' => 'T', 'Ū' => 'U', 'Č' => 'C', 'Ö' => 'Oe', 'È' => 'E', 'Ŷ' => 'Y', 'Ą' => 'A', 'Ł' => 'L', 'Ų' => 'U', 'Ů' => 'U', 'Ş' => 'S', 'Ğ' => 'G', 'Ļ' => 'L', 'Ƒ' => 'F', 'Ž' => 'Z', 'Ẃ' => 'W', 'Ḃ' => 'B', 'Å' => 'A', 'Ì' => 'I', 'Ï' => 'I', 'Ḋ' => 'D', 'Ť' => 'T', 'Ŗ' => 'R', 'Ä' => 'Ae', 'Í' => 'I', 'Ŕ' => 'R', 'Ê' => 'E', 'Ü' => 'Ue', 'Ò' => 'O', 'Ē' => 'E', 'Ñ' => 'N', 'Ń' => 'N', 'Ĥ' => 'H', 'Ĝ' => 'G', 'Đ' => 'D', 'Ĵ' => 'J', 'Ÿ' => 'Y', 'Ũ' => 'U', 'Ŭ' => 'U', 'Ư' => 'U', 'Ţ' => 'T', 'Ý' => 'Y', 'Ő' => 'O', 'Â' => 'A', 'Ľ' => 'L', 'Ẅ' => 'W', 'Ż' => 'Z', 'Ī' => 'I', 'Ã' => 'A', 'Ġ' => 'G', 'Ṁ' => 'M', 'Ō' => 'O', 'Ĩ' => 'I', 'Ù' => 'U', 'Į' => 'I', 'Ź' => 'Z', 'Á' => 'A', 'Û' => 'U', 'Þ' => 'Th', 'Ð' => 'Dh', 'Æ' => 'Ae', 'Ĕ' => 'E', ); } $str = str_replace( array_keys($UTF8_UPPER_ACCENTS), array_values($UTF8_UPPER_ACCENTS), $str ); } return $str; } PK���\U�����=libraries/vendor/joomla/string/src/phputf8/utils/position.phpnu�[���<?php /** * Locate a byte index given a UTF-8 character index * @package utf8 */ //-------------------------------------------------------------------- /** * Given a string and a character index in the string, in * terms of the UTF-8 character position, returns the byte * index of that character. Can be useful when you want to * PHP's native string functions but we warned, locating * the byte can be expensive * Takes variable number of parameters - first must be * the search string then 1 to n UTF-8 character positions * to obtain byte indexes for - it is more efficient to search * the string for multiple characters at once, than make * repeated calls to this function * * @author Chris Smith<chris@jalakai.co.uk> * @param string string to locate index in * @param int (n times) * @return mixed - int if only one input int, array if more * @return boolean TRUE if it's all ASCII * @package utf8 */ function utf8_byte_position() { $args = func_get_args(); $str =& array_shift($args); if (!is_string($str)) return false; $result = array(); // trivial byte index, character offset pair $prev = array(0,0); // use a short piece of str to estimate bytes per character // $i (& $j) -> byte indexes into $str $i = utf8_locate_next_chr($str, 300); // $c -> character offset into $str $c = strlen(utf8_decode(substr($str,0,$i))); // deal with arguments from lowest to highest sort($args); foreach ($args as $offset) { // sanity checks FIXME // 0 is an easy check if ($offset == 0) { $result[] = 0; continue; } // ensure no endless looping $safety_valve = 50; do { if ( ($c - $prev[1]) == 0 ) { // Hack: gone past end of string $error = 0; $i = strlen($str); break; } $j = $i + (int)(($offset-$c) * ($i - $prev[0]) / ($c - $prev[1])); // correct to utf8 character boundary $j = utf8_locate_next_chr($str, $j); // save the index, offset for use next iteration $prev = array($i,$c); if ($j > $i) { // determine new character offset $c += strlen(utf8_decode(substr($str,$i,$j-$i))); } else { // ditto $c -= strlen(utf8_decode(substr($str,$j,$i-$j))); } $error = abs($c-$offset); // ready for next time around $i = $j; // from 7 it is faster to iterate over the string } while ( ($error > 7) && --$safety_valve) ; if ($error && $error <= 7) { if ($c < $offset) { // move up while ($error--) { $i = utf8_locate_next_chr($str,++$i); } } else { // move down while ($error--) { $i = utf8_locate_current_chr($str,--$i); } } // ready for next arg $c = $offset; } $result[] = $i; } if ( count($result) == 1 ) { return $result[0]; } return $result; } //-------------------------------------------------------------------- /** * Given a string and any byte index, returns the byte index * of the start of the current UTF-8 character, relative to supplied * position. If the current character begins at the same place as the * supplied byte index, that byte index will be returned. Otherwise * this function will step backwards, looking for the index where * curent UTF-8 character begins * @author Chris Smith<chris@jalakai.co.uk> * @param string * @param int byte index in the string * @return int byte index of start of next UTF-8 character * @package utf8 */ function utf8_locate_current_chr( &$str, $idx ) { if ($idx <= 0) return 0; $limit = strlen($str); if ($idx >= $limit) return $limit; // Binary value for any byte after the first in a multi-byte UTF-8 character // will be like 10xxxxxx so & 0xC0 can be used to detect this kind // of byte - assuming well formed UTF-8 while ($idx && ((ord($str[$idx]) & 0xC0) == 0x80)) $idx--; return $idx; } //-------------------------------------------------------------------- /** * Given a string and any byte index, returns the byte index * of the start of the next UTF-8 character, relative to supplied * position. If the next character begins at the same place as the * supplied byte index, that byte index will be returned. * @author Chris Smith<chris@jalakai.co.uk> * @param string * @param int byte index in the string * @return int byte index of start of next UTF-8 character * @package utf8 */ function utf8_locate_next_chr( &$str, $idx ) { if ($idx <= 0) return 0; $limit = strlen($str); if ($idx >= $limit) return $limit; // Binary value for any byte after the first in a multi-byte UTF-8 character // will be like 10xxxxxx so & 0xC0 can be used to detect this kind // of byte - assuming well formed UTF-8 while (($idx < $limit) && ((ord($str[$idx]) & 0xC0) == 0x80)) $idx++; return $idx; } PK���\�)����?libraries/vendor/joomla/string/src/phputf8/utils/validation.phpnu�[���<?php /** * Tools for validing a UTF-8 string is well formed. * The Original Code is Mozilla Communicator client code. * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * Ported to PHP by Henri Sivonen (http://hsivonen.iki.fi) * Slight modifications to fit with phputf8 library by Harry Fuecks (hfuecks gmail com) * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUTF8ToUnicode.cpp * @see http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsUnicodeToUTF8.cpp * @see http://hsivonen.iki.fi/php-utf8/ * @package utf8 */ //-------------------------------------------------------------------- /** * Tests a string as to whether it's valid UTF-8 and supported by the * Unicode standard * Note: this function has been modified to simple return true or false * @author <hsivonen@iki.fi> * @param string UTF-8 encoded string * @return boolean true if valid * @see http://hsivonen.iki.fi/php-utf8/ * @see utf8_compliant * @package utf8 */ function utf8_is_valid($str) { $mState = 0; // cached expected number of octets after the current octet // until the beginning of the next UTF8 character sequence $mUcs4 = 0; // cached Unicode character $mBytes = 1; // cached expected number of octets in the current sequence $len = strlen($str); for($i = 0; $i < $len; $i++) { $in = ord($str{$i}); if ( $mState == 0) { // When mState is zero we expect either a US-ASCII character or a // multi-octet sequence. if (0 == (0x80 & ($in))) { // US-ASCII, pass straight through. $mBytes = 1; } else if (0xC0 == (0xE0 & ($in))) { // First octet of 2 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x1F) << 6; $mState = 1; $mBytes = 2; } else if (0xE0 == (0xF0 & ($in))) { // First octet of 3 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x0F) << 12; $mState = 2; $mBytes = 3; } else if (0xF0 == (0xF8 & ($in))) { // First octet of 4 octet sequence $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x07) << 18; $mState = 3; $mBytes = 4; } else if (0xF8 == (0xFC & ($in))) { /* First octet of 5 octet sequence. * * This is illegal because the encoded codepoint must be either * (a) not the shortest form or * (b) outside the Unicode range of 0-0x10FFFF. * Rather than trying to resynchronize, we will carry on until the end * of the sequence and let the later error handling code catch it. */ $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 0x03) << 24; $mState = 4; $mBytes = 5; } else if (0xFC == (0xFE & ($in))) { // First octet of 6 octet sequence, see comments for 5 octet sequence. $mUcs4 = ($in); $mUcs4 = ($mUcs4 & 1) << 30; $mState = 5; $mBytes = 6; } else { /* Current octet is neither in the US-ASCII range nor a legal first * octet of a multi-octet sequence. */ return FALSE; } } else { // When mState is non-zero, we expect a continuation of the multi-octet // sequence if (0x80 == (0xC0 & ($in))) { // Legal continuation. $shift = ($mState - 1) * 6; $tmp = $in; $tmp = ($tmp & 0x0000003F) << $shift; $mUcs4 |= $tmp; /** * End of the multi-octet sequence. mUcs4 now contains the final * Unicode codepoint to be output */ if (0 == --$mState) { /* * Check for illegal sequences and codepoints. */ // From Unicode 3.1, non-shortest form is illegal if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || ((3 == $mBytes) && ($mUcs4 < 0x0800)) || ((4 == $mBytes) && ($mUcs4 < 0x10000)) || (4 < $mBytes) || // From Unicode 3.2, surrogate characters are illegal (($mUcs4 & 0xFFFFF800) == 0xD800) || // Codepoints outside the Unicode range are illegal ($mUcs4 > 0x10FFFF)) { return FALSE; } //initialize UTF8 cache $mState = 0; $mUcs4 = 0; $mBytes = 1; } } else { /** *((0xC0 & (*in) != 0x80) && (mState != 0)) * Incomplete multi-octet sequence. */ return FALSE; } } } return TRUE; } //-------------------------------------------------------------------- /** * Tests whether a string complies as UTF-8. This will be much * faster than utf8_is_valid but will pass five and six octet * UTF-8 sequences, which are not supported by Unicode and * so cannot be displayed correctly in a browser. In other words * it is not as strict as utf8_is_valid but it's faster. If you use * is to validate user input, you place yourself at the risk that * attackers will be able to inject 5 and 6 byte sequences (which * may or may not be a significant risk, depending on what you are * are doing) * @see utf8_is_valid * @see http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php#54805 * @param string UTF-8 string to check * @return boolean TRUE if string is valid UTF-8 * @package utf8 */ function utf8_compliant($str) { if ( strlen($str) == 0 ) { return TRUE; } // If even just the first character can be matched, when the /u // modifier is used, then it's valid UTF-8. If the UTF-8 is somehow // invalid, nothing at all will match, even if the string contains // some valid sequences return (preg_match('/^.{1}/us',$str,$ar) == 1); } PK���\f 3VBB=libraries/vendor/joomla/string/src/phputf8/utils/patterns.phpnu�[���<?php /** * PCRE Regular expressions for UTF-8. Note this file is not actually used by * the rest of the library but these regular expressions can be useful to have * available. * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @package utf8 */ //-------------------------------------------------------------------- /** * PCRE Pattern to check a UTF-8 string is valid * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @package utf8 */ $UTF8_VALID = '^('. '[\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 ')*$'; //-------------------------------------------------------------------- /** * PCRE Pattern to match single UTF-8 characters * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @package utf8 */ $UTF8_MATCH = '([\x00-\x7F])'. # ASCII (including control chars) '|([\xC2-\xDF][\x80-\xBF])'. # non-overlong 2-byte '|(\xE0[\xA0-\xBF][\x80-\xBF])'. # excluding overlongs '|([\xE1-\xEC\xEE\xEF][\x80-\xBF]{2})'. # straight 3-byte '|(\xED[\x80-\x9F][\x80-\xBF])'. # excluding surrogates '|(\xF0[\x90-\xBF][\x80-\xBF]{2})'. # planes 1-3 '|([\xF1-\xF3][\x80-\xBF]{3})'. # planes 4-15 '|(\xF4[\x80-\x8F][\x80-\xBF]{2})'; # plane 16 //-------------------------------------------------------------------- /** * PCRE Pattern to locate bad bytes in a UTF-8 string * Comes from W3 FAQ: Multilingual Forms * Note: modified to include full ASCII range including control chars * @see http://www.w3.org/International/questions/qa-forms-utf-8 * @package utf8 */ $UTF8_BAD = '([\x00-\x7F]'. # ASCII (including control chars) '|[\xC2-\xDF][\x80-\xBF]'. # non-overlong 2-byte '|\xE0[\xA0-\xBF][\x80-\xBF]'. # excluding overlongs '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'. # straight 3-byte '|\xED[\x80-\x9F][\x80-\xBF]'. # excluding surrogates '|\xF0[\x90-\xBF][\x80-\xBF]{2}'. # planes 1-3 '|[\xF1-\xF3][\x80-\xBF]{3}'. # planes 4-15 '|\xF4[\x80-\x8F][\x80-\xBF]{2}'. # plane 16 '|(.{1}))'; # invalid byte PK���\�����1libraries/vendor/joomla/string/src/phputf8/READMEnu�[���++PHP UTF-8++ Version 0.5 ++DOCUMENTATION++ Documentation in progress in ./docs dir http://www.phpwact.org/php/i18n/charsets http://www.phpwact.org/php/i18n/utf-8 Important Note: DO NOT use these functions without understanding WHY you are using them. In particular, do not blindly replace all use of PHP's string functions which functions found here - most of the time you will not need to, and you will be introducing a significant performance overhead to your application. You can get a good idea of when to use what from reading: http://www.phpwact.org/php/i18n/utf-8 Important Note: For sake of performance most of the functions here are not "defensive" (e.g. there is not extensive parameter checking, well formed UTF-8 is assumed). This is particularily relevant when is comes to catching badly formed UTF-8 - you should screen input on the "outer perimeter" with help from functions in the utf8_validation.php and utf8_bad.php files. Important Note: this library treats ALL ASCII characters as valid, including ASCII control characters. But if you use some ASCII control characters in XML, it will render the XML ill-formed. Don't be a bozo: http://hsivonen.iki.fi/producing-xml/#controlchar ++BUGS / SUPPORT / FEATURE REQUESTS ++ Please report bugs to: http://sourceforge.net/tracker/?group_id=142846&atid=753842 - if you are able, please submit a failing unit test (http://www.lastcraft.com/simple_test.php) with your bug report. For feature requests / faster implementation of functions found here, please drop them in via the RFE tracker: http://sourceforge.net/tracker/?group_id=142846&atid=753845 Particularily interested in faster implementations! For general support / help, use: http://sourceforge.net/tracker/?group_id=142846&atid=753843 In the VERY WORST case, you can email me: hfuecks gmail com - I tend to be slow to respond though so be warned. Important Note: when reporting bugs, please provide the following information; PHP version, whether the iconv extension is loaded (in PHP5 it's there by default), whether the mbstring extension is loaded. The following PHP script can be used to determine this information; <?php print "PHP Version: " .phpversion()."<br>"; if ( extension_loaded('mbstring') ) { print "mbstring available<br>"; } else { print "mbstring not available<br>"; } if ( extension_loaded('iconv') ) { print "iconv available<br>"; } else { print "iconv not available<br>"; } ?> ++LICENSING++ Parts of the code in this library come from other places, under different licenses. The authors involved have been contacted (see below). Attribution for which code came from elsewhere can be found in the source code itself. +Andreas Gohr / Chris Smith - Dokuwiki There is a fair degree of collaboration / exchange of ideas and code beteen Dokuwiki's UTF-8 library; http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php and phputf8. Although Dokuwiki is released under GPL, its UTF-8 library is released under LGPL, hence no conflict with phputf8 +Henri Sivonen (http://hsivonen.iki.fi/php-utf8/ / http://hsivonen.iki.fi/php-utf8/) has also given permission for his code to be released under the terms of the LGPL. He ported a Unicode / UTF-8 converter from the Mozilla codebase to PHP, which is re-used in phputf8 PK���\O�y�tt6libraries/vendor/joomla/string/src/phputf8/ucwords.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to ucwords * Uppercase the first character of each word in a string * Note: requires utf8_substr_replace and utf8_strtoupper * @param string * @return string with first char of each word uppercase * @see http://www.php.net/ucwords * @package utf8 */ function utf8_ucwords($str) { // Note: [\x0c\x09\x0b\x0a\x0d\x20] matches; // form feeds, horizontal tabs, vertical tabs, linefeeds and carriage returns // This corresponds to the definition of a "word" defined at http://www.php.net/ucwords $pattern = '/(^|([\x0c\x09\x0b\x0a\x0d\x20]+))([^\x0c\x09\x0b\x0a\x0d\x20]{1})[^\x0c\x09\x0b\x0a\x0d\x20]*/u'; return preg_replace_callback($pattern, 'utf8_ucwords_callback',$str); } //--------------------------------------------------------------- /** * Callback function for preg_replace_callback call in utf8_ucwords * You don't need to call this yourself * @param array of matches corresponding to a single word * @return string with first char of the word in uppercase * @see utf8_ucwords * @see utf8_strtoupper * @package utf8 */ function utf8_ucwords_callback($matches) { $leadingws = $matches[2]; $ucfirst = utf8_strtoupper($matches[3]); $ucword = utf8_substr_replace(ltrim($matches[0]),$ucfirst,0,1); return $leadingws . $ucword; } PK���\iؚ�6libraries/vendor/joomla/string/src/phputf8/stristr.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to stristr * Find first occurrence of a string using case insensitive comparison * Note: requires utf8_strtolower * @param string * @param string * @return int * @see http://www.php.net/strcasecmp * @see utf8_strtolower * @package utf8 */ function utf8_stristr($str, $search) { if ( strlen($search) == 0 ) { return $str; } $lstr = utf8_strtolower($str); $lsearch = utf8_strtolower($search); //JOOMLA SPECIFIC FIX - BEGIN preg_match('/^(.*)'.preg_quote($lsearch, '/').'/Us',$lstr, $matches); //JOOMLA SPECIFIC FIX - END if ( count($matches) == 2 ) { return substr($str, strlen($matches[1])); } return FALSE; } PK���\�^���8libraries/vendor/joomla/string/src/phputf8/str_split.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to str_split * Convert a string to an array * Note: requires utf8_strlen to be loaded * @param string UTF-8 encoded * @param int number to characters to split string by * @return string characters in string reverses * @see http://www.php.net/str_split * @see utf8_strlen * @package utf8 */ function utf8_str_split($str, $split_len = 1) { if ( !preg_match('/^[0-9]+$/',$split_len) || $split_len < 1 ) { return FALSE; } $len = utf8_strlen($str); if ( $len <= $split_len ) { return array($str); } preg_match_all('/.{'.$split_len.'}|[^\x00]{1,'.$split_len.'}$/us', $str, $ar); return $ar[0]; } PK���\��)-BB6libraries/vendor/joomla/string/src/phputf8/strcspn.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to strcspn * Find length of initial segment not matching mask * Note: requires utf8_strlen and utf8_substr (if start, length are used) * @param string * @return int * @see http://www.php.net/strcspn * @see utf8_strlen * @package utf8 */ function utf8_strcspn($str, $mask, $start = NULL, $length = NULL) { if ( empty($mask) || strlen($mask) == 0 ) { return NULL; } $mask = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$mask); if ( $start !== NULL || $length !== NULL ) { $str = utf8_substr($str, $start, $length); } preg_match('/^[^'.$mask.']+/u',$str, $matches); if ( isset($matches[0]) ) { return utf8_strlen($matches[0]); } return 0; } PK���\�uww6libraries/vendor/joomla/string/src/phputf8/str_pad.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * Replacement for str_pad. $padStr may contain multi-byte characters. * * @author Oliver Saunders <oliver (a) osinternetservices.com> * @param string $input * @param int $length * @param string $padStr * @param int $type ( same constants as str_pad ) * @return string * @see http://www.php.net/str_pad * @see utf8_substr * @package utf8 */ function utf8_str_pad($input, $length, $padStr = ' ', $type = STR_PAD_RIGHT) { $inputLen = utf8_strlen($input); if ($length <= $inputLen) { return $input; } $padStrLen = utf8_strlen($padStr); $padLen = $length - $inputLen; if ($type == STR_PAD_RIGHT) { $repeatTimes = ceil($padLen / $padStrLen); return utf8_substr($input . str_repeat($padStr, $repeatTimes), 0, $length); } if ($type == STR_PAD_LEFT) { $repeatTimes = ceil($padLen / $padStrLen); return utf8_substr(str_repeat($padStr, $repeatTimes), 0, floor($padLen)) . $input; } if ($type == STR_PAD_BOTH) { $padLen/= 2; $padAmountLeft = floor($padLen); $padAmountRight = ceil($padLen); $repeatTimesLeft = ceil($padAmountLeft / $padStrLen); $repeatTimesRight = ceil($padAmountRight / $padStrLen); $paddingLeft = utf8_substr(str_repeat($padStr, $repeatTimesLeft), 0, $padAmountLeft); $paddingRight = utf8_substr(str_repeat($padStr, $repeatTimesRight), 0, $padAmountLeft); return $paddingLeft . $input . $paddingRight; } trigger_error('utf8_str_pad: Unknown padding type (' . $type . ')',E_USER_ERROR); } PK���\�h�w�A�A:libraries/vendor/joomla/string/src/phputf8/native/core.phpnu�[���<?php /** * @package utf8 */ /** * Define UTF8_CORE as required */ if ( !defined('UTF8_CORE') ) { define('UTF8_CORE',TRUE); } //-------------------------------------------------------------------- /** * Unicode aware replacement for strlen(). Returns the number * of characters in the string (not the number of bytes), replacing * multibyte characters with a single byte equivalent * utf8_decode() converts characters that are not in ISO-8859-1 * to '?', which, for the purpose of counting, is alright - It's * much faster than iconv_strlen * Note: this function does not count bad UTF-8 bytes in the string * - these are simply ignored * @author <chernyshevsky at hotmail dot com> * @link http://www.php.net/manual/en/function.strlen.php * @link http://www.php.net/manual/en/function.utf8-decode.php * @param string UTF-8 string * @return int number of UTF-8 characters in string * @package utf8 */ function utf8_strlen($str){ return strlen(utf8_decode($str)); } //-------------------------------------------------------------------- /** * UTF-8 aware alternative to strpos * Find position of first occurrence of a string * Note: This will get alot slower if offset is used * Note: requires utf8_strlen amd utf8_substr to be loaded * @param string haystack * @param string needle (you should validate this with utf8_is_valid) * @param integer offset in characters (from left) * @return mixed integer position or FALSE on failure * @see http://www.php.net/strpos * @see utf8_strlen * @see utf8_substr * @package utf8 */ function utf8_strpos($str, $needle, $offset = NULL) { if ( is_null($offset) ) { $ar = explode($needle, $str, 2); if ( count($ar) > 1 ) { return utf8_strlen($ar[0]); } return FALSE; } else { if ( !is_int($offset) ) { trigger_error('utf8_strpos: Offset must be an integer',E_USER_ERROR); return FALSE; } $str = utf8_substr($str, $offset); if ( FALSE !== ( $pos = utf8_strpos($str, $needle) ) ) { return $pos + $offset; } return FALSE; } } //-------------------------------------------------------------------- /** * UTF-8 aware alternative to strrpos * Find position of last occurrence of a char in a string * Note: This will get alot slower if offset is used * Note: requires utf8_substr and utf8_strlen to be loaded * @param string haystack * @param string needle (you should validate this with utf8_is_valid) * @param integer (optional) offset (from left) * @return mixed integer position or FALSE on failure * @see http://www.php.net/strrpos * @see utf8_substr * @see utf8_strlen * @package utf8 */ function utf8_strrpos($str, $needle, $offset = NULL) { if ( is_null($offset) ) { $ar = explode($needle, $str); if ( count($ar) > 1 ) { // Pop off the end of the string where the last match was made array_pop($ar); $str = join($needle,$ar); return utf8_strlen($str); } return FALSE; } else { if ( !is_int($offset) ) { trigger_error('utf8_strrpos expects parameter 3 to be long',E_USER_WARNING); return FALSE; } $str = utf8_substr($str, $offset); if ( FALSE !== ( $pos = utf8_strrpos($str, $needle) ) ) { return $pos + $offset; } return FALSE; } } //-------------------------------------------------------------------- /** * UTF-8 aware alternative to substr * Return part of a string given character offset (and optionally length) * * Note arguments: comparied to substr - if offset or length are * not integers, this version will not complain but rather massages them * into an integer. * * Note on returned values: substr documentation states false can be * returned in some cases (e.g. offset > string length) * mb_substr never returns false, it will return an empty string instead. * This adopts the mb_substr approach * * Note on implementation: PCRE only supports repetitions of less than * 65536, in order to accept up to MAXINT values for offset and length, * we'll repeat a group of 65535 characters when needed. * * Note on implementation: calculating the number of characters in the * string is a relatively expensive operation, so we only carry it out when * necessary. It isn't necessary for +ve offsets and no specified length * * @author Chris Smith<chris@jalakai.co.uk> * @param string * @param integer number of UTF-8 characters offset (from left) * @param integer (optional) length in UTF-8 characters from offset * @return mixed string or FALSE if failure * @package utf8 */ function utf8_substr($str, $offset, $length = NULL) { // generates E_NOTICE // for PHP4 objects, but not PHP5 objects $str = (string)$str; $offset = (int)$offset; if (!is_null($length)) $length = (int)$length; // handle trivial cases if ($length === 0) return ''; if ($offset < 0 && $length < 0 && $length < $offset) return ''; // normalise negative offsets (we could use a tail // anchored pattern, but they are horribly slow!) if ($offset < 0) { // see notes $strlen = strlen(utf8_decode($str)); $offset = $strlen + $offset; if ($offset < 0) $offset = 0; } $Op = ''; $Lp = ''; // establish a pattern for offset, a // non-captured group equal in length to offset if ($offset > 0) { $Ox = (int)($offset/65535); $Oy = $offset%65535; if ($Ox) { $Op = '(?:.{65535}){'.$Ox.'}'; } $Op = '^(?:'.$Op.'.{'.$Oy.'})'; } else { // offset == 0; just anchor the pattern $Op = '^'; } // establish a pattern for length if (is_null($length)) { // the rest of the string $Lp = '(.*)$'; } else { if (!isset($strlen)) { // see notes $strlen = strlen(utf8_decode($str)); } // another trivial case if ($offset > $strlen) return ''; if ($length > 0) { // reduce any length that would // go passed the end of the string $length = min($strlen-$offset, $length); $Lx = (int)( $length / 65535 ); $Ly = $length % 65535; // negative length requires a captured group // of length characters if ($Lx) $Lp = '(?:.{65535}){'.$Lx.'}'; $Lp = '('.$Lp.'.{'.$Ly.'})'; } else if ($length < 0) { if ( $length < ($offset - $strlen) ) { return ''; } $Lx = (int)((-$length)/65535); $Ly = (-$length)%65535; // negative length requires ... capture everything // except a group of -length characters // anchored at the tail-end of the string if ($Lx) $Lp = '(?:.{65535}){'.$Lx.'}'; $Lp = '(.*)(?:'.$Lp.'.{'.$Ly.'})$'; } } if (!preg_match( '#'.$Op.$Lp.'#us',$str, $match )) { return ''; } return $match[1]; } //--------------------------------------------------------------- /** * UTF-8 aware alternative to strtolower * Make a string lowercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * Note: requires utf8_to_unicode and utf8_from_unicode * @author Andreas Gohr <andi@splitbrain.org> * @param string * @return mixed either string in lowercase or FALSE is UTF-8 invalid * @see http://www.php.net/strtolower * @see utf8_to_unicode * @see utf8_from_unicode * @see http://www.unicode.org/reports/tr21/tr21-5.html * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @package utf8 */ function utf8_strtolower($string){ static $UTF8_UPPER_TO_LOWER = NULL; if ( is_null($UTF8_UPPER_TO_LOWER) ) { $UTF8_UPPER_TO_LOWER = array( 0x0041=>0x0061, 0x03A6=>0x03C6, 0x0162=>0x0163, 0x00C5=>0x00E5, 0x0042=>0x0062, 0x0139=>0x013A, 0x00C1=>0x00E1, 0x0141=>0x0142, 0x038E=>0x03CD, 0x0100=>0x0101, 0x0490=>0x0491, 0x0394=>0x03B4, 0x015A=>0x015B, 0x0044=>0x0064, 0x0393=>0x03B3, 0x00D4=>0x00F4, 0x042A=>0x044A, 0x0419=>0x0439, 0x0112=>0x0113, 0x041C=>0x043C, 0x015E=>0x015F, 0x0143=>0x0144, 0x00CE=>0x00EE, 0x040E=>0x045E, 0x042F=>0x044F, 0x039A=>0x03BA, 0x0154=>0x0155, 0x0049=>0x0069, 0x0053=>0x0073, 0x1E1E=>0x1E1F, 0x0134=>0x0135, 0x0427=>0x0447, 0x03A0=>0x03C0, 0x0418=>0x0438, 0x00D3=>0x00F3, 0x0420=>0x0440, 0x0404=>0x0454, 0x0415=>0x0435, 0x0429=>0x0449, 0x014A=>0x014B, 0x0411=>0x0431, 0x0409=>0x0459, 0x1E02=>0x1E03, 0x00D6=>0x00F6, 0x00D9=>0x00F9, 0x004E=>0x006E, 0x0401=>0x0451, 0x03A4=>0x03C4, 0x0423=>0x0443, 0x015C=>0x015D, 0x0403=>0x0453, 0x03A8=>0x03C8, 0x0158=>0x0159, 0x0047=>0x0067, 0x00C4=>0x00E4, 0x0386=>0x03AC, 0x0389=>0x03AE, 0x0166=>0x0167, 0x039E=>0x03BE, 0x0164=>0x0165, 0x0116=>0x0117, 0x0108=>0x0109, 0x0056=>0x0076, 0x00DE=>0x00FE, 0x0156=>0x0157, 0x00DA=>0x00FA, 0x1E60=>0x1E61, 0x1E82=>0x1E83, 0x00C2=>0x00E2, 0x0118=>0x0119, 0x0145=>0x0146, 0x0050=>0x0070, 0x0150=>0x0151, 0x042E=>0x044E, 0x0128=>0x0129, 0x03A7=>0x03C7, 0x013D=>0x013E, 0x0422=>0x0442, 0x005A=>0x007A, 0x0428=>0x0448, 0x03A1=>0x03C1, 0x1E80=>0x1E81, 0x016C=>0x016D, 0x00D5=>0x00F5, 0x0055=>0x0075, 0x0176=>0x0177, 0x00DC=>0x00FC, 0x1E56=>0x1E57, 0x03A3=>0x03C3, 0x041A=>0x043A, 0x004D=>0x006D, 0x016A=>0x016B, 0x0170=>0x0171, 0x0424=>0x0444, 0x00CC=>0x00EC, 0x0168=>0x0169, 0x039F=>0x03BF, 0x004B=>0x006B, 0x00D2=>0x00F2, 0x00C0=>0x00E0, 0x0414=>0x0434, 0x03A9=>0x03C9, 0x1E6A=>0x1E6B, 0x00C3=>0x00E3, 0x042D=>0x044D, 0x0416=>0x0436, 0x01A0=>0x01A1, 0x010C=>0x010D, 0x011C=>0x011D, 0x00D0=>0x00F0, 0x013B=>0x013C, 0x040F=>0x045F, 0x040A=>0x045A, 0x00C8=>0x00E8, 0x03A5=>0x03C5, 0x0046=>0x0066, 0x00DD=>0x00FD, 0x0043=>0x0063, 0x021A=>0x021B, 0x00CA=>0x00EA, 0x0399=>0x03B9, 0x0179=>0x017A, 0x00CF=>0x00EF, 0x01AF=>0x01B0, 0x0045=>0x0065, 0x039B=>0x03BB, 0x0398=>0x03B8, 0x039C=>0x03BC, 0x040C=>0x045C, 0x041F=>0x043F, 0x042C=>0x044C, 0x00DE=>0x00FE, 0x00D0=>0x00F0, 0x1EF2=>0x1EF3, 0x0048=>0x0068, 0x00CB=>0x00EB, 0x0110=>0x0111, 0x0413=>0x0433, 0x012E=>0x012F, 0x00C6=>0x00E6, 0x0058=>0x0078, 0x0160=>0x0161, 0x016E=>0x016F, 0x0391=>0x03B1, 0x0407=>0x0457, 0x0172=>0x0173, 0x0178=>0x00FF, 0x004F=>0x006F, 0x041B=>0x043B, 0x0395=>0x03B5, 0x0425=>0x0445, 0x0120=>0x0121, 0x017D=>0x017E, 0x017B=>0x017C, 0x0396=>0x03B6, 0x0392=>0x03B2, 0x0388=>0x03AD, 0x1E84=>0x1E85, 0x0174=>0x0175, 0x0051=>0x0071, 0x0417=>0x0437, 0x1E0A=>0x1E0B, 0x0147=>0x0148, 0x0104=>0x0105, 0x0408=>0x0458, 0x014C=>0x014D, 0x00CD=>0x00ED, 0x0059=>0x0079, 0x010A=>0x010B, 0x038F=>0x03CE, 0x0052=>0x0072, 0x0410=>0x0430, 0x0405=>0x0455, 0x0402=>0x0452, 0x0126=>0x0127, 0x0136=>0x0137, 0x012A=>0x012B, 0x038A=>0x03AF, 0x042B=>0x044B, 0x004C=>0x006C, 0x0397=>0x03B7, 0x0124=>0x0125, 0x0218=>0x0219, 0x00DB=>0x00FB, 0x011E=>0x011F, 0x041E=>0x043E, 0x1E40=>0x1E41, 0x039D=>0x03BD, 0x0106=>0x0107, 0x03AB=>0x03CB, 0x0426=>0x0446, 0x00DE=>0x00FE, 0x00C7=>0x00E7, 0x03AA=>0x03CA, 0x0421=>0x0441, 0x0412=>0x0432, 0x010E=>0x010F, 0x00D8=>0x00F8, 0x0057=>0x0077, 0x011A=>0x011B, 0x0054=>0x0074, 0x004A=>0x006A, 0x040B=>0x045B, 0x0406=>0x0456, 0x0102=>0x0103, 0x039B=>0x03BB, 0x00D1=>0x00F1, 0x041D=>0x043D, 0x038C=>0x03CC, 0x00C9=>0x00E9, 0x00D0=>0x00F0, 0x0407=>0x0457, 0x0122=>0x0123, ); } $uni = utf8_to_unicode($string); if ( !$uni ) { return FALSE; } $cnt = count($uni); for ($i=0; $i < $cnt; $i++){ if ( isset($UTF8_UPPER_TO_LOWER[$uni[$i]]) ) { $uni[$i] = $UTF8_UPPER_TO_LOWER[$uni[$i]]; } } return utf8_from_unicode($uni); } //--------------------------------------------------------------- /** * UTF-8 aware alternative to strtoupper * Make a string uppercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * Note: requires utf8_to_unicode and utf8_from_unicode * @author Andreas Gohr <andi@splitbrain.org> * @param string * @return mixed either string in lowercase or FALSE is UTF-8 invalid * @see http://www.php.net/strtoupper * @see utf8_to_unicode * @see utf8_from_unicode * @see http://www.unicode.org/reports/tr21/tr21-5.html * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php * @package utf8 */ function utf8_strtoupper($string){ static $UTF8_LOWER_TO_UPPER = NULL; if ( is_null($UTF8_LOWER_TO_UPPER) ) { $UTF8_LOWER_TO_UPPER = array( 0x0061=>0x0041, 0x03C6=>0x03A6, 0x0163=>0x0162, 0x00E5=>0x00C5, 0x0062=>0x0042, 0x013A=>0x0139, 0x00E1=>0x00C1, 0x0142=>0x0141, 0x03CD=>0x038E, 0x0101=>0x0100, 0x0491=>0x0490, 0x03B4=>0x0394, 0x015B=>0x015A, 0x0064=>0x0044, 0x03B3=>0x0393, 0x00F4=>0x00D4, 0x044A=>0x042A, 0x0439=>0x0419, 0x0113=>0x0112, 0x043C=>0x041C, 0x015F=>0x015E, 0x0144=>0x0143, 0x00EE=>0x00CE, 0x045E=>0x040E, 0x044F=>0x042F, 0x03BA=>0x039A, 0x0155=>0x0154, 0x0069=>0x0049, 0x0073=>0x0053, 0x1E1F=>0x1E1E, 0x0135=>0x0134, 0x0447=>0x0427, 0x03C0=>0x03A0, 0x0438=>0x0418, 0x00F3=>0x00D3, 0x0440=>0x0420, 0x0454=>0x0404, 0x0435=>0x0415, 0x0449=>0x0429, 0x014B=>0x014A, 0x0431=>0x0411, 0x0459=>0x0409, 0x1E03=>0x1E02, 0x00F6=>0x00D6, 0x00F9=>0x00D9, 0x006E=>0x004E, 0x0451=>0x0401, 0x03C4=>0x03A4, 0x0443=>0x0423, 0x015D=>0x015C, 0x0453=>0x0403, 0x03C8=>0x03A8, 0x0159=>0x0158, 0x0067=>0x0047, 0x00E4=>0x00C4, 0x03AC=>0x0386, 0x03AE=>0x0389, 0x0167=>0x0166, 0x03BE=>0x039E, 0x0165=>0x0164, 0x0117=>0x0116, 0x0109=>0x0108, 0x0076=>0x0056, 0x00FE=>0x00DE, 0x0157=>0x0156, 0x00FA=>0x00DA, 0x1E61=>0x1E60, 0x1E83=>0x1E82, 0x00E2=>0x00C2, 0x0119=>0x0118, 0x0146=>0x0145, 0x0070=>0x0050, 0x0151=>0x0150, 0x044E=>0x042E, 0x0129=>0x0128, 0x03C7=>0x03A7, 0x013E=>0x013D, 0x0442=>0x0422, 0x007A=>0x005A, 0x0448=>0x0428, 0x03C1=>0x03A1, 0x1E81=>0x1E80, 0x016D=>0x016C, 0x00F5=>0x00D5, 0x0075=>0x0055, 0x0177=>0x0176, 0x00FC=>0x00DC, 0x1E57=>0x1E56, 0x03C3=>0x03A3, 0x043A=>0x041A, 0x006D=>0x004D, 0x016B=>0x016A, 0x0171=>0x0170, 0x0444=>0x0424, 0x00EC=>0x00CC, 0x0169=>0x0168, 0x03BF=>0x039F, 0x006B=>0x004B, 0x00F2=>0x00D2, 0x00E0=>0x00C0, 0x0434=>0x0414, 0x03C9=>0x03A9, 0x1E6B=>0x1E6A, 0x00E3=>0x00C3, 0x044D=>0x042D, 0x0436=>0x0416, 0x01A1=>0x01A0, 0x010D=>0x010C, 0x011D=>0x011C, 0x00F0=>0x00D0, 0x013C=>0x013B, 0x045F=>0x040F, 0x045A=>0x040A, 0x00E8=>0x00C8, 0x03C5=>0x03A5, 0x0066=>0x0046, 0x00FD=>0x00DD, 0x0063=>0x0043, 0x021B=>0x021A, 0x00EA=>0x00CA, 0x03B9=>0x0399, 0x017A=>0x0179, 0x00EF=>0x00CF, 0x01B0=>0x01AF, 0x0065=>0x0045, 0x03BB=>0x039B, 0x03B8=>0x0398, 0x03BC=>0x039C, 0x045C=>0x040C, 0x043F=>0x041F, 0x044C=>0x042C, 0x00FE=>0x00DE, 0x00F0=>0x00D0, 0x1EF3=>0x1EF2, 0x0068=>0x0048, 0x00EB=>0x00CB, 0x0111=>0x0110, 0x0433=>0x0413, 0x012F=>0x012E, 0x00E6=>0x00C6, 0x0078=>0x0058, 0x0161=>0x0160, 0x016F=>0x016E, 0x03B1=>0x0391, 0x0457=>0x0407, 0x0173=>0x0172, 0x00FF=>0x0178, 0x006F=>0x004F, 0x043B=>0x041B, 0x03B5=>0x0395, 0x0445=>0x0425, 0x0121=>0x0120, 0x017E=>0x017D, 0x017C=>0x017B, 0x03B6=>0x0396, 0x03B2=>0x0392, 0x03AD=>0x0388, 0x1E85=>0x1E84, 0x0175=>0x0174, 0x0071=>0x0051, 0x0437=>0x0417, 0x1E0B=>0x1E0A, 0x0148=>0x0147, 0x0105=>0x0104, 0x0458=>0x0408, 0x014D=>0x014C, 0x00ED=>0x00CD, 0x0079=>0x0059, 0x010B=>0x010A, 0x03CE=>0x038F, 0x0072=>0x0052, 0x0430=>0x0410, 0x0455=>0x0405, 0x0452=>0x0402, 0x0127=>0x0126, 0x0137=>0x0136, 0x012B=>0x012A, 0x03AF=>0x038A, 0x044B=>0x042B, 0x006C=>0x004C, 0x03B7=>0x0397, 0x0125=>0x0124, 0x0219=>0x0218, 0x00FB=>0x00DB, 0x011F=>0x011E, 0x043E=>0x041E, 0x1E41=>0x1E40, 0x03BD=>0x039D, 0x0107=>0x0106, 0x03CB=>0x03AB, 0x0446=>0x0426, 0x00FE=>0x00DE, 0x00E7=>0x00C7, 0x03CA=>0x03AA, 0x0441=>0x0421, 0x0432=>0x0412, 0x010F=>0x010E, 0x00F8=>0x00D8, 0x0077=>0x0057, 0x011B=>0x011A, 0x0074=>0x0054, 0x006A=>0x004A, 0x045B=>0x040B, 0x0456=>0x0406, 0x0103=>0x0102, 0x03BB=>0x039B, 0x00F1=>0x00D1, 0x043D=>0x041D, 0x03CC=>0x038C, 0x00E9=>0x00C9, 0x00F0=>0x00D0, 0x0457=>0x0407, 0x0123=>0x0122, ); } $uni = utf8_to_unicode($string); if ( !$uni ) { return FALSE; } $cnt = count($uni); for ($i=0; $i < $cnt; $i++){ if( isset($UTF8_LOWER_TO_UPPER[$uni[$i]]) ) { $uni[$i] = $UTF8_LOWER_TO_UPPER[$uni[$i]]; } } return utf8_from_unicode($uni); } PK���\��{���5libraries/vendor/joomla/string/src/phputf8/strrev.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to strrev * Reverse a string * @param string UTF-8 encoded * @return string characters in string reverses * @see http://www.php.net/strrev * @package utf8 */ function utf8_strrev($str){ preg_match_all('/./us', $str, $ar); return join('',array_reverse($ar[0])); } PK���\�����6libraries/vendor/joomla/string/src/phputf8/ucfirst.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to ucfirst * Make a string's first character uppercase * Note: requires utf8_strtoupper * @param string * @return string with first character as upper case (if applicable) * @see http://www.php.net/ucfirst * @see utf8_strtoupper * @package utf8 */ function utf8_ucfirst($str){ switch ( utf8_strlen($str) ) { case 0: return ''; break; case 1: return utf8_strtoupper($str); break; default: preg_match('/^(.{1})(.*)$/us', $str, $matches); return utf8_strtoupper($matches[1]).$matches[2]; break; } } PK���\OX5��9libraries/vendor/joomla/string/src/phputf8/strcasecmp.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to strcasecmp * A case insensivite string comparison * Note: requires utf8_strtolower * @param string * @param string * @return int * @see http://www.php.net/strcasecmp * @see utf8_strtolower * @package utf8 */ function utf8_strcasecmp($strX, $strY) { $strX = utf8_strtolower($strX); $strY = utf8_strtolower($strY); return strcmp($strX, $strY); } PK���\:a �__5libraries/vendor/joomla/string/src/phputf8/strspn.phpnu�[���<?php /** * @package utf8 */ //--------------------------------------------------------------- /** * UTF-8 aware alternative to strspn * Find length of initial segment matching mask * Note: requires utf8_strlen and utf8_substr (if start, length are used) * @param string * @return int * @see http://www.php.net/strspn * @package utf8 */ function utf8_strspn($str, $mask, $start = NULL, $length = NULL) { $mask = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$mask); // Fix for $start but no $length argument. if ($start !== null && $length === null) { $length = utf8_strlen($str); } if ( $start !== NULL || $length !== NULL ) { $str = utf8_substr($str, $start, $length); } preg_match('/^['.$mask.']+/u',$str, $matches); if ( isset($matches[0]) ) { return utf8_strlen($matches[0]); } return 0; } PK���\�ˋii0libraries/vendor/joomla/string/src/Normalise.phpnu�[���<?php /** * Part of the Joomla Framework String Package * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\String; /** * Joomla Framework String Normalise Class * * @since 1.0 */ abstract class Normalise { /** * Method to convert a string from camel case. * * This method offers two modes. Grouped allows for splitting on groups of uppercase characters as follows: * * "FooBarABCDef" becomes array("Foo", "Bar", "ABC", "Def") * "JFooBar" becomes array("J", "Foo", "Bar") * "J001FooBar002" becomes array("J001", "Foo", "Bar002") * "abcDef" becomes array("abc", "Def") * "abc_defGhi_Jkl" becomes array("abc_def", "Ghi_Jkl") * "ThisIsA_NASAAstronaut" becomes array("This", "Is", "A_NASA", "Astronaut")) * "JohnFitzgerald_Kennedy" becomes array("John", "Fitzgerald_Kennedy")) * * Non-grouped will split strings at each uppercase character. * * @param string $input The string input (ASCII only). * @param boolean $grouped Optionally allows splitting on groups of uppercase characters. * * @return string The space separated string. * * @since 1.0 */ public static function fromCamelCase($input, $grouped = false) { return $grouped ? preg_split('/(?<=[^A-Z_])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][^A-Z_])/x', $input) : trim(preg_replace('#([A-Z])#', ' $1', $input)); } /** * Method to convert a string into camel case. * * @param string $input The string input (ASCII only). * * @return string The camel case string. * * @since 1.0 */ public static function toCamelCase($input) { // Convert words to uppercase and then remove spaces. $input = self::toSpaceSeparated($input); $input = ucwords($input); $input = str_ireplace(' ', '', $input); return $input; } /** * Method to convert a string into dash separated form. * * @param string $input The string input (ASCII only). * * @return string The dash separated string. * * @since 1.0 */ public static function toDashSeparated($input) { // Convert spaces and underscores to dashes. $input = preg_replace('#[ \-_]+#', '-', $input); return $input; } /** * Method to convert a string into space separated form. * * @param string $input The string input (ASCII only). * * @return string The space separated string. * * @since 1.0 */ public static function toSpaceSeparated($input) { // Convert underscores and dashes to spaces. $input = preg_replace('#[ \-_]+#', ' ', $input); return $input; } /** * Method to convert a string into underscore separated form. * * @param string $input The string input (ASCII only). * * @return string The underscore separated string. * * @since 1.0 */ public static function toUnderscoreSeparated($input) { // Convert spaces and dashes to underscores. $input = preg_replace('#[ \-_]+#', '_', $input); return $input; } /** * Method to convert a string into variable form. * * @param string $input The string input (ASCII only). * * @return string The variable string. * * @since 1.0 */ public static function toVariable($input) { // Remove dashes and underscores, then convert to camel case. $input = self::toSpaceSeparated($input); $input = self::toCamelCase($input); // Remove leading digits. $input = preg_replace('#^[0-9]+.*$#', '', $input); // Lowercase the first character. $first = substr($input, 0, 1); $first = strtolower($first); // Replace the first character with the lowercase character. $input = substr_replace($input, $first, 0, 1); return $input; } /** * Method to convert a string into key form. * * @param string $input The string input (ASCII only). * * @return string The key string. * * @since 1.0 */ public static function toKey($input) { // Remove spaces and dashes, then convert to lower case. $input = self::toUnderscoreSeparated($input); $input = strtolower($input); return $input; } } PK���\U�X�dUdU-libraries/vendor/joomla/string/src/String.phpnu�[���<?php /** * Part of the Joomla Framework String Package * * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\String; // PHP mbstring and iconv local configuration if (version_compare(PHP_VERSION, '5.6', '>=')) { @ini_set('default_charset', 'UTF-8'); } else { // Check if mbstring extension is loaded and attempt to load it if not present except for windows if (extension_loaded('mbstring')) { @ini_set('mbstring.internal_encoding', 'UTF-8'); @ini_set('mbstring.http_input', 'UTF-8'); @ini_set('mbstring.http_output', 'UTF-8'); } // Same for iconv if (function_exists('iconv')) { iconv_set_encoding('internal_encoding', 'UTF-8'); iconv_set_encoding('input_encoding', 'UTF-8'); iconv_set_encoding('output_encoding', 'UTF-8'); } } /** * Include the utf8 package */ if (!defined('UTF8')) { require_once __DIR__ . '/phputf8/utf8.php'; } if (!function_exists('utf8_strcasecmp')) { require_once __DIR__ . '/phputf8/strcasecmp.php'; } /** * String handling class for utf-8 data * Wraps the phputf8 library * All functions assume the validity of utf-8 strings. * * @since 1.0 */ abstract class String { /** * Increment styles. * * @var array * @since 1.0 */ protected static $incrementStyles = array( 'dash' => array( '#-(\d+)$#', '-%d' ), 'default' => array( array('#\((\d+)\)$#', '#\(\d+\)$#'), array(' (%d)', '(%d)'), ), ); /** * Increments a trailing number in a string. * * Used to easily create distinct labels when copying objects. The method has the following styles: * * default: "Label" becomes "Label (2)" * dash: "Label" becomes "Label-2" * * @param string $string The source string. * @param string $style The the style (default|dash). * @param integer $n If supplied, this number is used for the copy, otherwise it is the 'next' number. * * @return string The incremented string. * * @since 1.0 */ public static function increment($string, $style = 'default', $n = 0) { $styleSpec = isset(self::$incrementStyles[$style]) ? self::$incrementStyles[$style] : self::$incrementStyles['default']; // Regular expression search and replace patterns. if (is_array($styleSpec[0])) { $rxSearch = $styleSpec[0][0]; $rxReplace = $styleSpec[0][1]; } else { $rxSearch = $rxReplace = $styleSpec[0]; } // New and old (existing) sprintf formats. if (is_array($styleSpec[1])) { $newFormat = $styleSpec[1][0]; $oldFormat = $styleSpec[1][1]; } else { $newFormat = $oldFormat = $styleSpec[1]; } // Check if we are incrementing an existing pattern, or appending a new one. if (preg_match($rxSearch, $string, $matches)) { $n = empty($n) ? ($matches[1] + 1) : $n; $string = preg_replace($rxReplace, sprintf($oldFormat, $n), $string); } else { $n = empty($n) ? 2 : $n; $string .= sprintf($newFormat, $n); } return $string; } /** * Tests whether a string contains only 7bit ASCII bytes. * You might use this to conditionally check whether a string * needs handling as UTF-8 or not, potentially offering performance * benefits by using the native PHP equivalent if it's just ASCII e.g.; * * <code> * if (String::is_ascii($someString)) * { * // It's just ASCII - use the native PHP version * $someString = strtolower($someString); * } * else * { * $someString = String::strtolower($someString); * } * </code> * * @param string $str The string to test. * * @return boolean True if the string is all ASCII * * @since 1.0 */ public static function is_ascii($str) { require_once __DIR__ . '/phputf8/utils/ascii.php'; return utf8_is_ascii($str); } /** * UTF-8 aware alternative to strpos. * * Find position of first occurrence of a string. * * @param string $str String being examined * @param string $search String being searched for * @param integer $offset Optional, specifies the position from which the search should be performed * * @return mixed Number of characters before the first match or FALSE on failure * * @see http://www.php.net/strpos * @since 1.0 */ public static function strpos($str, $search, $offset = false) { if ($offset === false) { return utf8_strpos($str, $search); } return utf8_strpos($str, $search, $offset); } /** * UTF-8 aware alternative to strrpos * Finds position of last occurrence of a string * * @param string $str String being examined. * @param string $search String being searched for. * @param integer $offset Offset from the left of the string. * * @return mixed Number of characters before the last match or false on failure * * @see http://www.php.net/strrpos * @since 1.0 */ public static function strrpos($str, $search, $offset = 0) { return utf8_strrpos($str, $search, $offset); } /** * UTF-8 aware alternative to substr * Return part of a string given character offset (and optionally length) * * @param string $str String being processed * @param integer $offset Number of UTF-8 characters offset (from left) * @param integer $length Optional length in UTF-8 characters from offset * * @return mixed string or FALSE if failure * * @see http://www.php.net/substr * @since 1.0 */ public static function substr($str, $offset, $length = false) { if ($length === false) { return utf8_substr($str, $offset); } return utf8_substr($str, $offset, $length); } /** * UTF-8 aware alternative to strtlower * * Make a string lowercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * * @param string $str String being processed * * @return mixed Either string in lowercase or FALSE is UTF-8 invalid * * @see http://www.php.net/strtolower * @since 1.0 */ public static function strtolower($str) { return utf8_strtolower($str); } /** * UTF-8 aware alternative to strtoupper * Make a string uppercase * Note: The concept of a characters "case" only exists is some alphabets * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does * not exist in the Chinese alphabet, for example. See Unicode Standard * Annex #21: Case Mappings * * @param string $str String being processed * * @return mixed Either string in uppercase or FALSE is UTF-8 invalid * * @see http://www.php.net/strtoupper * @since 1.0 */ public static function strtoupper($str) { return utf8_strtoupper($str); } /** * UTF-8 aware alternative to strlen. * * Returns the number of characters in the string (NOT THE NUMBER OF BYTES), * * @param string $str UTF-8 string. * * @return integer Number of UTF-8 characters in string. * * @see http://www.php.net/strlen * @since 1.0 */ public static function strlen($str) { return utf8_strlen($str); } /** * UTF-8 aware alternative to str_ireplace * Case-insensitive version of str_replace * * @param string $search String to search * @param string $replace Existing string to replace * @param string $str New string to replace with * @param integer $count Optional count value to be passed by referene * * @return string UTF-8 String * * @see http://www.php.net/str_ireplace * @since 1.0 */ public static function str_ireplace($search, $replace, $str, $count = null) { require_once __DIR__ . '/phputf8/str_ireplace.php'; if ($count === false) { return utf8_ireplace($search, $replace, $str); } return utf8_ireplace($search, $replace, $str, $count); } /** * UTF-8 aware alternative to str_split * Convert a string to an array * * @param string $str UTF-8 encoded string to process * @param integer $split_len Number to characters to split string by * * @return array * * @see http://www.php.net/str_split * @since 1.0 */ public static function str_split($str, $split_len = 1) { require_once __DIR__ . '/phputf8/str_split.php'; return utf8_str_split($str, $split_len); } /** * UTF-8/LOCALE aware alternative to strcasecmp * A case insensitive string comparison * * @param string $str1 string 1 to compare * @param string $str2 string 2 to compare * @param mixed $locale The locale used by strcoll or false to use classical comparison * * @return integer < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal. * * @see http://www.php.net/strcasecmp * @see http://www.php.net/strcoll * @see http://www.php.net/setlocale * @since 1.0 */ public static function strcasecmp($str1, $str2, $locale = false) { if ($locale) { // Get current locale $locale0 = setlocale(LC_COLLATE, 0); if (!$locale = setlocale(LC_COLLATE, $locale)) { $locale = $locale0; } // See if we have successfully set locale to UTF-8 if (!stristr($locale, 'UTF-8') && stristr($locale, '_') && preg_match('~\.(\d+)$~', $locale, $m)) { $encoding = 'CP' . $m[1]; } elseif (stristr($locale, 'UTF-8') || stristr($locale, 'utf8')) { $encoding = 'UTF-8'; } else { $encoding = 'nonrecodable'; } // If we successfully set encoding it to utf-8 or encoding is sth weird don't recode if ($encoding == 'UTF-8' || $encoding == 'nonrecodable') { return strcoll(utf8_strtolower($str1), utf8_strtolower($str2)); } return strcoll( self::transcode(utf8_strtolower($str1), 'UTF-8', $encoding), self::transcode(utf8_strtolower($str2), 'UTF-8', $encoding) ); } return utf8_strcasecmp($str1, $str2); } /** * UTF-8/LOCALE aware alternative to strcmp * A case sensitive string comparison * * @param string $str1 string 1 to compare * @param string $str2 string 2 to compare * @param mixed $locale The locale used by strcoll or false to use classical comparison * * @return integer < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal. * * @see http://www.php.net/strcmp * @see http://www.php.net/strcoll * @see http://www.php.net/setlocale * @since 1.0 */ public static function strcmp($str1, $str2, $locale = false) { if ($locale) { // Get current locale $locale0 = setlocale(LC_COLLATE, 0); if (!$locale = setlocale(LC_COLLATE, $locale)) { $locale = $locale0; } // See if we have successfully set locale to UTF-8 if (!stristr($locale, 'UTF-8') && stristr($locale, '_') && preg_match('~\.(\d+)$~', $locale, $m)) { $encoding = 'CP' . $m[1]; } elseif (stristr($locale, 'UTF-8') || stristr($locale, 'utf8')) { $encoding = 'UTF-8'; } else { $encoding = 'nonrecodable'; } // If we successfully set encoding it to utf-8 or encoding is sth weird don't recode if ($encoding == 'UTF-8' || $encoding == 'nonrecodable') { return strcoll($str1, $str2); } return strcoll(self::transcode($str1, 'UTF-8', $encoding), self::transcode($str2, 'UTF-8', $encoding)); } return strcmp($str1, $str2); } /** * UTF-8 aware alternative to strcspn * Find length of initial segment not matching mask * * @param string $str The string to process * @param string $mask The mask * @param integer $start Optional starting character position (in characters) * @param integer $length Optional length * * @return integer The length of the initial segment of str1 which does not contain any of the characters in str2 * * @see http://www.php.net/strcspn * @since 1.0 */ public static function strcspn($str, $mask, $start = null, $length = null) { require_once __DIR__ . '/phputf8/strcspn.php'; if ($start === false && $length === false) { return utf8_strcspn($str, $mask); } if ($length === false) { return utf8_strcspn($str, $mask, $start); } return utf8_strcspn($str, $mask, $start, $length); } /** * UTF-8 aware alternative to stristr * Returns all of haystack from the first occurrence of needle to the end. * needle and haystack are examined in a case-insensitive manner * Find first occurrence of a string using case insensitive comparison * * @param string $str The haystack * @param string $search The needle * * @return string the sub string * * @see http://www.php.net/stristr * @since 1.0 */ public static function stristr($str, $search) { require_once __DIR__ . '/phputf8/stristr.php'; return utf8_stristr($str, $search); } /** * UTF-8 aware alternative to strrev * Reverse a string * * @param string $str String to be reversed * * @return string The string in reverse character order * * @see http://www.php.net/strrev * @since 1.0 */ public static function strrev($str) { require_once __DIR__ . '/phputf8/strrev.php'; return utf8_strrev($str); } /** * UTF-8 aware alternative to strspn * Find length of initial segment matching mask * * @param string $str The haystack * @param string $mask The mask * @param integer $start Start optional * @param integer $length Length optional * * @return integer * * @see http://www.php.net/strspn * @since 1.0 */ public static function strspn($str, $mask, $start = null, $length = null) { require_once __DIR__ . '/phputf8/strspn.php'; if ($start === null && $length === null) { return utf8_strspn($str, $mask); } if ($length === null) { return utf8_strspn($str, $mask, $start); } return utf8_strspn($str, $mask, $start, $length); } /** * UTF-8 aware substr_replace * Replace text within a portion of a string * * @param string $str The haystack * @param string $repl The replacement string * @param integer $start Start * @param integer $length Length (optional) * * @return string * * @see http://www.php.net/substr_replace * @since 1.0 */ public static function substr_replace($str, $repl, $start, $length = null) { // Loaded by library loader if ($length === false) { return utf8_substr_replace($str, $repl, $start); } return utf8_substr_replace($str, $repl, $start, $length); } /** * UTF-8 aware replacement for ltrim() * * Strip whitespace (or other characters) from the beginning of a string * You only need to use this if you are supplying the charlist * optional arg and it contains UTF-8 characters. Otherwise ltrim will * work normally on a UTF-8 string * * @param string $str The string to be trimmed * @param string $charlist The optional charlist of additional characters to trim * * @return string The trimmed string * * @see http://www.php.net/ltrim * @since 1.0 */ public static function ltrim($str, $charlist = false) { if (empty($charlist) && $charlist !== false) { return $str; } require_once __DIR__ . '/phputf8/trim.php'; if ($charlist === false) { return utf8_ltrim($str); } return utf8_ltrim($str, $charlist); } /** * UTF-8 aware replacement for rtrim() * Strip whitespace (or other characters) from the end of a string * You only need to use this if you are supplying the charlist * optional arg and it contains UTF-8 characters. Otherwise rtrim will * work normally on a UTF-8 string * * @param string $str The string to be trimmed * @param string $charlist The optional charlist of additional characters to trim * * @return string The trimmed string * * @see http://www.php.net/rtrim * @since 1.0 */ public static function rtrim($str, $charlist = false) { if (empty($charlist) && $charlist !== false) { return $str; } require_once __DIR__ . '/phputf8/trim.php'; if ($charlist === false) { return utf8_rtrim($str); } return utf8_rtrim($str, $charlist); } /** * UTF-8 aware replacement for trim() * Strip whitespace (or other characters) from the beginning and end of a string * Note: you only need to use this if you are supplying the charlist * optional arg and it contains UTF-8 characters. Otherwise trim will * work normally on a UTF-8 string * * @param string $str The string to be trimmed * @param string $charlist The optional charlist of additional characters to trim * * @return string The trimmed string * * @see http://www.php.net/trim * @since 1.0 */ public static function trim($str, $charlist = false) { if (empty($charlist) && $charlist !== false) { return $str; } require_once __DIR__ . '/phputf8/trim.php'; if ($charlist === false) { return utf8_trim($str); } return utf8_trim($str, $charlist); } /** * UTF-8 aware alternative to ucfirst * Make a string's first character uppercase or all words' first character uppercase * * @param string $str String to be processed * @param string $delimiter The words delimiter (null means do not split the string) * @param string $newDelimiter The new words delimiter (null means equal to $delimiter) * * @return string If $delimiter is null, return the string with first character as upper case (if applicable) * else consider the string of words separated by the delimiter, apply the ucfirst to each words * and return the string with the new delimiter * * @see http://www.php.net/ucfirst * @since 1.0 */ public static function ucfirst($str, $delimiter = null, $newDelimiter = null) { require_once __DIR__ . '/phputf8/ucfirst.php'; if ($delimiter === null) { return utf8_ucfirst($str); } if ($newDelimiter === null) { $newDelimiter = $delimiter; } return implode($newDelimiter, array_map('utf8_ucfirst', explode($delimiter, $str))); } /** * UTF-8 aware alternative to ucwords * Uppercase the first character of each word in a string * * @param string $str String to be processed * * @return string String with first char of each word uppercase * * @see http://www.php.net/ucwords * @since 1.0 */ public static function ucwords($str) { require_once __DIR__ . '/phputf8/ucwords.php'; return utf8_ucwords($str); } /** * Transcode a string. * * @param string $source The string to transcode. * @param string $from_encoding The source encoding. * @param string $to_encoding The target encoding. * * @return mixed The transcoded string, or null if the source was not a string. * * @link https://bugs.php.net/bug.php?id=48147 * * @since 1.0 */ public static function transcode($source, $from_encoding, $to_encoding) { if (is_string($source)) { switch (ICONV_IMPL) { case 'glibc': return @iconv($from_encoding, $to_encoding . '//TRANSLIT,IGNORE', $source); case 'libiconv': default: return iconv($from_encoding, $to_encoding . '//IGNORE//TRANSLIT', $source); } } return null; } /** * Tests a string as to whether it's valid UTF-8 and supported by the Unicode standard. * * Note: this function has been modified to simple return true or false. * * @param string $str UTF-8 encoded string. * * @return boolean true if valid * * @author <hsivonen@iki.fi> * @see http://hsivonen.iki.fi/php-utf8/ * @see compliant * @since 1.0 */ public static function valid($str) { require_once __DIR__ . '/phputf8/utils/validation.php'; return utf8_is_valid($str); } /** * Tests whether a string complies as UTF-8. This will be much * faster than utf8_is_valid but will pass five and six octet * UTF-8 sequences, which are not supported by Unicode and * so cannot be displayed correctly in a browser. In other words * it is not as strict as utf8_is_valid but it's faster. If you use * it to validate user input, you place yourself at the risk that * attackers will be able to inject 5 and 6 byte sequences (which * may or may not be a significant risk, depending on what you are * are doing) * * @param string $str UTF-8 string to check * * @return boolean TRUE if string is valid UTF-8 * * @see valid * @see http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php#54805 * @since 1.0 */ public static function compliant($str) { require_once __DIR__ . '/phputf8/utils/validation.php'; return utf8_compliant($str); } /** * Converts Unicode sequences to UTF-8 string * * @param string $str Unicode string to convert * * @return string UTF-8 string * * @since 1.2.0 */ public static function unicode_to_utf8($str) { if (extension_loaded('mbstring')) { return preg_replace_callback( '/\\\\u([0-9a-fA-F]{4})/', function ($match) { return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); }, $str ); } return $str; } /** * Converts Unicode sequences to UTF-16 string * * @param string $str Unicode string to convert * * @return string UTF-16 string * * @since 1.2.0 */ public static function unicode_to_utf16($str) { if (extension_loaded('mbstring')) { return preg_replace_callback( '/\\\\u([0-9a-fA-F]{4})/', function ($match) { return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UTF-16BE'); }, $str ); } return $str; } } PK���\�P�E�E+libraries/vendor/joomla/application/LICENSEnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\�ud�._._Elibraries/vendor/joomla/application/src/AbstractDaemonApplication.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application; use Joomla\Filesystem\Folder; use Joomla\Registry\Registry; use Joomla\Input\Cli; use Psr\Log\LoggerAwareInterface; /** * Class to turn Cli applications into daemons. It requires CLI and PCNTL support built into PHP. * * @see http://www.php.net/manual/en/book.pcntl.php * @see http://php.net/manual/en/features.commandline.php * @since 1.0 */ abstract class AbstractDaemonApplication extends AbstractCliApplication implements LoggerAwareInterface { /** * @var array The available POSIX signals to be caught by default. * @see http://php.net/manual/pcntl.constants.php * @since 1.0 */ protected static $signals = array( 'SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGIOT', 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGALRM', 'SIGTERM', 'SIGSTKFLT', 'SIGCLD', 'SIGCHLD', 'SIGCONT', 'SIGTSTP', 'SIGTTIN', 'SIGTTOU', 'SIGURG', 'SIGXCPU', 'SIGXFSZ', 'SIGVTALRM', 'SIGPROF', 'SIGWINCH', 'SIGPOLL', 'SIGIO', 'SIGPWR', 'SIGSYS', 'SIGBABY', 'SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK' ); /** * @var boolean True if the daemon is in the process of exiting. * @since 1.0 */ protected $exiting = false; /** * @var integer The parent process id. * @since 1.0 */ protected $parentId = 0; /** * @var integer The process id of the daemon. * @since 1.0 */ protected $processId = 0; /** * @var boolean True if the daemon is currently running. * @since 1.0 */ protected $running = false; /** * Class constructor. * * @param Cli $input An optional argument to provide dependency injection for the application's * input object. If the argument is a InputCli object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * * @since 1.0 * @throws \RuntimeException */ public function __construct(Cli $input = null, Registry $config = null) { // Verify that the process control extension for PHP is available. // @codeCoverageIgnoreStart if (!defined('SIGHUP')) { $this->getLogger()->error('The PCNTL extension for PHP is not available.'); throw new \RuntimeException('The PCNTL extension for PHP is not available.'); } // Verify that POSIX support for PHP is available. if (!function_exists('posix_getpid')) { $this->getLogger()->error('The POSIX extension for PHP is not available.'); throw new \RuntimeException('The POSIX extension for PHP is not available.'); } // @codeCoverageIgnoreEnd // Call the parent constructor. parent::__construct($input, $config); // Set some system limits. @set_time_limit($this->config->get('max_execution_time', 0)); if ($this->config->get('max_memory_limit') !== null) { ini_set('memory_limit', $this->config->get('max_memory_limit', '256M')); } // Flush content immediately. ob_implicit_flush(); } /** * Method to handle POSIX signals. * * @param integer $signal The received POSIX signal. * * @return void * * @since 1.0 * @see pcntl_signal() * @throws \RuntimeException */ public function signal($signal) { // Log all signals sent to the daemon. $this->getLogger()->debug('Received signal: ' . $signal); // Let's make sure we have an application instance. if (!is_subclass_of($this, __CLASS__)) { $this->getLogger()->emergency('Cannot find the application instance.'); throw new \RuntimeException('Cannot find the application instance.'); } // @event onReceiveSignal switch ($signal) { case SIGINT: case SIGTERM: // Handle shutdown tasks if ($this->running && $this->isActive()) { $this->shutdown(); } else { $this->close(); } break; case SIGHUP: // Handle restart tasks if ($this->running && $this->isActive()) { $this->shutdown(true); } else { $this->close(); } break; case SIGCHLD: // A child process has died while ($this->pcntlWait($signal, WNOHANG || WUNTRACED) > 0) { usleep(1000); } break; case SIGCLD: while ($this->pcntlWait($signal, WNOHANG) > 0) { $signal = $this->pcntlChildExitStatus($signal); } break; default: break; } } /** * Check to see if the daemon is active. This does not assume that $this daemon is active, but * only if an instance of the application is active as a daemon. * * @return boolean True if daemon is active. * * @since 1.0 */ public function isActive() { // Get the process id file location for the application. $pidFile = $this->config->get('application_pid_file'); // If the process id file doesn't exist then the daemon is obviously not running. if (!is_file($pidFile)) { return false; } // Read the contents of the process id file as an integer. $fp = fopen($pidFile, 'r'); $pid = fread($fp, filesize($pidFile)); $pid = (int) $pid; fclose($fp); // Check to make sure that the process id exists as a positive integer. if (!$pid) { return false; } // Check to make sure the process is active by pinging it and ensure it responds. if (!posix_kill($pid, 0)) { // No response so remove the process id file and log the situation. @ unlink($pidFile); $this->getLogger()->warning('The process found based on PID file was unresponsive.'); return false; } return true; } /** * Load an object or array into the application configuration object. * * @param mixed $data Either an array or object to be loaded into the configuration object. * * @return AbstractDaemonApplication Instance of $this to allow chaining. * * @since 1.0 */ public function loadConfiguration($data) { /* * Setup some application metadata options. This is useful if we ever want to write out startup scripts * or just have some sort of information available to share about things. */ // The application author name. This string is used in generating startup scripts and has // a maximum of 50 characters. $tmp = (string) $this->config->get('author_name', 'Joomla Framework'); $this->config->set('author_name', (strlen($tmp) > 50) ? substr($tmp, 0, 50) : $tmp); // The application author email. This string is used in generating startup scripts. $tmp = (string) $this->config->get('author_email', 'admin@joomla.org'); $this->config->set('author_email', filter_var($tmp, FILTER_VALIDATE_EMAIL)); // The application name. This string is used in generating startup scripts. $tmp = (string) $this->config->get('application_name', 'JApplicationDaemon'); $this->config->set('application_name', (string) preg_replace('/[^A-Z0-9_-]/i', '', $tmp)); // The application description. This string is used in generating startup scripts. $tmp = (string) $this->config->get('application_description', 'A generic Joomla Framework application.'); $this->config->set('application_description', filter_var($tmp, FILTER_SANITIZE_STRING)); /* * Setup the application path options. This defines the default executable name, executable directory, * and also the path to the daemon process id file. */ // The application executable daemon. This string is used in generating startup scripts. $tmp = (string) $this->config->get('application_executable', basename($this->input->executable)); $this->config->set('application_executable', $tmp); // The home directory of the daemon. $tmp = (string) $this->config->get('application_directory', dirname($this->input->executable)); $this->config->set('application_directory', $tmp); // The pid file location. This defaults to a path inside the /tmp directory. $name = $this->config->get('application_name'); $tmp = (string) $this->config->get('application_pid_file', strtolower('/tmp/' . $name . '/' . $name . '.pid')); $this->config->set('application_pid_file', $tmp); /* * Setup the application identity options. It is important to remember if the default of 0 is set for * either UID or GID then changing that setting will not be attempted as there is no real way to "change" * the identity of a process from some user to root. */ // The user id under which to run the daemon. $tmp = (int) $this->config->get('application_uid', 0); $options = array('options' => array('min_range' => 0, 'max_range' => 65000)); $this->config->set('application_uid', filter_var($tmp, FILTER_VALIDATE_INT, $options)); // The group id under which to run the daemon. $tmp = (int) $this->config->get('application_gid', 0); $options = array('options' => array('min_range' => 0, 'max_range' => 65000)); $this->config->set('application_gid', filter_var($tmp, FILTER_VALIDATE_INT, $options)); // Option to kill the daemon if it cannot switch to the chosen identity. $tmp = (bool) $this->config->get('application_require_identity', 1); $this->config->set('application_require_identity', $tmp); /* * Setup the application runtime options. By default our execution time limit is infinite obviously * because a daemon should be constantly running unless told otherwise. The default limit for memory * usage is 128M, which admittedly is a little high, but remember it is a "limit" and PHP's memory * management leaves a bit to be desired :-) */ // The maximum execution time of the application in seconds. Zero is infinite. $tmp = $this->config->get('max_execution_time'); if ($tmp !== null) { $this->config->set('max_execution_time', (int) $tmp); } // The maximum amount of memory the application can use. $tmp = $this->config->get('max_memory_limit', '256M'); if ($tmp !== null) { $this->config->set('max_memory_limit', (string) $tmp); } return $this; } /** * Execute the daemon. * * @return void * * @since 1.0 */ public function execute() { // @event onBeforeExecute // Enable basic garbage collection. gc_enable(); $this->getLogger()->info('Starting ' . $this->name); // Set off the process for becoming a daemon. if ($this->daemonize()) { // Declare ticks to start signal monitoring. When you declare ticks, PCNTL will monitor // incoming signals after each tick and call the relevant signal handler automatically. declare (ticks = 1); // Start the main execution loop. while (true) { // Perform basic garbage collection. $this->gc(); // Don't completely overload the CPU. usleep(1000); // Execute the main application logic. $this->doExecute(); } } else // We were not able to daemonize the application so log the failure and die gracefully. { $this->getLogger()->info('Starting ' . $this->name . ' failed'); } // @event onAfterExecute } /** * Restart daemon process. * * @return void * * @codeCoverageIgnore * @since 1.0 */ public function restart() { $this->getLogger()->info('Stopping ' . $this->name); $this->shutdown(true); } /** * Stop daemon process. * * @return void * * @codeCoverageIgnore * @since 1.0 */ public function stop() { $this->getLogger()->info('Stopping ' . $this->name); $this->shutdown(); } /** * Method to change the identity of the daemon process and resources. * * @return boolean True if identity successfully changed * * @since 1.0 * @see posix_setuid() */ protected function changeIdentity() { // Get the group and user ids to set for the daemon. $uid = (int) $this->config->get('application_uid', 0); $gid = (int) $this->config->get('application_gid', 0); // Get the application process id file path. $file = $this->config->get('application_pid_file'); // Change the user id for the process id file if necessary. if ($uid && (fileowner($file) != $uid) && (!@ chown($file, $uid))) { $this->getLogger()->error('Unable to change user ownership of the process id file.'); return false; } // Change the group id for the process id file if necessary. if ($gid && (filegroup($file) != $gid) && (!@ chgrp($file, $gid))) { $this->getLogger()->error('Unable to change group ownership of the process id file.'); return false; } // Set the correct home directory for the process. if ($uid && ($info = posix_getpwuid($uid)) && is_dir($info['dir'])) { system('export HOME="' . $info['dir'] . '"'); } // Change the user id for the process necessary. if ($uid && (posix_getuid($file) != $uid) && (!@ posix_setuid($uid))) { $this->getLogger()->error('Unable to change user ownership of the proccess.'); return false; } // Change the group id for the process necessary. if ($gid && (posix_getgid($file) != $gid) && (!@ posix_setgid($gid))) { $this->getLogger()->error('Unable to change group ownership of the proccess.'); return false; } // Get the user and group information based on uid and gid. $user = posix_getpwuid($uid); $group = posix_getgrgid($gid); $this->getLogger()->info('Changed daemon identity to ' . $user['name'] . ':' . $group['name']); return true; } /** * Method to put the application into the background. * * @return boolean * * @since 1.0 * @throws \RuntimeException */ protected function daemonize() { // Is there already an active daemon running? if ($this->isActive()) { $this->getLogger()->emergency($this->name . ' daemon is still running. Exiting the application.'); return false; } // Reset Process Information $this->safeMode = !!@ ini_get('safe_mode'); $this->processId = 0; $this->running = false; // Detach process! try { // Check if we should run in the foreground. if (!$this->input->get('f')) { // Detach from the terminal. $this->detach(); } else { // Setup running values. $this->exiting = false; $this->running = true; // Set the process id. $this->processId = (int) posix_getpid(); $this->parentId = $this->processId; } } catch (\RuntimeException $e) { $this->getLogger()->emergency('Unable to fork.'); return false; } // Verify the process id is valid. if ($this->processId < 1) { $this->getLogger()->emergency('The process id is invalid; the fork failed.'); return false; } // Clear the umask. @ umask(0); // Write out the process id file for concurrency management. if (!$this->writeProcessIdFile()) { $this->getLogger()->emergency('Unable to write the pid file at: ' . $this->config->get('application_pid_file')); return false; } // Attempt to change the identity of user running the process. if (!$this->changeIdentity()) { // If the identity change was required then we need to return false. if ($this->config->get('application_require_identity')) { $this->getLogger()->critical('Unable to change process owner.'); return false; } else { $this->getLogger()->warning('Unable to change process owner.'); } } // Setup the signal handlers for the daemon. if (!$this->setupSignalHandlers()) { return false; } // Change the current working directory to the application working directory. @ chdir($this->config->get('application_directory')); return true; } /** * This is truly where the magic happens. This is where we fork the process and kill the parent * process, which is essentially what turns the application into a daemon. * * @return void * * @since 1.0 * @throws \RuntimeException */ protected function detach() { $this->getLogger()->debug('Detaching the ' . $this->name . ' daemon.'); // Attempt to fork the process. $pid = $this->fork(); // If the pid is positive then we successfully forked, and can close this application. if ($pid) { // Add the log entry for debugging purposes and exit gracefully. $this->getLogger()->debug('Ending ' . $this->name . ' parent process'); $this->close(); } else // We are in the forked child process. { // Setup some protected values. $this->exiting = false; $this->running = true; // Set the parent to self. $this->parentId = $this->processId; } } /** * Method to fork the process. * * @return integer The child process id to the parent process, zero to the child process. * * @since 1.0 * @throws \RuntimeException */ protected function fork() { // Attempt to fork the process. $pid = $this->pcntlFork(); // If the fork failed, throw an exception. if ($pid === -1) { throw new \RuntimeException('The process could not be forked.'); } elseif ($pid === 0) // Update the process id for the child. { $this->processId = (int) posix_getpid(); } else // Log the fork in the parent. { // Log the fork. $this->getLogger()->debug('Process forked ' . $pid); } // Trigger the onFork event. $this->postFork(); return $pid; } /** * Method to perform basic garbage collection and memory management in the sense of clearing the * stat cache. We will probably call this method pretty regularly in our main loop. * * @return void * * @codeCoverageIgnore * @since 1.0 */ protected function gc() { // Perform generic garbage collection. gc_collect_cycles(); // Clear the stat cache so it doesn't blow up memory. clearstatcache(); } /** * Method to attach the AbstractDaemonApplication signal handler to the known signals. Applications * can override these handlers by using the pcntl_signal() function and attaching a different * callback method. * * @return boolean * * @since 1.0 * @see pcntl_signal() */ protected function setupSignalHandlers() { // We add the error suppression for the loop because on some platforms some constants are not defined. foreach (self::$signals as $signal) { // Ignore signals that are not defined. if (!defined($signal) || !is_int(constant($signal)) || (constant($signal) === 0)) { // Define the signal to avoid notices. $this->getLogger()->debug('Signal "' . $signal . '" not defined. Defining it as null.'); define($signal, null); // Don't listen for signal. continue; } // Attach the signal handler for the signal. if (!$this->pcntlSignal(constant($signal), array($this, 'signal'))) { $this->getLogger()->emergency(sprintf('Unable to reroute signal handler: %s', $signal)); return false; } } return true; } /** * Method to shut down the daemon and optionally restart it. * * @param boolean $restart True to restart the daemon on exit. * * @return void * * @since 1.0 */ protected function shutdown($restart = false) { // If we are already exiting, chill. if ($this->exiting) { return; } else // If not, now we are. { $this->exiting = true; } // If we aren't already daemonized then just kill the application. if (!$this->running && !$this->isActive()) { $this->getLogger()->info('Process was not daemonized yet, just halting current process'); $this->close(); } // Only read the pid for the parent file. if ($this->parentId == $this->processId) { // Read the contents of the process id file as an integer. $fp = fopen($this->config->get('application_pid_file'), 'r'); $pid = fread($fp, filesize($this->config->get('application_pid_file'))); $pid = (int) $pid; fclose($fp); // Remove the process id file. @ unlink($this->config->get('application_pid_file')); // If we are supposed to restart the daemon we need to execute the same command. if ($restart) { $this->close(exec(implode(' ', $GLOBALS['argv']) . ' > /dev/null &')); } else // If we are not supposed to restart the daemon let's just kill -9. { passthru('kill -9 ' . $pid); $this->close(); } } } /** * Method to write the process id file out to disk. * * @return boolean * * @since 1.0 */ protected function writeProcessIdFile() { // Verify the process id is valid. if ($this->processId < 1) { $this->getLogger()->emergency('The process id is invalid.'); return false; } // Get the application process id file path. $file = $this->config->get('application_pid_file'); if (empty($file)) { $this->getLogger()->error('The process id file path is empty.'); return false; } // Make sure that the folder where we are writing the process id file exists. $folder = dirname($file); if (!is_dir($folder) && !@ mkdir($folder, $this->get('folder_permission', 0755))) { $this->getLogger()->error('Unable to create directory: ' . $folder); return false; } // Write the process id file out to disk. if (!file_put_contents($file, $this->processId)) { $this->getLogger()->error('Unable to write proccess id file: ' . $file); return false; } // Make sure the permissions for the proccess id file are accurate. if (!chmod($file, $this->get('file_permission', 0644))) { $this->getLogger()->error('Unable to adjust permissions for the proccess id file: ' . $file); return false; } return true; } /** * Method to handle post-fork triggering of the onFork event. * * @return void * * @since 1.0 */ protected function postFork() { // @event onFork } /** * Method to return the exit code of a terminated child process. * * @param integer $status The status parameter is the status parameter supplied to a successful call to pcntl_waitpid(). * * @return integer The child process exit code. * * @codeCoverageIgnore * @see pcntl_wexitstatus() * @since 1.0 */ protected function pcntlChildExitStatus($status) { return pcntl_wexitstatus($status); } /** * Method to return the exit code of a terminated child process. * * @return integer On success, the PID of the child process is returned in the parent's thread * of execution, and a 0 is returned in the child's thread of execution. On * failure, a -1 will be returned in the parent's context, no child process * will be created, and a PHP error is raised. * * @codeCoverageIgnore * @see pcntl_fork() * @since 1.0 */ protected function pcntlFork() { return pcntl_fork(); } /** * Method to install a signal handler. * * @param integer $signal The signal number. * @param callable $handler The signal handler which may be the name of a user created function, * or method, or either of the two global constants SIG_IGN or SIG_DFL. * @param boolean $restart Specifies whether system call restarting should be used when this * signal arrives. * * @return boolean True on success. * * @codeCoverageIgnore * @see pcntl_signal() * @since 1.0 */ protected function pcntlSignal($signal , $handler, $restart = true) { return pcntl_signal($signal, $handler, $restart); } /** * Method to wait on or return the status of a forked child. * * @param integer &$status Status information. * @param integer $options If wait3 is available on your system (mostly BSD-style systems), * you can provide the optional options parameter. * * @return integer The process ID of the child which exited, -1 on error or zero if WNOHANG * was provided as an option (on wait3-available systems) and no child was available. * * @codeCoverageIgnore * @see pcntl_wait() * @since 1.0 */ protected function pcntlWait(&$status, $options = 0) { return pcntl_wait($status, $options); } } PK���\&l����:libraries/vendor/joomla/application/src/Cli/ColorStyle.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application\Cli; /** * Class ColorStyle * * @since 1.0 */ final class ColorStyle { /** * Known colors * * @var array * @since 1.0 */ private static $knownColors = array( 'black' => 0, 'red' => 1, 'green' => 2, 'yellow' => 3, 'blue' => 4, 'magenta' => 5, 'cyan' => 6, 'white' => 7 ); /** * Known styles * * @var array * @since 1.0 */ private static $knownOptions = array( 'bold' => 1, 'underscore' => 4, 'blink' => 5, 'reverse' => 7, ); /** * Foreground base value * * @var integer * @since 1.0 */ private static $fgBase = 30; /** * Background base value * * @var integer * @since 1.0 */ private static $bgBase = 40; /** * Foreground color * * @var integer * @since 1.0 */ private $fgColor = 0; /** * Background color * * @var integer * @since 1.0 */ private $bgColor = 0; /** * Array of style options * * @var array * @since 1.0 */ private $options = array(); /** * Constructor * * @param string $fg Foreground color. * @param string $bg Background color. * @param array $options Style options. * * @since 1.0 * @throws \InvalidArgumentException */ public function __construct($fg = '', $bg = '', $options = array()) { if ($fg) { if (false == array_key_exists($fg, static::$knownColors)) { throw new \InvalidArgumentException( sprintf('Invalid foreground color "%1$s" [%2$s]', $fg, implode(', ', $this->getKnownColors()) ) ); } $this->fgColor = static::$fgBase + static::$knownColors[$fg]; } if ($bg) { if (false == array_key_exists($bg, static::$knownColors)) { throw new \InvalidArgumentException( sprintf('Invalid background color "%1$s" [%2$s]', $bg, implode(', ', $this->getKnownColors()) ) ); } $this->bgColor = static::$bgBase + static::$knownColors[$bg]; } foreach ($options as $option) { if (false == array_key_exists($option, static::$knownOptions)) { throw new \InvalidArgumentException( sprintf('Invalid option "%1$s" [%2$s]', $option, implode(', ', $this->getKnownOptions()) ) ); } $this->options[] = $option; } } /** * Convert to a string. * * @return string * * @since 1.0 */ public function __toString() { return $this->getStyle(); } /** * Create a color style from a parameter string. * * Example: fg=red;bg=blue;options=bold,blink * * @param string $string The parameter string. * * @return ColorStyle Instance of $this to allow chaining. * * @since 1.0 * @throws \RuntimeException */ public static function fromString($string) { $fg = ''; $bg = ''; $options = array(); $parts = explode(';', $string); foreach ($parts as $part) { $subParts = explode('=', $part); if (count($subParts) < 2) { continue; } switch ($subParts[0]) { case 'fg': $fg = $subParts[1]; break; case 'bg': $bg = $subParts[1]; break; case 'options': $options = explode(',', $subParts[1]); break; default: throw new \RuntimeException('Invalid option'); break; } } return new self($fg, $bg, $options); } /** * Get the translated color code. * * @return string * * @since 1.0 */ public function getStyle() { $values = array(); if ($this->fgColor) { $values[] = $this->fgColor; } if ($this->bgColor) { $values[] = $this->bgColor; } foreach ($this->options as $option) { $values[] = static::$knownOptions[$option]; } return implode(';', $values); } /** * Get the known colors. * * @return string * * @since 1.0 */ public function getKnownColors() { return array_keys(static::$knownColors); } /** * Get the known options. * * @return array * * @since 1.0 */ public function getKnownOptions() { return array_keys(static::$knownOptions); } } PK���\� >libraries/vendor/joomla/application/src/Cli/ColorProcessor.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application\Cli; use \Joomla\Application\Cli\Output\Processor\ColorProcessor as RealColorProcessor; /** * Class ColorProcessor. * * @since 1.0 * @deprecated 2.0 Use \Joomla\Application\Cli\Output\Processor\ColorProcessor */ class ColorProcessor extends RealColorProcessor { } PK���\Mw�]##Olibraries/vendor/joomla/application/src/Cli/Output/Processor/ColorProcessor.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application\Cli\Output\Processor; use Joomla\Application\Cli\ColorStyle; use Joomla\Application\Cli\Output\Stdout; /** * Class ColorProcessor. * * @since 1.0 */ class ColorProcessor implements ProcessorInterface { /** * Flag to remove color codes from the output * * @var boolean * @since 1.0 */ public $noColors = false; /** * Regex to match tags * * @var string * @since 1.0 */ protected $tagFilter = '/<([a-z=;]+)>(.*?)<\/\\1>/s'; /** * Regex used for removing color codes * * @var string * @since 1.0 */ protected static $stripFilter = '/<[\/]?[a-z=;]+>/'; /** * Array of ColorStyle objects * * @var array * @since 1.0 */ protected $styles = array(); /** * Class constructor * * @param boolean $noColors Defines non-colored mode on construct * * @since 1.1.0 */ public function __construct($noColors = null) { if (is_null($noColors)) { /* * By default windows cmd.exe and PowerShell does not support ANSI-colored output * if the variable is not set explicitly colors should be disabled on Windows */ $noColors = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); } $this->noColors = $noColors; $this->addPredefinedStyles(); } /** * Add a style. * * @param string $name The style name. * @param ColorStyle $style The color style. * * @return ColorProcessor Instance of $this to allow chaining. * * @since 1.0 */ public function addStyle($name, ColorStyle $style) { $this->styles[$name] = $style; return $this; } /** * Strip color tags from a string. * * @param string $string The string. * * @return string * * @since 1.0 */ public static function stripColors($string) { return preg_replace(static::$stripFilter, '', $string); } /** * Process a string. * * @param string $string The string to process. * * @return string * * @since 1.0 */ public function process($string) { preg_match_all($this->tagFilter, $string, $matches); if (!$matches) { return $string; } foreach ($matches[0] as $i => $m) { if (array_key_exists($matches[1][$i], $this->styles)) { $string = $this->replaceColors($string, $matches[1][$i], $matches[2][$i], $this->styles[$matches[1][$i]]); } // Custom format elseif (strpos($matches[1][$i], '=')) { $string = $this->replaceColors($string, $matches[1][$i], $matches[2][$i], ColorStyle::fromString($matches[1][$i])); } } return $string; } /** * Replace color tags in a string. * * @param string $text The original text. * @param string $tag The matched tag. * @param string $match The match. * @param ColorStyle $style The color style to apply. * * @return mixed * * @since 1.0 */ private function replaceColors($text, $tag, $match, Colorstyle $style) { $replace = $this->noColors ? $match : "\033[" . $style . "m" . $match . "\033[0m"; return str_replace('<' . $tag . '>' . $match . '</' . $tag . '>', $replace, $text); } /** * Adds predefined color styles to the ColorProcessor object * * @return Stdout Instance of $this to allow chaining. * * @since 1.0 */ private function addPredefinedStyles() { $this->addStyle( 'info', new ColorStyle('green', '', array('bold')) ); $this->addStyle( 'comment', new ColorStyle('yellow', '', array('bold')) ); $this->addStyle( 'question', new ColorStyle('black', 'cyan') ); $this->addStyle( 'error', new ColorStyle('white', 'red') ); return $this; } } PK���\�̗�::Slibraries/vendor/joomla/application/src/Cli/Output/Processor/ProcessorInterface.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application\Cli\Output\Processor; /** * Class ProcessorInterface. * * @since 1.1.0 */ interface ProcessorInterface { /** * Process the provided output into a string. * * @param string $output The string to process. * * @return string * * @since 1.1.0 */ public function process($output); } PK���\�\�+MM=libraries/vendor/joomla/application/src/Cli/Output/Stdout.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application\Cli\Output; use Joomla\Application\Cli\CliOutput; /** * Class Stdout. * * @since 1.0 */ class Stdout extends CliOutput { /** * Write a string to standard output * * @param string $text The text to display. * @param boolean $nl True (default) to append a new line at the end of the output string. * * @return Stdout Instance of $this to allow chaining. * * @codeCoverageIgnore * @since 1.0 */ public function out($text = '', $nl = true) { fwrite(STDOUT, $this->getProcessor()->process($text) . ($nl ? "\n" : null)); return $this; } } PK���\�p:libraries/vendor/joomla/application/src/Cli/Output/Xml.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application\Cli\Output; use Joomla\Application\Cli\CliOutput; /** * Class Xml. * * @since 1.0 */ class Xml extends CliOutput { /** * Write a string to standard output. * * @param string $text The text to display. * @param boolean $nl True (default) to append a new line at the end of the output string. * * @return void * * @since 1.0 * @throws \RuntimeException * @codeCoverageIgnore */ public function out($text = '', $nl = true) { fwrite(STDOUT, $text . ($nl ? "\n" : null)); } } PK���\Z�����9libraries/vendor/joomla/application/src/Cli/CliOutput.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application\Cli; use Joomla\Application\Cli\Output\Processor\ProcessorInterface; /** * Class CliOutput * * @since 1.0 */ abstract class CliOutput { /** * Color processing object * * @var ProcessorInterface * @since 1.0 */ protected $processor; /** * Constructor * * @param ProcessorInterface $processor The output processor. * * @since 1.1.2 */ public function __construct(ProcessorInterface $processor = null) { $this->setProcessor(($processor instanceof ProcessorInterface) ? $processor : new Output\Processor\ColorProcessor); } /** * Set a processor * * @param ProcessorInterface $processor The output processor. * * @return Stdout Instance of $this to allow chaining. * * @since 1.0 */ public function setProcessor(ProcessorInterface $processor) { $this->processor = $processor; return $this; } /** * Get a processor * * @return ProcessorInterface * * @since 1.0 * @throws \RuntimeException */ public function getProcessor() { if ($this->processor) { return $this->processor; } throw new \RuntimeException('A ProcessorInterface object has not been set.'); } /** * Write a string to an output handler. * * @param string $text The text to display. * @param boolean $nl True (default) to append a new line at the end of the output string. * * @return void * * @since 1.0 * @codeCoverageIgnore */ abstract public function out($text = '', $nl = true); } PK���\���:�:9libraries/vendor/joomla/application/src/Web/WebClient.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application\Web; /** * Class to model a Web Client. * * @property-read integer $platform The detected platform on which the web client runs. * @property-read boolean $mobile True if the web client is a mobile device. * @property-read integer $engine The detected rendering engine used by the web client. * @property-read integer $browser The detected browser used by the web client. * @property-read string $browserVersion The detected browser version used by the web client. * @property-read array $languages The priority order detected accepted languages for the client. * @property-read array $encodings The priority order detected accepted encodings for the client. * @property-read string $userAgent The web client's user agent string. * @property-read string $acceptEncoding The web client's accepted encoding string. * @property-read string $acceptLanguage The web client's accepted languages string. * @property-read array $detection An array of flags determining whether or not a detection routine has been run. * @property-read boolean $robot True if the web client is a robot * @property-read array $headers An array of all headers sent by client * * @since 1.0 */ class WebClient { const WINDOWS = 1; const WINDOWS_PHONE = 2; const WINDOWS_CE = 3; const IPHONE = 4; const IPAD = 5; const IPOD = 6; const MAC = 7; const BLACKBERRY = 8; const ANDROID = 9; const LINUX = 10; const TRIDENT = 11; const WEBKIT = 12; const GECKO = 13; const PRESTO = 14; const KHTML = 15; const AMAYA = 16; const IE = 17; const FIREFOX = 18; const CHROME = 19; const SAFARI = 20; const OPERA = 21; const ANDROIDTABLET = 22; /** * @var integer The detected platform on which the web client runs. * @since 1.0 */ protected $platform; /** * @var boolean True if the web client is a mobile device. * @since 1.0 */ protected $mobile = false; /** * @var integer The detected rendering engine used by the web client. * @since 1.0 */ protected $engine; /** * @var integer The detected browser used by the web client. * @since 1.0 */ protected $browser; /** * @var string The detected browser version used by the web client. * @since 1.0 */ protected $browserVersion; /** * @var array The priority order detected accepted languages for the client. * @since 1.0 */ protected $languages = array(); /** * @var array The priority order detected accepted encodings for the client. * @since 1.0 */ protected $encodings = array(); /** * @var string The web client's user agent string. * @since 1.0 */ protected $userAgent; /** * @var string The web client's accepted encoding string. * @since 1.0 */ protected $acceptEncoding; /** * @var string The web client's accepted languages string. * @since 1.0 */ protected $acceptLanguage; /** * @var boolean True if the web client is a robot. * @since 1.0 */ protected $robot = false; /** * @var array An array of flags determining whether or not a detection routine has been run. * @since 1.0 */ protected $detection = array(); /** * @var array An array of headers sent by client * @since 1.3.0 */ protected $headers; /** * Class constructor. * * @param string $userAgent The optional user-agent string to parse. * @param string $acceptEncoding The optional client accept encoding string to parse. * @param string $acceptLanguage The optional client accept language string to parse. * * @since 1.0 */ public function __construct($userAgent = null, $acceptEncoding = null, $acceptLanguage = null) { // If no explicit user agent string was given attempt to use the implicit one from server environment. if (empty($userAgent) && isset($_SERVER['HTTP_USER_AGENT'])) { $this->userAgent = $_SERVER['HTTP_USER_AGENT']; } else { $this->userAgent = $userAgent; } // If no explicit acceptable encoding string was given attempt to use the implicit one from server environment. if (empty($acceptEncoding) && isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { $this->acceptEncoding = $_SERVER['HTTP_ACCEPT_ENCODING']; } else { $this->acceptEncoding = $acceptEncoding; } // If no explicit acceptable languages string was given attempt to use the implicit one from server environment. if (empty($acceptLanguage) && isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $this->acceptLanguage = $_SERVER['HTTP_ACCEPT_LANGUAGE']; } else { $this->acceptLanguage = $acceptLanguage; } } /** * Magic method to get an object property's value by name. * * @param string $name Name of the property for which to return a value. * * @return mixed The requested value if it exists. * * @since 1.0 */ public function __get($name) { switch ($name) { case 'mobile': case 'platform': if (empty($this->detection['platform'])) { $this->detectPlatform($this->userAgent); } break; case 'engine': if (empty($this->detection['engine'])) { $this->detectEngine($this->userAgent); } break; case 'browser': case 'browserVersion': if (empty($this->detection['browser'])) { $this->detectBrowser($this->userAgent); } break; case 'languages': if (empty($this->detection['acceptLanguage'])) { $this->detectLanguage($this->acceptLanguage); } break; case 'encodings': if (empty($this->detection['acceptEncoding'])) { $this->detectEncoding($this->acceptEncoding); } break; case 'robot': if (empty($this->detection['robot'])) { $this->detectRobot($this->userAgent); } break; case 'headers': if (empty($this->detection['headers'])) { $this->detectHeaders(); } break; } // Return the property if it exists. if (isset($this->$name)) { return $this->$name; } } /** * Detects the client browser and version in a user agent string. * * @param string $userAgent The user-agent string to parse. * * @return void * * @since 1.0 */ protected function detectBrowser($userAgent) { // Attempt to detect the browser type. Obviously we are only worried about major browsers. if ((stripos($userAgent, 'MSIE') !== false) && (stripos($userAgent, 'Opera') === false)) { $this->browser = self::IE; $patternBrowser = 'MSIE'; } elseif ((stripos($userAgent, 'Firefox') !== false) && (stripos($userAgent, 'like Firefox') === false)) { $this->browser = self::FIREFOX; $patternBrowser = 'Firefox'; } elseif (stripos($userAgent, 'Chrome') !== false) { $this->browser = self::CHROME; $patternBrowser = 'Chrome'; } elseif (stripos($userAgent, 'Safari') !== false) { $this->browser = self::SAFARI; $patternBrowser = 'Safari'; } elseif (stripos($userAgent, 'Opera') !== false) { $this->browser = self::OPERA; $patternBrowser = 'Opera'; } // If we detected a known browser let's attempt to determine the version. if ($this->browser) { // Build the REGEX pattern to match the browser version string within the user agent string. $pattern = '#(?<browser>Version|' . $patternBrowser . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#'; // Attempt to find version strings in the user agent string. $matches = array(); if (preg_match_all($pattern, $userAgent, $matches)) { // Do we have both a Version and browser match? if (count($matches['browser']) == 2) { // See whether Version or browser came first, and use the number accordingly. if (strripos($userAgent, 'Version') < strripos($userAgent, $patternBrowser)) { $this->browserVersion = $matches['version'][0]; } else { $this->browserVersion = $matches['version'][1]; } } elseif (count($matches['browser']) > 2) { $key = array_search('Version', $matches['browser']); if ($key) { $this->browserVersion = $matches['version'][$key]; } } else // We only have a Version or a browser so use what we have. { $this->browserVersion = $matches['version'][0]; } } } // Mark this detection routine as run. $this->detection['browser'] = true; } /** * Method to detect the accepted response encoding by the client. * * @param string $acceptEncoding The client accept encoding string to parse. * * @return void * * @since 1.0 */ protected function detectEncoding($acceptEncoding) { // Parse the accepted encodings. $this->encodings = array_map('trim', (array) explode(',', $acceptEncoding)); // Mark this detection routine as run. $this->detection['acceptEncoding'] = true; } /** * Detects the client rendering engine in a user agent string. * * @param string $userAgent The user-agent string to parse. * * @return void * * @since 1.0 */ protected function detectEngine($userAgent) { if (stripos($userAgent, 'MSIE') !== false || stripos($userAgent, 'Trident') !== false) { // Attempt to detect the client engine -- starting with the most popular ... for now. $this->engine = self::TRIDENT; } elseif (stripos($userAgent, 'AppleWebKit') !== false || stripos($userAgent, 'blackberry') !== false) { // Evidently blackberry uses WebKit and doesn't necessarily report it. Bad RIM. $this->engine = self::WEBKIT; } elseif (stripos($userAgent, 'Gecko') !== false && stripos($userAgent, 'like Gecko') === false) { // We have to check for like Gecko because some other browsers spoof Gecko. $this->engine = self::GECKO; } elseif (stripos($userAgent, 'Opera') !== false || stripos($userAgent, 'Presto') !== false) { // Sometimes Opera browsers don't say Presto. $this->engine = self::PRESTO; } elseif (stripos($userAgent, 'KHTML') !== false) { // *sigh* $this->engine = self::KHTML; } elseif (stripos($userAgent, 'Amaya') !== false) { // Lesser known engine but it finishes off the major list from Wikipedia :-) $this->engine = self::AMAYA; } // Mark this detection routine as run. $this->detection['engine'] = true; } /** * Method to detect the accepted languages by the client. * * @param mixed $acceptLanguage The client accept language string to parse. * * @return void * * @since 1.0 */ protected function detectLanguage($acceptLanguage) { // Parse the accepted encodings. $this->languages = array_map('trim', (array) explode(',', $acceptLanguage)); // Mark this detection routine as run. $this->detection['acceptLanguage'] = true; } /** * Detects the client platform in a user agent string. * * @param string $userAgent The user-agent string to parse. * * @return void * * @since 1.0 */ protected function detectPlatform($userAgent) { // Attempt to detect the client platform. if (stripos($userAgent, 'Windows') !== false) { $this->platform = self::WINDOWS; // Let's look at the specific mobile options in the Windows space. if (stripos($userAgent, 'Windows Phone') !== false) { $this->mobile = true; $this->platform = self::WINDOWS_PHONE; } elseif (stripos($userAgent, 'Windows CE') !== false) { $this->mobile = true; $this->platform = self::WINDOWS_CE; } } elseif (stripos($userAgent, 'iPhone') !== false) { // Interestingly 'iPhone' is present in all iOS devices so far including iPad and iPods. $this->mobile = true; $this->platform = self::IPHONE; // Let's look at the specific mobile options in the iOS space. if (stripos($userAgent, 'iPad') !== false) { $this->platform = self::IPAD; } elseif (stripos($userAgent, 'iPod') !== false) { $this->platform = self::IPOD; } } elseif (stripos($userAgent, 'iPad') !== false) { // In case where iPhone is not mentioed in iPad user agent string $this->mobile = true; $this->platform = self::IPAD; } elseif (stripos($userAgent, 'iPod') !== false) { // In case where iPhone is not mentioed in iPod user agent string $this->mobile = true; $this->platform = self::IPOD; } elseif (preg_match('/macintosh|mac os x/i', $userAgent)) { // This has to come after the iPhone check because mac strings are also present in iOS devices. $this->platform = self::MAC; } elseif (stripos($userAgent, 'Blackberry') !== false) { $this->mobile = true; $this->platform = self::BLACKBERRY; } elseif (stripos($userAgent, 'Android') !== false) { $this->mobile = true; $this->platform = self::ANDROID; /** * Attempt to distinguish between Android phones and tablets * There is no totally foolproof method but certain rules almost always hold * Android 3.x is only used for tablets * Some devices and browsers encourage users to change their UA string to include Tablet. * Google encourages manufacturers to exclude the string Mobile from tablet device UA strings. * In some modes Kindle Android devices include the string Mobile but they include the string Silk. */ if (stripos($userAgent, 'Android 3') !== false || stripos($userAgent, 'Tablet') !== false || stripos($userAgent, 'Mobile') === false || stripos($userAgent, 'Silk') !== false ) { $this->platform = self::ANDROIDTABLET; } } elseif (stripos($userAgent, 'Linux') !== false) { $this->platform = self::LINUX; } // Mark this detection routine as run. $this->detection['platform'] = true; } /** * Determines if the browser is a robot or not. * * @param string $userAgent The user-agent string to parse. * * @return void * * @since 1.0 */ protected function detectRobot($userAgent) { if (preg_match('/http|bot|robot|spider|crawler|curl|^$/i', $userAgent)) { $this->robot = true; } else { $this->robot = false; } $this->detection['robot'] = true; } /** * Fills internal array of headers * * @return void * * @since 1.3.0 */ protected function detectHeaders() { if (function_exists('getallheaders')) // If php is working under Apache, there is a special function { $this->headers = getallheaders(); } else // Else we fill headers from $_SERVER variable { $this->headers = array(); foreach ($_SERVER as $name => $value) { if (substr($name, 0, 5) == 'HTTP_') { $this->headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; } } } // Mark this detection routine as run. $this->detection['headers'] = true; } } PK���\�b1ɐ�Blibraries/vendor/joomla/application/src/AbstractCliApplication.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application; use Joomla\Registry\Registry; use Joomla\Input; use Joomla\Application\Cli\CliOutput; /** * Base class for a Joomla! command line application. * * @since 1.0 */ abstract class AbstractCliApplication extends AbstractApplication { /** * @var CliOutput Output object * @since 1.0 */ protected $output; /** * Class constructor. * * @param Input\Cli $input An optional argument to provide dependency injection for the application's * input object. If the argument is a InputCli object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * * @param CliOutput $output The output handler. * * @since 1.0 */ public function __construct(Input\Cli $input = null, Registry $config = null, CliOutput $output = null) { // Close the application if we are not executed from the command line. // @codeCoverageIgnoreStart if (!defined('STDOUT') || !defined('STDIN') || !isset($_SERVER['argv'])) { $this->close(); } // @codeCoverageIgnoreEnd $this->output = ($output instanceof CliOutput) ? $output : new Cli\Output\Stdout; // Call the constructor as late as possible (it runs `initialise`). parent::__construct($input instanceof Input\Input ? $input : new Input\Cli, $config); // Set the execution datetime and timestamp; $this->set('execution.datetime', gmdate('Y-m-d H:i:s')); $this->set('execution.timestamp', time()); // Set the current directory. $this->set('cwd', getcwd()); } /** * Get an output object. * * @return CliOutput * * @since 1.0 */ public function getOutput() { return $this->output; } /** * Write a string to standard output. * * @param string $text The text to display. * @param boolean $nl True (default) to append a new line at the end of the output string. * * @return AbstractCliApplication Instance of $this to allow chaining. * * @codeCoverageIgnore * @since 1.0 */ public function out($text = '', $nl = true) { $this->output->out($text, $nl); return $this; } /** * Get a value from standard input. * * @return string The input string from standard input. * * @codeCoverageIgnore * @since 1.0 */ public function in() { return rtrim(fread(STDIN, 8192), "\n\r"); } } PK���\��S#?libraries/vendor/joomla/application/src/AbstractApplication.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application; use Joomla\Input\Input; use Joomla\Registry\Registry; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; /** * Joomla Framework Base Application Class * * @since 1.0 */ abstract class AbstractApplication implements LoggerAwareInterface { /** * The application configuration object. * * @var Registry * @since 1.0 */ protected $config; /** * The application input object. * * @var Input * @since 1.0 */ public $input = null; /** * A logger. * * @var LoggerInterface * @since 1.0 */ private $logger; /** * Class constructor. * * @param Input $input An optional argument to provide dependency injection for the application's * input object. If the argument is a InputCli object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * * @since 1.0 */ public function __construct(Input $input = null, Registry $config = null) { $this->input = $input instanceof Input ? $input : new Input; $this->config = $config instanceof Registry ? $config : new Registry; $this->initialise(); } /** * Method to close the application. * * @param integer $code The exit code (optional; default is 0). * * @return void * * @codeCoverageIgnore * @since 1.0 */ public function close($code = 0) { exit($code); } /** * Method to run the application routines. Most likely you will want to instantiate a controller * and execute it, or perform some sort of task directly. * * @return void * * @since 1.0 */ abstract protected function doExecute(); /** * Execute the application. * * @return void * * @since 1.0 */ public function execute() { // @event onBeforeExecute // Perform application routines. $this->doExecute(); // @event onAfterExecute } /** * Returns a property of the object or the default value if the property is not set. * * @param string $key The name of the property. * @param mixed $default The default value (optional) if none is set. * * @return mixed The value of the configuration. * * @since 1.0 */ public function get($key, $default = null) { return $this->config->get($key, $default); } /** * Get the logger. * * @return LoggerInterface * * @since 1.0 */ public function getLogger() { // If a logger hasn't been set, use NullLogger if (! ($this->logger instanceof LoggerInterface)) { $this->logger = new NullLogger; } return $this->logger; } /** * Custom initialisation method. * * Called at the end of the AbstractApplication::__construct method. * This is for developers to inject initialisation code for their application classes. * * @return void * * @codeCoverageIgnore * @since 1.0 */ protected function initialise() { } /** * Modifies a property of the object, creating it if it does not already exist. * * @param string $key The name of the property. * @param mixed $value The value of the property to set (optional). * * @return mixed Previous value of the property * * @since 1.0 */ public function set($key, $value = null) { $previous = $this->config->get($key); $this->config->set($key, $value); return $previous; } /** * Sets the configuration for the application. * * @param Registry $config A registry object holding the configuration. * * @return AbstractApplication Returns itself to support chaining. * * @since 1.0 */ public function setConfiguration(Registry $config) { $this->config = $config; return $this; } /** * Set the logger. * * @param LoggerInterface $logger The logger. * * @return AbstractApplication Returns itself to support chaining. * * @since 1.0 */ public function setLogger(LoggerInterface $logger) { $this->logger = $logger; return $this; } } PK���\e�=A�V�VBlibraries/vendor/joomla/application/src/AbstractWebApplication.phpnu�[���<?php /** * Part of the Joomla Framework Application Package * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\Application; use Joomla\Uri\Uri; use Joomla\Input\Input; use Joomla\String\String; use Joomla\Session\Session; use Joomla\Registry\Registry; /** * Base class for a Joomla! Web application. * * @since 1.0 */ abstract class AbstractWebApplication extends AbstractApplication { /** * Character encoding string. * * @var string * @since 1.0 */ public $charSet = 'utf-8'; /** * Response mime type. * * @var string * @since 1.0 */ public $mimeType = 'text/html'; /** * The body modified date for response headers. * * @var \DateTime * @since 1.0 */ public $modifiedDate; /** * The application client object. * * @var Web\WebClient * @since 1.0 */ public $client; /** * The application response object. * * @var object * @since 1.0 */ protected $response; /** * The application session object. * * @var Session * @since 1.0 * @deprecated 2.0 The joomla/session package will no longer be required by this class */ private $session; /** * Class constructor. * * @param Input $input An optional argument to provide dependency injection for the application's * input object. If the argument is a Input object that object will become * the application's input object, otherwise a default input object is created. * @param Registry $config An optional argument to provide dependency injection for the application's * config object. If the argument is a Registry object that object will become * the application's config object, otherwise a default config object is created. * @param Web\WebClient $client An optional argument to provide dependency injection for the application's * client object. If the argument is a Web\WebClient object that object will become * the application's client object, otherwise a default client object is created. * * @since 1.0 */ public function __construct(Input $input = null, Registry $config = null, Web\WebClient $client = null) { $this->client = $client instanceof Web\WebClient ? $client : new Web\WebClient; // Setup the response object. $this->response = new \stdClass; $this->response->cachable = false; $this->response->headers = array(); $this->response->body = array(); // Call the constructor as late as possible (it runs `initialise`). parent::__construct($input, $config); // Set the system URIs. $this->loadSystemUris(); // Set the execution datetime and timestamp; $this->set('execution.datetime', gmdate('Y-m-d H:i:s')); $this->set('execution.timestamp', time()); } /** * Execute the application. * * @return void * * @since 1.0 */ public function execute() { // @event onBeforeExecute // Perform application routines. $this->doExecute(); // @event onAfterExecute // If gzip compression is enabled in configuration and the server is compliant, compress the output. if ($this->get('gzip') && !ini_get('zlib.output_compression') && (ini_get('output_handler') != 'ob_gzhandler')) { $this->compress(); } // @event onBeforeRespond // Send the application response. $this->respond(); // @event onAfterRespond } /** * Checks the accept encoding of the browser and compresses the data before * sending it to the client if possible. * * @return void * * @since 1.0 */ protected function compress() { // Supported compression encodings. $supported = array( 'x-gzip' => 'gz', 'gzip' => 'gz', 'deflate' => 'deflate' ); // Get the supported encoding. $encodings = array_intersect($this->client->encodings, array_keys($supported)); // If no supported encoding is detected do nothing and return. if (empty($encodings)) { return; } // Verify that headers have not yet been sent, and that our connection is still alive. if ($this->checkHeadersSent() || !$this->checkConnectionAlive()) { return; } // Iterate through the encodings and attempt to compress the data using any found supported encodings. foreach ($encodings as $encoding) { if (($supported[$encoding] == 'gz') || ($supported[$encoding] == 'deflate')) { // Verify that the server supports gzip compression before we attempt to gzip encode the data. // @codeCoverageIgnoreStart if (!extension_loaded('zlib') || ini_get('zlib.output_compression')) { continue; } // @codeCoverageIgnoreEnd // Attempt to gzip encode the data with an optimal level 4. $data = $this->getBody(); $gzdata = gzencode($data, 4, ($supported[$encoding] == 'gz') ? FORCE_GZIP : FORCE_DEFLATE); // If there was a problem encoding the data just try the next encoding scheme. // @codeCoverageIgnoreStart if ($gzdata === false) { continue; } // @codeCoverageIgnoreEnd // Set the encoding headers. $this->setHeader('Content-Encoding', $encoding); $this->setHeader('X-Content-Encoded-By', 'Joomla'); // Replace the output with the encoded data. $this->setBody($gzdata); // Compression complete, let's break out of the loop. break; } } } /** * Method to send the application response to the client. All headers will be sent prior to the main * application output data. * * @return void * * @since 1.0 */ protected function respond() { // Send the content-type header. $this->setHeader('Content-Type', $this->mimeType . '; charset=' . $this->charSet); // If the response is set to uncachable, we need to set some appropriate headers so browsers don't cache the response. if (!$this->response->cachable) { // Expires in the past. $this->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true); // Always modified. $this->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true); $this->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false); // HTTP 1.0 $this->setHeader('Pragma', 'no-cache'); } else { // Expires. $this->setHeader('Expires', gmdate('D, d M Y H:i:s', time() + 900) . ' GMT'); // Last modified. if ($this->modifiedDate instanceof \DateTime) { $this->modifiedDate->setTimezone(new \DateTimeZone('UTC')); $this->setHeader('Last-Modified', $this->modifiedDate->format('D, d M Y H:i:s') . ' GMT'); } } $this->sendHeaders(); echo $this->getBody(); } /** * Redirect to another URL. * * If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" * or "303 See Other" code in the header pointing to the new location. If the headers have already been * sent this will be accomplished using a JavaScript statement. * * @param string $url The URL to redirect to. Can only be http/https URL * @param boolean $moved True if the page is 301 Permanently Moved, otherwise 303 See Other is assumed. * * @return void * * @since 1.0 */ public function redirect($url, $moved = false) { // Check for relative internal links. if (preg_match('#^index\.php#', $url)) { $url = $this->get('uri.base.full') . $url; } // Perform a basic sanity check to make sure we don't have any CRLF garbage. $url = preg_split("/[\r\n]/", $url); $url = $url[0]; /* * Here we need to check and see if the URL is relative or absolute. Essentially, do we need to * prepend the URL with our base URL for a proper redirect. The rudimentary way we are looking * at this is to simply check whether or not the URL string has a valid scheme or not. */ if (!preg_match('#^[a-z]+\://#i', $url)) { // Get a JURI instance for the requested URI. $uri = new Uri($this->get('uri.request')); // Get a base URL to prepend from the requested URI. $prefix = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); // We just need the prefix since we have a path relative to the root. if ($url[0] == '/') { $url = $prefix . $url; } else // It's relative to where we are now, so lets add that. { $parts = explode('/', $uri->toString(array('path'))); array_pop($parts); $path = implode('/', $parts) . '/'; $url = $prefix . $path . $url; } } // If the headers have already been sent we need to send the redirect statement via JavaScript. if ($this->checkHeadersSent()) { echo "<script>document.location.href='$url';</script>\n"; } else { // We have to use a JavaScript redirect here because MSIE doesn't play nice with utf-8 URLs. if (($this->client->engine == Web\WebClient::TRIDENT) && !String::is_ascii($url)) { $html = '<html><head>'; $html .= '<meta http-equiv="content-type" content="text/html; charset=' . $this->charSet . '" />'; $html .= '<script>document.location.href=\'' . $url . '\';</script>'; $html .= '</head><body></body></html>'; echo $html; } else { // All other cases use the more efficient HTTP header for redirection. $this->header($moved ? 'HTTP/1.1 301 Moved Permanently' : 'HTTP/1.1 303 See other'); $this->header('Location: ' . $url); $this->header('Content-Type: text/html; charset=' . $this->charSet); // Send other headers that may have been set. $this->sendHeaders(); } } // Close the application after the redirect. $this->close(); } /** * Set/get cachable state for the response. If $allow is set, sets the cachable state of the * response. Always returns the current state. * * @param boolean $allow True to allow browser caching. * * @return boolean * * @since 1.0 */ public function allowCache($allow = null) { if ($allow !== null) { $this->response->cachable = (bool) $allow; } return $this->response->cachable; } /** * Method to set a response header. If the replace flag is set then all headers * with the given name will be replaced by the new one. The headers are stored * in an internal array to be sent when the site is sent to the browser. * * @param string $name The name of the header to set. * @param string $value The value of the header to set. * @param boolean $replace True to replace any headers with the same name. * * @return AbstractWebApplication Instance of $this to allow chaining. * * @since 1.0 */ public function setHeader($name, $value, $replace = false) { // Sanitize the input values. $name = (string) $name; $value = (string) $value; // If the replace flag is set, unset all known headers with the given name. if ($replace) { foreach ($this->response->headers as $key => $header) { if ($name == $header['name']) { unset($this->response->headers[$key]); } } // Clean up the array as unsetting nested arrays leaves some junk. $this->response->headers = array_values($this->response->headers); } // Add the header to the internal array. $this->response->headers[] = array('name' => $name, 'value' => $value); return $this; } /** * Method to get the array of response headers to be sent when the response is sent * to the client. * * @return array * * @since 1.0 */ public function getHeaders() { return $this->response->headers; } /** * Method to clear any set response headers. * * @return AbstractWebApplication Instance of $this to allow chaining. * * @since 1.0 */ public function clearHeaders() { $this->response->headers = array(); return $this; } /** * Send the response headers. * * @return AbstractWebApplication Instance of $this to allow chaining. * * @since 1.0 */ public function sendHeaders() { if (!$this->checkHeadersSent()) { foreach ($this->response->headers as $header) { if ('status' == strtolower($header['name'])) { // 'status' headers indicate an HTTP status, and need to be handled slightly differently $this->header(ucfirst(strtolower($header['name'])) . ': ' . $header['value'], null, (int) $header['value']); } else { $this->header($header['name'] . ': ' . $header['value']); } } } return $this; } /** * Set body content. If body content already defined, this will replace it. * * @param string $content The content to set as the response body. * * @return AbstractWebApplication Instance of $this to allow chaining. * * @since 1.0 */ public function setBody($content) { $this->response->body = array((string) $content); return $this; } /** * Prepend content to the body content * * @param string $content The content to prepend to the response body. * * @return AbstractWebApplication Instance of $this to allow chaining. * * @since 1.0 */ public function prependBody($content) { array_unshift($this->response->body, (string) $content); return $this; } /** * Append content to the body content * * @param string $content The content to append to the response body. * * @return AbstractWebApplication Instance of $this to allow chaining. * * @since 1.0 */ public function appendBody($content) { array_push($this->response->body, (string) $content); return $this; } /** * Return the body content * * @param boolean $asArray True to return the body as an array of strings. * * @return mixed The response body either as an array or concatenated string. * * @since 1.0 */ public function getBody($asArray = false) { return $asArray ? $this->response->body : implode((array) $this->response->body); } /** * Method to get the application session object. * * @return Session The session object * * @since 1.0 * @deprecated 2.0 The joomla/session package will no longer be required by this class */ public function getSession() { return $this->session; } /** * Method to check the current client connnection status to ensure that it is alive. We are * wrapping this to isolate the connection_status() function from our code base for testing reasons. * * @return boolean True if the connection is valid and normal. * * @codeCoverageIgnore * @see connection_status() * @since 1.0 */ protected function checkConnectionAlive() { return (connection_status() === CONNECTION_NORMAL); } /** * Method to check to see if headers have already been sent. We are wrapping this to isolate the * headers_sent() function from our code base for testing reasons. * * @return boolean True if the headers have already been sent. * * @codeCoverageIgnore * @see headers_sent() * @since 1.0 */ protected function checkHeadersSent() { return headers_sent(); } /** * Method to detect the requested URI from server environment variables. * * @return string The requested URI * * @since 1.0 */ protected function detectRequestUri() { // First we need to detect the URI scheme. if ($this->isSSLConnection()) { $scheme = 'https://'; } else { $scheme = 'http://'; } /* * There are some differences in the way that Apache and IIS populate server environment variables. To * properly detect the requested URI we need to adjust our algorithm based on whether or not we are getting * information from Apache or IIS. */ // If PHP_SELF and REQUEST_URI are both populated then we will assume "Apache Mode". if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) { // The URI is built from the HTTP_HOST and REQUEST_URI environment variables in an Apache environment. $uri = $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; } else // If not in "Apache Mode" we will assume that we are in an IIS environment and proceed. { // IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS $uri = $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; // If the QUERY_STRING variable exists append it to the URI string. if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { $uri .= '?' . $_SERVER['QUERY_STRING']; } } return trim($uri); } /** * Method to send a header to the client. We are wrapping this to isolate the header() function * from our code base for testing reasons. * * @param string $string The header string. * @param boolean $replace The optional replace parameter indicates whether the header should * replace a previous similar header, or add a second header of the same type. * @param integer $code Forces the HTTP response code to the specified value. Note that * this parameter only has an effect if the string is not empty. * * @return void * * @codeCoverageIgnore * @see header() * @since 1.0 */ protected function header($string, $replace = true, $code = null) { header($string, $replace, $code); } /** * Determine if we are using a secure (SSL) connection. * * @return boolean True if using SSL, false if not. * * @since 1.0 */ public function isSSLConnection() { return (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off'); } /** * Sets the session for the application to use, if required. * * @param Session $session A session object. * * @return AbstractWebApplication Returns itself to support chaining. * * @since 1.0 * @deprecated 2.0 The joomla/session package will no longer be required by this class */ public function setSession(Session $session) { $this->session = $session; return $this; } /** * Method to load the system URI strings for the application. * * @param string $requestUri An optional request URI to use instead of detecting one from the * server environment variables. * * @return void * * @since 1.0 */ protected function loadSystemUris($requestUri = null) { // Set the request URI. // @codeCoverageIgnoreStart if (!empty($requestUri)) { $this->set('uri.request', $requestUri); } else { $this->set('uri.request', $this->detectRequestUri()); } // @codeCoverageIgnoreEnd // Check to see if an explicit base URI has been set. $siteUri = trim($this->get('site_uri')); if ($siteUri != '') { $uri = new Uri($siteUri); $path = $uri->toString(array('path')); } else // No explicit base URI was set so we need to detect it. { // Start with the requested URI. $uri = new Uri($this->get('uri.request')); // If we are working from a CGI SAPI with the 'cgi.fix_pathinfo' directive disabled we use PHP_SELF. if (strpos(php_sapi_name(), 'cgi') !== false && !ini_get('cgi.fix_pathinfo') && !empty($_SERVER['REQUEST_URI'])) { // We aren't expecting PATH_INFO within PHP_SELF so this should work. $path = dirname($_SERVER['PHP_SELF']); } else // Pretty much everything else should be handled with SCRIPT_NAME. { $path = dirname($_SERVER['SCRIPT_NAME']); } } // Get the host from the URI. $host = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port')); // Check if the path includes "index.php". if (strpos($path, 'index.php') !== false) { // Remove the index.php portion of the path. $path = substr_replace($path, '', strpos($path, 'index.php'), 9); } $path = rtrim($path, '/\\'); // Set the base URI both as just a path and as the full URI. $this->set('uri.base.full', $host . $path . '/'); $this->set('uri.base.host', $host); $this->set('uri.base.path', $path . '/'); // Set the extended (non-base) part of the request URI as the route. if (stripos($this->get('uri.request'), $this->get('uri.base.full')) === 0) { $this->set('uri.route', substr_replace($this->get('uri.request'), '', 0, strlen($this->get('uri.base.full')))); } // Get an explicitly set media URI is present. $mediaURI = trim($this->get('media_uri')); if ($mediaURI) { if (strpos($mediaURI, '://') !== false) { $this->set('uri.media.full', $mediaURI); $this->set('uri.media.path', $mediaURI); } else { // Normalise slashes. $mediaURI = trim($mediaURI, '/\\'); $mediaURI = !empty($mediaURI) ? '/' . $mediaURI . '/' : '/'; $this->set('uri.media.full', $this->get('uri.base.host') . $mediaURI); $this->set('uri.media.path', $mediaURI); } } else // No explicit media URI was set, build it dynamically from the base uri. { $this->set('uri.media.full', $this->get('uri.base.full') . 'media/'); $this->set('uri.media.path', $this->get('uri.base.path') . 'media/'); } } /** * Checks for a form token in the request. * * Use in conjunction with getFormToken. * * @param string $method The request method in which to look for the token key. * * @return boolean True if found and valid, false otherwise. * * @since 1.0 * @deprecated 2.0 Deprecated without replacement */ public function checkToken($method = 'post') { $token = $this->getFormToken(); if (!$this->input->$method->get($token, '', 'alnum')) { if ($this->session->isNew()) { // Redirect to login screen. $this->redirect('index.php'); $this->close(); } else { return false; } } else { return true; } } /** * Method to determine a hash for anti-spoofing variable names * * @param boolean $forceNew If true, force a new token to be created * * @return string Hashed var name * * @since 1.0 * @deprecated 2.0 Deprecated without replacement */ public function getFormToken($forceNew = false) { // @todo we need the user id somehow here $userId = 0; return md5($this->get('secret') . $userId . $this->session->getToken($forceNew)); } } PK���\X�L�L?libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Exception\DumpException; /** * Inline implements a YAML parser/dumper for the YAML inline syntax. * * @author Fabien Potencier <fabien@symfony.com> */ class Inline { const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\']*(?:\'\'[^\']*)*)\')'; private static $exceptionOnInvalidType = false; private static $objectSupport = false; private static $objectForMap = false; /** * Converts a YAML string to a PHP array. * * @param string $value A YAML string * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise * @param bool $objectSupport true if object support is enabled, false otherwise * @param bool $objectForMap true if maps should return a stdClass instead of array() * @param array $references Mapping of variable names to values * * @return array A PHP array representing the YAML string * * @throws ParseException */ public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false, $references = array()) { self::$exceptionOnInvalidType = $exceptionOnInvalidType; self::$objectSupport = $objectSupport; self::$objectForMap = $objectForMap; $value = trim($value); if (0 == strlen($value)) { return ''; } if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { $mbEncoding = mb_internal_encoding(); mb_internal_encoding('ASCII'); } $i = 0; switch ($value[0]) { case '[': $result = self::parseSequence($value, $i, $references); ++$i; break; case '{': $result = self::parseMapping($value, $i, $references); ++$i; break; default: $result = self::parseScalar($value, null, array('"', "'"), $i, true, $references); } // some comments are allowed at the end if (preg_replace('/\s+#.*$/A', '', substr($value, $i))) { throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i))); } if (isset($mbEncoding)) { mb_internal_encoding($mbEncoding); } return $result; } /** * Dumps a given PHP variable to a YAML string. * * @param mixed $value The PHP variable to convert * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise * @param bool $objectSupport true if object support is enabled, false otherwise * * @return string The YAML string representing the PHP array * * @throws DumpException When trying to dump PHP resource */ public static function dump($value, $exceptionOnInvalidType = false, $objectSupport = false) { switch (true) { case is_resource($value): if ($exceptionOnInvalidType) { throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); } return 'null'; case is_object($value): if ($objectSupport) { return '!!php/object:'.serialize($value); } if ($exceptionOnInvalidType) { throw new DumpException('Object support when dumping a YAML file has been disabled.'); } return 'null'; case is_array($value): return self::dumpArray($value, $exceptionOnInvalidType, $objectSupport); case null === $value: return 'null'; case true === $value: return 'true'; case false === $value: return 'false'; case ctype_digit($value): return is_string($value) ? "'$value'" : (int) $value; case is_numeric($value): $locale = setlocale(LC_NUMERIC, 0); if (false !== $locale) { setlocale(LC_NUMERIC, 'C'); } if (is_float($value)) { $repr = strval($value); if (is_infinite($value)) { $repr = str_ireplace('INF', '.Inf', $repr); } elseif (floor($value) == $value && $repr == $value) { // Preserve float data type since storing a whole number will result in integer value. $repr = '!!float '.$repr; } } else { $repr = is_string($value) ? "'$value'" : strval($value); } if (false !== $locale) { setlocale(LC_NUMERIC, $locale); } return $repr; case Escaper::requiresDoubleQuoting($value): return Escaper::escapeWithDoubleQuotes($value); case Escaper::requiresSingleQuoting($value): return Escaper::escapeWithSingleQuotes($value); case '' == $value: return "''"; case preg_match(self::getTimestampRegex(), $value): case in_array(strtolower($value), array('null', '~', 'true', 'false')): return "'$value'"; default: return $value; } } /** * Dumps a PHP array to a YAML string. * * @param array $value The PHP array to dump * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise * @param bool $objectSupport true if object support is enabled, false otherwise * * @return string The YAML string representing the PHP array */ private static function dumpArray($value, $exceptionOnInvalidType, $objectSupport) { // array $keys = array_keys($value); if ((1 == count($keys) && '0' == $keys[0]) || (count($keys) > 1 && array_reduce($keys, function ($v, $w) { return (int) $v + $w; }, 0) == count($keys) * (count($keys) - 1) / 2) ) { $output = array(); foreach ($value as $val) { $output[] = self::dump($val, $exceptionOnInvalidType, $objectSupport); } return sprintf('[%s]', implode(', ', $output)); } // mapping $output = array(); foreach ($value as $key => $val) { $output[] = sprintf('%s: %s', self::dump($key, $exceptionOnInvalidType, $objectSupport), self::dump($val, $exceptionOnInvalidType, $objectSupport)); } return sprintf('{ %s }', implode(', ', $output)); } /** * Parses a scalar to a YAML string. * * @param scalar $scalar * @param string $delimiters * @param array $stringDelimiters * @param int &$i * @param bool $evaluate * @param array $references * * @return string A YAML string * * @throws ParseException When malformed inline YAML string is parsed */ public static function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true, $references = array()) { if (in_array($scalar[$i], $stringDelimiters)) { // quoted scalar $output = self::parseQuotedScalar($scalar, $i); if (null !== $delimiters) { $tmp = ltrim(substr($scalar, $i), ' '); if (!in_array($tmp[0], $delimiters)) { throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i))); } } } else { // "normal" string if (!$delimiters) { $output = substr($scalar, $i); $i += strlen($output); // remove comments if (false !== $strpos = strpos($output, ' #')) { $output = rtrim(substr($output, 0, $strpos)); } } elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { $output = $match[1]; $i += strlen($output); } else { throw new ParseException(sprintf('Malformed inline YAML string (%s).', $scalar)); } if ($evaluate) { $output = self::evaluateScalar($output, $references); } } return $output; } /** * Parses a quoted scalar to YAML. * * @param string $scalar * @param int &$i * * @return string A YAML string * * @throws ParseException When malformed inline YAML string is parsed */ private static function parseQuotedScalar($scalar, &$i) { if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); } $output = substr($match[0], 1, strlen($match[0]) - 2); $unescaper = new Unescaper(); if ('"' == $scalar[$i]) { $output = $unescaper->unescapeDoubleQuotedString($output); } else { $output = $unescaper->unescapeSingleQuotedString($output); } $i += strlen($match[0]); return $output; } /** * Parses a sequence to a YAML string. * * @param string $sequence * @param int &$i * @param array $references * * @return string A YAML string * * @throws ParseException When malformed inline YAML string is parsed */ private static function parseSequence($sequence, &$i = 0, $references = array()) { $output = array(); $len = strlen($sequence); $i += 1; // [foo, bar, ...] while ($i < $len) { switch ($sequence[$i]) { case '[': // nested sequence $output[] = self::parseSequence($sequence, $i, $references); break; case '{': // nested mapping $output[] = self::parseMapping($sequence, $i, $references); break; case ']': return $output; case ',': case ' ': break; default: $isQuoted = in_array($sequence[$i], array('"', "'")); $value = self::parseScalar($sequence, array(',', ']'), array('"', "'"), $i, true, $references); // the value can be an array if a reference has been resolved to an array var if (!is_array($value) && !$isQuoted && false !== strpos($value, ': ')) { // embedded mapping? try { $pos = 0; $value = self::parseMapping('{'.$value.'}', $pos, $references); } catch (\InvalidArgumentException $e) { // no, it's not } } $output[] = $value; --$i; } ++$i; } throw new ParseException(sprintf('Malformed inline YAML string %s', $sequence)); } /** * Parses a mapping to a YAML string. * * @param string $mapping * @param int &$i * @param array $references * * @return string A YAML string * * @throws ParseException When malformed inline YAML string is parsed */ private static function parseMapping($mapping, &$i = 0, $references = array()) { $output = array(); $len = strlen($mapping); $i += 1; // {foo: bar, bar:foo, ...} while ($i < $len) { switch ($mapping[$i]) { case ' ': case ',': ++$i; continue 2; case '}': if (self::$objectForMap) { return (object) $output; } return $output; } // key $key = self::parseScalar($mapping, array(':', ' '), array('"', "'"), $i, false); // value $done = false; while ($i < $len) { switch ($mapping[$i]) { case '[': // nested sequence $value = self::parseSequence($mapping, $i, $references); // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. if (!isset($output[$key])) { $output[$key] = $value; } $done = true; break; case '{': // nested mapping $value = self::parseMapping($mapping, $i, $references); // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. if (!isset($output[$key])) { $output[$key] = $value; } $done = true; break; case ':': case ' ': break; default: $value = self::parseScalar($mapping, array(',', '}'), array('"', "'"), $i, true, $references); // Spec: Keys MUST be unique; first one wins. // Parser cannot abort this mapping earlier, since lines // are processed sequentially. if (!isset($output[$key])) { $output[$key] = $value; } $done = true; --$i; } ++$i; if ($done) { continue 2; } } } throw new ParseException(sprintf('Malformed inline YAML string %s', $mapping)); } /** * Evaluates scalars and replaces magic values. * * @param string $scalar * @param array $references * * @return string A YAML string * * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved */ private static function evaluateScalar($scalar, $references = array()) { $scalar = trim($scalar); $scalarLower = strtolower($scalar); if (0 === strpos($scalar, '*')) { if (false !== $pos = strpos($scalar, '#')) { $value = substr($scalar, 1, $pos - 2); } else { $value = substr($scalar, 1); } // an unquoted * if (false === $value || '' === $value) { throw new ParseException('A reference must contain at least one character.'); } if (!array_key_exists($value, $references)) { throw new ParseException(sprintf('Reference "%s" does not exist.', $value)); } return $references[$value]; } switch (true) { case 'null' === $scalarLower: case '' === $scalar: case '~' === $scalar: return; case 'true' === $scalarLower: return true; case 'false' === $scalarLower: return false; // Optimise for returning strings. case $scalar[0] === '+' || $scalar[0] === '-' || $scalar[0] === '.' || $scalar[0] === '!' || is_numeric($scalar[0]): switch (true) { case 0 === strpos($scalar, '!str'): return (string) substr($scalar, 5); case 0 === strpos($scalar, '! '): return intval(self::parseScalar(substr($scalar, 2))); case 0 === strpos($scalar, '!!php/object:'): if (self::$objectSupport) { return unserialize(substr($scalar, 13)); } if (self::$exceptionOnInvalidType) { throw new ParseException('Object support when parsing a YAML file has been disabled.'); } return; case 0 === strpos($scalar, '!!float '): return (float) substr($scalar, 8); case ctype_digit($scalar): $raw = $scalar; $cast = intval($scalar); return '0' == $scalar[0] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): $raw = $scalar; $cast = intval($scalar); return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); case is_numeric($scalar): return '0x' == $scalar[0].$scalar[1] ? hexdec($scalar) : floatval($scalar); case '.inf' === $scalarLower: case '.nan' === $scalarLower: return -log(0); case '-.inf' === $scalarLower: return log(0); case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar): return floatval(str_replace(',', '', $scalar)); case preg_match(self::getTimestampRegex(), $scalar): return strtotime($scalar); } default: return (string) $scalar; } } /** * Gets a regex that matches a YAML date. * * @return string The regular expression * * @see http://www.yaml.org/spec/1.2/spec.html#id2761573 */ private static function getTimestampRegex() { return <<<EOF ~^ (?P<year>[0-9][0-9][0-9][0-9]) -(?P<month>[0-9][0-9]?) -(?P<day>[0-9][0-9]?) (?:(?:[Tt]|[ \t]+) (?P<hour>[0-9][0-9]?) :(?P<minute>[0-9][0-9]) :(?P<second>[0-9][0-9]) (?:\.(?P<fraction>[0-9]*))? (?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?) (?::(?P<tz_minute>[0-9][0-9]))?))?)? $~x EOF; } } PK���\bI!��Blibraries/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml; /** * Unescaper encapsulates unescaping rules for single and double-quoted * YAML strings. * * @author Matthew Lewinski <matthew@lewinski.org> */ class Unescaper { // Parser and Inline assume UTF-8 encoding, so escaped Unicode characters // must be converted to that encoding. // @deprecated since 2.5, to be removed in 3.0 const ENCODING = 'UTF-8'; // Regex fragment that matches an escaped character in a double quoted // string. const REGEX_ESCAPED_CHARACTER = "\\\\([0abt\tnvfre \\\"\\/\\\\N_LP]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})"; /** * Unescapes a single quoted string. * * @param string $value A single quoted string. * * @return string The unescaped string. */ public function unescapeSingleQuotedString($value) { return str_replace('\'\'', '\'', $value); } /** * Unescapes a double quoted string. * * @param string $value A double quoted string. * * @return string The unescaped string. */ public function unescapeDoubleQuotedString($value) { $self = $this; $callback = function ($match) use ($self) { return $self->unescapeCharacter($match[0]); }; // evaluate the string return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); } /** * Unescapes a character that was found in a double-quoted string * * @param string $value An escaped character * * @return string The unescaped character */ public function unescapeCharacter($value) { switch ($value{1}) { case '0': return "\x0"; case 'a': return "\x7"; case 'b': return "\x8"; case 't': return "\t"; case "\t": return "\t"; case 'n': return "\n"; case 'v': return "\xB"; case 'f': return "\xC"; case 'r': return "\r"; case 'e': return "\x1B"; case ' ': return ' '; case '"': return '"'; case '/': return '/'; case '\\': return '\\'; case 'N': // U+0085 NEXT LINE return "\xC2\x85"; case '_': // U+00A0 NO-BREAK SPACE return "\xC2\xA0"; case 'L': // U+2028 LINE SEPARATOR return "\xE2\x80\xA8"; case 'P': // U+2029 PARAGRAPH SEPARATOR return "\xE2\x80\xA9"; case 'x': return self::utf8chr(hexdec(substr($value, 2, 2))); case 'u': return self::utf8chr(hexdec(substr($value, 2, 4))); case 'U': return self::utf8chr(hexdec(substr($value, 2, 8))); } } /** * Get the UTF-8 character for the given code point. * * @param int $c The unicode code point * * @return string The corresponding UTF-8 character */ private static function utf8chr($c) { if (0x80 > $c %= 0x200000) { return chr($c); } if (0x800 > $c) { return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); } if (0x10000 > $c) { return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); } return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); } } PK���\E���))<libraries/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSEnu�[���Copyright (c) 2004-2014 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK���\l�D� � ?libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml; /** * Dumper dumps PHP variables to YAML strings. * * @author Fabien Potencier <fabien@symfony.com> */ class Dumper { /** * The amount of spaces to use for indentation of nested nodes. * * @var int */ protected $indentation = 4; /** * Sets the indentation. * * @param int $num The amount of spaces to use for indentation of nested nodes. */ public function setIndentation($num) { $this->indentation = (int) $num; } /** * Dumps a PHP value to YAML. * * @param mixed $input The PHP value * @param int $inline The level where you switch to inline YAML * @param int $indent The level of indentation (used internally) * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise * @param bool $objectSupport true if object support is enabled, false otherwise * * @return string The YAML representation of the PHP value */ public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType = false, $objectSupport = false) { $output = ''; $prefix = $indent ? str_repeat(' ', $indent) : ''; if ($inline <= 0 || !is_array($input) || empty($input)) { $output .= $prefix.Inline::dump($input, $exceptionOnInvalidType, $objectSupport); } else { $isAHash = array_keys($input) !== range(0, count($input) - 1); foreach ($input as $key => $value) { $willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value); $output .= sprintf('%s%s%s%s', $prefix, $isAHash ? Inline::dump($key, $exceptionOnInvalidType, $objectSupport).':' : '-', $willBeInlined ? ' ' : "\n", $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $exceptionOnInvalidType, $objectSupport) ).($willBeInlined ? "\n" : ''); } } return $output; } } PK���\.|m9 =libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml; use Symfony\Component\Yaml\Exception\ParseException; /** * Yaml offers convenience methods to load and dump YAML. * * @author Fabien Potencier <fabien@symfony.com> * * @api */ class Yaml { /** * Parses YAML into a PHP array. * * The parse method, when supplied with a YAML stream (string or file), * will do its best to convert YAML in a file into a PHP array. * * Usage: * <code> * $array = Yaml::parse('config.yml'); * print_r($array); * </code> * * As this method accepts both plain strings and file names as an input, * you must validate the input before calling this method. Passing a file * as an input is a deprecated feature and will be removed in 3.0. * * @param string $input Path to a YAML file or a string containing YAML * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise * @param bool $objectSupport True if object support is enabled, false otherwise * * @return array The YAML converted to a PHP array * * @throws ParseException If the YAML is not valid * * @api */ public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false) { // if input is a file, process it $file = ''; if (strpos($input, "\n") === false && is_file($input)) { if (false === is_readable($input)) { throw new ParseException(sprintf('Unable to parse "%s" as the file is not readable.', $input)); } $file = $input; $input = file_get_contents($file); } $yaml = new Parser(); try { return $yaml->parse($input, $exceptionOnInvalidType, $objectSupport); } catch (ParseException $e) { if ($file) { $e->setParsedFile($file); } throw $e; } } /** * Dumps a PHP array to a YAML string. * * The dump method, when supplied with an array, will do its best * to convert the array into friendly YAML. * * @param array $array PHP array * @param int $inline The level where you switch to inline YAML * @param int $indent The amount of spaces to use for indentation of nested nodes. * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise * @param bool $objectSupport true if object support is enabled, false otherwise * * @return string A YAML string representing the original PHP array * * @api */ public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false) { $yaml = new Dumper(); $yaml->setIndentation($indent); return $yaml->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport); } } PK���\5��dv v @libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml; /** * Escaper encapsulates escaping rules for single and double-quoted * YAML strings. * * @author Matthew Lewinski <matthew@lewinski.org> */ class Escaper { // Characters that would cause a dumped string to require double quoting. const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9"; // Mapping arrays for escaping a double quoted string. The backslash is // first to ensure proper escaping because str_replace operates iteratively // on the input arrays. This ordering of the characters avoids the use of strtr, // which performs more slowly. private static $escapees = array('\\', '\\\\', '\\"', '"', "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",); private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", "\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", "\\N", "\\_", "\\L", "\\P",); /** * Determines if a PHP value would require double quoting in YAML. * * @param string $value A PHP value * * @return bool True if the value would require double quotes. */ public static function requiresDoubleQuoting($value) { return preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); } /** * Escapes and surrounds a PHP value with double quotes. * * @param string $value A PHP value * * @return string The quoted, escaped string */ public static function escapeWithDoubleQuotes($value) { return sprintf('"%s"', str_replace(self::$escapees, self::$escaped, $value)); } /** * Determines if a PHP value would require single quoting in YAML. * * @param string $value A PHP value * * @return bool True if the value would require single quotes. */ public static function requiresSingleQuoting($value) { return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value); } /** * Escapes and surrounds a PHP value with single quotes. * * @param string $value A PHP value * * @return string The quoted, escaped string */ public static function escapeWithSingleQuotes($value) { return sprintf("'%s'", str_replace('\'', '\'\'', $value)); } } PK���\��� h h?libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml; use Symfony\Component\Yaml\Exception\ParseException; /** * Parser parses YAML strings to convert them to PHP arrays. * * @author Fabien Potencier <fabien@symfony.com> */ class Parser { const FOLDED_SCALAR_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?'; private $offset = 0; private $lines = array(); private $currentLineNb = -1; private $currentLine = ''; private $refs = array(); /** * Constructor * * @param int $offset The offset of YAML document (used for line numbers in error messages) */ public function __construct($offset = 0) { $this->offset = $offset; } /** * Parses a YAML string to a PHP value. * * @param string $value A YAML string * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise * @param bool $objectSupport true if object support is enabled, false otherwise * @param bool $objectForMap true if maps should return a stdClass instead of array() * * @return mixed A PHP value * * @throws ParseException If the YAML is not valid */ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false) { $this->currentLineNb = -1; $this->currentLine = ''; $this->lines = explode("\n", $this->cleanup($value)); if (!preg_match('//u', $value)) { throw new ParseException('The YAML value does not appear to be valid UTF-8.'); } if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { $mbEncoding = mb_internal_encoding(); mb_internal_encoding('UTF-8'); } $data = array(); $context = null; $allowOverwrite = false; while ($this->moveToNextLine()) { if ($this->isCurrentLineEmpty()) { continue; } // tab? if ("\t" === $this->currentLine[0]) { throw new ParseException('A YAML file cannot contain tabs as indentation.', $this->getRealCurrentLineNb() + 1, $this->currentLine); } $isRef = $mergeNode = false; if (preg_match('#^\-((?P<leadspaces>\s+)(?P<value>.+?))?\s*$#u', $this->currentLine, $values)) { if ($context && 'mapping' == $context) { throw new ParseException('You cannot define a sequence item when in a mapping'); } $context = 'sequence'; if (isset($values['value']) && preg_match('#^&(?P<ref>[^ ]+) *(?P<value>.*)#u', $values['value'], $matches)) { $isRef = $matches['ref']; $values['value'] = $matches['value']; } // array if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); $parser->refs = & $this->refs; $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap); } else { if (isset($values['leadspaces']) && ' ' == $values['leadspaces'] && preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $values['value'], $matches) ) { // this is a compact notation element, add to next block and parse $c = $this->getRealCurrentLineNb(); $parser = new Parser($c); $parser->refs = & $this->refs; $block = $values['value']; if ($this->isNextLineIndented()) { $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + 2); } $data[] = $parser->parse($block, $exceptionOnInvalidType, $objectSupport, $objectForMap); } else { $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport, $objectForMap); } } } elseif (preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->currentLine, $values) && (false === strpos($values['key'], ' #') || in_array($values['key'][0], array('"', "'")))) { if ($context && 'sequence' == $context) { throw new ParseException('You cannot define a mapping item when in a sequence'); } $context = 'mapping'; // force correct settings Inline::parse(null, $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); try { $key = Inline::parseScalar($values['key']); } catch (ParseException $e) { $e->setParsedLine($this->getRealCurrentLineNb() + 1); $e->setSnippet($this->currentLine); throw $e; } if ('<<' === $key) { $mergeNode = true; $allowOverwrite = true; if (isset($values['value']) && 0 === strpos($values['value'], '*')) { $refName = substr($values['value'], 1); if (!array_key_exists($refName, $this->refs)) { throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine); } $refValue = $this->refs[$refName]; if (!is_array($refValue)) { throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); } foreach ($refValue as $key => $value) { if (!isset($data[$key])) { $data[$key] = $value; } } } else { if (isset($values['value']) && $values['value'] !== '') { $value = $values['value']; } else { $value = $this->getNextEmbedBlock(); } $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); $parser->refs = & $this->refs; $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap); if (!is_array($parsed)) { throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); } if (isset($parsed[0])) { // If the value associated with the merge key is a sequence, then this sequence is expected to contain mapping nodes // and each of these nodes is merged in turn according to its order in the sequence. Keys in mapping nodes earlier // in the sequence override keys specified in later mapping nodes. foreach ($parsed as $parsedItem) { if (!is_array($parsedItem)) { throw new ParseException('Merge items must be arrays.', $this->getRealCurrentLineNb() + 1, $parsedItem); } foreach ($parsedItem as $key => $value) { if (!isset($data[$key])) { $data[$key] = $value; } } } } else { // If the value associated with the key is a single mapping node, each of its key/value pairs is inserted into the // current mapping, unless the key already exists in it. foreach ($parsed as $key => $value) { if (!isset($data[$key])) { $data[$key] = $value; } } } } } elseif (isset($values['value']) && preg_match('#^&(?P<ref>[^ ]+) *(?P<value>.*)#u', $values['value'], $matches)) { $isRef = $matches['ref']; $values['value'] = $matches['value']; } if ($mergeNode) { // Merge keys } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { // hash // if next line is less indented or equal, then it means that the current value is null if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { // Spec: Keys MUST be unique; first one wins. // But overwriting is allowed when a merge node is used in current block. if ($allowOverwrite || !isset($data[$key])) { $data[$key] = null; } } else { $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); $parser->refs = & $this->refs; $value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap); // Spec: Keys MUST be unique; first one wins. // But overwriting is allowed when a merge node is used in current block. if ($allowOverwrite || !isset($data[$key])) { $data[$key] = $value; } } } else { $value = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport, $objectForMap); // Spec: Keys MUST be unique; first one wins. // But overwriting is allowed when a merge node is used in current block. if ($allowOverwrite || !isset($data[$key])) { $data[$key] = $value; } } } else { // multiple documents are not supported if ('---' === $this->currentLine) { throw new ParseException('Multiple documents are not supported.'); } // 1-liner optionally followed by newline $lineCount = count($this->lines); if (1 === $lineCount || (2 === $lineCount && empty($this->lines[1]))) { try { $value = Inline::parse($this->lines[0], $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); } catch (ParseException $e) { $e->setParsedLine($this->getRealCurrentLineNb() + 1); $e->setSnippet($this->currentLine); throw $e; } if (is_array($value)) { $first = reset($value); if (is_string($first) && 0 === strpos($first, '*')) { $data = array(); foreach ($value as $alias) { $data[] = $this->refs[substr($alias, 1)]; } $value = $data; } } if (isset($mbEncoding)) { mb_internal_encoding($mbEncoding); } return $value; } switch (preg_last_error()) { case PREG_INTERNAL_ERROR: $error = 'Internal PCRE error.'; break; case PREG_BACKTRACK_LIMIT_ERROR: $error = 'pcre.backtrack_limit reached.'; break; case PREG_RECURSION_LIMIT_ERROR: $error = 'pcre.recursion_limit reached.'; break; case PREG_BAD_UTF8_ERROR: $error = 'Malformed UTF-8 data.'; break; case PREG_BAD_UTF8_OFFSET_ERROR: $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; break; default: $error = 'Unable to parse.'; } throw new ParseException($error, $this->getRealCurrentLineNb() + 1, $this->currentLine); } if ($isRef) { $this->refs[$isRef] = end($data); } } if (isset($mbEncoding)) { mb_internal_encoding($mbEncoding); } return empty($data) ? null : $data; } /** * Returns the current line number (takes the offset into account). * * @return int The current line number */ private function getRealCurrentLineNb() { return $this->currentLineNb + $this->offset; } /** * Returns the current line indentation. * * @return int The current line indentation */ private function getCurrentLineIndentation() { return strlen($this->currentLine) - strlen(ltrim($this->currentLine, ' ')); } /** * Returns the next embed block of YAML. * * @param int $indentation The indent level at which the block is to be read, or null for default * @param bool $inSequence True if the enclosing data structure is a sequence * * @return string A YAML string * * @throws ParseException When indentation problem are detected */ private function getNextEmbedBlock($indentation = null, $inSequence = false) { $oldLineIndentation = $this->getCurrentLineIndentation(); if (!$this->moveToNextLine()) { return; } if (null === $indentation) { $newIndent = $this->getCurrentLineIndentation(); $unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem($this->currentLine); if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) { throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); } } else { $newIndent = $indentation; } $data = array(substr($this->currentLine, $newIndent)); if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) { // the previous line contained a dash but no item content, this line is a sequence item with the same indentation // and therefore no nested list or mapping $this->moveToPreviousLine(); return; } $isItUnindentedCollection = $this->isStringUnIndentedCollectionItem($this->currentLine); // Comments must not be removed inside a string block (ie. after a line ending with "|") $removeCommentsPattern = '~'.self::FOLDED_SCALAR_PATTERN.'$~'; $removeComments = !preg_match($removeCommentsPattern, $this->currentLine); while ($this->moveToNextLine()) { $indent = $this->getCurrentLineIndentation(); if ($indent === $newIndent) { $removeComments = !preg_match($removeCommentsPattern, $this->currentLine); } if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine)) { $this->moveToPreviousLine(); break; } if ($this->isCurrentLineBlank()) { $data[] = substr($this->currentLine, $newIndent); continue; } if ($removeComments && $this->isCurrentLineComment()) { continue; } if ($indent >= $newIndent) { $data[] = substr($this->currentLine, $newIndent); } elseif (0 == $indent) { $this->moveToPreviousLine(); break; } else { throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine); } } return implode("\n", $data); } /** * Moves the parser to the next line. * * @return bool */ private function moveToNextLine() { if ($this->currentLineNb >= count($this->lines) - 1) { return false; } $this->currentLine = $this->lines[++$this->currentLineNb]; return true; } /** * Moves the parser to the previous line. */ private function moveToPreviousLine() { $this->currentLine = $this->lines[--$this->currentLineNb]; } /** * Parses a YAML value. * * @param string $value A YAML value * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise * @param bool $objectSupport True if object support is enabled, false otherwise * @param bool $objectForMap true if maps should return a stdClass instead of array() * * @return mixed A PHP value * * @throws ParseException When reference does not exist */ private function parseValue($value, $exceptionOnInvalidType, $objectSupport, $objectForMap) { if (0 === strpos($value, '*')) { if (false !== $pos = strpos($value, '#')) { $value = substr($value, 1, $pos - 2); } else { $value = substr($value, 1); } if (!array_key_exists($value, $this->refs)) { throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLine); } return $this->refs[$value]; } if (preg_match('/^'.self::FOLDED_SCALAR_PATTERN.'$/', $value, $matches)) { $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), intval(abs($modifiers))); } try { return Inline::parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); } catch (ParseException $e) { $e->setParsedLine($this->getRealCurrentLineNb() + 1); $e->setSnippet($this->currentLine); throw $e; } } /** * Parses a folded scalar. * * @param string $separator The separator that was used to begin this folded scalar (| or >) * @param string $indicator The indicator that was used to begin this folded scalar (+ or -) * @param int $indentation The indentation that was used to begin this folded scalar * * @return string The text value */ private function parseFoldedScalar($separator, $indicator = '', $indentation = 0) { $notEOF = $this->moveToNextLine(); if (!$notEOF) { return ''; } $isCurrentLineBlank = $this->isCurrentLineBlank(); $text = ''; // leading blank lines are consumed before determining indentation while ($notEOF && $isCurrentLineBlank) { // newline only if not EOF if ($notEOF = $this->moveToNextLine()) { $text .= "\n"; $isCurrentLineBlank = $this->isCurrentLineBlank(); } } // determine indentation if not specified if (0 === $indentation) { if (preg_match('/^ +/', $this->currentLine, $matches)) { $indentation = strlen($matches[0]); } } if ($indentation > 0) { $pattern = sprintf('/^ {%d}(.*)$/', $indentation); while ( $notEOF && ( $isCurrentLineBlank || preg_match($pattern, $this->currentLine, $matches) ) ) { if ($isCurrentLineBlank) { $text .= substr($this->currentLine, $indentation); } else { $text .= $matches[1]; } // newline only if not EOF if ($notEOF = $this->moveToNextLine()) { $text .= "\n"; $isCurrentLineBlank = $this->isCurrentLineBlank(); } } } elseif ($notEOF) { $text .= "\n"; } if ($notEOF) { $this->moveToPreviousLine(); } // replace all non-trailing single newlines with spaces in folded blocks if ('>' === $separator) { preg_match('/(\n*)$/', $text, $matches); $text = preg_replace('/(?<!\n)\n(?!\n)/', ' ', rtrim($text, "\n")); $text .= $matches[1]; } // deal with trailing newlines as indicated if ('' === $indicator) { $text = preg_replace('/\n+$/s', "\n", $text); } elseif ('-' === $indicator) { $text = preg_replace('/\n+$/s', '', $text); } return $text; } /** * Returns true if the next line is indented. * * @return bool Returns true if the next line is indented, false otherwise */ private function isNextLineIndented() { $currentIndentation = $this->getCurrentLineIndentation(); $EOF = !$this->moveToNextLine(); while (!$EOF && $this->isCurrentLineEmpty()) { $EOF = !$this->moveToNextLine(); } if ($EOF) { return false; } $ret = false; if ($this->getCurrentLineIndentation() > $currentIndentation) { $ret = true; } $this->moveToPreviousLine(); return $ret; } /** * Returns true if the current line is blank or if it is a comment line. * * @return bool Returns true if the current line is empty or if it is a comment line, false otherwise */ private function isCurrentLineEmpty() { return $this->isCurrentLineBlank() || $this->isCurrentLineComment(); } /** * Returns true if the current line is blank. * * @return bool Returns true if the current line is blank, false otherwise */ private function isCurrentLineBlank() { return '' == trim($this->currentLine, ' '); } /** * Returns true if the current line is a comment line. * * @return bool Returns true if the current line is a comment line, false otherwise */ private function isCurrentLineComment() { //checking explicitly the first char of the trim is faster than loops or strpos $ltrimmedLine = ltrim($this->currentLine, ' '); return $ltrimmedLine[0] === '#'; } /** * Cleanups a YAML string to be parsed. * * @param string $value The input YAML string * * @return string A cleaned up YAML string */ private function cleanup($value) { $value = str_replace(array("\r\n", "\r"), "\n", $value); // strip YAML header $count = 0; $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#su', '', $value, -1, $count); $this->offset += $count; // remove leading comments $trimmedValue = preg_replace('#^(\#.*?\n)+#s', '', $value, -1, $count); if ($count == 1) { // items have been removed, update the offset $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); $value = $trimmedValue; } // remove start of the document marker (---) $trimmedValue = preg_replace('#^\-\-\-.*?\n#s', '', $value, -1, $count); if ($count == 1) { // items have been removed, update the offset $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); $value = $trimmedValue; // remove end of the document marker (...) $value = preg_replace('#\.\.\.\s*$#s', '', $value); } return $value; } /** * Returns true if the next line starts unindented collection * * @return bool Returns true if the next line starts unindented collection, false otherwise */ private function isNextLineUnIndentedCollection() { $currentIndentation = $this->getCurrentLineIndentation(); $notEOF = $this->moveToNextLine(); while ($notEOF && $this->isCurrentLineEmpty()) { $notEOF = $this->moveToNextLine(); } if (false === $notEOF) { return false; } $ret = false; if ( $this->getCurrentLineIndentation() == $currentIndentation && $this->isStringUnIndentedCollectionItem($this->currentLine) ) { $ret = true; } $this->moveToPreviousLine(); return $ret; } /** * Returns true if the string is un-indented collection item * * @return bool Returns true if the string is un-indented collection item, false otherwise */ private function isStringUnIndentedCollectionItem() { return (0 === strpos($this->currentLine, '- ')); } } PK���\�|�-��Slibraries/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/RuntimeException.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml\Exception; /** * Exception class thrown when an error occurs during parsing. * * @author Romain Neutron <imprec@gmail.com> * * @api */ class RuntimeException extends \RuntimeException implements ExceptionInterface { } PK���\�79�Qlibraries/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ParseException.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml\Exception; /** * Exception class thrown when an error occurs during parsing. * * @author Fabien Potencier <fabien@symfony.com> * * @api */ class ParseException extends RuntimeException { private $parsedFile; private $parsedLine; private $snippet; private $rawMessage; /** * Constructor. * * @param string $message The error message * @param int $parsedLine The line where the error occurred * @param int $snippet The snippet of code near the problem * @param string $parsedFile The file name where the error occurred * @param \Exception $previous The previous exception */ public function __construct($message, $parsedLine = -1, $snippet = null, $parsedFile = null, \Exception $previous = null) { $this->parsedFile = $parsedFile; $this->parsedLine = $parsedLine; $this->snippet = $snippet; $this->rawMessage = $message; $this->updateRepr(); parent::__construct($this->message, 0, $previous); } /** * Gets the snippet of code near the error. * * @return string The snippet of code */ public function getSnippet() { return $this->snippet; } /** * Sets the snippet of code near the error. * * @param string $snippet The code snippet */ public function setSnippet($snippet) { $this->snippet = $snippet; $this->updateRepr(); } /** * Gets the filename where the error occurred. * * This method returns null if a string is parsed. * * @return string The filename */ public function getParsedFile() { return $this->parsedFile; } /** * Sets the filename where the error occurred. * * @param string $parsedFile The filename */ public function setParsedFile($parsedFile) { $this->parsedFile = $parsedFile; $this->updateRepr(); } /** * Gets the line where the error occurred. * * @return int The file line */ public function getParsedLine() { return $this->parsedLine; } /** * Sets the line where the error occurred. * * @param int $parsedLine The file line */ public function setParsedLine($parsedLine) { $this->parsedLine = $parsedLine; $this->updateRepr(); } private function updateRepr() { $this->message = $this->rawMessage; $dot = false; if ('.' === substr($this->message, -1)) { $this->message = substr($this->message, 0, -1); $dot = true; } if (null !== $this->parsedFile) { if (PHP_VERSION_ID >= 50400) { $jsonOptions = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; } else { $jsonOptions = 0; } $this->message .= sprintf(' in %s', json_encode($this->parsedFile, $jsonOptions)); } if ($this->parsedLine >= 0) { $this->message .= sprintf(' at line %d', $this->parsedLine); } if ($this->snippet) { $this->message .= sprintf(' (near "%s")', $this->snippet); } if ($dot) { $this->message .= '.'; } } } PK���\ؙ՚��Plibraries/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/DumpException.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml\Exception; /** * Exception class thrown when an error occurs during dumping. * * @author Fabien Potencier <fabien@symfony.com> * * @api */ class DumpException extends RuntimeException { } PK���\�+�l��Ulibraries/vendor/symfony/yaml/Symfony/Component/Yaml/Exception/ExceptionInterface.phpnu�[���<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml\Exception; /** * Exception interface for all exceptions thrown by the component. * * @author Fabien Potencier <fabien@symfony.com> * * @api */ interface ExceptionInterface { } PK���\�բC�0�0;libraries/vendor/ircmaxell/password-compat/lib/password.phpnu�[���<?php /** * A Compatibility library with PHP 5.5's simplified password hashing API. * * @author Anthony Ferrara <ircmaxell@php.net> * @license http://www.opensource.org/licenses/mit-license.html MIT License * @copyright 2012 The Authors */ namespace { if (!defined('PASSWORD_BCRYPT')) { /** * PHPUnit Process isolation caches constants, but not function declarations. * So we need to check if the constants are defined separately from * the functions to enable supporting process isolation in userland * code. */ define('PASSWORD_BCRYPT', 1); define('PASSWORD_DEFAULT', PASSWORD_BCRYPT); define('PASSWORD_BCRYPT_DEFAULT_COST', 10); } if (!function_exists('password_hash')) { /** * Hash the password using the specified algorithm * * @param string $password The password to hash * @param int $algo The algorithm to use (Defined by PASSWORD_* constants) * @param array $options The options for the algorithm to use * * @return string|false The hashed password, or false on error. */ function password_hash($password, $algo, array $options = array()) { if (!function_exists('crypt')) { trigger_error("Crypt must be loaded for password_hash to function", E_USER_WARNING); return null; } if (is_null($password) || is_int($password)) { $password = (string) $password; } if (!is_string($password)) { trigger_error("password_hash(): Password must be a string", E_USER_WARNING); return null; } if (!is_int($algo)) { trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING); return null; } $resultLength = 0; switch ($algo) { case PASSWORD_BCRYPT: $cost = PASSWORD_BCRYPT_DEFAULT_COST; if (isset($options['cost'])) { $cost = $options['cost']; if ($cost < 4 || $cost > 31) { trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING); return null; } } // The length of salt to generate $raw_salt_len = 16; // The length required in the final serialization $required_salt_len = 22; $hash_format = sprintf("$2y$%02d$", $cost); // The expected length of the final crypt() output $resultLength = 60; break; default: trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING); return null; } $salt_requires_encoding = false; if (isset($options['salt'])) { switch (gettype($options['salt'])) { case 'NULL': case 'boolean': case 'integer': case 'double': case 'string': $salt = (string) $options['salt']; break; case 'object': if (method_exists($options['salt'], '__tostring')) { $salt = (string) $options['salt']; break; } case 'array': case 'resource': default: trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING); return null; } if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) { trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING); return null; } elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) { $salt_requires_encoding = true; } } else { $buffer = ''; $buffer_valid = false; if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) { $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM); if ($buffer) { $buffer_valid = true; } } if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) { $buffer = openssl_random_pseudo_bytes($raw_salt_len); if ($buffer) { $buffer_valid = true; } } if (!$buffer_valid && @is_readable('/dev/urandom')) { $f = fopen('/dev/urandom', 'r'); $read = PasswordCompat\binary\_strlen($buffer); while ($read < $raw_salt_len) { $buffer .= fread($f, $raw_salt_len - $read); $read = PasswordCompat\binary\_strlen($buffer); } fclose($f); if ($read >= $raw_salt_len) { $buffer_valid = true; } } if (!$buffer_valid || PasswordCompat\binary\_strlen($buffer) < $raw_salt_len) { $bl = PasswordCompat\binary\_strlen($buffer); for ($i = 0; $i < $raw_salt_len; $i++) { if ($i < $bl) { $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255)); } else { $buffer .= chr(mt_rand(0, 255)); } } } $salt = $buffer; $salt_requires_encoding = true; } if ($salt_requires_encoding) { // encode string with the Base64 variant used by crypt $base64_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; $bcrypt64_digits = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $base64_string = base64_encode($salt); $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits); } $salt = PasswordCompat\binary\_substr($salt, 0, $required_salt_len); $hash = $hash_format . $salt; $ret = crypt($password, $hash); if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != $resultLength) { return false; } return $ret; } /** * Get information about the password hash. Returns an array of the information * that was used to generate the password hash. * * array( * 'algo' => 1, * 'algoName' => 'bcrypt', * 'options' => array( * 'cost' => PASSWORD_BCRYPT_DEFAULT_COST, * ), * ) * * @param string $hash The password hash to extract info from * * @return array The array of information about the hash. */ function password_get_info($hash) { $return = array( 'algo' => 0, 'algoName' => 'unknown', 'options' => array(), ); if (PasswordCompat\binary\_substr($hash, 0, 4) == '$2y$' && PasswordCompat\binary\_strlen($hash) == 60) { $return['algo'] = PASSWORD_BCRYPT; $return['algoName'] = 'bcrypt'; list($cost) = sscanf($hash, "$2y$%d$"); $return['options']['cost'] = $cost; } return $return; } /** * Determine if the password hash needs to be rehashed according to the options provided * * If the answer is true, after validating the password using password_verify, rehash it. * * @param string $hash The hash to test * @param int $algo The algorithm used for new password hashes * @param array $options The options array passed to password_hash * * @return boolean True if the password needs to be rehashed. */ function password_needs_rehash($hash, $algo, array $options = array()) { $info = password_get_info($hash); if ($info['algo'] != $algo) { return true; } switch ($algo) { case PASSWORD_BCRYPT: $cost = isset($options['cost']) ? $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST; if ($cost != $info['options']['cost']) { return true; } break; } return false; } /** * Verify a password against a hash using a timing attack resistant approach * * @param string $password The password to verify * @param string $hash The hash to verify against * * @return boolean If the password matches the hash */ function password_verify($password, $hash) { if (!function_exists('crypt')) { trigger_error("Crypt must be loaded for password_verify to function", E_USER_WARNING); return false; } $ret = crypt($password, $hash); if (!is_string($ret) || PasswordCompat\binary\_strlen($ret) != PasswordCompat\binary\_strlen($hash) || PasswordCompat\binary\_strlen($ret) <= 13) { return false; } $status = 0; for ($i = 0; $i < PasswordCompat\binary\_strlen($ret); $i++) { $status |= (ord($ret[$i]) ^ ord($hash[$i])); } return $status === 0; } } } namespace PasswordCompat\binary { if (!function_exists('PasswordCompat\\binary\\_strlen')) { /** * Count the number of bytes in a string * * We cannot simply use strlen() for this, because it might be overwritten by the mbstring extension. * In this case, strlen() will count the number of *characters* based on the internal encoding. A * sequence of bytes might be regarded as a single multibyte character. * * @param string $binary_string The input string * * @internal * @return int The number of bytes */ function _strlen($binary_string) { if (function_exists('mb_strlen')) { return mb_strlen($binary_string, '8bit'); } return strlen($binary_string); } /** * Get a substring based on byte limits * * @see _strlen() * * @param string $binary_string The input string * @param int $start * @param int $length * * @internal * @return string The substring */ function _substr($binary_string, $start, $length) { if (function_exists('mb_substr')) { return mb_substr($binary_string, $start, $length, '8bit'); } return substr($binary_string, $start, $length); } /** * Check if current PHP version is compatible with the library * * @return boolean the check result */ function check() { static $pass = NULL; if (is_null($pass)) { if (function_exists('crypt')) { $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG'; $test = crypt("password", $hash); $pass = $test == $hash; } else { $pass = false; } } return $pass; } } }PK���\Ճ!""5libraries/vendor/ircmaxell/password-compat/LICENSE.mdnu�[���Copyright (c) 2012 Anthony Ferrara Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.PK���\�i�11+libraries/vendor/composer/autoload_real.phpnu�[���<?php // autoload_real.php @generated by Composer class ComposerAutoloaderInitf9aed076f12471aff0049364a504b3f7 { private static $loader; public static function loadClassLoader($class) { if ('Composer\Autoload\ClassLoader' === $class) { require __DIR__ . '/ClassLoader.php'; } } public static function getLoader() { if (null !== self::$loader) { return self::$loader; } spl_autoload_register(array('ComposerAutoloaderInitf9aed076f12471aff0049364a504b3f7', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInitf9aed076f12471aff0049364a504b3f7', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { $loader->set($namespace, $path); } $map = require __DIR__ . '/autoload_psr4.php'; foreach ($map as $namespace => $path) { $loader->setPsr4($namespace, $path); } $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { $loader->addClassMap($classMap); } $loader->register(true); $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { composerRequiref9aed076f12471aff0049364a504b3f7($file); } return $loader; } } function composerRequiref9aed076f12471aff0049364a504b3f7($file) { require $file; } PK���\&��`[[1libraries/vendor/composer/autoload_namespaces.phpnu�[���<?php // autoload_namespaces.php @generated by Composer $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname(dirname($vendorDir)); return array( 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), 'Psr\\Log\\' => array($vendorDir . '/psr/log'), 'Joomla\\Session' => array($vendorDir . '/joomla/session'), ); PK���\�剧��,libraries/vendor/composer/autoload_files.phpnu�[���<?php // autoload_files.php @generated by Composer $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname(dirname($vendorDir)); return array( $vendorDir . '/ircmaxell/password-compat/lib/password.php', ); PK���\&��=�0�0)libraries/vendor/composer/ClassLoader.phpnu�[���<?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Autoload; /** * ClassLoader implements a PSR-0 class loader * * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md * * $loader = new \Composer\Autoload\ClassLoader(); * * // register classes with namespaces * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * * // activate the autoloader * $loader->register(); * * // to enable searching the include path (eg. for PEAR packages) * $loader->setUseIncludePath(true); * * In this example, if you try to use a class in the Symfony\Component * namespace or one of its children (Symfony\Component\Console for instance), * the autoloader will first look for the class under the component/ * directory, and it will then fallback to the framework/ directory if not * found before giving up. * * This class is loosely based on the Symfony UniversalClassLoader. * * @author Fabien Potencier <fabien@symfony.com> * @author Jordi Boggiano <j.boggiano@seld.be> */ class ClassLoader { // PSR-4 private $prefixLengthsPsr4 = array(); private $prefixDirsPsr4 = array(); private $fallbackDirsPsr4 = array(); // PSR-0 private $prefixesPsr0 = array(); private $fallbackDirsPsr0 = array(); private $useIncludePath = false; private $classMap = array(); private $classMapAuthoritative = false; public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', $this->prefixesPsr0); } return array(); } public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } public function getFallbackDirs() { return $this->fallbackDirsPsr0; } public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } public function getClassMap() { return $this->classMap; } /** * @param array $classMap Class to filename map */ public function addClassMap(array $classMap) { if ($this->classMap) { $this->classMap = array_merge($this->classMap, $classMap); } else { $this->classMap = $classMap; } } /** * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * * @param string $prefix The prefix * @param array|string $paths The PSR-0 root directories * @param bool $prepend Whether to prepend the directories */ public function add($prefix, $paths, $prepend = false) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $paths ); } } /** * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param array|string $paths The PSR-0 base directories * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException */ public function addPsr4($prefix, $paths, $prepend = false) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { // Register directories for a new namespace. $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $paths ); } } /** * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * * @param string $prefix The prefix * @param array|string $paths The PSR-0 base directories */ public function set($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr0 = (array) $paths; } else { $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; } } /** * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * * @param string $prefix The prefix/namespace, with trailing '\\' * @param array|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException */ public function setPsr4($prefix, $paths) { if (!$prefix) { $this->fallbackDirsPsr4 = (array) $paths; } else { $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixDirsPsr4[$prefix] = (array) $paths; } } /** * Turns on searching the include path for class files. * * @param bool $useIncludePath */ public function setUseIncludePath($useIncludePath) { $this->useIncludePath = $useIncludePath; } /** * Can be used to check if the autoloader uses the include path to check * for classes. * * @return bool */ public function getUseIncludePath() { return $this->useIncludePath; } /** * Turns off searching the prefix and fallback directories for classes * that have not been registered with the class map. * * @param bool $classMapAuthoritative */ public function setClassMapAuthoritative($classMapAuthoritative) { $this->classMapAuthoritative = $classMapAuthoritative; } /** * Should class lookup fail if not found in the current class map? * * @return bool */ public function isClassMapAuthoritative() { return $this->classMapAuthoritative; } /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); } /** * Unregisters this instance as an autoloader. */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); } /** * Loads the given class or interface. * * @param string $class The name of the class * @return bool|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { includeFile($file); return true; } } /** * Finds the path to the file where the class is defined. * * @param string $class The name of the class * * @return string|false The path if found, false otherwise */ public function findFile($class) { // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 if ('\\' == $class[0]) { $class = substr($class, 1); } // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative) { return false; } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM if ($file === null && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } if ($file === null) { // Remember that this class does not exist. return $this->classMap[$class] = false; } return $file; } private function findFileWithExtension($class, $ext) { // PSR-4 lookup $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { if (0 === strpos($class, $prefix)) { foreach ($this->prefixDirsPsr4[$prefix] as $dir) { if (is_file($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { return $file; } } } } } // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } // PSR-0 lookup if (false !== $pos = strrpos($class, '\\')) { // namespaced class name $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); } else { // PEAR-like class name $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; } if (isset($this->prefixesPsr0[$first])) { foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } } } } // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } // PSR-0 include paths. if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } } } /** * Scope isolated include. * * Prevents access to $this/self from included files. */ function includeFile($file) { include $file; } PK���\<�N�~~/libraries/vendor/composer/autoload_classmap.phpnu�[���<?php // autoload_classmap.php @generated by Composer $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname(dirname($vendorDir)); return array( 'JsonSerializable' => $vendorDir . '/joomla/compat/src/JsonSerializable.php', 'PHPMailer' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php', 'POP3' => $vendorDir . '/phpmailer/phpmailer/class.pop3.php', 'SMTP' => $vendorDir . '/phpmailer/phpmailer/class.smtp.php', 'lessc' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_classic' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_compressed' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_lessjs' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_parser' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'phpmailerException' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php', ); PK���\�R@�]�](libraries/vendor/composer/installed.jsonnu�[���[ { "name": "joomla/compat", "version": "1.1.1", "version_normalized": "1.1.1.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/compat.git", "reference": "92ba45e9cfdca4c912691bf04ef13e0c03660348" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/compat/zipball/92ba45e9cfdca4c912691bf04ef13e0c03660348", "reference": "92ba45e9cfdca4c912691bf04ef13e0c03660348", "shasum": "" }, "require": { "php": ">=5.3.10" }, "time": "2014-02-09 19:29:20", "type": "joomla-package", "installation-source": "dist", "autoload": { "classmap": [ "src/JsonSerializable.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla Compat Package", "homepage": "https://github.com/joomla-framework/compat", "keywords": [ "compat", "framework", "joomla" ] }, { "name": "psr/log", "version": "1.0.0", "version_normalized": "1.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", "shasum": "" }, "time": "2012-12-21 11:40:51", "type": "library", "installation-source": "dist", "autoload": { "psr-0": { "Psr\\Log\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", "homepage": "http://www.php-fig.org/" } ], "description": "Common interface for logging libraries", "keywords": [ "log", "psr", "psr-3" ] }, { "name": "joomla/uri", "version": "1.1.1", "version_normalized": "1.1.1.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/uri.git", "reference": "980e532e4235bb8f1ada15b28822abbeb171da3f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/uri/zipball/980e532e4235bb8f1ada15b28822abbeb171da3f", "reference": "980e532e4235bb8f1ada15b28822abbeb171da3f", "shasum": "" }, "require": { "php": ">=5.3.10" }, "time": "2014-02-09 02:57:17", "type": "joomla-package", "installation-source": "dist", "autoload": { "psr-4": { "Joomla\\Uri\\": "src/", "Joomla\\Uri\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla Uri Package", "homepage": "https://github.com/joomla-framework/uri", "keywords": [ "framework", "joomla", "uri" ] }, { "name": "joomla/event", "version": "1.1.1", "version_normalized": "1.1.1.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/event.git", "reference": "bb957bc45aba897e465384bbe21cd0eb79aca901" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/event/zipball/bb957bc45aba897e465384bbe21cd0eb79aca901", "reference": "bb957bc45aba897e465384bbe21cd0eb79aca901", "shasum": "" }, "require": { "php": ">=5.3.10" }, "time": "2014-02-09 01:30:54", "type": "joomla-package", "installation-source": "dist", "autoload": { "psr-4": { "Joomla\\Event\\": "src/", "Joomla\\Event\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla Event Package", "homepage": "https://github.com/joomla-framework/event", "keywords": [ "event", "framework", "joomla" ] }, { "name": "joomla/session", "version": "1.2.3", "version_normalized": "1.2.3.0", "target-dir": "Joomla/Session", "source": { "type": "git", "url": "https://github.com/joomla-framework/session.git", "reference": "ef955cf9642793c4ad5874f334069051c33ba604" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/session/zipball/ef955cf9642793c4ad5874f334069051c33ba604", "reference": "ef955cf9642793c4ad5874f334069051c33ba604", "shasum": "" }, "require": { "joomla/event": "~1.1", "joomla/filter": "~1.0", "php": ">=5.3.10" }, "require-dev": { "joomla/test": "~1.0" }, "suggest": { "joomla/database": "Install joomla/database if you want to use Database session storage." }, "time": "2014-08-18 17:41:06", "type": "joomla-package", "installation-source": "dist", "autoload": { "psr-0": { "Joomla\\Session": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla Session Package", "homepage": "https://github.com/joomla-framework/session", "keywords": [ "framework", "joomla", "session" ] }, { "name": "leafo/lessphp", "version": "v0.3.9", "version_normalized": "0.3.9.0", "source": { "type": "git", "url": "https://github.com/leafo/lessphp.git", "reference": "a11a6141b5715162b933c405379765d817891c5d" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/leafo/lessphp/zipball/a11a6141b5715162b933c405379765d817891c5d", "reference": "a11a6141b5715162b933c405379765d817891c5d", "shasum": "" }, "time": "2013-03-02 16:13:31", "type": "library", "extra": { "branch-alias": { "dev-master": "0.3-dev" } }, "installation-source": "dist", "autoload": { "classmap": [ "lessc.inc.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT", "GPL-3.0" ], "authors": [ { "name": "Leaf Corcoran", "email": "leafot@gmail.com", "homepage": "http://leafo.net" } ], "description": "lessphp is a compiler for LESS written in PHP.", "homepage": "http://leafo.net/lessphp/" }, { "name": "joomla/input", "version": "1.2.0", "version_normalized": "1.2.0.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/input.git", "reference": "b6098276043e2d627221fe54d3c91232e6679d0f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/input/zipball/b6098276043e2d627221fe54d3c91232e6679d0f", "reference": "b6098276043e2d627221fe54d3c91232e6679d0f", "shasum": "" }, "require": { "joomla/filter": "~1.0", "php": ">=5.3.10" }, "require-dev": { "joomla/test": "~1.0", "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*" }, "time": "2014-10-12 18:01:36", "type": "joomla-package", "extra": { "branch-alias": { "dev-master": "1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { "Joomla\\Input\\": "src/", "Joomla\\Input\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla Input Package", "homepage": "https://github.com/joomla-framework/input", "keywords": [ "framework", "input", "joomla" ] }, { "name": "joomla/application", "version": "1.3.0", "version_normalized": "1.3.0.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/application.git", "reference": "b7745273664294387bdd7fb694d75e65b7491f28" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/application/zipball/b7745273664294387bdd7fb694d75e65b7491f28", "reference": "b7745273664294387bdd7fb694d75e65b7491f28", "shasum": "" }, "require": { "joomla/input": "~1.2", "joomla/registry": "~1.1", "joomla/session": "~1.1", "joomla/string": "~1.1", "joomla/uri": "~1.1", "php": ">=5.3.10", "psr/log": "~1.0" }, "require-dev": { "joomla/test": "~1.1", "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*" }, "time": "2014-10-13 12:43:54", "type": "joomla-package", "extra": { "branch-alias": { "dev-master": "1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { "Joomla\\Application\\": "src/", "Joomla\\Application\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla Application Package", "homepage": "https://github.com/joomla-framework/application", "keywords": [ "application", "framework", "joomla" ] }, { "name": "ircmaxell/password-compat", "version": "v1.0.4", "version_normalized": "1.0.4.0", "source": { "type": "git", "url": "https://github.com/ircmaxell/password_compat.git", "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", "shasum": "" }, "require-dev": { "phpunit/phpunit": "4.*" }, "time": "2014-11-20 16:49:30", "type": "library", "installation-source": "dist", "autoload": { "files": [ "lib/password.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Anthony Ferrara", "email": "ircmaxell@php.net", "homepage": "http://blog.ircmaxell.com" } ], "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", "homepage": "https://github.com/ircmaxell/password_compat", "keywords": [ "hashing", "password" ] }, { "name": "phpmailer/phpmailer", "version": "v5.2.9", "version_normalized": "5.2.9.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", "reference": "73b61679809615850706f1dbf88e6df2ddc05745" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/73b61679809615850706f1dbf88e6df2ddc05745", "reference": "73b61679809615850706f1dbf88e6df2ddc05745", "shasum": "" }, "require": { "php": ">=5.0.0" }, "require-dev": { "phpdocumentor/phpdocumentor": "*", "phpunit/phpunit": "4.1.*" }, "time": "2014-09-26 18:33:30", "type": "library", "installation-source": "dist", "autoload": { "classmap": [ "class.phpmailer.php", "class.pop3.php", "class.smtp.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-2.1" ], "authors": [ { "name": "Jim Jagielski", "email": "jimjag@gmail.com" }, { "name": "Marcus Bointon", "email": "phpmailer@synchromedia.co.uk" }, { "name": "Andy Prevost", "email": "codeworxtech@users.sourceforge.net" }, { "name": "Brent R. Matzelle" } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP" }, { "name": "symfony/yaml", "version": "v2.6.1", "version_normalized": "2.6.1.0", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", "shasum": "" }, "require": { "php": ">=5.3.3" }, "time": "2014-12-02 20:19:20", "type": "library", "extra": { "branch-alias": { "dev-master": "2.6-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { "Symfony\\Component\\Yaml\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" } ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com" }, { "name": "joomla/filter", "version": "1.1.4", "version_normalized": "1.1.4.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/filter.git", "reference": "30b93dd411d864a1ea3959328df74f3c9ab9e41f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/filter/zipball/30b93dd411d864a1ea3959328df74f3c9ab9e41f", "reference": "30b93dd411d864a1ea3959328df74f3c9ab9e41f", "shasum": "" }, "require": { "php": ">=5.3.10" }, "require-dev": { "joomla/language": "~1.0", "joomla/string": "~1.0", "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*" }, "suggest": { "joomla/language": "Required only if you want to use `OutputFilter::stringURLSafe`.", "joomla/string": "Required only if you want to use `OutputFilter::stringURLSafe` and `OutputFilter::stringURLUnicodeSlug`." }, "time": "2014-12-10 02:21:00", "type": "joomla-package", "extra": { "branch-alias": { "dev-master": "1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { "Joomla\\Filter\\": "src/", "Joomla\\Filter\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla Filter Package", "homepage": "https://github.com/joomla-framework/filter", "keywords": [ "filter", "framework", "joomla" ] }, { "name": "joomla/di", "version": "1.3.0", "version_normalized": "1.3.0.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/di.git", "reference": "439db4e9dac8d7fa868b0839af20dd57570accfb" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/di/zipball/439db4e9dac8d7fa868b0839af20dd57570accfb", "reference": "439db4e9dac8d7fa868b0839af20dd57570accfb", "shasum": "" }, "require": { "php": ">=5.3.10" }, "require-dev": { "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*" }, "time": "2015-01-13 15:26:48", "type": "joomla-package", "extra": { "branch-alias": { "dev-master": "1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { "Joomla\\DI\\": "src/", "Joomla\\DI\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla DI Package", "homepage": "https://github.com/joomla-framework/di", "keywords": [ "container", "dependency injection", "di", "framework", "ioc", "joomla" ] }, { "name": "joomla/string", "version": "1.2.2", "version_normalized": "1.2.2.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/string.git", "reference": "9f7b27d6b2d48d65b2fe81b5c6d72225629ad692" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/string/zipball/9f7b27d6b2d48d65b2fe81b5c6d72225629ad692", "reference": "9f7b27d6b2d48d65b2fe81b5c6d72225629ad692", "shasum": "" }, "require": { "php": ">=5.3.10" }, "require-dev": { "joomla/test": "~1.0", "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*" }, "time": "2015-03-13 12:29:00", "type": "joomla-package", "extra": { "branch-alias": { "dev-master": "1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { "Joomla\\String\\": "src/", "Joomla\\String\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla String Package", "homepage": "https://github.com/joomla-framework/string", "keywords": [ "framework", "joomla", "string" ] }, { "name": "joomla/registry", "version": "1.4.4", "version_normalized": "1.4.4.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/registry.git", "reference": "730467978ad52677903e973bb33be2306eb161eb" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/registry/zipball/730467978ad52677903e973bb33be2306eb161eb", "reference": "730467978ad52677903e973bb33be2306eb161eb", "shasum": "" }, "require": { "joomla/compat": "~1.0", "joomla/string": "~1.2", "joomla/utilities": "~1.0", "php": ">=5.3.10" }, "require-dev": { "joomla/test": "~1.0", "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*", "symfony/yaml": "~2.0" }, "suggest": { "symfony/yaml": "Install 2.* if you require YAML support." }, "time": "2015-03-16 18:49:29", "type": "joomla-package", "extra": { "branch-alias": { "dev-master": "1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { "Joomla\\Registry\\": "src/", "Joomla\\Registry\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla Registry Package", "homepage": "https://github.com/joomla-framework/registry", "keywords": [ "framework", "joomla", "registry" ] }, { "name": "joomla/utilities", "version": "1.3.2", "version_normalized": "1.3.2.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/utilities.git", "reference": "2e7f37a69162fea02059c764a318a920121f8b4a" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/joomla-framework/utilities/zipball/2e7f37a69162fea02059c764a318a920121f8b4a", "reference": "2e7f37a69162fea02059c764a318a920121f8b4a", "shasum": "" }, "require": { "joomla/string": "~1.0", "php": ">=5.3.10" }, "require-dev": { "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*" }, "time": "2015-03-16 18:50:58", "type": "joomla-package", "extra": { "branch-alias": { "dev-master": "1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { "Joomla\\Utilities\\": "src/", "Joomla\\Utilities\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], "description": "Joomla Utilities Package", "homepage": "https://github.com/joomla-framework/utilities", "keywords": [ "framework", "joomla", "utilities" ] } ] PK���\�����+libraries/vendor/composer/autoload_psr4.phpnu�[���<?php // autoload_psr4.php @generated by Composer $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname(dirname($vendorDir)); return array( 'Joomla\\Utilities\\Tests\\' => array($vendorDir . '/joomla/utilities/Tests'), 'Joomla\\Utilities\\' => array($vendorDir . '/joomla/utilities/src'), 'Joomla\\Uri\\Tests\\' => array($vendorDir . '/joomla/uri/Tests'), 'Joomla\\Uri\\' => array($vendorDir . '/joomla/uri/src'), 'Joomla\\String\\Tests\\' => array($vendorDir . '/joomla/string/Tests'), 'Joomla\\String\\' => array($vendorDir . '/joomla/string/src'), 'Joomla\\Registry\\Tests\\' => array($vendorDir . '/joomla/registry/Tests'), 'Joomla\\Registry\\' => array($vendorDir . '/joomla/registry/src'), 'Joomla\\Input\\Tests\\' => array($vendorDir . '/joomla/input/Tests'), 'Joomla\\Input\\' => array($vendorDir . '/joomla/input/src'), 'Joomla\\Filter\\Tests\\' => array($vendorDir . '/joomla/filter/Tests'), 'Joomla\\Filter\\' => array($vendorDir . '/joomla/filter/src'), 'Joomla\\Event\\Tests\\' => array($vendorDir . '/joomla/event/Tests'), 'Joomla\\Event\\' => array($vendorDir . '/joomla/event/src'), 'Joomla\\DI\\Tests\\' => array($vendorDir . '/joomla/di/Tests'), 'Joomla\\DI\\' => array($vendorDir . '/joomla/di/src'), 'Joomla\\Application\\Tests\\' => array($vendorDir . '/joomla/application/Tests'), 'Joomla\\Application\\' => array($vendorDir . '/joomla/application/src'), ); PK���\�v���includes/framework.phpnu�[���<?php /** * @package Joomla.Site * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Joomla system checks. @ini_set('magic_quotes_runtime', 0); // System includes require_once JPATH_LIBRARIES . '/import.legacy.php'; // Set system error handling JError::setErrorHandling(E_NOTICE, 'message'); JError::setErrorHandling(E_WARNING, 'message'); JError::setErrorHandling(E_ERROR, 'callback', array('JError', 'customErrorPage')); // Bootstrap the CMS libraries. require_once JPATH_LIBRARIES . '/cms.php'; $version = new JVersion; // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === $version->isInDevelopmentState()))) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { header('Location: ' . substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'index.php')) . 'installation/index.php'); exit; } else { echo 'No configuration file found and no installation code available. Exiting...'; exit; } } // Pre-Load configuration. Don't remove the Output Buffering due to BOM issues, see JCode 26026 ob_start(); require_once JPATH_CONFIGURATION . '/configuration.php'; ob_end_clean(); // System configuration. $config = new JConfig; // Set the error_reporting switch ($config->error_reporting) { case 'default': case '-1': break; case 'none': case '0': error_reporting(0); break; case 'simple': error_reporting(E_ERROR | E_WARNING | E_PARSE); ini_set('display_errors', 1); break; case 'maximum': error_reporting(E_ALL); ini_set('display_errors', 1); break; case 'development': error_reporting(-1); ini_set('display_errors', 1); break; default: error_reporting($config->error_reporting); ini_set('display_errors', 1); break; } define('JDEBUG', $config->debug); unset($config); // System profiler if (JDEBUG) { $_PROFILER = JProfiler::getInstance('Application'); } PK���\I��includes/defines.phpnu�[���<?php /** * @package Joomla.Site * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Global definitions $parts = explode(DIRECTORY_SEPARATOR, JPATH_BASE); // Defines. define('JPATH_ROOT', implode(DIRECTORY_SEPARATOR, $parts)); define('JPATH_SITE', JPATH_ROOT); define('JPATH_CONFIGURATION', JPATH_ROOT); define('JPATH_ADMINISTRATOR', JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator'); define('JPATH_LIBRARIES', JPATH_ROOT . DIRECTORY_SEPARATOR . 'libraries'); define('JPATH_PLUGINS', JPATH_ROOT . DIRECTORY_SEPARATOR . 'plugins'); define('JPATH_INSTALLATION', JPATH_ROOT . DIRECTORY_SEPARATOR . 'installation'); define('JPATH_THEMES', JPATH_BASE . DIRECTORY_SEPARATOR . 'templates'); define('JPATH_CACHE', JPATH_BASE . DIRECTORY_SEPARATOR . 'cache'); define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'manifests'); PK���\�V�includes/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\xiM�� index.phpnu�[���<?php /** * @package Joomla.Site * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ /** * Define the application's minimum supported PHP version as a constant so it can be referenced within the application. */ define('JOOMLA_MINIMUM_PHP', '5.3.10'); if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { die('Your host needs to use PHP ' . JOOMLA_MINIMUM_PHP . ' or higher to run this version of Joomla!'); } /** * Constant that is checked in included files to prevent direct access. * define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower */ define('_JEXEC', 1); if (file_exists(__DIR__ . '/defines.php')) { include_once __DIR__ . '/defines.php'; } if (!defined('_JDEFINES')) { define('JPATH_BASE', __DIR__); require_once JPATH_BASE . '/includes/defines.php'; } require_once JPATH_BASE . '/includes/framework.php'; // Mark afterLoad in the profiler. JDEBUG ? $_PROFILER->mark('afterLoad') : null; // Instantiate the application. $app = JFactory::getApplication('site'); // Execute the application. $app->execute(); PK���\y�[`cchtaccess.txtnu�[���## # @package Joomla # @copyright Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. # @license GNU General Public License version 2 or later; see LICENSE.txt ## ## # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE! # # The line just below this section: 'Options +FollowSymLinks' may cause problems # with some server configurations. It is required for use of mod_rewrite, but may already # be set by your server administrator in a way that disallows changing it in # your .htaccess file. If using it causes your server to error out, comment it out (add # to # beginning of line), reload your site in your browser and test your sef url's. If they work, # it has been set by your server administrator and you do not need it set here. ## ## No directory listings IndexIgnore * ## Can be commented out if causes errors, see notes above. Options +FollowSymlinks Options -Indexes ## Mod_rewrite in use. RewriteEngine On ## Begin - Rewrite rules to block out some common exploits. # If you experience problems on your site block out the operations listed below # This attempts to block the most common type of exploit `attempts` to Joomla! # # Block out any script trying to base64_encode data within the URL. RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] # Block out any script that includes a <script> tag in URL. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR] # Block out any script trying to set a PHP GLOBALS variable via URL. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] # Block out any script trying to modify a _REQUEST variable via URL. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) # Return 403 Forbidden header and show the content of the root homepage RewriteRule .* index.php [F] # ## End - Rewrite rules to block out some common exploits. ## Begin - Custom redirects # # If you need to redirect some pages, or set a canonical non-www to # www redirect (or vice versa), place that code here. Ensure those # redirects use the correct RewriteRule syntax and the [R=301,L] flags. # ## End - Custom redirects ## # Uncomment following line if your webserver's URL # is not directly related to physical file paths. # Update Your Joomla! Directory (just / for root). ## # RewriteBase / ## Begin - Joomla! core SEF Section. # RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # # If the requested path and file is not /index.php and the request # has not already been internally rewritten to the index.php script RewriteCond %{REQUEST_URI} !^/index\.php # and the requested path and file doesn't directly match a physical file RewriteCond %{REQUEST_FILENAME} !-f # and the requested path and file doesn't directly match a physical folder RewriteCond %{REQUEST_FILENAME} !-d # internally rewrite the request to the index.php script RewriteRule .* index.php [L] # ## End - Joomla! core SEF Section. PK���\�V�language/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\�V�language/overrides/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\/L8��(language/en-GB/en-GB.mod_banners.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_BANNERS="Banners" MOD_BANNERS_XML_DESCRIPTION="The Banner Module displays the active Banners from the Component." MOD_BANNERS_LAYOUT_DEFAULT="Default" PK���\N�&��#language/en-GB/en-GB.com_mailto.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_MAILTO="Mailto" COM_MAILTO_CANCEL="Cancel" COM_MAILTO_CLOSE_WINDOW="Close Window" COM_MAILTO_EMAIL_ERR_NOINFO="Please provide a valid email address." COM_MAILTO_EMAIL_INVALID="The address '%s' does not appear to be a valid email address." COM_MAILTO_EMAIL_MSG="This is an email from (%s) sent by %s (%s). You may also find the following link interesting: %s" COM_MAILTO_EMAIL_NOT_SENT="Email could not be sent." COM_MAILTO_EMAIL_SENT="Email was sent successfully." COM_MAILTO_EMAIL_TO="Email to" COM_MAILTO_EMAIL_TO_A_FRIEND="Email this link to a friend." COM_MAILTO_LINK_IS_MISSING="Link is missing" COM_MAILTO_SEND="Send" COM_MAILTO_SENDER="Sender" COM_MAILTO_SENT_BY="Item sent by" COM_MAILTO_SUBJECT="Subject" COM_MAILTO_YOUR_EMAIL="Your Email" PK���\$�iz22-language/en-GB/en-GB.lib_idna_convert.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 LIB_IDNA_XML_DESCRIPTION="The class idna_convert allows to convert internationalised domain names (see RFC 3490, 3491, 3492 and 3454 for details) as they can be used with various registries worldwide to be translated between their original (localised) form and their encoded form as it will be used in the DNS (Domain Name System)." PK���\^@�1��-language/en-GB/en-GB.mod_tags_similar.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_TAGS_SIMILAR="Tags - Similar" MOD_TAGS_SIMILAR_LAYOUT_DEFAULT="Default" MOD_TAGS_SIMILAR_XML_DESCRIPTION="The Similar Tags Module displays links to other items with similar tags. The closeness of the match can be specified." PK���\���Yaa'language/en-GB/en-GB.mod_search.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_SEARCH="Search" MOD_SEARCH_XML_DESCRIPTION="This module will display a search box." MOD_SEARCH_LAYOUT_DEFAULT="Default" PK���\W 8W��'language/en-GB/en-GB.lib_phpass.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 LIB_PHPASS_XML_DESCRIPTION="phpass is a portable password hashing framework for use in PHP applications. The preferred (most secure) hashing method supported by phpass is the OpenBSD-style bcrypt (known in PHP as CRYPT_BLOWFISH), with a fallback to BSDI-style extended DES-based hashes (known in PHP as CRYPT_EXT_DES) and a last resort fallback to an MD5-based variable iteration count password hashing method implemented in phpass itself." PK���\%y�%//$language/en-GB/en-GB.mod_wrapper.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_WRAPPER="Wrapper" MOD_WRAPPER_FIELD_ADD_DESC="By default, http:// will be added unless it detects http:// or https:// in the URL you provide. This allows you to switch this ability off." MOD_WRAPPER_FIELD_ADD_LABEL="Auto Add" MOD_WRAPPER_FIELD_AUTOHEIGHT_DESC="The height will automatically be set to the size of the external page. This will only work for pages on your own domain." MOD_WRAPPER_FIELD_AUTOHEIGHT_LABEL="Auto Height" MOD_WRAPPER_FIELD_HEIGHT_DESC="Height of the iframe window." MOD_WRAPPER_FIELD_HEIGHT_LABEL="Height" MOD_WRAPPER_FIELD_SCROLL_DESC="Show or hide horizontal & vertical scroll bars." MOD_WRAPPER_FIELD_SCROLL_LABEL="Scroll Bars" MOD_WRAPPER_FIELD_TARGET_DESC="Name of the iframe when used as target." MOD_WRAPPER_FIELD_TARGET_LABEL="Target Name" MOD_WRAPPER_FIELD_URL_DESC="URL to site/file you wish to display within the iframe." MOD_WRAPPER_FIELD_URL_LABEL="URL" MOD_WRAPPER_FIELD_VALUE_AUTO="Auto" MOD_WRAPPER_FIELD_WIDTH_DESC="Width of the iframe window. You can enter an absolute figure in pixels or a relative figure by adding a %." MOD_WRAPPER_FIELD_WIDTH_LABEL="Width" MOD_WRAPPER_NO_IFRAMES="No iframes" MOD_WRAPPER_XML_DESCRIPTION="This module shows an iframe window to specified location." MOD_WRAPPER_FIELD_FRAME_LABEL="Frame border" MOD_WRAPPER_FIELD_FRAME_DESC="Show frame border which wraps the iframe."PK���\@M���%language/en-GB/en-GB.com_weblinks.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_WEBLINKS_CONTENT_TYPE_WEBLINK="Web Link" COM_WEBLINKS_CONTENT_TYPE_CATEGORY="Web Links Category" COM_WEBLINKS_DEFAULT_PAGE_TITLE="Web Links" COM_WEBLINKS_EDIT="Edit Web link" COM_WEBLINKS_ERR_TABLES_NAME="There is already a Web Link with that name in this category. Please try again." COM_WEBLINKS_ERR_TABLES_PROVIDE_URL="Please provide a valid URL" COM_WEBLINKS_ERR_TABLES_TITLE="Your Web Link must contain a title." COM_WEBLINKS_ERROR_CATEGORY_NOT_FOUND="Web Link category not found." COM_WEBLINKS_ERROR_UNIQUE_ALIAS="Another Web Link from this category has the same alias (remember it may be a trashed item)." COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND="Web Link not found." COM_WEBLINKS_ERROR_WEBLINK_URL_INVALID="Invalid Web link URL." COM_WEBLINKS_FIELD_ALIAS_DESC="The alias is for internal use only. Leave this blank and Joomla will fill in a default value from the title. It has to be unique for each web link in the same category." COM_WEBLINKS_FIELD_CATEGORY_DESC="You must select a Category." COM_WEBLINKS_FIELD_DESCRIPTION_DESC="Enter a description for your Web link." COM_WEBLINKS_FILTER_LABEL="Filter Field" COM_WEBLINKS_FILTER_SEARCH_DESC="Web Links filter search" COM_WEBLINKS_FIELD_TITLE_DESC="Your Web Link must have a Title." COM_WEBLINKS_FIELD_URL_DESC="You must enter a URL." COM_WEBLINKS_FIELD_URL_LABEL="URL" COM_WEBLINKS_FORM_CREATE_WEBLINK="Submit a Web Link" COM_WEBLINKS_GRID_TITLE="Title" COM_WEBLINKS_LINK="Web Link" COM_WEBLINKS_NAME="Name" COM_WEBLINKS_NO_WEBLINKS="There are no Web Links in this category." COM_WEBLINKS_NUM="# of links:" COM_WEBLINKS_FORM_EDIT_WEBLINK="Edit a Web Link" COM_WEBLINKS_FORM_SUBMIT_WEBLINK="Submit a Web Link" COM_WEBLINKS_SAVE_SUCCESS="Web link successfully saved." COM_WEBLINKS_SUBMIT_SAVE_SUCCESS="Web Link successfully submitted." COM_WEBLINKS_WEB_LINKS="Web Links" JGLOBAL_NEWITEMSLAST_DESC="New Web Links default to the last position. Ordering can be changed after this Web Link has been saved." PK���\Zd�{ #language/en-GB/en-GB.com_config.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_CONFIG="Administrator Services" COM_CONFIG_CONFIGURATION="Administrator Services Configuration" COM_CONFIG_ERROR_CONTROLLER_NOT_FOUND="Controller Not found!" COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_DESC="Select the default access level for new content, menu items and other items created on your site." COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_LABEL="Default Access Level" COM_CONFIG_FIELD_DEFAULT_LIST_LIMIT_DESC="Sets the default length of lists in the Control Panel for all users." COM_CONFIG_FIELD_DEFAULT_LIST_LIMIT_LABEL="Default List Limit" COM_CONFIG_FIELD_METADESC_DESC="Enter a description of the overall website that is to be used by search engines. Generally, a maximum of 20 words is optimal." COM_CONFIG_FIELD_METADESC_LABEL="Site Meta Description" COM_CONFIG_FIELD_METAKEYS_DESC="Enter the keywords and phrases that best describe your website. Separate keywords and phrases with a comma." COM_CONFIG_FIELD_METAKEYS_LABEL="Site Meta Keywords" COM_CONFIG_FIELD_SEF_URL_DESC="Select whether or not the URLs are optimised for Search Engines." COM_CONFIG_FIELD_SEF_URL_LABEL="Search Engine Friendly URLs" COM_CONFIG_FIELD_SITE_NAME_DESC="Enter the name of your website. This will be used in various locations (eg the Backend browser title bar and <em>Site Offline</em> pages)." COM_CONFIG_FIELD_SITE_NAME_LABEL="Site Name" COM_CONFIG_FIELD_VALUE_AFTER="After" COM_CONFIG_FIELD_VALUE_BEFORE="Before" COM_CONFIG_FIELD_SITE_OFFLINE_DESC="Select whether access to the Site Frontend is available. If Yes, the Frontend will display a message if set such in Backend." COM_CONFIG_FIELD_SITE_OFFLINE_LABEL="Site Offline" COM_CONFIG_FIELD_SITENAME_PAGETITLES_DESC="Begin or end all Page Titles with the site name (for example, My Site Name - My Article Name)." COM_CONFIG_FIELD_SITENAME_PAGETITLES_LABEL="Include Site Name in Page Titles" COM_CONFIG_METADATA_SETTINGS="Metadata Settings" COM_CONFIG_MODULES_MODULE_NAME="Module Name" COM_CONFIG_MODULES_MODULE_TYPE="Module Type" COM_CONFIG_MODULES_SETTINGS_TITLE="Module Settings" COM_CONFIG_MODULES_SAVE_SUCCESS="Module successfully saved." COM_CONFIG_SAVE_SUCCESS="Configuration successfully saved." COM_CONFIG_SEO_SETTINGS="SEO Settings" COM_CONFIG_SITE_SETTINGS="Site Settings" COM_CONFIG_TEMPLATE_SETTINGS="Template Settings" COM_CONFIG_XML_DESCRIPTION="Frontend Administrator Services Configuration Manager." PK���\�1��.language/en-GB/en-GB.mod_related_items.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_RELATED_ITEMS="Articles - Related" MOD_RELATED_XML_DESCRIPTION="This module displays other Articles that are related to the one currently being viewed. These relations are established by the Meta keywords. <br />All the keywords of the current Article are searched against all the keywords of all other published Articles. For example, you may have an Article on "Breeding Parrots" and another on "Hand Raising Black Cockatoos". If you include the keyword "parrot" in both Articles, then the Related Items Module will list the "Breeding Parrots" Article when viewing "Hand Raising Black Cockatoos" and vice-versa." MOD_RELATED_ITEMS_LAYOUT_DEFAULT="Default"PK���\�@R�__$language/en-GB/en-GB.com_wrapper.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_WRAPPER_NO_IFRAMES="This option will not work correctly. Unfortunately, your browser does not support inline frames." PK���\�����"language/en-GB/en-GB.mod_stats.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_STATS="Statistics" MOD_STATS_ARTICLES="Articles" MOD_STATS_ARTICLES_VIEW_HITS="Articles View Hits" MOD_STATS_CACHING="Caching" MOD_STATS_FIELD_COUNTER_DESC="Display hit counter." MOD_STATS_FIELD_COUNTER_LABEL="Hit Counter" MOD_STATS_FIELD_INCREASECOUNTER_DESC="Enter the number of hits to increase the counter by." MOD_STATS_FIELD_INCREASECOUNTER_LABEL="Increase Counter" MOD_STATS_FIELD_SERVERINFO_DESC="Display server information." MOD_STATS_FIELD_SERVERINFO_LABEL="Server Information" MOD_STATS_FIELD_SITEINFO_DESC="Display site information." MOD_STATS_FIELD_SITEINFO_LABEL="Site Information" MOD_STATS_GZIP="GZip" MOD_STATS_MYSQL="MySQL" MOD_STATS_OS="OS" MOD_STATS_PHP="PHP" MOD_STATS_TIME="Time" MOD_STATS_USERS="Users" MOD_STATS_WEBLINKS="Web Links" MOD_STATS_XML_DESCRIPTION="The Statistics Module shows information about your server installation together with statistics on the website users, number of Articles in your database and the number of Web links you provide." PK���\C�c�*language/en-GB/en-GB.tpl_protostar.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 TPL_PROTOSTAR_POSITION_BANNER="Banner" TPL_PROTOSTAR_POSITION_DEBUG="Debug" TPL_PROTOSTAR_POSITION_POSITION-0="Search" TPL_PROTOSTAR_POSITION_POSITION-10="Unused" TPL_PROTOSTAR_POSITION_POSITION-11="Unused" TPL_PROTOSTAR_POSITION_POSITION-12="Unused" TPL_PROTOSTAR_POSITION_POSITION-13="Unused" TPL_PROTOSTAR_POSITION_POSITION-14="Unused" TPL_PROTOSTAR_POSITION_POSITION-15="Unused" TPL_PROTOSTAR_POSITION_POSITION-1="Navigation" TPL_PROTOSTAR_POSITION_POSITION-2="Breadcrumbs" TPL_PROTOSTAR_POSITION_POSITION-3="Top centre" TPL_PROTOSTAR_POSITION_POSITION-4="Unused" TPL_PROTOSTAR_POSITION_POSITION-5="Unused" TPL_PROTOSTAR_POSITION_POSITION-6="Unused" TPL_PROTOSTAR_POSITION_POSITION-7="Right" TPL_PROTOSTAR_POSITION_POSITION-8="Left" TPL_PROTOSTAR_POSITION_POSITION-9="Unused" TPL_PROTOSTAR_POSITION_FOOTER="Footer" TPL_PROTOSTAR_XML_DESCRIPTION="Continuing the space theme (Solarflare from 1.0 and Milkyway from 1.5), Protostar is the Joomla 3 site template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." PK���\�Q?((&language/en-GB/en-GB.mod_login.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_LOGIN="Login" MOD_LOGIN_XML_DESCRIPTION="This module displays a username and password login form. It also displays a link to retrieve a forgotten password. If user registration is enabled (in User Manager > Options), another link will be shown to enable self-registration for users." MOD_LOGIN_LAYOUT_DEFAULT="Default" PK���\���4language/en-GB/en-GB.mod_articles_categories.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_CATEGORIES="Articles - Categories" MOD_ARTICLES_CATEGORIES_XML_DESCRIPTION="This module displays a list of categories from one parent category." MOD_ARTICLES_CATEGORIES_LAYOUT_DEFAULT="Default" PK���\���3rr%language/en-GB/en-GB.mod_feed.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_FEED="Feed Display" MOD_FEED_XML_DESCRIPTION="This module allows the displaying of a syndicated feed." MOD_FEED_LAYOUT_DEFAULT="Default" PK���\���ZVV$language/en-GB/en-GB.com_contact.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_CONTACT_ADDRESS="Address" COM_CONTACT_ARTICLES_HEADING="Contact's articles" COM_CONTACT_CAPTCHA_LABEL="Captcha" COM_CONTACT_CAPTCHA_DESC="Type in the textbox what you see in the image." COM_CONTACT_CAT_NUM="# of Contacts :" COM_CONTACT_CONTACT_EMAIL_A_COPY_DESC="Sends a copy of the message to the address you have supplied." COM_CONTACT_CONTACT_EMAIL_A_COPY_LABEL="Send Copy to Yourself" COM_CONTACT_CONTACT_EMAIL_NAME_DESC="Your name." COM_CONTACT_CONTACT_EMAIL_NAME_LABEL="Name" COM_CONTACT_CONTACT_ENTER_MESSAGE_DESC="Enter your message here." COM_CONTACT_CONTACT_ENTER_MESSAGE_LABEL="Message" COM_CONTACT_CONTACT_ENTER_VALID_EMAIL="Please enter a valid email address." COM_CONTACT_CONTENT_TYPE_CONTACT="Contact" COM_CONTACT_CONTENT_TYPE_CATEGORY="Contact Category" COM_CONTACT_FILTER_LABEL="Filter Field" COM_CONTACT_FILTER_SEARCH_DESC="Contact Filter Search" COM_CONTACT_CONTACT_MESSAGE_SUBJECT_DESC="Enter the subject of your message here." COM_CONTACT_CONTACT_MESSAGE_SUBJECT_LABEL="Subject" COM_CONTACT_CONTACT_SEND="Send Email" COM_CONTACT_COPYSUBJECT_OF="Copy of: %s" COM_CONTACT_COPYTEXT_OF="This is a copy of the following message you sent to %s via %s" COM_CONTACT_COUNT="Contact count:" COM_CONTACT_COUNTRY="Country" COM_CONTACT_DEFAULT_PAGE_TITLE="Contacts" COM_CONTACT_DETAILS="Contact" COM_CONTACT_DOWNLOAD_INFORMATION_AS="Download information as:" COM_CONTACT_EMAIL_BANNEDTEXT="The %s of your email contains banned text." COM_CONTACT_EMAIL_DESC="Email Address for contact." COM_CONTACT_EMAIL_FORM="Contact Form" COM_CONTACT_EMAIL_LABEL="Email" COM_CONTACT_EMAIL_THANKS="Thank you for your email." COM_CONTACT_ENQUIRY_TEXT="This is an enquiry email via %s from:" COM_CONTACT_ERROR_CONTACT_NOT_FOUND="Contact not found" COM_CONTACT_FAX="Fax" COM_CONTACT_FAX_NUMBER="Fax: %s" COM_CONTACT_FORM_LABEL="Send an Email. All fields with an asterisk (*) are required." COM_CONTACT_FORM_NC="Please make sure the form is complete and valid." COM_CONTACT_IMAGE_DETAILS="Contact image" COM_CONTACT_LINKS="Links" COM_CONTACT_MAILENQUIRY="%s Enquiry" COM_CONTACT_MOBILE="Mobile" COM_CONTACT_MOBILE_NUMBER="Mobile: %s" COM_CONTACT_NO_CONTACTS="There are no Contacts to display" COM_CONTACT_NOT_MORE_THAN_ONE_EMAIL_ADDRESS="You can't enter more than one email address." COM_CONTACT_OPTIONAL="(optional)" COM_CONTACT_OTHER_INFORMATION="Miscellaneous Information" COM_CONTACT_POSITION="Position" COM_CONTACT_PROFILE="Profile" COM_CONTACT_PROFILE_HEADING="Contact profile" COM_CONTACT_SELECT_CONTACT="Select a contact:" COM_CONTACT_STATE="State" COM_CONTACT_SUBURB="Suburb" COM_CONTACT_TELEPHONE="Phone" COM_CONTACT_TELEPHONE_NUMBER="Phone: %s" COM_CONTACT_VCARD="vCard" PK���\��t..!language/en-GB/en-GB.com_tags.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_TAGS_CREATED_DATE="Created Date" COM_TAGS_FILTER_SEARCH_DESC="Enter all or part of the title to search for." COM_TAGS_MODIFIED_DATE="Modified Date" COM_TAGS_NO_ITEMS="No matching items were found." COM_TAGS_NO_TAGS="There are no tags." COM_TAGS_PUBLISHED_DATE="Published Date" COM_TAGS_TITLE_FILTER_LABEL="Enter Part of Title"PK���\ ���-language/en-GB/en-GB.mod_users_latest.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_USERS_LATEST="Latest Users" MOD_USERS_LATEST_XML_DESCRIPTION="This module displays the latest registered users." MOD_USERS_LATEST_LAYOUT_DEFAULT="Default" PK���\�h�ۏ�#language/en-GB/en-GB.com_finder.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_FINDER="Smart Search" COM_FINDER_ADVANCED_SEARCH_TOGGLE="Advanced Search" COM_FINDER_ADVANCED_TIPS="<p>Here are a few examples of how you can use the search feature:</p><p>Entering <span class="_QQ_"term"_QQ_">this and that</span> into the search form will return results containing both "this" and "that".</p><p>Entering <span class="_QQ_"term"_QQ_">this not that</span> into the search form will return results containing "this" and not "that".</p><p>Entering <span class="_QQ_"term"_QQ_">this or that</span> into the search form will return results containing either "this" or "that".</p><p>Entering <span class="_QQ_"term"_QQ_">"this and that"</span> (with quotes) into the search form will return results containing the exact phrase "this and that".</p><p>Search results can also be filtered using a variety of criteria. Select one or more filters below to get started.</p>" COM_FINDER_DEFAULT_PAGE_TITLE="Search Results" COM_FINDER_FILTER_BRANCH_LABEL="Search by %s" COM_FINDER_FILTER_DATE_BEFORE="Before" COM_FINDER_FILTER_DATE_EXACTLY="Exactly" COM_FINDER_FILTER_DATE_AFTER="After" COM_FINDER_FILTER_DATE1="Start Date" COM_FINDER_FILTER_DATE1_DESC="Enter a date in YYYY-MM-DD format." COM_FINDER_FILTER_DATE2="End Date" COM_FINDER_FILTER_DATE2_DESC="Enter a date in YYYY-MM-DD format." COM_FINDER_FILTER_SELECT_ALL_LABEL="Search All" COM_FINDER_FILTER_WHEN_AFTER="After" COM_FINDER_FILTER_WHEN_BEFORE="Before" COM_FINDER_QUERY_DATE_CONDITION_AFTER="after" COM_FINDER_QUERY_DATE_CONDITION_BEFORE="before" COM_FINDER_QUERY_DATE_CONDITION_EXACT="exactly on" COM_FINDER_QUERY_END_DATE="ending date <span class="_QQ_"when"_QQ_">%s</span> <span class="_QQ_"date"_QQ_">%s</span>" COM_FINDER_QUERY_OPERATOR_AND="and" COM_FINDER_QUERY_OPERATOR_OR="or" COM_FINDER_QUERY_OPERATOR_NOT="not" COM_FINDER_QUERY_FILTER_BRANCH_VENUE="venue" COM_FINDER_QUERY_START_DATE="beginning date <span class="_QQ_"when"_QQ_">%s</span> <span class="_QQ_"date"_QQ_">%s</span>" COM_FINDER_QUERY_TAXONOMY_NODE="with <span class="_QQ_"node"_QQ_">%s</span> as <span class="_QQ_"branch"_QQ_">%s</span> " COM_FINDER_QUERY_TOKEN_EXCLUDED="<span class="_QQ_"term"_QQ_">%s</span> should be excluded." COM_FINDER_QUERY_TOKEN_GLUE=", and " COM_FINDER_QUERY_TOKEN_INTERPRETED="Assuming %s, the following results were found." COM_FINDER_QUERY_TOKEN_OPTIONAL="<span class="_QQ_"term"_QQ_">%s</span> is optional." COM_FINDER_QUERY_TOKEN_REQUIRED="<span class="_QQ_"term"_QQ_">%s</span> is required." COM_FINDER_SEARCH_NO_RESULTS_BODY="No search results could be found for query: %s." COM_FINDER_SEARCH_NO_RESULTS_BODY_MULTILANG="No search results (in English-UK) could be found for query: %s." COM_FINDER_SEARCH_NO_RESULTS_HEADING="No Results Found" COM_FINDER_SEARCH_RESULTS_OF="Results <strong>%s</strong> - <strong>%s</strong> of <strong>%s</strong>" COM_FINDER_SEARCH_SIMILAR="Did you mean: %s?" COM_FINDER_SEARCH_TERMS="Search Terms:" PK���\+J tt,language/en-GB/en-GB.mod_breadcrumbs.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_BREADCRUMBS="Breadcrumbs" MOD_BREADCRUMBS_XML_DESCRIPTION="This module displays the Breadcrumbs." MOD_BREADCRUMBS_LAYOUT_DEFAULT="Default" PK���\v�Tx��$language/en-GB/en-GB.mod_banners.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_BANNERS_NO_CLIENT="- No client -" MOD_BANNERS="Banners" MOD_BANNERS_BANNER="Banner" MOD_BANNERS_FIELD_BANNERCLIENT_DESC="Select banners only from a single client." MOD_BANNERS_FIELD_BANNERCLIENT_LABEL="Client" MOD_BANNERS_FIELD_CACHETIME_DESC="The time before the module is recached." MOD_BANNERS_FIELD_CACHETIME_LABEL="Cache Time" MOD_BANNERS_FIELD_CATEGORY_DESC="Select banners from a specific Category or a set of Categories. If no selection then it will show all categories as default." MOD_BANNERS_FIELD_COUNT_DESC="The number of banners to display (default 5)." MOD_BANNERS_FIELD_COUNT_LABEL="Count" MOD_BANNERS_FIELD_FOOTER_DESC="Text or HTML to display after the group of banners." MOD_BANNERS_FIELD_FOOTER_LABEL="Footer Text" MOD_BANNERS_FIELD_HEADER_DESC="Text or HTML to display before the group of banners." MOD_BANNERS_FIELD_HEADER_LABEL="Header Text" MOD_BANNERS_FIELD_RANDOMISE_DESC="Randomise the ordering of the banners." MOD_BANNERS_FIELD_RANDOMISE_LABEL="Randomise" MOD_BANNERS_FIELD_TAG_DESC="Banner is selected by matching the banner tags to the current document meta keywords." MOD_BANNERS_FIELD_TAG_LABEL="Search by Meta Keyword" MOD_BANNERS_FIELD_TARGET_DESC="Target window when the link is selected." MOD_BANNERS_FIELD_TARGET_LABEL="Target" MOD_BANNERS_VALUE_STICKYORDERING="Pinned, Ordering" MOD_BANNERS_VALUE_STICKYRANDOMISE="Pinned, Randomise" MOD_BANNERS_XML_DESCRIPTION="The Banner Module displays the active Banners from the Component." PK���\i��!1language/en-GB/en-GB.mod_articles_archive.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_ARCHIVE="Articles - Archived" MOD_ARTICLES_ARCHIVE_XML_DESCRIPTION="This module shows a list of the calendar months containing Archived Articles. After you have changed the status of an Article to Archived, this list will be automatically generated." MOD_ARTICLES_ARCHIVE_LAYOUT_DEFAULT="Default" PK���\�Ўyy-language/en-GB/en-GB.mod_articles_popular.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_POPULAR="Articles - Most Read" MOD_POPULAR_FIELD_CATEGORY_DESC="Select Articles from a specific Category or a set of Categories. If no selection will show all categories as default." MOD_POPULAR_FIELD_COUNT_DESC="The number of Articles to display (the default is 5)." MOD_POPULAR_FIELD_COUNT_LABEL="Count" MOD_POPULAR_FIELD_FEATURED_DESC="Show or hide Articles designated as Featured." MOD_POPULAR_FIELD_FEATURED_LABEL="Featured Articles" MOD_POPULAR_XML_DESCRIPTION="This module shows a list of the currently published Articles which have the highest number of page views." MOD_POPULAR_FIELD_DATEFIELD_DESC="Select which date field you want the date filter to be applied to." MOD_POPULAR_FIELD_DATEFIELD_LABEL="Date Field" MOD_POPULAR_FIELD_DATEFILTERING_DESC="Select Date Filtering Type." MOD_POPULAR_FIELD_DATEFILTERING_LABEL="Date Filtering" MOD_POPULAR_FIELD_ENDDATE_DESC="If Date Range is selected above, please enter an End Date." MOD_POPULAR_FIELD_ENDDATE_LABEL="End Date" MOD_POPULAR_FIELD_STARTDATE_DESC="If Date Range is selected above, please enter a Starting Date." MOD_POPULAR_FIELD_STARTDATE_LABEL="Start Date Range" MOD_POPULAR_FIELD_RELATIVEDATE_DESC="If Relative Date is selected above, please enter a numeric day value. Results will be retrieved relative to the current date and the value you enter." MOD_POPULAR_FIELD_RELATIVEDATE_LABEL="Relative Date" MOD_POPULAR_OPTION_CREATED_VALUE="Created Date" MOD_POPULAR_OPTION_DATERANGE_VALUE="Date Range" MOD_POPULAR_OPTION_MODIFIED_VALUE="Modified Date" MOD_POPULAR_OPTION_OFF_VALUE="Off" MOD_POPULAR_OPTION_RELATIVEDAY_VALUE="Relative Date" MOD_POPULAR_OPTION_STARTPUBLISHING_VALUE="Start Publishing Date" PK���\��!,,*language/en-GB/en-GB.lib_simplepie.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 LIB_SIMPLEPIE_XML_DESCRIPTION="PHP based RSS and Atom Feed Framework." PK���\<����(language/en-GB/en-GB.mod_breadcrumbs.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_BREADCRUMBS="Breadcrumbs" MOD_BREADCRUMBS_FIELD_HOMETEXT_DESC="This text will be shown as Home entry. If the field is left empty, it will use the default value from the mod_breadcrumbs.ini language file." MOD_BREADCRUMBS_FIELD_HOMETEXT_LABEL="Text for Home Entry" MOD_BREADCRUMBS_FIELD_SEPARATOR_DESC="A text separator." MOD_BREADCRUMBS_FIELD_SEPARATOR_LABEL="Text Separator" MOD_BREADCRUMBS_FIELD_SHOWHERE_DESC="Show or hide "You are here" text in the pathway." MOD_BREADCRUMBS_FIELD_SHOWHERE_LABEL="Show "You are here"" MOD_BREADCRUMBS_FIELD_SHOWHOME_DESC="Show or hide the Home element in the pathway." MOD_BREADCRUMBS_FIELD_SHOWHOME_LABEL="Show Home" MOD_BREADCRUMBS_FIELD_SHOWLAST_DESC="Show or hide the last element in the pathway." MOD_BREADCRUMBS_FIELD_SHOWLAST_LABEL="Show Last" MOD_BREADCRUMBS_HERE="You are here: " MOD_BREADCRUMBS_HOME="Home" MOD_BREADCRUMBS_XML_DESCRIPTION="This module displays the Breadcrumbs."PK���\�&�^^!language/en-GB/en-GB.mod_menu.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_MENU="Menu" MOD_MENU_FIELD_ACTIVE_DESC="Select a menu item to always be used as the base for the menu display. You must set the Start Level to the same level or higher than the level of the base item. This will cause the module to be displayed on all assigned pages. If Current is selected the currently active item is used as the base. This causes the module to only display when the parent menu item is active." MOD_MENU_FIELD_ACTIVE_LABEL="Base Item" MOD_MENU_FIELD_ALLCHILDREN_DESC="Expand the menu and make its sub-menu items always visible." MOD_MENU_FIELD_ALLCHILDREN_LABEL="Show Sub-menu Items" MOD_MENU_FIELD_CLASS_DESC="A suffix to be applied to the CSS class of the menu items." MOD_MENU_FIELD_CLASS_LABEL="Menu Class Suffix" MOD_MENU_FIELD_ENDLEVEL_DESC="Level to stop rendering the menu at. If you choose 'All', all levels will be shown depending on 'Show Sub-menu Items' setting." MOD_MENU_FIELD_ENDLEVEL_LABEL="End Level" MOD_MENU_FIELD_MENUTYPE_DESC="Select a menu in the list." MOD_MENU_FIELD_MENUTYPE_LABEL="Select Menu" MOD_MENU_FIELD_STARTLEVEL_DESC="Level to start rendering the menu at. Setting the start and end levels to the same # and setting 'Show Sub-menu Items' to yes will only display that single level." MOD_MENU_FIELD_STARTLEVEL_LABEL="Start Level" MOD_MENU_FIELD_TAG_ID_DESC="An ID attribute to assign to the root ul tag of the menu (optional)." MOD_MENU_FIELD_TAG_ID_LABEL="Menu Tag ID" MOD_MENU_FIELD_TARGET_DESC="JavaScript values to position a popup window, eg top=50,left=50,width=200,height=300." MOD_MENU_FIELD_TARGET_LABEL="Target Position" MOD_MENU_XML_DESCRIPTION="This module displays a menu on the Frontend." PK���\>S����$language/en-GB/en-GB.com_content.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_CONTENT_ACCESS_DELETE_DESC="Inherited state for <strong>delete actions</strong> on this article and the calculated state based on the menu selection." COM_CONTENT_ACCESS_EDITSTATE_DESC="Inherited state for <strong>edit state actions</strong> on this article and the calculated state based on the menu selection." COM_CONTENT_ACCESS_EDIT_DESC="Inherited state for <strong>edit actions</strong> on this article and the calculated state based on the menu selection." COM_CONTENT_ARTICLE_CONTENT="Content" COM_CONTENT_ARTICLE_HITS="Hits: %s" COM_CONTENT_ARTICLE_INFO="Details" COM_CONTENT_ARTICLE_VOTE_SUCCESS="Thank You for rating this Article." COM_CONTENT_ARTICLE_VOTE_FAILURE="You already rated this Article today!" COM_CONTENT_AUTHOR_FILTER_LABEL="Author Filter" COM_CONTENT_CATEGORY="Category: %s" COM_CONTENT_CHECKED_OUT_BY="Checked out by %s" COM_CONTENT_CONTENT_TYPE_ARTICLE="Article" COM_CONTENT_CONTENT_TYPE_CATEGORY="Article Category" COM_CONTENT_CREATE_ARTICLE="Submit new article" COM_CONTENT_CREATED_DATE="Created Date" COM_CONTENT_CREATED_DATE_ON="Created: %s" COM_CONTENT_EDIT_ITEM="Edit Article" COM_CONTENT_ERROR_ARTICLE_NOT_FOUND="Article not found" COM_CONTENT_ERROR_LOGIN_TO_VIEW_ARTICLE="Please login to view the article" COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND="Parent category not found" COM_CONTENT_FEED_READMORE="Read More ..." COM_CONTENT_FILTER_SEARCH_DESC="Content Filter Search" COM_CONTENT_FORM_EDIT_ARTICLE="Edit an article" COM_CONTENT_HEADING_TITLE="Title" COM_CONTENT_HITS_FILTER_LABEL="Hits Filter" COM_CONTENT_INTROTEXT="Article must have some content." COM_CONTENT_INVALID_RATING="Article Rating: Invalid Rating: %s" COM_CONTENT_LAST_UPDATED="Last Updated: %s" COM_CONTENT_METADATA="Metadata" COM_CONTENT_MODIFIED_DATE="Modified Date" COM_CONTENT_MONTH="Month" COM_CONTENT_MORE_ARTICLES="More Articles ..." COM_CONTENT_NEW_ARTICLE="New Article" COM_CONTENT_NO_ARTICLES="There are no articles in this category. If subcategories display on this page, they may contain articles." COM_CONTENT_NONE="None" COM_CONTENT_NUM_ITEMS="Article Count:" COM_CONTENT_ON_NEW_CONTENT="A new Article has been submitted by '%1$s' entitled '%2$s'." COM_CONTENT_ORDERING="Ordering:<br />New articles default to the first position in the Category. The ordering can be changed in Backend." COM_CONTENT_PAGEBREAK_DOC_TITLE="Page Break" COM_CONTENT_PAGEBREAK_INSERT_BUTTON="Insert Page Break" COM_CONTENT_PAGEBREAK_TITLE="Page Title:" COM_CONTENT_PAGEBREAK_TOC="Table of Contents Alias:" COM_CONTENT_PARENT="Parent Category: %s" COM_CONTENT_PUBLISHED_DATE="Published Date" COM_CONTENT_PUBLISHED_DATE_ON="Published: %s" COM_CONTENT_PUBLISHING="Publishing" COM_CONTENT_READ_MORE="Read more: " COM_CONTENT_READ_MORE_TITLE="Read more ..." COM_CONTENT_REGISTER_TO_READ_MORE="Register to read more ..." COM_CONTENT_SAVE_SUCCESS="Article successfully saved." COM_CONTENT_SAVE_WARNING="Alias already existed so a number was added at the end. If you want to change the alias, please contact a site administrator" COM_CONTENT_SELECT_AN_ARTICLE="Select an Article" COM_CONTENT_SUBMIT_SAVE_SUCCESS="Article successfully submitted." COM_CONTENT_TITLE_FILTER_LABEL="Title Filter" COM_CONTENT_WRITTEN_BY="Written by %s" COM_CONTENT_FIELD_FULL_DESC="Select or upload an image for the single article display." COM_CONTENT_FIELD_FULL_LABEL="Full Article Image" COM_CONTENT_FIELD_IMAGE_DESC="The image to be displayed." COM_CONTENT_FIELD_IMAGE_ALT_DESC="Alternative text used for visitors without access to images. Replaced with caption text if it is present." COM_CONTENT_FIELD_IMAGE_ALT_LABEL="Alt Text" COM_CONTENT_FIELD_IMAGE_CAPTION_DESC="Caption attached to the image." COM_CONTENT_FIELD_IMAGE_CAPTION_LABEL="Caption" COM_CONTENT_FIELD_INTRO_DESC="Select or upload an image for the intro text layouts such as blogs and featured." COM_CONTENT_FIELD_INTRO_LABEL="Intro Image" COM_CONTENT_FIELD_URLC_LABEL="Link C" COM_CONTENT_FIELD_URL_DESC="Link for display." COM_CONTENT_FIELD_URLA_LABEL="Link A" COM_CONTENT_FIELD_URLA_LINK_TEXT_LABEL="Link A Text" COM_CONTENT_FIELD_URLB_LABEL="Link B" COM_CONTENT_FIELD_URL_LINK_TEXT_DESC="Text to display for the link." COM_CONTENT_FIELD_URLB_LINK_TEXT_LABEL="Link B Text" COM_CONTENT_FIELD_URLC_LINK_TEXT_LABEL="Link C Text" COM_CONTENT_FLOAT_DESC="Controls placement of the image." COM_CONTENT_FLOAT_LABEL="Image Float" COM_CONTENT_FLOAT_INTRO_LABEL="Intro Image float" COM_CONTENT_FLOAT_FULLTEXT_LABEL="Full text image float." COM_CONTENT_LEFT="Left" COM_CONTENT_RIGHT="Right" COM_CONTENT_FIELD_URL_LINK_TEXT_LABEL="Link Text" COM_CONTENT_IMAGES_AND_URLS="Images and Links" PK���\���3�3language/en-GB/en-GB.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 ; Common boolean values ; Note: YES, NO, TRUE, FALSE are reserved words in INI format. ; Double quotes in the values have to be formatted as "_QQ_" ; Keep this string on top JERROR_PARSING_LANGUAGE_FILE=" : error(s) in line(s) %s" ERROR="Error" MESSAGE="Message" NOTICE="Notice" WARNING="Warning" J1="1" J2="2" J3="3" J4="4" J5="5" J6="6" J7="7" J8="8" J9="9" J10="10" J15="15" J20="20" J25="25" J30="30" J50="50" J100="100" JACTION_ADMIN="Configure" JACTION_ADMIN_GLOBAL="Super User" JACTION_COMPONENT_SETTINGS="Component Settings" JACTION_CREATE="Create" JACTION_DELETE="Delete" JACTION_EDIT="Edit" JACTION_EDITOWN="Edit Own" JACTION_EDITSTATE="Edit State" JACTION_LOGIN_ADMIN="Administrator Login" JACTION_LOGIN_SITE="Site Login" JACTION_MANAGE="Access Administration Interface" JADMINISTRATOR="Administrator" JALL="All" JALL_LANGUAGE="All" JARCHIVED="Archived" JAUTHOR="Author" JCANCEL="Cancel" JCATEGORY="Category" JDATE="Date" JDEFAULT="Default" JDETAILS="Details" JDISABLED="Disabled" JEDITOR="Editor" JENABLED="Enabled" JEXPIRED="Expired" JFALSE="False" JFEATURED="Featured" JHIDE="Hide" JINVALID_TOKEN="Invalid Token" JLOGIN="Log in" JLOGOUT="Log out" JNEW="New" JNEXT="Next" JNO="No" JNONE="None" JNOTPUBLISHEDYET="Not published yet" JNOTICE="Notice" JOFF="Off" JOFFLINE_MESSAGE="This site is down for maintenance.<br />Please check back again soon." JON="On" JOPTIONS="Options" JPAGETITLE="%1$s - %2$s" JPREV="Prev" JPREVIOUS="Previous" JPUBLISHED="Published" JREGISTER="Register" JREQUIRED="Required" JSAVE="Save" JSHOW="Show" JSITE="Site" JSTATUS="Status" JSUBMIT="Submit" JTAG="Tags" JTAG_DESC="Add and delete tags to an item." JTOOLBAR_VERSIONS="Versions" JTRASH="Trash" JTRASHED="Trashed" JTRUE="True" JUNPUBLISHED="Unpublished" JYEAR="Year" JYES="Yes" JBROWSERTARGET_MODAL="Modal" JBROWSERTARGET_NEW="Open in new window" JBROWSERTARGET_PARENT="Open in parent window" JBROWSERTARGET_POPUP="Open in popup" JERROR_ALERTNOAUTHOR="You are not authorised to view this resource." JERROR_ALERTNOTEMPLATE="<strong>The template for this display is not available. Please contact a Site administrator.</strong>" JERROR_AN_ERROR_HAS_OCCURRED="An error has occurred." JERROR_COULD_NOT_FIND_TEMPLATE="Could not find template "_QQ_"%s"_QQ_"." JERROR_ERROR="Error" JERROR_LAYOUT_AN_OUT_OF_DATE_BOOKMARK_FAVOURITE="an <strong>out-of-date bookmark/favourite</strong>" JERROR_LAYOUT_ERROR_HAS_OCCURRED_WHILE_PROCESSING_YOUR_REQUEST="An error has occurred while processing your request." JERROR_LAYOUT_GO_TO_THE_HOME_PAGE="Go to the Home Page" JERROR_LAYOUT_HOME_PAGE="Home Page" JERROR_LAYOUT_MIS_TYPED_ADDRESS="a <strong>mistyped address</strong>" JERROR_LAYOUT_NOT_ABLE_TO_VISIT="You may not be able to visit this page because of:" JERROR_LAYOUT_PAGE_NOT_FOUND="The requested page can't be found." JERROR_LAYOUT_PLEASE_CONTACT_THE_SYSTEM_ADMINISTRATOR="If difficulties persist, please contact the System Administrator of this site and report the error below." JERROR_LAYOUT_PLEASE_TRY_ONE_OF_THE_FOLLOWING_PAGES="Please try one of the following pages:" JERROR_LAYOUT_REQUESTED_RESOURCE_WAS_NOT_FOUND="The requested resource was not found." JERROR_LAYOUT_SEARCH="You may wish to search the site or visit the home page." JERROR_LAYOUT_SEARCH_ENGINE_OUT_OF_DATE_LISTING="a search engine that has an <strong>out-of-date listing for this site</strong>" JERROR_LAYOUT_SEARCH_PAGE="Search this site" JERROR_LAYOUT_YOU_HAVE_NO_ACCESS_TO_THIS_PAGE="you have <strong>no access</strong> to this page" JERROR_LOADING_MENUS="Error loading Menus: %s" JERROR_LOGIN_DENIED="You can't access the private section of this site." JERROR_NOLOGIN_BLOCKED="Login denied! Your account has either been blocked or you have not activated it yet." JERROR_SESSION_STARTUP="Error initialising the session." JERROR_TABLE_BIND_FAILED="hmm %s ..." JERROR_USERS_PROFILE_NOT_FOUND="User profile not found" JFIELD_ACCESS_DESC="Access level for this content." JFIELD_ACCESS_LABEL="Access" JFIELD_ALIAS_DESC="The Alias will be used in the SEF URL. Leave this blank and Joomla! will fill in a default value from the title. This value will depend on the SEO settings (Global Configuration->Site). <br />Using Unicode will produce UTF-8 aliases. You may also enter manually any UTF-8 character. Spaces and some forbidden characters will be changed to hyphens.<br />When using default transliteration it will produce an alias in lower case and with dashes instead of spaces. You may enter the Alias manually. Use lowercase letters and hyphens (-). No spaces or underscores are allowed. Default value will be a date and time if the title is typed in non-latin letters ." JFIELD_ALIAS_LABEL="Alias" JFIELD_ALIAS_PLACEHOLDER="Auto-generate from title" JFIELD_ALT_PAGE_TITLE_LABEL="Alternative Page Title" JFIELD_CATEGORY_DESC="Category" JFIELD_LANGUAGE_DESC="Assign a language to this article." JFIELD_LANGUAGE_LABEL="Language" JFIELD_META_DESCRIPTION_DESC="Metadata description." JFIELD_META_DESCRIPTION_LABEL="Meta Description" JFIELD_META_KEYWORDS_DESC="Keywords describing the content." JFIELD_META_KEYWORDS_LABEL="Keywords" JFIELD_META_RIGHTS_DESC="Describe what rights others have to use this content." JFIELD_META_RIGHTS_LABEL="Content Rights" JFIELD_ORDERING_DESC="Ordering of the article within the category." JFIELD_ORDERING_LABEL="Ordering" JFIELD_PUBLISHED_DESC="Set publication status." JFIELD_TITLE_DESC="Title for the article." JGLOBAL_ARTICLES="Articles" JGLOBAL_AUTH_ACCESS_DENIED="Access Denied" JGLOBAL_AUTH_ACCESS_GRANTED="Access Granted" JGLOBAL_AUTH_BIND_FAILED="Failed binding to LDAP server" JGLOBAL_AUTH_CANCEL="Authentication cancelled" JGLOBAL_AUTH_CURL_NOT_INSTALLED="Curl isn't installed." JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED="Empty password not allowed." JGLOBAL_AUTH_FAIL="Authentication failed" JGLOBAL_AUTH_FAILED="Failed to authenticate: %s" JGLOBAL_AUTH_INCORRECT="Incorrect username/password" JGLOBAL_AUTH_INVALID_PASS="Username and password do not match or you do not have an account yet." JGLOBAL_AUTH_INVALID_SECRETKEY="The two factor authentication Secret Key is invalid." JGLOBAL_AUTH_NO_BIND="Unable to bind to LDAP" JGLOBAL_AUTH_NO_CONNECT="Unable to connect to LDAP server" JGLOBAL_AUTH_NO_REDIRECT="Could not redirect to server: %s" JGLOBAL_AUTH_NO_USER="Username and password do not match or you do not have an account yet." JGLOBAL_AUTH_NOT_CREATE_DIR="Could not create the FileStore folder %s. Please check the effective permissions." JGLOBAL_AUTH_PASS_BLANK="LDAP can't have blank password" JGLOBAL_AUTH_UNKNOWN_ACCESS_DENIED="Result Unknown. Access Denied" JGLOBAL_AUTH_USER_BLACKLISTED="User is blacklisted." JGLOBAL_AUTH_USER_NOT_FOUND="Unable to find user" JGLOBAL_AUTO="Auto" JGLOBAL_CATEGORY_NOT_FOUND="Category not found" JGLOBAL_CENTER="Center" JGLOBAL_CHECK_ALL="Check All" JGLOBAL_CLICK_TO_SORT_THIS_COLUMN="Select to sort by this column" JGLOBAL_CREATED_DATE_ON="Created on %s" JGLOBAL_DESCRIPTION="Description" JGLOBAL_DISPLAY_NUM="Display #" JGLOBAL_EDIT="Edit" JGLOBAL_EMAIL="Email" JGLOBAL_FIELD_CREATED_BY_ALIAS_DESC="Uses another name than the author's for display." JGLOBAL_FIELD_CREATED_BY_ALIAS_LABEL="Author's Alias" JGLOBAL_FIELD_FEATURED_DESC="Assign the article to the featured blog layout." JGLOBAL_FIELD_FEATURED_LABEL="Featured" JGLOBAL_FIELD_PUBLISH_DOWN_DESC="An optional date to stop publishing." JGLOBAL_FIELD_PUBLISH_DOWN_LABEL="Finish Publishing" JGLOBAL_FIELD_PUBLISH_UP_DESC="An optional date to start publishing." JGLOBAL_FIELD_PUBLISH_UP_LABEL="Start Publishing" JGLOBAL_FIELD_VERSION_NOTE_DESC="Enter an optional note for this version of the item." JGLOBAL_FIELD_VERSION_NOTE_LABEL="Version Note" JGLOBAL_FILTER_BUTTON="Filter" JGLOBAL_FILTER_LABEL="Filter" JGLOBAL_FULL_TEXT="Full Text" JGLOBAL_GT=">" JGLOBAL_HELPREFRESH_BUTTON="Refresh" JGLOBAL_HITS="Hits" JGLOBAL_HITS_COUNT="Hits: %s" JGLOBAL_ICON_SEP="|" JGLOBAL_INHERIT="Inherit" JGLOBAL_INTRO_TEXT="Intro Text" JGLOBAL_KEEP_TYPING="Keep typing ..." JGLOBAL_LEFT="Left" JGLOBAL_LOOKING_FOR="Looking for" JGLOBAL_LT="<" JGLOBAL_NEWITEMSLAST_DESC="New items default to the last position. Ordering can be changed after this item has been saved." JGLOBAL_NO_MATCHING_RESULTS="No Matching Results" JGLOBAL_NUM="#" JGLOBAL_OTPMETHOD_NONE="Disable Two Factor Authentication" JGLOBAL_PASSWORD="Password" JGLOBAL_PASSWORD_RESET_REQUIRED="You are required to reset your password before proceeding." JGLOBAL_PRINT="Print" JGLOBAL_RECORD_NUMBER="Record ID: %d" JGLOBAL_REMEMBER_ME="Remember me" JGLOBAL_REMEMBER_MUST_LOGIN="For security reasons you must login before editing your personal information." JGLOBAL_RESOURCE_NOT_FOUND="Resource not found" JGLOBAL_RIGHT="Right" JGLOBAL_ROOT="Root" JGLOBAL_SECRETKEY="Secret Key" JGLOBAL_SECRETKEY_HELP="If you have enabled two factor authentication in your user account please enter your secret key. If you do not know what this means, you can leave this field blank." JGLOBAL_SELECT_AN_OPTION="Select an option" JGLOBAL_SELECT_NO_RESULTS_MATCH="No results match" JGLOBAL_SELECT_SOME_OPTIONS="Select some options" JGLOBAL_START_PUBLISH_AFTER_FINISH="Item start publishing date must be before finish publishing date" JGLOBAL_SUBCATEGORIES="Subcategories" JGLOBAL_SUBHEADING_DESC="Optional text to show as a subheading." JGLOBAL_TITLE="Title" JGLOBAL_USE_GLOBAL="Use Global" JGLOBAL_USERNAME="Username" JGLOBAL_VALIDATION_FORM_FAILED="Invalid form" JGLOBAL_YOU_MUST_LOGIN_FIRST="Please login first" JGRID_HEADING_ACCESS="Access" JGRID_HEADING_ID="ID" JGRID_HEADING_LANGUAGE="Language" ; if there is an error connecting database before initialisation, en-GB.lib_joomla.ini can't be loaded ; we therefore have to load the strings from en-GB.ini JLIB_DATABASE_ERROR_ADAPTER_MYSQL="The MySQL adapter 'mysql' is not available." JLIB_DATABASE_ERROR_ADAPTER_MYSQLI="The MySQL adapter 'mysqli' is not available." JLIB_DATABASE_ERROR_CONNECT_DATABASE="Unable to connect to the Database: %s" JLIB_DATABASE_ERROR_CONNECT_MYSQL="Could not connect to MySQL." JLIB_DATABASE_ERROR_DATABASE_CONNECT="Could not connect to database" JLIB_DATABASE_ERROR_LOAD_DATABASE_DRIVER="Unable to load Database Driver: %s" JLIB_ERROR_INFINITE_LOOP="Infinite loop detected in JError" JOPTION_SELECT_ACCESS="- Select Access -" JOPTION_SELECT_AUTHOR="- Select Author -" JOPTION_SELECT_CATEGORY="- Select Category -" JOPTION_SELECT_LANGUAGE="- Select Language -" JOPTION_SELECT_PUBLISHED="- Select Status -" JOPTION_SELECT_MAX_LEVELS="- Select Max Levels -" JOPTION_SELECT_TAG="- Select Tag -" JOPTION_USE_DEFAULT="- Use Default -" JSEARCH_FILTER_CLEAR="Clear" JSEARCH_FILTER_LABEL="Filter" JSEARCH_FILTER_SUBMIT="Search" JSEARCH_FILTER="Search" DATE_FORMAT_LC="l, d F Y" DATE_FORMAT_LC1="l, d F Y" DATE_FORMAT_LC2="l, d F Y H:i" DATE_FORMAT_LC3="d F Y" DATE_FORMAT_LC4="Y-m-d" DATE_FORMAT_JS1="y-m-d" ; Months JANUARY_SHORT="Jan" JANUARY="January" FEBRUARY_SHORT="Feb" FEBRUARY="February" MARCH_SHORT="Mar" MARCH="March" APRIL_SHORT="Apr" APRIL="April" MAY_SHORT="May" MAY="May" JUNE_SHORT="Jun" JUNE="June" JULY_SHORT="Jul" JULY="July" AUGUST_SHORT="Aug" AUGUST="August" SEPTEMBER_SHORT="Sep" SEPTEMBER="September" OCTOBER_SHORT="Oct" OCTOBER="October" NOVEMBER_SHORT="Nov" NOVEMBER="November" DECEMBER_SHORT="Dec" DECEMBER="December" ;Days of the Week SAT="Sat" SATURDAY="Saturday" SUN="Sun" SUNDAY="Sunday" MON="Mon" MONDAY="Monday" TUE="Tue" TUESDAY="Tuesday" WED="Wed" WEDNESDAY="Wednesday" THU="Thu" THURSDAY="Thursday" FRI="Fri" FRIDAY="Friday" ; Localised number format DECIMALS_SEPARATOR="." THOUSANDS_SEPARATOR="," ; Time Zones - this data has been removed as it is no longer used by Joomla 3.x PHPMAILER_PROVIDE_ADDRESS="You must provide at least one recipient email address." PHPMAILER_MAILER_IS_NOT_SUPPORTED=" Mailer is not supported." PHPMAILER_EXECUTE="Could not execute: " PHPMAILER_INSTANTIATE="Could not start mail function." PHPMAILER_AUTHENTICATE="SMTP Error! Could not authenticate." PHPMAILER_FROM_FAILED="The following from address failed: " PHPMAILER_RECIPIENTS_FAILED="SMTP Error! The following recipients failed: " PHPMAILER_DATA_NOT_ACCEPTED="SMTP Error! Data not accepted." PHPMAILER_CONNECT_HOST="SMTP Error! Could not connect to SMTP host." PHPMAILER_FILE_ACCESS="Could not access file: " PHPMAILER_FILE_OPEN="File Error: Could not open file: " PHPMAILER_ENCODING="Unknown encoding: " PHPMAILER_SIGNING_ERROR="Signing error: " PHPMAILER_SMTP_ERROR="SMTP server error: " PHPMAILER_EMPTY_MESSAGE="Empty message body" PHPMAILER_INVALID_ADDRESS="Invalid address" PHPMAILER_VARIABLE_SET="Can't set or reset variable: " PHPMAILER_SMTP_CONNECT_FAILED="SMTP connect failed" PHPMAILER_TLS="Could not start TLS" ; Database types (allows for a more descriptive label than the internal name) MYSQL="MySQL" MYSQLI="MySQLi" ORACLE="Oracle" PDOMYSQL="MySQL (PDO)" POSTGRESQL="PostgreSQL" SQLAZURE="Microsoft SQL Azure" SQLITE="SQLite" SQLSRV="Microsoft SQL Server" ; Search tools JSEARCH_TOOLS="Search Tools" JSEARCH_TOOLS_DESC="Filter the list items." JSEARCH_TOOLS_ORDERING="Order by:" PK���\��Ӧ�-language/en-GB/en-GB.mod_articles_archive.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_ARCHIVE="Articles - Archived" MOD_ARTICLES_ARCHIVE_FIELD_COUNT_LABEL="# of Months" MOD_ARTICLES_ARCHIVE_FIELD_COUNT_DESC="The number of months to display (the default is 10)." MOD_ARTICLES_ARCHIVE_XML_DESCRIPTION="This module shows a list of the calendar months containing archived articles. After you have changed the status of an article to archived, this list will be automatically generated." MOD_ARTICLES_ARCHIVE_DATE="%1$s, %2$s" PK���\�]���'language/en-GB/en-GB.mod_footer.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 ; Note : %date% will be auto replaced by current year !Don't translate MOD_FOOTER="Footer" MOD_FOOTER_XML_DESCRIPTION="This module shows the Joomla! copyright information." MOD_FOOTER_LAYOUT_DEFAULT="Default" PK���\ P�*��1language/en-GB/en-GB.mod_articles_popular.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_POPULAR="Articles - Most Read" MOD_POPULAR_XML_DESCRIPTION="This module shows a list of the currently published Articles which have the highest number of page views." MOD_ARTICLES_POPULAR_LAYOUT_DEFAULT="Default" PK���\�N���)language/en-GB/en-GB.files_joomla.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 FILES_JOOMLA="Joomla CMS" FILES_JOOMLA_ERROR_FILE_FOLDER="Error on deleting file or folder %s" FILES_JOOMLA_ERROR_MANIFEST="Error on updating manifest cache: (type, element, folder, client) = (%s, %s, %s, %s)" FILES_JOOMLA_XML_DESCRIPTION="Joomla! 3 Content Management System." PK���\[�̈;;&language/en-GB/en-GB.mod_syndicate.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_SYNDICATE="Syndication Feeds" MOD_SYNDICATE_DEFAULT_FEED_ENTRIES="Feed Entries" MOD_SYNDICATE_FIELD_DISPLAYTEXT_DESC="If set to 'Yes', text will be displayed next to the icon." MOD_SYNDICATE_FIELD_DISPLAYTEXT_LABEL="Display Text" MOD_SYNDICATE_FIELD_FORMAT_DESC="Select the format for the Syndication Feed." MOD_SYNDICATE_FIELD_FORMAT_LABEL="Feed Format" MOD_SYNDICATE_FIELD_TEXT_DESC="If 'Display Text' is activated, the text entered will be displayed next to the icon along with the RSS Link. If this field is left empty, the default text displayed will be picked from the site language ini file." MOD_SYNDICATE_FIELD_TEXT_LABEL="Text" MOD_SYNDICATE_FIELD_VALUE_ATOM="Atom 1.0" MOD_SYNDICATE_FIELD_VALUE_RSS="RSS 2.0" MOD_SYNDICATE_XML_DESCRIPTION="Smart Syndication Module that creates a Syndicated Feed for the page where the Module is displayed."PK���\�ԏ�-language/en-GB/en-GB.mod_random_image.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_RANDOM_IMAGE="Random Image" MOD_RANDOM_IMAGE_XML_DESCRIPTION="This module displays a random image from your chosen folder." MOD_RANDOM_IMAGE_LAYOUT_DEFAULT="Default" PK���\����� language/en-GB/en-GB.lib_fof.ininu�[���; @package FrameworkOnFramework ; @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. ; @license GNU General Public License version 2, or later LIB_FOF_DOWNLOAD_ERR_COULDNOTDOWNLOADFROMURL="Could not download from %s" LIB_FOF_DOWNLOAD_ERR_COULDNOTWRITELOCALFILE="Local file %s is not writeable" LIB_FOF_DOWNLOAD_ERR_CURL_ERROR="The download failed: cURL error %s: %s" LIB_FOF_DOWNLOAD_ERR_HTTPERROR="Unexpected HTTP status %s"PK���\��yO>>language/en-GB/install.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension version="3.4" client="site" type="language" method="upgrade"> <name>English (United Kingdom)</name> <tag>en-GB</tag> <version>3.4.2</version> <creationDate>2013-03-07</creationDate> <author>Joomla! Project</author> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <description>en-GB site language</description> <files> <filename>en-GB.com_ajax.ini</filename> <filename>en-GB.com_config.ini</filename> <filename>en-GB.com_contact.ini</filename> <filename>en-GB.com_content.ini</filename> <filename>en-GB.com_finder.ini</filename> <filename>en-GB.com_mailto.ini</filename> <filename>en-GB.com_media.ini</filename> <filename>en-GB.com_messages.ini</filename> <filename>en-GB.com_newsfeeds.ini</filename> <filename>en-GB.com_search.ini</filename> <filename>en-GB.com_tags.ini</filename> <filename>en-GB.com_users.ini</filename> <filename>en-GB.com_weblinks.ini</filename> <filename>en-GB.com_wrapper.ini</filename> <filename>en-GB.files_joomla.sys.ini</filename> <filename>en-GB.finder_cli.ini</filename> <filename>en-GB.ini</filename> <filename>en-GB.lib_fof.ini</filename> <filename>en-GB.lib_fof.sys.ini</filename> <filename>en-GB.lib_idna_convert.sys.ini</filename> <filename>en-GB.lib_joomla.ini</filename> <filename>en-GB.lib_joomla.sys.ini</filename> <filename>en-GB.lib_phpass.sys.ini</filename> <filename>en-GB.lib_phputf8.sys.ini</filename> <filename>en-GB.lib_simplepie.sys.ini</filename> <filename>en-GB.localise.php</filename> <filename>en-GB.mod_articles_archive.ini</filename> <filename>en-GB.mod_articles_archive.sys.ini</filename> <filename>en-GB.mod_articles_categories.ini</filename> <filename>en-GB.mod_articles_categories.sys.ini</filename> <filename>en-GB.mod_articles_category.ini</filename> <filename>en-GB.mod_articles_category.sys.ini</filename> <filename>en-GB.mod_articles_latest.ini</filename> <filename>en-GB.mod_articles_latest.sys.ini</filename> <filename>en-GB.mod_articles_news.ini</filename> <filename>en-GB.mod_articles_news.sys.ini</filename> <filename>en-GB.mod_articles_popular.ini</filename> <filename>en-GB.mod_articles_popular.sys.ini</filename> <filename>en-GB.mod_banners.ini</filename> <filename>en-GB.mod_banners.sys.ini</filename> <filename>en-GB.mod_breadcrumbs.ini</filename> <filename>en-GB.mod_breadcrumbs.sys.ini</filename> <filename>en-GB.mod_custom.ini</filename> <filename>en-GB.mod_custom.sys.ini</filename> <filename>en-GB.mod_feed.ini</filename> <filename>en-GB.mod_feed.sys.ini</filename> <filename>en-GB.mod_finder.ini</filename> <filename>en-GB.mod_finder.sys.ini</filename> <filename>en-GB.mod_footer.ini</filename> <filename>en-GB.mod_footer.sys.ini</filename> <filename>en-GB.mod_languages.ini</filename> <filename>en-GB.mod_languages.sys.ini</filename> <filename>en-GB.mod_login.ini</filename> <filename>en-GB.mod_login.sys.ini</filename> <filename>en-GB.mod_menu.ini</filename> <filename>en-GB.mod_menu.sys.ini</filename> <filename>en-GB.mod_random_image.ini</filename> <filename>en-GB.mod_random_image.sys.ini</filename> <filename>en-GB.mod_related_items.ini</filename> <filename>en-GB.mod_related_items.sys.ini</filename> <filename>en-GB.mod_search.ini</filename> <filename>en-GB.mod_search.sys.ini</filename> <filename>en-GB.mod_stats.ini</filename> <filename>en-GB.mod_stats.sys.ini</filename> <filename>en-GB.mod_syndicate.ini</filename> <filename>en-GB.mod_syndicate.sys.ini</filename> <filename>en-GB.mod_tags_popular.ini</filename> <filename>en-GB.mod_tags_popular.sys.ini</filename> <filename>en-GB.mod_tags_similar.ini</filename> <filename>en-GB.mod_tags_similar.sys.ini</filename> <filename>en-GB.mod_users_latest.ini</filename> <filename>en-GB.mod_users_latest.sys.ini</filename> <filename>en-GB.mod_weblinks.ini</filename> <filename>en-GB.mod_weblinks.sys.ini</filename> <filename>en-GB.mod_whosonline.ini</filename> <filename>en-GB.mod_whosonline.sys.ini</filename> <filename>en-GB.mod_wrapper.ini</filename> <filename>en-GB.mod_wrapper.sys.ini</filename> <filename>en-GB.tpl_beez3.ini</filename> <filename>en-GB.tpl_beez3.sys.ini</filename> <filename>en-GB.tpl_protostar.ini</filename> <filename>en-GB.tpl_protostar.sys.ini</filename> <filename file="meta">install.xml</filename> <filename file="meta">en-GB.xml</filename> </files> <params /> </extension> PK���\d_���#language/en-GB/en-GB.mod_custom.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_CUSTOM="Custom HTML" MOD_CUSTOM_FIELD_PREPARE_CONTENT_DESC="Optionally prepare the content with the Joomla Content Plugins." MOD_CUSTOM_FIELD_PREPARE_CONTENT_LABEL="Prepare Content" MOD_CUSTOM_XML_DESCRIPTION="This module allows you to create your own HTML Module using a WYSIWYG editor." MOD_CUSTOM_FIELD_BACKGROUNDIMAGE_LABEL="Select a Background Image" MOD_BACKGROUNDIMAGE_FIELD_LOGO_DESC="Select or upload an image that will automatically be inserted as an inline style for the wrapping div element." PK���\}>0__%language/en-GB/en-GB.mod_menu.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_MENU="Menu" MOD_MENU_XML_DESCRIPTION="This module displays a menu on the Frontend." MOD_MENU_LAYOUT_DEFAULT="Default" PK���\�Wm�II&language/en-GB/en-GB.mod_languages.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_LANGUAGES="Language Switcher" MOD_LANGUAGES_FIELD_ACTIVE_DESC="Display or not the active language. If displayed, the class 'lang-active' will be added to the element." MOD_LANGUAGES_FIELD_ACTIVE_LABEL="Active Language" MOD_LANGUAGES_FIELD_CACHING_DESC="Select whether to cache or not the content of this module.<br />This should be set to 'No caching' when using Items Associations." MOD_LANGUAGES_FIELD_DROPDOWN_DESC="If set to 'Yes', the display parameters below will be ignored. The content languages native names will display in a dropdown." MOD_LANGUAGES_FIELD_DROPDOWN_LABEL="Use Dropdown" MOD_LANGUAGES_FIELD_FOOTER_DESC="This is the text or HTML that is displayed below the language switcher." MOD_LANGUAGES_FIELD_FOOTER_LABEL="Post-text" MOD_LANGUAGES_FIELD_FULL_NAME_DESC="If set to 'Yes' and image flags set to 'No', full content language native names are displayed. If set to 'No', upper case abbreviations from the content languages URL Language Code are used. Example: EN for English, FR for French." MOD_LANGUAGES_FIELD_FULL_NAME_LABEL="Languages Full Names" MOD_LANGUAGES_FIELD_HEADER_DESC="This is the text or HTML that is displayed above the language switcher." MOD_LANGUAGES_FIELD_HEADER_LABEL="Pre-text" MOD_LANGUAGES_FIELD_INLINE_DESC="Default is set to 'Yes', ie to horizontal display." MOD_LANGUAGES_FIELD_INLINE_LABEL="Horizontal Display" MOD_LANGUAGES_FIELD_MODULE_LAYOUT_DESC="Use a different layout from the supplied module or overrides in the default template." MOD_LANGUAGES_FIELD_USEIMAGE_DESC="If set to 'Yes', will display language choice as image flags. Otherwise will use the content language native names." MOD_LANGUAGES_FIELD_USEIMAGE_LABEL="Use Image Flags" MOD_LANGUAGES_OPTION_DEFAULT_LANGUAGE="Default" MOD_LANGUAGES_SPACERDROP_LABEL="<u>If Use Dropdown is set to 'Yes', <br />the display options below will be ignored</u>" MOD_LANGUAGES_SPACERNAME_LABEL="<u>If Use Image Flags is set to 'Yes', <br />the display options below will be ignored</u>" MOD_LANGUAGES_XML_DESCRIPTION="This module displays a list of available Content Languages (as defined and published in Language Manager Content tab) for switching between them when you want to use Joomla! as a multilingual site. <br />--The plugin 'System - Language Filter' has to be enabled.--<br />When switching languages and if the item displayed in the page is not associated to another item, the module redirects to the Home page defined for the chosen language.<br />Otherwise, if the parameter is set for the Language filter plugin, it will redirect to the associated item in the language chosen. Thereafter, the navigation will be the one defined for that language. <br />If the plugin <strong>'System - Language Filter'</strong> is disabled, this may have unwanted results.<br /><strong>Method:</strong><br />1. Open Language Manager Content tab and make sure the Languages you want to use in contents are published and have a Language Code for the URL as well as prefix for the image used in the module display.<br />2. Create a Home page by assigning a language to a menu item and defining it as Default Home page for each published content language. <br />3. Thereafter, you can assign a language to any Article, Category, Module, News Feed, Web Links in Joomla.<br />4. Make sure the module is published and the plugin is enabled. <br />5. When using associated items, make sure the module is displayed on the pages concerned. <br />6. The way the flags or names of the languages are displayed is defined by the ordering in the Language Manager - Content Languages.<br ><br >If this module is published, it is suggested to publish the Administrator multilingual status module." PK���\�$ȗ�)language/en-GB/en-GB.mod_weblinks.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_WEBLINKS="Web Links" MOD_WEBLINKS_XML_DESCRIPTION="This modules displays Web Links from a category defined in the Web Links component." MOD_WEBLINKS_LAYOUT_DEFAULT="Default" PK���\xF���&language/en-GB/en-GB.tpl_protostar.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 TPL_PROTOSTAR_XML_DESCRIPTION="Continuing the space theme (Solarflare from 1.0 and Milkyway from 1.5), Protostar is the Joomla 3 site template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." TPL_PROTOSTAR_BACKGROUND_COLOR_DESC="Choose a background colour for static layouts. If left blank the Default (#f4f6f7) is used." TPL_PROTOSTAR_BACKGROUND_COLOR_LABEL="Background Colour" TPL_PROTOSTAR_BACKTOTOP="Back to Top" TPL_PROTOSTAR_COLOR_DESC="Choose an overall colour for the site template. If left blank the Default (#0088cc) is used." TPL_PROTOSTAR_COLOR_LABEL="Template Colour" TPL_PROTOSTAR_FLUID="Fluid" TPL_PROTOSTAR_FLUID_LABEL="Fluid Layout" TPL_PROTOSTAR_FLUID_DESC="Use Bootstrap's Fluid or Static Container (both are Responsive)." TPL_PROTOSTAR_FONT_LABEL="Google Font for Headings" TPL_PROTOSTAR_FONT_DESC="Load a Google font for the headings (H1, H2, H3, etc)." TPL_PROTOSTAR_FONT_NAME_LABEL="Google Font Name" TPL_PROTOSTAR_FONT_NAME_DESC="Example: Open+Sans or Source+Sans+Pro." TPL_PROTOSTAR_LOGO_LABEL="Logo" TPL_PROTOSTAR_LOGO_DESC="Select or upload a custom logo for the site template." TPL_PROTOSTAR_STATIC="Static" PK���\Z�q�xx)language/en-GB/en-GB.mod_tags_similar.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_TAGS_SIMILAR="Tags - Similar" MOD_TAGS_SIMILAR_FIELD_ALL="All" MOD_TAGS_SIMILAR_FIELD_HALF="Half" MOD_TAGS_SIMILAR_FIELD_MATCHTYPE_DESC="How closely an item's tags need to match. All - requires that all tags in the displayed item be matched. Any - requires that at least one tag match. Half - requires that at least half of the tags match (rounded up in the case of decimals)." MOD_TAGS_SIMILAR_FIELD_MATCHTYPE_LABEL="Match Type" MOD_TAGS_SIMILAR_FIELD_ONE="Any" MOD_TAGS_SIMILAR_LAYOUT_DEFAULT="Default" MOD_TAGS_SIMILAR_MAX_DESC="Maximum number of items to display." MOD_TAGS_SIMILAR_MAX_LABEL="Maximum Items" MOD_TAGS_SIMILAR_NO_MATCHING_TAGS="No matching tags." MOD_TAGS_SIMILAR_XML_DESCRIPTION="The Similar Tags Module displays links to other items with similar tags. The closeness of the match can be specified." MOD_TAGS_SIMILAR_FIELD_ORDERING_LABEL="Order Results" MOD_TAGS_SIMILAR_FIELD_ORDERING_DESC="Select the order in which you want query results presented." MOD_TAGS_SIMILAR_FIELD_ORDERING_COUNT="Number of matching tags" MOD_TAGS_SIMILAR_FIELD_ORDERING_RANDOM="Random" MOD_TAGS_SIMILAR_FIELD_ORDERING_COUNT_AND_RANDOM="Number of matching tags & Random" PK���\(language/en-GB/en-GB.lib_phputf8.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 LIB_PHPUTF8_XML_DESCRIPTION="Classes for UTF-8." PK���\��u��0language/en-GB/en-GB.mod_articles_categories.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_CATEGORIES="Articles - Categories" MOD_ARTICLES_CATEGORIES_FIELD_COUNT_DESC="Select the number of first level subcategories to display. Default is all." MOD_ARTICLES_CATEGORIES_FIELD_COUNT_LABEL="# First Subcategories" MOD_ARTICLES_CATEGORIES_FIELD_MAXLEVEL_DESC="Select the maximum level depth for each subcategory. Default is all." MOD_ARTICLES_CATEGORIES_FIELD_MAXLEVEL_LABEL="Maximum Level Depth" MOD_ARTICLES_CATEGORIES_FIELD_PARENT_DESC="Choose a parent category." MOD_ARTICLES_CATEGORIES_FIELD_PARENT_LABEL="Parent Category" MOD_ARTICLES_CATEGORIES_FIELD_SHOW_CHILDREN_DESC="Show or hide subcategories." MOD_ARTICLES_CATEGORIES_FIELD_SHOW_CHILDREN_LABEL="Show Subcategories" MOD_ARTICLES_CATEGORIES_FIELD_NUMITEMS_DESC="Show or hide number of articles." MOD_ARTICLES_CATEGORIES_FIELD_NUMITEMS_LABEL="Show Number of Articles" MOD_ARTICLES_CATEGORIES_FIELD_SHOW_DESCRIPTION_DESC="Show or hide category descriptions." MOD_ARTICLES_CATEGORIES_FIELD_SHOW_DESCRIPTION_LABEL="Category Descriptions" MOD_ARTICLES_CATEGORIES_XML_DESCRIPTION="This module displays a list of categories from one parent category." MOD_ARTICLES_CATEGORIES_TITLE_HEADING_LABEL="Heading Style" MOD_ARTICLES_CATEGORIES_TITLE_HEADING_DESC="Set the heading style to use."PK���\�-���!language/en-GB/en-GB.mod_feed.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_FEED="Feed Display" MOD_FEED_ERR_CACHE="Please make cache folder writeable." MOD_FEED_ERR_FEED_NOT_RETRIEVED="Feed not found." MOD_FEED_ERR_NO_URL="No feed URL specified." MOD_FEED_FIELD_DESCRIPTION_DESC="Show the description text for the entire feed." MOD_FEED_FIELD_DESCRIPTION_LABEL="Feed Description" MOD_FEED_FIELD_IMAGE_DESC="Show the image associated with the entire feed." MOD_FEED_FIELD_IMAGE_LABEL="Feed Image" MOD_FEED_FIELD_ITEMDESCRIPTION_DESC="Show the description or intro text of individual RSS items." MOD_FEED_FIELD_ITEMDESCRIPTION_LABEL="Item Description" MOD_FEED_FIELD_ITEMS_DESC="Enter number of RSS items to display." MOD_FEED_FIELD_ITEMS_LABEL="Feed Items" MOD_FEED_FIELD_RSSTITLE_DESC="Display news feed title." MOD_FEED_FIELD_RSSTITLE_LABEL="Feed Title" MOD_FEED_FIELD_RSSURL_DESC="Enter the URL of the RSS/RDF/ATOM feed." MOD_FEED_FIELD_RSSURL_LABEL="Feed URL" MOD_FEED_FIELD_RTL_DESC="Display feed in RTL direction." MOD_FEED_FIELD_RTL_LABEL="RTL Feed" MOD_FEED_FIELD_WORDCOUNT_DESC="Allows you to limit the amount of visible Item description text. 0 will show all the text." MOD_FEED_FIELD_WORDCOUNT_LABEL="Word Count" MOD_FEED_XML_DESCRIPTION="This module allows the displaying of a syndicated feed." PK���\�C��%language/en-GB/en-GB.mod_weblinks.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_WEBLINKS="Weblinks" MOD_WEBLINKS_FIELD_CATEGORY_DESC="Choose the Web Links category to display." MOD_WEBLINKS_FIELD_COUNT_DESC="Number of Web Links to display." MOD_WEBLINKS_FIELD_COUNT_LABEL="Count" MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded." MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL="Count Clicks" MOD_WEBLINKS_FIELD_DESCRIPTION_DESC="Display Web Link description." MOD_WEBLINKS_FIELD_DESCRIPTION_LABEL="Description" MOD_WEBLINKS_FIELD_FOLLOW_DESC="Robots index - allow to follow or not." MOD_WEBLINKS_FIELD_FOLLOW_LABEL="Follow/No Follow" MOD_WEBLINKS_FIELD_HITS_DESC="Show hits." MOD_WEBLINKS_FIELD_HITS_LABEL="Hits" MOD_WEBLINKS_FIELD_ORDERDIRECTION_DESC="Set the ordering direction." MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL="Direction" MOD_WEBLINKS_FIELD_ORDERING_DESC="Ordering for the Web Links." MOD_WEBLINKS_FIELD_ORDERING_LABEL="Ordering" MOD_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is selected." MOD_WEBLINKS_FIELD_TARGET_LABEL="Target Window" MOD_WEBLINKS_FIELD_VALUE_ASCENDING="Ascending" MOD_WEBLINKS_FIELD_VALUE_DESCENDING="Descending" MOD_WEBLINKS_FIELD_VALUE_FOLLOW="Follow" MOD_WEBLINKS_FIELD_VALUE_HITS="Hits" MOD_WEBLINKS_FIELD_VALUE_NOFOLLOW="No follow" MOD_WEBLINKS_FIELD_VALUE_ORDER="Order" MOD_WEBLINKS_HITS="Hits" MOD_WEBLINKS_XML_DESCRIPTION="This modules displays web links from a category defined in the Web Links component." PK���\w4�MM'language/en-GB/en-GB.lib_joomla.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 LIB_JOOMLA_XML_DESCRIPTION="The Joomla! Platform is the Core of the Joomla! Content Management System." PK���\Q��fBB"language/en-GB/en-GB.com_users.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_USERS_ACTIVATION_TOKEN_NOT_FOUND="Verification code not found." COM_USERS_CAPTCHA_LABEL="Captcha" COM_USERS_CAPTCHA_DESC="Type in the textbox what you see in the image." COM_USERS_DATABASE_ERROR="Error getting the user from the database: %s" COM_USERS_DESIRED_PASSWORD="Enter your desired password." COM_USERS_DESIRED_USERNAME="Enter your desired username." COM_USERS_EDIT_PROFILE="Edit Profile" COM_USERS_EMAIL_ACCOUNT_DETAILS="Account Details for %s at %s" COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY="Hello administrator,\n\nA new user has registered at %s.\nThe user has verified his email address and requests that you approve his account.\nThis email contains their details:\n\n Name : %s \n email: %s \n Username: %s \n\nYou can activate the user by selecting on the link below:\n %s \n" COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT="Registration approval required for account of %s at %s" COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY="Hello %s,\n\nYour account has been activated by an administrator. You can now login at %s using the username %s and the password you chose while registering." COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT="Account activated for %s at %s" COM_USERS_EMAIL_PASSWORD_RESET_BODY="Hello,\n\nA request has been made to reset your %s account password. To reset your password, you will need to submit this verification code in order to verify that the request was legitimate.\n\nThe verification code is %s\n\nSelect the URL below and proceed with resetting your password.\n\n %s \n\nThank you." COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT="Your %s password reset request" COM_USERS_EMAIL_REGISTERED_BODY="Hello %s,\n\nThank you for registering at %s.\n\nYou may now log in to %s using the following username and password:\n\nUsername: %s\nPassword: %s" COM_USERS_EMAIL_REGISTERED_BODY_NOPW="Hello %s,\n\nThank you for registering at %s.\n\nYou may now log in to %s using the username and password you registered with." COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY="Hello administrator, \n\nA new user '%s', username '%s', has registered at %s." COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s" COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s" COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account select the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s" COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account select the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s" COM_USERS_EMAIL_USERNAME_REMINDER_BODY="Hello,\n\nA username reminder has been requested for your %s account.\n\nYour username is %s.\n\nTo login to your account, select the link below.\n\n%s \n\nThank you." COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT="Your %s username" COM_USERS_ERROR_SECRET_CODE_WITHOUT_TFA="You have entered a Secret Code but two factor authentication is not enabled in your user account. If you want to use a secret code to secure your login please edit your user profile and enable two factor authentication." COM_USERS_FIELD_PASSWORD_RESET_DESC="Please enter the email address associated with your User account.<br />A verification code will be sent to you. Once you have received the verification code, you will be able to choose a new password for your account." COM_USERS_FIELD_PASSWORD_RESET_LABEL="Email Address" COM_USERS_FIELD_REMIND_EMAIL_DESC="Please enter the email address associated with your User account.<br />Your username will be emailed to the email address on file." COM_USERS_FIELD_REMIND_EMAIL_LABEL="Email Address" COM_USERS_FIELD_RESET_CONFIRM_TOKEN_DESC="Enter the password reset verification code you received by email." COM_USERS_FIELD_RESET_CONFIRM_TOKEN_LABEL="Verification Code" COM_USERS_FIELD_RESET_CONFIRM_USERNAME_DESC="Enter your username." COM_USERS_FIELD_RESET_CONFIRM_USERNAME_LABEL="Username" COM_USERS_FIELD_RESET_PASSWORD1_DESC="Enter your new password." COM_USERS_FIELD_RESET_PASSWORD1_LABEL="Password" COM_USERS_FIELD_RESET_PASSWORD1_MESSAGE="The passwords you entered do not match. Please enter your desired password in the password field and confirm your entry by entering it in the confirm password field." COM_USERS_FIELD_RESET_PASSWORD2_DESC="Confirm your new password." COM_USERS_FIELD_RESET_PASSWORD2_LABEL="Confirm Password" COM_USERS_INVALID_EMAIL="Invalid email address" COM_USERS_LOGIN_IMAGE_ALT="Login image" COM_USERS_LOGIN_REGISTER="Don't have an account?" COM_USERS_LOGIN_REMEMBER_ME="Remember me" COM_USERS_LOGIN_REMIND="Forgot your username?" COM_USERS_LOGIN_RESET="Forgot your password?" COM_USERS_LOGIN_USERNAME_LABEL="Username" COM_USERS_MAIL_FAILED="Failed sending email." COM_USERS_MAIL_SEND_FAILURE_BODY="An error was encountered when sending the user registration email. The error is: %s The user who attempted to register is: %s" COM_USERS_MAIL_SEND_FAILURE_SUBJECT="Error sending email" COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N="Password does not contain enough digits. At least %s digits are required." COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N_1="Password does not contain enough digits. At least 1 digit is required." COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N="Password does not contain enough symbols. At least %s symbols are required." COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N_1="Password does not contain enough symbols. At least 1 symbol is required." COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N="Password does not contain enough uppercase characters. At least %s upper case characters are required." COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N_1="Password does not contain enough uppercase characters. At least 1 upper case character is required." COM_USERS_MSG_PASSWORD_TOO_LONG="Password is too long. Passwords must be less than 100 characters." COM_USERS_MSG_PASSWORD_TOO_SHORT_N="Password is too short. Passwords must have at least %s characters." COM_USERS_MSG_SPACES_IN_PASSWORD="Password must not contain spaces." COM_USERS_OPTIONAL="(optional)" COM_USERS_OR="or" COM_USERS_PROFILE="User Profile" COM_USERS_PROFILE_BIND_FAILED="Could not bind profile data: %s" COM_USERS_PROFILE_CORE_LEGEND="Profile" COM_USERS_PROFILE_CUSTOM_LEGEND="Custom Profile" COM_USERS_PROFILE_DEFAULT_LABEL="Edit Your Profile" COM_USERS_PROFILE_EMAIL1_DESC="Enter your email address." COM_USERS_PROFILE_EMAIL1_LABEL="Email Address" COM_USERS_PROFILE_EMAIL1_MESSAGE="The email address you entered is already in use or invalid. Please enter another email address." COM_USERS_PROFILE_EMAIL2_DESC="Confirm your email address." COM_USERS_PROFILE_EMAIL2_LABEL="Confirm email Address" COM_USERS_PROFILE_EMAIL2_MESSAGE="The email addresses you entered do not match. Please enter your email address in the email address field and confirm your entry by entering it in the confirm email address field." COM_USERS_PROFILE_LAST_VISITED_DATE_LABEL="Last Visited Date" COM_USERS_PROFILE_MY_PROFILE="My Profile" COM_USERS_PROFILE_NAME_DESC="Enter your full name." COM_USERS_PROFILE_NAME_LABEL="Name" COM_USERS_PROFILE_NEVER_VISITED="This is the first time you visit this site" COM_USERS_PROFILE_NOCHANGE_USERNAME_DESC="If you want to change your username, please contact a site administrator." COM_USERS_PROFILE_OTEPS="One time emergency passwords" COM_USERS_PROFILE_OTEPS_DESC="If you do not have access to your two factor authentication device you can use any of the following passwords instead of a regular security code. Each one of these emergency passwords is immediately destroyed upon use. We recommend printing these passwords out and keeping the printout in a safe and accessible location, eg your wallet or a safety deposit box." COM_USERS_PROFILE_OTEPS_WAIT_DESC="There are currently no emergency one time passwords generated in your account. The passwords will be generated automatically and displayed here as soon as you activate two factor authentication." COM_USERS_PROFILE_PASSWORD1_LABEL="Password" COM_USERS_PROFILE_PASSWORD1_MESSAGE="The passwords you entered do not match. Please enter your desired password in the password field and confirm your entry by entering it in the confirm password field." COM_USERS_PROFILE_PASSWORD2_DESC="Confirm your password." COM_USERS_PROFILE_PASSWORD2_LABEL="Confirm Password" COM_USERS_PROFILE_REGISTERED_DATE_LABEL="Registered Date" COM_USERS_PROFILE_SAVE_FAILED="Profile could not be saved: %s" COM_USERS_PROFILE_SAVE_SUCCESS="Profile successfully saved." COM_USERS_PROFILE_TWO_FACTOR_AUTH="Two Factor Authentication" COM_USERS_PROFILE_TWOFACTOR_LABEL="Authentication Method" COM_USERS_PROFILE_TWOFACTOR_DESC="Which two factor authentication method you want to activate on the user account." COM_USERS_PROFILE_USERNAME_DESC="Enter your desired username." COM_USERS_PROFILE_USERNAME_LABEL="Username" COM_USERS_PROFILE_USERNAME_MESSAGE="The username you entered is not available. Please pick another username." COM_USERS_PROFILE_VALUE_NOT_FOUND="No Information Entered" COM_USERS_PROFILE_WELCOME="Welcome, %s" COM_USERS_REGISTER_DEFAULT_LABEL="Create An Account" COM_USERS_REGISTER_EMAIL1_DESC="Enter your email address." COM_USERS_REGISTER_EMAIL1_LABEL="Email Address" COM_USERS_REGISTER_EMAIL1_MESSAGE="The email address you entered is already in use or invalid. Please enter another email address." COM_USERS_REGISTER_EMAIL2_DESC="Confirm your email address." COM_USERS_REGISTER_EMAIL2_LABEL="Confirm email Address" COM_USERS_REGISTER_EMAIL2_MESSAGE="The email addresses you entered do not match. Please enter your email address in the email address field and confirm your entry by entering it in the confirm email address field." COM_USERS_REGISTER_NAME_DESC="Enter your full name." COM_USERS_REGISTER_NAME_LABEL="Name" COM_USERS_REGISTER_PASSWORD1_LABEL="Password" COM_USERS_REGISTER_PASSWORD1_MESSAGE="The passwords you entered do not match. Please enter your desired password in the password field and confirm your entry by entering it in the confirm password field." COM_USERS_REGISTER_PASSWORD2_DESC="Confirm your password." COM_USERS_REGISTER_PASSWORD2_LABEL="Confirm Password" COM_USERS_REGISTER_REQUIRED="<strong class="_QQ_"red"_QQ_">*</strong> Required field" COM_USERS_REGISTER_USERNAME_DESC="Enter your desired username." COM_USERS_REGISTER_USERNAME_LABEL="Username" COM_USERS_REGISTER_USERNAME_MESSAGE="The username you entered is not available. Please pick another username." COM_USERS_REGISTRATION="User Registration" COM_USERS_REGISTRATION_ACTIVATE_SUCCESS="Your Account has been successfully activated. You can now log in using the username and password you chose during the registration." COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED="An error was encountered while sending activation notification email" COM_USERS_REGISTRATION_ACTIVATION_SAVE_FAILED="Failed to save activation data: %s" COM_USERS_REGISTRATION_ADMINACTIVATE_SUCCESS="The user's account has been successfully activated and the user has been notified about it." COM_USERS_REGISTRATION_BIND_FAILED="Failed to bind registration data: %s" COM_USERS_REGISTRATION_COMPLETE_ACTIVATE="Your account has been created and an activation link has been sent to the email address you entered. Note that you must activate the account by selecting the activation link when you get the email before you can login." COM_USERS_REGISTRATION_COMPLETE_VERIFY="Your account has been created and a verification link has been sent to the email address you entered. Note that you must verify the account by selecting the verification link when you get the email and then an administrator will activate your account before you can login." COM_USERS_REGISTRATION_DEFAULT_LABEL="User Registration" COM_USERS_REGISTRATION_SAVE_FAILED="Registration failed: %s" COM_USERS_REGISTRATION_SAVE_SUCCESS="Thank you for registering. You may now log in using the username and password you registered with." COM_USERS_REGISTRATION_SEND_MAIL_FAILED="An error was encountered while sending the registration email. A message has been sent to the administrator of this site." COM_USERS_REGISTRATION_VERIFY_SUCCESS="Your email address has been verified. Once an administrator approves your account you will be notified by email and you can login to the site." COM_USERS_REMIND="Reminder" COM_USERS_REMIND_DEFAULT_LABEL="Please enter the email address associated with your User account. Your username will be emailed to the email address on file." COM_USERS_REMIND_EMAIL_LABEL="Your Email" COM_USERS_REMIND_LIMIT_ERROR_N_HOURS="You have exceeded the maximum number of password resets allowed. Please try again in %s hours." COM_USERS_REMIND_LIMIT_ERROR_N_HOURS_1="You have exceeded the maximum number of password resets allowed. Please try again in one hour." COM_USERS_REMIND_REQUEST_FAILED="Reminder failed: %s" COM_USERS_REMIND_REQUEST_SUCCESS="Reminder successfully sent. Please check your mail." COM_USERS_REMIND_SUPERADMIN_ERROR="A Super User can't request a password reminder. Please contact another Super User or use an alternative method." COM_USERS_RESET="Password Reset" COM_USERS_RESET_COMPLETE_ERROR="Error completing password reset." COM_USERS_RESET_COMPLETE_FAILED="Completing reset password failed: %s" COM_USERS_RESET_COMPLETE_LABEL="To complete the password reset process, please enter a new password." COM_USERS_RESET_COMPLETE_SUCCESS="Reset password successful. You may now login to the site." COM_USERS_RESET_CONFIRM_ERROR="Error while confirming the password." COM_USERS_RESET_CONFIRM_FAILED="Your password reset confirmation failed because the verification code was invalid. %s" COM_USERS_RESET_CONFIRM_LABEL="An email has been sent to your email address. The email contains a verification code, please paste the verification code in the field below to prove that you are the owner of this account." COM_USERS_RESET_COMPLETE_TOKENS_MISSING="Your password reset confirmation failed because the verification code was missing." COM_USERS_RESET_REQUEST_ERROR="Error requesting password reset." COM_USERS_RESET_REQUEST_FAILED="Reset password failed: %s" COM_USERS_RESET_REQUEST_LABEL="Please enter the email address for your account. A verification code will be sent to you. Once you have received the verification code, you will be able to choose a new password for your account." COM_USERS_SETTINGS_FIELDSET_LABEL="Basic Settings" COM_USERS_USER_BLOCKED="This user is blocked. If this is an error, please contact an administrator." COM_USERS_USER_FIELD_BACKEND_LANGUAGE_DESC="Choose your default language for the Backend." COM_USERS_USER_FIELD_BACKEND_LANGUAGE_LABEL="Backend Language" COM_USERS_USER_FIELD_BACKEND_TEMPLATE_DESC="Select the template style for the Administrator Backend interface. This will only affect this User." COM_USERS_USER_FIELD_BACKEND_TEMPLATE_LABEL="Backend Template Style" COM_USERS_USER_FIELD_EDITOR_DESC="Choose your text editor." COM_USERS_USER_FIELD_EDITOR_LABEL="Editor" COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_DESC="Choose your default language for the Frontend." COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_LABEL="Frontend Language" COM_USERS_USER_FIELD_HELPSITE_DESC="Help site for the Backend." COM_USERS_USER_FIELD_HELPSITE_LABEL="Help Site" COM_USERS_USER_FIELD_TIMEZONE_DESC="Choose your time zone." COM_USERS_USER_FIELD_TIMEZONE_LABEL="Time Zone" COM_USERS_USER_NOT_FOUND="User not found." COM_USERS_USER_SAVE_FAILED="Failed to save user: %s" PK���\ � &language/en-GB/en-GB.tpl_beez3.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 TPL_BEEZ3_POSITION_DEBUG="Debug" TPL_BEEZ3_POSITION_POSITION-0="Search" TPL_BEEZ3_POSITION_POSITION-10="Footer middle" TPL_BEEZ3_POSITION_POSITION-11="Footer bottom" TPL_BEEZ3_POSITION_POSITION-12="Middle top" TPL_BEEZ3_POSITION_POSITION-13="Unused" TPL_BEEZ3_POSITION_POSITION-14="Footer last" TPL_BEEZ3_POSITION_POSITION-15="Header" TPL_BEEZ3_POSITION_POSITION-1="Top" TPL_BEEZ3_POSITION_POSITION-2="Breadcrumbs" TPL_BEEZ3_POSITION_POSITION-3="Right bottom" TPL_BEEZ3_POSITION_POSITION-4="Left middle" TPL_BEEZ3_POSITION_POSITION-5="Left bottom" TPL_BEEZ3_POSITION_POSITION-6="Right top" TPL_BEEZ3_POSITION_POSITION-7="Left top" TPL_BEEZ3_POSITION_POSITION-8="Right middle" TPL_BEEZ3_POSITION_POSITION-9="Footer top" TPL_BEEZ3_XML_DESCRIPTION="Accessible template for Joomla! Beez, the HTML 4 version." PK���\a5=�� � #language/en-GB/en-GB.mod_search.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_SEARCH="Search" MOD_SEARCH_FIELD_BOXWIDTH_DESC="Size of the search text box in characters." MOD_SEARCH_FIELD_BOXWIDTH_LABEL="Box Width" MOD_SEARCH_FIELD_BUTTON_DESC="Display a search button." MOD_SEARCH_FIELD_BUTTON_LABEL="Search Button" MOD_SEARCH_FIELD_BUTTONPOS_DESC="Position of the button relative to the search box." MOD_SEARCH_FIELD_BUTTONPOS_LABEL="Button Position" MOD_SEARCH_FIELD_BUTTONTEXT_DESC="The text that appears in the search button. If left blank, it will load the 'searchbutton' string from your language file." MOD_SEARCH_FIELD_BUTTONTEXT_LABEL="Button Text" MOD_SEARCH_FIELD_IMAGEBUTTON_DESC="Use an image as button. This image has to be named searchButton.gif and must be located in templates/*your template name*/images/." MOD_SEARCH_FIELD_IMAGEBUTTON_LABEL="Search Button Image" MOD_SEARCH_FIELD_SETITEMID_DESC="Assign an ItemID by selecting a menu item in the list for the display of the search results if there is no com_search menu and a specific display is desired. If you do not know what this means, you may not need it." MOD_SEARCH_FIELD_SETITEMID_LABEL="Set ItemID" MOD_SEARCH_FIELD_LABEL_TEXT_DESC="The text that appears in the label of search box. If left blank, it will load 'label' string from your language file." MOD_SEARCH_FIELD_LABEL_TEXT_LABEL="Box Label" MOD_SEARCH_FIELD_OPENSEARCH_LABEL="OpenSearch Autodiscovery" MOD_SEARCH_FIELD_OPENSEARCH_TEXT_LABEL="OpenSearch Title" MOD_SEARCH_FIELD_OPENSEARCH_TEXT_DESC="Text displayed in supported browsers when adding your site as a search provider." MOD_SEARCH_FIELD_OPENSEARCH_DESC="Some browsers can add support for your site's search if this option is enabled." MOD_SEARCH_FIELD_TEXT_DESC="The text that appears in the search text box. If left blank, it will load the 'searchbox' string from your language file." MOD_SEARCH_FIELD_TEXT_LABEL="Box Text" MOD_SEARCH_FIELD_VALUE_BOTTOM="Bottom" MOD_SEARCH_FIELD_VALUE_LEFT="Left" MOD_SEARCH_FIELD_VALUE_RIGHT="Right" MOD_SEARCH_FIELD_VALUE_TOP="Top" MOD_SEARCH_LABEL_TEXT="Search ..." MOD_SEARCH_SEARCHBOX_TEXT="Search ..." MOD_SEARCH_SEARCHBUTTON_TEXT="Search" MOD_SEARCH_SELECT_MENU_ITEMID="Select a menu item" MOD_SEARCH_XML_DESCRIPTION="This module will display a search box."PK���\�"9 9 "language/en-GB/en-GB.mod_login.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_LOGIN="Login" MOD_LOGIN_FIELD_GREETING_DESC="Show or hide the simple greeting text." MOD_LOGIN_FIELD_GREETING_LABEL="Show Greeting" MOD_LOGIN_FIELD_LOGIN_REDIRECTURL_DESC="Select the page the user will be redirected to after a successful login. Select from all the pages listed in the dropdown menu. Choosing "Default" will return to the same page." MOD_LOGIN_FIELD_LOGIN_REDIRECTURL_LABEL="Login Redirection Page" MOD_LOGIN_FIELD_LOGOUT_REDIRECTURL_DESC="Select the page the user will be redirected to after successfully ending their current session by logging out. Select from all the pages listed in the dropdown menu. Choosing "Default" will return to the same page." MOD_LOGIN_FIELD_LOGOUT_REDIRECTURL_LABEL="Logout Redirection Page" MOD_LOGIN_FIELD_NAME_DESC="Displays name or username after logging in." MOD_LOGIN_FIELD_NAME_LABEL="Show Name/Username" MOD_LOGIN_FIELD_POST_TEXT_DESC="This is the text or HTML that is displayed below the login form." MOD_LOGIN_FIELD_POST_TEXT_LABEL="Post-text" MOD_LOGIN_FIELD_PRE_TEXT_DESC="This is the text or HTML that is displayed above the login form." MOD_LOGIN_FIELD_PRE_TEXT_LABEL="Pre-text" MOD_LOGIN_FIELD_USESECURE_DESC="Submit encrypted login data (requires SSL). Do not enable this option if Joomla is not accessible using the https:// protocol prefix." MOD_LOGIN_FIELD_USESECURE_LABEL="Encrypt Login Form" MOD_LOGIN_FIELD_USETEXT_DESC="Choose text or icons to display the field labels. Default is icons." MOD_LOGIN_FIELD_USETEXT_LABEL="Display Labels" MOD_LOGIN_FORGOT_YOUR_PASSWORD="Forgot your password?" MOD_LOGIN_FORGOT_YOUR_USERNAME="Forgot your username?" MOD_LOGIN_HINAME="Hi %s," MOD_LOGIN_REGISTER="Create an account" MOD_LOGIN_REMEMBER_ME="Remember Me" MOD_LOGIN_VALUE_ICONS="Icons" MOD_LOGIN_VALUE_NAME="Name" MOD_LOGIN_VALUE_TEXT="Text" MOD_LOGIN_VALUE_USERNAME="Username" MOD_LOGIN_XML_DESCRIPTION="This module displays a username and password login form. It also displays a link to retrieve a forgotten password. If user registration is enabled (in User Manager > Options), another link will be shown to enable self-registration for users." PK���\z'�~jj,language/en-GB/en-GB.mod_articles_latest.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_LATEST="Articles - Latest" MOD_LATEST_NEWS_FIELD_CATEGORY_DESC="Selects Articles from one or more Categories. If no selection will show all categories as default." MOD_LATEST_NEWS_FIELD_COUNT_DESC="The number of Articles to display (the default is 5)." MOD_LATEST_NEWS_FIELD_COUNT_LABEL="Count" MOD_LATEST_NEWS_FIELD_FEATURED_DESC="Show or hide articles designated as featured." MOD_LATEST_NEWS_FIELD_FEATURED_LABEL="Featured Articles" MOD_LATEST_NEWS_FIELD_ORDERING_DESC="Recently Added First: order the articles using their creation date<br />Recently Modified First: order the articles using their modification date<br />Recently Published First: order the articles using their publication date.<br />Recently Touched First: order the articles using their modification or creation dates." MOD_LATEST_NEWS_FIELD_ORDERING_LABEL="Order" MOD_LATEST_NEWS_FIELD_USER_DESC="Filter by author." MOD_LATEST_NEWS_FIELD_USER_LABEL="Authors" MOD_LATEST_NEWS_VALUE_ADDED_BY_ME="Added or modified by me" MOD_LATEST_NEWS_VALUE_ANYONE="Anyone" MOD_LATEST_NEWS_VALUE_NOTADDED_BY_ME="Not added or modified by me" MOD_LATEST_NEWS_VALUE_ONLY_SHOW_FEATURED="Only show Featured Articles" MOD_LATEST_NEWS_VALUE_RECENT_ADDED="Recently Added First" MOD_LATEST_NEWS_VALUE_RECENT_MODIFIED="Recently Modified First" MOD_LATEST_NEWS_VALUE_RECENT_RAND="Random Articles" MOD_LATEST_NEWS_VALUE_RECENT_PUBLISHED="Recently Published First" MOD_LATEST_NEWS_VALUE_RECENT_TOUCHED="Recently Touched First" MOD_LATEST_NEWS_XML_DESCRIPTION="This module shows a list of the most recently published and current Articles. Some that are shown may have expired even though they are the most recent." PK���\��w�* * #language/en-GB/en-GB.mod_finder.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 ; Strings going to the component COM_FINDER_FILTER_BRANCH_LABEL="Search by %s" COM_FINDER_FILTER_SELECT_ALL_LABEL="Search All" COM_FINDER_ADVANCED_SEARCH="Advanced Search" COM_FINDER_SELECT_SEARCH_FILTER="- No Filter -" ; Module strings MOD_FINDER="Smart Search" MOD_FINDER_CONFIG_OPTION_BOTTOM="Bottom" MOD_FINDER_CONFIG_OPTION_TOP="Top" MOD_FINDER_FIELDSET_ADVANCED_ALT_DESCRIPTION="An alternative label for the search field." MOD_FINDER_FIELDSET_ADVANCED_ALT_LABEL="Alternative Label" MOD_FINDER_FIELDSET_ADVANCED_BUTTON_POS_DESCRIPTION="The position of the search button relative to the search field." MOD_FINDER_FIELDSET_ADVANCED_BUTTON_POS_LABEL="Button Position" MOD_FINDER_FIELDSET_ADVANCED_FIELD_SIZE_DESCRIPTION="The width of the search field by character length." MOD_FINDER_FIELDSET_ADVANCED_FIELD_SIZE_LABEL="Search Field Size" MOD_FINDER_FIELDSET_ADVANCED_LABEL_POS_DESCRIPTION="The position of the search label relative to the search field." MOD_FINDER_FIELDSET_ADVANCED_LABEL_POS_LABEL="Label Position" MOD_FINDER_FIELDSET_ADVANCED_SETITEMID_DESCRIPTION="Assign an ItemID by selecting a menu item in the list for the display of the search results if there is no com_finder menu item and a specific display is desired. If you do not know what this means, you may not need it." MOD_FINDER_FIELDSET_ADVANCED_SETITEMID_LABEL="Set ItemID" MOD_FINDER_FIELDSET_ADVANCED_SHOW_BUTTON_DESCRIPTION="Toggle whether a button should be displayed for the search form." MOD_FINDER_FIELDSET_ADVANCED_SHOW_BUTTON_LABEL="Search Button" MOD_FINDER_FIELDSET_ADVANCED_SHOW_LABEL_DESCRIPTION="Toggle whether a label should be displayed for the search field." MOD_FINDER_FIELDSET_ADVANCED_SHOW_LABEL_LABEL="Search Field Label" MOD_FINDER_FIELDSET_BASIC_AUTOSUGGEST_DESCRIPTION="Toggle whether automatic search suggestions should be displayed." MOD_FINDER_FIELDSET_BASIC_AUTOSUGGEST_LABEL="Search Suggestions" MOD_FINDER_FIELDSET_BASIC_SEARCHFILTER_DESCRIPTION="Selecting a Search Filter will limit any searches submitted through this module to use the selected filter." MOD_FINDER_FIELDSET_BASIC_SEARCHFILTER_LABEL="Search Filter" MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_DESCRIPTION="Toggle whether users should be able to see advanced search options. If set to Link to Component option creates a Smart Search link which redirects to the smart search view. If set to show, the advanced search options will be displayed inline." MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_LABEL="Advanced Search" MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_OPTION_LINK="Link to Component" MOD_FINDER_FIELD_OPENSEARCH_DESCRIPTION="Some browsers can add support for your site's search if this option is enabled." MOD_FINDER_FIELD_OPENSEARCH_LABEL="OpenSearch Autodiscovery" MOD_FINDER_FIELD_OPENSEARCH_TEXT_DESCRIPTION="Text displayed in supported browsers when adding your site as a search provider." MOD_FINDER_FIELD_OPENSEARCH_TEXT_LABEL="OpenSearch title" MOD_FINDER_SEARCHBUTTON_TEXT="Search" MOD_FINDER_SEARCH_BUTTON="Go" MOD_FINDER_SEARCH_VALUE="Search ..." MOD_FINDER_SELECT_MENU_ITEMID="Select a menu item" MOD_FINDER_XML_DESCRIPTION="This is a Smart Search module." PK���\6����#language/en-GB/en-GB.finder_cli.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 FINDER_CLI="Smart Search INDEXER" FINDER_CLI_BATCH_COMPLETE=" * Processed batch %s in %s seconds." FINDER_CLI_FILTER_RESTORE_WARNING="Warning: Did not find taxonomy %s/%s in filter %s" FINDER_CLI_INDEX_PURGE="Clear index" FINDER_CLI_INDEX_PURGE_FAILED="- index clear failed." FINDER_CLI_INDEX_PURGE_SUCCESS="- index clear successful" FINDER_CLI_PROCESS_COMPLETE="Total Processing Time: %s seconds." FINDER_CLI_RESTORE_FILTER_COMPLETED="- number of filters restored: %s" FINDER_CLI_RESTORE_FILTERS="Restoring filters" FINDER_CLI_SAVE_FILTER_COMPLETED="- number of saved filters: %s" FINDER_CLI_SAVE_FILTERS="Saving filters" FINDER_CLI_SETTING_UP_PLUGINS="Setting up Smart Search plugins" FINDER_CLI_SETUP_ITEMS="Setup %s items in %s seconds." FINDER_CLI_STARTING_INDEXER="Starting Indexer" PK���\i���2language/en-GB/en-GB.mod_articles_category.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_CATEGORY="Articles - Category" MOD_ARTICLES_CATEGORY_XML_DESCRIPTION="This module displays a list of articles from one or more categories." MOD_ARTICLES_CATEGORY_LAYOUT_DEFAULT="Default" PK���\w��'language/en-GB/en-GB.mod_custom.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_CUSTOM="Custom HTML" MOD_CUSTOM_XML_DESCRIPTION="This module allows you to create your own HTML Module using a WYSIWYG editor." MOD_CUSTOM_LAYOUT_DEFAULT="Default" PK���\�G�Jhh)language/en-GB/en-GB.mod_users_latest.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_USERS_LATEST="Latest Users" MOD_USERS_LATEST_FIELD_FILTER_GROUPS_DESC="Choose to filter by groups of the connected user." MOD_USERS_LATEST_FIELD_FILTER_GROUPS_LABEL="Filter Groups" MOD_USERS_LATEST_FIELD_LINKTOWHAT_DESC="Choose the type of information to display." MOD_USERS_LATEST_FIELD_LINKTOWHAT_LABEL="User Information" MOD_USERS_LATEST_FIELD_NUMBER_DESC="Number of latest registered users to display." MOD_USERS_LATEST_FIELD_NUMBER_LABEL="Number of Users" MOD_USERS_LATEST_FIELD_VALUE_CONTACT="Contact" MOD_USERS_LATEST_FIELD_VALUE_PROFILE="Profile" MOD_USERS_LATEST_XML_DESCRIPTION="This module displays the latest registered users." PK���\�ub&&-language/en-GB/en-GB.mod_tags_popular.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_TAGS_POPULAR="Tags - Popular" MOD_TAGS_POPULAR_LAYOUT_CLOUD="Cloud" MOD_TAGS_POPULAR_LAYOUT_DEFAULT="Default" MOD_TAGS_POPULAR_XML_DESCRIPTION="This module displays tags used on the site in a list or a cloud layout. Tags can be ordered by title or by the number of tagged items and limited to a specific time period." PK���\��H�QQ$language/en-GB/en-GB.lib_fof.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 LIB_FOF_XML_DESCRIPTION="Framework-on-Framework (FOF) - A rapid component development framework for Joomla!" PK���\������(language/en-GB/en-GB.mod_wrapper.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_WRAPPER="Wrapper" MOD_WRAPPER_NO_IFRAMES="No iframes" MOD_WRAPPER_XML_DESCRIPTION="This module shows an iframe window to specified location." MOD_WRAPPER_LAYOUT_DEFAULT="Default" PK���\B��U*language/en-GB/en-GB.mod_articles_news.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_NEWS="Articles - Newsflash" MOD_ARTICLES_NEWS_FIELD_CATEGORY_DESC="Select Articles from a specific Category or a set of Categories. If no selection will show all categories as default." MOD_ARTICLES_NEWS_FIELD_IMAGES_DESC="Display Article images." MOD_ARTICLES_NEWS_FIELD_IMAGES_LABEL="Show Images" MOD_ARTICLES_NEWS_FIELD_ITEMS_DESC="The number of Articles to display within this module." MOD_ARTICLES_NEWS_FIELD_ITEMS_LABEL="Number of Articles" MOD_ARTICLES_NEWS_FIELD_LINKTITLE_DESC="Link the Article titles to Articles." MOD_ARTICLES_NEWS_FIELD_LINKTITLE_LABEL="Linked Titles" MOD_ARTICLES_NEWS_FIELD_ORDERING_DESC="Select the order in which you want query results presented." MOD_ARTICLES_NEWS_FIELD_ORDERING_LABEL="Order Results" MOD_ARTICLES_NEWS_FIELD_ORDERING_CREATED_DATE="Created Date" MOD_ARTICLES_NEWS_FIELD_ORDERING_PUBLISHED_DATE="Published Date" MOD_ARTICLES_NEWS_FIELD_ORDERING_ORDERING="Ordering" MOD_ARTICLES_NEWS_FIELD_ORDERING_RANDOM="Random" MOD_ARTICLES_NEWS_FIELD_READMORE_DESC="If set to Show, the 'Read more ...' link will show if Main text has been provided for an Article." MOD_ARTICLES_NEWS_FIELD_READMORE_LABEL="'Read more ...' Link" MOD_ARTICLES_NEWS_FIELD_SEPARATOR_DESC="Show separator after last Article." MOD_ARTICLES_NEWS_FIELD_SEPARATOR_LABEL="Show Last Separator" MOD_ARTICLES_NEWS_FIELD_TITLE_DESC="Show or hide the Article title." MOD_ARTICLES_NEWS_FIELD_TITLE_LABEL="Show Article Title" MOD_ARTICLES_NEWS_READMORE="Read more ..." MOD_ARTICLES_NEWS_READMORE_REGISTER="Register to Read More" MOD_ARTICLES_NEWS_TITLE_HEADING="Header Level" MOD_ARTICLES_NEWS_TITLE_HEADING_DESCRIPTION="Select the desired HTML header level for the Article titles." MOD_ARTICLES_NEWS_XML_DESCRIPTION="The Article Newsflash Module will display a fixed number of Articles from a specific Category or a set of Categories."PK���\$YF8++&language/en-GB/en-GB.com_newsfeeds.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_NEWSFEEDS_CACHE_DIRECTORY_UNWRITABLE="The cache folder is unwritable. The news feed can't be displayed. Please contact a site administrator." COM_NEWSFEEDS_CAT_NUM="# of News feeds :" COM_NEWSFEEDS_CONTENT_TYPE_NEWSFEED="News Feed" COM_NEWSFEEDS_CONTENT_TYPE_CATEGORY="News Feed Category" COM_NEWSFEEDS_DEFAULT_PAGE_TITLE="News Feeds" COM_NEWSFEEDS_ERROR_FEED_NOT_FOUND="Error. Feed not found." COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED="Error. Feed could not be retrieved." COM_NEWSFEEDS_FEED_LINK="Feed Link" COM_NEWSFEEDS_FEED_NAME="Feed Name" COM_NEWSFEEDS_FILTER_LABEL="Filter Field" COM_NEWSFEEDS_FILTER_SEARCH_DESC="News Feed Filter Search" COM_NEWSFEEDS_NO_ARTICLES="No Articles for this News Feed." COM_NEWSFEEDS_NUM_ARTICLES="# Articles" COM_NEWSFEEDS_NUM_ARTICLES_COUNT="# Articles: %s" COM_NEWSFEEDS_NUM_ITEMS="# News feeds" PK���\���`��"language/en-GB/en-GB.tpl_beez3.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 TPL_BEEZ3_ADDITIONAL_INFORMATION="Additional information" TPL_BEEZ3_ALTCLOSE="is closed" TPL_BEEZ3_ALTOPEN="is open" TPL_BEEZ3_BIGGER="Bigger" TPL_BEEZ3_CLICK="select" TPL_BEEZ3_CLOSEMENU="Close Menu" TPL_BEEZ3_DECREASE_SIZE="Decrease size" TPL_BEEZ3_ERROR_JUMP_TO_NAV="Jump to navigation" TPL_BEEZ3_FIELD_BOOTSTRAP_DESC="Create a comma separated list of any components for which Bootstrap is needed, for example com_name, com_anothername." TPL_BEEZ3_FIELD_BOOTSTRAP_LABEL="Components Requiring<br /> Bootstrap" TPL_BEEZ3_FIELD_DESCRIPTION_DESC="Please add your site description here." TPL_BEEZ3_FIELD_DESCRIPTION_LABEL="Site Description" TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_DESC="Choose a colour for the Background when Custom is selected as the Template Colour. If left blank the Default (#eeeeee) is used." TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_LABEL="Background Colour" TPL_BEEZ3_FIELD_HEADER_IMAGE_DESC="Select or upload an image to be used as a header image when the custom colour option is selected." TPL_BEEZ3_FIELD_HEADER_IMAGE_LABEL="Header Image" TPL_BEEZ3_FIELD_LOGO_DESC="Select or upload an image. If you do not want to display a logo, select Clear and leave the field blank." TPL_BEEZ3_FIELD_LOGO_LABEL="Logo" TPL_BEEZ3_FIELD_NAVPOSITION_DESC="Navigation before or after content." TPL_BEEZ3_FIELD_NAVPOSITION_LABEL="Position of Navigation" TPL_BEEZ3_FIELD_SITETITLE_DESC="Please add your site title here, it's only displayed if you don't use a logo." TPL_BEEZ3_FIELD_SITETITLE_LABEL="Site Title" TPL_BEEZ3_FIELD_TEMPLATECOLOR_DESC="Colour of the template." TPL_BEEZ3_FIELD_TEMPLATECOLOR_LABEL="Template Colour" TPL_BEEZ3_FIELD_WRAPPERLARGE_DESC="Wrapper width with closed additional columns in percent." TPL_BEEZ3_FIELD_WRAPPERLARGE_LABEL="Wrapper Large (%)" TPL_BEEZ3_FIELD_WRAPPERSMALL_DESC="Wrapper width with opened additional columns in percent." TPL_BEEZ3_FIELD_WRAPPERSMALL_LABEL="Wrapper Small (%)" TPL_BEEZ3_FONTSIZE="Font Size" TPL_BEEZ3_INCREASE_SIZE="Increase size" TPL_BEEZ3_JUMP_TO_INFO="Jump to additional information" TPL_BEEZ3_JUMP_TO_NAV="Jump to main navigation and login" TPL_BEEZ3_NAVIGATION="Navigation" TPL_BEEZ3_NAV_VIEW_SEARCH="Nav view search" TPL_BEEZ3_NEXTTAB="Next Tab" TPL_BEEZ3_OPENMENU="Open Menu" TPL_BEEZ3_OPTION_AFTER_CONTENT="after content" TPL_BEEZ3_OPTION_BEFORE_CONTENT="before content" TPL_BEEZ3_OPTION_IMAGE="Custom" TPL_BEEZ3_OPTION_NATURE="Nature" TPL_BEEZ3_OPTION_PERSONAL="Personal" TPL_BEEZ3_OPTION_RED="Red" TPL_BEEZ3_OPTION_TURQ="Turquoise" TPL_BEEZ3_POWERED_BY="Powered by" TPL_BEEZ3_RESET="Reset" TPL_BEEZ3_REVERT_STYLES_TO_DEFAULT="Revert styles to default" TPL_BEEZ3_SEARCH="Search" TPL_BEEZ3_SKIP_TO_CONTENT="Skip to content" TPL_BEEZ3_SKIP_TO_ERROR_CONTENT="Jump to error message and search" TPL_BEEZ3_SMALLER="Smaller" TPL_BEEZ3_SYSTEM_MESSAGE="Error" TPL_BEEZ3_TEXTRIGHTCLOSE="Close info" TPL_BEEZ3_TEXTRIGHTOPEN="Open info" TPL_BEEZ3_XML_DESCRIPTION="Accessible template for Joomla! Beez, the HTML 4 version." TPL_BEEZ3_YOUR_SITE_DESCRIPTION="Your site description" PK���\�d�tt'language/en-GB/en-GB.mod_finder.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_FINDER="Smart Search" MOD_FINDER_XML_DESCRIPTION="This is a search module for the Smart Search system." MOD_FINDER_LAYOUT_DEFAULT="Default" PK���\X_�>��+language/en-GB/en-GB.mod_whosonline.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_WHOSONLINE="Who's Online" MOD_WHOSONLINE_XML_DESCRIPTION="The Who's Online Module displays the number of Anonymous Users (Guests) and Registered Users (users logged-in) that are currently accessing the website." MOD_WHOSONLINE_LAYOUT_DEFAULT="Default" PK���\�6���#language/en-GB/en-GB.com_search.ininu�[���; author Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; license GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_SEARCH_ALL_WORDS="All words" COM_SEARCH_ALPHABETICAL="Alphabetical" COM_SEARCH_ANY_WORDS="Any words" COM_SEARCH_ERROR_ENTERKEYWORD="Enter a search keyword" COM_SEARCH_ERROR_IGNOREKEYWORD="One or more common words were ignored in the search." COM_SEARCH_ERROR_SEARCH_MESSAGE="Search term must be a minimum of %1$s characters and a maximum of %2$s characters." COM_SEARCH_EXACT_PHRASE="Exact Phrase" COM_SEARCH_FIELD_SEARCH_PHRASES_DESC="Show the search options." COM_SEARCH_FIELD_SEARCH_PHRASES_LABEL="Use Search Options" COM_SEARCH_FIELD_SEARCH_AREAS_DESC="Show the search areas checkboxes." COM_SEARCH_FIELD_SEARCH_AREAS_LABEL="Use Search Areas" COM_SEARCH_FOR="Search for:" COM_SEARCH_MOST_POPULAR="Most Popular" COM_SEARCH_NEWEST_FIRST="Newest First" COM_SEARCH_OLDEST_FIRST="Oldest First" COM_SEARCH_ORDERING="Ordering:" COM_SEARCH_SEARCH="Search" COM_SEARCH_SEARCH_AGAIN="Search Again" COM_SEARCH_SEARCH_KEYWORD="Search Keyword:" COM_SEARCH_SEARCH_KEYWORD_N_RESULTS_1="<strong>Total: One result found.</strong>" COM_SEARCH_SEARCH_KEYWORD_N_RESULTS="<strong>Total: %s results found.</strong>" COM_SEARCH_SEARCH_ONLY="Search Only:" COM_SEARCH_SEARCH_RESULT="Search Result" PK���\���6~ ~ )language/en-GB/en-GB.mod_tags_popular.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_TAGS_POPULAR="Tags - Popular" MOD_TAGS_POPULAR_FIELD_ALL_TIME="All time" MOD_TAGS_POPULAR_FIELD_DISPLAY_COUNT_DESC="Choose if the number of tagged items should be displayed next to each tag." MOD_TAGS_POPULAR_FIELD_DISPLAY_COUNT_LABEL="Display Number of Items" MOD_TAGS_POPULAR_FIELD_LAST_DAY="Last day" MOD_TAGS_POPULAR_FIELD_LAST_HOUR="Last hour" MOD_TAGS_POPULAR_FIELD_LAST_MONTH="Last month" MOD_TAGS_POPULAR_FIELD_LAST_WEEK="Last week" MOD_TAGS_POPULAR_FIELD_LAST_YEAR="Last year" MOD_TAGS_POPULAR_FIELD_MAX_DESC="Sets the maximum number of tags to display in the module. Enter "0" to display all tags." MOD_TAGS_POPULAR_FIELD_MAX_LABEL="Maximum Tags" MOD_TAGS_POPULAR_FIELD_MAXSIZE_DESC="The maximum font size used for the tags, proportional to the site's default font size (eg "2" means 200% of the default size)." MOD_TAGS_POPULAR_FIELD_MAXSIZE_LABEL="Maximum Font Size" MOD_TAGS_POPULAR_FIELD_MINSIZE_DESC="The minimum font size used for the tags, proportional to the site's default font size (eg "2" means 200% of the default size)." MOD_TAGS_POPULAR_FIELD_MINSIZE_LABEL="Minimum Font Size" MOD_TAGS_POPULAR_FIELD_NO_RESULTS_DESC="Will show a message if no matching tags are found instead of hiding the module." MOD_TAGS_POPULAR_FIELD_NO_RESULTS_LABEL="Show "No results" text" MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_COUNT="Number of Items" MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_DESC="The order that tags will show in." MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_LABEL="Order" MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_RANDOM="Random" MOD_TAGS_POPULAR_FIELD_ORDER_VALUE_TITLE="Title" MOD_TAGS_POPULAR_FIELD_TIMEFRAME_DESC="Sets the time period for which to calculate popularity." MOD_TAGS_POPULAR_FIELD_TIMEFRAME_LABEL="Time Period" MOD_TAGS_POPULAR_FIELDSET_CLOUD_LABEL="Cloud Layout" MOD_TAGS_POPULAR_MAX_DESC="Sets the maximum number of tags to display in the module." MOD_TAGS_POPULAR_MAX_LABEL="Maximum tags" MOD_TAGS_POPULAR_NO_ITEMS_FOUND="No Tags found." MOD_TAGS_POPULAR_XML_DESCRIPTION="This module displays tags used on the site in a list or a cloud layout. Tags can be ordered by title or by the number of tagged items and limited to a specific time period." PK���\�\~pp*language/en-GB/en-GB.mod_related_items.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_RELATED_FIELD_MAX_DESC="The maximum number of related articles to display (default is 5)." MOD_RELATED_FIELD_MAX_LABEL="Maximum Articles" MOD_RELATED_FIELD_SHOWDATE_DESC="Show or hide date." MOD_RELATED_FIELD_SHOWDATE_LABEL="Show Date" MOD_RELATED_ITEMS="Articles - Related" MOD_RELATED_XML_DESCRIPTION="This module displays other Articles that are related to the one currently being viewed. These relations are established by the Meta keywords. <br />All the keywords of the current Article are searched against all the keywords of all other published Articles. For example, you may have an Article on "Breeding Parrots" and another on "Hand Raising Black Cockatoos". If you include the keyword "parrot" in both Articles, then the Related Items Module will list the "Breeding Parrots" Article when viewing "Hand Raising Black Cockatoos" and vice-versa."PK���\:���0language/en-GB/en-GB.mod_articles_latest.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_LATEST="Articles - Latest" MOD_LATEST_NEWS_XML_DESCRIPTION="This module shows a list of the most recently published and current Articles. Some that are shown may have expired even though they are the most recent." MOD_ARTICLES_LATEST_LAYOUT_DEFAULT="Default" PK���\��M�||)language/en-GB/en-GB.mod_random_image.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_RANDOM_IMAGE="Random Image" MOD_RANDOM_IMAGE_FIELD_FOLDER_DESC="Path to the image folder relative to the site URL (eg images)." MOD_RANDOM_IMAGE_FIELD_FOLDER_LABEL="Image Folder" MOD_RANDOM_IMAGE_FIELD_HEIGHT_DESC="Image height forces all images to be displayed with the height in pixels." MOD_RANDOM_IMAGE_FIELD_HEIGHT_LABEL="Height (px)" MOD_RANDOM_IMAGE_FIELD_LINK_DESC="A URL to redirect to if the image is selected (eg http://www.joomla.org)." MOD_RANDOM_IMAGE_FIELD_LINK_LABEL="Link" MOD_RANDOM_IMAGE_FIELD_TYPE_DESC="Type of image PNG/GIF/JPG etc (the default is JPG)." MOD_RANDOM_IMAGE_FIELD_TYPE_LABEL="Image Type" MOD_RANDOM_IMAGE_FIELD_WIDTH_DESC="Image width forces all images to be displayed with this width in pixels." MOD_RANDOM_IMAGE_FIELD_WIDTH_LABEL="Width (px)" MOD_RANDOM_IMAGE_NO_IMAGES="No Images" MOD_RANDOM_IMAGE_XML_DESCRIPTION="This module displays a random image from your chosen folder." PK���\�ռ���&language/en-GB/en-GB.mod_stats.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_STATS="Statistics" MOD_STATS_XML_DESCRIPTION="The Statistics Module shows information about your server installation together with statistics on the website users, number of Articles in your database and the number of Web links you provide." MOD_STATS_LAYOUT_DEFAULT="Default" PK���\�=���%language/en-GB/en-GB.com_messages.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_MESSAGES_ERR_SEND_FAILED="The user has locked their mailbox. Message failed." COM_MESSAGES_NEW_MESSAGE_ARRIVED="A new private message has arrived from %s" COM_MESSAGES_PLEASE_LOGIN="Please log in to %s to read your message." PK���\�4lAEE"language/en-GB/en-GB.com_media.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_MEDIA_ALIGN="Image Float" COM_MEDIA_ALIGN_DESC="This will apply the classes 'pull-left', 'pull-center' or 'pull-right' to the '<figure>' or '<img>' element." COM_MEDIA_BROWSE_FILES="Browse Files" COM_MEDIA_CAPTION="Caption" COM_MEDIA_CAPTION_CLASS_LABEL="Caption Class" COM_MEDIA_CAPTION_CLASS_DESC="This will apply the entered class to the '<figcaption>' element. For example: 'text-left', 'text-right', 'text-center'." COM_MEDIA_CLEAR_LIST="Clear List" COM_MEDIA_CONFIGURATION="Media: Options" COM_MEDIA_CREATE_FOLDER="Create Folder" COM_MEDIA_CURRENT_PROGRESS="Current progress" COM_MEDIA_DESCFTP="To upload, change and delete media files, Joomla! will most likely need your FTP account details. Please enter them in the form fields below." COM_MEDIA_DESCFTPTITLE="FTP Login Details" COM_MEDIA_DETAIL_VIEW="Detail View" COM_MEDIA_DIRECTORY="Folder" COM_MEDIA_DIRECTORY_UP="Folder Up" COM_MEDIA_ERROR_BAD_REQUEST="Bad Request" COM_MEDIA_ERROR_FILE_EXISTS="File already exists." COM_MEDIA_ERROR_UNABLE_TO_CREATE_FOLDER_WARNDIRNAME="Unable to create folder. Folder name must only contain alphanumeric characters and no spaces." COM_MEDIA_ERROR_UNABLE_TO_BROWSE_FOLDER_WARNDIRNAME="Unable to browse: %s. Folder name must only contain alphanumeric characters and no spaces." COM_MEDIA_ERROR_UNABLE_TO_DELETE=" Unable to delete: " COM_MEDIA_ERROR_UNABLE_TO_DELETE_FILE_WARNFILENAME="Unable to delete: %s. File name must only contain alphanumeric characters and no spaces." COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_NOT_EMPTY="Unable to delete: %s. Folder is not empty!" COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_WARNDIRNAME="Unable to delete: %s. Folder name must only contain alphanumeric characters and no spaces." COM_MEDIA_ERROR_UNABLE_TO_UPLOAD_FILE="Unable to upload file." COM_MEDIA_ERROR_WARNFILETOOLARGE="This file is too large to upload." COM_MEDIA_ERROR_WARNUPLOADTOOLARGE="Total size of upload exceeds the limit." COM_MEDIA_FIELD_CHECK_MIME_DESC="Use MIME Magic or Fileinfo to attempt to verify files. Try disabling this if you get invalid mime type errors." COM_MEDIA_FIELD_CHECK_MIME_LABEL="Check MIME Types" COM_MEDIA_FIELD_IGNORED_EXTENSIONS_DESC="Ignored file extensions for MIME type checking and restricted uploads." COM_MEDIA_FIELD_IGNORED_EXTENSIONS_LABEL="Ignored Extensions" COM_MEDIA_FIELD_ILLEGAL_MIME_TYPES_DESC="A comma separated list of illegal MIME types for upload (blacklist)." COM_MEDIA_FIELD_ILLEGAL_MIME_TYPES_LABEL="Illegal MIME Types" COM_MEDIA_FIELD_LEGAL_EXTENSIONS_DESC=" Extensions (file types) you are allowed to upload (comma separated)." COM_MEDIA_FIELD_LEGAL_EXTENSIONS_LABEL="Legal Extensions (File Types)" COM_MEDIA_FIELD_LEGAL_IMAGE_EXTENSIONS_DESC=" Image extensions (file types) you are allowed to upload (comma separated). These are used to check for valid image headers." COM_MEDIA_FIELD_LEGAL_IMAGE_EXTENSIONS_LABEL="Legal Image Extensions (File Types)" COM_MEDIA_FIELD_LEGAL_MIME_TYPES_DESC="A comma separated list of legal MIME types for upload." COM_MEDIA_FIELD_LEGAL_MIME_TYPES_LABEL="Legal MIME Types" COM_MEDIA_FIELD_MAXIMUM_SIZE_DESC="The maximum size for an upload (in bytes). Use zero for no limit. Note: your server has a maximum limit." COM_MEDIA_FIELD_MAXIMUM_SIZE_LABEL="Maximum Size" COM_MEDIA_FIELD_PATH_FILE_FOLDER_DESC="Enter the path to the file folder relative to root." COM_MEDIA_FIELD_PATH_FILE_FOLDER_LABEL="Path to File Folder" COM_MEDIA_FIELD_PATH_IMAGE_FOLDER_DESC="Enter the path to the image folder relative to root." COM_MEDIA_FIELD_PATH_IMAGE_FOLDER_LABEL="Path to Image Folder" COM_MEDIA_FIELD_RESTRICT_UPLOADS_DESC="Restrict uploads for lower than manager users to just images if Fileinfo or MIME Magic isn't installed." COM_MEDIA_FIELD_RESTRICT_UPLOADS_LABEL="Restrict Uploads" COM_MEDIA_FILES="Files" COM_MEDIA_FILESIZE="File size" COM_MEDIA_FOLDER="Folder" COM_MEDIA_FOLDERS="Folders" COM_MEDIA_IMAGE_DESCRIPTION="Image Description" COM_MEDIA_IMAGE_URL="Image URL" COM_MEDIA_INSERT="Insert" COM_MEDIA_INSERT_IMAGE="Insert Image" COM_MEDIA_MAXIMUM_SIZE="Maximum Size" COM_MEDIA_MEDIA="Media" COM_MEDIA_NAME="Image Name" COM_MEDIA_NO_IMAGES_FOUND="No Images Found" COM_MEDIA_NOT_SET="Not Set" COM_MEDIA_OVERALL_PROGRESS="Overall Progress" COM_MEDIA_PIXEL_DIMENSIONS="Pixel Dimensions (w x h)" COM_MEDIA_START_UPLOAD="Start Upload" COM_MEDIA_THUMBNAIL_VIEW="Thumbnail View" COM_MEDIA_TITLE="Image Title" COM_MEDIA_UP="Up" COM_MEDIA_UPLOAD="Upload" COM_MEDIA_UPLOAD_COMPLETE="Upload Complete" COM_MEDIA_UPLOAD_FILE="Upload file" COM_MEDIA_UPLOAD_FILES="Upload files (Maximum Size: %s MB)" COM_MEDIA_UPLOAD_FILES_NOLIMIT="Upload files (No maximum size)" COM_MEDIA_UPLOAD_SUCCESSFUL="Upload Successful" PK���\�u�+��*language/en-GB/en-GB.mod_languages.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_LANGUAGES="Language Switcher" MOD_LANGUAGES_XML_DESCRIPTION="This module displays a list of available Content Languages (as defined and published in Language Manager Content tab) for switching between them when you want to use Joomla! as a multilingual site. <br />--The plugin 'System - Language Filter' has to be enabled.--<br />When switching languages and if the item displayed in the page is not associated to another item, the module redirects to the Home page defined for the chosen language.<br />Otherwise, if the parameter is set for the Language filter plugin, it will redirect to the associated item in the language chosen. Thereafter, the navigation will be the one defined for that language. <br />If the plugin <strong>'System - Language Filter'</strong> is disabled, this may have unwanted results.<br /><strong>Method:</strong><br />1. Open Language Manager Content tab and make sure the Languages you want to use in contents are published and have a Language Code for the URL as well as prefix for the image used in the module display.<br />2. Create a Home page by assigning a language to a menu item and defining it as Default Home page for each published content language. <br />3. Thereafter, you can assign a language to any Article, Category, Module, News Feed, Web Links in Joomla.<br />4. Make sure the module is published and the plugin is enabled. <br />5. When using associated items, make sure the module is displayed on the pages concerned. <br />6. The way the flags or names of the languages are displayed is defined by the ordering in the Language Manager - Content Languages.<br ><br >If this module is published, it is suggested to publish the Administrator multilingual status module." MOD_LANGUAGES_LAYOUT_DEFAULT="Default" PK���\��i��!language/en-GB/en-GB.localise.phpnu�[���<?php /** * @package Joomla.Language * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * en-GB localise class. * * @since 1.6 */ abstract class En_GBLocalise { /** * Returns the potential suffixes for a specific number of items * * @param int $count The number of items. * * @return array An array of potential suffixes. * * @since 1.6 */ public static function getPluralSuffixes($count) { if ($count == 0) { $return = array('0'); } elseif ($count == 1) { $return = array('1'); } else { $return = array('MORE'); } return $return; } /** * Returns the ignored search words * * @return array An array of ignored search words. * * @since 1.6 */ public static function getIgnoredSearchWords() { $search_ignore = array(); $search_ignore[] = "and"; $search_ignore[] = "in"; $search_ignore[] = "on"; return $search_ignore; } /** * Returns the lower length limit of search words * * @return integer The lower length limit of search words. * * @since 1.6 */ public static function getLowerLimitSearchWord() { return 3; } /** * Returns the upper length limit of search words * * @return integer The upper length limit of search words. * * @since 1.6 */ public static function getUpperLimitSearchWord() { return 20; } /** * Returns the number of chars to display when searching * * @return integer The number of chars to display when searching. * * @since 1.6 */ public static function getSearchDisplayedCharactersNumber() { return 200; } } PK���\���W'language/en-GB/en-GB.mod_whosonline.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_WHOSONLINE="Who's Online" MOD_WHOSONLINE_FIELD_FILTER_GROUPS_DESC="Choose to filter by groups of the connected user" MOD_WHOSONLINE_FIELD_FILTER_GROUPS_LABEL="Filter groups" MOD_WHOSONLINE_FIELD_LINKTOWHAT_DESC="Choose the type of information to display" MOD_WHOSONLINE_FIELD_LINKTOWHAT_LABEL="Information" MOD_WHOSONLINE_FIELD_VALUE_BOTH="Both" MOD_WHOSONLINE_FIELD_VALUE_CONTACT="Contact" MOD_WHOSONLINE_FIELD_VALUE_NAMES="Usernames" MOD_WHOSONLINE_FIELD_VALUE_NUMBER="# of Guests / Users" MOD_WHOSONLINE_FIELD_VALUE_PROFILE="Profile" MOD_WHOSONLINE_GUESTS="%s guests" MOD_WHOSONLINE_GUESTS_1="one guest" MOD_WHOSONLINE_GUESTS_0="no guests" MOD_WHOSONLINE_MEMBERS="%s members" MOD_WHOSONLINE_MEMBERS_1="one member" MOD_WHOSONLINE_MEMBERS_0="no members" MOD_WHOSONLINE_SAME_GROUP_MESSAGE="List of Users who belong to your user groups or your user groups' child groups" MOD_WHOSONLINE_SHOWMODE_DESC="Select what will be shown" MOD_WHOSONLINE_SHOWMODE_LABEL="Display" MOD_WHOSONLINE_XML_DESCRIPTION="The Who's Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site." ; frontend display ; in the following string ; %1$s is for guests and %2$s for members MOD_WHOSONLINE_WE_HAVE="We have %1$s and %2$s online" PK���\~=�F'!'!.language/en-GB/en-GB.mod_articles_category.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_CATEGORY="Articles - Category" MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPING_DESC="Select how you would like the articles to be grouped." MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPING_LABEL="Article Grouping" MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPINGDIR_DESC="Select the direction you would like the Article Groupings to be ordered by." MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPINGDIR_LABEL="Grouping Direction" MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERING_DESC="Select which field you would like Articles to be ordered by. Featured Ordering should only be used when Filtering Option for Featured Articles is set to 'Only'." MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERING_LABEL="Article Field to Order By" MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERINGDIR_DESC="Select the direction you would like Articles to be ordered by." MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERINGDIR_LABEL="Ordering Direction" MOD_ARTICLES_CATEGORY_FIELD_AUTHOR_DESC="Select one or more authors from the list below." MOD_ARTICLES_CATEGORY_FIELD_AUTHOR_LABEL="Authors" MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIAS_DESC="Select one or more author aliases from the list below." MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIAS_LABEL="Author Aliases" MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIASFILTERING_DESC="Select Inclusive to Include the Selected Author Aliases, Exclusive to Exclude the Selected Author Aliases." MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIASFILTERING_LABEL="Author Alias Filtering Type" MOD_ARTICLES_CATEGORY_FIELD_AUTHORFILTERING_DESC="Select Inclusive to Include the Selected Authors, Exclusive to Exclude the Selected Authors." MOD_ARTICLES_CATEGORY_FIELD_AUTHORFILTERING_LABEL="Author Filtering Type" MOD_ARTICLES_CATEGORY_FIELD_CATDEPTH_DESC="The number of child category levels to return." MOD_ARTICLES_CATEGORY_FIELD_CATDEPTH_LABEL="Category Depth" MOD_ARTICLES_CATEGORY_FIELD_CATEGORY_DESC="Please select one or more categories." MOD_ARTICLES_CATEGORY_FIELD_CATFILTERINGTYPE_DESC="Select Inclusive to Include the Selected Categories, Exclusive to Exclude the Selected Categories." MOD_ARTICLES_CATEGORY_FIELD_CATFILTERINGTYPE_LABEL="Category Filtering Type" MOD_ARTICLES_CATEGORY_FIELD_COUNT_DESC="The number of items to display. The default value of 0 will display all articles." MOD_ARTICLES_CATEGORY_FIELD_COUNT_LABEL="Count" MOD_ARTICLES_CATEGORY_FIELD_DATERANGEFIELD_DESC="Select which date field you want the date range to be applied to." MOD_ARTICLES_CATEGORY_FIELD_DATERANGEFIELD_LABEL="Date Range Field" MOD_ARTICLES_CATEGORY_FIELD_DATEFIELD_DESC="Select which date field you want to display." MOD_ARTICLES_CATEGORY_FIELD_DATEFIELD_LABEL="Date Field" MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_DESC="Please enter in a valid date format. See: http://php.net/date for formatting information." MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_LABEL="Date Format" MOD_ARTICLES_CATEGORY_FIELD_DATEFILTERING_DESC="Select Date Filtering Type." MOD_ARTICLES_CATEGORY_FIELD_DATEFILTERING_LABEL="Date Filtering" MOD_ARTICLES_CATEGORY_FIELD_ENDDATE_DESC="If Date Range is selected above, please enter an End Date." MOD_ARTICLES_CATEGORY_FIELD_ENDDATE_LABEL="To Date" MOD_ARTICLES_CATEGORY_FIELD_EXCLUDEDARTICLES_DESC="Please enter each Article ID on a new line." MOD_ARTICLES_CATEGORY_FIELD_EXCLUDEDARTICLES_LABEL="Article IDs to Exclude" MOD_ARTICLES_CATEGORY_FIELD_GROUP_DISPLAY_LABEL="Display Options" MOD_ARTICLES_CATEGORY_FIELD_GROUP_DYNAMIC_LABEL="Dynamic Mode Options" MOD_ARTICLES_CATEGORY_FIELD_GROUP_FILTERING_LABEL="Filtering Options" MOD_ARTICLES_CATEGORY_FIELD_GROUP_GROUPING_LABEL="Grouping Options" MOD_ARTICLES_CATEGORY_FIELD_GROUP_ORDERING_LABEL="Ordering Options" MOD_ARTICLES_CATEGORY_FIELD_INTROTEXTLIMIT_DESC="Please enter in a numeric character limit value. The introtext will be trimmed to the number of characters you enter." MOD_ARTICLES_CATEGORY_FIELD_INTROTEXTLIMIT_LABEL="Introtext Limit" MOD_ARTICLES_CATEGORY_FIELD_LINKTITLES_LABEL="Linked Titles" MOD_ARTICLES_CATEGORY_FIELD_LINKTITLES_DESC="Linked titles." MOD_ARTICLES_CATEGORY_FIELD_MODE_DESC="Please select the mode you would like to use. If Normal Mode is chosen, then simply configure the module and it will display a static list of Articles on the menu items you assign the module to. If Dynamic Mode is chosen, then you can still configure the module normally, however now the Category option will no longer be used. Instead, the module will dynamically detect whether or not you are on a Category view and will display the list of articles within that Category accordingly. When Dynamic Mode is chosen, it is best to leave the module set to display on all pages, as it will decide whether or not to display anything dynamically." MOD_ARTICLES_CATEGORY_FIELD_MODE_LABEL="Mode" MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_DESC="Please enter in a valid date format. See: http://php.net/date for formatting information." MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_LABEL="Month and Year Display Format" MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_DESC="If Relative Date is selected above, please enter in a numeric day value. Results will be retrieved relative to the current date and the value you enter." MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_LABEL="Relative Date" MOD_ARTICLES_CATEGORY_FIELD_SHOWAUTHOR_DESC="Select Show if you would like the author (or author alias instead, if available) to be displayed." MOD_ARTICLES_CATEGORY_FIELD_SHOWCATEGORY_DESC="Select Show if you would like the category name displayed." MOD_ARTICLES_CATEGORY_FIELD_SHOWCHILDCATEGORYARTICLES_DESC="Include or Exclude Articles from Child Categories." MOD_ARTICLES_CATEGORY_FIELD_SHOWCHILDCATEGORYARTICLES_LABEL="Child Category Articles" MOD_ARTICLES_CATEGORY_FIELD_SHOWDATE_DESC="Select Show if you would like the date displayed." MOD_ARTICLES_CATEGORY_FIELD_SHOWFEATURED_DESC="Select to Show, Hide, or Only display Featured Articles." MOD_ARTICLES_CATEGORY_FIELD_SHOWFEATURED_LABEL="Featured Articles" MOD_ARTICLES_CATEGORY_FIELD_SHOWHITS_DESC="Select Show if you would like the hits for each article to be displayed." MOD_ARTICLES_CATEGORY_FIELD_SHOWHITS_LABEL="Hits" MOD_ARTICLES_CATEGORY_FIELD_SHOWINTROTEXT_DESC="Select Show if you would like the introtext to be displayed." MOD_ARTICLES_CATEGORY_FIELD_SHOWINTROTEXT_LABEL="Introtext" MOD_ARTICLES_CATEGORY_FIELD_SHOWONARTICLEPAGE_DESC="Select to Show or hide Article List from Article Pages. This means that the module will only display itself dynamically on Category Pages." MOD_ARTICLES_CATEGORY_FIELD_SHOWONARTICLEPAGE_LABEL="Show on Article Page" MOD_ARTICLES_CATEGORY_FIELD_STARTDATE_DESC="If Date Range is selected above, please enter a Starting Date." MOD_ARTICLES_CATEGORY_FIELD_STARTDATE_LABEL="Start Date Range" MOD_ARTICLES_CATEGORY_OPTION_ASCENDING_VALUE="Ascending" MOD_ARTICLES_CATEGORY_OPTION_CREATED_VALUE="Created Date" MOD_ARTICLES_CATEGORY_OPTION_DATERANGE_VALUE="Date Range" MOD_ARTICLES_CATEGORY_OPTION_DESCENDING_VALUE="Descending" MOD_ARTICLES_CATEGORY_OPTION_DYNAMIC_VALUE="Dynamic" MOD_ARTICLES_CATEGORY_OPTION_EXCLUDE_VALUE="Exclude" MOD_ARTICLES_CATEGORY_OPTION_EXCLUSIVE_VALUE="Exclusive" MOD_ARTICLES_CATEGORY_OPTION_HITS_VALUE="Hits" MOD_ARTICLES_CATEGORY_OPTION_ID_VALUE="ID" MOD_ARTICLES_CATEGORY_OPTION_INCLUDE_VALUE="Include" MOD_ARTICLES_CATEGORY_OPTION_INCLUSIVE_VALUE="Inclusive" MOD_ARTICLES_CATEGORY_OPTION_MODIFIED_VALUE="Modified Date" MOD_ARTICLES_CATEGORY_OPTION_MONTHYEAR_VALUE="Month and Year" MOD_ARTICLES_CATEGORY_OPTION_NORMAL_VALUE="Normal" MOD_ARTICLES_CATEGORY_OPTION_OFF_VALUE="Off" MOD_ARTICLES_CATEGORY_OPTION_ONLYFEATURED_VALUE="Only" MOD_ARTICLES_CATEGORY_OPTION_ORDERING_VALUE="Article Order" MOD_ARTICLES_CATEGORY_OPTION_ORDERINGFEATURED_VALUE="Featured Articles Order" MOD_ARTICLES_CATEGORY_OPTION_RELATIVEDAY_VALUE="Relative Date" MOD_ARTICLES_CATEGORY_OPTION_STARTPUBLISHING_VALUE="Start Publishing Date" MOD_ARTICLES_CATEGORY_OPTION_FINISHPUBLISHING_VALUE="Finish Publishing Date" MOD_ARTICLES_CATEGORY_OPTION_YEAR_VALUE="Year" MOD_ARTICLES_CATEGORY_READ_MORE="Read more: " MOD_ARTICLES_CATEGORY_READ_MORE_TITLE="Read More ..." MOD_ARTICLES_CATEGORY_REGISTER_TO_READ_MORE="Register to read more" MOD_ARTICLES_CATEGORY_XML_DESCRIPTION="This module displays a list of articles from one or more categories."PK���\`к��*language/en-GB/en-GB.mod_syndicate.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_SYNDICATE="Syndication Feeds" MOD_SYNDICATE_XML_DESCRIPTION="Smart Syndication Module that creates a Syndicated Feed for the page where the Module is displayed." MOD_SYNDICATE_LAYOUT_DEFAULT="Default" PK���\)�s����#language/en-GB/en-GB.lib_joomla.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 ; Common boolean values ; Note: YES, NO, TRUE, FALSE are reserved words in INI format. ; Double quotes in the values have to be formatted as "_QQ_". ; Keep this string on top JERROR_PARSING_LANGUAGE_FILE=" : error(s) in line(s) %s" JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN="Access forbidden." JLIB_APPLICATION_ERROR_APPLICATION_GET_NAME="JApplication: :getName() : Can't get or parse class name." JLIB_APPLICATION_ERROR_APPLICATION_LOAD="Unable to load application: %s" JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE="You are not allowed to create new items in this category." JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT="You are not allowed to edit one or more of these items." JLIB_APPLICATION_ERROR_BATCH_FAILED="Batch process failed with following error: %s" JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND="Can't find the destination category for this move." JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND="Can't find the item being moved." JLIB_APPLICATION_ERROR_CHECKIN_FAILED="Check-in failed with the following error: %s" JLIB_APPLICATION_ERROR_CHECKIN_NOT_CHECKED="Item is not checked out." JLIB_APPLICATION_ERROR_CHECKIN_USER_MISMATCH="The user checking in does not match the user who checked out the item." JLIB_APPLICATION_ERROR_CHECKOUT_FAILED="Check-out failed with the following error: %s" JLIB_APPLICATION_ERROR_CHECKOUT_USER_MISMATCH="The user checking out does not match the user who checked out the item." JLIB_APPLICATION_ERROR_COMPONENT_NOT_FOUND="Component not found." JLIB_APPLICATION_ERROR_COMPONENT_NOT_LOADING="Error loading component: %1$s, %2$s" JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME="JController: :getName() : Can't get or parse class name." JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED="Create record not permitted." JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED="Delete not permitted." JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED="Edit state is not permitted." JLIB_APPLICATION_ERROR_EDIT_ITEM_NOT_PERMITTED="Edit is not permitted." JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED="Edit not permitted." JLIB_APPLICATION_ERROR_HISTORY_ID_MISMATCH="Error restoring item version from history." JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION="Insufficient information to perform the batch operation." JLIB_APPLICATION_ERROR_INVALID_CONTROLLER_CLASS="Invalid controller class: %s" JLIB_APPLICATION_ERROR_INVALID_CONTROLLER="Invalid controller: name='%s', format='%s'" JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND="Layout %s not found." JLIB_APPLICATION_ERROR_LIBRARY_NOT_FOUND="Library not found." JLIB_APPLICATION_ERROR_LIBRARY_NOT_LOADING="Error loading library: %1$s, %2$s" JLIB_APPLICATION_ERROR_MODEL_GET_NAME="JModel: :getName() : Can't get or parse class name." JLIB_APPLICATION_ERROR_MODULE_LOAD="Error loading module %s" JLIB_APPLICATION_ERROR_PATHWAY_LOAD="Unable to load pathway: %s" JLIB_APPLICATION_ERROR_REORDER_FAILED="Reorder failed. Error: %s" JLIB_APPLICATION_ERROR_ROUTER_LOAD="Unable to load router: %s" JLIB_APPLICATION_ERROR_MODELCLASS_NOT_FOUND="Model class %s not found in file." JLIB_APPLICATION_ERROR_SAVE_FAILED="Save failed with the following error: %s" JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED="Save not permitted." JLIB_APPLICATION_ERROR_TABLE_NAME_NOT_SUPPORTED="Table %s not supported. File not found." JLIB_APPLICATION_ERROR_TASK_NOT_FOUND="Task [%s] not found." JLIB_APPLICATION_ERROR_UNHELD_ID="You are not permitted to use that link to directly access that page (#%d)." JLIB_APPLICATION_ERROR_VIEW_CLASS_NOT_FOUND="View class not found [class, file]: %1$s, %2$s" JLIB_APPLICATION_ERROR_VIEW_GET_NAME_SUBSTRING="JView: :getName() : Your classname contains the substring 'view'. This causes problems when extracting the classname from the name of your objects view. Avoid Object names with the substring 'view'." JLIB_APPLICATION_ERROR_VIEW_GET_NAME="JView: :getName() : Can't get or parse class name." JLIB_APPLICATION_ERROR_VIEW_NOT_FOUND="View not found [name, type, prefix]: %1$s, %2$s, %3$s" JLIB_APPLICATION_SAVE_SUCCESS="Item successfully saved." JLIB_APPLICATION_SUBMIT_SAVE_SUCCESS="Item successfully submitted." JLIB_APPLICATION_SUCCESS_BATCH="Batch process completed successfully." JLIB_APPLICATION_SUCCESS_ITEM_REORDERED="Ordering successfully saved." JLIB_APPLICATION_SUCCESS_ORDERING_SAVED="Ordering successfully saved." JLIB_APPLICATION_SUCCESS_LOAD_HISTORY="Prior version successfully restored. Saved on %s %s." JLIB_LOGIN_AUTHENTICATE="Username and password do not match or you do not have an account yet." JLIB_CACHE_ERROR_CACHE_HANDLER_LOAD="Unable to load Cache Handler: %s" JLIB_CACHE_ERROR_CACHE_STORAGE_LOAD="Unable to load Cache Storage: %s" JLIB_CAPTCHA_ERROR_PLUGIN_NOT_FOUND="Captcha plugin not set or not found. Please contact a site administrator." JLIB_CLIENT_ERROR_JFTP_NO_CONNECT="JFTP: :connect: Could not connect to host ' %1$s ' on port ' %2$s '" JLIB_CLIENT_ERROR_JFTP_NO_CONNECT_SOCKET="JFTP: :connect: Could not connect to host ' %1$s ' on port ' %2$s '. Socket error number: %3$s and error message: %4$s" JLIB_CLIENT_ERROR_JFTP_BAD_RESPONSE="JFTP: :connect: Bad response. Server response: %s [Expected: 220]" JLIB_CLIENT_ERROR_JFTP_BAD_USERNAME="JFTP: :login: Bad Username. Server response: %1$s [Expected: 331]. Username sent: %2$s" JLIB_CLIENT_ERROR_JFTP_BAD_PASSWORD="JFTP: :login: Bad Password. Server response: %1$s [Expected: 230]. Password sent: %2$s" JLIB_CLIENT_ERROR_JFTP_PWD_BAD_RESPONSE_NATIVE="FTP: :pwd: Bad response." JLIB_CLIENT_ERROR_JFTP_PWD_BAD_RESPONSE="JFTP: :pwd: Bad response. Server response: %s [Expected: 257]" JLIB_CLIENT_ERROR_JFTP_SYST_BAD_RESPONSE_NATIVE="JFTP: :syst: Bad response." JLIB_CLIENT_ERROR_JFTP_SYST_BAD_RESPONSE="JFTP: :syst: Bad response. Server response: %s [Expected: 215]" JLIB_CLIENT_ERROR_JFTP_CHDIR_BAD_RESPONSE_NATIVE="JFTP: :chdir: Bad response." JLIB_CLIENT_ERROR_JFTP_CHDIR_BAD_RESPONSE="JFTP: :chdir: Bad response. Server response: %1$s [Expected: 250]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_REINIT_BAD_RESPONSE_NATIVE="JFTP: :reinit: Bad response." JLIB_CLIENT_ERROR_JFTP_REINIT_BAD_RESPONSE="JFTP: :reinit: Bad response. Server response: %s [Expected: 220]" JLIB_CLIENT_ERROR_JFTP_RENAME_BAD_RESPONSE_NATIVE="JFTP: :rename: Bad response." JLIB_CLIENT_ERROR_JFTP_RENAME_BAD_RESPONSE_FROM="JFTP: :rename: Bad response. Server response: %1$s [Expected: 350]. From path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_RENAME_BAD_RESPONSE_TO="JFTP: :rename: Bad response. Server response: %1$s [Expected: 250]. To path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_CHMOD_BAD_RESPONSE_NATIVE="JFTP: :chmod: Bad response." JLIB_CLIENT_ERROR_JFTP_CHMOD_BAD_RESPONSE="JFTP: :chmod: Bad response. Server response: %1$s [Expected: 250]. Path sent: %2$s. Mode sent: %3$s" JLIB_CLIENT_ERROR_JFTP_DELETE_BAD_RESPONSE_NATIVE="JFTP: :delete: Bad response." JLIB_CLIENT_ERROR_JFTP_DELETE_BAD_RESPONSE="JFTP: :delete: Bad response. Server response: %1$s [Expected: 250]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE_NATIVE="JFTP: :mkdir: Bad response." JLIB_CLIENT_ERROR_JFTP_MKDIR_BAD_RESPONSE="JFTP: :mkdir: Bad response. Server response: %1$s [Expected: 257]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_RESTART_BAD_RESPONSE_NATIVE="JFTP: :restart: Bad response." JLIB_CLIENT_ERROR_JFTP_RESTART_BAD_RESPONSE="JFTP: :restart: Bad response. Server response: %1$s [Expected: 350]. Restart point sent: %2$s" JLIB_CLIENT_ERROR_JFTP_CREATE_BAD_RESPONSE_BUFFER="JFTP: :create: Bad response." JLIB_CLIENT_ERROR_JFTP_CREATE_BAD_RESPONSE_PASSIVE="JFTP: :create: Unable to use passive mode." JLIB_CLIENT_ERROR_JFTP_CREATE_BAD_RESPONSE="JFTP: :create: Bad response. Server response: %1$s [Expected: 150 or 125]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_CREATE_BAD_RESPONSE_TRANSFER="JFTP: :create: Transfer Failed. Server response: %1$s [Expected: 226]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_READ_BAD_RESPONSE_BUFFER="JFTP: :read: Bad response." JLIB_CLIENT_ERROR_JFTP_READ_BAD_RESPONSE_PASSIVE="JFTP: :read: Unable to use passive mode." JLIB_CLIENT_ERROR_JFTP_READ_BAD_RESPONSE="JFTP: :read: Bad response. Server response: %1$s [Expected: 150 or 125]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_READ_BAD_RESPONSE_TRANSFER="JFTP: :read: Transfer Failed. Server response: %1$s [Expected: 226]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_GET_BAD_RESPONSE="JFTP: :get: Bad response." JLIB_CLIENT_ERROR_JFTP_GET_PASSIVE="JFTP: :get: Unable to use passive mode." JLIB_CLIENT_ERROR_JFTP_GET_WRITING_LOCAL="JFTP: :get: Unable to open local file for writing. Local path: %s" JLIB_CLIENT_ERROR_JFTP_GET_BAD_RESPONSE_RETR="JFTP: :get: Bad response. Server response: %1$s [Expected: 150 or 125]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_GET_BAD_RESPONSE_TRANSFER="JFTP: :get: Transfer Failed. Server response: %1$s [Expected: 226]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_STORE_PASSIVE="JFTP: :store: Unable to use passive mode." JLIB_CLIENT_ERROR_JFTP_STORE_BAD_RESPONSE="JFTP: :store: Bad response." JLIB_CLIENT_ERROR_JFTP_STORE_READING_LOCAL="JFTP: :store: Unable to open local file for reading. Local path: %s" JLIB_CLIENT_ERROR_JFTP_STORE_FIND_LOCAL="JFTP: :store: Unable to find local file. Local path: %s" JLIB_CLIENT_ERROR_JFTP_STORE_BAD_RESPONSE_STOR="JFTP: :store: Bad response. Server response: %1$s [Expected: 150 or 125]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_STORE_DATA_PORT="JFTP: :store: Unable to write to data port socket." JLIB_CLIENT_ERROR_JFTP_STORE_BAD_RESPONSE_TRANSFER="JFTP: :store: Transfer Failed. Server response: %1$s [Expected: 226]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_WRITE_PASSIVE="JFTP: :write: Unable to use passive mode." JLIB_CLIENT_ERROR_JFTP_WRITE_BAD_RESPONSE="JFTP: :write: Bad response." JLIB_CLIENT_ERROR_JFTP_WRITE_BAD_RESPONSE_STOR="JFTP: :write: Bad response. Server response: %1$s [Expected: 150 or 125]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_WRITE_DATA_PORT="JFTP: :write: Unable to write to data port socket." JLIB_CLIENT_ERROR_JFTP_WRITE_BAD_RESPONSE_TRANSFER="JFTP: :write: Transfer Failed. Server response: %1$s [Expected: 226]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_LISTNAMES_PASSIVE="JFTP: :listNames: Unable to use passive mode." JLIB_CLIENT_ERROR_JFTP_LISTNAMES_BAD_RESPONSE="JFTP: :listNames: Bad response." JLIB_CLIENT_ERROR_JFTP_LISTNAMES_BAD_RESPONSE_NLST="JFTP: :listNames: Bad response. Server response: %1$s [Expected: 150 or 125]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_LISTNAMES_BAD_RESPONSE_TRANSFER="JFTP: :listNames: Transfer Failed. Server response: %1$s [Expected: 226]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_BAD_RESPONSE="JFTP: :listDetails: Bad response." JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_PASSIVE="JFTP: :listDetails: Unable to use passive mode." JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_BAD_RESPONSE_LIST="JFTP: :listDetails: Bad response. Server response: %1$s [Expected: 150 or 125]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_BAD_RESPONSE_TRANSFER="JFTP: :listDetails: Transfer Failed. Server response: %1$s [Expected: 226]. Path sent: %2$s" JLIB_CLIENT_ERROR_JFTP_LISTDETAILS_UNRECOGNISED="JFTP: :listDetails: Unrecognised folder listing format." JLIB_CLIENT_ERROR_JFTP_PUTCMD_UNCONNECTED="JFTP: :_putCmd: Not connected to the control port." JLIB_CLIENT_ERROR_JFTP_PUTCMD_SEND="JFTP: :_putCmd: Unable to send command: %s" JLIB_CLIENT_ERROR_JFTP_VERIFYRESPONSE="JFTP: :_verifyResponse: Timeout or unrecognised response while waiting for a response from the server. Server response: %s" JLIB_CLIENT_ERROR_JFTP_PASSIVE_CONNECT_PORT="JFTP: :_passive: Not connected to the control port." JLIB_CLIENT_ERROR_JFTP_PASSIVE_RESPONSE="JFTP: :_passive: Timeout or unrecognised response while waiting for a response from the server. Server response: %s" JLIB_CLIENT_ERROR_JFTP_PASSIVE_IP_OBTAIN="JFTP: :_passive: Unable to obtain IP and port for data transfer. Server response: %s" JLIB_CLIENT_ERROR_JFTP_PASSIVE_IP_VALID="JFTP: :_passive: IP and port for data transfer not valid. Server response: %s" JLIB_CLIENT_ERROR_JFTP_PASSIVE_CONNECT="JFTP: :_passive: Could not connect to host %1$s on port %2$s. Socket error number: %3$s and error message: %4$s" JLIB_CLIENT_ERROR_JFTP_MODE_BINARY="JFTP: :_mode: Bad response. Server response: %s [Expected: 200]. Mode sent: Binary." JLIB_CLIENT_ERROR_JFTP_MODE_ASCII="JFTP: :_mode: Bad response. Server response: %s [Expected: 200]. Mode sent: Ascii." JLIB_CLIENT_ERROR_HELPER_SETCREDENTIALSFROMREQUEST_FAILED="Looks like User's credentials are no good." JLIB_CLIENT_ERROR_LDAP_ADDRESS_NOT_AVAILABLE="Address not available." JLIB_DATABASE_ERROR_ADAPTER_MYSQL="The MySQL adapter 'mysql' is not available." JLIB_DATABASE_ERROR_ADAPTER_MYSQLI="The MySQL adapter 'mysqli' is not available." JLIB_DATABASE_ERROR_BIND_FAILED_INVALID_SOURCE_ARGUMENT="%s: :bind failed. Invalid source argument." JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS="Another article from this category has the same alias (remember it may be a trashed item)." JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS="Another category with the same parent category has the same alias (remember it may be a trashed item)." JLIB_DATABASE_ERROR_CHECK_FAILED="%s: :check Failed - %s" JLIB_DATABASE_ERROR_CHECKIN_FAILED="%s: :check-in failed - %s" JLIB_DATABASE_ERROR_CHECKOUT_FAILED="%s: :check-out failed - %s" JLIB_DATABASE_ERROR_CHILD_ROWS_CHECKED_OUT="Child rows checked out." JLIB_DATABASE_ERROR_CLASS_DOES_NOT_SUPPORT_ORDERING="%s does not support ordering." JLIB_DATABASE_ERROR_CLASS_IS_MISSING_FIELD="Missing field in the database: %s   %s." JLIB_DATABASE_ERROR_CLASS_NOT_FOUND_IN_FILE="Table class %s not found in file." JLIB_DATABASE_ERROR_CONNECT_DATABASE="Unable to connect to the Database: %s" JLIB_DATABASE_ERROR_CONNECT_MYSQL="Could not connect to MySQL." JLIB_DATABASE_ERROR_DATABASE_CONNECT="Could not connect to database." JLIB_DATABASE_ERROR_DELETE_CATEGORY="Left-Right data inconsistency. Can't delete category." JLIB_DATABASE_ERROR_DELETE_FAILED="%s: :delete failed - %s" JLIB_DATABASE_ERROR_DELETE_ROOT_CATEGORIES="Root categories can't be deleted." JLIB_DATABASE_ERROR_EMAIL_INUSE="This email address is already registered." JLIB_DATABASE_ERROR_EMPTY_ROW_RETURNED="The database row is empty." JLIB_DATABASE_ERROR_FUNCTION_FAILED="DB function failed with error number %s <br /><span style="_QQ_"color: red;"_QQ_">%s</span>" JLIB_DATABASE_ERROR_GET_NEXT_ORDER_FAILED="%s: :getNextOrder failed - %s" JLIB_DATABASE_ERROR_GET_TREE_FAILED="%s: :getTree Failed - %s" JLIB_DATABASE_ERROR_GETNODE_FAILED="%s: :_getNode Failed - %s" JLIB_DATABASE_ERROR_GETROOTID_FAILED="%s: :getRootId Failed - %s" JLIB_DATABASE_ERROR_HIT_FAILED="%s: :hit failed - %s" JLIB_DATABASE_ERROR_INVALID_LOCATION="%s: :setLocation - Invalid location." JLIB_DATABASE_ERROR_INVALID_NODE_RECURSION="%s: :move Failed - Can't move the node to be a child of itself." JLIB_DATABASE_ERROR_INVALID_PARENT_ID="Invalid parent ID." JLIB_DATABASE_ERROR_LANGUAGE_NO_TITLE="The language should have a title." JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_IMAGE="A content language already exists with this Image Prefix." JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_LANG_CODE="A content language already exists with this Language Tag." JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_SEF="A content language already exists with this URL Language Code." JLIB_DATABASE_ERROR_LOAD_DATABASE_DRIVER="Unable to load Database Driver: %s" JLIB_DATABASE_ERROR_MENUTYPE="Some menu items or some menu modules related to this menutype are checked out by another user or the default menu item is in this menu." JLIB_DATABASE_ERROR_MENUTYPE_CHECKOUT="The user checking out does not match the user who checked out this menu and/or its linked menu module." JLIB_DATABASE_ERROR_MENUTYPE_EMPTY="Menu type empty." JLIB_DATABASE_ERROR_MENUTYPE_EXISTS="Menu type exists: %s" JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT="The Language parameter for this menu item must be set to 'All'. At least one Default menu item must have Language set to All, even if the site is multilingual." JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT_DEFAULT="At least one menu item has to be set as Default." JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME="Can't unpublish default home." JLIB_DATABASE_ERROR_MENU_DEFAULT_CHECKIN_USER_MISMATCH="The current home menu for this language is checked out." JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS="Another menu item with the same parent has this alias (remember it may be a trashed item)." JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS_ROOT="Another menu item has the same alias in Root (remember it may be a trashed item). Root is the top level parent." JLIB_DATABASE_ERROR_MENU_HOME_NOT_COMPONENT="The home menu item must be a component." JLIB_DATABASE_ERROR_MENU_HOME_NOT_UNIQUE_IN_MENU="A menu should contain only one Default home." JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_COMPONENT="A first level menu item alias can't be 'component'." JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_FOLDER="A first level menu item alias can't be '%s' because '%s' is a sub-folder of your joomla installation folder." JLIB_DATABASE_ERROR_MOVE_FAILED="%s: :move failed - %s" JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_CATEGORY="Category must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_EXTENSION="Extension must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MENUITEM="Menu Item must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MODULE="Module must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_UPDATESITE="Update site must have a title." JLIB_DATABASE_ERROR_NEGATIVE_NOT_PERMITTED="%s can't be negative." JLIB_DATABASE_ERROR_NO_ROWS_SELECTED="No rows selected." JLIB_DATABASE_ERROR_NOT_SUPPORTED_FILE_NOT_FOUND="Table %s not supported. File not found." JLIB_DATABASE_ERROR_NULL_PRIMARY_KEY="Null primary key not allowed." JLIB_DATABASE_ERROR_ORDERDOWN_FAILED="%s: :orderDown Failed - %s" JLIB_DATABASE_ERROR_ORDERUP_FAILED="%s: :orderUp Failed - %s" JLIB_DATABASE_ERROR_PLEASE_ENTER_A_USER_NAME="Please enter a username." JLIB_DATABASE_ERROR_PLEASE_ENTER_YOUR_NAME="Please enter your name." JLIB_DATABASE_ERROR_PUBLISH_FAILED="%s: :publish failed - %s" JLIB_DATABASE_ERROR_REBUILD_FAILED="%s: :rebuild Failed - %s" JLIB_DATABASE_ERROR_REBUILDPATH_FAILED="%s: :rebuildPath Failed - %s" JLIB_DATABASE_ERROR_REORDER_FAILED="%s: :reorder failed - %s" JLIB_DATABASE_ERROR_REORDER_UPDATE_ROW_FAILED="%s: :reorder update the row %s failed - %s" JLIB_DATABASE_ERROR_ROOT_NODE_NOT_FOUND="Root node not found." JLIB_DATABASE_ERROR_STORE_FAILED_UPDATE_ASSET_ID="The asset_id field could not be updated." JLIB_DATABASE_ERROR_STORE_FAILED="%1$s: :store failed<br />%2$s" JLIB_DATABASE_ERROR_USERGROUP_TITLE="User group must have a title." JLIB_DATABASE_ERROR_USERGROUP_TITLE_EXISTS="User group title already exists. Title must be unique with the same parent." JLIB_DATABASE_ERROR_USERLEVEL_NAME_EXISTS="Level with the name "%s" already exists." JLIB_DATABASE_ERROR_USERNAME_CANNOT_CHANGE="Can't use this username." JLIB_DATABASE_ERROR_USERNAME_INUSE="Username in use." JLIB_DATABASE_ERROR_VALID_AZ09="Please enter a valid username. No space at beginning or end, at least %d characters and must <strong>not</strong> contain the following characters: < > \ " ' % ; ( ) &." JLIB_DATABASE_ERROR_VALID_MAIL="Please enter a valid email address." JLIB_DATABASE_ERROR_VIEWLEVEL="Viewlevel must have a title." JLIB_DATABASE_FUNCTION_NOERROR="DB function reports no errors." JLIB_DATABASE_QUERY_FAILED="Database query failed (error # %s): %s" JLIB_DOCUMENT_ERROR_UNABLE_LOAD_DOC_CLASS="Unable to load document class." JLIB_ENVIRONMENT_SESSION_EXPIRED="Your session has expired. Please log in again." JLIB_ERROR_INFINITE_LOOP="Infinite loop detected in JError." JLIB_EVENT_ERROR_DISPATCHER="JEventDispatcher: :register: Event handler not recognised. Handler: %s" JLIB_FILESYSTEM_BZIP_NOT_SUPPORTED="BZip2 Not Supported." JLIB_FILESYSTEM_BZIP_UNABLE_TO_READ="Unable to read archive (bz2)." JLIB_FILESYSTEM_BZIP_UNABLE_TO_WRITE="Unable to write archive (bz2)." JLIB_FILESYSTEM_BZIP_UNABLE_TO_WRITE_FILE="Unable to write file (bz2)." JLIB_FILESYSTEM_GZIP_NOT_SUPPORTED="GZlib Not Supported." JLIB_FILESYSTEM_GZIP_UNABLE_TO_READ="Unable to read archive (gz)." JLIB_FILESYSTEM_GZIP_UNABLE_TO_WRITE="Unable to write archive (gz)." JLIB_FILESYSTEM_GZIP_UNABLE_TO_WRITE_FILE="Unable to write file (gz)." JLIB_FILESYSTEM_GZIP_UNABLE_TO_DECOMPRESS="Unable to decompress data." JLIB_FILESYSTEM_TAR_UNABLE_TO_READ="Unable to read archive (tar)." JLIB_FILESYSTEM_TAR_UNABLE_TO_DECOMPRESS="Unable to decompress data." JLIB_FILESYSTEM_TAR_UNABLE_TO_CREATE_DESTINATION="Unable to create destination." JLIB_FILESYSTEM_TAR_UNABLE_TO_WRITE_ENTRY="Unable to write entry." JLIB_FILESYSTEM_ZIP_NOT_SUPPORTED="Zlib Not Supported." JLIB_FILESYSTEM_ZIP_UNABLE_TO_READ="Unable to read archive (zip)." JLIB_FILESYSTEM_ZIP_INFO_FAILED="Get ZIP Information failed." JLIB_FILESYSTEM_ZIP_UNABLE_TO_CREATE_DESTINATION="Unable to create destination." JLIB_FILESYSTEM_ZIP_UNABLE_TO_WRITE_ENTRY="Unable to write entry." JLIB_FILESYSTEM_ZIP_UNABLE_TO_READ_ENTRY="Unable to read entry." JLIB_FILESYSTEM_ZIP_UNABLE_TO_OPEN_ARCHIVE="Unable to open archive." JLIB_FILESYSTEM_ZIP_INVALID_ZIP_DATA="Invalid ZIP data." JLIB_FILESYSTEM_STREAM_FAILED="Failed to register string stream." JLIB_FILESYSTEM_UNKNOWNARCHIVETYPE="Unknown Archive type." JLIB_FILESYSTEM_UNABLE_TO_LOAD_ARCHIVE="Unable to load archive." JLIB_FILESYSTEM_ERROR_JFILE_FIND_COPY="JFile: :copy: Can't find or read file: $%s" JLIB_FILESYSTEM_ERROR_JFILE_STREAMS="JFile: :copy(%1$s, %2$s): %3$s" JLIB_FILESYSTEM_ERROR_COPY_FAILED="Copy failed." JLIB_FILESYSTEM_DELETE_FAILED="Failed deleting %s" JLIB_FILESYSTEM_CANNOT_FIND_SOURCE_FILE="Can't find source file." JLIB_FILESYSTEM_ERROR_JFILE_MOVE_STREAMS="JFile: :move: %s" JLIB_FILESYSTEM_ERROR_RENAME_FILE="Rename failed." JLIB_FILESYSTEM_ERROR_READ_UNABLE_TO_OPEN_FILE="JFile: :read: Unable to open file: %s" JLIB_FILESYSTEM_ERROR_WRITE_STREAMS="JFile: :write(%1$s): %2$s" JLIB_FILESYSTEM_ERROR_UPLOAD="JFile: :upload: %s" JLIB_FILESYSTEM_ERROR_WARNFS_ERR01="Warning: Failed to change file permissions!" JLIB_FILESYSTEM_ERROR_WARNFS_ERR02="Warning: Failed to move file!" JLIB_FILESYSTEM_ERROR_WARNFS_ERR03="Warning: File %s not uploaded for security reasons!" JLIB_FILESYSTEM_ERROR_FIND_SOURCE_FOLDER="Can't find source folder." JLIB_FILESYSTEM_ERROR_FOLDER_EXISTS="Folder already exists." JLIB_FILESYSTEM_ERROR_FOLDER_CREATE="Unable to create target folder." JLIB_FILESYSTEM_ERROR_FOLDER_OPEN="Unable to open source folder." JLIB_FILESYSTEM_ERROR_FOLDER_LOOP="Infinite loop detected." JLIB_FILESYSTEM_ERROR_FOLDER_PATH="Path not in open_basedir paths." JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY="Could not create folder." JLIB_FILESYSTEM_ERROR_DELETE_BASE_DIRECTORY="You can't delete a base folder." JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER="JFolder: :delete: Path is not a folder. Path: %s" JLIB_FILESYSTEM_ERROR_FOLDER_DELETE="JFolder: :delete: Could not delete folder. Path: %s" JLIB_FILESYSTEM_ERROR_FOLDER_RENAME="Rename failed: %s" JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FILES="JFolder: :files: Path is not a folder. Path: %s" JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FOLDER="JFolder: :folder: Path is not a folder. Path: %s" JLIB_FILESYSTEM_ERROR_STREAMS_FILE_SIZE="Failed to get file size. This may not work for all streams!" JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN="File not open." JLIB_FILESYSTEM_ERROR_STREAMS_FILENAME="File name not set." JLIB_FILESYSTEM_ERROR_NO_DATA_WRITTEN="Warning: No data written." JLIB_FILESYSTEM_ERROR_STREAMS_FAILED_TO_OPEN_WRITER="Failed to open writer: %s" JLIB_FILESYSTEM_ERROR_STREAMS_FAILED_TO_OPEN_READER="Failed to open reader: %s" JLIB_FILESYSTEM_ERROR_STREAMS_NOT_UPLOADED_FILE="Not an uploaded file!" JLIB_FORM_BUTTON_CLEAR="Clear" JLIB_FORM_BUTTON_SELECT="Select" JLIB_FORM_CHANGE_IMAGE="Change Image" JLIB_FORM_CHANGE_IMAGE_BUTTON="Change Image Button" JLIB_FORM_CHANGE_USER="Select User" JLIB_FORM_ERROR_FIELDS_CATEGORY_ERROR_EXTENSION_EMPTY="Extension attribute is empty in the category field." JLIB_FORM_ERROR_FIELDS_GROUPEDLIST_ELEMENT_NAME="Unknown element type: %s" JLIB_FORM_ERROR_NO_DATA="No data." JLIB_FORM_ERROR_VALIDATE_FIELD="Invalid xml field." JLIB_FORM_ERROR_XML_FILE_DID_NOT_LOAD="XML file did not load." JLIB_FORM_FIELD_INVALID="Invalid field: " JLIB_FORM_INPUTMODE="latin" JLIB_FORM_INVALID_FORM_OBJECT="Invalid Form Object: :%s" JLIB_FORM_INVALID_FORM_RULE="Invalid Form Rule: :%s" JLIB_FORM_MEDIA_PREVIEW_ALT="Selected image." JLIB_FORM_MEDIA_PREVIEW_EMPTY="No image selected." JLIB_FORM_MEDIA_PREVIEW_SELECTED_IMAGE="Selected image." JLIB_FORM_MEDIA_PREVIEW_TIP_TITLE="Preview" JLIB_FORM_SELECT_USER="Select a User." JLIB_FORM_VALIDATE_FIELD_INVALID="Invalid field: %s" JLIB_FORM_VALIDATE_FIELD_REQUIRED="Field required: %s" JLIB_FORM_VALIDATE_FIELD_RULE_MISSING="Validation Rule missing: %s" JLIB_FORM_VALUE_CACHE_APC="Alternative PHP Cache" JLIB_FORM_VALUE_CACHE_CACHELITE="Cache_Lite" JLIB_FORM_VALUE_CACHE_EACCELERATOR="eAccelerator" JLIB_FORM_VALUE_CACHE_FILE="File" JLIB_FORM_VALUE_CACHE_MEMCACHE="Memcache" JLIB_FORM_VALUE_CACHE_MEMCACHED="Memcached (Experimental)" JLIB_FORM_VALUE_CACHE_REDIS="Redis" JLIB_FORM_VALUE_CACHE_WINCACHE="Windows Cache" JLIB_FORM_VALUE_CACHE_XCACHE="XCache" JLIB_FORM_VALUE_SESSION_APC="Alternative PHP Cache" JLIB_FORM_VALUE_SESSION_DATABASE="Database" JLIB_FORM_VALUE_SESSION_EACCELERATOR="eAccelerator" JLIB_FORM_VALUE_SESSION_MEMCACHE="Memcache" JLIB_FORM_VALUE_SESSION_MEMCACHED="Memcached (Experimental)" JLIB_FORM_VALUE_SESSION_NONE="None" JLIB_FORM_VALUE_SESSION_WINCACHE="Windows Cache" JLIB_FORM_VALUE_SESSION_XCACHE="XCache" JLIB_FORM_VALUE_TIMEZONE_UTC="Universal Time, Coordinated (UTC)" JLIB_FORM_VALUE_FROM_TEMPLATE="From Template" JLIB_FORM_VALUE_INHERITED="Inherited" JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_ACL="ACL" JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_TABLE="Table" JLIB_HTML_ACCESS_SUMMARY_DESC_CAPTION="ACL Summary Table" JLIB_HTML_ACCESS_SUMMARY_DESC="Shown below is an overview of the permission settings for this article. Select the tabs above to customise these settings by action." JLIB_HTML_ACCESS_SUMMARY="Summary." JLIB_HTML_ADD_TO_ROOT="Add to root." JLIB_HTML_ADD_TO_THIS_MENU="Add to this menu." JLIB_HTML_BATCH_ACCESS_LABEL="Set Access Level" JLIB_HTML_BATCH_ACCESS_LABEL_DESC="Not making a selection will keep the original access levels when processing." JLIB_HTML_BATCH_COPY="Copy" JLIB_HTML_BATCH_LANGUAGE_LABEL="Set Language" JLIB_HTML_BATCH_LANGUAGE_LABEL_DESC="Not making a selection will keep the original language when processing." JLIB_HTML_BATCH_LANGUAGE_NOCHANGE="- Keep original Language -" JLIB_HTML_BATCH_MENU_LABEL="To Move or Copy your selection please select a Category." JLIB_HTML_BATCH_MOVE="Move" JLIB_HTML_BATCH_MOVE_QUESTION="Do you want to move the items or make a copy of them?" JLIB_HTML_BATCH_NO_CATEGORY="- Don't move or copy -" JLIB_HTML_BATCH_NOCHANGE="- Keep original Access Levels -" JLIB_HTML_BATCH_TAG_LABEL="Add Tag" JLIB_HTML_BATCH_TAG_LABEL_DESC="Add a tag to selected items." JLIB_HTML_BATCH_TAG_NOCHANGE="- Keep original Tags -" JLIB_HTML_BATCH_USER_LABEL="Set User." JLIB_HTML_BATCH_USER_LABEL_DESC="Not making a selection will keep the original user when processing." JLIB_HTML_BATCH_USER_NOCHANGE="- Keep original User -" JLIB_HTML_BATCH_USER_NOUSER="No User." JLIB_HTML_BEHAVIOR_ABOUT_THE_CALENDAR="About the Calendar" JLIB_HTML_BEHAVIOR_CLOSE="Close" JLIB_HTML_BEHAVIOR_DATE_SELECTION="Date selection:\n" JLIB_HTML_BEHAVIOR_DISPLAY_S_FIRST="Display %s first" JLIB_HTML_BEHAVIOR_DRAG_TO_MOVE="Drag to move." JLIB_HTML_BEHAVIOR_GO_TODAY="Go to today" JLIB_HTML_BEHAVIOR_GREEN="Green" JLIB_HTML_BEHAVIOR_HOLD_MOUSE="- Hold mouse button on any of the buttons above for faster selection." JLIB_HTML_BEHAVIOR_MONTH_SELECT="- Use the < and > buttons to select month\n" JLIB_HTML_BEHAVIOR_NEXT_MONTH_HOLD_FOR_MENU="Select to move to the next month. Select and hold for a list of the months." JLIB_HTML_BEHAVIOR_NEXT_YEAR_HOLD_FOR_MENU="Select to move to the next year. Select and hold for a list of years." JLIB_HTML_BEHAVIOR_PREV_MONTH_HOLD_FOR_MENU="Select to move to the previous month. Select and hold for a list of the months." JLIB_HTML_BEHAVIOR_PREV_YEAR_HOLD_FOR_MENU="Select to move to the previous year. Select and hold for a list of years." JLIB_HTML_BEHAVIOR_SELECT_DATE="Select a date." JLIB_HTML_BEHAVIOR_SHIFT_CLICK_OR_DRAG_TO_CHANGE_VALUE="(Shift-)Select or Drag to change the value." JLIB_HTML_BEHAVIOR_TIME="Time:" JLIB_HTML_BEHAVIOR_TODAY="Today" JLIB_HTML_BEHAVIOR_TT_DATE_FORMAT="%a, %b %e" JLIB_HTML_BEHAVIOR_WK="wk" JLIB_HTML_BEHAVIOR_YEAR_SELECT="- Use the « and » buttons to select year\n" JLIB_HTML_BUTTON_BASE_CLASS="Could not load button base class." JLIB_HTML_BUTTON_NO_LOAD="Could not load button %s (%s);" JLIB_HTML_BUTTON_NOT_DEFINED="Button not defined for type = %s" JLIB_HTML_CALENDAR="Calendar" JLIB_HTML_CHECKED_OUT="Checked out." JLIB_HTML_CHECKIN="Check-in" JLIB_HTML_CLOAKING="This email address is being protected from spambots. You need JavaScript enabled to view it." JLIB_HTML_DATE_RELATIVE_DAYS="%s days ago." JLIB_HTML_DATE_RELATIVE_DAYS_1="%s day ago." JLIB_HTML_DATE_RELATIVE_DAYS_0="%s days ago." JLIB_HTML_DATE_RELATIVE_HOURS="%s hours ago." JLIB_HTML_DATE_RELATIVE_HOURS_1="%s hour ago." JLIB_HTML_DATE_RELATIVE_HOURS_0="%s hours ago." JLIB_HTML_DATE_RELATIVE_LESSTHANAMINUTE="Less than a minute ago." JLIB_HTML_DATE_RELATIVE_MINUTES="%s minutes ago." JLIB_HTML_DATE_RELATIVE_MINUTES_1="%s minute ago." JLIB_HTML_DATE_RELATIVE_MINUTES_0="%s minutes ago." JLIB_HTML_DATE_RELATIVE_WEEKS="%s weeks ago." JLIB_HTML_DATE_RELATIVE_WEEKS_1="%s week ago." JLIB_HTML_DATE_RELATIVE_WEEKS_0="%s weeks ago." JLIB_HTML_EDIT_MENU_ITEM="Edit menu item." JLIB_HTML_EDIT_MENU_ITEM_ID="Item ID: %s" JLIB_HTML_EDIT_MODULE="Edit module" JLIB_HTML_EDIT_MODULE_IN_POSITION="Position: %s" JLIB_HTML_EDITOR_CANNOT_LOAD="Can't load the editor." JLIB_HTML_END="End" JLIB_HTML_ERROR_FUNCTION_NOT_SUPPORTED="Function not supported." JLIB_HTML_ERROR_NOTFOUNDINFILE="%s: :%s not found in file." JLIB_HTML_ERROR_NOTSUPPORTED_NOFILE="%s: :%s not supported. File not found." JLIB_HTML_ERROR_NOTSUPPORTED="%s: :%s not supported." JLIB_HTML_MOVE_DOWN="Move Down" JLIB_HTML_MOVE_UP="Move Up" JLIB_HTML_NO_PARAMETERS_FOR_THIS_ITEM="There are no parameters for this item." JLIB_HTML_NO_RECORDS_FOUND="No records found." JLIB_HTML_PAGE_CURRENT_OF_TOTAL="Page %s of %s" JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST="Please first make a selection from the list." JLIB_HTML_PUBLISH_ITEM="Publish Item" JLIB_HTML_PUBLISHED_EXPIRED_ITEM="Published, but has Expired." JLIB_HTML_PUBLISHED_FINISHED="Finish: %s" JLIB_HTML_PUBLISHED_ITEM="Published and is Current." JLIB_HTML_PUBLISHED_PENDING_ITEM="Published, but is Pending." JLIB_HTML_PUBLISHED_START="Start: %s" JLIB_HTML_RESULTS_OF="Results %s - %s of %s" JLIB_HTML_SAVE_ORDER="Save Order" JLIB_HTML_SELECT_STATE="Select State" JLIB_HTML_START="Start" JLIB_HTML_UNPUBLISH_ITEM="Unpublish Item" JLIB_HTML_VIEW_ALL="View All" JLIB_HTML_SETDEFAULT_ITEM="Set default" JLIB_HTML_UNSETDEFAULT_ITEM="Unset default" JLIB_INSTALLER_ABORT="Aborting language installation: %s" JLIB_INSTALLER_ABORT_ALREADYINSTALLED="Extension is already installed." JLIB_INSTALLER_ABORT_ALREADY_EXISTS="Extension %1$s: Extension %2$s already exists." JLIB_INSTALLER_ABORT_COMP_BUILDADMINMENUS_FAILED="Error building Administrator Menus." JLIB_INSTALLER_ABORT_COMP_COPY_MANIFEST="Component %1$s: Could not copy PHP manifest file." JLIB_INSTALLER_ABORT_COMP_COPY_SETUP="Component %1$s: Could not copy setup file." JLIB_INSTALLER_ABORT_COMP_FAIL_ADMIN_FILES="Component %s: Failed to copy administrator files." JLIB_INSTALLER_ABORT_COMP_FAIL_SITE_FILES="Component %s: Failed to copy site files." JLIB_INSTALLER_ABORT_COMP_INSTALL_COPY_SETUP="Component Install: Could not copy setup file." JLIB_INSTALLER_ABORT_COMP_INSTALL_CUSTOM_INSTALL_FAILURE="Component Install: Custom install routine failure." JLIB_INSTALLER_ABORT_COMP_INSTALL_MANIFEST="Component Install: Could not copy PHP manifest file." JLIB_INSTALLER_ABORT_COMP_INSTALL_PHP_INSTALL="Component Install: Could not copy PHP install file." JLIB_INSTALLER_ABORT_COMP_INSTALL_PHP_UNINSTALL="Component Install: Could not copy PHP uninstall file." JLIB_INSTALLER_ABORT_COMP_INSTALL_ROLLBACK="Component Install: %s" JLIB_INSTALLER_ABORT_COMP_INSTALL_SQL_ERROR="Component Install: SQL error file %s" JLIB_INSTALLER_ABORT_COMP_UPDATESITEMENUS_FAILED="Component Install: Failed to update menu items." JLIB_INSTALLER_ABORT_COMP_UPDATE_ADMIN_ELEMENT="Component Update: The XML file did not contain an administration element." JLIB_INSTALLER_ABORT_COMP_UPDATE_COPY_SETUP="Component Update: Could not copy setup file." JLIB_INSTALLER_ABORT_COMP_UPDATE_MANIFEST="Component Update: Could not copy PHP manifest file." JLIB_INSTALLER_ABORT_COMP_UPDATE_PHP_INSTALL="Component Update: Could not copy PHP install file." JLIB_INSTALLER_ABORT_COMP_UPDATE_PHP_UNINSTALL="Component Update: Could not copy PHP uninstall file." JLIB_INSTALLER_ABORT_COMP_UPDATE_ROLLBACK="Component Update: %s" JLIB_INSTALLER_ABORT_COMP_UPDATE_SQL_ERROR="Component Update: SQL error file %s" JLIB_INSTALLER_ABORT_CREATE_DIRECTORY="Extension %1$s: Failed to create folder: %2$s" JLIB_INSTALLER_ABORT_DEBUG="Installation unexpectedly terminated:" JLIB_INSTALLER_ABORT_DETECTMANIFEST="Unable to detect manifest file." JLIB_INSTALLER_ABORT_DIRECTORY="Extension %1$s: Another %2$s is already using the named folder: %3$s. Are you trying to install the same extension again?" JLIB_INSTALLER_ABORT_EXTENSIONNOTVALID="Extension is not valid." JLIB_INSTALLER_ABORT_FILE_INSTALL_COPY_SETUP="Files Install: Could not copy setup file." JLIB_INSTALLER_ABORT_FILE_INSTALL_CUSTOM_INSTALL_FAILURE="Files Install: Custom install routine failure." JLIB_INSTALLER_ABORT_FILE_INSTALL_FAIL_SOURCE_DIRECTORY="Files Install: Failed to find source folder: %s" JLIB_INSTALLER_ABORT_FILE_INSTALL_ROLLBACK="Files Install: %s" JLIB_INSTALLER_ABORT_FILE_INSTALL_SQL_ERROR="Files %1$s: SQL error file %2$s" JLIB_INSTALLER_ABORT_FILE_ROLLBACK="Files Install: %s" JLIB_INSTALLER_ABORT_FILE_SAME_NAME="Files Install: Another extension with same name already exists." JLIB_INSTALLER_ABORT_FILE_UPDATE_SQL_ERROR="Files Update: SQL error file %s" JLIB_INSTALLER_ABORT_INSTALL_CUSTOM_INSTALL_FAILURE="Extension %s: Custom install routine failure." JLIB_INSTALLER_ABORT_LIB_COPY_FILES="Library %s: Could not copy files from the source." JLIB_INSTALLER_ABORT_LIB_INSTALL_ALREADY_INSTALLED="Library Install: Library already installed." JLIB_INSTALLER_ABORT_LIB_INSTALL_COPY_SETUP="Library Install: Could not copy setup file." JLIB_INSTALLER_ABORT_LIB_INSTALL_FAILED_TO_CREATE_DIRECTORY="Library Install: Failed to create folder: %s" JLIB_INSTALLER_ABORT_LIB_INSTALL_NOFILE="Library Install: No library file specified." JLIB_INSTALLER_ABORT_LIB_INSTALL_ROLLBACK="Library Install: %s" JLIB_INSTALLER_ABORT_LOAD_DETAILS="Failed to load extension details." JLIB_INSTALLER_ABORT_MANIFEST="Extension %1$s: Could not copy PHP manifest file." JLIB_INSTALLER_ABORT_METHODNOTSUPPORTED="Method not supported for this extension type." JLIB_INSTALLER_ABORT_METHODNOTSUPPORTED_TYPE="Method not supported for this extension type: %s" JLIB_INSTALLER_ABORT_MOD_COPY_FILES="Module %s: Could not copy files from the source." JLIB_INSTALLER_ABORT_MOD_INSTALL_COPY_SETUP="Module Install: Could not copy setup file." JLIB_INSTALLER_ABORT_MOD_INSTALL_CREATE_DIRECTORY="Module %1$s: Failed to create folder: %2$s" JLIB_INSTALLER_ABORT_MOD_INSTALL_CUSTOM_INSTALL_FAILURE="Module Install: Custom install routine failure." JLIB_INSTALLER_ABORT_MOD_INSTALL_DIRECTORY="Module %1$s: Another module is already using folder: %2$s" JLIB_INSTALLER_ABORT_MOD_INSTALL_MANIFEST="Module Install: Could not copy PHP manifest file." JLIB_INSTALLER_ABORT_MOD_INSTALL_NOFILE="Module %s: No module file specified." JLIB_INSTALLER_ABORT_MOD_INSTALL_SQL_ERROR="Module %1$s: SQL error file %2$s" JLIB_INSTALLER_ABORT_MOD_ROLLBACK="Module %1$s: %2$s" JLIB_INSTALLER_ABORT_MOD_UNINSTALL_UNKNOWN_CLIENT="Module Uninstall: Unknown client type [%s]" JLIB_INSTALLER_ABORT_MOD_UNKNOWN_CLIENT="Module %1$s: Unknown client type [%2$s]" JLIB_INSTALLER_ABORT_NOINSTALLPATH="Install path does not exist." JLIB_INSTALLER_ABORT_NOUPDATEPATH="Update path does not exist." JLIB_INSTALLER_ABORT_PACK_INSTALL_COPY_SETUP="Package Install: Could not copy setup file." JLIB_INSTALLER_ABORT_PACK_INSTALL_CREATE_DIRECTORY="Package Install: Failed to create folder:%s." JLIB_INSTALLER_ABORT_PACKAGE_INSTALL_CUSTOM_INSTALL_FAILURE="Package Install: Custom install routine failure." JLIB_INSTALLER_ABORT_PACKAGE_INSTALL_MANIFEST="Installation failed: Could not copy PHP manifest file." JLIB_INSTALLER_ABORT_PACK_INSTALL_ERROR_EXTENSION="Package %1$s: There was an error installing an extension: %2$s" JLIB_INSTALLER_ABORT_PACK_INSTALL_NO_FILES="Package %s: There were no files to install!" JLIB_INSTALLER_ABORT_PACK_INSTALL_NO_PACK="Package %s: No package file specified." JLIB_INSTALLER_ABORT_PACK_INSTALL_ROLLBACK="Package Install: %s" JLIB_INSTALLER_ABORT_PLG_COPY_FILES="Plugin %s: Could not copy files from the source." JLIB_INSTALLER_ABORT_PLG_INSTALL_ALLREADY_EXISTS="Plugin %1$s: Plugin %2$s already exists." JLIB_INSTALLER_ABORT_PLG_INSTALL_COPY_SETUP="Plugin %s: Could not copy setup file." JLIB_INSTALLER_ABORT_PLG_INSTALL_CREATE_DIRECTORY="Plugin %1$s: Failed to create folder: %2$s" JLIB_INSTALLER_ABORT_PLG_INSTALL_CUSTOM_INSTALL_FAILURE="Plugin Install: Custom install routine failure." JLIB_INSTALLER_ABORT_PLG_INSTALL_DIRECTORY="Plugin %1$s: Another plugin is already using folder: %2$s" JLIB_INSTALLER_ABORT_PLG_INSTALL_MANIFEST="Plugin %s: Could not copy PHP manifest file." JLIB_INSTALLER_ABORT_PLG_INSTALL_NO_FILE="Plugin %s: No plugin file specified." JLIB_INSTALLER_ABORT_PLG_INSTALL_ROLLBACK="Plugin %1$s: %2$s" JLIB_INSTALLER_ABORT_PLG_INSTALL_SQL_ERROR="Plugin %1$s: SQL error file %2$s" JLIB_INSTALLER_ABORT_PLG_UNINSTALL_SQL_ERROR="Plugin Uninstall: SQL error file %s" JLIB_INSTALLER_ABORT_REFRESH_MANIFEST_CACHE="Refresh Manifest Cache failed: Extension is not currently installed." JLIB_INSTALLER_ABORT_REFRESH_MANIFEST_CACHE_VALID="Refresh Manifest Cache failed: Extension is not valid." JLIB_INSTALLER_ABORT_ROLLBACK="Extension %1$s: %2$s" JLIB_INSTALLER_ABORT_SQL_ERROR="Extension %1$s: SQL error processing query: %2$s" JLIB_INSTALLER_ABORT_TPL_INSTALL_ALREADY_INSTALLED="Template Install: Template already installed." JLIB_INSTALLER_ABORT_TPL_INSTALL_ANOTHER_TEMPLATE_USING_DIRECTORY="Template Install: There is already a Template using the named folder: %s. Are you trying to install the same template again?" JLIB_INSTALLER_ABORT_TPL_INSTALL_COPY_FILES="Template Install: Could not copy files from the %s source." JLIB_INSTALLER_ABORT_TPL_INSTALL_COPY_SETUP="Template Install: Could not copy setup file." JLIB_INSTALLER_ABORT_TPL_INSTALL_FAILED_CREATE_DIRECTORY="Template Install: Failed to create folder: %s" JLIB_INSTALLER_ABORT_TPL_INSTALL_ROLLBACK="Template Install: %s" JLIB_INSTALLER_ABORT_TPL_INSTALL_UNKNOWN_CLIENT="Template Install: Unknown client type [%s]" JLIB_INSTALLER_AVAILABLE_UPDATE_PHP_VERSION="For the extension %1$s version %2$s is available, but it requires at least PHP version %3$s while your system only has %4$s" JLIB_INSTALLER_PURGED_UPDATES="Cleared updates" JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES="Failed to clear updates." JLIB_INSTALLER_DEFAULT_STYLE="%s - Default" JLIB_INSTALLER_DISCOVER="Discover" JLIB_INSTALLER_ERROR_COMP_DISCOVER_STORE_DETAILS="Component Discover install: Failed to store component details." JLIB_INSTALLER_ERROR_COMP_FAILED_TO_CREATE_DIRECTORY="Component %1$s: Failed to create folder: %2$s." JLIB_INSTALLER_ERROR_COMP_INSTALL_ADMIN_ELEMENT="Component Install: The XML file did not contain an administration element." JLIB_INSTALLER_ERROR_COMP_INSTALL_DIR_ADMIN="Component Install: Another component is already using folder: %s" JLIB_INSTALLER_ERROR_COMP_INSTALL_DIR_SITE="Component Install: Another component is already using folder: %s" JLIB_INSTALLER_ERROR_COMP_INSTALL_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Install: Failed to create administrator folder: %s" JLIB_INSTALLER_ERROR_COMP_INSTALL_FAILED_TO_CREATE_DIRECTORY_SITE="Component Install: Failed to create site folder: %s" JLIB_INSTALLER_ERROR_COMP_REFRESH_MANIFEST_CACHE="Component Refresh manifest cache: Failed to store component details." JLIB_INSTALLER_ERROR_COMP_REMOVING_ADMIN_MENUS_FAILED="Could not delete the Administrator menus." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_CUSTOM="Component Uninstall: Custom Uninstall script unsuccessful." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_DELETE_CATEGORIES="Component Uninstall: Unable to delete the component categories." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_ERRORREMOVEMANUALLY="Component Uninstall: Can't uninstall. Please remove manually." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_ERRORUNKOWNEXTENSION="Component Uninstall: Unknown Extension." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_ADMIN="Component Uninstall: Unable to remove the component administrator folder." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_SITE="Component Uninstall: Unable to remove the component site folder." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_NO_OPTION="Component Uninstall: Option field empty, can't remove files." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_SQL_ERROR="Component Uninstall: SQL error file %s" JLIB_INSTALLER_ERROR_COMP_UNINSTALL_WARNCORECOMPONENT="Component Uninstall: Trying to uninstall a core component." JLIB_INSTALLER_ERROR_COMP_UPDATE_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Update: Failed to create administrator folder: %s" JLIB_INSTALLER_ERROR_COMP_UPDATE_FAILED_TO_CREATE_DIRECTORY_SITE="Component Update: Failed to create site folder: %s" JLIB_INSTALLER_ERROR_CREATE_DIRECTORY="JInstaller: :Install: Failed to create folder: %s" JLIB_INSTALLER_ERROR_CREATE_FOLDER_FAILED="Failed to create folder [%s]" JLIB_INSTALLER_ERROR_DEPRECATED_FORMAT="Deprecated install format (client="_QQ_"both"_QQ_"), use package installer in future." JLIB_INSTALLER_ERROR_DISCOVER_INSTALL_UNSUPPORTED="A %s extension can not be installed using the discover method. Please install this extension from Extension Manager: Install." JLIB_INSTALLER_ERROR_DOWNLOAD_SERVER_CONNECT="Error connecting to the server: %s" JLIB_INSTALLER_ERROR_FAIL_COPY_FILE="JInstaller: :Install: Failed to copy file %1$s to %2$s" JLIB_INSTALLER_ERROR_FAIL_COPY_FOLDER="JInstaller: :Install: Failed to copy folder %1$s to %2$s" JLIB_INSTALLER_ERROR_FAILED_READING_NETWORK_RESOURCES="Failed reading network resource: %s" JLIB_INSTALLER_ERROR_FILE_EXISTS="JInstaller: :Install: File already exists %s" JLIB_INSTALLER_ERROR_FILE_UNINSTALL_INVALID_MANIFEST="Files Uninstall: Invalid manifest file." JLIB_INSTALLER_ERROR_FILE_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Files Uninstall: Manifest file invalid or not found." JLIB_INSTALLER_ERROR_FILE_UNINSTALL_LOAD_ENTRY="Files Uninstall: Could not load extension entry." JLIB_INSTALLER_ERROR_FILE_UNINSTALL_LOAD_MANIFEST="Files Uninstall: Could not load manifest file." JLIB_INSTALLER_ERROR_FILE_UNINSTALL_SQL_ERROR="Files Uninstall: SQL error file %s" JLIB_INSTALLER_ERROR_FILE_UNINSTALL_WARNCOREFILE="File Uninstall: Trying to uninstall core files." JLIB_INSTALLER_ERROR_FOLDER_IN_USE="Another extension is already using folder [%s]" JLIB_INSTALLER_ERROR_LANG_DISCOVER_STORE_DETAILS="Language Discover install: Failed to store language details." JLIB_INSTALLER_ERROR_LANG_UNINSTALL_DEFAULT="This language can't be uninstalled as long as it is defined as a default language." JLIB_INSTALLER_ERROR_LANG_UNINSTALL_DIRECTORY="Language Uninstall: Unable to remove the specified Language folder." JLIB_INSTALLER_ERROR_LANG_UNINSTALL_ELEMENT_EMPTY="Language Uninstall: Element is empty, can't uninstall files." JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PATH_EMPTY="Language Uninstall: Language path is empty, can't uninstall files." JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PROTECTED="This language can't be uninstalled. It is protected in the database (usually en-GB)." JLIB_INSTALLER_ERROR_LIB_DISCOVER_STORE_DETAILS="Library Discover install: Failed to store library details." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_INVALID_MANIFEST="Library Uninstall: Invalid manifest file." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Library Uninstall: Manifest file invalid or not found." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_LOAD_MANIFEST="Library Uninstall: Could not load manifest file." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_WARNCORELIBRARY="Library Uninstall: Trying to uninstall a core library." JLIB_INSTALLER_ERROR_LOAD_XML="JInstaller: :Install: Failed to load XML File: %s" JLIB_INSTALLER_ERROR_MOD_DISCOVER_STORE_DETAILS="Module Discover install: Failed to store module details." JLIB_INSTALLER_ERROR_MOD_REFRESH_MANIFEST_CACHE="Module Refresh manifest cache: Failed to store module details." JLIB_INSTALLER_ERROR_MOD_UNINSTALL_ERRORUNKOWNEXTENSION="Module Uninstall: Unknown Extension." JLIB_INSTALLER_ERROR_MOD_UNINSTALL_EXCEPTION="Module Uninstall: %s" JLIB_INSTALLER_ERROR_MOD_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Module Uninstall: Manifest file invalid or not found." JLIB_INSTALLER_ERROR_MOD_UNINSTALL_SQL_ERROR="Module Uninstall: SQL error file %s" JLIB_INSTALLER_ERROR_MOD_UNINSTALL_WARNCOREMODULE="Module Uninstall: Trying to uninstall a core module: %s" JLIB_INSTALLER_ERROR_NO_CORE_LANGUAGE="No core pack exists for the language [%s]" JLIB_INSTALLER_ERROR_NO_FILE="JInstaller: :Install: File does not exist %s" JLIB_INSTALLER_ERROR_NO_LANGUAGE_TAG="The package did not specify a language tag. Are you trying to install an old language package?" JLIB_INSTALLER_ERROR_NOTFINDJOOMLAXMLSETUPFILE="JInstaller: :Install: Can't find Joomla XML setup file." JLIB_INSTALLER_ERROR_NOTFINDXMLSETUPFILE="JInstaller: :Install: Can't find XML setup file." JLIB_INSTALLER_ERROR_PACK_UNINSTALL_INVALID_MANIFEST="Package Uninstall: Invalid manifest file." JLIB_INSTALLER_ERROR_PACK_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Package Uninstall: Manifest file invalid or not found: %s" JLIB_INSTALLER_ERROR_PACK_UNINSTALL_LOAD_MANIFEST="Package Uninstall: Could not load manifest file." JLIB_INSTALLER_ERROR_PACK_UNINSTALL_MANIFEST_NOT_REMOVED="Package Uninstall: Errors were detected, manifest file not removed!" JLIB_INSTALLER_ERROR_PACK_UNINSTALL_MISSINGMANIFEST="Package Uninstall: Missing manifest file." JLIB_INSTALLER_ERROR_PACK_UNINSTALL_NOT_PROPER="Package Uninstall: This extension may have already been uninstalled or might not have been uninstall properly: %s" JLIB_INSTALLER_ERROR_PACK_UNINSTALL_WARNCOREPACK="Package Uninstall: Trying to uninstall core package." JLIB_INSTALLER_ERROR_PLG_DISCOVER_STORE_DETAILS="Plugin Discover install: Failed to store plugin details." JLIB_INSTALLER_ERROR_PLG_REFRESH_MANIFEST_CACHE="Plugin Refresh manifest cache: Failed to store plugin details." JLIB_INSTALLER_ERROR_PLG_UNINSTALL_ERRORUNKOWNEXTENSION="Plugin Uninstall: Unknown Extension." JLIB_INSTALLER_ERROR_PLG_UNINSTALL_FOLDER_FIELD_EMPTY="Plugin Uninstall: Folder field empty, can't remove files." JLIB_INSTALLER_ERROR_PLG_UNINSTALL_INVALID_MANIFEST="Plugin Uninstall: Invalid manifest file." JLIB_INSTALLER_ERROR_PLG_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Plugin Uninstall: Manifest file invalid or not found." JLIB_INSTALLER_ERROR_PLG_UNINSTALL_LOAD_MANIFEST="Plugin Uninstall: Could not load manifest file." JLIB_INSTALLER_ERROR_PLG_UNINSTALL_WARNCOREPLUGIN="Plugin Uninstall: Trying to uninstall a core plugin: %s" JLIB_INSTALLER_ERROR_SQL_ERROR="JInstaller: :Install: Error SQL %s" JLIB_INSTALLER_ERROR_SQL_FILENOTFOUND="JInstaller: :Install: SQL File not found %s" JLIB_INSTALLER_ERROR_SQL_READBUFFER="JInstaller: :Install: SQL File Buffer Read Error." JLIB_INSTALLER_ERROR_TPL_DISCOVER_STORE_DETAILS="Template Discover install: Failed to store template details." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_ERRORUNKOWNEXTENSION="Template Uninstall: Unknown Extension." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_CLIENT="Template Uninstall: Invalid client." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Template Uninstall: Manifest file invalid or not found." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_DEFAULT="Template Uninstall: Can't remove default template." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_DIRECTORY="Template Uninstall: Folder does not exist, can't remove files." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_ID_EMPTY="Template Uninstall: Template ID is empty, can't uninstall files." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_WARNCORETEMPLATE="Template Uninstall: Trying to uninstall a core template: %s" JLIB_INSTALLER_ERROR_UNKNOWN_CLIENT_TYPE="Unknown Client Type [%s]" JLIB_INSTALLER_INSTALL="Install" JLIB_INSTALLER_NOTICE_LANG_RESET_USERS="Language set to Default for %d users." JLIB_INSTALLER_NOTICE_LANG_RESET_USERS_1="Language set to Default for %d user." JLIB_INSTALLER_UNINSTALL="Uninstall" JLIB_INSTALLER_UPDATE="Update" JLIB_INSTALLER_ERROR_EXTENSION_INVALID_CLIENT_IDENTIFIER="Invalid client identifier specified in extension manifest." JLIB_INSTALLER_ERROR_PACK_UNINSTALL_UNKNOWN_EXTENSION="Attempting to uninstall unknown extension from package. This extension may have already been removed earlier." JLIB_INSTALLER_NOT_ERROR="If the error is related to the installation of TinyMCE language files it has no effect on the installation of the language(s). Some language packs created prior to Joomla! 3.2.0 may try to install separate TinyMCE language files. As these are now included in the core they no longer need to be installed." JLIB_INSTALLER_UPDATE_LOG_QUERY="Ran query from file %1$s. Query text: %2$s." JLIB_MAIL_FUNCTION_DISABLED="The mail() function has been disabled and the mail can't be sent." JLIB_MAIL_FUNCTION_OFFLINE="The mail function has been temporarily disabled on this site, please try again later." JLIB_MAIL_INVALID_EMAIL_SENDER="JMail: : Invalid email Sender: %s, JMail: :setSender(%s)." JLIB_MEDIA_ERROR_UPLOAD_INPUT="Unable to upload file." JLIB_MEDIA_ERROR_WARNFILENAME="File name must only contain alphanumeric characters and no spaces." JLIB_MEDIA_ERROR_WARNFILETOOLARGE="This file is too large to upload." JLIB_MEDIA_ERROR_WARNFILETYPE="This file type is not supported." JLIB_MEDIA_ERROR_WARNIEXSS="Possible IE XSS Attack found." JLIB_MEDIA_ERROR_WARNINVALID_IMG="Not a valid image." JLIB_MEDIA_ERROR_WARNINVALID_MIME="Illegal or invalid mime type detected." JLIB_MEDIA_ERROR_WARNNOTADMIN="Uploaded file is not an image file and you do not have permission." JLIB_PLUGIN_ERROR_LOADING_PLUGINS="Error loading Plugins: %s" JLIB_REGISTRY_EXCEPTION_LOAD_FORMAT_CLASS="Unable to load format class." JLIB_RULES_ACTION="Action" JLIB_RULES_ALLOWED="Allowed" JLIB_RULES_ALLOWED_ADMIN="Allowed (Super User)" JLIB_RULES_CALCULATED_SETTING="Calculated Setting <sup>2</sup>" JLIB_RULES_CONFLICT="Conflict" JLIB_RULES_DENIED="Denied" JLIB_RULES_GROUP="%s" JLIB_RULES_GROUPS="Groups" JLIB_RULES_INHERIT="Inherit" JLIB_RULES_INHERITED="Inherited" JLIB_RULES_NOT_ALLOWED="Not Allowed." JLIB_RULES_NOT_ALLOWED_ADMIN_CONFLICT="Conflict" JLIB_RULES_NOT_ALLOWED_LOCKED="Not Allowed (Locked)" JLIB_RULES_NOT_SET="Not Set" JLIB_RULES_SELECT_ALLOW_DENY_GROUP="Allow or deny %s for users in the %s group." JLIB_RULES_SELECT_SETTING="Select New Setting <sup>1</sup>" JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this and all child groups, components and content. Note that <em>Denied</em> will overrule any inherited setting and also the setting in any child group, component or content. In the case of a setting conflict, <em>Deny</em> will take precedence. <em>Not Set</em> is equivalent to <em>Denied</em> but can be changed in child groups, components and content.<br />2. If you select a new setting, select <em>Save</em> to refresh the calculated settings." JLIB_RULES_SETTING_NOTES_ITEM="1. If you change the setting, it will apply to this item. Note that:<br /><em>Inherited</em> means that the permissions from global configuration, parent group and category will be used.<br /><em>Denied</em> means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this item.<br /><em>Allowed</em> means that the group being edited will be able to take this action for this item (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by <em>Not Allowed (Locked)</em> under Calculated Settings).<br />2. If you select a new setting, select <em>Save</em> to refresh the calculated settings." JLIB_RULES_SETTINGS_DESC="Manage the permission settings for the user groups below. See notes at the bottom." JLIB_UNKNOWN="Unknown" JLIB_UPDATER_ERROR_COLLECTION_FOPEN="The PHP allow_url_fopen setting is disabled. This setting must be enabled for the updater to work." JLIB_UPDATER_ERROR_COLLECTION_OPEN_URL="Update: :Collection: Could not open %s" JLIB_UPDATER_ERROR_COLLECTION_PARSE_URL="Update: :Collection: Could not parse %s" JLIB_UPDATER_ERROR_EXTENSION_OPEN_URL="Update: :Extension: Could not open %s" JLIB_UPDATER_ERROR_EXTENSION_PARSE_URL="Update: :Extension: Could not parse %s" JLIB_UPDATER_ERROR_OPEN_UPDATE_SITE="Update: Could not open update site #%d "%s", URL: %s" JLIB_USER_ERROR_AUTHENTICATION_FAILED_LOAD_PLUGIN="JAuthentication: :authenticate: Failed to load plugin: %s" JLIB_USER_ERROR_AUTHENTICATION_LIBRARIES="JAuthentication: :__construct: Could not load authentication libraries." JLIB_USER_ERROR_BIND_ARRAY="Unable to bind array to user object." JLIB_USER_ERROR_CANNOT_DEMOTE_SELF="You can't remove your own Super User permissions." JLIB_USER_ERROR_CANNOT_REUSE_PASSWORD="You can't reuse your current password, please enter a new password." JLIB_USER_ERROR_ID_NOT_EXISTS="JUser: :_load: User %s does not exist." JLIB_USER_ERROR_NOT_SUPERADMIN="Only users with Super User permissions can change other Super User user accounts." JLIB_USER_ERROR_PASSWORD_NOT_MATCH="Passwords do not match. Please re-enter password." JLIB_USER_ERROR_UNABLE_TO_FIND_USER="Unable to find a user with given activation string." JLIB_USER_ERROR_UNABLE_TO_LOAD_USER="JUser: :_load: Unable to load user with ID: %s" JLIB_USER_EXCEPTION_ACCESS_USERGROUP_INVALID="User group does not exist." JLIB_UTIL_ERROR_APP_INSTANTIATION="Application Startup Error." JLIB_UTIL_ERROR_CONNECT_DATABASE="JDatabase: :getInstance: Could not connect to database <br />joomla.library: %1$s - %2$s" JLIB_UTIL_ERROR_DOMIT="DommitDocument is deprecated. Use DomDocument instead." JLIB_UTIL_ERROR_LOADING_FEED_DATA="Error loading feed data." JLIB_UTIL_ERROR_XML_LOAD="Failed loading XML file." PK���\Ѻu��!language/en-GB/en-GB.com_ajax.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 COM_AJAX="Ajax Interface" COM_AJAX_XML_DESCRIPTION="An extendable Ajax interface for Joomla." COM_AJAX_SPECIFY_FORMAT="Please specify a valid response format, other than that of HTML, such as json, raw, debug, etc." COM_AJAX_METHOD_NOT_EXISTS="Method %s does not exist." COM_AJAX_FILE_NOT_EXISTS="The file at %s does not exist." COM_AJAX_MODULE_NOT_ACCESSIBLE="Module %s is not published, you do not have access to it, or it's not assigned to the current menu item." PK���\�J�fIIlanguage/en-GB/en-GB.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <metafile version="3.4" client="site"> <name>English (en-GB)</name> <version>3.4.3</version> <creationDate>2013-03-07</creationDate> <author>Joomla! Project</author> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <description>en-GB site language</description> <metadata> <name>English (en-GB)</name> <tag>en-GB</tag> <rtl>0</rtl> <locale>en_GB.utf8, en_GB.UTF-8, en_GB, eng_GB, en, english, english-uk, uk, gbr, britain, england, great britain, uk, united kingdom, united-kingdom</locale> <firstDay>0</firstDay> <weekEnd>0,6</weekEnd> </metadata> <params /> </metafile> PK���\7�?��#language/en-GB/en-GB.mod_footer.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 ; Note : %date% will be auto replaced by current year !Don't translate MOD_FOOTER="Footer" MOD_FOOTER_LINE1="Copyright © %date% %sitename%. All Rights Reserved." MOD_FOOTER_LINE2="<a href="_QQ_"http://www.joomla.org"_QQ_">Joomla!</a> is Free Software released under the <a href="_QQ_"http://www.gnu.org/licenses/gpl-2.0.html"_QQ_">GNU General Public License.</a>" MOD_FOOTER_XML_DESCRIPTION="This module shows the Joomla! copyright information." PK���\/tGi��.language/en-GB/en-GB.mod_articles_news.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_ARTICLES_NEWS="Articles - Newsflash" MOD_ARTICLES_NEWS_XML_DESCRIPTION="The Newsflash Module will display a fixed number of articles from a specific category." MOD_ARTICLES_NEWS_LAYOUT_DEFAULT="Default" PK���\�R�QQ joomla.xmlnu�[���<?xml version="1.0" encoding="UTF-8"?> <extension version="3.4" type="file" method="upgrade"> <name>files_joomla</name> <author>Joomla! Project</author> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <copyright>(C) 2005 - 2015 Open Source Matters. All rights reserved</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <version>3.4.8</version> <creationDate>December 2015</creationDate> <description>FILES_JOOMLA_XML_DESCRIPTION</description> <scriptfile>administrator/components/com_admin/script.php</scriptfile> <update> <schemas> <schemapath type="mysql">administrator/components/com_admin/sql/updates/mysql</schemapath> <schemapath type="sqlsrv">administrator/components/com_admin/sql/updates/sqlsrv</schemapath> <schemapath type="sqlazure">administrator/components/com_admin/sql/updates/sqlazure</schemapath> <schemapath type="postgresql">administrator/components/com_admin/sql/updates/postgresql</schemapath> </schemas> </update> <fileset> <files> <folder>administrator</folder> <folder>bin</folder> <folder>cache</folder> <folder>cli</folder> <folder>components</folder> <folder>images</folder> <folder>includes</folder> <folder>language</folder> <folder>layouts</folder> <folder>libraries</folder> <folder>logs</folder> <folder>media</folder> <folder>modules</folder> <folder>plugins</folder> <folder>templates</folder> <folder>tmp</folder> <file>htaccess.txt</file> <file>web.config.txt</file> <file>LICENSE.txt</file> <file>README.txt</file> <file>index.php</file> </files> </fileset> <updateservers> <server type="collection">http://update.joomla.org/core/list.xml</server> <server type="collection">http://update.joomla.org/jed/list.xml</server> </updateservers> </extension> PK���\��ھ� � error_lognu�[���[27-Jun-2026 04:51:00 UTC] PHP Deprecated: Return type of JDate::format($format, $local = false, $translate = true) should either be compatible with DateTime::format(string $format): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/poliximo/public_html/htm/libraries/joomla/date/date.php on line 275 [27-Jun-2026 04:51:00 UTC] PHP Deprecated: Return type of JDate::setTimezone($tz) should either be compatible with DateTime::setTimezone(DateTimeZone $timezone): DateTime, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/poliximo/public_html/htm/libraries/joomla/date/date.php on line 392 [27-Jun-2026 13:02:31 UTC] PHP Deprecated: Return type of JDate::format($format, $local = false, $translate = true) should either be compatible with DateTime::format(string $format): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/poliximo/public_html/htm/libraries/joomla/date/date.php on line 275 [27-Jun-2026 13:02:31 UTC] PHP Deprecated: Return type of JDate::setTimezone($tz) should either be compatible with DateTime::setTimezone(DateTimeZone $timezone): DateTime, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/poliximo/public_html/htm/libraries/joomla/date/date.php on line 392 [27-Jun-2026 13:03:32 UTC] PHP Deprecated: Return type of JDate::format($format, $local = false, $translate = true) should either be compatible with DateTime::format(string $format): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/poliximo/public_html/htm/libraries/joomla/date/date.php on line 275 [27-Jun-2026 13:03:32 UTC] PHP Deprecated: Return type of JDate::setTimezone($tz) should either be compatible with DateTime::setTimezone(DateTimeZone $timezone): DateTime, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/poliximo/public_html/htm/libraries/joomla/date/date.php on line 392 [27-Jun-2026 13:28:39 UTC] PHP Deprecated: Return type of JDate::format($format, $local = false, $translate = true) should either be compatible with DateTime::format(string $format): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/poliximo/public_html/htm/libraries/joomla/date/date.php on line 275 [27-Jun-2026 13:28:39 UTC] PHP Deprecated: Return type of JDate::setTimezone($tz) should either be compatible with DateTime::setTimezone(DateTimeZone $timezone): DateTime, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/poliximo/public_html/htm/libraries/joomla/date/date.php on line 392 PK���\�E3�1administrator/modules/mod_popular/mod_popular.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the mod_popular functions only once. require_once __DIR__ . '/helper.php'; // Get module data. $list = ModPopularHelper::getList($params); // Render the module require JModuleHelper::getLayoutPath('mod_popular', $params->get('layout', 'default')); PK���\���� � 1administrator/modules/mod_popular/mod_popular.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_popular</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_POPULAR_XML_DESCRIPTION</description> <files> <filename module="mod_popular">mod_popular.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_popular.ini</language> <language tag="en-GB">en-GB.mod_popular.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_POPULAR" /> <config> <fields name="params"> <fieldset name="basic"> <field name="count" type="text" default="5" label="MOD_POPULAR_FIELD_COUNT_LABEL" description="MOD_POPULAR_FIELD_COUNT_DESC" /> <field id="catid" name="catid" type="category" extension="com_content" label="JCATEGORY" description="MOD_POPULAR_FIELD_CATEGORY_DESC" default="" > <option value="">JOPTION_ANY_CATEGORY</option> </field> <field name="user_id" type="list" default="0" label="MOD_POPULAR_FIELD_AUTHORS_LABEL" description="MOD_POPULAR_FIELD_AUTHORS_DESC"> <option value="0">MOD_POPULAR_FIELD_VALUE_ANYONE</option> <option value="by_me">MOD_POPULAR_FIELD_VALUE_ADDED_OR_MODIFIED_BY_ME</option> <option value="not_me">MOD_POPULAR_FIELD_VALUE_NOT_ADDED_OR_MODIFIED_BY_ME</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\�J�Y��2administrator/modules/mod_popular/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); ?> <div class="row-striped"> <?php if (count($list)) : ?> <?php foreach ($list as $i => $item) : ?> <?php // Calculate popular items ?> <?php $hits = (int) $item->hits; ?> <?php $hits_class = ($hits >= 10000 ? 'important' : ($hits >= 1000 ? 'warning' : ($hits >= 100 ? 'info' : ''))); ?> <div class="row-fluid"> <div class="span9"> <span class="badge badge-<?php echo $hits_class; ?> hasTooltip" title="<?php echo JHtml::tooltipText('JGLOBAL_HITS'); ?>"><?php echo $item->hits; ?></span> <?php if ($item->checked_out) : ?> <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time); ?> <?php endif; ?> <strong class="row-title break-word"> <?php if ($item->link) : ?> <a href="<?php echo $item->link; ?>"> <?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?></a> <?php else : ?> <?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?> <?php endif; ?> </strong> </div> <div class="span3"> <span class="small"> <span class="icon-calendar"></span> <?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')); ?> </span> </div> </div> <?php endforeach; ?> <?php else : ?> <div class="row-fluid"> <div class="span12"> <div class="alert"><?php echo JText::_('MOD_POPULAR_NO_MATCHING_RESULTS'); ?></div> </div> </div> <?php endif; ?> </div> PK���\u_�S� � ,administrator/modules/mod_popular/helper.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_popular * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_content/models', 'ContentModel'); /** * Helper for mod_popular * * @since 1.6 */ abstract class ModPopularHelper { /** * Get a list of the most popular articles * * @param JObject &$params The module parameters. * * @return array */ public static function getList(&$params) { $user = JFactory::getuser(); // Get an instance of the generic articles model $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set List SELECT $model->setState('list.select', 'a.id, a.title, a.checked_out, a.checked_out_time, ' . ' a.created, a.hits'); // Set Ordering filter $model->setState('list.ordering', 'a.hits'); $model->setState('list.direction', 'DESC'); // Set Category Filter $categoryId = $params->get('catid'); if (is_numeric($categoryId)) { $model->setState('filter.category_id', $categoryId); } // Set User Filter. $userId = $user->get('id'); switch ($params->get('user_id')) { case 'by_me': $model->setState('filter.author_id', $userId); break; case 'not_me': $model->setState('filter.author_id', $userId); $model->setState('filter.author_id.include', false); break; } // Set the Start and Limit $model->setState('list.start', 0); $model->setState('list.limit', $params->get('count', 5)); $items = $model->getItems(); if ($error = $model->getError()) { JError::raiseError(500, $error); return false; } // Set the links foreach ($items as &$item) { if ($user->authorise('core.edit', 'com_content.article.' . $item->id)) { $item->link = JRoute::_('index.php?option=com_content&task=article.edit&id=' . $item->id); } else { $item->link = ''; } } return $items; } /** * Get the alternate title for the module * * @param JObject $params The module parameters. * * @return string The alternate title for the module. */ public static function getTitle($params) { $who = $params->get('user_id'); $catid = (int) $params->get('catid'); if ($catid) { $category = JCategories::getInstance('Content')->get($catid); if ($category) { $title = $category->title; } else { $title = JText::_('MOD_POPULAR_UNEXISTING'); } } else { $title = ''; } return JText::plural('MOD_POPULAR_TITLE' . ($catid ? "_CATEGORY" : '') . ($who != '0' ? "_$who" : ''), (int) $params->get('count'), $title); } } PK���\ [� +administrator/modules/mod_menu/mod_menu.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the module helper classes. if (!class_exists('ModMenuHelper')) { require __DIR__ . '/helper.php'; } if (!class_exists('JAdminCssMenu')) { require __DIR__ . '/menu.php'; } $lang = JFactory::getLanguage(); $user = JFactory::getUser(); $input = JFactory::getApplication()->input; $menu = new JAdminCSSMenu; $enabled = $input->getBool('hidemainmenu') ? false : true; // Render the module layout require JModuleHelper::getLayoutPath('mod_menu', $params->get('layout', 'default')); PK���\{�eH: : +administrator/modules/mod_menu/mod_menu.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_menu</name> <author>Joomla! Project</author> <creationDate>March 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_MENU_XML_DESCRIPTION</description> <files> <filename module="mod_menu">mod_menu.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> <filename>menu.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_menu.ini</language> <language tag="en-GB">en-GB.mod_menu.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_MENU" /> <config> <fields name="params"> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="shownew" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_MENU_FIELD_SHOWNEW" description="MOD_MENU_FIELD_SHOWNEW_DESC"> <option value="0">JHIDE</option> <option value="1">JSHOW</option> </field> <field name="showhelp" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_MENU_FIELD_SHOWHELP" description="MOD_MENU_FIELD_SHOWHELP_DESC"> <option value="0">JHIDE</option> <option value="1">JSHOW</option> </field> <field name="forum_url" type="url" filter="url" size="30" default="" label="MOD_MENU_FIELD_FORUMURL_LABEL" description="MOD_MENU_FIELD_FORUMURL_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\�En�$�$'administrator/modules/mod_menu/menu.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Tree based class to render the admin menu * * @since 1.5 */ class JAdminCssMenu extends JObject { /** * CSS string to add to document head * * @var string */ protected $_css = null; /** * Root node * * @var object */ protected $_root = null; /** * Current working node * * @var object */ protected $_current = null; /** * Constructor */ public function __construct() { $this->_root = new JMenuNode('ROOT'); $this->_current = & $this->_root; } /** * Method to add a child * * @param JMenuNode &$node The node to process * @param boolean $setCurrent True to set as current working node * * @return void */ public function addChild(JMenuNode &$node, $setCurrent = false) { $this->_current->addChild($node); if ($setCurrent) { $this->_current = &$node; } } /** * Method to get the parent * * @return void */ public function getParent() { $this->_current = &$this->_current->getParent(); } /** * Method to get the parent * * @return void */ public function reset() { $this->_current = &$this->_root; } /** * Method to add a separator node * * @return void */ public function addSeparator() { $this->addChild(new JMenuNode(null, null, 'separator', false)); } /** * Method to render the menu * * @param string $id The id of the menu to be rendered * @param string $class The class of the menu to be rendered * * @return void */ public function renderMenu($id = 'menu', $class = '') { $depth = 1; if (!empty($id)) { $id = 'id="' . $id . '"'; } if (!empty($class)) { $class = 'class="' . $class . '"'; } // Recurse through children if they exist while ($this->_current->hasChildren()) { echo "<ul " . $id . " " . $class . ">\n"; foreach ($this->_current->getChildren() as $child) { $this->_current = & $child; $this->renderLevel($depth++); } echo "</ul>\n"; } if ($this->_css) { // Add style to document head JFactory::getDocument()->addStyleDeclaration($this->_css); } } /** * Method to render a given level of a menu * * @param integer $depth The level of the menu to be rendered * * @return void */ public function renderLevel($depth) { // Build the CSS class suffix $class = ''; if ($this->_current->hasChildren()) { $class = ' class="dropdown"'; } if ($this->_current->class == 'separator') { $class = ' class="divider"'; } if ($this->_current->hasChildren() && $this->_current->class) { $class = ' class="dropdown-submenu"'; } if ($this->_current->class == 'disabled') { $class = ' class="disabled"'; } // Print the item echo "<li" . $class . ">"; // Print a link if it exists $linkClass = array(); $dataToggle = ''; $dropdownCaret = ''; if ($this->_current->hasChildren()) { $linkClass[] = 'dropdown-toggle'; $dataToggle = ' data-toggle="dropdown"'; if (!$this->_current->getParent()->hasParent()) { $dropdownCaret = ' <span class="caret"></span>'; } } if ($this->_current->link != null && $this->_current->getParent()->title != 'ROOT') { $iconClass = $this->getIconClass($this->_current->class); if (!empty($iconClass)) { $linkClass[] = $iconClass; } } // Implode out $linkClass for rendering $linkClass = ' class="' . implode(' ', $linkClass) . '"'; if ($this->_current->link != null && $this->_current->target != null) { echo "<a" . $linkClass . " " . $dataToggle . " href=\"" . $this->_current->link . "\" target=\"" . $this->_current->target . "\" >" . $this->_current->title . $dropdownCaret . "</a>"; } elseif ($this->_current->link != null && $this->_current->target == null) { echo "<a" . $linkClass . " " . $dataToggle . " href=\"" . $this->_current->link . "\">" . $this->_current->title . $dropdownCaret . "</a>"; } elseif ($this->_current->title != null) { echo "<a" . $linkClass . " " . $dataToggle . ">" . $this->_current->title . $dropdownCaret . "</a>"; } else { echo "<span></span>"; } // Recurse through children if they exist while ($this->_current->hasChildren()) { if ($this->_current->class) { $id = ''; if (!empty($this->_current->id)) { $id = ' id="menu-' . strtolower($this->_current->id) . '"'; } echo '<ul' . $id . ' class="dropdown-menu menu-component">' . "\n"; } else { echo '<ul class="dropdown-menu">' . "\n"; } foreach ($this->_current->getChildren() as $child) { $this->_current = & $child; $this->renderLevel($depth++); } echo "</ul>\n"; } echo "</li>\n"; } /** * Method to get the CSS class name for an icon identifier or create one if * a custom image path is passed as the identifier * * @param string $identifier Icon identification string * * @return string CSS class name * * @since 1.5 */ public function getIconClass($identifier) { static $classes; // Initialise the known classes array if it does not exist if (!is_array($classes)) { $classes = array(); } /* * If we don't already know about the class... build it and mark it * known so we don't have to build it again */ if (!isset($classes[$identifier])) { if (substr($identifier, 0, 6) == 'class:') { // We were passed a class name $class = substr($identifier, 6); $classes[$identifier] = "menu-$class"; } else { if ($identifier == null) { return null; } // Build the CSS class for the icon $class = preg_replace('#\.[^.]*$#', '', basename($identifier)); $class = preg_replace('#\.\.[^A-Za-z0-9\.\_\- ]#', '', $class); $this->_css .= "\n.menu-$class {\n" . "\tbackground: url($identifier) no-repeat;\n" . "}\n"; $classes[$identifier] = "menu-$class"; } } return $classes[$identifier]; } } /** * A Node for JAdminCssMenu * * @see JAdminCssMenu * @since 1.5 */ class JMenuNode extends JObject { /** * Node Title * * @var string */ public $title = null; /** * Node Id * * @var string */ public $id = null; /** * Node Link * * @var string */ public $link = null; /** * Link Target * * @var string */ public $target = null; /** * CSS Class for node * * @var string */ public $class = null; /** * Active Node? * * @var boolean */ public $active = false; /** * Parent node * * @var JMenuNode */ protected $_parent = null; /** * Array of Children * * @var array */ protected $_children = array(); /** * Constructor for the class. * * @param string $title The title of the node * @param string $link The node link * @param string $class The CSS class for the node * @param boolean $active True if node is active, false otherwise * @param string $target The link target * @param string $titleicon The title icon for the node */ public function __construct($title, $link = null, $class = null, $active = false, $target = null, $titleicon = null) { $this->title = $titleicon ? $title . $titleicon : $title; $this->link = JFilterOutput::ampReplace($link); $this->class = $class; $this->active = $active; $this->id = null; if (!empty($link) && $link !== '#') { $uri = new JUri($link); $params = $uri->getQuery(true); $parts = array(); foreach ($params as $value) { $parts[] = str_replace(array('.', '_'), '-', $value); } $this->id = implode('-', $parts); } $this->target = $target; } /** * Add child to this node * * If the child already has a parent, the link is unset * * @param JMenuNode &$child The child to be added * * @return void */ public function addChild(JMenuNode &$child) { $child->setParent($this); } /** * Set the parent of a this node * * If the node already has a parent, the link is unset * * @param JMenuNode &$parent The JMenuNode for parent to be set or null * * @return void */ public function setParent(JMenuNode &$parent = null) { $hash = spl_object_hash($this); if (!is_null($this->_parent)) { unset($this->_parent->children[$hash]); } if (!is_null($parent)) { $parent->_children[$hash] = & $this; } $this->_parent = & $parent; } /** * Get the children of this node * * @return array The children */ public function &getChildren() { return $this->_children; } /** * Get the parent of this node * * @return mixed JMenuNode object with the parent or null for no parent */ public function &getParent() { return $this->_parent; } /** * Test if this node has children * * @return boolean True if there are children */ public function hasChildren() { return (bool) count($this->_children); } /** * Test if this node has a parent * * @return boolean True if there is a parent */ public function hasParent() { return $this->getParent() != null; } } PK���\c�v� 8administrator/modules/mod_menu/tmpl/default_disabled.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $showhelp = $params->get('showhelp', 1); /** * Site SubMenu **/ $menu->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), null, 'disabled')); /** * Users Submenu **/ if ($user->authorise('core.manage', 'com_users')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS'), null, 'disabled')); } /** * Menus Submenu **/ if ($user->authorise('core.manage', 'com_menus')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS'), null, 'disabled')); } /** * Content Submenu **/ if ($user->authorise('core.manage', 'com_content')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), null, 'disabled')); } /** * Components Submenu **/ // Get the authorised components and sub-menus. $components = ModMenuHelper::getComponents(true); // Check if there are any components, otherwise, don't display the components menu item if ($components) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), null, 'disabled')); } /** * Extensions Submenu **/ $im = $user->authorise('core.manage', 'com_installer'); $mm = $user->authorise('core.manage', 'com_modules'); $pm = $user->authorise('core.manage', 'com_plugins'); $tm = $user->authorise('core.manage', 'com_templates'); $lm = $user->authorise('core.manage', 'com_languages'); if ($im || $mm || $pm || $tm || $lm) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSIONS'), null, 'disabled')); } /** * Help Submenu **/ if ($showhelp == 1) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), null, 'disabled')); } PK���\Ʉ��.�.7administrator/modules/mod_menu/tmpl/default_enabled.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /* @var $menu JAdminCSSMenu */ $shownew = (boolean) $params->get('shownew', 1); $showhelp = $params->get('showhelp', 1); $user = JFactory::getUser(); $lang = JFactory::getLanguage(); /* * Site Submenu */ $menu->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), '#'), true); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_CONTROL_PANEL'), 'index.php', 'class:cpanel')); if ($user->authorise('core.admin')) { $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_CONFIGURATION'), 'index.php?option=com_config', 'class:config')); } if ($user->authorise('core.manage', 'com_checkin')) { $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_GLOBAL_CHECKIN'), 'index.php?option=com_checkin', 'class:checkin')); } if ($user->authorise('core.manage', 'com_cache')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_CLEAR_CACHE'), 'index.php?option=com_cache', 'class:clear')); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_PURGE_EXPIRED_CACHE'), 'index.php?option=com_cache&view=purge', 'class:purge')); } if ($user->authorise('core.admin')) { $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM_INFORMATION'), 'index.php?option=com_admin&view=sysinfo', 'class:info')); } $menu->getParent(); /* * Users Submenu */ if ($user->authorise('core.manage', 'com_users')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_USERS'), '#'), true); $createUser = $shownew && $user->authorise('core.create', 'com_users'); $createGrp = $user->authorise('core.admin', 'com_users'); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_USER_MANAGER'), 'index.php?option=com_users&view=users', 'class:user'), $createUser); if ($createUser) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_USER'), 'index.php?option=com_users&task=user.add', 'class:newarticle')); $menu->getParent(); } if ($createGrp) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_GROUPS'), 'index.php?option=com_users&view=groups', 'class:groups'), $createUser); if ($createUser) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_GROUP'), 'index.php?option=com_users&task=group.add', 'class:newarticle')); $menu->getParent(); } $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_LEVELS'), 'index.php?option=com_users&view=levels', 'class:levels'), $createUser); if ($createUser) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_LEVEL'), 'index.php?option=com_users&task=level.add', 'class:newarticle')); $menu->getParent(); } } $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_NOTES'), 'index.php?option=com_users&view=notes', 'class:user-note'), $createUser); if ($createUser) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS_ADD_NOTE'), 'index.php?option=com_users&task=note.add', 'class:newarticle')); $menu->getParent(); } $menu->addChild( new JMenuNode( JText::_('MOD_MENU_COM_USERS_NOTE_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_users', 'class:category'), $createUser ); if ($createUser) { $menu->addChild( new JMenuNode( JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), 'index.php?option=com_categories&task=category.add&extension=com_users', 'class:newarticle' ) ); $menu->getParent(); } if (JFactory::getApplication()->get('massmailoff') != 1) { $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MASS_MAIL_USERS'), 'index.php?option=com_users&view=mail', 'class:massmail')); } $menu->getParent(); } /* * Menus Submenu */ if ($user->authorise('core.manage', 'com_menus')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS'), '#'), true); $createMenu = $shownew && $user->authorise('core.create', 'com_menus'); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER'), 'index.php?option=com_menus&view=menus', 'class:menumgr'), $createMenu); if ($createMenu) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU'), 'index.php?option=com_menus&view=menu&layout=edit', 'class:newarticle')); $menu->getParent(); } $menu->addSeparator(); // Menu Types $menuTypes = ModMenuHelper::getMenus(); $menuTypes = JArrayHelper::sortObjects($menuTypes, 'title', 1, false); foreach ($menuTypes as $menuType) { $alt = '*' . $menuType->sef . '*'; if ($menuType->home == 0) { $titleicon = ''; } elseif ($menuType->home == 1 && $menuType->language == '*') { $titleicon = ' <span class="icon-home"></span>'; } elseif ($menuType->home > 1) { $titleicon = ' <span>' . JHtml::_('image', 'mod_languages/icon-16-language.png', $menuType->home, array('title' => JText::_('MOD_MENU_HOME_MULTIPLE')), true) . '</span>'; } else { $image = JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', null, null, true, true); if (!$image) { $image = JHtml::_('image', 'mod_languages/icon-16-language.png', $alt, array('title' => $menuType->title_native), true); } else { $image = JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', $alt, array('title' => $menuType->title_native), true); } $titleicon = ' <span>' . $image . '</span>'; } $menu->addChild( new JMenuNode( $menuType->title, 'index.php?option=com_menus&view=items&menutype=' . $menuType->menutype, 'class:menu', null, null, $titleicon ), $createMenu ); if ($createMenu) { $menu->addChild( new JMenuNode( JText::_('MOD_MENU_MENU_MANAGER_NEW_MENU_ITEM'), 'index.php?option=com_menus&view=item&layout=edit&menutype=' . $menuType->menutype, 'class:newarticle') ); $menu->getParent(); } } $menu->getParent(); } /* * Content Submenu */ if ($user->authorise('core.manage', 'com_content')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), '#'), true); $createContent = $shownew && $user->authorise('core.create', 'com_content'); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_ARTICLE_MANAGER'), 'index.php?option=com_content', 'class:article'), $createContent); if ($createContent) { $menu->addChild( new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_ARTICLE'), 'index.php?option=com_content&task=article.add', 'class:newarticle') ); $menu->getParent(); } $menu->addChild( new JMenuNode( JText::_('MOD_MENU_COM_CONTENT_CATEGORY_MANAGER'), 'index.php?option=com_categories&extension=com_content', 'class:category'), $createContent ); if ($createContent) { $menu->addChild( new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_NEW_CATEGORY'), 'index.php?option=com_categories&task=category.add&extension=com_content', 'class:newarticle') ); $menu->getParent(); } $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_FEATURED'), 'index.php?option=com_content&view=featured', 'class:featured')); if ($user->authorise('core.manage', 'com_media')) { $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MEDIA_MANAGER'), 'index.php?option=com_media', 'class:media')); } $menu->getParent(); } /* * Components Submenu */ // Get the authorised components and sub-menus. $components = ModMenuHelper::getComponents(true); // Check if there are any components, otherwise, don't render the menu if ($components) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COMPONENTS'), '#'), true); foreach ($components as &$component) { if (!empty($component->submenu)) { // This component has a db driven submenu. $menu->addChild(new JMenuNode($component->text, $component->link, $component->img), true); foreach ($component->submenu as $sub) { $menu->addChild(new JMenuNode($sub->text, $sub->link, $sub->img)); } $menu->getParent(); } else { $menu->addChild(new JMenuNode($component->text, $component->link, $component->img)); } } $menu->getParent(); } /* * Extensions Submenu */ $im = $user->authorise('core.manage', 'com_installer'); $mm = $user->authorise('core.manage', 'com_modules'); $pm = $user->authorise('core.manage', 'com_plugins'); $tm = $user->authorise('core.manage', 'com_templates'); $lm = $user->authorise('core.manage', 'com_languages'); if ($im || $mm || $pm || $tm || $lm) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSIONS'), '#'), true); if ($im) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_EXTENSION_MANAGER'), 'index.php?option=com_installer', 'class:install')); } if ($im && ($mm || $pm || $tm || $lm)) { $menu->addSeparator(); } if ($mm) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_MODULE_MANAGER'), 'index.php?option=com_modules', 'class:module')); } if ($pm) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_PLUGIN_MANAGER'), 'index.php?option=com_plugins', 'class:plugin')); } if ($tm) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_TEMPLATE_MANAGER'), 'index.php?option=com_templates', 'class:themes')); } if ($lm) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_EXTENSIONS_LANGUAGE_MANAGER'), 'index.php?option=com_languages', 'class:language')); } $menu->getParent(); } /* * Help Submenu */ if ($showhelp == 1) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), '#'), true); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_JOOMLA'), 'index.php?option=com_admin&view=help', 'class:help')); $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM'), 'http://forum.joomla.org', 'class:help-forum', false, '_blank')); if ($forum_url = $params->get('forum_url')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM'), $forum_url, 'class:help-forum', false, '_blank')); } $debug = $lang->setDebug(false); if ($lang->hasKey('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') && JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') != '') { $forum_url = 'http://forum.joomla.org/viewforum.php?f=' . (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE'); $lang->setDebug($debug); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM'), $forum_url, 'class:help-forum', false, '_blank')); } $lang->setDebug($debug); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_DOCUMENTATION'), 'https://docs.joomla.org', 'class:help-docs', false, '_blank')); $menu->addSeparator(); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_EXTENSIONS'), 'http://extensions.joomla.org', 'class:help-jed', false, '_blank')); $menu->addChild( new JMenuNode(JText::_('MOD_MENU_HELP_TRANSLATIONS'), 'http://community.joomla.org/translations.html', 'class:help-trans', false, '_blank') ); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_RESOURCES'), 'http://resources.joomla.org', 'class:help-jrd', false, '_blank')); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_COMMUNITY'), 'http://community.joomla.org', 'class:help-community', false, '_blank')); $menu->addChild( new JMenuNode(JText::_('MOD_MENU_HELP_SECURITY'), 'http://developer.joomla.org/security-centre.html', 'class:help-security', false, '_blank') ); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_DEVELOPER'), 'http://developer.joomla.org', 'class:help-dev', false, '_blank')); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_XCHANGE'), 'http://joomla.stackexchange.com', 'class:help-dev', false, '_blank')); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SHOP'), 'http://shop.joomla.org', 'class:help-shop', false, '_blank')); $menu->getParent(); } PK���\�B��88/administrator/modules/mod_menu/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $document = JFactory::getDocument(); $direction = $document->direction == 'rtl' ? 'pull-right' : ''; require JModuleHelper::getLayoutPath('mod_menu', $enabled ? 'default_enabled' : 'default_disabled'); $menu->renderMenu('menu', $enabled ? 'nav ' . $direction : 'nav disabled ' . $direction); PK���\,����)administrator/modules/mod_menu/helper.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_menu * * @since 1.5 */ abstract class ModMenuHelper { /** * Get a list of the available menus. * * @return array An array of the available menus (from the menu types table). * * @since 1.6 */ public static function getMenus() { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.*, SUM(b.home) AS home') ->from('#__menu_types AS a') ->join('LEFT', '#__menu AS b ON b.menutype = a.menutype AND b.home != 0') ->select('b.language') ->join('LEFT', '#__languages AS l ON l.lang_code = language') ->select('l.image') ->select('l.sef') ->select('l.title_native') ->where('(b.client_id = 0 OR b.client_id IS NULL)'); // Sqlsrv change $query->group('a.id, a.menutype, a.description, a.title, b.menutype,b.language,l.image,l.sef,l.title_native'); $db->setQuery($query); try { $result = $db->loadObjectList(); } catch (RuntimeException $e) { $result = array(); JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } return $result; } /** * Get a list of the authorised, non-special components to display in the components menu. * * @param boolean $authCheck An optional switch to turn off the auth check (to support custom layouts 'grey out' behaviour). * * @return array A nest array of component objects and submenus * * @since 1.6 */ public static function getComponents($authCheck = true) { $lang = JFactory::getLanguage(); $user = JFactory::getUser(); $db = JFactory::getDbo(); $query = $db->getQuery(true); $result = array(); // Prepare the query. $query->select('m.id, m.title, m.alias, m.link, m.parent_id, m.img, e.element') ->from('#__menu AS m'); // Filter on the enabled states. $query->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id') ->where('m.client_id = 1') ->where('e.enabled = 1') ->where('m.id > 1'); // Order by lft. $query->order('m.lft'); $db->setQuery($query); // Component list try { $components = $db->loadObjectList(); } catch (RuntimeException $e) { $components = array(); JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); } // Parse the list of extensions. foreach ($components as &$component) { // Trim the menu link. $component->link = trim($component->link); if ($component->parent_id == 1) { // Only add this top level if it is authorised and enabled. if ($authCheck == false || ($authCheck && $user->authorise('core.manage', $component->element))) { // Root level. $result[$component->id] = $component; if (!isset($result[$component->id]->submenu)) { $result[$component->id]->submenu = array(); } // If the root menu link is empty, add it in. if (empty($component->link)) { $component->link = 'index.php?option=' . $component->element; } if (!empty($component->element)) { // Load the core file then // Load extension-local file. $lang->load($component->element . '.sys', JPATH_BASE, null, false, true) || $lang->load($component->element . '.sys', JPATH_ADMINISTRATOR . '/components/' . $component->element, null, false, true); } $component->text = $lang->hasKey($component->title) ? JText::_($component->title) : $component->alias; } } else { // Sub-menu level. if (isset($result[$component->parent_id])) { // Add the submenu link if it is defined. if (isset($result[$component->parent_id]->submenu) && !empty($component->link)) { $component->text = $lang->hasKey($component->title) ? JText::_($component->title) : $component->alias; $result[$component->parent_id]->submenu[] = &$component; } } } } $result = JArrayHelper::sortObjects($result, 'text', 1, false, true); return $result; } } PK���\^b[���/administrator/modules/mod_logged/mod_logged.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_logged * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include dependencies. require_once __DIR__ . '/helper.php'; $users = ModLoggedHelper::getList($params); require JModuleHelper::getLayoutPath('mod_logged', $params->get('layout', 'default')); PK���\S�RI��/administrator/modules/mod_logged/mod_logged.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_logged</name> <author>Joomla! Project</author> <creationDate>January 2005</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_LOGGED_XML_DESCRIPTION</description> <files> <filename module="mod_logged">mod_logged.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_logged.ini</language> <language tag="en-GB">en-GB.mod_logged.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_LOGGED" /> <config> <fields name="params"> <fieldset name="basic"> <field name="count" type="text" default="5" label="MOD_LOGGED_FIELD_COUNT_LABEL" description="MOD_LOGGED_FIELD_COUNT_DESC" /> <field name="name" type="list" default="1" label="MOD_LOGGED_NAME" description="MOD_LOGGED_FIELD_NAME_DESC" > <option value="1">MOD_LOGGED_NAME</option> <option value="0">JGLOBAL_USERNAME</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\ʧ깩�1administrator/modules/mod_logged/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_logged * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); ?> <div class="row-striped"> <?php foreach ($users as $user) : ?> <div class="row-fluid"> <div class="span9"> <?php if ($user->client_id == 0) : ?> <a class="hasTooltip" title="<?php echo JHtml::tooltipText('MOD_LOGGED_LOGOUT'); ?>" href="<?php echo $user->logoutLink; ?>" class="btn btn-danger btn-mini"> <span class="icon-remove icon-white" title="<?php echo JText::_('JLOGOUT'); ?>"></span> </a> <?php endif; ?> <strong class="row-title"> <?php if (isset($user->editLink)) : ?> <a href="<?php echo $user->editLink; ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('JGRID_HEADING_ID'); ?> : <?php echo $user->id; ?>"> <?php echo $user->name; ?> </a> <?php else : ?> <?php echo $user->name; ?> <?php endif; ?> </strong> <small class="small hasTooltip" title="<?php echo JHtml::tooltipText('JCLIENT'); ?>"> <?php if ($user->client_id) : ?> <?php echo JText::_('JADMINISTRATION'); ?> <?php else : ?> <?php echo JText::_('JSITE'); ?> <?php endif; ?> </small> </div> <div class="span3"> <span class="small hasTooltip" title="<?php echo JHtml::tooltipText('MOD_LOGGED_LAST_ACTIVITY'); ?>"> <span class="icon-calendar"></span> <?php echo JHtml::_('date', $user->time, JText::_('DATE_FORMAT_LC2')); ?> </span> </div> </div> <?php endforeach; ?> </div> PK���\���5JJ+administrator/modules/mod_logged/helper.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_logged * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_logged * * @since 1.5 */ abstract class ModLoggedHelper { /** * Get a list of logged users. * * @param \Joomla\Registry\Registry &$params The module parameters. * * @return mixed An array of users, or false on error. * * @throws RuntimeException */ public static function getList(&$params) { $db = JFactory::getDbo(); $user = JFactory::getUser(); $query = $db->getQuery(true) ->select('s.time, s.client_id, u.id, u.name, u.username') ->from('#__session AS s') ->join('LEFT', '#__users AS u ON s.userid = u.id') ->where('s.guest = 0'); $db->setQuery($query, 0, $params->get('count', 5)); try { $results = $db->loadObjectList(); } catch (RuntimeException $e) { throw $e; } foreach ($results as $k => $result) { $results[$k]->logoutLink = ''; if ($user->authorise('core.manage', 'com_users')) { $results[$k]->editLink = JRoute::_('index.php?option=com_users&task=user.edit&id=' . $result->id); $results[$k]->logoutLink = JRoute::_('index.php?option=com_login&task=logout&uid=' . $result->id . '&' . JSession::getFormToken() . '=1'); } if ($params->get('name', 1) == 0) { $results[$k]->name = $results[$k]->username; } } return $results; } /** * Get the alternate title for the module * * @param \Joomla\Registry\Registry $params The module parameters. * * @return string The alternate title for the module. */ public static function getTitle($params) { return JText::plural('MOD_LOGGED_TITLE', $params->get('count')); } } PK���\�+xx2administrator/modules/mod_version/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_version * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php if (!empty($version)) : ?> <p align="center"><?php echo $version; ?></p> <?php endif; ?> PK���\�TNN,administrator/modules/mod_version/helper.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_version * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_version * * @since 1.6 */ abstract class ModVersionHelper { /** * Get the member items of the submenu. * * @param \Joomla\Registry\Registry &$params The parameters object. * * @return string String containing the current Joomla version based on the selected format. */ public static function getVersion(&$params) { $format = $params->get('format', 'short'); $product = $params->get('product', 0); $method = 'get' . ucfirst($format) . "Version"; // Get the joomla version $instance = new JVersion; $version = call_user_func(array($instance, $method)); if ($format == 'short' && !empty($product)) { // Add the product name to short format only (in long format it's included) $version = $instance->PRODUCT . ' ' . $version; } return $version; } } PK���\#� yyFadministrator/modules/mod_version/language/en-GB/en-GB.mod_version.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_VERSION="Joomla! Version Information" MOD_VERSION_FORMAT_DESC="The long version includes code name and date." MOD_VERSION_FORMAT_LABEL="Version Format" MOD_VERSION_FORMAT_LONG="Long" MOD_VERSION_FORMAT_SHORT="Short" MOD_VERSION_PRODUCT_DESC="Include Joomla! name when using short format." MOD_VERSION_PRODUCT_LABEL="Show Joomla!" MOD_VERSION_XML_DESCRIPTION="This module displays the Joomla! version."PK���\��;{{Jadministrator/modules/mod_version/language/en-GB/en-GB.mod_version.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_VERSION="Joomla! Version Information" MOD_VERSION_LAYOUT_DEFAULT="Default" MOD_VERSION_XML_DESCRIPTION="This module displays the Joomla! version." PK���\!����1administrator/modules/mod_version/mod_version.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_version</name> <author>Joomla! Project</author> <creationDate>January 2012</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_VERSION_XML_DESCRIPTION</description> <files> <filename module="mod_version">mod_version.php</filename> <folder>language</folder> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">language/en-GB/en-GB.mod_version.ini</language> <language tag="en-GB">language/en-GB/en-GB.mod_version.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_VERSION" /> <config> <fields name="params"> <fieldset name="basic"> <field name="format" type="list" default="short" label="MOD_VERSION_FORMAT_LABEL" description="MOD_VERSION_FORMAT_DESC"> <option value="short">MOD_VERSION_FORMAT_SHORT</option> <option value="long">MOD_VERSION_FORMAT_LONG</option> </field> <field name="product" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_VERSION_PRODUCT_LABEL" description="MOD_VERSION_PRODUCT_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\�����1administrator/modules/mod_version/mod_version.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_version * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once __DIR__ . '/helper.php'; $version = ModVersionHelper::getVersion($params); require JModuleHelper::getLayoutPath('mod_version', $params->get('layout', 'default')); PK���\rW����1administrator/modules/mod_status/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_status * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $hideLinks = $input->getBool('hidemainmenu'); $task = $input->getCmd('task'); $output = array(); // Print the Preview link to Main site. if ($params->get('show_viewsite', 1)) { $output[] = '<div class="btn-group viewsite">' . '<a href="' . JUri::root() . '" target="_blank">' . '<span class="icon-out-2"></span> ' . JText::_('JGLOBAL_VIEW_SITE') . '</a>' . '</div>' . '<div class="btn-group divider"></div>'; } // Print the frontend logged in users. if ($params->get('show_loggedin_users', 1)) { $output[] = '<div class="btn-group loggedin-users">' . '<span class="badge">' . $online_num . '</span> ' . JText::plural('MOD_STATUS_USERS', $online_num) . '</div>'; } // Print the back-end logged in users. if ($params->get('show_loggedin_users_admin', 1)) { $output[] = '<div class="btn-group backloggedin-users">' . '<span class="badge">' . $count . '</span> ' . JText::plural('MOD_STATUS_BACKEND_USERS', $count) . '</div>'; } // Print the inbox message. if ($params->get('show_messages', 1)) { $active = $unread ? ' badge-warning' : ''; $output[] = '<div class="btn-group hasTooltip ' . $inboxClass . '"' . ' title="' . JText::plural('MOD_STATUS_MESSAGES', $unread) . '">' . ($hideLinks ? '' : '<a href="' . $inboxLink . '">') . '<span class="icon-envelope"></span> ' . '<span class="badge' . $active . '">' . $unread . '</span>' . ($hideLinks ? '' : '</a>') . '<div class="btn-group divider"></div>' . '</div>'; } // Print the logout link. if ($task == 'edit' || $task == 'editA' || $input->getInt('hidemainmenu')) { $logoutLink = ''; } else { $logoutLink = JRoute::_('index.php?option=com_login&task=logout&' . JSession::getFormToken() . '=1'); } if ($params->get('show_logout', 1)) { $output[] = '<div class="btn-group logout">' . ($hideLinks ? '' : '<a href="' . $logoutLink . '">') . '<span class="icon-minus-2"></span> ' . JText::_('JLOGOUT') . ($hideLinks ? '' : '</a>') . '</div>'; } // Output the items. foreach ($output as $item) { echo $item; } PK���\1+�W� � /administrator/modules/mod_status/mod_status.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_status</name> <author>Joomla! Project</author> <creationDate>Feb 2006</creationDate> <copyright>(C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_STATUS_XML_DESCRIPTION</description> <files> <filename module="mod_status">mod_status.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_status.ini</language> <language tag="en-GB">en-GB.mod_status.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_STATUS" /> <config> <fields name="params"> <fieldset name="basic"> <field name="show_loggedin_users" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_LABEL" description="MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="show_loggedin_users_admin" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_ADMIN_LABEL" description="MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_ADMIN_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="show_messages" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_STATUS_FIELD_SHOW_MESSAGES_LABEL" description="MOD_STATUS_FIELD_SHOW_MESSAGES_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\/p�}��/administrator/modules/mod_status/mod_status.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_status * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $config = JFactory::getConfig(); $user = JFactory::getUser(); $db = JFactory::getDbo(); $lang = JFactory::getLanguage(); $input = JFactory::getApplication()->input; // Get the number of unread messages in your inbox. $query = $db->getQuery(true) ->select('COUNT(*)') ->from('#__messages') ->where('state = 0 AND user_id_to = ' . (int) $user->get('id')); $db->setQuery($query); $unread = (int) $db->loadResult(); // Get the number of back-end logged in users. $query->clear() ->select('COUNT(session_id)') ->from('#__session') ->where('guest = 0 AND client_id = 1'); $db->setQuery($query); $count = (int) $db->loadResult(); // Set the inbox link. if ($input->getBool('hidemainmenu')) { $inboxLink = ''; } else { $inboxLink = JRoute::_('index.php?option=com_messages'); } // Set the inbox class. if ($unread) { $inboxClass = 'unread-messages'; } else { $inboxClass = 'no-unread-messages'; } // Get the number of frontend logged in users. $query->clear() ->select('COUNT(session_id)') ->from('#__session') ->where('guest = 0 AND client_id = 0'); $db->setQuery($query); $online_num = (int) $db->loadResult(); require JModuleHelper::getLayoutPath('mod_status', $params->get('layout', 'default')); PK���\I�����9administrator/modules/mod_stats_admin/mod_stats_admin.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_stats * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $serverinfo = $params->get('serverinfo'); $siteinfo = $params->get('siteinfo'); $list = ModStatsHelper::getStats($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_stats_admin', $params->get('layout', 'default')); PK���\e�>>6administrator/modules/mod_stats_admin/tmpl/default.phpnu�[���<?php /** * @package Joomla.Site * @subpackage mod_stats * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <ul class="list-striped list-condensed stats-module<?php echo $moduleclass_sfx ?>"> <?php foreach ($list as $item) : ?> <li><span class="icon-<?php echo $item->icon; ?>" title="<?php echo $item->title; ?>"></span> <?php echo $item->title; ?> <?php echo $item->data; ?></li> <?php endforeach; ?> </ul> PK���\�U�*]]0administrator/modules/mod_stats_admin/helper.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_stats_admin * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper class for admin stats module * * @since 3.0 */ class ModStatsHelper { /** * Method to retrieve information about the site * * @param JObject &$params Params object * * @return array Array containing site information * * @since 3.0 */ public static function getStats(&$params) { $app = JFactory::getApplication(); $db = JFactory::getDbo(); $rows = array(); $query = $db->getQuery(true); $serverinfo = $params->get('serverinfo'); $siteinfo = $params->get('siteinfo'); $counter = $params->get('counter'); $increase = $params->get('increase'); $i = 0; if ($serverinfo) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_OS'); $rows[$i]->icon = 'screen'; $rows[$i]->data = substr(php_uname(), 0, 7); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_PHP'); $rows[$i]->icon = 'cogs'; $rows[$i]->data = phpversion(); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_($db->name); $rows[$i]->icon = 'database'; $rows[$i]->data = $db->getVersion(); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_TIME'); $rows[$i]->icon = 'clock'; $rows[$i]->data = JHtml::_('date', 'now', 'H:i'); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_CACHING'); $rows[$i]->icon = 'dashboard'; $rows[$i]->data = $app->get('caching') ? JText::_('JENABLED') : JText::_('JDISABLED'); $i++; $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_GZIP'); $rows[$i]->icon = 'lightning'; $rows[$i]->data = $app->get('gzip') ? JText::_('JENABLED') : JText::_('JDISABLED'); $i++; } if ($siteinfo) { $query->select('COUNT(id) AS count_users') ->from('#__users'); $db->setQuery($query); try { $users = $db->loadResult(); } catch (RuntimeException $e) { $users = false; } $query->clear() ->select('COUNT(id) AS count_items') ->from('#__content') ->where('state = 1'); $db->setQuery($query); try { $items = $db->loadResult(); } catch (RuntimeException $e) { $items = false; } if ($users) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_USERS'); $rows[$i]->icon = 'users'; $rows[$i]->data = $users; $i++; } if ($items) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_ARTICLES'); $rows[$i]->icon = 'file'; $rows[$i]->data = $items; $i++; } if (JComponentHelper::isInstalled('com_weblinks')) { $query->clear() ->select('COUNT(id) AS count_links') ->from('#__weblinks') ->where('state = 1'); $db->setQuery($query); try { $links = $db->loadResult(); } catch (RuntimeException $e) { $links = false; } if ($links) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_WEBLINKS'); $rows[$i]->icon = 'out-2'; $rows[$i]->data = $links; $i++; } } } if ($counter) { $query->clear() ->select('SUM(hits) AS count_hits') ->from('#__content') ->where('state = 1'); $db->setQuery($query); try { $hits = $db->loadResult(); } catch (RuntimeException $e) { $hits = false; } if ($hits) { $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_ARTICLES_VIEW_HITS'); $rows[$i]->icon = 'eye'; $rows[$i]->data = $hits + $increase; } } return $rows; } } PK���\���m��Hadministrator/modules/mod_stats_admin/language/en-GB.mod_stats_admin.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_STATS_ADMIN="Statistics" MOD_STATS_ARTICLES="Articles" MOD_STATS_ARTICLES_VIEW_HITS="Articles View Hits" MOD_STATS_CACHING="Caching" MOD_STATS_FIELD_COUNTER_DESC="Display hit counter." MOD_STATS_FIELD_COUNTER_LABEL="Hit Counter" MOD_STATS_FIELD_INCREASECOUNTER_DESC="Enter the number of hits to increase the counter by." MOD_STATS_FIELD_INCREASECOUNTER_LABEL="Increase Counter" MOD_STATS_FIELD_SERVERINFO_DESC="Display server information." MOD_STATS_FIELD_SERVERINFO_LABEL="Server Information" MOD_STATS_FIELD_SITEINFO_DESC="Display site information." MOD_STATS_FIELD_SITEINFO_LABEL="Site Information" MOD_STATS_GZIP="GZip" MOD_STATS_OS="OS" MOD_STATS_PHP="PHP" MOD_STATS_TIME="Time" MOD_STATS_USERS="Users" MOD_STATS_WEBLINKS="Web Links" MOD_STATS_XML_DESCRIPTION="The Statistics Module shows information about your server installation together with statistics on the website users, number of Articles in your database and the number of Web links you provide." PK���\��\�Ladministrator/modules/mod_stats_admin/language/en-GB.mod_stats_admin.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_STATS_ADMIN="Statistics" MOD_STATS_XML_DESCRIPTION="The Statistics Module shows information about your server installation together with statistics on the website users, number of Articles in your database and the number of Web links you provide." MOD_STATS_LAYOUT_DEFAULT="Default" PK���\��� 9administrator/modules/mod_stats_admin/mod_stats_admin.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_stats_admin</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_STATS_XML_DESCRIPTION</description> <files> <filename module="mod_stats_admin">mod_stats_admin.php</filename> <folder>tmpl</folder> <folder>language</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_stats.ini</language> <language tag="en-GB">en-GB.mod_stats.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_STATISTICS" /> <config> <fields name="params"> <fieldset name="basic"> <field name="serverinfo" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_STATS_FIELD_SERVERINFO_LABEL" description="MOD_STATS_FIELD_SERVERINFO_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="siteinfo" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_STATS_FIELD_SITEINFO_LABEL" description="MOD_STATS_FIELD_SITEINFO_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="counter" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_STATS_FIELD_COUNTER_LABEL" description="MOD_STATS_FIELD_COUNTER_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="increase" type="text" default="0" label="MOD_STATS_FIELD_INCREASECOUNTER_LABEL" description="MOD_STATS_FIELD_INCREASECOUNTER_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static"> <option value="static"></option> </field> </fieldset> </fields> </config> </extension> PK���\�jJ{{-administrator/modules/mod_login/mod_login.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_login</name> <author>Joomla! Project</author> <creationDate>March 2005</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_LOGIN_XML_DESCRIPTION</description> <files> <filename module="mod_login">mod_login.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_login.ini</language> <language tag="en-GB">en-GB.mod_login.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_LOGIN" /> <config> <fields name="params"> <fieldset name="basic"> <field name="usesecure" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_LOGIN_FIELD_USESECURE_LABEL" description="MOD_LOGIN_FIELD_USESECURE_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\\{!�}}0administrator/modules/mod_login/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_login * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('behavior.keepalive'); JHtml::_('bootstrap.tooltip'); JHtml::_('formbehavior.chosen'); ?> <form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" id="form-login" class="form-inline"> <fieldset class="loginform"> <div class="control-group"> <div class="controls"> <div class="input-prepend input-append"> <span class="add-on"> <span class="icon-user hasTooltip" title="<?php echo JText::_('JGLOBAL_USERNAME'); ?>"></span> <label for="mod-login-username" class="element-invisible"> <?php echo JText::_('JGLOBAL_USERNAME'); ?> </label> </span> <input name="username" tabindex="1" id="mod-login-username" type="text" class="input-medium" placeholder="<?php echo JText::_('JGLOBAL_USERNAME'); ?>" size="15" autofocus="true" /> <a href="<?php echo JUri::root(); ?>index.php?option=com_users&view=remind" class="btn width-auto hasTooltip" title="<?php echo JText::_('MOD_LOGIN_REMIND'); ?>"> <span class="icon-help"></span> </a> </div> </div> </div> <div class="control-group"> <div class="controls"> <div class="input-prepend input-append"> <span class="add-on"> <span class="icon-lock hasTooltip" title="<?php echo JText::_('JGLOBAL_PASSWORD'); ?>"></span> <label for="mod-login-password" class="element-invisible"> <?php echo JText::_('JGLOBAL_PASSWORD'); ?> </label> </span> <input name="passwd" tabindex="2" id="mod-login-password" type="password" class="input-medium" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD'); ?>" size="15"/> <a href="<?php echo JUri::root(); ?>index.php?option=com_users&view=reset" class="btn width-auto hasTooltip" title="<?php echo JText::_('MOD_LOGIN_RESET'); ?>"> <span class="icon-help"></span> </a> </div> </div> </div> <?php if (count($twofactormethods) > 1): ?> <div class="control-group"> <div class="controls"> <div class="input-prepend input-append"> <span class="add-on"> <span class="icon-star hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY'); ?>"></span> <label for="mod-login-secretkey" class="element-invisible"> <?php echo JText::_('JGLOBAL_SECRETKEY'); ?> </label> </span> <input name="secretkey" autocomplete="off" tabindex="3" id="mod-login-secretkey" type="text" class="input-medium" placeholder="<?php echo JText::_('JGLOBAL_SECRETKEY'); ?>" size="15"/> <span class="btn width-auto hasTooltip" title="<?php echo JText::_('JGLOBAL_SECRETKEY_HELP'); ?>"> <span class="icon-help"></span> </span> </div> </div> </div> <?php endif; ?> <?php if (!empty($langs)) : ?> <div class="control-group"> <div class="controls"> <div class="input-prepend"> <span class="add-on"> <span class="icon-comment hasTooltip" title="<?php echo JHtml::tooltipText('MOD_LOGIN_LANGUAGE'); ?>"></span> <label for="lang" class="element-invisible"> <?php echo JText::_('MOD_LOGIN_LANGUAGE'); ?> </label> </span> <?php echo $langs; ?> </div> </div> </div> <?php endif; ?> <div class="control-group"> <div class="controls"> <div class="btn-group"> <button tabindex="3" class="btn btn-primary btn-block btn-large"> <span class="icon-lock icon-white"></span> <?php echo JText::_('MOD_LOGIN_LOGIN'); ?> </button> </div> </div> </div> <input type="hidden" name="option" value="com_login"/> <input type="hidden" name="task" value="login"/> <input type="hidden" name="return" value="<?php echo $return; ?>"/> <?php echo JHtml::_('form.token'); ?> </fieldset> </form> PK���\�j~�*administrator/modules/mod_login/helper.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_login * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_login * * @since 1.6 */ abstract class ModLoginHelper { /** * Get an HTML select list of the available languages. * * @return string */ public static function getLanguageList() { $languages = JLanguageHelper::createLanguageList(null, JPATH_ADMINISTRATOR, false, true); if (count($languages) <= 1) { return ''; } usort( $languages, function ($a, $b) { return strcmp($a["value"], $b["value"]); } ); // Fix wrongly set parentheses in RTL languages if (JFactory::getLanguage()->isRtl()) { foreach ($languages as &$language) { $language['text'] = $language['text'] . '‎'; } } array_unshift($languages, JHtml::_('select.option', '', JText::_('JDEFAULTLANGUAGE'))); return JHtml::_('select.genericlist', $languages, 'lang', ' class="advancedSelect"', 'value', 'text', null); } /** * Get the redirect URI after login. * * @return string */ public static function getReturnUri() { $uri = JUri::getInstance(); $return = 'index.php' . $uri->toString(array('query')); if ($return != 'index.php?option=com_login') { return base64_encode($return); } else { return base64_encode('index.php'); } } /** * Creates a list of two factor authentication methods used in com_users * on user view * * @return array */ public static function getTwoFactorMethods() { require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; return UsersHelper::getTwoFactorMethods(); } } PK���\)��ee-administrator/modules/mod_login/mod_login.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_login * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $langs = ModLoginHelper::getLanguageList(); $twofactormethods = ModLoginHelper::getTwoFactorMethods(); $return = ModLoginHelper::getReturnUri(); require JModuleHelper::getLayoutPath('mod_login', $params->get('layout', 'default')); PK���\�e��''2administrator/modules/mod_submenu/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_submenu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div id="sidebar"> <div class="sidebar-nav"> <?php if ($displayMenu) : ?> <ul id="submenu" class="nav nav-list"> <?php foreach ($list as $item) : ?> <?php if (isset ($item[2]) && $item[2] == 1) : ?> <li class="active"> <?php else : ?> <li> <?php endif; ?> <?php if ($hide) : ?> <a class="nolink"><?php echo $item[0]; ?></a> <?php else : ?> <?php if (strlen($item[1])) : ?> <a href="<?php echo JFilterOutput::ampReplace($item[1]); ?>"><?php echo $item[0]; ?></a> <?php else : ?> <?php echo $item[0]; ?> <?php endif; ?> <?php endif; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> <?php if ($displayMenu && $displayFilters) : ?> <hr /> <?php endif; ?> <?php if ($displayFilters) : ?> <div class="filter-select hidden-phone"> <h4 class="page-header"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></h4> <form action="<?php echo JRoute::_($action); ?>" method="post"> <?php foreach ($filters as $filter) : ?> <label for="<?php echo $filter['name']; ?>" class="element-invisible"><?php echo $filter['label']; ?></label> <select name="<?php echo $filter['name']; ?>" id="<?php echo $filter['name']; ?>" class="span12 small" onchange="this.form.submit()"> <?php if (!$filter['noDefault']) : ?> <option value=""><?php echo $filter['label']; ?></option> <?php endif; ?> <?php echo $filter['options']; ?> </select> <hr class="hr-condensed" /> <?php endforeach; ?> </form> </div> <?php endif; ?> </div> </div> PK���\{,ם��1administrator/modules/mod_submenu/mod_submenu.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_submenu * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $list = JSubMenuHelper::getEntries(); $filters = JSubMenuHelper::getFilters(); $action = JSubMenuHelper::getAction(); $displayMenu = count($list); $displayFilters = count($filters); $hide = JFactory::getApplication()->input->getBool('hidemainmenu'); if ($displayMenu || $displayFilters) { require JModuleHelper::getLayoutPath('mod_submenu', $params->get('layout', 'default')); } PK���\�PB�1administrator/modules/mod_submenu/mod_submenu.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_submenu</name> <author>Joomla! Project</author> <creationDate>Feb 2006</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_SUBMENU_XML_DESCRIPTION</description> <files> <filename module="mod_submenu">mod_submenu.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_submenu.ini</language> <language tag="en-GB">en-GB.mod_submenu.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_SUBMENU" /> <config> <fields name="params"> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\mCD+administrator/modules/mod_feed/mod_feed.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $rssurl = $params->get('rssurl', ''); $rssrtl = $params->get('rssrtl', 0); // Check if feed URL has been set if (empty ($rssurl)) { echo '<div>'; echo JText::_('MOD_FEED_ERR_NO_URL'); echo '</div>'; return; } $feed = ModFeedHelper::getFeed($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_feed', $params->get('layout', 'default')); PK���\�i��/administrator/modules/mod_feed/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; if (!empty($feed) && is_string($feed)) { echo $feed; } else { $lang = JFactory::getLanguage(); $myrtl = $params->get('rssrtl'); $direction = " "; if ($lang->isRtl() && $myrtl == 0) { $direction = " redirect-rtl"; } // Feed description elseif ($lang->isRtl() && $myrtl == 1) { $direction = " redirect-ltr"; } elseif ($lang->isRtl() && $myrtl == 2) { $direction = " redirect-rtl"; } elseif ($myrtl == 0) { $direction = " redirect-ltr"; } elseif ($myrtl == 1) { $direction = " redirect-ltr"; } elseif ($myrtl == 2) { $direction = " redirect-rtl"; } if ($feed != false) : // Image handling $iUrl = isset($feed->image) ? $feed->image : null; $iTitle = isset($feed->imagetitle) ? $feed->imagetitle : null; ?> <div style="direction: <?php echo $rssrtl ? 'rtl' :'ltr'; ?>; text-align: <?php echo $rssrtl ? 'right' :'left'; ?> ! important" class="feed<?php echo $moduleclass_sfx; ?>"> <?php // Feed description if (!is_null($feed->title) && $params->get('rsstitle', 1)) : ?> <h2 class="<?php echo $direction; ?>"> <a href="<?php echo str_replace('&', '&', $rssurl); ?>" target="_blank"> <?php echo $feed->title; ?></a> </h2> <?php endif; ?> <!-- Feed description --> <?php if ($params->get('rssdesc', 1)) : ?> <?php echo $feed->description; ?> <?php endif; ?> <!-- Feed image --> <?php if ($params->get('rssimage', 1) && $iUrl) : ?> <img src="<?php echo $iUrl; ?>" alt="<?php echo @$iTitle; ?>"/> <?php endif; ?> <!-- Show items --> <?php if (!empty($feed)) : ?> <ul class="newsfeed<?php echo $params->get('moduleclass_sfx'); ?>"> <?php for ($i = 0; $i < $params->get('rssitems', 5); $i++) : if (!$feed->offsetExists($i)) : break; endif; $uri = (!empty($feed[$i]->uri) || !is_null($feed[$i]->uri)) ? $feed[$i]->uri : $feed[$i]->guid; $uri = substr($uri, 0, 4) != 'http' ? $params->get('rsslink') : $uri; $text = !empty($feed[$i]->content) || !is_null($feed[$i]->content) ? $feed[$i]->content : $feed[$i]->description; ?> <li> <?php if (!empty($uri)) : ?> <h5 class="feed-link"> <a href="<?php echo $uri; ?>" target="_blank"> <?php echo $feed[$i]->title; ?></a></h5> <?php else : ?> <h5 class="feed-link"><?php echo $feed[$i]->title; ?></h5> <?php endif; ?> <?php if ($params->get('rssitemdesc') && !empty($text)) : ?> <div class="feed-item-description"> <?php // Strip the images. $text = JFilterOutput::stripImages($text); $text = JHtml::_('string.truncate', $text, $params->get('word_count')); echo str_replace(''', "'", $text); ?> </div> <?php endif; ?> </li> <?php endfor; ?> </ul> <?php endif; ?> </div> <?php endif; } PK���\ؑ����)administrator/modules/mod_feed/helper.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_feed * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_feed * * @since 1.5 */ class ModFeedHelper { /** * Method to load a feed. * * @param JRegisty $params The parameters object. * * @return JFeedReader|string Return a JFeedReader object or a string message if error. * * @since 1.5 */ public static function getFeed($params) { // Module params $rssurl = $params->get('rssurl', ''); // Get RSS parsed object try { jimport('joomla.feed.factory'); $feed = new JFeedFactory; $rssDoc = $feed->getFeed($rssurl); } catch (Exception $e) { return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } if (empty($rssDoc)) { return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); } return $rssDoc; } } PK���\A�%j$$+administrator/modules/mod_feed/mod_feed.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_feed</name> <author>Joomla! Project</author> <creationDate>July 2005</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_FEED_XML_DESCRIPTION</description> <files> <filename module="mod_feed">mod_feed.php</filename> <filename>helper.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_feed.ini</language> <language tag="en-GB">en-GB.mod_feed.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_FEED" /> <config> <fields name="params"> <fieldset name="basic"> <field name="rssurl" type="url" filter="url" size="50" required="true" validate="url" label="MOD_FEED_FIELD_RSSURL_LABEL" description="MOD_FEED_FIELD_RSSURL_DESC" /> <field name="rssrtl" type="radio" class="btn-group btn-group-yesno" default="0" label="MOD_FEED_FIELD_RTL_LABEL" description="MOD_FEED_FIELD_RTL_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="rsstitle" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_FEED_FIELD_RSSTITLE_LABEL" description="MOD_FEED_FIELD_RSSTITLE_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="rssdesc" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_FEED_FIELD_DESCRIPTION_LABEL" description="MOD_FEED_FIELD_DESCRIPTION_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="rssimage" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_FEED_FIELD_IMAGE_LABEL" description="MOD_FEED_FIELD_IMAGE_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="rssitems" type="text" default="3" label="MOD_FEED_FIELD_ITEMS_LABEL" description="MOD_FEED_FIELD_ITEMS_DESC" /> <field name="rssitemdesc" type="radio" class="btn-group btn-group-yesno" default="1" label="MOD_FEED_FIELD_ITEMDESCRIPTION_LABEL" description="MOD_FEED_FIELD_ITEMDESCRIPTION_DESC"> <option value="1">JYES</option> <option value="0">JNO</option> </field> <field name="word_count" type="text" size="6" default="0" label="MOD_FEED_FIELD_WORDCOUNT_LABEL" description="MOD_FEED_FIELD_WORDCOUNT_DESC" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\�X��� � /administrator/modules/mod_latest/mod_latest.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_latest</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_LATEST_XML_DESCRIPTION</description> <files> <filename module="mod_latest">mod_latest.php</filename> <filename>helper.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_latest.ini</language> <language tag="en-GB">en-GB.mod_latest.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_LATEST" /> <config> <fields name="params"> <fieldset name="basic"> <field name="count" type="text" default="5" label="MOD_LATEST_FIELD_COUNT_LABEL" description="MOD_LATEST_FIELD_COUNT_DESC" /> <field name="ordering" type="list" default="c_dsc" label="MOD_LATEST_FIELD_ORDERING_LABEL" description="MOD_LATEST_FIELD_ORDERING_DESC"> <option value="c_dsc">MOD_LATEST_FIELD_VALUE_ORDERING_ADDED</option> <option value="m_dsc">MOD_LATEST_FIELD_VALUE_ORDERING_MODIFIED</option> </field> <field id="catid" name="catid" type="category" extension="com_content" label="JCATEGORY" description="MOD_LATEST_FIELD_CATEGORY_DESC" default="" > <option value="">JOPTION_ANY_CATEGORY</option> </field> <field name="user_id" type="list" default="0" label="MOD_LATEST_FIELD_AUTHORS_LABEL" description="MOD_LATEST_FIELD_AUTHORS_DESC"> <option value="0">MOD_LATEST_FIELD_VALUE_AUTHORS_ANYONE</option> <option value="by_me">MOD_LATEST_FIELD_VALUE_AUTHORS_BY_ME</option> <option value="not_me">MOD_LATEST_FIELD_VALUE_AUTHORS_NOT_BY_ME</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\�.NPP1administrator/modules/mod_latest/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_latest * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); ?> <div class="row-striped"> <?php if (count($list)) : ?> <?php foreach ($list as $i => $item) : ?> <div class="row-fluid"> <div class="span9"> <?php echo JHtml::_('jgrid.published', $item->state, $i, '', false); ?> <?php if ($item->checked_out) : ?> <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time); ?> <?php endif; ?> <strong class="row-title break-word"> <?php if ($item->link) : ?> <a href="<?php echo $item->link; ?>"> <?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?></a> <?php else : ?> <?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?> <?php endif; ?> </strong> <small class="hasTooltip" title="<?php echo JHtml::tooltipText('MOD_LATEST_CREATED_BY'); ?>"> <?php echo $item->author_name; ?> </small> </div> <div class="span3"> <span class="small"> <span class="icon-calendar"></span> <?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')); ?> </span> </div> </div> <?php endforeach; ?> <?php else : ?> <div class="row-fluid"> <div class="span12"> <div class="alert"><?php echo JText::_('MOD_LATEST_NO_MATCHING_RESULTS');?></div> </div> </div> <?php endif; ?> </div> PK���\}_����+administrator/modules/mod_latest/helper.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_latest * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_content/models', 'ContentModel'); /** * Helper for mod_latest * * @since 1.5 */ abstract class ModLatestHelper { /** * Get a list of articles. * * @param \Joomla\Registry\Registry &$params The module parameters. * * @return mixed An array of articles, or false on error. */ public static function getList(&$params) { $user = JFactory::getuser(); // Get an instance of the generic articles model $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set List SELECT $model->setState('list.select', 'a.id, a.title, a.checked_out, a.checked_out_time, ' . ' a.access, a.created, a.created_by, a.created_by_alias, a.featured, a.state'); // Set Ordering filter switch ($params->get('ordering')) { case 'm_dsc': $model->setState('list.ordering', 'modified DESC, created'); $model->setState('list.direction', 'DESC'); break; case 'c_dsc': default: $model->setState('list.ordering', 'created'); $model->setState('list.direction', 'DESC'); break; } // Set Category Filter $categoryId = $params->get('catid'); if (is_numeric($categoryId)) { $model->setState('filter.category_id', $categoryId); } // Set User Filter. $userId = $user->get('id'); switch ($params->get('user_id')) { case 'by_me': $model->setState('filter.author_id', $userId); break; case 'not_me': $model->setState('filter.author_id', $userId); $model->setState('filter.author_id.include', false); break; } // Set the Start and Limit $model->setState('list.start', 0); $model->setState('list.limit', $params->get('count', 5)); $items = $model->getItems(); if ($error = $model->getError()) { JError::raiseError(500, $error); return false; } // Set the links foreach ($items as &$item) { if ($user->authorise('core.edit', 'com_content.article.' . $item->id)) { $item->link = JRoute::_('index.php?option=com_content&task=article.edit&id=' . $item->id); } else { $item->link = ''; } } return $items; } /** * Get the alternate title for the module. * * @param \Joomla\Registry\Registry $params The module parameters. * * @return string The alternate title for the module. */ public static function getTitle($params) { $who = $params->get('user_id'); $catid = (int) $params->get('catid'); $type = $params->get('ordering') == 'c_dsc' ? '_CREATED' : '_MODIFIED'; if ($catid) { $category = JCategories::getInstance('Content')->get($catid); if ($category) { $title = $category->title; } else { $title = JText::_('MOD_POPULAR_UNEXISTING'); } } else { $title = ''; } return JText::plural('MOD_LATEST_TITLE' . $type . ($catid ? "_CATEGORY" : '') . ($who != '0' ? "_$who" : ''), (int) $params->get('count'), $title); } } PK���\u�/��/administrator/modules/mod_latest/mod_latest.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_latest * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include dependencies. require_once __DIR__ . '/helper.php'; $list = ModLatestHelper::getList($params); require JModuleHelper::getLayoutPath('mod_latest', $params->get('layout', 'default')); PK���\<06,,1administrator/modules/mod_custom/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_custom * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; echo $module->content; PK���\�!�[��/administrator/modules/mod_custom/mod_custom.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_custom</name> <author>Joomla! Project</author> <creationDate>July 2004</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_CUSTOM_XML_DESCRIPTION</description> <customContent /> <files> <filename module="mod_custom">mod_custom.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_custom.ini</language> <language tag="en-GB">en-GB.mod_custom.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_CUSTOM" /> <config> <fields name="params"> <fieldset name="options" label="COM_MODULES_BASIC_FIELDSET_LABEL"> <field name="prepare_content" type="radio" label="MOD_CUSTOM_FIELD_PREPARE_CONTENT_LABEL" class="btn-group btn-group-yesno" description="MOD_CUSTOM_FIELD_PREPARE_CONTENT_DESC" default="1"> <option value="1">JYES</option> <option value="0">JNO</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\�.��/administrator/modules/mod_custom/mod_custom.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_custom * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; if ($params->def('prepare_content', 1)) { JPluginHelper::importPlugin('content'); $module->content = JHtml::_('content.prepare', $module->content, '', 'mod_custom.content'); } // Replace 'images/' to '../images/' when using an image from /images in backend. $module->content = preg_replace('*src\=\"(?!administrator\/)images/*', 'src="../images/', $module->content); require JModuleHelper::getLayoutPath('mod_custom', $params->get('layout', 'default')); PK���\�SZ'��1administrator/modules/mod_toolbar/mod_toolbar.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $toolbar = JToolbar::getInstance('toolbar')->render('toolbar'); require JModuleHelper::getLayoutPath('mod_toolbar', $params->get('layout', 'default')); PK���\\Xe�::2administrator/modules/mod_toolbar/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_toolbar * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Echo the toolbar. echo $toolbar; PK���\��W1administrator/modules/mod_toolbar/mod_toolbar.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_toolbar</name> <author>Joomla! Project</author> <creationDate>Nov 2005</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_TOOLBAR_XML_DESCRIPTION</description> <files> <filename module="mod_toolbar">mod_toolbar.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_toolbar.ini</language> <language tag="en-GB">en-GB.mod_toolbar.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_TOOLBAR" /> <config> <fields name="params"> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\QZ���:administrator/modules/mod_multilangstatus/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_multilangstatus * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include jQuery JHtml::_('jquery.framework'); JFactory::getDocument()->addStyleDeclaration('.navbar-fixed-bottom {z-index:1050;}'); $link = JRoute::_('index.php?option=com_languages&view=multilangstatus&tmpl=component'); $footer = '<button class="btn" data-dismiss="modal" aria-hidden="true">' . JText::_('JTOOLBAR_CLOSE') . '</a>'; ?> <div class="btn-group multilanguage"> <a href="#multiLangModal" role="button" class="btn btn-link" data-toggle="modal" title="<?php echo JText::_('MOD_MULTILANGSTATUS'); ?>"> <span class="icon-comment"></span> <?php echo JText::_('MOD_MULTILANGSTATUS'); ?> </a> </div> <?php echo JHtml::_( 'bootstrap.renderModal', 'multiLangModal', array( 'title' => JText::_('MOD_MULTILANGSTATUS'), 'backdrop' => 'static', 'keyboard' => true, 'closeButton' => true, 'footer' => $footer, 'url' => $link, 'height' => '300px', 'width' => '500px' ) ); PK���\��g~~Aadministrator/modules/mod_multilangstatus/mod_multilangstatus.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_multilangstatus * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require JModuleHelper::getLayoutPath('mod_multilangstatus', $params->get('layout', 'default')); PK���\�"���Aadministrator/modules/mod_multilangstatus/mod_multilangstatus.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_multilangstatus</name> <author>Joomla! Project</author> <creationDate>September 2011</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_MULTILANGSTATUS_XML_DESCRIPTION</description> <files> <filename module="mod_multilangstatus">mod_multilangstatus.php</filename> <folder>tmpl</folder> <folder>language</folder> </files> <languages> <language tag="en-GB">language/en-GB/en-GB.mod_multilangstatus.ini</language> <language tag="en-GB">language/en-GB/en-GB.mod_multilangstatus.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_MULTILANG" /> <config> <fields name="params"> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\K���ssZadministrator/modules/mod_multilangstatus/language/en-GB/en-GB.mod_multilangstatus.sys.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_MULTILANGSTATUS="Multilanguage Status" MOD_MULTILANGSTATUS_XML_DESCRIPTION="This module shows the status of the multilanguage parameters." PK���\K���ssVadministrator/modules/mod_multilangstatus/language/en-GB/en-GB.mod_multilangstatus.ininu�[���; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 MOD_MULTILANGSTATUS="Multilanguage Status" MOD_MULTILANGSTATUS_XML_DESCRIPTION="This module shows the status of the multilanguage parameters." PK���\d���5administrator/modules/mod_quickicon/mod_quickicon.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_quickicon</name> <author>Joomla! Project</author> <creationDate>Nov 2005</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_QUICKICON_XML_DESCRIPTION</description> <files> <filename module="mod_quickicon">mod_quickicon.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> </files> <languages> <language tag="en-GB">en-GB.mod_quickicon.ini</language> <language tag="en-GB">en-GB.mod_quickicon.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_QUICKICON" /> <config> <fields name="params"> <fieldset name="basic"> <field name="context" type="text" default="mod_quickicon" description="MOD_QUICKICON_GROUP_DESC" label="MOD_QUICKICON_GROUP_LABEL" /> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> </fieldset> </fields> </config> </extension> PK���\�}��5administrator/modules/mod_quickicon/mod_quickicon.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_quickicon * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once __DIR__ . '/helper.php'; $buttons = ModQuickIconHelper::getButtons($params); require JModuleHelper::getLayoutPath('mod_quickicon', $params->get('layout', 'default')); PK���\%mW���4administrator/modules/mod_quickicon/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_quickicon * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $html = JHtml::_('links.linksgroups', ModQuickIconHelper::groupButtons($buttons)); ?> <?php if (!empty($html)) : ?> <div class="sidebar-nav quick-icons"> <?php echo $html;?> </div> <?php endif;?> PK���\,�MM.administrator/modules/mod_quickicon/helper.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_quickicon * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Helper for mod_quickicon * * @since 1.6 */ abstract class ModQuickIconHelper { /** * Stack to hold buttons * * @since 1.6 */ protected static $buttons = array(); /** * Helper method to return button list. * * This method returns the array by reference so it can be * used to add custom buttons or remove default ones. * * @param JObject $params The module parameters. * * @return array An array of buttons * * @since 1.6 */ public static function &getButtons($params) { $key = (string) $params; if (!isset(self::$buttons[$key])) { $context = $params->get('context', 'mod_quickicon'); if ($context == 'mod_quickicon') { // Load mod_quickicon language file in case this method is called before rendering the module JFactory::getLanguage()->load('mod_quickicon'); self::$buttons[$key] = array( array( 'link' => JRoute::_('index.php?option=com_content&task=article.add'), 'image' => 'pencil-2', 'icon' => 'header/icon-48-article-add.png', 'text' => JText::_('MOD_QUICKICON_ADD_NEW_ARTICLE'), 'access' => array('core.manage', 'com_content', 'core.create', 'com_content'), 'group' => 'MOD_QUICKICON_CONTENT' ), array( 'link' => JRoute::_('index.php?option=com_content'), 'image' => 'stack', 'icon' => 'header/icon-48-article.png', 'text' => JText::_('MOD_QUICKICON_ARTICLE_MANAGER'), 'access' => array('core.manage', 'com_content'), 'group' => 'MOD_QUICKICON_CONTENT' ), array( 'link' => JRoute::_('index.php?option=com_categories&extension=com_content'), 'image' => 'folder', 'icon' => 'header/icon-48-category.png', 'text' => JText::_('MOD_QUICKICON_CATEGORY_MANAGER'), 'access' => array('core.manage', 'com_content'), 'group' => 'MOD_QUICKICON_CONTENT' ), array( 'link' => JRoute::_('index.php?option=com_media'), 'image' => 'pictures', 'icon' => 'header/icon-48-media.png', 'text' => JText::_('MOD_QUICKICON_MEDIA_MANAGER'), 'access' => array('core.manage', 'com_media'), 'group' => 'MOD_QUICKICON_CONTENT' ), array( 'link' => JRoute::_('index.php?option=com_menus'), 'image' => 'list-view', 'icon' => 'header/icon-48-menumgr.png', 'text' => JText::_('MOD_QUICKICON_MENU_MANAGER'), 'access' => array('core.manage', 'com_menus'), 'group' => 'MOD_QUICKICON_STRUCTURE' ), array( 'link' => JRoute::_('index.php?option=com_users'), 'image' => 'users', 'icon' => 'header/icon-48-user.png', 'text' => JText::_('MOD_QUICKICON_USER_MANAGER'), 'access' => array('core.manage', 'com_users'), 'group' => 'MOD_QUICKICON_USERS' ), array( 'link' => JRoute::_('index.php?option=com_modules'), 'image' => 'cube', 'icon' => 'header/icon-48-module.png', 'text' => JText::_('MOD_QUICKICON_MODULE_MANAGER'), 'access' => array('core.manage', 'com_modules'), 'group' => 'MOD_QUICKICON_STRUCTURE' ), array( 'link' => JRoute::_('index.php?option=com_config'), 'image' => 'cog', 'icon' => 'header/icon-48-config.png', 'text' => JText::_('MOD_QUICKICON_GLOBAL_CONFIGURATION'), 'access' => array('core.manage', 'com_config', 'core.admin', 'com_config'), 'group' => 'MOD_QUICKICON_CONFIGURATION' ), array( 'link' => JRoute::_('index.php?option=com_templates'), 'image' => 'eye', 'icon' => 'header/icon-48-themes.png', 'text' => JText::_('MOD_QUICKICON_TEMPLATE_MANAGER'), 'access' => array('core.manage', 'com_templates'), 'group' => 'MOD_QUICKICON_CONFIGURATION' ), array( 'link' => JRoute::_('index.php?option=com_languages'), 'image' => 'comments-2', 'icon' => 'header/icon-48-language.png', 'text' => JText::_('MOD_QUICKICON_LANGUAGE_MANAGER'), 'access' => array('core.manage', 'com_languages'), 'group' => 'MOD_QUICKICON_CONFIGURATION' ), array( 'link' => JRoute::_('index.php?option=com_installer'), 'image' => 'download', 'icon' => 'header/icon-48-extension.png', 'text' => JText::_('MOD_QUICKICON_INSTALL_EXTENSIONS'), 'access' => array('core.manage', 'com_installer'), 'group' => 'MOD_QUICKICON_EXTENSIONS' ) ); } else { self::$buttons[$key] = array(); } // Include buttons defined by published quickicon plugins JPluginHelper::importPlugin('quickicon'); $app = JFactory::getApplication(); $arrays = (array) $app->triggerEvent('onGetIcons', array($context)); foreach ($arrays as $response) { foreach ($response as $icon) { $default = array( 'link' => null, 'image' => 'cog', 'text' => null, 'access' => true, 'group' => 'MOD_QUICKICON_EXTENSIONS' ); $icon = array_merge($default, $icon); if (!is_null($icon['link']) && !is_null($icon['text'])) { self::$buttons[$key][] = $icon; } } } } return self::$buttons[$key]; } /** * Classifies the $buttons by group * * @param array $buttons The buttons * * @return array The buttons sorted by groups * * @since 3.2 */ public static function groupButtons($buttons) { $groupedButtons = array(); foreach ($buttons as $button) { $groupedButtons[$button['group']][] = $button; } return $groupedButtons; } /** * Get the alternate title for the module * * @param JObject $params The module parameters. * @param JObject $module The module. * * @return string The alternate title for the module. */ public static function getTitle($params, $module) { $key = $params->get('context', 'mod_quickicon') . '_title'; if (JFactory::getLanguage()->hasKey($key)) { return JText::_($key); } else { return $module->title; } } } PK���\�hn�\\0administrator/modules/mod_title/tmpl/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_title * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php if (!empty($title)) : ?> <?php echo $title; ?> <?php endif; ?> PK���\Ⱟ[��-administrator/modules/mod_title/mod_title.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage mod_title * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Get the component title div if (isset(JFactory::getApplication()->JComponentTitle)) { $title = JFactory::getApplication()->JComponentTitle; } require JModuleHelper::getLayoutPath('mod_title', $params->get('layout', 'default')); PK���\#X�y-administrator/modules/mod_title/mod_title.xmlnu�[���<?xml version="1.0" encoding="utf-8"?> <extension type="module" version="3.1" client="administrator" method="upgrade"> <name>mod_title</name> <author>Joomla! Project</author> <creationDate>Nov 2005</creationDate> <copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>3.0.0</version> <description>MOD_TITLE_XML_DESCRIPTION</description> <files> <filename module="mod_title">mod_title.php</filename> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">en-GB.mod_title.ini</language> <language tag="en-GB">en-GB.mod_title.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_TITLE" /> <config> <fields name="params"> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="textarea" rows="3" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="0" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> </fieldset> </fields> </config> </extension> PK���\c�+��!administrator/help/en-GB/toc.jsonnu�[���{"COMPONENTS_BANNERS_BANNERS":"COMPONENTS_BANNERS_BANNERS","COMPONENTS_BANNERS_BANNERS_EDIT":"COMPONENTS_BANNERS_BANNERS_EDIT","COMPONENTS_BANNERS_CATEGORIES":"COMPONENTS_BANNERS_CATEGORIES","COMPONENTS_BANNERS_CATEGORY_EDIT":"COMPONENTS_BANNERS_CATEGORIES_EDIT","COMPONENTS_BANNERS_CLIENTS":"COMPONENTS_BANNERS_CLIENTS","COMPONENTS_BANNERS_CLIENTS_EDIT":"COMPONENTS_BANNERS_CLIENTS_EDIT","COMPONENTS_BANNERS_TRACKS":"COMPONENTS_BANNERS_TRACKS","COMPONENTS_CONTACTS_CONTACTS":"COMPONENTS_CONTACTS_CONTACTS","COMPONENTS_CONTACTS_CONTACTS_EDIT":"COMPONENTS_CONTACTS_CONTACTS_EDIT","COMPONENTS_CONTACT_CATEGORIES":"COMPONENTS_CONTACT_CATEGORIES","COMPONENTS_CONTACT_CATEGORY_EDIT":"COMPONENTS_CONTACT_CATEGORIES_EDIT","COMPONENTS_CONTENT_CATEGORIES":"COMPONENTS_CONTENT_CATEGORIES","COMPONENTS_CONTENT_CATEGORY_EDIT":"COMPONENTS_CONTENT_CATEGORIES_EDIT","COMPONENTS_FINDER_MANAGE_CONTENT_MAPS":"COMPONENTS_FINDER_MANAGE_CONTENT_MAPS","COMPONENTS_FINDER_MANAGE_INDEXED_CONTENT":"COMPONENTS_FINDER_MANAGE_INDEXED_CONTENT","COMPONENTS_FINDER_MANAGE_SEARCH_FILTERS":"COMPONENTS_FINDER_MANAGE_SEARCH_FILTERS","COMPONENTS_FINDER_MANAGE_SEARCH_FILTERS_EDIT":"COMPONENTS_FINDER_MANAGE_SEARCH_FILTERS_EDIT","COMPONENTS_JOOMLA_UPDATE":"COMPONENTS_JOOMLA_UPDATE","COMPONENTS_MESSAGING_INBOX":"COMPONENTS_MESSAGING_INBOX","COMPONENTS_MESSAGING_READ":"COMPONENTS_MESSAGING_READ","COMPONENTS_MESSAGING_WRITE":"COMPONENTS_MESSAGING_WRITE","COMPONENTS_NEWSFEEDS_CATEGORIES":"COMPONENTS_NEWSFEEDS_CATEGORIES","COMPONENTS_NEWSFEEDS_CATEGORY_EDIT":"COMPONENTS_NEWSFEEDS_CATEGORIES_EDIT","COMPONENTS_NEWSFEEDS_FEEDS":"COMPONENTS_NEWSFEEDS_FEEDS","COMPONENTS_NEWSFEEDS_FEEDS_EDIT":"COMPONENTS_NEWSFEEDS_FEEDS_EDIT","COMPONENTS_POST_INSTALLATION_MESSAGES":"COMPONENTS_POST_INSTALLATION_MESSAGES","COMPONENTS_REDIRECT_MANAGER":"COMPONENTS_REDIRECT_MANAGER","COMPONENTS_REDIRECT_MANAGER_EDIT":"COMPONENTS_REDIRECT_MANAGER_EDIT","COMPONENTS_SEARCH":"COMPONENTS_SEARCH","COMPONENTS_TAGS_MANAGER":"COMPONENTS_TAGS_MANAGER","COMPONENTS_TAGS_MANAGER_EDIT":"COMPONENTS_TAGS_MANAGER_EDIT","COMPONENTS_WEBLINKS_CATEGORIES":"COMPONENTS_WEBLINKS_CATEGORIES","COMPONENTS_WEBLINKS_CATEGORY_EDIT":"COMPONENTS_WEBLINKS_CATEGORIES_EDIT","COMPONENTS_WEBLINKS_LINKS":"COMPONENTS_WEBLINKS_LINKS","COMPONENTS_WEBLINKS_LINKS_EDIT":"COMPONENTS_WEBLINKS_LINKS_EDIT","CONTENT_ARTICLE_MANAGER":"CONTENT_ARTICLE_MANAGER","CONTENT_ARTICLE_MANAGER_EDIT":"CONTENT_ARTICLE_MANAGER_EDIT","CONTENT_FEATURED_ARTICLES":"CONTENT_FEATURED_ARTICLES","CONTENT_MEDIA_MANAGER":"CONTENT_MEDIA_MANAGER","EXTENSIONS_EXTENSION_MANAGER_DATABASE":"EXTENSIONS_EXTENSION_MANAGER_DATABASE","EXTENSIONS_EXTENSION_MANAGER_DISCOVER":"EXTENSIONS_EXTENSION_MANAGER_DISCOVER","EXTENSIONS_EXTENSION_MANAGER_INSTALL":"EXTENSIONS_EXTENSION_MANAGER_INSTALL","EXTENSIONS_EXTENSION_MANAGER_MANAGE":"EXTENSIONS_EXTENSION_MANAGER_MANAGE","EXTENSIONS_EXTENSION_MANAGER_UPDATE":"EXTENSIONS_EXTENSION_MANAGER_UPDATE","EXTENSIONS_EXTENSION_MANAGER_WARNINGS":"EXTENSIONS_EXTENSION_MANAGER_WARNINGS","EXTENSIONS_LANGUAGE_MANAGER_CONTENT":"EXTENSIONS_LANGUAGE_MANAGER_CONTENT","EXTENSIONS_LANGUAGE_MANAGER_EDIT":"EXTENSIONS_LANGUAGE_MANAGER_EDIT","EXTENSIONS_LANGUAGE_MANAGER_INSTALLED":"EXTENSIONS_LANGUAGE_MANAGER_INSTALLED","EXTENSIONS_LANGUAGE_MANAGER_OVERRIDES":"EXTENSIONS_LANGUAGE_MANAGER_OVERRIDES","EXTENSIONS_LANGUAGE_MANAGER_OVERRIDES_EDIT":"EXTENSIONS_LANGUAGE_MANAGER_OVERRIDES_EDIT","EXTENSIONS_MODULE_MANAGER":"EXTENSIONS_MODULE_MANAGER","EXTENSIONS_MODULE_MANAGER_EDIT":"EXTENSIONS_MODULE_MANAGER_EDIT","EXTENSIONS_PLUGIN_MANAGER":"EXTENSIONS_PLUGIN_MANAGER","EXTENSIONS_PLUGIN_MANAGER_EDIT":"EXTENSIONS_PLUGIN_MANAGER_EDIT","EXTENSIONS_TEMPLATE_MANAGER_STYLES":"EXTENSIONS_TEMPLATE_MANAGER_STYLES","EXTENSIONS_TEMPLATE_MANAGER_STYLES_EDIT":"EXTENSIONS_TEMPLATE_MANAGER_STYLES_EDIT","EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES":"EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES","EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT":"EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT","EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT_SOURCE":"EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT_SOURCE","MENUS_MENU_ITEM_MANAGER":"MENUS_MENU_ITEM_MANAGER","MENUS_MENU_ITEM_MANAGER_EDIT":"MENUS_MENU_ITEM_MANAGER_EDIT","MENUS_MENU_MANAGER":"MENUS_MENU_MANAGER","MENUS_MENU_MANAGER_EDIT":"MENUS_MENU_MANAGER_EDIT","SITE_GLOBAL_CONFIGURATION":"SITE_GLOBAL_CONFIGURATION","SITE_MAINTENANCE_CLEAR_CACHE":"SITE_MAINTENANCE_CLEAR_CACHE","SITE_MAINTENANCE_GLOBAL_CHECK-IN":"SITE_MAINTENANCE_GLOBAL_CHECK-IN","SITE_MAINTENANCE_PURGE_EXPIRED_CACHE":"SITE_MAINTENANCE_PURGE_EXPIRED_CACHE","SITE_SYSTEM_INFORMATION":"SITE_SYSTEM_INFORMATION","START_HERE":"START_HERE","USERS_ACCESS_LEVELS":"USERS_ACCESS_LEVELS","USERS_ACCESS_LEVELS_EDIT":"USERS_ACCESS_LEVELS_EDIT","USERS_DEBUG_USERS":"USERS_DEBUG_USER","USERS_GROUPS":"USERS_GROUPS","USERS_GROUPS_EDIT":"USERS_GROUPS_EDIT","USERS_MASS_MAIL_USERS":"USERS_MASS_MAIL_USERS","USERS_USER_MANAGER":"USERS_USER_MANAGER","USERS_USER_MANAGER_EDIT":"USERS_USER_MANAGER_EDIT","USERS_USER_NOTES":"USERS_USER_NOTES","USERS_USER_NOTES_EDIT":"USERS_USER_NOTES_EDIT"}PK���\D���� administrator/help/helpsites.xmlnu�[���<?xml version="1.0" encoding="iso-8859-1"?> <joshelp> <sites> <site tag="en-GB" url="https://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:{keyref}">English (GB) - Joomla help wiki</site> <site tag="fr-FR" url="http://help.joomla.fr/3/index.php?option=com_help&keyref=Help{major}{minor}:{keyref}">Fran�ais (FR) - Aide de Joomla!</site> </sites> </joshelp> PK���\�V�administrator/cache/index.htmlnu�[���<!DOCTYPE html><title></title> PK���\��++)administrator/templates/hathor/cpanel.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $lang = JFactory::getLanguage(); $input = $app->input; $user = JFactory::getUser(); // Load optional RTL Bootstrap CSS JHtml::_('bootstrap.loadCss', false, $this->direction); // Load system style CSS $doc->addStyleSheet($this->baseurl . '/templates/system/css/system.css'); // Loadtemplate CSS $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template.css'); // Load additional CSS styles for colors if (!$this->params->get('colourChoice')) { $colour = 'standard'; } else { $colour = htmlspecialchars($this->params->get('colourChoice')); } $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '.css'); // Load specific language related CSS $file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; if (is_file($file)) { $doc->addStyleSheet($file); } // Load additional CSS styles for rtl sites if ($this->direction == 'rtl') { $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template_rtl.css'); $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '_rtl.css'); } // Load specific language related CSS $file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; if (JFile::exists($file)) { $doc->addStyleSheet($file); } // Load additional CSS styles for bold Text if ($this->params->get('boldText')) { $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/boldtext.css'); } // Load template javascript $doc->addScript($this->baseurl . '/templates/' . $this->template . '/js/template.js', 'text/javascript'); // Logo file if ($this->params->get('logoFile')) { $logo = JUri::root() . $this->params->get('logoFile'); } else { $logo = $this->baseurl . '/templates/' . $this->template . '/images/logo.png'; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> <head> <jdoc:include type="head" /> <!-- Load additional CSS styles for Internet Explorer --> <!--[if IE 8]> <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/ie8.css" rel="stylesheet" type="text/css" /> <![endif]--> <!--[if IE 7]> <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/ie7.css" rel="stylesheet" type="text/css" /> <![endif]--> <!--[if lt IE 9]> <script src="<?php echo JUri::root(true); ?>/media/jui/js/html5.js"></script> <![endif]--> </head> <body id="minwidth" class="cpanel-page"> <div id="containerwrap"> <!-- Header Logo --> <div id="header"> <!-- Site Title and Skip to Content --> <div class="title-ua"> <h1 class="title"><?php echo $this->params->get('showSiteName') ? $app->get('sitename') . " " . JText::_('JADMINISTRATION') : JText::_('JADMINISTRATION'); ?></h1> <div id="skiplinkholder"><p><a id="skiplink" href="#skiptarget"><?php echo JText::_('TPL_HATHOR_SKIP_TO_MAIN_CONTENT'); ?></a></p></div> </div> </div><!-- end header --> <!-- Main Menu Navigation --> <div id="nav"> <div id="module-menu"> <h2 class="element-invisible"><?php echo JText::_('TPL_HATHOR_MAIN_MENU'); ?></h2> <jdoc:include type="modules" name="menu" /> </div> <div class="clr"></div> </div><!-- end nav --> <!-- Status Module --> <div id="module-status"> <jdoc:include type="modules" name="status"/> </div> <!-- Content Area --> <div id="content"> <!-- Component Title --> <jdoc:include type="modules" name="title" /> <!-- System Messages --> <jdoc:include type="message" /> <!-- Sub Menu Navigation --> <div id="no-submenu"></div> <div class="clr"></div> <!-- Beginning of Actual Content --> <div id="element-box"> <p id="skiptargetholder"><a id="skiptarget" class="skip" tabindex="-1"></a></p> <div class="adminform"> <!-- Display the Quick Icon Shortcuts --> <div class="cpanel-icons"> <jdoc:include type="modules" name="icon" /> </div> <!-- Display Admin Information Panels --> <div class="cpanel-component"> <jdoc:include type="component" /> </div> </div> <div class="clr"></div> </div><!-- end element-box --> <noscript> <?php echo JText::_('JGLOBAL_WARNJAVASCRIPT'); ?> </noscript> <div class="clr"></div> </div><!-- end content --> <div class="clr"></div> </div><!-- end containerwrap --> <!-- Footer --> <div id="footer"> <jdoc:include type="modules" name="footer" style="none" /> <p class="copyright"> <?php // Fix wrong display of Joomla!® in RTL language if (JFactory::getLanguage()->isRtl()) { $joomla = '<a href="http://www.joomla.org" target="_blank">Joomla!</a><sup>®‎</sup>'; } else { $joomla = '<a href="http://www.joomla.org" target="_blank">Joomla!</a><sup>®</sup>'; } echo JText::sprintf('JGLOBAL_ISFREESOFTWARE', $joomla); ?> </p> </div> </body> </html> PK���\鱦��8administrator/templates/hathor/less/colour_standard.lessnu�[���// colour_standard.less // // Less to compile Hathor in the default colour scheme // ----------------------------------------------------- /** * Main colors: * #2c2c2c Text * #054993 Links * #ffffff Background, border, text * #f9fade Background alternate, button/icon/menu background * #e5f0fa Background (input required) * #e3e4ca Background Hover, Right/Bottom icon borders * #c7c8b2 Main borders * #868778 Top/Left icon hover borders * #f6f7db Right/Bottom icon hover borders * * Special Use Colors: * #a20000 Text Error, border invalid * #cccccc Text (faded) * #005800 Text (success) * #eeeeee Background (input disabled) * #ffffcf Background‚ permissions debug * #cfffda Background‚ permissions debug * #ffcfcf Background‚ permissions debug */ // Import the variables file first to get common variables loaded @import "hathor_variables.less"; // Define variables unique to this colour scheme, as well as override variables already defined in the common file @altBackground: #f9fade; @gradientTop: #f9fade; @gradientBottom: #f9fade; @mainBorder: #c7c8b2; // Import the baseline to compile the CSS @import "colour_baseline.less"; PK���\ 0I)qq/administrator/templates/hathor/less/modals.lessnu�[���// MODALS // ------ // Recalculate z-index where appropriate .modal-open { .dropdown-menu { z-index: @zindexDropdown + @zindexModal; } .dropdown.open { *z-index: @zindexDropdown + @zindexModal; } .popover { z-index: @zindexPopover + @zindexModal; } .tooltip { z-index: @zindexTooltip + @zindexModal; } } // Background .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: @zindexModalBackdrop; background-color: @black; // Fade for backdrop &.fade { opacity: 0; } } .modal-backdrop, .modal-backdrop.fade.in { .opacity(80); } // Base modal div.modal { position: fixed; top: 50%; left: 50%; z-index: @zindexModal; overflow: auto; width: 80%; margin: -250px 0 0 -40%; background-color: @white; border: 1px solid #999; border: 1px solid rgba(0,0,0,.3); *border: 1px solid #999; /* IE6-7 */ .border-radius(6px); .box-shadow(0 3px 7px rgba(0,0,0,0.3)); .background-clip(padding-box); &.fade { .transition(e('opacity .3s linear, top .3s ease-out')); top: -25%; } &.fade.in { top: 50%; } } .modal-header { padding: 9px 15px; border-bottom: 1px solid #eee; // Close icon .close { float: right; margin-top: 2px; } } // Body (where all modal content resides) .modal-body { overflow-y: auto; max-height: 400px; padding: 15px; } // Remove bottom margin if need be .modal-form { margin-bottom: 0; } // Footer (for actions) .modal-footer { padding: 14px 15px 15px; margin-bottom: 0; text-align: right; // right align buttons background-color: #f5f5f5; border-top: 1px solid #ddd; .border-radius(0 0 6px 6px); .box-shadow(inset 0 1px 0 @white); .clearfix(); // clear it in case folks use .pull-* classes on buttons // Properly space out buttons .btn + .btn { margin-left: 5px; margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs } // but override that for button groups .btn-group .btn + .btn { margin-left: -1px; } } /* Prevent scrolling on the parent window of a modal */ body.modal-open { overflow: hidden; -ms-overflow-style: none; }PK���\JVs��0administrator/templates/hathor/less/buttons.lessnu�[���// // Buttons // This is a custom version of Bootstrap's buttons.less file suited for Hathor's needs // -------------------------------------------------- // Base styles // -------------------------------------------------- // Core #form-login .btn { display: inline-block; .ie7-inline-block(); padding: 4px 14px; margin-bottom: 0; // For input.btn font-size: @baseFontSize; line-height: @baseLineHeight; *line-height: @baseLineHeight; text-align: center; vertical-align: middle; cursor: pointer; .buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark, 0 1px 1px rgba(255,255,255,.75)); border: 1px solid @btnBorder; *border: 0; // Remove the border to prevent IE7's black border on input:focus border-bottom-color: darken(@btnBorder, 10%); .border-radius(4px); .ie7-restore-left-whitespace(); // Give IE7 some love .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)"); // Hover state &:hover { color: @grayDark; text-decoration: none; background-color: darken(@white, 10%); *background-color: darken(@white, 15%); /* Buttons in IE7 don't get borders, so darken on hover */ background-position: 0 -15px; // transition is only when going to hover, otherwise the background // behind the gradient (there for IE<=9 fallback) gets mismatched .transition(background-position .1s linear); } // Focus state for keyboard and accessibility &:focus { .tab-focus(); } // Active state &.active, &:active { background-color: darken(@white, 10%); background-color: darken(@white, 15%) e("\9"); background-image: none; outline: 0; .box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)"); } // Disabled state &.disabled, &[disabled] { cursor: default; background-color: darken(@white, 10%); background-image: none; .opacity(65); .box-shadow(none); } } // Button Sizes // -------------------------------------------------- // Large .btn-large { padding: 9px 14px; font-size: @baseFontSize + 2px; line-height: normal; .border-radius(5px); } .btn-large [class^="icon-"] { margin-top: 2px; } PK���\"V.���0administrator/templates/hathor/less/icomoon.lessnu�[���@font-face { font-family: 'IcoMoon'; src: url('../../../../media/jui/fonts/IcoMoon.eot'); src: url('../../../../media/jui/fonts/IcoMoon.eot?#iefix') format('embedded-opentype'), url('../../../../media/jui/fonts/IcoMoon.woff') format('woff'), url('../../../../media/jui/fonts/IcoMoon.ttf') format('truetype'), url('../../../../media/jui/fonts/IcoMoon.svg#IcoMoon') format('svg'); font-weight: normal; font-style: normal; } @import "../../../../media/jui/less/icomoon.less"; PK���\N����4administrator/templates/hathor/less/colour_blue.lessnu�[���// colour_blue.less // // Less to compile Hathor in the blue colour scheme // ----------------------------------------------------- /** * #2c2c2c Text * #054993 Links * #ffffff Background, border, text * #c3d2e5 Background alternate, button/icon/menu background * #a5bbd4-c3d2e5 Gradient Background * #e5f0fa Background (input required) * #e5d9c3 Background Hover, Top/Left icon borders * #738498 Main borders * #868778 Top/Left hover borders * #f6f7db Right/Bottom hover borders * * Special Use Colors: * #a20000 Text Error, border invalid * #cccccc Text (faded) * #005800 Text (success) * #eeeeee Background (input disabled) * #ffffcf Background permissions debug * #cfffda Background permissions debug * #ffcfcf Background permissions debug */ // Import the variables file first to get common variables loaded @import "hathor_variables.less"; // Define variables unique to this colour scheme, as well as override variables already defined in the common file @altBackground: #c3d2e5; @gradientTop: #a5bbd4; @gradientBottom: #c3d2e5; @mainBorder: #738498; // Import the baseline to compile the CSS @import "colour_baseline.less"; PK���\Q�=����1administrator/templates/hathor/less/template.lessnu�[���// Import the variables file first to get common variables loaded @import "hathor_variables.less"; // Core variables and mixins @import "../../../../media/jui/less/mixins.less"; // Bootstrap Component Animations @import "../../../../media/jui/less/component-animations.less"; // Bootstrap Modals @import "modals.less"; //@import "../../../../media/jui/less/modals.joomla.less"; // Icon Font @import "icomoon.less"; /** * CSS Reset */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; font-size: 100%; background: transparent; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } del { text-decoration: line-through; } /** * General styles */ html { overflow-y: scroll; height: 100%; } body { margin: 0; padding: 0; font-size: 62.5%; line-height: 1.5em; height: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body, td, th, span, a { font-family: Arial, Helvetica, sans-serif; } html, body { height: 100%; } a, img { padding: 0; margin: 0; } img { border: 0 none; } form { margin: 0; padding: 0; } ul { padding: 0; margin: 0; } h1 { margin: 0; padding-bottom: 8px; font-size: 1.4em; font-weight: bold; line-height: 2em; } h2 { padding-top: .83em; padding-bottom: .83em; } h3 { font-size: 1.4em; } a:link { color: #054993; text-decoration: none; } a:visited { color: #054993; text-decoration: none; } a:hover { text-decoration: underline; } a:focus { text-decoration: underline; } iframe { border: 0; } /* new styles */ .enabled { color: #005800; font-weight: bold; } .disabled { color: #a20000; font-weight: bold; } p.error { color: #a20000; font-weight: bold; } .warning { color: #a20000; font-weight: bold; } .nowarning { color: #2c2c2c; font-weight: bold; } .success { color: #005800; font-weight: bold; } .allow { color: #005800; } span.writable { color: #005800; } .deny { color: #a20000; } span.unwritable { color: #a20000; } .none { color: #aaaaaa; } .pointer { cursor: pointer; } .nowrap { white-space: nowrap; } p.nowarning, p.warning { margin: 10px; } /* end new styles */ /** * Overall Styles */ #minwidth, #minwidth-body { min-width: 980px; } #containerwrap { position: relative; } #header { position: relative; } #header h1.title { font-size: 1.5em; font-weight: normal; line-height: 25px; margin: 0; padding: 0 0 0 120px; } #footer { padding: 10px 20px; } #footer .copyright { margin: 0 0 0 0; text-align: center; } #footer p { font-size: 1.2em; } #nav .no-nav { line-height: 2em; } #content { margin: 5px 20px 20px 20px; } .cpanel-page div#element-box { padding: 15px; } /** * Status layout */ #module-status { float: right; position: relative; top: -48px; } #module-status div.btn-group { display: block; float: left; padding: 4px 10px 0 10px; font-size: 1.2em; } #module-status div.divider { display: none; } #module-status .unread-messages a { font-weight: bold; } .title-ua { position: relative; width: 60%; } /** * Various Styles */ .enabled, .disabled, p.error, .warning, .nowarning, .success { font-weight: bold; } .pointer { cursor: pointer; } .nowrap { white-space: nowrap; } span.note { display: block; padding: 5px; } div.checkin-tick { text-indent: -9999px; } /** * Overlib */ .ol-textfont { font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; } .ol-captionfont { font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; font-weight: bold; } .ol-captionfont a { text-decoration: none; } /** * Subheader, toolbar, page title */ div.subheader .padding { padding: 0; } div.pagetitle { padding: 0 0 5px 5px; margin: 0; background-repeat: no-repeat; background-position: left 50%; line-height: 54px; width: 100%; margin-top: -20px; height: 60px; } .tabs-left > .nav-tabs { float: left; margin-right: 19px; border-right: 1px solid #DDD; } tabs-below > .nav-tabs, .tabs-right > .nav-tabs, .tabs-left > .nav-tabs { border-bottom: 0; } /* Tabbed Content */ .tab-content { overflow: visible; } .tabs-left .tab-content { overflow: auto; } /* Non-linkable nav-tabs */ .nav-tabs > li > span { display: block; margin-right: 2px; padding-right: 12px; padding-left: 12px; padding-top: 8px; padding-bottom: 8px; line-height: 18px; border: 1px solid transparent; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } /* Extended Joomla Button Classes */ .btn-micro { padding: 1px 4px; font-size: 10px; line-height: 8px; } /* Joomla => Bootstrap Tooltip */ .tip-wrap { max-width: 200px; padding: 3px 8px; color: #ffffff; text-align: center; text-decoration: none; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; z-index: 100; } .pagetitle h2 { padding: 0 0 0 50px; font-size: 1.3em; font-weight: bold; line-height: 48px; font-style: italic; } div.configuration { font-size: 1.2em; font-weight: bold; line-height: 2em; padding-left: 30px; margin-left: 10px; } div.toolbar-box h3 { height: 0; overflow: hidden; position: absolute; padding: 0; margin: 0; } .btn-toolbar { margin-bottom: 3px; margin-top: 14px; } div.btn-toolbar, div.toolbar-list { float: left; text-align: left; padding: 0; } div.toolbar-list li { padding: 5px 1px 5px 4px; text-align: center; height: 52px; list-style: none; float: left; } div.toolbar-list li.spacer { width: 10px; } div.toolbar-list li.divider { width: 10px; margin-right: 10px; } div.toolbar-list span { float: none; width: 32px; height: 32px; margin: 0 auto; display: block; } div.toolbar-list a { display: block; float: left; white-space: nowrap; padding: 1px 5px; cursor: pointer; font-weight: bold; } div.btn-toolbar div.btn-group button { display: block; float: left; white-space: nowrap; padding: 1px 5px; cursor: pointer; text-align: center; } div.btn-toolbar button:hover, div.btn-toolbar button:focus, div.toolbar-list a:hover, div.toolbar-list a:focus { text-decoration: none; } /** * Massmail component */ td#mm_pane { width: 90%; } input#mm_subject { width: 200px; } textarea#mm_message { width: 100%; } textarea { resize:both; } textarea.vert { resize:vertical; } textarea.noResize { resize:none; } /** * Pane Slider pane Toggler styles */ .pane-sliders { margin: 0; position: relative; } .pane-sliders .title { margin: 0; padding: 2px; cursor: pointer; } .pane-sliders .panel { margin-bottom: 3px; } .pane-sliders .adminlist td { border: 0 none; } h3.pane-toggler-down a:focus, h3.pane-toggler a:focus { outline: none; } .pane-toggler span { padding-left: 20px; } .pane-toggler-down span { padding-left: 20px; } /* The following line hides the unseen panel (prevents the mouse from activating in IE, so overridden in the ie css files) */ /*.pane-toggler + div.pane-slider {display: none;}*/ .pane-slider.pane-hide { display: none; } div#position-icon.pane-sliders div.pane-down div.quickicon-wrapper { margin: 5px 0 5px 0; } div#position-icon.pane-sliders div.pane-down .quickicon-wrapper .icon { padding: 5px 0 5px 10px; margin: 0; } /** * Tabs */ dl.tabs { float: left; margin: 10px 0 -1px 0; z-index: 50; } dl.tabs dt { float: left; padding: 4px 10px; margin-left: 3px; } dl.tabs dt.open { z-index: 100; } div.current { clear: both; padding: 10px 10px; } div.current dd { padding: 0; margin: 0; } /* New parameter styles */ dl#content-pane.tabs { margin: 1px 0 0 0; } div.current label, div.current span.faux-label { display: block; min-width: 150px; float: left; clear: left; margin-top: 8px; } div.current fieldset.radio { float: left; } div.current fieldset.radio input { clear: none; min-width: 15px; float: left; margin: 3px 0 0 2px; } div.current fieldset.radio label { clear: none; min-width: 45px; float: left; margin: 3px 0 0 2px; } div.current fieldset.checkboxes { float: left; clear: right; } div.current fieldset.checkboxes input { clear: left; min-width: 15px; float: left; margin: 3px 0 0 2px; } div.current fieldset.checkboxes label { clear: right; min-width: 45px; margin: 3px 0 0 2px; } div.current input, div.current span.faux-input, div.current textarea, div.current select { clear: none; float: left; margin: 3px 0 0 2px; } div.current select { margin-bottom: 15px; } div.current table#acl-config th.acl-groups { text-align: left; } div.current table#filter-config th.acl-groups { text-align: left; } div.current table#filter-config select { margin-bottom: 0; } /* -------- Menu Assigments ---------- */ div#menu-assignment { clear: left; } div#menu-assignment ul.menu-links { float: left; width: 49%; } div#menu-assignment ul.menu-links label { clear: none; float: left; margin: 3px 0 0 2px; } div#menu-assignment ul.menu-links input { clear: left; float: left; } button.jform-rightbtn { float: right; margin-right: 0; } p.tab-description { font-size: 1.091em; margin-left: 0; margin-top: 5px; } /* end new parameter styles */ /** * Login Settings */ #login-page input, #login-page select { float: right; clear: none; } #login-page .login { margin: 0 auto; width: 575px; margin-bottom: 100px; } #login-page .pagetitle h2 { margin: -70px 0 30px 0; font-size: 2em; padding: 0; } #login-page p { margin: 0; padding: 0; margin-bottom: 1em; font-size: 1.2em; } #login-page #header { margin-bottom: 100px; } #login-page .login-inst { float: left; width: 35%; } #login-page .login-box { float: right; width: 63%; } #login-page #lock { width: 150px; height: 137px; } #login-page #element-box.login { padding: 20px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } #login-page .button { text-align: right; } #login-page .login-text { text-align: left; width: 40%; float: left; } #form-login { float: right; padding: 1.1em; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } #form-login fieldset { border: none; } #form-login label { display: block; float: left; clear: left; width: 100px; text-align: right; padding: 4px; color: #2c2c2c; font-weight: bold; font-size: 1.4em; margin-bottom: 15px; } #form-login div.button1 div.next { float: left; } #form-login div.button1 a { height: 2.2em; line-height: 2.2em; font-size: 1.5em; cursor: default; padding: 0 15px 0 15px; } .login-submit { border: 0; padding: 0; margin: 0; width: 0; height: 0; } /** * Cpanel Settings */ #cpanel div.icon, .cpanel div.icon { text-align: center; margin-right: 5px; float: left; margin-bottom: 5px; } #cpanel div.icon a, .cpanel div.icon a { display: block; float: left; height: auto; min-height: 97px; width: 108px; color: #2c2c2c; vertical-align: middle; text-decoration: none; font-weight: bold; } #cpanel img, .cpanel img { padding: 10px; margin: 0 auto; } #cpanel span, .cpanel span { display: block; text-align: center; padding: 0 0 5px; } div.cpanel-icons { width: 54%; float: left; } div.cpanel-component { width: 45%; float: right; } /** * Standard Layout Styles */ div.col { float: left; } div.options-section.col { float: right; } div.col1 { float: left; width: 45%; } div.col2 { float: right; width: 45%; } /* Avoid using the width divs. They are here for 3PD Extensions if needed * Use the specific layout divs listed after. See also the th.width entries */ div.width-1 { width: 1%; } div.width-3 { width: 3%; } div.width-5 { width: 5%; } div.width-10 { width: 10%; } div.width-20 { width: 20%; } div.width-30 { width: 30%; } div.width-35 { width: 35%; } div.width-40 { width: 40%; } div.width-45 { width: 45%; } div.width-50 { width: 50%; } div.width-55 { width: 55%; } div.width-60 { width: 60%; } div.width-65 { width: 65%; } div.width-70 { width: 70%; } div.width-80 { width: 80%; } div.width-100 { width: 100%; } .clrlft { clear: left; } .clrrt { clear: right; } .fltlft { float: left; } .fltrt { float: right; } .fltnone { float: none; } /* Layout Divs */ div.main-section { width: 60%; } div.options-section { width: 38%; margin: 10px 10px 10px 0; } /* for bluestork style html */ div.width-40.fltrt { width: 38%; margin: 10px 10px 10px 0; } div.rules-section { width: 98%; margin: 10px; } /** * Form Styles */ fieldset { margin: 2px 10px 2px 10px; padding: 5px; text-align: left; } legend { font-size: 1.3em; font-weight: bold; padding-bottom: 5px; } fieldset p { margin: 10px 0; font-size: 1.2em; } fieldset ol, ol#property-values, fieldset ul, ul#property-values { margin: 0; padding: 0; } fieldset li, ol#property-values li, ul#property-values li { list-style: none; margin: 0; padding: 5px; } fieldset.adminform fieldset.radio, fieldset.panelform fieldset.radio, fieldset.adminform-legacy fieldset.radio { border: 0; float: left; padding: 0; margin: 0 0 5px 0; clear: right; } fieldset.adminform fieldset.radio label, fieldset.panelform fieldset.radio label, fieldset.adminform fieldset.radio span.faux-label, fieldset.panelform fieldset.radio span.faux-label { min-width: 40px; float: left; clear: none; } /* checkboxes */ fieldset.adminform fieldset.checkboxes, fieldset.panelform fieldset.checkboxes, fieldset.adminform-legacy fieldset.checkboxes { border: 0; float: left; padding: 0; margin: 0 0 5px 0; clear: right; } fieldset.adminform fieldset.checkboxes input[type="checkbox"], fieldset.panelform fieldset.checkboxes input[type="checkbox"] { float: left; clear: left; } fieldset.adminform fieldset.checkboxes label, fieldset.panelform fieldset.checkboxes label, fieldset.adminform fieldset.checkboxes span.faux-label, fieldset.panelform fieldset.checkboxes span.faux-label { clear: right; } /* end checkboxes */ /* spacer */ div.current span.spacer > span.before, fieldset.adminform span.spacer > span.before, fieldset.panelform span.spacer > span.before { clear: both; overflow: hidden; height: 0; display: block; } /* end spacer */ fieldset.panelform-legacy label, fieldset.adminform-legacy label, fieldset.panelform-legacy span.faux-label, fieldset.adminform-legacy span.faux-label { min-width: 150px; float: left; } /* JParameter classes on radio button labels */ fieldset.panelform-legacy label.radiobtn-jno, fieldset.panelform-legacy label.radiobtn-jyes, fieldset.panelform-legacy label.radiobtn-show, fieldset.panelform-legacy label.radiobtn-hide, fieldset.panelform-legacy label.radiobtn-off, fieldset.panelform-legacy label.radiobtn-on { min-width: 40px !important; clear: none !important; } #jform_plugdesc-lbl, #jform_description-lbl { font-weight: bold; clear: both; margin-top: 15px; } p.jform_desc { clear: left; } div#jform_ordering { font-size: 1.091em; margin-top: 3px; } fieldset ul.checklist { margin-left: 27px; } fieldset ul.checklist input, fieldset ul.checklist label { float: none; } fieldset ul.checklist input:focus { outline: thin dotted #333333; } fieldset#filter-bar { margin: 0; padding: 5px 10px 5px 10px; float: left; width: 98% } fieldset#filter-bar ol, fieldset#filter-bar ul { list-style: none; margin: 0; padding: 5px 0 0; } fieldset#filter-bar ol li, fieldset#filter-bar ul li { float: left; padding: 0 5px 0 0; } fieldset#filter-bar ol li fieldset, fieldset#filter-bar ul li fieldset { margin: 0; padding: 0; } fieldset#filter-bar .filter-search { float: left; padding-bottom: 3px; } fieldset#filter-bar .filter-select { float: right; } fieldset#filter-bar input#search { width: 10em; } /* Note: these visual cues should be augmented by aria */ .invalid { font-weight: bold; } /* augmented by aria in template javascript */ input.readonly, span.faux-input { border: 0; } .star { color: #cc0000; font-size: 1.2em; } input, select, span.faux-input { font-size: 1.2em; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } span.readonly { float: left; font-size: 1.2em; line-height: 2em; } div.readonly { font-size: 1.2em; line-height: 2em; } div.extdescript { margin-left: 10px; } input[type="button"], input[type="submit"], input[type="reset"] { font-family: Arial, Helvetica, sans-serif; padding: 1px 6px; font-size: 1.2em; line-height: 1.5em; } textarea { font-size: 1.4em; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } input.button { cursor: pointer; } label { font-weight: bold; font-size: 1.1em; } span.faux-label { font-weight: bold; font-size: 1.1em; } label.selectlabel { position: absolute; left: -1000em; } /** * Option or Parameter styles */ .paramrules { padding: 10px; } span.gi { font-weight: bold; margin-right: 5px; } span.gtr { visibility: hidden; margin-right: 5px; } /** * Admintable Styles */ table.admintable td { padding: 3px; font-size: 1em; } table.admintable td.key, table.admintable td.paramlist_key { text-align: right; width: 140px; font-weight: bold; font-size: 1em; } table.admintable td.key label, table.admintable td.paramlist_key label { font-size: 1em; } table.admintable td.paramlist_value label { font-size: 1em; } table.admintable input, table.admintable span.faux-input, table.admintable select { font-size: 1em; } table.paramlist td.paramlist_description { text-align: left; width: 170px; font-weight: normal; } table.admintable td.key.vtop { vertical-align: top; } /** * Admin Form Styles */ fieldset.adminform { margin: 0 10px 10px 10px; overflow: hidden; } .adminformlist .btn.modal{ float: left; margin-top: 7px; } ul.adminformlist, ul.adminformlist li, dl.adminformlist, dl.adminformlist li { margin: 0; padding: 0; list-style: none; } ul.adminformlist pre { font-size: 1.3em; } ul.adminformlist .button2-left, ul.adminformlist .button2-left { margin-top: 5px; } /* Table styles are for use with tabular data */ table.adminform { width: 100%; border-collapse: collapse; margin: 8px 0 10px 0; margin-bottom: 15px; } table.adminform.nospace { margin-bottom: 0; } table.adminform th { font-size: 1.4em; padding: 6px 2px 4px 4px; text-align: left; height: 25px; } table.adminform td { padding: 3px; text-align: left; } table.adminform td#filter-bar { text-align: left; } table.adminform td.helpMenu { text-align: right; } table.adminform tr { padding-left: 10px; padding-right: 10px; } /** * Table formating styles */ td.center, th.center { text-align: center; } /* Avoid using the width classes. They are here for 3PD Extensions if needed * Use the specific layout table headers listed after. See also the div.width entries */ th.width-1 { width: 1%; } th.width-3 { width: 3%; } th.width-5 { width: 5%; } th.width-10 { width: 10%; } th.width-12 { width: 12%; } th.width-15 { width: 15%; } th.width-20 { width: 20%; } th.width-25 { width: 25%; } th.width-30 { width: 30%; } th.width-40 { width: 40%; } /* Table header layout classes */ th.row-number-col { width: 3%; } th.checkmark-col { width: 1%; } th.state-col { width: 5%; } th.ordering-col { width: 10%; } th.ordering-col a { display: block; float: left; margin-left: 3px; } th.ordering-col a img { margin-left: 4px; margin-right: 4px; } .categories th.ordering-col input, .categories td.order input { font-size: 1em; } th.category-col { width: 5%; } th.access-col { width: 10%; } .categories th.access-col { width: 5%; } th.hits-col { width: 5%; } th.id-col { width: 3%; } th.featured-col { width: 5%; } th.created-by-col { width: 15%; } th.date-col { width: 5%; } th.language-col { width: 5%; } th.home-col { width: 5%; } /** * Adminlist Table layout */ table.adminlist { width: 100%; float: left; } table.adminlist td, table.adminlist th { padding: 4px; font-size: 1.2em; } table.adminlist thead th { text-align: center; } table.adminlist thead a:hover { text-decoration: none; } table.adminlist thead th img { vertical-align: middle; } table.adminlist tbody th { font-weight: bold; } /* Table row styles */ table.adminlist tr { padding-left: 30px; padding-right: 30px; } table.adminlist tbody tr { text-align: left; } table.adminlist tbody tr td, table.adminlist tbody tr th { height: 25px; } table.adminlist tfoot tr { text-align: center; } /* Table td/th styles */ table.adminlist tfoot td, table.adminlist tfoot th { text-align: center; } table.adminlist td.order { text-align: center; white-space: nowrap; } table.adminlist td.order span { float: left; width: 20px; text-align: center; } table.adminlist td.order input { text-align: center; width: 3em; font-size: 100%; } /** * Tree indentation & nesting - Up to 10 levels deep so don't go crazy : */ #media-tree_tree ul { list-style: none outside none; margin: 0 10px; } table.adminlist td.indent-4 { padding-left: 4px; } table.adminlist td.indent-19 { padding-left: 19px; } table.adminlist td.indent-34 { padding-left: 34px; } table.adminlist td.indent-49 { padding-left: 49px; } table.adminlist td.indent-64 { padding-left: 64px; } table.adminlist td.indent-79 { padding-left: 79px; } table.adminlist td.indent-94 { padding-left: 94px; } table.adminlist td.indent-109 { padding-left: 109px; } table.adminlist td.indent-124 { padding-left: 124px; } table.adminlist td.indent-139 { padding-left: 139px; } /** * Adminlist buttons */ table.adminlist tr td.btns a { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; padding: 3px 20px; } table.adminlist tr td.btns a:hover, table.adminlist tr td.btns a:active, table.adminlist tr td.btns a:focus { text-decoration: none; } /** * Adminlist lists */ table.adminlist td li { list-style: inside; } /** * Modal Modules styles */ ul#new-modules-list { margin-left: 50px; font-size: 1.4em; line-height: 1.5em; } /** * Utility styles */ /* General Clearing Class */ .clr { clear: both; overflow: hidden; height: 0; } .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .menu-module-list { list-style-position: inside; padding-left: 10px; margin-left: 5px; } /* stu nicholls solution for centering divs */ .container { clear: both; text-decoration: none; } * html .container { display: inline-block; } /* table solution for global config */ table.noshow { width: 100%; border-collapse: collapse; padding: 0; margin: 0; } table.noshow tr { vertical-align: top; } table.noshow fieldset { margin: 15px 7px 7px 7px; } /** * Saving order icon styling in admin tables */ a.saveorder { width: 16px; height: 16px; display: block; overflow: hidden; float: right; margin-right: 8px; } /** * Button styling */ #editor-xtd-buttons { padding: 5px; } button { font-family: Arial, Helvetica, sans-serif; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; margin-right: 3px; margin-left: 3px; } .invalid { font-weight: bold; } /* Button 1 Type */ .button1, .button1 div { height: 1%; float: right; } .button1 { white-space: nowrap; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .button1 a { display: block; height: 2.2em; float: left; line-height: 2.2em; font-size: 1.2em; font-weight: bold; cursor: default; padding: 0 6px 0 6px; /* add padding if you are using the directional images */ /* padding: 0 30px 0 6px; */ } .button1 a:hover, .button1 a:focus { text-decoration: none; } /* Button 2 Type */ .button2-left, .button2-right { float: left; line-height: 1.5em; font-size: 1.2em; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .button2-left.smallsub, .button2-right.smallsub { line-height: 1.2em; font-size: .9em; } .button2-left a, .button2-right a, .button2-left span, .button2-right span { display: block; float: left; cursor: default; } /* these are inactive buttons */ .button2-left span, .button2-right span { cursor: default; } .button2-left .page a, .button2-right .page a, .button2-left .page span, .button2-right .page span, .button2-left .blank a, .button2-right .blank a, .button2-left .blank span, .button2-right .blank span { padding: 0 6px; } .page span, .blank span { font-weight: bold; } .button2-left a:hover, .button2-right a:hover, .button2-left a:focus, .button2-right a:focus { text-decoration: none; } .button2-left a, .button2-left span { padding: 0 24px 0 6px; } .button2-right a, .button2-right span { padding: 0 6px 0 24px; } .button2-left { float: left; margin-left: 5px; } .button2-right { float: left; margin-left: 5px; } /** * Pagination styles */ /* Normal pagination styles */ div.containerpg { position: relative; left: 50%; float: left; clear: left; } div.pagination { position: relative; left: -50%; margin: 0 auto; padding: .5em; } .pagination div.limit { float: left; margin: 0 10px; font-size: 1.2em; height: 1.8em; line-height: 1.8em; } .pagination div.limit label { font-size: 100%; height: 1.8em; line-height: 1.8em; } .pagination div.limit select { font-size: 100%; } /* The Go submittal button */ .pagination button { font-size: 100%; height: 2.0em; line-height: 1.8em; margin-right: 20px; } div.pagination .button2-right, div.pagination .button2-left { font-size: 1.2em; height: 1.6em; line-height: 1.6em; } /* Style if pagination is part of the table (old style) */ table.adminlist .pagination { display: table; padding: 0; margin: 0 auto; font-size: .8em; } table.adminlist .pagination button { font-size: 1.2em; height: 1.6em; line-height: 1.5em; margin-right: 20px; } /** * MCE Editor */ div.toggle-editor { margin-top: 9px; } /** * Tooltips */ .tip { float: left; padding: 5px; max-width: 400px; z-index: 50; } .tip-title { padding: 0; margin: 0; font-size: 120%; margin-top: -15px; padding-top: 15px; padding-bottom: 5px; } .tip-text { font-size: 100%; text-align: left; margin: 0; } /** * Calendar */ a img.calendar { width: 16px; height: 16px; margin-left: 3px; cursor: pointer; vertical-align: middle; } /** * JGrid styles */ a.jgrid:hover { text-decoration: none; } .jgrid span.state { display: inline-block; height: 16px; width: 16px; } .jgrid span.text { display: none; } /** * Icons * The Background Icons for Menus, Toolbars, Quick Icons * are now in the color css files */ /** * General styles */ div.message { text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 1.2em; padding: 3px; margin-bottom: 10px; font-weight: bold; } .helpIndex { border: 0; width: 100%; height: 100%; padding: 0; overflow: auto; } .helpFrame { width: 100%; height: 800px; padding: 0 5px 0 10px; } #treecellhelp { width: 25%; display: block; position: relative; float: left; margin: 0; padding: 2px; overflow: hidden; } #datacellhelp { width: 73%; display: block; float: left; margin: 0; padding: 2px 0 0 0; } .outline { padding: 2px; } /** * Modal Styles */ h2.modal-title { margin-left: 15px; margin-bottom: 0; margin-top: 5px; font-size: 1.8em; padding-bottom: .5em; } ul.menu_types { padding: 0 0 0 15px; width: 95%; margin: 0; } ul.menu_types li, dl.menu_type dd ul li { width: 240px; list-style: none; display: block; float: left; margin-right: 10px; } ul.menu_types li { width: 47%; } dl.menu_type { width: 240px; margin: 0; padding: 0; } dl.menu_type dt { font-weight: bold; font-size: 1.5em; float: left; margin: 13px 0 5px 0; width: 240px; } dl.menu_type dd { clear: left; margin: 0; } dl.menu_type dd a { font-size: 1.2em; } dl.menu_type dd ul li { margin: 0; } ul#new-modules-list { padding: 5px 0 0 15px; width: 95%; margin: 0; list-style: none; } ul#new-modules-list li { list-style: none; display: block; float: left; margin: 0 20px 0 0; width: 47%; } ul#new-modules-list li a { font-size: 1em; line-height: 1.5em; } body.contentpane #filter-bar { font-size: 80%; } body.contentpane input, body.contentpane select { font-size: 120%; } #filter-bar input, #filter-bar select, #filter-bar button { font-size: 110%; } /** * User Accessibility */ /* Skip to Content Structural Styling */ #skiplinkholder a, #skiplinkholder a:link, #skiplinkholder a:visited { display: block; width: 99%; position: absolute; top: 0; left: -200%; z-index: 2; } #skiplinkholder a:focus, #skiplinkholder a:active { left: 0; top: 0; z-index: 100; } #skiplinkholder p { margin: 0; } #skiptargetholder { position: absolute; left: -200%; } /* Skip to Content Visual Styling */ #skiplinkholder a, #skiplinkholder a:link, #skiplinkholder a:visited { text-decoration: underline; padding: 5px; font-size: 1.3em; font-weight: bold; padding-left: 20px; padding-right: 20px; } /* Hide overlayed controls so that keyboarders can get to the modal */ .body-overlayed a, .body-overlayed input, .body-overlayed button { visibility: hidden; } .body-overlayed #sbox-window a, .body-overlayed #sbox-window input, .body-overlayed #sbox-window button { visibility: visible; } /** * Admin Form Styles */ /* For elements that aren't to be seen by users unless the user does something * like clicking on a header to see the collapsed section. */ .element-hidden, .hide { display: none; } .hidebtn { border: 0 !important; padding: 0 !important; margin: 0; width: 0; height: 0; } /* For elements that aren't to be seen by visual users but do need to be read by screenreaders. * Cannot be used for elements that can get focus such as links and form elements */ .element-invisible, .hidelabeltxt { height: 0; overflow: hidden; position: absolute; padding: 0; margin: 0; } /* Firefox has issues styling legend so this is a universal fix for making the legend invisible (i.e. visually it's not there, but screen readers see it */ legend.element-invisible { position: absolute !important; margin: 0; padding: 0; border: 0; margin-left: -10000px; font-size: 1px; height: 0; } fieldset.panelform { overflow: hidden; clear: both; } fieldset.adminform label, fieldset.panelform label, fieldset.adminform span.faux-label, fieldset.panelform span.faux-label { line-height: 2em; clear: left; min-width: 12em; float: left; margin-left: 10px; margin-right: 5px; } fieldset.adminform.long label, fieldset.panelform.long label, fieldset.adminform.long span.faux-label, fieldset.panelform.long span.faux-label { min-width: 18em; } fieldset.adminform fieldset.radio label, fieldset.panelform fieldset.radio label, fieldset.adminform fieldset.radio span.faux-label, fieldset.panelform fieldset.radio span.faux-label { margin-left: 0; } fieldset.adminform input, fieldset.adminform span.faux-input, fieldset.adminform textarea, fieldset.adminform select, fieldset.adminform img, fieldset.adminform button, fieldset.panelform input, fieldset.panelform span.faux-input, fieldset.panelform textarea, fieldset.panelform select, fieldset.panelform img, fieldset.panelform button { float: left; margin: 5px 5px 5px 0; width: auto; } /* -------- Batch Section ---------- */ fieldset.batch { margin: 20px 10px 10px 10px; padding: 10px; } fieldset.batch label { margin: 5px; min-width: 40px; } fieldset.batch button { margin: 3px; } fieldset#batch-choose-action { clear: left; border: 0 none; } fieldset.batch label { float: left; clear: none; } fieldset label#batch-choose-action-lbl { clear: left; margin-top: 15px; } label#batch-language-lbl, label#batch-user-lbl { clear: left; margin-right: 10px; margin-top: 15px; } select#batch-language-id, select#batch-user-id { margin-top: 15px; } select#batch-category-id, select#batch-position-id, select#batch-menu-id { margin-right: 30px; } fieldset.batch select, fieldset.batch input, fieldset.batch img, fieldset.batch button { float: left; } label#batch-access-lbl, label#batch-client-lbl { margin-right: 10px; } div#jform_ordering { font-size: 1.091em; margin-top: 3px; } /* Banner edit */ #jform_impmade, #jform_clicks { width: 30px; } fieldset.panelform label#jform-imp { min-width: 3em; font-size: 1.091em; } fieldset.adminform input#jform_clickurl { width: 20em; } /** * ACL STYLES relocated from com_users/media/grid.css */ a.move_up { display: inline-block; height: 16px; text-indent: -1000em; width: 16px; } span.move_up { display: inline-block; height: 16px; width: 16px; } a.move_down { display: inline-block; height: 16px; text-indent: -1000em; width: 16px; } span.move_down { display: inline-block; height: 16px; width: 16px; } a.grid_false { display: inline-block; height: 16px; text-indent: -1000em; width: 16px; } a.grid_true { display: inline-block; height: 16px; text-indent: -1000em; width: 16px; } a.grid_trash { display: inline-block; height: 16px; text-indent: -1000em; width: 16px; } /** * ACL PANEL STYLES */ div.acl-options { width: 100%; } /* All Tabs */ table.aclsummary-table, table.aclmodify-table { border-collapse: collapse; width: 100%; font-size: 1.091em; } td.col1 { font-size: 1.091em; text-align: left; padding: 4px; } table.aclsummary-table caption, table.aclmodify-table caption { display: none; } /* Summary Tab */ table.aclsummary-table th.col1 { width: 25%; } table.aclsummary-table th.col2, table.aclsummary-table th.col3, table.aclsummary-table th.col4, table.aclsummary-table th.col5, table.aclsummary-table th.col6 { width: 15%; vertical-align: bottom; text-align: center; } /* Icons (background images moved to color css files */ span.icon-16-unset, span.icon-16-allowed, span.icon-16-denied, span.icon-16-locked { padding-left: 18px; } label.icon-16-allow, label.icon-16-deny, a.icon-16-allow, a.icon-16-deny, a.icon-16-allowinactive, a.icon-16-denyinactive { display: block; height: 16px; width: 16px; margin: 0 auto; } label.icon-16-allow { text-indent: -9999em; position: relative; left: 40%; } label.icon-16-deny { text-indent: -9999em; position: relative; left: 40%; } /* Create, Edit, Edit State & Delete Tabs */ table.aclmodify-table th.col2, table.aclmodify-table th.col3, table.aclmodify-table th.col4 { width: 20%; vertical-align: bottom; text-align: center; } table.aclmodify-table select { margin: 1px; } table.aclsummary-table td label, table.aclmodify-table td label { min-width: 20px; } /* ACL footer/legend */ ul.acllegend { list-style: none; font-size: 1.091em; padding-bottom: 10px; } ul.acllegend li { display: block; float: left; padding-right: 20px; margin: 15px 0 15px 10px; } ul.acllegend li.acl-allowed { padding-left: 20px; padding-right: 10px; } ul.acllegend li.acl-denied { padding-left: 20px; padding-right: 20px; } ul.acllegend li.acl-editgroups { padding-right: 10px; } ul.acllegend li.acl-resetbtn { padding-right: 0; } li.acl-editgroups, li.acl-resetbtn { display: block; float: left; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } li.acl-editgroups a, li.acl-resetbtn a { padding: 6px; cursor: default; } li.acl-editgroups a:hover, li.acl-resetbtn a:hover, li.acl-editgroups a:focus, li.acl-resetbtn a:focus { text-decoration: none; cursor: default; } li.acl-editgroups:hover, li.acl-resetbtn:hover, li.acl-editgroups:focus, li.acl-resetbtn:focus { text-decoration: none; cursor: default; } table#acl-config { width: 100%; margin-top: 15px; } table#acl-config th, table#acl-config td { height: 2em; background: #f9fade; text-align: center; vertical-align: middle; } table#acl-config th.acl-groups { padding-left: 8px; font-weight: bold; text-align: left; } table#acl-config th.acl-groups span.gi { margin-right: 2px; } table#acl-config td { width: 9em; } table#acl-config td select { float: none; } .acl-action { font-size: 1.091em; margin: auto 0; } .acl-groups { font-size: 1.091em; font-weight: normal; } label#jform_rules-lbl { float: none; white-space: nowrap; display: none; visibility: hidden; } label#jform_filters-lbl { float: none; white-space: nowrap; display: none; visibility: hidden; } /** * Options modal- config */ ul.config-option-list, ul.config-option-list li { margin: 0; padding: 0; list-style: none; } ul.config-option-list fieldset { margin: 0; padding-left: 0; padding-right: 0; } /* * * Permission Rules */ #permissions-sliders { margin-top: 15px; } #permissions-sliders ul#rules, #permissions-sliders ul#rules ul { margin: 0 !important; padding: 0 !important; list-style-type: none; } #permissions-sliders ul#rules li { margin: 0; padding: 0; } #permissions-sliders ul#rules table.group-rules { border-collapse: collapse; margin: 5px; width: 100%; } #permissions-sliders ul#rules table.group-rules td { padding: 4px; vertical-align: middle; text-align: left; overflow: hidden; } #permissions-sliders ul#rules table.group-rules th { font-size: 1.2em; overflow: hidden; font-weight: bold; } #permissions-sliders .panel { margin-bottom: 3px; margin-left: 0; border: 0; } #permissions-sliders p.rule-desc { font-size: 1.1em; } #permissions-sliders div.rule-notes { font-size: 1.1em; } ul#rules table.group-rules td label { margin: 0 !important; line-height: 1.1em; } ul#rules table.group-rules td span { font-size: 1.1em; padding-bottom: 4px; } ul#rules table.group-rules td span span { font-size: 100%; } table.group-rules td select { margin: 0 !important; } #permissions-sliders ul#rules .mypanel { padding: 0; line-height: 1.3em; } #permissions-sliders .mypanel table.group-rules caption { font-size: 1.3em; } #permissions-sliders ul#rules { padding: 5px; } #permissions-sliders ul#rules table.group-rules th { text-align: left; padding: 4px; } #permissions-sliders ul#rules table.group-rules td label { min-width: 1em; } #permissions-sliders .pane-toggler span { padding-left: 20px; } #permissions-sliders .pane-toggler-down span { padding-left: 20px; } #permissions-sliders .pane-toggler-down span.level, #permissions-sliders .pane-toggler span.level { padding: 0; } /* * Debug styles */ .swatch { text-align: center; padding: 0 15px 0 15px; } /* Tab changes for accessibility */ dl.tabs dt h3 { padding: 0; font-size: 100%; } /** * Helpmenus */ ul.helpmenu li { float: right; margin: 10px; padding: 0; list-style-type: none; font-weight: bold; } /* CSS file for Accessible Admin Menu * based on Matt Carrolls' son of suckerfish * with javascript by Bill Tomczak */ /* Note: set up the font-size on the id and used 100% on the elements. If ul/li/a are different ems, then the shifting back via non-js keyboard doesn't work properly */ /** * Menu Styling */ #menu { /* this is on the main ul */ position: relative; z-index: 100; padding: 0; margin: 0; width: 100%; list-style: none; font-size: 1.2em; font-weight: bold; } #menu ul { /* all lists */ padding: 0; margin: 0; list-style: none; font-size: 100%; } #menu ul li.separator { margin-bottom: 1em; } #menu a { padding: 0.35em 2.5em 0.35em 2em; vertical-align: middle; display: block; /* width: 10em; */ text-decoration: none; font-size: 100%; } #menu li { /* all list items */ float: left; /* width: 12em; width needed or else Opera goes nuts */ font-size: 100%; } #menu li a { white-space: nowrap; } #menu li li a { margin-bottom: 1px; margin-top: 1px; width: 10em; } #menu li.disabled a:hover, #menu li.disabled a:focus, #menu li.disabled a { cursor: default; } #menu li ul { /* second-level lists */ position: absolute; width: 16em; margin-left: -1000em; /* using left instead of display to hide menus because display: none isn't read by screen readers */ } #menu li li { /* second-level row */ border: none; width: 16em; } #menu li ul ul { /* third-and-above-level lists */ margin: -2.3em 0 0 -1000em; /* top margin is equal to parent line height+bottom padding */ } #menu li:hover ul ul, #menu li.sfhover ul ul { margin-left: -1000em; } #menu li:hover ul, #menu li.sfhover ul { /* lists nested under hovered list items */ margin-left: 0; } #menu li li:hover ul, #menu li li.sfhover ul { margin-left: 16em; } /** * Menu Icons * These icons are used on the Administrator menu * The classes are constructed dynamically when the menu is generated */ [class^="menu-"], [class*=" menu-"] { background-position: 3px 50% !important; } .menu-archive { background-image: url(../images/menu/icon-16-archive.png); } .menu-article { background-image: url(../images/menu/icon-16-article.png); } .menu-banners { background-image: url(../images/menu/icon-16-banner.png); } .menu-banners-clients { background-image: url(../images/menu/icon-16-banner-client.png); } .menu-banners-tracks { background-image: url(../images/menu/icon-16-banner-tracks.png); } .menu-banners-cat { background-image: url(../images/menu/icon-16-banner-categories.png); } .menu-category { background-image: url(../images/menu/icon-16-category.png); } .menu-checkin { background-image: url(../images/menu/icon-16-checkin.png); } .menu-clear { background-image: url(../images/menu/icon-16-clear.png); } .menu-component { background-image: url(../images/menu/icon-16-component.png); } .menu-config { background-image: url(../images/menu/icon-16-config.png); } .menu-contact { background-image: url(../images/menu/icon-16-contacts.png); } .menu-contact-cat { background-image: url(../images/menu/icon-16-contacts-categories.png); } .menu-content { background-image: url(../images/menu/icon-16-content.png); } .menu-cpanel { background-image: url(../images/menu/icon-16-cpanel.png); } .menu-default { background-image: url(../images/menu/icon-16-default.png); } .menu-featured { background-image: url(../images/menu/icon-16-featured.png); } .menu-groups { background-image: url(../images/menu/icon-16-groups.png); } .menu-help { background-image: url(../images/menu/icon-16-help.png); } .menu-help-this { background-image: url(../images/menu/icon-16-help-this.png); } .menu-help-forum { background-image: url(../images/menu/icon-16-help-forum.png); } .menu-help-docs { background-image: url(../images/menu/icon-16-help-docs.png); } .menu-help-jed { background-image: url(../images/menu/icon-16-help-jed.png); } .menu-help-jrd { background-image: url(../images/menu/icon-16-help-jrd.png); } .menu-help-community { background-image: url(../images/menu/icon-16-help-community.png); } .menu-help-security { background-image: url(../images/menu/icon-16-help-security.png); } .menu-help-dev { background-image: url(../images/menu/icon-16-help-dev.png); } .menu-help-shop { background-image: url(../images/menu/icon-16-help-shop.png); } .menu-info { background-image: url(../images/menu/icon-16-info.png); } .menu-install { background-image: url(../images/menu/icon-16-install.png); } .menu-joomlaupdate { background-image: url(../images/menu/icon-16-install.png); } .menu-language { background-image: url(../images/menu/icon-16-language.png); } .menu-levels { background-image: url(../images/menu/icon-16-levels.png); } .menu-logout { background-image: url(../images/menu/icon-16-logout.png); } .menu-maintenance { background-image: url(../images/menu/icon-16-maintenance.png); } .menu-massmail { background-image: url(../images/menu/icon-16-massmail.png); } .menu-media { background-image: url(../images/menu/icon-16-media.png); } .menu-menu { background-image: url(../images/menu/icon-16-menu.png); } .menu-menumgr { background-image: url(../images/menu/icon-16-menumgr.png); } .menu-messages { background-image: url(../images/menu/icon-16-messaging.png); } .menu-messages-add { background-image: url(../images/menu/icon-16-new-privatemessage.png); } .menu-messages-read { background-image: url(../images/menu/icon-16-messages.png); } .menu-module { background-image: url(../images/menu/icon-16-module.png); } .menu-newarticle { background-image: url(../images/menu/icon-16-newarticle.png); } .menu-newcategory { background-image: url(../images/menu/icon-16-newcategory.png); } .menu-newgroup { background-image: url(../images/menu/icon-16-newgroup.png); } .menu-newlevel { background-image: url(../images/menu/icon-16-newlevel.png); } .menu-newuser { background-image: url(../images/menu/icon-16-newuser.png); } .menu-plugin { background-image: url(../images/menu/icon-16-plugin.png); } .menu-profile { background-image: url(../images/menu/icon-16-user.png); } .menu-purge { background-image: url(../images/menu/icon-16-purge.png); } .menu-readmess { background-image: url(../images/menu/icon-16-readmess.png); } .menu-section { background-image: url(../images/menu/icon-16-section.png); } .menu-static { background-image: url(../images/menu/icon-16-static.png); } .menu-stats { background-image: url(../images/menu/icon-16-stats.png); } .menu-themes { background-image: url(../images/menu/icon-16-themes.png); } .menu-trash { background-image: url(../images/menu/icon-16-trash.png); } .menu-user { background-image: url(../images/menu/icon-16-user.png); } .menu-user-note { background-image: url(../images/menu/icon-16-user-note.png); } .menu-delete { background-image: url(../images/menu/icon-16-delete.png); } .menu-help-trans { background-image: url(../images/menu/icon-16-help-trans.png); } .menu-newsfeeds { background-image: url(../images/menu/icon-16-newsfeeds.png); } .menu-newsfeeds-cat { background-image: url(../images/menu/icon-16-newsfeeds-cat.png); } .menu-redirect { background-image: url(../images/menu/icon-16-redirect.png); } .menu-search { background-image: url(../images/menu/icon-16-search.png); } .menu-finder { background-image: url(../images/menu/icon-16-search.png); } .menu-weblinks { background-image: url(../images/menu/icon-16-links.png); } .menu-weblinks-cat { background-image: url(../images/menu/icon-16-links-cat.png); } .menu-tags { background-image: url(../images/menu/icon-16-tags.png); } .menu-postinstall { background-image: url(../images/menu/icon-16-generic.png); } /** * Extra positioning rules for limited noscript keyboard accessibility * need the backgrounds here to keep the background as the nav background * since it is overlaying other content. * Using margin-left instead of left so that can move back without javascript * display downlevel ul */ #menu li a:focus+ul { margin-left: 0; } #menu li li a:focus+ul { margin-left: 1016em; } /* bring back the focus elements into view */ #menu li li a:focus { margin-left: 1000em; width: 10em; } #menu li li li a:focus { margin-left: 2016em; width: 10em; } #menu li:hover a:focus, #menu li.sfhover a.sffocus { margin-left: 0; } #menu li li:hover a:focus+ul, #menu li li.sfhover a.sffocus+ul { margin-left: 16em; } /** * Sidebar styling */ #sidebar { float:left; margin: 15px 5px; } /** * Submenu styling */ #submenu { list-style: none; padding: 0; margin: 0; /* border-bottom plus padding-bottom is the technique */ padding-bottom: 2.5em; line-height: 2em; } #submenu ul, #submenu li { display: inline; list-style-type: none; margin: 0; padding: 0; } #submenu li, #submenu span.nolink { float: left; font-weight: bold; margin-right: 8px; padding: 2px 10px 2px 10px; text-decoration: none; cursor: pointer; -moz-border-radius-topright: 3px; -moz-border-radius-topleft: 3px; -webkit-border-top-right-radius: 3px; -webkit-border-top-left-radius: 3px; border-top-right-radius: 3px; border-top-left-radius: 3px; } #submenu span.nolink { color: #999; } #submenu li.active, #submenu span.nolink.active { cursor: default; } #submenu li.active a, #submenu span.nolink.active, #submenu li a:hover, #submenu li a:focus { text-decoration: none; } /* -- CUSTOM LANG STRINGS STYLES ----------- */ .red { font-weight: bold; color: #c00; } /* -- OTHER STYLES ----------- */ .pre_message { font-size: 1.3em; } /* -- Update check badges -- */ span.update-badge { background-image: -moz-linear-gradient(center bottom, #FF0000 41%, #FC7E7E 79%); background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.41, rgb(255, 0, 0)), color-stop(0.79, rgb(252, 126, 126))); border: 2px solid white; border-radius: 1.5em 1.5em 1.5em 1.5em; color: white; display: block; float: left; font-size: 1.2em; font-weight: bold; height: 1.2em; left: 60px; min-width: 1em; padding: 0 0.1em 0; position: relative; top: -88px; } /* User Notes */ .unotes ul, .unotes ol { list-style: none; list-style-position: inside; padding-left: 0; padding-right: 0; } .unotes div.utitle { padding: 10px; float: left; font-size: 1.2em; line-height: 1.2em; } .unotes h4 { margin-top: 0; margin-bottom: 0; font-size: 1.3em; } .unotes .ubody { padding-left: 10px; padding-right: 10px; font-size: 1.2em; line-height: 1.5em; } .unotes p { padding-bottom: 10px; } /* com-install styling */ div#database-sliders { margin: 10px; } fieldset.uploadform { margin-top: 10px; margin-bottom: 10px; } /* Installer Database */ #installer-database, #installer-discover, #installer-update, #installer-warnings { margin-top: 10px; } #installer-database #sidebar { float: none } #installer-database p.warning { padding-left: 20px; } #installer-database p.nowarning { padding-left: 20px; } /* Spinner */ .joomlaupdate_spinner { float: left; margin-right: 15px; } .btn-group { position: relative; display: inline-block; } .btn-group + .btn-group { margin-left: 5px; } .btn-group > .btn { position: relative; float: left; margin-left: -1px; } .icon-48-cpanel { height: 50px; width: 50%; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.05); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); } .well-large { padding: 24px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .well-small { padding: 9px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } /* Striped */ .list-striped, .row-striped { list-style: none; line-height: 18px; text-align: left; vertical-align: middle; border-top: 1px solid #dddddd; margin-left: 0; font-size: 1.2em; padding: 9px; } .list-striped li, .list-striped dd, .row-striped .row, .row-striped .row-fluid { border-bottom: 1px solid #dddddd; padding: 8px; } .list-striped li:nth-child(odd), .list-striped dd:nth-child(odd), .row-striped .row:nth-child(odd), .row-striped .row-fluid:nth-child(odd) { background-color: #f9f9f9; } .list-striped li:hover, .list-striped dd:hover, .row-striped .row:hover, .row-striped .row-fluid:hover { background-color: #f5f5f5; } .row-striped .row-fluid { width: 97%; } .row-striped .row-fluid [class*="span"] { min-height: 10px; } .alert { padding: 8px 35px 8px 14px; margin-bottom: 18px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); background-color: #fcf8e3; border: 1px solid #fbeed5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #c09853; font-size: 120%; } .alert-heading { color: inherit; } .alert .close { position: relative; right: -30px; top: -5px; line-height: 18px; float: right; font-size: 20px; font-weight: bold; } .alert-success { background-color: #dff0d8; border-color: #d6e9c6; color: #468847; } .alert-danger, .alert-error { background-color: #f2dede; border-color: #eed3d7; color: #b94a48; } .alert-info { background-color: #d9edf7; border-color: #bce8f1; color: #3a87ad; } .alert-block { padding-top: 14px; padding-bottom: 14px; } .alert-block > p, .alert-block > ul { margin-bottom: 0; } .alert-block p + p { margin-top: 5px; } .btn-group > .btn:hover, .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active { z-index: 2; } .btn-group > .btn { position: relative; float: left; margin-left: -1px; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } table { max-width: 100%; background-color: transparent; border-collapse: collapse; border-spacing: 0; } .table { width: 100%; margin-bottom: 18px; } .tab-content > .tab-pane, .pill-content > .pill-pane { display: none; } .tab-content > .active, .pill-content > .active { display: block; } .tabs-below > .nav-tabs { border-top: 1px solid #ddd; } #status .btn-toolbar, #status p { margin: 0px; } .navbar .btn-group { margin: 0; padding: 5px 5px 6px; } /** * Media */ .media .btn { margin: 10px 20px; } .thumbnails > li { list-style: none outside none; float: left; margin-bottom: 18px; margin-left: 20px; } #mediamanager-form { margin: 10px; } .is-tagbox { float: left; } /* Item associations */ .item-associations { margin: 0; } .item-associations li { list-style: none; display: inline-block; margin: 0 0 3px 0; } .item-associations li a, table.adminlist .item-associations li a { color: #ffffff; } .hidden { display: none; visibility: hidden; } // Bootstrap Tooltips (need to load last, something is overriding these styles in the CSS, debug later ;-) ) @import "../../../../media/jui/less/tooltip.less"; .tooltip { max-width: 400px; } .tooltip-inner { max-width: none; text-align: left; text-shadow: none; } th .tooltip-inner { font-weight: normal; } .tooltip.hasimage { opacity: 1; } fieldset.panelform .tooltip img { float: none; margin: 0; } //Toggle editor button div.toggle-editor { float: right; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } .module-edit { display: inline-block; } .break-word { word-break: break-all; word-wrap: break-word; } .muted { color: #999; } PK���\ +"��2administrator/templates/hathor/less/variables.lessnu�[���// Variables.less // Variables to customize the look and feel of Bootstrap // ----------------------------------------------------- // GLOBAL VALUES // -------------------------------------------------- // Grays // ------------------------- @black: #000; @grayDarker: #222; @grayDark: #333; @gray: #555; @grayLight: #999; @grayLighter: #eee; @white: #fff; // Accent colors // ------------------------- @blue: #049cdb; @blueDark: #0064cd; @green: #46a546; @red: #9d261d; @yellow: #ffc40d; @orange: #f89406; @pink: #c3325f; @purple: #7a43b6; // Scaffolding // ------------------------- @bodyBackground: @white; @textColor: @grayDark; // Links // ------------------------- @linkColor: #08c; @linkColorHover: darken(@linkColor, 15%); // Typography // ------------------------- @sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif; @serifFontFamily: Georgia, "Times New Roman", Times, serif; @monoFontFamily: Menlo, Monaco, Consolas, "Courier New", monospace; @baseFontSize: 13px; @baseFontFamily: @sansFontFamily; @baseLineHeight: 18px; @altFontFamily: @serifFontFamily; @headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily @headingsFontWeight: bold; // instead of browser default, bold @headingsColor: inherit; // empty to use BS default, @textColor // Tables // ------------------------- @tableBackground: transparent; // overall background-color @tableBackgroundAccent: #f9f9f9; // for striping @tableBackgroundHover: #f5f5f5; // for hover @tableBorder: #ddd; // table and cell border // Buttons // ------------------------- @btnBackground: @white; @btnBackgroundHighlight: darken(@white, 10%); @btnBorder: #ccc; @btnPrimaryBackground: #2384d3; @btnPrimaryBackgroundHighlight: #15497c; @btnInfoBackground: #5bc0de; @btnInfoBackgroundHighlight: #2f96b4; @btnSuccessBackground: #62c462; @btnSuccessBackgroundHighlight: #51a351; @btnWarningBackground: lighten(@orange, 15%); @btnWarningBackgroundHighlight: @orange; @btnDangerBackground: #ee5f5b; @btnDangerBackgroundHighlight: #bd362f; @btnInverseBackground: @gray; @btnInverseBackgroundHighlight: @grayDarker; // Forms // ------------------------- @inputBackground: @white; @inputBorder: #ccc; @inputBorderRadius: 3px; @inputDisabledBackground: @grayLighter; @formActionsBackground: #f5f5f5; // Dropdowns // ------------------------- @dropdownBackground: @white; @dropdownBorder: rgba(0,0,0,.2); @dropdownLinkColor: @grayDark; @dropdownLinkColorHover: @white; @dropdownLinkBackgroundHover: @linkColor; @dropdownDividerTop: #e5e5e5; @dropdownDividerBottom: @white; // COMPONENT VARIABLES // -------------------------------------------------- // Z-index master list // ------------------------- // Used for a bird's eye view of components dependent on the z-axis // Try to avoid customizing these :) @zindexDropdown: 1000; @zindexPopover: 1010; @zindexTooltip: 1020; @zindexFixedNavbar: 1030; @zindexModalBackdrop: 1040; @zindexModal: 1050; // Sprite icons path // ------------------------- @iconSpritePath: "../img/glyphicons-halflings.png"; @iconWhiteSpritePath: "../img/glyphicons-halflings-white.png"; // Input placeholder text color // ------------------------- @placeholderText: @grayLight; // Hr border color // ------------------------- @hrBorder: @grayLighter; // Navbar // ------------------------- @navbarHeight: 40px; @navbarBackground: @grayDarker; @navbarBackgroundHighlight: @grayDark; @navbarText: @grayLight; @navbarLinkColor: @grayLight; @navbarLinkColorHover: @white; @navbarLinkColorActive: @navbarLinkColorHover; @navbarLinkBackgroundHover: transparent; @navbarLinkBackgroundActive: @navbarBackground; @navbarSearchBackground: lighten(@navbarBackground, 25%); @navbarSearchBackgroundFocus: @white; @navbarSearchBorder: darken(@navbarSearchBackground, 30%); @navbarSearchPlaceholderColor: #ccc; @navbarBrandColor: @navbarLinkColor; // Hero unit // ------------------------- @heroUnitBackground: @grayLighter; @heroUnitHeadingColor: inherit; @heroUnitLeadColor: inherit; // Form states and alerts // ------------------------- @warningText: #c09853; @warningBackground: #fcf8e3; @warningBorder: darken(spin(@warningBackground, -10), 3%); @errorText: #b94a48; @errorBackground: #f2dede; @errorBorder: darken(spin(@errorBackground, -10), 3%); @successText: #468847; @successBackground: #dff0d8; @successBorder: darken(spin(@successBackground, -10), 5%); @infoText: #3a87ad; @infoBackground: #d9edf7; @infoBorder: darken(spin(@infoBackground, -10), 7%); // GRID // -------------------------------------------------- // Default 940px grid // ------------------------- @gridColumns: 12; @gridColumnWidth: 60px; @gridGutterWidth: 20px; @gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1)); // Fluid grid // ------------------------- @fluidGridColumnWidth: 6.382978723%; @fluidGridGutterWidth: 2.127659574%; // Login // ------------------------- @loginBackground: #142849; @loginBackgroundHighlight: #165387; // Header // ------------------------- @headerBackground: #1a3867; @headerBackgroundHighlight: #17568c;PK���\���q�q�8administrator/templates/hathor/less/colour_baseline.lessnu�[���// colour_baseline.less // // Baseline CSS for the Hathor colours. // Compilers should include this in their colour's imports, but not directly // compile using this file. // ----------------------------------------------------- // Core variables and mixins @import "../../../../media/jui/less/mixins.less"; // Bootstrap Buttons // Using override for Hathor to target specific instances only @import "buttons.less"; // Bootstrap Forms // Using override for Hathor since we're not pulling in all Bootstrap form styles @import "forms.less"; // Bootstrap Labels and Badges @import "../../../../media/jui/less/labels-badges.less"; /* * General styles */ body { background-color: @bodyBackground; color: @textColor; } h1 { color: @textColor; } a:link { color: @linkColor; } a:visited { color: @linkColor; } /* * Overall Styles */ #header { background: @bodyBackground url(../images/j_logo.png) no-repeat; } #header h1.title { color: @textColor; } #nav { #gradient > .vertical(@gradientTop, @gradientBottom); border: 1px solid @mainBorder; } #content { background: @bodyBackground; } #no-submenu { border-bottom: 1px solid @mainBorder; } #element-box { background: @bodyBackground; border-right: 1px solid @mainBorder; border-bottom: 1px solid @mainBorder; border-left: 1px solid @mainBorder; } #element-box.login { border-top: 1px solid @mainBorder; } /* * Various Styles */ .enabled, .success, .allow, span.writable { color: @successText; } .disabled, p.error, .warning, .deny, span.unwritable { color: @errorText; } .nowarning { color: @textColor; } .none, .protected { color: @mainBorder; } span.note { background: @bodyBackground; color: @textColor; } div.checkin-tick { background: url(../images/admin/tick.png) 20px 50% no-repeat; } /* * Overlib */ .ol-foreground { background-color: @altBackground; } .ol-background { background-color: @successText; } .ol-textfont { color: @textColor; } .ol-captionfont { color: @bodyBackground; } .ol-captionfont a { color: @linkColor; } /* * Subheader, toolbar, page title */ div.subheader .padding { background: @bodyBackground; } .pagetitle h2 { color: @textColor; } div.configuration { color: @textColor; background-image: url(../images/menu/icon-16-config.png); background-repeat: no-repeat; } div.toolbar-box { border-right: 1px solid @mainBorder; border-bottom: 1px solid @mainBorder; border-left: 1px solid @mainBorder; background: @bodyBackground; } div.toolbar-list li { color: @textColor; } div.toolbar-list li.divider { border-right: 1px dotted @hoverBackground; } div.toolbar-list a { border-left: 1px solid @hoverBackground; border-top: 1px solid @hoverBackground; border-right: 1px solid @mainBorder; border-bottom: 1px solid @mainBorder; background: @altBackground; } div.toolbar-list a:hover { border-left: 1px solid @NWBorder; border-top: 1px solid @NWBorder; border-right: 1px solid @SEBorder; border-bottom: 1px solid @SEBorder; background: @hoverBackground; color: @toolbarColor; } div.btn-toolbar { margin-left: 5px; padding-top: 3px; } div.btn-toolbar li.divider { border-right: 1px dotted @hoverBackground; } div.btn-toolbar div.btn-group button { border-left: 1px solid @hoverBackground; border-top: 1px solid @hoverBackground; border-right: 1px solid @mainBorder; border-bottom: 1px solid @mainBorder; #gradient > .vertical(@gradientTop, @gradientBottom); padding: 5px 4px 5px 4px; } div.btn-toolbar div.btn-group button:hover { border-left: 1px solid @NWBorder; border-top: 1px solid @NWBorder; border-right: 1px solid @SEBorder; border-bottom: 1px solid @SEBorder; background: @hoverBackground; color: @toolbarColor; cursor: pointer; } div.btn-toolbar a { border-left: 1px solid @hoverBackground; border-top: 1px solid @hoverBackground; border-right: 1px solid @mainBorder; border-bottom: 1px solid @mainBorder; #gradient > .vertical(@gradientTop, @gradientBottom); padding: 6px 5px; text-align: center; white-space: nowrap; font-size: 1.2em; text-decoration: none; } div.btn-toolbar a:hover { border-left: 1px solid @NWBorder; border-top: 1px solid @NWBorder; border-right: 1px solid @SEBorder; border-bottom: 1px solid @SEBorder; background: @hoverBackground; color: @toolbarColor; cursor: pointer; } div.btn-toolbar div.btn-group button.inactive { background: @altBackground; } /* * Pane Slider pane Toggler styles */ .pane-sliders .title { color: @textColor; } .pane-sliders .panel { border: 1px solid @mainBorder; } .pane-sliders .panel h3 { #gradient > .vertical(@gradientTop, @gradientBottom); color: @linkColor; } .pane-sliders .panel h3:hover { background: @hoverBackground; } .pane-sliders .panel h3:hover a { text-decoration: none; } .pane-sliders .adminlist { border: 0 none; } .pane-sliders .adminlist td { border: 0 none; } .pane-toggler span { background: transparent url(../images/j_arrow.png) 5px 50% no-repeat; } .pane-toggler-down span { background: transparent url(../images/j_arrow_down.png) 5px 50% no-repeat; } .pane-toggler-down { border-bottom: 1px solid @mainBorder; } /* * Tabs */ dl.tabs dt { border: 1px solid @mainBorder; #gradient > .vertical(@gradientTop, @gradientBottom); color: @linkColor; } dl.tabs dt:hover { background: @hoverBackground; } dl.tabs dt.open { background: @bodyBackground; border-bottom: 1px solid @bodyBackground; color: @textColor; } dl.tabs dt.open a:visited { color: @textColor; } dl.tabs dt a:hover { text-decoration: none; } dl.tabs dt a:focus { text-decoration: underline; } div.current { border: 1px solid @mainBorder; background: @bodyBackground; } /* * New parameter styles */ div.current fieldset { border: none 0; } div.current fieldset.adminform { border: 1px solid @mainBorder; } /* * Login Settings */ #login-page .pagetitle h2 { background: transparent; } #login-page #header { border-bottom: 1px solid @mainBorder; } #login-page #lock { background: url(../images/j_login_lock.png) 50% 0 no-repeat; } #login-page #element-box.login { #gradient > .vertical(@gradientTop, @gradientBottom); } #form-login { background: @bodyBackground; border: 1px solid @mainBorder; } #form-login label { color: @textColor; } #form-login div.button1 a { color: @linkColor; } /* * Cpanel Settings */ #cpanel div.icon a, .cpanel div.icon a { color: @linkColor; border-left: 1px solid @hoverBackground; border-top: 1px solid @hoverBackground; border-right: 1px solid @mainBorder; border-bottom: 1px solid @mainBorder; #gradient > .vertical(@gradientTop, @gradientBottom); } #cpanel div.icon a:hover, #cpanel div.icon a:focus, .cpanel div.icon a:hover, .cpanel div.icon a:focus { border-left: 1px solid @NWBorder; border-top: 1px solid @NWBorder; border-right: 1px solid @SEBorder; border-bottom: 1px solid @SEBorder; color: @linkColor; background: @hoverBackground; } /* * Form Styles */ fieldset { border: 1px @mainBorder solid; } legend { color: @textColor; } fieldset ul.checklist input:focus { outline: thin dotted @textColor; } fieldset#filter-bar { border-top: 0 solid @mainBorder; border-right: 0 solid @mainBorder; border-bottom: 1px solid @mainBorder; border-left: 0 solid @mainBorder; } fieldset#filter-bar ol, fieldset#filter-bar ul { border: 0; } fieldset#filter-bar ol li fieldset, fieldset#filter-bar ul li fieldset { border: 0; } /* Note: these visual cues should be augmented by aria */ .invalid { color: @errorText; } /* must be augmented by aria at the same time if changed dynamically by js aria-invalid=true or aria-invalid=false */ input.invalid { border: 1px solid @errorText; } /* augmented by aria in template javascript */ input.readonly, span.faux-input { border: 0; } input.required { background-color: @inputBackground; } input.disabled { background-color: @disabledBackground; } input, select, span.faux-input { background-color: @bodyBackground; border: 1px solid @mainBorder; } /* Inputs used as buttons */ input[type="button"], input[type="submit"], input[type="reset"] { color: @linkColor; #gradient > .vertical(@gradientTop, @gradientBottom); } input[type="button"]:hover, input[type="button"]:focus, input[type="submit"]:hover, input[type="submit"]:focus, input[type="reset"]:hover, input[type="reset"]:focus { background: @hoverBackground; } textarea { background-color: @bodyBackground; border: 1px solid @mainBorder; } input:focus, select:focus, textarea:focus, option:focus, input:hover, select:hover, textarea:hover, option:hover { background-color: @hoverBackground; color: @linkColor; } /* * Option or Parameter styles */ .paramrules { background: @altBackground; } span.gi { color: @mainBorder; } /* * Admintable Styles */ table.admintable td.key, table.admintable td.paramlist_key { background-color: @altBackground; color: @textColor; border-bottom: 1px solid @mainBorder; border-right: 1px solid @mainBorder; } table.paramlist td.paramlist_description { background-color: @altBackground; color: @textColor; border-bottom: 1px solid @mainBorder; border-right: 1px solid @mainBorder; } /* * Admin Form Styles */ fieldset.adminform { border: 1px solid @mainBorder; } /* * Table styles are for use with tabular data */ table.adminform { background-color: @bodyBackground; } table.adminform tr.row0 { background-color: @bodyBackground; } table.adminform tr.row1 { background-color: @hoverBackground; } table.adminform th { color: @textColor; background: @bodyBackground; } table.adminform tr { border-bottom: 1px solid @mainBorder; border-right: 1px solid @mainBorder; } /* * Adminlist Table layout */ table.adminlist { border-spacing: 1px; background-color: @bodyBackground; color: @textColor; } table.adminlist.modal { border-right: 1px solid @mainBorder; border-left: 1px solid @mainBorder; } table.adminlist a { color: @linkColor; } table.adminlist thead th { background: @bodyBackground; color: @textColor; border-bottom: 1px solid @mainBorder; } /* * Table row styles */ table.adminlist tbody tr { background: @bodyBackground; } table.adminlist tbody tr.row1 { background: @bodyBackground; } table.adminlist tbody tr.row1:last-child td, table.adminlist tbody tr.row1:last-child th { border-bottom: 1px solid @mainBorder; } table.adminlist tbody tr.row0:hover td, table.adminlist tbody tr.row1:hover td, table.adminlist tbody tr.row0:hover th, table.adminlist tbody tr.row1:hover th, table.adminlist tbody tr.row0:focus td, table.adminlist tbody tr.row1:focus td, table.adminlist tbody tr.row0:focus th, table.adminlist tbody tr.row1:focus th { background-color: @hoverBackground; } table.adminlist tbody tr td, table.adminlist tbody tr th { border-right: 1px solid @mainBorder; } table.adminlist tbody tr td:last-child { border-right: none; } table.adminlist tbody tr.row0:last-child td, table.adminlist tbody tr.row0:last-child th { border-bottom: 1px solid @mainBorder; } table.adminlist tbody tr.row0 td, table.adminlist tbody tr.row0 th { #gradient > .vertical(@gradientTop, @gradientBottom); } table.adminlist { border-bottom: 0 solid @mainBorder; } table.adminlist tfoot tr { color: @textColor; } /* * Table td/th styles */ table.adminlist tfoot td, table.adminlist tfoot th { background-color: @bodyBackground; border-top: 1px solid @mainBorder; } /* * Adminlist buttons */ table.adminlist tr td.btns a { border: 1px solid @mainBorder; #gradient > .vertical(@gradientTop, @gradientBottom); color: @linkColor; } table.adminlist tr td.btns a:hover, table.adminlist tr td.btns a:active, table.adminlist tr td.btns a:focus { background-color: @bodyBackground; } /* * Saving order icon styling in admin tables */ a.saveorder { background: url(../images/admin/filesave.png) no-repeat; } a.saveorder.inactive { background-position: 0 -16px; } /* * Saving order icon styling in admin tables */ fieldset.batch { background: @bodyBackground; } /** * Button styling */ button { color: @toolbarColor; border: 1px solid @mainBorder; #gradient > .vertical(@gradientTop, @gradientBottom); } button:hover, button:focus { background: @hoverBackground; } .invalid { color: #ff0000; } /* Button 1 Type */ .button1 { border: 1px solid @mainBorder; color: @linkColor; #gradient > .vertical(@gradientTop, @gradientBottom); } /* Use this if you add images to the buttons such as directional arrows */ .button1 a { color: @linkColor; /* add padding if you are using the directional images */ /* padding: 0 30px 0 6px; */ } .button1 a:hover, .button1 a:focus { background: @hoverBackground; } /* Button 2 Type */ .button2-left, .button2-right { border: 1px solid @mainBorder; #gradient > .vertical(@gradientTop, @gradientBottom); } .button2-left a, .button2-right a, .button2-left span, .button2-right span { color: @linkColor; } /* these are inactive buttons */ .button2-left span, .button2-right span { color: #999999; } .page span, .blank span { color: @linkColor; } .button2-left a:hover, .button2-right a:hover, .button2-left a:focus, .button2-right a:focus { background: @hoverBackground; } /** * Pagination styles */ /* Grey out the current page number */ .pagination .page span { color: #999999; } /** * Tooltips */ .tip { background: #000000; border: 1px solid #FFFFFF; } .tip-title { background: url(../images/selector-arrow-std.png) no-repeat; } /** * Calendar */ a img.calendar { background: url(../images/calendar.png) no-repeat; } /** * JGrid styles */ .jgrid span.publish { background-image: url(../images/admin/tick.png); } .jgrid span.unpublish { background-image: url(../images/admin/publish_x.png); } .jgrid span.archive { background-image: url(../images/menu/icon-16-archive.png); } .jgrid span.trash { background-image: url(../images/menu/icon-16-trash.png); } .jgrid span.default { background-image: url(../images/menu/icon-16-default.png); } .jgrid span.notdefault { background-image: url(../images/menu/icon-16-notdefault.png); } .jgrid span.checkedout { background-image: url(../images/admin/checked_out.png); } .jgrid span.downarrow { background-image: url(../images/admin/downarrow.png); } .jgrid span.downarrow_disabled { background-image: url(../images/admin/downarrow0.png); } .jgrid span.uparrow { background-image: url(../images/admin/uparrow.png); } .jgrid span.uparrow_disabled { background-image: url(../images/admin/uparrow0.png); } .jgrid span.published { background-image: url(../images/admin/publish_g.png); } .jgrid span.expired { background-image: url(../images/admin/publish_r.png); } .jgrid span.pending { background-image: url(../images/admin/publish_y.png); } .jgrid span.warning { background-image: url(../images/admin/publish_y.png); } /** * Toolbar icons * These icons are used for the toolbar buttons * The classes are constructed dynamically when the toolbar is created */ .icon-32-send { background-image: url(../images/toolbar/icon-32-send.png); } .icon-32-delete { background-image: url(../images/toolbar/icon-32-delete.png); } .icon-32-help { background-image: url(../images/toolbar/icon-32-help.png); } .icon-32-cancel { background-image: url(../images/toolbar/icon-32-cancel.png); } .icon-32-checkin { background-image: url(../images/toolbar/icon-32-checkin.png); } .icon-32-options { background-image: url(../images/toolbar/icon-32-config.png); } .icon-32-apply { background-image: url(../images/toolbar/icon-32-apply.png); } .icon-32-back { background-image: url(../images/toolbar/icon-32-back.png); } .icon-32-forward { background-image: url(../images/toolbar/icon-32-forward.png); } .icon-32-save { background-image: url(../images/toolbar/icon-32-save.png); } .icon-32-edit { background-image: url(../images/toolbar/icon-32-edit.png); } .icon-32-copy { background-image: url(../images/toolbar/icon-32-copy.png); } .icon-32-move { background-image: url(../images/toolbar/icon-32-move.png); } .icon-32-new { background-image: url(../images/toolbar/icon-32-new.png); } .icon-32-upload { background-image: url(../images/toolbar/icon-32-upload.png); } .icon-32-assign { background-image: url(../images/toolbar/icon-32-publish.png); } .icon-32-html { background-image: url(../images/toolbar/icon-32-html.png); } .icon-32-css { background-image: url(../images/toolbar/icon-32-css.png); } .icon-32-menus { background-image: url(../images/toolbar/icon-32-menu.png); } .icon-32-publish { background-image: url(../images/toolbar/icon-32-publish.png); } .icon-32-unblock { background-image: url(../images/toolbar/icon-32-unblock.png); } .icon-32-unpublish { background-image: url(../images/toolbar/icon-32-unpublish.png); } .icon-32-restore { background-image: url(../images/toolbar/icon-32-revert.png); } .icon-32-trash { background-image: url(../images/toolbar/icon-32-trash.png); } .icon-32-archive { background-image: url(../images/toolbar/icon-32-archive.png); } .icon-32-unarchive { background-image: url(../images/toolbar/icon-32-unarchive.png); } .icon-32-preview { background-image: url(../images/toolbar/icon-32-preview.png); } .icon-32-default { background-image: url(../images/toolbar/icon-32-default.png); } .icon-32-refresh { background-image: url(../images/toolbar/icon-32-refresh.png); } .icon-32-save-new { background-image: url(../images/toolbar/icon-32-save-new.png); } .icon-32-save-copy { background-image: url(../images/toolbar/icon-32-save-copy.png); } .icon-32-error { background-image: url(../images/toolbar/icon-32-error.png); } .icon-32-new-style { background-image: url(../images/toolbar/icon-32-new-style.png); } .icon-32-delete-style { background-image: url(../images/toolbar/icon-32-delete-style.png); } .icon-32-purge { background-image: url(../images/toolbar/icon-32-purge.png); } .icon-32-remove { background-image: url(../images/toolbar/icon-32-remove.png); } .icon-32-featured { background-image: url(../images/toolbar/icon-32-featured.png); } .icon-32-unfeatured { background-image: url(../images/toolbar/icon-32-featured.png); background-position: 0% 100%; } .icon-32-export { background-image: url(../images/toolbar/icon-32-export.png); } .icon-32-stats { background-image: url(../images/toolbar/icon-32-stats.png); } .icon-32-print { background-image: url(../images/toolbar/icon-32-print.png); } .icon-32-batch { background-image: url(../images/toolbar/icon-32-batch.png); } .icon-32-envelope { background-image: url(../images/toolbar/icon-32-messaging.png); } .icon-32-download { background-image: url(../images/toolbar/icon-32-export.png); } .icon-32-bars { background-image: url(../images/toolbar/icon-32-stats.png); } /** * Quick Icons * Also knows as Header Icons * These are used for the Quick Icons on the Control Panel * The same classes are also assigned the Component Title */ .icon-48-categories { background-image: url(../images/header/icon-48-category.png); } .icon-48-category-edit { background-image: url(../images/header/icon-48-category.png); } .icon-48-category-add { background-image: url(../images/header/icon-48-category-add.png); } .icon-48-generic { background-image: url(../images/header/icon-48-generic.png); } .icon-48-banners { background-image: url(../images/header/icon-48-banner.png); } .icon-48-banners-categories { background-image: url(../images/header/icon-48-banner-categories.png); } .icon-48-banners-category-edit { background-image: url(../images/header/icon-48-banner-categories.png); } .icon-48-banners-category-add { background-image: url(../images/header/icon-48-category-add.png); } .icon-48-banners-clients { background-image: url(../images/header/icon-48-banner-client.png); } .icon-48-banners-tracks { background-image: url(../images/header/icon-48-banner-tracks.png); } .icon-48-checkin { background-image: url(../images/header/icon-48-checkin.png); } .icon-48-clear { background-image: url(../images/header/icon-48-clear.png); } .icon-48-contact { background-image: url(../images/header/icon-48-contacts.png); } .icon-48-contact-categories { background-image: url(../images/header/icon-48-contacts-categories.png); } .icon-48-contact-category-edit { background-image: url(../images/header/icon-48-contacts-categories.png); } .icon-48-contact-category-add { background-image: url(../images/header/icon-48-category-add.png); } .icon-48-purge { background-image: url(../images/header/icon-48-purge.png); } .icon-48-cpanel { background-image: url(../images/header/icon-48-cpanel.png); } .icon-48-config { background-image: url(../images/header/icon-48-config.png); } .icon-48-groups { background-image: url(../images/header/icon-48-groups.png); } .icon-48-groups-add { background-image: url(../images/header/icon-48-groups-add.png); } .icon-48-levels { background-image: url(../images/header/icon-48-levels.png); } .icon-48-levels-add { background-image: url(../images/header/icon-48-levels-add.png); } .icon-48-module { background-image: url(../images/header/icon-48-module.png); } .icon-48-menu { background-image: url(../images/header/icon-48-menu.png); } .icon-48-menu-add { background-image: url(../images/header/icon-48-menu-add.png); } .icon-48-menumgr { background-image: url(../images/header/icon-48-menumgr.png); } .icon-48-trash { background-image: url(../images/header/icon-48-trash.png); } .icon-48-user { background-image: url(../images/header/icon-48-user.png); } .icon-48-user-add { background-image: url(../images/header/icon-48-user-add.png); } .icon-48-user-edit { background-image: url(../images/header/icon-48-user-edit.png); } .icon-48-user-profile { background-image: url(../images/header/icon-48-user-profile.png); } .icon-48-inbox { background-image: url(../images/header/icon-48-inbox.png); } .icon-48-new-privatemessage { background-image: url(../images/header/icon-48-new-privatemessage.png); } .icon-48-msgconfig { background-image: url(../images/header/icon-48-message_config.png); } .icon-48-langmanager { background-image: url(../images/header/icon-48-language.png); } .icon-48-mediamanager { background-image: url(../images/header/icon-48-media.png); } .icon-48-plugin { background-image: url(../images/header/icon-48-plugin.png); } .icon-48-help_header { background-image: url(../images/header/icon-48-help_header.png); } .icon-48-impressions { background-image: url(../images/header/icon-48-stats.png); } .icon-48-browser { background-image: url(../images/header/icon-48-stats.png); } .icon-48-searchtext { background-image: url(../images/header/icon-48-stats.png); } .icon-48-thememanager { background-image: url(../images/header/icon-48-themes.png); } .icon-48-writemess { background-image: url(../images/header/icon-48-writemess.png); } .icon-48-featured { background-image: url(../images/header/icon-48-featured.png); } .icon-48-sections { background-image: url(../images/header/icon-48-section.png); } .icon-48-article-add { background-image: url(../images/header/icon-48-article-add.png); } .icon-48-article-edit { background-image: url(../images/header/icon-48-article-edit.png); } .icon-48-article { background-image: url(../images/header/icon-48-article.png); } .icon-48-content-categories { background-image: url(../images/header/icon-48-category.png); } .icon-48-content-category-edit { background-image: url(../images/header/icon-48-category.png); } .icon-48-content-category-add { background-image: url(../images/header/icon-48-category-add.png); } .icon-48-install { background-image: url(../images/header/icon-48-extension.png); } .icon-48-dbbackup { background-image: url(../images/header/icon-48-backup.png); } .icon-48-dbrestore { background-image: url(../images/header/icon-48-dbrestore.png); } .icon-48-dbquery { background-image: url(../images/header/icon-48-query.png); } .icon-48-systeminfo { background-image: url(../images/header/icon-48-info.png); } .icon-48-massmail { background-image: url(../images/header/icon-48-massmail.png); } .icon-48-redirect { background-image: url(../images/header/icon-48-redirect.png); } .icon-48-search { background-image: url(../images/header/icon-48-search.png); } .icon-48-finder { background-image: url(../images/header/icon-48-search.png); } .icon-48-newsfeeds { background-image: url(../images/header/icon-48-newsfeeds.png); } .icon-48-newsfeeds-categories { background-image: url(../images/header/icon-48-newsfeeds-cat.png); } .icon-48-newsfeeds-category-edit { background-image: url(../images/header/icon-48-newsfeeds-cat.png); } .icon-48-newsfeeds-category-add { background-image: url(../images/header/icon-48-category-add.png); } .icon-48-weblinks { background-image: url(../images/header/icon-48-links.png); } .icon-48-weblinks-categories { background-image: url(../images/header/icon-48-links-cat.png); } .icon-48-weblinks-category-edit { background-image: url(../images/header/icon-48-links-cat.png); } .icon-48-weblinks-category-add { background-image: url(../images/header/icon-48-category-add.png); } .icon-48-tags { background-image: url(../images/header/icon-48-tags.png); } /** * General styles */ div.message { border: 1px solid @mainBorder; color: @textColor; } .helpFrame { border-left: 0 solid @mainBorder; border-right: none; border-top: none; border-bottom: none; } .outline { border: 1px solid @mainBorder; background: @bodyBackground; } /** * Modal Styles */ dl.menu_type dt { border-bottom: 1px solid @mainBorder; } ul#new-modules-list { border-top: 1px solid @mainBorder; } /** * User Accessibility */ /* Skip to Content Visual Styling */ #skiplinkholder a, #skiplinkholder a:link, #skiplinkholder a:visited { color: @bodyBackground; background: @linkColor; border-bottom: solid #336 2px; } /** * Admin Form Styles */ fieldset.panelform { border: none 0; } /** * ACL STYLES relocated from com_users/media/grid.css */ a.move_up { background-image: url('../images/admin/uparrow.png'); } span.move_up { background-image: url('../images/admin/uparrow0.png'); } a.move_down { background-image: url('../images/admin/downarrow.png'); } span.move_down { background-image: url('../images/admin/downarrow0.png'); } a.grid_false { background-image: url('../images/admin/publish_x.png'); } a.grid_true { background-image: url('../images/admin/tick.png'); } a.grid_trash { background-image: url('../images/admin/icon-16-trash.png'); } /** * ACL PANEL STYLES */ /* All Tabs */ tr.row1 { background-color: @altBackground; } /* Summary Tab */ table.aclsummary-table td.col2, table.aclsummary-table th.col2, table.aclsummary-table td.col3, table.aclsummary-table th.col3, table.aclsummary-table td.col4, table.aclsummary-table th.col4, table.aclsummary-table td.col5, table.aclsummary-table th.col5, table.aclsummary-table td.col6, table.aclsummary-table th.col6, table.aclmodify-table td.col2, table.aclmodify-table th.col2 { border-left: 1px solid @mainBorder; } /* Icons */ span.icon-16-unset { background: url(../images/admin/icon-16-denyinactive.png) no-repeat; } span.icon-16-allowed { background: url(../images/admin/icon-16-allow.png) no-repeat; } span.icon-16-denied { background: url(../images/admin/icon-16-deny.png) no-repeat; } span.icon-16-locked { background: url(../images/admin/checked_out.png) 0 0 no-repeat; } label.icon-16-allow { background: url(../images/admin/icon-16-allow.png) no-repeat; } label.icon-16-deny { background: url(../images/admin/icon-16-deny.png) no-repeat; } a.icon-16-allow { background: url(../images/admin/icon-16-allow.png) no-repeat; } a.icon-16-deny { background: url(../images/admin/icon-16-deny.png) no-repeat; } a.icon-16-allowinactive { background: url(../images/admin/icon-16-allowinactive.png) no-repeat; } a.icon-16-denyinactive { background: url(../images/admin/icon-16-denyinactive.png) no-repeat; } /* ACL footer/legend */ ul.acllegend li.acl-allowed { background: url(../images/admin/icon-16-allow.png) no-repeat left; } ul.acllegend li.acl-denied { background: url(../images/admin/icon-16-deny.png) no-repeat left; } li.acl-editgroups, li.acl-resetbtn { background-color: @altBackground; border: 1px solid @mainBorder; } li.acl-editgroups a, li.acl-resetbtn a { color: @linkColor; } li.acl-editgroups:hover, li.acl-resetbtn:hover, li.acl-editgroups:focus, li.acl-resetbtn:focus { background-color: @hoverBackground; } /* ACL Config --------- */ table#acl-config { border: 1px solid @mainBorder; } table#acl-config th, table#acl-config td { background: @altBackground; border-bottom: 1px solid @mainBorder; } table#acl-config th.acl-groups { border-right: 1px solid @mainBorder; } /** * Mod_rewrite Warning */ #jform_sef_rewrite-lbl { background: url(../images/admin/icon-16-notice-note.png) right top no-repeat; } /** * Permission Rules */ #permissions-sliders .tip { background: @bodyBackground; border: 1px solid @mainBorder; } #permissions-sliders ul#rules, #permissions-sliders ul#rules ul { border: solid 0 @mainBorder; background: @bodyBackground; } ul#rules li .pane-sliders .panel h3.title { border: solid 0 @mainBorder; } #permissions-sliders ul#rules .pane-slider { border: solid 1px @mainBorder; } #permissions-sliders ul#rules li h3 { border: solid 1px @mainBorder; } #permissions-sliders ul#rules li h3.pane-toggler-down a { border: solid 0; } #permissions-sliders ul#rules .group-kind { color: @textColor; } #permissions-sliders ul#rules table.group-rules { border: solid 1px @mainBorder; } #permissions-sliders ul#rules table.group-rules td { border-right: solid 1px @mainBorder; border-bottom: solid 1px @mainBorder; } #permissions-sliders ul#rules table.group-rules th { background: @hoverBackground; border-right: solid 1px @mainBorder; border-bottom: solid 1px @mainBorder; color: @textColor; } ul#rules table.aclmodify-table { border: solid 1px @mainBorder; } ul#rules table.group-rules td label { border: solid 0 @mainBorder; } #permissions-sliders ul#rules .mypanel { border: solid 0 @mainBorder; } #permissions-sliders ul#rules table.group-rules td { background: @bodyBackground; } #permissions-sliders span.level { color: @mainBorder; background-image: none; } /* * Debug styles */ .check-0, table.adminlist tbody td.check-0 { background-color: @permissionDefault; } .check-a, table.adminlist tbody td.check-a { background-color: @permissionAllowed; } .check-d, table.adminlist tbody td.check-d { background-color: @permissionDenied; } /** * System Messages */ #system-message dd ul { color: @textColor; } #system-message dd.error ul { color: @textColor; } #system-message dd.message ul { color: @textColor; } #system-message dd.notice ul { color: @textColor; } /** CSS file for Accessible Admin Menu * based on Matt Carrolls' son of suckerfish * with javascript by Bill Tomczak */ /* Note: set up the font-size on the id and used 100% on the elements. If ul/li/a are different ems, then the shifting back via non-js keyboard doesn't work properly */ /** * Menu Styling */ #menu { /* this is on the main ul */ color: @textColor; } #menu ul.dropdown-menu { /* all lists */ #gradient > .vertical(@gradientTop, @gradientBottom); color: @textColor; } #menu ul.dropdown-menu li.dropdown-submenu { background: url(../images/j_arrow.png) no-repeat right 50%; } #menu ul.dropdown-menu li.divider { margin-bottom: 0; border-bottom: 1px dotted @mainBorder; } #menu a { color: @toolbarColor; background-repeat: no-repeat; background-position: left 50%; } #menu li { /* all list items */ border-right: 1px solid @mainBorder; background-color: transparent; } #menu li a:hover, #menu li a:focus { background-color: @hoverBackground; } #menu li.disabled a:hover, #menu li.disabled a:focus, #menu li.disabled a { color: @mainBorder; #gradient > .vertical(@gradientTop, @gradientBottom); } #menu li ul { /* second-level lists */ border: 1px solid @mainBorder; } #menu li li { /* second-level row */ background-color: transparent; } /** * Styling parents */ /* 1 level - sfhover */ #menu li.sfhover a { background-color: @hoverBackground; } /* 2 level - normal */ #menu li.sfhover li a { background-color: transparent; } /* 2 level - hover */ #menu li.sfhover li.sfhover a, #menu li li a:focus { background-color: @hoverBackground; } /* 3 level - normal */ #menu li.sfhover li.sfhover li a { background-color: transparent; } /* 3 level - hover */ #menu li.sfhover li.sfhover li.sfhover a, #menu li li li a:focus { background-color: @hoverBackground; } /* bring back the focus elements into view */ #menu li li a:focus, #menu li li li a:focus { background-color: @hoverBackground; } #menu li li li a:focus { background-color: @hoverBackground; } /** * Submenu styling */ #submenu { border-bottom: 1px solid @mainBorder; /* border-bottom plus padding-bottom is the technique */ /* This is the background befind the tabs */ /*background: @bodyBackground;*/ } #submenu li, #submenu span.nolink { #gradient > .vertical(@gradientTop, @gradientBottom); border: 1px solid @mainBorder; color: @linkColor; } #submenu li:hover, #submenu li:focus { background: @hoverBackground; } #submenu li.active, #submenu span.nolink.active { background: @bodyBackground; border-bottom: 1px solid @bodyBackground; } #submenu li.active a, #submenu span.nolink.active { color: #000; } .element-invisible { margin: 0; padding: 0; } /* -- Codemirror Editor ----------- */ div.CodeMirror-wrapping { border: 1px solid @mainBorder; } /* User Notes */ table.adminform tr.row0 { background-color: @bodyBackground; } ul.alternating > li:nth-child(odd) { background-color: @bodyBackground; } ul.alternating > li:nth-child(even) { background-color: @altBackground; } ol.alternating > li:nth-child(odd) { background-color: @bodyBackground; } ol.alternating > li:nth-child(even) { background-color: @altBackground; } /* Installer Database */ #installer-database, #installer-discover, #installer-update, #installer-warnings { border-top: 1px solid @mainBorder; } #installer-database p.warning { background: transparent url(../images/admin/icon-16-deny.png) center left no-repeat; } #installer-database p.nowarning { background: transparent url(../images/admin/icon-16-allow.png) center left no-repeat; } /* Override default bootstrap font-size */ .input-append, .input-prepend { font-size: 1.2em; } PK���\Ϙ�9administrator/templates/hathor/less/hathor_variables.lessnu�[���// hathor_variables.less // // Less file containing Bootstrap variables needed to compile its CSS // ----------------------------------------------------- // Grays // ------------------------- @black: #000000; @grayDarker: #222222; @grayDark: #333333; @gray: #555555; @grayLight: #999999; @grayLighter: #eeeeee; @white: #ffffff; // Accent colors // ------------------------- @blue: #049cdb; @blueDark: #0064cd; @green: #46a546; @red: #9d261d; @yellow: #ffc40d; @orange: #f89406; @pink: #c3325f; @purple: #7a43b6; // Scaffolding // ------------------------- @bodyBackground: @white; @textColor: #2c2c2c; // Links // ------------------------- @linkColor: #054993; @linkColorHover: darken(@linkColor, 15%); // Typography // ------------------------- @baseFontSize: 13px; @baseLineHeight: 15px; @headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily @headingsFontWeight: bold; // instead of browser default, bold @headingsColor: inherit; // empty to use BS default, @textColor // Component sizing // ------------------------- @baseBorderRadius: 4px; @borderRadiusLarge: 6px; @borderRadiusSmall: 3px; // Buttons // ------------------------- @btnBackground: @white; @btnBackgroundHighlight: darken(@white, 10%); @btnBorder: #bbb; @btnPrimaryBackground: @linkColor; @btnPrimaryBackgroundHighlight: spin(@btnPrimaryBackground, 20%); @btnInfoBackground: #5bc0de; @btnInfoBackgroundHighlight: #2f96b4; @btnSuccessBackground: #62c462; @btnSuccessBackgroundHighlight: #51a351; @btnWarningBackground: lighten(@orange, 15%); @btnWarningBackgroundHighlight: @orange; @btnDangerBackground: #ee5f5b; @btnDangerBackgroundHighlight: #bd362f; @btnInverseBackground: #444; @btnInverseBackgroundHighlight: @grayDarker; // Forms // ------------------------- @inputBackground: #e5f0fa; @inputBorder: #ccc; @inputBorderRadius: 3px; @inputDisabledBackground: @grayLighter; @formActionsBackground: #f5f5f5; @inputHeight: @baseLineHeight + 10px; // base line-height + 8px vertical padding + 2px top/bottom border // Z-index master list // ------------------------- // Used for a bird's eye view of components dependent on the z-axis // Try to avoid customizing these :) @zindexDropdown: 1000; @zindexPopover: 1010; @zindexTooltip: 1030; @zindexFixedNavbar: 1030; @zindexModalBackdrop: 1040; @zindexModal: 1050; // Form states and alerts // ------------------------- @warningText: #c09853; @warningBackground: #fcf8e3; @warningBorder: darken(spin(@warningBackground, -10), 3%); @errorText: #a20000; @errorBackground: #f2dede; @errorBorder: darken(spin(@errorBackground, -10), 3%); @successText: #005800; @successBackground: #dff0d8; @successBorder: darken(spin(@successBackground, -10), 5%); @infoText: #3a87ad; @infoBackground: #d9edf7; @infoBorder: darken(spin(@infoBackground, -10), 7%); // Tooltips and popovers // ------------------------- @tooltipColor: @white; @tooltipBackground: @black; @tooltipArrowWidth: 5px; @tooltipArrowColor: @tooltipBackground; @popoverBackground: @white; @popoverArrowWidth: 10px; @popoverArrowColor: @white; @popoverTitleBackground: darken(@popoverBackground, 3%); // Special enhancement for popovers @popoverArrowOuterWidth: @popoverArrowWidth + 1; @popoverArrowOuterColor: rgba(0,0,0,.25); // Variables unique to Hathor // ------------------------- @toolbarColor: @linkColor; @hoverBackground: #e5d9c3; @NWBorder: #868778; @SEBorder: #f6f7db; @fadedText: #cccccc; @disabledBackground: #eeeeee; @permissionDefault: #ffffcf; @permissionAllowed: #cfffda; @permissionDenied: #ffcfcf; PK���\<���.administrator/templates/hathor/less/forms.lessnu�[���// // Forms // This is a custom version of Bootstrap's forms.less file suited for Hathor's needs // -------------------------------------------------- // Ensure input-prepend/append never wraps .input-append input[class*="span"], .input-append .uneditable-input[class*="span"], .input-prepend input[class*="span"], .input-prepend .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"], .row-fluid .input-prepend [class*="span"], .row-fluid .input-append [class*="span"] { display: inline-block; } // Allow us to put symbols and text within the input field for a cleaner look .input-append, .input-prepend { margin-bottom: 5px; font-size: 0; white-space: nowrap; // Prevent span and input from separating input, select, .uneditable-input { position: relative; // placed here by default so that on :focus we can place the input above the .add-on for full border and box-shadow goodness margin-bottom: 0; // prevent bottom margin from screwing up alignment in stacked forms *margin-left: 0; font-size: @baseFontSize; vertical-align: top; .border-radius(0 @inputBorderRadius @inputBorderRadius 0); // Make input on top when focused so blue border and shadow always show &:focus { z-index: 2; } } .add-on { display: inline-block; width: auto; height: @baseLineHeight; min-width: 16px; padding: 4px 5px; font-size: @baseFontSize; font-weight: normal; line-height: @baseLineHeight; text-align: center; text-shadow: 0 1px 0 @white; background-color: @grayLighter; border: 1px solid #ccc; } .add-on, .btn { margin-left: -1px; vertical-align: top; .border-radius(0); } .active { background-color: lighten(@green, 30); border-color: @green; } } .input-prepend { .add-on, .btn { margin-right: -1px; } .add-on:first-child, .btn:first-child { .border-radius(@inputBorderRadius 0 0 @inputBorderRadius); } } .input-append { input, select, .uneditable-input { .border-radius(@inputBorderRadius 0 0 @inputBorderRadius); } .add-on:last-child, .btn:last-child { .border-radius(0 @inputBorderRadius @inputBorderRadius 0); } } // Remove all border-radius for inputs with both prepend and append .input-prepend.input-append { input, select, .uneditable-input { .border-radius(0); } .add-on:first-child, .btn:first-child { margin-right: -1px; .border-radius(@inputBorderRadius 0 0 @inputBorderRadius); } .add-on:last-child, .btn:last-child { margin-left: -1px; .border-radius(0 @inputBorderRadius @inputBorderRadius 0); } } /* Allow for input prepend/append in search forms */ .form-search .input-append .search-query, .form-search .input-prepend .search-query { .border-radius(0); // Override due to specificity } .form-search .input-append .search-query { .border-radius(14px 0 0 14px) } .form-search .input-append .btn { .border-radius(0 14px 14px 0) } .form-search .input-prepend .search-query { .border-radius(0 14px 14px 0) } .form-search .input-prepend .btn { .border-radius(14px 0 0 14px) } .form-search, .form-inline, .form-horizontal { input, textarea, select, .help-inline, .uneditable-input, .input-prepend, .input-append { display: inline-block; .ie7-inline-block(); margin-bottom: 0; vertical-align: middle; } // Re-hide hidden elements due to specifity .hide { display: none; } } // Remove margin for input-prepend/-append .form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend { margin-bottom: 0; } /* Accessible Hidden Elements (good for hidden labels and such) */ .element-invisible{ position: absolute; padding: 0 !important; margin: 0 !important; border: 0; height: 1px; width: 1px !important; overflow: hidden; } // Login form only // Shared size and type resets #form-login select, #form-login input[type="text"], #form-login input[type="password"] { display: inline-block; padding: 4px 6px; margin-bottom: 9px; font-size: @baseFontSize; line-height: @baseLineHeight; color: @gray; .border-radius(@inputBorderRadius); width: 175px; } PK���\�h�5administrator/templates/hathor/less/colour_brown.lessnu�[���// colour_brown.less // // Less to compile Hathor in the brown colour scheme // ----------------------------------------------------- /** * #2c2c2c Text * #054993 Links * #ffffff Background, border, text * #d5c1b2 Background alternate, button/icon/menu background * #d5c1b2-d5c1b2 Gradient Background * #e5f0fa Background (input required) * #e1d3c8 Background Hover, Top/Left icon borders * #000000 Main borders * #000000 Top/Left hover borders * #000000 Right/Bottom hover borders * * Special Use Colors: * #a20000 Text Error, border invalid * #cccccc Text (faded) * #005800 Text (success) * #eeeeee Background (input disabled) * #ffffcf Background permissions debug * #cfffda Background permissions debug * #ffcfcf Background permissions debug */ // Import the variables file first to get common variables loaded @import "hathor_variables.less"; // Define variables unique to this colour scheme, as well as override variables already defined in the common file @altBackground: #d5c1b2; @gradientTop: #d5c1b2; @gradientBottom: #d5c1b2; @mainBorder: #000000; @toolbarColor: #000000; @hoverBackground: #e1d3c8; @NWBorder: #000000; @SEBorder: #000000; // Import the baseline to compile the CSS @import "colour_baseline.less"; PK���\�����(administrator/templates/hathor/error.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" > <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $this->title; ?> <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></title> <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/error.css" type="text/css" /> <?php if ($app->get('debug_lang', '0') == '1' || $app->get('debug', '0') == '1') : ?> <!-- Load additional CSS styles for debug mode--> <link rel="stylesheet" href="<?php echo JUri::root(); ?>/media/cms/css/debug.css" type="text/css" /> <?php endif; ?> <!-- Load additional CSS styles for rtl sites --> <?php if ($this->direction == 'rtl') : ?> <link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/template_rtl.css" rel="stylesheet" type="text/css" /> <?php endif; ?> </head> <body class="errors"> <div> <h1> <?php echo $this->error->getCode(); ?> - <?php echo JText::_('JERROR_AN_ERROR_HAS_OCCURRED'); ?> </h1> </div> <div> <p><?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></p> <p><a href="index.php"><?php echo JText::_('JGLOBAL_TPL_CPANEL_LINK_TEXT'); ?></a></p> <?php if ($this->debug) : ?> <?php echo $this->renderBacktrace(); ?> <?php endif; ?> </div> <div class="clr"></div> <noscript> <?php echo JText::_('JGLOBAL_WARNJAVASCRIPT'); ?> </noscript> </body> </html> PK���\�P�E�E*administrator/templates/hathor/LICENSE.txtnu�[���GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. PK���\I�JQll=administrator/templates/hathor/html/com_tags/tags/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.multiselect'); $app = JFactory::getApplication(); $user = JFactory::getUser(); $userId = $user->get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; $n = count($this->items); ?> <form action="<?php echo JRoute::_('index.php?option=com_tags&view=tags');?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <fieldset id="filter-bar"> <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend> <div class="filter-search"> <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_TAGS_FILTER_SEARCH_DESC'); ?>" /> <button type="submit" class="btn"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="filter-select"> <label class="selectlabel" for="filter_published"><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></label> <select name="filter_published" id="filter_published"> <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true); ?> </select> <label class="selectlabel" for="filter_access"><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></label> <select name="filter_access" id="filter_access"> <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')); ?> </select> <label class="selectlabel" for="filter_author_id"><?php echo JText::_('JOPTION_SELECT_AUTHOR'); ?></label> <select name="filter_author_id" id="filter_author_id"> <option value=""><?php echo JText::_('JOPTION_SELECT_AUTHOR'); ?></option> <?php echo JHtml::_('select.options', $this->authors, 'value', 'text', $this->state->get('filter.author_id')); ?> </select> <label class="selectlabel" for="filter_language"><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></label> <select name="filter_language" id="filter_language"> <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')); ?> </select> <button type="submit" id="filter-go"> <?php echo JText::_('JSUBMIT'); ?></button> </div> </fieldset> <div class="clr"> </div> <table class="adminlist"> <thead> <tr> <th class="checkmark-col"> <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /> </th> <th class="title"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?> </th> <th class="nowrap state-col"> <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?> </th> <th class="title access-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'access', $listDirn, $listOrder); ?> <th class="language-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?> </th> <th class="nowrap id-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->items as $i => $item) : $item->max_ordering = 0; //?? $canCreate = $user->authorise('core.create', 'com_tags'); $canEdit = $user->authorise('core.edit', 'com_tags.tag.' . $item->id); $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out_user_id == $userId || $item->checked_out_user_id == 0; $canChange = $user->authorise('core.edit.state', 'com_tags.tag.' . $item->id) && $canCheckin; ?> <tr class="row<?php echo $i % 2; ?>"> <th class="center"> <?php echo JHtml::_('grid.id', $i, $item->id); ?> </th> <td> <?php if ($item->level > 0): ?> <?php echo str_repeat('<span class="gi">—</span>', $item->level - 1) ?> <?php endif; ?> <?php if ($item->checked_out) : ?> <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'tags.', $canCheckin); ?> <?php endif; ?> <?php if ($canEdit || $canEditOwn) : ?> <a href="<?php echo JRoute::_('index.php?option=com_tags&task=tag.edit&id='.$item->id); ?>"> <?php echo $this->escape($item->title); ?></a> <?php else : ?> <?php echo $this->escape($item->title); ?> <?php endif; ?> <p class="smallsub"> <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?></p> </td> <td class="center"> <?php echo JHtml::_('jgrid.published', $item->published, $i, 'tags.', $canChange, 'cb'); ?> </td> <td class="center"> <?php echo $this->escape($item->access_title); ?> </td> <td class="center"> <?php if ($item->language == '*'):?> <?php echo JText::alt('JALL', 'language'); ?> <?php else:?> <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> <?php endif;?> </td> <td class="center"> <?php echo (int) $item->id; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php //Load the batch processing form if user is allowed ?> <?php if ($user->authorise('core.create', 'com_tags') && $user->authorise('core.edit', 'com_tags') && $user->authorise('core.edit.state', 'com_tags')) : ?> <?php echo JHtml::_( 'bootstrap.renderModal', 'collapseModal', array( 'title' => JText::_('COM_TAGS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') ); ?> <?php endif;?> <?php echo $this->pagination->getListFooter(); ?> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> PK���\cD����Aadministrator/templates/hathor/html/com_tags/tag/edit_options.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; if (isset($fieldSet->description) && trim($fieldSet->description)) : echo '<p class="tip">'.$this->escape(JText::_($fieldSet->description)).'</p>'; endif; ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_($fieldSet->label); ?></legend> <ul class="adminformlist"> <li><?php echo $this->form->getLabel('created_user_id'); ?> <?php echo $this->form->getInput('created_user_id'); ?></li> <li><?php echo $this->form->getLabel('created_by_alias'); ?> <?php echo $this->form->getInput('created_by_alias'); ?></li> <li><?php echo $this->form->getLabel('created_time'); ?> <?php echo $this->form->getInput('created_time'); ?></li> <li><?php echo $this->form->getLabel('publish_up'); ?> <?php echo $this->form->getInput('publish_up'); ?></li> <li><?php echo $this->form->getLabel('publish_down'); ?> <?php echo $this->form->getInput('publish_down'); ?></li> <li><?php echo $this->form->getLabel('modified_user_id'); ?> <?php echo $this->form->getInput('modified_user_id'); ?></li> <li><?php echo $this->form->getLabel('modified_time'); ?> <?php echo $this->form->getInput('modified_time'); ?></li> <li><?php echo $this->form->getLabel('version'); ?> <?php echo $this->form->getInput('version'); ?></li> </ul> </fieldset> <?php $fieldSets = $this->form->getFieldsets('params'); foreach ($fieldSets as $name => $fieldSet) : echo JHtml::_('sliders.panel', JText::_($fieldSet->label), $name.'-params'); if (isset($fieldSet->description) && trim($fieldSet->description)) : echo '<p class="tip">'.$this->escape(JText::_($fieldSet->description)).'</p>'; endif; ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_($fieldSet->label); ?></legend> <ul class="adminformlist"> <?php foreach ($this->form->getFieldset($name) as $field) : ?> <li><?php echo $field->label; ?> <?php echo $field->input; ?></li> <?php endforeach; ?> </ul> </fieldset> <?php endforeach; ?> PK���\T�NN9administrator/templates/hathor/html/com_tags/tag/edit.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); $saveHistory = $this->state->get('params')->get('save_history', 0); JHtml::_('behavior.formvalidator'); JFactory::getDocument()->addScriptDeclaration(" Joomla.submitbutton = function(task) { if (task == 'tag.cancel' || document.formvalidator.isValid(document.getElementById('tag-form'))) { " . $this->form->getField('description')->save() . " Joomla.submitform(task, document.getElementById('tag-form')); } } "); ?> <div class="weblink-edit"> <form action="<?php echo JRoute::_('index.php?option=com_tags&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="tag-form" class="form-validate"> <div class="col main-section"> <fieldset class="adminform"> <legend><?php echo empty($this->item->id) ? JText::_('JTOOLBAR_NEW') : JText::sprintf('JTOOLBAR_EDIT', $this->item->id); ?></legend> <ul class="adminformlist"> <li><?php echo $this->form->getLabel('title'); ?> <?php echo $this->form->getInput('title'); ?></li> <li><?php echo $this->form->getLabel('alias'); ?> <?php echo $this->form->getInput('alias'); ?></li> <li><?php echo $this->form->getLabel('parent_id'); ?> <?php echo $this->form->getInput('parent_id'); ?></li> <li><?php echo $this->form->getLabel('published'); ?> <?php echo $this->form->getInput('published'); ?></li> <li><?php echo $this->form->getLabel('access'); ?> <?php echo $this->form->getInput('access'); ?></li> <li><?php echo $this->form->getLabel('language'); ?> <?php echo $this->form->getInput('language'); ?></li> <?php if ($saveHistory) : ?> <li><?php echo $this->form->getLabel('version_note'); ?> <?php echo $this->form->getInput('version_note'); ?></li> <?php endif; ?> <li><?php echo $this->form->getLabel('id'); ?> <?php echo $this->form->getInput('id'); ?></li> </ul> <div> <?php echo $this->form->getLabel('description'); ?> <div class="clr"></div> <?php echo $this->form->getInput('description'); ?> </div> </fieldset> </div> <div class="col options-section"> <?php echo JHtml::_('sliders.start', 'weblink-sliders-'.$this->item->id, array('useCookie' => 1)); ?> <?php echo JHtml::_('sliders.panel', JText::_('JGLOBAL_FIELDSET_PUBLISHING'), 'publishing-details'); ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_('JGLOBAL_FIELDSET_PUBLISHING'); ?></legend> <ul class="adminformlist"> <li><?php echo $this->form->getLabel('created_by'); ?> <?php echo $this->form->getInput('created_by'); ?></li> <li><?php echo $this->form->getLabel('created_by_alias'); ?> <?php echo $this->form->getInput('created_by_alias'); ?></li> <li><?php echo $this->form->getLabel('created'); ?> <?php echo $this->form->getInput('created'); ?></li> <li><?php echo $this->form->getLabel('publish_up'); ?> <?php echo $this->form->getInput('publish_up'); ?></li> <li><?php echo $this->form->getLabel('publish_down'); ?> <?php echo $this->form->getInput('publish_down'); ?></li> <?php if ($this->item->modified_user_id) : ?> <li><?php echo $this->form->getLabel('modified_user_id'); ?> <?php echo $this->form->getInput('modified_user_id'); ?></li> <li><?php echo $this->form->getLabel('modified'); ?> <?php echo $this->form->getInput('modified'); ?></li> <?php endif; ?> <?php if ($this->item->hits) : ?> <li><?php echo $this->form->getLabel('hits'); ?> <?php echo $this->form->getInput('hits'); ?></li> <?php endif; ?> </ul> </fieldset> <?php echo $this->loadTemplate('options'); ?> <?php echo $this->loadTemplate('metadata'); ?> <?php echo JHtml::_('sliders.end'); ?> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </div> <div class="clr"></div> </form> </div> PK���\ܹ�S��Badministrator/templates/hathor/html/com_tags/tag/edit_metadata.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $fieldSets = $this->form->getFieldsets('metadata'); foreach ($fieldSets as $name => $fieldSet) : echo JHtml::_('sliders.panel', JText::_($fieldSet->label), $name.'-options'); if (isset($fieldSet->description) && trim($fieldSet->description)) : echo '<p class="tip">'.$this->escape(JText::_($fieldSet->description)).'</p>'; endif; ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_($fieldSet->label); ?></legend> <ul class="adminformlist"> <?php if ($name == 'jmetadata') : // Include the real fields in this panel. ?> <li><?php echo $this->form->getLabel('metadesc'); ?> <?php echo $this->form->getInput('metadesc'); ?></li> <li><?php echo $this->form->getLabel('metakey'); ?> <?php echo $this->form->getInput('metakey'); ?></li> <li><?php echo $this->form->getLabel('xreference'); ?> <?php echo $this->form->getInput('xreference'); ?></li> <?php endif; ?> <?php foreach ($this->form->getFieldset($name) as $field) : ?> <li><?php echo $field->label; ?> <?php echo $field->input; ?></li> <?php endforeach; ?> </ul> </fieldset> <?php endforeach; ?> PK���\)�M���?administrator/templates/hathor/html/com_cache/cache/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> <form action="<?php echo JRoute::_('index.php?option=com_cache'); ?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <fieldset id="filter-bar"> <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend> <div class="filter-select fltrt"> <label class="selectlabel" for="filter_client_id"> <?php echo JText::_('COM_CACHE_SELECT_CLIENT'); ?> </label> <select name="filter_client_id" id="filter_client_id"> <?php echo JHtml::_('select.options', CacheHelper::getClientOptions(), 'value', 'text', $this->state->get('clientId'));?> </select> <button type="submit" id="filter-go"> <?php echo JText::_('JSUBMIT'); ?></button> </div> </fieldset> <div class="clr"> </div> <table class="adminlist"> <thead> <tr> <th class="checkmark-col"> <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /> </th> <th class="title nowrap"> <?php echo JHtml::_('grid.sort', 'COM_CACHE_GROUP', 'group', $listDirn, $listOrder); ?> </th> <th class="width-5 center nowrap"> <?php echo JHtml::_('grid.sort', 'COM_CACHE_NUMBER_OF_FILES', 'count', $listDirn, $listOrder); ?> </th> <th class="width-10 center"> <?php echo JHtml::_('grid.sort', 'COM_CACHE_SIZE', 'size', $listDirn, $listOrder); ?> </th> </tr> </thead> <tbody> <?php $i = 0; foreach ($this->data as $folder => $item) : ?> <tr class="row<?php echo $i % 2; ?>"> <td> <input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $item->group; ?>" onclick="Joomla.isChecked(this.checked);" /> </td> <td> <span class="bold"> <?php echo $item->group; ?> </span> </td> <td class="center"> <?php echo $item->count; ?> </td> <td class="center"> <?php echo JHtml::_('number.bytes', $item->size*1024); ?> </td> </tr> <?php $i++; endforeach; ?> </tbody> </table> <?php echo $this->pagination->getListFooter(); ?> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="client" value="<?php echo $this->client->id;?>" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> PK���\�\f�aa?administrator/templates/hathor/html/com_cache/purge/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage com_cache * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <form action="<?php echo JRoute::_('index.php?option=com_cache'); ?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <table class="adminlist"> <thead> <tr> <th> <?php echo JText::_('COM_CACHE_PURGE_EXPIRED_ITEMS'); ?> </th> </tr> </thead> <tbody> <tr> <td> <p class="mod-purge-instruct"><?php echo JText::_('COM_CACHE_PURGE_INSTRUCTIONS'); ?></p> <p class="warning"><?php echo JText::_('COM_CACHE_RESOURCE_INTENSIVE_WARNING'); ?></p> </td> </tr> </tbody> </table> <div> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </div> </div> </form> PK���\ˌ���&�&Dadministrator/templates/hathor/html/com_content/featured/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ /* add accessibility, labels on input forms */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.multiselect'); $user = JFactory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $canOrder = $user->authorise('core.edit.state', 'com_content.article'); $saveOrder = $listOrder == 'fp.ordering'; $n = count($this->items); ?> <form action="<?php echo JRoute::_('index.php?option=com_content&view=featured'); ?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <fieldset id="filter-bar"> <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend> <div class="filter-search"> <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>" /> <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="filter-select"> <label class="selectlabel" for="filter_published"><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></label> <select name="filter_published" id="filter_published"> <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true); ?> </select> <label class="selectlabel" for="filter_category_id"><?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?></label> <select name="filter_category_id" id="filter_category_id"> <option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $this->state->get('filter.category_id')); ?> </select> <label class="selectlabel" for="filter_level"><?php echo JText::_('JOPTION_SELECT_MAX_LEVELS'); ?></label> <select name="filter_level" id="filter_level"> <option value=""><?php echo JText::_('JOPTION_SELECT_MAX_LEVELS'); ?></option> <?php echo JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level')); ?> </select> <label class="selectlabel" for="filter_access"><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></label> <select name="filter_access" id="filter_access"> <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS');?></option> <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')); ?> </select> <label class="selectlabel" for="filter_language"><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></label> <select name="filter_language" id="filter_language"> <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')); ?> </select> <button type="submit" id="filter-go"> <?php echo JText::_('JSUBMIT'); ?></button> </div> </fieldset> <div class="clr"> </div> <table class="adminlist"> <thead> <tr> <th class="checkmark-col"> <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /> </th> <th class="title"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?> </th> <th class="nowrap state-col"> <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?> </th> <th class="title category-col"> <?php echo JHtml::_('grid.sort', 'JCATEGORY', 'a.catid', $listDirn, $listOrder); ?> </th> <th class="nowrap ordering-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'fp.ordering', $listDirn, $listOrder); ?> <?php if ($canOrder && $saveOrder) :?> <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'featured.saveorder'); ?> <?php endif; ?> </th> <th class="title access-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?> </th> <th class="title created-by-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_CREATED_BY', 'a.created_by', $listDirn, $listOrder); ?> </th> <th class="title date-col"> <?php echo JHtml::_('grid.sort', 'JDATE', 'a.created', $listDirn, $listOrder); ?> </th> <th class="hits-col"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?> </th> <th class="language-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?> </th> <th class="nowrap id-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->items as $i => $item) : $item->max_ordering = 0; //?? $ordering = ($listOrder == 'fp.ordering'); $assetId = 'com_content.article.' . $item->id; $canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid); $canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id); $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id')|| $item->checked_out == 0; $canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin; ?> <tr class="row<?php echo $i % 2; ?>"> <th class="center"> <?php echo JHtml::_('grid.id', $i, $item->id); ?> </th> <td> <?php if ($item->checked_out) : ?> <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'featured.', $canCheckin); ?> <?php endif; ?> <?php if ($canEdit) : ?> <a href="<?php echo JRoute::_('index.php?option=com_content&task=article.edit&return=featured&id='.$item->id);?>"> <?php echo $this->escape($item->title); ?></a> <?php else : ?> <?php echo $this->escape($item->title); ?> <?php endif; ?> <p class="smallsub"> <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?></p> </td> <td class="center"> <?php echo JHtml::_('jgrid.published', $item->state, $i, 'articles.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?> </td> <td class="center"> <?php echo $this->escape($item->category_title); ?> </td> <td class="order"> <?php if ($canChange) : ?> <?php if ($saveOrder) : ?> <?php if ($listDirn == 'asc') : ?> <span><?php echo $this->pagination->orderUpIcon($i, true, 'featured.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span> <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'featured.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span> <?php elseif ($listDirn == 'desc') : ?> <span><?php echo $this->pagination->orderUpIcon($i, true, 'featured.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?></span> <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'featured.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span> <?php endif; ?> <?php endif; ?> <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?> <input type="text" name="order[]" value="<?php echo $item->ordering; ?>" <?php echo $disabled; ?> class="text-area-order" title="<?php echo $item->title; ?> order" /> <?php else : ?> <?php echo $item->ordering; ?> <?php endif; ?> </td> <td class="center"> <?php echo $this->escape($item->access_level); ?> </td> <td class="center"> <?php if ($item->created_by_alias) : ?> <?php echo $this->escape($item->author_name); ?> <p class="smallsub"> <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->created_by_alias)); ?></p> <?php else : ?> <?php echo $this->escape($item->author_name); ?> <?php endif; ?> </td> <td class="center nowrap"> <?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')); ?> </td> <td class="center"> <?php echo (int) $item->hits; ?> </td> <td class="center"> <?php if ($item->language == '*') : ?> <?php echo JText::alt('JALL', 'language'); ?> <?php else : ?> <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> <?php endif;?> </td> <td class="center"> <?php echo (int) $item->id; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php echo $this->pagination->getListFooter(); ?> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> PK���\�ێ�Badministrator/templates/hathor/html/com_content/articles/modal.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $app = JFactory::getApplication(); if ($app->isSite()) { JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN')); } require_once JPATH_ROOT . '/components/com_content/helpers/route.php'; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); $function = $app->input->getCmd('function', 'jSelectArticle'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> <form action="<?php echo JRoute::_('index.php?option=com_content&view=articles&layout=modal&tmpl=component&function='.$function.'&'.JSession::getFormToken().'=1');?>" method="post" name="adminForm" id="adminForm"> <fieldset id="filter-bar"> <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend> <div class="filter-search"> <label class="filter-search-lbl" for="filter_search"> <?php echo JText::_('JSEARCH_FILTER_LABEL'); ?> </label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>" /> <button type="submit"> <?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"> <?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="filter-select"> <label class="selectlabel" for="filter_access"><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></label> <select name="filter_access" id="filter_access"> <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS');?></option> <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));?> </select> <label class="selectlabel" for="filter_published"><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></label> <select name="filter_published" id="filter_published"> <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option> <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true);?> </select> <label class="selectlabel" for="filter_category_id"><?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?></label> <select name="filter_category_id" id="filter_category_id"> <option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY');?></option> <?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $this->state->get('filter.category_id'));?> </select> <?php if ($this->state->get('filter.forcedLanguage')) : ?> <input type="hidden" name="forcedLanguage" value="<?php echo $this->escape($this->state->get('filter.forcedLanguage')); ?>" /> <input type="hidden" name="filter_language" value="<?php echo $this->escape($this->state->get('filter.language')); ?>" /> <?php else : ?> <label class="selectlabel" for="filter_language"><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></label> <select name="filter_language" id="filter_language"> <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE');?></option> <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'));?> </select> <?php endif; ?> <button type="submit" id="filter-go"> <?php echo JText::_('JSUBMIT'); ?></button> </div> </fieldset> <table class="adminlist modal"> <thead> <tr> <th class="title"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?> </th> <th class="title access-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?> </th> <th class="nowrap state-col"> <?php echo JHtml::_('grid.sort', 'JCATEGORY', 'a.catid', $listDirn, $listOrder); ?> </th> <th class="title language-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?> </th> <th class="title date-col"> <?php echo JHtml::_('grid.sort', 'JDATE', 'a.created', $listDirn, $listOrder); ?> </th> <th class="nowrap id-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->items as $i => $item) : ?> <tr class="row<?php echo $i % 2; ?>"> <th> <a class="pointer" onclick="if (window.parent) window.parent.<?php echo $this->escape($function);?>('<?php echo $item->id; ?>', '<?php echo $this->escape(addslashes($item->title)); ?>', '<?php echo $this->escape($item->catid); ?>', null, '<?php echo $this->escape(ContentHelperRoute::getArticleRoute($item->id, $item->catid, $item->language)); ?>');"> <?php echo $this->escape($item->title); ?></a> </th> <td class="center"> <?php echo $this->escape($item->access_level); ?> </td> <td class="center"> <?php echo $this->escape($item->category_title); ?> </td> <td class="center"> <?php if ($item->language == '*'):?> <?php echo JText::alt('JALL', 'language'); ?> <?php else:?> <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> <?php endif;?> </td> <td class="center nowrap"> <?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')); ?> </td> <td class="center"> <?php echo (int) $item->id; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php echo $this->pagination->getListFooter(); ?> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </form> PK���\�m��/�/Dadministrator/templates/hathor/html/com_content/articles/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.multiselect'); $app = JFactory::getApplication(); $user = JFactory::getUser(); $userId = $user->get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; $assoc = JLanguageAssociations::isEnabled(); $n = count($this->items); ?> <form action="<?php echo JRoute::_('index.php?option=com_content&view=articles'); ?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <fieldset id="filter-bar"> <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend> <div class="filter-search"> <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>" /> <button type="submit" class="btn"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="filter-select"> <label class="selectlabel" for="filter_published"><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></label> <select name="filter_published" id="filter_published"> <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true); ?> </select> <label class="selectlabel" for="filter_category_id"><?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?></label> <select name="filter_category_id" id="filter_category_id"> <option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_content', array('filter.published' => array(-2, 0, 1, 2))), 'value', 'text', $this->state->get('filter.category_id')); ?> </select> <label class="selectlabel" for="filter_level"><?php echo JText::_('JOPTION_SELECT_MAX_LEVELS'); ?></label> <select name="filter_level" id="filter_level"> <option value=""><?php echo JText::_('JOPTION_SELECT_MAX_LEVELS'); ?></option> <?php echo JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level')); ?> </select> <label class="selectlabel" for="filter_access"><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></label> <select name="filter_access" id="filter_access"> <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')); ?> </select> <label class="selectlabel" for="filter_author_id"><?php echo JText::_('JOPTION_SELECT_AUTHOR'); ?></label> <select name="filter_author_id" id="filter_author_id"> <option value=""><?php echo JText::_('JOPTION_SELECT_AUTHOR'); ?></option> <?php echo JHtml::_('select.options', $this->authors, 'value', 'text', $this->state->get('filter.author_id')); ?> </select> <label class="selectlabel" for="filter_language"><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></label> <select name="filter_language" id="filter_language"> <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')); ?> </select> <label class="selectlabel" for="filter_tag"><?php echo JText::_('JOPTION_SELECT_TAG'); ?></label> <select name="filter_tag" id="filter_tag"> <option value=""><?php echo JText::_('JOPTION_SELECT_TAG'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('tag.options', true, true), 'value', 'text', $this->state->get('filter.tag')); ?> </select> <button type="submit" id="filter-go"> <?php echo JText::_('JSUBMIT'); ?></button> </div> </fieldset> <div class="clr"> </div> <table class="adminlist"> <thead> <tr> <th class="checkmark-col"> <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /> </th> <th class="title"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?> </th> <th class="nowrap state-col"> <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?> </th> <th class="nowrap featured-col"> <?php echo JHtml::_('grid.sort', 'JFEATURED', 'a.featured', $listDirn, $listOrder, null, 'desc'); ?> </th> <th class="title category-col"> <?php echo JHtml::_('grid.sort', 'JCATEGORY', 'category_title', $listDirn, $listOrder); ?> </th> <th class="nowrap ordering-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'a.ordering', $listDirn, $listOrder); ?> <?php if ($saveOrder) : ?> <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'articles.saveorder'); ?> <?php endif; ?> </th> <th class="title access-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?> </th> <?php if ($assoc) : ?> <th width="5%"> <?php echo JHtml::_('grid.sort', 'COM_CONTENT_HEADING_ASSOCIATION', 'association', $listDirn, $listOrder); ?> </th> <?php endif;?> <th class="title created-by-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_CREATED_BY', 'a.created_by', $listDirn, $listOrder); ?> </th> <th class="title date-col"> <?php echo JHtml::_('grid.sort', 'JDATE', 'a.created', $listDirn, $listOrder); ?> </th> <th class="hits-col"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?> </th> <th class="language-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?> </th> <th class="nowrap id-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->items as $i => $item) : $item->max_ordering = 0; //?? $ordering = ($listOrder == 'a.ordering'); $canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid); $canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id); $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; $canEditOwn = $user->authorise('core.edit.own', 'com_content.article.' . $item->id) && $item->created_by == $userId; $canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin; ?> <tr class="row<?php echo $i % 2; ?>"> <th class="center"> <?php echo JHtml::_('grid.id', $i, $item->id); ?> </th> <td class="break-word"> <?php if ($item->checked_out) : ?> <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'articles.', $canCheckin); ?> <?php endif; ?> <?php if ($canEdit || $canEditOwn) : ?> <a href="<?php echo JRoute::_('index.php?option=com_content&task=article.edit&id='.$item->id); ?>"> <?php echo $this->escape($item->title); ?></a> <?php else : ?> <?php echo $this->escape($item->title); ?> <?php endif; ?> <p class="smallsub"> <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?></p> </td> <td class="center"> <?php echo JHtml::_('jgrid.published', $item->state, $i, 'articles.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?> </td> <td class="center"> <?php echo JHtml::_('contentadministrator.featured', $item->featured, $i, $canChange); ?> </td> <td class="center"> <?php echo $this->escape($item->category_title); ?> </td> <td class="order"> <?php if ($canChange) : ?> <?php if ($saveOrder) : ?> <?php if ($listDirn == 'asc') : ?> <span><?php echo $this->pagination->orderUpIcon($i, ($item->catid == @$this->items[$i - 1]->catid), 'articles.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span> <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, ($item->catid == @$this->items[$i + 1]->catid), 'articles.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span> <?php elseif ($listDirn == 'desc') : ?> <span><?php echo $this->pagination->orderUpIcon($i, ($item->catid == @$this->items[$i - 1]->catid), 'articles.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?></span> <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, ($item->catid == @$this->items[$i + 1]->catid), 'articles.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span> <?php endif; ?> <?php endif; ?> <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?> <input type="text" name="order[]" value="<?php echo $item->ordering; ?>" <?php echo $disabled; ?> class="text-area-order" title="<?php echo $item->title; ?> order" /> <?php else : ?> <?php echo $item->ordering; ?> <?php endif; ?> </td> <td class="center"> <?php echo $this->escape($item->access_level); ?> </td> <?php if ($assoc) : ?> <td class="center"> <?php if ($item->association):?> <?php echo JHtml::_('contentadministrator.association', $item->id); ?> <?php endif;?> </td> <?php endif;?> <td class="center"> <?php if ($item->created_by_alias) : ?> <?php echo $this->escape($item->author_name); ?> <p class="smallsub"> <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->created_by_alias)); ?></p> <?php else : ?> <?php echo $this->escape($item->author_name); ?> <?php endif; ?> </td> <td class="center nowrap"> <?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')); ?> </td> <td class="center"> <?php echo (int) $item->hits; ?> </td> <td class="center"> <?php if ($item->language == '*'):?> <?php echo JText::alt('JALL', 'language'); ?> <?php else:?> <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> <?php endif;?> </td> <td class="center"> <?php echo (int) $item->id; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php //Load the batch processing form. ?> <?php if ($user->authorise('core.create', 'com_content') && $user->authorise('core.edit', 'com_content') && $user->authorise('core.edit.state', 'com_content')) : ?> <?php echo JHtml::_( 'bootstrap.renderModal', 'collapseModal', array( 'title' => JText::_('COM_CONTENT_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') ); ?> <?php endif; ?> <?php echo $this->pagination->getListFooter(); ?> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> PK���\UM�i*i*@administrator/templates/hathor/html/com_content/article/edit.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); // Create shortcut to parameters. $params = $this->state->get('params'); $params = $params->toArray(); $saveHistory = $this->state->get('params')->get('save_history', 0); // This checks if the config options have ever been saved. If they haven't they will fall back to the original settings. $editoroptions = isset($params['show_publishing_options']); $input = JFactory::getApplication()->input; if (!$editoroptions): $params['show_publishing_options'] = '1'; $params['show_article_options'] = '1'; $params['show_urls_images_backend'] = '0'; $params['show_urls_images_frontend'] = '0'; endif; // Check if the article uses configuration settings besides global. If so, use them. if (!empty($this->item->attribs['show_publishing_options'])): $params['show_publishing_options'] = $this->item->attribs['show_publishing_options']; endif; if (!empty($this->item->attribs['show_article_options'])): $params['show_article_options'] = $this->item->attribs['show_article_options']; endif; if (!empty($this->item->attribs['show_urls_images_backend'])): $params['show_urls_images_backend'] = $this->item->attribs['show_urls_images_backend']; endif; $assoc = JLanguageAssociations::isEnabled(); JFactory::getDocument()->addScriptDeclaration(" Joomla.submitbutton = function(task) { if (task == 'article.cancel' || document.formvalidator.isValid(document.getElementById('item-form'))) { " . $this->form->getField('articletext')->save() . " Joomla.submitform(task, document.getElementById('item-form')); } } "); ?> <div class="article-edit"> <form action="<?php echo JRoute::_('index.php?option=com_content&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate"> <div class="col main-section"> <fieldset class="adminform"> <legend><?php echo empty($this->item->id) ? JText::_('COM_CONTENT_NEW_ARTICLE') : JText::sprintf('COM_CONTENT_EDIT_ARTICLE', $this->item->id); ?></legend> <ul class="adminformlist"> <li><?php echo $this->form->getLabel('title'); ?> <?php echo $this->form->getInput('title'); ?></li> <li><?php echo $this->form->getLabel('alias'); ?> <?php echo $this->form->getInput('alias'); ?></li> <li><?php echo $this->form->getLabel('catid'); ?> <?php echo $this->form->getInput('catid'); ?></li> <li><?php echo $this->form->getLabel('state'); ?> <?php echo $this->form->getInput('state'); ?></li> <li><?php echo $this->form->getLabel('access'); ?> <?php echo $this->form->getInput('access'); ?></li> <?php if ($this->canDo->get('core.admin')) : ?> <li><span class="faux-label"><?php echo JText::_('JGLOBAL_ACTION_PERMISSIONS_LABEL'); ?></span> <button type="button" onclick="document.location.href='#access-rules';"> <?php echo JText::_('JGLOBAL_PERMISSIONS_ANCHOR'); ?> </button> </li> <?php endif; ?> <li><?php echo $this->form->getLabel('featured'); ?> <?php echo $this->form->getInput('featured'); ?></li> <li><?php echo $this->form->getLabel('language'); ?> <?php echo $this->form->getInput('language'); ?></li> <!-- Tag field --> <li><?php echo $this->form->getLabel('tags'); ?> <div class="is-tagbox"> <?php echo $this->form->getInput('tags'); ?> </div> </li> <?php if ($saveHistory) : ?> <li><?php echo $this->form->getLabel('version_note'); ?> <?php echo $this->form->getInput('version_note'); ?></li> <?php endif; ?> <li><?php echo $this->form->getLabel('id'); ?> <?php echo $this->form->getInput('id'); ?></li> </ul> <div class="clr"></div> <?php echo $this->form->getLabel('articletext'); ?> <div class="clr"></div> <?php echo $this->form->getInput('articletext'); ?> <div class="clr"></div> </fieldset> </div> <div class="col options-section"> <?php echo JHtml::_('sliders.start', 'content-sliders-' . $this->item->id, array('useCookie' => 1)); ?> <?php // Do not show the publishing options if the edit form is configured not to. ?> <?php if ($params['show_publishing_options'] || ( $params['show_publishing_options'] = '' && !empty($editoroptions)) ) : ?> <?php echo JHtml::_('sliders.panel', JText::_('COM_CONTENT_FIELDSET_PUBLISHING'), 'publishing-details'); ?> <fieldset class="panelform"> <ul class="adminformlist"> <li><?php echo $this->form->getLabel('created_by'); ?> <?php echo $this->form->getInput('created_by'); ?></li> <li><?php echo $this->form->getLabel('created_by_alias'); ?> <?php echo $this->form->getInput('created_by_alias'); ?></li> <li><?php echo $this->form->getLabel('created'); ?> <?php echo $this->form->getInput('created'); ?></li> <li><?php echo $this->form->getLabel('publish_up'); ?> <?php echo $this->form->getInput('publish_up'); ?></li> <li><?php echo $this->form->getLabel('publish_down'); ?> <?php echo $this->form->getInput('publish_down'); ?></li> <?php if ($this->item->modified_by) : ?> <li><?php echo $this->form->getLabel('modified_by'); ?> <?php echo $this->form->getInput('modified_by'); ?></li> <li><?php echo $this->form->getLabel('modified'); ?> <?php echo $this->form->getInput('modified'); ?></li> <?php endif; ?> <?php if ($this->item->version) : ?> <li><?php echo $this->form->getLabel('version'); ?> <?php echo $this->form->getInput('version'); ?></li> <?php endif; ?> <?php if ($this->item->hits) : ?> <li><?php echo $this->form->getLabel('hits'); ?> <?php echo $this->form->getInput('hits'); ?></li> <?php endif; ?> </ul> </fieldset> <?php endif; ?> <?php $fieldSets = $this->form->getFieldsets('attribs'); ?> <?php foreach ($fieldSets as $name => $fieldSet) : ?> <?php // If the parameter says to show the article options or if the parameters have never been set, we will // show the article options. if ($params['show_article_options'] || (( $params['show_article_options'] == '' && !empty($editoroptions) ))): // Go through all the fieldsets except the configuration and basic-limited, which are // handled separately below. if ($name != 'editorConfig' && $name != 'basic-limited') : ?> <?php echo JHtml::_('sliders.panel', JText::_($fieldSet->label), $name.'-options'); ?> <?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?> <p class="tip"><?php echo $this->escape(JText::_($fieldSet->description));?></p> <?php endif; ?> <fieldset class="panelform"> <ul class="adminformlist"> <?php foreach ($this->form->getFieldset($name) as $field) : ?> <li><?php echo $field->label; ?> <?php echo $field->input; ?></li> <?php endforeach; ?> </ul> </fieldset> <?php endif ?> <?php // If we are not showing the options we need to use the hidden fields so the values are not lost. ?> <?php elseif ($name == 'basic-limited') : ?> <?php foreach ($this->form->getFieldset('basic-limited') as $field) : ?> <?php echo $field->input; ?> <?php endforeach; ?> <?php endif; ?> <?php endforeach; ?> <?php // Not the best place, but here for continuity with 1.5/1/6/1.7 ?> <fieldset class="panelform"> </fieldset> <?php // We need to make a separate space for the configuration // so that those fields always show to those wih permissions if ( $this->canDo->get('core.admin') ): ?> <?php echo JHtml::_('sliders.panel', JText::_('COM_CONTENT_SLIDER_EDITOR_CONFIG'), 'configure-sliders'); ?> <fieldset class="panelform" > <ul class="adminformlist"> <?php foreach ($this->form->getFieldset('editorConfig') as $field) : ?> <li><?php echo $field->label; ?> <?php echo $field->input; ?></li> <?php endforeach; ?> </ul> </fieldset> <?php endif ?> <?php // The url and images fields only show if the configuration is set to allow them. ?> <?php // This is for legacy reasons. ?> <?php if ($params['show_urls_images_backend']) : ?> <?php echo JHtml::_('sliders.panel', JText::_('COM_CONTENT_FIELDSET_URLS_AND_IMAGES'), 'urls_and_images-options'); ?> <fieldset class="panelform"> <ul class="adminformlist"> <li> <?php echo $this->form->getLabel('images'); ?> <?php echo $this->form->getInput('images'); ?></li> <?php foreach ($this->form->getGroup('images') as $field) : ?> <li> <?php if (!$field->hidden) : ?> <?php echo $field->label; ?> <?php endif; ?> <?php echo $field->input; ?> </li> <?php endforeach; ?> <?php foreach ($this->form->getGroup('urls') as $field) : ?> <li> <?php if (!$field->hidden) : ?> <?php echo $field->label; ?> <?php endif; ?> <?php echo $field->input; ?> </li> <?php endforeach; ?> </ul> </fieldset> <?php endif; ?> <?php echo JHtml::_('sliders.panel', JText::_('JGLOBAL_FIELDSET_METADATA_OPTIONS'), 'meta-options'); ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_('JGLOBAL_FIELDSET_METADATA_OPTIONS'); ?></legend> <?php echo $this->loadTemplate('metadata'); ?> </fieldset> <?php if ($assoc) : ?> <?php echo JHtml::_('sliders.panel', JText::_('COM_CONTENT_ITEM_ASSOCIATIONS_FIELDSET_LABEL'), '-options');?> <?php echo $this->loadTemplate('associations'); ?> <?php endif; ?> <?php echo JHtml::_('sliders.end'); ?> </div> <div class="clr"></div> <?php if ($this->canDo->get('core.admin')) : ?> <div class="col rules-section"> <?php echo JHtml::_('sliders.start', 'permissions-sliders-' . $this->item->id, array('useCookie' => 1)); ?> <?php echo JHtml::_('sliders.panel', JText::_('COM_CONTENT_FIELDSET_RULES'), 'access-rules'); ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_('COM_CONTENT_FIELDSET_RULES'); ?></legend> <?php echo $this->form->getLabel('rules'); ?> <?php echo $this->form->getInput('rules'); ?> </fieldset> <?php echo JHtml::_('sliders.end'); ?> </div> <?php endif; ?> <div> <input type="hidden" name="task" value="" /> <input type="hidden" name="return" value="<?php echo $input->getCmd('return');?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> <div class="clr"></div> </div> PK���\s�b�Gadministrator/templates/hathor/html/com_languages/languages/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('bootstrap.tooltip'); JHtml::_('behavior.multiselect'); $user = JFactory::getUser(); $userId = $user->get('id'); $n = count($this->items); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $canOrder = $user->authorise('core.edit.state', 'com_languages'); $saveOrder = $listOrder == 'a.ordering'; ?> <form action="<?php echo JRoute::_('index.php?option=com_languages&view=languages'); ?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <fieldset id="filter-bar"> <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend> <div class="filter-search"> <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_LANGS_SEARCH_IN_TITLE'); ?>" /> <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="filter-select"> <label class="selectlabel" for="filter_published"> <?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?> </label> <select name="filter_published" id="filter_published"> <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option> <?php echo JHtml::_('select.options', JHtml::_('languages.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true);?> </select> <button type="submit" id="filter-go"> <?php echo JText::_('JSUBMIT'); ?></button> </div> </fieldset> <table class="adminlist"> <thead> <tr> <th class="checkmark-col"> <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /> </th> <th class="title"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?> </th> <th class="title"> <?php echo JHtml::_('grid.sort', 'COM_LANGUAGES_HEADING_TITLE_NATIVE', 'a.title_native', $listDirn, $listOrder); ?> </th> <th class="nowrap width-5"> <?php echo JHtml::_('grid.sort', 'COM_LANGUAGES_FIELD_LANG_TAG_LABEL', 'a.lang_code', $listDirn, $listOrder); ?> </th> <th class="nowrap width-5"> <?php echo JHtml::_('grid.sort', 'COM_LANGUAGES_FIELD_LANG_CODE_LABEL', 'a.sef', $listDirn, $listOrder); ?> </th> <th class="nowrap width-5"> <?php echo JHtml::_('grid.sort', 'COM_LANGUAGES_HEADING_LANG_IMAGE', 'a.image', $listDirn, $listOrder); ?> </th> <th class="nowrap width-5"> <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?> </th> <th width="nowrap ordering-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'ordering', $listDirn, $listOrder); ?> <?php if ($canOrder && $saveOrder) :?> <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'languages.saveorder'); ?> <?php endif; ?> </th> <th class="nowrap width-5"> <?php echo JHtml::_('grid.sort', 'COM_LANGUAGES_HOMEPAGE', '', $listDirn, $listOrder); ?> </th> <th class="nowrap id-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.lang_id', $listDirn, $listOrder); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->items as $i => $item) : $ordering = ($listOrder == 'a.ordering'); $canCreate = $user->authorise('core.create', 'com_languages'); $canEdit = $user->authorise('core.edit', 'com_languages'); $canChange = $user->authorise('core.edit.state', 'com_languages'); ?> <tr class="row<?php echo $i % 2; ?>"> <td> <?php echo JHtml::_('grid.id', $i, $item->lang_id); ?> </td> <td> <span class="editlinktip hasTooltip" title="<?php echo JHtml::tooltipText(JText::_('JGLOBAL_EDIT_ITEM'), $item->title, 0); ?>"> <?php if ($canEdit) : ?> <a href="<?php echo JRoute::_('index.php?option=com_languages&task=language.edit&lang_id='.(int) $item->lang_id); ?>"> <?php echo $this->escape($item->title); ?></a> <?php else : ?> <?php echo $this->escape($item->title); ?> <?php endif; ?> </span> </td> <td class="center"> <?php echo $this->escape($item->title_native); ?> </td> <td class="center"> <?php echo $this->escape($item->lang_code); ?> </td> <td class="center"> <?php echo $this->escape($item->sef); ?> </td> <td class="center"> <?php echo $this->escape($item->image); ?> <?php echo JHtml::_('image', 'mod_languages/'.$item->image.'.gif', $item->image, array('title' => $item->image), true); ?> </td> <td class="center"> <?php echo JHtml::_('jgrid.published', $item->published, $i, 'languages.', $canChange);?> </td> <td class="order"> <?php if ($canChange) : ?> <?php if ($saveOrder) :?> <?php if ($listDirn == 'asc') : ?> <span><?php echo $this->pagination->orderUpIcon($i, true, 'languages.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span> <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'languages.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span> <?php elseif ($listDirn == 'desc') : ?> <span><?php echo $this->pagination->orderUpIcon($i, true, 'languages.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?></span> <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, true, 'languages.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span> <?php endif; ?> <?php endif; ?> <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?> <input type="text" name="order[]" size="5" value="<?php echo $item->ordering;?>" <?php echo $disabled ?> class="text-area-order" /> <?php else : ?> <?php echo $item->ordering; ?> <?php endif; ?> </td> <td class="center"> <?php if ($item->home == '1') : ?> <?php echo JText::_('JYES');?> <?php else:?> <?php echo JText::_('JNO');?> <?php endif;?> </td> <td class="center"> <?php echo $this->escape($item->lang_id); ?> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php echo $this->pagination->getListFooter(); ?> <div> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </div> </form> PK���\Hw�]��Gadministrator/templates/hathor/html/com_languages/overrides/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage com_languages * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); $client = $this->state->get('filter.client') == 'site' ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); $language = $this->state->get('filter.language'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> <form action="<?php echo JRoute::_('index.php?option=com_languages&view=overrides'); ?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <fieldset id="filter-bar"> <div class="filter-search fltlft"> <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_LANGUAGES_VIEW_OVERRIDES_FILTER_SEARCH_DESC'); ?>" /> <button type="submit" class="btn"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="filter-select fltrt"> <select name="filter_language_client" onchange="this.form.submit()"> <?php echo JHtml::_('select.options', $this->languages, null, 'text', $this->state->get('filter.language_client')); ?> </select> </div> </fieldset> <div class="clr"></div> <table class="adminlist"> <thead> <tr> <th width="1%"> <input type="checkbox" name="checkall-toggle" value="" onclick="Joomla.checkAll(this)" /> </th> <th width="30%" class="left"> <?php echo JHtml::_('grid.sort', 'COM_LANGUAGES_VIEW_OVERRIDES_KEY', 'key', $listDirn, $listOrder); ?> </th> <th class="left"> <?php echo JHtml::_('grid.sort', 'COM_LANGUAGES_VIEW_OVERRIDES_TEXT', 'text', $listDirn, $listOrder); ?> </th> <th class="nowrap"> <?php echo JText::_('COM_LANGUAGES_FIELD_LANG_TAG_LABEL'); ?> </th> <th> <?php echo JText::_('JCLIENT'); ?> </th> </tr> </thead> <tfoot> <tr> <td colspan="5"> <?php echo $this->pagination->getListFooter(); ?> </td> </tr> </tfoot> <tbody> <?php $canEdit = JFactory::getUser()->authorise('core.edit', 'com_languages'); $i = 0; foreach ($this->items as $key => $text) : ?> <tr class="row<?php echo $i % 2; ?>" id="overriderrow<?php echo $i; ?>"> <td class="center"> <?php echo JHtml::_('grid.id', $i, $key); ?> </td> <td> <?php if ($canEdit) : ?> <a id="key[<?php echo $this->escape($key); ?>]" href="<?php echo JRoute::_('index.php?option=com_languages&task=override.edit&id='.$key); ?>"><?php echo $this->escape($key); ?></a> <?php else: ?> <?php echo $this->escape($key); ?> <?php endif; ?> </td> <td> <span id="string[<?php echo $this->escape($key); ?>]"><?php echo $this->escape($text); ?></span> </td> <td class="center"> <?php echo $language; ?> </td> <td class="center"> <?php echo $client; ?> </td> </tr> <?php $i++; endforeach; ?> </tbody> </table> <div> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </div> </form> PK���\%����Kadministrator/templates/hathor/html/com_languages/installed/default_ftp.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <fieldset class="adminform" title="<?php echo JText::_('COM_LANGUAGES_FTP_TITLE'); ?>"> <legend><?php echo JText::_('COM_LANGUAGES_FTP_TITLE'); ?></legend> <?php echo JText::_('COM_LANGUAGES_FTP_DESC'); ?> <?php if ($ftp instanceof Exception) : ?> <p class="warning"><?php echo JText::_($ftp->message); ?></p> <?php endif; ?> <div> <label for="username"><?php echo JText::_('JGLOBAL_USERNAME'); ?></label> <input type="text" id="username" name="username" value="" /> </div> <div> <label for="password"><?php echo JText::_('JGLOBAL_PASSWORD'); ?></label> <input type="password" id="password" name="password" value="" /> </div> </fieldset> PK���\�&�F��Gadministrator/templates/hathor/html/com_languages/installed/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtmlBehavior::core(); // Add specific helper files for html generation JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); $user = JFactory::getUser(); $userId = $user->get('id'); $client = $this->state->get('filter.client_id', 0) ? JText::_('JADMINISTRATOR') : JText::_('JSITE'); $clientId = $this->state->get('filter.client_id', 0); ?> <form action="<?php echo JRoute::_('index.php?option=com_languages&view=installed&client='.$clientId); ?>" method="post" id="adminForm" name="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <?php if ($this->ftp) : ?> <?php echo $this->loadTemplate('ftp');?> <?php endif; ?> <table class="adminlist"> <thead> <tr> <th class="checkmark-col">   </th> <th class="title"> <?php echo JText::_('COM_LANGUAGES_HEADING_LANGUAGE'); ?> </th> <th> <?php echo JText::_('COM_LANGUAGES_FIELD_LANG_TAG_LABEL'); ?> </th> <th class="width-10"> <?php echo JText::_('JCLIENT'); ?> </th> <th class="width-5"> <?php echo JText::_('COM_LANGUAGES_HEADING_DEFAULT'); ?> </th> <th class="width-10"> <?php echo JText::_('JVERSION'); ?> </th> <th class="width-10"> <?php echo JText::_('JDATE'); ?> </th> <th class="width-20"> <?php echo JText::_('JAUTHOR'); ?> </th> <th class="width-25"> <?php echo JText::_('COM_LANGUAGES_HEADING_AUTHOR_EMAIL'); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->rows as $i => $row) : $canCreate = $user->authorise('core.create', 'com_languages'); $canEdit = $user->authorise('core.edit', 'com_languages'); $canChange = $user->authorise('core.edit.state', 'com_languages'); ?> <tr class="row<?php echo $i % 2; ?>"> <td> <?php echo JHtml::_('languages.id', $i, $row->language);?> </td> <td> <?php echo $this->escape($row->name); ?> </td> <td align="center"> <?php echo $this->escape($row->language); ?> </td> <td class="center"> <?php echo $client;?> </td> <td class="center"> <?php echo JHtml::_('jgrid.isdefault', $row->published, $i, 'installed.', !$row->published && $canChange);?> </td> <td class="center"> <?php echo $this->escape($row->version); ?> </td> <td class="center"> <?php echo $this->escape($row->creationDate); ?> </td> <td class="center"> <?php echo $this->escape($row->author); ?> </td> <td class="center"> <?php echo JStringPunycode::emailToUTF8($this->escape($row->authorEmail)); ?> </td> </tr> <?php endforeach;?> </tbody> </table> <?php echo $this->pagination->getListFooter(); ?> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <?php echo JHtml::_('form.token'); ?> </div> </form> PK���\.Q��(�(Iadministrator/templates/hathor/html/com_categories/categories/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::_('behavior.multiselect'); $app = JFactory::getApplication(); $user = JFactory::getUser(); $userId = $user->get('id'); $extension = $this->escape($this->state->get('filter.extension')); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $ordering = ($listOrder == 'a.lft'); $saveOrder = ($listOrder == 'a.lft' && $listDirn == 'asc'); ?> <div class="categories"> <form action="<?php echo JRoute::_('index.php?option=com_categories&view=categories'); ?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty($this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <?php endif; ?> <div id="j-main-container"<?php echo !empty($this->sidebar) ? ' class="span10"' : ''; ?>> <fieldset id="filter-bar"> <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend> <div class="filter-search"> <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_CATEGORIES_ITEMS_SEARCH_FILTER'); ?>" /> <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="filter-select"> <label class="selectlabel" for="filter_level"><?php echo JText::_('JOPTION_SELECT_MAX_LEVELS'); ?></label> <select name="filter_level" id="filter_level"> <option value=""><?php echo JText::_('JOPTION_SELECT_MAX_LEVELS'); ?></option> <?php echo JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level')); ?> </select> <label class="selectlabel" for="filter_published"><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></label> <select name="filter_published" id="filter_published"> <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true); ?> </select> <label class="selectlabel" for="filter_access"><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></label> <select name="filter_access" id="filter_access"> <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')); ?> </select> <label class="selectlabel" for="filter_language"><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></label> <select name="filter_language" id="filter_language"> <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')); ?> </select> <label class="selectlabel" for="filter_tag"><?php echo JText::_('JOPTION_SELECT_TAG'); ?></label> <select name="filter_tag" id="filter_tag"> <option value=""><?php echo JText::_('JOPTION_SELECT_TAG'); ?></option> <?php echo JHtml::_('select.options', JHtml::_('tag.options', true, true), 'value', 'text', $this->state->get('filter.tag')); ?> </select> <button type="submit" id="filter-go"> <?php echo JText::_('JSUBMIT'); ?></button> </div> </fieldset> <div class="clr"></div> <table class="adminlist"> <thead> <tr> <th class="checkmark-col"> <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /> </th> <th class="title"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?> </th> <th class="nowrap state-col"> <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?> </th> <th class="nowrap ordering-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ORDERING', 'a.lft', $listDirn, $listOrder); ?> <?php if ($saveOrder) : ?> <?php echo JHtml::_('grid.order', $this->items, 'filesave.png', 'categories.saveorder'); ?> <?php endif; ?> </th> <th class="access-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?> </th> <?php if ($this->assoc) : ?> <th width="5%"> <?php echo JHtml::_('grid.sort', 'COM_CATEGORY_HEADING_ASSOCIATION', 'association', $listDirn, $listOrder); ?> </th> <?php endif; ?> <th class="language-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?> </th> <th class="nowrap id-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->items as $i => $item) : ?> <?php $orderkey = array_search($item->id, $this->ordering[$item->parent_id]); $canEdit = $user->authorise('core.edit', $extension . '.category.' . $item->id); $canCheckin = $user->authorise('core.admin', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; $canEditOwn = $user->authorise('core.edit.own', $extension . '.category.' . $item->id) && $item->created_user_id == $userId; $canChange = $user->authorise('core.edit.state', $extension . '.category.' . $item->id) && $canCheckin; ?> <tr class="row<?php echo $i % 2; ?>"> <th class="center"> <?php echo JHtml::_('grid.id', $i, $item->id); ?> </th> <td> <?php echo str_repeat('<span class="gi">|—</span>', $item->level - 1) ?> <?php if ($item->checked_out) : ?> <?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'categories.', $canCheckin); ?> <?php endif; ?> <?php if ($canEdit || $canEditOwn) : ?> <a href="<?php echo JRoute::_('index.php?option=com_categories&task=category.edit&id=' . $item->id . '&extension=' . $extension); ?>"> <?php echo $this->escape($item->title); ?></a> <?php else : ?> <?php echo $this->escape($item->title); ?> <?php endif; ?> <p class="smallsub" title="<?php echo $this->escape($item->path); ?>"> <?php echo str_repeat('<span class="gtr">|—</span>', $item->level - 1) ?> <?php if (empty($item->note)) : ?> <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?> <?php else : ?> <?php echo JText::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note)); ?> <?php endif; ?></p> </td> <td class="center"> <?php echo JHtml::_('jgrid.published', $item->published, $i, 'categories.', $canChange); ?> </td> <td class="order"> <?php if ($canChange) : ?> <?php if ($saveOrder) : ?> <span><?php echo $this->pagination->orderUpIcon($i, isset($this->ordering[$item->parent_id][$orderkey - 1]), 'categories.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?></span> <span><?php echo $this->pagination->orderDownIcon($i, $this->pagination->total, isset($this->ordering[$item->parent_id][$orderkey + 1]), 'categories.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?></span> <?php endif; ?> <?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?> <input type="text" name="order[]" value="<?php echo $orderkey + 1; ?>" <?php echo $disabled ?> class="text-area-order" title="<?php echo $item->title; ?> order" /> <?php else : ?> <?php echo $orderkey + 1; ?> <?php endif; ?> </td> <td class="center"> <?php echo $this->escape($item->access_level); ?> </td> <?php if ($this->assoc) : ?> <td class="center"> <?php if ($item->association): ?> <?php echo JHtml::_('CategoriesAdministrator.association', $item->id, $extension); ?> <?php endif; ?> </td> <?php endif; ?> <td class="center nowrap"> <?php if ($item->language == '*'): ?> <?php echo JText::alt('JALL', 'language'); ?> <?php else: ?> <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> <?php endif; ?> </td> <td class="center"> <span title="<?php echo sprintf('%d-%d', $item->lft, $item->rgt); ?>"> <?php echo (int) $item->id; ?></span> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php echo $this->pagination->getListFooter(); ?> <div class="clr"></div> <?php //Load the batch processing form. ?> <?php if ($user->authorise('core.create', $extension) && $user->authorise('core.edit', $extension) && $user->authorise('core.edit.state', $extension)) : ?> <?php echo JHtml::_( 'bootstrap.renderModal', 'collapseModal', array( 'title' => JText::_('COM_CATEGORIES_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') ); ?> <?php endif; ?> <input type="hidden" name="extension" value="<?php echo $extension; ?>" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> </div> PK���\��<��Ladministrator/templates/hathor/html/com_categories/category/edit_options.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <?php echo JHtml::_('sliders.panel', JText::_('JGLOBAL_FIELDSET_PUBLISHING'), 'publishing-details'); ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_('COM_CONTENT_FIELDSET_PUBLISHING'); ?></legend> <ul class="adminformlist"> <li> <?php echo $this->form->getLabel('created_user_id'); ?> <?php echo $this->form->getInput('created_user_id'); ?> </li> <?php if ((int) $this->item->created_time) : ?> <li> <?php echo $this->form->getLabel('created_time'); ?> <?php echo $this->form->getInput('created_time'); ?> </li> <?php endif; ?> <?php if ($this->item->modified_user_id) : ?> <li> <?php echo $this->form->getLabel('modified_user_id'); ?> <?php echo $this->form->getInput('modified_user_id'); ?> </li> <li> <?php echo $this->form->getLabel('modified_time'); ?> <?php echo $this->form->getInput('modified_time'); ?> </li> <?php endif; ?> </ul> </fieldset> <?php $fieldSets = $this->form->getFieldsets('params'); ?> <?php foreach ($fieldSets as $name => $fieldSet) : ?> <?php $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_CATEGORIES_' . $name . '_FIELDSET_LABEL'; echo JHtml::_('sliders.panel', JText::_($label), $name . '-options'); if (isset($fieldSet->description) && trim($fieldSet->description)) { echo '<p class="tip">' . $this->escape(JText::_($fieldSet->description)) . '</p>'; } ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_($label); ?></legend> <ul class="adminformlist"> <?php foreach ($this->form->getFieldset($name) as $field) : ?> <li> <?php echo $field->label; ?> <?php echo $field->input; ?> </li> <?php endforeach; ?> <?php if ($name == 'basic'): ?> <li> <?php echo $this->form->getLabel('note'); ?> <?php echo $this->form->getInput('note'); ?> </li> <?php endif; ?> </ul> </fieldset> <?php endforeach; ?> PK���\���{��Dadministrator/templates/hathor/html/com_categories/category/edit.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); $input = JFactory::getApplication()->input; $saveHistory = $this->state->get('params')->get('save_history', 0); JHtml::_('behavior.keepalive'); JHtml::_('behavior.formvalidator'); JFactory::getDocument()->addScriptDeclaration(" Joomla.submitbutton = function(task) { if (task == 'category.cancel' || document.formvalidator.isValid(document.getElementById('item-form'))) { " . $this->form->getField('description')->save() . " Joomla.submitform(task, document.getElementById('item-form')); } } "); $assoc = JLanguageAssociations::isEnabled(); ?> <div class="category-edit"> <form action="<?php echo JRoute::_('index.php?option=com_categories&extension=' . $input->getCmd('extension', 'com_content') . '&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="item-form" class="form-validate"> <div class="col main-section"> <fieldset class="adminform"> <legend><?php echo JText::_('COM_CATEGORIES_FIELDSET_DETAILS'); ?></legend> <ul class="adminformlist"> <li> <?php echo $this->form->getLabel('title'); ?> <?php echo $this->form->getInput('title'); ?> </li> <li> <?php echo $this->form->getLabel('alias'); ?> <?php echo $this->form->getInput('alias'); ?> </li> <li> <?php echo $this->form->getLabel('extension'); ?> <?php echo $this->form->getInput('extension'); ?> </li> <li> <?php echo $this->form->getLabel('parent_id'); ?> <?php echo $this->form->getInput('parent_id'); ?> </li> <li> <?php echo $this->form->getLabel('published'); ?> <?php echo $this->form->getInput('published'); ?> </li> <li> <?php echo $this->form->getLabel('access'); ?> <?php echo $this->form->getInput('access'); ?> </li> <?php if ($this->canDo->get('core.admin')) : ?> <li> <span class="faux-label"><?php echo JText::_('JGLOBAL_ACTION_PERMISSIONS_LABEL'); ?></span> <button type="button" onclick="document.location.href='#access-rules';"> <?php echo JText::_('JGLOBAL_PERMISSIONS_ANCHOR'); ?></button> </li> <?php endif; ?> <li> <?php echo $this->form->getLabel('language'); ?> <?php echo $this->form->getInput('language'); ?> </li> <!-- Tag field --> <li> <?php if ($this->checkTags) : ?> <?php echo $this->form->getLabel('tags'); ?> <div class="is-tagbox"> <?php echo $this->form->getInput('tags'); ?> </div> <?php endif; ?> </li> <?php if ($saveHistory) : ?> <li><?php echo $this->form->getLabel('version_note'); ?> <?php echo $this->form->getInput('version_note'); ?></li> <?php endif; ?> <li> <?php echo $this->form->getLabel('id'); ?> <?php echo $this->form->getInput('id'); ?> </li> <li> <?php echo $this->form->getLabel('hits'); ?> <?php echo $this->form->getInput('hits'); ?> </li> </ul> <div class="clr"></div> <?php echo $this->form->getLabel('description'); ?> <div class="clr"></div> <?php echo $this->form->getInput('description'); ?> <div class="clr"></div> </fieldset> </div> <div class="col options-section"> <?php echo JHtml::_('sliders.start', 'categories-sliders-' . $this->item->id, array('useCookie' => 1)); ?> <?php echo $this->loadTemplate('options'); ?> <div class="clr"></div> <?php echo JHtml::_('sliders.panel', JText::_('JGLOBAL_FIELDSET_METADATA_OPTIONS'), 'meta-options'); ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_('JGLOBAL_FIELDSET_METADATA_OPTIONS'); ?></legend> <?php echo $this->loadTemplate('metadata'); ?> </fieldset> <?php $fieldSets = $this->form->getFieldsets('attribs'); ?> <?php foreach ($fieldSets as $name => $fieldSet) : ?> <?php if ($name != 'editorConfig' && $name != 'basic-limited') : ?> <?php $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_CATEGORIES_' . $name . '_FIELDSET_LABEL'; echo JHtml::_('sliders.panel', JText::_($label), $name . '-options'); if (isset($fieldSet->description) && trim($fieldSet->description)) { echo '<p class="tip">' . $this->escape(JText::_($fieldSet->description)) . '</p>'; } ?> <div class="clr"></div> <fieldset class="panelform"> <ul class="adminformlist"> <?php foreach ($this->form->getFieldset($name) as $field) : ?> <li> <?php echo $field->label; ?> <?php echo $field->input; ?> </li> <?php endforeach; ?> </ul> </fieldset> <?php endif; ?> <?php endforeach; ?> <?php if ($assoc) : ?> <?php echo JHtml::_('sliders.panel', JText::_('COM_CATEGORIES_ITEM_ASSOCIATIONS_FIELDSET_LABEL'), '-options');?> <?php echo $this->loadTemplate('associations'); ?> <?php endif; ?> <?php echo JHtml::_('sliders.end'); ?> </div> <div class="clr"></div> <?php if ($this->canDo->get('core.admin')) : ?> <div class="col rules-section"> <?php echo JHtml::_('sliders.start', 'permissions-sliders-' . $this->item->id, array('useCookie' => 1)); ?> <?php echo JHtml::_('sliders.panel', JText::_('COM_CATEGORIES_FIELDSET_RULES'), 'access-rules'); ?> <fieldset class="panelform"> <legend class="element-invisible"><?php echo JText::_('COM_CATEGORIES_FIELDSET_RULES'); ?></legend> <?php echo $this->form->getLabel('rules'); ?> <?php echo $this->form->getInput('rules'); ?> </fieldset> <?php echo JHtml::_('sliders.end'); ?> </div> <?php endif; ?> <div> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </div> </form> <div class="clr"></div> </div> PK���\/�z Gadministrator/templates/hathor/html/com_templates/templates/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('bootstrap.tooltip'); JHtml::_('behavior.multiselect'); $user = JFactory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> <form action="<?php echo JRoute::_('index.php?option=com_templates&view=templates'); ?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <fieldset id="filter-bar"> <legend class="element-invisible"><?php echo JText::_('Filters'); ?></legend> <div class="filter-search"> <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_TEMPLATES_TEMPLATES_FILTER_SEARCH_DESC'); ?>" /> <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="filter-select"> <label class="selectlabel" for="filter_client_id"> <?php echo JText::_('JGLOBAL_FILTER_CLIENT'); ?> </label> <select name="filter_client_id" id="filter_client_id"> <option value="*"><?php echo JText::_('JGLOBAL_FILTER_CLIENT'); ?></option> <?php echo JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'));?> </select> <button type="submit" id="filter-go"> <?php echo JText::_('JSUBMIT'); ?></button> </div> </fieldset> <div class="clr"> </div> <table class="adminlist" id="template-mgr"> <thead> <tr> <th class="checkmark-col">   </th> <th> <?php echo JHtml::_('grid.sort', 'COM_TEMPLATES_HEADING_TEMPLATE', 'a.element', $listDirn, $listOrder); ?> </th> <th class="width-10"> <?php echo JHtml::_('grid.sort', 'JCLIENT', 'a.client_id', $listDirn, $listOrder); ?> </th> <th class="center width-10"> <?php echo JText::_('JVERSION'); ?> </th> <th class="width-15"> <?php echo JText::_('JDATE'); ?> </th> <th class="width-25"> <?php echo JText::_('JAUTHOR'); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->items as $i => $item) : ?> <tr class="row<?php echo $i % 2; ?>"> <td class="center"> <?php echo JHtml::_('templates.thumb', $item->element, $item->client_id); ?> </td> <td class="template-name"> <a href="<?php echo JRoute::_('index.php?option=com_templates&view=template&id='.(int) $item->extension_id . '&file=' . $this->file); ?>"> <?php echo JText::sprintf('COM_TEMPLATES_TEMPLATE_DETAILS', $item->name); ?></a> <p> <?php if ($this->preview && $item->client_id == '0') : ?> <a href="<?php echo JUri::root().'index.php?tp=1&template='.$item->element; ?>" target="_blank"> <?php echo JText::_('COM_TEMPLATES_TEMPLATE_PREVIEW'); ?></a> <?php elseif ($item->client_id == '1') : ?> <?php echo JText::_('COM_TEMPLATES_TEMPLATE_NO_PREVIEW_ADMIN'); ?> <?php else: ?> <span class="hasTooltip" title="<?php echo JHtml::tooltipText('COM_TEMPLATES_TEMPLATE_NO_PREVIEW', 'COM_TEMPLATES_TEMPLATE_NO_PREVIEW_DESC'); ?>"> <?php echo JText::_('COM_TEMPLATES_TEMPLATE_NO_PREVIEW'); ?></span> <?php endif; ?> </p> </td> <td class="center"> <?php echo $item->client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?> </td> <td class="center"> <?php echo $this->escape($item->xmldata->get('version')); ?> </td> <td class="center"> <?php echo $this->escape($item->xmldata->get('creationDate')); ?> </td> <td> <?php if ($author = $item->xmldata->get('author')) : ?> <p><?php echo $this->escape($author); ?></p> <?php else : ?> — <?php endif; ?> <?php if ($email = $item->xmldata->get('authorEmail')) : ?> <p><?php echo $this->escape($email); ?></p> <?php endif; ?> <?php if ($url = $item->xmldata->get('authorUrl')) : ?> <p><a href="<?php echo $this->escape($url); ?>"> <?php echo $this->escape($url); ?></a></p> <?php endif; ?> </td> <?php echo JHtml::_('templates.thumbModal', $item->element, $item->client_id); ?> </tr> <?php endforeach; ?> </tbody> </table> <?php echo $this->pagination->getListFooter(); ?> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> PK���\�/M��Kadministrator/templates/hathor/html/com_templates/style/edit_assignment.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage com_templates * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Initiasile related data. require_once JPATH_ADMINISTRATOR.'/components/com_menus/helpers/menus.php'; $menuTypes = MenusHelper::getMenuLinks(); $user = JFactory::getUser(); ?> <fieldset class="adminform"> <legend><?php echo JText::_('COM_TEMPLATES_MENUS_ASSIGNMENT'); ?></legend> <label id="jform_menuselect-lbl" for="jform_menuselect"><?php echo JText::_('JGLOBAL_MENU_SELECTION'); ?></label> <button type="button" class="jform-rightbtn" onclick="$$('.chk-menulink').each(function(el) { el.checked = !el.checked; });"> <?php echo JText::_('JGLOBAL_SELECTION_INVERT_ALL'); ?> </button> <div class="clr"></div> <div id="menu-assignment"> <?php foreach ($menuTypes as &$type) : ?> <ul class="menu-links"> <button type="button" class="jform-rightbtn" onclick="$$('.<?php echo $type->menutype; ?>').each(function(el) { el.checked = !el.checked; });"> <?php echo JText::_('JGLOBAL_SELECTION_INVERT'); ?> </button> <div class="clr"></div> <h3><?php echo $type->title ? $type->title : $type->menutype; ?></h3> <?php foreach ($type->links as $link) : ?> <li class="menu-link"> <input type="checkbox" name="jform[assigned][]" value="<?php echo (int) $link->value;?>" id="link<?php echo (int) $link->value;?>"<?php if ($link->template_style_id == $this->item->id):?> checked="checked"<?php endif;?><?php if ($link->checked_out && $link->checked_out != $user->id):?> disabled="disabled"<?php else:?> class="chk-menulink <?php echo $type->menutype; ?>"<?php endif;?> /> <label for="link<?php echo (int) $link->value;?>" > <?php echo $link->text; ?> </label> </li> <?php endforeach; ?> </ul> <?php endforeach; ?> </div> </fieldset> PK���\��p�""Hadministrator/templates/hathor/html/com_templates/style/edit_options.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage com_templates * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; $fieldSets = $this->form->getFieldsets('params'); foreach ($fieldSets as $name => $fieldSet) : $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_TEMPLATES_'.$name.'_FIELDSET_LABEL'; echo JHtml::_('sliders.panel', JText::_($label), $name.'-options'); if (isset($fieldSet->description) && trim($fieldSet->description)) : echo '<p class="tip">'.$this->escape(JText::_($fieldSet->description)).'</p>'; endif; ?> <fieldset class="panelform"> <ul class="adminformlist"> <?php foreach ($this->form->getFieldset($name) as $field) : ?> <li> <?php if (!$field->hidden) : ?> <?php echo $field->label; ?> <?php endif; ?> <?php echo $field->input; ?> </li> <?php endforeach; ?> </ul> </fieldset> <?php endforeach; ?> PK���\��fZ��@administrator/templates/hathor/html/com_templates/style/edit.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage com_templates * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); $user = JFactory::getUser(); JFactory::getDocument()->addScriptDeclaration(" Joomla.submitbutton = function(task) { if (task == 'style.cancel' || document.formvalidator.isValid(document.getElementById('style-form'))) { Joomla.submitform(task, document.getElementById('style-form')); } } "); ?> <form action="<?php echo JRoute::_('index.php?option=com_templates&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="style-form" class="form-validate"> <div class="width-60 fltlft"> <fieldset class="adminform"> <legend><?php echo JText::_('JDETAILS');?></legend> <ul class="adminformlist"> <li><?php echo $this->form->getLabel('title'); ?> <?php echo $this->form->getInput('title'); ?></li> <li><?php echo $this->form->getLabel('template'); ?> <?php echo $this->form->getInput('template'); ?> <?php echo $this->form->getLabel('client_id'); ?> <?php echo $this->form->getInput('client_id'); ?> <input type="text" size="35" value="<?php echo $this->item->client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?> " class="readonly" readonly="readonly" /></li> <li><?php echo $this->form->getLabel('home'); ?> <?php echo $this->form->getInput('home'); ?></li> <?php if ($this->item->id) : ?> <li><?php echo $this->form->getLabel('id'); ?> <span class="readonly"><?php echo $this->item->id; ?></span></li> <?php endif; ?> </ul> <div class="clr"></div> <?php if ($this->item->xml) : ?> <?php if ($text = trim($this->item->xml->description)) : ?> <label> <?php echo JText::_('COM_TEMPLATES_TEMPLATE_DESCRIPTION'); ?> </label> <span class="readonly mod-desc"><?php echo JText::_($text); ?></span> <?php endif; ?> <?php else : ?> <p class="error"><?php echo JText::_('COM_TEMPLATES_ERR_XML'); ?></p> <?php endif; ?> <div class="clr"></div> </fieldset> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </div> <div class="width-40 fltrt"> <?php echo JHtml::_('sliders.start', 'template-sliders-'.$this->item->id); ?> <?php //get the menu parameters that are automatically set but may be modified. echo $this->loadTemplate('options'); ?> <div class="clr"></div> <?php echo JHtml::_('sliders.end'); ?> </div> <?php if ($user->authorise('core.edit', 'com_menu') && $this->item->client_id == 0):?> <?php if ($this->canDo->get('core.edit.state')) : ?> <div class="width-60 fltlft"> <?php echo $this->loadTemplate('assignment'); ?> </div> <?php endif; ?> <?php endif;?> <div class="clr"></div> </form> PK���\G�LLDadministrator/templates/hathor/html/com_templates/styles/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage Template.hathor * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('bootstrap.tooltip'); JHtml::_('script', 'system/multiselect.js', false, true); $user = JFactory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> <form action="<?php echo JRoute::_('index.php?option=com_templates&view=styles'); ?>" method="post" name="adminForm" id="adminForm"> <?php if (!empty( $this->sidebar)) : ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif;?> <fieldset id="filter-bar"> <legend class="element-invisible"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></legend> <div class="filter-search"> <label class="filter-search-lbl" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_TEMPLATES_STYLES_FILTER_SEARCH_DESC'); ?>" /> <button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="filter-select"> <label class="selectlabel" for="filter_template"><?php echo JText::_('COM_TEMPLATES_FILTER_TEMPLATE'); ?></label> <select name="filter_template" id="filter_template"> <option value="0"><?php echo JText::_('COM_TEMPLATES_FILTER_TEMPLATE'); ?></option> <?php echo JHtml::_('select.options', TemplatesHelper::getTemplateOptions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.template'));?> </select> <label class="selectlabel" for="filter_client_id"><?php echo JText::_('JGLOBAL_FILTER_CLIENT'); ?></label> <select name="filter_client_id" id="filter_client_id"> <option value="*"><?php echo JText::_('JGLOBAL_FILTER_CLIENT'); ?></option> <?php echo JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'));?> </select> <button type="submit" id="filter-go"> <?php echo JText::_('JSUBMIT'); ?></button> </div> </fieldset> <div class="clr"> </div> <table class="adminlist"> <thead> <tr> <th class="checkmark-col">   </th> <th> <?php echo JHtml::_('grid.sort', 'COM_TEMPLATES_HEADING_STYLE', 'a.title', $listDirn, $listOrder); ?> </th> <th class="width-10"> <?php echo JHtml::_('grid.sort', 'JCLIENT', 'a.client_id', $listDirn, $listOrder); ?> </th> <th> <?php echo JHtml::_('grid.sort', 'COM_TEMPLATES_HEADING_TEMPLATE', 'a.template', $listDirn, $listOrder); ?> </th> <th class="width-5"> <?php echo JHtml::_('grid.sort', 'COM_TEMPLATES_HEADING_DEFAULT', 'a.home', $listDirn, $listOrder); ?> </th> <th class="width-5"> <?php echo JText::_('COM_TEMPLATES_HEADING_ASSIGNED'); ?> </th> <th class="nowrap id-col"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> </th> </tr> </thead> <tbody> <?php foreach ($this->items as $i => $item) : $canCreate = $user->authorise('core.create', 'com_templates'); $canEdit = $user->authorise('core.edit', 'com_templates'); $canChange = $user->authorise('core.edit.state', 'com_templates'); ?> <tr class="row<?php echo $i % 2; ?>"> <td class="center"> <?php echo JHtml::_('grid.id', $i, $item->id); ?> </td> <td> <?php if ($this->preview && $item->client_id == '0') : ?> <a target="_blank" href="<?php echo JUri::root().'index.php?tp=1&templateStyle='.(int) $item->id ?>" class="jgrid hasTooltip" title="<?php echo JHtml::tooltipText(JText::_('COM_TEMPLATES_TEMPLATE_PREVIEW'), $item->title, 0); ?>" ><span class="state icon-16-preview"><span class="text"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_PREVIEW'); ?></span></span></a> <?php elseif ($item->client_id == '1') : ?> <span class="jgrid hasTooltip" title="<?php echo JHtml::tooltipText('COM_TEMPLATES_TEMPLATE_NO_PREVIEW_ADMIN'); ?>"><span class="state icon-16-nopreview"><span class="text"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_NO_PREVIEW_ADMIN'); ?></span></span></span> <?php else: ?> <span class="jgrid hasTooltip" title="<?php echo JHtml::tooltipText('COM_TEMPLATES_TEMPLATE_NO_PREVIEW'); ?>"><span class="state icon-16-nopreview"><span class="text"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_NO_PREVIEW'); ?></span></span></span> <?php endif; ?> <?php if ($canEdit) : ?> <a href="<?php echo JRoute::_('index.php?option=com_templates&task=style.edit&id='.(int) $item->id); ?>"> <?php echo $this->escape($item->title);?></a> <?php else : ?> <?php echo $this->escape($item->title);?> <?php endif; ?> </td> <td class="center"> <?php echo $item->client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?> </td> <td> <label for="cb<?php echo $i;?>"> <?php echo $this->escape($item->template);?> </label> </td> <td class="center"> <?php if ($item->home == '0' || $item->home == '1'):?> <?php echo JHtml::_('jgrid.isdefault', $item->home != '0', $i, 'styles.', $canChange && $item->home != '1');?> <?php elseif ($canChange):?> <a href="<?php echo JRoute::_('index.php?option=com_templates&task=styles.unsetDefault&cid[]='.$item->id.'&'.JSession::getFormToken().'=1');?>"> <?php echo JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title)), true);?> </a> <?php else:?> <?php echo JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true);?> <?php endif;?> </td> <td class="center"> <?php if ($item->assigned > 0) : ?> <?php echo JHtml::_('image', 'admin/tick.png', JText::plural('COM_TEMPLATES_ASSIGNED', $item->assigned), array('title' => JText::plural('COM_TEMPLATES_ASSIGNED', $item->assigned)), true); ?> <?php else : ?>   <?php endif; ?> </td> <td class="center"> <?php echo (int) $item->id; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php echo $this->pagination->getListFooter(); ?> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form> PK���\S��OORadministrator/templates/hathor/html/com_templates/template/default_description.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage com_templates * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ?> <div class="pull-left"> <?php echo JHtml::_('templates.thumb', $this->template->element, $this->template->client_id); ?> <?php echo JHtml::_('templates.thumbModal', $this->template->element, $this->template->client_id); ?> </div> <h2><?php echo ucfirst($this->template->element); ?></h2> <?php $client = JApplicationHelper::getClientInfo($this->template->client_id); ?> <p><?php $this->template->xmldata = TemplatesHelper::parseXMLTemplateFile($client->path, $this->template->element);?></p> <p><?php echo JText::_($this->template->xmldata->description); ?></p>PK���\g�j���Kadministrator/templates/hathor/html/com_templates/template/default_tree.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage com_templates * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; ksort($this->files, SORT_STRING); ?> <ul class='nav nav-list directory-tree'> <?php foreach ($this->files as $key => $value): ?> <?php if (is_array($value)): ?> <?php $keyArray = explode('/', $key); $fileArray = explode('/', $this->fileName); $count = 0; if (count($fileArray) >= count($keyArray)) { for ($i = 0; $i < count($keyArray); $i++) { if ($keyArray[$i] === $fileArray[$i]) { $count++; } } if ($count == count($keyArray)) { $class = "folder show"; } else { $class = "folder"; } } else { $class = "folder"; } ?> <li class="<?php echo $class; ?>"> <a class='folder-url nowrap' href=''> <span class='icon-folder-close'> <?php $explodeArray = explode('/', $key); echo end($explodeArray); ?></span> </a> <?php echo $this->directoryTree($value); ?> </li> <?php endif; ?> <?php if (is_object($value)): ?> <li> <a class="file nowrap" href='<?php echo JRoute::_('index.php?option=com_templates&view=template&id=' . $this->id . '&file=' . $value->id) ?>'> <span class='icon-file'> <?php echo $value->name; ?></span> </a> </li> <?php endif; ?> <?php endforeach; ?> </ul> PK���\*�PPFadministrator/templates/hathor/html/com_templates/template/default.phpnu�[���<?php /** * @package Joomla.Administrator * @subpackage com_templates * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('bootstrap.tooltip'); $input = JFactory::getApplication()->input; if ($this->type == 'image') { JHtml::_('script', 'system/jquery.Jcrop.min.js', false, true); JHtml::_('stylesheet', 'system/jquery.Jcrop.min.css', array(), true); } JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function($){ // Hide all the folder when the page loads $('.folder ul, .component-folder ul').hide(); // Display the tree after loading $('.directory-tree').removeClass('directory-tree'); // Show all the lists in the path of an open file $('.show > ul').show(); // Stop the default action of anchor tag on a click event $('.folder-url, .component-folder-url').click(function(event){ event.preventDefault(); }); // Prevent the click event from proliferating $('.file, .component-file-url').bind('click',function(e){ e.stopPropagation(); }); // Toggle the child indented list on a click event $('.folder, .component-folder').bind('click',function(e){ $(this).children('ul').toggle(); e.stopPropagation(); }); // New file tree $('#fileModal .folder-url').bind('click',function(e){ $('.folder-url').removeClass('selected'); e.stopPropagation(); $('#fileModal input.address').val($(this).attr('data-id')); $(this).addClass('selected'); }); // Folder manager tree $('#folderModal .folder-url').bind('click',function(e){ $('.folder-url').removeClass('selected'); e.stopPropagation(); $('#folderModal input.address').val($(this).attr('data-id')); $(this).addClass('selected'); }); });"); if($this->type == 'image') { JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function() { var jcrop_api; // Configuration for image cropping $('#image-crop').Jcrop({ onChange: showCoords, onSelect: showCoords, onRelease: clearCoords, trueSize: " . $this->image['width'] . "," . $this->image['height'] . "] },function(){ jcrop_api = this; }); // Function for calculating the crop coordinates function showCoords(c) { $('#x').val(c.x); $('#y').val(c.y); $('#w').val(c.w); $('#h').val(c.h); }; // Function for clearing the coordinates function clearCoords() { $('#adminForm input').val(''); }; });"); } JFactory::getDocument()->addStyleDeclaration(" /* Styles for modals */ .selected{ background: #08c; color: #fff; } .selected:hover{ background: #08c !important; color: #fff; } .modal-body .column { width: 50%; float: left; } #deleteFolder{ margin: 0; } #image-crop{ max-width: 100% !important; width: auto; height: auto; } .directory-tree{ display: none; } .tree-holder{ overflow-x: auto; } "); if($this->type == 'font') { JFactory::getDocument()->addStyleDeclaration( "/* Styles for font preview */ @font-face { font-family: previewFont; src: url('" . $this->font['address'] . "') } .font-preview{ font-family: previewFont !important; }" ); } ?> <div class="width-60 fltlft"> <?php if ($this->type != 'home'): ?> <div id="deleteModal" class="modal hide fade"> <fieldset> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3><?php echo JText::_('COM_TEMPLATES_ARE_YOU_SURE');?></h3> </div> <div class="modal-body"> <p><?php echo JText::sprintf('COM_TEMPLATES_MODAL_FILE_DELETE', $this->fileName); ?></p> </div> <div class="modal-footer"> <form method="post" action=""> <input type="hidden" name="option" value="com_templates" /> <input type="hidden" name="task" value="template.delete" /> <input type="hidden" name="id" value="<? echo $input->getInt('id'); ?>" /> <input type="hidden" name="file" value="<? echo $this->file; ?>" /> <?php echo JHtml::_('form.token'); ?> <a href="#" class="btn" data-dismiss="modal"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></a> <button type="submit"><?php echo JText::_('COM_TEMPLATES_BUTTON_DELETE');?></button> </form> </div> </fieldset> </div> <?php endif; ?> <div id="folderModal" class="modal hide fade"> <fieldset> <legend><?php echo JText::_('COM_TEMPLATES_MANAGE_FOLDERS');?></legend> <div class="modal-body"> <div class="width-50 fltlft"> <form method="post" action="<?php echo JRoute::_('index.php?option=com_templates&task=template.createFolder&id=' . $input->getInt('id') . '&file=' . $this->file); ?>"> <fieldset> <label><?php echo JText::_('COM_TEMPLATES_FOLDER_NAME');?></label> <input type="text" name="name" required /> <input type="hidden" class="address" name="address" /> <input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_CREATE');?>" class="btn btn-primary" /> </fieldset> </form> </div> <div class="width-50 fltlft"> <?php echo $this->loadTemplate('folders');?> </div> </div> <div class="modal-footer"> <form id="deleteFolder" method="post" action="<?php echo JRoute::_('index.php?option=com_templates&task=template.deleteFolder&id=' . $input->getInt('id') . '&file=' . $this->file); ?>"> <fieldset> <a href="#" class="btn" data-dismiss="modal"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></a> <input type="hidden" class="address" name="address" /> <input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_DELETE');?>" class="btn btn-danger" /> </fieldset> </form> </div> </fieldset> </div> <div id="fileModal" class="modal hide fade"> <fieldset> <legend><?php echo JText::_('COM_TEMPLATES_BUTTON_FILE');?></legend> <div class="modal-body"> <div class="width-50 fltlft"> <form method="post" action="<?php echo JRoute::_('index.php?option=com_templates&task=template.createFile&id=' . $input->getInt('id') . '&file=' . $this->file); ?>"> <fieldset> <label><?php echo JText::_('COM_TEMPLATES_NEW_FILE_TYPE');?></label> <select name="type" required > <option value="null">- <?php echo JText::_('COM_TEMPLATES_NEW_FILE_SELECT');?> -</option> <option value="css">css</option> <option value="php">php</option> <option value="js">js</option> <option value="xml">xml</option> <option value="ini">ini</option> <option value="less">less</option> <option value="txt">txt</option> </select> <br /> <label><?php echo JText::_('COM_TEMPLATES_FILE_NAME');?></label> <input type="text" name="name" required /> <input type="hidden" class="address" name="address" /> <input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_CREATE');?>" class="btn btn-primary" /> </fieldset> </form> <br /> <form method="post" action="<?php echo JRoute::_('index.php?option=com_templates&task=template.uploadFile&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" enctype="multipart/form-data" > <fieldset> <input type="hidden" class="address" name="address" /> <input type="file" name="files" required /> <input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_UPLOAD');?>" class="btn btn-primary" /> </fieldset> </form> <br /> <?php if ($this->type != 'home'): ?> <form method="post" action="<?php echo JRoute::_('index.php?option=com_templates&task=template.copyFile&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" enctype="multipart/form-data" > <fieldset> <input type="hidden" class="address" name="address" /> <div class="control-group"> <label for="new_name" class="control-label hasTooltip" title="<?php echo JHtml::tooltipText('COM_TEMPLATES_FILE_NEW_NAME_DESC'); ?>"><?php echo JText::_('COM_TEMPLATES_FILE_NEW_NAME_LABEL')?></label> <div class="controls"> <input type="text" id="new_name" name="new_name" required /> </div> </div> <input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_COPY_FILE');?>" class="btn btn-primary" /> </fieldset> </form> <?php endif; ?> </div> <div class="width-50 fltlft"> <?php echo $this->loadTemplate('folders');?> </div> </div> <div class="modal-footer"> <a href="#" class="btn" data-dismiss="modal"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></a> </div> </fieldset> </div> <?php if ($this->type != 'home'): ?> <form action="<?php echo JRoute::_('index.php?option=com_templates&task=template.resizeImage&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" method="post" > <div id="resizeModal" class="modal hide fade"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3><?php echo JText::_('COM_TEMPLATES_RESIZE_IMAGE'); ?></h3> </div> <div class="modal-body"> <div id="template-manager-css" class="form-horizontal"> <div class="control-group"> <label for="height" class="control-label hasTooltip" title="<?php echo JHtml::tooltipText('COM_TEMPLATES_IMAGE_HEIGHT'); ?>"><?php echo JText::_('COM_TEMPLATES_IMAGE_HEIGHT')?></label> <div class="controls"> <input class="input-xlarge" type="number" name="height" placeholder="<?php echo $this->image['height']; ?> px" required /> </div> <br /> <label for="width" class="control-label hasTooltip" title="<?php echo JHtml::tooltipText('COM_TEMPLATES_IMAGE_WIDTH'); ?>"><?php echo JText::_('COM_TEMPLATES_IMAGE_WIDTH')?></label> <div class="controls"> <input class="input-xlarge" type="number" name="width" placeholder="<?php echo $this->image['width']; ?> px" required /> </div> </div> </div> </div> <div class="modal-footer"> <a href="#" class="btn" data-dismiss="modal"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></a> <button class="btn btn-primary" type="submit"><?php echo JText::_('COM_TEMPLATES_BUTTON_RESIZE'); ?></button> </div> </div> <?php echo JHtml::_('form.token'); ?> </form> <?php endif; ?> <?php if($this->type == 'home'): ?> <form action="<?php echo JRoute::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" method="post" name="adminForm" id="adminForm" class="form-horizontal"> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> <div id="home-box" style="text-align: justify;"> <h1><p><?php echo JText::_('COM_TEMPLATES_HOME_HEADING'); ?></p></h1> <p><?php echo JText::_('COM_TEMPLATES_HOME_TEXT'); ?></p> <p> <a href="https://docs.joomla.org/J3.2:How_to_use_the_Template_Manager" target="_blank"> <?php echo JText::_('COM_TEMPLATES_HOME_BUTTON'); ?> </a> </p> </div> </form> <?php endif; ?> <?php if($this->type == 'file'): ?> <form action="<?php echo JRoute::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" method="post" name="adminForm" id="adminForm" class="form-horizontal"> <fieldset class="adminform"> <legend><?php echo JText::_('COM_TEMPLATES_SOURCE_CODE');?></legend> <p class="label"><?php echo JText::_('COM_TEMPLATES_TOGGLE_FULL_SCREEN'); ?></p> <div class="clr"></div> <div class="editor-border"> <?php echo $this->form->getInput('source'); ?> </div> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> <?php echo $this->form->getInput('extension_id'); ?> <?php echo $this->form->getInput('filename'); ?> </fieldset> </form> <?php endif; ?> <?php if($this->